google_cloud_deploy_v1/model.rs
1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17#![allow(rustdoc::redundant_explicit_links)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![no_implicit_prelude]
20extern crate async_trait;
21extern crate bytes;
22extern crate gaxi;
23extern crate google_cloud_gax;
24extern crate google_cloud_iam_v1;
25extern crate google_cloud_location;
26extern crate google_cloud_longrunning;
27extern crate google_cloud_lro;
28extern crate google_cloud_type;
29extern crate serde;
30extern crate serde_json;
31extern crate serde_with;
32extern crate std;
33extern crate tracing;
34extern crate wkt;
35
36mod debug;
37mod deserialize;
38mod serialize;
39
40/// Payload proto for "clouddeploy.googleapis.com/automation"
41/// Platform Log event that describes the Automation related events.
42#[derive(Clone, Default, PartialEq)]
43#[non_exhaustive]
44pub struct AutomationEvent {
45 /// Debug message for when there is an update on the AutomationRun.
46 /// Provides further details about the resource creation or state change.
47 pub message: std::string::String,
48
49 /// The name of the `AutomationRun`.
50 pub automation: std::string::String,
51
52 /// Unique identifier of the `DeliveryPipeline`.
53 pub pipeline_uid: std::string::String,
54
55 /// Type of this notification, e.g. for a Pub/Sub failure.
56 pub r#type: crate::model::Type,
57
58 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
59}
60
61impl AutomationEvent {
62 pub fn new() -> Self {
63 std::default::Default::default()
64 }
65
66 /// Sets the value of [message][crate::model::AutomationEvent::message].
67 ///
68 /// # Example
69 /// ```ignore,no_run
70 /// # use google_cloud_deploy_v1::model::AutomationEvent;
71 /// let x = AutomationEvent::new().set_message("example");
72 /// ```
73 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
74 self.message = v.into();
75 self
76 }
77
78 /// Sets the value of [automation][crate::model::AutomationEvent::automation].
79 ///
80 /// # Example
81 /// ```ignore,no_run
82 /// # use google_cloud_deploy_v1::model::AutomationEvent;
83 /// let x = AutomationEvent::new().set_automation("example");
84 /// ```
85 pub fn set_automation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
86 self.automation = v.into();
87 self
88 }
89
90 /// Sets the value of [pipeline_uid][crate::model::AutomationEvent::pipeline_uid].
91 ///
92 /// # Example
93 /// ```ignore,no_run
94 /// # use google_cloud_deploy_v1::model::AutomationEvent;
95 /// let x = AutomationEvent::new().set_pipeline_uid("example");
96 /// ```
97 pub fn set_pipeline_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
98 self.pipeline_uid = v.into();
99 self
100 }
101
102 /// Sets the value of [r#type][crate::model::AutomationEvent::type].
103 ///
104 /// # Example
105 /// ```ignore,no_run
106 /// # use google_cloud_deploy_v1::model::AutomationEvent;
107 /// use google_cloud_deploy_v1::model::Type;
108 /// let x0 = AutomationEvent::new().set_type(Type::PubsubNotificationFailure);
109 /// let x1 = AutomationEvent::new().set_type(Type::ResourceStateChange);
110 /// let x2 = AutomationEvent::new().set_type(Type::ProcessAborted);
111 /// ```
112 pub fn set_type<T: std::convert::Into<crate::model::Type>>(mut self, v: T) -> Self {
113 self.r#type = v.into();
114 self
115 }
116}
117
118impl wkt::message::Message for AutomationEvent {
119 fn typename() -> &'static str {
120 "type.googleapis.com/google.cloud.deploy.v1.AutomationEvent"
121 }
122}
123
124/// Payload proto for "clouddeploy.googleapis.com/automation_run"
125/// Platform Log event that describes the AutomationRun related events.
126#[derive(Clone, Default, PartialEq)]
127#[non_exhaustive]
128pub struct AutomationRunEvent {
129 /// Debug message for when there is an update on the AutomationRun.
130 /// Provides further details about the resource creation or state change.
131 pub message: std::string::String,
132
133 /// The name of the `AutomationRun`.
134 pub automation_run: std::string::String,
135
136 /// Unique identifier of the `DeliveryPipeline`.
137 pub pipeline_uid: std::string::String,
138
139 /// Identifier of the `Automation`.
140 pub automation_id: std::string::String,
141
142 /// Identifier of the `Automation` rule.
143 pub rule_id: std::string::String,
144
145 /// ID of the `Target` to which the `AutomationRun` is created.
146 pub destination_target_id: std::string::String,
147
148 /// Type of this notification, e.g. for a Pub/Sub failure.
149 pub r#type: crate::model::Type,
150
151 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
152}
153
154impl AutomationRunEvent {
155 pub fn new() -> Self {
156 std::default::Default::default()
157 }
158
159 /// Sets the value of [message][crate::model::AutomationRunEvent::message].
160 ///
161 /// # Example
162 /// ```ignore,no_run
163 /// # use google_cloud_deploy_v1::model::AutomationRunEvent;
164 /// let x = AutomationRunEvent::new().set_message("example");
165 /// ```
166 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
167 self.message = v.into();
168 self
169 }
170
171 /// Sets the value of [automation_run][crate::model::AutomationRunEvent::automation_run].
172 ///
173 /// # Example
174 /// ```ignore,no_run
175 /// # use google_cloud_deploy_v1::model::AutomationRunEvent;
176 /// let x = AutomationRunEvent::new().set_automation_run("example");
177 /// ```
178 pub fn set_automation_run<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
179 self.automation_run = v.into();
180 self
181 }
182
183 /// Sets the value of [pipeline_uid][crate::model::AutomationRunEvent::pipeline_uid].
184 ///
185 /// # Example
186 /// ```ignore,no_run
187 /// # use google_cloud_deploy_v1::model::AutomationRunEvent;
188 /// let x = AutomationRunEvent::new().set_pipeline_uid("example");
189 /// ```
190 pub fn set_pipeline_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
191 self.pipeline_uid = v.into();
192 self
193 }
194
195 /// Sets the value of [automation_id][crate::model::AutomationRunEvent::automation_id].
196 ///
197 /// # Example
198 /// ```ignore,no_run
199 /// # use google_cloud_deploy_v1::model::AutomationRunEvent;
200 /// let x = AutomationRunEvent::new().set_automation_id("example");
201 /// ```
202 pub fn set_automation_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
203 self.automation_id = v.into();
204 self
205 }
206
207 /// Sets the value of [rule_id][crate::model::AutomationRunEvent::rule_id].
208 ///
209 /// # Example
210 /// ```ignore,no_run
211 /// # use google_cloud_deploy_v1::model::AutomationRunEvent;
212 /// let x = AutomationRunEvent::new().set_rule_id("example");
213 /// ```
214 pub fn set_rule_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
215 self.rule_id = v.into();
216 self
217 }
218
219 /// Sets the value of [destination_target_id][crate::model::AutomationRunEvent::destination_target_id].
220 ///
221 /// # Example
222 /// ```ignore,no_run
223 /// # use google_cloud_deploy_v1::model::AutomationRunEvent;
224 /// let x = AutomationRunEvent::new().set_destination_target_id("example");
225 /// ```
226 pub fn set_destination_target_id<T: std::convert::Into<std::string::String>>(
227 mut self,
228 v: T,
229 ) -> Self {
230 self.destination_target_id = v.into();
231 self
232 }
233
234 /// Sets the value of [r#type][crate::model::AutomationRunEvent::type].
235 ///
236 /// # Example
237 /// ```ignore,no_run
238 /// # use google_cloud_deploy_v1::model::AutomationRunEvent;
239 /// use google_cloud_deploy_v1::model::Type;
240 /// let x0 = AutomationRunEvent::new().set_type(Type::PubsubNotificationFailure);
241 /// let x1 = AutomationRunEvent::new().set_type(Type::ResourceStateChange);
242 /// let x2 = AutomationRunEvent::new().set_type(Type::ProcessAborted);
243 /// ```
244 pub fn set_type<T: std::convert::Into<crate::model::Type>>(mut self, v: T) -> Self {
245 self.r#type = v.into();
246 self
247 }
248}
249
250impl wkt::message::Message for AutomationRunEvent {
251 fn typename() -> &'static str {
252 "type.googleapis.com/google.cloud.deploy.v1.AutomationRunEvent"
253 }
254}
255
256/// A `DeliveryPipeline` resource in the Cloud Deploy API.
257///
258/// A `DeliveryPipeline` defines a pipeline through which a Skaffold
259/// configuration can progress.
260#[derive(Clone, Default, PartialEq)]
261#[non_exhaustive]
262pub struct DeliveryPipeline {
263 /// Identifier. Name of the `DeliveryPipeline`. Format is
264 /// `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}`.
265 /// The `deliveryPipeline` component must match
266 /// `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`
267 pub name: std::string::String,
268
269 /// Output only. Unique identifier of the `DeliveryPipeline`.
270 pub uid: std::string::String,
271
272 /// Optional. Description of the `DeliveryPipeline`. Max length is 255
273 /// characters.
274 pub description: std::string::String,
275
276 /// Optional. User annotations. These attributes can only be set and used by
277 /// the user, and not by Cloud Deploy.
278 pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
279
280 /// Labels are attributes that can be set and used by both the
281 /// user and by Cloud Deploy. Labels must meet the following constraints:
282 ///
283 /// * Keys and values can contain only lowercase letters, numeric characters,
284 /// underscores, and dashes.
285 /// * All characters must use UTF-8 encoding, and international characters are
286 /// allowed.
287 /// * Keys must start with a lowercase letter or international character.
288 /// * Each resource is limited to a maximum of 64 labels.
289 ///
290 /// Both keys and values are additionally constrained to be <= 128 bytes.
291 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
292
293 /// Output only. Time at which the pipeline was created.
294 pub create_time: std::option::Option<wkt::Timestamp>,
295
296 /// Output only. Most recent time at which the pipeline was updated.
297 pub update_time: std::option::Option<wkt::Timestamp>,
298
299 /// Output only. Information around the state of the Delivery Pipeline.
300 pub condition: std::option::Option<crate::model::PipelineCondition>,
301
302 /// This checksum is computed by the server based on the value of other
303 /// fields, and may be sent on update and delete requests to ensure the
304 /// client has an up-to-date value before proceeding.
305 pub etag: std::string::String,
306
307 /// Optional. When suspended, no new releases or rollouts can be created,
308 /// but in-progress ones will complete.
309 pub suspended: bool,
310
311 /// The ordering configuration of the `DeliveryPipeline`.
312 pub pipeline: std::option::Option<crate::model::delivery_pipeline::Pipeline>,
313
314 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
315}
316
317impl DeliveryPipeline {
318 pub fn new() -> Self {
319 std::default::Default::default()
320 }
321
322 /// Sets the value of [name][crate::model::DeliveryPipeline::name].
323 ///
324 /// # Example
325 /// ```ignore,no_run
326 /// # use google_cloud_deploy_v1::model::DeliveryPipeline;
327 /// let x = DeliveryPipeline::new().set_name("example");
328 /// ```
329 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
330 self.name = v.into();
331 self
332 }
333
334 /// Sets the value of [uid][crate::model::DeliveryPipeline::uid].
335 ///
336 /// # Example
337 /// ```ignore,no_run
338 /// # use google_cloud_deploy_v1::model::DeliveryPipeline;
339 /// let x = DeliveryPipeline::new().set_uid("example");
340 /// ```
341 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
342 self.uid = v.into();
343 self
344 }
345
346 /// Sets the value of [description][crate::model::DeliveryPipeline::description].
347 ///
348 /// # Example
349 /// ```ignore,no_run
350 /// # use google_cloud_deploy_v1::model::DeliveryPipeline;
351 /// let x = DeliveryPipeline::new().set_description("example");
352 /// ```
353 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
354 self.description = v.into();
355 self
356 }
357
358 /// Sets the value of [annotations][crate::model::DeliveryPipeline::annotations].
359 ///
360 /// # Example
361 /// ```ignore,no_run
362 /// # use google_cloud_deploy_v1::model::DeliveryPipeline;
363 /// let x = DeliveryPipeline::new().set_annotations([
364 /// ("key0", "abc"),
365 /// ("key1", "xyz"),
366 /// ]);
367 /// ```
368 pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
369 where
370 T: std::iter::IntoIterator<Item = (K, V)>,
371 K: std::convert::Into<std::string::String>,
372 V: std::convert::Into<std::string::String>,
373 {
374 use std::iter::Iterator;
375 self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
376 self
377 }
378
379 /// Sets the value of [labels][crate::model::DeliveryPipeline::labels].
380 ///
381 /// # Example
382 /// ```ignore,no_run
383 /// # use google_cloud_deploy_v1::model::DeliveryPipeline;
384 /// let x = DeliveryPipeline::new().set_labels([
385 /// ("key0", "abc"),
386 /// ("key1", "xyz"),
387 /// ]);
388 /// ```
389 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
390 where
391 T: std::iter::IntoIterator<Item = (K, V)>,
392 K: std::convert::Into<std::string::String>,
393 V: std::convert::Into<std::string::String>,
394 {
395 use std::iter::Iterator;
396 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
397 self
398 }
399
400 /// Sets the value of [create_time][crate::model::DeliveryPipeline::create_time].
401 ///
402 /// # Example
403 /// ```ignore,no_run
404 /// # use google_cloud_deploy_v1::model::DeliveryPipeline;
405 /// use wkt::Timestamp;
406 /// let x = DeliveryPipeline::new().set_create_time(Timestamp::default()/* use setters */);
407 /// ```
408 pub fn set_create_time<T>(mut self, v: T) -> Self
409 where
410 T: std::convert::Into<wkt::Timestamp>,
411 {
412 self.create_time = std::option::Option::Some(v.into());
413 self
414 }
415
416 /// Sets or clears the value of [create_time][crate::model::DeliveryPipeline::create_time].
417 ///
418 /// # Example
419 /// ```ignore,no_run
420 /// # use google_cloud_deploy_v1::model::DeliveryPipeline;
421 /// use wkt::Timestamp;
422 /// let x = DeliveryPipeline::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
423 /// let x = DeliveryPipeline::new().set_or_clear_create_time(None::<Timestamp>);
424 /// ```
425 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
426 where
427 T: std::convert::Into<wkt::Timestamp>,
428 {
429 self.create_time = v.map(|x| x.into());
430 self
431 }
432
433 /// Sets the value of [update_time][crate::model::DeliveryPipeline::update_time].
434 ///
435 /// # Example
436 /// ```ignore,no_run
437 /// # use google_cloud_deploy_v1::model::DeliveryPipeline;
438 /// use wkt::Timestamp;
439 /// let x = DeliveryPipeline::new().set_update_time(Timestamp::default()/* use setters */);
440 /// ```
441 pub fn set_update_time<T>(mut self, v: T) -> Self
442 where
443 T: std::convert::Into<wkt::Timestamp>,
444 {
445 self.update_time = std::option::Option::Some(v.into());
446 self
447 }
448
449 /// Sets or clears the value of [update_time][crate::model::DeliveryPipeline::update_time].
450 ///
451 /// # Example
452 /// ```ignore,no_run
453 /// # use google_cloud_deploy_v1::model::DeliveryPipeline;
454 /// use wkt::Timestamp;
455 /// let x = DeliveryPipeline::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
456 /// let x = DeliveryPipeline::new().set_or_clear_update_time(None::<Timestamp>);
457 /// ```
458 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
459 where
460 T: std::convert::Into<wkt::Timestamp>,
461 {
462 self.update_time = v.map(|x| x.into());
463 self
464 }
465
466 /// Sets the value of [condition][crate::model::DeliveryPipeline::condition].
467 ///
468 /// # Example
469 /// ```ignore,no_run
470 /// # use google_cloud_deploy_v1::model::DeliveryPipeline;
471 /// use google_cloud_deploy_v1::model::PipelineCondition;
472 /// let x = DeliveryPipeline::new().set_condition(PipelineCondition::default()/* use setters */);
473 /// ```
474 pub fn set_condition<T>(mut self, v: T) -> Self
475 where
476 T: std::convert::Into<crate::model::PipelineCondition>,
477 {
478 self.condition = std::option::Option::Some(v.into());
479 self
480 }
481
482 /// Sets or clears the value of [condition][crate::model::DeliveryPipeline::condition].
483 ///
484 /// # Example
485 /// ```ignore,no_run
486 /// # use google_cloud_deploy_v1::model::DeliveryPipeline;
487 /// use google_cloud_deploy_v1::model::PipelineCondition;
488 /// let x = DeliveryPipeline::new().set_or_clear_condition(Some(PipelineCondition::default()/* use setters */));
489 /// let x = DeliveryPipeline::new().set_or_clear_condition(None::<PipelineCondition>);
490 /// ```
491 pub fn set_or_clear_condition<T>(mut self, v: std::option::Option<T>) -> Self
492 where
493 T: std::convert::Into<crate::model::PipelineCondition>,
494 {
495 self.condition = v.map(|x| x.into());
496 self
497 }
498
499 /// Sets the value of [etag][crate::model::DeliveryPipeline::etag].
500 ///
501 /// # Example
502 /// ```ignore,no_run
503 /// # use google_cloud_deploy_v1::model::DeliveryPipeline;
504 /// let x = DeliveryPipeline::new().set_etag("example");
505 /// ```
506 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
507 self.etag = v.into();
508 self
509 }
510
511 /// Sets the value of [suspended][crate::model::DeliveryPipeline::suspended].
512 ///
513 /// # Example
514 /// ```ignore,no_run
515 /// # use google_cloud_deploy_v1::model::DeliveryPipeline;
516 /// let x = DeliveryPipeline::new().set_suspended(true);
517 /// ```
518 pub fn set_suspended<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
519 self.suspended = v.into();
520 self
521 }
522
523 /// Sets the value of [pipeline][crate::model::DeliveryPipeline::pipeline].
524 ///
525 /// Note that all the setters affecting `pipeline` are mutually
526 /// exclusive.
527 ///
528 /// # Example
529 /// ```ignore,no_run
530 /// # use google_cloud_deploy_v1::model::DeliveryPipeline;
531 /// use google_cloud_deploy_v1::model::SerialPipeline;
532 /// let x = DeliveryPipeline::new().set_pipeline(Some(
533 /// google_cloud_deploy_v1::model::delivery_pipeline::Pipeline::SerialPipeline(SerialPipeline::default().into())));
534 /// ```
535 pub fn set_pipeline<
536 T: std::convert::Into<std::option::Option<crate::model::delivery_pipeline::Pipeline>>,
537 >(
538 mut self,
539 v: T,
540 ) -> Self {
541 self.pipeline = v.into();
542 self
543 }
544
545 /// The value of [pipeline][crate::model::DeliveryPipeline::pipeline]
546 /// if it holds a `SerialPipeline`, `None` if the field is not set or
547 /// holds a different branch.
548 pub fn serial_pipeline(
549 &self,
550 ) -> std::option::Option<&std::boxed::Box<crate::model::SerialPipeline>> {
551 #[allow(unreachable_patterns)]
552 self.pipeline.as_ref().and_then(|v| match v {
553 crate::model::delivery_pipeline::Pipeline::SerialPipeline(v) => {
554 std::option::Option::Some(v)
555 }
556 _ => std::option::Option::None,
557 })
558 }
559
560 /// Sets the value of [pipeline][crate::model::DeliveryPipeline::pipeline]
561 /// to hold a `SerialPipeline`.
562 ///
563 /// Note that all the setters affecting `pipeline` are
564 /// mutually exclusive.
565 ///
566 /// # Example
567 /// ```ignore,no_run
568 /// # use google_cloud_deploy_v1::model::DeliveryPipeline;
569 /// use google_cloud_deploy_v1::model::SerialPipeline;
570 /// let x = DeliveryPipeline::new().set_serial_pipeline(SerialPipeline::default()/* use setters */);
571 /// assert!(x.serial_pipeline().is_some());
572 /// ```
573 pub fn set_serial_pipeline<
574 T: std::convert::Into<std::boxed::Box<crate::model::SerialPipeline>>,
575 >(
576 mut self,
577 v: T,
578 ) -> Self {
579 self.pipeline = std::option::Option::Some(
580 crate::model::delivery_pipeline::Pipeline::SerialPipeline(v.into()),
581 );
582 self
583 }
584}
585
586impl wkt::message::Message for DeliveryPipeline {
587 fn typename() -> &'static str {
588 "type.googleapis.com/google.cloud.deploy.v1.DeliveryPipeline"
589 }
590}
591
592/// Defines additional types related to [DeliveryPipeline].
593pub mod delivery_pipeline {
594 #[allow(unused_imports)]
595 use super::*;
596
597 /// The ordering configuration of the `DeliveryPipeline`.
598 #[derive(Clone, Debug, PartialEq)]
599 #[non_exhaustive]
600 pub enum Pipeline {
601 /// Optional. SerialPipeline defines a sequential set of stages for a
602 /// `DeliveryPipeline`.
603 SerialPipeline(std::boxed::Box<crate::model::SerialPipeline>),
604 }
605}
606
607/// SerialPipeline defines a sequential set of stages for a `DeliveryPipeline`.
608#[derive(Clone, Default, PartialEq)]
609#[non_exhaustive]
610pub struct SerialPipeline {
611 /// Optional. Each stage specifies configuration for a `Target`. The ordering
612 /// of this list defines the promotion flow.
613 pub stages: std::vec::Vec<crate::model::Stage>,
614
615 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
616}
617
618impl SerialPipeline {
619 pub fn new() -> Self {
620 std::default::Default::default()
621 }
622
623 /// Sets the value of [stages][crate::model::SerialPipeline::stages].
624 ///
625 /// # Example
626 /// ```ignore,no_run
627 /// # use google_cloud_deploy_v1::model::SerialPipeline;
628 /// use google_cloud_deploy_v1::model::Stage;
629 /// let x = SerialPipeline::new()
630 /// .set_stages([
631 /// Stage::default()/* use setters */,
632 /// Stage::default()/* use (different) setters */,
633 /// ]);
634 /// ```
635 pub fn set_stages<T, V>(mut self, v: T) -> Self
636 where
637 T: std::iter::IntoIterator<Item = V>,
638 V: std::convert::Into<crate::model::Stage>,
639 {
640 use std::iter::Iterator;
641 self.stages = v.into_iter().map(|i| i.into()).collect();
642 self
643 }
644}
645
646impl wkt::message::Message for SerialPipeline {
647 fn typename() -> &'static str {
648 "type.googleapis.com/google.cloud.deploy.v1.SerialPipeline"
649 }
650}
651
652/// Stage specifies a location to which to deploy.
653#[derive(Clone, Default, PartialEq)]
654#[non_exhaustive]
655pub struct Stage {
656 /// Optional. The target_id to which this stage points. This field refers
657 /// exclusively to the last segment of a target name. For example, this field
658 /// would just be `my-target` (rather than
659 /// `projects/project/locations/location/targets/my-target`). The location of
660 /// the `Target` is inferred to be the same as the location of the
661 /// `DeliveryPipeline` that contains this `Stage`.
662 pub target_id: std::string::String,
663
664 /// Optional. Skaffold profiles to use when rendering the manifest for this
665 /// stage's `Target`.
666 pub profiles: std::vec::Vec<std::string::String>,
667
668 /// Optional. The strategy to use for a `Rollout` to this stage.
669 pub strategy: std::option::Option<crate::model::Strategy>,
670
671 /// Optional. The deploy parameters to use for the target in this stage.
672 pub deploy_parameters: std::vec::Vec<crate::model::DeployParameters>,
673
674 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
675}
676
677impl Stage {
678 pub fn new() -> Self {
679 std::default::Default::default()
680 }
681
682 /// Sets the value of [target_id][crate::model::Stage::target_id].
683 ///
684 /// # Example
685 /// ```ignore,no_run
686 /// # use google_cloud_deploy_v1::model::Stage;
687 /// let x = Stage::new().set_target_id("example");
688 /// ```
689 pub fn set_target_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
690 self.target_id = v.into();
691 self
692 }
693
694 /// Sets the value of [profiles][crate::model::Stage::profiles].
695 ///
696 /// # Example
697 /// ```ignore,no_run
698 /// # use google_cloud_deploy_v1::model::Stage;
699 /// let x = Stage::new().set_profiles(["a", "b", "c"]);
700 /// ```
701 pub fn set_profiles<T, V>(mut self, v: T) -> Self
702 where
703 T: std::iter::IntoIterator<Item = V>,
704 V: std::convert::Into<std::string::String>,
705 {
706 use std::iter::Iterator;
707 self.profiles = v.into_iter().map(|i| i.into()).collect();
708 self
709 }
710
711 /// Sets the value of [strategy][crate::model::Stage::strategy].
712 ///
713 /// # Example
714 /// ```ignore,no_run
715 /// # use google_cloud_deploy_v1::model::Stage;
716 /// use google_cloud_deploy_v1::model::Strategy;
717 /// let x = Stage::new().set_strategy(Strategy::default()/* use setters */);
718 /// ```
719 pub fn set_strategy<T>(mut self, v: T) -> Self
720 where
721 T: std::convert::Into<crate::model::Strategy>,
722 {
723 self.strategy = std::option::Option::Some(v.into());
724 self
725 }
726
727 /// Sets or clears the value of [strategy][crate::model::Stage::strategy].
728 ///
729 /// # Example
730 /// ```ignore,no_run
731 /// # use google_cloud_deploy_v1::model::Stage;
732 /// use google_cloud_deploy_v1::model::Strategy;
733 /// let x = Stage::new().set_or_clear_strategy(Some(Strategy::default()/* use setters */));
734 /// let x = Stage::new().set_or_clear_strategy(None::<Strategy>);
735 /// ```
736 pub fn set_or_clear_strategy<T>(mut self, v: std::option::Option<T>) -> Self
737 where
738 T: std::convert::Into<crate::model::Strategy>,
739 {
740 self.strategy = v.map(|x| x.into());
741 self
742 }
743
744 /// Sets the value of [deploy_parameters][crate::model::Stage::deploy_parameters].
745 ///
746 /// # Example
747 /// ```ignore,no_run
748 /// # use google_cloud_deploy_v1::model::Stage;
749 /// use google_cloud_deploy_v1::model::DeployParameters;
750 /// let x = Stage::new()
751 /// .set_deploy_parameters([
752 /// DeployParameters::default()/* use setters */,
753 /// DeployParameters::default()/* use (different) setters */,
754 /// ]);
755 /// ```
756 pub fn set_deploy_parameters<T, V>(mut self, v: T) -> Self
757 where
758 T: std::iter::IntoIterator<Item = V>,
759 V: std::convert::Into<crate::model::DeployParameters>,
760 {
761 use std::iter::Iterator;
762 self.deploy_parameters = v.into_iter().map(|i| i.into()).collect();
763 self
764 }
765}
766
767impl wkt::message::Message for Stage {
768 fn typename() -> &'static str {
769 "type.googleapis.com/google.cloud.deploy.v1.Stage"
770 }
771}
772
773/// DeployParameters contains deploy parameters information.
774#[derive(Clone, Default, PartialEq)]
775#[non_exhaustive]
776pub struct DeployParameters {
777 /// Required. Values are deploy parameters in key-value pairs.
778 pub values: std::collections::HashMap<std::string::String, std::string::String>,
779
780 /// Optional. Deploy parameters are applied to targets with match labels.
781 /// If unspecified, deploy parameters are applied to all targets (including
782 /// child targets of a multi-target).
783 pub match_target_labels: std::collections::HashMap<std::string::String, std::string::String>,
784
785 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
786}
787
788impl DeployParameters {
789 pub fn new() -> Self {
790 std::default::Default::default()
791 }
792
793 /// Sets the value of [values][crate::model::DeployParameters::values].
794 ///
795 /// # Example
796 /// ```ignore,no_run
797 /// # use google_cloud_deploy_v1::model::DeployParameters;
798 /// let x = DeployParameters::new().set_values([
799 /// ("key0", "abc"),
800 /// ("key1", "xyz"),
801 /// ]);
802 /// ```
803 pub fn set_values<T, K, V>(mut self, v: T) -> Self
804 where
805 T: std::iter::IntoIterator<Item = (K, V)>,
806 K: std::convert::Into<std::string::String>,
807 V: std::convert::Into<std::string::String>,
808 {
809 use std::iter::Iterator;
810 self.values = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
811 self
812 }
813
814 /// Sets the value of [match_target_labels][crate::model::DeployParameters::match_target_labels].
815 ///
816 /// # Example
817 /// ```ignore,no_run
818 /// # use google_cloud_deploy_v1::model::DeployParameters;
819 /// let x = DeployParameters::new().set_match_target_labels([
820 /// ("key0", "abc"),
821 /// ("key1", "xyz"),
822 /// ]);
823 /// ```
824 pub fn set_match_target_labels<T, K, V>(mut self, v: T) -> Self
825 where
826 T: std::iter::IntoIterator<Item = (K, V)>,
827 K: std::convert::Into<std::string::String>,
828 V: std::convert::Into<std::string::String>,
829 {
830 use std::iter::Iterator;
831 self.match_target_labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
832 self
833 }
834}
835
836impl wkt::message::Message for DeployParameters {
837 fn typename() -> &'static str {
838 "type.googleapis.com/google.cloud.deploy.v1.DeployParameters"
839 }
840}
841
842/// Strategy contains deployment strategy information.
843#[derive(Clone, Default, PartialEq)]
844#[non_exhaustive]
845pub struct Strategy {
846 /// Deployment strategy details.
847 pub deployment_strategy: std::option::Option<crate::model::strategy::DeploymentStrategy>,
848
849 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
850}
851
852impl Strategy {
853 pub fn new() -> Self {
854 std::default::Default::default()
855 }
856
857 /// Sets the value of [deployment_strategy][crate::model::Strategy::deployment_strategy].
858 ///
859 /// Note that all the setters affecting `deployment_strategy` are mutually
860 /// exclusive.
861 ///
862 /// # Example
863 /// ```ignore,no_run
864 /// # use google_cloud_deploy_v1::model::Strategy;
865 /// use google_cloud_deploy_v1::model::Standard;
866 /// let x = Strategy::new().set_deployment_strategy(Some(
867 /// google_cloud_deploy_v1::model::strategy::DeploymentStrategy::Standard(Standard::default().into())));
868 /// ```
869 pub fn set_deployment_strategy<
870 T: std::convert::Into<std::option::Option<crate::model::strategy::DeploymentStrategy>>,
871 >(
872 mut self,
873 v: T,
874 ) -> Self {
875 self.deployment_strategy = v.into();
876 self
877 }
878
879 /// The value of [deployment_strategy][crate::model::Strategy::deployment_strategy]
880 /// if it holds a `Standard`, `None` if the field is not set or
881 /// holds a different branch.
882 pub fn standard(&self) -> std::option::Option<&std::boxed::Box<crate::model::Standard>> {
883 #[allow(unreachable_patterns)]
884 self.deployment_strategy.as_ref().and_then(|v| match v {
885 crate::model::strategy::DeploymentStrategy::Standard(v) => std::option::Option::Some(v),
886 _ => std::option::Option::None,
887 })
888 }
889
890 /// Sets the value of [deployment_strategy][crate::model::Strategy::deployment_strategy]
891 /// to hold a `Standard`.
892 ///
893 /// Note that all the setters affecting `deployment_strategy` are
894 /// mutually exclusive.
895 ///
896 /// # Example
897 /// ```ignore,no_run
898 /// # use google_cloud_deploy_v1::model::Strategy;
899 /// use google_cloud_deploy_v1::model::Standard;
900 /// let x = Strategy::new().set_standard(Standard::default()/* use setters */);
901 /// assert!(x.standard().is_some());
902 /// assert!(x.canary().is_none());
903 /// ```
904 pub fn set_standard<T: std::convert::Into<std::boxed::Box<crate::model::Standard>>>(
905 mut self,
906 v: T,
907 ) -> Self {
908 self.deployment_strategy = std::option::Option::Some(
909 crate::model::strategy::DeploymentStrategy::Standard(v.into()),
910 );
911 self
912 }
913
914 /// The value of [deployment_strategy][crate::model::Strategy::deployment_strategy]
915 /// if it holds a `Canary`, `None` if the field is not set or
916 /// holds a different branch.
917 pub fn canary(&self) -> std::option::Option<&std::boxed::Box<crate::model::Canary>> {
918 #[allow(unreachable_patterns)]
919 self.deployment_strategy.as_ref().and_then(|v| match v {
920 crate::model::strategy::DeploymentStrategy::Canary(v) => std::option::Option::Some(v),
921 _ => std::option::Option::None,
922 })
923 }
924
925 /// Sets the value of [deployment_strategy][crate::model::Strategy::deployment_strategy]
926 /// to hold a `Canary`.
927 ///
928 /// Note that all the setters affecting `deployment_strategy` are
929 /// mutually exclusive.
930 ///
931 /// # Example
932 /// ```ignore,no_run
933 /// # use google_cloud_deploy_v1::model::Strategy;
934 /// use google_cloud_deploy_v1::model::Canary;
935 /// let x = Strategy::new().set_canary(Canary::default()/* use setters */);
936 /// assert!(x.canary().is_some());
937 /// assert!(x.standard().is_none());
938 /// ```
939 pub fn set_canary<T: std::convert::Into<std::boxed::Box<crate::model::Canary>>>(
940 mut self,
941 v: T,
942 ) -> Self {
943 self.deployment_strategy =
944 std::option::Option::Some(crate::model::strategy::DeploymentStrategy::Canary(v.into()));
945 self
946 }
947}
948
949impl wkt::message::Message for Strategy {
950 fn typename() -> &'static str {
951 "type.googleapis.com/google.cloud.deploy.v1.Strategy"
952 }
953}
954
955/// Defines additional types related to [Strategy].
956pub mod strategy {
957 #[allow(unused_imports)]
958 use super::*;
959
960 /// Deployment strategy details.
961 #[derive(Clone, Debug, PartialEq)]
962 #[non_exhaustive]
963 pub enum DeploymentStrategy {
964 /// Optional. Standard deployment strategy executes a single deploy and
965 /// allows verifying the deployment.
966 Standard(std::boxed::Box<crate::model::Standard>),
967 /// Optional. Canary deployment strategy provides progressive percentage
968 /// based deployments to a Target.
969 Canary(std::boxed::Box<crate::model::Canary>),
970 }
971}
972
973/// Predeploy contains the predeploy job configuration information.
974#[derive(Clone, Default, PartialEq)]
975#[non_exhaustive]
976pub struct Predeploy {
977 /// Optional. A sequence of Skaffold custom actions to invoke during execution
978 /// of the predeploy job.
979 pub actions: std::vec::Vec<std::string::String>,
980
981 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
982}
983
984impl Predeploy {
985 pub fn new() -> Self {
986 std::default::Default::default()
987 }
988
989 /// Sets the value of [actions][crate::model::Predeploy::actions].
990 ///
991 /// # Example
992 /// ```ignore,no_run
993 /// # use google_cloud_deploy_v1::model::Predeploy;
994 /// let x = Predeploy::new().set_actions(["a", "b", "c"]);
995 /// ```
996 pub fn set_actions<T, V>(mut self, v: T) -> Self
997 where
998 T: std::iter::IntoIterator<Item = V>,
999 V: std::convert::Into<std::string::String>,
1000 {
1001 use std::iter::Iterator;
1002 self.actions = v.into_iter().map(|i| i.into()).collect();
1003 self
1004 }
1005}
1006
1007impl wkt::message::Message for Predeploy {
1008 fn typename() -> &'static str {
1009 "type.googleapis.com/google.cloud.deploy.v1.Predeploy"
1010 }
1011}
1012
1013/// Postdeploy contains the postdeploy job configuration information.
1014#[derive(Clone, Default, PartialEq)]
1015#[non_exhaustive]
1016pub struct Postdeploy {
1017 /// Optional. A sequence of Skaffold custom actions to invoke during execution
1018 /// of the postdeploy job.
1019 pub actions: std::vec::Vec<std::string::String>,
1020
1021 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1022}
1023
1024impl Postdeploy {
1025 pub fn new() -> Self {
1026 std::default::Default::default()
1027 }
1028
1029 /// Sets the value of [actions][crate::model::Postdeploy::actions].
1030 ///
1031 /// # Example
1032 /// ```ignore,no_run
1033 /// # use google_cloud_deploy_v1::model::Postdeploy;
1034 /// let x = Postdeploy::new().set_actions(["a", "b", "c"]);
1035 /// ```
1036 pub fn set_actions<T, V>(mut self, v: T) -> Self
1037 where
1038 T: std::iter::IntoIterator<Item = V>,
1039 V: std::convert::Into<std::string::String>,
1040 {
1041 use std::iter::Iterator;
1042 self.actions = v.into_iter().map(|i| i.into()).collect();
1043 self
1044 }
1045}
1046
1047impl wkt::message::Message for Postdeploy {
1048 fn typename() -> &'static str {
1049 "type.googleapis.com/google.cloud.deploy.v1.Postdeploy"
1050 }
1051}
1052
1053/// Standard represents the standard deployment strategy.
1054#[derive(Clone, Default, PartialEq)]
1055#[non_exhaustive]
1056pub struct Standard {
1057 /// Optional. Whether to verify a deployment via `skaffold verify`.
1058 pub verify: bool,
1059
1060 /// Optional. Configuration for the predeploy job. If this is not configured,
1061 /// the predeploy job will not be present.
1062 pub predeploy: std::option::Option<crate::model::Predeploy>,
1063
1064 /// Optional. Configuration for the postdeploy job. If this is not configured,
1065 /// the postdeploy job will not be present.
1066 pub postdeploy: std::option::Option<crate::model::Postdeploy>,
1067
1068 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1069}
1070
1071impl Standard {
1072 pub fn new() -> Self {
1073 std::default::Default::default()
1074 }
1075
1076 /// Sets the value of [verify][crate::model::Standard::verify].
1077 ///
1078 /// # Example
1079 /// ```ignore,no_run
1080 /// # use google_cloud_deploy_v1::model::Standard;
1081 /// let x = Standard::new().set_verify(true);
1082 /// ```
1083 pub fn set_verify<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1084 self.verify = v.into();
1085 self
1086 }
1087
1088 /// Sets the value of [predeploy][crate::model::Standard::predeploy].
1089 ///
1090 /// # Example
1091 /// ```ignore,no_run
1092 /// # use google_cloud_deploy_v1::model::Standard;
1093 /// use google_cloud_deploy_v1::model::Predeploy;
1094 /// let x = Standard::new().set_predeploy(Predeploy::default()/* use setters */);
1095 /// ```
1096 pub fn set_predeploy<T>(mut self, v: T) -> Self
1097 where
1098 T: std::convert::Into<crate::model::Predeploy>,
1099 {
1100 self.predeploy = std::option::Option::Some(v.into());
1101 self
1102 }
1103
1104 /// Sets or clears the value of [predeploy][crate::model::Standard::predeploy].
1105 ///
1106 /// # Example
1107 /// ```ignore,no_run
1108 /// # use google_cloud_deploy_v1::model::Standard;
1109 /// use google_cloud_deploy_v1::model::Predeploy;
1110 /// let x = Standard::new().set_or_clear_predeploy(Some(Predeploy::default()/* use setters */));
1111 /// let x = Standard::new().set_or_clear_predeploy(None::<Predeploy>);
1112 /// ```
1113 pub fn set_or_clear_predeploy<T>(mut self, v: std::option::Option<T>) -> Self
1114 where
1115 T: std::convert::Into<crate::model::Predeploy>,
1116 {
1117 self.predeploy = v.map(|x| x.into());
1118 self
1119 }
1120
1121 /// Sets the value of [postdeploy][crate::model::Standard::postdeploy].
1122 ///
1123 /// # Example
1124 /// ```ignore,no_run
1125 /// # use google_cloud_deploy_v1::model::Standard;
1126 /// use google_cloud_deploy_v1::model::Postdeploy;
1127 /// let x = Standard::new().set_postdeploy(Postdeploy::default()/* use setters */);
1128 /// ```
1129 pub fn set_postdeploy<T>(mut self, v: T) -> Self
1130 where
1131 T: std::convert::Into<crate::model::Postdeploy>,
1132 {
1133 self.postdeploy = std::option::Option::Some(v.into());
1134 self
1135 }
1136
1137 /// Sets or clears the value of [postdeploy][crate::model::Standard::postdeploy].
1138 ///
1139 /// # Example
1140 /// ```ignore,no_run
1141 /// # use google_cloud_deploy_v1::model::Standard;
1142 /// use google_cloud_deploy_v1::model::Postdeploy;
1143 /// let x = Standard::new().set_or_clear_postdeploy(Some(Postdeploy::default()/* use setters */));
1144 /// let x = Standard::new().set_or_clear_postdeploy(None::<Postdeploy>);
1145 /// ```
1146 pub fn set_or_clear_postdeploy<T>(mut self, v: std::option::Option<T>) -> Self
1147 where
1148 T: std::convert::Into<crate::model::Postdeploy>,
1149 {
1150 self.postdeploy = v.map(|x| x.into());
1151 self
1152 }
1153}
1154
1155impl wkt::message::Message for Standard {
1156 fn typename() -> &'static str {
1157 "type.googleapis.com/google.cloud.deploy.v1.Standard"
1158 }
1159}
1160
1161/// Canary represents the canary deployment strategy.
1162#[derive(Clone, Default, PartialEq)]
1163#[non_exhaustive]
1164pub struct Canary {
1165 /// Optional. Runtime specific configurations for the deployment strategy. The
1166 /// runtime configuration is used to determine how Cloud Deploy will split
1167 /// traffic to enable a progressive deployment.
1168 pub runtime_config: std::option::Option<crate::model::RuntimeConfig>,
1169
1170 /// The mode to use for the canary deployment strategy.
1171 pub mode: std::option::Option<crate::model::canary::Mode>,
1172
1173 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1174}
1175
1176impl Canary {
1177 pub fn new() -> Self {
1178 std::default::Default::default()
1179 }
1180
1181 /// Sets the value of [runtime_config][crate::model::Canary::runtime_config].
1182 ///
1183 /// # Example
1184 /// ```ignore,no_run
1185 /// # use google_cloud_deploy_v1::model::Canary;
1186 /// use google_cloud_deploy_v1::model::RuntimeConfig;
1187 /// let x = Canary::new().set_runtime_config(RuntimeConfig::default()/* use setters */);
1188 /// ```
1189 pub fn set_runtime_config<T>(mut self, v: T) -> Self
1190 where
1191 T: std::convert::Into<crate::model::RuntimeConfig>,
1192 {
1193 self.runtime_config = std::option::Option::Some(v.into());
1194 self
1195 }
1196
1197 /// Sets or clears the value of [runtime_config][crate::model::Canary::runtime_config].
1198 ///
1199 /// # Example
1200 /// ```ignore,no_run
1201 /// # use google_cloud_deploy_v1::model::Canary;
1202 /// use google_cloud_deploy_v1::model::RuntimeConfig;
1203 /// let x = Canary::new().set_or_clear_runtime_config(Some(RuntimeConfig::default()/* use setters */));
1204 /// let x = Canary::new().set_or_clear_runtime_config(None::<RuntimeConfig>);
1205 /// ```
1206 pub fn set_or_clear_runtime_config<T>(mut self, v: std::option::Option<T>) -> Self
1207 where
1208 T: std::convert::Into<crate::model::RuntimeConfig>,
1209 {
1210 self.runtime_config = v.map(|x| x.into());
1211 self
1212 }
1213
1214 /// Sets the value of [mode][crate::model::Canary::mode].
1215 ///
1216 /// Note that all the setters affecting `mode` are mutually
1217 /// exclusive.
1218 ///
1219 /// # Example
1220 /// ```ignore,no_run
1221 /// # use google_cloud_deploy_v1::model::Canary;
1222 /// use google_cloud_deploy_v1::model::CanaryDeployment;
1223 /// let x = Canary::new().set_mode(Some(
1224 /// google_cloud_deploy_v1::model::canary::Mode::CanaryDeployment(CanaryDeployment::default().into())));
1225 /// ```
1226 pub fn set_mode<T: std::convert::Into<std::option::Option<crate::model::canary::Mode>>>(
1227 mut self,
1228 v: T,
1229 ) -> Self {
1230 self.mode = v.into();
1231 self
1232 }
1233
1234 /// The value of [mode][crate::model::Canary::mode]
1235 /// if it holds a `CanaryDeployment`, `None` if the field is not set or
1236 /// holds a different branch.
1237 pub fn canary_deployment(
1238 &self,
1239 ) -> std::option::Option<&std::boxed::Box<crate::model::CanaryDeployment>> {
1240 #[allow(unreachable_patterns)]
1241 self.mode.as_ref().and_then(|v| match v {
1242 crate::model::canary::Mode::CanaryDeployment(v) => std::option::Option::Some(v),
1243 _ => std::option::Option::None,
1244 })
1245 }
1246
1247 /// Sets the value of [mode][crate::model::Canary::mode]
1248 /// to hold a `CanaryDeployment`.
1249 ///
1250 /// Note that all the setters affecting `mode` are
1251 /// mutually exclusive.
1252 ///
1253 /// # Example
1254 /// ```ignore,no_run
1255 /// # use google_cloud_deploy_v1::model::Canary;
1256 /// use google_cloud_deploy_v1::model::CanaryDeployment;
1257 /// let x = Canary::new().set_canary_deployment(CanaryDeployment::default()/* use setters */);
1258 /// assert!(x.canary_deployment().is_some());
1259 /// assert!(x.custom_canary_deployment().is_none());
1260 /// ```
1261 pub fn set_canary_deployment<
1262 T: std::convert::Into<std::boxed::Box<crate::model::CanaryDeployment>>,
1263 >(
1264 mut self,
1265 v: T,
1266 ) -> Self {
1267 self.mode =
1268 std::option::Option::Some(crate::model::canary::Mode::CanaryDeployment(v.into()));
1269 self
1270 }
1271
1272 /// The value of [mode][crate::model::Canary::mode]
1273 /// if it holds a `CustomCanaryDeployment`, `None` if the field is not set or
1274 /// holds a different branch.
1275 pub fn custom_canary_deployment(
1276 &self,
1277 ) -> std::option::Option<&std::boxed::Box<crate::model::CustomCanaryDeployment>> {
1278 #[allow(unreachable_patterns)]
1279 self.mode.as_ref().and_then(|v| match v {
1280 crate::model::canary::Mode::CustomCanaryDeployment(v) => std::option::Option::Some(v),
1281 _ => std::option::Option::None,
1282 })
1283 }
1284
1285 /// Sets the value of [mode][crate::model::Canary::mode]
1286 /// to hold a `CustomCanaryDeployment`.
1287 ///
1288 /// Note that all the setters affecting `mode` are
1289 /// mutually exclusive.
1290 ///
1291 /// # Example
1292 /// ```ignore,no_run
1293 /// # use google_cloud_deploy_v1::model::Canary;
1294 /// use google_cloud_deploy_v1::model::CustomCanaryDeployment;
1295 /// let x = Canary::new().set_custom_canary_deployment(CustomCanaryDeployment::default()/* use setters */);
1296 /// assert!(x.custom_canary_deployment().is_some());
1297 /// assert!(x.canary_deployment().is_none());
1298 /// ```
1299 pub fn set_custom_canary_deployment<
1300 T: std::convert::Into<std::boxed::Box<crate::model::CustomCanaryDeployment>>,
1301 >(
1302 mut self,
1303 v: T,
1304 ) -> Self {
1305 self.mode =
1306 std::option::Option::Some(crate::model::canary::Mode::CustomCanaryDeployment(v.into()));
1307 self
1308 }
1309}
1310
1311impl wkt::message::Message for Canary {
1312 fn typename() -> &'static str {
1313 "type.googleapis.com/google.cloud.deploy.v1.Canary"
1314 }
1315}
1316
1317/// Defines additional types related to [Canary].
1318pub mod canary {
1319 #[allow(unused_imports)]
1320 use super::*;
1321
1322 /// The mode to use for the canary deployment strategy.
1323 #[derive(Clone, Debug, PartialEq)]
1324 #[non_exhaustive]
1325 pub enum Mode {
1326 /// Optional. Configures the progressive based deployment for a Target.
1327 CanaryDeployment(std::boxed::Box<crate::model::CanaryDeployment>),
1328 /// Optional. Configures the progressive based deployment for a Target, but
1329 /// allows customizing at the phase level where a phase represents each of
1330 /// the percentage deployments.
1331 CustomCanaryDeployment(std::boxed::Box<crate::model::CustomCanaryDeployment>),
1332 }
1333}
1334
1335/// CanaryDeployment represents the canary deployment configuration
1336#[derive(Clone, Default, PartialEq)]
1337#[non_exhaustive]
1338pub struct CanaryDeployment {
1339 /// Required. The percentage based deployments that will occur as a part of a
1340 /// `Rollout`. List is expected in ascending order and each integer n is
1341 /// 0 <= n < 100.
1342 /// If the GatewayServiceMesh is configured for Kubernetes, then the range for
1343 /// n is 0 <= n <= 100.
1344 pub percentages: std::vec::Vec<i32>,
1345
1346 /// Optional. Whether to run verify tests after each percentage deployment via
1347 /// `skaffold verify`.
1348 pub verify: bool,
1349
1350 /// Optional. Configuration for the predeploy job of the first phase. If this
1351 /// is not configured, there will be no predeploy job for this phase.
1352 pub predeploy: std::option::Option<crate::model::Predeploy>,
1353
1354 /// Optional. Configuration for the postdeploy job of the last phase. If this
1355 /// is not configured, there will be no postdeploy job for this phase.
1356 pub postdeploy: std::option::Option<crate::model::Postdeploy>,
1357
1358 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1359}
1360
1361impl CanaryDeployment {
1362 pub fn new() -> Self {
1363 std::default::Default::default()
1364 }
1365
1366 /// Sets the value of [percentages][crate::model::CanaryDeployment::percentages].
1367 ///
1368 /// # Example
1369 /// ```ignore,no_run
1370 /// # use google_cloud_deploy_v1::model::CanaryDeployment;
1371 /// let x = CanaryDeployment::new().set_percentages([1, 2, 3]);
1372 /// ```
1373 pub fn set_percentages<T, V>(mut self, v: T) -> Self
1374 where
1375 T: std::iter::IntoIterator<Item = V>,
1376 V: std::convert::Into<i32>,
1377 {
1378 use std::iter::Iterator;
1379 self.percentages = v.into_iter().map(|i| i.into()).collect();
1380 self
1381 }
1382
1383 /// Sets the value of [verify][crate::model::CanaryDeployment::verify].
1384 ///
1385 /// # Example
1386 /// ```ignore,no_run
1387 /// # use google_cloud_deploy_v1::model::CanaryDeployment;
1388 /// let x = CanaryDeployment::new().set_verify(true);
1389 /// ```
1390 pub fn set_verify<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1391 self.verify = v.into();
1392 self
1393 }
1394
1395 /// Sets the value of [predeploy][crate::model::CanaryDeployment::predeploy].
1396 ///
1397 /// # Example
1398 /// ```ignore,no_run
1399 /// # use google_cloud_deploy_v1::model::CanaryDeployment;
1400 /// use google_cloud_deploy_v1::model::Predeploy;
1401 /// let x = CanaryDeployment::new().set_predeploy(Predeploy::default()/* use setters */);
1402 /// ```
1403 pub fn set_predeploy<T>(mut self, v: T) -> Self
1404 where
1405 T: std::convert::Into<crate::model::Predeploy>,
1406 {
1407 self.predeploy = std::option::Option::Some(v.into());
1408 self
1409 }
1410
1411 /// Sets or clears the value of [predeploy][crate::model::CanaryDeployment::predeploy].
1412 ///
1413 /// # Example
1414 /// ```ignore,no_run
1415 /// # use google_cloud_deploy_v1::model::CanaryDeployment;
1416 /// use google_cloud_deploy_v1::model::Predeploy;
1417 /// let x = CanaryDeployment::new().set_or_clear_predeploy(Some(Predeploy::default()/* use setters */));
1418 /// let x = CanaryDeployment::new().set_or_clear_predeploy(None::<Predeploy>);
1419 /// ```
1420 pub fn set_or_clear_predeploy<T>(mut self, v: std::option::Option<T>) -> Self
1421 where
1422 T: std::convert::Into<crate::model::Predeploy>,
1423 {
1424 self.predeploy = v.map(|x| x.into());
1425 self
1426 }
1427
1428 /// Sets the value of [postdeploy][crate::model::CanaryDeployment::postdeploy].
1429 ///
1430 /// # Example
1431 /// ```ignore,no_run
1432 /// # use google_cloud_deploy_v1::model::CanaryDeployment;
1433 /// use google_cloud_deploy_v1::model::Postdeploy;
1434 /// let x = CanaryDeployment::new().set_postdeploy(Postdeploy::default()/* use setters */);
1435 /// ```
1436 pub fn set_postdeploy<T>(mut self, v: T) -> Self
1437 where
1438 T: std::convert::Into<crate::model::Postdeploy>,
1439 {
1440 self.postdeploy = std::option::Option::Some(v.into());
1441 self
1442 }
1443
1444 /// Sets or clears the value of [postdeploy][crate::model::CanaryDeployment::postdeploy].
1445 ///
1446 /// # Example
1447 /// ```ignore,no_run
1448 /// # use google_cloud_deploy_v1::model::CanaryDeployment;
1449 /// use google_cloud_deploy_v1::model::Postdeploy;
1450 /// let x = CanaryDeployment::new().set_or_clear_postdeploy(Some(Postdeploy::default()/* use setters */));
1451 /// let x = CanaryDeployment::new().set_or_clear_postdeploy(None::<Postdeploy>);
1452 /// ```
1453 pub fn set_or_clear_postdeploy<T>(mut self, v: std::option::Option<T>) -> Self
1454 where
1455 T: std::convert::Into<crate::model::Postdeploy>,
1456 {
1457 self.postdeploy = v.map(|x| x.into());
1458 self
1459 }
1460}
1461
1462impl wkt::message::Message for CanaryDeployment {
1463 fn typename() -> &'static str {
1464 "type.googleapis.com/google.cloud.deploy.v1.CanaryDeployment"
1465 }
1466}
1467
1468/// CustomCanaryDeployment represents the custom canary deployment
1469/// configuration.
1470#[derive(Clone, Default, PartialEq)]
1471#[non_exhaustive]
1472pub struct CustomCanaryDeployment {
1473 /// Required. Configuration for each phase in the canary deployment in the
1474 /// order executed.
1475 pub phase_configs: std::vec::Vec<crate::model::custom_canary_deployment::PhaseConfig>,
1476
1477 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1478}
1479
1480impl CustomCanaryDeployment {
1481 pub fn new() -> Self {
1482 std::default::Default::default()
1483 }
1484
1485 /// Sets the value of [phase_configs][crate::model::CustomCanaryDeployment::phase_configs].
1486 ///
1487 /// # Example
1488 /// ```ignore,no_run
1489 /// # use google_cloud_deploy_v1::model::CustomCanaryDeployment;
1490 /// use google_cloud_deploy_v1::model::custom_canary_deployment::PhaseConfig;
1491 /// let x = CustomCanaryDeployment::new()
1492 /// .set_phase_configs([
1493 /// PhaseConfig::default()/* use setters */,
1494 /// PhaseConfig::default()/* use (different) setters */,
1495 /// ]);
1496 /// ```
1497 pub fn set_phase_configs<T, V>(mut self, v: T) -> Self
1498 where
1499 T: std::iter::IntoIterator<Item = V>,
1500 V: std::convert::Into<crate::model::custom_canary_deployment::PhaseConfig>,
1501 {
1502 use std::iter::Iterator;
1503 self.phase_configs = v.into_iter().map(|i| i.into()).collect();
1504 self
1505 }
1506}
1507
1508impl wkt::message::Message for CustomCanaryDeployment {
1509 fn typename() -> &'static str {
1510 "type.googleapis.com/google.cloud.deploy.v1.CustomCanaryDeployment"
1511 }
1512}
1513
1514/// Defines additional types related to [CustomCanaryDeployment].
1515pub mod custom_canary_deployment {
1516 #[allow(unused_imports)]
1517 use super::*;
1518
1519 /// PhaseConfig represents the configuration for a phase in the custom
1520 /// canary deployment.
1521 #[derive(Clone, Default, PartialEq)]
1522 #[non_exhaustive]
1523 pub struct PhaseConfig {
1524 /// Required. The ID to assign to the `Rollout` phase.
1525 /// This value must consist of lower-case letters, numbers, and hyphens,
1526 /// start with a letter and end with a letter or a number, and have a max
1527 /// length of 63 characters. In other words, it must match the following
1528 /// regex: `^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$`.
1529 pub phase_id: std::string::String,
1530
1531 /// Required. Percentage deployment for the phase.
1532 pub percentage: i32,
1533
1534 /// Optional. Skaffold profiles to use when rendering the manifest for this
1535 /// phase. These are in addition to the profiles list specified in the
1536 /// `DeliveryPipeline` stage.
1537 pub profiles: std::vec::Vec<std::string::String>,
1538
1539 /// Optional. Whether to run verify tests after the deployment via `skaffold
1540 /// verify`.
1541 pub verify: bool,
1542
1543 /// Optional. Configuration for the predeploy job of this phase. If this is
1544 /// not configured, there will be no predeploy job for this phase.
1545 pub predeploy: std::option::Option<crate::model::Predeploy>,
1546
1547 /// Optional. Configuration for the postdeploy job of this phase. If this is
1548 /// not configured, there will be no postdeploy job for this phase.
1549 pub postdeploy: std::option::Option<crate::model::Postdeploy>,
1550
1551 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1552 }
1553
1554 impl PhaseConfig {
1555 pub fn new() -> Self {
1556 std::default::Default::default()
1557 }
1558
1559 /// Sets the value of [phase_id][crate::model::custom_canary_deployment::PhaseConfig::phase_id].
1560 ///
1561 /// # Example
1562 /// ```ignore,no_run
1563 /// # use google_cloud_deploy_v1::model::custom_canary_deployment::PhaseConfig;
1564 /// let x = PhaseConfig::new().set_phase_id("example");
1565 /// ```
1566 pub fn set_phase_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1567 self.phase_id = v.into();
1568 self
1569 }
1570
1571 /// Sets the value of [percentage][crate::model::custom_canary_deployment::PhaseConfig::percentage].
1572 ///
1573 /// # Example
1574 /// ```ignore,no_run
1575 /// # use google_cloud_deploy_v1::model::custom_canary_deployment::PhaseConfig;
1576 /// let x = PhaseConfig::new().set_percentage(42);
1577 /// ```
1578 pub fn set_percentage<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1579 self.percentage = v.into();
1580 self
1581 }
1582
1583 /// Sets the value of [profiles][crate::model::custom_canary_deployment::PhaseConfig::profiles].
1584 ///
1585 /// # Example
1586 /// ```ignore,no_run
1587 /// # use google_cloud_deploy_v1::model::custom_canary_deployment::PhaseConfig;
1588 /// let x = PhaseConfig::new().set_profiles(["a", "b", "c"]);
1589 /// ```
1590 pub fn set_profiles<T, V>(mut self, v: T) -> Self
1591 where
1592 T: std::iter::IntoIterator<Item = V>,
1593 V: std::convert::Into<std::string::String>,
1594 {
1595 use std::iter::Iterator;
1596 self.profiles = v.into_iter().map(|i| i.into()).collect();
1597 self
1598 }
1599
1600 /// Sets the value of [verify][crate::model::custom_canary_deployment::PhaseConfig::verify].
1601 ///
1602 /// # Example
1603 /// ```ignore,no_run
1604 /// # use google_cloud_deploy_v1::model::custom_canary_deployment::PhaseConfig;
1605 /// let x = PhaseConfig::new().set_verify(true);
1606 /// ```
1607 pub fn set_verify<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1608 self.verify = v.into();
1609 self
1610 }
1611
1612 /// Sets the value of [predeploy][crate::model::custom_canary_deployment::PhaseConfig::predeploy].
1613 ///
1614 /// # Example
1615 /// ```ignore,no_run
1616 /// # use google_cloud_deploy_v1::model::custom_canary_deployment::PhaseConfig;
1617 /// use google_cloud_deploy_v1::model::Predeploy;
1618 /// let x = PhaseConfig::new().set_predeploy(Predeploy::default()/* use setters */);
1619 /// ```
1620 pub fn set_predeploy<T>(mut self, v: T) -> Self
1621 where
1622 T: std::convert::Into<crate::model::Predeploy>,
1623 {
1624 self.predeploy = std::option::Option::Some(v.into());
1625 self
1626 }
1627
1628 /// Sets or clears the value of [predeploy][crate::model::custom_canary_deployment::PhaseConfig::predeploy].
1629 ///
1630 /// # Example
1631 /// ```ignore,no_run
1632 /// # use google_cloud_deploy_v1::model::custom_canary_deployment::PhaseConfig;
1633 /// use google_cloud_deploy_v1::model::Predeploy;
1634 /// let x = PhaseConfig::new().set_or_clear_predeploy(Some(Predeploy::default()/* use setters */));
1635 /// let x = PhaseConfig::new().set_or_clear_predeploy(None::<Predeploy>);
1636 /// ```
1637 pub fn set_or_clear_predeploy<T>(mut self, v: std::option::Option<T>) -> Self
1638 where
1639 T: std::convert::Into<crate::model::Predeploy>,
1640 {
1641 self.predeploy = v.map(|x| x.into());
1642 self
1643 }
1644
1645 /// Sets the value of [postdeploy][crate::model::custom_canary_deployment::PhaseConfig::postdeploy].
1646 ///
1647 /// # Example
1648 /// ```ignore,no_run
1649 /// # use google_cloud_deploy_v1::model::custom_canary_deployment::PhaseConfig;
1650 /// use google_cloud_deploy_v1::model::Postdeploy;
1651 /// let x = PhaseConfig::new().set_postdeploy(Postdeploy::default()/* use setters */);
1652 /// ```
1653 pub fn set_postdeploy<T>(mut self, v: T) -> Self
1654 where
1655 T: std::convert::Into<crate::model::Postdeploy>,
1656 {
1657 self.postdeploy = std::option::Option::Some(v.into());
1658 self
1659 }
1660
1661 /// Sets or clears the value of [postdeploy][crate::model::custom_canary_deployment::PhaseConfig::postdeploy].
1662 ///
1663 /// # Example
1664 /// ```ignore,no_run
1665 /// # use google_cloud_deploy_v1::model::custom_canary_deployment::PhaseConfig;
1666 /// use google_cloud_deploy_v1::model::Postdeploy;
1667 /// let x = PhaseConfig::new().set_or_clear_postdeploy(Some(Postdeploy::default()/* use setters */));
1668 /// let x = PhaseConfig::new().set_or_clear_postdeploy(None::<Postdeploy>);
1669 /// ```
1670 pub fn set_or_clear_postdeploy<T>(mut self, v: std::option::Option<T>) -> Self
1671 where
1672 T: std::convert::Into<crate::model::Postdeploy>,
1673 {
1674 self.postdeploy = v.map(|x| x.into());
1675 self
1676 }
1677 }
1678
1679 impl wkt::message::Message for PhaseConfig {
1680 fn typename() -> &'static str {
1681 "type.googleapis.com/google.cloud.deploy.v1.CustomCanaryDeployment.PhaseConfig"
1682 }
1683 }
1684}
1685
1686/// KubernetesConfig contains the Kubernetes runtime configuration.
1687#[derive(Clone, Default, PartialEq)]
1688#[non_exhaustive]
1689pub struct KubernetesConfig {
1690 /// The service definition configuration.
1691 pub service_definition: std::option::Option<crate::model::kubernetes_config::ServiceDefinition>,
1692
1693 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1694}
1695
1696impl KubernetesConfig {
1697 pub fn new() -> Self {
1698 std::default::Default::default()
1699 }
1700
1701 /// Sets the value of [service_definition][crate::model::KubernetesConfig::service_definition].
1702 ///
1703 /// Note that all the setters affecting `service_definition` are mutually
1704 /// exclusive.
1705 ///
1706 /// # Example
1707 /// ```ignore,no_run
1708 /// # use google_cloud_deploy_v1::model::KubernetesConfig;
1709 /// use google_cloud_deploy_v1::model::kubernetes_config::GatewayServiceMesh;
1710 /// let x = KubernetesConfig::new().set_service_definition(Some(
1711 /// google_cloud_deploy_v1::model::kubernetes_config::ServiceDefinition::GatewayServiceMesh(GatewayServiceMesh::default().into())));
1712 /// ```
1713 pub fn set_service_definition<
1714 T: std::convert::Into<std::option::Option<crate::model::kubernetes_config::ServiceDefinition>>,
1715 >(
1716 mut self,
1717 v: T,
1718 ) -> Self {
1719 self.service_definition = v.into();
1720 self
1721 }
1722
1723 /// The value of [service_definition][crate::model::KubernetesConfig::service_definition]
1724 /// if it holds a `GatewayServiceMesh`, `None` if the field is not set or
1725 /// holds a different branch.
1726 pub fn gateway_service_mesh(
1727 &self,
1728 ) -> std::option::Option<&std::boxed::Box<crate::model::kubernetes_config::GatewayServiceMesh>>
1729 {
1730 #[allow(unreachable_patterns)]
1731 self.service_definition.as_ref().and_then(|v| match v {
1732 crate::model::kubernetes_config::ServiceDefinition::GatewayServiceMesh(v) => {
1733 std::option::Option::Some(v)
1734 }
1735 _ => std::option::Option::None,
1736 })
1737 }
1738
1739 /// Sets the value of [service_definition][crate::model::KubernetesConfig::service_definition]
1740 /// to hold a `GatewayServiceMesh`.
1741 ///
1742 /// Note that all the setters affecting `service_definition` are
1743 /// mutually exclusive.
1744 ///
1745 /// # Example
1746 /// ```ignore,no_run
1747 /// # use google_cloud_deploy_v1::model::KubernetesConfig;
1748 /// use google_cloud_deploy_v1::model::kubernetes_config::GatewayServiceMesh;
1749 /// let x = KubernetesConfig::new().set_gateway_service_mesh(GatewayServiceMesh::default()/* use setters */);
1750 /// assert!(x.gateway_service_mesh().is_some());
1751 /// assert!(x.service_networking().is_none());
1752 /// ```
1753 pub fn set_gateway_service_mesh<
1754 T: std::convert::Into<std::boxed::Box<crate::model::kubernetes_config::GatewayServiceMesh>>,
1755 >(
1756 mut self,
1757 v: T,
1758 ) -> Self {
1759 self.service_definition = std::option::Option::Some(
1760 crate::model::kubernetes_config::ServiceDefinition::GatewayServiceMesh(v.into()),
1761 );
1762 self
1763 }
1764
1765 /// The value of [service_definition][crate::model::KubernetesConfig::service_definition]
1766 /// if it holds a `ServiceNetworking`, `None` if the field is not set or
1767 /// holds a different branch.
1768 pub fn service_networking(
1769 &self,
1770 ) -> std::option::Option<&std::boxed::Box<crate::model::kubernetes_config::ServiceNetworking>>
1771 {
1772 #[allow(unreachable_patterns)]
1773 self.service_definition.as_ref().and_then(|v| match v {
1774 crate::model::kubernetes_config::ServiceDefinition::ServiceNetworking(v) => {
1775 std::option::Option::Some(v)
1776 }
1777 _ => std::option::Option::None,
1778 })
1779 }
1780
1781 /// Sets the value of [service_definition][crate::model::KubernetesConfig::service_definition]
1782 /// to hold a `ServiceNetworking`.
1783 ///
1784 /// Note that all the setters affecting `service_definition` are
1785 /// mutually exclusive.
1786 ///
1787 /// # Example
1788 /// ```ignore,no_run
1789 /// # use google_cloud_deploy_v1::model::KubernetesConfig;
1790 /// use google_cloud_deploy_v1::model::kubernetes_config::ServiceNetworking;
1791 /// let x = KubernetesConfig::new().set_service_networking(ServiceNetworking::default()/* use setters */);
1792 /// assert!(x.service_networking().is_some());
1793 /// assert!(x.gateway_service_mesh().is_none());
1794 /// ```
1795 pub fn set_service_networking<
1796 T: std::convert::Into<std::boxed::Box<crate::model::kubernetes_config::ServiceNetworking>>,
1797 >(
1798 mut self,
1799 v: T,
1800 ) -> Self {
1801 self.service_definition = std::option::Option::Some(
1802 crate::model::kubernetes_config::ServiceDefinition::ServiceNetworking(v.into()),
1803 );
1804 self
1805 }
1806}
1807
1808impl wkt::message::Message for KubernetesConfig {
1809 fn typename() -> &'static str {
1810 "type.googleapis.com/google.cloud.deploy.v1.KubernetesConfig"
1811 }
1812}
1813
1814/// Defines additional types related to [KubernetesConfig].
1815pub mod kubernetes_config {
1816 #[allow(unused_imports)]
1817 use super::*;
1818
1819 /// Information about the Kubernetes Gateway API service mesh configuration.
1820 #[derive(Clone, Default, PartialEq)]
1821 #[non_exhaustive]
1822 pub struct GatewayServiceMesh {
1823 /// Required. Name of the Gateway API HTTPRoute.
1824 pub http_route: std::string::String,
1825
1826 /// Required. Name of the Kubernetes Service.
1827 pub service: std::string::String,
1828
1829 /// Required. Name of the Kubernetes Deployment whose traffic is managed by
1830 /// the specified HTTPRoute and Service.
1831 pub deployment: std::string::String,
1832
1833 /// Optional. The time to wait for route updates to propagate. The maximum
1834 /// configurable time is 3 hours, in seconds format. If unspecified, there is
1835 /// no wait time.
1836 pub route_update_wait_time: std::option::Option<wkt::Duration>,
1837
1838 /// Optional. The amount of time to migrate traffic back from the canary
1839 /// Service to the original Service during the stable phase deployment. If
1840 /// specified, must be between 15s and 3600s. If unspecified, there is no
1841 /// cutback time.
1842 pub stable_cutback_duration: std::option::Option<wkt::Duration>,
1843
1844 /// Optional. The label to use when selecting Pods for the Deployment and
1845 /// Service resources. This label must already be present in both resources.
1846 pub pod_selector_label: std::string::String,
1847
1848 /// Optional. Route destinations allow configuring the Gateway API HTTPRoute
1849 /// to be deployed to additional clusters. This option is available for
1850 /// multi-cluster service mesh set ups that require the route to exist in the
1851 /// clusters that call the service. If unspecified, the HTTPRoute will only
1852 /// be deployed to the Target cluster.
1853 pub route_destinations: std::option::Option<
1854 crate::model::kubernetes_config::gateway_service_mesh::RouteDestinations,
1855 >,
1856
1857 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1858 }
1859
1860 impl GatewayServiceMesh {
1861 pub fn new() -> Self {
1862 std::default::Default::default()
1863 }
1864
1865 /// Sets the value of [http_route][crate::model::kubernetes_config::GatewayServiceMesh::http_route].
1866 ///
1867 /// # Example
1868 /// ```ignore,no_run
1869 /// # use google_cloud_deploy_v1::model::kubernetes_config::GatewayServiceMesh;
1870 /// let x = GatewayServiceMesh::new().set_http_route("example");
1871 /// ```
1872 pub fn set_http_route<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1873 self.http_route = v.into();
1874 self
1875 }
1876
1877 /// Sets the value of [service][crate::model::kubernetes_config::GatewayServiceMesh::service].
1878 ///
1879 /// # Example
1880 /// ```ignore,no_run
1881 /// # use google_cloud_deploy_v1::model::kubernetes_config::GatewayServiceMesh;
1882 /// let x = GatewayServiceMesh::new().set_service("example");
1883 /// ```
1884 pub fn set_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1885 self.service = v.into();
1886 self
1887 }
1888
1889 /// Sets the value of [deployment][crate::model::kubernetes_config::GatewayServiceMesh::deployment].
1890 ///
1891 /// # Example
1892 /// ```ignore,no_run
1893 /// # use google_cloud_deploy_v1::model::kubernetes_config::GatewayServiceMesh;
1894 /// let x = GatewayServiceMesh::new().set_deployment("example");
1895 /// ```
1896 pub fn set_deployment<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1897 self.deployment = v.into();
1898 self
1899 }
1900
1901 /// Sets the value of [route_update_wait_time][crate::model::kubernetes_config::GatewayServiceMesh::route_update_wait_time].
1902 ///
1903 /// # Example
1904 /// ```ignore,no_run
1905 /// # use google_cloud_deploy_v1::model::kubernetes_config::GatewayServiceMesh;
1906 /// use wkt::Duration;
1907 /// let x = GatewayServiceMesh::new().set_route_update_wait_time(Duration::default()/* use setters */);
1908 /// ```
1909 pub fn set_route_update_wait_time<T>(mut self, v: T) -> Self
1910 where
1911 T: std::convert::Into<wkt::Duration>,
1912 {
1913 self.route_update_wait_time = std::option::Option::Some(v.into());
1914 self
1915 }
1916
1917 /// Sets or clears the value of [route_update_wait_time][crate::model::kubernetes_config::GatewayServiceMesh::route_update_wait_time].
1918 ///
1919 /// # Example
1920 /// ```ignore,no_run
1921 /// # use google_cloud_deploy_v1::model::kubernetes_config::GatewayServiceMesh;
1922 /// use wkt::Duration;
1923 /// let x = GatewayServiceMesh::new().set_or_clear_route_update_wait_time(Some(Duration::default()/* use setters */));
1924 /// let x = GatewayServiceMesh::new().set_or_clear_route_update_wait_time(None::<Duration>);
1925 /// ```
1926 pub fn set_or_clear_route_update_wait_time<T>(mut self, v: std::option::Option<T>) -> Self
1927 where
1928 T: std::convert::Into<wkt::Duration>,
1929 {
1930 self.route_update_wait_time = v.map(|x| x.into());
1931 self
1932 }
1933
1934 /// Sets the value of [stable_cutback_duration][crate::model::kubernetes_config::GatewayServiceMesh::stable_cutback_duration].
1935 ///
1936 /// # Example
1937 /// ```ignore,no_run
1938 /// # use google_cloud_deploy_v1::model::kubernetes_config::GatewayServiceMesh;
1939 /// use wkt::Duration;
1940 /// let x = GatewayServiceMesh::new().set_stable_cutback_duration(Duration::default()/* use setters */);
1941 /// ```
1942 pub fn set_stable_cutback_duration<T>(mut self, v: T) -> Self
1943 where
1944 T: std::convert::Into<wkt::Duration>,
1945 {
1946 self.stable_cutback_duration = std::option::Option::Some(v.into());
1947 self
1948 }
1949
1950 /// Sets or clears the value of [stable_cutback_duration][crate::model::kubernetes_config::GatewayServiceMesh::stable_cutback_duration].
1951 ///
1952 /// # Example
1953 /// ```ignore,no_run
1954 /// # use google_cloud_deploy_v1::model::kubernetes_config::GatewayServiceMesh;
1955 /// use wkt::Duration;
1956 /// let x = GatewayServiceMesh::new().set_or_clear_stable_cutback_duration(Some(Duration::default()/* use setters */));
1957 /// let x = GatewayServiceMesh::new().set_or_clear_stable_cutback_duration(None::<Duration>);
1958 /// ```
1959 pub fn set_or_clear_stable_cutback_duration<T>(mut self, v: std::option::Option<T>) -> Self
1960 where
1961 T: std::convert::Into<wkt::Duration>,
1962 {
1963 self.stable_cutback_duration = v.map(|x| x.into());
1964 self
1965 }
1966
1967 /// Sets the value of [pod_selector_label][crate::model::kubernetes_config::GatewayServiceMesh::pod_selector_label].
1968 ///
1969 /// # Example
1970 /// ```ignore,no_run
1971 /// # use google_cloud_deploy_v1::model::kubernetes_config::GatewayServiceMesh;
1972 /// let x = GatewayServiceMesh::new().set_pod_selector_label("example");
1973 /// ```
1974 pub fn set_pod_selector_label<T: std::convert::Into<std::string::String>>(
1975 mut self,
1976 v: T,
1977 ) -> Self {
1978 self.pod_selector_label = v.into();
1979 self
1980 }
1981
1982 /// Sets the value of [route_destinations][crate::model::kubernetes_config::GatewayServiceMesh::route_destinations].
1983 ///
1984 /// # Example
1985 /// ```ignore,no_run
1986 /// # use google_cloud_deploy_v1::model::kubernetes_config::GatewayServiceMesh;
1987 /// use google_cloud_deploy_v1::model::kubernetes_config::gateway_service_mesh::RouteDestinations;
1988 /// let x = GatewayServiceMesh::new().set_route_destinations(RouteDestinations::default()/* use setters */);
1989 /// ```
1990 pub fn set_route_destinations<T>(mut self, v: T) -> Self
1991 where
1992 T: std::convert::Into<
1993 crate::model::kubernetes_config::gateway_service_mesh::RouteDestinations,
1994 >,
1995 {
1996 self.route_destinations = std::option::Option::Some(v.into());
1997 self
1998 }
1999
2000 /// Sets or clears the value of [route_destinations][crate::model::kubernetes_config::GatewayServiceMesh::route_destinations].
2001 ///
2002 /// # Example
2003 /// ```ignore,no_run
2004 /// # use google_cloud_deploy_v1::model::kubernetes_config::GatewayServiceMesh;
2005 /// use google_cloud_deploy_v1::model::kubernetes_config::gateway_service_mesh::RouteDestinations;
2006 /// let x = GatewayServiceMesh::new().set_or_clear_route_destinations(Some(RouteDestinations::default()/* use setters */));
2007 /// let x = GatewayServiceMesh::new().set_or_clear_route_destinations(None::<RouteDestinations>);
2008 /// ```
2009 pub fn set_or_clear_route_destinations<T>(mut self, v: std::option::Option<T>) -> Self
2010 where
2011 T: std::convert::Into<
2012 crate::model::kubernetes_config::gateway_service_mesh::RouteDestinations,
2013 >,
2014 {
2015 self.route_destinations = v.map(|x| x.into());
2016 self
2017 }
2018 }
2019
2020 impl wkt::message::Message for GatewayServiceMesh {
2021 fn typename() -> &'static str {
2022 "type.googleapis.com/google.cloud.deploy.v1.KubernetesConfig.GatewayServiceMesh"
2023 }
2024 }
2025
2026 /// Defines additional types related to [GatewayServiceMesh].
2027 pub mod gateway_service_mesh {
2028 #[allow(unused_imports)]
2029 use super::*;
2030
2031 /// Information about route destinations for the Gateway API service mesh.
2032 #[derive(Clone, Default, PartialEq)]
2033 #[non_exhaustive]
2034 pub struct RouteDestinations {
2035 /// Required. The clusters where the Gateway API HTTPRoute resource will be
2036 /// deployed to. Valid entries include the associated entities IDs
2037 /// configured in the Target resource and "@self" to include the Target
2038 /// cluster.
2039 pub destination_ids: std::vec::Vec<std::string::String>,
2040
2041 /// Optional. Whether to propagate the Kubernetes Service to the route
2042 /// destination clusters. The Service will always be deployed to the Target
2043 /// cluster even if the HTTPRoute is not. This option may be used to
2044 /// facilitate successful DNS lookup in the route destination clusters. Can
2045 /// only be set to true if destinations are specified.
2046 pub propagate_service: bool,
2047
2048 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2049 }
2050
2051 impl RouteDestinations {
2052 pub fn new() -> Self {
2053 std::default::Default::default()
2054 }
2055
2056 /// Sets the value of [destination_ids][crate::model::kubernetes_config::gateway_service_mesh::RouteDestinations::destination_ids].
2057 ///
2058 /// # Example
2059 /// ```ignore,no_run
2060 /// # use google_cloud_deploy_v1::model::kubernetes_config::gateway_service_mesh::RouteDestinations;
2061 /// let x = RouteDestinations::new().set_destination_ids(["a", "b", "c"]);
2062 /// ```
2063 pub fn set_destination_ids<T, V>(mut self, v: T) -> Self
2064 where
2065 T: std::iter::IntoIterator<Item = V>,
2066 V: std::convert::Into<std::string::String>,
2067 {
2068 use std::iter::Iterator;
2069 self.destination_ids = v.into_iter().map(|i| i.into()).collect();
2070 self
2071 }
2072
2073 /// Sets the value of [propagate_service][crate::model::kubernetes_config::gateway_service_mesh::RouteDestinations::propagate_service].
2074 ///
2075 /// # Example
2076 /// ```ignore,no_run
2077 /// # use google_cloud_deploy_v1::model::kubernetes_config::gateway_service_mesh::RouteDestinations;
2078 /// let x = RouteDestinations::new().set_propagate_service(true);
2079 /// ```
2080 pub fn set_propagate_service<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2081 self.propagate_service = v.into();
2082 self
2083 }
2084 }
2085
2086 impl wkt::message::Message for RouteDestinations {
2087 fn typename() -> &'static str {
2088 "type.googleapis.com/google.cloud.deploy.v1.KubernetesConfig.GatewayServiceMesh.RouteDestinations"
2089 }
2090 }
2091 }
2092
2093 /// Information about the Kubernetes Service networking configuration.
2094 #[derive(Clone, Default, PartialEq)]
2095 #[non_exhaustive]
2096 pub struct ServiceNetworking {
2097 /// Required. Name of the Kubernetes Service.
2098 pub service: std::string::String,
2099
2100 /// Required. Name of the Kubernetes Deployment whose traffic is managed by
2101 /// the specified Service.
2102 pub deployment: std::string::String,
2103
2104 /// Optional. Whether to disable Pod overprovisioning. If Pod
2105 /// overprovisioning is disabled then Cloud Deploy will limit the number of
2106 /// total Pods used for the deployment strategy to the number of Pods the
2107 /// Deployment has on the cluster.
2108 pub disable_pod_overprovisioning: bool,
2109
2110 /// Optional. The label to use when selecting Pods for the Deployment
2111 /// resource. This label must already be present in the Deployment.
2112 pub pod_selector_label: std::string::String,
2113
2114 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2115 }
2116
2117 impl ServiceNetworking {
2118 pub fn new() -> Self {
2119 std::default::Default::default()
2120 }
2121
2122 /// Sets the value of [service][crate::model::kubernetes_config::ServiceNetworking::service].
2123 ///
2124 /// # Example
2125 /// ```ignore,no_run
2126 /// # use google_cloud_deploy_v1::model::kubernetes_config::ServiceNetworking;
2127 /// let x = ServiceNetworking::new().set_service("example");
2128 /// ```
2129 pub fn set_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2130 self.service = v.into();
2131 self
2132 }
2133
2134 /// Sets the value of [deployment][crate::model::kubernetes_config::ServiceNetworking::deployment].
2135 ///
2136 /// # Example
2137 /// ```ignore,no_run
2138 /// # use google_cloud_deploy_v1::model::kubernetes_config::ServiceNetworking;
2139 /// let x = ServiceNetworking::new().set_deployment("example");
2140 /// ```
2141 pub fn set_deployment<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2142 self.deployment = v.into();
2143 self
2144 }
2145
2146 /// Sets the value of [disable_pod_overprovisioning][crate::model::kubernetes_config::ServiceNetworking::disable_pod_overprovisioning].
2147 ///
2148 /// # Example
2149 /// ```ignore,no_run
2150 /// # use google_cloud_deploy_v1::model::kubernetes_config::ServiceNetworking;
2151 /// let x = ServiceNetworking::new().set_disable_pod_overprovisioning(true);
2152 /// ```
2153 pub fn set_disable_pod_overprovisioning<T: std::convert::Into<bool>>(
2154 mut self,
2155 v: T,
2156 ) -> Self {
2157 self.disable_pod_overprovisioning = v.into();
2158 self
2159 }
2160
2161 /// Sets the value of [pod_selector_label][crate::model::kubernetes_config::ServiceNetworking::pod_selector_label].
2162 ///
2163 /// # Example
2164 /// ```ignore,no_run
2165 /// # use google_cloud_deploy_v1::model::kubernetes_config::ServiceNetworking;
2166 /// let x = ServiceNetworking::new().set_pod_selector_label("example");
2167 /// ```
2168 pub fn set_pod_selector_label<T: std::convert::Into<std::string::String>>(
2169 mut self,
2170 v: T,
2171 ) -> Self {
2172 self.pod_selector_label = v.into();
2173 self
2174 }
2175 }
2176
2177 impl wkt::message::Message for ServiceNetworking {
2178 fn typename() -> &'static str {
2179 "type.googleapis.com/google.cloud.deploy.v1.KubernetesConfig.ServiceNetworking"
2180 }
2181 }
2182
2183 /// The service definition configuration.
2184 #[derive(Clone, Debug, PartialEq)]
2185 #[non_exhaustive]
2186 pub enum ServiceDefinition {
2187 /// Optional. Kubernetes Gateway API service mesh configuration.
2188 GatewayServiceMesh(std::boxed::Box<crate::model::kubernetes_config::GatewayServiceMesh>),
2189 /// Optional. Kubernetes Service networking configuration.
2190 ServiceNetworking(std::boxed::Box<crate::model::kubernetes_config::ServiceNetworking>),
2191 }
2192}
2193
2194/// CloudRunConfig contains the Cloud Run runtime configuration.
2195#[derive(Clone, Default, PartialEq)]
2196#[non_exhaustive]
2197pub struct CloudRunConfig {
2198 /// Optional. Whether Cloud Deploy should update the traffic stanza in a Cloud
2199 /// Run Service on the user's behalf to facilitate traffic splitting. This is
2200 /// required to be true for CanaryDeployments, but optional for
2201 /// CustomCanaryDeployments.
2202 pub automatic_traffic_control: bool,
2203
2204 /// Optional. A list of tags that are added to the canary revision while the
2205 /// canary phase is in progress.
2206 pub canary_revision_tags: std::vec::Vec<std::string::String>,
2207
2208 /// Optional. A list of tags that are added to the prior revision while the
2209 /// canary phase is in progress.
2210 pub prior_revision_tags: std::vec::Vec<std::string::String>,
2211
2212 /// Optional. A list of tags that are added to the final stable revision when
2213 /// the stable phase is applied.
2214 pub stable_revision_tags: std::vec::Vec<std::string::String>,
2215
2216 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2217}
2218
2219impl CloudRunConfig {
2220 pub fn new() -> Self {
2221 std::default::Default::default()
2222 }
2223
2224 /// Sets the value of [automatic_traffic_control][crate::model::CloudRunConfig::automatic_traffic_control].
2225 ///
2226 /// # Example
2227 /// ```ignore,no_run
2228 /// # use google_cloud_deploy_v1::model::CloudRunConfig;
2229 /// let x = CloudRunConfig::new().set_automatic_traffic_control(true);
2230 /// ```
2231 pub fn set_automatic_traffic_control<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2232 self.automatic_traffic_control = v.into();
2233 self
2234 }
2235
2236 /// Sets the value of [canary_revision_tags][crate::model::CloudRunConfig::canary_revision_tags].
2237 ///
2238 /// # Example
2239 /// ```ignore,no_run
2240 /// # use google_cloud_deploy_v1::model::CloudRunConfig;
2241 /// let x = CloudRunConfig::new().set_canary_revision_tags(["a", "b", "c"]);
2242 /// ```
2243 pub fn set_canary_revision_tags<T, V>(mut self, v: T) -> Self
2244 where
2245 T: std::iter::IntoIterator<Item = V>,
2246 V: std::convert::Into<std::string::String>,
2247 {
2248 use std::iter::Iterator;
2249 self.canary_revision_tags = v.into_iter().map(|i| i.into()).collect();
2250 self
2251 }
2252
2253 /// Sets the value of [prior_revision_tags][crate::model::CloudRunConfig::prior_revision_tags].
2254 ///
2255 /// # Example
2256 /// ```ignore,no_run
2257 /// # use google_cloud_deploy_v1::model::CloudRunConfig;
2258 /// let x = CloudRunConfig::new().set_prior_revision_tags(["a", "b", "c"]);
2259 /// ```
2260 pub fn set_prior_revision_tags<T, V>(mut self, v: T) -> Self
2261 where
2262 T: std::iter::IntoIterator<Item = V>,
2263 V: std::convert::Into<std::string::String>,
2264 {
2265 use std::iter::Iterator;
2266 self.prior_revision_tags = v.into_iter().map(|i| i.into()).collect();
2267 self
2268 }
2269
2270 /// Sets the value of [stable_revision_tags][crate::model::CloudRunConfig::stable_revision_tags].
2271 ///
2272 /// # Example
2273 /// ```ignore,no_run
2274 /// # use google_cloud_deploy_v1::model::CloudRunConfig;
2275 /// let x = CloudRunConfig::new().set_stable_revision_tags(["a", "b", "c"]);
2276 /// ```
2277 pub fn set_stable_revision_tags<T, V>(mut self, v: T) -> Self
2278 where
2279 T: std::iter::IntoIterator<Item = V>,
2280 V: std::convert::Into<std::string::String>,
2281 {
2282 use std::iter::Iterator;
2283 self.stable_revision_tags = v.into_iter().map(|i| i.into()).collect();
2284 self
2285 }
2286}
2287
2288impl wkt::message::Message for CloudRunConfig {
2289 fn typename() -> &'static str {
2290 "type.googleapis.com/google.cloud.deploy.v1.CloudRunConfig"
2291 }
2292}
2293
2294/// RuntimeConfig contains the runtime specific configurations for a deployment
2295/// strategy.
2296#[derive(Clone, Default, PartialEq)]
2297#[non_exhaustive]
2298pub struct RuntimeConfig {
2299 /// The runtime configuration details.
2300 pub runtime_config: std::option::Option<crate::model::runtime_config::RuntimeConfig>,
2301
2302 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2303}
2304
2305impl RuntimeConfig {
2306 pub fn new() -> Self {
2307 std::default::Default::default()
2308 }
2309
2310 /// Sets the value of [runtime_config][crate::model::RuntimeConfig::runtime_config].
2311 ///
2312 /// Note that all the setters affecting `runtime_config` are mutually
2313 /// exclusive.
2314 ///
2315 /// # Example
2316 /// ```ignore,no_run
2317 /// # use google_cloud_deploy_v1::model::RuntimeConfig;
2318 /// use google_cloud_deploy_v1::model::KubernetesConfig;
2319 /// let x = RuntimeConfig::new().set_runtime_config(Some(
2320 /// google_cloud_deploy_v1::model::runtime_config::RuntimeConfig::Kubernetes(KubernetesConfig::default().into())));
2321 /// ```
2322 pub fn set_runtime_config<
2323 T: std::convert::Into<std::option::Option<crate::model::runtime_config::RuntimeConfig>>,
2324 >(
2325 mut self,
2326 v: T,
2327 ) -> Self {
2328 self.runtime_config = v.into();
2329 self
2330 }
2331
2332 /// The value of [runtime_config][crate::model::RuntimeConfig::runtime_config]
2333 /// if it holds a `Kubernetes`, `None` if the field is not set or
2334 /// holds a different branch.
2335 pub fn kubernetes(
2336 &self,
2337 ) -> std::option::Option<&std::boxed::Box<crate::model::KubernetesConfig>> {
2338 #[allow(unreachable_patterns)]
2339 self.runtime_config.as_ref().and_then(|v| match v {
2340 crate::model::runtime_config::RuntimeConfig::Kubernetes(v) => {
2341 std::option::Option::Some(v)
2342 }
2343 _ => std::option::Option::None,
2344 })
2345 }
2346
2347 /// Sets the value of [runtime_config][crate::model::RuntimeConfig::runtime_config]
2348 /// to hold a `Kubernetes`.
2349 ///
2350 /// Note that all the setters affecting `runtime_config` are
2351 /// mutually exclusive.
2352 ///
2353 /// # Example
2354 /// ```ignore,no_run
2355 /// # use google_cloud_deploy_v1::model::RuntimeConfig;
2356 /// use google_cloud_deploy_v1::model::KubernetesConfig;
2357 /// let x = RuntimeConfig::new().set_kubernetes(KubernetesConfig::default()/* use setters */);
2358 /// assert!(x.kubernetes().is_some());
2359 /// assert!(x.cloud_run().is_none());
2360 /// ```
2361 pub fn set_kubernetes<
2362 T: std::convert::Into<std::boxed::Box<crate::model::KubernetesConfig>>,
2363 >(
2364 mut self,
2365 v: T,
2366 ) -> Self {
2367 self.runtime_config = std::option::Option::Some(
2368 crate::model::runtime_config::RuntimeConfig::Kubernetes(v.into()),
2369 );
2370 self
2371 }
2372
2373 /// The value of [runtime_config][crate::model::RuntimeConfig::runtime_config]
2374 /// if it holds a `CloudRun`, `None` if the field is not set or
2375 /// holds a different branch.
2376 pub fn cloud_run(&self) -> std::option::Option<&std::boxed::Box<crate::model::CloudRunConfig>> {
2377 #[allow(unreachable_patterns)]
2378 self.runtime_config.as_ref().and_then(|v| match v {
2379 crate::model::runtime_config::RuntimeConfig::CloudRun(v) => {
2380 std::option::Option::Some(v)
2381 }
2382 _ => std::option::Option::None,
2383 })
2384 }
2385
2386 /// Sets the value of [runtime_config][crate::model::RuntimeConfig::runtime_config]
2387 /// to hold a `CloudRun`.
2388 ///
2389 /// Note that all the setters affecting `runtime_config` are
2390 /// mutually exclusive.
2391 ///
2392 /// # Example
2393 /// ```ignore,no_run
2394 /// # use google_cloud_deploy_v1::model::RuntimeConfig;
2395 /// use google_cloud_deploy_v1::model::CloudRunConfig;
2396 /// let x = RuntimeConfig::new().set_cloud_run(CloudRunConfig::default()/* use setters */);
2397 /// assert!(x.cloud_run().is_some());
2398 /// assert!(x.kubernetes().is_none());
2399 /// ```
2400 pub fn set_cloud_run<T: std::convert::Into<std::boxed::Box<crate::model::CloudRunConfig>>>(
2401 mut self,
2402 v: T,
2403 ) -> Self {
2404 self.runtime_config = std::option::Option::Some(
2405 crate::model::runtime_config::RuntimeConfig::CloudRun(v.into()),
2406 );
2407 self
2408 }
2409}
2410
2411impl wkt::message::Message for RuntimeConfig {
2412 fn typename() -> &'static str {
2413 "type.googleapis.com/google.cloud.deploy.v1.RuntimeConfig"
2414 }
2415}
2416
2417/// Defines additional types related to [RuntimeConfig].
2418pub mod runtime_config {
2419 #[allow(unused_imports)]
2420 use super::*;
2421
2422 /// The runtime configuration details.
2423 #[derive(Clone, Debug, PartialEq)]
2424 #[non_exhaustive]
2425 pub enum RuntimeConfig {
2426 /// Optional. Kubernetes runtime configuration.
2427 Kubernetes(std::boxed::Box<crate::model::KubernetesConfig>),
2428 /// Optional. Cloud Run runtime configuration.
2429 CloudRun(std::boxed::Box<crate::model::CloudRunConfig>),
2430 }
2431}
2432
2433/// PipelineReadyCondition contains information around the status of the
2434/// Pipeline.
2435#[derive(Clone, Default, PartialEq)]
2436#[non_exhaustive]
2437pub struct PipelineReadyCondition {
2438 /// True if the Pipeline is in a valid state. Otherwise at least one condition
2439 /// in `PipelineCondition` is in an invalid state. Iterate over those
2440 /// conditions and see which condition(s) has status = false to find out what
2441 /// is wrong with the Pipeline.
2442 pub status: bool,
2443
2444 /// Last time the condition was updated.
2445 pub update_time: std::option::Option<wkt::Timestamp>,
2446
2447 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2448}
2449
2450impl PipelineReadyCondition {
2451 pub fn new() -> Self {
2452 std::default::Default::default()
2453 }
2454
2455 /// Sets the value of [status][crate::model::PipelineReadyCondition::status].
2456 ///
2457 /// # Example
2458 /// ```ignore,no_run
2459 /// # use google_cloud_deploy_v1::model::PipelineReadyCondition;
2460 /// let x = PipelineReadyCondition::new().set_status(true);
2461 /// ```
2462 pub fn set_status<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2463 self.status = v.into();
2464 self
2465 }
2466
2467 /// Sets the value of [update_time][crate::model::PipelineReadyCondition::update_time].
2468 ///
2469 /// # Example
2470 /// ```ignore,no_run
2471 /// # use google_cloud_deploy_v1::model::PipelineReadyCondition;
2472 /// use wkt::Timestamp;
2473 /// let x = PipelineReadyCondition::new().set_update_time(Timestamp::default()/* use setters */);
2474 /// ```
2475 pub fn set_update_time<T>(mut self, v: T) -> Self
2476 where
2477 T: std::convert::Into<wkt::Timestamp>,
2478 {
2479 self.update_time = std::option::Option::Some(v.into());
2480 self
2481 }
2482
2483 /// Sets or clears the value of [update_time][crate::model::PipelineReadyCondition::update_time].
2484 ///
2485 /// # Example
2486 /// ```ignore,no_run
2487 /// # use google_cloud_deploy_v1::model::PipelineReadyCondition;
2488 /// use wkt::Timestamp;
2489 /// let x = PipelineReadyCondition::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
2490 /// let x = PipelineReadyCondition::new().set_or_clear_update_time(None::<Timestamp>);
2491 /// ```
2492 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
2493 where
2494 T: std::convert::Into<wkt::Timestamp>,
2495 {
2496 self.update_time = v.map(|x| x.into());
2497 self
2498 }
2499}
2500
2501impl wkt::message::Message for PipelineReadyCondition {
2502 fn typename() -> &'static str {
2503 "type.googleapis.com/google.cloud.deploy.v1.PipelineReadyCondition"
2504 }
2505}
2506
2507/// `TargetsPresentCondition` contains information on any Targets referenced in
2508/// the Delivery Pipeline that do not actually exist.
2509#[derive(Clone, Default, PartialEq)]
2510#[non_exhaustive]
2511pub struct TargetsPresentCondition {
2512 /// True if there aren't any missing Targets.
2513 pub status: bool,
2514
2515 /// The list of Target names that do not exist. For example,
2516 /// `projects/{project_id}/locations/{location_name}/targets/{target_name}`.
2517 pub missing_targets: std::vec::Vec<std::string::String>,
2518
2519 /// Last time the condition was updated.
2520 pub update_time: std::option::Option<wkt::Timestamp>,
2521
2522 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2523}
2524
2525impl TargetsPresentCondition {
2526 pub fn new() -> Self {
2527 std::default::Default::default()
2528 }
2529
2530 /// Sets the value of [status][crate::model::TargetsPresentCondition::status].
2531 ///
2532 /// # Example
2533 /// ```ignore,no_run
2534 /// # use google_cloud_deploy_v1::model::TargetsPresentCondition;
2535 /// let x = TargetsPresentCondition::new().set_status(true);
2536 /// ```
2537 pub fn set_status<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2538 self.status = v.into();
2539 self
2540 }
2541
2542 /// Sets the value of [missing_targets][crate::model::TargetsPresentCondition::missing_targets].
2543 ///
2544 /// # Example
2545 /// ```ignore,no_run
2546 /// # use google_cloud_deploy_v1::model::TargetsPresentCondition;
2547 /// let x = TargetsPresentCondition::new().set_missing_targets(["a", "b", "c"]);
2548 /// ```
2549 pub fn set_missing_targets<T, V>(mut self, v: T) -> Self
2550 where
2551 T: std::iter::IntoIterator<Item = V>,
2552 V: std::convert::Into<std::string::String>,
2553 {
2554 use std::iter::Iterator;
2555 self.missing_targets = v.into_iter().map(|i| i.into()).collect();
2556 self
2557 }
2558
2559 /// Sets the value of [update_time][crate::model::TargetsPresentCondition::update_time].
2560 ///
2561 /// # Example
2562 /// ```ignore,no_run
2563 /// # use google_cloud_deploy_v1::model::TargetsPresentCondition;
2564 /// use wkt::Timestamp;
2565 /// let x = TargetsPresentCondition::new().set_update_time(Timestamp::default()/* use setters */);
2566 /// ```
2567 pub fn set_update_time<T>(mut self, v: T) -> Self
2568 where
2569 T: std::convert::Into<wkt::Timestamp>,
2570 {
2571 self.update_time = std::option::Option::Some(v.into());
2572 self
2573 }
2574
2575 /// Sets or clears the value of [update_time][crate::model::TargetsPresentCondition::update_time].
2576 ///
2577 /// # Example
2578 /// ```ignore,no_run
2579 /// # use google_cloud_deploy_v1::model::TargetsPresentCondition;
2580 /// use wkt::Timestamp;
2581 /// let x = TargetsPresentCondition::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
2582 /// let x = TargetsPresentCondition::new().set_or_clear_update_time(None::<Timestamp>);
2583 /// ```
2584 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
2585 where
2586 T: std::convert::Into<wkt::Timestamp>,
2587 {
2588 self.update_time = v.map(|x| x.into());
2589 self
2590 }
2591}
2592
2593impl wkt::message::Message for TargetsPresentCondition {
2594 fn typename() -> &'static str {
2595 "type.googleapis.com/google.cloud.deploy.v1.TargetsPresentCondition"
2596 }
2597}
2598
2599/// TargetsTypeCondition contains information on whether the Targets defined in
2600/// the Delivery Pipeline are of the same type.
2601#[derive(Clone, Default, PartialEq)]
2602#[non_exhaustive]
2603pub struct TargetsTypeCondition {
2604 /// True if the targets are all a comparable type. For example this is true if
2605 /// all targets are GKE clusters. This is false if some targets are Cloud Run
2606 /// targets and others are GKE clusters.
2607 pub status: bool,
2608
2609 /// Human readable error message.
2610 pub error_details: std::string::String,
2611
2612 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2613}
2614
2615impl TargetsTypeCondition {
2616 pub fn new() -> Self {
2617 std::default::Default::default()
2618 }
2619
2620 /// Sets the value of [status][crate::model::TargetsTypeCondition::status].
2621 ///
2622 /// # Example
2623 /// ```ignore,no_run
2624 /// # use google_cloud_deploy_v1::model::TargetsTypeCondition;
2625 /// let x = TargetsTypeCondition::new().set_status(true);
2626 /// ```
2627 pub fn set_status<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2628 self.status = v.into();
2629 self
2630 }
2631
2632 /// Sets the value of [error_details][crate::model::TargetsTypeCondition::error_details].
2633 ///
2634 /// # Example
2635 /// ```ignore,no_run
2636 /// # use google_cloud_deploy_v1::model::TargetsTypeCondition;
2637 /// let x = TargetsTypeCondition::new().set_error_details("example");
2638 /// ```
2639 pub fn set_error_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2640 self.error_details = v.into();
2641 self
2642 }
2643}
2644
2645impl wkt::message::Message for TargetsTypeCondition {
2646 fn typename() -> &'static str {
2647 "type.googleapis.com/google.cloud.deploy.v1.TargetsTypeCondition"
2648 }
2649}
2650
2651/// PipelineCondition contains all conditions relevant to a Delivery Pipeline.
2652#[derive(Clone, Default, PartialEq)]
2653#[non_exhaustive]
2654pub struct PipelineCondition {
2655 /// Details around the Pipeline's overall status.
2656 pub pipeline_ready_condition: std::option::Option<crate::model::PipelineReadyCondition>,
2657
2658 /// Details around targets enumerated in the pipeline.
2659 pub targets_present_condition: std::option::Option<crate::model::TargetsPresentCondition>,
2660
2661 /// Details on the whether the targets enumerated in the pipeline are of the
2662 /// same type.
2663 pub targets_type_condition: std::option::Option<crate::model::TargetsTypeCondition>,
2664
2665 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2666}
2667
2668impl PipelineCondition {
2669 pub fn new() -> Self {
2670 std::default::Default::default()
2671 }
2672
2673 /// Sets the value of [pipeline_ready_condition][crate::model::PipelineCondition::pipeline_ready_condition].
2674 ///
2675 /// # Example
2676 /// ```ignore,no_run
2677 /// # use google_cloud_deploy_v1::model::PipelineCondition;
2678 /// use google_cloud_deploy_v1::model::PipelineReadyCondition;
2679 /// let x = PipelineCondition::new().set_pipeline_ready_condition(PipelineReadyCondition::default()/* use setters */);
2680 /// ```
2681 pub fn set_pipeline_ready_condition<T>(mut self, v: T) -> Self
2682 where
2683 T: std::convert::Into<crate::model::PipelineReadyCondition>,
2684 {
2685 self.pipeline_ready_condition = std::option::Option::Some(v.into());
2686 self
2687 }
2688
2689 /// Sets or clears the value of [pipeline_ready_condition][crate::model::PipelineCondition::pipeline_ready_condition].
2690 ///
2691 /// # Example
2692 /// ```ignore,no_run
2693 /// # use google_cloud_deploy_v1::model::PipelineCondition;
2694 /// use google_cloud_deploy_v1::model::PipelineReadyCondition;
2695 /// let x = PipelineCondition::new().set_or_clear_pipeline_ready_condition(Some(PipelineReadyCondition::default()/* use setters */));
2696 /// let x = PipelineCondition::new().set_or_clear_pipeline_ready_condition(None::<PipelineReadyCondition>);
2697 /// ```
2698 pub fn set_or_clear_pipeline_ready_condition<T>(mut self, v: std::option::Option<T>) -> Self
2699 where
2700 T: std::convert::Into<crate::model::PipelineReadyCondition>,
2701 {
2702 self.pipeline_ready_condition = v.map(|x| x.into());
2703 self
2704 }
2705
2706 /// Sets the value of [targets_present_condition][crate::model::PipelineCondition::targets_present_condition].
2707 ///
2708 /// # Example
2709 /// ```ignore,no_run
2710 /// # use google_cloud_deploy_v1::model::PipelineCondition;
2711 /// use google_cloud_deploy_v1::model::TargetsPresentCondition;
2712 /// let x = PipelineCondition::new().set_targets_present_condition(TargetsPresentCondition::default()/* use setters */);
2713 /// ```
2714 pub fn set_targets_present_condition<T>(mut self, v: T) -> Self
2715 where
2716 T: std::convert::Into<crate::model::TargetsPresentCondition>,
2717 {
2718 self.targets_present_condition = std::option::Option::Some(v.into());
2719 self
2720 }
2721
2722 /// Sets or clears the value of [targets_present_condition][crate::model::PipelineCondition::targets_present_condition].
2723 ///
2724 /// # Example
2725 /// ```ignore,no_run
2726 /// # use google_cloud_deploy_v1::model::PipelineCondition;
2727 /// use google_cloud_deploy_v1::model::TargetsPresentCondition;
2728 /// let x = PipelineCondition::new().set_or_clear_targets_present_condition(Some(TargetsPresentCondition::default()/* use setters */));
2729 /// let x = PipelineCondition::new().set_or_clear_targets_present_condition(None::<TargetsPresentCondition>);
2730 /// ```
2731 pub fn set_or_clear_targets_present_condition<T>(mut self, v: std::option::Option<T>) -> Self
2732 where
2733 T: std::convert::Into<crate::model::TargetsPresentCondition>,
2734 {
2735 self.targets_present_condition = v.map(|x| x.into());
2736 self
2737 }
2738
2739 /// Sets the value of [targets_type_condition][crate::model::PipelineCondition::targets_type_condition].
2740 ///
2741 /// # Example
2742 /// ```ignore,no_run
2743 /// # use google_cloud_deploy_v1::model::PipelineCondition;
2744 /// use google_cloud_deploy_v1::model::TargetsTypeCondition;
2745 /// let x = PipelineCondition::new().set_targets_type_condition(TargetsTypeCondition::default()/* use setters */);
2746 /// ```
2747 pub fn set_targets_type_condition<T>(mut self, v: T) -> Self
2748 where
2749 T: std::convert::Into<crate::model::TargetsTypeCondition>,
2750 {
2751 self.targets_type_condition = std::option::Option::Some(v.into());
2752 self
2753 }
2754
2755 /// Sets or clears the value of [targets_type_condition][crate::model::PipelineCondition::targets_type_condition].
2756 ///
2757 /// # Example
2758 /// ```ignore,no_run
2759 /// # use google_cloud_deploy_v1::model::PipelineCondition;
2760 /// use google_cloud_deploy_v1::model::TargetsTypeCondition;
2761 /// let x = PipelineCondition::new().set_or_clear_targets_type_condition(Some(TargetsTypeCondition::default()/* use setters */));
2762 /// let x = PipelineCondition::new().set_or_clear_targets_type_condition(None::<TargetsTypeCondition>);
2763 /// ```
2764 pub fn set_or_clear_targets_type_condition<T>(mut self, v: std::option::Option<T>) -> Self
2765 where
2766 T: std::convert::Into<crate::model::TargetsTypeCondition>,
2767 {
2768 self.targets_type_condition = v.map(|x| x.into());
2769 self
2770 }
2771}
2772
2773impl wkt::message::Message for PipelineCondition {
2774 fn typename() -> &'static str {
2775 "type.googleapis.com/google.cloud.deploy.v1.PipelineCondition"
2776 }
2777}
2778
2779/// The request object for `ListDeliveryPipelines`.
2780#[derive(Clone, Default, PartialEq)]
2781#[non_exhaustive]
2782pub struct ListDeliveryPipelinesRequest {
2783 /// Required. The parent, which owns this collection of pipelines. Format must
2784 /// be `projects/{project_id}/locations/{location_name}`.
2785 pub parent: std::string::String,
2786
2787 /// The maximum number of pipelines to return. The service may return
2788 /// fewer than this value. If unspecified, at most 50 pipelines will
2789 /// be returned. The maximum value is 1000; values above 1000 will be set
2790 /// to 1000.
2791 pub page_size: i32,
2792
2793 /// A page token, received from a previous `ListDeliveryPipelines` call.
2794 /// Provide this to retrieve the subsequent page.
2795 ///
2796 /// When paginating, all other provided parameters match
2797 /// the call that provided the page token.
2798 pub page_token: std::string::String,
2799
2800 /// Filter pipelines to be returned. See <https://google.aip.dev/160> for more
2801 /// details.
2802 pub filter: std::string::String,
2803
2804 /// Field to sort by. See <https://google.aip.dev/132#ordering> for more details.
2805 pub order_by: std::string::String,
2806
2807 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2808}
2809
2810impl ListDeliveryPipelinesRequest {
2811 pub fn new() -> Self {
2812 std::default::Default::default()
2813 }
2814
2815 /// Sets the value of [parent][crate::model::ListDeliveryPipelinesRequest::parent].
2816 ///
2817 /// # Example
2818 /// ```ignore,no_run
2819 /// # use google_cloud_deploy_v1::model::ListDeliveryPipelinesRequest;
2820 /// let x = ListDeliveryPipelinesRequest::new().set_parent("example");
2821 /// ```
2822 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2823 self.parent = v.into();
2824 self
2825 }
2826
2827 /// Sets the value of [page_size][crate::model::ListDeliveryPipelinesRequest::page_size].
2828 ///
2829 /// # Example
2830 /// ```ignore,no_run
2831 /// # use google_cloud_deploy_v1::model::ListDeliveryPipelinesRequest;
2832 /// let x = ListDeliveryPipelinesRequest::new().set_page_size(42);
2833 /// ```
2834 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2835 self.page_size = v.into();
2836 self
2837 }
2838
2839 /// Sets the value of [page_token][crate::model::ListDeliveryPipelinesRequest::page_token].
2840 ///
2841 /// # Example
2842 /// ```ignore,no_run
2843 /// # use google_cloud_deploy_v1::model::ListDeliveryPipelinesRequest;
2844 /// let x = ListDeliveryPipelinesRequest::new().set_page_token("example");
2845 /// ```
2846 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2847 self.page_token = v.into();
2848 self
2849 }
2850
2851 /// Sets the value of [filter][crate::model::ListDeliveryPipelinesRequest::filter].
2852 ///
2853 /// # Example
2854 /// ```ignore,no_run
2855 /// # use google_cloud_deploy_v1::model::ListDeliveryPipelinesRequest;
2856 /// let x = ListDeliveryPipelinesRequest::new().set_filter("example");
2857 /// ```
2858 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2859 self.filter = v.into();
2860 self
2861 }
2862
2863 /// Sets the value of [order_by][crate::model::ListDeliveryPipelinesRequest::order_by].
2864 ///
2865 /// # Example
2866 /// ```ignore,no_run
2867 /// # use google_cloud_deploy_v1::model::ListDeliveryPipelinesRequest;
2868 /// let x = ListDeliveryPipelinesRequest::new().set_order_by("example");
2869 /// ```
2870 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2871 self.order_by = v.into();
2872 self
2873 }
2874}
2875
2876impl wkt::message::Message for ListDeliveryPipelinesRequest {
2877 fn typename() -> &'static str {
2878 "type.googleapis.com/google.cloud.deploy.v1.ListDeliveryPipelinesRequest"
2879 }
2880}
2881
2882/// The response object from `ListDeliveryPipelines`.
2883#[derive(Clone, Default, PartialEq)]
2884#[non_exhaustive]
2885pub struct ListDeliveryPipelinesResponse {
2886 /// The `DeliveryPipeline` objects.
2887 pub delivery_pipelines: std::vec::Vec<crate::model::DeliveryPipeline>,
2888
2889 /// A token, which can be sent as `page_token` to retrieve the next page.
2890 /// If this field is omitted, there are no subsequent pages.
2891 pub next_page_token: std::string::String,
2892
2893 /// Locations that could not be reached.
2894 pub unreachable: std::vec::Vec<std::string::String>,
2895
2896 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2897}
2898
2899impl ListDeliveryPipelinesResponse {
2900 pub fn new() -> Self {
2901 std::default::Default::default()
2902 }
2903
2904 /// Sets the value of [delivery_pipelines][crate::model::ListDeliveryPipelinesResponse::delivery_pipelines].
2905 ///
2906 /// # Example
2907 /// ```ignore,no_run
2908 /// # use google_cloud_deploy_v1::model::ListDeliveryPipelinesResponse;
2909 /// use google_cloud_deploy_v1::model::DeliveryPipeline;
2910 /// let x = ListDeliveryPipelinesResponse::new()
2911 /// .set_delivery_pipelines([
2912 /// DeliveryPipeline::default()/* use setters */,
2913 /// DeliveryPipeline::default()/* use (different) setters */,
2914 /// ]);
2915 /// ```
2916 pub fn set_delivery_pipelines<T, V>(mut self, v: T) -> Self
2917 where
2918 T: std::iter::IntoIterator<Item = V>,
2919 V: std::convert::Into<crate::model::DeliveryPipeline>,
2920 {
2921 use std::iter::Iterator;
2922 self.delivery_pipelines = v.into_iter().map(|i| i.into()).collect();
2923 self
2924 }
2925
2926 /// Sets the value of [next_page_token][crate::model::ListDeliveryPipelinesResponse::next_page_token].
2927 ///
2928 /// # Example
2929 /// ```ignore,no_run
2930 /// # use google_cloud_deploy_v1::model::ListDeliveryPipelinesResponse;
2931 /// let x = ListDeliveryPipelinesResponse::new().set_next_page_token("example");
2932 /// ```
2933 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2934 self.next_page_token = v.into();
2935 self
2936 }
2937
2938 /// Sets the value of [unreachable][crate::model::ListDeliveryPipelinesResponse::unreachable].
2939 ///
2940 /// # Example
2941 /// ```ignore,no_run
2942 /// # use google_cloud_deploy_v1::model::ListDeliveryPipelinesResponse;
2943 /// let x = ListDeliveryPipelinesResponse::new().set_unreachable(["a", "b", "c"]);
2944 /// ```
2945 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
2946 where
2947 T: std::iter::IntoIterator<Item = V>,
2948 V: std::convert::Into<std::string::String>,
2949 {
2950 use std::iter::Iterator;
2951 self.unreachable = v.into_iter().map(|i| i.into()).collect();
2952 self
2953 }
2954}
2955
2956impl wkt::message::Message for ListDeliveryPipelinesResponse {
2957 fn typename() -> &'static str {
2958 "type.googleapis.com/google.cloud.deploy.v1.ListDeliveryPipelinesResponse"
2959 }
2960}
2961
2962#[doc(hidden)]
2963impl google_cloud_gax::paginator::internal::PageableResponse for ListDeliveryPipelinesResponse {
2964 type PageItem = crate::model::DeliveryPipeline;
2965
2966 fn items(self) -> std::vec::Vec<Self::PageItem> {
2967 self.delivery_pipelines
2968 }
2969
2970 fn next_page_token(&self) -> std::string::String {
2971 use std::clone::Clone;
2972 self.next_page_token.clone()
2973 }
2974}
2975
2976/// The request object for `GetDeliveryPipeline`
2977#[derive(Clone, Default, PartialEq)]
2978#[non_exhaustive]
2979pub struct GetDeliveryPipelineRequest {
2980 /// Required. Name of the `DeliveryPipeline`. Format must be
2981 /// `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}`.
2982 pub name: std::string::String,
2983
2984 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2985}
2986
2987impl GetDeliveryPipelineRequest {
2988 pub fn new() -> Self {
2989 std::default::Default::default()
2990 }
2991
2992 /// Sets the value of [name][crate::model::GetDeliveryPipelineRequest::name].
2993 ///
2994 /// # Example
2995 /// ```ignore,no_run
2996 /// # use google_cloud_deploy_v1::model::GetDeliveryPipelineRequest;
2997 /// let x = GetDeliveryPipelineRequest::new().set_name("example");
2998 /// ```
2999 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3000 self.name = v.into();
3001 self
3002 }
3003}
3004
3005impl wkt::message::Message for GetDeliveryPipelineRequest {
3006 fn typename() -> &'static str {
3007 "type.googleapis.com/google.cloud.deploy.v1.GetDeliveryPipelineRequest"
3008 }
3009}
3010
3011/// The request object for `CreateDeliveryPipeline`.
3012#[derive(Clone, Default, PartialEq)]
3013#[non_exhaustive]
3014pub struct CreateDeliveryPipelineRequest {
3015 /// Required. The parent collection in which the `DeliveryPipeline` must be
3016 /// created. The format is `projects/{project_id}/locations/{location_name}`.
3017 pub parent: std::string::String,
3018
3019 /// Required. ID of the `DeliveryPipeline`.
3020 pub delivery_pipeline_id: std::string::String,
3021
3022 /// Required. The `DeliveryPipeline` to create.
3023 pub delivery_pipeline: std::option::Option<crate::model::DeliveryPipeline>,
3024
3025 /// Optional. A request ID to identify requests. Specify a unique request ID
3026 /// so that if you must retry your request, the server knows to ignore the
3027 /// request if it has already been completed. The server guarantees that for
3028 /// at least 60 minutes after the first request.
3029 ///
3030 /// For example, consider a situation where you make an initial request and the
3031 /// request times out. If you make the request again with the same request ID,
3032 /// the server can check if original operation with the same request ID was
3033 /// received, and if so, will ignore the second request. This prevents clients
3034 /// from accidentally creating duplicate commitments.
3035 ///
3036 /// The request ID must be a valid UUID with the exception that zero UUID is
3037 /// not supported (00000000-0000-0000-0000-000000000000).
3038 pub request_id: std::string::String,
3039
3040 /// Optional. If set to true, the request is validated and the user is provided
3041 /// with an expected result, but no actual change is made.
3042 pub validate_only: bool,
3043
3044 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3045}
3046
3047impl CreateDeliveryPipelineRequest {
3048 pub fn new() -> Self {
3049 std::default::Default::default()
3050 }
3051
3052 /// Sets the value of [parent][crate::model::CreateDeliveryPipelineRequest::parent].
3053 ///
3054 /// # Example
3055 /// ```ignore,no_run
3056 /// # use google_cloud_deploy_v1::model::CreateDeliveryPipelineRequest;
3057 /// let x = CreateDeliveryPipelineRequest::new().set_parent("example");
3058 /// ```
3059 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3060 self.parent = v.into();
3061 self
3062 }
3063
3064 /// Sets the value of [delivery_pipeline_id][crate::model::CreateDeliveryPipelineRequest::delivery_pipeline_id].
3065 ///
3066 /// # Example
3067 /// ```ignore,no_run
3068 /// # use google_cloud_deploy_v1::model::CreateDeliveryPipelineRequest;
3069 /// let x = CreateDeliveryPipelineRequest::new().set_delivery_pipeline_id("example");
3070 /// ```
3071 pub fn set_delivery_pipeline_id<T: std::convert::Into<std::string::String>>(
3072 mut self,
3073 v: T,
3074 ) -> Self {
3075 self.delivery_pipeline_id = v.into();
3076 self
3077 }
3078
3079 /// Sets the value of [delivery_pipeline][crate::model::CreateDeliveryPipelineRequest::delivery_pipeline].
3080 ///
3081 /// # Example
3082 /// ```ignore,no_run
3083 /// # use google_cloud_deploy_v1::model::CreateDeliveryPipelineRequest;
3084 /// use google_cloud_deploy_v1::model::DeliveryPipeline;
3085 /// let x = CreateDeliveryPipelineRequest::new().set_delivery_pipeline(DeliveryPipeline::default()/* use setters */);
3086 /// ```
3087 pub fn set_delivery_pipeline<T>(mut self, v: T) -> Self
3088 where
3089 T: std::convert::Into<crate::model::DeliveryPipeline>,
3090 {
3091 self.delivery_pipeline = std::option::Option::Some(v.into());
3092 self
3093 }
3094
3095 /// Sets or clears the value of [delivery_pipeline][crate::model::CreateDeliveryPipelineRequest::delivery_pipeline].
3096 ///
3097 /// # Example
3098 /// ```ignore,no_run
3099 /// # use google_cloud_deploy_v1::model::CreateDeliveryPipelineRequest;
3100 /// use google_cloud_deploy_v1::model::DeliveryPipeline;
3101 /// let x = CreateDeliveryPipelineRequest::new().set_or_clear_delivery_pipeline(Some(DeliveryPipeline::default()/* use setters */));
3102 /// let x = CreateDeliveryPipelineRequest::new().set_or_clear_delivery_pipeline(None::<DeliveryPipeline>);
3103 /// ```
3104 pub fn set_or_clear_delivery_pipeline<T>(mut self, v: std::option::Option<T>) -> Self
3105 where
3106 T: std::convert::Into<crate::model::DeliveryPipeline>,
3107 {
3108 self.delivery_pipeline = v.map(|x| x.into());
3109 self
3110 }
3111
3112 /// Sets the value of [request_id][crate::model::CreateDeliveryPipelineRequest::request_id].
3113 ///
3114 /// # Example
3115 /// ```ignore,no_run
3116 /// # use google_cloud_deploy_v1::model::CreateDeliveryPipelineRequest;
3117 /// let x = CreateDeliveryPipelineRequest::new().set_request_id("example");
3118 /// ```
3119 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3120 self.request_id = v.into();
3121 self
3122 }
3123
3124 /// Sets the value of [validate_only][crate::model::CreateDeliveryPipelineRequest::validate_only].
3125 ///
3126 /// # Example
3127 /// ```ignore,no_run
3128 /// # use google_cloud_deploy_v1::model::CreateDeliveryPipelineRequest;
3129 /// let x = CreateDeliveryPipelineRequest::new().set_validate_only(true);
3130 /// ```
3131 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3132 self.validate_only = v.into();
3133 self
3134 }
3135}
3136
3137impl wkt::message::Message for CreateDeliveryPipelineRequest {
3138 fn typename() -> &'static str {
3139 "type.googleapis.com/google.cloud.deploy.v1.CreateDeliveryPipelineRequest"
3140 }
3141}
3142
3143/// The request object for `UpdateDeliveryPipeline`.
3144#[derive(Clone, Default, PartialEq)]
3145#[non_exhaustive]
3146pub struct UpdateDeliveryPipelineRequest {
3147 /// Required. Field mask is used to specify the fields to be overwritten by the
3148 /// update in the `DeliveryPipeline` resource. The fields specified in the
3149 /// update_mask are relative to the resource, not the full request. A field
3150 /// will be overwritten if it's in the mask. If the user doesn't provide a mask
3151 /// then all fields are overwritten.
3152 pub update_mask: std::option::Option<wkt::FieldMask>,
3153
3154 /// Required. The `DeliveryPipeline` to update.
3155 pub delivery_pipeline: std::option::Option<crate::model::DeliveryPipeline>,
3156
3157 /// Optional. A request ID to identify requests. Specify a unique request ID
3158 /// so that if you must retry your request, the server knows to ignore the
3159 /// request if it has already been completed. The server guarantees that for
3160 /// at least 60 minutes after the first request.
3161 ///
3162 /// For example, consider a situation where you make an initial request and the
3163 /// request times out. If you make the request again with the same request ID,
3164 /// the server can check if original operation with the same request ID was
3165 /// received, and if so, will ignore the second request. This prevents clients
3166 /// from accidentally creating duplicate commitments.
3167 ///
3168 /// The request ID must be a valid UUID with the exception that zero UUID is
3169 /// not supported (00000000-0000-0000-0000-000000000000).
3170 pub request_id: std::string::String,
3171
3172 /// Optional. If set to true, updating a `DeliveryPipeline` that does not exist
3173 /// will result in the creation of a new `DeliveryPipeline`.
3174 pub allow_missing: bool,
3175
3176 /// Optional. If set to true, the request is validated and the user is provided
3177 /// with an expected result, but no actual change is made.
3178 pub validate_only: bool,
3179
3180 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3181}
3182
3183impl UpdateDeliveryPipelineRequest {
3184 pub fn new() -> Self {
3185 std::default::Default::default()
3186 }
3187
3188 /// Sets the value of [update_mask][crate::model::UpdateDeliveryPipelineRequest::update_mask].
3189 ///
3190 /// # Example
3191 /// ```ignore,no_run
3192 /// # use google_cloud_deploy_v1::model::UpdateDeliveryPipelineRequest;
3193 /// use wkt::FieldMask;
3194 /// let x = UpdateDeliveryPipelineRequest::new().set_update_mask(FieldMask::default()/* use setters */);
3195 /// ```
3196 pub fn set_update_mask<T>(mut self, v: T) -> Self
3197 where
3198 T: std::convert::Into<wkt::FieldMask>,
3199 {
3200 self.update_mask = std::option::Option::Some(v.into());
3201 self
3202 }
3203
3204 /// Sets or clears the value of [update_mask][crate::model::UpdateDeliveryPipelineRequest::update_mask].
3205 ///
3206 /// # Example
3207 /// ```ignore,no_run
3208 /// # use google_cloud_deploy_v1::model::UpdateDeliveryPipelineRequest;
3209 /// use wkt::FieldMask;
3210 /// let x = UpdateDeliveryPipelineRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
3211 /// let x = UpdateDeliveryPipelineRequest::new().set_or_clear_update_mask(None::<FieldMask>);
3212 /// ```
3213 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3214 where
3215 T: std::convert::Into<wkt::FieldMask>,
3216 {
3217 self.update_mask = v.map(|x| x.into());
3218 self
3219 }
3220
3221 /// Sets the value of [delivery_pipeline][crate::model::UpdateDeliveryPipelineRequest::delivery_pipeline].
3222 ///
3223 /// # Example
3224 /// ```ignore,no_run
3225 /// # use google_cloud_deploy_v1::model::UpdateDeliveryPipelineRequest;
3226 /// use google_cloud_deploy_v1::model::DeliveryPipeline;
3227 /// let x = UpdateDeliveryPipelineRequest::new().set_delivery_pipeline(DeliveryPipeline::default()/* use setters */);
3228 /// ```
3229 pub fn set_delivery_pipeline<T>(mut self, v: T) -> Self
3230 where
3231 T: std::convert::Into<crate::model::DeliveryPipeline>,
3232 {
3233 self.delivery_pipeline = std::option::Option::Some(v.into());
3234 self
3235 }
3236
3237 /// Sets or clears the value of [delivery_pipeline][crate::model::UpdateDeliveryPipelineRequest::delivery_pipeline].
3238 ///
3239 /// # Example
3240 /// ```ignore,no_run
3241 /// # use google_cloud_deploy_v1::model::UpdateDeliveryPipelineRequest;
3242 /// use google_cloud_deploy_v1::model::DeliveryPipeline;
3243 /// let x = UpdateDeliveryPipelineRequest::new().set_or_clear_delivery_pipeline(Some(DeliveryPipeline::default()/* use setters */));
3244 /// let x = UpdateDeliveryPipelineRequest::new().set_or_clear_delivery_pipeline(None::<DeliveryPipeline>);
3245 /// ```
3246 pub fn set_or_clear_delivery_pipeline<T>(mut self, v: std::option::Option<T>) -> Self
3247 where
3248 T: std::convert::Into<crate::model::DeliveryPipeline>,
3249 {
3250 self.delivery_pipeline = v.map(|x| x.into());
3251 self
3252 }
3253
3254 /// Sets the value of [request_id][crate::model::UpdateDeliveryPipelineRequest::request_id].
3255 ///
3256 /// # Example
3257 /// ```ignore,no_run
3258 /// # use google_cloud_deploy_v1::model::UpdateDeliveryPipelineRequest;
3259 /// let x = UpdateDeliveryPipelineRequest::new().set_request_id("example");
3260 /// ```
3261 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3262 self.request_id = v.into();
3263 self
3264 }
3265
3266 /// Sets the value of [allow_missing][crate::model::UpdateDeliveryPipelineRequest::allow_missing].
3267 ///
3268 /// # Example
3269 /// ```ignore,no_run
3270 /// # use google_cloud_deploy_v1::model::UpdateDeliveryPipelineRequest;
3271 /// let x = UpdateDeliveryPipelineRequest::new().set_allow_missing(true);
3272 /// ```
3273 pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3274 self.allow_missing = v.into();
3275 self
3276 }
3277
3278 /// Sets the value of [validate_only][crate::model::UpdateDeliveryPipelineRequest::validate_only].
3279 ///
3280 /// # Example
3281 /// ```ignore,no_run
3282 /// # use google_cloud_deploy_v1::model::UpdateDeliveryPipelineRequest;
3283 /// let x = UpdateDeliveryPipelineRequest::new().set_validate_only(true);
3284 /// ```
3285 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3286 self.validate_only = v.into();
3287 self
3288 }
3289}
3290
3291impl wkt::message::Message for UpdateDeliveryPipelineRequest {
3292 fn typename() -> &'static str {
3293 "type.googleapis.com/google.cloud.deploy.v1.UpdateDeliveryPipelineRequest"
3294 }
3295}
3296
3297/// The request object for `DeleteDeliveryPipeline`.
3298#[derive(Clone, Default, PartialEq)]
3299#[non_exhaustive]
3300pub struct DeleteDeliveryPipelineRequest {
3301 /// Required. The name of the `DeliveryPipeline` to delete. The format is
3302 /// `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}`.
3303 pub name: std::string::String,
3304
3305 /// Optional. A request ID to identify requests. Specify a unique request ID
3306 /// so that if you must retry your request, the server knows to ignore the
3307 /// request if it has already been completed. The server guarantees that for
3308 /// at least 60 minutes after the first request.
3309 ///
3310 /// For example, consider a situation where you make an initial request and the
3311 /// request times out. If you make the request again with the same request ID,
3312 /// the server can check if original operation with the same request ID was
3313 /// received, and if so, will ignore the second request. This prevents clients
3314 /// from accidentally creating duplicate commitments.
3315 ///
3316 /// The request ID must be a valid UUID with the exception that zero UUID is
3317 /// not supported (00000000-0000-0000-0000-000000000000).
3318 pub request_id: std::string::String,
3319
3320 /// Optional. If set to true, then deleting an already deleted or non-existing
3321 /// `DeliveryPipeline` will succeed.
3322 pub allow_missing: bool,
3323
3324 /// Optional. If set, validate the request and preview the review, but do not
3325 /// actually post it.
3326 pub validate_only: bool,
3327
3328 /// Optional. If set to true, all child resources under this pipeline will also
3329 /// be deleted. Otherwise, the request will only work if the pipeline has no
3330 /// child resources.
3331 pub force: bool,
3332
3333 /// Optional. This checksum is computed by the server based on the value of
3334 /// other fields, and may be sent on update and delete requests to ensure the
3335 /// client has an up-to-date value before proceeding.
3336 pub etag: std::string::String,
3337
3338 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3339}
3340
3341impl DeleteDeliveryPipelineRequest {
3342 pub fn new() -> Self {
3343 std::default::Default::default()
3344 }
3345
3346 /// Sets the value of [name][crate::model::DeleteDeliveryPipelineRequest::name].
3347 ///
3348 /// # Example
3349 /// ```ignore,no_run
3350 /// # use google_cloud_deploy_v1::model::DeleteDeliveryPipelineRequest;
3351 /// let x = DeleteDeliveryPipelineRequest::new().set_name("example");
3352 /// ```
3353 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3354 self.name = v.into();
3355 self
3356 }
3357
3358 /// Sets the value of [request_id][crate::model::DeleteDeliveryPipelineRequest::request_id].
3359 ///
3360 /// # Example
3361 /// ```ignore,no_run
3362 /// # use google_cloud_deploy_v1::model::DeleteDeliveryPipelineRequest;
3363 /// let x = DeleteDeliveryPipelineRequest::new().set_request_id("example");
3364 /// ```
3365 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3366 self.request_id = v.into();
3367 self
3368 }
3369
3370 /// Sets the value of [allow_missing][crate::model::DeleteDeliveryPipelineRequest::allow_missing].
3371 ///
3372 /// # Example
3373 /// ```ignore,no_run
3374 /// # use google_cloud_deploy_v1::model::DeleteDeliveryPipelineRequest;
3375 /// let x = DeleteDeliveryPipelineRequest::new().set_allow_missing(true);
3376 /// ```
3377 pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3378 self.allow_missing = v.into();
3379 self
3380 }
3381
3382 /// Sets the value of [validate_only][crate::model::DeleteDeliveryPipelineRequest::validate_only].
3383 ///
3384 /// # Example
3385 /// ```ignore,no_run
3386 /// # use google_cloud_deploy_v1::model::DeleteDeliveryPipelineRequest;
3387 /// let x = DeleteDeliveryPipelineRequest::new().set_validate_only(true);
3388 /// ```
3389 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3390 self.validate_only = v.into();
3391 self
3392 }
3393
3394 /// Sets the value of [force][crate::model::DeleteDeliveryPipelineRequest::force].
3395 ///
3396 /// # Example
3397 /// ```ignore,no_run
3398 /// # use google_cloud_deploy_v1::model::DeleteDeliveryPipelineRequest;
3399 /// let x = DeleteDeliveryPipelineRequest::new().set_force(true);
3400 /// ```
3401 pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3402 self.force = v.into();
3403 self
3404 }
3405
3406 /// Sets the value of [etag][crate::model::DeleteDeliveryPipelineRequest::etag].
3407 ///
3408 /// # Example
3409 /// ```ignore,no_run
3410 /// # use google_cloud_deploy_v1::model::DeleteDeliveryPipelineRequest;
3411 /// let x = DeleteDeliveryPipelineRequest::new().set_etag("example");
3412 /// ```
3413 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3414 self.etag = v.into();
3415 self
3416 }
3417}
3418
3419impl wkt::message::Message for DeleteDeliveryPipelineRequest {
3420 fn typename() -> &'static str {
3421 "type.googleapis.com/google.cloud.deploy.v1.DeleteDeliveryPipelineRequest"
3422 }
3423}
3424
3425/// Configs for the Rollback rollout.
3426#[derive(Clone, Default, PartialEq)]
3427#[non_exhaustive]
3428pub struct RollbackTargetConfig {
3429 /// Optional. The rollback `Rollout` to create.
3430 pub rollout: std::option::Option<crate::model::Rollout>,
3431
3432 /// Optional. The starting phase ID for the `Rollout`. If unspecified, the
3433 /// `Rollout` will start in the stable phase.
3434 pub starting_phase_id: std::string::String,
3435
3436 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3437}
3438
3439impl RollbackTargetConfig {
3440 pub fn new() -> Self {
3441 std::default::Default::default()
3442 }
3443
3444 /// Sets the value of [rollout][crate::model::RollbackTargetConfig::rollout].
3445 ///
3446 /// # Example
3447 /// ```ignore,no_run
3448 /// # use google_cloud_deploy_v1::model::RollbackTargetConfig;
3449 /// use google_cloud_deploy_v1::model::Rollout;
3450 /// let x = RollbackTargetConfig::new().set_rollout(Rollout::default()/* use setters */);
3451 /// ```
3452 pub fn set_rollout<T>(mut self, v: T) -> Self
3453 where
3454 T: std::convert::Into<crate::model::Rollout>,
3455 {
3456 self.rollout = std::option::Option::Some(v.into());
3457 self
3458 }
3459
3460 /// Sets or clears the value of [rollout][crate::model::RollbackTargetConfig::rollout].
3461 ///
3462 /// # Example
3463 /// ```ignore,no_run
3464 /// # use google_cloud_deploy_v1::model::RollbackTargetConfig;
3465 /// use google_cloud_deploy_v1::model::Rollout;
3466 /// let x = RollbackTargetConfig::new().set_or_clear_rollout(Some(Rollout::default()/* use setters */));
3467 /// let x = RollbackTargetConfig::new().set_or_clear_rollout(None::<Rollout>);
3468 /// ```
3469 pub fn set_or_clear_rollout<T>(mut self, v: std::option::Option<T>) -> Self
3470 where
3471 T: std::convert::Into<crate::model::Rollout>,
3472 {
3473 self.rollout = v.map(|x| x.into());
3474 self
3475 }
3476
3477 /// Sets the value of [starting_phase_id][crate::model::RollbackTargetConfig::starting_phase_id].
3478 ///
3479 /// # Example
3480 /// ```ignore,no_run
3481 /// # use google_cloud_deploy_v1::model::RollbackTargetConfig;
3482 /// let x = RollbackTargetConfig::new().set_starting_phase_id("example");
3483 /// ```
3484 pub fn set_starting_phase_id<T: std::convert::Into<std::string::String>>(
3485 mut self,
3486 v: T,
3487 ) -> Self {
3488 self.starting_phase_id = v.into();
3489 self
3490 }
3491}
3492
3493impl wkt::message::Message for RollbackTargetConfig {
3494 fn typename() -> &'static str {
3495 "type.googleapis.com/google.cloud.deploy.v1.RollbackTargetConfig"
3496 }
3497}
3498
3499/// The request object for `RollbackTarget`.
3500#[derive(Clone, Default, PartialEq)]
3501#[non_exhaustive]
3502pub struct RollbackTargetRequest {
3503 /// Required. The `DeliveryPipeline` for which the rollback `Rollout` must be
3504 /// created. The format is
3505 /// `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}`.
3506 pub name: std::string::String,
3507
3508 /// Required. ID of the `Target` that is being rolled back.
3509 pub target_id: std::string::String,
3510
3511 /// Required. ID of the rollback `Rollout` to create.
3512 pub rollout_id: std::string::String,
3513
3514 /// Optional. ID of the `Release` to roll back to. If this isn't specified, the
3515 /// previous successful `Rollout` to the specified target will be used to
3516 /// determine the `Release`.
3517 pub release_id: std::string::String,
3518
3519 /// Optional. If provided, this must be the latest `Rollout` that is on the
3520 /// `Target`.
3521 pub rollout_to_roll_back: std::string::String,
3522
3523 /// Optional. Configs for the rollback `Rollout`.
3524 pub rollback_config: std::option::Option<crate::model::RollbackTargetConfig>,
3525
3526 /// Optional. If set to true, the request is validated and the user is provided
3527 /// with a `RollbackTargetResponse`.
3528 pub validate_only: bool,
3529
3530 /// Optional. Deploy policies to override. Format is
3531 /// `projects/{project}/locations/{location}/deployPolicies/{deploy_policy}`.
3532 pub override_deploy_policy: std::vec::Vec<std::string::String>,
3533
3534 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3535}
3536
3537impl RollbackTargetRequest {
3538 pub fn new() -> Self {
3539 std::default::Default::default()
3540 }
3541
3542 /// Sets the value of [name][crate::model::RollbackTargetRequest::name].
3543 ///
3544 /// # Example
3545 /// ```ignore,no_run
3546 /// # use google_cloud_deploy_v1::model::RollbackTargetRequest;
3547 /// let x = RollbackTargetRequest::new().set_name("example");
3548 /// ```
3549 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3550 self.name = v.into();
3551 self
3552 }
3553
3554 /// Sets the value of [target_id][crate::model::RollbackTargetRequest::target_id].
3555 ///
3556 /// # Example
3557 /// ```ignore,no_run
3558 /// # use google_cloud_deploy_v1::model::RollbackTargetRequest;
3559 /// let x = RollbackTargetRequest::new().set_target_id("example");
3560 /// ```
3561 pub fn set_target_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3562 self.target_id = v.into();
3563 self
3564 }
3565
3566 /// Sets the value of [rollout_id][crate::model::RollbackTargetRequest::rollout_id].
3567 ///
3568 /// # Example
3569 /// ```ignore,no_run
3570 /// # use google_cloud_deploy_v1::model::RollbackTargetRequest;
3571 /// let x = RollbackTargetRequest::new().set_rollout_id("example");
3572 /// ```
3573 pub fn set_rollout_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3574 self.rollout_id = v.into();
3575 self
3576 }
3577
3578 /// Sets the value of [release_id][crate::model::RollbackTargetRequest::release_id].
3579 ///
3580 /// # Example
3581 /// ```ignore,no_run
3582 /// # use google_cloud_deploy_v1::model::RollbackTargetRequest;
3583 /// let x = RollbackTargetRequest::new().set_release_id("example");
3584 /// ```
3585 pub fn set_release_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3586 self.release_id = v.into();
3587 self
3588 }
3589
3590 /// Sets the value of [rollout_to_roll_back][crate::model::RollbackTargetRequest::rollout_to_roll_back].
3591 ///
3592 /// # Example
3593 /// ```ignore,no_run
3594 /// # use google_cloud_deploy_v1::model::RollbackTargetRequest;
3595 /// let x = RollbackTargetRequest::new().set_rollout_to_roll_back("example");
3596 /// ```
3597 pub fn set_rollout_to_roll_back<T: std::convert::Into<std::string::String>>(
3598 mut self,
3599 v: T,
3600 ) -> Self {
3601 self.rollout_to_roll_back = v.into();
3602 self
3603 }
3604
3605 /// Sets the value of [rollback_config][crate::model::RollbackTargetRequest::rollback_config].
3606 ///
3607 /// # Example
3608 /// ```ignore,no_run
3609 /// # use google_cloud_deploy_v1::model::RollbackTargetRequest;
3610 /// use google_cloud_deploy_v1::model::RollbackTargetConfig;
3611 /// let x = RollbackTargetRequest::new().set_rollback_config(RollbackTargetConfig::default()/* use setters */);
3612 /// ```
3613 pub fn set_rollback_config<T>(mut self, v: T) -> Self
3614 where
3615 T: std::convert::Into<crate::model::RollbackTargetConfig>,
3616 {
3617 self.rollback_config = std::option::Option::Some(v.into());
3618 self
3619 }
3620
3621 /// Sets or clears the value of [rollback_config][crate::model::RollbackTargetRequest::rollback_config].
3622 ///
3623 /// # Example
3624 /// ```ignore,no_run
3625 /// # use google_cloud_deploy_v1::model::RollbackTargetRequest;
3626 /// use google_cloud_deploy_v1::model::RollbackTargetConfig;
3627 /// let x = RollbackTargetRequest::new().set_or_clear_rollback_config(Some(RollbackTargetConfig::default()/* use setters */));
3628 /// let x = RollbackTargetRequest::new().set_or_clear_rollback_config(None::<RollbackTargetConfig>);
3629 /// ```
3630 pub fn set_or_clear_rollback_config<T>(mut self, v: std::option::Option<T>) -> Self
3631 where
3632 T: std::convert::Into<crate::model::RollbackTargetConfig>,
3633 {
3634 self.rollback_config = v.map(|x| x.into());
3635 self
3636 }
3637
3638 /// Sets the value of [validate_only][crate::model::RollbackTargetRequest::validate_only].
3639 ///
3640 /// # Example
3641 /// ```ignore,no_run
3642 /// # use google_cloud_deploy_v1::model::RollbackTargetRequest;
3643 /// let x = RollbackTargetRequest::new().set_validate_only(true);
3644 /// ```
3645 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3646 self.validate_only = v.into();
3647 self
3648 }
3649
3650 /// Sets the value of [override_deploy_policy][crate::model::RollbackTargetRequest::override_deploy_policy].
3651 ///
3652 /// # Example
3653 /// ```ignore,no_run
3654 /// # use google_cloud_deploy_v1::model::RollbackTargetRequest;
3655 /// let x = RollbackTargetRequest::new().set_override_deploy_policy(["a", "b", "c"]);
3656 /// ```
3657 pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
3658 where
3659 T: std::iter::IntoIterator<Item = V>,
3660 V: std::convert::Into<std::string::String>,
3661 {
3662 use std::iter::Iterator;
3663 self.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
3664 self
3665 }
3666}
3667
3668impl wkt::message::Message for RollbackTargetRequest {
3669 fn typename() -> &'static str {
3670 "type.googleapis.com/google.cloud.deploy.v1.RollbackTargetRequest"
3671 }
3672}
3673
3674/// The response object from `RollbackTarget`.
3675#[derive(Clone, Default, PartialEq)]
3676#[non_exhaustive]
3677pub struct RollbackTargetResponse {
3678 /// The config of the rollback `Rollout` created or will be created.
3679 pub rollback_config: std::option::Option<crate::model::RollbackTargetConfig>,
3680
3681 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3682}
3683
3684impl RollbackTargetResponse {
3685 pub fn new() -> Self {
3686 std::default::Default::default()
3687 }
3688
3689 /// Sets the value of [rollback_config][crate::model::RollbackTargetResponse::rollback_config].
3690 ///
3691 /// # Example
3692 /// ```ignore,no_run
3693 /// # use google_cloud_deploy_v1::model::RollbackTargetResponse;
3694 /// use google_cloud_deploy_v1::model::RollbackTargetConfig;
3695 /// let x = RollbackTargetResponse::new().set_rollback_config(RollbackTargetConfig::default()/* use setters */);
3696 /// ```
3697 pub fn set_rollback_config<T>(mut self, v: T) -> Self
3698 where
3699 T: std::convert::Into<crate::model::RollbackTargetConfig>,
3700 {
3701 self.rollback_config = std::option::Option::Some(v.into());
3702 self
3703 }
3704
3705 /// Sets or clears the value of [rollback_config][crate::model::RollbackTargetResponse::rollback_config].
3706 ///
3707 /// # Example
3708 /// ```ignore,no_run
3709 /// # use google_cloud_deploy_v1::model::RollbackTargetResponse;
3710 /// use google_cloud_deploy_v1::model::RollbackTargetConfig;
3711 /// let x = RollbackTargetResponse::new().set_or_clear_rollback_config(Some(RollbackTargetConfig::default()/* use setters */));
3712 /// let x = RollbackTargetResponse::new().set_or_clear_rollback_config(None::<RollbackTargetConfig>);
3713 /// ```
3714 pub fn set_or_clear_rollback_config<T>(mut self, v: std::option::Option<T>) -> Self
3715 where
3716 T: std::convert::Into<crate::model::RollbackTargetConfig>,
3717 {
3718 self.rollback_config = v.map(|x| x.into());
3719 self
3720 }
3721}
3722
3723impl wkt::message::Message for RollbackTargetResponse {
3724 fn typename() -> &'static str {
3725 "type.googleapis.com/google.cloud.deploy.v1.RollbackTargetResponse"
3726 }
3727}
3728
3729/// A `Target` resource in the Cloud Deploy API.
3730///
3731/// A `Target` defines a location to which a Skaffold configuration
3732/// can be deployed.
3733#[derive(Clone, Default, PartialEq)]
3734#[non_exhaustive]
3735pub struct Target {
3736 /// Identifier. Name of the `Target`. Format is
3737 /// `projects/{project}/locations/{location}/targets/{target}`.
3738 /// The `target` component must match `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`
3739 pub name: std::string::String,
3740
3741 /// Output only. Resource id of the `Target`.
3742 pub target_id: std::string::String,
3743
3744 /// Output only. Unique identifier of the `Target`.
3745 pub uid: std::string::String,
3746
3747 /// Optional. Description of the `Target`. Max length is 255 characters.
3748 pub description: std::string::String,
3749
3750 /// Optional. User annotations. These attributes can only be set and used by
3751 /// the user, and not by Cloud Deploy. See
3752 /// <https://google.aip.dev/128#annotations> for more details such as format and
3753 /// size limitations.
3754 pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
3755
3756 /// Optional. Labels are attributes that can be set and used by both the
3757 /// user and by Cloud Deploy. Labels must meet the following constraints:
3758 ///
3759 /// * Keys and values can contain only lowercase letters, numeric characters,
3760 /// underscores, and dashes.
3761 /// * All characters must use UTF-8 encoding, and international characters are
3762 /// allowed.
3763 /// * Keys must start with a lowercase letter or international character.
3764 /// * Each resource is limited to a maximum of 64 labels.
3765 ///
3766 /// Both keys and values are additionally constrained to be <= 128 bytes.
3767 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
3768
3769 /// Optional. Whether or not the `Target` requires approval.
3770 pub require_approval: bool,
3771
3772 /// Output only. Time at which the `Target` was created.
3773 pub create_time: std::option::Option<wkt::Timestamp>,
3774
3775 /// Output only. Most recent time at which the `Target` was updated.
3776 pub update_time: std::option::Option<wkt::Timestamp>,
3777
3778 /// Optional. Map of entity IDs to their associated entities. Associated
3779 /// entities allows specifying places other than the deployment target for
3780 /// specific features. For example, the Gateway API canary can be configured to
3781 /// deploy the HTTPRoute to a different cluster(s) than the deployment cluster
3782 /// using associated entities. An entity ID must consist of lower-case letters,
3783 /// numbers, and hyphens, start with a letter and end with a letter or a
3784 /// number, and have a max length of 63 characters. In other words, it must
3785 /// match the following regex: `^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$`.
3786 pub associated_entities:
3787 std::collections::HashMap<std::string::String, crate::model::AssociatedEntities>,
3788
3789 /// Optional. This checksum is computed by the server based on the value of
3790 /// other fields, and may be sent on update and delete requests to ensure the
3791 /// client has an up-to-date value before proceeding.
3792 pub etag: std::string::String,
3793
3794 /// Optional. Configurations for all execution that relates to this `Target`.
3795 /// Each `ExecutionEnvironmentUsage` value may only be used in a single
3796 /// configuration; using the same value multiple times is an error.
3797 /// When one or more configurations are specified, they must include the
3798 /// `RENDER` and `DEPLOY` `ExecutionEnvironmentUsage` values.
3799 /// When no configurations are specified, execution will use the default
3800 /// specified in `DefaultPool`.
3801 pub execution_configs: std::vec::Vec<crate::model::ExecutionConfig>,
3802
3803 /// Optional. The deploy parameters to use for this target.
3804 pub deploy_parameters: std::collections::HashMap<std::string::String, std::string::String>,
3805
3806 /// Destination to which the Skaffold configuration is applied during a
3807 /// rollout.
3808 pub deployment_target: std::option::Option<crate::model::target::DeploymentTarget>,
3809
3810 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3811}
3812
3813impl Target {
3814 pub fn new() -> Self {
3815 std::default::Default::default()
3816 }
3817
3818 /// Sets the value of [name][crate::model::Target::name].
3819 ///
3820 /// # Example
3821 /// ```ignore,no_run
3822 /// # use google_cloud_deploy_v1::model::Target;
3823 /// let x = Target::new().set_name("example");
3824 /// ```
3825 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3826 self.name = v.into();
3827 self
3828 }
3829
3830 /// Sets the value of [target_id][crate::model::Target::target_id].
3831 ///
3832 /// # Example
3833 /// ```ignore,no_run
3834 /// # use google_cloud_deploy_v1::model::Target;
3835 /// let x = Target::new().set_target_id("example");
3836 /// ```
3837 pub fn set_target_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3838 self.target_id = v.into();
3839 self
3840 }
3841
3842 /// Sets the value of [uid][crate::model::Target::uid].
3843 ///
3844 /// # Example
3845 /// ```ignore,no_run
3846 /// # use google_cloud_deploy_v1::model::Target;
3847 /// let x = Target::new().set_uid("example");
3848 /// ```
3849 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3850 self.uid = v.into();
3851 self
3852 }
3853
3854 /// Sets the value of [description][crate::model::Target::description].
3855 ///
3856 /// # Example
3857 /// ```ignore,no_run
3858 /// # use google_cloud_deploy_v1::model::Target;
3859 /// let x = Target::new().set_description("example");
3860 /// ```
3861 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3862 self.description = v.into();
3863 self
3864 }
3865
3866 /// Sets the value of [annotations][crate::model::Target::annotations].
3867 ///
3868 /// # Example
3869 /// ```ignore,no_run
3870 /// # use google_cloud_deploy_v1::model::Target;
3871 /// let x = Target::new().set_annotations([
3872 /// ("key0", "abc"),
3873 /// ("key1", "xyz"),
3874 /// ]);
3875 /// ```
3876 pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
3877 where
3878 T: std::iter::IntoIterator<Item = (K, V)>,
3879 K: std::convert::Into<std::string::String>,
3880 V: std::convert::Into<std::string::String>,
3881 {
3882 use std::iter::Iterator;
3883 self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
3884 self
3885 }
3886
3887 /// Sets the value of [labels][crate::model::Target::labels].
3888 ///
3889 /// # Example
3890 /// ```ignore,no_run
3891 /// # use google_cloud_deploy_v1::model::Target;
3892 /// let x = Target::new().set_labels([
3893 /// ("key0", "abc"),
3894 /// ("key1", "xyz"),
3895 /// ]);
3896 /// ```
3897 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
3898 where
3899 T: std::iter::IntoIterator<Item = (K, V)>,
3900 K: std::convert::Into<std::string::String>,
3901 V: std::convert::Into<std::string::String>,
3902 {
3903 use std::iter::Iterator;
3904 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
3905 self
3906 }
3907
3908 /// Sets the value of [require_approval][crate::model::Target::require_approval].
3909 ///
3910 /// # Example
3911 /// ```ignore,no_run
3912 /// # use google_cloud_deploy_v1::model::Target;
3913 /// let x = Target::new().set_require_approval(true);
3914 /// ```
3915 pub fn set_require_approval<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3916 self.require_approval = v.into();
3917 self
3918 }
3919
3920 /// Sets the value of [create_time][crate::model::Target::create_time].
3921 ///
3922 /// # Example
3923 /// ```ignore,no_run
3924 /// # use google_cloud_deploy_v1::model::Target;
3925 /// use wkt::Timestamp;
3926 /// let x = Target::new().set_create_time(Timestamp::default()/* use setters */);
3927 /// ```
3928 pub fn set_create_time<T>(mut self, v: T) -> Self
3929 where
3930 T: std::convert::Into<wkt::Timestamp>,
3931 {
3932 self.create_time = std::option::Option::Some(v.into());
3933 self
3934 }
3935
3936 /// Sets or clears the value of [create_time][crate::model::Target::create_time].
3937 ///
3938 /// # Example
3939 /// ```ignore,no_run
3940 /// # use google_cloud_deploy_v1::model::Target;
3941 /// use wkt::Timestamp;
3942 /// let x = Target::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
3943 /// let x = Target::new().set_or_clear_create_time(None::<Timestamp>);
3944 /// ```
3945 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
3946 where
3947 T: std::convert::Into<wkt::Timestamp>,
3948 {
3949 self.create_time = v.map(|x| x.into());
3950 self
3951 }
3952
3953 /// Sets the value of [update_time][crate::model::Target::update_time].
3954 ///
3955 /// # Example
3956 /// ```ignore,no_run
3957 /// # use google_cloud_deploy_v1::model::Target;
3958 /// use wkt::Timestamp;
3959 /// let x = Target::new().set_update_time(Timestamp::default()/* use setters */);
3960 /// ```
3961 pub fn set_update_time<T>(mut self, v: T) -> Self
3962 where
3963 T: std::convert::Into<wkt::Timestamp>,
3964 {
3965 self.update_time = std::option::Option::Some(v.into());
3966 self
3967 }
3968
3969 /// Sets or clears the value of [update_time][crate::model::Target::update_time].
3970 ///
3971 /// # Example
3972 /// ```ignore,no_run
3973 /// # use google_cloud_deploy_v1::model::Target;
3974 /// use wkt::Timestamp;
3975 /// let x = Target::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
3976 /// let x = Target::new().set_or_clear_update_time(None::<Timestamp>);
3977 /// ```
3978 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
3979 where
3980 T: std::convert::Into<wkt::Timestamp>,
3981 {
3982 self.update_time = v.map(|x| x.into());
3983 self
3984 }
3985
3986 /// Sets the value of [associated_entities][crate::model::Target::associated_entities].
3987 ///
3988 /// # Example
3989 /// ```ignore,no_run
3990 /// # use google_cloud_deploy_v1::model::Target;
3991 /// use google_cloud_deploy_v1::model::AssociatedEntities;
3992 /// let x = Target::new().set_associated_entities([
3993 /// ("key0", AssociatedEntities::default()/* use setters */),
3994 /// ("key1", AssociatedEntities::default()/* use (different) setters */),
3995 /// ]);
3996 /// ```
3997 pub fn set_associated_entities<T, K, V>(mut self, v: T) -> Self
3998 where
3999 T: std::iter::IntoIterator<Item = (K, V)>,
4000 K: std::convert::Into<std::string::String>,
4001 V: std::convert::Into<crate::model::AssociatedEntities>,
4002 {
4003 use std::iter::Iterator;
4004 self.associated_entities = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
4005 self
4006 }
4007
4008 /// Sets the value of [etag][crate::model::Target::etag].
4009 ///
4010 /// # Example
4011 /// ```ignore,no_run
4012 /// # use google_cloud_deploy_v1::model::Target;
4013 /// let x = Target::new().set_etag("example");
4014 /// ```
4015 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4016 self.etag = v.into();
4017 self
4018 }
4019
4020 /// Sets the value of [execution_configs][crate::model::Target::execution_configs].
4021 ///
4022 /// # Example
4023 /// ```ignore,no_run
4024 /// # use google_cloud_deploy_v1::model::Target;
4025 /// use google_cloud_deploy_v1::model::ExecutionConfig;
4026 /// let x = Target::new()
4027 /// .set_execution_configs([
4028 /// ExecutionConfig::default()/* use setters */,
4029 /// ExecutionConfig::default()/* use (different) setters */,
4030 /// ]);
4031 /// ```
4032 pub fn set_execution_configs<T, V>(mut self, v: T) -> Self
4033 where
4034 T: std::iter::IntoIterator<Item = V>,
4035 V: std::convert::Into<crate::model::ExecutionConfig>,
4036 {
4037 use std::iter::Iterator;
4038 self.execution_configs = v.into_iter().map(|i| i.into()).collect();
4039 self
4040 }
4041
4042 /// Sets the value of [deploy_parameters][crate::model::Target::deploy_parameters].
4043 ///
4044 /// # Example
4045 /// ```ignore,no_run
4046 /// # use google_cloud_deploy_v1::model::Target;
4047 /// let x = Target::new().set_deploy_parameters([
4048 /// ("key0", "abc"),
4049 /// ("key1", "xyz"),
4050 /// ]);
4051 /// ```
4052 pub fn set_deploy_parameters<T, K, V>(mut self, v: T) -> Self
4053 where
4054 T: std::iter::IntoIterator<Item = (K, V)>,
4055 K: std::convert::Into<std::string::String>,
4056 V: std::convert::Into<std::string::String>,
4057 {
4058 use std::iter::Iterator;
4059 self.deploy_parameters = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
4060 self
4061 }
4062
4063 /// Sets the value of [deployment_target][crate::model::Target::deployment_target].
4064 ///
4065 /// Note that all the setters affecting `deployment_target` are mutually
4066 /// exclusive.
4067 ///
4068 /// # Example
4069 /// ```ignore,no_run
4070 /// # use google_cloud_deploy_v1::model::Target;
4071 /// use google_cloud_deploy_v1::model::GkeCluster;
4072 /// let x = Target::new().set_deployment_target(Some(
4073 /// google_cloud_deploy_v1::model::target::DeploymentTarget::Gke(GkeCluster::default().into())));
4074 /// ```
4075 pub fn set_deployment_target<
4076 T: std::convert::Into<std::option::Option<crate::model::target::DeploymentTarget>>,
4077 >(
4078 mut self,
4079 v: T,
4080 ) -> Self {
4081 self.deployment_target = v.into();
4082 self
4083 }
4084
4085 /// The value of [deployment_target][crate::model::Target::deployment_target]
4086 /// if it holds a `Gke`, `None` if the field is not set or
4087 /// holds a different branch.
4088 pub fn gke(&self) -> std::option::Option<&std::boxed::Box<crate::model::GkeCluster>> {
4089 #[allow(unreachable_patterns)]
4090 self.deployment_target.as_ref().and_then(|v| match v {
4091 crate::model::target::DeploymentTarget::Gke(v) => std::option::Option::Some(v),
4092 _ => std::option::Option::None,
4093 })
4094 }
4095
4096 /// Sets the value of [deployment_target][crate::model::Target::deployment_target]
4097 /// to hold a `Gke`.
4098 ///
4099 /// Note that all the setters affecting `deployment_target` are
4100 /// mutually exclusive.
4101 ///
4102 /// # Example
4103 /// ```ignore,no_run
4104 /// # use google_cloud_deploy_v1::model::Target;
4105 /// use google_cloud_deploy_v1::model::GkeCluster;
4106 /// let x = Target::new().set_gke(GkeCluster::default()/* use setters */);
4107 /// assert!(x.gke().is_some());
4108 /// assert!(x.anthos_cluster().is_none());
4109 /// assert!(x.run().is_none());
4110 /// assert!(x.multi_target().is_none());
4111 /// assert!(x.custom_target().is_none());
4112 /// ```
4113 pub fn set_gke<T: std::convert::Into<std::boxed::Box<crate::model::GkeCluster>>>(
4114 mut self,
4115 v: T,
4116 ) -> Self {
4117 self.deployment_target =
4118 std::option::Option::Some(crate::model::target::DeploymentTarget::Gke(v.into()));
4119 self
4120 }
4121
4122 /// The value of [deployment_target][crate::model::Target::deployment_target]
4123 /// if it holds a `AnthosCluster`, `None` if the field is not set or
4124 /// holds a different branch.
4125 pub fn anthos_cluster(
4126 &self,
4127 ) -> std::option::Option<&std::boxed::Box<crate::model::AnthosCluster>> {
4128 #[allow(unreachable_patterns)]
4129 self.deployment_target.as_ref().and_then(|v| match v {
4130 crate::model::target::DeploymentTarget::AnthosCluster(v) => {
4131 std::option::Option::Some(v)
4132 }
4133 _ => std::option::Option::None,
4134 })
4135 }
4136
4137 /// Sets the value of [deployment_target][crate::model::Target::deployment_target]
4138 /// to hold a `AnthosCluster`.
4139 ///
4140 /// Note that all the setters affecting `deployment_target` are
4141 /// mutually exclusive.
4142 ///
4143 /// # Example
4144 /// ```ignore,no_run
4145 /// # use google_cloud_deploy_v1::model::Target;
4146 /// use google_cloud_deploy_v1::model::AnthosCluster;
4147 /// let x = Target::new().set_anthos_cluster(AnthosCluster::default()/* use setters */);
4148 /// assert!(x.anthos_cluster().is_some());
4149 /// assert!(x.gke().is_none());
4150 /// assert!(x.run().is_none());
4151 /// assert!(x.multi_target().is_none());
4152 /// assert!(x.custom_target().is_none());
4153 /// ```
4154 pub fn set_anthos_cluster<
4155 T: std::convert::Into<std::boxed::Box<crate::model::AnthosCluster>>,
4156 >(
4157 mut self,
4158 v: T,
4159 ) -> Self {
4160 self.deployment_target = std::option::Option::Some(
4161 crate::model::target::DeploymentTarget::AnthosCluster(v.into()),
4162 );
4163 self
4164 }
4165
4166 /// The value of [deployment_target][crate::model::Target::deployment_target]
4167 /// if it holds a `Run`, `None` if the field is not set or
4168 /// holds a different branch.
4169 pub fn run(&self) -> std::option::Option<&std::boxed::Box<crate::model::CloudRunLocation>> {
4170 #[allow(unreachable_patterns)]
4171 self.deployment_target.as_ref().and_then(|v| match v {
4172 crate::model::target::DeploymentTarget::Run(v) => std::option::Option::Some(v),
4173 _ => std::option::Option::None,
4174 })
4175 }
4176
4177 /// Sets the value of [deployment_target][crate::model::Target::deployment_target]
4178 /// to hold a `Run`.
4179 ///
4180 /// Note that all the setters affecting `deployment_target` are
4181 /// mutually exclusive.
4182 ///
4183 /// # Example
4184 /// ```ignore,no_run
4185 /// # use google_cloud_deploy_v1::model::Target;
4186 /// use google_cloud_deploy_v1::model::CloudRunLocation;
4187 /// let x = Target::new().set_run(CloudRunLocation::default()/* use setters */);
4188 /// assert!(x.run().is_some());
4189 /// assert!(x.gke().is_none());
4190 /// assert!(x.anthos_cluster().is_none());
4191 /// assert!(x.multi_target().is_none());
4192 /// assert!(x.custom_target().is_none());
4193 /// ```
4194 pub fn set_run<T: std::convert::Into<std::boxed::Box<crate::model::CloudRunLocation>>>(
4195 mut self,
4196 v: T,
4197 ) -> Self {
4198 self.deployment_target =
4199 std::option::Option::Some(crate::model::target::DeploymentTarget::Run(v.into()));
4200 self
4201 }
4202
4203 /// The value of [deployment_target][crate::model::Target::deployment_target]
4204 /// if it holds a `MultiTarget`, `None` if the field is not set or
4205 /// holds a different branch.
4206 pub fn multi_target(&self) -> std::option::Option<&std::boxed::Box<crate::model::MultiTarget>> {
4207 #[allow(unreachable_patterns)]
4208 self.deployment_target.as_ref().and_then(|v| match v {
4209 crate::model::target::DeploymentTarget::MultiTarget(v) => std::option::Option::Some(v),
4210 _ => std::option::Option::None,
4211 })
4212 }
4213
4214 /// Sets the value of [deployment_target][crate::model::Target::deployment_target]
4215 /// to hold a `MultiTarget`.
4216 ///
4217 /// Note that all the setters affecting `deployment_target` are
4218 /// mutually exclusive.
4219 ///
4220 /// # Example
4221 /// ```ignore,no_run
4222 /// # use google_cloud_deploy_v1::model::Target;
4223 /// use google_cloud_deploy_v1::model::MultiTarget;
4224 /// let x = Target::new().set_multi_target(MultiTarget::default()/* use setters */);
4225 /// assert!(x.multi_target().is_some());
4226 /// assert!(x.gke().is_none());
4227 /// assert!(x.anthos_cluster().is_none());
4228 /// assert!(x.run().is_none());
4229 /// assert!(x.custom_target().is_none());
4230 /// ```
4231 pub fn set_multi_target<T: std::convert::Into<std::boxed::Box<crate::model::MultiTarget>>>(
4232 mut self,
4233 v: T,
4234 ) -> Self {
4235 self.deployment_target = std::option::Option::Some(
4236 crate::model::target::DeploymentTarget::MultiTarget(v.into()),
4237 );
4238 self
4239 }
4240
4241 /// The value of [deployment_target][crate::model::Target::deployment_target]
4242 /// if it holds a `CustomTarget`, `None` if the field is not set or
4243 /// holds a different branch.
4244 pub fn custom_target(
4245 &self,
4246 ) -> std::option::Option<&std::boxed::Box<crate::model::CustomTarget>> {
4247 #[allow(unreachable_patterns)]
4248 self.deployment_target.as_ref().and_then(|v| match v {
4249 crate::model::target::DeploymentTarget::CustomTarget(v) => std::option::Option::Some(v),
4250 _ => std::option::Option::None,
4251 })
4252 }
4253
4254 /// Sets the value of [deployment_target][crate::model::Target::deployment_target]
4255 /// to hold a `CustomTarget`.
4256 ///
4257 /// Note that all the setters affecting `deployment_target` are
4258 /// mutually exclusive.
4259 ///
4260 /// # Example
4261 /// ```ignore,no_run
4262 /// # use google_cloud_deploy_v1::model::Target;
4263 /// use google_cloud_deploy_v1::model::CustomTarget;
4264 /// let x = Target::new().set_custom_target(CustomTarget::default()/* use setters */);
4265 /// assert!(x.custom_target().is_some());
4266 /// assert!(x.gke().is_none());
4267 /// assert!(x.anthos_cluster().is_none());
4268 /// assert!(x.run().is_none());
4269 /// assert!(x.multi_target().is_none());
4270 /// ```
4271 pub fn set_custom_target<T: std::convert::Into<std::boxed::Box<crate::model::CustomTarget>>>(
4272 mut self,
4273 v: T,
4274 ) -> Self {
4275 self.deployment_target = std::option::Option::Some(
4276 crate::model::target::DeploymentTarget::CustomTarget(v.into()),
4277 );
4278 self
4279 }
4280}
4281
4282impl wkt::message::Message for Target {
4283 fn typename() -> &'static str {
4284 "type.googleapis.com/google.cloud.deploy.v1.Target"
4285 }
4286}
4287
4288/// Defines additional types related to [Target].
4289pub mod target {
4290 #[allow(unused_imports)]
4291 use super::*;
4292
4293 /// Destination to which the Skaffold configuration is applied during a
4294 /// rollout.
4295 #[derive(Clone, Debug, PartialEq)]
4296 #[non_exhaustive]
4297 pub enum DeploymentTarget {
4298 /// Optional. Information specifying a GKE Cluster.
4299 Gke(std::boxed::Box<crate::model::GkeCluster>),
4300 /// Optional. Information specifying an Anthos Cluster.
4301 AnthosCluster(std::boxed::Box<crate::model::AnthosCluster>),
4302 /// Optional. Information specifying a Cloud Run deployment target.
4303 Run(std::boxed::Box<crate::model::CloudRunLocation>),
4304 /// Optional. Information specifying a multiTarget.
4305 MultiTarget(std::boxed::Box<crate::model::MultiTarget>),
4306 /// Optional. Information specifying a Custom Target.
4307 CustomTarget(std::boxed::Box<crate::model::CustomTarget>),
4308 }
4309}
4310
4311/// Configuration of the environment to use when calling Skaffold.
4312#[derive(Clone, Default, PartialEq)]
4313#[non_exhaustive]
4314pub struct ExecutionConfig {
4315 /// Required. Usages when this configuration should be applied.
4316 pub usages: std::vec::Vec<crate::model::execution_config::ExecutionEnvironmentUsage>,
4317
4318 /// Optional. The resource name of the `WorkerPool`, with the format
4319 /// `projects/{project}/locations/{location}/workerPools/{worker_pool}`.
4320 /// If this optional field is unspecified, the default Cloud Build pool will be
4321 /// used.
4322 pub worker_pool: std::string::String,
4323
4324 /// Optional. Google service account to use for execution. If unspecified,
4325 /// the project execution service account
4326 /// (<PROJECT_NUMBER>-compute@developer.gserviceaccount.com) is used.
4327 pub service_account: std::string::String,
4328
4329 /// Optional. Cloud Storage location in which to store execution outputs. This
4330 /// can either be a bucket ("gs://my-bucket") or a path within a bucket
4331 /// ("gs://my-bucket/my-dir").
4332 /// If unspecified, a default bucket located in the same region will be used.
4333 pub artifact_storage: std::string::String,
4334
4335 /// Optional. Execution timeout for a Cloud Build Execution. This must be
4336 /// between 10m and 24h in seconds format. If unspecified, a default timeout of
4337 /// 1h is used.
4338 pub execution_timeout: std::option::Option<wkt::Duration>,
4339
4340 /// Optional. If true, additional logging will be enabled when running builds
4341 /// in this execution environment.
4342 pub verbose: bool,
4343
4344 /// Details of the environment.
4345 pub execution_environment:
4346 std::option::Option<crate::model::execution_config::ExecutionEnvironment>,
4347
4348 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4349}
4350
4351impl ExecutionConfig {
4352 pub fn new() -> Self {
4353 std::default::Default::default()
4354 }
4355
4356 /// Sets the value of [usages][crate::model::ExecutionConfig::usages].
4357 ///
4358 /// # Example
4359 /// ```ignore,no_run
4360 /// # use google_cloud_deploy_v1::model::ExecutionConfig;
4361 /// use google_cloud_deploy_v1::model::execution_config::ExecutionEnvironmentUsage;
4362 /// let x = ExecutionConfig::new().set_usages([
4363 /// ExecutionEnvironmentUsage::Render,
4364 /// ExecutionEnvironmentUsage::Deploy,
4365 /// ExecutionEnvironmentUsage::Verify,
4366 /// ]);
4367 /// ```
4368 pub fn set_usages<T, V>(mut self, v: T) -> Self
4369 where
4370 T: std::iter::IntoIterator<Item = V>,
4371 V: std::convert::Into<crate::model::execution_config::ExecutionEnvironmentUsage>,
4372 {
4373 use std::iter::Iterator;
4374 self.usages = v.into_iter().map(|i| i.into()).collect();
4375 self
4376 }
4377
4378 /// Sets the value of [worker_pool][crate::model::ExecutionConfig::worker_pool].
4379 ///
4380 /// # Example
4381 /// ```ignore,no_run
4382 /// # use google_cloud_deploy_v1::model::ExecutionConfig;
4383 /// let x = ExecutionConfig::new().set_worker_pool("example");
4384 /// ```
4385 pub fn set_worker_pool<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4386 self.worker_pool = v.into();
4387 self
4388 }
4389
4390 /// Sets the value of [service_account][crate::model::ExecutionConfig::service_account].
4391 ///
4392 /// # Example
4393 /// ```ignore,no_run
4394 /// # use google_cloud_deploy_v1::model::ExecutionConfig;
4395 /// let x = ExecutionConfig::new().set_service_account("example");
4396 /// ```
4397 pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4398 self.service_account = v.into();
4399 self
4400 }
4401
4402 /// Sets the value of [artifact_storage][crate::model::ExecutionConfig::artifact_storage].
4403 ///
4404 /// # Example
4405 /// ```ignore,no_run
4406 /// # use google_cloud_deploy_v1::model::ExecutionConfig;
4407 /// let x = ExecutionConfig::new().set_artifact_storage("example");
4408 /// ```
4409 pub fn set_artifact_storage<T: std::convert::Into<std::string::String>>(
4410 mut self,
4411 v: T,
4412 ) -> Self {
4413 self.artifact_storage = v.into();
4414 self
4415 }
4416
4417 /// Sets the value of [execution_timeout][crate::model::ExecutionConfig::execution_timeout].
4418 ///
4419 /// # Example
4420 /// ```ignore,no_run
4421 /// # use google_cloud_deploy_v1::model::ExecutionConfig;
4422 /// use wkt::Duration;
4423 /// let x = ExecutionConfig::new().set_execution_timeout(Duration::default()/* use setters */);
4424 /// ```
4425 pub fn set_execution_timeout<T>(mut self, v: T) -> Self
4426 where
4427 T: std::convert::Into<wkt::Duration>,
4428 {
4429 self.execution_timeout = std::option::Option::Some(v.into());
4430 self
4431 }
4432
4433 /// Sets or clears the value of [execution_timeout][crate::model::ExecutionConfig::execution_timeout].
4434 ///
4435 /// # Example
4436 /// ```ignore,no_run
4437 /// # use google_cloud_deploy_v1::model::ExecutionConfig;
4438 /// use wkt::Duration;
4439 /// let x = ExecutionConfig::new().set_or_clear_execution_timeout(Some(Duration::default()/* use setters */));
4440 /// let x = ExecutionConfig::new().set_or_clear_execution_timeout(None::<Duration>);
4441 /// ```
4442 pub fn set_or_clear_execution_timeout<T>(mut self, v: std::option::Option<T>) -> Self
4443 where
4444 T: std::convert::Into<wkt::Duration>,
4445 {
4446 self.execution_timeout = v.map(|x| x.into());
4447 self
4448 }
4449
4450 /// Sets the value of [verbose][crate::model::ExecutionConfig::verbose].
4451 ///
4452 /// # Example
4453 /// ```ignore,no_run
4454 /// # use google_cloud_deploy_v1::model::ExecutionConfig;
4455 /// let x = ExecutionConfig::new().set_verbose(true);
4456 /// ```
4457 pub fn set_verbose<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4458 self.verbose = v.into();
4459 self
4460 }
4461
4462 /// Sets the value of [execution_environment][crate::model::ExecutionConfig::execution_environment].
4463 ///
4464 /// Note that all the setters affecting `execution_environment` are mutually
4465 /// exclusive.
4466 ///
4467 /// # Example
4468 /// ```ignore,no_run
4469 /// # use google_cloud_deploy_v1::model::ExecutionConfig;
4470 /// use google_cloud_deploy_v1::model::DefaultPool;
4471 /// let x = ExecutionConfig::new().set_execution_environment(Some(
4472 /// google_cloud_deploy_v1::model::execution_config::ExecutionEnvironment::DefaultPool(DefaultPool::default().into())));
4473 /// ```
4474 pub fn set_execution_environment<
4475 T: std::convert::Into<
4476 std::option::Option<crate::model::execution_config::ExecutionEnvironment>,
4477 >,
4478 >(
4479 mut self,
4480 v: T,
4481 ) -> Self {
4482 self.execution_environment = v.into();
4483 self
4484 }
4485
4486 /// The value of [execution_environment][crate::model::ExecutionConfig::execution_environment]
4487 /// if it holds a `DefaultPool`, `None` if the field is not set or
4488 /// holds a different branch.
4489 pub fn default_pool(&self) -> std::option::Option<&std::boxed::Box<crate::model::DefaultPool>> {
4490 #[allow(unreachable_patterns)]
4491 self.execution_environment.as_ref().and_then(|v| match v {
4492 crate::model::execution_config::ExecutionEnvironment::DefaultPool(v) => {
4493 std::option::Option::Some(v)
4494 }
4495 _ => std::option::Option::None,
4496 })
4497 }
4498
4499 /// Sets the value of [execution_environment][crate::model::ExecutionConfig::execution_environment]
4500 /// to hold a `DefaultPool`.
4501 ///
4502 /// Note that all the setters affecting `execution_environment` are
4503 /// mutually exclusive.
4504 ///
4505 /// # Example
4506 /// ```ignore,no_run
4507 /// # use google_cloud_deploy_v1::model::ExecutionConfig;
4508 /// use google_cloud_deploy_v1::model::DefaultPool;
4509 /// let x = ExecutionConfig::new().set_default_pool(DefaultPool::default()/* use setters */);
4510 /// assert!(x.default_pool().is_some());
4511 /// assert!(x.private_pool().is_none());
4512 /// ```
4513 pub fn set_default_pool<T: std::convert::Into<std::boxed::Box<crate::model::DefaultPool>>>(
4514 mut self,
4515 v: T,
4516 ) -> Self {
4517 self.execution_environment = std::option::Option::Some(
4518 crate::model::execution_config::ExecutionEnvironment::DefaultPool(v.into()),
4519 );
4520 self
4521 }
4522
4523 /// The value of [execution_environment][crate::model::ExecutionConfig::execution_environment]
4524 /// if it holds a `PrivatePool`, `None` if the field is not set or
4525 /// holds a different branch.
4526 pub fn private_pool(&self) -> std::option::Option<&std::boxed::Box<crate::model::PrivatePool>> {
4527 #[allow(unreachable_patterns)]
4528 self.execution_environment.as_ref().and_then(|v| match v {
4529 crate::model::execution_config::ExecutionEnvironment::PrivatePool(v) => {
4530 std::option::Option::Some(v)
4531 }
4532 _ => std::option::Option::None,
4533 })
4534 }
4535
4536 /// Sets the value of [execution_environment][crate::model::ExecutionConfig::execution_environment]
4537 /// to hold a `PrivatePool`.
4538 ///
4539 /// Note that all the setters affecting `execution_environment` are
4540 /// mutually exclusive.
4541 ///
4542 /// # Example
4543 /// ```ignore,no_run
4544 /// # use google_cloud_deploy_v1::model::ExecutionConfig;
4545 /// use google_cloud_deploy_v1::model::PrivatePool;
4546 /// let x = ExecutionConfig::new().set_private_pool(PrivatePool::default()/* use setters */);
4547 /// assert!(x.private_pool().is_some());
4548 /// assert!(x.default_pool().is_none());
4549 /// ```
4550 pub fn set_private_pool<T: std::convert::Into<std::boxed::Box<crate::model::PrivatePool>>>(
4551 mut self,
4552 v: T,
4553 ) -> Self {
4554 self.execution_environment = std::option::Option::Some(
4555 crate::model::execution_config::ExecutionEnvironment::PrivatePool(v.into()),
4556 );
4557 self
4558 }
4559}
4560
4561impl wkt::message::Message for ExecutionConfig {
4562 fn typename() -> &'static str {
4563 "type.googleapis.com/google.cloud.deploy.v1.ExecutionConfig"
4564 }
4565}
4566
4567/// Defines additional types related to [ExecutionConfig].
4568pub mod execution_config {
4569 #[allow(unused_imports)]
4570 use super::*;
4571
4572 /// Possible usages of this configuration.
4573 ///
4574 /// # Working with unknown values
4575 ///
4576 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4577 /// additional enum variants at any time. Adding new variants is not considered
4578 /// a breaking change. Applications should write their code in anticipation of:
4579 ///
4580 /// - New values appearing in future releases of the client library, **and**
4581 /// - New values received dynamically, without application changes.
4582 ///
4583 /// Please consult the [Working with enums] section in the user guide for some
4584 /// guidelines.
4585 ///
4586 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
4587 #[derive(Clone, Debug, PartialEq)]
4588 #[non_exhaustive]
4589 pub enum ExecutionEnvironmentUsage {
4590 /// Default value. This value is unused.
4591 Unspecified,
4592 /// Use for rendering.
4593 Render,
4594 /// Use for deploying and deployment hooks.
4595 Deploy,
4596 /// Use for deployment verification.
4597 Verify,
4598 /// Use for predeploy job execution.
4599 Predeploy,
4600 /// Use for postdeploy job execution.
4601 Postdeploy,
4602 /// If set, the enum was initialized with an unknown value.
4603 ///
4604 /// Applications can examine the value using [ExecutionEnvironmentUsage::value] or
4605 /// [ExecutionEnvironmentUsage::name].
4606 UnknownValue(execution_environment_usage::UnknownValue),
4607 }
4608
4609 #[doc(hidden)]
4610 pub mod execution_environment_usage {
4611 #[allow(unused_imports)]
4612 use super::*;
4613 #[derive(Clone, Debug, PartialEq)]
4614 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4615 }
4616
4617 impl ExecutionEnvironmentUsage {
4618 /// Gets the enum value.
4619 ///
4620 /// Returns `None` if the enum contains an unknown value deserialized from
4621 /// the string representation of enums.
4622 pub fn value(&self) -> std::option::Option<i32> {
4623 match self {
4624 Self::Unspecified => std::option::Option::Some(0),
4625 Self::Render => std::option::Option::Some(1),
4626 Self::Deploy => std::option::Option::Some(2),
4627 Self::Verify => std::option::Option::Some(3),
4628 Self::Predeploy => std::option::Option::Some(4),
4629 Self::Postdeploy => std::option::Option::Some(5),
4630 Self::UnknownValue(u) => u.0.value(),
4631 }
4632 }
4633
4634 /// Gets the enum value as a string.
4635 ///
4636 /// Returns `None` if the enum contains an unknown value deserialized from
4637 /// the integer representation of enums.
4638 pub fn name(&self) -> std::option::Option<&str> {
4639 match self {
4640 Self::Unspecified => {
4641 std::option::Option::Some("EXECUTION_ENVIRONMENT_USAGE_UNSPECIFIED")
4642 }
4643 Self::Render => std::option::Option::Some("RENDER"),
4644 Self::Deploy => std::option::Option::Some("DEPLOY"),
4645 Self::Verify => std::option::Option::Some("VERIFY"),
4646 Self::Predeploy => std::option::Option::Some("PREDEPLOY"),
4647 Self::Postdeploy => std::option::Option::Some("POSTDEPLOY"),
4648 Self::UnknownValue(u) => u.0.name(),
4649 }
4650 }
4651 }
4652
4653 impl std::default::Default for ExecutionEnvironmentUsage {
4654 fn default() -> Self {
4655 use std::convert::From;
4656 Self::from(0)
4657 }
4658 }
4659
4660 impl std::fmt::Display for ExecutionEnvironmentUsage {
4661 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4662 wkt::internal::display_enum(f, self.name(), self.value())
4663 }
4664 }
4665
4666 impl std::convert::From<i32> for ExecutionEnvironmentUsage {
4667 fn from(value: i32) -> Self {
4668 match value {
4669 0 => Self::Unspecified,
4670 1 => Self::Render,
4671 2 => Self::Deploy,
4672 3 => Self::Verify,
4673 4 => Self::Predeploy,
4674 5 => Self::Postdeploy,
4675 _ => Self::UnknownValue(execution_environment_usage::UnknownValue(
4676 wkt::internal::UnknownEnumValue::Integer(value),
4677 )),
4678 }
4679 }
4680 }
4681
4682 impl std::convert::From<&str> for ExecutionEnvironmentUsage {
4683 fn from(value: &str) -> Self {
4684 use std::string::ToString;
4685 match value {
4686 "EXECUTION_ENVIRONMENT_USAGE_UNSPECIFIED" => Self::Unspecified,
4687 "RENDER" => Self::Render,
4688 "DEPLOY" => Self::Deploy,
4689 "VERIFY" => Self::Verify,
4690 "PREDEPLOY" => Self::Predeploy,
4691 "POSTDEPLOY" => Self::Postdeploy,
4692 _ => Self::UnknownValue(execution_environment_usage::UnknownValue(
4693 wkt::internal::UnknownEnumValue::String(value.to_string()),
4694 )),
4695 }
4696 }
4697 }
4698
4699 impl serde::ser::Serialize for ExecutionEnvironmentUsage {
4700 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4701 where
4702 S: serde::Serializer,
4703 {
4704 match self {
4705 Self::Unspecified => serializer.serialize_i32(0),
4706 Self::Render => serializer.serialize_i32(1),
4707 Self::Deploy => serializer.serialize_i32(2),
4708 Self::Verify => serializer.serialize_i32(3),
4709 Self::Predeploy => serializer.serialize_i32(4),
4710 Self::Postdeploy => serializer.serialize_i32(5),
4711 Self::UnknownValue(u) => u.0.serialize(serializer),
4712 }
4713 }
4714 }
4715
4716 impl<'de> serde::de::Deserialize<'de> for ExecutionEnvironmentUsage {
4717 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4718 where
4719 D: serde::Deserializer<'de>,
4720 {
4721 deserializer.deserialize_any(
4722 wkt::internal::EnumVisitor::<ExecutionEnvironmentUsage>::new(
4723 ".google.cloud.deploy.v1.ExecutionConfig.ExecutionEnvironmentUsage",
4724 ),
4725 )
4726 }
4727 }
4728
4729 /// Details of the environment.
4730 #[derive(Clone, Debug, PartialEq)]
4731 #[non_exhaustive]
4732 pub enum ExecutionEnvironment {
4733 /// Optional. Use default Cloud Build pool.
4734 DefaultPool(std::boxed::Box<crate::model::DefaultPool>),
4735 /// Optional. Use private Cloud Build pool.
4736 PrivatePool(std::boxed::Box<crate::model::PrivatePool>),
4737 }
4738}
4739
4740/// Execution using the default Cloud Build pool.
4741#[derive(Clone, Default, PartialEq)]
4742#[non_exhaustive]
4743pub struct DefaultPool {
4744 /// Optional. Google service account to use for execution. If unspecified,
4745 /// the project execution service account
4746 /// (<PROJECT_NUMBER>-compute@developer.gserviceaccount.com) will be used.
4747 pub service_account: std::string::String,
4748
4749 /// Optional. Cloud Storage location where execution outputs should be stored.
4750 /// This can either be a bucket ("gs://my-bucket") or a path within a bucket
4751 /// ("gs://my-bucket/my-dir").
4752 /// If unspecified, a default bucket located in the same region will be used.
4753 pub artifact_storage: std::string::String,
4754
4755 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4756}
4757
4758impl DefaultPool {
4759 pub fn new() -> Self {
4760 std::default::Default::default()
4761 }
4762
4763 /// Sets the value of [service_account][crate::model::DefaultPool::service_account].
4764 ///
4765 /// # Example
4766 /// ```ignore,no_run
4767 /// # use google_cloud_deploy_v1::model::DefaultPool;
4768 /// let x = DefaultPool::new().set_service_account("example");
4769 /// ```
4770 pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4771 self.service_account = v.into();
4772 self
4773 }
4774
4775 /// Sets the value of [artifact_storage][crate::model::DefaultPool::artifact_storage].
4776 ///
4777 /// # Example
4778 /// ```ignore,no_run
4779 /// # use google_cloud_deploy_v1::model::DefaultPool;
4780 /// let x = DefaultPool::new().set_artifact_storage("example");
4781 /// ```
4782 pub fn set_artifact_storage<T: std::convert::Into<std::string::String>>(
4783 mut self,
4784 v: T,
4785 ) -> Self {
4786 self.artifact_storage = v.into();
4787 self
4788 }
4789}
4790
4791impl wkt::message::Message for DefaultPool {
4792 fn typename() -> &'static str {
4793 "type.googleapis.com/google.cloud.deploy.v1.DefaultPool"
4794 }
4795}
4796
4797/// Execution using a private Cloud Build pool.
4798#[derive(Clone, Default, PartialEq)]
4799#[non_exhaustive]
4800pub struct PrivatePool {
4801 /// Required. Resource name of the Cloud Build worker pool to use. The format
4802 /// is `projects/{project}/locations/{location}/workerPools/{pool}`.
4803 pub worker_pool: std::string::String,
4804
4805 /// Optional. Google service account to use for execution. If unspecified,
4806 /// the project execution service account
4807 /// (<PROJECT_NUMBER>-compute@developer.gserviceaccount.com) will be used.
4808 pub service_account: std::string::String,
4809
4810 /// Optional. Cloud Storage location where execution outputs should be stored.
4811 /// This can either be a bucket ("gs://my-bucket") or a path within a bucket
4812 /// ("gs://my-bucket/my-dir").
4813 /// If unspecified, a default bucket located in the same region will be used.
4814 pub artifact_storage: std::string::String,
4815
4816 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4817}
4818
4819impl PrivatePool {
4820 pub fn new() -> Self {
4821 std::default::Default::default()
4822 }
4823
4824 /// Sets the value of [worker_pool][crate::model::PrivatePool::worker_pool].
4825 ///
4826 /// # Example
4827 /// ```ignore,no_run
4828 /// # use google_cloud_deploy_v1::model::PrivatePool;
4829 /// let x = PrivatePool::new().set_worker_pool("example");
4830 /// ```
4831 pub fn set_worker_pool<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4832 self.worker_pool = v.into();
4833 self
4834 }
4835
4836 /// Sets the value of [service_account][crate::model::PrivatePool::service_account].
4837 ///
4838 /// # Example
4839 /// ```ignore,no_run
4840 /// # use google_cloud_deploy_v1::model::PrivatePool;
4841 /// let x = PrivatePool::new().set_service_account("example");
4842 /// ```
4843 pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4844 self.service_account = v.into();
4845 self
4846 }
4847
4848 /// Sets the value of [artifact_storage][crate::model::PrivatePool::artifact_storage].
4849 ///
4850 /// # Example
4851 /// ```ignore,no_run
4852 /// # use google_cloud_deploy_v1::model::PrivatePool;
4853 /// let x = PrivatePool::new().set_artifact_storage("example");
4854 /// ```
4855 pub fn set_artifact_storage<T: std::convert::Into<std::string::String>>(
4856 mut self,
4857 v: T,
4858 ) -> Self {
4859 self.artifact_storage = v.into();
4860 self
4861 }
4862}
4863
4864impl wkt::message::Message for PrivatePool {
4865 fn typename() -> &'static str {
4866 "type.googleapis.com/google.cloud.deploy.v1.PrivatePool"
4867 }
4868}
4869
4870/// Information specifying a GKE Cluster.
4871#[derive(Clone, Default, PartialEq)]
4872#[non_exhaustive]
4873pub struct GkeCluster {
4874 /// Optional. Information specifying a GKE Cluster. Format is
4875 /// `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}`.
4876 pub cluster: std::string::String,
4877
4878 /// Optional. If true, `cluster` is accessed using the private IP address of
4879 /// the control plane endpoint. Otherwise, the default IP address of the
4880 /// control plane endpoint is used. The default IP address is the private IP
4881 /// address for clusters with private control-plane endpoints and the public IP
4882 /// address otherwise.
4883 ///
4884 /// Only specify this option when `cluster` is a [private GKE
4885 /// cluster](https://cloud.google.com/kubernetes-engine/docs/concepts/private-cluster-concept).
4886 /// Note that `internal_ip` and `dns_endpoint` cannot both be set to true.
4887 pub internal_ip: bool,
4888
4889 /// Optional. If set, used to configure a
4890 /// [proxy](https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/#proxy)
4891 /// to the Kubernetes server.
4892 pub proxy_url: std::string::String,
4893
4894 /// Optional. If set, the cluster will be accessed using the DNS endpoint. Note
4895 /// that both `dns_endpoint` and `internal_ip` cannot be set to true.
4896 pub dns_endpoint: bool,
4897
4898 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4899}
4900
4901impl GkeCluster {
4902 pub fn new() -> Self {
4903 std::default::Default::default()
4904 }
4905
4906 /// Sets the value of [cluster][crate::model::GkeCluster::cluster].
4907 ///
4908 /// # Example
4909 /// ```ignore,no_run
4910 /// # use google_cloud_deploy_v1::model::GkeCluster;
4911 /// let x = GkeCluster::new().set_cluster("example");
4912 /// ```
4913 pub fn set_cluster<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4914 self.cluster = v.into();
4915 self
4916 }
4917
4918 /// Sets the value of [internal_ip][crate::model::GkeCluster::internal_ip].
4919 ///
4920 /// # Example
4921 /// ```ignore,no_run
4922 /// # use google_cloud_deploy_v1::model::GkeCluster;
4923 /// let x = GkeCluster::new().set_internal_ip(true);
4924 /// ```
4925 pub fn set_internal_ip<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4926 self.internal_ip = v.into();
4927 self
4928 }
4929
4930 /// Sets the value of [proxy_url][crate::model::GkeCluster::proxy_url].
4931 ///
4932 /// # Example
4933 /// ```ignore,no_run
4934 /// # use google_cloud_deploy_v1::model::GkeCluster;
4935 /// let x = GkeCluster::new().set_proxy_url("example");
4936 /// ```
4937 pub fn set_proxy_url<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4938 self.proxy_url = v.into();
4939 self
4940 }
4941
4942 /// Sets the value of [dns_endpoint][crate::model::GkeCluster::dns_endpoint].
4943 ///
4944 /// # Example
4945 /// ```ignore,no_run
4946 /// # use google_cloud_deploy_v1::model::GkeCluster;
4947 /// let x = GkeCluster::new().set_dns_endpoint(true);
4948 /// ```
4949 pub fn set_dns_endpoint<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4950 self.dns_endpoint = v.into();
4951 self
4952 }
4953}
4954
4955impl wkt::message::Message for GkeCluster {
4956 fn typename() -> &'static str {
4957 "type.googleapis.com/google.cloud.deploy.v1.GkeCluster"
4958 }
4959}
4960
4961/// Information specifying an Anthos Cluster.
4962#[derive(Clone, Default, PartialEq)]
4963#[non_exhaustive]
4964pub struct AnthosCluster {
4965 /// Optional. Membership of the GKE Hub-registered cluster to which to apply
4966 /// the Skaffold configuration. Format is
4967 /// `projects/{project}/locations/{location}/memberships/{membership_name}`.
4968 pub membership: std::string::String,
4969
4970 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4971}
4972
4973impl AnthosCluster {
4974 pub fn new() -> Self {
4975 std::default::Default::default()
4976 }
4977
4978 /// Sets the value of [membership][crate::model::AnthosCluster::membership].
4979 ///
4980 /// # Example
4981 /// ```ignore,no_run
4982 /// # use google_cloud_deploy_v1::model::AnthosCluster;
4983 /// let x = AnthosCluster::new().set_membership("example");
4984 /// ```
4985 pub fn set_membership<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4986 self.membership = v.into();
4987 self
4988 }
4989}
4990
4991impl wkt::message::Message for AnthosCluster {
4992 fn typename() -> &'static str {
4993 "type.googleapis.com/google.cloud.deploy.v1.AnthosCluster"
4994 }
4995}
4996
4997/// Information specifying where to deploy a Cloud Run Service.
4998#[derive(Clone, Default, PartialEq)]
4999#[non_exhaustive]
5000pub struct CloudRunLocation {
5001 /// Required. The location for the Cloud Run Service. Format must be
5002 /// `projects/{project}/locations/{location}`.
5003 pub location: std::string::String,
5004
5005 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5006}
5007
5008impl CloudRunLocation {
5009 pub fn new() -> Self {
5010 std::default::Default::default()
5011 }
5012
5013 /// Sets the value of [location][crate::model::CloudRunLocation::location].
5014 ///
5015 /// # Example
5016 /// ```ignore,no_run
5017 /// # use google_cloud_deploy_v1::model::CloudRunLocation;
5018 /// let x = CloudRunLocation::new().set_location("example");
5019 /// ```
5020 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5021 self.location = v.into();
5022 self
5023 }
5024}
5025
5026impl wkt::message::Message for CloudRunLocation {
5027 fn typename() -> &'static str {
5028 "type.googleapis.com/google.cloud.deploy.v1.CloudRunLocation"
5029 }
5030}
5031
5032/// Information specifying a multiTarget.
5033#[derive(Clone, Default, PartialEq)]
5034#[non_exhaustive]
5035pub struct MultiTarget {
5036 /// Required. The target_ids of this multiTarget.
5037 pub target_ids: std::vec::Vec<std::string::String>,
5038
5039 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5040}
5041
5042impl MultiTarget {
5043 pub fn new() -> Self {
5044 std::default::Default::default()
5045 }
5046
5047 /// Sets the value of [target_ids][crate::model::MultiTarget::target_ids].
5048 ///
5049 /// # Example
5050 /// ```ignore,no_run
5051 /// # use google_cloud_deploy_v1::model::MultiTarget;
5052 /// let x = MultiTarget::new().set_target_ids(["a", "b", "c"]);
5053 /// ```
5054 pub fn set_target_ids<T, V>(mut self, v: T) -> Self
5055 where
5056 T: std::iter::IntoIterator<Item = V>,
5057 V: std::convert::Into<std::string::String>,
5058 {
5059 use std::iter::Iterator;
5060 self.target_ids = v.into_iter().map(|i| i.into()).collect();
5061 self
5062 }
5063}
5064
5065impl wkt::message::Message for MultiTarget {
5066 fn typename() -> &'static str {
5067 "type.googleapis.com/google.cloud.deploy.v1.MultiTarget"
5068 }
5069}
5070
5071/// Information specifying a Custom Target.
5072#[derive(Clone, Default, PartialEq)]
5073#[non_exhaustive]
5074pub struct CustomTarget {
5075 /// Required. The name of the CustomTargetType. Format must be
5076 /// `projects/{project}/locations/{location}/customTargetTypes/{custom_target_type}`.
5077 pub custom_target_type: std::string::String,
5078
5079 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5080}
5081
5082impl CustomTarget {
5083 pub fn new() -> Self {
5084 std::default::Default::default()
5085 }
5086
5087 /// Sets the value of [custom_target_type][crate::model::CustomTarget::custom_target_type].
5088 ///
5089 /// # Example
5090 /// ```ignore,no_run
5091 /// # use google_cloud_deploy_v1::model::CustomTarget;
5092 /// let x = CustomTarget::new().set_custom_target_type("example");
5093 /// ```
5094 pub fn set_custom_target_type<T: std::convert::Into<std::string::String>>(
5095 mut self,
5096 v: T,
5097 ) -> Self {
5098 self.custom_target_type = v.into();
5099 self
5100 }
5101}
5102
5103impl wkt::message::Message for CustomTarget {
5104 fn typename() -> &'static str {
5105 "type.googleapis.com/google.cloud.deploy.v1.CustomTarget"
5106 }
5107}
5108
5109/// Information about entities associated with a `Target`.
5110#[derive(Clone, Default, PartialEq)]
5111#[non_exhaustive]
5112pub struct AssociatedEntities {
5113 /// Optional. Information specifying GKE clusters as associated entities.
5114 pub gke_clusters: std::vec::Vec<crate::model::GkeCluster>,
5115
5116 /// Optional. Information specifying Anthos clusters as associated entities.
5117 pub anthos_clusters: std::vec::Vec<crate::model::AnthosCluster>,
5118
5119 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5120}
5121
5122impl AssociatedEntities {
5123 pub fn new() -> Self {
5124 std::default::Default::default()
5125 }
5126
5127 /// Sets the value of [gke_clusters][crate::model::AssociatedEntities::gke_clusters].
5128 ///
5129 /// # Example
5130 /// ```ignore,no_run
5131 /// # use google_cloud_deploy_v1::model::AssociatedEntities;
5132 /// use google_cloud_deploy_v1::model::GkeCluster;
5133 /// let x = AssociatedEntities::new()
5134 /// .set_gke_clusters([
5135 /// GkeCluster::default()/* use setters */,
5136 /// GkeCluster::default()/* use (different) setters */,
5137 /// ]);
5138 /// ```
5139 pub fn set_gke_clusters<T, V>(mut self, v: T) -> Self
5140 where
5141 T: std::iter::IntoIterator<Item = V>,
5142 V: std::convert::Into<crate::model::GkeCluster>,
5143 {
5144 use std::iter::Iterator;
5145 self.gke_clusters = v.into_iter().map(|i| i.into()).collect();
5146 self
5147 }
5148
5149 /// Sets the value of [anthos_clusters][crate::model::AssociatedEntities::anthos_clusters].
5150 ///
5151 /// # Example
5152 /// ```ignore,no_run
5153 /// # use google_cloud_deploy_v1::model::AssociatedEntities;
5154 /// use google_cloud_deploy_v1::model::AnthosCluster;
5155 /// let x = AssociatedEntities::new()
5156 /// .set_anthos_clusters([
5157 /// AnthosCluster::default()/* use setters */,
5158 /// AnthosCluster::default()/* use (different) setters */,
5159 /// ]);
5160 /// ```
5161 pub fn set_anthos_clusters<T, V>(mut self, v: T) -> Self
5162 where
5163 T: std::iter::IntoIterator<Item = V>,
5164 V: std::convert::Into<crate::model::AnthosCluster>,
5165 {
5166 use std::iter::Iterator;
5167 self.anthos_clusters = v.into_iter().map(|i| i.into()).collect();
5168 self
5169 }
5170}
5171
5172impl wkt::message::Message for AssociatedEntities {
5173 fn typename() -> &'static str {
5174 "type.googleapis.com/google.cloud.deploy.v1.AssociatedEntities"
5175 }
5176}
5177
5178/// The request object for `ListTargets`.
5179#[derive(Clone, Default, PartialEq)]
5180#[non_exhaustive]
5181pub struct ListTargetsRequest {
5182 /// Required. The parent, which owns this collection of targets. Format must be
5183 /// `projects/{project_id}/locations/{location_name}`.
5184 pub parent: std::string::String,
5185
5186 /// Optional. The maximum number of `Target` objects to return. The service may
5187 /// return fewer than this value. If unspecified, at most 50 `Target` objects
5188 /// will be returned. The maximum value is 1000; values above 1000 will be set
5189 /// to 1000.
5190 pub page_size: i32,
5191
5192 /// Optional. A page token, received from a previous `ListTargets` call.
5193 /// Provide this to retrieve the subsequent page.
5194 ///
5195 /// When paginating, all other provided parameters match
5196 /// the call that provided the page token.
5197 pub page_token: std::string::String,
5198
5199 /// Optional. Filter targets to be returned. See <https://google.aip.dev/160> for
5200 /// more details.
5201 pub filter: std::string::String,
5202
5203 /// Optional. Field to sort by. See <https://google.aip.dev/132#ordering> for
5204 /// more details.
5205 pub order_by: std::string::String,
5206
5207 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5208}
5209
5210impl ListTargetsRequest {
5211 pub fn new() -> Self {
5212 std::default::Default::default()
5213 }
5214
5215 /// Sets the value of [parent][crate::model::ListTargetsRequest::parent].
5216 ///
5217 /// # Example
5218 /// ```ignore,no_run
5219 /// # use google_cloud_deploy_v1::model::ListTargetsRequest;
5220 /// let x = ListTargetsRequest::new().set_parent("example");
5221 /// ```
5222 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5223 self.parent = v.into();
5224 self
5225 }
5226
5227 /// Sets the value of [page_size][crate::model::ListTargetsRequest::page_size].
5228 ///
5229 /// # Example
5230 /// ```ignore,no_run
5231 /// # use google_cloud_deploy_v1::model::ListTargetsRequest;
5232 /// let x = ListTargetsRequest::new().set_page_size(42);
5233 /// ```
5234 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5235 self.page_size = v.into();
5236 self
5237 }
5238
5239 /// Sets the value of [page_token][crate::model::ListTargetsRequest::page_token].
5240 ///
5241 /// # Example
5242 /// ```ignore,no_run
5243 /// # use google_cloud_deploy_v1::model::ListTargetsRequest;
5244 /// let x = ListTargetsRequest::new().set_page_token("example");
5245 /// ```
5246 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5247 self.page_token = v.into();
5248 self
5249 }
5250
5251 /// Sets the value of [filter][crate::model::ListTargetsRequest::filter].
5252 ///
5253 /// # Example
5254 /// ```ignore,no_run
5255 /// # use google_cloud_deploy_v1::model::ListTargetsRequest;
5256 /// let x = ListTargetsRequest::new().set_filter("example");
5257 /// ```
5258 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5259 self.filter = v.into();
5260 self
5261 }
5262
5263 /// Sets the value of [order_by][crate::model::ListTargetsRequest::order_by].
5264 ///
5265 /// # Example
5266 /// ```ignore,no_run
5267 /// # use google_cloud_deploy_v1::model::ListTargetsRequest;
5268 /// let x = ListTargetsRequest::new().set_order_by("example");
5269 /// ```
5270 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5271 self.order_by = v.into();
5272 self
5273 }
5274}
5275
5276impl wkt::message::Message for ListTargetsRequest {
5277 fn typename() -> &'static str {
5278 "type.googleapis.com/google.cloud.deploy.v1.ListTargetsRequest"
5279 }
5280}
5281
5282/// The response object from `ListTargets`.
5283#[derive(Clone, Default, PartialEq)]
5284#[non_exhaustive]
5285pub struct ListTargetsResponse {
5286 /// The `Target` objects.
5287 pub targets: std::vec::Vec<crate::model::Target>,
5288
5289 /// A token, which can be sent as `page_token` to retrieve the next page.
5290 /// If this field is omitted, there are no subsequent pages.
5291 pub next_page_token: std::string::String,
5292
5293 /// Locations that could not be reached.
5294 pub unreachable: std::vec::Vec<std::string::String>,
5295
5296 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5297}
5298
5299impl ListTargetsResponse {
5300 pub fn new() -> Self {
5301 std::default::Default::default()
5302 }
5303
5304 /// Sets the value of [targets][crate::model::ListTargetsResponse::targets].
5305 ///
5306 /// # Example
5307 /// ```ignore,no_run
5308 /// # use google_cloud_deploy_v1::model::ListTargetsResponse;
5309 /// use google_cloud_deploy_v1::model::Target;
5310 /// let x = ListTargetsResponse::new()
5311 /// .set_targets([
5312 /// Target::default()/* use setters */,
5313 /// Target::default()/* use (different) setters */,
5314 /// ]);
5315 /// ```
5316 pub fn set_targets<T, V>(mut self, v: T) -> Self
5317 where
5318 T: std::iter::IntoIterator<Item = V>,
5319 V: std::convert::Into<crate::model::Target>,
5320 {
5321 use std::iter::Iterator;
5322 self.targets = v.into_iter().map(|i| i.into()).collect();
5323 self
5324 }
5325
5326 /// Sets the value of [next_page_token][crate::model::ListTargetsResponse::next_page_token].
5327 ///
5328 /// # Example
5329 /// ```ignore,no_run
5330 /// # use google_cloud_deploy_v1::model::ListTargetsResponse;
5331 /// let x = ListTargetsResponse::new().set_next_page_token("example");
5332 /// ```
5333 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5334 self.next_page_token = v.into();
5335 self
5336 }
5337
5338 /// Sets the value of [unreachable][crate::model::ListTargetsResponse::unreachable].
5339 ///
5340 /// # Example
5341 /// ```ignore,no_run
5342 /// # use google_cloud_deploy_v1::model::ListTargetsResponse;
5343 /// let x = ListTargetsResponse::new().set_unreachable(["a", "b", "c"]);
5344 /// ```
5345 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
5346 where
5347 T: std::iter::IntoIterator<Item = V>,
5348 V: std::convert::Into<std::string::String>,
5349 {
5350 use std::iter::Iterator;
5351 self.unreachable = v.into_iter().map(|i| i.into()).collect();
5352 self
5353 }
5354}
5355
5356impl wkt::message::Message for ListTargetsResponse {
5357 fn typename() -> &'static str {
5358 "type.googleapis.com/google.cloud.deploy.v1.ListTargetsResponse"
5359 }
5360}
5361
5362#[doc(hidden)]
5363impl google_cloud_gax::paginator::internal::PageableResponse for ListTargetsResponse {
5364 type PageItem = crate::model::Target;
5365
5366 fn items(self) -> std::vec::Vec<Self::PageItem> {
5367 self.targets
5368 }
5369
5370 fn next_page_token(&self) -> std::string::String {
5371 use std::clone::Clone;
5372 self.next_page_token.clone()
5373 }
5374}
5375
5376/// The request object for `GetTarget`.
5377#[derive(Clone, Default, PartialEq)]
5378#[non_exhaustive]
5379pub struct GetTargetRequest {
5380 /// Required. Name of the `Target`. Format must be
5381 /// `projects/{project_id}/locations/{location_name}/targets/{target_name}`.
5382 pub name: std::string::String,
5383
5384 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5385}
5386
5387impl GetTargetRequest {
5388 pub fn new() -> Self {
5389 std::default::Default::default()
5390 }
5391
5392 /// Sets the value of [name][crate::model::GetTargetRequest::name].
5393 ///
5394 /// # Example
5395 /// ```ignore,no_run
5396 /// # use google_cloud_deploy_v1::model::GetTargetRequest;
5397 /// let x = GetTargetRequest::new().set_name("example");
5398 /// ```
5399 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5400 self.name = v.into();
5401 self
5402 }
5403}
5404
5405impl wkt::message::Message for GetTargetRequest {
5406 fn typename() -> &'static str {
5407 "type.googleapis.com/google.cloud.deploy.v1.GetTargetRequest"
5408 }
5409}
5410
5411/// The request object for `CreateTarget`.
5412#[derive(Clone, Default, PartialEq)]
5413#[non_exhaustive]
5414pub struct CreateTargetRequest {
5415 /// Required. The parent collection in which the `Target` must be created.
5416 /// The format is
5417 /// `projects/{project_id}/locations/{location_name}`.
5418 pub parent: std::string::String,
5419
5420 /// Required. ID of the `Target`.
5421 pub target_id: std::string::String,
5422
5423 /// Required. The `Target` to create.
5424 pub target: std::option::Option<crate::model::Target>,
5425
5426 /// Optional. A request ID to identify requests. Specify a unique request ID
5427 /// so that if you must retry your request, the server knows to ignore the
5428 /// request if it has already been completed. The server guarantees that for
5429 /// at least 60 minutes after the first request.
5430 ///
5431 /// For example, consider a situation where you make an initial request and the
5432 /// request times out. If you make the request again with the same request ID,
5433 /// the server can check if original operation with the same request ID was
5434 /// received, and if so, will ignore the second request. This prevents clients
5435 /// from accidentally creating duplicate commitments.
5436 ///
5437 /// The request ID must be a valid UUID with the exception that zero UUID is
5438 /// not supported (00000000-0000-0000-0000-000000000000).
5439 pub request_id: std::string::String,
5440
5441 /// Optional. If set to true, the request is validated and the user is provided
5442 /// with an expected result, but no actual change is made.
5443 pub validate_only: bool,
5444
5445 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5446}
5447
5448impl CreateTargetRequest {
5449 pub fn new() -> Self {
5450 std::default::Default::default()
5451 }
5452
5453 /// Sets the value of [parent][crate::model::CreateTargetRequest::parent].
5454 ///
5455 /// # Example
5456 /// ```ignore,no_run
5457 /// # use google_cloud_deploy_v1::model::CreateTargetRequest;
5458 /// let x = CreateTargetRequest::new().set_parent("example");
5459 /// ```
5460 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5461 self.parent = v.into();
5462 self
5463 }
5464
5465 /// Sets the value of [target_id][crate::model::CreateTargetRequest::target_id].
5466 ///
5467 /// # Example
5468 /// ```ignore,no_run
5469 /// # use google_cloud_deploy_v1::model::CreateTargetRequest;
5470 /// let x = CreateTargetRequest::new().set_target_id("example");
5471 /// ```
5472 pub fn set_target_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5473 self.target_id = v.into();
5474 self
5475 }
5476
5477 /// Sets the value of [target][crate::model::CreateTargetRequest::target].
5478 ///
5479 /// # Example
5480 /// ```ignore,no_run
5481 /// # use google_cloud_deploy_v1::model::CreateTargetRequest;
5482 /// use google_cloud_deploy_v1::model::Target;
5483 /// let x = CreateTargetRequest::new().set_target(Target::default()/* use setters */);
5484 /// ```
5485 pub fn set_target<T>(mut self, v: T) -> Self
5486 where
5487 T: std::convert::Into<crate::model::Target>,
5488 {
5489 self.target = std::option::Option::Some(v.into());
5490 self
5491 }
5492
5493 /// Sets or clears the value of [target][crate::model::CreateTargetRequest::target].
5494 ///
5495 /// # Example
5496 /// ```ignore,no_run
5497 /// # use google_cloud_deploy_v1::model::CreateTargetRequest;
5498 /// use google_cloud_deploy_v1::model::Target;
5499 /// let x = CreateTargetRequest::new().set_or_clear_target(Some(Target::default()/* use setters */));
5500 /// let x = CreateTargetRequest::new().set_or_clear_target(None::<Target>);
5501 /// ```
5502 pub fn set_or_clear_target<T>(mut self, v: std::option::Option<T>) -> Self
5503 where
5504 T: std::convert::Into<crate::model::Target>,
5505 {
5506 self.target = v.map(|x| x.into());
5507 self
5508 }
5509
5510 /// Sets the value of [request_id][crate::model::CreateTargetRequest::request_id].
5511 ///
5512 /// # Example
5513 /// ```ignore,no_run
5514 /// # use google_cloud_deploy_v1::model::CreateTargetRequest;
5515 /// let x = CreateTargetRequest::new().set_request_id("example");
5516 /// ```
5517 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5518 self.request_id = v.into();
5519 self
5520 }
5521
5522 /// Sets the value of [validate_only][crate::model::CreateTargetRequest::validate_only].
5523 ///
5524 /// # Example
5525 /// ```ignore,no_run
5526 /// # use google_cloud_deploy_v1::model::CreateTargetRequest;
5527 /// let x = CreateTargetRequest::new().set_validate_only(true);
5528 /// ```
5529 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5530 self.validate_only = v.into();
5531 self
5532 }
5533}
5534
5535impl wkt::message::Message for CreateTargetRequest {
5536 fn typename() -> &'static str {
5537 "type.googleapis.com/google.cloud.deploy.v1.CreateTargetRequest"
5538 }
5539}
5540
5541/// The request object for `UpdateTarget`.
5542#[derive(Clone, Default, PartialEq)]
5543#[non_exhaustive]
5544pub struct UpdateTargetRequest {
5545 /// Required. Field mask is used to specify the fields to be overwritten by the
5546 /// update in the `Target` resource. The fields specified in the update_mask
5547 /// are relative to the resource, not the full request. A field will be
5548 /// overwritten if it's in the mask. If the user doesn't provide a mask then
5549 /// all fields are overwritten.
5550 pub update_mask: std::option::Option<wkt::FieldMask>,
5551
5552 /// Required. The `Target` to update.
5553 pub target: std::option::Option<crate::model::Target>,
5554
5555 /// Optional. A request ID to identify requests. Specify a unique request ID
5556 /// so that if you must retry your request, the server knows to ignore the
5557 /// request if it has already been completed. The server guarantees that for
5558 /// at least 60 minutes after the first request.
5559 ///
5560 /// For example, consider a situation where you make an initial request and the
5561 /// request times out. If you make the request again with the same request ID,
5562 /// the server can check if original operation with the same request ID was
5563 /// received, and if so, will ignore the second request. This prevents clients
5564 /// from accidentally creating duplicate commitments.
5565 ///
5566 /// The request ID must be a valid UUID with the exception that zero UUID is
5567 /// not supported (00000000-0000-0000-0000-000000000000).
5568 pub request_id: std::string::String,
5569
5570 /// Optional. If set to true, updating a `Target` that does not exist will
5571 /// result in the creation of a new `Target`.
5572 pub allow_missing: bool,
5573
5574 /// Optional. If set to true, the request is validated and the user is provided
5575 /// with an expected result, but no actual change is made.
5576 pub validate_only: bool,
5577
5578 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5579}
5580
5581impl UpdateTargetRequest {
5582 pub fn new() -> Self {
5583 std::default::Default::default()
5584 }
5585
5586 /// Sets the value of [update_mask][crate::model::UpdateTargetRequest::update_mask].
5587 ///
5588 /// # Example
5589 /// ```ignore,no_run
5590 /// # use google_cloud_deploy_v1::model::UpdateTargetRequest;
5591 /// use wkt::FieldMask;
5592 /// let x = UpdateTargetRequest::new().set_update_mask(FieldMask::default()/* use setters */);
5593 /// ```
5594 pub fn set_update_mask<T>(mut self, v: T) -> Self
5595 where
5596 T: std::convert::Into<wkt::FieldMask>,
5597 {
5598 self.update_mask = std::option::Option::Some(v.into());
5599 self
5600 }
5601
5602 /// Sets or clears the value of [update_mask][crate::model::UpdateTargetRequest::update_mask].
5603 ///
5604 /// # Example
5605 /// ```ignore,no_run
5606 /// # use google_cloud_deploy_v1::model::UpdateTargetRequest;
5607 /// use wkt::FieldMask;
5608 /// let x = UpdateTargetRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
5609 /// let x = UpdateTargetRequest::new().set_or_clear_update_mask(None::<FieldMask>);
5610 /// ```
5611 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5612 where
5613 T: std::convert::Into<wkt::FieldMask>,
5614 {
5615 self.update_mask = v.map(|x| x.into());
5616 self
5617 }
5618
5619 /// Sets the value of [target][crate::model::UpdateTargetRequest::target].
5620 ///
5621 /// # Example
5622 /// ```ignore,no_run
5623 /// # use google_cloud_deploy_v1::model::UpdateTargetRequest;
5624 /// use google_cloud_deploy_v1::model::Target;
5625 /// let x = UpdateTargetRequest::new().set_target(Target::default()/* use setters */);
5626 /// ```
5627 pub fn set_target<T>(mut self, v: T) -> Self
5628 where
5629 T: std::convert::Into<crate::model::Target>,
5630 {
5631 self.target = std::option::Option::Some(v.into());
5632 self
5633 }
5634
5635 /// Sets or clears the value of [target][crate::model::UpdateTargetRequest::target].
5636 ///
5637 /// # Example
5638 /// ```ignore,no_run
5639 /// # use google_cloud_deploy_v1::model::UpdateTargetRequest;
5640 /// use google_cloud_deploy_v1::model::Target;
5641 /// let x = UpdateTargetRequest::new().set_or_clear_target(Some(Target::default()/* use setters */));
5642 /// let x = UpdateTargetRequest::new().set_or_clear_target(None::<Target>);
5643 /// ```
5644 pub fn set_or_clear_target<T>(mut self, v: std::option::Option<T>) -> Self
5645 where
5646 T: std::convert::Into<crate::model::Target>,
5647 {
5648 self.target = v.map(|x| x.into());
5649 self
5650 }
5651
5652 /// Sets the value of [request_id][crate::model::UpdateTargetRequest::request_id].
5653 ///
5654 /// # Example
5655 /// ```ignore,no_run
5656 /// # use google_cloud_deploy_v1::model::UpdateTargetRequest;
5657 /// let x = UpdateTargetRequest::new().set_request_id("example");
5658 /// ```
5659 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5660 self.request_id = v.into();
5661 self
5662 }
5663
5664 /// Sets the value of [allow_missing][crate::model::UpdateTargetRequest::allow_missing].
5665 ///
5666 /// # Example
5667 /// ```ignore,no_run
5668 /// # use google_cloud_deploy_v1::model::UpdateTargetRequest;
5669 /// let x = UpdateTargetRequest::new().set_allow_missing(true);
5670 /// ```
5671 pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5672 self.allow_missing = v.into();
5673 self
5674 }
5675
5676 /// Sets the value of [validate_only][crate::model::UpdateTargetRequest::validate_only].
5677 ///
5678 /// # Example
5679 /// ```ignore,no_run
5680 /// # use google_cloud_deploy_v1::model::UpdateTargetRequest;
5681 /// let x = UpdateTargetRequest::new().set_validate_only(true);
5682 /// ```
5683 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5684 self.validate_only = v.into();
5685 self
5686 }
5687}
5688
5689impl wkt::message::Message for UpdateTargetRequest {
5690 fn typename() -> &'static str {
5691 "type.googleapis.com/google.cloud.deploy.v1.UpdateTargetRequest"
5692 }
5693}
5694
5695/// The request object for `DeleteTarget`.
5696#[derive(Clone, Default, PartialEq)]
5697#[non_exhaustive]
5698pub struct DeleteTargetRequest {
5699 /// Required. The name of the `Target` to delete. The format is
5700 /// `projects/{project_id}/locations/{location_name}/targets/{target_name}`.
5701 pub name: std::string::String,
5702
5703 /// Optional. A request ID to identify requests. Specify a unique request ID
5704 /// so that if you must retry your request, the server knows to ignore the
5705 /// request if it has already been completed. The server guarantees that for
5706 /// at least 60 minutes after the first request.
5707 ///
5708 /// For example, consider a situation where you make an initial request and the
5709 /// request times out. If you make the request again with the same request ID,
5710 /// the server can check if original operation with the same request ID was
5711 /// received, and if so, will ignore the second request. This prevents clients
5712 /// from accidentally creating duplicate commitments.
5713 ///
5714 /// The request ID must be a valid UUID with the exception that zero UUID is
5715 /// not supported (00000000-0000-0000-0000-000000000000).
5716 pub request_id: std::string::String,
5717
5718 /// Optional. If set to true, then deleting an already deleted or non-existing
5719 /// `Target` will succeed.
5720 pub allow_missing: bool,
5721
5722 /// Optional. If set, validate the request and preview the review, but do not
5723 /// actually post it.
5724 pub validate_only: bool,
5725
5726 /// Optional. This checksum is computed by the server based on the value of
5727 /// other fields, and may be sent on update and delete requests to ensure the
5728 /// client has an up-to-date value before proceeding.
5729 pub etag: std::string::String,
5730
5731 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5732}
5733
5734impl DeleteTargetRequest {
5735 pub fn new() -> Self {
5736 std::default::Default::default()
5737 }
5738
5739 /// Sets the value of [name][crate::model::DeleteTargetRequest::name].
5740 ///
5741 /// # Example
5742 /// ```ignore,no_run
5743 /// # use google_cloud_deploy_v1::model::DeleteTargetRequest;
5744 /// let x = DeleteTargetRequest::new().set_name("example");
5745 /// ```
5746 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5747 self.name = v.into();
5748 self
5749 }
5750
5751 /// Sets the value of [request_id][crate::model::DeleteTargetRequest::request_id].
5752 ///
5753 /// # Example
5754 /// ```ignore,no_run
5755 /// # use google_cloud_deploy_v1::model::DeleteTargetRequest;
5756 /// let x = DeleteTargetRequest::new().set_request_id("example");
5757 /// ```
5758 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5759 self.request_id = v.into();
5760 self
5761 }
5762
5763 /// Sets the value of [allow_missing][crate::model::DeleteTargetRequest::allow_missing].
5764 ///
5765 /// # Example
5766 /// ```ignore,no_run
5767 /// # use google_cloud_deploy_v1::model::DeleteTargetRequest;
5768 /// let x = DeleteTargetRequest::new().set_allow_missing(true);
5769 /// ```
5770 pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5771 self.allow_missing = v.into();
5772 self
5773 }
5774
5775 /// Sets the value of [validate_only][crate::model::DeleteTargetRequest::validate_only].
5776 ///
5777 /// # Example
5778 /// ```ignore,no_run
5779 /// # use google_cloud_deploy_v1::model::DeleteTargetRequest;
5780 /// let x = DeleteTargetRequest::new().set_validate_only(true);
5781 /// ```
5782 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5783 self.validate_only = v.into();
5784 self
5785 }
5786
5787 /// Sets the value of [etag][crate::model::DeleteTargetRequest::etag].
5788 ///
5789 /// # Example
5790 /// ```ignore,no_run
5791 /// # use google_cloud_deploy_v1::model::DeleteTargetRequest;
5792 /// let x = DeleteTargetRequest::new().set_etag("example");
5793 /// ```
5794 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5795 self.etag = v.into();
5796 self
5797 }
5798}
5799
5800impl wkt::message::Message for DeleteTargetRequest {
5801 fn typename() -> &'static str {
5802 "type.googleapis.com/google.cloud.deploy.v1.DeleteTargetRequest"
5803 }
5804}
5805
5806/// A `CustomTargetType` resource in the Cloud Deploy API.
5807///
5808/// A `CustomTargetType` defines a type of custom target that can be referenced
5809/// in a `Target` in order to facilitate deploying to other systems besides the
5810/// supported runtimes.
5811#[derive(Clone, Default, PartialEq)]
5812#[non_exhaustive]
5813pub struct CustomTargetType {
5814 /// Identifier. Name of the `CustomTargetType`. Format is
5815 /// `projects/{project}/locations/{location}/customTargetTypes/{customTargetType}`.
5816 /// The `customTargetType` component must match
5817 /// `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`
5818 pub name: std::string::String,
5819
5820 /// Output only. Resource id of the `CustomTargetType`.
5821 pub custom_target_type_id: std::string::String,
5822
5823 /// Output only. Unique identifier of the `CustomTargetType`.
5824 pub uid: std::string::String,
5825
5826 /// Optional. Description of the `CustomTargetType`. Max length is 255
5827 /// characters.
5828 pub description: std::string::String,
5829
5830 /// Optional. User annotations. These attributes can only be set and used by
5831 /// the user, and not by Cloud Deploy. See
5832 /// <https://google.aip.dev/128#annotations> for more details such as format and
5833 /// size limitations.
5834 pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
5835
5836 /// Optional. Labels are attributes that can be set and used by both the
5837 /// user and by Cloud Deploy. Labels must meet the following constraints:
5838 ///
5839 /// * Keys and values can contain only lowercase letters, numeric characters,
5840 /// underscores, and dashes.
5841 /// * All characters must use UTF-8 encoding, and international characters are
5842 /// allowed.
5843 /// * Keys must start with a lowercase letter or international character.
5844 /// * Each resource is limited to a maximum of 64 labels.
5845 ///
5846 /// Both keys and values are additionally constrained to be <= 128 bytes.
5847 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
5848
5849 /// Output only. Time at which the `CustomTargetType` was created.
5850 pub create_time: std::option::Option<wkt::Timestamp>,
5851
5852 /// Output only. Most recent time at which the `CustomTargetType` was updated.
5853 pub update_time: std::option::Option<wkt::Timestamp>,
5854
5855 /// Optional. This checksum is computed by the server based on the value of
5856 /// other fields, and may be sent on update and delete requests to ensure the
5857 /// client has an up-to-date value before proceeding.
5858 pub etag: std::string::String,
5859
5860 /// Defines the `CustomTargetType` renderer and deployer.
5861 pub definition: std::option::Option<crate::model::custom_target_type::Definition>,
5862
5863 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5864}
5865
5866impl CustomTargetType {
5867 pub fn new() -> Self {
5868 std::default::Default::default()
5869 }
5870
5871 /// Sets the value of [name][crate::model::CustomTargetType::name].
5872 ///
5873 /// # Example
5874 /// ```ignore,no_run
5875 /// # use google_cloud_deploy_v1::model::CustomTargetType;
5876 /// let x = CustomTargetType::new().set_name("example");
5877 /// ```
5878 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5879 self.name = v.into();
5880 self
5881 }
5882
5883 /// Sets the value of [custom_target_type_id][crate::model::CustomTargetType::custom_target_type_id].
5884 ///
5885 /// # Example
5886 /// ```ignore,no_run
5887 /// # use google_cloud_deploy_v1::model::CustomTargetType;
5888 /// let x = CustomTargetType::new().set_custom_target_type_id("example");
5889 /// ```
5890 pub fn set_custom_target_type_id<T: std::convert::Into<std::string::String>>(
5891 mut self,
5892 v: T,
5893 ) -> Self {
5894 self.custom_target_type_id = v.into();
5895 self
5896 }
5897
5898 /// Sets the value of [uid][crate::model::CustomTargetType::uid].
5899 ///
5900 /// # Example
5901 /// ```ignore,no_run
5902 /// # use google_cloud_deploy_v1::model::CustomTargetType;
5903 /// let x = CustomTargetType::new().set_uid("example");
5904 /// ```
5905 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5906 self.uid = v.into();
5907 self
5908 }
5909
5910 /// Sets the value of [description][crate::model::CustomTargetType::description].
5911 ///
5912 /// # Example
5913 /// ```ignore,no_run
5914 /// # use google_cloud_deploy_v1::model::CustomTargetType;
5915 /// let x = CustomTargetType::new().set_description("example");
5916 /// ```
5917 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5918 self.description = v.into();
5919 self
5920 }
5921
5922 /// Sets the value of [annotations][crate::model::CustomTargetType::annotations].
5923 ///
5924 /// # Example
5925 /// ```ignore,no_run
5926 /// # use google_cloud_deploy_v1::model::CustomTargetType;
5927 /// let x = CustomTargetType::new().set_annotations([
5928 /// ("key0", "abc"),
5929 /// ("key1", "xyz"),
5930 /// ]);
5931 /// ```
5932 pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
5933 where
5934 T: std::iter::IntoIterator<Item = (K, V)>,
5935 K: std::convert::Into<std::string::String>,
5936 V: std::convert::Into<std::string::String>,
5937 {
5938 use std::iter::Iterator;
5939 self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5940 self
5941 }
5942
5943 /// Sets the value of [labels][crate::model::CustomTargetType::labels].
5944 ///
5945 /// # Example
5946 /// ```ignore,no_run
5947 /// # use google_cloud_deploy_v1::model::CustomTargetType;
5948 /// let x = CustomTargetType::new().set_labels([
5949 /// ("key0", "abc"),
5950 /// ("key1", "xyz"),
5951 /// ]);
5952 /// ```
5953 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
5954 where
5955 T: std::iter::IntoIterator<Item = (K, V)>,
5956 K: std::convert::Into<std::string::String>,
5957 V: std::convert::Into<std::string::String>,
5958 {
5959 use std::iter::Iterator;
5960 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5961 self
5962 }
5963
5964 /// Sets the value of [create_time][crate::model::CustomTargetType::create_time].
5965 ///
5966 /// # Example
5967 /// ```ignore,no_run
5968 /// # use google_cloud_deploy_v1::model::CustomTargetType;
5969 /// use wkt::Timestamp;
5970 /// let x = CustomTargetType::new().set_create_time(Timestamp::default()/* use setters */);
5971 /// ```
5972 pub fn set_create_time<T>(mut self, v: T) -> Self
5973 where
5974 T: std::convert::Into<wkt::Timestamp>,
5975 {
5976 self.create_time = std::option::Option::Some(v.into());
5977 self
5978 }
5979
5980 /// Sets or clears the value of [create_time][crate::model::CustomTargetType::create_time].
5981 ///
5982 /// # Example
5983 /// ```ignore,no_run
5984 /// # use google_cloud_deploy_v1::model::CustomTargetType;
5985 /// use wkt::Timestamp;
5986 /// let x = CustomTargetType::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
5987 /// let x = CustomTargetType::new().set_or_clear_create_time(None::<Timestamp>);
5988 /// ```
5989 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
5990 where
5991 T: std::convert::Into<wkt::Timestamp>,
5992 {
5993 self.create_time = v.map(|x| x.into());
5994 self
5995 }
5996
5997 /// Sets the value of [update_time][crate::model::CustomTargetType::update_time].
5998 ///
5999 /// # Example
6000 /// ```ignore,no_run
6001 /// # use google_cloud_deploy_v1::model::CustomTargetType;
6002 /// use wkt::Timestamp;
6003 /// let x = CustomTargetType::new().set_update_time(Timestamp::default()/* use setters */);
6004 /// ```
6005 pub fn set_update_time<T>(mut self, v: T) -> Self
6006 where
6007 T: std::convert::Into<wkt::Timestamp>,
6008 {
6009 self.update_time = std::option::Option::Some(v.into());
6010 self
6011 }
6012
6013 /// Sets or clears the value of [update_time][crate::model::CustomTargetType::update_time].
6014 ///
6015 /// # Example
6016 /// ```ignore,no_run
6017 /// # use google_cloud_deploy_v1::model::CustomTargetType;
6018 /// use wkt::Timestamp;
6019 /// let x = CustomTargetType::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
6020 /// let x = CustomTargetType::new().set_or_clear_update_time(None::<Timestamp>);
6021 /// ```
6022 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
6023 where
6024 T: std::convert::Into<wkt::Timestamp>,
6025 {
6026 self.update_time = v.map(|x| x.into());
6027 self
6028 }
6029
6030 /// Sets the value of [etag][crate::model::CustomTargetType::etag].
6031 ///
6032 /// # Example
6033 /// ```ignore,no_run
6034 /// # use google_cloud_deploy_v1::model::CustomTargetType;
6035 /// let x = CustomTargetType::new().set_etag("example");
6036 /// ```
6037 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6038 self.etag = v.into();
6039 self
6040 }
6041
6042 /// Sets the value of [definition][crate::model::CustomTargetType::definition].
6043 ///
6044 /// Note that all the setters affecting `definition` are mutually
6045 /// exclusive.
6046 ///
6047 /// # Example
6048 /// ```ignore,no_run
6049 /// # use google_cloud_deploy_v1::model::CustomTargetType;
6050 /// use google_cloud_deploy_v1::model::CustomTargetSkaffoldActions;
6051 /// let x = CustomTargetType::new().set_definition(Some(
6052 /// google_cloud_deploy_v1::model::custom_target_type::Definition::CustomActions(CustomTargetSkaffoldActions::default().into())));
6053 /// ```
6054 pub fn set_definition<
6055 T: std::convert::Into<std::option::Option<crate::model::custom_target_type::Definition>>,
6056 >(
6057 mut self,
6058 v: T,
6059 ) -> Self {
6060 self.definition = v.into();
6061 self
6062 }
6063
6064 /// The value of [definition][crate::model::CustomTargetType::definition]
6065 /// if it holds a `CustomActions`, `None` if the field is not set or
6066 /// holds a different branch.
6067 pub fn custom_actions(
6068 &self,
6069 ) -> std::option::Option<&std::boxed::Box<crate::model::CustomTargetSkaffoldActions>> {
6070 #[allow(unreachable_patterns)]
6071 self.definition.as_ref().and_then(|v| match v {
6072 crate::model::custom_target_type::Definition::CustomActions(v) => {
6073 std::option::Option::Some(v)
6074 }
6075 _ => std::option::Option::None,
6076 })
6077 }
6078
6079 /// Sets the value of [definition][crate::model::CustomTargetType::definition]
6080 /// to hold a `CustomActions`.
6081 ///
6082 /// Note that all the setters affecting `definition` are
6083 /// mutually exclusive.
6084 ///
6085 /// # Example
6086 /// ```ignore,no_run
6087 /// # use google_cloud_deploy_v1::model::CustomTargetType;
6088 /// use google_cloud_deploy_v1::model::CustomTargetSkaffoldActions;
6089 /// let x = CustomTargetType::new().set_custom_actions(CustomTargetSkaffoldActions::default()/* use setters */);
6090 /// assert!(x.custom_actions().is_some());
6091 /// ```
6092 pub fn set_custom_actions<
6093 T: std::convert::Into<std::boxed::Box<crate::model::CustomTargetSkaffoldActions>>,
6094 >(
6095 mut self,
6096 v: T,
6097 ) -> Self {
6098 self.definition = std::option::Option::Some(
6099 crate::model::custom_target_type::Definition::CustomActions(v.into()),
6100 );
6101 self
6102 }
6103}
6104
6105impl wkt::message::Message for CustomTargetType {
6106 fn typename() -> &'static str {
6107 "type.googleapis.com/google.cloud.deploy.v1.CustomTargetType"
6108 }
6109}
6110
6111/// Defines additional types related to [CustomTargetType].
6112pub mod custom_target_type {
6113 #[allow(unused_imports)]
6114 use super::*;
6115
6116 /// Defines the `CustomTargetType` renderer and deployer.
6117 #[derive(Clone, Debug, PartialEq)]
6118 #[non_exhaustive]
6119 pub enum Definition {
6120 /// Optional. Configures render and deploy for the `CustomTargetType` using
6121 /// Skaffold custom actions.
6122 CustomActions(std::boxed::Box<crate::model::CustomTargetSkaffoldActions>),
6123 }
6124}
6125
6126/// CustomTargetSkaffoldActions represents the `CustomTargetType` configuration
6127/// using Skaffold custom actions.
6128#[derive(Clone, Default, PartialEq)]
6129#[non_exhaustive]
6130pub struct CustomTargetSkaffoldActions {
6131 /// Optional. The Skaffold custom action responsible for render operations. If
6132 /// not provided then Cloud Deploy will perform the render operations via
6133 /// `skaffold render`.
6134 pub render_action: std::string::String,
6135
6136 /// Required. The Skaffold custom action responsible for deploy operations.
6137 pub deploy_action: std::string::String,
6138
6139 /// Optional. List of Skaffold modules Cloud Deploy will include in the
6140 /// Skaffold Config as required before performing diagnose.
6141 pub include_skaffold_modules: std::vec::Vec<crate::model::SkaffoldModules>,
6142
6143 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6144}
6145
6146impl CustomTargetSkaffoldActions {
6147 pub fn new() -> Self {
6148 std::default::Default::default()
6149 }
6150
6151 /// Sets the value of [render_action][crate::model::CustomTargetSkaffoldActions::render_action].
6152 ///
6153 /// # Example
6154 /// ```ignore,no_run
6155 /// # use google_cloud_deploy_v1::model::CustomTargetSkaffoldActions;
6156 /// let x = CustomTargetSkaffoldActions::new().set_render_action("example");
6157 /// ```
6158 pub fn set_render_action<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6159 self.render_action = v.into();
6160 self
6161 }
6162
6163 /// Sets the value of [deploy_action][crate::model::CustomTargetSkaffoldActions::deploy_action].
6164 ///
6165 /// # Example
6166 /// ```ignore,no_run
6167 /// # use google_cloud_deploy_v1::model::CustomTargetSkaffoldActions;
6168 /// let x = CustomTargetSkaffoldActions::new().set_deploy_action("example");
6169 /// ```
6170 pub fn set_deploy_action<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6171 self.deploy_action = v.into();
6172 self
6173 }
6174
6175 /// Sets the value of [include_skaffold_modules][crate::model::CustomTargetSkaffoldActions::include_skaffold_modules].
6176 ///
6177 /// # Example
6178 /// ```ignore,no_run
6179 /// # use google_cloud_deploy_v1::model::CustomTargetSkaffoldActions;
6180 /// use google_cloud_deploy_v1::model::SkaffoldModules;
6181 /// let x = CustomTargetSkaffoldActions::new()
6182 /// .set_include_skaffold_modules([
6183 /// SkaffoldModules::default()/* use setters */,
6184 /// SkaffoldModules::default()/* use (different) setters */,
6185 /// ]);
6186 /// ```
6187 pub fn set_include_skaffold_modules<T, V>(mut self, v: T) -> Self
6188 where
6189 T: std::iter::IntoIterator<Item = V>,
6190 V: std::convert::Into<crate::model::SkaffoldModules>,
6191 {
6192 use std::iter::Iterator;
6193 self.include_skaffold_modules = v.into_iter().map(|i| i.into()).collect();
6194 self
6195 }
6196}
6197
6198impl wkt::message::Message for CustomTargetSkaffoldActions {
6199 fn typename() -> &'static str {
6200 "type.googleapis.com/google.cloud.deploy.v1.CustomTargetSkaffoldActions"
6201 }
6202}
6203
6204/// Skaffold Config modules and their remote source.
6205#[derive(Clone, Default, PartialEq)]
6206#[non_exhaustive]
6207pub struct SkaffoldModules {
6208 /// Optional. The Skaffold Config modules to use from the specified source.
6209 pub configs: std::vec::Vec<std::string::String>,
6210
6211 /// The source that contains the Skaffold Config modules.
6212 pub source: std::option::Option<crate::model::skaffold_modules::Source>,
6213
6214 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6215}
6216
6217impl SkaffoldModules {
6218 pub fn new() -> Self {
6219 std::default::Default::default()
6220 }
6221
6222 /// Sets the value of [configs][crate::model::SkaffoldModules::configs].
6223 ///
6224 /// # Example
6225 /// ```ignore,no_run
6226 /// # use google_cloud_deploy_v1::model::SkaffoldModules;
6227 /// let x = SkaffoldModules::new().set_configs(["a", "b", "c"]);
6228 /// ```
6229 pub fn set_configs<T, V>(mut self, v: T) -> Self
6230 where
6231 T: std::iter::IntoIterator<Item = V>,
6232 V: std::convert::Into<std::string::String>,
6233 {
6234 use std::iter::Iterator;
6235 self.configs = v.into_iter().map(|i| i.into()).collect();
6236 self
6237 }
6238
6239 /// Sets the value of [source][crate::model::SkaffoldModules::source].
6240 ///
6241 /// Note that all the setters affecting `source` are mutually
6242 /// exclusive.
6243 ///
6244 /// # Example
6245 /// ```ignore,no_run
6246 /// # use google_cloud_deploy_v1::model::SkaffoldModules;
6247 /// use google_cloud_deploy_v1::model::skaffold_modules::SkaffoldGitSource;
6248 /// let x = SkaffoldModules::new().set_source(Some(
6249 /// google_cloud_deploy_v1::model::skaffold_modules::Source::Git(SkaffoldGitSource::default().into())));
6250 /// ```
6251 pub fn set_source<
6252 T: std::convert::Into<std::option::Option<crate::model::skaffold_modules::Source>>,
6253 >(
6254 mut self,
6255 v: T,
6256 ) -> Self {
6257 self.source = v.into();
6258 self
6259 }
6260
6261 /// The value of [source][crate::model::SkaffoldModules::source]
6262 /// if it holds a `Git`, `None` if the field is not set or
6263 /// holds a different branch.
6264 pub fn git(
6265 &self,
6266 ) -> std::option::Option<&std::boxed::Box<crate::model::skaffold_modules::SkaffoldGitSource>>
6267 {
6268 #[allow(unreachable_patterns)]
6269 self.source.as_ref().and_then(|v| match v {
6270 crate::model::skaffold_modules::Source::Git(v) => std::option::Option::Some(v),
6271 _ => std::option::Option::None,
6272 })
6273 }
6274
6275 /// Sets the value of [source][crate::model::SkaffoldModules::source]
6276 /// to hold a `Git`.
6277 ///
6278 /// Note that all the setters affecting `source` are
6279 /// mutually exclusive.
6280 ///
6281 /// # Example
6282 /// ```ignore,no_run
6283 /// # use google_cloud_deploy_v1::model::SkaffoldModules;
6284 /// use google_cloud_deploy_v1::model::skaffold_modules::SkaffoldGitSource;
6285 /// let x = SkaffoldModules::new().set_git(SkaffoldGitSource::default()/* use setters */);
6286 /// assert!(x.git().is_some());
6287 /// assert!(x.google_cloud_storage().is_none());
6288 /// assert!(x.google_cloud_build_repo().is_none());
6289 /// ```
6290 pub fn set_git<
6291 T: std::convert::Into<std::boxed::Box<crate::model::skaffold_modules::SkaffoldGitSource>>,
6292 >(
6293 mut self,
6294 v: T,
6295 ) -> Self {
6296 self.source =
6297 std::option::Option::Some(crate::model::skaffold_modules::Source::Git(v.into()));
6298 self
6299 }
6300
6301 /// The value of [source][crate::model::SkaffoldModules::source]
6302 /// if it holds a `GoogleCloudStorage`, `None` if the field is not set or
6303 /// holds a different branch.
6304 pub fn google_cloud_storage(
6305 &self,
6306 ) -> std::option::Option<&std::boxed::Box<crate::model::skaffold_modules::SkaffoldGCSSource>>
6307 {
6308 #[allow(unreachable_patterns)]
6309 self.source.as_ref().and_then(|v| match v {
6310 crate::model::skaffold_modules::Source::GoogleCloudStorage(v) => {
6311 std::option::Option::Some(v)
6312 }
6313 _ => std::option::Option::None,
6314 })
6315 }
6316
6317 /// Sets the value of [source][crate::model::SkaffoldModules::source]
6318 /// to hold a `GoogleCloudStorage`.
6319 ///
6320 /// Note that all the setters affecting `source` are
6321 /// mutually exclusive.
6322 ///
6323 /// # Example
6324 /// ```ignore,no_run
6325 /// # use google_cloud_deploy_v1::model::SkaffoldModules;
6326 /// use google_cloud_deploy_v1::model::skaffold_modules::SkaffoldGCSSource;
6327 /// let x = SkaffoldModules::new().set_google_cloud_storage(SkaffoldGCSSource::default()/* use setters */);
6328 /// assert!(x.google_cloud_storage().is_some());
6329 /// assert!(x.git().is_none());
6330 /// assert!(x.google_cloud_build_repo().is_none());
6331 /// ```
6332 pub fn set_google_cloud_storage<
6333 T: std::convert::Into<std::boxed::Box<crate::model::skaffold_modules::SkaffoldGCSSource>>,
6334 >(
6335 mut self,
6336 v: T,
6337 ) -> Self {
6338 self.source = std::option::Option::Some(
6339 crate::model::skaffold_modules::Source::GoogleCloudStorage(v.into()),
6340 );
6341 self
6342 }
6343
6344 /// The value of [source][crate::model::SkaffoldModules::source]
6345 /// if it holds a `GoogleCloudBuildRepo`, `None` if the field is not set or
6346 /// holds a different branch.
6347 pub fn google_cloud_build_repo(
6348 &self,
6349 ) -> std::option::Option<&std::boxed::Box<crate::model::skaffold_modules::SkaffoldGCBRepoSource>>
6350 {
6351 #[allow(unreachable_patterns)]
6352 self.source.as_ref().and_then(|v| match v {
6353 crate::model::skaffold_modules::Source::GoogleCloudBuildRepo(v) => {
6354 std::option::Option::Some(v)
6355 }
6356 _ => std::option::Option::None,
6357 })
6358 }
6359
6360 /// Sets the value of [source][crate::model::SkaffoldModules::source]
6361 /// to hold a `GoogleCloudBuildRepo`.
6362 ///
6363 /// Note that all the setters affecting `source` are
6364 /// mutually exclusive.
6365 ///
6366 /// # Example
6367 /// ```ignore,no_run
6368 /// # use google_cloud_deploy_v1::model::SkaffoldModules;
6369 /// use google_cloud_deploy_v1::model::skaffold_modules::SkaffoldGCBRepoSource;
6370 /// let x = SkaffoldModules::new().set_google_cloud_build_repo(SkaffoldGCBRepoSource::default()/* use setters */);
6371 /// assert!(x.google_cloud_build_repo().is_some());
6372 /// assert!(x.git().is_none());
6373 /// assert!(x.google_cloud_storage().is_none());
6374 /// ```
6375 pub fn set_google_cloud_build_repo<
6376 T: std::convert::Into<std::boxed::Box<crate::model::skaffold_modules::SkaffoldGCBRepoSource>>,
6377 >(
6378 mut self,
6379 v: T,
6380 ) -> Self {
6381 self.source = std::option::Option::Some(
6382 crate::model::skaffold_modules::Source::GoogleCloudBuildRepo(v.into()),
6383 );
6384 self
6385 }
6386}
6387
6388impl wkt::message::Message for SkaffoldModules {
6389 fn typename() -> &'static str {
6390 "type.googleapis.com/google.cloud.deploy.v1.SkaffoldModules"
6391 }
6392}
6393
6394/// Defines additional types related to [SkaffoldModules].
6395pub mod skaffold_modules {
6396 #[allow(unused_imports)]
6397 use super::*;
6398
6399 /// Git repository containing Skaffold Config modules.
6400 #[derive(Clone, Default, PartialEq)]
6401 #[non_exhaustive]
6402 pub struct SkaffoldGitSource {
6403 /// Required. Git repository the package should be cloned from.
6404 pub repo: std::string::String,
6405
6406 /// Optional. Relative path from the repository root to the Skaffold file.
6407 pub path: std::string::String,
6408
6409 /// Optional. Git branch or tag to use when cloning the repository.
6410 pub r#ref: std::string::String,
6411
6412 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6413 }
6414
6415 impl SkaffoldGitSource {
6416 pub fn new() -> Self {
6417 std::default::Default::default()
6418 }
6419
6420 /// Sets the value of [repo][crate::model::skaffold_modules::SkaffoldGitSource::repo].
6421 ///
6422 /// # Example
6423 /// ```ignore,no_run
6424 /// # use google_cloud_deploy_v1::model::skaffold_modules::SkaffoldGitSource;
6425 /// let x = SkaffoldGitSource::new().set_repo("example");
6426 /// ```
6427 pub fn set_repo<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6428 self.repo = v.into();
6429 self
6430 }
6431
6432 /// Sets the value of [path][crate::model::skaffold_modules::SkaffoldGitSource::path].
6433 ///
6434 /// # Example
6435 /// ```ignore,no_run
6436 /// # use google_cloud_deploy_v1::model::skaffold_modules::SkaffoldGitSource;
6437 /// let x = SkaffoldGitSource::new().set_path("example");
6438 /// ```
6439 pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6440 self.path = v.into();
6441 self
6442 }
6443
6444 /// Sets the value of [r#ref][crate::model::skaffold_modules::SkaffoldGitSource::ref].
6445 ///
6446 /// # Example
6447 /// ```ignore,no_run
6448 /// # use google_cloud_deploy_v1::model::skaffold_modules::SkaffoldGitSource;
6449 /// let x = SkaffoldGitSource::new().set_ref("example");
6450 /// ```
6451 pub fn set_ref<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6452 self.r#ref = v.into();
6453 self
6454 }
6455 }
6456
6457 impl wkt::message::Message for SkaffoldGitSource {
6458 fn typename() -> &'static str {
6459 "type.googleapis.com/google.cloud.deploy.v1.SkaffoldModules.SkaffoldGitSource"
6460 }
6461 }
6462
6463 /// Cloud Storage bucket containing Skaffold Config modules.
6464 #[derive(Clone, Default, PartialEq)]
6465 #[non_exhaustive]
6466 pub struct SkaffoldGCSSource {
6467 /// Required. Cloud Storage source paths to copy recursively. For example,
6468 /// providing "gs://my-bucket/dir/configs/*" will result in Skaffold copying
6469 /// all files within the "dir/configs" directory in the bucket "my-bucket".
6470 pub source: std::string::String,
6471
6472 /// Optional. Relative path from the source to the Skaffold file.
6473 pub path: std::string::String,
6474
6475 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6476 }
6477
6478 impl SkaffoldGCSSource {
6479 pub fn new() -> Self {
6480 std::default::Default::default()
6481 }
6482
6483 /// Sets the value of [source][crate::model::skaffold_modules::SkaffoldGCSSource::source].
6484 ///
6485 /// # Example
6486 /// ```ignore,no_run
6487 /// # use google_cloud_deploy_v1::model::skaffold_modules::SkaffoldGCSSource;
6488 /// let x = SkaffoldGCSSource::new().set_source("example");
6489 /// ```
6490 pub fn set_source<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6491 self.source = v.into();
6492 self
6493 }
6494
6495 /// Sets the value of [path][crate::model::skaffold_modules::SkaffoldGCSSource::path].
6496 ///
6497 /// # Example
6498 /// ```ignore,no_run
6499 /// # use google_cloud_deploy_v1::model::skaffold_modules::SkaffoldGCSSource;
6500 /// let x = SkaffoldGCSSource::new().set_path("example");
6501 /// ```
6502 pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6503 self.path = v.into();
6504 self
6505 }
6506 }
6507
6508 impl wkt::message::Message for SkaffoldGCSSource {
6509 fn typename() -> &'static str {
6510 "type.googleapis.com/google.cloud.deploy.v1.SkaffoldModules.SkaffoldGCSSource"
6511 }
6512 }
6513
6514 /// Cloud Build V2 Repository containing Skaffold Configs.
6515 #[derive(Clone, Default, PartialEq)]
6516 #[non_exhaustive]
6517 pub struct SkaffoldGCBRepoSource {
6518 /// Required. Name of the Cloud Build V2 Repository.
6519 /// Format is
6520 /// projects/{project}/locations/{location}/connections/{connection}/repositories/{repository}.
6521 pub repository: std::string::String,
6522
6523 /// Optional. Relative path from the repository root to the Skaffold Config
6524 /// file.
6525 pub path: std::string::String,
6526
6527 /// Optional. Branch or tag to use when cloning the repository.
6528 pub r#ref: std::string::String,
6529
6530 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6531 }
6532
6533 impl SkaffoldGCBRepoSource {
6534 pub fn new() -> Self {
6535 std::default::Default::default()
6536 }
6537
6538 /// Sets the value of [repository][crate::model::skaffold_modules::SkaffoldGCBRepoSource::repository].
6539 ///
6540 /// # Example
6541 /// ```ignore,no_run
6542 /// # use google_cloud_deploy_v1::model::skaffold_modules::SkaffoldGCBRepoSource;
6543 /// let x = SkaffoldGCBRepoSource::new().set_repository("example");
6544 /// ```
6545 pub fn set_repository<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6546 self.repository = v.into();
6547 self
6548 }
6549
6550 /// Sets the value of [path][crate::model::skaffold_modules::SkaffoldGCBRepoSource::path].
6551 ///
6552 /// # Example
6553 /// ```ignore,no_run
6554 /// # use google_cloud_deploy_v1::model::skaffold_modules::SkaffoldGCBRepoSource;
6555 /// let x = SkaffoldGCBRepoSource::new().set_path("example");
6556 /// ```
6557 pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6558 self.path = v.into();
6559 self
6560 }
6561
6562 /// Sets the value of [r#ref][crate::model::skaffold_modules::SkaffoldGCBRepoSource::ref].
6563 ///
6564 /// # Example
6565 /// ```ignore,no_run
6566 /// # use google_cloud_deploy_v1::model::skaffold_modules::SkaffoldGCBRepoSource;
6567 /// let x = SkaffoldGCBRepoSource::new().set_ref("example");
6568 /// ```
6569 pub fn set_ref<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6570 self.r#ref = v.into();
6571 self
6572 }
6573 }
6574
6575 impl wkt::message::Message for SkaffoldGCBRepoSource {
6576 fn typename() -> &'static str {
6577 "type.googleapis.com/google.cloud.deploy.v1.SkaffoldModules.SkaffoldGCBRepoSource"
6578 }
6579 }
6580
6581 /// The source that contains the Skaffold Config modules.
6582 #[derive(Clone, Debug, PartialEq)]
6583 #[non_exhaustive]
6584 pub enum Source {
6585 /// Optional. Remote git repository containing the Skaffold Config modules.
6586 Git(std::boxed::Box<crate::model::skaffold_modules::SkaffoldGitSource>),
6587 /// Optional. Cloud Storage bucket containing the Skaffold Config modules.
6588 GoogleCloudStorage(std::boxed::Box<crate::model::skaffold_modules::SkaffoldGCSSource>),
6589 /// Optional. Cloud Build V2 repository containing the Skaffold Config
6590 /// modules.
6591 GoogleCloudBuildRepo(
6592 std::boxed::Box<crate::model::skaffold_modules::SkaffoldGCBRepoSource>,
6593 ),
6594 }
6595}
6596
6597/// The request object for `ListCustomTargetTypes`.
6598#[derive(Clone, Default, PartialEq)]
6599#[non_exhaustive]
6600pub struct ListCustomTargetTypesRequest {
6601 /// Required. The parent that owns this collection of custom target types.
6602 /// Format must be `projects/{project_id}/locations/{location_name}`.
6603 pub parent: std::string::String,
6604
6605 /// Optional. The maximum number of `CustomTargetType` objects to return. The
6606 /// service may return fewer than this value. If unspecified, at most 50
6607 /// `CustomTargetType` objects will be returned. The maximum value is 1000;
6608 /// values above 1000 will be set to 1000.
6609 pub page_size: i32,
6610
6611 /// Optional. A page token, received from a previous `ListCustomTargetTypes`
6612 /// call. Provide this to retrieve the subsequent page.
6613 ///
6614 /// When paginating, all other provided parameters match
6615 /// the call that provided the page token.
6616 pub page_token: std::string::String,
6617
6618 /// Optional. Filter custom target types to be returned. See
6619 /// <https://google.aip.dev/160> for more details.
6620 pub filter: std::string::String,
6621
6622 /// Optional. Field to sort by. See <https://google.aip.dev/132#ordering> for
6623 /// more details.
6624 pub order_by: std::string::String,
6625
6626 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6627}
6628
6629impl ListCustomTargetTypesRequest {
6630 pub fn new() -> Self {
6631 std::default::Default::default()
6632 }
6633
6634 /// Sets the value of [parent][crate::model::ListCustomTargetTypesRequest::parent].
6635 ///
6636 /// # Example
6637 /// ```ignore,no_run
6638 /// # use google_cloud_deploy_v1::model::ListCustomTargetTypesRequest;
6639 /// let x = ListCustomTargetTypesRequest::new().set_parent("example");
6640 /// ```
6641 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6642 self.parent = v.into();
6643 self
6644 }
6645
6646 /// Sets the value of [page_size][crate::model::ListCustomTargetTypesRequest::page_size].
6647 ///
6648 /// # Example
6649 /// ```ignore,no_run
6650 /// # use google_cloud_deploy_v1::model::ListCustomTargetTypesRequest;
6651 /// let x = ListCustomTargetTypesRequest::new().set_page_size(42);
6652 /// ```
6653 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6654 self.page_size = v.into();
6655 self
6656 }
6657
6658 /// Sets the value of [page_token][crate::model::ListCustomTargetTypesRequest::page_token].
6659 ///
6660 /// # Example
6661 /// ```ignore,no_run
6662 /// # use google_cloud_deploy_v1::model::ListCustomTargetTypesRequest;
6663 /// let x = ListCustomTargetTypesRequest::new().set_page_token("example");
6664 /// ```
6665 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6666 self.page_token = v.into();
6667 self
6668 }
6669
6670 /// Sets the value of [filter][crate::model::ListCustomTargetTypesRequest::filter].
6671 ///
6672 /// # Example
6673 /// ```ignore,no_run
6674 /// # use google_cloud_deploy_v1::model::ListCustomTargetTypesRequest;
6675 /// let x = ListCustomTargetTypesRequest::new().set_filter("example");
6676 /// ```
6677 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6678 self.filter = v.into();
6679 self
6680 }
6681
6682 /// Sets the value of [order_by][crate::model::ListCustomTargetTypesRequest::order_by].
6683 ///
6684 /// # Example
6685 /// ```ignore,no_run
6686 /// # use google_cloud_deploy_v1::model::ListCustomTargetTypesRequest;
6687 /// let x = ListCustomTargetTypesRequest::new().set_order_by("example");
6688 /// ```
6689 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6690 self.order_by = v.into();
6691 self
6692 }
6693}
6694
6695impl wkt::message::Message for ListCustomTargetTypesRequest {
6696 fn typename() -> &'static str {
6697 "type.googleapis.com/google.cloud.deploy.v1.ListCustomTargetTypesRequest"
6698 }
6699}
6700
6701/// The response object from `ListCustomTargetTypes.`
6702#[derive(Clone, Default, PartialEq)]
6703#[non_exhaustive]
6704pub struct ListCustomTargetTypesResponse {
6705 /// The `CustomTargetType` objects.
6706 pub custom_target_types: std::vec::Vec<crate::model::CustomTargetType>,
6707
6708 /// A token, which can be sent as `page_token` to retrieve the next page.
6709 /// If this field is omitted, there are no subsequent pages.
6710 pub next_page_token: std::string::String,
6711
6712 /// Locations that could not be reached.
6713 pub unreachable: std::vec::Vec<std::string::String>,
6714
6715 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6716}
6717
6718impl ListCustomTargetTypesResponse {
6719 pub fn new() -> Self {
6720 std::default::Default::default()
6721 }
6722
6723 /// Sets the value of [custom_target_types][crate::model::ListCustomTargetTypesResponse::custom_target_types].
6724 ///
6725 /// # Example
6726 /// ```ignore,no_run
6727 /// # use google_cloud_deploy_v1::model::ListCustomTargetTypesResponse;
6728 /// use google_cloud_deploy_v1::model::CustomTargetType;
6729 /// let x = ListCustomTargetTypesResponse::new()
6730 /// .set_custom_target_types([
6731 /// CustomTargetType::default()/* use setters */,
6732 /// CustomTargetType::default()/* use (different) setters */,
6733 /// ]);
6734 /// ```
6735 pub fn set_custom_target_types<T, V>(mut self, v: T) -> Self
6736 where
6737 T: std::iter::IntoIterator<Item = V>,
6738 V: std::convert::Into<crate::model::CustomTargetType>,
6739 {
6740 use std::iter::Iterator;
6741 self.custom_target_types = v.into_iter().map(|i| i.into()).collect();
6742 self
6743 }
6744
6745 /// Sets the value of [next_page_token][crate::model::ListCustomTargetTypesResponse::next_page_token].
6746 ///
6747 /// # Example
6748 /// ```ignore,no_run
6749 /// # use google_cloud_deploy_v1::model::ListCustomTargetTypesResponse;
6750 /// let x = ListCustomTargetTypesResponse::new().set_next_page_token("example");
6751 /// ```
6752 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6753 self.next_page_token = v.into();
6754 self
6755 }
6756
6757 /// Sets the value of [unreachable][crate::model::ListCustomTargetTypesResponse::unreachable].
6758 ///
6759 /// # Example
6760 /// ```ignore,no_run
6761 /// # use google_cloud_deploy_v1::model::ListCustomTargetTypesResponse;
6762 /// let x = ListCustomTargetTypesResponse::new().set_unreachable(["a", "b", "c"]);
6763 /// ```
6764 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
6765 where
6766 T: std::iter::IntoIterator<Item = V>,
6767 V: std::convert::Into<std::string::String>,
6768 {
6769 use std::iter::Iterator;
6770 self.unreachable = v.into_iter().map(|i| i.into()).collect();
6771 self
6772 }
6773}
6774
6775impl wkt::message::Message for ListCustomTargetTypesResponse {
6776 fn typename() -> &'static str {
6777 "type.googleapis.com/google.cloud.deploy.v1.ListCustomTargetTypesResponse"
6778 }
6779}
6780
6781#[doc(hidden)]
6782impl google_cloud_gax::paginator::internal::PageableResponse for ListCustomTargetTypesResponse {
6783 type PageItem = crate::model::CustomTargetType;
6784
6785 fn items(self) -> std::vec::Vec<Self::PageItem> {
6786 self.custom_target_types
6787 }
6788
6789 fn next_page_token(&self) -> std::string::String {
6790 use std::clone::Clone;
6791 self.next_page_token.clone()
6792 }
6793}
6794
6795/// The request object for `GetCustomTargetType`.
6796#[derive(Clone, Default, PartialEq)]
6797#[non_exhaustive]
6798pub struct GetCustomTargetTypeRequest {
6799 /// Required. Name of the `CustomTargetType`. Format must be
6800 /// `projects/{project_id}/locations/{location_name}/customTargetTypes/{custom_target_type}`.
6801 pub name: std::string::String,
6802
6803 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6804}
6805
6806impl GetCustomTargetTypeRequest {
6807 pub fn new() -> Self {
6808 std::default::Default::default()
6809 }
6810
6811 /// Sets the value of [name][crate::model::GetCustomTargetTypeRequest::name].
6812 ///
6813 /// # Example
6814 /// ```ignore,no_run
6815 /// # use google_cloud_deploy_v1::model::GetCustomTargetTypeRequest;
6816 /// let x = GetCustomTargetTypeRequest::new().set_name("example");
6817 /// ```
6818 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6819 self.name = v.into();
6820 self
6821 }
6822}
6823
6824impl wkt::message::Message for GetCustomTargetTypeRequest {
6825 fn typename() -> &'static str {
6826 "type.googleapis.com/google.cloud.deploy.v1.GetCustomTargetTypeRequest"
6827 }
6828}
6829
6830/// The request object for `CreateCustomTargetType`.
6831#[derive(Clone, Default, PartialEq)]
6832#[non_exhaustive]
6833pub struct CreateCustomTargetTypeRequest {
6834 /// Required. The parent collection in which the `CustomTargetType` must be
6835 /// created. The format is `projects/{project_id}/locations/{location_name}`.
6836 pub parent: std::string::String,
6837
6838 /// Required. ID of the `CustomTargetType`.
6839 pub custom_target_type_id: std::string::String,
6840
6841 /// Required. The `CustomTargetType` to create.
6842 pub custom_target_type: std::option::Option<crate::model::CustomTargetType>,
6843
6844 /// Optional. A request ID to identify requests. Specify a unique request ID
6845 /// so that if you must retry your request, the server knows to ignore the
6846 /// request if it has already been completed. The server guarantees that for
6847 /// at least 60 minutes after the first request.
6848 ///
6849 /// For example, consider a situation where you make an initial request and the
6850 /// request times out. If you make the request again with the same request ID,
6851 /// the server can check if original operation with the same request ID was
6852 /// received, and if so, will ignore the second request. This prevents clients
6853 /// from accidentally creating duplicate commitments.
6854 ///
6855 /// The request ID must be a valid UUID with the exception that zero UUID is
6856 /// not supported (00000000-0000-0000-0000-000000000000).
6857 pub request_id: std::string::String,
6858
6859 /// Optional. If set to true, the request is validated and the user is provided
6860 /// with an expected result, but no actual change is made.
6861 pub validate_only: bool,
6862
6863 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6864}
6865
6866impl CreateCustomTargetTypeRequest {
6867 pub fn new() -> Self {
6868 std::default::Default::default()
6869 }
6870
6871 /// Sets the value of [parent][crate::model::CreateCustomTargetTypeRequest::parent].
6872 ///
6873 /// # Example
6874 /// ```ignore,no_run
6875 /// # use google_cloud_deploy_v1::model::CreateCustomTargetTypeRequest;
6876 /// let x = CreateCustomTargetTypeRequest::new().set_parent("example");
6877 /// ```
6878 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6879 self.parent = v.into();
6880 self
6881 }
6882
6883 /// Sets the value of [custom_target_type_id][crate::model::CreateCustomTargetTypeRequest::custom_target_type_id].
6884 ///
6885 /// # Example
6886 /// ```ignore,no_run
6887 /// # use google_cloud_deploy_v1::model::CreateCustomTargetTypeRequest;
6888 /// let x = CreateCustomTargetTypeRequest::new().set_custom_target_type_id("example");
6889 /// ```
6890 pub fn set_custom_target_type_id<T: std::convert::Into<std::string::String>>(
6891 mut self,
6892 v: T,
6893 ) -> Self {
6894 self.custom_target_type_id = v.into();
6895 self
6896 }
6897
6898 /// Sets the value of [custom_target_type][crate::model::CreateCustomTargetTypeRequest::custom_target_type].
6899 ///
6900 /// # Example
6901 /// ```ignore,no_run
6902 /// # use google_cloud_deploy_v1::model::CreateCustomTargetTypeRequest;
6903 /// use google_cloud_deploy_v1::model::CustomTargetType;
6904 /// let x = CreateCustomTargetTypeRequest::new().set_custom_target_type(CustomTargetType::default()/* use setters */);
6905 /// ```
6906 pub fn set_custom_target_type<T>(mut self, v: T) -> Self
6907 where
6908 T: std::convert::Into<crate::model::CustomTargetType>,
6909 {
6910 self.custom_target_type = std::option::Option::Some(v.into());
6911 self
6912 }
6913
6914 /// Sets or clears the value of [custom_target_type][crate::model::CreateCustomTargetTypeRequest::custom_target_type].
6915 ///
6916 /// # Example
6917 /// ```ignore,no_run
6918 /// # use google_cloud_deploy_v1::model::CreateCustomTargetTypeRequest;
6919 /// use google_cloud_deploy_v1::model::CustomTargetType;
6920 /// let x = CreateCustomTargetTypeRequest::new().set_or_clear_custom_target_type(Some(CustomTargetType::default()/* use setters */));
6921 /// let x = CreateCustomTargetTypeRequest::new().set_or_clear_custom_target_type(None::<CustomTargetType>);
6922 /// ```
6923 pub fn set_or_clear_custom_target_type<T>(mut self, v: std::option::Option<T>) -> Self
6924 where
6925 T: std::convert::Into<crate::model::CustomTargetType>,
6926 {
6927 self.custom_target_type = v.map(|x| x.into());
6928 self
6929 }
6930
6931 /// Sets the value of [request_id][crate::model::CreateCustomTargetTypeRequest::request_id].
6932 ///
6933 /// # Example
6934 /// ```ignore,no_run
6935 /// # use google_cloud_deploy_v1::model::CreateCustomTargetTypeRequest;
6936 /// let x = CreateCustomTargetTypeRequest::new().set_request_id("example");
6937 /// ```
6938 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6939 self.request_id = v.into();
6940 self
6941 }
6942
6943 /// Sets the value of [validate_only][crate::model::CreateCustomTargetTypeRequest::validate_only].
6944 ///
6945 /// # Example
6946 /// ```ignore,no_run
6947 /// # use google_cloud_deploy_v1::model::CreateCustomTargetTypeRequest;
6948 /// let x = CreateCustomTargetTypeRequest::new().set_validate_only(true);
6949 /// ```
6950 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6951 self.validate_only = v.into();
6952 self
6953 }
6954}
6955
6956impl wkt::message::Message for CreateCustomTargetTypeRequest {
6957 fn typename() -> &'static str {
6958 "type.googleapis.com/google.cloud.deploy.v1.CreateCustomTargetTypeRequest"
6959 }
6960}
6961
6962/// The request object for `UpdateCustomTargetType`.
6963#[derive(Clone, Default, PartialEq)]
6964#[non_exhaustive]
6965pub struct UpdateCustomTargetTypeRequest {
6966 /// Required. Field mask is used to specify the fields to be overwritten by the
6967 /// update in the `CustomTargetType` resource. The fields specified in the
6968 /// update_mask are relative to the resource, not the full request. A field
6969 /// will be overwritten if it's in the mask. If the user doesn't provide a mask
6970 /// then all fields are overwritten.
6971 pub update_mask: std::option::Option<wkt::FieldMask>,
6972
6973 /// Required. The `CustomTargetType` to update.
6974 pub custom_target_type: std::option::Option<crate::model::CustomTargetType>,
6975
6976 /// Optional. A request ID to identify requests. Specify a unique request ID
6977 /// so that if you must retry your request, the server knows to ignore the
6978 /// request if it has already been completed. The server guarantees that for
6979 /// at least 60 minutes after the first request.
6980 ///
6981 /// For example, consider a situation where you make an initial request and the
6982 /// request times out. If you make the request again with the same request ID,
6983 /// the server can check if original operation with the same request ID was
6984 /// received, and if so, will ignore the second request. This prevents clients
6985 /// from accidentally creating duplicate commitments.
6986 ///
6987 /// The request ID must be a valid UUID with the exception that zero UUID is
6988 /// not supported (00000000-0000-0000-0000-000000000000).
6989 pub request_id: std::string::String,
6990
6991 /// Optional. If set to true, updating a `CustomTargetType` that does not exist
6992 /// will result in the creation of a new `CustomTargetType`.
6993 pub allow_missing: bool,
6994
6995 /// Optional. If set to true, the request is validated and the user is provided
6996 /// with an expected result, but no actual change is made.
6997 pub validate_only: bool,
6998
6999 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7000}
7001
7002impl UpdateCustomTargetTypeRequest {
7003 pub fn new() -> Self {
7004 std::default::Default::default()
7005 }
7006
7007 /// Sets the value of [update_mask][crate::model::UpdateCustomTargetTypeRequest::update_mask].
7008 ///
7009 /// # Example
7010 /// ```ignore,no_run
7011 /// # use google_cloud_deploy_v1::model::UpdateCustomTargetTypeRequest;
7012 /// use wkt::FieldMask;
7013 /// let x = UpdateCustomTargetTypeRequest::new().set_update_mask(FieldMask::default()/* use setters */);
7014 /// ```
7015 pub fn set_update_mask<T>(mut self, v: T) -> Self
7016 where
7017 T: std::convert::Into<wkt::FieldMask>,
7018 {
7019 self.update_mask = std::option::Option::Some(v.into());
7020 self
7021 }
7022
7023 /// Sets or clears the value of [update_mask][crate::model::UpdateCustomTargetTypeRequest::update_mask].
7024 ///
7025 /// # Example
7026 /// ```ignore,no_run
7027 /// # use google_cloud_deploy_v1::model::UpdateCustomTargetTypeRequest;
7028 /// use wkt::FieldMask;
7029 /// let x = UpdateCustomTargetTypeRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
7030 /// let x = UpdateCustomTargetTypeRequest::new().set_or_clear_update_mask(None::<FieldMask>);
7031 /// ```
7032 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
7033 where
7034 T: std::convert::Into<wkt::FieldMask>,
7035 {
7036 self.update_mask = v.map(|x| x.into());
7037 self
7038 }
7039
7040 /// Sets the value of [custom_target_type][crate::model::UpdateCustomTargetTypeRequest::custom_target_type].
7041 ///
7042 /// # Example
7043 /// ```ignore,no_run
7044 /// # use google_cloud_deploy_v1::model::UpdateCustomTargetTypeRequest;
7045 /// use google_cloud_deploy_v1::model::CustomTargetType;
7046 /// let x = UpdateCustomTargetTypeRequest::new().set_custom_target_type(CustomTargetType::default()/* use setters */);
7047 /// ```
7048 pub fn set_custom_target_type<T>(mut self, v: T) -> Self
7049 where
7050 T: std::convert::Into<crate::model::CustomTargetType>,
7051 {
7052 self.custom_target_type = std::option::Option::Some(v.into());
7053 self
7054 }
7055
7056 /// Sets or clears the value of [custom_target_type][crate::model::UpdateCustomTargetTypeRequest::custom_target_type].
7057 ///
7058 /// # Example
7059 /// ```ignore,no_run
7060 /// # use google_cloud_deploy_v1::model::UpdateCustomTargetTypeRequest;
7061 /// use google_cloud_deploy_v1::model::CustomTargetType;
7062 /// let x = UpdateCustomTargetTypeRequest::new().set_or_clear_custom_target_type(Some(CustomTargetType::default()/* use setters */));
7063 /// let x = UpdateCustomTargetTypeRequest::new().set_or_clear_custom_target_type(None::<CustomTargetType>);
7064 /// ```
7065 pub fn set_or_clear_custom_target_type<T>(mut self, v: std::option::Option<T>) -> Self
7066 where
7067 T: std::convert::Into<crate::model::CustomTargetType>,
7068 {
7069 self.custom_target_type = v.map(|x| x.into());
7070 self
7071 }
7072
7073 /// Sets the value of [request_id][crate::model::UpdateCustomTargetTypeRequest::request_id].
7074 ///
7075 /// # Example
7076 /// ```ignore,no_run
7077 /// # use google_cloud_deploy_v1::model::UpdateCustomTargetTypeRequest;
7078 /// let x = UpdateCustomTargetTypeRequest::new().set_request_id("example");
7079 /// ```
7080 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7081 self.request_id = v.into();
7082 self
7083 }
7084
7085 /// Sets the value of [allow_missing][crate::model::UpdateCustomTargetTypeRequest::allow_missing].
7086 ///
7087 /// # Example
7088 /// ```ignore,no_run
7089 /// # use google_cloud_deploy_v1::model::UpdateCustomTargetTypeRequest;
7090 /// let x = UpdateCustomTargetTypeRequest::new().set_allow_missing(true);
7091 /// ```
7092 pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7093 self.allow_missing = v.into();
7094 self
7095 }
7096
7097 /// Sets the value of [validate_only][crate::model::UpdateCustomTargetTypeRequest::validate_only].
7098 ///
7099 /// # Example
7100 /// ```ignore,no_run
7101 /// # use google_cloud_deploy_v1::model::UpdateCustomTargetTypeRequest;
7102 /// let x = UpdateCustomTargetTypeRequest::new().set_validate_only(true);
7103 /// ```
7104 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7105 self.validate_only = v.into();
7106 self
7107 }
7108}
7109
7110impl wkt::message::Message for UpdateCustomTargetTypeRequest {
7111 fn typename() -> &'static str {
7112 "type.googleapis.com/google.cloud.deploy.v1.UpdateCustomTargetTypeRequest"
7113 }
7114}
7115
7116/// The request object for `DeleteCustomTargetType`.
7117#[derive(Clone, Default, PartialEq)]
7118#[non_exhaustive]
7119pub struct DeleteCustomTargetTypeRequest {
7120 /// Required. The name of the `CustomTargetType` to delete. Format must be
7121 /// `projects/{project_id}/locations/{location_name}/customTargetTypes/{custom_target_type}`.
7122 pub name: std::string::String,
7123
7124 /// Optional. A request ID to identify requests. Specify a unique request ID
7125 /// so that if you must retry your request, the server knows to ignore the
7126 /// request if it has already been completed. The server guarantees that for
7127 /// at least 60 minutes after the first request.
7128 ///
7129 /// For example, consider a situation where you make an initial request and the
7130 /// request times out. If you make the request again with the same request ID,
7131 /// the server can check if original operation with the same request ID was
7132 /// received, and if so, will ignore the second request. This prevents clients
7133 /// from accidentally creating duplicate commitments.
7134 ///
7135 /// The request ID must be a valid UUID with the exception that zero UUID is
7136 /// not supported (00000000-0000-0000-0000-000000000000).
7137 pub request_id: std::string::String,
7138
7139 /// Optional. If set to true, then deleting an already deleted or non-existing
7140 /// `CustomTargetType` will succeed.
7141 pub allow_missing: bool,
7142
7143 /// Optional. If set to true, the request is validated but no actual change is
7144 /// made.
7145 pub validate_only: bool,
7146
7147 /// Optional. This checksum is computed by the server based on the value of
7148 /// other fields, and may be sent on update and delete requests to ensure the
7149 /// client has an up-to-date value before proceeding.
7150 pub etag: std::string::String,
7151
7152 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7153}
7154
7155impl DeleteCustomTargetTypeRequest {
7156 pub fn new() -> Self {
7157 std::default::Default::default()
7158 }
7159
7160 /// Sets the value of [name][crate::model::DeleteCustomTargetTypeRequest::name].
7161 ///
7162 /// # Example
7163 /// ```ignore,no_run
7164 /// # use google_cloud_deploy_v1::model::DeleteCustomTargetTypeRequest;
7165 /// let x = DeleteCustomTargetTypeRequest::new().set_name("example");
7166 /// ```
7167 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7168 self.name = v.into();
7169 self
7170 }
7171
7172 /// Sets the value of [request_id][crate::model::DeleteCustomTargetTypeRequest::request_id].
7173 ///
7174 /// # Example
7175 /// ```ignore,no_run
7176 /// # use google_cloud_deploy_v1::model::DeleteCustomTargetTypeRequest;
7177 /// let x = DeleteCustomTargetTypeRequest::new().set_request_id("example");
7178 /// ```
7179 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7180 self.request_id = v.into();
7181 self
7182 }
7183
7184 /// Sets the value of [allow_missing][crate::model::DeleteCustomTargetTypeRequest::allow_missing].
7185 ///
7186 /// # Example
7187 /// ```ignore,no_run
7188 /// # use google_cloud_deploy_v1::model::DeleteCustomTargetTypeRequest;
7189 /// let x = DeleteCustomTargetTypeRequest::new().set_allow_missing(true);
7190 /// ```
7191 pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7192 self.allow_missing = v.into();
7193 self
7194 }
7195
7196 /// Sets the value of [validate_only][crate::model::DeleteCustomTargetTypeRequest::validate_only].
7197 ///
7198 /// # Example
7199 /// ```ignore,no_run
7200 /// # use google_cloud_deploy_v1::model::DeleteCustomTargetTypeRequest;
7201 /// let x = DeleteCustomTargetTypeRequest::new().set_validate_only(true);
7202 /// ```
7203 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7204 self.validate_only = v.into();
7205 self
7206 }
7207
7208 /// Sets the value of [etag][crate::model::DeleteCustomTargetTypeRequest::etag].
7209 ///
7210 /// # Example
7211 /// ```ignore,no_run
7212 /// # use google_cloud_deploy_v1::model::DeleteCustomTargetTypeRequest;
7213 /// let x = DeleteCustomTargetTypeRequest::new().set_etag("example");
7214 /// ```
7215 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7216 self.etag = v.into();
7217 self
7218 }
7219}
7220
7221impl wkt::message::Message for DeleteCustomTargetTypeRequest {
7222 fn typename() -> &'static str {
7223 "type.googleapis.com/google.cloud.deploy.v1.DeleteCustomTargetTypeRequest"
7224 }
7225}
7226
7227/// A `DeployPolicy` resource in the Cloud Deploy API.
7228///
7229/// A `DeployPolicy` inhibits manual or automation-driven actions within a
7230/// Delivery Pipeline or Target.
7231#[derive(Clone, Default, PartialEq)]
7232#[non_exhaustive]
7233pub struct DeployPolicy {
7234 /// Output only. Name of the `DeployPolicy`. Format is
7235 /// `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`.
7236 /// The `deployPolicy` component must match `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`
7237 pub name: std::string::String,
7238
7239 /// Output only. Unique identifier of the `DeployPolicy`.
7240 pub uid: std::string::String,
7241
7242 /// Optional. Description of the `DeployPolicy`. Max length is 255 characters.
7243 pub description: std::string::String,
7244
7245 /// Optional. User annotations. These attributes can only be set and used by
7246 /// the user, and not by Cloud Deploy. Annotations must meet the following
7247 /// constraints:
7248 ///
7249 /// * Annotations are key/value pairs.
7250 /// * Valid annotation keys have two segments: an optional prefix and name,
7251 /// separated by a slash (`/`).
7252 /// * The name segment is required and must be 63 characters or less,
7253 /// beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with
7254 /// dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between.
7255 /// * The prefix is optional. If specified, the prefix must be a DNS subdomain:
7256 /// a series of DNS labels separated by dots(`.`), not longer than 253
7257 /// characters in total, followed by a slash (`/`).
7258 ///
7259 /// See
7260 /// <https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/#syntax-and-character-set>
7261 /// for more details.
7262 pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
7263
7264 /// Labels are attributes that can be set and used by both the
7265 /// user and by Cloud Deploy. Labels must meet the following constraints:
7266 ///
7267 /// * Keys and values can contain only lowercase letters, numeric characters,
7268 /// underscores, and dashes.
7269 /// * All characters must use UTF-8 encoding, and international characters are
7270 /// allowed.
7271 /// * Keys must start with a lowercase letter or international character.
7272 /// * Each resource is limited to a maximum of 64 labels.
7273 ///
7274 /// Both keys and values are additionally constrained to be <= 128 bytes.
7275 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
7276
7277 /// Output only. Time at which the deploy policy was created.
7278 pub create_time: std::option::Option<wkt::Timestamp>,
7279
7280 /// Output only. Most recent time at which the deploy policy was updated.
7281 pub update_time: std::option::Option<wkt::Timestamp>,
7282
7283 /// Optional. When suspended, the policy will not prevent actions from
7284 /// occurring, even if the action violates the policy.
7285 pub suspended: bool,
7286
7287 /// Required. Selected resources to which the policy will be applied. At least
7288 /// one selector is required. If one selector matches the resource the policy
7289 /// applies. For example, if there are two selectors and the action being
7290 /// attempted matches one of them, the policy will apply to that action.
7291 pub selectors: std::vec::Vec<crate::model::DeployPolicyResourceSelector>,
7292
7293 /// Required. Rules to apply. At least one rule must be present.
7294 pub rules: std::vec::Vec<crate::model::PolicyRule>,
7295
7296 /// The weak etag of the `DeployPolicy` resource.
7297 /// This checksum is computed by the server based on the value of other
7298 /// fields, and may be sent on update and delete requests to ensure the
7299 /// client has an up-to-date value before proceeding.
7300 pub etag: std::string::String,
7301
7302 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7303}
7304
7305impl DeployPolicy {
7306 pub fn new() -> Self {
7307 std::default::Default::default()
7308 }
7309
7310 /// Sets the value of [name][crate::model::DeployPolicy::name].
7311 ///
7312 /// # Example
7313 /// ```ignore,no_run
7314 /// # use google_cloud_deploy_v1::model::DeployPolicy;
7315 /// let x = DeployPolicy::new().set_name("example");
7316 /// ```
7317 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7318 self.name = v.into();
7319 self
7320 }
7321
7322 /// Sets the value of [uid][crate::model::DeployPolicy::uid].
7323 ///
7324 /// # Example
7325 /// ```ignore,no_run
7326 /// # use google_cloud_deploy_v1::model::DeployPolicy;
7327 /// let x = DeployPolicy::new().set_uid("example");
7328 /// ```
7329 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7330 self.uid = v.into();
7331 self
7332 }
7333
7334 /// Sets the value of [description][crate::model::DeployPolicy::description].
7335 ///
7336 /// # Example
7337 /// ```ignore,no_run
7338 /// # use google_cloud_deploy_v1::model::DeployPolicy;
7339 /// let x = DeployPolicy::new().set_description("example");
7340 /// ```
7341 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7342 self.description = v.into();
7343 self
7344 }
7345
7346 /// Sets the value of [annotations][crate::model::DeployPolicy::annotations].
7347 ///
7348 /// # Example
7349 /// ```ignore,no_run
7350 /// # use google_cloud_deploy_v1::model::DeployPolicy;
7351 /// let x = DeployPolicy::new().set_annotations([
7352 /// ("key0", "abc"),
7353 /// ("key1", "xyz"),
7354 /// ]);
7355 /// ```
7356 pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
7357 where
7358 T: std::iter::IntoIterator<Item = (K, V)>,
7359 K: std::convert::Into<std::string::String>,
7360 V: std::convert::Into<std::string::String>,
7361 {
7362 use std::iter::Iterator;
7363 self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7364 self
7365 }
7366
7367 /// Sets the value of [labels][crate::model::DeployPolicy::labels].
7368 ///
7369 /// # Example
7370 /// ```ignore,no_run
7371 /// # use google_cloud_deploy_v1::model::DeployPolicy;
7372 /// let x = DeployPolicy::new().set_labels([
7373 /// ("key0", "abc"),
7374 /// ("key1", "xyz"),
7375 /// ]);
7376 /// ```
7377 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
7378 where
7379 T: std::iter::IntoIterator<Item = (K, V)>,
7380 K: std::convert::Into<std::string::String>,
7381 V: std::convert::Into<std::string::String>,
7382 {
7383 use std::iter::Iterator;
7384 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7385 self
7386 }
7387
7388 /// Sets the value of [create_time][crate::model::DeployPolicy::create_time].
7389 ///
7390 /// # Example
7391 /// ```ignore,no_run
7392 /// # use google_cloud_deploy_v1::model::DeployPolicy;
7393 /// use wkt::Timestamp;
7394 /// let x = DeployPolicy::new().set_create_time(Timestamp::default()/* use setters */);
7395 /// ```
7396 pub fn set_create_time<T>(mut self, v: T) -> Self
7397 where
7398 T: std::convert::Into<wkt::Timestamp>,
7399 {
7400 self.create_time = std::option::Option::Some(v.into());
7401 self
7402 }
7403
7404 /// Sets or clears the value of [create_time][crate::model::DeployPolicy::create_time].
7405 ///
7406 /// # Example
7407 /// ```ignore,no_run
7408 /// # use google_cloud_deploy_v1::model::DeployPolicy;
7409 /// use wkt::Timestamp;
7410 /// let x = DeployPolicy::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
7411 /// let x = DeployPolicy::new().set_or_clear_create_time(None::<Timestamp>);
7412 /// ```
7413 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
7414 where
7415 T: std::convert::Into<wkt::Timestamp>,
7416 {
7417 self.create_time = v.map(|x| x.into());
7418 self
7419 }
7420
7421 /// Sets the value of [update_time][crate::model::DeployPolicy::update_time].
7422 ///
7423 /// # Example
7424 /// ```ignore,no_run
7425 /// # use google_cloud_deploy_v1::model::DeployPolicy;
7426 /// use wkt::Timestamp;
7427 /// let x = DeployPolicy::new().set_update_time(Timestamp::default()/* use setters */);
7428 /// ```
7429 pub fn set_update_time<T>(mut self, v: T) -> Self
7430 where
7431 T: std::convert::Into<wkt::Timestamp>,
7432 {
7433 self.update_time = std::option::Option::Some(v.into());
7434 self
7435 }
7436
7437 /// Sets or clears the value of [update_time][crate::model::DeployPolicy::update_time].
7438 ///
7439 /// # Example
7440 /// ```ignore,no_run
7441 /// # use google_cloud_deploy_v1::model::DeployPolicy;
7442 /// use wkt::Timestamp;
7443 /// let x = DeployPolicy::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
7444 /// let x = DeployPolicy::new().set_or_clear_update_time(None::<Timestamp>);
7445 /// ```
7446 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
7447 where
7448 T: std::convert::Into<wkt::Timestamp>,
7449 {
7450 self.update_time = v.map(|x| x.into());
7451 self
7452 }
7453
7454 /// Sets the value of [suspended][crate::model::DeployPolicy::suspended].
7455 ///
7456 /// # Example
7457 /// ```ignore,no_run
7458 /// # use google_cloud_deploy_v1::model::DeployPolicy;
7459 /// let x = DeployPolicy::new().set_suspended(true);
7460 /// ```
7461 pub fn set_suspended<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7462 self.suspended = v.into();
7463 self
7464 }
7465
7466 /// Sets the value of [selectors][crate::model::DeployPolicy::selectors].
7467 ///
7468 /// # Example
7469 /// ```ignore,no_run
7470 /// # use google_cloud_deploy_v1::model::DeployPolicy;
7471 /// use google_cloud_deploy_v1::model::DeployPolicyResourceSelector;
7472 /// let x = DeployPolicy::new()
7473 /// .set_selectors([
7474 /// DeployPolicyResourceSelector::default()/* use setters */,
7475 /// DeployPolicyResourceSelector::default()/* use (different) setters */,
7476 /// ]);
7477 /// ```
7478 pub fn set_selectors<T, V>(mut self, v: T) -> Self
7479 where
7480 T: std::iter::IntoIterator<Item = V>,
7481 V: std::convert::Into<crate::model::DeployPolicyResourceSelector>,
7482 {
7483 use std::iter::Iterator;
7484 self.selectors = v.into_iter().map(|i| i.into()).collect();
7485 self
7486 }
7487
7488 /// Sets the value of [rules][crate::model::DeployPolicy::rules].
7489 ///
7490 /// # Example
7491 /// ```ignore,no_run
7492 /// # use google_cloud_deploy_v1::model::DeployPolicy;
7493 /// use google_cloud_deploy_v1::model::PolicyRule;
7494 /// let x = DeployPolicy::new()
7495 /// .set_rules([
7496 /// PolicyRule::default()/* use setters */,
7497 /// PolicyRule::default()/* use (different) setters */,
7498 /// ]);
7499 /// ```
7500 pub fn set_rules<T, V>(mut self, v: T) -> Self
7501 where
7502 T: std::iter::IntoIterator<Item = V>,
7503 V: std::convert::Into<crate::model::PolicyRule>,
7504 {
7505 use std::iter::Iterator;
7506 self.rules = v.into_iter().map(|i| i.into()).collect();
7507 self
7508 }
7509
7510 /// Sets the value of [etag][crate::model::DeployPolicy::etag].
7511 ///
7512 /// # Example
7513 /// ```ignore,no_run
7514 /// # use google_cloud_deploy_v1::model::DeployPolicy;
7515 /// let x = DeployPolicy::new().set_etag("example");
7516 /// ```
7517 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7518 self.etag = v.into();
7519 self
7520 }
7521}
7522
7523impl wkt::message::Message for DeployPolicy {
7524 fn typename() -> &'static str {
7525 "type.googleapis.com/google.cloud.deploy.v1.DeployPolicy"
7526 }
7527}
7528
7529/// Defines additional types related to [DeployPolicy].
7530pub mod deploy_policy {
7531 #[allow(unused_imports)]
7532 use super::*;
7533
7534 /// What invoked the action. Filters enforcing the policy depending on what
7535 /// invoked the action.
7536 ///
7537 /// # Working with unknown values
7538 ///
7539 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7540 /// additional enum variants at any time. Adding new variants is not considered
7541 /// a breaking change. Applications should write their code in anticipation of:
7542 ///
7543 /// - New values appearing in future releases of the client library, **and**
7544 /// - New values received dynamically, without application changes.
7545 ///
7546 /// Please consult the [Working with enums] section in the user guide for some
7547 /// guidelines.
7548 ///
7549 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
7550 #[derive(Clone, Debug, PartialEq)]
7551 #[non_exhaustive]
7552 pub enum Invoker {
7553 /// Unspecified.
7554 Unspecified,
7555 /// The action is user-driven. For example, creating a rollout manually via a
7556 /// gcloud create command.
7557 User,
7558 /// Automated action by Cloud Deploy.
7559 DeployAutomation,
7560 /// If set, the enum was initialized with an unknown value.
7561 ///
7562 /// Applications can examine the value using [Invoker::value] or
7563 /// [Invoker::name].
7564 UnknownValue(invoker::UnknownValue),
7565 }
7566
7567 #[doc(hidden)]
7568 pub mod invoker {
7569 #[allow(unused_imports)]
7570 use super::*;
7571 #[derive(Clone, Debug, PartialEq)]
7572 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7573 }
7574
7575 impl Invoker {
7576 /// Gets the enum value.
7577 ///
7578 /// Returns `None` if the enum contains an unknown value deserialized from
7579 /// the string representation of enums.
7580 pub fn value(&self) -> std::option::Option<i32> {
7581 match self {
7582 Self::Unspecified => std::option::Option::Some(0),
7583 Self::User => std::option::Option::Some(1),
7584 Self::DeployAutomation => std::option::Option::Some(2),
7585 Self::UnknownValue(u) => u.0.value(),
7586 }
7587 }
7588
7589 /// Gets the enum value as a string.
7590 ///
7591 /// Returns `None` if the enum contains an unknown value deserialized from
7592 /// the integer representation of enums.
7593 pub fn name(&self) -> std::option::Option<&str> {
7594 match self {
7595 Self::Unspecified => std::option::Option::Some("INVOKER_UNSPECIFIED"),
7596 Self::User => std::option::Option::Some("USER"),
7597 Self::DeployAutomation => std::option::Option::Some("DEPLOY_AUTOMATION"),
7598 Self::UnknownValue(u) => u.0.name(),
7599 }
7600 }
7601 }
7602
7603 impl std::default::Default for Invoker {
7604 fn default() -> Self {
7605 use std::convert::From;
7606 Self::from(0)
7607 }
7608 }
7609
7610 impl std::fmt::Display for Invoker {
7611 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7612 wkt::internal::display_enum(f, self.name(), self.value())
7613 }
7614 }
7615
7616 impl std::convert::From<i32> for Invoker {
7617 fn from(value: i32) -> Self {
7618 match value {
7619 0 => Self::Unspecified,
7620 1 => Self::User,
7621 2 => Self::DeployAutomation,
7622 _ => Self::UnknownValue(invoker::UnknownValue(
7623 wkt::internal::UnknownEnumValue::Integer(value),
7624 )),
7625 }
7626 }
7627 }
7628
7629 impl std::convert::From<&str> for Invoker {
7630 fn from(value: &str) -> Self {
7631 use std::string::ToString;
7632 match value {
7633 "INVOKER_UNSPECIFIED" => Self::Unspecified,
7634 "USER" => Self::User,
7635 "DEPLOY_AUTOMATION" => Self::DeployAutomation,
7636 _ => Self::UnknownValue(invoker::UnknownValue(
7637 wkt::internal::UnknownEnumValue::String(value.to_string()),
7638 )),
7639 }
7640 }
7641 }
7642
7643 impl serde::ser::Serialize for Invoker {
7644 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7645 where
7646 S: serde::Serializer,
7647 {
7648 match self {
7649 Self::Unspecified => serializer.serialize_i32(0),
7650 Self::User => serializer.serialize_i32(1),
7651 Self::DeployAutomation => serializer.serialize_i32(2),
7652 Self::UnknownValue(u) => u.0.serialize(serializer),
7653 }
7654 }
7655 }
7656
7657 impl<'de> serde::de::Deserialize<'de> for Invoker {
7658 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7659 where
7660 D: serde::Deserializer<'de>,
7661 {
7662 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Invoker>::new(
7663 ".google.cloud.deploy.v1.DeployPolicy.Invoker",
7664 ))
7665 }
7666 }
7667}
7668
7669/// Contains information on the resources to select for a deploy policy.
7670/// Attributes provided must all match the resource in order for policy
7671/// restrictions to apply. For example, if delivery pipelines attributes given
7672/// are an id "prod" and labels "foo: bar", a delivery pipeline resource must
7673/// match both that id and have that label in order to be subject to the policy.
7674#[derive(Clone, Default, PartialEq)]
7675#[non_exhaustive]
7676pub struct DeployPolicyResourceSelector {
7677 /// Optional. Contains attributes about a delivery pipeline.
7678 pub delivery_pipeline: std::option::Option<crate::model::DeliveryPipelineAttribute>,
7679
7680 /// Optional. Contains attributes about a target.
7681 pub target: std::option::Option<crate::model::TargetAttribute>,
7682
7683 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7684}
7685
7686impl DeployPolicyResourceSelector {
7687 pub fn new() -> Self {
7688 std::default::Default::default()
7689 }
7690
7691 /// Sets the value of [delivery_pipeline][crate::model::DeployPolicyResourceSelector::delivery_pipeline].
7692 ///
7693 /// # Example
7694 /// ```ignore,no_run
7695 /// # use google_cloud_deploy_v1::model::DeployPolicyResourceSelector;
7696 /// use google_cloud_deploy_v1::model::DeliveryPipelineAttribute;
7697 /// let x = DeployPolicyResourceSelector::new().set_delivery_pipeline(DeliveryPipelineAttribute::default()/* use setters */);
7698 /// ```
7699 pub fn set_delivery_pipeline<T>(mut self, v: T) -> Self
7700 where
7701 T: std::convert::Into<crate::model::DeliveryPipelineAttribute>,
7702 {
7703 self.delivery_pipeline = std::option::Option::Some(v.into());
7704 self
7705 }
7706
7707 /// Sets or clears the value of [delivery_pipeline][crate::model::DeployPolicyResourceSelector::delivery_pipeline].
7708 ///
7709 /// # Example
7710 /// ```ignore,no_run
7711 /// # use google_cloud_deploy_v1::model::DeployPolicyResourceSelector;
7712 /// use google_cloud_deploy_v1::model::DeliveryPipelineAttribute;
7713 /// let x = DeployPolicyResourceSelector::new().set_or_clear_delivery_pipeline(Some(DeliveryPipelineAttribute::default()/* use setters */));
7714 /// let x = DeployPolicyResourceSelector::new().set_or_clear_delivery_pipeline(None::<DeliveryPipelineAttribute>);
7715 /// ```
7716 pub fn set_or_clear_delivery_pipeline<T>(mut self, v: std::option::Option<T>) -> Self
7717 where
7718 T: std::convert::Into<crate::model::DeliveryPipelineAttribute>,
7719 {
7720 self.delivery_pipeline = v.map(|x| x.into());
7721 self
7722 }
7723
7724 /// Sets the value of [target][crate::model::DeployPolicyResourceSelector::target].
7725 ///
7726 /// # Example
7727 /// ```ignore,no_run
7728 /// # use google_cloud_deploy_v1::model::DeployPolicyResourceSelector;
7729 /// use google_cloud_deploy_v1::model::TargetAttribute;
7730 /// let x = DeployPolicyResourceSelector::new().set_target(TargetAttribute::default()/* use setters */);
7731 /// ```
7732 pub fn set_target<T>(mut self, v: T) -> Self
7733 where
7734 T: std::convert::Into<crate::model::TargetAttribute>,
7735 {
7736 self.target = std::option::Option::Some(v.into());
7737 self
7738 }
7739
7740 /// Sets or clears the value of [target][crate::model::DeployPolicyResourceSelector::target].
7741 ///
7742 /// # Example
7743 /// ```ignore,no_run
7744 /// # use google_cloud_deploy_v1::model::DeployPolicyResourceSelector;
7745 /// use google_cloud_deploy_v1::model::TargetAttribute;
7746 /// let x = DeployPolicyResourceSelector::new().set_or_clear_target(Some(TargetAttribute::default()/* use setters */));
7747 /// let x = DeployPolicyResourceSelector::new().set_or_clear_target(None::<TargetAttribute>);
7748 /// ```
7749 pub fn set_or_clear_target<T>(mut self, v: std::option::Option<T>) -> Self
7750 where
7751 T: std::convert::Into<crate::model::TargetAttribute>,
7752 {
7753 self.target = v.map(|x| x.into());
7754 self
7755 }
7756}
7757
7758impl wkt::message::Message for DeployPolicyResourceSelector {
7759 fn typename() -> &'static str {
7760 "type.googleapis.com/google.cloud.deploy.v1.DeployPolicyResourceSelector"
7761 }
7762}
7763
7764/// Contains criteria for selecting DeliveryPipelines.
7765#[derive(Clone, Default, PartialEq)]
7766#[non_exhaustive]
7767pub struct DeliveryPipelineAttribute {
7768 /// Optional. ID of the `DeliveryPipeline`. The value of this field could be
7769 /// one of the following:
7770 ///
7771 /// * The last segment of a pipeline name
7772 /// * "*", all delivery pipelines in a location
7773 pub id: std::string::String,
7774
7775 /// DeliveryPipeline labels.
7776 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
7777
7778 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7779}
7780
7781impl DeliveryPipelineAttribute {
7782 pub fn new() -> Self {
7783 std::default::Default::default()
7784 }
7785
7786 /// Sets the value of [id][crate::model::DeliveryPipelineAttribute::id].
7787 ///
7788 /// # Example
7789 /// ```ignore,no_run
7790 /// # use google_cloud_deploy_v1::model::DeliveryPipelineAttribute;
7791 /// let x = DeliveryPipelineAttribute::new().set_id("example");
7792 /// ```
7793 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7794 self.id = v.into();
7795 self
7796 }
7797
7798 /// Sets the value of [labels][crate::model::DeliveryPipelineAttribute::labels].
7799 ///
7800 /// # Example
7801 /// ```ignore,no_run
7802 /// # use google_cloud_deploy_v1::model::DeliveryPipelineAttribute;
7803 /// let x = DeliveryPipelineAttribute::new().set_labels([
7804 /// ("key0", "abc"),
7805 /// ("key1", "xyz"),
7806 /// ]);
7807 /// ```
7808 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
7809 where
7810 T: std::iter::IntoIterator<Item = (K, V)>,
7811 K: std::convert::Into<std::string::String>,
7812 V: std::convert::Into<std::string::String>,
7813 {
7814 use std::iter::Iterator;
7815 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7816 self
7817 }
7818}
7819
7820impl wkt::message::Message for DeliveryPipelineAttribute {
7821 fn typename() -> &'static str {
7822 "type.googleapis.com/google.cloud.deploy.v1.DeliveryPipelineAttribute"
7823 }
7824}
7825
7826/// Contains criteria for selecting Targets. This could be used to select targets
7827/// for a Deploy Policy or for an Automation.
7828#[derive(Clone, Default, PartialEq)]
7829#[non_exhaustive]
7830pub struct TargetAttribute {
7831 /// Optional. ID of the `Target`. The value of this field could be one of the
7832 /// following:
7833 ///
7834 /// * The last segment of a target name
7835 /// * "*", all targets in a location
7836 pub id: std::string::String,
7837
7838 /// Target labels.
7839 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
7840
7841 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7842}
7843
7844impl TargetAttribute {
7845 pub fn new() -> Self {
7846 std::default::Default::default()
7847 }
7848
7849 /// Sets the value of [id][crate::model::TargetAttribute::id].
7850 ///
7851 /// # Example
7852 /// ```ignore,no_run
7853 /// # use google_cloud_deploy_v1::model::TargetAttribute;
7854 /// let x = TargetAttribute::new().set_id("example");
7855 /// ```
7856 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7857 self.id = v.into();
7858 self
7859 }
7860
7861 /// Sets the value of [labels][crate::model::TargetAttribute::labels].
7862 ///
7863 /// # Example
7864 /// ```ignore,no_run
7865 /// # use google_cloud_deploy_v1::model::TargetAttribute;
7866 /// let x = TargetAttribute::new().set_labels([
7867 /// ("key0", "abc"),
7868 /// ("key1", "xyz"),
7869 /// ]);
7870 /// ```
7871 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
7872 where
7873 T: std::iter::IntoIterator<Item = (K, V)>,
7874 K: std::convert::Into<std::string::String>,
7875 V: std::convert::Into<std::string::String>,
7876 {
7877 use std::iter::Iterator;
7878 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7879 self
7880 }
7881}
7882
7883impl wkt::message::Message for TargetAttribute {
7884 fn typename() -> &'static str {
7885 "type.googleapis.com/google.cloud.deploy.v1.TargetAttribute"
7886 }
7887}
7888
7889/// Deploy Policy rule.
7890#[derive(Clone, Default, PartialEq)]
7891#[non_exhaustive]
7892pub struct PolicyRule {
7893 pub rule: std::option::Option<crate::model::policy_rule::Rule>,
7894
7895 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7896}
7897
7898impl PolicyRule {
7899 pub fn new() -> Self {
7900 std::default::Default::default()
7901 }
7902
7903 /// Sets the value of [rule][crate::model::PolicyRule::rule].
7904 ///
7905 /// Note that all the setters affecting `rule` are mutually
7906 /// exclusive.
7907 ///
7908 /// # Example
7909 /// ```ignore,no_run
7910 /// # use google_cloud_deploy_v1::model::PolicyRule;
7911 /// use google_cloud_deploy_v1::model::RolloutRestriction;
7912 /// let x = PolicyRule::new().set_rule(Some(
7913 /// google_cloud_deploy_v1::model::policy_rule::Rule::RolloutRestriction(RolloutRestriction::default().into())));
7914 /// ```
7915 pub fn set_rule<T: std::convert::Into<std::option::Option<crate::model::policy_rule::Rule>>>(
7916 mut self,
7917 v: T,
7918 ) -> Self {
7919 self.rule = v.into();
7920 self
7921 }
7922
7923 /// The value of [rule][crate::model::PolicyRule::rule]
7924 /// if it holds a `RolloutRestriction`, `None` if the field is not set or
7925 /// holds a different branch.
7926 pub fn rollout_restriction(
7927 &self,
7928 ) -> std::option::Option<&std::boxed::Box<crate::model::RolloutRestriction>> {
7929 #[allow(unreachable_patterns)]
7930 self.rule.as_ref().and_then(|v| match v {
7931 crate::model::policy_rule::Rule::RolloutRestriction(v) => std::option::Option::Some(v),
7932 _ => std::option::Option::None,
7933 })
7934 }
7935
7936 /// Sets the value of [rule][crate::model::PolicyRule::rule]
7937 /// to hold a `RolloutRestriction`.
7938 ///
7939 /// Note that all the setters affecting `rule` are
7940 /// mutually exclusive.
7941 ///
7942 /// # Example
7943 /// ```ignore,no_run
7944 /// # use google_cloud_deploy_v1::model::PolicyRule;
7945 /// use google_cloud_deploy_v1::model::RolloutRestriction;
7946 /// let x = PolicyRule::new().set_rollout_restriction(RolloutRestriction::default()/* use setters */);
7947 /// assert!(x.rollout_restriction().is_some());
7948 /// ```
7949 pub fn set_rollout_restriction<
7950 T: std::convert::Into<std::boxed::Box<crate::model::RolloutRestriction>>,
7951 >(
7952 mut self,
7953 v: T,
7954 ) -> Self {
7955 self.rule = std::option::Option::Some(crate::model::policy_rule::Rule::RolloutRestriction(
7956 v.into(),
7957 ));
7958 self
7959 }
7960}
7961
7962impl wkt::message::Message for PolicyRule {
7963 fn typename() -> &'static str {
7964 "type.googleapis.com/google.cloud.deploy.v1.PolicyRule"
7965 }
7966}
7967
7968/// Defines additional types related to [PolicyRule].
7969pub mod policy_rule {
7970 #[allow(unused_imports)]
7971 use super::*;
7972
7973 #[derive(Clone, Debug, PartialEq)]
7974 #[non_exhaustive]
7975 pub enum Rule {
7976 /// Optional. Rollout restrictions.
7977 RolloutRestriction(std::boxed::Box<crate::model::RolloutRestriction>),
7978 }
7979}
7980
7981/// Rollout restrictions.
7982#[derive(Clone, Default, PartialEq)]
7983#[non_exhaustive]
7984pub struct RolloutRestriction {
7985 /// Required. Restriction rule ID. Required and must be unique within a
7986 /// DeployPolicy. The format is `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`.
7987 pub id: std::string::String,
7988
7989 /// Optional. What invoked the action. If left empty, all invoker types will be
7990 /// restricted.
7991 pub invokers: std::vec::Vec<crate::model::deploy_policy::Invoker>,
7992
7993 /// Optional. Rollout actions to be restricted as part of the policy. If left
7994 /// empty, all actions will be restricted.
7995 pub actions: std::vec::Vec<crate::model::rollout_restriction::RolloutActions>,
7996
7997 /// Required. Time window within which actions are restricted.
7998 pub time_windows: std::option::Option<crate::model::TimeWindows>,
7999
8000 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8001}
8002
8003impl RolloutRestriction {
8004 pub fn new() -> Self {
8005 std::default::Default::default()
8006 }
8007
8008 /// Sets the value of [id][crate::model::RolloutRestriction::id].
8009 ///
8010 /// # Example
8011 /// ```ignore,no_run
8012 /// # use google_cloud_deploy_v1::model::RolloutRestriction;
8013 /// let x = RolloutRestriction::new().set_id("example");
8014 /// ```
8015 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8016 self.id = v.into();
8017 self
8018 }
8019
8020 /// Sets the value of [invokers][crate::model::RolloutRestriction::invokers].
8021 ///
8022 /// # Example
8023 /// ```ignore,no_run
8024 /// # use google_cloud_deploy_v1::model::RolloutRestriction;
8025 /// use google_cloud_deploy_v1::model::deploy_policy::Invoker;
8026 /// let x = RolloutRestriction::new().set_invokers([
8027 /// Invoker::User,
8028 /// Invoker::DeployAutomation,
8029 /// ]);
8030 /// ```
8031 pub fn set_invokers<T, V>(mut self, v: T) -> Self
8032 where
8033 T: std::iter::IntoIterator<Item = V>,
8034 V: std::convert::Into<crate::model::deploy_policy::Invoker>,
8035 {
8036 use std::iter::Iterator;
8037 self.invokers = v.into_iter().map(|i| i.into()).collect();
8038 self
8039 }
8040
8041 /// Sets the value of [actions][crate::model::RolloutRestriction::actions].
8042 ///
8043 /// # Example
8044 /// ```ignore,no_run
8045 /// # use google_cloud_deploy_v1::model::RolloutRestriction;
8046 /// use google_cloud_deploy_v1::model::rollout_restriction::RolloutActions;
8047 /// let x = RolloutRestriction::new().set_actions([
8048 /// RolloutActions::Advance,
8049 /// RolloutActions::Approve,
8050 /// RolloutActions::Cancel,
8051 /// ]);
8052 /// ```
8053 pub fn set_actions<T, V>(mut self, v: T) -> Self
8054 where
8055 T: std::iter::IntoIterator<Item = V>,
8056 V: std::convert::Into<crate::model::rollout_restriction::RolloutActions>,
8057 {
8058 use std::iter::Iterator;
8059 self.actions = v.into_iter().map(|i| i.into()).collect();
8060 self
8061 }
8062
8063 /// Sets the value of [time_windows][crate::model::RolloutRestriction::time_windows].
8064 ///
8065 /// # Example
8066 /// ```ignore,no_run
8067 /// # use google_cloud_deploy_v1::model::RolloutRestriction;
8068 /// use google_cloud_deploy_v1::model::TimeWindows;
8069 /// let x = RolloutRestriction::new().set_time_windows(TimeWindows::default()/* use setters */);
8070 /// ```
8071 pub fn set_time_windows<T>(mut self, v: T) -> Self
8072 where
8073 T: std::convert::Into<crate::model::TimeWindows>,
8074 {
8075 self.time_windows = std::option::Option::Some(v.into());
8076 self
8077 }
8078
8079 /// Sets or clears the value of [time_windows][crate::model::RolloutRestriction::time_windows].
8080 ///
8081 /// # Example
8082 /// ```ignore,no_run
8083 /// # use google_cloud_deploy_v1::model::RolloutRestriction;
8084 /// use google_cloud_deploy_v1::model::TimeWindows;
8085 /// let x = RolloutRestriction::new().set_or_clear_time_windows(Some(TimeWindows::default()/* use setters */));
8086 /// let x = RolloutRestriction::new().set_or_clear_time_windows(None::<TimeWindows>);
8087 /// ```
8088 pub fn set_or_clear_time_windows<T>(mut self, v: std::option::Option<T>) -> Self
8089 where
8090 T: std::convert::Into<crate::model::TimeWindows>,
8091 {
8092 self.time_windows = v.map(|x| x.into());
8093 self
8094 }
8095}
8096
8097impl wkt::message::Message for RolloutRestriction {
8098 fn typename() -> &'static str {
8099 "type.googleapis.com/google.cloud.deploy.v1.RolloutRestriction"
8100 }
8101}
8102
8103/// Defines additional types related to [RolloutRestriction].
8104pub mod rollout_restriction {
8105 #[allow(unused_imports)]
8106 use super::*;
8107
8108 /// Rollout actions to be restricted as part of the policy.
8109 ///
8110 /// # Working with unknown values
8111 ///
8112 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8113 /// additional enum variants at any time. Adding new variants is not considered
8114 /// a breaking change. Applications should write their code in anticipation of:
8115 ///
8116 /// - New values appearing in future releases of the client library, **and**
8117 /// - New values received dynamically, without application changes.
8118 ///
8119 /// Please consult the [Working with enums] section in the user guide for some
8120 /// guidelines.
8121 ///
8122 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
8123 #[derive(Clone, Debug, PartialEq)]
8124 #[non_exhaustive]
8125 pub enum RolloutActions {
8126 /// Unspecified.
8127 Unspecified,
8128 /// Advance the rollout to the next phase.
8129 Advance,
8130 /// Approve the rollout.
8131 Approve,
8132 /// Cancel the rollout.
8133 Cancel,
8134 /// Create a rollout.
8135 Create,
8136 /// Ignore a job result on the rollout.
8137 IgnoreJob,
8138 /// Retry a job for a rollout.
8139 RetryJob,
8140 /// Rollback a rollout.
8141 Rollback,
8142 /// Terminate a jobrun.
8143 TerminateJobrun,
8144 /// If set, the enum was initialized with an unknown value.
8145 ///
8146 /// Applications can examine the value using [RolloutActions::value] or
8147 /// [RolloutActions::name].
8148 UnknownValue(rollout_actions::UnknownValue),
8149 }
8150
8151 #[doc(hidden)]
8152 pub mod rollout_actions {
8153 #[allow(unused_imports)]
8154 use super::*;
8155 #[derive(Clone, Debug, PartialEq)]
8156 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8157 }
8158
8159 impl RolloutActions {
8160 /// Gets the enum value.
8161 ///
8162 /// Returns `None` if the enum contains an unknown value deserialized from
8163 /// the string representation of enums.
8164 pub fn value(&self) -> std::option::Option<i32> {
8165 match self {
8166 Self::Unspecified => std::option::Option::Some(0),
8167 Self::Advance => std::option::Option::Some(1),
8168 Self::Approve => std::option::Option::Some(2),
8169 Self::Cancel => std::option::Option::Some(3),
8170 Self::Create => std::option::Option::Some(4),
8171 Self::IgnoreJob => std::option::Option::Some(5),
8172 Self::RetryJob => std::option::Option::Some(6),
8173 Self::Rollback => std::option::Option::Some(7),
8174 Self::TerminateJobrun => std::option::Option::Some(8),
8175 Self::UnknownValue(u) => u.0.value(),
8176 }
8177 }
8178
8179 /// Gets the enum value as a string.
8180 ///
8181 /// Returns `None` if the enum contains an unknown value deserialized from
8182 /// the integer representation of enums.
8183 pub fn name(&self) -> std::option::Option<&str> {
8184 match self {
8185 Self::Unspecified => std::option::Option::Some("ROLLOUT_ACTIONS_UNSPECIFIED"),
8186 Self::Advance => std::option::Option::Some("ADVANCE"),
8187 Self::Approve => std::option::Option::Some("APPROVE"),
8188 Self::Cancel => std::option::Option::Some("CANCEL"),
8189 Self::Create => std::option::Option::Some("CREATE"),
8190 Self::IgnoreJob => std::option::Option::Some("IGNORE_JOB"),
8191 Self::RetryJob => std::option::Option::Some("RETRY_JOB"),
8192 Self::Rollback => std::option::Option::Some("ROLLBACK"),
8193 Self::TerminateJobrun => std::option::Option::Some("TERMINATE_JOBRUN"),
8194 Self::UnknownValue(u) => u.0.name(),
8195 }
8196 }
8197 }
8198
8199 impl std::default::Default for RolloutActions {
8200 fn default() -> Self {
8201 use std::convert::From;
8202 Self::from(0)
8203 }
8204 }
8205
8206 impl std::fmt::Display for RolloutActions {
8207 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8208 wkt::internal::display_enum(f, self.name(), self.value())
8209 }
8210 }
8211
8212 impl std::convert::From<i32> for RolloutActions {
8213 fn from(value: i32) -> Self {
8214 match value {
8215 0 => Self::Unspecified,
8216 1 => Self::Advance,
8217 2 => Self::Approve,
8218 3 => Self::Cancel,
8219 4 => Self::Create,
8220 5 => Self::IgnoreJob,
8221 6 => Self::RetryJob,
8222 7 => Self::Rollback,
8223 8 => Self::TerminateJobrun,
8224 _ => Self::UnknownValue(rollout_actions::UnknownValue(
8225 wkt::internal::UnknownEnumValue::Integer(value),
8226 )),
8227 }
8228 }
8229 }
8230
8231 impl std::convert::From<&str> for RolloutActions {
8232 fn from(value: &str) -> Self {
8233 use std::string::ToString;
8234 match value {
8235 "ROLLOUT_ACTIONS_UNSPECIFIED" => Self::Unspecified,
8236 "ADVANCE" => Self::Advance,
8237 "APPROVE" => Self::Approve,
8238 "CANCEL" => Self::Cancel,
8239 "CREATE" => Self::Create,
8240 "IGNORE_JOB" => Self::IgnoreJob,
8241 "RETRY_JOB" => Self::RetryJob,
8242 "ROLLBACK" => Self::Rollback,
8243 "TERMINATE_JOBRUN" => Self::TerminateJobrun,
8244 _ => Self::UnknownValue(rollout_actions::UnknownValue(
8245 wkt::internal::UnknownEnumValue::String(value.to_string()),
8246 )),
8247 }
8248 }
8249 }
8250
8251 impl serde::ser::Serialize for RolloutActions {
8252 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8253 where
8254 S: serde::Serializer,
8255 {
8256 match self {
8257 Self::Unspecified => serializer.serialize_i32(0),
8258 Self::Advance => serializer.serialize_i32(1),
8259 Self::Approve => serializer.serialize_i32(2),
8260 Self::Cancel => serializer.serialize_i32(3),
8261 Self::Create => serializer.serialize_i32(4),
8262 Self::IgnoreJob => serializer.serialize_i32(5),
8263 Self::RetryJob => serializer.serialize_i32(6),
8264 Self::Rollback => serializer.serialize_i32(7),
8265 Self::TerminateJobrun => serializer.serialize_i32(8),
8266 Self::UnknownValue(u) => u.0.serialize(serializer),
8267 }
8268 }
8269 }
8270
8271 impl<'de> serde::de::Deserialize<'de> for RolloutActions {
8272 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8273 where
8274 D: serde::Deserializer<'de>,
8275 {
8276 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RolloutActions>::new(
8277 ".google.cloud.deploy.v1.RolloutRestriction.RolloutActions",
8278 ))
8279 }
8280 }
8281}
8282
8283/// Time windows within which actions are restricted. See the
8284/// [documentation](https://cloud.google.com/deploy/docs/deploy-policy#dates_times)
8285/// for more information on how to configure dates/times.
8286#[derive(Clone, Default, PartialEq)]
8287#[non_exhaustive]
8288pub struct TimeWindows {
8289 /// Required. The time zone in IANA format [IANA Time Zone
8290 /// Database](https://www.iana.org/time-zones) (e.g. America/New_York).
8291 pub time_zone: std::string::String,
8292
8293 /// Optional. One-time windows within which actions are restricted.
8294 pub one_time_windows: std::vec::Vec<crate::model::OneTimeWindow>,
8295
8296 /// Optional. Recurring weekly windows within which actions are restricted.
8297 pub weekly_windows: std::vec::Vec<crate::model::WeeklyWindow>,
8298
8299 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8300}
8301
8302impl TimeWindows {
8303 pub fn new() -> Self {
8304 std::default::Default::default()
8305 }
8306
8307 /// Sets the value of [time_zone][crate::model::TimeWindows::time_zone].
8308 ///
8309 /// # Example
8310 /// ```ignore,no_run
8311 /// # use google_cloud_deploy_v1::model::TimeWindows;
8312 /// let x = TimeWindows::new().set_time_zone("example");
8313 /// ```
8314 pub fn set_time_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8315 self.time_zone = v.into();
8316 self
8317 }
8318
8319 /// Sets the value of [one_time_windows][crate::model::TimeWindows::one_time_windows].
8320 ///
8321 /// # Example
8322 /// ```ignore,no_run
8323 /// # use google_cloud_deploy_v1::model::TimeWindows;
8324 /// use google_cloud_deploy_v1::model::OneTimeWindow;
8325 /// let x = TimeWindows::new()
8326 /// .set_one_time_windows([
8327 /// OneTimeWindow::default()/* use setters */,
8328 /// OneTimeWindow::default()/* use (different) setters */,
8329 /// ]);
8330 /// ```
8331 pub fn set_one_time_windows<T, V>(mut self, v: T) -> Self
8332 where
8333 T: std::iter::IntoIterator<Item = V>,
8334 V: std::convert::Into<crate::model::OneTimeWindow>,
8335 {
8336 use std::iter::Iterator;
8337 self.one_time_windows = v.into_iter().map(|i| i.into()).collect();
8338 self
8339 }
8340
8341 /// Sets the value of [weekly_windows][crate::model::TimeWindows::weekly_windows].
8342 ///
8343 /// # Example
8344 /// ```ignore,no_run
8345 /// # use google_cloud_deploy_v1::model::TimeWindows;
8346 /// use google_cloud_deploy_v1::model::WeeklyWindow;
8347 /// let x = TimeWindows::new()
8348 /// .set_weekly_windows([
8349 /// WeeklyWindow::default()/* use setters */,
8350 /// WeeklyWindow::default()/* use (different) setters */,
8351 /// ]);
8352 /// ```
8353 pub fn set_weekly_windows<T, V>(mut self, v: T) -> Self
8354 where
8355 T: std::iter::IntoIterator<Item = V>,
8356 V: std::convert::Into<crate::model::WeeklyWindow>,
8357 {
8358 use std::iter::Iterator;
8359 self.weekly_windows = v.into_iter().map(|i| i.into()).collect();
8360 self
8361 }
8362}
8363
8364impl wkt::message::Message for TimeWindows {
8365 fn typename() -> &'static str {
8366 "type.googleapis.com/google.cloud.deploy.v1.TimeWindows"
8367 }
8368}
8369
8370/// One-time window within which actions are restricted. For example, blocking
8371/// actions over New Year's Eve from December 31st at 5pm to January 1st at 9am.
8372#[derive(Clone, Default, PartialEq)]
8373#[non_exhaustive]
8374pub struct OneTimeWindow {
8375 /// Required. Start date.
8376 pub start_date: std::option::Option<google_cloud_type::model::Date>,
8377
8378 /// Required. Start time (inclusive). Use 00:00 for the beginning of the day.
8379 pub start_time: std::option::Option<google_cloud_type::model::TimeOfDay>,
8380
8381 /// Required. End date.
8382 pub end_date: std::option::Option<google_cloud_type::model::Date>,
8383
8384 /// Required. End time (exclusive). You may use 24:00 for the end of the day.
8385 pub end_time: std::option::Option<google_cloud_type::model::TimeOfDay>,
8386
8387 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8388}
8389
8390impl OneTimeWindow {
8391 pub fn new() -> Self {
8392 std::default::Default::default()
8393 }
8394
8395 /// Sets the value of [start_date][crate::model::OneTimeWindow::start_date].
8396 ///
8397 /// # Example
8398 /// ```ignore,no_run
8399 /// # use google_cloud_deploy_v1::model::OneTimeWindow;
8400 /// use google_cloud_type::model::Date;
8401 /// let x = OneTimeWindow::new().set_start_date(Date::default()/* use setters */);
8402 /// ```
8403 pub fn set_start_date<T>(mut self, v: T) -> Self
8404 where
8405 T: std::convert::Into<google_cloud_type::model::Date>,
8406 {
8407 self.start_date = std::option::Option::Some(v.into());
8408 self
8409 }
8410
8411 /// Sets or clears the value of [start_date][crate::model::OneTimeWindow::start_date].
8412 ///
8413 /// # Example
8414 /// ```ignore,no_run
8415 /// # use google_cloud_deploy_v1::model::OneTimeWindow;
8416 /// use google_cloud_type::model::Date;
8417 /// let x = OneTimeWindow::new().set_or_clear_start_date(Some(Date::default()/* use setters */));
8418 /// let x = OneTimeWindow::new().set_or_clear_start_date(None::<Date>);
8419 /// ```
8420 pub fn set_or_clear_start_date<T>(mut self, v: std::option::Option<T>) -> Self
8421 where
8422 T: std::convert::Into<google_cloud_type::model::Date>,
8423 {
8424 self.start_date = v.map(|x| x.into());
8425 self
8426 }
8427
8428 /// Sets the value of [start_time][crate::model::OneTimeWindow::start_time].
8429 ///
8430 /// # Example
8431 /// ```ignore,no_run
8432 /// # use google_cloud_deploy_v1::model::OneTimeWindow;
8433 /// use google_cloud_type::model::TimeOfDay;
8434 /// let x = OneTimeWindow::new().set_start_time(TimeOfDay::default()/* use setters */);
8435 /// ```
8436 pub fn set_start_time<T>(mut self, v: T) -> Self
8437 where
8438 T: std::convert::Into<google_cloud_type::model::TimeOfDay>,
8439 {
8440 self.start_time = std::option::Option::Some(v.into());
8441 self
8442 }
8443
8444 /// Sets or clears the value of [start_time][crate::model::OneTimeWindow::start_time].
8445 ///
8446 /// # Example
8447 /// ```ignore,no_run
8448 /// # use google_cloud_deploy_v1::model::OneTimeWindow;
8449 /// use google_cloud_type::model::TimeOfDay;
8450 /// let x = OneTimeWindow::new().set_or_clear_start_time(Some(TimeOfDay::default()/* use setters */));
8451 /// let x = OneTimeWindow::new().set_or_clear_start_time(None::<TimeOfDay>);
8452 /// ```
8453 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
8454 where
8455 T: std::convert::Into<google_cloud_type::model::TimeOfDay>,
8456 {
8457 self.start_time = v.map(|x| x.into());
8458 self
8459 }
8460
8461 /// Sets the value of [end_date][crate::model::OneTimeWindow::end_date].
8462 ///
8463 /// # Example
8464 /// ```ignore,no_run
8465 /// # use google_cloud_deploy_v1::model::OneTimeWindow;
8466 /// use google_cloud_type::model::Date;
8467 /// let x = OneTimeWindow::new().set_end_date(Date::default()/* use setters */);
8468 /// ```
8469 pub fn set_end_date<T>(mut self, v: T) -> Self
8470 where
8471 T: std::convert::Into<google_cloud_type::model::Date>,
8472 {
8473 self.end_date = std::option::Option::Some(v.into());
8474 self
8475 }
8476
8477 /// Sets or clears the value of [end_date][crate::model::OneTimeWindow::end_date].
8478 ///
8479 /// # Example
8480 /// ```ignore,no_run
8481 /// # use google_cloud_deploy_v1::model::OneTimeWindow;
8482 /// use google_cloud_type::model::Date;
8483 /// let x = OneTimeWindow::new().set_or_clear_end_date(Some(Date::default()/* use setters */));
8484 /// let x = OneTimeWindow::new().set_or_clear_end_date(None::<Date>);
8485 /// ```
8486 pub fn set_or_clear_end_date<T>(mut self, v: std::option::Option<T>) -> Self
8487 where
8488 T: std::convert::Into<google_cloud_type::model::Date>,
8489 {
8490 self.end_date = v.map(|x| x.into());
8491 self
8492 }
8493
8494 /// Sets the value of [end_time][crate::model::OneTimeWindow::end_time].
8495 ///
8496 /// # Example
8497 /// ```ignore,no_run
8498 /// # use google_cloud_deploy_v1::model::OneTimeWindow;
8499 /// use google_cloud_type::model::TimeOfDay;
8500 /// let x = OneTimeWindow::new().set_end_time(TimeOfDay::default()/* use setters */);
8501 /// ```
8502 pub fn set_end_time<T>(mut self, v: T) -> Self
8503 where
8504 T: std::convert::Into<google_cloud_type::model::TimeOfDay>,
8505 {
8506 self.end_time = std::option::Option::Some(v.into());
8507 self
8508 }
8509
8510 /// Sets or clears the value of [end_time][crate::model::OneTimeWindow::end_time].
8511 ///
8512 /// # Example
8513 /// ```ignore,no_run
8514 /// # use google_cloud_deploy_v1::model::OneTimeWindow;
8515 /// use google_cloud_type::model::TimeOfDay;
8516 /// let x = OneTimeWindow::new().set_or_clear_end_time(Some(TimeOfDay::default()/* use setters */));
8517 /// let x = OneTimeWindow::new().set_or_clear_end_time(None::<TimeOfDay>);
8518 /// ```
8519 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
8520 where
8521 T: std::convert::Into<google_cloud_type::model::TimeOfDay>,
8522 {
8523 self.end_time = v.map(|x| x.into());
8524 self
8525 }
8526}
8527
8528impl wkt::message::Message for OneTimeWindow {
8529 fn typename() -> &'static str {
8530 "type.googleapis.com/google.cloud.deploy.v1.OneTimeWindow"
8531 }
8532}
8533
8534/// Weekly windows. For example, blocking actions every Saturday and Sunday.
8535/// Another example would be blocking actions every weekday from 5pm to midnight.
8536#[derive(Clone, Default, PartialEq)]
8537#[non_exhaustive]
8538pub struct WeeklyWindow {
8539 /// Optional. Days of week. If left empty, all days of the week will be
8540 /// included.
8541 pub days_of_week: std::vec::Vec<google_cloud_type::model::DayOfWeek>,
8542
8543 /// Optional. Start time (inclusive). Use 00:00 for the beginning of the day.
8544 /// If you specify start_time you must also specify end_time. If left empty,
8545 /// this will block for the entire day for the days specified in days_of_week.
8546 pub start_time: std::option::Option<google_cloud_type::model::TimeOfDay>,
8547
8548 /// Optional. End time (exclusive). Use 24:00 to indicate midnight. If you
8549 /// specify end_time you must also specify start_time. If left empty, this will
8550 /// block for the entire day for the days specified in days_of_week.
8551 pub end_time: std::option::Option<google_cloud_type::model::TimeOfDay>,
8552
8553 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8554}
8555
8556impl WeeklyWindow {
8557 pub fn new() -> Self {
8558 std::default::Default::default()
8559 }
8560
8561 /// Sets the value of [days_of_week][crate::model::WeeklyWindow::days_of_week].
8562 ///
8563 /// # Example
8564 /// ```ignore,no_run
8565 /// # use google_cloud_deploy_v1::model::WeeklyWindow;
8566 /// use google_cloud_type::model::DayOfWeek;
8567 /// let x = WeeklyWindow::new().set_days_of_week([
8568 /// DayOfWeek::Monday,
8569 /// DayOfWeek::Tuesday,
8570 /// DayOfWeek::Wednesday,
8571 /// ]);
8572 /// ```
8573 pub fn set_days_of_week<T, V>(mut self, v: T) -> Self
8574 where
8575 T: std::iter::IntoIterator<Item = V>,
8576 V: std::convert::Into<google_cloud_type::model::DayOfWeek>,
8577 {
8578 use std::iter::Iterator;
8579 self.days_of_week = v.into_iter().map(|i| i.into()).collect();
8580 self
8581 }
8582
8583 /// Sets the value of [start_time][crate::model::WeeklyWindow::start_time].
8584 ///
8585 /// # Example
8586 /// ```ignore,no_run
8587 /// # use google_cloud_deploy_v1::model::WeeklyWindow;
8588 /// use google_cloud_type::model::TimeOfDay;
8589 /// let x = WeeklyWindow::new().set_start_time(TimeOfDay::default()/* use setters */);
8590 /// ```
8591 pub fn set_start_time<T>(mut self, v: T) -> Self
8592 where
8593 T: std::convert::Into<google_cloud_type::model::TimeOfDay>,
8594 {
8595 self.start_time = std::option::Option::Some(v.into());
8596 self
8597 }
8598
8599 /// Sets or clears the value of [start_time][crate::model::WeeklyWindow::start_time].
8600 ///
8601 /// # Example
8602 /// ```ignore,no_run
8603 /// # use google_cloud_deploy_v1::model::WeeklyWindow;
8604 /// use google_cloud_type::model::TimeOfDay;
8605 /// let x = WeeklyWindow::new().set_or_clear_start_time(Some(TimeOfDay::default()/* use setters */));
8606 /// let x = WeeklyWindow::new().set_or_clear_start_time(None::<TimeOfDay>);
8607 /// ```
8608 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
8609 where
8610 T: std::convert::Into<google_cloud_type::model::TimeOfDay>,
8611 {
8612 self.start_time = v.map(|x| x.into());
8613 self
8614 }
8615
8616 /// Sets the value of [end_time][crate::model::WeeklyWindow::end_time].
8617 ///
8618 /// # Example
8619 /// ```ignore,no_run
8620 /// # use google_cloud_deploy_v1::model::WeeklyWindow;
8621 /// use google_cloud_type::model::TimeOfDay;
8622 /// let x = WeeklyWindow::new().set_end_time(TimeOfDay::default()/* use setters */);
8623 /// ```
8624 pub fn set_end_time<T>(mut self, v: T) -> Self
8625 where
8626 T: std::convert::Into<google_cloud_type::model::TimeOfDay>,
8627 {
8628 self.end_time = std::option::Option::Some(v.into());
8629 self
8630 }
8631
8632 /// Sets or clears the value of [end_time][crate::model::WeeklyWindow::end_time].
8633 ///
8634 /// # Example
8635 /// ```ignore,no_run
8636 /// # use google_cloud_deploy_v1::model::WeeklyWindow;
8637 /// use google_cloud_type::model::TimeOfDay;
8638 /// let x = WeeklyWindow::new().set_or_clear_end_time(Some(TimeOfDay::default()/* use setters */));
8639 /// let x = WeeklyWindow::new().set_or_clear_end_time(None::<TimeOfDay>);
8640 /// ```
8641 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
8642 where
8643 T: std::convert::Into<google_cloud_type::model::TimeOfDay>,
8644 {
8645 self.end_time = v.map(|x| x.into());
8646 self
8647 }
8648}
8649
8650impl wkt::message::Message for WeeklyWindow {
8651 fn typename() -> &'static str {
8652 "type.googleapis.com/google.cloud.deploy.v1.WeeklyWindow"
8653 }
8654}
8655
8656/// Returned from an action if one or more policies were
8657/// violated, and therefore the action was prevented. Contains information about
8658/// what policies were violated and why.
8659#[derive(Clone, Default, PartialEq)]
8660#[non_exhaustive]
8661pub struct PolicyViolation {
8662 /// Policy violation details.
8663 pub policy_violation_details: std::vec::Vec<crate::model::PolicyViolationDetails>,
8664
8665 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8666}
8667
8668impl PolicyViolation {
8669 pub fn new() -> Self {
8670 std::default::Default::default()
8671 }
8672
8673 /// Sets the value of [policy_violation_details][crate::model::PolicyViolation::policy_violation_details].
8674 ///
8675 /// # Example
8676 /// ```ignore,no_run
8677 /// # use google_cloud_deploy_v1::model::PolicyViolation;
8678 /// use google_cloud_deploy_v1::model::PolicyViolationDetails;
8679 /// let x = PolicyViolation::new()
8680 /// .set_policy_violation_details([
8681 /// PolicyViolationDetails::default()/* use setters */,
8682 /// PolicyViolationDetails::default()/* use (different) setters */,
8683 /// ]);
8684 /// ```
8685 pub fn set_policy_violation_details<T, V>(mut self, v: T) -> Self
8686 where
8687 T: std::iter::IntoIterator<Item = V>,
8688 V: std::convert::Into<crate::model::PolicyViolationDetails>,
8689 {
8690 use std::iter::Iterator;
8691 self.policy_violation_details = v.into_iter().map(|i| i.into()).collect();
8692 self
8693 }
8694}
8695
8696impl wkt::message::Message for PolicyViolation {
8697 fn typename() -> &'static str {
8698 "type.googleapis.com/google.cloud.deploy.v1.PolicyViolation"
8699 }
8700}
8701
8702/// Policy violation details.
8703#[derive(Clone, Default, PartialEq)]
8704#[non_exhaustive]
8705pub struct PolicyViolationDetails {
8706 /// Name of the policy that was violated.
8707 /// Policy resource will be in the format of
8708 /// `projects/{project}/locations/{location}/policies/{policy}`.
8709 pub policy: std::string::String,
8710
8711 /// Id of the rule that triggered the policy violation.
8712 pub rule_id: std::string::String,
8713
8714 /// User readable message about why the request violated a policy. This is not
8715 /// intended for machine parsing.
8716 pub failure_message: std::string::String,
8717
8718 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8719}
8720
8721impl PolicyViolationDetails {
8722 pub fn new() -> Self {
8723 std::default::Default::default()
8724 }
8725
8726 /// Sets the value of [policy][crate::model::PolicyViolationDetails::policy].
8727 ///
8728 /// # Example
8729 /// ```ignore,no_run
8730 /// # use google_cloud_deploy_v1::model::PolicyViolationDetails;
8731 /// let x = PolicyViolationDetails::new().set_policy("example");
8732 /// ```
8733 pub fn set_policy<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8734 self.policy = v.into();
8735 self
8736 }
8737
8738 /// Sets the value of [rule_id][crate::model::PolicyViolationDetails::rule_id].
8739 ///
8740 /// # Example
8741 /// ```ignore,no_run
8742 /// # use google_cloud_deploy_v1::model::PolicyViolationDetails;
8743 /// let x = PolicyViolationDetails::new().set_rule_id("example");
8744 /// ```
8745 pub fn set_rule_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8746 self.rule_id = v.into();
8747 self
8748 }
8749
8750 /// Sets the value of [failure_message][crate::model::PolicyViolationDetails::failure_message].
8751 ///
8752 /// # Example
8753 /// ```ignore,no_run
8754 /// # use google_cloud_deploy_v1::model::PolicyViolationDetails;
8755 /// let x = PolicyViolationDetails::new().set_failure_message("example");
8756 /// ```
8757 pub fn set_failure_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8758 self.failure_message = v.into();
8759 self
8760 }
8761}
8762
8763impl wkt::message::Message for PolicyViolationDetails {
8764 fn typename() -> &'static str {
8765 "type.googleapis.com/google.cloud.deploy.v1.PolicyViolationDetails"
8766 }
8767}
8768
8769/// A `Release` resource in the Cloud Deploy API.
8770///
8771/// A `Release` defines a specific Skaffold configuration instance
8772/// that can be deployed.
8773#[derive(Clone, Default, PartialEq)]
8774#[non_exhaustive]
8775pub struct Release {
8776 /// Identifier. Name of the `Release`. Format is
8777 /// `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}`.
8778 /// The `release` component must match `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`
8779 pub name: std::string::String,
8780
8781 /// Output only. Unique identifier of the `Release`.
8782 pub uid: std::string::String,
8783
8784 /// Optional. Description of the `Release`. Max length is 255 characters.
8785 pub description: std::string::String,
8786
8787 /// Optional. User annotations. These attributes can only be set and used by
8788 /// the user, and not by Cloud Deploy. See
8789 /// <https://google.aip.dev/128#annotations> for more details such as format and
8790 /// size limitations.
8791 pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
8792
8793 /// Labels are attributes that can be set and used by both the
8794 /// user and by Cloud Deploy. Labels must meet the following constraints:
8795 ///
8796 /// * Keys and values can contain only lowercase letters, numeric characters,
8797 /// underscores, and dashes.
8798 /// * All characters must use UTF-8 encoding, and international characters are
8799 /// allowed.
8800 /// * Keys must start with a lowercase letter or international character.
8801 /// * Each resource is limited to a maximum of 64 labels.
8802 ///
8803 /// Both keys and values are additionally constrained to be <= 128 bytes.
8804 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
8805
8806 /// Output only. Indicates whether this is an abandoned release.
8807 pub abandoned: bool,
8808
8809 /// Output only. Time at which the `Release` was created.
8810 pub create_time: std::option::Option<wkt::Timestamp>,
8811
8812 /// Output only. Time at which the render began.
8813 pub render_start_time: std::option::Option<wkt::Timestamp>,
8814
8815 /// Output only. Time at which the render completed.
8816 pub render_end_time: std::option::Option<wkt::Timestamp>,
8817
8818 /// Optional. Cloud Storage URI of tar.gz archive containing Skaffold
8819 /// configuration.
8820 pub skaffold_config_uri: std::string::String,
8821
8822 /// Optional. Filepath of the Skaffold config inside of the config URI.
8823 pub skaffold_config_path: std::string::String,
8824
8825 /// Optional. List of artifacts to pass through to Skaffold command.
8826 pub build_artifacts: std::vec::Vec<crate::model::BuildArtifact>,
8827
8828 /// Output only. Snapshot of the parent pipeline taken at release creation
8829 /// time.
8830 pub delivery_pipeline_snapshot: std::option::Option<crate::model::DeliveryPipeline>,
8831
8832 /// Output only. Snapshot of the targets taken at release creation time.
8833 pub target_snapshots: std::vec::Vec<crate::model::Target>,
8834
8835 /// Output only. Snapshot of the custom target types referenced by the targets
8836 /// taken at release creation time.
8837 pub custom_target_type_snapshots: std::vec::Vec<crate::model::CustomTargetType>,
8838
8839 /// Output only. Current state of the render operation.
8840 pub render_state: crate::model::release::RenderState,
8841
8842 /// This checksum is computed by the server based on the value of other
8843 /// fields, and may be sent on update and delete requests to ensure the
8844 /// client has an up-to-date value before proceeding.
8845 pub etag: std::string::String,
8846
8847 /// Optional. The Skaffold version to use when operating on this release, such
8848 /// as "1.20.0". Not all versions are valid; Cloud Deploy supports a specific
8849 /// set of versions.
8850 ///
8851 /// If unset, the most recent supported Skaffold version will be used.
8852 pub skaffold_version: std::string::String,
8853
8854 /// Output only. Map from target ID to the target artifacts created
8855 /// during the render operation.
8856 pub target_artifacts:
8857 std::collections::HashMap<std::string::String, crate::model::TargetArtifact>,
8858
8859 /// Output only. Map from target ID to details of the render operation for that
8860 /// target.
8861 pub target_renders:
8862 std::collections::HashMap<std::string::String, crate::model::release::TargetRender>,
8863
8864 /// Output only. Information around the state of the Release.
8865 pub condition: std::option::Option<crate::model::release::ReleaseCondition>,
8866
8867 /// Optional. The deploy parameters to use for all targets in this release.
8868 pub deploy_parameters: std::collections::HashMap<std::string::String, std::string::String>,
8869
8870 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8871}
8872
8873impl Release {
8874 pub fn new() -> Self {
8875 std::default::Default::default()
8876 }
8877
8878 /// Sets the value of [name][crate::model::Release::name].
8879 ///
8880 /// # Example
8881 /// ```ignore,no_run
8882 /// # use google_cloud_deploy_v1::model::Release;
8883 /// let x = Release::new().set_name("example");
8884 /// ```
8885 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8886 self.name = v.into();
8887 self
8888 }
8889
8890 /// Sets the value of [uid][crate::model::Release::uid].
8891 ///
8892 /// # Example
8893 /// ```ignore,no_run
8894 /// # use google_cloud_deploy_v1::model::Release;
8895 /// let x = Release::new().set_uid("example");
8896 /// ```
8897 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8898 self.uid = v.into();
8899 self
8900 }
8901
8902 /// Sets the value of [description][crate::model::Release::description].
8903 ///
8904 /// # Example
8905 /// ```ignore,no_run
8906 /// # use google_cloud_deploy_v1::model::Release;
8907 /// let x = Release::new().set_description("example");
8908 /// ```
8909 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8910 self.description = v.into();
8911 self
8912 }
8913
8914 /// Sets the value of [annotations][crate::model::Release::annotations].
8915 ///
8916 /// # Example
8917 /// ```ignore,no_run
8918 /// # use google_cloud_deploy_v1::model::Release;
8919 /// let x = Release::new().set_annotations([
8920 /// ("key0", "abc"),
8921 /// ("key1", "xyz"),
8922 /// ]);
8923 /// ```
8924 pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
8925 where
8926 T: std::iter::IntoIterator<Item = (K, V)>,
8927 K: std::convert::Into<std::string::String>,
8928 V: std::convert::Into<std::string::String>,
8929 {
8930 use std::iter::Iterator;
8931 self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
8932 self
8933 }
8934
8935 /// Sets the value of [labels][crate::model::Release::labels].
8936 ///
8937 /// # Example
8938 /// ```ignore,no_run
8939 /// # use google_cloud_deploy_v1::model::Release;
8940 /// let x = Release::new().set_labels([
8941 /// ("key0", "abc"),
8942 /// ("key1", "xyz"),
8943 /// ]);
8944 /// ```
8945 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
8946 where
8947 T: std::iter::IntoIterator<Item = (K, V)>,
8948 K: std::convert::Into<std::string::String>,
8949 V: std::convert::Into<std::string::String>,
8950 {
8951 use std::iter::Iterator;
8952 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
8953 self
8954 }
8955
8956 /// Sets the value of [abandoned][crate::model::Release::abandoned].
8957 ///
8958 /// # Example
8959 /// ```ignore,no_run
8960 /// # use google_cloud_deploy_v1::model::Release;
8961 /// let x = Release::new().set_abandoned(true);
8962 /// ```
8963 pub fn set_abandoned<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8964 self.abandoned = v.into();
8965 self
8966 }
8967
8968 /// Sets the value of [create_time][crate::model::Release::create_time].
8969 ///
8970 /// # Example
8971 /// ```ignore,no_run
8972 /// # use google_cloud_deploy_v1::model::Release;
8973 /// use wkt::Timestamp;
8974 /// let x = Release::new().set_create_time(Timestamp::default()/* use setters */);
8975 /// ```
8976 pub fn set_create_time<T>(mut self, v: T) -> Self
8977 where
8978 T: std::convert::Into<wkt::Timestamp>,
8979 {
8980 self.create_time = std::option::Option::Some(v.into());
8981 self
8982 }
8983
8984 /// Sets or clears the value of [create_time][crate::model::Release::create_time].
8985 ///
8986 /// # Example
8987 /// ```ignore,no_run
8988 /// # use google_cloud_deploy_v1::model::Release;
8989 /// use wkt::Timestamp;
8990 /// let x = Release::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
8991 /// let x = Release::new().set_or_clear_create_time(None::<Timestamp>);
8992 /// ```
8993 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
8994 where
8995 T: std::convert::Into<wkt::Timestamp>,
8996 {
8997 self.create_time = v.map(|x| x.into());
8998 self
8999 }
9000
9001 /// Sets the value of [render_start_time][crate::model::Release::render_start_time].
9002 ///
9003 /// # Example
9004 /// ```ignore,no_run
9005 /// # use google_cloud_deploy_v1::model::Release;
9006 /// use wkt::Timestamp;
9007 /// let x = Release::new().set_render_start_time(Timestamp::default()/* use setters */);
9008 /// ```
9009 pub fn set_render_start_time<T>(mut self, v: T) -> Self
9010 where
9011 T: std::convert::Into<wkt::Timestamp>,
9012 {
9013 self.render_start_time = std::option::Option::Some(v.into());
9014 self
9015 }
9016
9017 /// Sets or clears the value of [render_start_time][crate::model::Release::render_start_time].
9018 ///
9019 /// # Example
9020 /// ```ignore,no_run
9021 /// # use google_cloud_deploy_v1::model::Release;
9022 /// use wkt::Timestamp;
9023 /// let x = Release::new().set_or_clear_render_start_time(Some(Timestamp::default()/* use setters */));
9024 /// let x = Release::new().set_or_clear_render_start_time(None::<Timestamp>);
9025 /// ```
9026 pub fn set_or_clear_render_start_time<T>(mut self, v: std::option::Option<T>) -> Self
9027 where
9028 T: std::convert::Into<wkt::Timestamp>,
9029 {
9030 self.render_start_time = v.map(|x| x.into());
9031 self
9032 }
9033
9034 /// Sets the value of [render_end_time][crate::model::Release::render_end_time].
9035 ///
9036 /// # Example
9037 /// ```ignore,no_run
9038 /// # use google_cloud_deploy_v1::model::Release;
9039 /// use wkt::Timestamp;
9040 /// let x = Release::new().set_render_end_time(Timestamp::default()/* use setters */);
9041 /// ```
9042 pub fn set_render_end_time<T>(mut self, v: T) -> Self
9043 where
9044 T: std::convert::Into<wkt::Timestamp>,
9045 {
9046 self.render_end_time = std::option::Option::Some(v.into());
9047 self
9048 }
9049
9050 /// Sets or clears the value of [render_end_time][crate::model::Release::render_end_time].
9051 ///
9052 /// # Example
9053 /// ```ignore,no_run
9054 /// # use google_cloud_deploy_v1::model::Release;
9055 /// use wkt::Timestamp;
9056 /// let x = Release::new().set_or_clear_render_end_time(Some(Timestamp::default()/* use setters */));
9057 /// let x = Release::new().set_or_clear_render_end_time(None::<Timestamp>);
9058 /// ```
9059 pub fn set_or_clear_render_end_time<T>(mut self, v: std::option::Option<T>) -> Self
9060 where
9061 T: std::convert::Into<wkt::Timestamp>,
9062 {
9063 self.render_end_time = v.map(|x| x.into());
9064 self
9065 }
9066
9067 /// Sets the value of [skaffold_config_uri][crate::model::Release::skaffold_config_uri].
9068 ///
9069 /// # Example
9070 /// ```ignore,no_run
9071 /// # use google_cloud_deploy_v1::model::Release;
9072 /// let x = Release::new().set_skaffold_config_uri("example");
9073 /// ```
9074 pub fn set_skaffold_config_uri<T: std::convert::Into<std::string::String>>(
9075 mut self,
9076 v: T,
9077 ) -> Self {
9078 self.skaffold_config_uri = v.into();
9079 self
9080 }
9081
9082 /// Sets the value of [skaffold_config_path][crate::model::Release::skaffold_config_path].
9083 ///
9084 /// # Example
9085 /// ```ignore,no_run
9086 /// # use google_cloud_deploy_v1::model::Release;
9087 /// let x = Release::new().set_skaffold_config_path("example");
9088 /// ```
9089 pub fn set_skaffold_config_path<T: std::convert::Into<std::string::String>>(
9090 mut self,
9091 v: T,
9092 ) -> Self {
9093 self.skaffold_config_path = v.into();
9094 self
9095 }
9096
9097 /// Sets the value of [build_artifacts][crate::model::Release::build_artifacts].
9098 ///
9099 /// # Example
9100 /// ```ignore,no_run
9101 /// # use google_cloud_deploy_v1::model::Release;
9102 /// use google_cloud_deploy_v1::model::BuildArtifact;
9103 /// let x = Release::new()
9104 /// .set_build_artifacts([
9105 /// BuildArtifact::default()/* use setters */,
9106 /// BuildArtifact::default()/* use (different) setters */,
9107 /// ]);
9108 /// ```
9109 pub fn set_build_artifacts<T, V>(mut self, v: T) -> Self
9110 where
9111 T: std::iter::IntoIterator<Item = V>,
9112 V: std::convert::Into<crate::model::BuildArtifact>,
9113 {
9114 use std::iter::Iterator;
9115 self.build_artifacts = v.into_iter().map(|i| i.into()).collect();
9116 self
9117 }
9118
9119 /// Sets the value of [delivery_pipeline_snapshot][crate::model::Release::delivery_pipeline_snapshot].
9120 ///
9121 /// # Example
9122 /// ```ignore,no_run
9123 /// # use google_cloud_deploy_v1::model::Release;
9124 /// use google_cloud_deploy_v1::model::DeliveryPipeline;
9125 /// let x = Release::new().set_delivery_pipeline_snapshot(DeliveryPipeline::default()/* use setters */);
9126 /// ```
9127 pub fn set_delivery_pipeline_snapshot<T>(mut self, v: T) -> Self
9128 where
9129 T: std::convert::Into<crate::model::DeliveryPipeline>,
9130 {
9131 self.delivery_pipeline_snapshot = std::option::Option::Some(v.into());
9132 self
9133 }
9134
9135 /// Sets or clears the value of [delivery_pipeline_snapshot][crate::model::Release::delivery_pipeline_snapshot].
9136 ///
9137 /// # Example
9138 /// ```ignore,no_run
9139 /// # use google_cloud_deploy_v1::model::Release;
9140 /// use google_cloud_deploy_v1::model::DeliveryPipeline;
9141 /// let x = Release::new().set_or_clear_delivery_pipeline_snapshot(Some(DeliveryPipeline::default()/* use setters */));
9142 /// let x = Release::new().set_or_clear_delivery_pipeline_snapshot(None::<DeliveryPipeline>);
9143 /// ```
9144 pub fn set_or_clear_delivery_pipeline_snapshot<T>(mut self, v: std::option::Option<T>) -> Self
9145 where
9146 T: std::convert::Into<crate::model::DeliveryPipeline>,
9147 {
9148 self.delivery_pipeline_snapshot = v.map(|x| x.into());
9149 self
9150 }
9151
9152 /// Sets the value of [target_snapshots][crate::model::Release::target_snapshots].
9153 ///
9154 /// # Example
9155 /// ```ignore,no_run
9156 /// # use google_cloud_deploy_v1::model::Release;
9157 /// use google_cloud_deploy_v1::model::Target;
9158 /// let x = Release::new()
9159 /// .set_target_snapshots([
9160 /// Target::default()/* use setters */,
9161 /// Target::default()/* use (different) setters */,
9162 /// ]);
9163 /// ```
9164 pub fn set_target_snapshots<T, V>(mut self, v: T) -> Self
9165 where
9166 T: std::iter::IntoIterator<Item = V>,
9167 V: std::convert::Into<crate::model::Target>,
9168 {
9169 use std::iter::Iterator;
9170 self.target_snapshots = v.into_iter().map(|i| i.into()).collect();
9171 self
9172 }
9173
9174 /// Sets the value of [custom_target_type_snapshots][crate::model::Release::custom_target_type_snapshots].
9175 ///
9176 /// # Example
9177 /// ```ignore,no_run
9178 /// # use google_cloud_deploy_v1::model::Release;
9179 /// use google_cloud_deploy_v1::model::CustomTargetType;
9180 /// let x = Release::new()
9181 /// .set_custom_target_type_snapshots([
9182 /// CustomTargetType::default()/* use setters */,
9183 /// CustomTargetType::default()/* use (different) setters */,
9184 /// ]);
9185 /// ```
9186 pub fn set_custom_target_type_snapshots<T, V>(mut self, v: T) -> Self
9187 where
9188 T: std::iter::IntoIterator<Item = V>,
9189 V: std::convert::Into<crate::model::CustomTargetType>,
9190 {
9191 use std::iter::Iterator;
9192 self.custom_target_type_snapshots = v.into_iter().map(|i| i.into()).collect();
9193 self
9194 }
9195
9196 /// Sets the value of [render_state][crate::model::Release::render_state].
9197 ///
9198 /// # Example
9199 /// ```ignore,no_run
9200 /// # use google_cloud_deploy_v1::model::Release;
9201 /// use google_cloud_deploy_v1::model::release::RenderState;
9202 /// let x0 = Release::new().set_render_state(RenderState::Succeeded);
9203 /// let x1 = Release::new().set_render_state(RenderState::Failed);
9204 /// let x2 = Release::new().set_render_state(RenderState::InProgress);
9205 /// ```
9206 pub fn set_render_state<T: std::convert::Into<crate::model::release::RenderState>>(
9207 mut self,
9208 v: T,
9209 ) -> Self {
9210 self.render_state = v.into();
9211 self
9212 }
9213
9214 /// Sets the value of [etag][crate::model::Release::etag].
9215 ///
9216 /// # Example
9217 /// ```ignore,no_run
9218 /// # use google_cloud_deploy_v1::model::Release;
9219 /// let x = Release::new().set_etag("example");
9220 /// ```
9221 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9222 self.etag = v.into();
9223 self
9224 }
9225
9226 /// Sets the value of [skaffold_version][crate::model::Release::skaffold_version].
9227 ///
9228 /// # Example
9229 /// ```ignore,no_run
9230 /// # use google_cloud_deploy_v1::model::Release;
9231 /// let x = Release::new().set_skaffold_version("example");
9232 /// ```
9233 pub fn set_skaffold_version<T: std::convert::Into<std::string::String>>(
9234 mut self,
9235 v: T,
9236 ) -> Self {
9237 self.skaffold_version = v.into();
9238 self
9239 }
9240
9241 /// Sets the value of [target_artifacts][crate::model::Release::target_artifacts].
9242 ///
9243 /// # Example
9244 /// ```ignore,no_run
9245 /// # use google_cloud_deploy_v1::model::Release;
9246 /// use google_cloud_deploy_v1::model::TargetArtifact;
9247 /// let x = Release::new().set_target_artifacts([
9248 /// ("key0", TargetArtifact::default()/* use setters */),
9249 /// ("key1", TargetArtifact::default()/* use (different) setters */),
9250 /// ]);
9251 /// ```
9252 pub fn set_target_artifacts<T, K, V>(mut self, v: T) -> Self
9253 where
9254 T: std::iter::IntoIterator<Item = (K, V)>,
9255 K: std::convert::Into<std::string::String>,
9256 V: std::convert::Into<crate::model::TargetArtifact>,
9257 {
9258 use std::iter::Iterator;
9259 self.target_artifacts = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
9260 self
9261 }
9262
9263 /// Sets the value of [target_renders][crate::model::Release::target_renders].
9264 ///
9265 /// # Example
9266 /// ```ignore,no_run
9267 /// # use google_cloud_deploy_v1::model::Release;
9268 /// use google_cloud_deploy_v1::model::release::TargetRender;
9269 /// let x = Release::new().set_target_renders([
9270 /// ("key0", TargetRender::default()/* use setters */),
9271 /// ("key1", TargetRender::default()/* use (different) setters */),
9272 /// ]);
9273 /// ```
9274 pub fn set_target_renders<T, K, V>(mut self, v: T) -> Self
9275 where
9276 T: std::iter::IntoIterator<Item = (K, V)>,
9277 K: std::convert::Into<std::string::String>,
9278 V: std::convert::Into<crate::model::release::TargetRender>,
9279 {
9280 use std::iter::Iterator;
9281 self.target_renders = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
9282 self
9283 }
9284
9285 /// Sets the value of [condition][crate::model::Release::condition].
9286 ///
9287 /// # Example
9288 /// ```ignore,no_run
9289 /// # use google_cloud_deploy_v1::model::Release;
9290 /// use google_cloud_deploy_v1::model::release::ReleaseCondition;
9291 /// let x = Release::new().set_condition(ReleaseCondition::default()/* use setters */);
9292 /// ```
9293 pub fn set_condition<T>(mut self, v: T) -> Self
9294 where
9295 T: std::convert::Into<crate::model::release::ReleaseCondition>,
9296 {
9297 self.condition = std::option::Option::Some(v.into());
9298 self
9299 }
9300
9301 /// Sets or clears the value of [condition][crate::model::Release::condition].
9302 ///
9303 /// # Example
9304 /// ```ignore,no_run
9305 /// # use google_cloud_deploy_v1::model::Release;
9306 /// use google_cloud_deploy_v1::model::release::ReleaseCondition;
9307 /// let x = Release::new().set_or_clear_condition(Some(ReleaseCondition::default()/* use setters */));
9308 /// let x = Release::new().set_or_clear_condition(None::<ReleaseCondition>);
9309 /// ```
9310 pub fn set_or_clear_condition<T>(mut self, v: std::option::Option<T>) -> Self
9311 where
9312 T: std::convert::Into<crate::model::release::ReleaseCondition>,
9313 {
9314 self.condition = v.map(|x| x.into());
9315 self
9316 }
9317
9318 /// Sets the value of [deploy_parameters][crate::model::Release::deploy_parameters].
9319 ///
9320 /// # Example
9321 /// ```ignore,no_run
9322 /// # use google_cloud_deploy_v1::model::Release;
9323 /// let x = Release::new().set_deploy_parameters([
9324 /// ("key0", "abc"),
9325 /// ("key1", "xyz"),
9326 /// ]);
9327 /// ```
9328 pub fn set_deploy_parameters<T, K, V>(mut self, v: T) -> Self
9329 where
9330 T: std::iter::IntoIterator<Item = (K, V)>,
9331 K: std::convert::Into<std::string::String>,
9332 V: std::convert::Into<std::string::String>,
9333 {
9334 use std::iter::Iterator;
9335 self.deploy_parameters = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
9336 self
9337 }
9338}
9339
9340impl wkt::message::Message for Release {
9341 fn typename() -> &'static str {
9342 "type.googleapis.com/google.cloud.deploy.v1.Release"
9343 }
9344}
9345
9346/// Defines additional types related to [Release].
9347pub mod release {
9348 #[allow(unused_imports)]
9349 use super::*;
9350
9351 /// Details of rendering for a single target.
9352 #[derive(Clone, Default, PartialEq)]
9353 #[non_exhaustive]
9354 pub struct TargetRender {
9355 /// Output only. The resource name of the Cloud Build `Build` object that is
9356 /// used to render the manifest for this target. Format is
9357 /// `projects/{project}/locations/{location}/builds/{build}`.
9358 pub rendering_build: std::string::String,
9359
9360 /// Output only. Current state of the render operation for this Target.
9361 pub rendering_state: crate::model::release::target_render::TargetRenderState,
9362
9363 /// Output only. Metadata related to the `Release` render for this Target.
9364 pub metadata: std::option::Option<crate::model::RenderMetadata>,
9365
9366 /// Output only. Reason this render failed. This will always be unspecified
9367 /// while the render in progress.
9368 pub failure_cause: crate::model::release::target_render::FailureCause,
9369
9370 /// Output only. Additional information about the render failure, if
9371 /// available.
9372 pub failure_message: std::string::String,
9373
9374 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9375 }
9376
9377 impl TargetRender {
9378 pub fn new() -> Self {
9379 std::default::Default::default()
9380 }
9381
9382 /// Sets the value of [rendering_build][crate::model::release::TargetRender::rendering_build].
9383 ///
9384 /// # Example
9385 /// ```ignore,no_run
9386 /// # use google_cloud_deploy_v1::model::release::TargetRender;
9387 /// let x = TargetRender::new().set_rendering_build("example");
9388 /// ```
9389 pub fn set_rendering_build<T: std::convert::Into<std::string::String>>(
9390 mut self,
9391 v: T,
9392 ) -> Self {
9393 self.rendering_build = v.into();
9394 self
9395 }
9396
9397 /// Sets the value of [rendering_state][crate::model::release::TargetRender::rendering_state].
9398 ///
9399 /// # Example
9400 /// ```ignore,no_run
9401 /// # use google_cloud_deploy_v1::model::release::TargetRender;
9402 /// use google_cloud_deploy_v1::model::release::target_render::TargetRenderState;
9403 /// let x0 = TargetRender::new().set_rendering_state(TargetRenderState::Succeeded);
9404 /// let x1 = TargetRender::new().set_rendering_state(TargetRenderState::Failed);
9405 /// let x2 = TargetRender::new().set_rendering_state(TargetRenderState::InProgress);
9406 /// ```
9407 pub fn set_rendering_state<
9408 T: std::convert::Into<crate::model::release::target_render::TargetRenderState>,
9409 >(
9410 mut self,
9411 v: T,
9412 ) -> Self {
9413 self.rendering_state = v.into();
9414 self
9415 }
9416
9417 /// Sets the value of [metadata][crate::model::release::TargetRender::metadata].
9418 ///
9419 /// # Example
9420 /// ```ignore,no_run
9421 /// # use google_cloud_deploy_v1::model::release::TargetRender;
9422 /// use google_cloud_deploy_v1::model::RenderMetadata;
9423 /// let x = TargetRender::new().set_metadata(RenderMetadata::default()/* use setters */);
9424 /// ```
9425 pub fn set_metadata<T>(mut self, v: T) -> Self
9426 where
9427 T: std::convert::Into<crate::model::RenderMetadata>,
9428 {
9429 self.metadata = std::option::Option::Some(v.into());
9430 self
9431 }
9432
9433 /// Sets or clears the value of [metadata][crate::model::release::TargetRender::metadata].
9434 ///
9435 /// # Example
9436 /// ```ignore,no_run
9437 /// # use google_cloud_deploy_v1::model::release::TargetRender;
9438 /// use google_cloud_deploy_v1::model::RenderMetadata;
9439 /// let x = TargetRender::new().set_or_clear_metadata(Some(RenderMetadata::default()/* use setters */));
9440 /// let x = TargetRender::new().set_or_clear_metadata(None::<RenderMetadata>);
9441 /// ```
9442 pub fn set_or_clear_metadata<T>(mut self, v: std::option::Option<T>) -> Self
9443 where
9444 T: std::convert::Into<crate::model::RenderMetadata>,
9445 {
9446 self.metadata = v.map(|x| x.into());
9447 self
9448 }
9449
9450 /// Sets the value of [failure_cause][crate::model::release::TargetRender::failure_cause].
9451 ///
9452 /// # Example
9453 /// ```ignore,no_run
9454 /// # use google_cloud_deploy_v1::model::release::TargetRender;
9455 /// use google_cloud_deploy_v1::model::release::target_render::FailureCause;
9456 /// let x0 = TargetRender::new().set_failure_cause(FailureCause::CloudBuildUnavailable);
9457 /// let x1 = TargetRender::new().set_failure_cause(FailureCause::ExecutionFailed);
9458 /// let x2 = TargetRender::new().set_failure_cause(FailureCause::CloudBuildRequestFailed);
9459 /// ```
9460 pub fn set_failure_cause<
9461 T: std::convert::Into<crate::model::release::target_render::FailureCause>,
9462 >(
9463 mut self,
9464 v: T,
9465 ) -> Self {
9466 self.failure_cause = v.into();
9467 self
9468 }
9469
9470 /// Sets the value of [failure_message][crate::model::release::TargetRender::failure_message].
9471 ///
9472 /// # Example
9473 /// ```ignore,no_run
9474 /// # use google_cloud_deploy_v1::model::release::TargetRender;
9475 /// let x = TargetRender::new().set_failure_message("example");
9476 /// ```
9477 pub fn set_failure_message<T: std::convert::Into<std::string::String>>(
9478 mut self,
9479 v: T,
9480 ) -> Self {
9481 self.failure_message = v.into();
9482 self
9483 }
9484 }
9485
9486 impl wkt::message::Message for TargetRender {
9487 fn typename() -> &'static str {
9488 "type.googleapis.com/google.cloud.deploy.v1.Release.TargetRender"
9489 }
9490 }
9491
9492 /// Defines additional types related to [TargetRender].
9493 pub mod target_render {
9494 #[allow(unused_imports)]
9495 use super::*;
9496
9497 /// Valid states of the render operation.
9498 ///
9499 /// # Working with unknown values
9500 ///
9501 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9502 /// additional enum variants at any time. Adding new variants is not considered
9503 /// a breaking change. Applications should write their code in anticipation of:
9504 ///
9505 /// - New values appearing in future releases of the client library, **and**
9506 /// - New values received dynamically, without application changes.
9507 ///
9508 /// Please consult the [Working with enums] section in the user guide for some
9509 /// guidelines.
9510 ///
9511 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
9512 #[derive(Clone, Debug, PartialEq)]
9513 #[non_exhaustive]
9514 pub enum TargetRenderState {
9515 /// The render operation state is unspecified.
9516 Unspecified,
9517 /// The render operation has completed successfully.
9518 Succeeded,
9519 /// The render operation has failed.
9520 Failed,
9521 /// The render operation is in progress.
9522 InProgress,
9523 /// If set, the enum was initialized with an unknown value.
9524 ///
9525 /// Applications can examine the value using [TargetRenderState::value] or
9526 /// [TargetRenderState::name].
9527 UnknownValue(target_render_state::UnknownValue),
9528 }
9529
9530 #[doc(hidden)]
9531 pub mod target_render_state {
9532 #[allow(unused_imports)]
9533 use super::*;
9534 #[derive(Clone, Debug, PartialEq)]
9535 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9536 }
9537
9538 impl TargetRenderState {
9539 /// Gets the enum value.
9540 ///
9541 /// Returns `None` if the enum contains an unknown value deserialized from
9542 /// the string representation of enums.
9543 pub fn value(&self) -> std::option::Option<i32> {
9544 match self {
9545 Self::Unspecified => std::option::Option::Some(0),
9546 Self::Succeeded => std::option::Option::Some(1),
9547 Self::Failed => std::option::Option::Some(2),
9548 Self::InProgress => std::option::Option::Some(3),
9549 Self::UnknownValue(u) => u.0.value(),
9550 }
9551 }
9552
9553 /// Gets the enum value as a string.
9554 ///
9555 /// Returns `None` if the enum contains an unknown value deserialized from
9556 /// the integer representation of enums.
9557 pub fn name(&self) -> std::option::Option<&str> {
9558 match self {
9559 Self::Unspecified => {
9560 std::option::Option::Some("TARGET_RENDER_STATE_UNSPECIFIED")
9561 }
9562 Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
9563 Self::Failed => std::option::Option::Some("FAILED"),
9564 Self::InProgress => std::option::Option::Some("IN_PROGRESS"),
9565 Self::UnknownValue(u) => u.0.name(),
9566 }
9567 }
9568 }
9569
9570 impl std::default::Default for TargetRenderState {
9571 fn default() -> Self {
9572 use std::convert::From;
9573 Self::from(0)
9574 }
9575 }
9576
9577 impl std::fmt::Display for TargetRenderState {
9578 fn fmt(
9579 &self,
9580 f: &mut std::fmt::Formatter<'_>,
9581 ) -> std::result::Result<(), std::fmt::Error> {
9582 wkt::internal::display_enum(f, self.name(), self.value())
9583 }
9584 }
9585
9586 impl std::convert::From<i32> for TargetRenderState {
9587 fn from(value: i32) -> Self {
9588 match value {
9589 0 => Self::Unspecified,
9590 1 => Self::Succeeded,
9591 2 => Self::Failed,
9592 3 => Self::InProgress,
9593 _ => Self::UnknownValue(target_render_state::UnknownValue(
9594 wkt::internal::UnknownEnumValue::Integer(value),
9595 )),
9596 }
9597 }
9598 }
9599
9600 impl std::convert::From<&str> for TargetRenderState {
9601 fn from(value: &str) -> Self {
9602 use std::string::ToString;
9603 match value {
9604 "TARGET_RENDER_STATE_UNSPECIFIED" => Self::Unspecified,
9605 "SUCCEEDED" => Self::Succeeded,
9606 "FAILED" => Self::Failed,
9607 "IN_PROGRESS" => Self::InProgress,
9608 _ => Self::UnknownValue(target_render_state::UnknownValue(
9609 wkt::internal::UnknownEnumValue::String(value.to_string()),
9610 )),
9611 }
9612 }
9613 }
9614
9615 impl serde::ser::Serialize for TargetRenderState {
9616 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9617 where
9618 S: serde::Serializer,
9619 {
9620 match self {
9621 Self::Unspecified => serializer.serialize_i32(0),
9622 Self::Succeeded => serializer.serialize_i32(1),
9623 Self::Failed => serializer.serialize_i32(2),
9624 Self::InProgress => serializer.serialize_i32(3),
9625 Self::UnknownValue(u) => u.0.serialize(serializer),
9626 }
9627 }
9628 }
9629
9630 impl<'de> serde::de::Deserialize<'de> for TargetRenderState {
9631 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9632 where
9633 D: serde::Deserializer<'de>,
9634 {
9635 deserializer.deserialize_any(wkt::internal::EnumVisitor::<TargetRenderState>::new(
9636 ".google.cloud.deploy.v1.Release.TargetRender.TargetRenderState",
9637 ))
9638 }
9639 }
9640
9641 /// Well-known rendering failures.
9642 ///
9643 /// # Working with unknown values
9644 ///
9645 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9646 /// additional enum variants at any time. Adding new variants is not considered
9647 /// a breaking change. Applications should write their code in anticipation of:
9648 ///
9649 /// - New values appearing in future releases of the client library, **and**
9650 /// - New values received dynamically, without application changes.
9651 ///
9652 /// Please consult the [Working with enums] section in the user guide for some
9653 /// guidelines.
9654 ///
9655 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
9656 #[derive(Clone, Debug, PartialEq)]
9657 #[non_exhaustive]
9658 pub enum FailureCause {
9659 /// No reason for failure is specified.
9660 Unspecified,
9661 /// Cloud Build is not available, either because it is not enabled or
9662 /// because Cloud Deploy has insufficient permissions. See [required
9663 /// permission](https://cloud.google.com/deploy/docs/cloud-deploy-service-account#required_permissions).
9664 CloudBuildUnavailable,
9665 /// The render operation did not complete successfully; check Cloud Build
9666 /// logs.
9667 ExecutionFailed,
9668 /// Cloud Build failed to fulfill Cloud Deploy's request. See
9669 /// failure_message for additional details.
9670 CloudBuildRequestFailed,
9671 /// The render operation did not complete successfully because the
9672 /// verification stanza required for verify was not found on the Skaffold
9673 /// configuration.
9674 VerificationConfigNotFound,
9675 /// The render operation did not complete successfully because the custom
9676 /// action(s) required for Rollout jobs were not found in the Skaffold
9677 /// configuration. See failure_message for additional details.
9678 CustomActionNotFound,
9679 /// Release failed during rendering because the release configuration is
9680 /// not supported with the specified deployment strategy.
9681 DeploymentStrategyNotSupported,
9682 /// The render operation had a feature configured that is not supported.
9683 RenderFeatureNotSupported,
9684 /// If set, the enum was initialized with an unknown value.
9685 ///
9686 /// Applications can examine the value using [FailureCause::value] or
9687 /// [FailureCause::name].
9688 UnknownValue(failure_cause::UnknownValue),
9689 }
9690
9691 #[doc(hidden)]
9692 pub mod failure_cause {
9693 #[allow(unused_imports)]
9694 use super::*;
9695 #[derive(Clone, Debug, PartialEq)]
9696 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9697 }
9698
9699 impl FailureCause {
9700 /// Gets the enum value.
9701 ///
9702 /// Returns `None` if the enum contains an unknown value deserialized from
9703 /// the string representation of enums.
9704 pub fn value(&self) -> std::option::Option<i32> {
9705 match self {
9706 Self::Unspecified => std::option::Option::Some(0),
9707 Self::CloudBuildUnavailable => std::option::Option::Some(1),
9708 Self::ExecutionFailed => std::option::Option::Some(2),
9709 Self::CloudBuildRequestFailed => std::option::Option::Some(3),
9710 Self::VerificationConfigNotFound => std::option::Option::Some(4),
9711 Self::CustomActionNotFound => std::option::Option::Some(5),
9712 Self::DeploymentStrategyNotSupported => std::option::Option::Some(6),
9713 Self::RenderFeatureNotSupported => std::option::Option::Some(7),
9714 Self::UnknownValue(u) => u.0.value(),
9715 }
9716 }
9717
9718 /// Gets the enum value as a string.
9719 ///
9720 /// Returns `None` if the enum contains an unknown value deserialized from
9721 /// the integer representation of enums.
9722 pub fn name(&self) -> std::option::Option<&str> {
9723 match self {
9724 Self::Unspecified => std::option::Option::Some("FAILURE_CAUSE_UNSPECIFIED"),
9725 Self::CloudBuildUnavailable => {
9726 std::option::Option::Some("CLOUD_BUILD_UNAVAILABLE")
9727 }
9728 Self::ExecutionFailed => std::option::Option::Some("EXECUTION_FAILED"),
9729 Self::CloudBuildRequestFailed => {
9730 std::option::Option::Some("CLOUD_BUILD_REQUEST_FAILED")
9731 }
9732 Self::VerificationConfigNotFound => {
9733 std::option::Option::Some("VERIFICATION_CONFIG_NOT_FOUND")
9734 }
9735 Self::CustomActionNotFound => {
9736 std::option::Option::Some("CUSTOM_ACTION_NOT_FOUND")
9737 }
9738 Self::DeploymentStrategyNotSupported => {
9739 std::option::Option::Some("DEPLOYMENT_STRATEGY_NOT_SUPPORTED")
9740 }
9741 Self::RenderFeatureNotSupported => {
9742 std::option::Option::Some("RENDER_FEATURE_NOT_SUPPORTED")
9743 }
9744 Self::UnknownValue(u) => u.0.name(),
9745 }
9746 }
9747 }
9748
9749 impl std::default::Default for FailureCause {
9750 fn default() -> Self {
9751 use std::convert::From;
9752 Self::from(0)
9753 }
9754 }
9755
9756 impl std::fmt::Display for FailureCause {
9757 fn fmt(
9758 &self,
9759 f: &mut std::fmt::Formatter<'_>,
9760 ) -> std::result::Result<(), std::fmt::Error> {
9761 wkt::internal::display_enum(f, self.name(), self.value())
9762 }
9763 }
9764
9765 impl std::convert::From<i32> for FailureCause {
9766 fn from(value: i32) -> Self {
9767 match value {
9768 0 => Self::Unspecified,
9769 1 => Self::CloudBuildUnavailable,
9770 2 => Self::ExecutionFailed,
9771 3 => Self::CloudBuildRequestFailed,
9772 4 => Self::VerificationConfigNotFound,
9773 5 => Self::CustomActionNotFound,
9774 6 => Self::DeploymentStrategyNotSupported,
9775 7 => Self::RenderFeatureNotSupported,
9776 _ => Self::UnknownValue(failure_cause::UnknownValue(
9777 wkt::internal::UnknownEnumValue::Integer(value),
9778 )),
9779 }
9780 }
9781 }
9782
9783 impl std::convert::From<&str> for FailureCause {
9784 fn from(value: &str) -> Self {
9785 use std::string::ToString;
9786 match value {
9787 "FAILURE_CAUSE_UNSPECIFIED" => Self::Unspecified,
9788 "CLOUD_BUILD_UNAVAILABLE" => Self::CloudBuildUnavailable,
9789 "EXECUTION_FAILED" => Self::ExecutionFailed,
9790 "CLOUD_BUILD_REQUEST_FAILED" => Self::CloudBuildRequestFailed,
9791 "VERIFICATION_CONFIG_NOT_FOUND" => Self::VerificationConfigNotFound,
9792 "CUSTOM_ACTION_NOT_FOUND" => Self::CustomActionNotFound,
9793 "DEPLOYMENT_STRATEGY_NOT_SUPPORTED" => Self::DeploymentStrategyNotSupported,
9794 "RENDER_FEATURE_NOT_SUPPORTED" => Self::RenderFeatureNotSupported,
9795 _ => Self::UnknownValue(failure_cause::UnknownValue(
9796 wkt::internal::UnknownEnumValue::String(value.to_string()),
9797 )),
9798 }
9799 }
9800 }
9801
9802 impl serde::ser::Serialize for FailureCause {
9803 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9804 where
9805 S: serde::Serializer,
9806 {
9807 match self {
9808 Self::Unspecified => serializer.serialize_i32(0),
9809 Self::CloudBuildUnavailable => serializer.serialize_i32(1),
9810 Self::ExecutionFailed => serializer.serialize_i32(2),
9811 Self::CloudBuildRequestFailed => serializer.serialize_i32(3),
9812 Self::VerificationConfigNotFound => serializer.serialize_i32(4),
9813 Self::CustomActionNotFound => serializer.serialize_i32(5),
9814 Self::DeploymentStrategyNotSupported => serializer.serialize_i32(6),
9815 Self::RenderFeatureNotSupported => serializer.serialize_i32(7),
9816 Self::UnknownValue(u) => u.0.serialize(serializer),
9817 }
9818 }
9819 }
9820
9821 impl<'de> serde::de::Deserialize<'de> for FailureCause {
9822 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9823 where
9824 D: serde::Deserializer<'de>,
9825 {
9826 deserializer.deserialize_any(wkt::internal::EnumVisitor::<FailureCause>::new(
9827 ".google.cloud.deploy.v1.Release.TargetRender.FailureCause",
9828 ))
9829 }
9830 }
9831 }
9832
9833 /// ReleaseReadyCondition contains information around the status of the
9834 /// Release. If a release is not ready, you cannot create a rollout with the
9835 /// release.
9836 #[derive(Clone, Default, PartialEq)]
9837 #[non_exhaustive]
9838 pub struct ReleaseReadyCondition {
9839 /// True if the Release is in a valid state. Otherwise at least one condition
9840 /// in `ReleaseCondition` is in an invalid state. Iterate over those
9841 /// conditions and see which condition(s) has status = false to find out what
9842 /// is wrong with the Release.
9843 pub status: bool,
9844
9845 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9846 }
9847
9848 impl ReleaseReadyCondition {
9849 pub fn new() -> Self {
9850 std::default::Default::default()
9851 }
9852
9853 /// Sets the value of [status][crate::model::release::ReleaseReadyCondition::status].
9854 ///
9855 /// # Example
9856 /// ```ignore,no_run
9857 /// # use google_cloud_deploy_v1::model::release::ReleaseReadyCondition;
9858 /// let x = ReleaseReadyCondition::new().set_status(true);
9859 /// ```
9860 pub fn set_status<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9861 self.status = v.into();
9862 self
9863 }
9864 }
9865
9866 impl wkt::message::Message for ReleaseReadyCondition {
9867 fn typename() -> &'static str {
9868 "type.googleapis.com/google.cloud.deploy.v1.Release.ReleaseReadyCondition"
9869 }
9870 }
9871
9872 /// SkaffoldSupportedCondition contains information about when support for the
9873 /// release's version of Skaffold ends.
9874 #[derive(Clone, Default, PartialEq)]
9875 #[non_exhaustive]
9876 pub struct SkaffoldSupportedCondition {
9877 /// True if the version of Skaffold used by this release is supported.
9878 pub status: bool,
9879
9880 /// The Skaffold support state for this release's version of Skaffold.
9881 pub skaffold_support_state: crate::model::SkaffoldSupportState,
9882
9883 /// The time at which this release's version of Skaffold will enter
9884 /// maintenance mode.
9885 pub maintenance_mode_time: std::option::Option<wkt::Timestamp>,
9886
9887 /// The time at which this release's version of Skaffold will no longer be
9888 /// supported.
9889 pub support_expiration_time: std::option::Option<wkt::Timestamp>,
9890
9891 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9892 }
9893
9894 impl SkaffoldSupportedCondition {
9895 pub fn new() -> Self {
9896 std::default::Default::default()
9897 }
9898
9899 /// Sets the value of [status][crate::model::release::SkaffoldSupportedCondition::status].
9900 ///
9901 /// # Example
9902 /// ```ignore,no_run
9903 /// # use google_cloud_deploy_v1::model::release::SkaffoldSupportedCondition;
9904 /// let x = SkaffoldSupportedCondition::new().set_status(true);
9905 /// ```
9906 pub fn set_status<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9907 self.status = v.into();
9908 self
9909 }
9910
9911 /// Sets the value of [skaffold_support_state][crate::model::release::SkaffoldSupportedCondition::skaffold_support_state].
9912 ///
9913 /// # Example
9914 /// ```ignore,no_run
9915 /// # use google_cloud_deploy_v1::model::release::SkaffoldSupportedCondition;
9916 /// use google_cloud_deploy_v1::model::SkaffoldSupportState;
9917 /// let x0 = SkaffoldSupportedCondition::new().set_skaffold_support_state(SkaffoldSupportState::Supported);
9918 /// let x1 = SkaffoldSupportedCondition::new().set_skaffold_support_state(SkaffoldSupportState::MaintenanceMode);
9919 /// let x2 = SkaffoldSupportedCondition::new().set_skaffold_support_state(SkaffoldSupportState::Unsupported);
9920 /// ```
9921 pub fn set_skaffold_support_state<
9922 T: std::convert::Into<crate::model::SkaffoldSupportState>,
9923 >(
9924 mut self,
9925 v: T,
9926 ) -> Self {
9927 self.skaffold_support_state = v.into();
9928 self
9929 }
9930
9931 /// Sets the value of [maintenance_mode_time][crate::model::release::SkaffoldSupportedCondition::maintenance_mode_time].
9932 ///
9933 /// # Example
9934 /// ```ignore,no_run
9935 /// # use google_cloud_deploy_v1::model::release::SkaffoldSupportedCondition;
9936 /// use wkt::Timestamp;
9937 /// let x = SkaffoldSupportedCondition::new().set_maintenance_mode_time(Timestamp::default()/* use setters */);
9938 /// ```
9939 pub fn set_maintenance_mode_time<T>(mut self, v: T) -> Self
9940 where
9941 T: std::convert::Into<wkt::Timestamp>,
9942 {
9943 self.maintenance_mode_time = std::option::Option::Some(v.into());
9944 self
9945 }
9946
9947 /// Sets or clears the value of [maintenance_mode_time][crate::model::release::SkaffoldSupportedCondition::maintenance_mode_time].
9948 ///
9949 /// # Example
9950 /// ```ignore,no_run
9951 /// # use google_cloud_deploy_v1::model::release::SkaffoldSupportedCondition;
9952 /// use wkt::Timestamp;
9953 /// let x = SkaffoldSupportedCondition::new().set_or_clear_maintenance_mode_time(Some(Timestamp::default()/* use setters */));
9954 /// let x = SkaffoldSupportedCondition::new().set_or_clear_maintenance_mode_time(None::<Timestamp>);
9955 /// ```
9956 pub fn set_or_clear_maintenance_mode_time<T>(mut self, v: std::option::Option<T>) -> Self
9957 where
9958 T: std::convert::Into<wkt::Timestamp>,
9959 {
9960 self.maintenance_mode_time = v.map(|x| x.into());
9961 self
9962 }
9963
9964 /// Sets the value of [support_expiration_time][crate::model::release::SkaffoldSupportedCondition::support_expiration_time].
9965 ///
9966 /// # Example
9967 /// ```ignore,no_run
9968 /// # use google_cloud_deploy_v1::model::release::SkaffoldSupportedCondition;
9969 /// use wkt::Timestamp;
9970 /// let x = SkaffoldSupportedCondition::new().set_support_expiration_time(Timestamp::default()/* use setters */);
9971 /// ```
9972 pub fn set_support_expiration_time<T>(mut self, v: T) -> Self
9973 where
9974 T: std::convert::Into<wkt::Timestamp>,
9975 {
9976 self.support_expiration_time = std::option::Option::Some(v.into());
9977 self
9978 }
9979
9980 /// Sets or clears the value of [support_expiration_time][crate::model::release::SkaffoldSupportedCondition::support_expiration_time].
9981 ///
9982 /// # Example
9983 /// ```ignore,no_run
9984 /// # use google_cloud_deploy_v1::model::release::SkaffoldSupportedCondition;
9985 /// use wkt::Timestamp;
9986 /// let x = SkaffoldSupportedCondition::new().set_or_clear_support_expiration_time(Some(Timestamp::default()/* use setters */));
9987 /// let x = SkaffoldSupportedCondition::new().set_or_clear_support_expiration_time(None::<Timestamp>);
9988 /// ```
9989 pub fn set_or_clear_support_expiration_time<T>(mut self, v: std::option::Option<T>) -> Self
9990 where
9991 T: std::convert::Into<wkt::Timestamp>,
9992 {
9993 self.support_expiration_time = v.map(|x| x.into());
9994 self
9995 }
9996 }
9997
9998 impl wkt::message::Message for SkaffoldSupportedCondition {
9999 fn typename() -> &'static str {
10000 "type.googleapis.com/google.cloud.deploy.v1.Release.SkaffoldSupportedCondition"
10001 }
10002 }
10003
10004 /// ReleaseCondition contains all conditions relevant to a Release.
10005 #[derive(Clone, Default, PartialEq)]
10006 #[non_exhaustive]
10007 pub struct ReleaseCondition {
10008 /// Details around the Releases's overall status.
10009 pub release_ready_condition:
10010 std::option::Option<crate::model::release::ReleaseReadyCondition>,
10011
10012 /// Details around the support state of the release's Skaffold
10013 /// version.
10014 pub skaffold_supported_condition:
10015 std::option::Option<crate::model::release::SkaffoldSupportedCondition>,
10016
10017 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10018 }
10019
10020 impl ReleaseCondition {
10021 pub fn new() -> Self {
10022 std::default::Default::default()
10023 }
10024
10025 /// Sets the value of [release_ready_condition][crate::model::release::ReleaseCondition::release_ready_condition].
10026 ///
10027 /// # Example
10028 /// ```ignore,no_run
10029 /// # use google_cloud_deploy_v1::model::release::ReleaseCondition;
10030 /// use google_cloud_deploy_v1::model::release::ReleaseReadyCondition;
10031 /// let x = ReleaseCondition::new().set_release_ready_condition(ReleaseReadyCondition::default()/* use setters */);
10032 /// ```
10033 pub fn set_release_ready_condition<T>(mut self, v: T) -> Self
10034 where
10035 T: std::convert::Into<crate::model::release::ReleaseReadyCondition>,
10036 {
10037 self.release_ready_condition = std::option::Option::Some(v.into());
10038 self
10039 }
10040
10041 /// Sets or clears the value of [release_ready_condition][crate::model::release::ReleaseCondition::release_ready_condition].
10042 ///
10043 /// # Example
10044 /// ```ignore,no_run
10045 /// # use google_cloud_deploy_v1::model::release::ReleaseCondition;
10046 /// use google_cloud_deploy_v1::model::release::ReleaseReadyCondition;
10047 /// let x = ReleaseCondition::new().set_or_clear_release_ready_condition(Some(ReleaseReadyCondition::default()/* use setters */));
10048 /// let x = ReleaseCondition::new().set_or_clear_release_ready_condition(None::<ReleaseReadyCondition>);
10049 /// ```
10050 pub fn set_or_clear_release_ready_condition<T>(mut self, v: std::option::Option<T>) -> Self
10051 where
10052 T: std::convert::Into<crate::model::release::ReleaseReadyCondition>,
10053 {
10054 self.release_ready_condition = v.map(|x| x.into());
10055 self
10056 }
10057
10058 /// Sets the value of [skaffold_supported_condition][crate::model::release::ReleaseCondition::skaffold_supported_condition].
10059 ///
10060 /// # Example
10061 /// ```ignore,no_run
10062 /// # use google_cloud_deploy_v1::model::release::ReleaseCondition;
10063 /// use google_cloud_deploy_v1::model::release::SkaffoldSupportedCondition;
10064 /// let x = ReleaseCondition::new().set_skaffold_supported_condition(SkaffoldSupportedCondition::default()/* use setters */);
10065 /// ```
10066 pub fn set_skaffold_supported_condition<T>(mut self, v: T) -> Self
10067 where
10068 T: std::convert::Into<crate::model::release::SkaffoldSupportedCondition>,
10069 {
10070 self.skaffold_supported_condition = std::option::Option::Some(v.into());
10071 self
10072 }
10073
10074 /// Sets or clears the value of [skaffold_supported_condition][crate::model::release::ReleaseCondition::skaffold_supported_condition].
10075 ///
10076 /// # Example
10077 /// ```ignore,no_run
10078 /// # use google_cloud_deploy_v1::model::release::ReleaseCondition;
10079 /// use google_cloud_deploy_v1::model::release::SkaffoldSupportedCondition;
10080 /// let x = ReleaseCondition::new().set_or_clear_skaffold_supported_condition(Some(SkaffoldSupportedCondition::default()/* use setters */));
10081 /// let x = ReleaseCondition::new().set_or_clear_skaffold_supported_condition(None::<SkaffoldSupportedCondition>);
10082 /// ```
10083 pub fn set_or_clear_skaffold_supported_condition<T>(
10084 mut self,
10085 v: std::option::Option<T>,
10086 ) -> Self
10087 where
10088 T: std::convert::Into<crate::model::release::SkaffoldSupportedCondition>,
10089 {
10090 self.skaffold_supported_condition = v.map(|x| x.into());
10091 self
10092 }
10093 }
10094
10095 impl wkt::message::Message for ReleaseCondition {
10096 fn typename() -> &'static str {
10097 "type.googleapis.com/google.cloud.deploy.v1.Release.ReleaseCondition"
10098 }
10099 }
10100
10101 /// Valid states of the render operation.
10102 ///
10103 /// # Working with unknown values
10104 ///
10105 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10106 /// additional enum variants at any time. Adding new variants is not considered
10107 /// a breaking change. Applications should write their code in anticipation of:
10108 ///
10109 /// - New values appearing in future releases of the client library, **and**
10110 /// - New values received dynamically, without application changes.
10111 ///
10112 /// Please consult the [Working with enums] section in the user guide for some
10113 /// guidelines.
10114 ///
10115 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
10116 #[derive(Clone, Debug, PartialEq)]
10117 #[non_exhaustive]
10118 pub enum RenderState {
10119 /// The render state is unspecified.
10120 Unspecified,
10121 /// All rendering operations have completed successfully.
10122 Succeeded,
10123 /// All rendering operations have completed, and one or more have failed.
10124 Failed,
10125 /// Rendering has started and is not complete.
10126 InProgress,
10127 /// If set, the enum was initialized with an unknown value.
10128 ///
10129 /// Applications can examine the value using [RenderState::value] or
10130 /// [RenderState::name].
10131 UnknownValue(render_state::UnknownValue),
10132 }
10133
10134 #[doc(hidden)]
10135 pub mod render_state {
10136 #[allow(unused_imports)]
10137 use super::*;
10138 #[derive(Clone, Debug, PartialEq)]
10139 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10140 }
10141
10142 impl RenderState {
10143 /// Gets the enum value.
10144 ///
10145 /// Returns `None` if the enum contains an unknown value deserialized from
10146 /// the string representation of enums.
10147 pub fn value(&self) -> std::option::Option<i32> {
10148 match self {
10149 Self::Unspecified => std::option::Option::Some(0),
10150 Self::Succeeded => std::option::Option::Some(1),
10151 Self::Failed => std::option::Option::Some(2),
10152 Self::InProgress => std::option::Option::Some(3),
10153 Self::UnknownValue(u) => u.0.value(),
10154 }
10155 }
10156
10157 /// Gets the enum value as a string.
10158 ///
10159 /// Returns `None` if the enum contains an unknown value deserialized from
10160 /// the integer representation of enums.
10161 pub fn name(&self) -> std::option::Option<&str> {
10162 match self {
10163 Self::Unspecified => std::option::Option::Some("RENDER_STATE_UNSPECIFIED"),
10164 Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
10165 Self::Failed => std::option::Option::Some("FAILED"),
10166 Self::InProgress => std::option::Option::Some("IN_PROGRESS"),
10167 Self::UnknownValue(u) => u.0.name(),
10168 }
10169 }
10170 }
10171
10172 impl std::default::Default for RenderState {
10173 fn default() -> Self {
10174 use std::convert::From;
10175 Self::from(0)
10176 }
10177 }
10178
10179 impl std::fmt::Display for RenderState {
10180 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10181 wkt::internal::display_enum(f, self.name(), self.value())
10182 }
10183 }
10184
10185 impl std::convert::From<i32> for RenderState {
10186 fn from(value: i32) -> Self {
10187 match value {
10188 0 => Self::Unspecified,
10189 1 => Self::Succeeded,
10190 2 => Self::Failed,
10191 3 => Self::InProgress,
10192 _ => Self::UnknownValue(render_state::UnknownValue(
10193 wkt::internal::UnknownEnumValue::Integer(value),
10194 )),
10195 }
10196 }
10197 }
10198
10199 impl std::convert::From<&str> for RenderState {
10200 fn from(value: &str) -> Self {
10201 use std::string::ToString;
10202 match value {
10203 "RENDER_STATE_UNSPECIFIED" => Self::Unspecified,
10204 "SUCCEEDED" => Self::Succeeded,
10205 "FAILED" => Self::Failed,
10206 "IN_PROGRESS" => Self::InProgress,
10207 _ => Self::UnknownValue(render_state::UnknownValue(
10208 wkt::internal::UnknownEnumValue::String(value.to_string()),
10209 )),
10210 }
10211 }
10212 }
10213
10214 impl serde::ser::Serialize for RenderState {
10215 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10216 where
10217 S: serde::Serializer,
10218 {
10219 match self {
10220 Self::Unspecified => serializer.serialize_i32(0),
10221 Self::Succeeded => serializer.serialize_i32(1),
10222 Self::Failed => serializer.serialize_i32(2),
10223 Self::InProgress => serializer.serialize_i32(3),
10224 Self::UnknownValue(u) => u.0.serialize(serializer),
10225 }
10226 }
10227 }
10228
10229 impl<'de> serde::de::Deserialize<'de> for RenderState {
10230 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10231 where
10232 D: serde::Deserializer<'de>,
10233 {
10234 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RenderState>::new(
10235 ".google.cloud.deploy.v1.Release.RenderState",
10236 ))
10237 }
10238 }
10239}
10240
10241/// The request object for `CreateDeployPolicy`.
10242#[derive(Clone, Default, PartialEq)]
10243#[non_exhaustive]
10244pub struct CreateDeployPolicyRequest {
10245 /// Required. The parent collection in which the `DeployPolicy` must be
10246 /// created. The format is `projects/{project_id}/locations/{location_name}`.
10247 pub parent: std::string::String,
10248
10249 /// Required. ID of the `DeployPolicy`.
10250 pub deploy_policy_id: std::string::String,
10251
10252 /// Required. The `DeployPolicy` to create.
10253 pub deploy_policy: std::option::Option<crate::model::DeployPolicy>,
10254
10255 /// Optional. A request ID to identify requests. Specify a unique request ID
10256 /// so that if you must retry your request, the server knows to ignore the
10257 /// request if it has already been completed. The server guarantees that for
10258 /// at least 60 minutes after the first request.
10259 ///
10260 /// For example, consider a situation where you make an initial request and the
10261 /// request times out. If you make the request again with the same request ID,
10262 /// the server can check if original operation with the same request ID was
10263 /// received, and if so, will ignore the second request. This prevents clients
10264 /// from accidentally creating duplicate commitments.
10265 ///
10266 /// The request ID must be a valid UUID with the exception that zero UUID is
10267 /// not supported (00000000-0000-0000-0000-000000000000).
10268 pub request_id: std::string::String,
10269
10270 /// Optional. If set to true, the request is validated and the user is provided
10271 /// with an expected result, but no actual change is made.
10272 pub validate_only: bool,
10273
10274 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10275}
10276
10277impl CreateDeployPolicyRequest {
10278 pub fn new() -> Self {
10279 std::default::Default::default()
10280 }
10281
10282 /// Sets the value of [parent][crate::model::CreateDeployPolicyRequest::parent].
10283 ///
10284 /// # Example
10285 /// ```ignore,no_run
10286 /// # use google_cloud_deploy_v1::model::CreateDeployPolicyRequest;
10287 /// let x = CreateDeployPolicyRequest::new().set_parent("example");
10288 /// ```
10289 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10290 self.parent = v.into();
10291 self
10292 }
10293
10294 /// Sets the value of [deploy_policy_id][crate::model::CreateDeployPolicyRequest::deploy_policy_id].
10295 ///
10296 /// # Example
10297 /// ```ignore,no_run
10298 /// # use google_cloud_deploy_v1::model::CreateDeployPolicyRequest;
10299 /// let x = CreateDeployPolicyRequest::new().set_deploy_policy_id("example");
10300 /// ```
10301 pub fn set_deploy_policy_id<T: std::convert::Into<std::string::String>>(
10302 mut self,
10303 v: T,
10304 ) -> Self {
10305 self.deploy_policy_id = v.into();
10306 self
10307 }
10308
10309 /// Sets the value of [deploy_policy][crate::model::CreateDeployPolicyRequest::deploy_policy].
10310 ///
10311 /// # Example
10312 /// ```ignore,no_run
10313 /// # use google_cloud_deploy_v1::model::CreateDeployPolicyRequest;
10314 /// use google_cloud_deploy_v1::model::DeployPolicy;
10315 /// let x = CreateDeployPolicyRequest::new().set_deploy_policy(DeployPolicy::default()/* use setters */);
10316 /// ```
10317 pub fn set_deploy_policy<T>(mut self, v: T) -> Self
10318 where
10319 T: std::convert::Into<crate::model::DeployPolicy>,
10320 {
10321 self.deploy_policy = std::option::Option::Some(v.into());
10322 self
10323 }
10324
10325 /// Sets or clears the value of [deploy_policy][crate::model::CreateDeployPolicyRequest::deploy_policy].
10326 ///
10327 /// # Example
10328 /// ```ignore,no_run
10329 /// # use google_cloud_deploy_v1::model::CreateDeployPolicyRequest;
10330 /// use google_cloud_deploy_v1::model::DeployPolicy;
10331 /// let x = CreateDeployPolicyRequest::new().set_or_clear_deploy_policy(Some(DeployPolicy::default()/* use setters */));
10332 /// let x = CreateDeployPolicyRequest::new().set_or_clear_deploy_policy(None::<DeployPolicy>);
10333 /// ```
10334 pub fn set_or_clear_deploy_policy<T>(mut self, v: std::option::Option<T>) -> Self
10335 where
10336 T: std::convert::Into<crate::model::DeployPolicy>,
10337 {
10338 self.deploy_policy = v.map(|x| x.into());
10339 self
10340 }
10341
10342 /// Sets the value of [request_id][crate::model::CreateDeployPolicyRequest::request_id].
10343 ///
10344 /// # Example
10345 /// ```ignore,no_run
10346 /// # use google_cloud_deploy_v1::model::CreateDeployPolicyRequest;
10347 /// let x = CreateDeployPolicyRequest::new().set_request_id("example");
10348 /// ```
10349 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10350 self.request_id = v.into();
10351 self
10352 }
10353
10354 /// Sets the value of [validate_only][crate::model::CreateDeployPolicyRequest::validate_only].
10355 ///
10356 /// # Example
10357 /// ```ignore,no_run
10358 /// # use google_cloud_deploy_v1::model::CreateDeployPolicyRequest;
10359 /// let x = CreateDeployPolicyRequest::new().set_validate_only(true);
10360 /// ```
10361 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10362 self.validate_only = v.into();
10363 self
10364 }
10365}
10366
10367impl wkt::message::Message for CreateDeployPolicyRequest {
10368 fn typename() -> &'static str {
10369 "type.googleapis.com/google.cloud.deploy.v1.CreateDeployPolicyRequest"
10370 }
10371}
10372
10373/// The request object for `UpdateDeployPolicy`.
10374#[derive(Clone, Default, PartialEq)]
10375#[non_exhaustive]
10376pub struct UpdateDeployPolicyRequest {
10377 /// Required. Field mask is used to specify the fields to be overwritten by the
10378 /// update in the `DeployPolicy` resource. The fields specified in the
10379 /// update_mask are relative to the resource, not the full request. A field
10380 /// will be overwritten if it's in the mask. If the user doesn't provide a mask
10381 /// then all fields are overwritten.
10382 pub update_mask: std::option::Option<wkt::FieldMask>,
10383
10384 /// Required. The `DeployPolicy` to update.
10385 pub deploy_policy: std::option::Option<crate::model::DeployPolicy>,
10386
10387 /// Optional. A request ID to identify requests. Specify a unique request ID
10388 /// so that if you must retry your request, the server knows to ignore the
10389 /// request if it has already been completed. The server guarantees that for
10390 /// at least 60 minutes after the first request.
10391 ///
10392 /// For example, consider a situation where you make an initial request and the
10393 /// request times out. If you make the request again with the same request ID,
10394 /// the server can check if original operation with the same request ID was
10395 /// received, and if so, will ignore the second request. This prevents clients
10396 /// from accidentally creating duplicate commitments.
10397 ///
10398 /// The request ID must be a valid UUID with the exception that zero UUID is
10399 /// not supported (00000000-0000-0000-0000-000000000000).
10400 pub request_id: std::string::String,
10401
10402 /// Optional. If set to true, updating a `DeployPolicy` that does not exist
10403 /// will result in the creation of a new `DeployPolicy`.
10404 pub allow_missing: bool,
10405
10406 /// Optional. If set to true, the request is validated and the user is provided
10407 /// with an expected result, but no actual change is made.
10408 pub validate_only: bool,
10409
10410 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10411}
10412
10413impl UpdateDeployPolicyRequest {
10414 pub fn new() -> Self {
10415 std::default::Default::default()
10416 }
10417
10418 /// Sets the value of [update_mask][crate::model::UpdateDeployPolicyRequest::update_mask].
10419 ///
10420 /// # Example
10421 /// ```ignore,no_run
10422 /// # use google_cloud_deploy_v1::model::UpdateDeployPolicyRequest;
10423 /// use wkt::FieldMask;
10424 /// let x = UpdateDeployPolicyRequest::new().set_update_mask(FieldMask::default()/* use setters */);
10425 /// ```
10426 pub fn set_update_mask<T>(mut self, v: T) -> Self
10427 where
10428 T: std::convert::Into<wkt::FieldMask>,
10429 {
10430 self.update_mask = std::option::Option::Some(v.into());
10431 self
10432 }
10433
10434 /// Sets or clears the value of [update_mask][crate::model::UpdateDeployPolicyRequest::update_mask].
10435 ///
10436 /// # Example
10437 /// ```ignore,no_run
10438 /// # use google_cloud_deploy_v1::model::UpdateDeployPolicyRequest;
10439 /// use wkt::FieldMask;
10440 /// let x = UpdateDeployPolicyRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
10441 /// let x = UpdateDeployPolicyRequest::new().set_or_clear_update_mask(None::<FieldMask>);
10442 /// ```
10443 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
10444 where
10445 T: std::convert::Into<wkt::FieldMask>,
10446 {
10447 self.update_mask = v.map(|x| x.into());
10448 self
10449 }
10450
10451 /// Sets the value of [deploy_policy][crate::model::UpdateDeployPolicyRequest::deploy_policy].
10452 ///
10453 /// # Example
10454 /// ```ignore,no_run
10455 /// # use google_cloud_deploy_v1::model::UpdateDeployPolicyRequest;
10456 /// use google_cloud_deploy_v1::model::DeployPolicy;
10457 /// let x = UpdateDeployPolicyRequest::new().set_deploy_policy(DeployPolicy::default()/* use setters */);
10458 /// ```
10459 pub fn set_deploy_policy<T>(mut self, v: T) -> Self
10460 where
10461 T: std::convert::Into<crate::model::DeployPolicy>,
10462 {
10463 self.deploy_policy = std::option::Option::Some(v.into());
10464 self
10465 }
10466
10467 /// Sets or clears the value of [deploy_policy][crate::model::UpdateDeployPolicyRequest::deploy_policy].
10468 ///
10469 /// # Example
10470 /// ```ignore,no_run
10471 /// # use google_cloud_deploy_v1::model::UpdateDeployPolicyRequest;
10472 /// use google_cloud_deploy_v1::model::DeployPolicy;
10473 /// let x = UpdateDeployPolicyRequest::new().set_or_clear_deploy_policy(Some(DeployPolicy::default()/* use setters */));
10474 /// let x = UpdateDeployPolicyRequest::new().set_or_clear_deploy_policy(None::<DeployPolicy>);
10475 /// ```
10476 pub fn set_or_clear_deploy_policy<T>(mut self, v: std::option::Option<T>) -> Self
10477 where
10478 T: std::convert::Into<crate::model::DeployPolicy>,
10479 {
10480 self.deploy_policy = v.map(|x| x.into());
10481 self
10482 }
10483
10484 /// Sets the value of [request_id][crate::model::UpdateDeployPolicyRequest::request_id].
10485 ///
10486 /// # Example
10487 /// ```ignore,no_run
10488 /// # use google_cloud_deploy_v1::model::UpdateDeployPolicyRequest;
10489 /// let x = UpdateDeployPolicyRequest::new().set_request_id("example");
10490 /// ```
10491 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10492 self.request_id = v.into();
10493 self
10494 }
10495
10496 /// Sets the value of [allow_missing][crate::model::UpdateDeployPolicyRequest::allow_missing].
10497 ///
10498 /// # Example
10499 /// ```ignore,no_run
10500 /// # use google_cloud_deploy_v1::model::UpdateDeployPolicyRequest;
10501 /// let x = UpdateDeployPolicyRequest::new().set_allow_missing(true);
10502 /// ```
10503 pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10504 self.allow_missing = v.into();
10505 self
10506 }
10507
10508 /// Sets the value of [validate_only][crate::model::UpdateDeployPolicyRequest::validate_only].
10509 ///
10510 /// # Example
10511 /// ```ignore,no_run
10512 /// # use google_cloud_deploy_v1::model::UpdateDeployPolicyRequest;
10513 /// let x = UpdateDeployPolicyRequest::new().set_validate_only(true);
10514 /// ```
10515 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10516 self.validate_only = v.into();
10517 self
10518 }
10519}
10520
10521impl wkt::message::Message for UpdateDeployPolicyRequest {
10522 fn typename() -> &'static str {
10523 "type.googleapis.com/google.cloud.deploy.v1.UpdateDeployPolicyRequest"
10524 }
10525}
10526
10527/// The request object for `DeleteDeployPolicy`.
10528#[derive(Clone, Default, PartialEq)]
10529#[non_exhaustive]
10530pub struct DeleteDeployPolicyRequest {
10531 /// Required. The name of the `DeployPolicy` to delete. The format is
10532 /// `projects/{project_id}/locations/{location_name}/deployPolicies/{deploy_policy_name}`.
10533 pub name: std::string::String,
10534
10535 /// Optional. A request ID to identify requests. Specify a unique request ID
10536 /// so that if you must retry your request, the server knows to ignore the
10537 /// request if it has already been completed. The server guarantees that for
10538 /// at least 60 minutes after the first request.
10539 ///
10540 /// For example, consider a situation where you make an initial request and the
10541 /// request times out. If you make the request again with the same request ID,
10542 /// the server can check if original operation with the same request ID was
10543 /// received, and if so, will ignore the second request. This prevents clients
10544 /// from accidentally creating duplicate commitments.
10545 ///
10546 /// The request ID must be a valid UUID with the exception that zero UUID is
10547 /// not supported (00000000-0000-0000-0000-000000000000).
10548 pub request_id: std::string::String,
10549
10550 /// Optional. If set to true, then deleting an already deleted or non-existing
10551 /// `DeployPolicy` will succeed.
10552 pub allow_missing: bool,
10553
10554 /// Optional. If set, validate the request and preview the review, but do not
10555 /// actually post it.
10556 pub validate_only: bool,
10557
10558 /// Optional. This checksum is computed by the server based on the value of
10559 /// other fields, and may be sent on update and delete requests to ensure the
10560 /// client has an up-to-date value before proceeding.
10561 pub etag: std::string::String,
10562
10563 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10564}
10565
10566impl DeleteDeployPolicyRequest {
10567 pub fn new() -> Self {
10568 std::default::Default::default()
10569 }
10570
10571 /// Sets the value of [name][crate::model::DeleteDeployPolicyRequest::name].
10572 ///
10573 /// # Example
10574 /// ```ignore,no_run
10575 /// # use google_cloud_deploy_v1::model::DeleteDeployPolicyRequest;
10576 /// let x = DeleteDeployPolicyRequest::new().set_name("example");
10577 /// ```
10578 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10579 self.name = v.into();
10580 self
10581 }
10582
10583 /// Sets the value of [request_id][crate::model::DeleteDeployPolicyRequest::request_id].
10584 ///
10585 /// # Example
10586 /// ```ignore,no_run
10587 /// # use google_cloud_deploy_v1::model::DeleteDeployPolicyRequest;
10588 /// let x = DeleteDeployPolicyRequest::new().set_request_id("example");
10589 /// ```
10590 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10591 self.request_id = v.into();
10592 self
10593 }
10594
10595 /// Sets the value of [allow_missing][crate::model::DeleteDeployPolicyRequest::allow_missing].
10596 ///
10597 /// # Example
10598 /// ```ignore,no_run
10599 /// # use google_cloud_deploy_v1::model::DeleteDeployPolicyRequest;
10600 /// let x = DeleteDeployPolicyRequest::new().set_allow_missing(true);
10601 /// ```
10602 pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10603 self.allow_missing = v.into();
10604 self
10605 }
10606
10607 /// Sets the value of [validate_only][crate::model::DeleteDeployPolicyRequest::validate_only].
10608 ///
10609 /// # Example
10610 /// ```ignore,no_run
10611 /// # use google_cloud_deploy_v1::model::DeleteDeployPolicyRequest;
10612 /// let x = DeleteDeployPolicyRequest::new().set_validate_only(true);
10613 /// ```
10614 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10615 self.validate_only = v.into();
10616 self
10617 }
10618
10619 /// Sets the value of [etag][crate::model::DeleteDeployPolicyRequest::etag].
10620 ///
10621 /// # Example
10622 /// ```ignore,no_run
10623 /// # use google_cloud_deploy_v1::model::DeleteDeployPolicyRequest;
10624 /// let x = DeleteDeployPolicyRequest::new().set_etag("example");
10625 /// ```
10626 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10627 self.etag = v.into();
10628 self
10629 }
10630}
10631
10632impl wkt::message::Message for DeleteDeployPolicyRequest {
10633 fn typename() -> &'static str {
10634 "type.googleapis.com/google.cloud.deploy.v1.DeleteDeployPolicyRequest"
10635 }
10636}
10637
10638/// The request object for `ListDeployPolicies`.
10639#[derive(Clone, Default, PartialEq)]
10640#[non_exhaustive]
10641pub struct ListDeployPoliciesRequest {
10642 /// Required. The parent, which owns this collection of deploy policies. Format
10643 /// must be `projects/{project_id}/locations/{location_name}`.
10644 pub parent: std::string::String,
10645
10646 /// The maximum number of deploy policies to return. The service may return
10647 /// fewer than this value. If unspecified, at most 50 deploy policies will
10648 /// be returned. The maximum value is 1000; values above 1000 will be set
10649 /// to 1000.
10650 pub page_size: i32,
10651
10652 /// A page token, received from a previous `ListDeployPolicies` call.
10653 /// Provide this to retrieve the subsequent page.
10654 ///
10655 /// When paginating, all other provided parameters match
10656 /// the call that provided the page token.
10657 pub page_token: std::string::String,
10658
10659 /// Filter deploy policies to be returned. See <https://google.aip.dev/160> for
10660 /// more details. All fields can be used in the filter.
10661 pub filter: std::string::String,
10662
10663 /// Field to sort by. See <https://google.aip.dev/132#ordering> for more details.
10664 pub order_by: std::string::String,
10665
10666 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10667}
10668
10669impl ListDeployPoliciesRequest {
10670 pub fn new() -> Self {
10671 std::default::Default::default()
10672 }
10673
10674 /// Sets the value of [parent][crate::model::ListDeployPoliciesRequest::parent].
10675 ///
10676 /// # Example
10677 /// ```ignore,no_run
10678 /// # use google_cloud_deploy_v1::model::ListDeployPoliciesRequest;
10679 /// let x = ListDeployPoliciesRequest::new().set_parent("example");
10680 /// ```
10681 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10682 self.parent = v.into();
10683 self
10684 }
10685
10686 /// Sets the value of [page_size][crate::model::ListDeployPoliciesRequest::page_size].
10687 ///
10688 /// # Example
10689 /// ```ignore,no_run
10690 /// # use google_cloud_deploy_v1::model::ListDeployPoliciesRequest;
10691 /// let x = ListDeployPoliciesRequest::new().set_page_size(42);
10692 /// ```
10693 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10694 self.page_size = v.into();
10695 self
10696 }
10697
10698 /// Sets the value of [page_token][crate::model::ListDeployPoliciesRequest::page_token].
10699 ///
10700 /// # Example
10701 /// ```ignore,no_run
10702 /// # use google_cloud_deploy_v1::model::ListDeployPoliciesRequest;
10703 /// let x = ListDeployPoliciesRequest::new().set_page_token("example");
10704 /// ```
10705 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10706 self.page_token = v.into();
10707 self
10708 }
10709
10710 /// Sets the value of [filter][crate::model::ListDeployPoliciesRequest::filter].
10711 ///
10712 /// # Example
10713 /// ```ignore,no_run
10714 /// # use google_cloud_deploy_v1::model::ListDeployPoliciesRequest;
10715 /// let x = ListDeployPoliciesRequest::new().set_filter("example");
10716 /// ```
10717 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10718 self.filter = v.into();
10719 self
10720 }
10721
10722 /// Sets the value of [order_by][crate::model::ListDeployPoliciesRequest::order_by].
10723 ///
10724 /// # Example
10725 /// ```ignore,no_run
10726 /// # use google_cloud_deploy_v1::model::ListDeployPoliciesRequest;
10727 /// let x = ListDeployPoliciesRequest::new().set_order_by("example");
10728 /// ```
10729 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10730 self.order_by = v.into();
10731 self
10732 }
10733}
10734
10735impl wkt::message::Message for ListDeployPoliciesRequest {
10736 fn typename() -> &'static str {
10737 "type.googleapis.com/google.cloud.deploy.v1.ListDeployPoliciesRequest"
10738 }
10739}
10740
10741/// The response object from `ListDeployPolicies`.
10742#[derive(Clone, Default, PartialEq)]
10743#[non_exhaustive]
10744pub struct ListDeployPoliciesResponse {
10745 /// The `DeployPolicy` objects.
10746 pub deploy_policies: std::vec::Vec<crate::model::DeployPolicy>,
10747
10748 /// A token, which can be sent as `page_token` to retrieve the next page.
10749 /// If this field is omitted, there are no subsequent pages.
10750 pub next_page_token: std::string::String,
10751
10752 /// Locations that could not be reached.
10753 pub unreachable: std::vec::Vec<std::string::String>,
10754
10755 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10756}
10757
10758impl ListDeployPoliciesResponse {
10759 pub fn new() -> Self {
10760 std::default::Default::default()
10761 }
10762
10763 /// Sets the value of [deploy_policies][crate::model::ListDeployPoliciesResponse::deploy_policies].
10764 ///
10765 /// # Example
10766 /// ```ignore,no_run
10767 /// # use google_cloud_deploy_v1::model::ListDeployPoliciesResponse;
10768 /// use google_cloud_deploy_v1::model::DeployPolicy;
10769 /// let x = ListDeployPoliciesResponse::new()
10770 /// .set_deploy_policies([
10771 /// DeployPolicy::default()/* use setters */,
10772 /// DeployPolicy::default()/* use (different) setters */,
10773 /// ]);
10774 /// ```
10775 pub fn set_deploy_policies<T, V>(mut self, v: T) -> Self
10776 where
10777 T: std::iter::IntoIterator<Item = V>,
10778 V: std::convert::Into<crate::model::DeployPolicy>,
10779 {
10780 use std::iter::Iterator;
10781 self.deploy_policies = v.into_iter().map(|i| i.into()).collect();
10782 self
10783 }
10784
10785 /// Sets the value of [next_page_token][crate::model::ListDeployPoliciesResponse::next_page_token].
10786 ///
10787 /// # Example
10788 /// ```ignore,no_run
10789 /// # use google_cloud_deploy_v1::model::ListDeployPoliciesResponse;
10790 /// let x = ListDeployPoliciesResponse::new().set_next_page_token("example");
10791 /// ```
10792 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10793 self.next_page_token = v.into();
10794 self
10795 }
10796
10797 /// Sets the value of [unreachable][crate::model::ListDeployPoliciesResponse::unreachable].
10798 ///
10799 /// # Example
10800 /// ```ignore,no_run
10801 /// # use google_cloud_deploy_v1::model::ListDeployPoliciesResponse;
10802 /// let x = ListDeployPoliciesResponse::new().set_unreachable(["a", "b", "c"]);
10803 /// ```
10804 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
10805 where
10806 T: std::iter::IntoIterator<Item = V>,
10807 V: std::convert::Into<std::string::String>,
10808 {
10809 use std::iter::Iterator;
10810 self.unreachable = v.into_iter().map(|i| i.into()).collect();
10811 self
10812 }
10813}
10814
10815impl wkt::message::Message for ListDeployPoliciesResponse {
10816 fn typename() -> &'static str {
10817 "type.googleapis.com/google.cloud.deploy.v1.ListDeployPoliciesResponse"
10818 }
10819}
10820
10821#[doc(hidden)]
10822impl google_cloud_gax::paginator::internal::PageableResponse for ListDeployPoliciesResponse {
10823 type PageItem = crate::model::DeployPolicy;
10824
10825 fn items(self) -> std::vec::Vec<Self::PageItem> {
10826 self.deploy_policies
10827 }
10828
10829 fn next_page_token(&self) -> std::string::String {
10830 use std::clone::Clone;
10831 self.next_page_token.clone()
10832 }
10833}
10834
10835/// The request object for `GetDeployPolicy`
10836#[derive(Clone, Default, PartialEq)]
10837#[non_exhaustive]
10838pub struct GetDeployPolicyRequest {
10839 /// Required. Name of the `DeployPolicy`. Format must be
10840 /// `projects/{project_id}/locations/{location_name}/deployPolicies/{deploy_policy_name}`.
10841 pub name: std::string::String,
10842
10843 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10844}
10845
10846impl GetDeployPolicyRequest {
10847 pub fn new() -> Self {
10848 std::default::Default::default()
10849 }
10850
10851 /// Sets the value of [name][crate::model::GetDeployPolicyRequest::name].
10852 ///
10853 /// # Example
10854 /// ```ignore,no_run
10855 /// # use google_cloud_deploy_v1::model::GetDeployPolicyRequest;
10856 /// let x = GetDeployPolicyRequest::new().set_name("example");
10857 /// ```
10858 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10859 self.name = v.into();
10860 self
10861 }
10862}
10863
10864impl wkt::message::Message for GetDeployPolicyRequest {
10865 fn typename() -> &'static str {
10866 "type.googleapis.com/google.cloud.deploy.v1.GetDeployPolicyRequest"
10867 }
10868}
10869
10870/// Description of an a image to use during Skaffold rendering.
10871#[derive(Clone, Default, PartialEq)]
10872#[non_exhaustive]
10873pub struct BuildArtifact {
10874 /// Optional. Image name in Skaffold configuration.
10875 pub image: std::string::String,
10876
10877 /// Optional. Image tag to use. This will generally be the full path to an
10878 /// image, such as "gcr.io/my-project/busybox:1.2.3" or
10879 /// "gcr.io/my-project/busybox@sha256:abc123".
10880 pub tag: std::string::String,
10881
10882 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10883}
10884
10885impl BuildArtifact {
10886 pub fn new() -> Self {
10887 std::default::Default::default()
10888 }
10889
10890 /// Sets the value of [image][crate::model::BuildArtifact::image].
10891 ///
10892 /// # Example
10893 /// ```ignore,no_run
10894 /// # use google_cloud_deploy_v1::model::BuildArtifact;
10895 /// let x = BuildArtifact::new().set_image("example");
10896 /// ```
10897 pub fn set_image<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10898 self.image = v.into();
10899 self
10900 }
10901
10902 /// Sets the value of [tag][crate::model::BuildArtifact::tag].
10903 ///
10904 /// # Example
10905 /// ```ignore,no_run
10906 /// # use google_cloud_deploy_v1::model::BuildArtifact;
10907 /// let x = BuildArtifact::new().set_tag("example");
10908 /// ```
10909 pub fn set_tag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10910 self.tag = v.into();
10911 self
10912 }
10913}
10914
10915impl wkt::message::Message for BuildArtifact {
10916 fn typename() -> &'static str {
10917 "type.googleapis.com/google.cloud.deploy.v1.BuildArtifact"
10918 }
10919}
10920
10921/// The artifacts produced by a target render operation.
10922#[derive(Clone, Default, PartialEq)]
10923#[non_exhaustive]
10924pub struct TargetArtifact {
10925 /// Output only. File path of the resolved Skaffold configuration for the
10926 /// stable phase, relative to the URI.
10927 pub skaffold_config_path: std::string::String,
10928
10929 /// Output only. File path of the rendered manifest relative to the URI for the
10930 /// stable phase.
10931 pub manifest_path: std::string::String,
10932
10933 /// Output only. Map from the phase ID to the phase artifacts for the `Target`.
10934 pub phase_artifacts: std::collections::HashMap<
10935 std::string::String,
10936 crate::model::target_artifact::PhaseArtifact,
10937 >,
10938
10939 pub uri: std::option::Option<crate::model::target_artifact::Uri>,
10940
10941 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10942}
10943
10944impl TargetArtifact {
10945 pub fn new() -> Self {
10946 std::default::Default::default()
10947 }
10948
10949 /// Sets the value of [skaffold_config_path][crate::model::TargetArtifact::skaffold_config_path].
10950 ///
10951 /// # Example
10952 /// ```ignore,no_run
10953 /// # use google_cloud_deploy_v1::model::TargetArtifact;
10954 /// let x = TargetArtifact::new().set_skaffold_config_path("example");
10955 /// ```
10956 pub fn set_skaffold_config_path<T: std::convert::Into<std::string::String>>(
10957 mut self,
10958 v: T,
10959 ) -> Self {
10960 self.skaffold_config_path = v.into();
10961 self
10962 }
10963
10964 /// Sets the value of [manifest_path][crate::model::TargetArtifact::manifest_path].
10965 ///
10966 /// # Example
10967 /// ```ignore,no_run
10968 /// # use google_cloud_deploy_v1::model::TargetArtifact;
10969 /// let x = TargetArtifact::new().set_manifest_path("example");
10970 /// ```
10971 pub fn set_manifest_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10972 self.manifest_path = v.into();
10973 self
10974 }
10975
10976 /// Sets the value of [phase_artifacts][crate::model::TargetArtifact::phase_artifacts].
10977 ///
10978 /// # Example
10979 /// ```ignore,no_run
10980 /// # use google_cloud_deploy_v1::model::TargetArtifact;
10981 /// use google_cloud_deploy_v1::model::target_artifact::PhaseArtifact;
10982 /// let x = TargetArtifact::new().set_phase_artifacts([
10983 /// ("key0", PhaseArtifact::default()/* use setters */),
10984 /// ("key1", PhaseArtifact::default()/* use (different) setters */),
10985 /// ]);
10986 /// ```
10987 pub fn set_phase_artifacts<T, K, V>(mut self, v: T) -> Self
10988 where
10989 T: std::iter::IntoIterator<Item = (K, V)>,
10990 K: std::convert::Into<std::string::String>,
10991 V: std::convert::Into<crate::model::target_artifact::PhaseArtifact>,
10992 {
10993 use std::iter::Iterator;
10994 self.phase_artifacts = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
10995 self
10996 }
10997
10998 /// Sets the value of [uri][crate::model::TargetArtifact::uri].
10999 ///
11000 /// Note that all the setters affecting `uri` are mutually
11001 /// exclusive.
11002 ///
11003 /// # Example
11004 /// ```ignore,no_run
11005 /// # use google_cloud_deploy_v1::model::TargetArtifact;
11006 /// use google_cloud_deploy_v1::model::target_artifact::Uri;
11007 /// let x = TargetArtifact::new().set_uri(Some(Uri::ArtifactUri("example".to_string())));
11008 /// ```
11009 pub fn set_uri<
11010 T: std::convert::Into<std::option::Option<crate::model::target_artifact::Uri>>,
11011 >(
11012 mut self,
11013 v: T,
11014 ) -> Self {
11015 self.uri = v.into();
11016 self
11017 }
11018
11019 /// The value of [uri][crate::model::TargetArtifact::uri]
11020 /// if it holds a `ArtifactUri`, `None` if the field is not set or
11021 /// holds a different branch.
11022 pub fn artifact_uri(&self) -> std::option::Option<&std::string::String> {
11023 #[allow(unreachable_patterns)]
11024 self.uri.as_ref().and_then(|v| match v {
11025 crate::model::target_artifact::Uri::ArtifactUri(v) => std::option::Option::Some(v),
11026 _ => std::option::Option::None,
11027 })
11028 }
11029
11030 /// Sets the value of [uri][crate::model::TargetArtifact::uri]
11031 /// to hold a `ArtifactUri`.
11032 ///
11033 /// Note that all the setters affecting `uri` are
11034 /// mutually exclusive.
11035 ///
11036 /// # Example
11037 /// ```ignore,no_run
11038 /// # use google_cloud_deploy_v1::model::TargetArtifact;
11039 /// let x = TargetArtifact::new().set_artifact_uri("example");
11040 /// assert!(x.artifact_uri().is_some());
11041 /// ```
11042 pub fn set_artifact_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11043 self.uri =
11044 std::option::Option::Some(crate::model::target_artifact::Uri::ArtifactUri(v.into()));
11045 self
11046 }
11047}
11048
11049impl wkt::message::Message for TargetArtifact {
11050 fn typename() -> &'static str {
11051 "type.googleapis.com/google.cloud.deploy.v1.TargetArtifact"
11052 }
11053}
11054
11055/// Defines additional types related to [TargetArtifact].
11056pub mod target_artifact {
11057 #[allow(unused_imports)]
11058 use super::*;
11059
11060 /// Contains the paths to the artifacts, relative to the URI, for a phase.
11061 #[derive(Clone, Default, PartialEq)]
11062 #[non_exhaustive]
11063 pub struct PhaseArtifact {
11064 /// Output only. File path of the resolved Skaffold configuration relative to
11065 /// the URI.
11066 pub skaffold_config_path: std::string::String,
11067
11068 /// Output only. File path of the rendered manifest relative to the URI.
11069 pub manifest_path: std::string::String,
11070
11071 /// Output only. File path of the directory of rendered job manifests
11072 /// relative to the URI. This is only set if it is applicable.
11073 pub job_manifests_path: std::string::String,
11074
11075 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11076 }
11077
11078 impl PhaseArtifact {
11079 pub fn new() -> Self {
11080 std::default::Default::default()
11081 }
11082
11083 /// Sets the value of [skaffold_config_path][crate::model::target_artifact::PhaseArtifact::skaffold_config_path].
11084 ///
11085 /// # Example
11086 /// ```ignore,no_run
11087 /// # use google_cloud_deploy_v1::model::target_artifact::PhaseArtifact;
11088 /// let x = PhaseArtifact::new().set_skaffold_config_path("example");
11089 /// ```
11090 pub fn set_skaffold_config_path<T: std::convert::Into<std::string::String>>(
11091 mut self,
11092 v: T,
11093 ) -> Self {
11094 self.skaffold_config_path = v.into();
11095 self
11096 }
11097
11098 /// Sets the value of [manifest_path][crate::model::target_artifact::PhaseArtifact::manifest_path].
11099 ///
11100 /// # Example
11101 /// ```ignore,no_run
11102 /// # use google_cloud_deploy_v1::model::target_artifact::PhaseArtifact;
11103 /// let x = PhaseArtifact::new().set_manifest_path("example");
11104 /// ```
11105 pub fn set_manifest_path<T: std::convert::Into<std::string::String>>(
11106 mut self,
11107 v: T,
11108 ) -> Self {
11109 self.manifest_path = v.into();
11110 self
11111 }
11112
11113 /// Sets the value of [job_manifests_path][crate::model::target_artifact::PhaseArtifact::job_manifests_path].
11114 ///
11115 /// # Example
11116 /// ```ignore,no_run
11117 /// # use google_cloud_deploy_v1::model::target_artifact::PhaseArtifact;
11118 /// let x = PhaseArtifact::new().set_job_manifests_path("example");
11119 /// ```
11120 pub fn set_job_manifests_path<T: std::convert::Into<std::string::String>>(
11121 mut self,
11122 v: T,
11123 ) -> Self {
11124 self.job_manifests_path = v.into();
11125 self
11126 }
11127 }
11128
11129 impl wkt::message::Message for PhaseArtifact {
11130 fn typename() -> &'static str {
11131 "type.googleapis.com/google.cloud.deploy.v1.TargetArtifact.PhaseArtifact"
11132 }
11133 }
11134
11135 #[derive(Clone, Debug, PartialEq)]
11136 #[non_exhaustive]
11137 pub enum Uri {
11138 /// Output only. URI of a directory containing the artifacts. This contains
11139 /// deployment configuration used by Skaffold during a rollout, and all
11140 /// paths are relative to this location.
11141 ArtifactUri(std::string::String),
11142 }
11143}
11144
11145/// The artifacts produced by a deploy operation.
11146#[derive(Clone, Default, PartialEq)]
11147#[non_exhaustive]
11148pub struct DeployArtifact {
11149 /// Output only. URI of a directory containing the artifacts. All paths are
11150 /// relative to this location.
11151 pub artifact_uri: std::string::String,
11152
11153 /// Output only. File paths of the manifests applied during the deploy
11154 /// operation relative to the URI.
11155 pub manifest_paths: std::vec::Vec<std::string::String>,
11156
11157 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11158}
11159
11160impl DeployArtifact {
11161 pub fn new() -> Self {
11162 std::default::Default::default()
11163 }
11164
11165 /// Sets the value of [artifact_uri][crate::model::DeployArtifact::artifact_uri].
11166 ///
11167 /// # Example
11168 /// ```ignore,no_run
11169 /// # use google_cloud_deploy_v1::model::DeployArtifact;
11170 /// let x = DeployArtifact::new().set_artifact_uri("example");
11171 /// ```
11172 pub fn set_artifact_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11173 self.artifact_uri = v.into();
11174 self
11175 }
11176
11177 /// Sets the value of [manifest_paths][crate::model::DeployArtifact::manifest_paths].
11178 ///
11179 /// # Example
11180 /// ```ignore,no_run
11181 /// # use google_cloud_deploy_v1::model::DeployArtifact;
11182 /// let x = DeployArtifact::new().set_manifest_paths(["a", "b", "c"]);
11183 /// ```
11184 pub fn set_manifest_paths<T, V>(mut self, v: T) -> Self
11185 where
11186 T: std::iter::IntoIterator<Item = V>,
11187 V: std::convert::Into<std::string::String>,
11188 {
11189 use std::iter::Iterator;
11190 self.manifest_paths = v.into_iter().map(|i| i.into()).collect();
11191 self
11192 }
11193}
11194
11195impl wkt::message::Message for DeployArtifact {
11196 fn typename() -> &'static str {
11197 "type.googleapis.com/google.cloud.deploy.v1.DeployArtifact"
11198 }
11199}
11200
11201/// CloudRunRenderMetadata contains Cloud Run information associated with a
11202/// `Release` render.
11203#[derive(Clone, Default, PartialEq)]
11204#[non_exhaustive]
11205pub struct CloudRunRenderMetadata {
11206 /// Output only. The name of the Cloud Run Service in the rendered manifest.
11207 /// Format is `projects/{project}/locations/{location}/services/{service}`.
11208 pub service: std::string::String,
11209
11210 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11211}
11212
11213impl CloudRunRenderMetadata {
11214 pub fn new() -> Self {
11215 std::default::Default::default()
11216 }
11217
11218 /// Sets the value of [service][crate::model::CloudRunRenderMetadata::service].
11219 ///
11220 /// # Example
11221 /// ```ignore,no_run
11222 /// # use google_cloud_deploy_v1::model::CloudRunRenderMetadata;
11223 /// let x = CloudRunRenderMetadata::new().set_service("example");
11224 /// ```
11225 pub fn set_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11226 self.service = v.into();
11227 self
11228 }
11229}
11230
11231impl wkt::message::Message for CloudRunRenderMetadata {
11232 fn typename() -> &'static str {
11233 "type.googleapis.com/google.cloud.deploy.v1.CloudRunRenderMetadata"
11234 }
11235}
11236
11237/// RenderMetadata includes information associated with a `Release` render.
11238#[derive(Clone, Default, PartialEq)]
11239#[non_exhaustive]
11240pub struct RenderMetadata {
11241 /// Output only. Metadata associated with rendering for Cloud Run.
11242 pub cloud_run: std::option::Option<crate::model::CloudRunRenderMetadata>,
11243
11244 /// Output only. Custom metadata provided by user-defined render operation.
11245 pub custom: std::option::Option<crate::model::CustomMetadata>,
11246
11247 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11248}
11249
11250impl RenderMetadata {
11251 pub fn new() -> Self {
11252 std::default::Default::default()
11253 }
11254
11255 /// Sets the value of [cloud_run][crate::model::RenderMetadata::cloud_run].
11256 ///
11257 /// # Example
11258 /// ```ignore,no_run
11259 /// # use google_cloud_deploy_v1::model::RenderMetadata;
11260 /// use google_cloud_deploy_v1::model::CloudRunRenderMetadata;
11261 /// let x = RenderMetadata::new().set_cloud_run(CloudRunRenderMetadata::default()/* use setters */);
11262 /// ```
11263 pub fn set_cloud_run<T>(mut self, v: T) -> Self
11264 where
11265 T: std::convert::Into<crate::model::CloudRunRenderMetadata>,
11266 {
11267 self.cloud_run = std::option::Option::Some(v.into());
11268 self
11269 }
11270
11271 /// Sets or clears the value of [cloud_run][crate::model::RenderMetadata::cloud_run].
11272 ///
11273 /// # Example
11274 /// ```ignore,no_run
11275 /// # use google_cloud_deploy_v1::model::RenderMetadata;
11276 /// use google_cloud_deploy_v1::model::CloudRunRenderMetadata;
11277 /// let x = RenderMetadata::new().set_or_clear_cloud_run(Some(CloudRunRenderMetadata::default()/* use setters */));
11278 /// let x = RenderMetadata::new().set_or_clear_cloud_run(None::<CloudRunRenderMetadata>);
11279 /// ```
11280 pub fn set_or_clear_cloud_run<T>(mut self, v: std::option::Option<T>) -> Self
11281 where
11282 T: std::convert::Into<crate::model::CloudRunRenderMetadata>,
11283 {
11284 self.cloud_run = v.map(|x| x.into());
11285 self
11286 }
11287
11288 /// Sets the value of [custom][crate::model::RenderMetadata::custom].
11289 ///
11290 /// # Example
11291 /// ```ignore,no_run
11292 /// # use google_cloud_deploy_v1::model::RenderMetadata;
11293 /// use google_cloud_deploy_v1::model::CustomMetadata;
11294 /// let x = RenderMetadata::new().set_custom(CustomMetadata::default()/* use setters */);
11295 /// ```
11296 pub fn set_custom<T>(mut self, v: T) -> Self
11297 where
11298 T: std::convert::Into<crate::model::CustomMetadata>,
11299 {
11300 self.custom = std::option::Option::Some(v.into());
11301 self
11302 }
11303
11304 /// Sets or clears the value of [custom][crate::model::RenderMetadata::custom].
11305 ///
11306 /// # Example
11307 /// ```ignore,no_run
11308 /// # use google_cloud_deploy_v1::model::RenderMetadata;
11309 /// use google_cloud_deploy_v1::model::CustomMetadata;
11310 /// let x = RenderMetadata::new().set_or_clear_custom(Some(CustomMetadata::default()/* use setters */));
11311 /// let x = RenderMetadata::new().set_or_clear_custom(None::<CustomMetadata>);
11312 /// ```
11313 pub fn set_or_clear_custom<T>(mut self, v: std::option::Option<T>) -> Self
11314 where
11315 T: std::convert::Into<crate::model::CustomMetadata>,
11316 {
11317 self.custom = v.map(|x| x.into());
11318 self
11319 }
11320}
11321
11322impl wkt::message::Message for RenderMetadata {
11323 fn typename() -> &'static str {
11324 "type.googleapis.com/google.cloud.deploy.v1.RenderMetadata"
11325 }
11326}
11327
11328/// The request object for `ListReleases`.
11329#[derive(Clone, Default, PartialEq)]
11330#[non_exhaustive]
11331pub struct ListReleasesRequest {
11332 /// Required. The `DeliveryPipeline` which owns this collection of `Release`
11333 /// objects.
11334 pub parent: std::string::String,
11335
11336 /// Optional. The maximum number of `Release` objects to return. The service
11337 /// may return fewer than this value. If unspecified, at most 50 `Release`
11338 /// objects will be returned. The maximum value is 1000; values above 1000 will
11339 /// be set to 1000.
11340 pub page_size: i32,
11341
11342 /// Optional. A page token, received from a previous `ListReleases` call.
11343 /// Provide this to retrieve the subsequent page.
11344 ///
11345 /// When paginating, all other provided parameters match
11346 /// the call that provided the page token.
11347 pub page_token: std::string::String,
11348
11349 /// Optional. Filter releases to be returned. See <https://google.aip.dev/160>
11350 /// for more details.
11351 pub filter: std::string::String,
11352
11353 /// Optional. Field to sort by. See <https://google.aip.dev/132#ordering> for
11354 /// more details.
11355 pub order_by: std::string::String,
11356
11357 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11358}
11359
11360impl ListReleasesRequest {
11361 pub fn new() -> Self {
11362 std::default::Default::default()
11363 }
11364
11365 /// Sets the value of [parent][crate::model::ListReleasesRequest::parent].
11366 ///
11367 /// # Example
11368 /// ```ignore,no_run
11369 /// # use google_cloud_deploy_v1::model::ListReleasesRequest;
11370 /// let x = ListReleasesRequest::new().set_parent("example");
11371 /// ```
11372 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11373 self.parent = v.into();
11374 self
11375 }
11376
11377 /// Sets the value of [page_size][crate::model::ListReleasesRequest::page_size].
11378 ///
11379 /// # Example
11380 /// ```ignore,no_run
11381 /// # use google_cloud_deploy_v1::model::ListReleasesRequest;
11382 /// let x = ListReleasesRequest::new().set_page_size(42);
11383 /// ```
11384 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11385 self.page_size = v.into();
11386 self
11387 }
11388
11389 /// Sets the value of [page_token][crate::model::ListReleasesRequest::page_token].
11390 ///
11391 /// # Example
11392 /// ```ignore,no_run
11393 /// # use google_cloud_deploy_v1::model::ListReleasesRequest;
11394 /// let x = ListReleasesRequest::new().set_page_token("example");
11395 /// ```
11396 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11397 self.page_token = v.into();
11398 self
11399 }
11400
11401 /// Sets the value of [filter][crate::model::ListReleasesRequest::filter].
11402 ///
11403 /// # Example
11404 /// ```ignore,no_run
11405 /// # use google_cloud_deploy_v1::model::ListReleasesRequest;
11406 /// let x = ListReleasesRequest::new().set_filter("example");
11407 /// ```
11408 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11409 self.filter = v.into();
11410 self
11411 }
11412
11413 /// Sets the value of [order_by][crate::model::ListReleasesRequest::order_by].
11414 ///
11415 /// # Example
11416 /// ```ignore,no_run
11417 /// # use google_cloud_deploy_v1::model::ListReleasesRequest;
11418 /// let x = ListReleasesRequest::new().set_order_by("example");
11419 /// ```
11420 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11421 self.order_by = v.into();
11422 self
11423 }
11424}
11425
11426impl wkt::message::Message for ListReleasesRequest {
11427 fn typename() -> &'static str {
11428 "type.googleapis.com/google.cloud.deploy.v1.ListReleasesRequest"
11429 }
11430}
11431
11432/// The response object from `ListReleases`.
11433#[derive(Clone, Default, PartialEq)]
11434#[non_exhaustive]
11435pub struct ListReleasesResponse {
11436 /// The `Release` objects.
11437 pub releases: std::vec::Vec<crate::model::Release>,
11438
11439 /// A token, which can be sent as `page_token` to retrieve the next page.
11440 /// If this field is omitted, there are no subsequent pages.
11441 pub next_page_token: std::string::String,
11442
11443 /// Locations that could not be reached.
11444 pub unreachable: std::vec::Vec<std::string::String>,
11445
11446 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11447}
11448
11449impl ListReleasesResponse {
11450 pub fn new() -> Self {
11451 std::default::Default::default()
11452 }
11453
11454 /// Sets the value of [releases][crate::model::ListReleasesResponse::releases].
11455 ///
11456 /// # Example
11457 /// ```ignore,no_run
11458 /// # use google_cloud_deploy_v1::model::ListReleasesResponse;
11459 /// use google_cloud_deploy_v1::model::Release;
11460 /// let x = ListReleasesResponse::new()
11461 /// .set_releases([
11462 /// Release::default()/* use setters */,
11463 /// Release::default()/* use (different) setters */,
11464 /// ]);
11465 /// ```
11466 pub fn set_releases<T, V>(mut self, v: T) -> Self
11467 where
11468 T: std::iter::IntoIterator<Item = V>,
11469 V: std::convert::Into<crate::model::Release>,
11470 {
11471 use std::iter::Iterator;
11472 self.releases = v.into_iter().map(|i| i.into()).collect();
11473 self
11474 }
11475
11476 /// Sets the value of [next_page_token][crate::model::ListReleasesResponse::next_page_token].
11477 ///
11478 /// # Example
11479 /// ```ignore,no_run
11480 /// # use google_cloud_deploy_v1::model::ListReleasesResponse;
11481 /// let x = ListReleasesResponse::new().set_next_page_token("example");
11482 /// ```
11483 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11484 self.next_page_token = v.into();
11485 self
11486 }
11487
11488 /// Sets the value of [unreachable][crate::model::ListReleasesResponse::unreachable].
11489 ///
11490 /// # Example
11491 /// ```ignore,no_run
11492 /// # use google_cloud_deploy_v1::model::ListReleasesResponse;
11493 /// let x = ListReleasesResponse::new().set_unreachable(["a", "b", "c"]);
11494 /// ```
11495 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
11496 where
11497 T: std::iter::IntoIterator<Item = V>,
11498 V: std::convert::Into<std::string::String>,
11499 {
11500 use std::iter::Iterator;
11501 self.unreachable = v.into_iter().map(|i| i.into()).collect();
11502 self
11503 }
11504}
11505
11506impl wkt::message::Message for ListReleasesResponse {
11507 fn typename() -> &'static str {
11508 "type.googleapis.com/google.cloud.deploy.v1.ListReleasesResponse"
11509 }
11510}
11511
11512#[doc(hidden)]
11513impl google_cloud_gax::paginator::internal::PageableResponse for ListReleasesResponse {
11514 type PageItem = crate::model::Release;
11515
11516 fn items(self) -> std::vec::Vec<Self::PageItem> {
11517 self.releases
11518 }
11519
11520 fn next_page_token(&self) -> std::string::String {
11521 use std::clone::Clone;
11522 self.next_page_token.clone()
11523 }
11524}
11525
11526/// The request object for `GetRelease`.
11527#[derive(Clone, Default, PartialEq)]
11528#[non_exhaustive]
11529pub struct GetReleaseRequest {
11530 /// Required. Name of the `Release`. Format must be
11531 /// `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}`.
11532 pub name: std::string::String,
11533
11534 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11535}
11536
11537impl GetReleaseRequest {
11538 pub fn new() -> Self {
11539 std::default::Default::default()
11540 }
11541
11542 /// Sets the value of [name][crate::model::GetReleaseRequest::name].
11543 ///
11544 /// # Example
11545 /// ```ignore,no_run
11546 /// # use google_cloud_deploy_v1::model::GetReleaseRequest;
11547 /// let x = GetReleaseRequest::new().set_name("example");
11548 /// ```
11549 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11550 self.name = v.into();
11551 self
11552 }
11553}
11554
11555impl wkt::message::Message for GetReleaseRequest {
11556 fn typename() -> &'static str {
11557 "type.googleapis.com/google.cloud.deploy.v1.GetReleaseRequest"
11558 }
11559}
11560
11561/// The request object for `CreateRelease`,
11562#[derive(Clone, Default, PartialEq)]
11563#[non_exhaustive]
11564pub struct CreateReleaseRequest {
11565 /// Required. The parent collection in which the `Release` is created.
11566 /// The format is
11567 /// `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}`.
11568 pub parent: std::string::String,
11569
11570 /// Required. ID of the `Release`.
11571 pub release_id: std::string::String,
11572
11573 /// Required. The `Release` to create.
11574 pub release: std::option::Option<crate::model::Release>,
11575
11576 /// Optional. A request ID to identify requests. Specify a unique request ID
11577 /// so that if you must retry your request, the server knows to ignore the
11578 /// request if it has already been completed. The server guarantees that for
11579 /// at least 60 minutes after the first request.
11580 ///
11581 /// For example, consider a situation where you make an initial request and the
11582 /// request times out. If you make the request again with the same request ID,
11583 /// the server can check if original operation with the same request ID was
11584 /// received, and if so, will ignore the second request. This prevents clients
11585 /// from accidentally creating duplicate commitments.
11586 ///
11587 /// The request ID must be a valid UUID with the exception that zero UUID is
11588 /// not supported (00000000-0000-0000-0000-000000000000).
11589 pub request_id: std::string::String,
11590
11591 /// Optional. If set to true, the request is validated and the user is provided
11592 /// with an expected result, but no actual change is made.
11593 pub validate_only: bool,
11594
11595 /// Optional. Deploy policies to override. Format is
11596 /// `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`.
11597 pub override_deploy_policy: std::vec::Vec<std::string::String>,
11598
11599 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11600}
11601
11602impl CreateReleaseRequest {
11603 pub fn new() -> Self {
11604 std::default::Default::default()
11605 }
11606
11607 /// Sets the value of [parent][crate::model::CreateReleaseRequest::parent].
11608 ///
11609 /// # Example
11610 /// ```ignore,no_run
11611 /// # use google_cloud_deploy_v1::model::CreateReleaseRequest;
11612 /// let x = CreateReleaseRequest::new().set_parent("example");
11613 /// ```
11614 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11615 self.parent = v.into();
11616 self
11617 }
11618
11619 /// Sets the value of [release_id][crate::model::CreateReleaseRequest::release_id].
11620 ///
11621 /// # Example
11622 /// ```ignore,no_run
11623 /// # use google_cloud_deploy_v1::model::CreateReleaseRequest;
11624 /// let x = CreateReleaseRequest::new().set_release_id("example");
11625 /// ```
11626 pub fn set_release_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11627 self.release_id = v.into();
11628 self
11629 }
11630
11631 /// Sets the value of [release][crate::model::CreateReleaseRequest::release].
11632 ///
11633 /// # Example
11634 /// ```ignore,no_run
11635 /// # use google_cloud_deploy_v1::model::CreateReleaseRequest;
11636 /// use google_cloud_deploy_v1::model::Release;
11637 /// let x = CreateReleaseRequest::new().set_release(Release::default()/* use setters */);
11638 /// ```
11639 pub fn set_release<T>(mut self, v: T) -> Self
11640 where
11641 T: std::convert::Into<crate::model::Release>,
11642 {
11643 self.release = std::option::Option::Some(v.into());
11644 self
11645 }
11646
11647 /// Sets or clears the value of [release][crate::model::CreateReleaseRequest::release].
11648 ///
11649 /// # Example
11650 /// ```ignore,no_run
11651 /// # use google_cloud_deploy_v1::model::CreateReleaseRequest;
11652 /// use google_cloud_deploy_v1::model::Release;
11653 /// let x = CreateReleaseRequest::new().set_or_clear_release(Some(Release::default()/* use setters */));
11654 /// let x = CreateReleaseRequest::new().set_or_clear_release(None::<Release>);
11655 /// ```
11656 pub fn set_or_clear_release<T>(mut self, v: std::option::Option<T>) -> Self
11657 where
11658 T: std::convert::Into<crate::model::Release>,
11659 {
11660 self.release = v.map(|x| x.into());
11661 self
11662 }
11663
11664 /// Sets the value of [request_id][crate::model::CreateReleaseRequest::request_id].
11665 ///
11666 /// # Example
11667 /// ```ignore,no_run
11668 /// # use google_cloud_deploy_v1::model::CreateReleaseRequest;
11669 /// let x = CreateReleaseRequest::new().set_request_id("example");
11670 /// ```
11671 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11672 self.request_id = v.into();
11673 self
11674 }
11675
11676 /// Sets the value of [validate_only][crate::model::CreateReleaseRequest::validate_only].
11677 ///
11678 /// # Example
11679 /// ```ignore,no_run
11680 /// # use google_cloud_deploy_v1::model::CreateReleaseRequest;
11681 /// let x = CreateReleaseRequest::new().set_validate_only(true);
11682 /// ```
11683 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
11684 self.validate_only = v.into();
11685 self
11686 }
11687
11688 /// Sets the value of [override_deploy_policy][crate::model::CreateReleaseRequest::override_deploy_policy].
11689 ///
11690 /// # Example
11691 /// ```ignore,no_run
11692 /// # use google_cloud_deploy_v1::model::CreateReleaseRequest;
11693 /// let x = CreateReleaseRequest::new().set_override_deploy_policy(["a", "b", "c"]);
11694 /// ```
11695 pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
11696 where
11697 T: std::iter::IntoIterator<Item = V>,
11698 V: std::convert::Into<std::string::String>,
11699 {
11700 use std::iter::Iterator;
11701 self.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
11702 self
11703 }
11704}
11705
11706impl wkt::message::Message for CreateReleaseRequest {
11707 fn typename() -> &'static str {
11708 "type.googleapis.com/google.cloud.deploy.v1.CreateReleaseRequest"
11709 }
11710}
11711
11712/// A `Rollout` resource in the Cloud Deploy API.
11713///
11714/// A `Rollout` contains information around a specific deployment to a `Target`.
11715#[derive(Clone, Default, PartialEq)]
11716#[non_exhaustive]
11717pub struct Rollout {
11718 /// Identifier. Name of the `Rollout`. Format is
11719 /// `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`.
11720 /// The `rollout` component must match `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`
11721 pub name: std::string::String,
11722
11723 /// Output only. Unique identifier of the `Rollout`.
11724 pub uid: std::string::String,
11725
11726 /// Optional. Description of the `Rollout` for user purposes. Max length is 255
11727 /// characters.
11728 pub description: std::string::String,
11729
11730 /// Optional. User annotations. These attributes can only be set and used by
11731 /// the user, and not by Cloud Deploy. See
11732 /// <https://google.aip.dev/128#annotations> for more details such as format and
11733 /// size limitations.
11734 pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
11735
11736 /// Labels are attributes that can be set and used by both the
11737 /// user and by Cloud Deploy. Labels must meet the following constraints:
11738 ///
11739 /// * Keys and values can contain only lowercase letters, numeric characters,
11740 /// underscores, and dashes.
11741 /// * All characters must use UTF-8 encoding, and international characters are
11742 /// allowed.
11743 /// * Keys must start with a lowercase letter or international character.
11744 /// * Each resource is limited to a maximum of 64 labels.
11745 ///
11746 /// Both keys and values are additionally constrained to be <= 128 bytes.
11747 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
11748
11749 /// Output only. Time at which the `Rollout` was created.
11750 pub create_time: std::option::Option<wkt::Timestamp>,
11751
11752 /// Output only. Time at which the `Rollout` was approved.
11753 pub approve_time: std::option::Option<wkt::Timestamp>,
11754
11755 /// Output only. Time at which the `Rollout` was enqueued.
11756 pub enqueue_time: std::option::Option<wkt::Timestamp>,
11757
11758 /// Output only. Time at which the `Rollout` started deploying.
11759 pub deploy_start_time: std::option::Option<wkt::Timestamp>,
11760
11761 /// Output only. Time at which the `Rollout` finished deploying.
11762 pub deploy_end_time: std::option::Option<wkt::Timestamp>,
11763
11764 /// Required. The ID of Target to which this `Rollout` is deploying.
11765 pub target_id: std::string::String,
11766
11767 /// Output only. Approval state of the `Rollout`.
11768 pub approval_state: crate::model::rollout::ApprovalState,
11769
11770 /// Output only. Current state of the `Rollout`.
11771 pub state: crate::model::rollout::State,
11772
11773 /// Output only. Additional information about the rollout failure, if
11774 /// available.
11775 pub failure_reason: std::string::String,
11776
11777 /// Output only. The resource name of the Cloud Build `Build` object that is
11778 /// used to deploy the Rollout. Format is
11779 /// `projects/{project}/locations/{location}/builds/{build}`.
11780 pub deploying_build: std::string::String,
11781
11782 /// This checksum is computed by the server based on the value of other
11783 /// fields, and may be sent on update and delete requests to ensure the
11784 /// client has an up-to-date value before proceeding.
11785 pub etag: std::string::String,
11786
11787 /// Output only. The reason this rollout failed. This will always be
11788 /// unspecified while the rollout is in progress.
11789 pub deploy_failure_cause: crate::model::rollout::FailureCause,
11790
11791 /// Output only. The phases that represent the workflows of this `Rollout`.
11792 pub phases: std::vec::Vec<crate::model::Phase>,
11793
11794 /// Output only. Metadata contains information about the rollout.
11795 pub metadata: std::option::Option<crate::model::Metadata>,
11796
11797 /// Output only. Name of the `ControllerRollout`. Format is
11798 /// `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`.
11799 pub controller_rollout: std::string::String,
11800
11801 /// Output only. Name of the `Rollout` that is rolled back by this `Rollout`.
11802 /// Empty if this `Rollout` wasn't created as a rollback.
11803 pub rollback_of_rollout: std::string::String,
11804
11805 /// Output only. Names of `Rollouts` that rolled back this `Rollout`.
11806 pub rolled_back_by_rollouts: std::vec::Vec<std::string::String>,
11807
11808 /// Output only. The AutomationRun actively repairing the rollout.
11809 pub active_repair_automation_run: std::string::String,
11810
11811 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11812}
11813
11814impl Rollout {
11815 pub fn new() -> Self {
11816 std::default::Default::default()
11817 }
11818
11819 /// Sets the value of [name][crate::model::Rollout::name].
11820 ///
11821 /// # Example
11822 /// ```ignore,no_run
11823 /// # use google_cloud_deploy_v1::model::Rollout;
11824 /// let x = Rollout::new().set_name("example");
11825 /// ```
11826 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11827 self.name = v.into();
11828 self
11829 }
11830
11831 /// Sets the value of [uid][crate::model::Rollout::uid].
11832 ///
11833 /// # Example
11834 /// ```ignore,no_run
11835 /// # use google_cloud_deploy_v1::model::Rollout;
11836 /// let x = Rollout::new().set_uid("example");
11837 /// ```
11838 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11839 self.uid = v.into();
11840 self
11841 }
11842
11843 /// Sets the value of [description][crate::model::Rollout::description].
11844 ///
11845 /// # Example
11846 /// ```ignore,no_run
11847 /// # use google_cloud_deploy_v1::model::Rollout;
11848 /// let x = Rollout::new().set_description("example");
11849 /// ```
11850 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11851 self.description = v.into();
11852 self
11853 }
11854
11855 /// Sets the value of [annotations][crate::model::Rollout::annotations].
11856 ///
11857 /// # Example
11858 /// ```ignore,no_run
11859 /// # use google_cloud_deploy_v1::model::Rollout;
11860 /// let x = Rollout::new().set_annotations([
11861 /// ("key0", "abc"),
11862 /// ("key1", "xyz"),
11863 /// ]);
11864 /// ```
11865 pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
11866 where
11867 T: std::iter::IntoIterator<Item = (K, V)>,
11868 K: std::convert::Into<std::string::String>,
11869 V: std::convert::Into<std::string::String>,
11870 {
11871 use std::iter::Iterator;
11872 self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
11873 self
11874 }
11875
11876 /// Sets the value of [labels][crate::model::Rollout::labels].
11877 ///
11878 /// # Example
11879 /// ```ignore,no_run
11880 /// # use google_cloud_deploy_v1::model::Rollout;
11881 /// let x = Rollout::new().set_labels([
11882 /// ("key0", "abc"),
11883 /// ("key1", "xyz"),
11884 /// ]);
11885 /// ```
11886 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
11887 where
11888 T: std::iter::IntoIterator<Item = (K, V)>,
11889 K: std::convert::Into<std::string::String>,
11890 V: std::convert::Into<std::string::String>,
11891 {
11892 use std::iter::Iterator;
11893 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
11894 self
11895 }
11896
11897 /// Sets the value of [create_time][crate::model::Rollout::create_time].
11898 ///
11899 /// # Example
11900 /// ```ignore,no_run
11901 /// # use google_cloud_deploy_v1::model::Rollout;
11902 /// use wkt::Timestamp;
11903 /// let x = Rollout::new().set_create_time(Timestamp::default()/* use setters */);
11904 /// ```
11905 pub fn set_create_time<T>(mut self, v: T) -> Self
11906 where
11907 T: std::convert::Into<wkt::Timestamp>,
11908 {
11909 self.create_time = std::option::Option::Some(v.into());
11910 self
11911 }
11912
11913 /// Sets or clears the value of [create_time][crate::model::Rollout::create_time].
11914 ///
11915 /// # Example
11916 /// ```ignore,no_run
11917 /// # use google_cloud_deploy_v1::model::Rollout;
11918 /// use wkt::Timestamp;
11919 /// let x = Rollout::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
11920 /// let x = Rollout::new().set_or_clear_create_time(None::<Timestamp>);
11921 /// ```
11922 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
11923 where
11924 T: std::convert::Into<wkt::Timestamp>,
11925 {
11926 self.create_time = v.map(|x| x.into());
11927 self
11928 }
11929
11930 /// Sets the value of [approve_time][crate::model::Rollout::approve_time].
11931 ///
11932 /// # Example
11933 /// ```ignore,no_run
11934 /// # use google_cloud_deploy_v1::model::Rollout;
11935 /// use wkt::Timestamp;
11936 /// let x = Rollout::new().set_approve_time(Timestamp::default()/* use setters */);
11937 /// ```
11938 pub fn set_approve_time<T>(mut self, v: T) -> Self
11939 where
11940 T: std::convert::Into<wkt::Timestamp>,
11941 {
11942 self.approve_time = std::option::Option::Some(v.into());
11943 self
11944 }
11945
11946 /// Sets or clears the value of [approve_time][crate::model::Rollout::approve_time].
11947 ///
11948 /// # Example
11949 /// ```ignore,no_run
11950 /// # use google_cloud_deploy_v1::model::Rollout;
11951 /// use wkt::Timestamp;
11952 /// let x = Rollout::new().set_or_clear_approve_time(Some(Timestamp::default()/* use setters */));
11953 /// let x = Rollout::new().set_or_clear_approve_time(None::<Timestamp>);
11954 /// ```
11955 pub fn set_or_clear_approve_time<T>(mut self, v: std::option::Option<T>) -> Self
11956 where
11957 T: std::convert::Into<wkt::Timestamp>,
11958 {
11959 self.approve_time = v.map(|x| x.into());
11960 self
11961 }
11962
11963 /// Sets the value of [enqueue_time][crate::model::Rollout::enqueue_time].
11964 ///
11965 /// # Example
11966 /// ```ignore,no_run
11967 /// # use google_cloud_deploy_v1::model::Rollout;
11968 /// use wkt::Timestamp;
11969 /// let x = Rollout::new().set_enqueue_time(Timestamp::default()/* use setters */);
11970 /// ```
11971 pub fn set_enqueue_time<T>(mut self, v: T) -> Self
11972 where
11973 T: std::convert::Into<wkt::Timestamp>,
11974 {
11975 self.enqueue_time = std::option::Option::Some(v.into());
11976 self
11977 }
11978
11979 /// Sets or clears the value of [enqueue_time][crate::model::Rollout::enqueue_time].
11980 ///
11981 /// # Example
11982 /// ```ignore,no_run
11983 /// # use google_cloud_deploy_v1::model::Rollout;
11984 /// use wkt::Timestamp;
11985 /// let x = Rollout::new().set_or_clear_enqueue_time(Some(Timestamp::default()/* use setters */));
11986 /// let x = Rollout::new().set_or_clear_enqueue_time(None::<Timestamp>);
11987 /// ```
11988 pub fn set_or_clear_enqueue_time<T>(mut self, v: std::option::Option<T>) -> Self
11989 where
11990 T: std::convert::Into<wkt::Timestamp>,
11991 {
11992 self.enqueue_time = v.map(|x| x.into());
11993 self
11994 }
11995
11996 /// Sets the value of [deploy_start_time][crate::model::Rollout::deploy_start_time].
11997 ///
11998 /// # Example
11999 /// ```ignore,no_run
12000 /// # use google_cloud_deploy_v1::model::Rollout;
12001 /// use wkt::Timestamp;
12002 /// let x = Rollout::new().set_deploy_start_time(Timestamp::default()/* use setters */);
12003 /// ```
12004 pub fn set_deploy_start_time<T>(mut self, v: T) -> Self
12005 where
12006 T: std::convert::Into<wkt::Timestamp>,
12007 {
12008 self.deploy_start_time = std::option::Option::Some(v.into());
12009 self
12010 }
12011
12012 /// Sets or clears the value of [deploy_start_time][crate::model::Rollout::deploy_start_time].
12013 ///
12014 /// # Example
12015 /// ```ignore,no_run
12016 /// # use google_cloud_deploy_v1::model::Rollout;
12017 /// use wkt::Timestamp;
12018 /// let x = Rollout::new().set_or_clear_deploy_start_time(Some(Timestamp::default()/* use setters */));
12019 /// let x = Rollout::new().set_or_clear_deploy_start_time(None::<Timestamp>);
12020 /// ```
12021 pub fn set_or_clear_deploy_start_time<T>(mut self, v: std::option::Option<T>) -> Self
12022 where
12023 T: std::convert::Into<wkt::Timestamp>,
12024 {
12025 self.deploy_start_time = v.map(|x| x.into());
12026 self
12027 }
12028
12029 /// Sets the value of [deploy_end_time][crate::model::Rollout::deploy_end_time].
12030 ///
12031 /// # Example
12032 /// ```ignore,no_run
12033 /// # use google_cloud_deploy_v1::model::Rollout;
12034 /// use wkt::Timestamp;
12035 /// let x = Rollout::new().set_deploy_end_time(Timestamp::default()/* use setters */);
12036 /// ```
12037 pub fn set_deploy_end_time<T>(mut self, v: T) -> Self
12038 where
12039 T: std::convert::Into<wkt::Timestamp>,
12040 {
12041 self.deploy_end_time = std::option::Option::Some(v.into());
12042 self
12043 }
12044
12045 /// Sets or clears the value of [deploy_end_time][crate::model::Rollout::deploy_end_time].
12046 ///
12047 /// # Example
12048 /// ```ignore,no_run
12049 /// # use google_cloud_deploy_v1::model::Rollout;
12050 /// use wkt::Timestamp;
12051 /// let x = Rollout::new().set_or_clear_deploy_end_time(Some(Timestamp::default()/* use setters */));
12052 /// let x = Rollout::new().set_or_clear_deploy_end_time(None::<Timestamp>);
12053 /// ```
12054 pub fn set_or_clear_deploy_end_time<T>(mut self, v: std::option::Option<T>) -> Self
12055 where
12056 T: std::convert::Into<wkt::Timestamp>,
12057 {
12058 self.deploy_end_time = v.map(|x| x.into());
12059 self
12060 }
12061
12062 /// Sets the value of [target_id][crate::model::Rollout::target_id].
12063 ///
12064 /// # Example
12065 /// ```ignore,no_run
12066 /// # use google_cloud_deploy_v1::model::Rollout;
12067 /// let x = Rollout::new().set_target_id("example");
12068 /// ```
12069 pub fn set_target_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12070 self.target_id = v.into();
12071 self
12072 }
12073
12074 /// Sets the value of [approval_state][crate::model::Rollout::approval_state].
12075 ///
12076 /// # Example
12077 /// ```ignore,no_run
12078 /// # use google_cloud_deploy_v1::model::Rollout;
12079 /// use google_cloud_deploy_v1::model::rollout::ApprovalState;
12080 /// let x0 = Rollout::new().set_approval_state(ApprovalState::NeedsApproval);
12081 /// let x1 = Rollout::new().set_approval_state(ApprovalState::DoesNotNeedApproval);
12082 /// let x2 = Rollout::new().set_approval_state(ApprovalState::Approved);
12083 /// ```
12084 pub fn set_approval_state<T: std::convert::Into<crate::model::rollout::ApprovalState>>(
12085 mut self,
12086 v: T,
12087 ) -> Self {
12088 self.approval_state = v.into();
12089 self
12090 }
12091
12092 /// Sets the value of [state][crate::model::Rollout::state].
12093 ///
12094 /// # Example
12095 /// ```ignore,no_run
12096 /// # use google_cloud_deploy_v1::model::Rollout;
12097 /// use google_cloud_deploy_v1::model::rollout::State;
12098 /// let x0 = Rollout::new().set_state(State::Succeeded);
12099 /// let x1 = Rollout::new().set_state(State::Failed);
12100 /// let x2 = Rollout::new().set_state(State::InProgress);
12101 /// ```
12102 pub fn set_state<T: std::convert::Into<crate::model::rollout::State>>(mut self, v: T) -> Self {
12103 self.state = v.into();
12104 self
12105 }
12106
12107 /// Sets the value of [failure_reason][crate::model::Rollout::failure_reason].
12108 ///
12109 /// # Example
12110 /// ```ignore,no_run
12111 /// # use google_cloud_deploy_v1::model::Rollout;
12112 /// let x = Rollout::new().set_failure_reason("example");
12113 /// ```
12114 pub fn set_failure_reason<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12115 self.failure_reason = v.into();
12116 self
12117 }
12118
12119 /// Sets the value of [deploying_build][crate::model::Rollout::deploying_build].
12120 ///
12121 /// # Example
12122 /// ```ignore,no_run
12123 /// # use google_cloud_deploy_v1::model::Rollout;
12124 /// let x = Rollout::new().set_deploying_build("example");
12125 /// ```
12126 pub fn set_deploying_build<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12127 self.deploying_build = v.into();
12128 self
12129 }
12130
12131 /// Sets the value of [etag][crate::model::Rollout::etag].
12132 ///
12133 /// # Example
12134 /// ```ignore,no_run
12135 /// # use google_cloud_deploy_v1::model::Rollout;
12136 /// let x = Rollout::new().set_etag("example");
12137 /// ```
12138 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12139 self.etag = v.into();
12140 self
12141 }
12142
12143 /// Sets the value of [deploy_failure_cause][crate::model::Rollout::deploy_failure_cause].
12144 ///
12145 /// # Example
12146 /// ```ignore,no_run
12147 /// # use google_cloud_deploy_v1::model::Rollout;
12148 /// use google_cloud_deploy_v1::model::rollout::FailureCause;
12149 /// let x0 = Rollout::new().set_deploy_failure_cause(FailureCause::CloudBuildUnavailable);
12150 /// let x1 = Rollout::new().set_deploy_failure_cause(FailureCause::ExecutionFailed);
12151 /// let x2 = Rollout::new().set_deploy_failure_cause(FailureCause::DeadlineExceeded);
12152 /// ```
12153 pub fn set_deploy_failure_cause<T: std::convert::Into<crate::model::rollout::FailureCause>>(
12154 mut self,
12155 v: T,
12156 ) -> Self {
12157 self.deploy_failure_cause = v.into();
12158 self
12159 }
12160
12161 /// Sets the value of [phases][crate::model::Rollout::phases].
12162 ///
12163 /// # Example
12164 /// ```ignore,no_run
12165 /// # use google_cloud_deploy_v1::model::Rollout;
12166 /// use google_cloud_deploy_v1::model::Phase;
12167 /// let x = Rollout::new()
12168 /// .set_phases([
12169 /// Phase::default()/* use setters */,
12170 /// Phase::default()/* use (different) setters */,
12171 /// ]);
12172 /// ```
12173 pub fn set_phases<T, V>(mut self, v: T) -> Self
12174 where
12175 T: std::iter::IntoIterator<Item = V>,
12176 V: std::convert::Into<crate::model::Phase>,
12177 {
12178 use std::iter::Iterator;
12179 self.phases = v.into_iter().map(|i| i.into()).collect();
12180 self
12181 }
12182
12183 /// Sets the value of [metadata][crate::model::Rollout::metadata].
12184 ///
12185 /// # Example
12186 /// ```ignore,no_run
12187 /// # use google_cloud_deploy_v1::model::Rollout;
12188 /// use google_cloud_deploy_v1::model::Metadata;
12189 /// let x = Rollout::new().set_metadata(Metadata::default()/* use setters */);
12190 /// ```
12191 pub fn set_metadata<T>(mut self, v: T) -> Self
12192 where
12193 T: std::convert::Into<crate::model::Metadata>,
12194 {
12195 self.metadata = std::option::Option::Some(v.into());
12196 self
12197 }
12198
12199 /// Sets or clears the value of [metadata][crate::model::Rollout::metadata].
12200 ///
12201 /// # Example
12202 /// ```ignore,no_run
12203 /// # use google_cloud_deploy_v1::model::Rollout;
12204 /// use google_cloud_deploy_v1::model::Metadata;
12205 /// let x = Rollout::new().set_or_clear_metadata(Some(Metadata::default()/* use setters */));
12206 /// let x = Rollout::new().set_or_clear_metadata(None::<Metadata>);
12207 /// ```
12208 pub fn set_or_clear_metadata<T>(mut self, v: std::option::Option<T>) -> Self
12209 where
12210 T: std::convert::Into<crate::model::Metadata>,
12211 {
12212 self.metadata = v.map(|x| x.into());
12213 self
12214 }
12215
12216 /// Sets the value of [controller_rollout][crate::model::Rollout::controller_rollout].
12217 ///
12218 /// # Example
12219 /// ```ignore,no_run
12220 /// # use google_cloud_deploy_v1::model::Rollout;
12221 /// let x = Rollout::new().set_controller_rollout("example");
12222 /// ```
12223 pub fn set_controller_rollout<T: std::convert::Into<std::string::String>>(
12224 mut self,
12225 v: T,
12226 ) -> Self {
12227 self.controller_rollout = v.into();
12228 self
12229 }
12230
12231 /// Sets the value of [rollback_of_rollout][crate::model::Rollout::rollback_of_rollout].
12232 ///
12233 /// # Example
12234 /// ```ignore,no_run
12235 /// # use google_cloud_deploy_v1::model::Rollout;
12236 /// let x = Rollout::new().set_rollback_of_rollout("example");
12237 /// ```
12238 pub fn set_rollback_of_rollout<T: std::convert::Into<std::string::String>>(
12239 mut self,
12240 v: T,
12241 ) -> Self {
12242 self.rollback_of_rollout = v.into();
12243 self
12244 }
12245
12246 /// Sets the value of [rolled_back_by_rollouts][crate::model::Rollout::rolled_back_by_rollouts].
12247 ///
12248 /// # Example
12249 /// ```ignore,no_run
12250 /// # use google_cloud_deploy_v1::model::Rollout;
12251 /// let x = Rollout::new().set_rolled_back_by_rollouts(["a", "b", "c"]);
12252 /// ```
12253 pub fn set_rolled_back_by_rollouts<T, V>(mut self, v: T) -> Self
12254 where
12255 T: std::iter::IntoIterator<Item = V>,
12256 V: std::convert::Into<std::string::String>,
12257 {
12258 use std::iter::Iterator;
12259 self.rolled_back_by_rollouts = v.into_iter().map(|i| i.into()).collect();
12260 self
12261 }
12262
12263 /// Sets the value of [active_repair_automation_run][crate::model::Rollout::active_repair_automation_run].
12264 ///
12265 /// # Example
12266 /// ```ignore,no_run
12267 /// # use google_cloud_deploy_v1::model::Rollout;
12268 /// let x = Rollout::new().set_active_repair_automation_run("example");
12269 /// ```
12270 pub fn set_active_repair_automation_run<T: std::convert::Into<std::string::String>>(
12271 mut self,
12272 v: T,
12273 ) -> Self {
12274 self.active_repair_automation_run = v.into();
12275 self
12276 }
12277}
12278
12279impl wkt::message::Message for Rollout {
12280 fn typename() -> &'static str {
12281 "type.googleapis.com/google.cloud.deploy.v1.Rollout"
12282 }
12283}
12284
12285/// Defines additional types related to [Rollout].
12286pub mod rollout {
12287 #[allow(unused_imports)]
12288 use super::*;
12289
12290 /// Valid approval states of a `Rollout`.
12291 ///
12292 /// # Working with unknown values
12293 ///
12294 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12295 /// additional enum variants at any time. Adding new variants is not considered
12296 /// a breaking change. Applications should write their code in anticipation of:
12297 ///
12298 /// - New values appearing in future releases of the client library, **and**
12299 /// - New values received dynamically, without application changes.
12300 ///
12301 /// Please consult the [Working with enums] section in the user guide for some
12302 /// guidelines.
12303 ///
12304 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
12305 #[derive(Clone, Debug, PartialEq)]
12306 #[non_exhaustive]
12307 pub enum ApprovalState {
12308 /// The `Rollout` has an unspecified approval state.
12309 Unspecified,
12310 /// The `Rollout` requires approval.
12311 NeedsApproval,
12312 /// The `Rollout` does not require approval.
12313 DoesNotNeedApproval,
12314 /// The `Rollout` has been approved.
12315 Approved,
12316 /// The `Rollout` has been rejected.
12317 Rejected,
12318 /// If set, the enum was initialized with an unknown value.
12319 ///
12320 /// Applications can examine the value using [ApprovalState::value] or
12321 /// [ApprovalState::name].
12322 UnknownValue(approval_state::UnknownValue),
12323 }
12324
12325 #[doc(hidden)]
12326 pub mod approval_state {
12327 #[allow(unused_imports)]
12328 use super::*;
12329 #[derive(Clone, Debug, PartialEq)]
12330 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12331 }
12332
12333 impl ApprovalState {
12334 /// Gets the enum value.
12335 ///
12336 /// Returns `None` if the enum contains an unknown value deserialized from
12337 /// the string representation of enums.
12338 pub fn value(&self) -> std::option::Option<i32> {
12339 match self {
12340 Self::Unspecified => std::option::Option::Some(0),
12341 Self::NeedsApproval => std::option::Option::Some(1),
12342 Self::DoesNotNeedApproval => std::option::Option::Some(2),
12343 Self::Approved => std::option::Option::Some(3),
12344 Self::Rejected => std::option::Option::Some(4),
12345 Self::UnknownValue(u) => u.0.value(),
12346 }
12347 }
12348
12349 /// Gets the enum value as a string.
12350 ///
12351 /// Returns `None` if the enum contains an unknown value deserialized from
12352 /// the integer representation of enums.
12353 pub fn name(&self) -> std::option::Option<&str> {
12354 match self {
12355 Self::Unspecified => std::option::Option::Some("APPROVAL_STATE_UNSPECIFIED"),
12356 Self::NeedsApproval => std::option::Option::Some("NEEDS_APPROVAL"),
12357 Self::DoesNotNeedApproval => std::option::Option::Some("DOES_NOT_NEED_APPROVAL"),
12358 Self::Approved => std::option::Option::Some("APPROVED"),
12359 Self::Rejected => std::option::Option::Some("REJECTED"),
12360 Self::UnknownValue(u) => u.0.name(),
12361 }
12362 }
12363 }
12364
12365 impl std::default::Default for ApprovalState {
12366 fn default() -> Self {
12367 use std::convert::From;
12368 Self::from(0)
12369 }
12370 }
12371
12372 impl std::fmt::Display for ApprovalState {
12373 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12374 wkt::internal::display_enum(f, self.name(), self.value())
12375 }
12376 }
12377
12378 impl std::convert::From<i32> for ApprovalState {
12379 fn from(value: i32) -> Self {
12380 match value {
12381 0 => Self::Unspecified,
12382 1 => Self::NeedsApproval,
12383 2 => Self::DoesNotNeedApproval,
12384 3 => Self::Approved,
12385 4 => Self::Rejected,
12386 _ => Self::UnknownValue(approval_state::UnknownValue(
12387 wkt::internal::UnknownEnumValue::Integer(value),
12388 )),
12389 }
12390 }
12391 }
12392
12393 impl std::convert::From<&str> for ApprovalState {
12394 fn from(value: &str) -> Self {
12395 use std::string::ToString;
12396 match value {
12397 "APPROVAL_STATE_UNSPECIFIED" => Self::Unspecified,
12398 "NEEDS_APPROVAL" => Self::NeedsApproval,
12399 "DOES_NOT_NEED_APPROVAL" => Self::DoesNotNeedApproval,
12400 "APPROVED" => Self::Approved,
12401 "REJECTED" => Self::Rejected,
12402 _ => Self::UnknownValue(approval_state::UnknownValue(
12403 wkt::internal::UnknownEnumValue::String(value.to_string()),
12404 )),
12405 }
12406 }
12407 }
12408
12409 impl serde::ser::Serialize for ApprovalState {
12410 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12411 where
12412 S: serde::Serializer,
12413 {
12414 match self {
12415 Self::Unspecified => serializer.serialize_i32(0),
12416 Self::NeedsApproval => serializer.serialize_i32(1),
12417 Self::DoesNotNeedApproval => serializer.serialize_i32(2),
12418 Self::Approved => serializer.serialize_i32(3),
12419 Self::Rejected => serializer.serialize_i32(4),
12420 Self::UnknownValue(u) => u.0.serialize(serializer),
12421 }
12422 }
12423 }
12424
12425 impl<'de> serde::de::Deserialize<'de> for ApprovalState {
12426 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12427 where
12428 D: serde::Deserializer<'de>,
12429 {
12430 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ApprovalState>::new(
12431 ".google.cloud.deploy.v1.Rollout.ApprovalState",
12432 ))
12433 }
12434 }
12435
12436 /// Valid states of a `Rollout`.
12437 ///
12438 /// # Working with unknown values
12439 ///
12440 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12441 /// additional enum variants at any time. Adding new variants is not considered
12442 /// a breaking change. Applications should write their code in anticipation of:
12443 ///
12444 /// - New values appearing in future releases of the client library, **and**
12445 /// - New values received dynamically, without application changes.
12446 ///
12447 /// Please consult the [Working with enums] section in the user guide for some
12448 /// guidelines.
12449 ///
12450 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
12451 #[derive(Clone, Debug, PartialEq)]
12452 #[non_exhaustive]
12453 pub enum State {
12454 /// The `Rollout` has an unspecified state.
12455 Unspecified,
12456 /// The `Rollout` has completed successfully.
12457 Succeeded,
12458 /// The `Rollout` has failed.
12459 Failed,
12460 /// The `Rollout` is being deployed.
12461 InProgress,
12462 /// The `Rollout` needs approval.
12463 PendingApproval,
12464 /// An approver rejected the `Rollout`.
12465 ApprovalRejected,
12466 /// The `Rollout` is waiting for an earlier Rollout(s) to complete on this
12467 /// `Target`.
12468 Pending,
12469 /// The `Rollout` is waiting for the `Release` to be fully rendered.
12470 PendingRelease,
12471 /// The `Rollout` is in the process of being cancelled.
12472 Cancelling,
12473 /// The `Rollout` has been cancelled.
12474 Cancelled,
12475 /// The `Rollout` is halted.
12476 Halted,
12477 /// If set, the enum was initialized with an unknown value.
12478 ///
12479 /// Applications can examine the value using [State::value] or
12480 /// [State::name].
12481 UnknownValue(state::UnknownValue),
12482 }
12483
12484 #[doc(hidden)]
12485 pub mod state {
12486 #[allow(unused_imports)]
12487 use super::*;
12488 #[derive(Clone, Debug, PartialEq)]
12489 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12490 }
12491
12492 impl State {
12493 /// Gets the enum value.
12494 ///
12495 /// Returns `None` if the enum contains an unknown value deserialized from
12496 /// the string representation of enums.
12497 pub fn value(&self) -> std::option::Option<i32> {
12498 match self {
12499 Self::Unspecified => std::option::Option::Some(0),
12500 Self::Succeeded => std::option::Option::Some(1),
12501 Self::Failed => std::option::Option::Some(2),
12502 Self::InProgress => std::option::Option::Some(3),
12503 Self::PendingApproval => std::option::Option::Some(4),
12504 Self::ApprovalRejected => std::option::Option::Some(5),
12505 Self::Pending => std::option::Option::Some(6),
12506 Self::PendingRelease => std::option::Option::Some(7),
12507 Self::Cancelling => std::option::Option::Some(8),
12508 Self::Cancelled => std::option::Option::Some(9),
12509 Self::Halted => std::option::Option::Some(10),
12510 Self::UnknownValue(u) => u.0.value(),
12511 }
12512 }
12513
12514 /// Gets the enum value as a string.
12515 ///
12516 /// Returns `None` if the enum contains an unknown value deserialized from
12517 /// the integer representation of enums.
12518 pub fn name(&self) -> std::option::Option<&str> {
12519 match self {
12520 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
12521 Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
12522 Self::Failed => std::option::Option::Some("FAILED"),
12523 Self::InProgress => std::option::Option::Some("IN_PROGRESS"),
12524 Self::PendingApproval => std::option::Option::Some("PENDING_APPROVAL"),
12525 Self::ApprovalRejected => std::option::Option::Some("APPROVAL_REJECTED"),
12526 Self::Pending => std::option::Option::Some("PENDING"),
12527 Self::PendingRelease => std::option::Option::Some("PENDING_RELEASE"),
12528 Self::Cancelling => std::option::Option::Some("CANCELLING"),
12529 Self::Cancelled => std::option::Option::Some("CANCELLED"),
12530 Self::Halted => std::option::Option::Some("HALTED"),
12531 Self::UnknownValue(u) => u.0.name(),
12532 }
12533 }
12534 }
12535
12536 impl std::default::Default for State {
12537 fn default() -> Self {
12538 use std::convert::From;
12539 Self::from(0)
12540 }
12541 }
12542
12543 impl std::fmt::Display for State {
12544 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12545 wkt::internal::display_enum(f, self.name(), self.value())
12546 }
12547 }
12548
12549 impl std::convert::From<i32> for State {
12550 fn from(value: i32) -> Self {
12551 match value {
12552 0 => Self::Unspecified,
12553 1 => Self::Succeeded,
12554 2 => Self::Failed,
12555 3 => Self::InProgress,
12556 4 => Self::PendingApproval,
12557 5 => Self::ApprovalRejected,
12558 6 => Self::Pending,
12559 7 => Self::PendingRelease,
12560 8 => Self::Cancelling,
12561 9 => Self::Cancelled,
12562 10 => Self::Halted,
12563 _ => Self::UnknownValue(state::UnknownValue(
12564 wkt::internal::UnknownEnumValue::Integer(value),
12565 )),
12566 }
12567 }
12568 }
12569
12570 impl std::convert::From<&str> for State {
12571 fn from(value: &str) -> Self {
12572 use std::string::ToString;
12573 match value {
12574 "STATE_UNSPECIFIED" => Self::Unspecified,
12575 "SUCCEEDED" => Self::Succeeded,
12576 "FAILED" => Self::Failed,
12577 "IN_PROGRESS" => Self::InProgress,
12578 "PENDING_APPROVAL" => Self::PendingApproval,
12579 "APPROVAL_REJECTED" => Self::ApprovalRejected,
12580 "PENDING" => Self::Pending,
12581 "PENDING_RELEASE" => Self::PendingRelease,
12582 "CANCELLING" => Self::Cancelling,
12583 "CANCELLED" => Self::Cancelled,
12584 "HALTED" => Self::Halted,
12585 _ => Self::UnknownValue(state::UnknownValue(
12586 wkt::internal::UnknownEnumValue::String(value.to_string()),
12587 )),
12588 }
12589 }
12590 }
12591
12592 impl serde::ser::Serialize for State {
12593 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12594 where
12595 S: serde::Serializer,
12596 {
12597 match self {
12598 Self::Unspecified => serializer.serialize_i32(0),
12599 Self::Succeeded => serializer.serialize_i32(1),
12600 Self::Failed => serializer.serialize_i32(2),
12601 Self::InProgress => serializer.serialize_i32(3),
12602 Self::PendingApproval => serializer.serialize_i32(4),
12603 Self::ApprovalRejected => serializer.serialize_i32(5),
12604 Self::Pending => serializer.serialize_i32(6),
12605 Self::PendingRelease => serializer.serialize_i32(7),
12606 Self::Cancelling => serializer.serialize_i32(8),
12607 Self::Cancelled => serializer.serialize_i32(9),
12608 Self::Halted => serializer.serialize_i32(10),
12609 Self::UnknownValue(u) => u.0.serialize(serializer),
12610 }
12611 }
12612 }
12613
12614 impl<'de> serde::de::Deserialize<'de> for State {
12615 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12616 where
12617 D: serde::Deserializer<'de>,
12618 {
12619 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
12620 ".google.cloud.deploy.v1.Rollout.State",
12621 ))
12622 }
12623 }
12624
12625 /// Well-known rollout failures.
12626 ///
12627 /// # Working with unknown values
12628 ///
12629 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12630 /// additional enum variants at any time. Adding new variants is not considered
12631 /// a breaking change. Applications should write their code in anticipation of:
12632 ///
12633 /// - New values appearing in future releases of the client library, **and**
12634 /// - New values received dynamically, without application changes.
12635 ///
12636 /// Please consult the [Working with enums] section in the user guide for some
12637 /// guidelines.
12638 ///
12639 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
12640 #[derive(Clone, Debug, PartialEq)]
12641 #[non_exhaustive]
12642 pub enum FailureCause {
12643 /// No reason for failure is specified.
12644 Unspecified,
12645 /// Cloud Build is not available, either because it is not enabled or because
12646 /// Cloud Deploy has insufficient permissions. See [required
12647 /// permission](https://cloud.google.com/deploy/docs/cloud-deploy-service-account#required_permissions).
12648 CloudBuildUnavailable,
12649 /// The deploy operation did not complete successfully; check Cloud Build
12650 /// logs.
12651 ExecutionFailed,
12652 /// Deployment did not complete within the allotted time.
12653 DeadlineExceeded,
12654 /// Release is in a failed state.
12655 ReleaseFailed,
12656 /// Release is abandoned.
12657 ReleaseAbandoned,
12658 /// No Skaffold verify configuration was found.
12659 VerificationConfigNotFound,
12660 /// Cloud Build failed to fulfill Cloud Deploy's request. See failure_message
12661 /// for additional details.
12662 CloudBuildRequestFailed,
12663 /// A Rollout operation had a feature configured that is not supported.
12664 OperationFeatureNotSupported,
12665 /// If set, the enum was initialized with an unknown value.
12666 ///
12667 /// Applications can examine the value using [FailureCause::value] or
12668 /// [FailureCause::name].
12669 UnknownValue(failure_cause::UnknownValue),
12670 }
12671
12672 #[doc(hidden)]
12673 pub mod failure_cause {
12674 #[allow(unused_imports)]
12675 use super::*;
12676 #[derive(Clone, Debug, PartialEq)]
12677 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12678 }
12679
12680 impl FailureCause {
12681 /// Gets the enum value.
12682 ///
12683 /// Returns `None` if the enum contains an unknown value deserialized from
12684 /// the string representation of enums.
12685 pub fn value(&self) -> std::option::Option<i32> {
12686 match self {
12687 Self::Unspecified => std::option::Option::Some(0),
12688 Self::CloudBuildUnavailable => std::option::Option::Some(1),
12689 Self::ExecutionFailed => std::option::Option::Some(2),
12690 Self::DeadlineExceeded => std::option::Option::Some(3),
12691 Self::ReleaseFailed => std::option::Option::Some(4),
12692 Self::ReleaseAbandoned => std::option::Option::Some(5),
12693 Self::VerificationConfigNotFound => std::option::Option::Some(6),
12694 Self::CloudBuildRequestFailed => std::option::Option::Some(7),
12695 Self::OperationFeatureNotSupported => std::option::Option::Some(8),
12696 Self::UnknownValue(u) => u.0.value(),
12697 }
12698 }
12699
12700 /// Gets the enum value as a string.
12701 ///
12702 /// Returns `None` if the enum contains an unknown value deserialized from
12703 /// the integer representation of enums.
12704 pub fn name(&self) -> std::option::Option<&str> {
12705 match self {
12706 Self::Unspecified => std::option::Option::Some("FAILURE_CAUSE_UNSPECIFIED"),
12707 Self::CloudBuildUnavailable => std::option::Option::Some("CLOUD_BUILD_UNAVAILABLE"),
12708 Self::ExecutionFailed => std::option::Option::Some("EXECUTION_FAILED"),
12709 Self::DeadlineExceeded => std::option::Option::Some("DEADLINE_EXCEEDED"),
12710 Self::ReleaseFailed => std::option::Option::Some("RELEASE_FAILED"),
12711 Self::ReleaseAbandoned => std::option::Option::Some("RELEASE_ABANDONED"),
12712 Self::VerificationConfigNotFound => {
12713 std::option::Option::Some("VERIFICATION_CONFIG_NOT_FOUND")
12714 }
12715 Self::CloudBuildRequestFailed => {
12716 std::option::Option::Some("CLOUD_BUILD_REQUEST_FAILED")
12717 }
12718 Self::OperationFeatureNotSupported => {
12719 std::option::Option::Some("OPERATION_FEATURE_NOT_SUPPORTED")
12720 }
12721 Self::UnknownValue(u) => u.0.name(),
12722 }
12723 }
12724 }
12725
12726 impl std::default::Default for FailureCause {
12727 fn default() -> Self {
12728 use std::convert::From;
12729 Self::from(0)
12730 }
12731 }
12732
12733 impl std::fmt::Display for FailureCause {
12734 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12735 wkt::internal::display_enum(f, self.name(), self.value())
12736 }
12737 }
12738
12739 impl std::convert::From<i32> for FailureCause {
12740 fn from(value: i32) -> Self {
12741 match value {
12742 0 => Self::Unspecified,
12743 1 => Self::CloudBuildUnavailable,
12744 2 => Self::ExecutionFailed,
12745 3 => Self::DeadlineExceeded,
12746 4 => Self::ReleaseFailed,
12747 5 => Self::ReleaseAbandoned,
12748 6 => Self::VerificationConfigNotFound,
12749 7 => Self::CloudBuildRequestFailed,
12750 8 => Self::OperationFeatureNotSupported,
12751 _ => Self::UnknownValue(failure_cause::UnknownValue(
12752 wkt::internal::UnknownEnumValue::Integer(value),
12753 )),
12754 }
12755 }
12756 }
12757
12758 impl std::convert::From<&str> for FailureCause {
12759 fn from(value: &str) -> Self {
12760 use std::string::ToString;
12761 match value {
12762 "FAILURE_CAUSE_UNSPECIFIED" => Self::Unspecified,
12763 "CLOUD_BUILD_UNAVAILABLE" => Self::CloudBuildUnavailable,
12764 "EXECUTION_FAILED" => Self::ExecutionFailed,
12765 "DEADLINE_EXCEEDED" => Self::DeadlineExceeded,
12766 "RELEASE_FAILED" => Self::ReleaseFailed,
12767 "RELEASE_ABANDONED" => Self::ReleaseAbandoned,
12768 "VERIFICATION_CONFIG_NOT_FOUND" => Self::VerificationConfigNotFound,
12769 "CLOUD_BUILD_REQUEST_FAILED" => Self::CloudBuildRequestFailed,
12770 "OPERATION_FEATURE_NOT_SUPPORTED" => Self::OperationFeatureNotSupported,
12771 _ => Self::UnknownValue(failure_cause::UnknownValue(
12772 wkt::internal::UnknownEnumValue::String(value.to_string()),
12773 )),
12774 }
12775 }
12776 }
12777
12778 impl serde::ser::Serialize for FailureCause {
12779 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12780 where
12781 S: serde::Serializer,
12782 {
12783 match self {
12784 Self::Unspecified => serializer.serialize_i32(0),
12785 Self::CloudBuildUnavailable => serializer.serialize_i32(1),
12786 Self::ExecutionFailed => serializer.serialize_i32(2),
12787 Self::DeadlineExceeded => serializer.serialize_i32(3),
12788 Self::ReleaseFailed => serializer.serialize_i32(4),
12789 Self::ReleaseAbandoned => serializer.serialize_i32(5),
12790 Self::VerificationConfigNotFound => serializer.serialize_i32(6),
12791 Self::CloudBuildRequestFailed => serializer.serialize_i32(7),
12792 Self::OperationFeatureNotSupported => serializer.serialize_i32(8),
12793 Self::UnknownValue(u) => u.0.serialize(serializer),
12794 }
12795 }
12796 }
12797
12798 impl<'de> serde::de::Deserialize<'de> for FailureCause {
12799 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12800 where
12801 D: serde::Deserializer<'de>,
12802 {
12803 deserializer.deserialize_any(wkt::internal::EnumVisitor::<FailureCause>::new(
12804 ".google.cloud.deploy.v1.Rollout.FailureCause",
12805 ))
12806 }
12807 }
12808}
12809
12810/// Metadata includes information associated with a `Rollout`.
12811#[derive(Clone, Default, PartialEq)]
12812#[non_exhaustive]
12813pub struct Metadata {
12814 /// Output only. The name of the Cloud Run Service that is associated with a
12815 /// `Rollout`.
12816 pub cloud_run: std::option::Option<crate::model::CloudRunMetadata>,
12817
12818 /// Output only. AutomationRolloutMetadata contains the information about the
12819 /// interactions between Automation service and this rollout.
12820 pub automation: std::option::Option<crate::model::AutomationRolloutMetadata>,
12821
12822 /// Output only. Custom metadata provided by user-defined `Rollout` operations.
12823 pub custom: std::option::Option<crate::model::CustomMetadata>,
12824
12825 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12826}
12827
12828impl Metadata {
12829 pub fn new() -> Self {
12830 std::default::Default::default()
12831 }
12832
12833 /// Sets the value of [cloud_run][crate::model::Metadata::cloud_run].
12834 ///
12835 /// # Example
12836 /// ```ignore,no_run
12837 /// # use google_cloud_deploy_v1::model::Metadata;
12838 /// use google_cloud_deploy_v1::model::CloudRunMetadata;
12839 /// let x = Metadata::new().set_cloud_run(CloudRunMetadata::default()/* use setters */);
12840 /// ```
12841 pub fn set_cloud_run<T>(mut self, v: T) -> Self
12842 where
12843 T: std::convert::Into<crate::model::CloudRunMetadata>,
12844 {
12845 self.cloud_run = std::option::Option::Some(v.into());
12846 self
12847 }
12848
12849 /// Sets or clears the value of [cloud_run][crate::model::Metadata::cloud_run].
12850 ///
12851 /// # Example
12852 /// ```ignore,no_run
12853 /// # use google_cloud_deploy_v1::model::Metadata;
12854 /// use google_cloud_deploy_v1::model::CloudRunMetadata;
12855 /// let x = Metadata::new().set_or_clear_cloud_run(Some(CloudRunMetadata::default()/* use setters */));
12856 /// let x = Metadata::new().set_or_clear_cloud_run(None::<CloudRunMetadata>);
12857 /// ```
12858 pub fn set_or_clear_cloud_run<T>(mut self, v: std::option::Option<T>) -> Self
12859 where
12860 T: std::convert::Into<crate::model::CloudRunMetadata>,
12861 {
12862 self.cloud_run = v.map(|x| x.into());
12863 self
12864 }
12865
12866 /// Sets the value of [automation][crate::model::Metadata::automation].
12867 ///
12868 /// # Example
12869 /// ```ignore,no_run
12870 /// # use google_cloud_deploy_v1::model::Metadata;
12871 /// use google_cloud_deploy_v1::model::AutomationRolloutMetadata;
12872 /// let x = Metadata::new().set_automation(AutomationRolloutMetadata::default()/* use setters */);
12873 /// ```
12874 pub fn set_automation<T>(mut self, v: T) -> Self
12875 where
12876 T: std::convert::Into<crate::model::AutomationRolloutMetadata>,
12877 {
12878 self.automation = std::option::Option::Some(v.into());
12879 self
12880 }
12881
12882 /// Sets or clears the value of [automation][crate::model::Metadata::automation].
12883 ///
12884 /// # Example
12885 /// ```ignore,no_run
12886 /// # use google_cloud_deploy_v1::model::Metadata;
12887 /// use google_cloud_deploy_v1::model::AutomationRolloutMetadata;
12888 /// let x = Metadata::new().set_or_clear_automation(Some(AutomationRolloutMetadata::default()/* use setters */));
12889 /// let x = Metadata::new().set_or_clear_automation(None::<AutomationRolloutMetadata>);
12890 /// ```
12891 pub fn set_or_clear_automation<T>(mut self, v: std::option::Option<T>) -> Self
12892 where
12893 T: std::convert::Into<crate::model::AutomationRolloutMetadata>,
12894 {
12895 self.automation = v.map(|x| x.into());
12896 self
12897 }
12898
12899 /// Sets the value of [custom][crate::model::Metadata::custom].
12900 ///
12901 /// # Example
12902 /// ```ignore,no_run
12903 /// # use google_cloud_deploy_v1::model::Metadata;
12904 /// use google_cloud_deploy_v1::model::CustomMetadata;
12905 /// let x = Metadata::new().set_custom(CustomMetadata::default()/* use setters */);
12906 /// ```
12907 pub fn set_custom<T>(mut self, v: T) -> Self
12908 where
12909 T: std::convert::Into<crate::model::CustomMetadata>,
12910 {
12911 self.custom = std::option::Option::Some(v.into());
12912 self
12913 }
12914
12915 /// Sets or clears the value of [custom][crate::model::Metadata::custom].
12916 ///
12917 /// # Example
12918 /// ```ignore,no_run
12919 /// # use google_cloud_deploy_v1::model::Metadata;
12920 /// use google_cloud_deploy_v1::model::CustomMetadata;
12921 /// let x = Metadata::new().set_or_clear_custom(Some(CustomMetadata::default()/* use setters */));
12922 /// let x = Metadata::new().set_or_clear_custom(None::<CustomMetadata>);
12923 /// ```
12924 pub fn set_or_clear_custom<T>(mut self, v: std::option::Option<T>) -> Self
12925 where
12926 T: std::convert::Into<crate::model::CustomMetadata>,
12927 {
12928 self.custom = v.map(|x| x.into());
12929 self
12930 }
12931}
12932
12933impl wkt::message::Message for Metadata {
12934 fn typename() -> &'static str {
12935 "type.googleapis.com/google.cloud.deploy.v1.Metadata"
12936 }
12937}
12938
12939/// DeployJobRunMetadata surfaces information associated with a `DeployJobRun` to
12940/// the user.
12941#[derive(Clone, Default, PartialEq)]
12942#[non_exhaustive]
12943pub struct DeployJobRunMetadata {
12944 /// Output only. The name of the Cloud Run Service that is associated with a
12945 /// `DeployJobRun`.
12946 pub cloud_run: std::option::Option<crate::model::CloudRunMetadata>,
12947
12948 /// Output only. Custom Target metadata associated with a `DeployJobRun`.
12949 pub custom_target: std::option::Option<crate::model::CustomTargetDeployMetadata>,
12950
12951 /// Output only. Custom metadata provided by user-defined deploy operation.
12952 pub custom: std::option::Option<crate::model::CustomMetadata>,
12953
12954 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12955}
12956
12957impl DeployJobRunMetadata {
12958 pub fn new() -> Self {
12959 std::default::Default::default()
12960 }
12961
12962 /// Sets the value of [cloud_run][crate::model::DeployJobRunMetadata::cloud_run].
12963 ///
12964 /// # Example
12965 /// ```ignore,no_run
12966 /// # use google_cloud_deploy_v1::model::DeployJobRunMetadata;
12967 /// use google_cloud_deploy_v1::model::CloudRunMetadata;
12968 /// let x = DeployJobRunMetadata::new().set_cloud_run(CloudRunMetadata::default()/* use setters */);
12969 /// ```
12970 pub fn set_cloud_run<T>(mut self, v: T) -> Self
12971 where
12972 T: std::convert::Into<crate::model::CloudRunMetadata>,
12973 {
12974 self.cloud_run = std::option::Option::Some(v.into());
12975 self
12976 }
12977
12978 /// Sets or clears the value of [cloud_run][crate::model::DeployJobRunMetadata::cloud_run].
12979 ///
12980 /// # Example
12981 /// ```ignore,no_run
12982 /// # use google_cloud_deploy_v1::model::DeployJobRunMetadata;
12983 /// use google_cloud_deploy_v1::model::CloudRunMetadata;
12984 /// let x = DeployJobRunMetadata::new().set_or_clear_cloud_run(Some(CloudRunMetadata::default()/* use setters */));
12985 /// let x = DeployJobRunMetadata::new().set_or_clear_cloud_run(None::<CloudRunMetadata>);
12986 /// ```
12987 pub fn set_or_clear_cloud_run<T>(mut self, v: std::option::Option<T>) -> Self
12988 where
12989 T: std::convert::Into<crate::model::CloudRunMetadata>,
12990 {
12991 self.cloud_run = v.map(|x| x.into());
12992 self
12993 }
12994
12995 /// Sets the value of [custom_target][crate::model::DeployJobRunMetadata::custom_target].
12996 ///
12997 /// # Example
12998 /// ```ignore,no_run
12999 /// # use google_cloud_deploy_v1::model::DeployJobRunMetadata;
13000 /// use google_cloud_deploy_v1::model::CustomTargetDeployMetadata;
13001 /// let x = DeployJobRunMetadata::new().set_custom_target(CustomTargetDeployMetadata::default()/* use setters */);
13002 /// ```
13003 pub fn set_custom_target<T>(mut self, v: T) -> Self
13004 where
13005 T: std::convert::Into<crate::model::CustomTargetDeployMetadata>,
13006 {
13007 self.custom_target = std::option::Option::Some(v.into());
13008 self
13009 }
13010
13011 /// Sets or clears the value of [custom_target][crate::model::DeployJobRunMetadata::custom_target].
13012 ///
13013 /// # Example
13014 /// ```ignore,no_run
13015 /// # use google_cloud_deploy_v1::model::DeployJobRunMetadata;
13016 /// use google_cloud_deploy_v1::model::CustomTargetDeployMetadata;
13017 /// let x = DeployJobRunMetadata::new().set_or_clear_custom_target(Some(CustomTargetDeployMetadata::default()/* use setters */));
13018 /// let x = DeployJobRunMetadata::new().set_or_clear_custom_target(None::<CustomTargetDeployMetadata>);
13019 /// ```
13020 pub fn set_or_clear_custom_target<T>(mut self, v: std::option::Option<T>) -> Self
13021 where
13022 T: std::convert::Into<crate::model::CustomTargetDeployMetadata>,
13023 {
13024 self.custom_target = v.map(|x| x.into());
13025 self
13026 }
13027
13028 /// Sets the value of [custom][crate::model::DeployJobRunMetadata::custom].
13029 ///
13030 /// # Example
13031 /// ```ignore,no_run
13032 /// # use google_cloud_deploy_v1::model::DeployJobRunMetadata;
13033 /// use google_cloud_deploy_v1::model::CustomMetadata;
13034 /// let x = DeployJobRunMetadata::new().set_custom(CustomMetadata::default()/* use setters */);
13035 /// ```
13036 pub fn set_custom<T>(mut self, v: T) -> Self
13037 where
13038 T: std::convert::Into<crate::model::CustomMetadata>,
13039 {
13040 self.custom = std::option::Option::Some(v.into());
13041 self
13042 }
13043
13044 /// Sets or clears the value of [custom][crate::model::DeployJobRunMetadata::custom].
13045 ///
13046 /// # Example
13047 /// ```ignore,no_run
13048 /// # use google_cloud_deploy_v1::model::DeployJobRunMetadata;
13049 /// use google_cloud_deploy_v1::model::CustomMetadata;
13050 /// let x = DeployJobRunMetadata::new().set_or_clear_custom(Some(CustomMetadata::default()/* use setters */));
13051 /// let x = DeployJobRunMetadata::new().set_or_clear_custom(None::<CustomMetadata>);
13052 /// ```
13053 pub fn set_or_clear_custom<T>(mut self, v: std::option::Option<T>) -> Self
13054 where
13055 T: std::convert::Into<crate::model::CustomMetadata>,
13056 {
13057 self.custom = v.map(|x| x.into());
13058 self
13059 }
13060}
13061
13062impl wkt::message::Message for DeployJobRunMetadata {
13063 fn typename() -> &'static str {
13064 "type.googleapis.com/google.cloud.deploy.v1.DeployJobRunMetadata"
13065 }
13066}
13067
13068/// CloudRunMetadata contains information from a Cloud Run deployment.
13069#[derive(Clone, Default, PartialEq)]
13070#[non_exhaustive]
13071pub struct CloudRunMetadata {
13072 /// Output only. The name of the Cloud Run Service that is associated with a
13073 /// `Rollout`. Format is
13074 /// `projects/{project}/locations/{location}/services/{service}`.
13075 pub service: std::string::String,
13076
13077 /// Output only. The Cloud Run Service urls that are associated with a
13078 /// `Rollout`.
13079 pub service_urls: std::vec::Vec<std::string::String>,
13080
13081 /// Output only. The Cloud Run Revision id associated with a `Rollout`.
13082 pub revision: std::string::String,
13083
13084 /// Output only. The name of the Cloud Run job that is associated with a
13085 /// `Rollout`. Format is
13086 /// `projects/{project}/locations/{location}/jobs/{job_name}`.
13087 pub job: std::string::String,
13088
13089 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13090}
13091
13092impl CloudRunMetadata {
13093 pub fn new() -> Self {
13094 std::default::Default::default()
13095 }
13096
13097 /// Sets the value of [service][crate::model::CloudRunMetadata::service].
13098 ///
13099 /// # Example
13100 /// ```ignore,no_run
13101 /// # use google_cloud_deploy_v1::model::CloudRunMetadata;
13102 /// let x = CloudRunMetadata::new().set_service("example");
13103 /// ```
13104 pub fn set_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13105 self.service = v.into();
13106 self
13107 }
13108
13109 /// Sets the value of [service_urls][crate::model::CloudRunMetadata::service_urls].
13110 ///
13111 /// # Example
13112 /// ```ignore,no_run
13113 /// # use google_cloud_deploy_v1::model::CloudRunMetadata;
13114 /// let x = CloudRunMetadata::new().set_service_urls(["a", "b", "c"]);
13115 /// ```
13116 pub fn set_service_urls<T, V>(mut self, v: T) -> Self
13117 where
13118 T: std::iter::IntoIterator<Item = V>,
13119 V: std::convert::Into<std::string::String>,
13120 {
13121 use std::iter::Iterator;
13122 self.service_urls = v.into_iter().map(|i| i.into()).collect();
13123 self
13124 }
13125
13126 /// Sets the value of [revision][crate::model::CloudRunMetadata::revision].
13127 ///
13128 /// # Example
13129 /// ```ignore,no_run
13130 /// # use google_cloud_deploy_v1::model::CloudRunMetadata;
13131 /// let x = CloudRunMetadata::new().set_revision("example");
13132 /// ```
13133 pub fn set_revision<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13134 self.revision = v.into();
13135 self
13136 }
13137
13138 /// Sets the value of [job][crate::model::CloudRunMetadata::job].
13139 ///
13140 /// # Example
13141 /// ```ignore,no_run
13142 /// # use google_cloud_deploy_v1::model::CloudRunMetadata;
13143 /// let x = CloudRunMetadata::new().set_job("example");
13144 /// ```
13145 pub fn set_job<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13146 self.job = v.into();
13147 self
13148 }
13149}
13150
13151impl wkt::message::Message for CloudRunMetadata {
13152 fn typename() -> &'static str {
13153 "type.googleapis.com/google.cloud.deploy.v1.CloudRunMetadata"
13154 }
13155}
13156
13157/// CustomTargetDeployMetadata contains information from a Custom Target
13158/// deploy operation.
13159#[derive(Clone, Default, PartialEq)]
13160#[non_exhaustive]
13161pub struct CustomTargetDeployMetadata {
13162 /// Output only. Skip message provided in the results of a custom deploy
13163 /// operation.
13164 pub skip_message: std::string::String,
13165
13166 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13167}
13168
13169impl CustomTargetDeployMetadata {
13170 pub fn new() -> Self {
13171 std::default::Default::default()
13172 }
13173
13174 /// Sets the value of [skip_message][crate::model::CustomTargetDeployMetadata::skip_message].
13175 ///
13176 /// # Example
13177 /// ```ignore,no_run
13178 /// # use google_cloud_deploy_v1::model::CustomTargetDeployMetadata;
13179 /// let x = CustomTargetDeployMetadata::new().set_skip_message("example");
13180 /// ```
13181 pub fn set_skip_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13182 self.skip_message = v.into();
13183 self
13184 }
13185}
13186
13187impl wkt::message::Message for CustomTargetDeployMetadata {
13188 fn typename() -> &'static str {
13189 "type.googleapis.com/google.cloud.deploy.v1.CustomTargetDeployMetadata"
13190 }
13191}
13192
13193/// AutomationRolloutMetadata contains Automation-related actions that
13194/// were performed on a rollout.
13195#[derive(Clone, Default, PartialEq)]
13196#[non_exhaustive]
13197pub struct AutomationRolloutMetadata {
13198 /// Output only. The name of the AutomationRun initiated by a promote release
13199 /// rule.
13200 pub promote_automation_run: std::string::String,
13201
13202 /// Output only. The names of the AutomationRuns initiated by an advance
13203 /// rollout rule.
13204 pub advance_automation_runs: std::vec::Vec<std::string::String>,
13205
13206 /// Output only. The names of the AutomationRuns initiated by a repair rollout
13207 /// rule.
13208 pub repair_automation_runs: std::vec::Vec<std::string::String>,
13209
13210 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13211}
13212
13213impl AutomationRolloutMetadata {
13214 pub fn new() -> Self {
13215 std::default::Default::default()
13216 }
13217
13218 /// Sets the value of [promote_automation_run][crate::model::AutomationRolloutMetadata::promote_automation_run].
13219 ///
13220 /// # Example
13221 /// ```ignore,no_run
13222 /// # use google_cloud_deploy_v1::model::AutomationRolloutMetadata;
13223 /// let x = AutomationRolloutMetadata::new().set_promote_automation_run("example");
13224 /// ```
13225 pub fn set_promote_automation_run<T: std::convert::Into<std::string::String>>(
13226 mut self,
13227 v: T,
13228 ) -> Self {
13229 self.promote_automation_run = v.into();
13230 self
13231 }
13232
13233 /// Sets the value of [advance_automation_runs][crate::model::AutomationRolloutMetadata::advance_automation_runs].
13234 ///
13235 /// # Example
13236 /// ```ignore,no_run
13237 /// # use google_cloud_deploy_v1::model::AutomationRolloutMetadata;
13238 /// let x = AutomationRolloutMetadata::new().set_advance_automation_runs(["a", "b", "c"]);
13239 /// ```
13240 pub fn set_advance_automation_runs<T, V>(mut self, v: T) -> Self
13241 where
13242 T: std::iter::IntoIterator<Item = V>,
13243 V: std::convert::Into<std::string::String>,
13244 {
13245 use std::iter::Iterator;
13246 self.advance_automation_runs = v.into_iter().map(|i| i.into()).collect();
13247 self
13248 }
13249
13250 /// Sets the value of [repair_automation_runs][crate::model::AutomationRolloutMetadata::repair_automation_runs].
13251 ///
13252 /// # Example
13253 /// ```ignore,no_run
13254 /// # use google_cloud_deploy_v1::model::AutomationRolloutMetadata;
13255 /// let x = AutomationRolloutMetadata::new().set_repair_automation_runs(["a", "b", "c"]);
13256 /// ```
13257 pub fn set_repair_automation_runs<T, V>(mut self, v: T) -> Self
13258 where
13259 T: std::iter::IntoIterator<Item = V>,
13260 V: std::convert::Into<std::string::String>,
13261 {
13262 use std::iter::Iterator;
13263 self.repair_automation_runs = v.into_iter().map(|i| i.into()).collect();
13264 self
13265 }
13266}
13267
13268impl wkt::message::Message for AutomationRolloutMetadata {
13269 fn typename() -> &'static str {
13270 "type.googleapis.com/google.cloud.deploy.v1.AutomationRolloutMetadata"
13271 }
13272}
13273
13274/// CustomMetadata contains information from a user-defined operation.
13275#[derive(Clone, Default, PartialEq)]
13276#[non_exhaustive]
13277pub struct CustomMetadata {
13278 /// Output only. Key-value pairs provided by the user-defined operation.
13279 pub values: std::collections::HashMap<std::string::String, std::string::String>,
13280
13281 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13282}
13283
13284impl CustomMetadata {
13285 pub fn new() -> Self {
13286 std::default::Default::default()
13287 }
13288
13289 /// Sets the value of [values][crate::model::CustomMetadata::values].
13290 ///
13291 /// # Example
13292 /// ```ignore,no_run
13293 /// # use google_cloud_deploy_v1::model::CustomMetadata;
13294 /// let x = CustomMetadata::new().set_values([
13295 /// ("key0", "abc"),
13296 /// ("key1", "xyz"),
13297 /// ]);
13298 /// ```
13299 pub fn set_values<T, K, V>(mut self, v: T) -> Self
13300 where
13301 T: std::iter::IntoIterator<Item = (K, V)>,
13302 K: std::convert::Into<std::string::String>,
13303 V: std::convert::Into<std::string::String>,
13304 {
13305 use std::iter::Iterator;
13306 self.values = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
13307 self
13308 }
13309}
13310
13311impl wkt::message::Message for CustomMetadata {
13312 fn typename() -> &'static str {
13313 "type.googleapis.com/google.cloud.deploy.v1.CustomMetadata"
13314 }
13315}
13316
13317/// Phase represents a collection of jobs that are logically grouped together
13318/// for a `Rollout`.
13319#[derive(Clone, Default, PartialEq)]
13320#[non_exhaustive]
13321pub struct Phase {
13322 /// Output only. The ID of the Phase.
13323 pub id: std::string::String,
13324
13325 /// Output only. Current state of the Phase.
13326 pub state: crate::model::phase::State,
13327
13328 /// Output only. Additional information on why the Phase was skipped, if
13329 /// available.
13330 pub skip_message: std::string::String,
13331
13332 /// The job composition of this Phase.
13333 pub jobs: std::option::Option<crate::model::phase::Jobs>,
13334
13335 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13336}
13337
13338impl Phase {
13339 pub fn new() -> Self {
13340 std::default::Default::default()
13341 }
13342
13343 /// Sets the value of [id][crate::model::Phase::id].
13344 ///
13345 /// # Example
13346 /// ```ignore,no_run
13347 /// # use google_cloud_deploy_v1::model::Phase;
13348 /// let x = Phase::new().set_id("example");
13349 /// ```
13350 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13351 self.id = v.into();
13352 self
13353 }
13354
13355 /// Sets the value of [state][crate::model::Phase::state].
13356 ///
13357 /// # Example
13358 /// ```ignore,no_run
13359 /// # use google_cloud_deploy_v1::model::Phase;
13360 /// use google_cloud_deploy_v1::model::phase::State;
13361 /// let x0 = Phase::new().set_state(State::Pending);
13362 /// let x1 = Phase::new().set_state(State::InProgress);
13363 /// let x2 = Phase::new().set_state(State::Succeeded);
13364 /// ```
13365 pub fn set_state<T: std::convert::Into<crate::model::phase::State>>(mut self, v: T) -> Self {
13366 self.state = v.into();
13367 self
13368 }
13369
13370 /// Sets the value of [skip_message][crate::model::Phase::skip_message].
13371 ///
13372 /// # Example
13373 /// ```ignore,no_run
13374 /// # use google_cloud_deploy_v1::model::Phase;
13375 /// let x = Phase::new().set_skip_message("example");
13376 /// ```
13377 pub fn set_skip_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13378 self.skip_message = v.into();
13379 self
13380 }
13381
13382 /// Sets the value of [jobs][crate::model::Phase::jobs].
13383 ///
13384 /// Note that all the setters affecting `jobs` are mutually
13385 /// exclusive.
13386 ///
13387 /// # Example
13388 /// ```ignore,no_run
13389 /// # use google_cloud_deploy_v1::model::Phase;
13390 /// use google_cloud_deploy_v1::model::DeploymentJobs;
13391 /// let x = Phase::new().set_jobs(Some(
13392 /// google_cloud_deploy_v1::model::phase::Jobs::DeploymentJobs(DeploymentJobs::default().into())));
13393 /// ```
13394 pub fn set_jobs<T: std::convert::Into<std::option::Option<crate::model::phase::Jobs>>>(
13395 mut self,
13396 v: T,
13397 ) -> Self {
13398 self.jobs = v.into();
13399 self
13400 }
13401
13402 /// The value of [jobs][crate::model::Phase::jobs]
13403 /// if it holds a `DeploymentJobs`, `None` if the field is not set or
13404 /// holds a different branch.
13405 pub fn deployment_jobs(
13406 &self,
13407 ) -> std::option::Option<&std::boxed::Box<crate::model::DeploymentJobs>> {
13408 #[allow(unreachable_patterns)]
13409 self.jobs.as_ref().and_then(|v| match v {
13410 crate::model::phase::Jobs::DeploymentJobs(v) => std::option::Option::Some(v),
13411 _ => std::option::Option::None,
13412 })
13413 }
13414
13415 /// Sets the value of [jobs][crate::model::Phase::jobs]
13416 /// to hold a `DeploymentJobs`.
13417 ///
13418 /// Note that all the setters affecting `jobs` are
13419 /// mutually exclusive.
13420 ///
13421 /// # Example
13422 /// ```ignore,no_run
13423 /// # use google_cloud_deploy_v1::model::Phase;
13424 /// use google_cloud_deploy_v1::model::DeploymentJobs;
13425 /// let x = Phase::new().set_deployment_jobs(DeploymentJobs::default()/* use setters */);
13426 /// assert!(x.deployment_jobs().is_some());
13427 /// assert!(x.child_rollout_jobs().is_none());
13428 /// ```
13429 pub fn set_deployment_jobs<
13430 T: std::convert::Into<std::boxed::Box<crate::model::DeploymentJobs>>,
13431 >(
13432 mut self,
13433 v: T,
13434 ) -> Self {
13435 self.jobs = std::option::Option::Some(crate::model::phase::Jobs::DeploymentJobs(v.into()));
13436 self
13437 }
13438
13439 /// The value of [jobs][crate::model::Phase::jobs]
13440 /// if it holds a `ChildRolloutJobs`, `None` if the field is not set or
13441 /// holds a different branch.
13442 pub fn child_rollout_jobs(
13443 &self,
13444 ) -> std::option::Option<&std::boxed::Box<crate::model::ChildRolloutJobs>> {
13445 #[allow(unreachable_patterns)]
13446 self.jobs.as_ref().and_then(|v| match v {
13447 crate::model::phase::Jobs::ChildRolloutJobs(v) => std::option::Option::Some(v),
13448 _ => std::option::Option::None,
13449 })
13450 }
13451
13452 /// Sets the value of [jobs][crate::model::Phase::jobs]
13453 /// to hold a `ChildRolloutJobs`.
13454 ///
13455 /// Note that all the setters affecting `jobs` are
13456 /// mutually exclusive.
13457 ///
13458 /// # Example
13459 /// ```ignore,no_run
13460 /// # use google_cloud_deploy_v1::model::Phase;
13461 /// use google_cloud_deploy_v1::model::ChildRolloutJobs;
13462 /// let x = Phase::new().set_child_rollout_jobs(ChildRolloutJobs::default()/* use setters */);
13463 /// assert!(x.child_rollout_jobs().is_some());
13464 /// assert!(x.deployment_jobs().is_none());
13465 /// ```
13466 pub fn set_child_rollout_jobs<
13467 T: std::convert::Into<std::boxed::Box<crate::model::ChildRolloutJobs>>,
13468 >(
13469 mut self,
13470 v: T,
13471 ) -> Self {
13472 self.jobs =
13473 std::option::Option::Some(crate::model::phase::Jobs::ChildRolloutJobs(v.into()));
13474 self
13475 }
13476}
13477
13478impl wkt::message::Message for Phase {
13479 fn typename() -> &'static str {
13480 "type.googleapis.com/google.cloud.deploy.v1.Phase"
13481 }
13482}
13483
13484/// Defines additional types related to [Phase].
13485pub mod phase {
13486 #[allow(unused_imports)]
13487 use super::*;
13488
13489 /// Valid states of a Phase.
13490 ///
13491 /// # Working with unknown values
13492 ///
13493 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13494 /// additional enum variants at any time. Adding new variants is not considered
13495 /// a breaking change. Applications should write their code in anticipation of:
13496 ///
13497 /// - New values appearing in future releases of the client library, **and**
13498 /// - New values received dynamically, without application changes.
13499 ///
13500 /// Please consult the [Working with enums] section in the user guide for some
13501 /// guidelines.
13502 ///
13503 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
13504 #[derive(Clone, Debug, PartialEq)]
13505 #[non_exhaustive]
13506 pub enum State {
13507 /// The Phase has an unspecified state.
13508 Unspecified,
13509 /// The Phase is waiting for an earlier Phase(s) to complete.
13510 Pending,
13511 /// The Phase is in progress.
13512 InProgress,
13513 /// The Phase has succeeded.
13514 Succeeded,
13515 /// The Phase has failed.
13516 Failed,
13517 /// The Phase was aborted.
13518 Aborted,
13519 /// The Phase was skipped.
13520 Skipped,
13521 /// If set, the enum was initialized with an unknown value.
13522 ///
13523 /// Applications can examine the value using [State::value] or
13524 /// [State::name].
13525 UnknownValue(state::UnknownValue),
13526 }
13527
13528 #[doc(hidden)]
13529 pub mod state {
13530 #[allow(unused_imports)]
13531 use super::*;
13532 #[derive(Clone, Debug, PartialEq)]
13533 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13534 }
13535
13536 impl State {
13537 /// Gets the enum value.
13538 ///
13539 /// Returns `None` if the enum contains an unknown value deserialized from
13540 /// the string representation of enums.
13541 pub fn value(&self) -> std::option::Option<i32> {
13542 match self {
13543 Self::Unspecified => std::option::Option::Some(0),
13544 Self::Pending => std::option::Option::Some(1),
13545 Self::InProgress => std::option::Option::Some(2),
13546 Self::Succeeded => std::option::Option::Some(3),
13547 Self::Failed => std::option::Option::Some(4),
13548 Self::Aborted => std::option::Option::Some(5),
13549 Self::Skipped => std::option::Option::Some(6),
13550 Self::UnknownValue(u) => u.0.value(),
13551 }
13552 }
13553
13554 /// Gets the enum value as a string.
13555 ///
13556 /// Returns `None` if the enum contains an unknown value deserialized from
13557 /// the integer representation of enums.
13558 pub fn name(&self) -> std::option::Option<&str> {
13559 match self {
13560 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
13561 Self::Pending => std::option::Option::Some("PENDING"),
13562 Self::InProgress => std::option::Option::Some("IN_PROGRESS"),
13563 Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
13564 Self::Failed => std::option::Option::Some("FAILED"),
13565 Self::Aborted => std::option::Option::Some("ABORTED"),
13566 Self::Skipped => std::option::Option::Some("SKIPPED"),
13567 Self::UnknownValue(u) => u.0.name(),
13568 }
13569 }
13570 }
13571
13572 impl std::default::Default for State {
13573 fn default() -> Self {
13574 use std::convert::From;
13575 Self::from(0)
13576 }
13577 }
13578
13579 impl std::fmt::Display for State {
13580 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13581 wkt::internal::display_enum(f, self.name(), self.value())
13582 }
13583 }
13584
13585 impl std::convert::From<i32> for State {
13586 fn from(value: i32) -> Self {
13587 match value {
13588 0 => Self::Unspecified,
13589 1 => Self::Pending,
13590 2 => Self::InProgress,
13591 3 => Self::Succeeded,
13592 4 => Self::Failed,
13593 5 => Self::Aborted,
13594 6 => Self::Skipped,
13595 _ => Self::UnknownValue(state::UnknownValue(
13596 wkt::internal::UnknownEnumValue::Integer(value),
13597 )),
13598 }
13599 }
13600 }
13601
13602 impl std::convert::From<&str> for State {
13603 fn from(value: &str) -> Self {
13604 use std::string::ToString;
13605 match value {
13606 "STATE_UNSPECIFIED" => Self::Unspecified,
13607 "PENDING" => Self::Pending,
13608 "IN_PROGRESS" => Self::InProgress,
13609 "SUCCEEDED" => Self::Succeeded,
13610 "FAILED" => Self::Failed,
13611 "ABORTED" => Self::Aborted,
13612 "SKIPPED" => Self::Skipped,
13613 _ => Self::UnknownValue(state::UnknownValue(
13614 wkt::internal::UnknownEnumValue::String(value.to_string()),
13615 )),
13616 }
13617 }
13618 }
13619
13620 impl serde::ser::Serialize for State {
13621 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13622 where
13623 S: serde::Serializer,
13624 {
13625 match self {
13626 Self::Unspecified => serializer.serialize_i32(0),
13627 Self::Pending => serializer.serialize_i32(1),
13628 Self::InProgress => serializer.serialize_i32(2),
13629 Self::Succeeded => serializer.serialize_i32(3),
13630 Self::Failed => serializer.serialize_i32(4),
13631 Self::Aborted => serializer.serialize_i32(5),
13632 Self::Skipped => serializer.serialize_i32(6),
13633 Self::UnknownValue(u) => u.0.serialize(serializer),
13634 }
13635 }
13636 }
13637
13638 impl<'de> serde::de::Deserialize<'de> for State {
13639 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13640 where
13641 D: serde::Deserializer<'de>,
13642 {
13643 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
13644 ".google.cloud.deploy.v1.Phase.State",
13645 ))
13646 }
13647 }
13648
13649 /// The job composition of this Phase.
13650 #[derive(Clone, Debug, PartialEq)]
13651 #[non_exhaustive]
13652 pub enum Jobs {
13653 /// Output only. Deployment job composition.
13654 DeploymentJobs(std::boxed::Box<crate::model::DeploymentJobs>),
13655 /// Output only. ChildRollout job composition.
13656 ChildRolloutJobs(std::boxed::Box<crate::model::ChildRolloutJobs>),
13657 }
13658}
13659
13660/// Deployment job composition.
13661#[derive(Clone, Default, PartialEq)]
13662#[non_exhaustive]
13663pub struct DeploymentJobs {
13664 /// Output only. The predeploy Job, which is the first job on the phase.
13665 pub predeploy_job: std::option::Option<crate::model::Job>,
13666
13667 /// Output only. The deploy Job. This is the deploy job in the phase.
13668 pub deploy_job: std::option::Option<crate::model::Job>,
13669
13670 /// Output only. The verify Job. Runs after a deploy if the deploy succeeds.
13671 pub verify_job: std::option::Option<crate::model::Job>,
13672
13673 /// Output only. The postdeploy Job, which is the last job on the phase.
13674 pub postdeploy_job: std::option::Option<crate::model::Job>,
13675
13676 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13677}
13678
13679impl DeploymentJobs {
13680 pub fn new() -> Self {
13681 std::default::Default::default()
13682 }
13683
13684 /// Sets the value of [predeploy_job][crate::model::DeploymentJobs::predeploy_job].
13685 ///
13686 /// # Example
13687 /// ```ignore,no_run
13688 /// # use google_cloud_deploy_v1::model::DeploymentJobs;
13689 /// use google_cloud_deploy_v1::model::Job;
13690 /// let x = DeploymentJobs::new().set_predeploy_job(Job::default()/* use setters */);
13691 /// ```
13692 pub fn set_predeploy_job<T>(mut self, v: T) -> Self
13693 where
13694 T: std::convert::Into<crate::model::Job>,
13695 {
13696 self.predeploy_job = std::option::Option::Some(v.into());
13697 self
13698 }
13699
13700 /// Sets or clears the value of [predeploy_job][crate::model::DeploymentJobs::predeploy_job].
13701 ///
13702 /// # Example
13703 /// ```ignore,no_run
13704 /// # use google_cloud_deploy_v1::model::DeploymentJobs;
13705 /// use google_cloud_deploy_v1::model::Job;
13706 /// let x = DeploymentJobs::new().set_or_clear_predeploy_job(Some(Job::default()/* use setters */));
13707 /// let x = DeploymentJobs::new().set_or_clear_predeploy_job(None::<Job>);
13708 /// ```
13709 pub fn set_or_clear_predeploy_job<T>(mut self, v: std::option::Option<T>) -> Self
13710 where
13711 T: std::convert::Into<crate::model::Job>,
13712 {
13713 self.predeploy_job = v.map(|x| x.into());
13714 self
13715 }
13716
13717 /// Sets the value of [deploy_job][crate::model::DeploymentJobs::deploy_job].
13718 ///
13719 /// # Example
13720 /// ```ignore,no_run
13721 /// # use google_cloud_deploy_v1::model::DeploymentJobs;
13722 /// use google_cloud_deploy_v1::model::Job;
13723 /// let x = DeploymentJobs::new().set_deploy_job(Job::default()/* use setters */);
13724 /// ```
13725 pub fn set_deploy_job<T>(mut self, v: T) -> Self
13726 where
13727 T: std::convert::Into<crate::model::Job>,
13728 {
13729 self.deploy_job = std::option::Option::Some(v.into());
13730 self
13731 }
13732
13733 /// Sets or clears the value of [deploy_job][crate::model::DeploymentJobs::deploy_job].
13734 ///
13735 /// # Example
13736 /// ```ignore,no_run
13737 /// # use google_cloud_deploy_v1::model::DeploymentJobs;
13738 /// use google_cloud_deploy_v1::model::Job;
13739 /// let x = DeploymentJobs::new().set_or_clear_deploy_job(Some(Job::default()/* use setters */));
13740 /// let x = DeploymentJobs::new().set_or_clear_deploy_job(None::<Job>);
13741 /// ```
13742 pub fn set_or_clear_deploy_job<T>(mut self, v: std::option::Option<T>) -> Self
13743 where
13744 T: std::convert::Into<crate::model::Job>,
13745 {
13746 self.deploy_job = v.map(|x| x.into());
13747 self
13748 }
13749
13750 /// Sets the value of [verify_job][crate::model::DeploymentJobs::verify_job].
13751 ///
13752 /// # Example
13753 /// ```ignore,no_run
13754 /// # use google_cloud_deploy_v1::model::DeploymentJobs;
13755 /// use google_cloud_deploy_v1::model::Job;
13756 /// let x = DeploymentJobs::new().set_verify_job(Job::default()/* use setters */);
13757 /// ```
13758 pub fn set_verify_job<T>(mut self, v: T) -> Self
13759 where
13760 T: std::convert::Into<crate::model::Job>,
13761 {
13762 self.verify_job = std::option::Option::Some(v.into());
13763 self
13764 }
13765
13766 /// Sets or clears the value of [verify_job][crate::model::DeploymentJobs::verify_job].
13767 ///
13768 /// # Example
13769 /// ```ignore,no_run
13770 /// # use google_cloud_deploy_v1::model::DeploymentJobs;
13771 /// use google_cloud_deploy_v1::model::Job;
13772 /// let x = DeploymentJobs::new().set_or_clear_verify_job(Some(Job::default()/* use setters */));
13773 /// let x = DeploymentJobs::new().set_or_clear_verify_job(None::<Job>);
13774 /// ```
13775 pub fn set_or_clear_verify_job<T>(mut self, v: std::option::Option<T>) -> Self
13776 where
13777 T: std::convert::Into<crate::model::Job>,
13778 {
13779 self.verify_job = v.map(|x| x.into());
13780 self
13781 }
13782
13783 /// Sets the value of [postdeploy_job][crate::model::DeploymentJobs::postdeploy_job].
13784 ///
13785 /// # Example
13786 /// ```ignore,no_run
13787 /// # use google_cloud_deploy_v1::model::DeploymentJobs;
13788 /// use google_cloud_deploy_v1::model::Job;
13789 /// let x = DeploymentJobs::new().set_postdeploy_job(Job::default()/* use setters */);
13790 /// ```
13791 pub fn set_postdeploy_job<T>(mut self, v: T) -> Self
13792 where
13793 T: std::convert::Into<crate::model::Job>,
13794 {
13795 self.postdeploy_job = std::option::Option::Some(v.into());
13796 self
13797 }
13798
13799 /// Sets or clears the value of [postdeploy_job][crate::model::DeploymentJobs::postdeploy_job].
13800 ///
13801 /// # Example
13802 /// ```ignore,no_run
13803 /// # use google_cloud_deploy_v1::model::DeploymentJobs;
13804 /// use google_cloud_deploy_v1::model::Job;
13805 /// let x = DeploymentJobs::new().set_or_clear_postdeploy_job(Some(Job::default()/* use setters */));
13806 /// let x = DeploymentJobs::new().set_or_clear_postdeploy_job(None::<Job>);
13807 /// ```
13808 pub fn set_or_clear_postdeploy_job<T>(mut self, v: std::option::Option<T>) -> Self
13809 where
13810 T: std::convert::Into<crate::model::Job>,
13811 {
13812 self.postdeploy_job = v.map(|x| x.into());
13813 self
13814 }
13815}
13816
13817impl wkt::message::Message for DeploymentJobs {
13818 fn typename() -> &'static str {
13819 "type.googleapis.com/google.cloud.deploy.v1.DeploymentJobs"
13820 }
13821}
13822
13823/// ChildRollouts job composition
13824#[derive(Clone, Default, PartialEq)]
13825#[non_exhaustive]
13826pub struct ChildRolloutJobs {
13827 /// Output only. List of CreateChildRolloutJobs
13828 pub create_rollout_jobs: std::vec::Vec<crate::model::Job>,
13829
13830 /// Output only. List of AdvanceChildRolloutJobs
13831 pub advance_rollout_jobs: std::vec::Vec<crate::model::Job>,
13832
13833 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13834}
13835
13836impl ChildRolloutJobs {
13837 pub fn new() -> Self {
13838 std::default::Default::default()
13839 }
13840
13841 /// Sets the value of [create_rollout_jobs][crate::model::ChildRolloutJobs::create_rollout_jobs].
13842 ///
13843 /// # Example
13844 /// ```ignore,no_run
13845 /// # use google_cloud_deploy_v1::model::ChildRolloutJobs;
13846 /// use google_cloud_deploy_v1::model::Job;
13847 /// let x = ChildRolloutJobs::new()
13848 /// .set_create_rollout_jobs([
13849 /// Job::default()/* use setters */,
13850 /// Job::default()/* use (different) setters */,
13851 /// ]);
13852 /// ```
13853 pub fn set_create_rollout_jobs<T, V>(mut self, v: T) -> Self
13854 where
13855 T: std::iter::IntoIterator<Item = V>,
13856 V: std::convert::Into<crate::model::Job>,
13857 {
13858 use std::iter::Iterator;
13859 self.create_rollout_jobs = v.into_iter().map(|i| i.into()).collect();
13860 self
13861 }
13862
13863 /// Sets the value of [advance_rollout_jobs][crate::model::ChildRolloutJobs::advance_rollout_jobs].
13864 ///
13865 /// # Example
13866 /// ```ignore,no_run
13867 /// # use google_cloud_deploy_v1::model::ChildRolloutJobs;
13868 /// use google_cloud_deploy_v1::model::Job;
13869 /// let x = ChildRolloutJobs::new()
13870 /// .set_advance_rollout_jobs([
13871 /// Job::default()/* use setters */,
13872 /// Job::default()/* use (different) setters */,
13873 /// ]);
13874 /// ```
13875 pub fn set_advance_rollout_jobs<T, V>(mut self, v: T) -> Self
13876 where
13877 T: std::iter::IntoIterator<Item = V>,
13878 V: std::convert::Into<crate::model::Job>,
13879 {
13880 use std::iter::Iterator;
13881 self.advance_rollout_jobs = v.into_iter().map(|i| i.into()).collect();
13882 self
13883 }
13884}
13885
13886impl wkt::message::Message for ChildRolloutJobs {
13887 fn typename() -> &'static str {
13888 "type.googleapis.com/google.cloud.deploy.v1.ChildRolloutJobs"
13889 }
13890}
13891
13892/// Job represents an operation for a `Rollout`.
13893#[derive(Clone, Default, PartialEq)]
13894#[non_exhaustive]
13895pub struct Job {
13896 /// Output only. The ID of the Job.
13897 pub id: std::string::String,
13898
13899 /// Output only. The current state of the Job.
13900 pub state: crate::model::job::State,
13901
13902 /// Output only. Additional information on why the Job was skipped, if
13903 /// available.
13904 pub skip_message: std::string::String,
13905
13906 /// Output only. The name of the `JobRun` responsible for the most recent
13907 /// invocation of this Job.
13908 pub job_run: std::string::String,
13909
13910 /// The type of Job.
13911 pub job_type: std::option::Option<crate::model::job::JobType>,
13912
13913 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13914}
13915
13916impl Job {
13917 pub fn new() -> Self {
13918 std::default::Default::default()
13919 }
13920
13921 /// Sets the value of [id][crate::model::Job::id].
13922 ///
13923 /// # Example
13924 /// ```ignore,no_run
13925 /// # use google_cloud_deploy_v1::model::Job;
13926 /// let x = Job::new().set_id("example");
13927 /// ```
13928 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13929 self.id = v.into();
13930 self
13931 }
13932
13933 /// Sets the value of [state][crate::model::Job::state].
13934 ///
13935 /// # Example
13936 /// ```ignore,no_run
13937 /// # use google_cloud_deploy_v1::model::Job;
13938 /// use google_cloud_deploy_v1::model::job::State;
13939 /// let x0 = Job::new().set_state(State::Pending);
13940 /// let x1 = Job::new().set_state(State::Disabled);
13941 /// let x2 = Job::new().set_state(State::InProgress);
13942 /// ```
13943 pub fn set_state<T: std::convert::Into<crate::model::job::State>>(mut self, v: T) -> Self {
13944 self.state = v.into();
13945 self
13946 }
13947
13948 /// Sets the value of [skip_message][crate::model::Job::skip_message].
13949 ///
13950 /// # Example
13951 /// ```ignore,no_run
13952 /// # use google_cloud_deploy_v1::model::Job;
13953 /// let x = Job::new().set_skip_message("example");
13954 /// ```
13955 pub fn set_skip_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13956 self.skip_message = v.into();
13957 self
13958 }
13959
13960 /// Sets the value of [job_run][crate::model::Job::job_run].
13961 ///
13962 /// # Example
13963 /// ```ignore,no_run
13964 /// # use google_cloud_deploy_v1::model::Job;
13965 /// let x = Job::new().set_job_run("example");
13966 /// ```
13967 pub fn set_job_run<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13968 self.job_run = v.into();
13969 self
13970 }
13971
13972 /// Sets the value of [job_type][crate::model::Job::job_type].
13973 ///
13974 /// Note that all the setters affecting `job_type` are mutually
13975 /// exclusive.
13976 ///
13977 /// # Example
13978 /// ```ignore,no_run
13979 /// # use google_cloud_deploy_v1::model::Job;
13980 /// use google_cloud_deploy_v1::model::DeployJob;
13981 /// let x = Job::new().set_job_type(Some(
13982 /// google_cloud_deploy_v1::model::job::JobType::DeployJob(DeployJob::default().into())));
13983 /// ```
13984 pub fn set_job_type<T: std::convert::Into<std::option::Option<crate::model::job::JobType>>>(
13985 mut self,
13986 v: T,
13987 ) -> Self {
13988 self.job_type = v.into();
13989 self
13990 }
13991
13992 /// The value of [job_type][crate::model::Job::job_type]
13993 /// if it holds a `DeployJob`, `None` if the field is not set or
13994 /// holds a different branch.
13995 pub fn deploy_job(&self) -> std::option::Option<&std::boxed::Box<crate::model::DeployJob>> {
13996 #[allow(unreachable_patterns)]
13997 self.job_type.as_ref().and_then(|v| match v {
13998 crate::model::job::JobType::DeployJob(v) => std::option::Option::Some(v),
13999 _ => std::option::Option::None,
14000 })
14001 }
14002
14003 /// Sets the value of [job_type][crate::model::Job::job_type]
14004 /// to hold a `DeployJob`.
14005 ///
14006 /// Note that all the setters affecting `job_type` are
14007 /// mutually exclusive.
14008 ///
14009 /// # Example
14010 /// ```ignore,no_run
14011 /// # use google_cloud_deploy_v1::model::Job;
14012 /// use google_cloud_deploy_v1::model::DeployJob;
14013 /// let x = Job::new().set_deploy_job(DeployJob::default()/* use setters */);
14014 /// assert!(x.deploy_job().is_some());
14015 /// assert!(x.verify_job().is_none());
14016 /// assert!(x.predeploy_job().is_none());
14017 /// assert!(x.postdeploy_job().is_none());
14018 /// assert!(x.create_child_rollout_job().is_none());
14019 /// assert!(x.advance_child_rollout_job().is_none());
14020 /// ```
14021 pub fn set_deploy_job<T: std::convert::Into<std::boxed::Box<crate::model::DeployJob>>>(
14022 mut self,
14023 v: T,
14024 ) -> Self {
14025 self.job_type = std::option::Option::Some(crate::model::job::JobType::DeployJob(v.into()));
14026 self
14027 }
14028
14029 /// The value of [job_type][crate::model::Job::job_type]
14030 /// if it holds a `VerifyJob`, `None` if the field is not set or
14031 /// holds a different branch.
14032 pub fn verify_job(&self) -> std::option::Option<&std::boxed::Box<crate::model::VerifyJob>> {
14033 #[allow(unreachable_patterns)]
14034 self.job_type.as_ref().and_then(|v| match v {
14035 crate::model::job::JobType::VerifyJob(v) => std::option::Option::Some(v),
14036 _ => std::option::Option::None,
14037 })
14038 }
14039
14040 /// Sets the value of [job_type][crate::model::Job::job_type]
14041 /// to hold a `VerifyJob`.
14042 ///
14043 /// Note that all the setters affecting `job_type` are
14044 /// mutually exclusive.
14045 ///
14046 /// # Example
14047 /// ```ignore,no_run
14048 /// # use google_cloud_deploy_v1::model::Job;
14049 /// use google_cloud_deploy_v1::model::VerifyJob;
14050 /// let x = Job::new().set_verify_job(VerifyJob::default()/* use setters */);
14051 /// assert!(x.verify_job().is_some());
14052 /// assert!(x.deploy_job().is_none());
14053 /// assert!(x.predeploy_job().is_none());
14054 /// assert!(x.postdeploy_job().is_none());
14055 /// assert!(x.create_child_rollout_job().is_none());
14056 /// assert!(x.advance_child_rollout_job().is_none());
14057 /// ```
14058 pub fn set_verify_job<T: std::convert::Into<std::boxed::Box<crate::model::VerifyJob>>>(
14059 mut self,
14060 v: T,
14061 ) -> Self {
14062 self.job_type = std::option::Option::Some(crate::model::job::JobType::VerifyJob(v.into()));
14063 self
14064 }
14065
14066 /// The value of [job_type][crate::model::Job::job_type]
14067 /// if it holds a `PredeployJob`, `None` if the field is not set or
14068 /// holds a different branch.
14069 pub fn predeploy_job(
14070 &self,
14071 ) -> std::option::Option<&std::boxed::Box<crate::model::PredeployJob>> {
14072 #[allow(unreachable_patterns)]
14073 self.job_type.as_ref().and_then(|v| match v {
14074 crate::model::job::JobType::PredeployJob(v) => std::option::Option::Some(v),
14075 _ => std::option::Option::None,
14076 })
14077 }
14078
14079 /// Sets the value of [job_type][crate::model::Job::job_type]
14080 /// to hold a `PredeployJob`.
14081 ///
14082 /// Note that all the setters affecting `job_type` are
14083 /// mutually exclusive.
14084 ///
14085 /// # Example
14086 /// ```ignore,no_run
14087 /// # use google_cloud_deploy_v1::model::Job;
14088 /// use google_cloud_deploy_v1::model::PredeployJob;
14089 /// let x = Job::new().set_predeploy_job(PredeployJob::default()/* use setters */);
14090 /// assert!(x.predeploy_job().is_some());
14091 /// assert!(x.deploy_job().is_none());
14092 /// assert!(x.verify_job().is_none());
14093 /// assert!(x.postdeploy_job().is_none());
14094 /// assert!(x.create_child_rollout_job().is_none());
14095 /// assert!(x.advance_child_rollout_job().is_none());
14096 /// ```
14097 pub fn set_predeploy_job<T: std::convert::Into<std::boxed::Box<crate::model::PredeployJob>>>(
14098 mut self,
14099 v: T,
14100 ) -> Self {
14101 self.job_type =
14102 std::option::Option::Some(crate::model::job::JobType::PredeployJob(v.into()));
14103 self
14104 }
14105
14106 /// The value of [job_type][crate::model::Job::job_type]
14107 /// if it holds a `PostdeployJob`, `None` if the field is not set or
14108 /// holds a different branch.
14109 pub fn postdeploy_job(
14110 &self,
14111 ) -> std::option::Option<&std::boxed::Box<crate::model::PostdeployJob>> {
14112 #[allow(unreachable_patterns)]
14113 self.job_type.as_ref().and_then(|v| match v {
14114 crate::model::job::JobType::PostdeployJob(v) => std::option::Option::Some(v),
14115 _ => std::option::Option::None,
14116 })
14117 }
14118
14119 /// Sets the value of [job_type][crate::model::Job::job_type]
14120 /// to hold a `PostdeployJob`.
14121 ///
14122 /// Note that all the setters affecting `job_type` are
14123 /// mutually exclusive.
14124 ///
14125 /// # Example
14126 /// ```ignore,no_run
14127 /// # use google_cloud_deploy_v1::model::Job;
14128 /// use google_cloud_deploy_v1::model::PostdeployJob;
14129 /// let x = Job::new().set_postdeploy_job(PostdeployJob::default()/* use setters */);
14130 /// assert!(x.postdeploy_job().is_some());
14131 /// assert!(x.deploy_job().is_none());
14132 /// assert!(x.verify_job().is_none());
14133 /// assert!(x.predeploy_job().is_none());
14134 /// assert!(x.create_child_rollout_job().is_none());
14135 /// assert!(x.advance_child_rollout_job().is_none());
14136 /// ```
14137 pub fn set_postdeploy_job<
14138 T: std::convert::Into<std::boxed::Box<crate::model::PostdeployJob>>,
14139 >(
14140 mut self,
14141 v: T,
14142 ) -> Self {
14143 self.job_type =
14144 std::option::Option::Some(crate::model::job::JobType::PostdeployJob(v.into()));
14145 self
14146 }
14147
14148 /// The value of [job_type][crate::model::Job::job_type]
14149 /// if it holds a `CreateChildRolloutJob`, `None` if the field is not set or
14150 /// holds a different branch.
14151 pub fn create_child_rollout_job(
14152 &self,
14153 ) -> std::option::Option<&std::boxed::Box<crate::model::CreateChildRolloutJob>> {
14154 #[allow(unreachable_patterns)]
14155 self.job_type.as_ref().and_then(|v| match v {
14156 crate::model::job::JobType::CreateChildRolloutJob(v) => std::option::Option::Some(v),
14157 _ => std::option::Option::None,
14158 })
14159 }
14160
14161 /// Sets the value of [job_type][crate::model::Job::job_type]
14162 /// to hold a `CreateChildRolloutJob`.
14163 ///
14164 /// Note that all the setters affecting `job_type` are
14165 /// mutually exclusive.
14166 ///
14167 /// # Example
14168 /// ```ignore,no_run
14169 /// # use google_cloud_deploy_v1::model::Job;
14170 /// use google_cloud_deploy_v1::model::CreateChildRolloutJob;
14171 /// let x = Job::new().set_create_child_rollout_job(CreateChildRolloutJob::default()/* use setters */);
14172 /// assert!(x.create_child_rollout_job().is_some());
14173 /// assert!(x.deploy_job().is_none());
14174 /// assert!(x.verify_job().is_none());
14175 /// assert!(x.predeploy_job().is_none());
14176 /// assert!(x.postdeploy_job().is_none());
14177 /// assert!(x.advance_child_rollout_job().is_none());
14178 /// ```
14179 pub fn set_create_child_rollout_job<
14180 T: std::convert::Into<std::boxed::Box<crate::model::CreateChildRolloutJob>>,
14181 >(
14182 mut self,
14183 v: T,
14184 ) -> Self {
14185 self.job_type =
14186 std::option::Option::Some(crate::model::job::JobType::CreateChildRolloutJob(v.into()));
14187 self
14188 }
14189
14190 /// The value of [job_type][crate::model::Job::job_type]
14191 /// if it holds a `AdvanceChildRolloutJob`, `None` if the field is not set or
14192 /// holds a different branch.
14193 pub fn advance_child_rollout_job(
14194 &self,
14195 ) -> std::option::Option<&std::boxed::Box<crate::model::AdvanceChildRolloutJob>> {
14196 #[allow(unreachable_patterns)]
14197 self.job_type.as_ref().and_then(|v| match v {
14198 crate::model::job::JobType::AdvanceChildRolloutJob(v) => std::option::Option::Some(v),
14199 _ => std::option::Option::None,
14200 })
14201 }
14202
14203 /// Sets the value of [job_type][crate::model::Job::job_type]
14204 /// to hold a `AdvanceChildRolloutJob`.
14205 ///
14206 /// Note that all the setters affecting `job_type` are
14207 /// mutually exclusive.
14208 ///
14209 /// # Example
14210 /// ```ignore,no_run
14211 /// # use google_cloud_deploy_v1::model::Job;
14212 /// use google_cloud_deploy_v1::model::AdvanceChildRolloutJob;
14213 /// let x = Job::new().set_advance_child_rollout_job(AdvanceChildRolloutJob::default()/* use setters */);
14214 /// assert!(x.advance_child_rollout_job().is_some());
14215 /// assert!(x.deploy_job().is_none());
14216 /// assert!(x.verify_job().is_none());
14217 /// assert!(x.predeploy_job().is_none());
14218 /// assert!(x.postdeploy_job().is_none());
14219 /// assert!(x.create_child_rollout_job().is_none());
14220 /// ```
14221 pub fn set_advance_child_rollout_job<
14222 T: std::convert::Into<std::boxed::Box<crate::model::AdvanceChildRolloutJob>>,
14223 >(
14224 mut self,
14225 v: T,
14226 ) -> Self {
14227 self.job_type =
14228 std::option::Option::Some(crate::model::job::JobType::AdvanceChildRolloutJob(v.into()));
14229 self
14230 }
14231}
14232
14233impl wkt::message::Message for Job {
14234 fn typename() -> &'static str {
14235 "type.googleapis.com/google.cloud.deploy.v1.Job"
14236 }
14237}
14238
14239/// Defines additional types related to [Job].
14240pub mod job {
14241 #[allow(unused_imports)]
14242 use super::*;
14243
14244 /// Valid states of a Job.
14245 ///
14246 /// # Working with unknown values
14247 ///
14248 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
14249 /// additional enum variants at any time. Adding new variants is not considered
14250 /// a breaking change. Applications should write their code in anticipation of:
14251 ///
14252 /// - New values appearing in future releases of the client library, **and**
14253 /// - New values received dynamically, without application changes.
14254 ///
14255 /// Please consult the [Working with enums] section in the user guide for some
14256 /// guidelines.
14257 ///
14258 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
14259 #[derive(Clone, Debug, PartialEq)]
14260 #[non_exhaustive]
14261 pub enum State {
14262 /// The Job has an unspecified state.
14263 Unspecified,
14264 /// The Job is waiting for an earlier Phase(s) or Job(s) to complete.
14265 Pending,
14266 /// The Job is disabled.
14267 Disabled,
14268 /// The Job is in progress.
14269 InProgress,
14270 /// The Job succeeded.
14271 Succeeded,
14272 /// The Job failed.
14273 Failed,
14274 /// The Job was aborted.
14275 Aborted,
14276 /// The Job was skipped.
14277 Skipped,
14278 /// The Job was ignored.
14279 Ignored,
14280 /// If set, the enum was initialized with an unknown value.
14281 ///
14282 /// Applications can examine the value using [State::value] or
14283 /// [State::name].
14284 UnknownValue(state::UnknownValue),
14285 }
14286
14287 #[doc(hidden)]
14288 pub mod state {
14289 #[allow(unused_imports)]
14290 use super::*;
14291 #[derive(Clone, Debug, PartialEq)]
14292 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
14293 }
14294
14295 impl State {
14296 /// Gets the enum value.
14297 ///
14298 /// Returns `None` if the enum contains an unknown value deserialized from
14299 /// the string representation of enums.
14300 pub fn value(&self) -> std::option::Option<i32> {
14301 match self {
14302 Self::Unspecified => std::option::Option::Some(0),
14303 Self::Pending => std::option::Option::Some(1),
14304 Self::Disabled => std::option::Option::Some(2),
14305 Self::InProgress => std::option::Option::Some(3),
14306 Self::Succeeded => std::option::Option::Some(4),
14307 Self::Failed => std::option::Option::Some(5),
14308 Self::Aborted => std::option::Option::Some(6),
14309 Self::Skipped => std::option::Option::Some(7),
14310 Self::Ignored => std::option::Option::Some(8),
14311 Self::UnknownValue(u) => u.0.value(),
14312 }
14313 }
14314
14315 /// Gets the enum value as a string.
14316 ///
14317 /// Returns `None` if the enum contains an unknown value deserialized from
14318 /// the integer representation of enums.
14319 pub fn name(&self) -> std::option::Option<&str> {
14320 match self {
14321 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
14322 Self::Pending => std::option::Option::Some("PENDING"),
14323 Self::Disabled => std::option::Option::Some("DISABLED"),
14324 Self::InProgress => std::option::Option::Some("IN_PROGRESS"),
14325 Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
14326 Self::Failed => std::option::Option::Some("FAILED"),
14327 Self::Aborted => std::option::Option::Some("ABORTED"),
14328 Self::Skipped => std::option::Option::Some("SKIPPED"),
14329 Self::Ignored => std::option::Option::Some("IGNORED"),
14330 Self::UnknownValue(u) => u.0.name(),
14331 }
14332 }
14333 }
14334
14335 impl std::default::Default for State {
14336 fn default() -> Self {
14337 use std::convert::From;
14338 Self::from(0)
14339 }
14340 }
14341
14342 impl std::fmt::Display for State {
14343 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
14344 wkt::internal::display_enum(f, self.name(), self.value())
14345 }
14346 }
14347
14348 impl std::convert::From<i32> for State {
14349 fn from(value: i32) -> Self {
14350 match value {
14351 0 => Self::Unspecified,
14352 1 => Self::Pending,
14353 2 => Self::Disabled,
14354 3 => Self::InProgress,
14355 4 => Self::Succeeded,
14356 5 => Self::Failed,
14357 6 => Self::Aborted,
14358 7 => Self::Skipped,
14359 8 => Self::Ignored,
14360 _ => Self::UnknownValue(state::UnknownValue(
14361 wkt::internal::UnknownEnumValue::Integer(value),
14362 )),
14363 }
14364 }
14365 }
14366
14367 impl std::convert::From<&str> for State {
14368 fn from(value: &str) -> Self {
14369 use std::string::ToString;
14370 match value {
14371 "STATE_UNSPECIFIED" => Self::Unspecified,
14372 "PENDING" => Self::Pending,
14373 "DISABLED" => Self::Disabled,
14374 "IN_PROGRESS" => Self::InProgress,
14375 "SUCCEEDED" => Self::Succeeded,
14376 "FAILED" => Self::Failed,
14377 "ABORTED" => Self::Aborted,
14378 "SKIPPED" => Self::Skipped,
14379 "IGNORED" => Self::Ignored,
14380 _ => Self::UnknownValue(state::UnknownValue(
14381 wkt::internal::UnknownEnumValue::String(value.to_string()),
14382 )),
14383 }
14384 }
14385 }
14386
14387 impl serde::ser::Serialize for State {
14388 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14389 where
14390 S: serde::Serializer,
14391 {
14392 match self {
14393 Self::Unspecified => serializer.serialize_i32(0),
14394 Self::Pending => serializer.serialize_i32(1),
14395 Self::Disabled => serializer.serialize_i32(2),
14396 Self::InProgress => serializer.serialize_i32(3),
14397 Self::Succeeded => serializer.serialize_i32(4),
14398 Self::Failed => serializer.serialize_i32(5),
14399 Self::Aborted => serializer.serialize_i32(6),
14400 Self::Skipped => serializer.serialize_i32(7),
14401 Self::Ignored => serializer.serialize_i32(8),
14402 Self::UnknownValue(u) => u.0.serialize(serializer),
14403 }
14404 }
14405 }
14406
14407 impl<'de> serde::de::Deserialize<'de> for State {
14408 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14409 where
14410 D: serde::Deserializer<'de>,
14411 {
14412 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
14413 ".google.cloud.deploy.v1.Job.State",
14414 ))
14415 }
14416 }
14417
14418 /// The type of Job.
14419 #[derive(Clone, Debug, PartialEq)]
14420 #[non_exhaustive]
14421 pub enum JobType {
14422 /// Output only. A deploy Job.
14423 DeployJob(std::boxed::Box<crate::model::DeployJob>),
14424 /// Output only. A verify Job.
14425 VerifyJob(std::boxed::Box<crate::model::VerifyJob>),
14426 /// Output only. A predeploy Job.
14427 PredeployJob(std::boxed::Box<crate::model::PredeployJob>),
14428 /// Output only. A postdeploy Job.
14429 PostdeployJob(std::boxed::Box<crate::model::PostdeployJob>),
14430 /// Output only. A createChildRollout Job.
14431 CreateChildRolloutJob(std::boxed::Box<crate::model::CreateChildRolloutJob>),
14432 /// Output only. An advanceChildRollout Job.
14433 AdvanceChildRolloutJob(std::boxed::Box<crate::model::AdvanceChildRolloutJob>),
14434 }
14435}
14436
14437/// A deploy Job.
14438#[derive(Clone, Default, PartialEq)]
14439#[non_exhaustive]
14440pub struct DeployJob {
14441 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14442}
14443
14444impl DeployJob {
14445 pub fn new() -> Self {
14446 std::default::Default::default()
14447 }
14448}
14449
14450impl wkt::message::Message for DeployJob {
14451 fn typename() -> &'static str {
14452 "type.googleapis.com/google.cloud.deploy.v1.DeployJob"
14453 }
14454}
14455
14456/// A verify Job.
14457#[derive(Clone, Default, PartialEq)]
14458#[non_exhaustive]
14459pub struct VerifyJob {
14460 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14461}
14462
14463impl VerifyJob {
14464 pub fn new() -> Self {
14465 std::default::Default::default()
14466 }
14467}
14468
14469impl wkt::message::Message for VerifyJob {
14470 fn typename() -> &'static str {
14471 "type.googleapis.com/google.cloud.deploy.v1.VerifyJob"
14472 }
14473}
14474
14475/// A predeploy Job.
14476#[derive(Clone, Default, PartialEq)]
14477#[non_exhaustive]
14478pub struct PredeployJob {
14479 /// Output only. The custom actions that the predeploy Job executes.
14480 pub actions: std::vec::Vec<std::string::String>,
14481
14482 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14483}
14484
14485impl PredeployJob {
14486 pub fn new() -> Self {
14487 std::default::Default::default()
14488 }
14489
14490 /// Sets the value of [actions][crate::model::PredeployJob::actions].
14491 ///
14492 /// # Example
14493 /// ```ignore,no_run
14494 /// # use google_cloud_deploy_v1::model::PredeployJob;
14495 /// let x = PredeployJob::new().set_actions(["a", "b", "c"]);
14496 /// ```
14497 pub fn set_actions<T, V>(mut self, v: T) -> Self
14498 where
14499 T: std::iter::IntoIterator<Item = V>,
14500 V: std::convert::Into<std::string::String>,
14501 {
14502 use std::iter::Iterator;
14503 self.actions = v.into_iter().map(|i| i.into()).collect();
14504 self
14505 }
14506}
14507
14508impl wkt::message::Message for PredeployJob {
14509 fn typename() -> &'static str {
14510 "type.googleapis.com/google.cloud.deploy.v1.PredeployJob"
14511 }
14512}
14513
14514/// A postdeploy Job.
14515#[derive(Clone, Default, PartialEq)]
14516#[non_exhaustive]
14517pub struct PostdeployJob {
14518 /// Output only. The custom actions that the postdeploy Job executes.
14519 pub actions: std::vec::Vec<std::string::String>,
14520
14521 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14522}
14523
14524impl PostdeployJob {
14525 pub fn new() -> Self {
14526 std::default::Default::default()
14527 }
14528
14529 /// Sets the value of [actions][crate::model::PostdeployJob::actions].
14530 ///
14531 /// # Example
14532 /// ```ignore,no_run
14533 /// # use google_cloud_deploy_v1::model::PostdeployJob;
14534 /// let x = PostdeployJob::new().set_actions(["a", "b", "c"]);
14535 /// ```
14536 pub fn set_actions<T, V>(mut self, v: T) -> Self
14537 where
14538 T: std::iter::IntoIterator<Item = V>,
14539 V: std::convert::Into<std::string::String>,
14540 {
14541 use std::iter::Iterator;
14542 self.actions = v.into_iter().map(|i| i.into()).collect();
14543 self
14544 }
14545}
14546
14547impl wkt::message::Message for PostdeployJob {
14548 fn typename() -> &'static str {
14549 "type.googleapis.com/google.cloud.deploy.v1.PostdeployJob"
14550 }
14551}
14552
14553/// A createChildRollout Job.
14554#[derive(Clone, Default, PartialEq)]
14555#[non_exhaustive]
14556pub struct CreateChildRolloutJob {
14557 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14558}
14559
14560impl CreateChildRolloutJob {
14561 pub fn new() -> Self {
14562 std::default::Default::default()
14563 }
14564}
14565
14566impl wkt::message::Message for CreateChildRolloutJob {
14567 fn typename() -> &'static str {
14568 "type.googleapis.com/google.cloud.deploy.v1.CreateChildRolloutJob"
14569 }
14570}
14571
14572/// An advanceChildRollout Job.
14573#[derive(Clone, Default, PartialEq)]
14574#[non_exhaustive]
14575pub struct AdvanceChildRolloutJob {
14576 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14577}
14578
14579impl AdvanceChildRolloutJob {
14580 pub fn new() -> Self {
14581 std::default::Default::default()
14582 }
14583}
14584
14585impl wkt::message::Message for AdvanceChildRolloutJob {
14586 fn typename() -> &'static str {
14587 "type.googleapis.com/google.cloud.deploy.v1.AdvanceChildRolloutJob"
14588 }
14589}
14590
14591/// ListRolloutsRequest is the request object used by `ListRollouts`.
14592#[derive(Clone, Default, PartialEq)]
14593#[non_exhaustive]
14594pub struct ListRolloutsRequest {
14595 /// Required. The `Release` which owns this collection of `Rollout` objects.
14596 pub parent: std::string::String,
14597
14598 /// Optional. The maximum number of `Rollout` objects to return. The service
14599 /// may return fewer than this value. If unspecified, at most 50 `Rollout`
14600 /// objects will be returned. The maximum value is 1000; values above 1000 will
14601 /// be set to 1000.
14602 pub page_size: i32,
14603
14604 /// Optional. A page token, received from a previous `ListRollouts` call.
14605 /// Provide this to retrieve the subsequent page.
14606 ///
14607 /// When paginating, all other provided parameters match
14608 /// the call that provided the page token.
14609 pub page_token: std::string::String,
14610
14611 /// Optional. Filter rollouts to be returned. See <https://google.aip.dev/160>
14612 /// for more details.
14613 pub filter: std::string::String,
14614
14615 /// Optional. Field to sort by. See <https://google.aip.dev/132#ordering> for
14616 /// more details.
14617 pub order_by: std::string::String,
14618
14619 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14620}
14621
14622impl ListRolloutsRequest {
14623 pub fn new() -> Self {
14624 std::default::Default::default()
14625 }
14626
14627 /// Sets the value of [parent][crate::model::ListRolloutsRequest::parent].
14628 ///
14629 /// # Example
14630 /// ```ignore,no_run
14631 /// # use google_cloud_deploy_v1::model::ListRolloutsRequest;
14632 /// let x = ListRolloutsRequest::new().set_parent("example");
14633 /// ```
14634 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14635 self.parent = v.into();
14636 self
14637 }
14638
14639 /// Sets the value of [page_size][crate::model::ListRolloutsRequest::page_size].
14640 ///
14641 /// # Example
14642 /// ```ignore,no_run
14643 /// # use google_cloud_deploy_v1::model::ListRolloutsRequest;
14644 /// let x = ListRolloutsRequest::new().set_page_size(42);
14645 /// ```
14646 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
14647 self.page_size = v.into();
14648 self
14649 }
14650
14651 /// Sets the value of [page_token][crate::model::ListRolloutsRequest::page_token].
14652 ///
14653 /// # Example
14654 /// ```ignore,no_run
14655 /// # use google_cloud_deploy_v1::model::ListRolloutsRequest;
14656 /// let x = ListRolloutsRequest::new().set_page_token("example");
14657 /// ```
14658 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14659 self.page_token = v.into();
14660 self
14661 }
14662
14663 /// Sets the value of [filter][crate::model::ListRolloutsRequest::filter].
14664 ///
14665 /// # Example
14666 /// ```ignore,no_run
14667 /// # use google_cloud_deploy_v1::model::ListRolloutsRequest;
14668 /// let x = ListRolloutsRequest::new().set_filter("example");
14669 /// ```
14670 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14671 self.filter = v.into();
14672 self
14673 }
14674
14675 /// Sets the value of [order_by][crate::model::ListRolloutsRequest::order_by].
14676 ///
14677 /// # Example
14678 /// ```ignore,no_run
14679 /// # use google_cloud_deploy_v1::model::ListRolloutsRequest;
14680 /// let x = ListRolloutsRequest::new().set_order_by("example");
14681 /// ```
14682 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14683 self.order_by = v.into();
14684 self
14685 }
14686}
14687
14688impl wkt::message::Message for ListRolloutsRequest {
14689 fn typename() -> &'static str {
14690 "type.googleapis.com/google.cloud.deploy.v1.ListRolloutsRequest"
14691 }
14692}
14693
14694/// ListRolloutsResponse is the response object returned by `ListRollouts`.
14695#[derive(Clone, Default, PartialEq)]
14696#[non_exhaustive]
14697pub struct ListRolloutsResponse {
14698 /// The `Rollout` objects.
14699 pub rollouts: std::vec::Vec<crate::model::Rollout>,
14700
14701 /// A token, which can be sent as `page_token` to retrieve the next page.
14702 /// If this field is omitted, there are no subsequent pages.
14703 pub next_page_token: std::string::String,
14704
14705 /// Locations that could not be reached.
14706 pub unreachable: std::vec::Vec<std::string::String>,
14707
14708 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14709}
14710
14711impl ListRolloutsResponse {
14712 pub fn new() -> Self {
14713 std::default::Default::default()
14714 }
14715
14716 /// Sets the value of [rollouts][crate::model::ListRolloutsResponse::rollouts].
14717 ///
14718 /// # Example
14719 /// ```ignore,no_run
14720 /// # use google_cloud_deploy_v1::model::ListRolloutsResponse;
14721 /// use google_cloud_deploy_v1::model::Rollout;
14722 /// let x = ListRolloutsResponse::new()
14723 /// .set_rollouts([
14724 /// Rollout::default()/* use setters */,
14725 /// Rollout::default()/* use (different) setters */,
14726 /// ]);
14727 /// ```
14728 pub fn set_rollouts<T, V>(mut self, v: T) -> Self
14729 where
14730 T: std::iter::IntoIterator<Item = V>,
14731 V: std::convert::Into<crate::model::Rollout>,
14732 {
14733 use std::iter::Iterator;
14734 self.rollouts = v.into_iter().map(|i| i.into()).collect();
14735 self
14736 }
14737
14738 /// Sets the value of [next_page_token][crate::model::ListRolloutsResponse::next_page_token].
14739 ///
14740 /// # Example
14741 /// ```ignore,no_run
14742 /// # use google_cloud_deploy_v1::model::ListRolloutsResponse;
14743 /// let x = ListRolloutsResponse::new().set_next_page_token("example");
14744 /// ```
14745 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14746 self.next_page_token = v.into();
14747 self
14748 }
14749
14750 /// Sets the value of [unreachable][crate::model::ListRolloutsResponse::unreachable].
14751 ///
14752 /// # Example
14753 /// ```ignore,no_run
14754 /// # use google_cloud_deploy_v1::model::ListRolloutsResponse;
14755 /// let x = ListRolloutsResponse::new().set_unreachable(["a", "b", "c"]);
14756 /// ```
14757 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
14758 where
14759 T: std::iter::IntoIterator<Item = V>,
14760 V: std::convert::Into<std::string::String>,
14761 {
14762 use std::iter::Iterator;
14763 self.unreachable = v.into_iter().map(|i| i.into()).collect();
14764 self
14765 }
14766}
14767
14768impl wkt::message::Message for ListRolloutsResponse {
14769 fn typename() -> &'static str {
14770 "type.googleapis.com/google.cloud.deploy.v1.ListRolloutsResponse"
14771 }
14772}
14773
14774#[doc(hidden)]
14775impl google_cloud_gax::paginator::internal::PageableResponse for ListRolloutsResponse {
14776 type PageItem = crate::model::Rollout;
14777
14778 fn items(self) -> std::vec::Vec<Self::PageItem> {
14779 self.rollouts
14780 }
14781
14782 fn next_page_token(&self) -> std::string::String {
14783 use std::clone::Clone;
14784 self.next_page_token.clone()
14785 }
14786}
14787
14788/// GetRolloutRequest is the request object used by `GetRollout`.
14789#[derive(Clone, Default, PartialEq)]
14790#[non_exhaustive]
14791pub struct GetRolloutRequest {
14792 /// Required. Name of the `Rollout`. Format must be
14793 /// `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}/rollouts/{rollout_name}`.
14794 pub name: std::string::String,
14795
14796 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14797}
14798
14799impl GetRolloutRequest {
14800 pub fn new() -> Self {
14801 std::default::Default::default()
14802 }
14803
14804 /// Sets the value of [name][crate::model::GetRolloutRequest::name].
14805 ///
14806 /// # Example
14807 /// ```ignore,no_run
14808 /// # use google_cloud_deploy_v1::model::GetRolloutRequest;
14809 /// let x = GetRolloutRequest::new().set_name("example");
14810 /// ```
14811 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14812 self.name = v.into();
14813 self
14814 }
14815}
14816
14817impl wkt::message::Message for GetRolloutRequest {
14818 fn typename() -> &'static str {
14819 "type.googleapis.com/google.cloud.deploy.v1.GetRolloutRequest"
14820 }
14821}
14822
14823/// CreateRolloutRequest is the request object used by `CreateRollout`.
14824#[derive(Clone, Default, PartialEq)]
14825#[non_exhaustive]
14826pub struct CreateRolloutRequest {
14827 /// Required. The parent collection in which the `Rollout` must be created.
14828 /// The format is
14829 /// `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}`.
14830 pub parent: std::string::String,
14831
14832 /// Required. ID of the `Rollout`.
14833 pub rollout_id: std::string::String,
14834
14835 /// Required. The `Rollout` to create.
14836 pub rollout: std::option::Option<crate::model::Rollout>,
14837
14838 /// Optional. A request ID to identify requests. Specify a unique request ID
14839 /// so that if you must retry your request, the server knows to ignore the
14840 /// request if it has already been completed. The server guarantees that for
14841 /// at least 60 minutes after the first request.
14842 ///
14843 /// For example, consider a situation where you make an initial request and the
14844 /// request times out. If you make the request again with the same request ID,
14845 /// the server can check if original operation with the same request ID was
14846 /// received, and if so, will ignore the second request. This prevents clients
14847 /// from accidentally creating duplicate commitments.
14848 ///
14849 /// The request ID must be a valid UUID with the exception that zero UUID is
14850 /// not supported (00000000-0000-0000-0000-000000000000).
14851 pub request_id: std::string::String,
14852
14853 /// Optional. If set to true, the request is validated and the user is provided
14854 /// with an expected result, but no actual change is made.
14855 pub validate_only: bool,
14856
14857 /// Optional. Deploy policies to override. Format is
14858 /// `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`.
14859 pub override_deploy_policy: std::vec::Vec<std::string::String>,
14860
14861 /// Optional. The starting phase ID for the `Rollout`. If empty the `Rollout`
14862 /// will start at the first phase.
14863 pub starting_phase_id: std::string::String,
14864
14865 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14866}
14867
14868impl CreateRolloutRequest {
14869 pub fn new() -> Self {
14870 std::default::Default::default()
14871 }
14872
14873 /// Sets the value of [parent][crate::model::CreateRolloutRequest::parent].
14874 ///
14875 /// # Example
14876 /// ```ignore,no_run
14877 /// # use google_cloud_deploy_v1::model::CreateRolloutRequest;
14878 /// let x = CreateRolloutRequest::new().set_parent("example");
14879 /// ```
14880 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14881 self.parent = v.into();
14882 self
14883 }
14884
14885 /// Sets the value of [rollout_id][crate::model::CreateRolloutRequest::rollout_id].
14886 ///
14887 /// # Example
14888 /// ```ignore,no_run
14889 /// # use google_cloud_deploy_v1::model::CreateRolloutRequest;
14890 /// let x = CreateRolloutRequest::new().set_rollout_id("example");
14891 /// ```
14892 pub fn set_rollout_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14893 self.rollout_id = v.into();
14894 self
14895 }
14896
14897 /// Sets the value of [rollout][crate::model::CreateRolloutRequest::rollout].
14898 ///
14899 /// # Example
14900 /// ```ignore,no_run
14901 /// # use google_cloud_deploy_v1::model::CreateRolloutRequest;
14902 /// use google_cloud_deploy_v1::model::Rollout;
14903 /// let x = CreateRolloutRequest::new().set_rollout(Rollout::default()/* use setters */);
14904 /// ```
14905 pub fn set_rollout<T>(mut self, v: T) -> Self
14906 where
14907 T: std::convert::Into<crate::model::Rollout>,
14908 {
14909 self.rollout = std::option::Option::Some(v.into());
14910 self
14911 }
14912
14913 /// Sets or clears the value of [rollout][crate::model::CreateRolloutRequest::rollout].
14914 ///
14915 /// # Example
14916 /// ```ignore,no_run
14917 /// # use google_cloud_deploy_v1::model::CreateRolloutRequest;
14918 /// use google_cloud_deploy_v1::model::Rollout;
14919 /// let x = CreateRolloutRequest::new().set_or_clear_rollout(Some(Rollout::default()/* use setters */));
14920 /// let x = CreateRolloutRequest::new().set_or_clear_rollout(None::<Rollout>);
14921 /// ```
14922 pub fn set_or_clear_rollout<T>(mut self, v: std::option::Option<T>) -> Self
14923 where
14924 T: std::convert::Into<crate::model::Rollout>,
14925 {
14926 self.rollout = v.map(|x| x.into());
14927 self
14928 }
14929
14930 /// Sets the value of [request_id][crate::model::CreateRolloutRequest::request_id].
14931 ///
14932 /// # Example
14933 /// ```ignore,no_run
14934 /// # use google_cloud_deploy_v1::model::CreateRolloutRequest;
14935 /// let x = CreateRolloutRequest::new().set_request_id("example");
14936 /// ```
14937 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14938 self.request_id = v.into();
14939 self
14940 }
14941
14942 /// Sets the value of [validate_only][crate::model::CreateRolloutRequest::validate_only].
14943 ///
14944 /// # Example
14945 /// ```ignore,no_run
14946 /// # use google_cloud_deploy_v1::model::CreateRolloutRequest;
14947 /// let x = CreateRolloutRequest::new().set_validate_only(true);
14948 /// ```
14949 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
14950 self.validate_only = v.into();
14951 self
14952 }
14953
14954 /// Sets the value of [override_deploy_policy][crate::model::CreateRolloutRequest::override_deploy_policy].
14955 ///
14956 /// # Example
14957 /// ```ignore,no_run
14958 /// # use google_cloud_deploy_v1::model::CreateRolloutRequest;
14959 /// let x = CreateRolloutRequest::new().set_override_deploy_policy(["a", "b", "c"]);
14960 /// ```
14961 pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
14962 where
14963 T: std::iter::IntoIterator<Item = V>,
14964 V: std::convert::Into<std::string::String>,
14965 {
14966 use std::iter::Iterator;
14967 self.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
14968 self
14969 }
14970
14971 /// Sets the value of [starting_phase_id][crate::model::CreateRolloutRequest::starting_phase_id].
14972 ///
14973 /// # Example
14974 /// ```ignore,no_run
14975 /// # use google_cloud_deploy_v1::model::CreateRolloutRequest;
14976 /// let x = CreateRolloutRequest::new().set_starting_phase_id("example");
14977 /// ```
14978 pub fn set_starting_phase_id<T: std::convert::Into<std::string::String>>(
14979 mut self,
14980 v: T,
14981 ) -> Self {
14982 self.starting_phase_id = v.into();
14983 self
14984 }
14985}
14986
14987impl wkt::message::Message for CreateRolloutRequest {
14988 fn typename() -> &'static str {
14989 "type.googleapis.com/google.cloud.deploy.v1.CreateRolloutRequest"
14990 }
14991}
14992
14993/// Represents the metadata of the long-running operation.
14994#[derive(Clone, Default, PartialEq)]
14995#[non_exhaustive]
14996pub struct OperationMetadata {
14997 /// Output only. The time the operation was created.
14998 pub create_time: std::option::Option<wkt::Timestamp>,
14999
15000 /// Output only. The time the operation finished running.
15001 pub end_time: std::option::Option<wkt::Timestamp>,
15002
15003 /// Output only. Server-defined resource path for the target of the operation.
15004 pub target: std::string::String,
15005
15006 /// Output only. Name of the verb executed by the operation.
15007 pub verb: std::string::String,
15008
15009 /// Output only. Human-readable status of the operation, if any.
15010 pub status_message: std::string::String,
15011
15012 /// Output only. Identifies whether the user has requested cancellation
15013 /// of the operation. Operations that have successfully been cancelled
15014 /// have
15015 /// [google.longrunning.Operation.error][google.longrunning.Operation.error]
15016 /// value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
15017 /// corresponding to `Code.CANCELLED`.
15018 ///
15019 /// [google.longrunning.Operation.error]: google_cloud_longrunning::model::Operation::result
15020 /// [google.rpc.Status.code]: google_cloud_rpc::model::Status::code
15021 pub requested_cancellation: bool,
15022
15023 /// Output only. API version used to start the operation.
15024 pub api_version: std::string::String,
15025
15026 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15027}
15028
15029impl OperationMetadata {
15030 pub fn new() -> Self {
15031 std::default::Default::default()
15032 }
15033
15034 /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
15035 ///
15036 /// # Example
15037 /// ```ignore,no_run
15038 /// # use google_cloud_deploy_v1::model::OperationMetadata;
15039 /// use wkt::Timestamp;
15040 /// let x = OperationMetadata::new().set_create_time(Timestamp::default()/* use setters */);
15041 /// ```
15042 pub fn set_create_time<T>(mut self, v: T) -> Self
15043 where
15044 T: std::convert::Into<wkt::Timestamp>,
15045 {
15046 self.create_time = std::option::Option::Some(v.into());
15047 self
15048 }
15049
15050 /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
15051 ///
15052 /// # Example
15053 /// ```ignore,no_run
15054 /// # use google_cloud_deploy_v1::model::OperationMetadata;
15055 /// use wkt::Timestamp;
15056 /// let x = OperationMetadata::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
15057 /// let x = OperationMetadata::new().set_or_clear_create_time(None::<Timestamp>);
15058 /// ```
15059 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
15060 where
15061 T: std::convert::Into<wkt::Timestamp>,
15062 {
15063 self.create_time = v.map(|x| x.into());
15064 self
15065 }
15066
15067 /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
15068 ///
15069 /// # Example
15070 /// ```ignore,no_run
15071 /// # use google_cloud_deploy_v1::model::OperationMetadata;
15072 /// use wkt::Timestamp;
15073 /// let x = OperationMetadata::new().set_end_time(Timestamp::default()/* use setters */);
15074 /// ```
15075 pub fn set_end_time<T>(mut self, v: T) -> Self
15076 where
15077 T: std::convert::Into<wkt::Timestamp>,
15078 {
15079 self.end_time = std::option::Option::Some(v.into());
15080 self
15081 }
15082
15083 /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
15084 ///
15085 /// # Example
15086 /// ```ignore,no_run
15087 /// # use google_cloud_deploy_v1::model::OperationMetadata;
15088 /// use wkt::Timestamp;
15089 /// let x = OperationMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
15090 /// let x = OperationMetadata::new().set_or_clear_end_time(None::<Timestamp>);
15091 /// ```
15092 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
15093 where
15094 T: std::convert::Into<wkt::Timestamp>,
15095 {
15096 self.end_time = v.map(|x| x.into());
15097 self
15098 }
15099
15100 /// Sets the value of [target][crate::model::OperationMetadata::target].
15101 ///
15102 /// # Example
15103 /// ```ignore,no_run
15104 /// # use google_cloud_deploy_v1::model::OperationMetadata;
15105 /// let x = OperationMetadata::new().set_target("example");
15106 /// ```
15107 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15108 self.target = v.into();
15109 self
15110 }
15111
15112 /// Sets the value of [verb][crate::model::OperationMetadata::verb].
15113 ///
15114 /// # Example
15115 /// ```ignore,no_run
15116 /// # use google_cloud_deploy_v1::model::OperationMetadata;
15117 /// let x = OperationMetadata::new().set_verb("example");
15118 /// ```
15119 pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15120 self.verb = v.into();
15121 self
15122 }
15123
15124 /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
15125 ///
15126 /// # Example
15127 /// ```ignore,no_run
15128 /// # use google_cloud_deploy_v1::model::OperationMetadata;
15129 /// let x = OperationMetadata::new().set_status_message("example");
15130 /// ```
15131 pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15132 self.status_message = v.into();
15133 self
15134 }
15135
15136 /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
15137 ///
15138 /// # Example
15139 /// ```ignore,no_run
15140 /// # use google_cloud_deploy_v1::model::OperationMetadata;
15141 /// let x = OperationMetadata::new().set_requested_cancellation(true);
15142 /// ```
15143 pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
15144 self.requested_cancellation = v.into();
15145 self
15146 }
15147
15148 /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
15149 ///
15150 /// # Example
15151 /// ```ignore,no_run
15152 /// # use google_cloud_deploy_v1::model::OperationMetadata;
15153 /// let x = OperationMetadata::new().set_api_version("example");
15154 /// ```
15155 pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15156 self.api_version = v.into();
15157 self
15158 }
15159}
15160
15161impl wkt::message::Message for OperationMetadata {
15162 fn typename() -> &'static str {
15163 "type.googleapis.com/google.cloud.deploy.v1.OperationMetadata"
15164 }
15165}
15166
15167/// The request object used by `ApproveRollout`.
15168#[derive(Clone, Default, PartialEq)]
15169#[non_exhaustive]
15170pub struct ApproveRolloutRequest {
15171 /// Required. Name of the Rollout. Format is
15172 /// `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`.
15173 pub name: std::string::String,
15174
15175 /// Required. True = approve; false = reject
15176 pub approved: bool,
15177
15178 /// Optional. Deploy policies to override. Format is
15179 /// `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`.
15180 pub override_deploy_policy: std::vec::Vec<std::string::String>,
15181
15182 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15183}
15184
15185impl ApproveRolloutRequest {
15186 pub fn new() -> Self {
15187 std::default::Default::default()
15188 }
15189
15190 /// Sets the value of [name][crate::model::ApproveRolloutRequest::name].
15191 ///
15192 /// # Example
15193 /// ```ignore,no_run
15194 /// # use google_cloud_deploy_v1::model::ApproveRolloutRequest;
15195 /// let x = ApproveRolloutRequest::new().set_name("example");
15196 /// ```
15197 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15198 self.name = v.into();
15199 self
15200 }
15201
15202 /// Sets the value of [approved][crate::model::ApproveRolloutRequest::approved].
15203 ///
15204 /// # Example
15205 /// ```ignore,no_run
15206 /// # use google_cloud_deploy_v1::model::ApproveRolloutRequest;
15207 /// let x = ApproveRolloutRequest::new().set_approved(true);
15208 /// ```
15209 pub fn set_approved<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
15210 self.approved = v.into();
15211 self
15212 }
15213
15214 /// Sets the value of [override_deploy_policy][crate::model::ApproveRolloutRequest::override_deploy_policy].
15215 ///
15216 /// # Example
15217 /// ```ignore,no_run
15218 /// # use google_cloud_deploy_v1::model::ApproveRolloutRequest;
15219 /// let x = ApproveRolloutRequest::new().set_override_deploy_policy(["a", "b", "c"]);
15220 /// ```
15221 pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
15222 where
15223 T: std::iter::IntoIterator<Item = V>,
15224 V: std::convert::Into<std::string::String>,
15225 {
15226 use std::iter::Iterator;
15227 self.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
15228 self
15229 }
15230}
15231
15232impl wkt::message::Message for ApproveRolloutRequest {
15233 fn typename() -> &'static str {
15234 "type.googleapis.com/google.cloud.deploy.v1.ApproveRolloutRequest"
15235 }
15236}
15237
15238/// The response object from `ApproveRollout`.
15239#[derive(Clone, Default, PartialEq)]
15240#[non_exhaustive]
15241pub struct ApproveRolloutResponse {
15242 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15243}
15244
15245impl ApproveRolloutResponse {
15246 pub fn new() -> Self {
15247 std::default::Default::default()
15248 }
15249}
15250
15251impl wkt::message::Message for ApproveRolloutResponse {
15252 fn typename() -> &'static str {
15253 "type.googleapis.com/google.cloud.deploy.v1.ApproveRolloutResponse"
15254 }
15255}
15256
15257/// The request object used by `AdvanceRollout`.
15258#[derive(Clone, Default, PartialEq)]
15259#[non_exhaustive]
15260pub struct AdvanceRolloutRequest {
15261 /// Required. Name of the Rollout. Format is
15262 /// `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`.
15263 pub name: std::string::String,
15264
15265 /// Required. The phase ID to advance the `Rollout` to.
15266 pub phase_id: std::string::String,
15267
15268 /// Optional. Deploy policies to override. Format is
15269 /// `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`.
15270 pub override_deploy_policy: std::vec::Vec<std::string::String>,
15271
15272 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15273}
15274
15275impl AdvanceRolloutRequest {
15276 pub fn new() -> Self {
15277 std::default::Default::default()
15278 }
15279
15280 /// Sets the value of [name][crate::model::AdvanceRolloutRequest::name].
15281 ///
15282 /// # Example
15283 /// ```ignore,no_run
15284 /// # use google_cloud_deploy_v1::model::AdvanceRolloutRequest;
15285 /// let x = AdvanceRolloutRequest::new().set_name("example");
15286 /// ```
15287 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15288 self.name = v.into();
15289 self
15290 }
15291
15292 /// Sets the value of [phase_id][crate::model::AdvanceRolloutRequest::phase_id].
15293 ///
15294 /// # Example
15295 /// ```ignore,no_run
15296 /// # use google_cloud_deploy_v1::model::AdvanceRolloutRequest;
15297 /// let x = AdvanceRolloutRequest::new().set_phase_id("example");
15298 /// ```
15299 pub fn set_phase_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15300 self.phase_id = v.into();
15301 self
15302 }
15303
15304 /// Sets the value of [override_deploy_policy][crate::model::AdvanceRolloutRequest::override_deploy_policy].
15305 ///
15306 /// # Example
15307 /// ```ignore,no_run
15308 /// # use google_cloud_deploy_v1::model::AdvanceRolloutRequest;
15309 /// let x = AdvanceRolloutRequest::new().set_override_deploy_policy(["a", "b", "c"]);
15310 /// ```
15311 pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
15312 where
15313 T: std::iter::IntoIterator<Item = V>,
15314 V: std::convert::Into<std::string::String>,
15315 {
15316 use std::iter::Iterator;
15317 self.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
15318 self
15319 }
15320}
15321
15322impl wkt::message::Message for AdvanceRolloutRequest {
15323 fn typename() -> &'static str {
15324 "type.googleapis.com/google.cloud.deploy.v1.AdvanceRolloutRequest"
15325 }
15326}
15327
15328/// The response object from `AdvanceRollout`.
15329#[derive(Clone, Default, PartialEq)]
15330#[non_exhaustive]
15331pub struct AdvanceRolloutResponse {
15332 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15333}
15334
15335impl AdvanceRolloutResponse {
15336 pub fn new() -> Self {
15337 std::default::Default::default()
15338 }
15339}
15340
15341impl wkt::message::Message for AdvanceRolloutResponse {
15342 fn typename() -> &'static str {
15343 "type.googleapis.com/google.cloud.deploy.v1.AdvanceRolloutResponse"
15344 }
15345}
15346
15347/// The request object used by `CancelRollout`.
15348#[derive(Clone, Default, PartialEq)]
15349#[non_exhaustive]
15350pub struct CancelRolloutRequest {
15351 /// Required. Name of the Rollout. Format is
15352 /// `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`.
15353 pub name: std::string::String,
15354
15355 /// Optional. Deploy policies to override. Format is
15356 /// `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`.
15357 pub override_deploy_policy: std::vec::Vec<std::string::String>,
15358
15359 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15360}
15361
15362impl CancelRolloutRequest {
15363 pub fn new() -> Self {
15364 std::default::Default::default()
15365 }
15366
15367 /// Sets the value of [name][crate::model::CancelRolloutRequest::name].
15368 ///
15369 /// # Example
15370 /// ```ignore,no_run
15371 /// # use google_cloud_deploy_v1::model::CancelRolloutRequest;
15372 /// let x = CancelRolloutRequest::new().set_name("example");
15373 /// ```
15374 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15375 self.name = v.into();
15376 self
15377 }
15378
15379 /// Sets the value of [override_deploy_policy][crate::model::CancelRolloutRequest::override_deploy_policy].
15380 ///
15381 /// # Example
15382 /// ```ignore,no_run
15383 /// # use google_cloud_deploy_v1::model::CancelRolloutRequest;
15384 /// let x = CancelRolloutRequest::new().set_override_deploy_policy(["a", "b", "c"]);
15385 /// ```
15386 pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
15387 where
15388 T: std::iter::IntoIterator<Item = V>,
15389 V: std::convert::Into<std::string::String>,
15390 {
15391 use std::iter::Iterator;
15392 self.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
15393 self
15394 }
15395}
15396
15397impl wkt::message::Message for CancelRolloutRequest {
15398 fn typename() -> &'static str {
15399 "type.googleapis.com/google.cloud.deploy.v1.CancelRolloutRequest"
15400 }
15401}
15402
15403/// The response object from `CancelRollout`.
15404#[derive(Clone, Default, PartialEq)]
15405#[non_exhaustive]
15406pub struct CancelRolloutResponse {
15407 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15408}
15409
15410impl CancelRolloutResponse {
15411 pub fn new() -> Self {
15412 std::default::Default::default()
15413 }
15414}
15415
15416impl wkt::message::Message for CancelRolloutResponse {
15417 fn typename() -> &'static str {
15418 "type.googleapis.com/google.cloud.deploy.v1.CancelRolloutResponse"
15419 }
15420}
15421
15422/// The request object used by `IgnoreJob`.
15423#[derive(Clone, Default, PartialEq)]
15424#[non_exhaustive]
15425pub struct IgnoreJobRequest {
15426 /// Required. Name of the Rollout. Format is
15427 /// `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`.
15428 pub rollout: std::string::String,
15429
15430 /// Required. The phase ID the Job to ignore belongs to.
15431 pub phase_id: std::string::String,
15432
15433 /// Required. The job ID for the Job to ignore.
15434 pub job_id: std::string::String,
15435
15436 /// Optional. Deploy policies to override. Format is
15437 /// `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`.
15438 pub override_deploy_policy: std::vec::Vec<std::string::String>,
15439
15440 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15441}
15442
15443impl IgnoreJobRequest {
15444 pub fn new() -> Self {
15445 std::default::Default::default()
15446 }
15447
15448 /// Sets the value of [rollout][crate::model::IgnoreJobRequest::rollout].
15449 ///
15450 /// # Example
15451 /// ```ignore,no_run
15452 /// # use google_cloud_deploy_v1::model::IgnoreJobRequest;
15453 /// let x = IgnoreJobRequest::new().set_rollout("example");
15454 /// ```
15455 pub fn set_rollout<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15456 self.rollout = v.into();
15457 self
15458 }
15459
15460 /// Sets the value of [phase_id][crate::model::IgnoreJobRequest::phase_id].
15461 ///
15462 /// # Example
15463 /// ```ignore,no_run
15464 /// # use google_cloud_deploy_v1::model::IgnoreJobRequest;
15465 /// let x = IgnoreJobRequest::new().set_phase_id("example");
15466 /// ```
15467 pub fn set_phase_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15468 self.phase_id = v.into();
15469 self
15470 }
15471
15472 /// Sets the value of [job_id][crate::model::IgnoreJobRequest::job_id].
15473 ///
15474 /// # Example
15475 /// ```ignore,no_run
15476 /// # use google_cloud_deploy_v1::model::IgnoreJobRequest;
15477 /// let x = IgnoreJobRequest::new().set_job_id("example");
15478 /// ```
15479 pub fn set_job_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15480 self.job_id = v.into();
15481 self
15482 }
15483
15484 /// Sets the value of [override_deploy_policy][crate::model::IgnoreJobRequest::override_deploy_policy].
15485 ///
15486 /// # Example
15487 /// ```ignore,no_run
15488 /// # use google_cloud_deploy_v1::model::IgnoreJobRequest;
15489 /// let x = IgnoreJobRequest::new().set_override_deploy_policy(["a", "b", "c"]);
15490 /// ```
15491 pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
15492 where
15493 T: std::iter::IntoIterator<Item = V>,
15494 V: std::convert::Into<std::string::String>,
15495 {
15496 use std::iter::Iterator;
15497 self.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
15498 self
15499 }
15500}
15501
15502impl wkt::message::Message for IgnoreJobRequest {
15503 fn typename() -> &'static str {
15504 "type.googleapis.com/google.cloud.deploy.v1.IgnoreJobRequest"
15505 }
15506}
15507
15508/// The response object from `IgnoreJob`.
15509#[derive(Clone, Default, PartialEq)]
15510#[non_exhaustive]
15511pub struct IgnoreJobResponse {
15512 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15513}
15514
15515impl IgnoreJobResponse {
15516 pub fn new() -> Self {
15517 std::default::Default::default()
15518 }
15519}
15520
15521impl wkt::message::Message for IgnoreJobResponse {
15522 fn typename() -> &'static str {
15523 "type.googleapis.com/google.cloud.deploy.v1.IgnoreJobResponse"
15524 }
15525}
15526
15527/// RetryJobRequest is the request object used by `RetryJob`.
15528#[derive(Clone, Default, PartialEq)]
15529#[non_exhaustive]
15530pub struct RetryJobRequest {
15531 /// Required. Name of the Rollout. Format is
15532 /// `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`.
15533 pub rollout: std::string::String,
15534
15535 /// Required. The phase ID the Job to retry belongs to.
15536 pub phase_id: std::string::String,
15537
15538 /// Required. The job ID for the Job to retry.
15539 pub job_id: std::string::String,
15540
15541 /// Optional. Deploy policies to override. Format is
15542 /// `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`.
15543 pub override_deploy_policy: std::vec::Vec<std::string::String>,
15544
15545 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15546}
15547
15548impl RetryJobRequest {
15549 pub fn new() -> Self {
15550 std::default::Default::default()
15551 }
15552
15553 /// Sets the value of [rollout][crate::model::RetryJobRequest::rollout].
15554 ///
15555 /// # Example
15556 /// ```ignore,no_run
15557 /// # use google_cloud_deploy_v1::model::RetryJobRequest;
15558 /// let x = RetryJobRequest::new().set_rollout("example");
15559 /// ```
15560 pub fn set_rollout<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15561 self.rollout = v.into();
15562 self
15563 }
15564
15565 /// Sets the value of [phase_id][crate::model::RetryJobRequest::phase_id].
15566 ///
15567 /// # Example
15568 /// ```ignore,no_run
15569 /// # use google_cloud_deploy_v1::model::RetryJobRequest;
15570 /// let x = RetryJobRequest::new().set_phase_id("example");
15571 /// ```
15572 pub fn set_phase_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15573 self.phase_id = v.into();
15574 self
15575 }
15576
15577 /// Sets the value of [job_id][crate::model::RetryJobRequest::job_id].
15578 ///
15579 /// # Example
15580 /// ```ignore,no_run
15581 /// # use google_cloud_deploy_v1::model::RetryJobRequest;
15582 /// let x = RetryJobRequest::new().set_job_id("example");
15583 /// ```
15584 pub fn set_job_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15585 self.job_id = v.into();
15586 self
15587 }
15588
15589 /// Sets the value of [override_deploy_policy][crate::model::RetryJobRequest::override_deploy_policy].
15590 ///
15591 /// # Example
15592 /// ```ignore,no_run
15593 /// # use google_cloud_deploy_v1::model::RetryJobRequest;
15594 /// let x = RetryJobRequest::new().set_override_deploy_policy(["a", "b", "c"]);
15595 /// ```
15596 pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
15597 where
15598 T: std::iter::IntoIterator<Item = V>,
15599 V: std::convert::Into<std::string::String>,
15600 {
15601 use std::iter::Iterator;
15602 self.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
15603 self
15604 }
15605}
15606
15607impl wkt::message::Message for RetryJobRequest {
15608 fn typename() -> &'static str {
15609 "type.googleapis.com/google.cloud.deploy.v1.RetryJobRequest"
15610 }
15611}
15612
15613/// The response object from 'RetryJob'.
15614#[derive(Clone, Default, PartialEq)]
15615#[non_exhaustive]
15616pub struct RetryJobResponse {
15617 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15618}
15619
15620impl RetryJobResponse {
15621 pub fn new() -> Self {
15622 std::default::Default::default()
15623 }
15624}
15625
15626impl wkt::message::Message for RetryJobResponse {
15627 fn typename() -> &'static str {
15628 "type.googleapis.com/google.cloud.deploy.v1.RetryJobResponse"
15629 }
15630}
15631
15632/// The request object used by `AbandonRelease`.
15633#[derive(Clone, Default, PartialEq)]
15634#[non_exhaustive]
15635pub struct AbandonReleaseRequest {
15636 /// Required. Name of the Release. Format is
15637 /// `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}`.
15638 pub name: std::string::String,
15639
15640 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15641}
15642
15643impl AbandonReleaseRequest {
15644 pub fn new() -> Self {
15645 std::default::Default::default()
15646 }
15647
15648 /// Sets the value of [name][crate::model::AbandonReleaseRequest::name].
15649 ///
15650 /// # Example
15651 /// ```ignore,no_run
15652 /// # use google_cloud_deploy_v1::model::AbandonReleaseRequest;
15653 /// let x = AbandonReleaseRequest::new().set_name("example");
15654 /// ```
15655 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15656 self.name = v.into();
15657 self
15658 }
15659}
15660
15661impl wkt::message::Message for AbandonReleaseRequest {
15662 fn typename() -> &'static str {
15663 "type.googleapis.com/google.cloud.deploy.v1.AbandonReleaseRequest"
15664 }
15665}
15666
15667/// The response object for `AbandonRelease`.
15668#[derive(Clone, Default, PartialEq)]
15669#[non_exhaustive]
15670pub struct AbandonReleaseResponse {
15671 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15672}
15673
15674impl AbandonReleaseResponse {
15675 pub fn new() -> Self {
15676 std::default::Default::default()
15677 }
15678}
15679
15680impl wkt::message::Message for AbandonReleaseResponse {
15681 fn typename() -> &'static str {
15682 "type.googleapis.com/google.cloud.deploy.v1.AbandonReleaseResponse"
15683 }
15684}
15685
15686/// A `JobRun` resource in the Cloud Deploy API.
15687///
15688/// A `JobRun` contains information of a single `Rollout` job evaluation.
15689#[derive(Clone, Default, PartialEq)]
15690#[non_exhaustive]
15691pub struct JobRun {
15692 /// Output only. Name of the `JobRun`. Format is
15693 /// `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{releases}/rollouts/{rollouts}/jobRuns/{uuid}`.
15694 pub name: std::string::String,
15695
15696 /// Output only. Unique identifier of the `JobRun`.
15697 pub uid: std::string::String,
15698
15699 /// Output only. ID of the `Rollout` phase this `JobRun` belongs in.
15700 pub phase_id: std::string::String,
15701
15702 /// Output only. ID of the `Rollout` job this `JobRun` corresponds to.
15703 pub job_id: std::string::String,
15704
15705 /// Output only. Time at which the `JobRun` was created.
15706 pub create_time: std::option::Option<wkt::Timestamp>,
15707
15708 /// Output only. Time at which the `JobRun` was started.
15709 pub start_time: std::option::Option<wkt::Timestamp>,
15710
15711 /// Output only. Time at which the `JobRun` ended.
15712 pub end_time: std::option::Option<wkt::Timestamp>,
15713
15714 /// Output only. The current state of the `JobRun`.
15715 pub state: crate::model::job_run::State,
15716
15717 /// Output only. This checksum is computed by the server based on the value of
15718 /// other fields, and may be sent on update and delete requests to ensure the
15719 /// client has an up-to-date value before proceeding.
15720 pub etag: std::string::String,
15721
15722 /// The `JobRun` type and the information for that type.
15723 pub job_run: std::option::Option<crate::model::job_run::JobRun>,
15724
15725 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15726}
15727
15728impl JobRun {
15729 pub fn new() -> Self {
15730 std::default::Default::default()
15731 }
15732
15733 /// Sets the value of [name][crate::model::JobRun::name].
15734 ///
15735 /// # Example
15736 /// ```ignore,no_run
15737 /// # use google_cloud_deploy_v1::model::JobRun;
15738 /// let x = JobRun::new().set_name("example");
15739 /// ```
15740 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15741 self.name = v.into();
15742 self
15743 }
15744
15745 /// Sets the value of [uid][crate::model::JobRun::uid].
15746 ///
15747 /// # Example
15748 /// ```ignore,no_run
15749 /// # use google_cloud_deploy_v1::model::JobRun;
15750 /// let x = JobRun::new().set_uid("example");
15751 /// ```
15752 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15753 self.uid = v.into();
15754 self
15755 }
15756
15757 /// Sets the value of [phase_id][crate::model::JobRun::phase_id].
15758 ///
15759 /// # Example
15760 /// ```ignore,no_run
15761 /// # use google_cloud_deploy_v1::model::JobRun;
15762 /// let x = JobRun::new().set_phase_id("example");
15763 /// ```
15764 pub fn set_phase_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15765 self.phase_id = v.into();
15766 self
15767 }
15768
15769 /// Sets the value of [job_id][crate::model::JobRun::job_id].
15770 ///
15771 /// # Example
15772 /// ```ignore,no_run
15773 /// # use google_cloud_deploy_v1::model::JobRun;
15774 /// let x = JobRun::new().set_job_id("example");
15775 /// ```
15776 pub fn set_job_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15777 self.job_id = v.into();
15778 self
15779 }
15780
15781 /// Sets the value of [create_time][crate::model::JobRun::create_time].
15782 ///
15783 /// # Example
15784 /// ```ignore,no_run
15785 /// # use google_cloud_deploy_v1::model::JobRun;
15786 /// use wkt::Timestamp;
15787 /// let x = JobRun::new().set_create_time(Timestamp::default()/* use setters */);
15788 /// ```
15789 pub fn set_create_time<T>(mut self, v: T) -> Self
15790 where
15791 T: std::convert::Into<wkt::Timestamp>,
15792 {
15793 self.create_time = std::option::Option::Some(v.into());
15794 self
15795 }
15796
15797 /// Sets or clears the value of [create_time][crate::model::JobRun::create_time].
15798 ///
15799 /// # Example
15800 /// ```ignore,no_run
15801 /// # use google_cloud_deploy_v1::model::JobRun;
15802 /// use wkt::Timestamp;
15803 /// let x = JobRun::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
15804 /// let x = JobRun::new().set_or_clear_create_time(None::<Timestamp>);
15805 /// ```
15806 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
15807 where
15808 T: std::convert::Into<wkt::Timestamp>,
15809 {
15810 self.create_time = v.map(|x| x.into());
15811 self
15812 }
15813
15814 /// Sets the value of [start_time][crate::model::JobRun::start_time].
15815 ///
15816 /// # Example
15817 /// ```ignore,no_run
15818 /// # use google_cloud_deploy_v1::model::JobRun;
15819 /// use wkt::Timestamp;
15820 /// let x = JobRun::new().set_start_time(Timestamp::default()/* use setters */);
15821 /// ```
15822 pub fn set_start_time<T>(mut self, v: T) -> Self
15823 where
15824 T: std::convert::Into<wkt::Timestamp>,
15825 {
15826 self.start_time = std::option::Option::Some(v.into());
15827 self
15828 }
15829
15830 /// Sets or clears the value of [start_time][crate::model::JobRun::start_time].
15831 ///
15832 /// # Example
15833 /// ```ignore,no_run
15834 /// # use google_cloud_deploy_v1::model::JobRun;
15835 /// use wkt::Timestamp;
15836 /// let x = JobRun::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
15837 /// let x = JobRun::new().set_or_clear_start_time(None::<Timestamp>);
15838 /// ```
15839 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
15840 where
15841 T: std::convert::Into<wkt::Timestamp>,
15842 {
15843 self.start_time = v.map(|x| x.into());
15844 self
15845 }
15846
15847 /// Sets the value of [end_time][crate::model::JobRun::end_time].
15848 ///
15849 /// # Example
15850 /// ```ignore,no_run
15851 /// # use google_cloud_deploy_v1::model::JobRun;
15852 /// use wkt::Timestamp;
15853 /// let x = JobRun::new().set_end_time(Timestamp::default()/* use setters */);
15854 /// ```
15855 pub fn set_end_time<T>(mut self, v: T) -> Self
15856 where
15857 T: std::convert::Into<wkt::Timestamp>,
15858 {
15859 self.end_time = std::option::Option::Some(v.into());
15860 self
15861 }
15862
15863 /// Sets or clears the value of [end_time][crate::model::JobRun::end_time].
15864 ///
15865 /// # Example
15866 /// ```ignore,no_run
15867 /// # use google_cloud_deploy_v1::model::JobRun;
15868 /// use wkt::Timestamp;
15869 /// let x = JobRun::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
15870 /// let x = JobRun::new().set_or_clear_end_time(None::<Timestamp>);
15871 /// ```
15872 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
15873 where
15874 T: std::convert::Into<wkt::Timestamp>,
15875 {
15876 self.end_time = v.map(|x| x.into());
15877 self
15878 }
15879
15880 /// Sets the value of [state][crate::model::JobRun::state].
15881 ///
15882 /// # Example
15883 /// ```ignore,no_run
15884 /// # use google_cloud_deploy_v1::model::JobRun;
15885 /// use google_cloud_deploy_v1::model::job_run::State;
15886 /// let x0 = JobRun::new().set_state(State::InProgress);
15887 /// let x1 = JobRun::new().set_state(State::Succeeded);
15888 /// let x2 = JobRun::new().set_state(State::Failed);
15889 /// ```
15890 pub fn set_state<T: std::convert::Into<crate::model::job_run::State>>(mut self, v: T) -> Self {
15891 self.state = v.into();
15892 self
15893 }
15894
15895 /// Sets the value of [etag][crate::model::JobRun::etag].
15896 ///
15897 /// # Example
15898 /// ```ignore,no_run
15899 /// # use google_cloud_deploy_v1::model::JobRun;
15900 /// let x = JobRun::new().set_etag("example");
15901 /// ```
15902 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15903 self.etag = v.into();
15904 self
15905 }
15906
15907 /// Sets the value of [job_run][crate::model::JobRun::job_run].
15908 ///
15909 /// Note that all the setters affecting `job_run` are mutually
15910 /// exclusive.
15911 ///
15912 /// # Example
15913 /// ```ignore,no_run
15914 /// # use google_cloud_deploy_v1::model::JobRun;
15915 /// use google_cloud_deploy_v1::model::DeployJobRun;
15916 /// let x = JobRun::new().set_job_run(Some(
15917 /// google_cloud_deploy_v1::model::job_run::JobRun::DeployJobRun(DeployJobRun::default().into())));
15918 /// ```
15919 pub fn set_job_run<
15920 T: std::convert::Into<std::option::Option<crate::model::job_run::JobRun>>,
15921 >(
15922 mut self,
15923 v: T,
15924 ) -> Self {
15925 self.job_run = v.into();
15926 self
15927 }
15928
15929 /// The value of [job_run][crate::model::JobRun::job_run]
15930 /// if it holds a `DeployJobRun`, `None` if the field is not set or
15931 /// holds a different branch.
15932 pub fn deploy_job_run(
15933 &self,
15934 ) -> std::option::Option<&std::boxed::Box<crate::model::DeployJobRun>> {
15935 #[allow(unreachable_patterns)]
15936 self.job_run.as_ref().and_then(|v| match v {
15937 crate::model::job_run::JobRun::DeployJobRun(v) => std::option::Option::Some(v),
15938 _ => std::option::Option::None,
15939 })
15940 }
15941
15942 /// Sets the value of [job_run][crate::model::JobRun::job_run]
15943 /// to hold a `DeployJobRun`.
15944 ///
15945 /// Note that all the setters affecting `job_run` are
15946 /// mutually exclusive.
15947 ///
15948 /// # Example
15949 /// ```ignore,no_run
15950 /// # use google_cloud_deploy_v1::model::JobRun;
15951 /// use google_cloud_deploy_v1::model::DeployJobRun;
15952 /// let x = JobRun::new().set_deploy_job_run(DeployJobRun::default()/* use setters */);
15953 /// assert!(x.deploy_job_run().is_some());
15954 /// assert!(x.verify_job_run().is_none());
15955 /// assert!(x.predeploy_job_run().is_none());
15956 /// assert!(x.postdeploy_job_run().is_none());
15957 /// assert!(x.create_child_rollout_job_run().is_none());
15958 /// assert!(x.advance_child_rollout_job_run().is_none());
15959 /// ```
15960 pub fn set_deploy_job_run<
15961 T: std::convert::Into<std::boxed::Box<crate::model::DeployJobRun>>,
15962 >(
15963 mut self,
15964 v: T,
15965 ) -> Self {
15966 self.job_run =
15967 std::option::Option::Some(crate::model::job_run::JobRun::DeployJobRun(v.into()));
15968 self
15969 }
15970
15971 /// The value of [job_run][crate::model::JobRun::job_run]
15972 /// if it holds a `VerifyJobRun`, `None` if the field is not set or
15973 /// holds a different branch.
15974 pub fn verify_job_run(
15975 &self,
15976 ) -> std::option::Option<&std::boxed::Box<crate::model::VerifyJobRun>> {
15977 #[allow(unreachable_patterns)]
15978 self.job_run.as_ref().and_then(|v| match v {
15979 crate::model::job_run::JobRun::VerifyJobRun(v) => std::option::Option::Some(v),
15980 _ => std::option::Option::None,
15981 })
15982 }
15983
15984 /// Sets the value of [job_run][crate::model::JobRun::job_run]
15985 /// to hold a `VerifyJobRun`.
15986 ///
15987 /// Note that all the setters affecting `job_run` are
15988 /// mutually exclusive.
15989 ///
15990 /// # Example
15991 /// ```ignore,no_run
15992 /// # use google_cloud_deploy_v1::model::JobRun;
15993 /// use google_cloud_deploy_v1::model::VerifyJobRun;
15994 /// let x = JobRun::new().set_verify_job_run(VerifyJobRun::default()/* use setters */);
15995 /// assert!(x.verify_job_run().is_some());
15996 /// assert!(x.deploy_job_run().is_none());
15997 /// assert!(x.predeploy_job_run().is_none());
15998 /// assert!(x.postdeploy_job_run().is_none());
15999 /// assert!(x.create_child_rollout_job_run().is_none());
16000 /// assert!(x.advance_child_rollout_job_run().is_none());
16001 /// ```
16002 pub fn set_verify_job_run<
16003 T: std::convert::Into<std::boxed::Box<crate::model::VerifyJobRun>>,
16004 >(
16005 mut self,
16006 v: T,
16007 ) -> Self {
16008 self.job_run =
16009 std::option::Option::Some(crate::model::job_run::JobRun::VerifyJobRun(v.into()));
16010 self
16011 }
16012
16013 /// The value of [job_run][crate::model::JobRun::job_run]
16014 /// if it holds a `PredeployJobRun`, `None` if the field is not set or
16015 /// holds a different branch.
16016 pub fn predeploy_job_run(
16017 &self,
16018 ) -> std::option::Option<&std::boxed::Box<crate::model::PredeployJobRun>> {
16019 #[allow(unreachable_patterns)]
16020 self.job_run.as_ref().and_then(|v| match v {
16021 crate::model::job_run::JobRun::PredeployJobRun(v) => std::option::Option::Some(v),
16022 _ => std::option::Option::None,
16023 })
16024 }
16025
16026 /// Sets the value of [job_run][crate::model::JobRun::job_run]
16027 /// to hold a `PredeployJobRun`.
16028 ///
16029 /// Note that all the setters affecting `job_run` are
16030 /// mutually exclusive.
16031 ///
16032 /// # Example
16033 /// ```ignore,no_run
16034 /// # use google_cloud_deploy_v1::model::JobRun;
16035 /// use google_cloud_deploy_v1::model::PredeployJobRun;
16036 /// let x = JobRun::new().set_predeploy_job_run(PredeployJobRun::default()/* use setters */);
16037 /// assert!(x.predeploy_job_run().is_some());
16038 /// assert!(x.deploy_job_run().is_none());
16039 /// assert!(x.verify_job_run().is_none());
16040 /// assert!(x.postdeploy_job_run().is_none());
16041 /// assert!(x.create_child_rollout_job_run().is_none());
16042 /// assert!(x.advance_child_rollout_job_run().is_none());
16043 /// ```
16044 pub fn set_predeploy_job_run<
16045 T: std::convert::Into<std::boxed::Box<crate::model::PredeployJobRun>>,
16046 >(
16047 mut self,
16048 v: T,
16049 ) -> Self {
16050 self.job_run =
16051 std::option::Option::Some(crate::model::job_run::JobRun::PredeployJobRun(v.into()));
16052 self
16053 }
16054
16055 /// The value of [job_run][crate::model::JobRun::job_run]
16056 /// if it holds a `PostdeployJobRun`, `None` if the field is not set or
16057 /// holds a different branch.
16058 pub fn postdeploy_job_run(
16059 &self,
16060 ) -> std::option::Option<&std::boxed::Box<crate::model::PostdeployJobRun>> {
16061 #[allow(unreachable_patterns)]
16062 self.job_run.as_ref().and_then(|v| match v {
16063 crate::model::job_run::JobRun::PostdeployJobRun(v) => std::option::Option::Some(v),
16064 _ => std::option::Option::None,
16065 })
16066 }
16067
16068 /// Sets the value of [job_run][crate::model::JobRun::job_run]
16069 /// to hold a `PostdeployJobRun`.
16070 ///
16071 /// Note that all the setters affecting `job_run` are
16072 /// mutually exclusive.
16073 ///
16074 /// # Example
16075 /// ```ignore,no_run
16076 /// # use google_cloud_deploy_v1::model::JobRun;
16077 /// use google_cloud_deploy_v1::model::PostdeployJobRun;
16078 /// let x = JobRun::new().set_postdeploy_job_run(PostdeployJobRun::default()/* use setters */);
16079 /// assert!(x.postdeploy_job_run().is_some());
16080 /// assert!(x.deploy_job_run().is_none());
16081 /// assert!(x.verify_job_run().is_none());
16082 /// assert!(x.predeploy_job_run().is_none());
16083 /// assert!(x.create_child_rollout_job_run().is_none());
16084 /// assert!(x.advance_child_rollout_job_run().is_none());
16085 /// ```
16086 pub fn set_postdeploy_job_run<
16087 T: std::convert::Into<std::boxed::Box<crate::model::PostdeployJobRun>>,
16088 >(
16089 mut self,
16090 v: T,
16091 ) -> Self {
16092 self.job_run =
16093 std::option::Option::Some(crate::model::job_run::JobRun::PostdeployJobRun(v.into()));
16094 self
16095 }
16096
16097 /// The value of [job_run][crate::model::JobRun::job_run]
16098 /// if it holds a `CreateChildRolloutJobRun`, `None` if the field is not set or
16099 /// holds a different branch.
16100 pub fn create_child_rollout_job_run(
16101 &self,
16102 ) -> std::option::Option<&std::boxed::Box<crate::model::CreateChildRolloutJobRun>> {
16103 #[allow(unreachable_patterns)]
16104 self.job_run.as_ref().and_then(|v| match v {
16105 crate::model::job_run::JobRun::CreateChildRolloutJobRun(v) => {
16106 std::option::Option::Some(v)
16107 }
16108 _ => std::option::Option::None,
16109 })
16110 }
16111
16112 /// Sets the value of [job_run][crate::model::JobRun::job_run]
16113 /// to hold a `CreateChildRolloutJobRun`.
16114 ///
16115 /// Note that all the setters affecting `job_run` are
16116 /// mutually exclusive.
16117 ///
16118 /// # Example
16119 /// ```ignore,no_run
16120 /// # use google_cloud_deploy_v1::model::JobRun;
16121 /// use google_cloud_deploy_v1::model::CreateChildRolloutJobRun;
16122 /// let x = JobRun::new().set_create_child_rollout_job_run(CreateChildRolloutJobRun::default()/* use setters */);
16123 /// assert!(x.create_child_rollout_job_run().is_some());
16124 /// assert!(x.deploy_job_run().is_none());
16125 /// assert!(x.verify_job_run().is_none());
16126 /// assert!(x.predeploy_job_run().is_none());
16127 /// assert!(x.postdeploy_job_run().is_none());
16128 /// assert!(x.advance_child_rollout_job_run().is_none());
16129 /// ```
16130 pub fn set_create_child_rollout_job_run<
16131 T: std::convert::Into<std::boxed::Box<crate::model::CreateChildRolloutJobRun>>,
16132 >(
16133 mut self,
16134 v: T,
16135 ) -> Self {
16136 self.job_run = std::option::Option::Some(
16137 crate::model::job_run::JobRun::CreateChildRolloutJobRun(v.into()),
16138 );
16139 self
16140 }
16141
16142 /// The value of [job_run][crate::model::JobRun::job_run]
16143 /// if it holds a `AdvanceChildRolloutJobRun`, `None` if the field is not set or
16144 /// holds a different branch.
16145 pub fn advance_child_rollout_job_run(
16146 &self,
16147 ) -> std::option::Option<&std::boxed::Box<crate::model::AdvanceChildRolloutJobRun>> {
16148 #[allow(unreachable_patterns)]
16149 self.job_run.as_ref().and_then(|v| match v {
16150 crate::model::job_run::JobRun::AdvanceChildRolloutJobRun(v) => {
16151 std::option::Option::Some(v)
16152 }
16153 _ => std::option::Option::None,
16154 })
16155 }
16156
16157 /// Sets the value of [job_run][crate::model::JobRun::job_run]
16158 /// to hold a `AdvanceChildRolloutJobRun`.
16159 ///
16160 /// Note that all the setters affecting `job_run` are
16161 /// mutually exclusive.
16162 ///
16163 /// # Example
16164 /// ```ignore,no_run
16165 /// # use google_cloud_deploy_v1::model::JobRun;
16166 /// use google_cloud_deploy_v1::model::AdvanceChildRolloutJobRun;
16167 /// let x = JobRun::new().set_advance_child_rollout_job_run(AdvanceChildRolloutJobRun::default()/* use setters */);
16168 /// assert!(x.advance_child_rollout_job_run().is_some());
16169 /// assert!(x.deploy_job_run().is_none());
16170 /// assert!(x.verify_job_run().is_none());
16171 /// assert!(x.predeploy_job_run().is_none());
16172 /// assert!(x.postdeploy_job_run().is_none());
16173 /// assert!(x.create_child_rollout_job_run().is_none());
16174 /// ```
16175 pub fn set_advance_child_rollout_job_run<
16176 T: std::convert::Into<std::boxed::Box<crate::model::AdvanceChildRolloutJobRun>>,
16177 >(
16178 mut self,
16179 v: T,
16180 ) -> Self {
16181 self.job_run = std::option::Option::Some(
16182 crate::model::job_run::JobRun::AdvanceChildRolloutJobRun(v.into()),
16183 );
16184 self
16185 }
16186}
16187
16188impl wkt::message::Message for JobRun {
16189 fn typename() -> &'static str {
16190 "type.googleapis.com/google.cloud.deploy.v1.JobRun"
16191 }
16192}
16193
16194/// Defines additional types related to [JobRun].
16195pub mod job_run {
16196 #[allow(unused_imports)]
16197 use super::*;
16198
16199 /// Valid states of a `JobRun`.
16200 ///
16201 /// # Working with unknown values
16202 ///
16203 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16204 /// additional enum variants at any time. Adding new variants is not considered
16205 /// a breaking change. Applications should write their code in anticipation of:
16206 ///
16207 /// - New values appearing in future releases of the client library, **and**
16208 /// - New values received dynamically, without application changes.
16209 ///
16210 /// Please consult the [Working with enums] section in the user guide for some
16211 /// guidelines.
16212 ///
16213 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
16214 #[derive(Clone, Debug, PartialEq)]
16215 #[non_exhaustive]
16216 pub enum State {
16217 /// The `JobRun` has an unspecified state.
16218 Unspecified,
16219 /// The `JobRun` is in progress.
16220 InProgress,
16221 /// The `JobRun` has succeeded.
16222 Succeeded,
16223 /// The `JobRun` has failed.
16224 Failed,
16225 /// The `JobRun` is terminating.
16226 Terminating,
16227 /// The `JobRun` was terminated.
16228 Terminated,
16229 /// If set, the enum was initialized with an unknown value.
16230 ///
16231 /// Applications can examine the value using [State::value] or
16232 /// [State::name].
16233 UnknownValue(state::UnknownValue),
16234 }
16235
16236 #[doc(hidden)]
16237 pub mod state {
16238 #[allow(unused_imports)]
16239 use super::*;
16240 #[derive(Clone, Debug, PartialEq)]
16241 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16242 }
16243
16244 impl State {
16245 /// Gets the enum value.
16246 ///
16247 /// Returns `None` if the enum contains an unknown value deserialized from
16248 /// the string representation of enums.
16249 pub fn value(&self) -> std::option::Option<i32> {
16250 match self {
16251 Self::Unspecified => std::option::Option::Some(0),
16252 Self::InProgress => std::option::Option::Some(1),
16253 Self::Succeeded => std::option::Option::Some(2),
16254 Self::Failed => std::option::Option::Some(3),
16255 Self::Terminating => std::option::Option::Some(4),
16256 Self::Terminated => std::option::Option::Some(5),
16257 Self::UnknownValue(u) => u.0.value(),
16258 }
16259 }
16260
16261 /// Gets the enum value as a string.
16262 ///
16263 /// Returns `None` if the enum contains an unknown value deserialized from
16264 /// the integer representation of enums.
16265 pub fn name(&self) -> std::option::Option<&str> {
16266 match self {
16267 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
16268 Self::InProgress => std::option::Option::Some("IN_PROGRESS"),
16269 Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
16270 Self::Failed => std::option::Option::Some("FAILED"),
16271 Self::Terminating => std::option::Option::Some("TERMINATING"),
16272 Self::Terminated => std::option::Option::Some("TERMINATED"),
16273 Self::UnknownValue(u) => u.0.name(),
16274 }
16275 }
16276 }
16277
16278 impl std::default::Default for State {
16279 fn default() -> Self {
16280 use std::convert::From;
16281 Self::from(0)
16282 }
16283 }
16284
16285 impl std::fmt::Display for State {
16286 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16287 wkt::internal::display_enum(f, self.name(), self.value())
16288 }
16289 }
16290
16291 impl std::convert::From<i32> for State {
16292 fn from(value: i32) -> Self {
16293 match value {
16294 0 => Self::Unspecified,
16295 1 => Self::InProgress,
16296 2 => Self::Succeeded,
16297 3 => Self::Failed,
16298 4 => Self::Terminating,
16299 5 => Self::Terminated,
16300 _ => Self::UnknownValue(state::UnknownValue(
16301 wkt::internal::UnknownEnumValue::Integer(value),
16302 )),
16303 }
16304 }
16305 }
16306
16307 impl std::convert::From<&str> for State {
16308 fn from(value: &str) -> Self {
16309 use std::string::ToString;
16310 match value {
16311 "STATE_UNSPECIFIED" => Self::Unspecified,
16312 "IN_PROGRESS" => Self::InProgress,
16313 "SUCCEEDED" => Self::Succeeded,
16314 "FAILED" => Self::Failed,
16315 "TERMINATING" => Self::Terminating,
16316 "TERMINATED" => Self::Terminated,
16317 _ => Self::UnknownValue(state::UnknownValue(
16318 wkt::internal::UnknownEnumValue::String(value.to_string()),
16319 )),
16320 }
16321 }
16322 }
16323
16324 impl serde::ser::Serialize for State {
16325 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16326 where
16327 S: serde::Serializer,
16328 {
16329 match self {
16330 Self::Unspecified => serializer.serialize_i32(0),
16331 Self::InProgress => serializer.serialize_i32(1),
16332 Self::Succeeded => serializer.serialize_i32(2),
16333 Self::Failed => serializer.serialize_i32(3),
16334 Self::Terminating => serializer.serialize_i32(4),
16335 Self::Terminated => serializer.serialize_i32(5),
16336 Self::UnknownValue(u) => u.0.serialize(serializer),
16337 }
16338 }
16339 }
16340
16341 impl<'de> serde::de::Deserialize<'de> for State {
16342 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16343 where
16344 D: serde::Deserializer<'de>,
16345 {
16346 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
16347 ".google.cloud.deploy.v1.JobRun.State",
16348 ))
16349 }
16350 }
16351
16352 /// The `JobRun` type and the information for that type.
16353 #[derive(Clone, Debug, PartialEq)]
16354 #[non_exhaustive]
16355 pub enum JobRun {
16356 /// Output only. Information specific to a deploy `JobRun`.
16357 DeployJobRun(std::boxed::Box<crate::model::DeployJobRun>),
16358 /// Output only. Information specific to a verify `JobRun`.
16359 VerifyJobRun(std::boxed::Box<crate::model::VerifyJobRun>),
16360 /// Output only. Information specific to a predeploy `JobRun`.
16361 PredeployJobRun(std::boxed::Box<crate::model::PredeployJobRun>),
16362 /// Output only. Information specific to a postdeploy `JobRun`.
16363 PostdeployJobRun(std::boxed::Box<crate::model::PostdeployJobRun>),
16364 /// Output only. Information specific to a createChildRollout `JobRun`.
16365 CreateChildRolloutJobRun(std::boxed::Box<crate::model::CreateChildRolloutJobRun>),
16366 /// Output only. Information specific to an advanceChildRollout `JobRun`
16367 AdvanceChildRolloutJobRun(std::boxed::Box<crate::model::AdvanceChildRolloutJobRun>),
16368 }
16369}
16370
16371/// DeployJobRun contains information specific to a deploy `JobRun`.
16372#[derive(Clone, Default, PartialEq)]
16373#[non_exhaustive]
16374pub struct DeployJobRun {
16375 /// Output only. The resource name of the Cloud Build `Build` object that is
16376 /// used to deploy. Format is
16377 /// `projects/{project}/locations/{location}/builds/{build}`.
16378 pub build: std::string::String,
16379
16380 /// Output only. The reason the deploy failed. This will always be unspecified
16381 /// while the deploy is in progress or if it succeeded.
16382 pub failure_cause: crate::model::deploy_job_run::FailureCause,
16383
16384 /// Output only. Additional information about the deploy failure, if available.
16385 pub failure_message: std::string::String,
16386
16387 /// Output only. Metadata containing information about the deploy job run.
16388 pub metadata: std::option::Option<crate::model::DeployJobRunMetadata>,
16389
16390 /// Output only. The artifact of a deploy job run, if available.
16391 pub artifact: std::option::Option<crate::model::DeployArtifact>,
16392
16393 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16394}
16395
16396impl DeployJobRun {
16397 pub fn new() -> Self {
16398 std::default::Default::default()
16399 }
16400
16401 /// Sets the value of [build][crate::model::DeployJobRun::build].
16402 ///
16403 /// # Example
16404 /// ```ignore,no_run
16405 /// # use google_cloud_deploy_v1::model::DeployJobRun;
16406 /// let x = DeployJobRun::new().set_build("example");
16407 /// ```
16408 pub fn set_build<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16409 self.build = v.into();
16410 self
16411 }
16412
16413 /// Sets the value of [failure_cause][crate::model::DeployJobRun::failure_cause].
16414 ///
16415 /// # Example
16416 /// ```ignore,no_run
16417 /// # use google_cloud_deploy_v1::model::DeployJobRun;
16418 /// use google_cloud_deploy_v1::model::deploy_job_run::FailureCause;
16419 /// let x0 = DeployJobRun::new().set_failure_cause(FailureCause::CloudBuildUnavailable);
16420 /// let x1 = DeployJobRun::new().set_failure_cause(FailureCause::ExecutionFailed);
16421 /// let x2 = DeployJobRun::new().set_failure_cause(FailureCause::DeadlineExceeded);
16422 /// ```
16423 pub fn set_failure_cause<T: std::convert::Into<crate::model::deploy_job_run::FailureCause>>(
16424 mut self,
16425 v: T,
16426 ) -> Self {
16427 self.failure_cause = v.into();
16428 self
16429 }
16430
16431 /// Sets the value of [failure_message][crate::model::DeployJobRun::failure_message].
16432 ///
16433 /// # Example
16434 /// ```ignore,no_run
16435 /// # use google_cloud_deploy_v1::model::DeployJobRun;
16436 /// let x = DeployJobRun::new().set_failure_message("example");
16437 /// ```
16438 pub fn set_failure_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16439 self.failure_message = v.into();
16440 self
16441 }
16442
16443 /// Sets the value of [metadata][crate::model::DeployJobRun::metadata].
16444 ///
16445 /// # Example
16446 /// ```ignore,no_run
16447 /// # use google_cloud_deploy_v1::model::DeployJobRun;
16448 /// use google_cloud_deploy_v1::model::DeployJobRunMetadata;
16449 /// let x = DeployJobRun::new().set_metadata(DeployJobRunMetadata::default()/* use setters */);
16450 /// ```
16451 pub fn set_metadata<T>(mut self, v: T) -> Self
16452 where
16453 T: std::convert::Into<crate::model::DeployJobRunMetadata>,
16454 {
16455 self.metadata = std::option::Option::Some(v.into());
16456 self
16457 }
16458
16459 /// Sets or clears the value of [metadata][crate::model::DeployJobRun::metadata].
16460 ///
16461 /// # Example
16462 /// ```ignore,no_run
16463 /// # use google_cloud_deploy_v1::model::DeployJobRun;
16464 /// use google_cloud_deploy_v1::model::DeployJobRunMetadata;
16465 /// let x = DeployJobRun::new().set_or_clear_metadata(Some(DeployJobRunMetadata::default()/* use setters */));
16466 /// let x = DeployJobRun::new().set_or_clear_metadata(None::<DeployJobRunMetadata>);
16467 /// ```
16468 pub fn set_or_clear_metadata<T>(mut self, v: std::option::Option<T>) -> Self
16469 where
16470 T: std::convert::Into<crate::model::DeployJobRunMetadata>,
16471 {
16472 self.metadata = v.map(|x| x.into());
16473 self
16474 }
16475
16476 /// Sets the value of [artifact][crate::model::DeployJobRun::artifact].
16477 ///
16478 /// # Example
16479 /// ```ignore,no_run
16480 /// # use google_cloud_deploy_v1::model::DeployJobRun;
16481 /// use google_cloud_deploy_v1::model::DeployArtifact;
16482 /// let x = DeployJobRun::new().set_artifact(DeployArtifact::default()/* use setters */);
16483 /// ```
16484 pub fn set_artifact<T>(mut self, v: T) -> Self
16485 where
16486 T: std::convert::Into<crate::model::DeployArtifact>,
16487 {
16488 self.artifact = std::option::Option::Some(v.into());
16489 self
16490 }
16491
16492 /// Sets or clears the value of [artifact][crate::model::DeployJobRun::artifact].
16493 ///
16494 /// # Example
16495 /// ```ignore,no_run
16496 /// # use google_cloud_deploy_v1::model::DeployJobRun;
16497 /// use google_cloud_deploy_v1::model::DeployArtifact;
16498 /// let x = DeployJobRun::new().set_or_clear_artifact(Some(DeployArtifact::default()/* use setters */));
16499 /// let x = DeployJobRun::new().set_or_clear_artifact(None::<DeployArtifact>);
16500 /// ```
16501 pub fn set_or_clear_artifact<T>(mut self, v: std::option::Option<T>) -> Self
16502 where
16503 T: std::convert::Into<crate::model::DeployArtifact>,
16504 {
16505 self.artifact = v.map(|x| x.into());
16506 self
16507 }
16508}
16509
16510impl wkt::message::Message for DeployJobRun {
16511 fn typename() -> &'static str {
16512 "type.googleapis.com/google.cloud.deploy.v1.DeployJobRun"
16513 }
16514}
16515
16516/// Defines additional types related to [DeployJobRun].
16517pub mod deploy_job_run {
16518 #[allow(unused_imports)]
16519 use super::*;
16520
16521 /// Well-known deploy failures.
16522 ///
16523 /// # Working with unknown values
16524 ///
16525 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16526 /// additional enum variants at any time. Adding new variants is not considered
16527 /// a breaking change. Applications should write their code in anticipation of:
16528 ///
16529 /// - New values appearing in future releases of the client library, **and**
16530 /// - New values received dynamically, without application changes.
16531 ///
16532 /// Please consult the [Working with enums] section in the user guide for some
16533 /// guidelines.
16534 ///
16535 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
16536 #[derive(Clone, Debug, PartialEq)]
16537 #[non_exhaustive]
16538 pub enum FailureCause {
16539 /// No reason for failure is specified.
16540 Unspecified,
16541 /// Cloud Build is not available, either because it is not enabled or because
16542 /// Cloud Deploy has insufficient permissions. See [Required
16543 /// permission](https://cloud.google.com/deploy/docs/cloud-deploy-service-account#required_permissions).
16544 CloudBuildUnavailable,
16545 /// The deploy operation did not complete successfully; check Cloud Build
16546 /// logs.
16547 ExecutionFailed,
16548 /// The deploy job run did not complete within the allotted time.
16549 DeadlineExceeded,
16550 /// There were missing resources in the runtime environment required for a
16551 /// canary deployment. Check the Cloud Build logs for more information.
16552 MissingResourcesForCanary,
16553 /// Cloud Build failed to fulfill Cloud Deploy's request. See failure_message
16554 /// for additional details.
16555 CloudBuildRequestFailed,
16556 /// The deploy operation had a feature configured that is not supported.
16557 DeployFeatureNotSupported,
16558 /// If set, the enum was initialized with an unknown value.
16559 ///
16560 /// Applications can examine the value using [FailureCause::value] or
16561 /// [FailureCause::name].
16562 UnknownValue(failure_cause::UnknownValue),
16563 }
16564
16565 #[doc(hidden)]
16566 pub mod failure_cause {
16567 #[allow(unused_imports)]
16568 use super::*;
16569 #[derive(Clone, Debug, PartialEq)]
16570 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16571 }
16572
16573 impl FailureCause {
16574 /// Gets the enum value.
16575 ///
16576 /// Returns `None` if the enum contains an unknown value deserialized from
16577 /// the string representation of enums.
16578 pub fn value(&self) -> std::option::Option<i32> {
16579 match self {
16580 Self::Unspecified => std::option::Option::Some(0),
16581 Self::CloudBuildUnavailable => std::option::Option::Some(1),
16582 Self::ExecutionFailed => std::option::Option::Some(2),
16583 Self::DeadlineExceeded => std::option::Option::Some(3),
16584 Self::MissingResourcesForCanary => std::option::Option::Some(4),
16585 Self::CloudBuildRequestFailed => std::option::Option::Some(5),
16586 Self::DeployFeatureNotSupported => std::option::Option::Some(6),
16587 Self::UnknownValue(u) => u.0.value(),
16588 }
16589 }
16590
16591 /// Gets the enum value as a string.
16592 ///
16593 /// Returns `None` if the enum contains an unknown value deserialized from
16594 /// the integer representation of enums.
16595 pub fn name(&self) -> std::option::Option<&str> {
16596 match self {
16597 Self::Unspecified => std::option::Option::Some("FAILURE_CAUSE_UNSPECIFIED"),
16598 Self::CloudBuildUnavailable => std::option::Option::Some("CLOUD_BUILD_UNAVAILABLE"),
16599 Self::ExecutionFailed => std::option::Option::Some("EXECUTION_FAILED"),
16600 Self::DeadlineExceeded => std::option::Option::Some("DEADLINE_EXCEEDED"),
16601 Self::MissingResourcesForCanary => {
16602 std::option::Option::Some("MISSING_RESOURCES_FOR_CANARY")
16603 }
16604 Self::CloudBuildRequestFailed => {
16605 std::option::Option::Some("CLOUD_BUILD_REQUEST_FAILED")
16606 }
16607 Self::DeployFeatureNotSupported => {
16608 std::option::Option::Some("DEPLOY_FEATURE_NOT_SUPPORTED")
16609 }
16610 Self::UnknownValue(u) => u.0.name(),
16611 }
16612 }
16613 }
16614
16615 impl std::default::Default for FailureCause {
16616 fn default() -> Self {
16617 use std::convert::From;
16618 Self::from(0)
16619 }
16620 }
16621
16622 impl std::fmt::Display for FailureCause {
16623 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16624 wkt::internal::display_enum(f, self.name(), self.value())
16625 }
16626 }
16627
16628 impl std::convert::From<i32> for FailureCause {
16629 fn from(value: i32) -> Self {
16630 match value {
16631 0 => Self::Unspecified,
16632 1 => Self::CloudBuildUnavailable,
16633 2 => Self::ExecutionFailed,
16634 3 => Self::DeadlineExceeded,
16635 4 => Self::MissingResourcesForCanary,
16636 5 => Self::CloudBuildRequestFailed,
16637 6 => Self::DeployFeatureNotSupported,
16638 _ => Self::UnknownValue(failure_cause::UnknownValue(
16639 wkt::internal::UnknownEnumValue::Integer(value),
16640 )),
16641 }
16642 }
16643 }
16644
16645 impl std::convert::From<&str> for FailureCause {
16646 fn from(value: &str) -> Self {
16647 use std::string::ToString;
16648 match value {
16649 "FAILURE_CAUSE_UNSPECIFIED" => Self::Unspecified,
16650 "CLOUD_BUILD_UNAVAILABLE" => Self::CloudBuildUnavailable,
16651 "EXECUTION_FAILED" => Self::ExecutionFailed,
16652 "DEADLINE_EXCEEDED" => Self::DeadlineExceeded,
16653 "MISSING_RESOURCES_FOR_CANARY" => Self::MissingResourcesForCanary,
16654 "CLOUD_BUILD_REQUEST_FAILED" => Self::CloudBuildRequestFailed,
16655 "DEPLOY_FEATURE_NOT_SUPPORTED" => Self::DeployFeatureNotSupported,
16656 _ => Self::UnknownValue(failure_cause::UnknownValue(
16657 wkt::internal::UnknownEnumValue::String(value.to_string()),
16658 )),
16659 }
16660 }
16661 }
16662
16663 impl serde::ser::Serialize for FailureCause {
16664 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16665 where
16666 S: serde::Serializer,
16667 {
16668 match self {
16669 Self::Unspecified => serializer.serialize_i32(0),
16670 Self::CloudBuildUnavailable => serializer.serialize_i32(1),
16671 Self::ExecutionFailed => serializer.serialize_i32(2),
16672 Self::DeadlineExceeded => serializer.serialize_i32(3),
16673 Self::MissingResourcesForCanary => serializer.serialize_i32(4),
16674 Self::CloudBuildRequestFailed => serializer.serialize_i32(5),
16675 Self::DeployFeatureNotSupported => serializer.serialize_i32(6),
16676 Self::UnknownValue(u) => u.0.serialize(serializer),
16677 }
16678 }
16679 }
16680
16681 impl<'de> serde::de::Deserialize<'de> for FailureCause {
16682 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16683 where
16684 D: serde::Deserializer<'de>,
16685 {
16686 deserializer.deserialize_any(wkt::internal::EnumVisitor::<FailureCause>::new(
16687 ".google.cloud.deploy.v1.DeployJobRun.FailureCause",
16688 ))
16689 }
16690 }
16691}
16692
16693/// VerifyJobRun contains information specific to a verify `JobRun`.
16694#[derive(Clone, Default, PartialEq)]
16695#[non_exhaustive]
16696pub struct VerifyJobRun {
16697 /// Output only. The resource name of the Cloud Build `Build` object that is
16698 /// used to verify. Format is
16699 /// `projects/{project}/locations/{location}/builds/{build}`.
16700 pub build: std::string::String,
16701
16702 /// Output only. URI of a directory containing the verify artifacts. This
16703 /// contains the Skaffold event log.
16704 pub artifact_uri: std::string::String,
16705
16706 /// Output only. File path of the Skaffold event log relative to the artifact
16707 /// URI.
16708 pub event_log_path: std::string::String,
16709
16710 /// Output only. The reason the verify failed. This will always be unspecified
16711 /// while the verify is in progress or if it succeeded.
16712 pub failure_cause: crate::model::verify_job_run::FailureCause,
16713
16714 /// Output only. Additional information about the verify failure, if available.
16715 pub failure_message: std::string::String,
16716
16717 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16718}
16719
16720impl VerifyJobRun {
16721 pub fn new() -> Self {
16722 std::default::Default::default()
16723 }
16724
16725 /// Sets the value of [build][crate::model::VerifyJobRun::build].
16726 ///
16727 /// # Example
16728 /// ```ignore,no_run
16729 /// # use google_cloud_deploy_v1::model::VerifyJobRun;
16730 /// let x = VerifyJobRun::new().set_build("example");
16731 /// ```
16732 pub fn set_build<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16733 self.build = v.into();
16734 self
16735 }
16736
16737 /// Sets the value of [artifact_uri][crate::model::VerifyJobRun::artifact_uri].
16738 ///
16739 /// # Example
16740 /// ```ignore,no_run
16741 /// # use google_cloud_deploy_v1::model::VerifyJobRun;
16742 /// let x = VerifyJobRun::new().set_artifact_uri("example");
16743 /// ```
16744 pub fn set_artifact_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16745 self.artifact_uri = v.into();
16746 self
16747 }
16748
16749 /// Sets the value of [event_log_path][crate::model::VerifyJobRun::event_log_path].
16750 ///
16751 /// # Example
16752 /// ```ignore,no_run
16753 /// # use google_cloud_deploy_v1::model::VerifyJobRun;
16754 /// let x = VerifyJobRun::new().set_event_log_path("example");
16755 /// ```
16756 pub fn set_event_log_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16757 self.event_log_path = v.into();
16758 self
16759 }
16760
16761 /// Sets the value of [failure_cause][crate::model::VerifyJobRun::failure_cause].
16762 ///
16763 /// # Example
16764 /// ```ignore,no_run
16765 /// # use google_cloud_deploy_v1::model::VerifyJobRun;
16766 /// use google_cloud_deploy_v1::model::verify_job_run::FailureCause;
16767 /// let x0 = VerifyJobRun::new().set_failure_cause(FailureCause::CloudBuildUnavailable);
16768 /// let x1 = VerifyJobRun::new().set_failure_cause(FailureCause::ExecutionFailed);
16769 /// let x2 = VerifyJobRun::new().set_failure_cause(FailureCause::DeadlineExceeded);
16770 /// ```
16771 pub fn set_failure_cause<T: std::convert::Into<crate::model::verify_job_run::FailureCause>>(
16772 mut self,
16773 v: T,
16774 ) -> Self {
16775 self.failure_cause = v.into();
16776 self
16777 }
16778
16779 /// Sets the value of [failure_message][crate::model::VerifyJobRun::failure_message].
16780 ///
16781 /// # Example
16782 /// ```ignore,no_run
16783 /// # use google_cloud_deploy_v1::model::VerifyJobRun;
16784 /// let x = VerifyJobRun::new().set_failure_message("example");
16785 /// ```
16786 pub fn set_failure_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16787 self.failure_message = v.into();
16788 self
16789 }
16790}
16791
16792impl wkt::message::Message for VerifyJobRun {
16793 fn typename() -> &'static str {
16794 "type.googleapis.com/google.cloud.deploy.v1.VerifyJobRun"
16795 }
16796}
16797
16798/// Defines additional types related to [VerifyJobRun].
16799pub mod verify_job_run {
16800 #[allow(unused_imports)]
16801 use super::*;
16802
16803 /// Well-known verify failures.
16804 ///
16805 /// # Working with unknown values
16806 ///
16807 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16808 /// additional enum variants at any time. Adding new variants is not considered
16809 /// a breaking change. Applications should write their code in anticipation of:
16810 ///
16811 /// - New values appearing in future releases of the client library, **and**
16812 /// - New values received dynamically, without application changes.
16813 ///
16814 /// Please consult the [Working with enums] section in the user guide for some
16815 /// guidelines.
16816 ///
16817 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
16818 #[derive(Clone, Debug, PartialEq)]
16819 #[non_exhaustive]
16820 pub enum FailureCause {
16821 /// No reason for failure is specified.
16822 Unspecified,
16823 /// Cloud Build is not available, either because it is not enabled or because
16824 /// Cloud Deploy has insufficient permissions. See [required
16825 /// permission](https://cloud.google.com/deploy/docs/cloud-deploy-service-account#required_permissions).
16826 CloudBuildUnavailable,
16827 /// The verify operation did not complete successfully; check Cloud Build
16828 /// logs.
16829 ExecutionFailed,
16830 /// The verify job run did not complete within the allotted time.
16831 DeadlineExceeded,
16832 /// No Skaffold verify configuration was found.
16833 VerificationConfigNotFound,
16834 /// Cloud Build failed to fulfill Cloud Deploy's request. See failure_message
16835 /// for additional details.
16836 CloudBuildRequestFailed,
16837 /// If set, the enum was initialized with an unknown value.
16838 ///
16839 /// Applications can examine the value using [FailureCause::value] or
16840 /// [FailureCause::name].
16841 UnknownValue(failure_cause::UnknownValue),
16842 }
16843
16844 #[doc(hidden)]
16845 pub mod failure_cause {
16846 #[allow(unused_imports)]
16847 use super::*;
16848 #[derive(Clone, Debug, PartialEq)]
16849 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16850 }
16851
16852 impl FailureCause {
16853 /// Gets the enum value.
16854 ///
16855 /// Returns `None` if the enum contains an unknown value deserialized from
16856 /// the string representation of enums.
16857 pub fn value(&self) -> std::option::Option<i32> {
16858 match self {
16859 Self::Unspecified => std::option::Option::Some(0),
16860 Self::CloudBuildUnavailable => std::option::Option::Some(1),
16861 Self::ExecutionFailed => std::option::Option::Some(2),
16862 Self::DeadlineExceeded => std::option::Option::Some(3),
16863 Self::VerificationConfigNotFound => std::option::Option::Some(4),
16864 Self::CloudBuildRequestFailed => std::option::Option::Some(5),
16865 Self::UnknownValue(u) => u.0.value(),
16866 }
16867 }
16868
16869 /// Gets the enum value as a string.
16870 ///
16871 /// Returns `None` if the enum contains an unknown value deserialized from
16872 /// the integer representation of enums.
16873 pub fn name(&self) -> std::option::Option<&str> {
16874 match self {
16875 Self::Unspecified => std::option::Option::Some("FAILURE_CAUSE_UNSPECIFIED"),
16876 Self::CloudBuildUnavailable => std::option::Option::Some("CLOUD_BUILD_UNAVAILABLE"),
16877 Self::ExecutionFailed => std::option::Option::Some("EXECUTION_FAILED"),
16878 Self::DeadlineExceeded => std::option::Option::Some("DEADLINE_EXCEEDED"),
16879 Self::VerificationConfigNotFound => {
16880 std::option::Option::Some("VERIFICATION_CONFIG_NOT_FOUND")
16881 }
16882 Self::CloudBuildRequestFailed => {
16883 std::option::Option::Some("CLOUD_BUILD_REQUEST_FAILED")
16884 }
16885 Self::UnknownValue(u) => u.0.name(),
16886 }
16887 }
16888 }
16889
16890 impl std::default::Default for FailureCause {
16891 fn default() -> Self {
16892 use std::convert::From;
16893 Self::from(0)
16894 }
16895 }
16896
16897 impl std::fmt::Display for FailureCause {
16898 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16899 wkt::internal::display_enum(f, self.name(), self.value())
16900 }
16901 }
16902
16903 impl std::convert::From<i32> for FailureCause {
16904 fn from(value: i32) -> Self {
16905 match value {
16906 0 => Self::Unspecified,
16907 1 => Self::CloudBuildUnavailable,
16908 2 => Self::ExecutionFailed,
16909 3 => Self::DeadlineExceeded,
16910 4 => Self::VerificationConfigNotFound,
16911 5 => Self::CloudBuildRequestFailed,
16912 _ => Self::UnknownValue(failure_cause::UnknownValue(
16913 wkt::internal::UnknownEnumValue::Integer(value),
16914 )),
16915 }
16916 }
16917 }
16918
16919 impl std::convert::From<&str> for FailureCause {
16920 fn from(value: &str) -> Self {
16921 use std::string::ToString;
16922 match value {
16923 "FAILURE_CAUSE_UNSPECIFIED" => Self::Unspecified,
16924 "CLOUD_BUILD_UNAVAILABLE" => Self::CloudBuildUnavailable,
16925 "EXECUTION_FAILED" => Self::ExecutionFailed,
16926 "DEADLINE_EXCEEDED" => Self::DeadlineExceeded,
16927 "VERIFICATION_CONFIG_NOT_FOUND" => Self::VerificationConfigNotFound,
16928 "CLOUD_BUILD_REQUEST_FAILED" => Self::CloudBuildRequestFailed,
16929 _ => Self::UnknownValue(failure_cause::UnknownValue(
16930 wkt::internal::UnknownEnumValue::String(value.to_string()),
16931 )),
16932 }
16933 }
16934 }
16935
16936 impl serde::ser::Serialize for FailureCause {
16937 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16938 where
16939 S: serde::Serializer,
16940 {
16941 match self {
16942 Self::Unspecified => serializer.serialize_i32(0),
16943 Self::CloudBuildUnavailable => serializer.serialize_i32(1),
16944 Self::ExecutionFailed => serializer.serialize_i32(2),
16945 Self::DeadlineExceeded => serializer.serialize_i32(3),
16946 Self::VerificationConfigNotFound => serializer.serialize_i32(4),
16947 Self::CloudBuildRequestFailed => serializer.serialize_i32(5),
16948 Self::UnknownValue(u) => u.0.serialize(serializer),
16949 }
16950 }
16951 }
16952
16953 impl<'de> serde::de::Deserialize<'de> for FailureCause {
16954 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16955 where
16956 D: serde::Deserializer<'de>,
16957 {
16958 deserializer.deserialize_any(wkt::internal::EnumVisitor::<FailureCause>::new(
16959 ".google.cloud.deploy.v1.VerifyJobRun.FailureCause",
16960 ))
16961 }
16962 }
16963}
16964
16965/// PredeployJobRun contains information specific to a predeploy `JobRun`.
16966#[derive(Clone, Default, PartialEq)]
16967#[non_exhaustive]
16968pub struct PredeployJobRun {
16969 /// Output only. The resource name of the Cloud Build `Build` object that is
16970 /// used to execute the custom actions associated with the predeploy Job.
16971 /// Format is `projects/{project}/locations/{location}/builds/{build}`.
16972 pub build: std::string::String,
16973
16974 /// Output only. The reason the predeploy failed. This will always be
16975 /// unspecified while the predeploy is in progress or if it succeeded.
16976 pub failure_cause: crate::model::predeploy_job_run::FailureCause,
16977
16978 /// Output only. Additional information about the predeploy failure, if
16979 /// available.
16980 pub failure_message: std::string::String,
16981
16982 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16983}
16984
16985impl PredeployJobRun {
16986 pub fn new() -> Self {
16987 std::default::Default::default()
16988 }
16989
16990 /// Sets the value of [build][crate::model::PredeployJobRun::build].
16991 ///
16992 /// # Example
16993 /// ```ignore,no_run
16994 /// # use google_cloud_deploy_v1::model::PredeployJobRun;
16995 /// let x = PredeployJobRun::new().set_build("example");
16996 /// ```
16997 pub fn set_build<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16998 self.build = v.into();
16999 self
17000 }
17001
17002 /// Sets the value of [failure_cause][crate::model::PredeployJobRun::failure_cause].
17003 ///
17004 /// # Example
17005 /// ```ignore,no_run
17006 /// # use google_cloud_deploy_v1::model::PredeployJobRun;
17007 /// use google_cloud_deploy_v1::model::predeploy_job_run::FailureCause;
17008 /// let x0 = PredeployJobRun::new().set_failure_cause(FailureCause::CloudBuildUnavailable);
17009 /// let x1 = PredeployJobRun::new().set_failure_cause(FailureCause::ExecutionFailed);
17010 /// let x2 = PredeployJobRun::new().set_failure_cause(FailureCause::DeadlineExceeded);
17011 /// ```
17012 pub fn set_failure_cause<
17013 T: std::convert::Into<crate::model::predeploy_job_run::FailureCause>,
17014 >(
17015 mut self,
17016 v: T,
17017 ) -> Self {
17018 self.failure_cause = v.into();
17019 self
17020 }
17021
17022 /// Sets the value of [failure_message][crate::model::PredeployJobRun::failure_message].
17023 ///
17024 /// # Example
17025 /// ```ignore,no_run
17026 /// # use google_cloud_deploy_v1::model::PredeployJobRun;
17027 /// let x = PredeployJobRun::new().set_failure_message("example");
17028 /// ```
17029 pub fn set_failure_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17030 self.failure_message = v.into();
17031 self
17032 }
17033}
17034
17035impl wkt::message::Message for PredeployJobRun {
17036 fn typename() -> &'static str {
17037 "type.googleapis.com/google.cloud.deploy.v1.PredeployJobRun"
17038 }
17039}
17040
17041/// Defines additional types related to [PredeployJobRun].
17042pub mod predeploy_job_run {
17043 #[allow(unused_imports)]
17044 use super::*;
17045
17046 /// Well-known predeploy failures.
17047 ///
17048 /// # Working with unknown values
17049 ///
17050 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17051 /// additional enum variants at any time. Adding new variants is not considered
17052 /// a breaking change. Applications should write their code in anticipation of:
17053 ///
17054 /// - New values appearing in future releases of the client library, **and**
17055 /// - New values received dynamically, without application changes.
17056 ///
17057 /// Please consult the [Working with enums] section in the user guide for some
17058 /// guidelines.
17059 ///
17060 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
17061 #[derive(Clone, Debug, PartialEq)]
17062 #[non_exhaustive]
17063 pub enum FailureCause {
17064 /// No reason for failure is specified.
17065 Unspecified,
17066 /// Cloud Build is not available, either because it is not enabled or because
17067 /// Cloud Deploy has insufficient permissions. See [required
17068 /// permission](https://cloud.google.com/deploy/docs/cloud-deploy-service-account#required_permissions).
17069 CloudBuildUnavailable,
17070 /// The predeploy operation did not complete successfully; check Cloud Build
17071 /// logs.
17072 ExecutionFailed,
17073 /// The predeploy job run did not complete within the allotted time.
17074 DeadlineExceeded,
17075 /// Cloud Build failed to fulfill Cloud Deploy's request. See failure_message
17076 /// for additional details.
17077 CloudBuildRequestFailed,
17078 /// If set, the enum was initialized with an unknown value.
17079 ///
17080 /// Applications can examine the value using [FailureCause::value] or
17081 /// [FailureCause::name].
17082 UnknownValue(failure_cause::UnknownValue),
17083 }
17084
17085 #[doc(hidden)]
17086 pub mod failure_cause {
17087 #[allow(unused_imports)]
17088 use super::*;
17089 #[derive(Clone, Debug, PartialEq)]
17090 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17091 }
17092
17093 impl FailureCause {
17094 /// Gets the enum value.
17095 ///
17096 /// Returns `None` if the enum contains an unknown value deserialized from
17097 /// the string representation of enums.
17098 pub fn value(&self) -> std::option::Option<i32> {
17099 match self {
17100 Self::Unspecified => std::option::Option::Some(0),
17101 Self::CloudBuildUnavailable => std::option::Option::Some(1),
17102 Self::ExecutionFailed => std::option::Option::Some(2),
17103 Self::DeadlineExceeded => std::option::Option::Some(3),
17104 Self::CloudBuildRequestFailed => std::option::Option::Some(4),
17105 Self::UnknownValue(u) => u.0.value(),
17106 }
17107 }
17108
17109 /// Gets the enum value as a string.
17110 ///
17111 /// Returns `None` if the enum contains an unknown value deserialized from
17112 /// the integer representation of enums.
17113 pub fn name(&self) -> std::option::Option<&str> {
17114 match self {
17115 Self::Unspecified => std::option::Option::Some("FAILURE_CAUSE_UNSPECIFIED"),
17116 Self::CloudBuildUnavailable => std::option::Option::Some("CLOUD_BUILD_UNAVAILABLE"),
17117 Self::ExecutionFailed => std::option::Option::Some("EXECUTION_FAILED"),
17118 Self::DeadlineExceeded => std::option::Option::Some("DEADLINE_EXCEEDED"),
17119 Self::CloudBuildRequestFailed => {
17120 std::option::Option::Some("CLOUD_BUILD_REQUEST_FAILED")
17121 }
17122 Self::UnknownValue(u) => u.0.name(),
17123 }
17124 }
17125 }
17126
17127 impl std::default::Default for FailureCause {
17128 fn default() -> Self {
17129 use std::convert::From;
17130 Self::from(0)
17131 }
17132 }
17133
17134 impl std::fmt::Display for FailureCause {
17135 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17136 wkt::internal::display_enum(f, self.name(), self.value())
17137 }
17138 }
17139
17140 impl std::convert::From<i32> for FailureCause {
17141 fn from(value: i32) -> Self {
17142 match value {
17143 0 => Self::Unspecified,
17144 1 => Self::CloudBuildUnavailable,
17145 2 => Self::ExecutionFailed,
17146 3 => Self::DeadlineExceeded,
17147 4 => Self::CloudBuildRequestFailed,
17148 _ => Self::UnknownValue(failure_cause::UnknownValue(
17149 wkt::internal::UnknownEnumValue::Integer(value),
17150 )),
17151 }
17152 }
17153 }
17154
17155 impl std::convert::From<&str> for FailureCause {
17156 fn from(value: &str) -> Self {
17157 use std::string::ToString;
17158 match value {
17159 "FAILURE_CAUSE_UNSPECIFIED" => Self::Unspecified,
17160 "CLOUD_BUILD_UNAVAILABLE" => Self::CloudBuildUnavailable,
17161 "EXECUTION_FAILED" => Self::ExecutionFailed,
17162 "DEADLINE_EXCEEDED" => Self::DeadlineExceeded,
17163 "CLOUD_BUILD_REQUEST_FAILED" => Self::CloudBuildRequestFailed,
17164 _ => Self::UnknownValue(failure_cause::UnknownValue(
17165 wkt::internal::UnknownEnumValue::String(value.to_string()),
17166 )),
17167 }
17168 }
17169 }
17170
17171 impl serde::ser::Serialize for FailureCause {
17172 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17173 where
17174 S: serde::Serializer,
17175 {
17176 match self {
17177 Self::Unspecified => serializer.serialize_i32(0),
17178 Self::CloudBuildUnavailable => serializer.serialize_i32(1),
17179 Self::ExecutionFailed => serializer.serialize_i32(2),
17180 Self::DeadlineExceeded => serializer.serialize_i32(3),
17181 Self::CloudBuildRequestFailed => serializer.serialize_i32(4),
17182 Self::UnknownValue(u) => u.0.serialize(serializer),
17183 }
17184 }
17185 }
17186
17187 impl<'de> serde::de::Deserialize<'de> for FailureCause {
17188 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17189 where
17190 D: serde::Deserializer<'de>,
17191 {
17192 deserializer.deserialize_any(wkt::internal::EnumVisitor::<FailureCause>::new(
17193 ".google.cloud.deploy.v1.PredeployJobRun.FailureCause",
17194 ))
17195 }
17196 }
17197}
17198
17199/// PostdeployJobRun contains information specific to a postdeploy `JobRun`.
17200#[derive(Clone, Default, PartialEq)]
17201#[non_exhaustive]
17202pub struct PostdeployJobRun {
17203 /// Output only. The resource name of the Cloud Build `Build` object that is
17204 /// used to execute the custom actions associated with the postdeploy Job.
17205 /// Format is `projects/{project}/locations/{location}/builds/{build}`.
17206 pub build: std::string::String,
17207
17208 /// Output only. The reason the postdeploy failed. This will always be
17209 /// unspecified while the postdeploy is in progress or if it succeeded.
17210 pub failure_cause: crate::model::postdeploy_job_run::FailureCause,
17211
17212 /// Output only. Additional information about the postdeploy failure, if
17213 /// available.
17214 pub failure_message: std::string::String,
17215
17216 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17217}
17218
17219impl PostdeployJobRun {
17220 pub fn new() -> Self {
17221 std::default::Default::default()
17222 }
17223
17224 /// Sets the value of [build][crate::model::PostdeployJobRun::build].
17225 ///
17226 /// # Example
17227 /// ```ignore,no_run
17228 /// # use google_cloud_deploy_v1::model::PostdeployJobRun;
17229 /// let x = PostdeployJobRun::new().set_build("example");
17230 /// ```
17231 pub fn set_build<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17232 self.build = v.into();
17233 self
17234 }
17235
17236 /// Sets the value of [failure_cause][crate::model::PostdeployJobRun::failure_cause].
17237 ///
17238 /// # Example
17239 /// ```ignore,no_run
17240 /// # use google_cloud_deploy_v1::model::PostdeployJobRun;
17241 /// use google_cloud_deploy_v1::model::postdeploy_job_run::FailureCause;
17242 /// let x0 = PostdeployJobRun::new().set_failure_cause(FailureCause::CloudBuildUnavailable);
17243 /// let x1 = PostdeployJobRun::new().set_failure_cause(FailureCause::ExecutionFailed);
17244 /// let x2 = PostdeployJobRun::new().set_failure_cause(FailureCause::DeadlineExceeded);
17245 /// ```
17246 pub fn set_failure_cause<
17247 T: std::convert::Into<crate::model::postdeploy_job_run::FailureCause>,
17248 >(
17249 mut self,
17250 v: T,
17251 ) -> Self {
17252 self.failure_cause = v.into();
17253 self
17254 }
17255
17256 /// Sets the value of [failure_message][crate::model::PostdeployJobRun::failure_message].
17257 ///
17258 /// # Example
17259 /// ```ignore,no_run
17260 /// # use google_cloud_deploy_v1::model::PostdeployJobRun;
17261 /// let x = PostdeployJobRun::new().set_failure_message("example");
17262 /// ```
17263 pub fn set_failure_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17264 self.failure_message = v.into();
17265 self
17266 }
17267}
17268
17269impl wkt::message::Message for PostdeployJobRun {
17270 fn typename() -> &'static str {
17271 "type.googleapis.com/google.cloud.deploy.v1.PostdeployJobRun"
17272 }
17273}
17274
17275/// Defines additional types related to [PostdeployJobRun].
17276pub mod postdeploy_job_run {
17277 #[allow(unused_imports)]
17278 use super::*;
17279
17280 /// Well-known postdeploy failures.
17281 ///
17282 /// # Working with unknown values
17283 ///
17284 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17285 /// additional enum variants at any time. Adding new variants is not considered
17286 /// a breaking change. Applications should write their code in anticipation of:
17287 ///
17288 /// - New values appearing in future releases of the client library, **and**
17289 /// - New values received dynamically, without application changes.
17290 ///
17291 /// Please consult the [Working with enums] section in the user guide for some
17292 /// guidelines.
17293 ///
17294 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
17295 #[derive(Clone, Debug, PartialEq)]
17296 #[non_exhaustive]
17297 pub enum FailureCause {
17298 /// No reason for failure is specified.
17299 Unspecified,
17300 /// Cloud Build is not available, either because it is not enabled or because
17301 /// Cloud Deploy has insufficient permissions. See [required
17302 /// permission](https://cloud.google.com/deploy/docs/cloud-deploy-service-account#required_permissions).
17303 CloudBuildUnavailable,
17304 /// The postdeploy operation did not complete successfully; check Cloud Build
17305 /// logs.
17306 ExecutionFailed,
17307 /// The postdeploy job run did not complete within the allotted time.
17308 DeadlineExceeded,
17309 /// Cloud Build failed to fulfill Cloud Deploy's request. See failure_message
17310 /// for additional details.
17311 CloudBuildRequestFailed,
17312 /// If set, the enum was initialized with an unknown value.
17313 ///
17314 /// Applications can examine the value using [FailureCause::value] or
17315 /// [FailureCause::name].
17316 UnknownValue(failure_cause::UnknownValue),
17317 }
17318
17319 #[doc(hidden)]
17320 pub mod failure_cause {
17321 #[allow(unused_imports)]
17322 use super::*;
17323 #[derive(Clone, Debug, PartialEq)]
17324 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17325 }
17326
17327 impl FailureCause {
17328 /// Gets the enum value.
17329 ///
17330 /// Returns `None` if the enum contains an unknown value deserialized from
17331 /// the string representation of enums.
17332 pub fn value(&self) -> std::option::Option<i32> {
17333 match self {
17334 Self::Unspecified => std::option::Option::Some(0),
17335 Self::CloudBuildUnavailable => std::option::Option::Some(1),
17336 Self::ExecutionFailed => std::option::Option::Some(2),
17337 Self::DeadlineExceeded => std::option::Option::Some(3),
17338 Self::CloudBuildRequestFailed => std::option::Option::Some(4),
17339 Self::UnknownValue(u) => u.0.value(),
17340 }
17341 }
17342
17343 /// Gets the enum value as a string.
17344 ///
17345 /// Returns `None` if the enum contains an unknown value deserialized from
17346 /// the integer representation of enums.
17347 pub fn name(&self) -> std::option::Option<&str> {
17348 match self {
17349 Self::Unspecified => std::option::Option::Some("FAILURE_CAUSE_UNSPECIFIED"),
17350 Self::CloudBuildUnavailable => std::option::Option::Some("CLOUD_BUILD_UNAVAILABLE"),
17351 Self::ExecutionFailed => std::option::Option::Some("EXECUTION_FAILED"),
17352 Self::DeadlineExceeded => std::option::Option::Some("DEADLINE_EXCEEDED"),
17353 Self::CloudBuildRequestFailed => {
17354 std::option::Option::Some("CLOUD_BUILD_REQUEST_FAILED")
17355 }
17356 Self::UnknownValue(u) => u.0.name(),
17357 }
17358 }
17359 }
17360
17361 impl std::default::Default for FailureCause {
17362 fn default() -> Self {
17363 use std::convert::From;
17364 Self::from(0)
17365 }
17366 }
17367
17368 impl std::fmt::Display for FailureCause {
17369 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17370 wkt::internal::display_enum(f, self.name(), self.value())
17371 }
17372 }
17373
17374 impl std::convert::From<i32> for FailureCause {
17375 fn from(value: i32) -> Self {
17376 match value {
17377 0 => Self::Unspecified,
17378 1 => Self::CloudBuildUnavailable,
17379 2 => Self::ExecutionFailed,
17380 3 => Self::DeadlineExceeded,
17381 4 => Self::CloudBuildRequestFailed,
17382 _ => Self::UnknownValue(failure_cause::UnknownValue(
17383 wkt::internal::UnknownEnumValue::Integer(value),
17384 )),
17385 }
17386 }
17387 }
17388
17389 impl std::convert::From<&str> for FailureCause {
17390 fn from(value: &str) -> Self {
17391 use std::string::ToString;
17392 match value {
17393 "FAILURE_CAUSE_UNSPECIFIED" => Self::Unspecified,
17394 "CLOUD_BUILD_UNAVAILABLE" => Self::CloudBuildUnavailable,
17395 "EXECUTION_FAILED" => Self::ExecutionFailed,
17396 "DEADLINE_EXCEEDED" => Self::DeadlineExceeded,
17397 "CLOUD_BUILD_REQUEST_FAILED" => Self::CloudBuildRequestFailed,
17398 _ => Self::UnknownValue(failure_cause::UnknownValue(
17399 wkt::internal::UnknownEnumValue::String(value.to_string()),
17400 )),
17401 }
17402 }
17403 }
17404
17405 impl serde::ser::Serialize for FailureCause {
17406 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17407 where
17408 S: serde::Serializer,
17409 {
17410 match self {
17411 Self::Unspecified => serializer.serialize_i32(0),
17412 Self::CloudBuildUnavailable => serializer.serialize_i32(1),
17413 Self::ExecutionFailed => serializer.serialize_i32(2),
17414 Self::DeadlineExceeded => serializer.serialize_i32(3),
17415 Self::CloudBuildRequestFailed => serializer.serialize_i32(4),
17416 Self::UnknownValue(u) => u.0.serialize(serializer),
17417 }
17418 }
17419 }
17420
17421 impl<'de> serde::de::Deserialize<'de> for FailureCause {
17422 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17423 where
17424 D: serde::Deserializer<'de>,
17425 {
17426 deserializer.deserialize_any(wkt::internal::EnumVisitor::<FailureCause>::new(
17427 ".google.cloud.deploy.v1.PostdeployJobRun.FailureCause",
17428 ))
17429 }
17430 }
17431}
17432
17433/// CreateChildRolloutJobRun contains information specific to a
17434/// createChildRollout `JobRun`.
17435#[derive(Clone, Default, PartialEq)]
17436#[non_exhaustive]
17437pub struct CreateChildRolloutJobRun {
17438 /// Output only. Name of the `ChildRollout`. Format is
17439 /// `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`.
17440 pub rollout: std::string::String,
17441
17442 /// Output only. The ID of the childRollout Phase initiated by this JobRun.
17443 pub rollout_phase_id: std::string::String,
17444
17445 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17446}
17447
17448impl CreateChildRolloutJobRun {
17449 pub fn new() -> Self {
17450 std::default::Default::default()
17451 }
17452
17453 /// Sets the value of [rollout][crate::model::CreateChildRolloutJobRun::rollout].
17454 ///
17455 /// # Example
17456 /// ```ignore,no_run
17457 /// # use google_cloud_deploy_v1::model::CreateChildRolloutJobRun;
17458 /// let x = CreateChildRolloutJobRun::new().set_rollout("example");
17459 /// ```
17460 pub fn set_rollout<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17461 self.rollout = v.into();
17462 self
17463 }
17464
17465 /// Sets the value of [rollout_phase_id][crate::model::CreateChildRolloutJobRun::rollout_phase_id].
17466 ///
17467 /// # Example
17468 /// ```ignore,no_run
17469 /// # use google_cloud_deploy_v1::model::CreateChildRolloutJobRun;
17470 /// let x = CreateChildRolloutJobRun::new().set_rollout_phase_id("example");
17471 /// ```
17472 pub fn set_rollout_phase_id<T: std::convert::Into<std::string::String>>(
17473 mut self,
17474 v: T,
17475 ) -> Self {
17476 self.rollout_phase_id = v.into();
17477 self
17478 }
17479}
17480
17481impl wkt::message::Message for CreateChildRolloutJobRun {
17482 fn typename() -> &'static str {
17483 "type.googleapis.com/google.cloud.deploy.v1.CreateChildRolloutJobRun"
17484 }
17485}
17486
17487/// AdvanceChildRolloutJobRun contains information specific to a
17488/// advanceChildRollout `JobRun`.
17489#[derive(Clone, Default, PartialEq)]
17490#[non_exhaustive]
17491pub struct AdvanceChildRolloutJobRun {
17492 /// Output only. Name of the `ChildRollout`. Format is
17493 /// `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`.
17494 pub rollout: std::string::String,
17495
17496 /// Output only. the ID of the ChildRollout's Phase.
17497 pub rollout_phase_id: std::string::String,
17498
17499 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17500}
17501
17502impl AdvanceChildRolloutJobRun {
17503 pub fn new() -> Self {
17504 std::default::Default::default()
17505 }
17506
17507 /// Sets the value of [rollout][crate::model::AdvanceChildRolloutJobRun::rollout].
17508 ///
17509 /// # Example
17510 /// ```ignore,no_run
17511 /// # use google_cloud_deploy_v1::model::AdvanceChildRolloutJobRun;
17512 /// let x = AdvanceChildRolloutJobRun::new().set_rollout("example");
17513 /// ```
17514 pub fn set_rollout<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17515 self.rollout = v.into();
17516 self
17517 }
17518
17519 /// Sets the value of [rollout_phase_id][crate::model::AdvanceChildRolloutJobRun::rollout_phase_id].
17520 ///
17521 /// # Example
17522 /// ```ignore,no_run
17523 /// # use google_cloud_deploy_v1::model::AdvanceChildRolloutJobRun;
17524 /// let x = AdvanceChildRolloutJobRun::new().set_rollout_phase_id("example");
17525 /// ```
17526 pub fn set_rollout_phase_id<T: std::convert::Into<std::string::String>>(
17527 mut self,
17528 v: T,
17529 ) -> Self {
17530 self.rollout_phase_id = v.into();
17531 self
17532 }
17533}
17534
17535impl wkt::message::Message for AdvanceChildRolloutJobRun {
17536 fn typename() -> &'static str {
17537 "type.googleapis.com/google.cloud.deploy.v1.AdvanceChildRolloutJobRun"
17538 }
17539}
17540
17541/// ListJobRunsRequest is the request object used by `ListJobRuns`.
17542#[derive(Clone, Default, PartialEq)]
17543#[non_exhaustive]
17544pub struct ListJobRunsRequest {
17545 /// Required. The `Rollout` which owns this collection of `JobRun` objects.
17546 pub parent: std::string::String,
17547
17548 /// Optional. The maximum number of `JobRun` objects to return. The service may
17549 /// return fewer than this value. If unspecified, at most 50 `JobRun` objects
17550 /// will be returned. The maximum value is 1000; values above 1000 will be set
17551 /// to 1000.
17552 pub page_size: i32,
17553
17554 /// Optional. A page token, received from a previous `ListJobRuns` call.
17555 /// Provide this to retrieve the subsequent page.
17556 ///
17557 /// When paginating, all other provided parameters match the call that provided
17558 /// the page token.
17559 pub page_token: std::string::String,
17560
17561 /// Optional. Filter results to be returned. See <https://google.aip.dev/160> for
17562 /// more details.
17563 pub filter: std::string::String,
17564
17565 /// Optional. Field to sort by. See <https://google.aip.dev/132#ordering> for
17566 /// more details.
17567 pub order_by: std::string::String,
17568
17569 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17570}
17571
17572impl ListJobRunsRequest {
17573 pub fn new() -> Self {
17574 std::default::Default::default()
17575 }
17576
17577 /// Sets the value of [parent][crate::model::ListJobRunsRequest::parent].
17578 ///
17579 /// # Example
17580 /// ```ignore,no_run
17581 /// # use google_cloud_deploy_v1::model::ListJobRunsRequest;
17582 /// let x = ListJobRunsRequest::new().set_parent("example");
17583 /// ```
17584 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17585 self.parent = v.into();
17586 self
17587 }
17588
17589 /// Sets the value of [page_size][crate::model::ListJobRunsRequest::page_size].
17590 ///
17591 /// # Example
17592 /// ```ignore,no_run
17593 /// # use google_cloud_deploy_v1::model::ListJobRunsRequest;
17594 /// let x = ListJobRunsRequest::new().set_page_size(42);
17595 /// ```
17596 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
17597 self.page_size = v.into();
17598 self
17599 }
17600
17601 /// Sets the value of [page_token][crate::model::ListJobRunsRequest::page_token].
17602 ///
17603 /// # Example
17604 /// ```ignore,no_run
17605 /// # use google_cloud_deploy_v1::model::ListJobRunsRequest;
17606 /// let x = ListJobRunsRequest::new().set_page_token("example");
17607 /// ```
17608 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17609 self.page_token = v.into();
17610 self
17611 }
17612
17613 /// Sets the value of [filter][crate::model::ListJobRunsRequest::filter].
17614 ///
17615 /// # Example
17616 /// ```ignore,no_run
17617 /// # use google_cloud_deploy_v1::model::ListJobRunsRequest;
17618 /// let x = ListJobRunsRequest::new().set_filter("example");
17619 /// ```
17620 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17621 self.filter = v.into();
17622 self
17623 }
17624
17625 /// Sets the value of [order_by][crate::model::ListJobRunsRequest::order_by].
17626 ///
17627 /// # Example
17628 /// ```ignore,no_run
17629 /// # use google_cloud_deploy_v1::model::ListJobRunsRequest;
17630 /// let x = ListJobRunsRequest::new().set_order_by("example");
17631 /// ```
17632 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17633 self.order_by = v.into();
17634 self
17635 }
17636}
17637
17638impl wkt::message::Message for ListJobRunsRequest {
17639 fn typename() -> &'static str {
17640 "type.googleapis.com/google.cloud.deploy.v1.ListJobRunsRequest"
17641 }
17642}
17643
17644/// ListJobRunsResponse is the response object returned by `ListJobRuns`.
17645#[derive(Clone, Default, PartialEq)]
17646#[non_exhaustive]
17647pub struct ListJobRunsResponse {
17648 /// The `JobRun` objects.
17649 pub job_runs: std::vec::Vec<crate::model::JobRun>,
17650
17651 /// A token, which can be sent as `page_token` to retrieve the next page. If
17652 /// this field is omitted, there are no subsequent pages.
17653 pub next_page_token: std::string::String,
17654
17655 /// Locations that could not be reached
17656 pub unreachable: std::vec::Vec<std::string::String>,
17657
17658 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17659}
17660
17661impl ListJobRunsResponse {
17662 pub fn new() -> Self {
17663 std::default::Default::default()
17664 }
17665
17666 /// Sets the value of [job_runs][crate::model::ListJobRunsResponse::job_runs].
17667 ///
17668 /// # Example
17669 /// ```ignore,no_run
17670 /// # use google_cloud_deploy_v1::model::ListJobRunsResponse;
17671 /// use google_cloud_deploy_v1::model::JobRun;
17672 /// let x = ListJobRunsResponse::new()
17673 /// .set_job_runs([
17674 /// JobRun::default()/* use setters */,
17675 /// JobRun::default()/* use (different) setters */,
17676 /// ]);
17677 /// ```
17678 pub fn set_job_runs<T, V>(mut self, v: T) -> Self
17679 where
17680 T: std::iter::IntoIterator<Item = V>,
17681 V: std::convert::Into<crate::model::JobRun>,
17682 {
17683 use std::iter::Iterator;
17684 self.job_runs = v.into_iter().map(|i| i.into()).collect();
17685 self
17686 }
17687
17688 /// Sets the value of [next_page_token][crate::model::ListJobRunsResponse::next_page_token].
17689 ///
17690 /// # Example
17691 /// ```ignore,no_run
17692 /// # use google_cloud_deploy_v1::model::ListJobRunsResponse;
17693 /// let x = ListJobRunsResponse::new().set_next_page_token("example");
17694 /// ```
17695 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17696 self.next_page_token = v.into();
17697 self
17698 }
17699
17700 /// Sets the value of [unreachable][crate::model::ListJobRunsResponse::unreachable].
17701 ///
17702 /// # Example
17703 /// ```ignore,no_run
17704 /// # use google_cloud_deploy_v1::model::ListJobRunsResponse;
17705 /// let x = ListJobRunsResponse::new().set_unreachable(["a", "b", "c"]);
17706 /// ```
17707 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
17708 where
17709 T: std::iter::IntoIterator<Item = V>,
17710 V: std::convert::Into<std::string::String>,
17711 {
17712 use std::iter::Iterator;
17713 self.unreachable = v.into_iter().map(|i| i.into()).collect();
17714 self
17715 }
17716}
17717
17718impl wkt::message::Message for ListJobRunsResponse {
17719 fn typename() -> &'static str {
17720 "type.googleapis.com/google.cloud.deploy.v1.ListJobRunsResponse"
17721 }
17722}
17723
17724#[doc(hidden)]
17725impl google_cloud_gax::paginator::internal::PageableResponse for ListJobRunsResponse {
17726 type PageItem = crate::model::JobRun;
17727
17728 fn items(self) -> std::vec::Vec<Self::PageItem> {
17729 self.job_runs
17730 }
17731
17732 fn next_page_token(&self) -> std::string::String {
17733 use std::clone::Clone;
17734 self.next_page_token.clone()
17735 }
17736}
17737
17738/// GetJobRunRequest is the request object used by `GetJobRun`.
17739#[derive(Clone, Default, PartialEq)]
17740#[non_exhaustive]
17741pub struct GetJobRunRequest {
17742 /// Required. Name of the `JobRun`. Format must be
17743 /// `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}/rollouts/{rollout_name}/jobRuns/{job_run_name}`.
17744 pub name: std::string::String,
17745
17746 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17747}
17748
17749impl GetJobRunRequest {
17750 pub fn new() -> Self {
17751 std::default::Default::default()
17752 }
17753
17754 /// Sets the value of [name][crate::model::GetJobRunRequest::name].
17755 ///
17756 /// # Example
17757 /// ```ignore,no_run
17758 /// # use google_cloud_deploy_v1::model::GetJobRunRequest;
17759 /// let x = GetJobRunRequest::new().set_name("example");
17760 /// ```
17761 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17762 self.name = v.into();
17763 self
17764 }
17765}
17766
17767impl wkt::message::Message for GetJobRunRequest {
17768 fn typename() -> &'static str {
17769 "type.googleapis.com/google.cloud.deploy.v1.GetJobRunRequest"
17770 }
17771}
17772
17773/// The request object used by `TerminateJobRun`.
17774#[derive(Clone, Default, PartialEq)]
17775#[non_exhaustive]
17776pub struct TerminateJobRunRequest {
17777 /// Required. Name of the `JobRun`. Format must be
17778 /// `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}/jobRuns/{jobRun}`.
17779 pub name: std::string::String,
17780
17781 /// Optional. Deploy policies to override. Format is
17782 /// `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`.
17783 pub override_deploy_policy: std::vec::Vec<std::string::String>,
17784
17785 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17786}
17787
17788impl TerminateJobRunRequest {
17789 pub fn new() -> Self {
17790 std::default::Default::default()
17791 }
17792
17793 /// Sets the value of [name][crate::model::TerminateJobRunRequest::name].
17794 ///
17795 /// # Example
17796 /// ```ignore,no_run
17797 /// # use google_cloud_deploy_v1::model::TerminateJobRunRequest;
17798 /// let x = TerminateJobRunRequest::new().set_name("example");
17799 /// ```
17800 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17801 self.name = v.into();
17802 self
17803 }
17804
17805 /// Sets the value of [override_deploy_policy][crate::model::TerminateJobRunRequest::override_deploy_policy].
17806 ///
17807 /// # Example
17808 /// ```ignore,no_run
17809 /// # use google_cloud_deploy_v1::model::TerminateJobRunRequest;
17810 /// let x = TerminateJobRunRequest::new().set_override_deploy_policy(["a", "b", "c"]);
17811 /// ```
17812 pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
17813 where
17814 T: std::iter::IntoIterator<Item = V>,
17815 V: std::convert::Into<std::string::String>,
17816 {
17817 use std::iter::Iterator;
17818 self.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
17819 self
17820 }
17821}
17822
17823impl wkt::message::Message for TerminateJobRunRequest {
17824 fn typename() -> &'static str {
17825 "type.googleapis.com/google.cloud.deploy.v1.TerminateJobRunRequest"
17826 }
17827}
17828
17829/// The response object from `TerminateJobRun`.
17830#[derive(Clone, Default, PartialEq)]
17831#[non_exhaustive]
17832pub struct TerminateJobRunResponse {
17833 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17834}
17835
17836impl TerminateJobRunResponse {
17837 pub fn new() -> Self {
17838 std::default::Default::default()
17839 }
17840}
17841
17842impl wkt::message::Message for TerminateJobRunResponse {
17843 fn typename() -> &'static str {
17844 "type.googleapis.com/google.cloud.deploy.v1.TerminateJobRunResponse"
17845 }
17846}
17847
17848/// Service-wide configuration.
17849#[derive(Clone, Default, PartialEq)]
17850#[non_exhaustive]
17851pub struct Config {
17852 /// Name of the configuration.
17853 pub name: std::string::String,
17854
17855 /// All supported versions of Skaffold.
17856 pub supported_versions: std::vec::Vec<crate::model::SkaffoldVersion>,
17857
17858 /// Default Skaffold version that is assigned when a Release is created without
17859 /// specifying a Skaffold version.
17860 pub default_skaffold_version: std::string::String,
17861
17862 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17863}
17864
17865impl Config {
17866 pub fn new() -> Self {
17867 std::default::Default::default()
17868 }
17869
17870 /// Sets the value of [name][crate::model::Config::name].
17871 ///
17872 /// # Example
17873 /// ```ignore,no_run
17874 /// # use google_cloud_deploy_v1::model::Config;
17875 /// let x = Config::new().set_name("example");
17876 /// ```
17877 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17878 self.name = v.into();
17879 self
17880 }
17881
17882 /// Sets the value of [supported_versions][crate::model::Config::supported_versions].
17883 ///
17884 /// # Example
17885 /// ```ignore,no_run
17886 /// # use google_cloud_deploy_v1::model::Config;
17887 /// use google_cloud_deploy_v1::model::SkaffoldVersion;
17888 /// let x = Config::new()
17889 /// .set_supported_versions([
17890 /// SkaffoldVersion::default()/* use setters */,
17891 /// SkaffoldVersion::default()/* use (different) setters */,
17892 /// ]);
17893 /// ```
17894 pub fn set_supported_versions<T, V>(mut self, v: T) -> Self
17895 where
17896 T: std::iter::IntoIterator<Item = V>,
17897 V: std::convert::Into<crate::model::SkaffoldVersion>,
17898 {
17899 use std::iter::Iterator;
17900 self.supported_versions = v.into_iter().map(|i| i.into()).collect();
17901 self
17902 }
17903
17904 /// Sets the value of [default_skaffold_version][crate::model::Config::default_skaffold_version].
17905 ///
17906 /// # Example
17907 /// ```ignore,no_run
17908 /// # use google_cloud_deploy_v1::model::Config;
17909 /// let x = Config::new().set_default_skaffold_version("example");
17910 /// ```
17911 pub fn set_default_skaffold_version<T: std::convert::Into<std::string::String>>(
17912 mut self,
17913 v: T,
17914 ) -> Self {
17915 self.default_skaffold_version = v.into();
17916 self
17917 }
17918}
17919
17920impl wkt::message::Message for Config {
17921 fn typename() -> &'static str {
17922 "type.googleapis.com/google.cloud.deploy.v1.Config"
17923 }
17924}
17925
17926/// Details of a supported Skaffold version.
17927#[derive(Clone, Default, PartialEq)]
17928#[non_exhaustive]
17929pub struct SkaffoldVersion {
17930 /// Release version number. For example, "1.20.3".
17931 pub version: std::string::String,
17932
17933 /// The time at which this version of Skaffold will enter maintenance mode.
17934 pub maintenance_mode_time: std::option::Option<wkt::Timestamp>,
17935
17936 /// The time at which this version of Skaffold will no longer be supported.
17937 pub support_expiration_time: std::option::Option<wkt::Timestamp>,
17938
17939 /// Date when this version is expected to no longer be supported.
17940 pub support_end_date: std::option::Option<google_cloud_type::model::Date>,
17941
17942 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17943}
17944
17945impl SkaffoldVersion {
17946 pub fn new() -> Self {
17947 std::default::Default::default()
17948 }
17949
17950 /// Sets the value of [version][crate::model::SkaffoldVersion::version].
17951 ///
17952 /// # Example
17953 /// ```ignore,no_run
17954 /// # use google_cloud_deploy_v1::model::SkaffoldVersion;
17955 /// let x = SkaffoldVersion::new().set_version("example");
17956 /// ```
17957 pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17958 self.version = v.into();
17959 self
17960 }
17961
17962 /// Sets the value of [maintenance_mode_time][crate::model::SkaffoldVersion::maintenance_mode_time].
17963 ///
17964 /// # Example
17965 /// ```ignore,no_run
17966 /// # use google_cloud_deploy_v1::model::SkaffoldVersion;
17967 /// use wkt::Timestamp;
17968 /// let x = SkaffoldVersion::new().set_maintenance_mode_time(Timestamp::default()/* use setters */);
17969 /// ```
17970 pub fn set_maintenance_mode_time<T>(mut self, v: T) -> Self
17971 where
17972 T: std::convert::Into<wkt::Timestamp>,
17973 {
17974 self.maintenance_mode_time = std::option::Option::Some(v.into());
17975 self
17976 }
17977
17978 /// Sets or clears the value of [maintenance_mode_time][crate::model::SkaffoldVersion::maintenance_mode_time].
17979 ///
17980 /// # Example
17981 /// ```ignore,no_run
17982 /// # use google_cloud_deploy_v1::model::SkaffoldVersion;
17983 /// use wkt::Timestamp;
17984 /// let x = SkaffoldVersion::new().set_or_clear_maintenance_mode_time(Some(Timestamp::default()/* use setters */));
17985 /// let x = SkaffoldVersion::new().set_or_clear_maintenance_mode_time(None::<Timestamp>);
17986 /// ```
17987 pub fn set_or_clear_maintenance_mode_time<T>(mut self, v: std::option::Option<T>) -> Self
17988 where
17989 T: std::convert::Into<wkt::Timestamp>,
17990 {
17991 self.maintenance_mode_time = v.map(|x| x.into());
17992 self
17993 }
17994
17995 /// Sets the value of [support_expiration_time][crate::model::SkaffoldVersion::support_expiration_time].
17996 ///
17997 /// # Example
17998 /// ```ignore,no_run
17999 /// # use google_cloud_deploy_v1::model::SkaffoldVersion;
18000 /// use wkt::Timestamp;
18001 /// let x = SkaffoldVersion::new().set_support_expiration_time(Timestamp::default()/* use setters */);
18002 /// ```
18003 pub fn set_support_expiration_time<T>(mut self, v: T) -> Self
18004 where
18005 T: std::convert::Into<wkt::Timestamp>,
18006 {
18007 self.support_expiration_time = std::option::Option::Some(v.into());
18008 self
18009 }
18010
18011 /// Sets or clears the value of [support_expiration_time][crate::model::SkaffoldVersion::support_expiration_time].
18012 ///
18013 /// # Example
18014 /// ```ignore,no_run
18015 /// # use google_cloud_deploy_v1::model::SkaffoldVersion;
18016 /// use wkt::Timestamp;
18017 /// let x = SkaffoldVersion::new().set_or_clear_support_expiration_time(Some(Timestamp::default()/* use setters */));
18018 /// let x = SkaffoldVersion::new().set_or_clear_support_expiration_time(None::<Timestamp>);
18019 /// ```
18020 pub fn set_or_clear_support_expiration_time<T>(mut self, v: std::option::Option<T>) -> Self
18021 where
18022 T: std::convert::Into<wkt::Timestamp>,
18023 {
18024 self.support_expiration_time = v.map(|x| x.into());
18025 self
18026 }
18027
18028 /// Sets the value of [support_end_date][crate::model::SkaffoldVersion::support_end_date].
18029 ///
18030 /// # Example
18031 /// ```ignore,no_run
18032 /// # use google_cloud_deploy_v1::model::SkaffoldVersion;
18033 /// use google_cloud_type::model::Date;
18034 /// let x = SkaffoldVersion::new().set_support_end_date(Date::default()/* use setters */);
18035 /// ```
18036 pub fn set_support_end_date<T>(mut self, v: T) -> Self
18037 where
18038 T: std::convert::Into<google_cloud_type::model::Date>,
18039 {
18040 self.support_end_date = std::option::Option::Some(v.into());
18041 self
18042 }
18043
18044 /// Sets or clears the value of [support_end_date][crate::model::SkaffoldVersion::support_end_date].
18045 ///
18046 /// # Example
18047 /// ```ignore,no_run
18048 /// # use google_cloud_deploy_v1::model::SkaffoldVersion;
18049 /// use google_cloud_type::model::Date;
18050 /// let x = SkaffoldVersion::new().set_or_clear_support_end_date(Some(Date::default()/* use setters */));
18051 /// let x = SkaffoldVersion::new().set_or_clear_support_end_date(None::<Date>);
18052 /// ```
18053 pub fn set_or_clear_support_end_date<T>(mut self, v: std::option::Option<T>) -> Self
18054 where
18055 T: std::convert::Into<google_cloud_type::model::Date>,
18056 {
18057 self.support_end_date = v.map(|x| x.into());
18058 self
18059 }
18060}
18061
18062impl wkt::message::Message for SkaffoldVersion {
18063 fn typename() -> &'static str {
18064 "type.googleapis.com/google.cloud.deploy.v1.SkaffoldVersion"
18065 }
18066}
18067
18068/// Request to get a configuration.
18069#[derive(Clone, Default, PartialEq)]
18070#[non_exhaustive]
18071pub struct GetConfigRequest {
18072 /// Required. Name of requested configuration.
18073 pub name: std::string::String,
18074
18075 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18076}
18077
18078impl GetConfigRequest {
18079 pub fn new() -> Self {
18080 std::default::Default::default()
18081 }
18082
18083 /// Sets the value of [name][crate::model::GetConfigRequest::name].
18084 ///
18085 /// # Example
18086 /// ```ignore,no_run
18087 /// # use google_cloud_deploy_v1::model::GetConfigRequest;
18088 /// let x = GetConfigRequest::new().set_name("example");
18089 /// ```
18090 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18091 self.name = v.into();
18092 self
18093 }
18094}
18095
18096impl wkt::message::Message for GetConfigRequest {
18097 fn typename() -> &'static str {
18098 "type.googleapis.com/google.cloud.deploy.v1.GetConfigRequest"
18099 }
18100}
18101
18102/// An `Automation` resource in the Cloud Deploy API.
18103///
18104/// An `Automation` enables the automation of manually driven actions for
18105/// a Delivery Pipeline, which includes Release promotion among Targets,
18106/// Rollout repair and Rollout deployment strategy advancement. The intention
18107/// of Automation is to reduce manual intervention in the continuous delivery
18108/// process.
18109#[derive(Clone, Default, PartialEq)]
18110#[non_exhaustive]
18111pub struct Automation {
18112 /// Output only. Name of the `Automation`. Format is
18113 /// `projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/automations/{automation}`.
18114 pub name: std::string::String,
18115
18116 /// Output only. Unique identifier of the `Automation`.
18117 pub uid: std::string::String,
18118
18119 /// Optional. Description of the `Automation`. Max length is 255 characters.
18120 pub description: std::string::String,
18121
18122 /// Output only. Time at which the automation was created.
18123 pub create_time: std::option::Option<wkt::Timestamp>,
18124
18125 /// Output only. Time at which the automation was updated.
18126 pub update_time: std::option::Option<wkt::Timestamp>,
18127
18128 /// Optional. User annotations. These attributes can only be set and used by
18129 /// the user, and not by Cloud Deploy. Annotations must meet the following
18130 /// constraints:
18131 ///
18132 /// * Annotations are key/value pairs.
18133 /// * Valid annotation keys have two segments: an optional prefix and name,
18134 /// separated by a slash (`/`).
18135 /// * The name segment is required and must be 63 characters or less,
18136 /// beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with
18137 /// dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between.
18138 /// * The prefix is optional. If specified, the prefix must be a DNS subdomain:
18139 /// a series of DNS labels separated by dots(`.`), not longer than 253
18140 /// characters in total, followed by a slash (`/`).
18141 ///
18142 /// See
18143 /// <https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/#syntax-and-character-set>
18144 /// for more details.
18145 pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
18146
18147 /// Optional. Labels are attributes that can be set and used by both the
18148 /// user and by Cloud Deploy. Labels must meet the following constraints:
18149 ///
18150 /// * Keys and values can contain only lowercase letters, numeric characters,
18151 /// underscores, and dashes.
18152 /// * All characters must use UTF-8 encoding, and international characters are
18153 /// allowed.
18154 /// * Keys must start with a lowercase letter or international character.
18155 /// * Each resource is limited to a maximum of 64 labels.
18156 ///
18157 /// Both keys and values are additionally constrained to be <= 63 characters.
18158 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
18159
18160 /// Optional. The weak etag of the `Automation` resource.
18161 /// This checksum is computed by the server based on the value of other
18162 /// fields, and may be sent on update and delete requests to ensure the
18163 /// client has an up-to-date value before proceeding.
18164 pub etag: std::string::String,
18165
18166 /// Optional. When Suspended, automation is deactivated from execution.
18167 pub suspended: bool,
18168
18169 /// Required. Email address of the user-managed IAM service account that
18170 /// creates Cloud Deploy release and rollout resources.
18171 pub service_account: std::string::String,
18172
18173 /// Required. Selected resources to which the automation will be applied.
18174 pub selector: std::option::Option<crate::model::AutomationResourceSelector>,
18175
18176 /// Required. List of Automation rules associated with the Automation resource.
18177 /// Must have at least one rule and limited to 250 rules per Delivery Pipeline.
18178 /// Note: the order of the rules here is not the same as the order of
18179 /// execution.
18180 pub rules: std::vec::Vec<crate::model::AutomationRule>,
18181
18182 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18183}
18184
18185impl Automation {
18186 pub fn new() -> Self {
18187 std::default::Default::default()
18188 }
18189
18190 /// Sets the value of [name][crate::model::Automation::name].
18191 ///
18192 /// # Example
18193 /// ```ignore,no_run
18194 /// # use google_cloud_deploy_v1::model::Automation;
18195 /// let x = Automation::new().set_name("example");
18196 /// ```
18197 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18198 self.name = v.into();
18199 self
18200 }
18201
18202 /// Sets the value of [uid][crate::model::Automation::uid].
18203 ///
18204 /// # Example
18205 /// ```ignore,no_run
18206 /// # use google_cloud_deploy_v1::model::Automation;
18207 /// let x = Automation::new().set_uid("example");
18208 /// ```
18209 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18210 self.uid = v.into();
18211 self
18212 }
18213
18214 /// Sets the value of [description][crate::model::Automation::description].
18215 ///
18216 /// # Example
18217 /// ```ignore,no_run
18218 /// # use google_cloud_deploy_v1::model::Automation;
18219 /// let x = Automation::new().set_description("example");
18220 /// ```
18221 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18222 self.description = v.into();
18223 self
18224 }
18225
18226 /// Sets the value of [create_time][crate::model::Automation::create_time].
18227 ///
18228 /// # Example
18229 /// ```ignore,no_run
18230 /// # use google_cloud_deploy_v1::model::Automation;
18231 /// use wkt::Timestamp;
18232 /// let x = Automation::new().set_create_time(Timestamp::default()/* use setters */);
18233 /// ```
18234 pub fn set_create_time<T>(mut self, v: T) -> Self
18235 where
18236 T: std::convert::Into<wkt::Timestamp>,
18237 {
18238 self.create_time = std::option::Option::Some(v.into());
18239 self
18240 }
18241
18242 /// Sets or clears the value of [create_time][crate::model::Automation::create_time].
18243 ///
18244 /// # Example
18245 /// ```ignore,no_run
18246 /// # use google_cloud_deploy_v1::model::Automation;
18247 /// use wkt::Timestamp;
18248 /// let x = Automation::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
18249 /// let x = Automation::new().set_or_clear_create_time(None::<Timestamp>);
18250 /// ```
18251 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
18252 where
18253 T: std::convert::Into<wkt::Timestamp>,
18254 {
18255 self.create_time = v.map(|x| x.into());
18256 self
18257 }
18258
18259 /// Sets the value of [update_time][crate::model::Automation::update_time].
18260 ///
18261 /// # Example
18262 /// ```ignore,no_run
18263 /// # use google_cloud_deploy_v1::model::Automation;
18264 /// use wkt::Timestamp;
18265 /// let x = Automation::new().set_update_time(Timestamp::default()/* use setters */);
18266 /// ```
18267 pub fn set_update_time<T>(mut self, v: T) -> Self
18268 where
18269 T: std::convert::Into<wkt::Timestamp>,
18270 {
18271 self.update_time = std::option::Option::Some(v.into());
18272 self
18273 }
18274
18275 /// Sets or clears the value of [update_time][crate::model::Automation::update_time].
18276 ///
18277 /// # Example
18278 /// ```ignore,no_run
18279 /// # use google_cloud_deploy_v1::model::Automation;
18280 /// use wkt::Timestamp;
18281 /// let x = Automation::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
18282 /// let x = Automation::new().set_or_clear_update_time(None::<Timestamp>);
18283 /// ```
18284 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
18285 where
18286 T: std::convert::Into<wkt::Timestamp>,
18287 {
18288 self.update_time = v.map(|x| x.into());
18289 self
18290 }
18291
18292 /// Sets the value of [annotations][crate::model::Automation::annotations].
18293 ///
18294 /// # Example
18295 /// ```ignore,no_run
18296 /// # use google_cloud_deploy_v1::model::Automation;
18297 /// let x = Automation::new().set_annotations([
18298 /// ("key0", "abc"),
18299 /// ("key1", "xyz"),
18300 /// ]);
18301 /// ```
18302 pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
18303 where
18304 T: std::iter::IntoIterator<Item = (K, V)>,
18305 K: std::convert::Into<std::string::String>,
18306 V: std::convert::Into<std::string::String>,
18307 {
18308 use std::iter::Iterator;
18309 self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
18310 self
18311 }
18312
18313 /// Sets the value of [labels][crate::model::Automation::labels].
18314 ///
18315 /// # Example
18316 /// ```ignore,no_run
18317 /// # use google_cloud_deploy_v1::model::Automation;
18318 /// let x = Automation::new().set_labels([
18319 /// ("key0", "abc"),
18320 /// ("key1", "xyz"),
18321 /// ]);
18322 /// ```
18323 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
18324 where
18325 T: std::iter::IntoIterator<Item = (K, V)>,
18326 K: std::convert::Into<std::string::String>,
18327 V: std::convert::Into<std::string::String>,
18328 {
18329 use std::iter::Iterator;
18330 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
18331 self
18332 }
18333
18334 /// Sets the value of [etag][crate::model::Automation::etag].
18335 ///
18336 /// # Example
18337 /// ```ignore,no_run
18338 /// # use google_cloud_deploy_v1::model::Automation;
18339 /// let x = Automation::new().set_etag("example");
18340 /// ```
18341 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18342 self.etag = v.into();
18343 self
18344 }
18345
18346 /// Sets the value of [suspended][crate::model::Automation::suspended].
18347 ///
18348 /// # Example
18349 /// ```ignore,no_run
18350 /// # use google_cloud_deploy_v1::model::Automation;
18351 /// let x = Automation::new().set_suspended(true);
18352 /// ```
18353 pub fn set_suspended<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
18354 self.suspended = v.into();
18355 self
18356 }
18357
18358 /// Sets the value of [service_account][crate::model::Automation::service_account].
18359 ///
18360 /// # Example
18361 /// ```ignore,no_run
18362 /// # use google_cloud_deploy_v1::model::Automation;
18363 /// let x = Automation::new().set_service_account("example");
18364 /// ```
18365 pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18366 self.service_account = v.into();
18367 self
18368 }
18369
18370 /// Sets the value of [selector][crate::model::Automation::selector].
18371 ///
18372 /// # Example
18373 /// ```ignore,no_run
18374 /// # use google_cloud_deploy_v1::model::Automation;
18375 /// use google_cloud_deploy_v1::model::AutomationResourceSelector;
18376 /// let x = Automation::new().set_selector(AutomationResourceSelector::default()/* use setters */);
18377 /// ```
18378 pub fn set_selector<T>(mut self, v: T) -> Self
18379 where
18380 T: std::convert::Into<crate::model::AutomationResourceSelector>,
18381 {
18382 self.selector = std::option::Option::Some(v.into());
18383 self
18384 }
18385
18386 /// Sets or clears the value of [selector][crate::model::Automation::selector].
18387 ///
18388 /// # Example
18389 /// ```ignore,no_run
18390 /// # use google_cloud_deploy_v1::model::Automation;
18391 /// use google_cloud_deploy_v1::model::AutomationResourceSelector;
18392 /// let x = Automation::new().set_or_clear_selector(Some(AutomationResourceSelector::default()/* use setters */));
18393 /// let x = Automation::new().set_or_clear_selector(None::<AutomationResourceSelector>);
18394 /// ```
18395 pub fn set_or_clear_selector<T>(mut self, v: std::option::Option<T>) -> Self
18396 where
18397 T: std::convert::Into<crate::model::AutomationResourceSelector>,
18398 {
18399 self.selector = v.map(|x| x.into());
18400 self
18401 }
18402
18403 /// Sets the value of [rules][crate::model::Automation::rules].
18404 ///
18405 /// # Example
18406 /// ```ignore,no_run
18407 /// # use google_cloud_deploy_v1::model::Automation;
18408 /// use google_cloud_deploy_v1::model::AutomationRule;
18409 /// let x = Automation::new()
18410 /// .set_rules([
18411 /// AutomationRule::default()/* use setters */,
18412 /// AutomationRule::default()/* use (different) setters */,
18413 /// ]);
18414 /// ```
18415 pub fn set_rules<T, V>(mut self, v: T) -> Self
18416 where
18417 T: std::iter::IntoIterator<Item = V>,
18418 V: std::convert::Into<crate::model::AutomationRule>,
18419 {
18420 use std::iter::Iterator;
18421 self.rules = v.into_iter().map(|i| i.into()).collect();
18422 self
18423 }
18424}
18425
18426impl wkt::message::Message for Automation {
18427 fn typename() -> &'static str {
18428 "type.googleapis.com/google.cloud.deploy.v1.Automation"
18429 }
18430}
18431
18432/// AutomationResourceSelector contains the information to select the resources
18433/// to which an Automation is going to be applied.
18434#[derive(Clone, Default, PartialEq)]
18435#[non_exhaustive]
18436pub struct AutomationResourceSelector {
18437 /// Optional. Contains attributes about a target.
18438 pub targets: std::vec::Vec<crate::model::TargetAttribute>,
18439
18440 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18441}
18442
18443impl AutomationResourceSelector {
18444 pub fn new() -> Self {
18445 std::default::Default::default()
18446 }
18447
18448 /// Sets the value of [targets][crate::model::AutomationResourceSelector::targets].
18449 ///
18450 /// # Example
18451 /// ```ignore,no_run
18452 /// # use google_cloud_deploy_v1::model::AutomationResourceSelector;
18453 /// use google_cloud_deploy_v1::model::TargetAttribute;
18454 /// let x = AutomationResourceSelector::new()
18455 /// .set_targets([
18456 /// TargetAttribute::default()/* use setters */,
18457 /// TargetAttribute::default()/* use (different) setters */,
18458 /// ]);
18459 /// ```
18460 pub fn set_targets<T, V>(mut self, v: T) -> Self
18461 where
18462 T: std::iter::IntoIterator<Item = V>,
18463 V: std::convert::Into<crate::model::TargetAttribute>,
18464 {
18465 use std::iter::Iterator;
18466 self.targets = v.into_iter().map(|i| i.into()).collect();
18467 self
18468 }
18469}
18470
18471impl wkt::message::Message for AutomationResourceSelector {
18472 fn typename() -> &'static str {
18473 "type.googleapis.com/google.cloud.deploy.v1.AutomationResourceSelector"
18474 }
18475}
18476
18477/// `AutomationRule` defines the automation activities.
18478#[derive(Clone, Default, PartialEq)]
18479#[non_exhaustive]
18480pub struct AutomationRule {
18481 /// The configuration of the Automation rule.
18482 pub rule: std::option::Option<crate::model::automation_rule::Rule>,
18483
18484 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18485}
18486
18487impl AutomationRule {
18488 pub fn new() -> Self {
18489 std::default::Default::default()
18490 }
18491
18492 /// Sets the value of [rule][crate::model::AutomationRule::rule].
18493 ///
18494 /// Note that all the setters affecting `rule` are mutually
18495 /// exclusive.
18496 ///
18497 /// # Example
18498 /// ```ignore,no_run
18499 /// # use google_cloud_deploy_v1::model::AutomationRule;
18500 /// use google_cloud_deploy_v1::model::PromoteReleaseRule;
18501 /// let x = AutomationRule::new().set_rule(Some(
18502 /// google_cloud_deploy_v1::model::automation_rule::Rule::PromoteReleaseRule(PromoteReleaseRule::default().into())));
18503 /// ```
18504 pub fn set_rule<
18505 T: std::convert::Into<std::option::Option<crate::model::automation_rule::Rule>>,
18506 >(
18507 mut self,
18508 v: T,
18509 ) -> Self {
18510 self.rule = v.into();
18511 self
18512 }
18513
18514 /// The value of [rule][crate::model::AutomationRule::rule]
18515 /// if it holds a `PromoteReleaseRule`, `None` if the field is not set or
18516 /// holds a different branch.
18517 pub fn promote_release_rule(
18518 &self,
18519 ) -> std::option::Option<&std::boxed::Box<crate::model::PromoteReleaseRule>> {
18520 #[allow(unreachable_patterns)]
18521 self.rule.as_ref().and_then(|v| match v {
18522 crate::model::automation_rule::Rule::PromoteReleaseRule(v) => {
18523 std::option::Option::Some(v)
18524 }
18525 _ => std::option::Option::None,
18526 })
18527 }
18528
18529 /// Sets the value of [rule][crate::model::AutomationRule::rule]
18530 /// to hold a `PromoteReleaseRule`.
18531 ///
18532 /// Note that all the setters affecting `rule` are
18533 /// mutually exclusive.
18534 ///
18535 /// # Example
18536 /// ```ignore,no_run
18537 /// # use google_cloud_deploy_v1::model::AutomationRule;
18538 /// use google_cloud_deploy_v1::model::PromoteReleaseRule;
18539 /// let x = AutomationRule::new().set_promote_release_rule(PromoteReleaseRule::default()/* use setters */);
18540 /// assert!(x.promote_release_rule().is_some());
18541 /// assert!(x.advance_rollout_rule().is_none());
18542 /// assert!(x.repair_rollout_rule().is_none());
18543 /// assert!(x.timed_promote_release_rule().is_none());
18544 /// ```
18545 pub fn set_promote_release_rule<
18546 T: std::convert::Into<std::boxed::Box<crate::model::PromoteReleaseRule>>,
18547 >(
18548 mut self,
18549 v: T,
18550 ) -> Self {
18551 self.rule = std::option::Option::Some(
18552 crate::model::automation_rule::Rule::PromoteReleaseRule(v.into()),
18553 );
18554 self
18555 }
18556
18557 /// The value of [rule][crate::model::AutomationRule::rule]
18558 /// if it holds a `AdvanceRolloutRule`, `None` if the field is not set or
18559 /// holds a different branch.
18560 pub fn advance_rollout_rule(
18561 &self,
18562 ) -> std::option::Option<&std::boxed::Box<crate::model::AdvanceRolloutRule>> {
18563 #[allow(unreachable_patterns)]
18564 self.rule.as_ref().and_then(|v| match v {
18565 crate::model::automation_rule::Rule::AdvanceRolloutRule(v) => {
18566 std::option::Option::Some(v)
18567 }
18568 _ => std::option::Option::None,
18569 })
18570 }
18571
18572 /// Sets the value of [rule][crate::model::AutomationRule::rule]
18573 /// to hold a `AdvanceRolloutRule`.
18574 ///
18575 /// Note that all the setters affecting `rule` are
18576 /// mutually exclusive.
18577 ///
18578 /// # Example
18579 /// ```ignore,no_run
18580 /// # use google_cloud_deploy_v1::model::AutomationRule;
18581 /// use google_cloud_deploy_v1::model::AdvanceRolloutRule;
18582 /// let x = AutomationRule::new().set_advance_rollout_rule(AdvanceRolloutRule::default()/* use setters */);
18583 /// assert!(x.advance_rollout_rule().is_some());
18584 /// assert!(x.promote_release_rule().is_none());
18585 /// assert!(x.repair_rollout_rule().is_none());
18586 /// assert!(x.timed_promote_release_rule().is_none());
18587 /// ```
18588 pub fn set_advance_rollout_rule<
18589 T: std::convert::Into<std::boxed::Box<crate::model::AdvanceRolloutRule>>,
18590 >(
18591 mut self,
18592 v: T,
18593 ) -> Self {
18594 self.rule = std::option::Option::Some(
18595 crate::model::automation_rule::Rule::AdvanceRolloutRule(v.into()),
18596 );
18597 self
18598 }
18599
18600 /// The value of [rule][crate::model::AutomationRule::rule]
18601 /// if it holds a `RepairRolloutRule`, `None` if the field is not set or
18602 /// holds a different branch.
18603 pub fn repair_rollout_rule(
18604 &self,
18605 ) -> std::option::Option<&std::boxed::Box<crate::model::RepairRolloutRule>> {
18606 #[allow(unreachable_patterns)]
18607 self.rule.as_ref().and_then(|v| match v {
18608 crate::model::automation_rule::Rule::RepairRolloutRule(v) => {
18609 std::option::Option::Some(v)
18610 }
18611 _ => std::option::Option::None,
18612 })
18613 }
18614
18615 /// Sets the value of [rule][crate::model::AutomationRule::rule]
18616 /// to hold a `RepairRolloutRule`.
18617 ///
18618 /// Note that all the setters affecting `rule` are
18619 /// mutually exclusive.
18620 ///
18621 /// # Example
18622 /// ```ignore,no_run
18623 /// # use google_cloud_deploy_v1::model::AutomationRule;
18624 /// use google_cloud_deploy_v1::model::RepairRolloutRule;
18625 /// let x = AutomationRule::new().set_repair_rollout_rule(RepairRolloutRule::default()/* use setters */);
18626 /// assert!(x.repair_rollout_rule().is_some());
18627 /// assert!(x.promote_release_rule().is_none());
18628 /// assert!(x.advance_rollout_rule().is_none());
18629 /// assert!(x.timed_promote_release_rule().is_none());
18630 /// ```
18631 pub fn set_repair_rollout_rule<
18632 T: std::convert::Into<std::boxed::Box<crate::model::RepairRolloutRule>>,
18633 >(
18634 mut self,
18635 v: T,
18636 ) -> Self {
18637 self.rule = std::option::Option::Some(
18638 crate::model::automation_rule::Rule::RepairRolloutRule(v.into()),
18639 );
18640 self
18641 }
18642
18643 /// The value of [rule][crate::model::AutomationRule::rule]
18644 /// if it holds a `TimedPromoteReleaseRule`, `None` if the field is not set or
18645 /// holds a different branch.
18646 pub fn timed_promote_release_rule(
18647 &self,
18648 ) -> std::option::Option<&std::boxed::Box<crate::model::TimedPromoteReleaseRule>> {
18649 #[allow(unreachable_patterns)]
18650 self.rule.as_ref().and_then(|v| match v {
18651 crate::model::automation_rule::Rule::TimedPromoteReleaseRule(v) => {
18652 std::option::Option::Some(v)
18653 }
18654 _ => std::option::Option::None,
18655 })
18656 }
18657
18658 /// Sets the value of [rule][crate::model::AutomationRule::rule]
18659 /// to hold a `TimedPromoteReleaseRule`.
18660 ///
18661 /// Note that all the setters affecting `rule` are
18662 /// mutually exclusive.
18663 ///
18664 /// # Example
18665 /// ```ignore,no_run
18666 /// # use google_cloud_deploy_v1::model::AutomationRule;
18667 /// use google_cloud_deploy_v1::model::TimedPromoteReleaseRule;
18668 /// let x = AutomationRule::new().set_timed_promote_release_rule(TimedPromoteReleaseRule::default()/* use setters */);
18669 /// assert!(x.timed_promote_release_rule().is_some());
18670 /// assert!(x.promote_release_rule().is_none());
18671 /// assert!(x.advance_rollout_rule().is_none());
18672 /// assert!(x.repair_rollout_rule().is_none());
18673 /// ```
18674 pub fn set_timed_promote_release_rule<
18675 T: std::convert::Into<std::boxed::Box<crate::model::TimedPromoteReleaseRule>>,
18676 >(
18677 mut self,
18678 v: T,
18679 ) -> Self {
18680 self.rule = std::option::Option::Some(
18681 crate::model::automation_rule::Rule::TimedPromoteReleaseRule(v.into()),
18682 );
18683 self
18684 }
18685}
18686
18687impl wkt::message::Message for AutomationRule {
18688 fn typename() -> &'static str {
18689 "type.googleapis.com/google.cloud.deploy.v1.AutomationRule"
18690 }
18691}
18692
18693/// Defines additional types related to [AutomationRule].
18694pub mod automation_rule {
18695 #[allow(unused_imports)]
18696 use super::*;
18697
18698 /// The configuration of the Automation rule.
18699 #[derive(Clone, Debug, PartialEq)]
18700 #[non_exhaustive]
18701 pub enum Rule {
18702 /// Optional. `PromoteReleaseRule` will automatically promote a release from
18703 /// the current target to a specified target.
18704 PromoteReleaseRule(std::boxed::Box<crate::model::PromoteReleaseRule>),
18705 /// Optional. The `AdvanceRolloutRule` will automatically advance a
18706 /// successful Rollout.
18707 AdvanceRolloutRule(std::boxed::Box<crate::model::AdvanceRolloutRule>),
18708 /// Optional. The `RepairRolloutRule` will automatically repair a failed
18709 /// rollout.
18710 RepairRolloutRule(std::boxed::Box<crate::model::RepairRolloutRule>),
18711 /// Optional. The `TimedPromoteReleaseRule` will automatically promote a
18712 /// release from the current target(s) to the specified target(s) on a
18713 /// configured schedule.
18714 TimedPromoteReleaseRule(std::boxed::Box<crate::model::TimedPromoteReleaseRule>),
18715 }
18716}
18717
18718/// The `TimedPromoteReleaseRule` will automatically promote a release from the
18719/// current target(s) to the specified target(s) on a configured schedule.
18720#[derive(Clone, Default, PartialEq)]
18721#[non_exhaustive]
18722pub struct TimedPromoteReleaseRule {
18723 /// Required. ID of the rule. This ID must be unique in the `Automation`
18724 /// resource to which this rule belongs. The format is
18725 /// `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`.
18726 pub id: std::string::String,
18727
18728 /// Optional. The ID of the stage in the pipeline to which this `Release` is
18729 /// deploying. If unspecified, default it to the next stage in the promotion
18730 /// flow. The value of this field could be one of the following:
18731 ///
18732 /// * The last segment of a target name
18733 /// * "@next", the next target in the promotion sequence
18734 pub destination_target_id: std::string::String,
18735
18736 /// Required. Schedule in crontab format. e.g. "0 9 * * 1" for every Monday at
18737 /// 9am.
18738 pub schedule: std::string::String,
18739
18740 /// Required. The time zone in IANA format [IANA Time Zone
18741 /// Database](https://www.iana.org/time-zones) (e.g. America/New_York).
18742 pub time_zone: std::string::String,
18743
18744 /// Output only. Information around the state of the Automation rule.
18745 pub condition: std::option::Option<crate::model::AutomationRuleCondition>,
18746
18747 /// Optional. The starting phase of the rollout created by this rule. Default
18748 /// to the first phase.
18749 pub destination_phase: std::string::String,
18750
18751 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18752}
18753
18754impl TimedPromoteReleaseRule {
18755 pub fn new() -> Self {
18756 std::default::Default::default()
18757 }
18758
18759 /// Sets the value of [id][crate::model::TimedPromoteReleaseRule::id].
18760 ///
18761 /// # Example
18762 /// ```ignore,no_run
18763 /// # use google_cloud_deploy_v1::model::TimedPromoteReleaseRule;
18764 /// let x = TimedPromoteReleaseRule::new().set_id("example");
18765 /// ```
18766 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18767 self.id = v.into();
18768 self
18769 }
18770
18771 /// Sets the value of [destination_target_id][crate::model::TimedPromoteReleaseRule::destination_target_id].
18772 ///
18773 /// # Example
18774 /// ```ignore,no_run
18775 /// # use google_cloud_deploy_v1::model::TimedPromoteReleaseRule;
18776 /// let x = TimedPromoteReleaseRule::new().set_destination_target_id("example");
18777 /// ```
18778 pub fn set_destination_target_id<T: std::convert::Into<std::string::String>>(
18779 mut self,
18780 v: T,
18781 ) -> Self {
18782 self.destination_target_id = v.into();
18783 self
18784 }
18785
18786 /// Sets the value of [schedule][crate::model::TimedPromoteReleaseRule::schedule].
18787 ///
18788 /// # Example
18789 /// ```ignore,no_run
18790 /// # use google_cloud_deploy_v1::model::TimedPromoteReleaseRule;
18791 /// let x = TimedPromoteReleaseRule::new().set_schedule("example");
18792 /// ```
18793 pub fn set_schedule<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18794 self.schedule = v.into();
18795 self
18796 }
18797
18798 /// Sets the value of [time_zone][crate::model::TimedPromoteReleaseRule::time_zone].
18799 ///
18800 /// # Example
18801 /// ```ignore,no_run
18802 /// # use google_cloud_deploy_v1::model::TimedPromoteReleaseRule;
18803 /// let x = TimedPromoteReleaseRule::new().set_time_zone("example");
18804 /// ```
18805 pub fn set_time_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18806 self.time_zone = v.into();
18807 self
18808 }
18809
18810 /// Sets the value of [condition][crate::model::TimedPromoteReleaseRule::condition].
18811 ///
18812 /// # Example
18813 /// ```ignore,no_run
18814 /// # use google_cloud_deploy_v1::model::TimedPromoteReleaseRule;
18815 /// use google_cloud_deploy_v1::model::AutomationRuleCondition;
18816 /// let x = TimedPromoteReleaseRule::new().set_condition(AutomationRuleCondition::default()/* use setters */);
18817 /// ```
18818 pub fn set_condition<T>(mut self, v: T) -> Self
18819 where
18820 T: std::convert::Into<crate::model::AutomationRuleCondition>,
18821 {
18822 self.condition = std::option::Option::Some(v.into());
18823 self
18824 }
18825
18826 /// Sets or clears the value of [condition][crate::model::TimedPromoteReleaseRule::condition].
18827 ///
18828 /// # Example
18829 /// ```ignore,no_run
18830 /// # use google_cloud_deploy_v1::model::TimedPromoteReleaseRule;
18831 /// use google_cloud_deploy_v1::model::AutomationRuleCondition;
18832 /// let x = TimedPromoteReleaseRule::new().set_or_clear_condition(Some(AutomationRuleCondition::default()/* use setters */));
18833 /// let x = TimedPromoteReleaseRule::new().set_or_clear_condition(None::<AutomationRuleCondition>);
18834 /// ```
18835 pub fn set_or_clear_condition<T>(mut self, v: std::option::Option<T>) -> Self
18836 where
18837 T: std::convert::Into<crate::model::AutomationRuleCondition>,
18838 {
18839 self.condition = v.map(|x| x.into());
18840 self
18841 }
18842
18843 /// Sets the value of [destination_phase][crate::model::TimedPromoteReleaseRule::destination_phase].
18844 ///
18845 /// # Example
18846 /// ```ignore,no_run
18847 /// # use google_cloud_deploy_v1::model::TimedPromoteReleaseRule;
18848 /// let x = TimedPromoteReleaseRule::new().set_destination_phase("example");
18849 /// ```
18850 pub fn set_destination_phase<T: std::convert::Into<std::string::String>>(
18851 mut self,
18852 v: T,
18853 ) -> Self {
18854 self.destination_phase = v.into();
18855 self
18856 }
18857}
18858
18859impl wkt::message::Message for TimedPromoteReleaseRule {
18860 fn typename() -> &'static str {
18861 "type.googleapis.com/google.cloud.deploy.v1.TimedPromoteReleaseRule"
18862 }
18863}
18864
18865/// The `PromoteRelease` rule will automatically promote a release from the
18866/// current target to a specified target.
18867#[derive(Clone, Default, PartialEq)]
18868#[non_exhaustive]
18869pub struct PromoteReleaseRule {
18870 /// Required. ID of the rule. This id must be unique in the `Automation`
18871 /// resource to which this rule belongs. The format is
18872 /// `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`.
18873 pub id: std::string::String,
18874
18875 /// Optional. How long the release need to be paused until being promoted to
18876 /// the next target.
18877 pub wait: std::option::Option<wkt::Duration>,
18878
18879 /// Optional. The ID of the stage in the pipeline to which this `Release` is
18880 /// deploying. If unspecified, default it to the next stage in the promotion
18881 /// flow. The value of this field could be one of the following:
18882 ///
18883 /// * The last segment of a target name
18884 /// * "@next", the next target in the promotion sequence
18885 pub destination_target_id: std::string::String,
18886
18887 /// Output only. Information around the state of the Automation rule.
18888 pub condition: std::option::Option<crate::model::AutomationRuleCondition>,
18889
18890 /// Optional. The starting phase of the rollout created by this operation.
18891 /// Default to the first phase.
18892 pub destination_phase: std::string::String,
18893
18894 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18895}
18896
18897impl PromoteReleaseRule {
18898 pub fn new() -> Self {
18899 std::default::Default::default()
18900 }
18901
18902 /// Sets the value of [id][crate::model::PromoteReleaseRule::id].
18903 ///
18904 /// # Example
18905 /// ```ignore,no_run
18906 /// # use google_cloud_deploy_v1::model::PromoteReleaseRule;
18907 /// let x = PromoteReleaseRule::new().set_id("example");
18908 /// ```
18909 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18910 self.id = v.into();
18911 self
18912 }
18913
18914 /// Sets the value of [wait][crate::model::PromoteReleaseRule::wait].
18915 ///
18916 /// # Example
18917 /// ```ignore,no_run
18918 /// # use google_cloud_deploy_v1::model::PromoteReleaseRule;
18919 /// use wkt::Duration;
18920 /// let x = PromoteReleaseRule::new().set_wait(Duration::default()/* use setters */);
18921 /// ```
18922 pub fn set_wait<T>(mut self, v: T) -> Self
18923 where
18924 T: std::convert::Into<wkt::Duration>,
18925 {
18926 self.wait = std::option::Option::Some(v.into());
18927 self
18928 }
18929
18930 /// Sets or clears the value of [wait][crate::model::PromoteReleaseRule::wait].
18931 ///
18932 /// # Example
18933 /// ```ignore,no_run
18934 /// # use google_cloud_deploy_v1::model::PromoteReleaseRule;
18935 /// use wkt::Duration;
18936 /// let x = PromoteReleaseRule::new().set_or_clear_wait(Some(Duration::default()/* use setters */));
18937 /// let x = PromoteReleaseRule::new().set_or_clear_wait(None::<Duration>);
18938 /// ```
18939 pub fn set_or_clear_wait<T>(mut self, v: std::option::Option<T>) -> Self
18940 where
18941 T: std::convert::Into<wkt::Duration>,
18942 {
18943 self.wait = v.map(|x| x.into());
18944 self
18945 }
18946
18947 /// Sets the value of [destination_target_id][crate::model::PromoteReleaseRule::destination_target_id].
18948 ///
18949 /// # Example
18950 /// ```ignore,no_run
18951 /// # use google_cloud_deploy_v1::model::PromoteReleaseRule;
18952 /// let x = PromoteReleaseRule::new().set_destination_target_id("example");
18953 /// ```
18954 pub fn set_destination_target_id<T: std::convert::Into<std::string::String>>(
18955 mut self,
18956 v: T,
18957 ) -> Self {
18958 self.destination_target_id = v.into();
18959 self
18960 }
18961
18962 /// Sets the value of [condition][crate::model::PromoteReleaseRule::condition].
18963 ///
18964 /// # Example
18965 /// ```ignore,no_run
18966 /// # use google_cloud_deploy_v1::model::PromoteReleaseRule;
18967 /// use google_cloud_deploy_v1::model::AutomationRuleCondition;
18968 /// let x = PromoteReleaseRule::new().set_condition(AutomationRuleCondition::default()/* use setters */);
18969 /// ```
18970 pub fn set_condition<T>(mut self, v: T) -> Self
18971 where
18972 T: std::convert::Into<crate::model::AutomationRuleCondition>,
18973 {
18974 self.condition = std::option::Option::Some(v.into());
18975 self
18976 }
18977
18978 /// Sets or clears the value of [condition][crate::model::PromoteReleaseRule::condition].
18979 ///
18980 /// # Example
18981 /// ```ignore,no_run
18982 /// # use google_cloud_deploy_v1::model::PromoteReleaseRule;
18983 /// use google_cloud_deploy_v1::model::AutomationRuleCondition;
18984 /// let x = PromoteReleaseRule::new().set_or_clear_condition(Some(AutomationRuleCondition::default()/* use setters */));
18985 /// let x = PromoteReleaseRule::new().set_or_clear_condition(None::<AutomationRuleCondition>);
18986 /// ```
18987 pub fn set_or_clear_condition<T>(mut self, v: std::option::Option<T>) -> Self
18988 where
18989 T: std::convert::Into<crate::model::AutomationRuleCondition>,
18990 {
18991 self.condition = v.map(|x| x.into());
18992 self
18993 }
18994
18995 /// Sets the value of [destination_phase][crate::model::PromoteReleaseRule::destination_phase].
18996 ///
18997 /// # Example
18998 /// ```ignore,no_run
18999 /// # use google_cloud_deploy_v1::model::PromoteReleaseRule;
19000 /// let x = PromoteReleaseRule::new().set_destination_phase("example");
19001 /// ```
19002 pub fn set_destination_phase<T: std::convert::Into<std::string::String>>(
19003 mut self,
19004 v: T,
19005 ) -> Self {
19006 self.destination_phase = v.into();
19007 self
19008 }
19009}
19010
19011impl wkt::message::Message for PromoteReleaseRule {
19012 fn typename() -> &'static str {
19013 "type.googleapis.com/google.cloud.deploy.v1.PromoteReleaseRule"
19014 }
19015}
19016
19017/// The `AdvanceRollout` automation rule will automatically advance a successful
19018/// Rollout to the next phase.
19019#[derive(Clone, Default, PartialEq)]
19020#[non_exhaustive]
19021pub struct AdvanceRolloutRule {
19022 /// Required. ID of the rule. This id must be unique in the `Automation`
19023 /// resource to which this rule belongs. The format is
19024 /// `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`.
19025 pub id: std::string::String,
19026
19027 /// Optional. Proceeds only after phase name matched any one in the list.
19028 /// This value must consist of lower-case letters, numbers, and hyphens,
19029 /// start with a letter and end with a letter or a number, and have a max
19030 /// length of 63 characters. In other words, it must match the following
19031 /// regex: `^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$`.
19032 pub source_phases: std::vec::Vec<std::string::String>,
19033
19034 /// Optional. How long to wait after a rollout is finished.
19035 pub wait: std::option::Option<wkt::Duration>,
19036
19037 /// Output only. Information around the state of the Automation rule.
19038 pub condition: std::option::Option<crate::model::AutomationRuleCondition>,
19039
19040 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19041}
19042
19043impl AdvanceRolloutRule {
19044 pub fn new() -> Self {
19045 std::default::Default::default()
19046 }
19047
19048 /// Sets the value of [id][crate::model::AdvanceRolloutRule::id].
19049 ///
19050 /// # Example
19051 /// ```ignore,no_run
19052 /// # use google_cloud_deploy_v1::model::AdvanceRolloutRule;
19053 /// let x = AdvanceRolloutRule::new().set_id("example");
19054 /// ```
19055 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19056 self.id = v.into();
19057 self
19058 }
19059
19060 /// Sets the value of [source_phases][crate::model::AdvanceRolloutRule::source_phases].
19061 ///
19062 /// # Example
19063 /// ```ignore,no_run
19064 /// # use google_cloud_deploy_v1::model::AdvanceRolloutRule;
19065 /// let x = AdvanceRolloutRule::new().set_source_phases(["a", "b", "c"]);
19066 /// ```
19067 pub fn set_source_phases<T, V>(mut self, v: T) -> Self
19068 where
19069 T: std::iter::IntoIterator<Item = V>,
19070 V: std::convert::Into<std::string::String>,
19071 {
19072 use std::iter::Iterator;
19073 self.source_phases = v.into_iter().map(|i| i.into()).collect();
19074 self
19075 }
19076
19077 /// Sets the value of [wait][crate::model::AdvanceRolloutRule::wait].
19078 ///
19079 /// # Example
19080 /// ```ignore,no_run
19081 /// # use google_cloud_deploy_v1::model::AdvanceRolloutRule;
19082 /// use wkt::Duration;
19083 /// let x = AdvanceRolloutRule::new().set_wait(Duration::default()/* use setters */);
19084 /// ```
19085 pub fn set_wait<T>(mut self, v: T) -> Self
19086 where
19087 T: std::convert::Into<wkt::Duration>,
19088 {
19089 self.wait = std::option::Option::Some(v.into());
19090 self
19091 }
19092
19093 /// Sets or clears the value of [wait][crate::model::AdvanceRolloutRule::wait].
19094 ///
19095 /// # Example
19096 /// ```ignore,no_run
19097 /// # use google_cloud_deploy_v1::model::AdvanceRolloutRule;
19098 /// use wkt::Duration;
19099 /// let x = AdvanceRolloutRule::new().set_or_clear_wait(Some(Duration::default()/* use setters */));
19100 /// let x = AdvanceRolloutRule::new().set_or_clear_wait(None::<Duration>);
19101 /// ```
19102 pub fn set_or_clear_wait<T>(mut self, v: std::option::Option<T>) -> Self
19103 where
19104 T: std::convert::Into<wkt::Duration>,
19105 {
19106 self.wait = v.map(|x| x.into());
19107 self
19108 }
19109
19110 /// Sets the value of [condition][crate::model::AdvanceRolloutRule::condition].
19111 ///
19112 /// # Example
19113 /// ```ignore,no_run
19114 /// # use google_cloud_deploy_v1::model::AdvanceRolloutRule;
19115 /// use google_cloud_deploy_v1::model::AutomationRuleCondition;
19116 /// let x = AdvanceRolloutRule::new().set_condition(AutomationRuleCondition::default()/* use setters */);
19117 /// ```
19118 pub fn set_condition<T>(mut self, v: T) -> Self
19119 where
19120 T: std::convert::Into<crate::model::AutomationRuleCondition>,
19121 {
19122 self.condition = std::option::Option::Some(v.into());
19123 self
19124 }
19125
19126 /// Sets or clears the value of [condition][crate::model::AdvanceRolloutRule::condition].
19127 ///
19128 /// # Example
19129 /// ```ignore,no_run
19130 /// # use google_cloud_deploy_v1::model::AdvanceRolloutRule;
19131 /// use google_cloud_deploy_v1::model::AutomationRuleCondition;
19132 /// let x = AdvanceRolloutRule::new().set_or_clear_condition(Some(AutomationRuleCondition::default()/* use setters */));
19133 /// let x = AdvanceRolloutRule::new().set_or_clear_condition(None::<AutomationRuleCondition>);
19134 /// ```
19135 pub fn set_or_clear_condition<T>(mut self, v: std::option::Option<T>) -> Self
19136 where
19137 T: std::convert::Into<crate::model::AutomationRuleCondition>,
19138 {
19139 self.condition = v.map(|x| x.into());
19140 self
19141 }
19142}
19143
19144impl wkt::message::Message for AdvanceRolloutRule {
19145 fn typename() -> &'static str {
19146 "type.googleapis.com/google.cloud.deploy.v1.AdvanceRolloutRule"
19147 }
19148}
19149
19150/// The `RepairRolloutRule` automation rule will automatically repair a failed
19151/// `Rollout`.
19152#[derive(Clone, Default, PartialEq)]
19153#[non_exhaustive]
19154pub struct RepairRolloutRule {
19155 /// Required. ID of the rule. This id must be unique in the `Automation`
19156 /// resource to which this rule belongs. The format is
19157 /// `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`.
19158 pub id: std::string::String,
19159
19160 /// Optional. Phases within which jobs are subject to automatic repair actions
19161 /// on failure. Proceeds only after phase name matched any one in the list, or
19162 /// for all phases if unspecified. This value must consist of lower-case
19163 /// letters, numbers, and hyphens, start with a letter and end with a letter or
19164 /// a number, and have a max length of 63 characters. In other words, it must
19165 /// match the following regex: `^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$`.
19166 pub phases: std::vec::Vec<std::string::String>,
19167
19168 /// Optional. Jobs to repair. Proceeds only after job name matched any one in
19169 /// the list, or for all jobs if unspecified or empty. The phase that includes
19170 /// the job must match the phase ID specified in `source_phase`. This value
19171 /// must consist of lower-case letters, numbers, and hyphens, start with a
19172 /// letter and end with a letter or a number, and have a max length of 63
19173 /// characters. In other words, it must match the following regex:
19174 /// `^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$`.
19175 pub jobs: std::vec::Vec<std::string::String>,
19176
19177 /// Output only. Information around the state of the 'Automation' rule.
19178 pub condition: std::option::Option<crate::model::AutomationRuleCondition>,
19179
19180 /// Required. Defines the types of automatic repair phases for failed jobs.
19181 pub repair_phases: std::vec::Vec<crate::model::RepairPhaseConfig>,
19182
19183 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19184}
19185
19186impl RepairRolloutRule {
19187 pub fn new() -> Self {
19188 std::default::Default::default()
19189 }
19190
19191 /// Sets the value of [id][crate::model::RepairRolloutRule::id].
19192 ///
19193 /// # Example
19194 /// ```ignore,no_run
19195 /// # use google_cloud_deploy_v1::model::RepairRolloutRule;
19196 /// let x = RepairRolloutRule::new().set_id("example");
19197 /// ```
19198 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19199 self.id = v.into();
19200 self
19201 }
19202
19203 /// Sets the value of [phases][crate::model::RepairRolloutRule::phases].
19204 ///
19205 /// # Example
19206 /// ```ignore,no_run
19207 /// # use google_cloud_deploy_v1::model::RepairRolloutRule;
19208 /// let x = RepairRolloutRule::new().set_phases(["a", "b", "c"]);
19209 /// ```
19210 pub fn set_phases<T, V>(mut self, v: T) -> Self
19211 where
19212 T: std::iter::IntoIterator<Item = V>,
19213 V: std::convert::Into<std::string::String>,
19214 {
19215 use std::iter::Iterator;
19216 self.phases = v.into_iter().map(|i| i.into()).collect();
19217 self
19218 }
19219
19220 /// Sets the value of [jobs][crate::model::RepairRolloutRule::jobs].
19221 ///
19222 /// # Example
19223 /// ```ignore,no_run
19224 /// # use google_cloud_deploy_v1::model::RepairRolloutRule;
19225 /// let x = RepairRolloutRule::new().set_jobs(["a", "b", "c"]);
19226 /// ```
19227 pub fn set_jobs<T, V>(mut self, v: T) -> Self
19228 where
19229 T: std::iter::IntoIterator<Item = V>,
19230 V: std::convert::Into<std::string::String>,
19231 {
19232 use std::iter::Iterator;
19233 self.jobs = v.into_iter().map(|i| i.into()).collect();
19234 self
19235 }
19236
19237 /// Sets the value of [condition][crate::model::RepairRolloutRule::condition].
19238 ///
19239 /// # Example
19240 /// ```ignore,no_run
19241 /// # use google_cloud_deploy_v1::model::RepairRolloutRule;
19242 /// use google_cloud_deploy_v1::model::AutomationRuleCondition;
19243 /// let x = RepairRolloutRule::new().set_condition(AutomationRuleCondition::default()/* use setters */);
19244 /// ```
19245 pub fn set_condition<T>(mut self, v: T) -> Self
19246 where
19247 T: std::convert::Into<crate::model::AutomationRuleCondition>,
19248 {
19249 self.condition = std::option::Option::Some(v.into());
19250 self
19251 }
19252
19253 /// Sets or clears the value of [condition][crate::model::RepairRolloutRule::condition].
19254 ///
19255 /// # Example
19256 /// ```ignore,no_run
19257 /// # use google_cloud_deploy_v1::model::RepairRolloutRule;
19258 /// use google_cloud_deploy_v1::model::AutomationRuleCondition;
19259 /// let x = RepairRolloutRule::new().set_or_clear_condition(Some(AutomationRuleCondition::default()/* use setters */));
19260 /// let x = RepairRolloutRule::new().set_or_clear_condition(None::<AutomationRuleCondition>);
19261 /// ```
19262 pub fn set_or_clear_condition<T>(mut self, v: std::option::Option<T>) -> Self
19263 where
19264 T: std::convert::Into<crate::model::AutomationRuleCondition>,
19265 {
19266 self.condition = v.map(|x| x.into());
19267 self
19268 }
19269
19270 /// Sets the value of [repair_phases][crate::model::RepairRolloutRule::repair_phases].
19271 ///
19272 /// # Example
19273 /// ```ignore,no_run
19274 /// # use google_cloud_deploy_v1::model::RepairRolloutRule;
19275 /// use google_cloud_deploy_v1::model::RepairPhaseConfig;
19276 /// let x = RepairRolloutRule::new()
19277 /// .set_repair_phases([
19278 /// RepairPhaseConfig::default()/* use setters */,
19279 /// RepairPhaseConfig::default()/* use (different) setters */,
19280 /// ]);
19281 /// ```
19282 pub fn set_repair_phases<T, V>(mut self, v: T) -> Self
19283 where
19284 T: std::iter::IntoIterator<Item = V>,
19285 V: std::convert::Into<crate::model::RepairPhaseConfig>,
19286 {
19287 use std::iter::Iterator;
19288 self.repair_phases = v.into_iter().map(|i| i.into()).collect();
19289 self
19290 }
19291}
19292
19293impl wkt::message::Message for RepairRolloutRule {
19294 fn typename() -> &'static str {
19295 "type.googleapis.com/google.cloud.deploy.v1.RepairRolloutRule"
19296 }
19297}
19298
19299/// Configuration of the repair phase.
19300#[derive(Clone, Default, PartialEq)]
19301#[non_exhaustive]
19302pub struct RepairPhaseConfig {
19303 /// The repair phase to perform.
19304 pub repair_phase: std::option::Option<crate::model::repair_phase_config::RepairPhase>,
19305
19306 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19307}
19308
19309impl RepairPhaseConfig {
19310 pub fn new() -> Self {
19311 std::default::Default::default()
19312 }
19313
19314 /// Sets the value of [repair_phase][crate::model::RepairPhaseConfig::repair_phase].
19315 ///
19316 /// Note that all the setters affecting `repair_phase` are mutually
19317 /// exclusive.
19318 ///
19319 /// # Example
19320 /// ```ignore,no_run
19321 /// # use google_cloud_deploy_v1::model::RepairPhaseConfig;
19322 /// use google_cloud_deploy_v1::model::Retry;
19323 /// let x = RepairPhaseConfig::new().set_repair_phase(Some(
19324 /// google_cloud_deploy_v1::model::repair_phase_config::RepairPhase::Retry(Retry::default().into())));
19325 /// ```
19326 pub fn set_repair_phase<
19327 T: std::convert::Into<std::option::Option<crate::model::repair_phase_config::RepairPhase>>,
19328 >(
19329 mut self,
19330 v: T,
19331 ) -> Self {
19332 self.repair_phase = v.into();
19333 self
19334 }
19335
19336 /// The value of [repair_phase][crate::model::RepairPhaseConfig::repair_phase]
19337 /// if it holds a `Retry`, `None` if the field is not set or
19338 /// holds a different branch.
19339 pub fn retry(&self) -> std::option::Option<&std::boxed::Box<crate::model::Retry>> {
19340 #[allow(unreachable_patterns)]
19341 self.repair_phase.as_ref().and_then(|v| match v {
19342 crate::model::repair_phase_config::RepairPhase::Retry(v) => {
19343 std::option::Option::Some(v)
19344 }
19345 _ => std::option::Option::None,
19346 })
19347 }
19348
19349 /// Sets the value of [repair_phase][crate::model::RepairPhaseConfig::repair_phase]
19350 /// to hold a `Retry`.
19351 ///
19352 /// Note that all the setters affecting `repair_phase` are
19353 /// mutually exclusive.
19354 ///
19355 /// # Example
19356 /// ```ignore,no_run
19357 /// # use google_cloud_deploy_v1::model::RepairPhaseConfig;
19358 /// use google_cloud_deploy_v1::model::Retry;
19359 /// let x = RepairPhaseConfig::new().set_retry(Retry::default()/* use setters */);
19360 /// assert!(x.retry().is_some());
19361 /// assert!(x.rollback().is_none());
19362 /// ```
19363 pub fn set_retry<T: std::convert::Into<std::boxed::Box<crate::model::Retry>>>(
19364 mut self,
19365 v: T,
19366 ) -> Self {
19367 self.repair_phase = std::option::Option::Some(
19368 crate::model::repair_phase_config::RepairPhase::Retry(v.into()),
19369 );
19370 self
19371 }
19372
19373 /// The value of [repair_phase][crate::model::RepairPhaseConfig::repair_phase]
19374 /// if it holds a `Rollback`, `None` if the field is not set or
19375 /// holds a different branch.
19376 pub fn rollback(&self) -> std::option::Option<&std::boxed::Box<crate::model::Rollback>> {
19377 #[allow(unreachable_patterns)]
19378 self.repair_phase.as_ref().and_then(|v| match v {
19379 crate::model::repair_phase_config::RepairPhase::Rollback(v) => {
19380 std::option::Option::Some(v)
19381 }
19382 _ => std::option::Option::None,
19383 })
19384 }
19385
19386 /// Sets the value of [repair_phase][crate::model::RepairPhaseConfig::repair_phase]
19387 /// to hold a `Rollback`.
19388 ///
19389 /// Note that all the setters affecting `repair_phase` are
19390 /// mutually exclusive.
19391 ///
19392 /// # Example
19393 /// ```ignore,no_run
19394 /// # use google_cloud_deploy_v1::model::RepairPhaseConfig;
19395 /// use google_cloud_deploy_v1::model::Rollback;
19396 /// let x = RepairPhaseConfig::new().set_rollback(Rollback::default()/* use setters */);
19397 /// assert!(x.rollback().is_some());
19398 /// assert!(x.retry().is_none());
19399 /// ```
19400 pub fn set_rollback<T: std::convert::Into<std::boxed::Box<crate::model::Rollback>>>(
19401 mut self,
19402 v: T,
19403 ) -> Self {
19404 self.repair_phase = std::option::Option::Some(
19405 crate::model::repair_phase_config::RepairPhase::Rollback(v.into()),
19406 );
19407 self
19408 }
19409}
19410
19411impl wkt::message::Message for RepairPhaseConfig {
19412 fn typename() -> &'static str {
19413 "type.googleapis.com/google.cloud.deploy.v1.RepairPhaseConfig"
19414 }
19415}
19416
19417/// Defines additional types related to [RepairPhaseConfig].
19418pub mod repair_phase_config {
19419 #[allow(unused_imports)]
19420 use super::*;
19421
19422 /// The repair phase to perform.
19423 #[derive(Clone, Debug, PartialEq)]
19424 #[non_exhaustive]
19425 pub enum RepairPhase {
19426 /// Optional. Retries a failed job.
19427 Retry(std::boxed::Box<crate::model::Retry>),
19428 /// Optional. Rolls back a `Rollout`.
19429 Rollback(std::boxed::Box<crate::model::Rollback>),
19430 }
19431}
19432
19433/// Retries the failed job.
19434#[derive(Clone, Default, PartialEq)]
19435#[non_exhaustive]
19436pub struct Retry {
19437 /// Required. Total number of retries. Retry is skipped if set to 0; The
19438 /// minimum value is 1, and the maximum value is 10.
19439 pub attempts: i64,
19440
19441 /// Optional. How long to wait for the first retry. Default is 0, and the
19442 /// maximum value is 14d.
19443 pub wait: std::option::Option<wkt::Duration>,
19444
19445 /// Optional. The pattern of how wait time will be increased. Default is
19446 /// linear. Backoff mode will be ignored if `wait` is 0.
19447 pub backoff_mode: crate::model::BackoffMode,
19448
19449 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19450}
19451
19452impl Retry {
19453 pub fn new() -> Self {
19454 std::default::Default::default()
19455 }
19456
19457 /// Sets the value of [attempts][crate::model::Retry::attempts].
19458 ///
19459 /// # Example
19460 /// ```ignore,no_run
19461 /// # use google_cloud_deploy_v1::model::Retry;
19462 /// let x = Retry::new().set_attempts(42);
19463 /// ```
19464 pub fn set_attempts<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
19465 self.attempts = v.into();
19466 self
19467 }
19468
19469 /// Sets the value of [wait][crate::model::Retry::wait].
19470 ///
19471 /// # Example
19472 /// ```ignore,no_run
19473 /// # use google_cloud_deploy_v1::model::Retry;
19474 /// use wkt::Duration;
19475 /// let x = Retry::new().set_wait(Duration::default()/* use setters */);
19476 /// ```
19477 pub fn set_wait<T>(mut self, v: T) -> Self
19478 where
19479 T: std::convert::Into<wkt::Duration>,
19480 {
19481 self.wait = std::option::Option::Some(v.into());
19482 self
19483 }
19484
19485 /// Sets or clears the value of [wait][crate::model::Retry::wait].
19486 ///
19487 /// # Example
19488 /// ```ignore,no_run
19489 /// # use google_cloud_deploy_v1::model::Retry;
19490 /// use wkt::Duration;
19491 /// let x = Retry::new().set_or_clear_wait(Some(Duration::default()/* use setters */));
19492 /// let x = Retry::new().set_or_clear_wait(None::<Duration>);
19493 /// ```
19494 pub fn set_or_clear_wait<T>(mut self, v: std::option::Option<T>) -> Self
19495 where
19496 T: std::convert::Into<wkt::Duration>,
19497 {
19498 self.wait = v.map(|x| x.into());
19499 self
19500 }
19501
19502 /// Sets the value of [backoff_mode][crate::model::Retry::backoff_mode].
19503 ///
19504 /// # Example
19505 /// ```ignore,no_run
19506 /// # use google_cloud_deploy_v1::model::Retry;
19507 /// use google_cloud_deploy_v1::model::BackoffMode;
19508 /// let x0 = Retry::new().set_backoff_mode(BackoffMode::Linear);
19509 /// let x1 = Retry::new().set_backoff_mode(BackoffMode::Exponential);
19510 /// ```
19511 pub fn set_backoff_mode<T: std::convert::Into<crate::model::BackoffMode>>(
19512 mut self,
19513 v: T,
19514 ) -> Self {
19515 self.backoff_mode = v.into();
19516 self
19517 }
19518}
19519
19520impl wkt::message::Message for Retry {
19521 fn typename() -> &'static str {
19522 "type.googleapis.com/google.cloud.deploy.v1.Retry"
19523 }
19524}
19525
19526/// Rolls back a `Rollout`.
19527#[derive(Clone, Default, PartialEq)]
19528#[non_exhaustive]
19529pub struct Rollback {
19530 /// Optional. The starting phase ID for the `Rollout`. If unspecified, the
19531 /// `Rollout` will start in the stable phase.
19532 pub destination_phase: std::string::String,
19533
19534 /// Optional. If pending rollout exists on the target, the rollback operation
19535 /// will be aborted.
19536 pub disable_rollback_if_rollout_pending: bool,
19537
19538 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19539}
19540
19541impl Rollback {
19542 pub fn new() -> Self {
19543 std::default::Default::default()
19544 }
19545
19546 /// Sets the value of [destination_phase][crate::model::Rollback::destination_phase].
19547 ///
19548 /// # Example
19549 /// ```ignore,no_run
19550 /// # use google_cloud_deploy_v1::model::Rollback;
19551 /// let x = Rollback::new().set_destination_phase("example");
19552 /// ```
19553 pub fn set_destination_phase<T: std::convert::Into<std::string::String>>(
19554 mut self,
19555 v: T,
19556 ) -> Self {
19557 self.destination_phase = v.into();
19558 self
19559 }
19560
19561 /// Sets the value of [disable_rollback_if_rollout_pending][crate::model::Rollback::disable_rollback_if_rollout_pending].
19562 ///
19563 /// # Example
19564 /// ```ignore,no_run
19565 /// # use google_cloud_deploy_v1::model::Rollback;
19566 /// let x = Rollback::new().set_disable_rollback_if_rollout_pending(true);
19567 /// ```
19568 pub fn set_disable_rollback_if_rollout_pending<T: std::convert::Into<bool>>(
19569 mut self,
19570 v: T,
19571 ) -> Self {
19572 self.disable_rollback_if_rollout_pending = v.into();
19573 self
19574 }
19575}
19576
19577impl wkt::message::Message for Rollback {
19578 fn typename() -> &'static str {
19579 "type.googleapis.com/google.cloud.deploy.v1.Rollback"
19580 }
19581}
19582
19583/// `AutomationRuleCondition` contains conditions relevant to an
19584/// `Automation` rule.
19585#[derive(Clone, Default, PartialEq)]
19586#[non_exhaustive]
19587pub struct AutomationRuleCondition {
19588 /// Optional. Details around targets enumerated in the rule.
19589 pub targets_present_condition: std::option::Option<crate::model::TargetsPresentCondition>,
19590
19591 /// Details specific to the automation rule type.
19592 pub rule_type_condition:
19593 std::option::Option<crate::model::automation_rule_condition::RuleTypeCondition>,
19594
19595 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19596}
19597
19598impl AutomationRuleCondition {
19599 pub fn new() -> Self {
19600 std::default::Default::default()
19601 }
19602
19603 /// Sets the value of [targets_present_condition][crate::model::AutomationRuleCondition::targets_present_condition].
19604 ///
19605 /// # Example
19606 /// ```ignore,no_run
19607 /// # use google_cloud_deploy_v1::model::AutomationRuleCondition;
19608 /// use google_cloud_deploy_v1::model::TargetsPresentCondition;
19609 /// let x = AutomationRuleCondition::new().set_targets_present_condition(TargetsPresentCondition::default()/* use setters */);
19610 /// ```
19611 pub fn set_targets_present_condition<T>(mut self, v: T) -> Self
19612 where
19613 T: std::convert::Into<crate::model::TargetsPresentCondition>,
19614 {
19615 self.targets_present_condition = std::option::Option::Some(v.into());
19616 self
19617 }
19618
19619 /// Sets or clears the value of [targets_present_condition][crate::model::AutomationRuleCondition::targets_present_condition].
19620 ///
19621 /// # Example
19622 /// ```ignore,no_run
19623 /// # use google_cloud_deploy_v1::model::AutomationRuleCondition;
19624 /// use google_cloud_deploy_v1::model::TargetsPresentCondition;
19625 /// let x = AutomationRuleCondition::new().set_or_clear_targets_present_condition(Some(TargetsPresentCondition::default()/* use setters */));
19626 /// let x = AutomationRuleCondition::new().set_or_clear_targets_present_condition(None::<TargetsPresentCondition>);
19627 /// ```
19628 pub fn set_or_clear_targets_present_condition<T>(mut self, v: std::option::Option<T>) -> Self
19629 where
19630 T: std::convert::Into<crate::model::TargetsPresentCondition>,
19631 {
19632 self.targets_present_condition = v.map(|x| x.into());
19633 self
19634 }
19635
19636 /// Sets the value of [rule_type_condition][crate::model::AutomationRuleCondition::rule_type_condition].
19637 ///
19638 /// Note that all the setters affecting `rule_type_condition` are mutually
19639 /// exclusive.
19640 ///
19641 /// # Example
19642 /// ```ignore,no_run
19643 /// # use google_cloud_deploy_v1::model::AutomationRuleCondition;
19644 /// use google_cloud_deploy_v1::model::TimedPromoteReleaseCondition;
19645 /// let x = AutomationRuleCondition::new().set_rule_type_condition(Some(
19646 /// google_cloud_deploy_v1::model::automation_rule_condition::RuleTypeCondition::TimedPromoteReleaseCondition(TimedPromoteReleaseCondition::default().into())));
19647 /// ```
19648 pub fn set_rule_type_condition<
19649 T: std::convert::Into<
19650 std::option::Option<crate::model::automation_rule_condition::RuleTypeCondition>,
19651 >,
19652 >(
19653 mut self,
19654 v: T,
19655 ) -> Self {
19656 self.rule_type_condition = v.into();
19657 self
19658 }
19659
19660 /// The value of [rule_type_condition][crate::model::AutomationRuleCondition::rule_type_condition]
19661 /// if it holds a `TimedPromoteReleaseCondition`, `None` if the field is not set or
19662 /// holds a different branch.
19663 pub fn timed_promote_release_condition(
19664 &self,
19665 ) -> std::option::Option<&std::boxed::Box<crate::model::TimedPromoteReleaseCondition>> {
19666 #[allow(unreachable_patterns)]
19667 self.rule_type_condition.as_ref().and_then(|v| match v {
19668 crate::model::automation_rule_condition::RuleTypeCondition::TimedPromoteReleaseCondition(v) => std::option::Option::Some(v),
19669 _ => std::option::Option::None,
19670 })
19671 }
19672
19673 /// Sets the value of [rule_type_condition][crate::model::AutomationRuleCondition::rule_type_condition]
19674 /// to hold a `TimedPromoteReleaseCondition`.
19675 ///
19676 /// Note that all the setters affecting `rule_type_condition` are
19677 /// mutually exclusive.
19678 ///
19679 /// # Example
19680 /// ```ignore,no_run
19681 /// # use google_cloud_deploy_v1::model::AutomationRuleCondition;
19682 /// use google_cloud_deploy_v1::model::TimedPromoteReleaseCondition;
19683 /// let x = AutomationRuleCondition::new().set_timed_promote_release_condition(TimedPromoteReleaseCondition::default()/* use setters */);
19684 /// assert!(x.timed_promote_release_condition().is_some());
19685 /// ```
19686 pub fn set_timed_promote_release_condition<
19687 T: std::convert::Into<std::boxed::Box<crate::model::TimedPromoteReleaseCondition>>,
19688 >(
19689 mut self,
19690 v: T,
19691 ) -> Self {
19692 self.rule_type_condition = std::option::Option::Some(
19693 crate::model::automation_rule_condition::RuleTypeCondition::TimedPromoteReleaseCondition(
19694 v.into()
19695 )
19696 );
19697 self
19698 }
19699}
19700
19701impl wkt::message::Message for AutomationRuleCondition {
19702 fn typename() -> &'static str {
19703 "type.googleapis.com/google.cloud.deploy.v1.AutomationRuleCondition"
19704 }
19705}
19706
19707/// Defines additional types related to [AutomationRuleCondition].
19708pub mod automation_rule_condition {
19709 #[allow(unused_imports)]
19710 use super::*;
19711
19712 /// Details specific to the automation rule type.
19713 #[derive(Clone, Debug, PartialEq)]
19714 #[non_exhaustive]
19715 pub enum RuleTypeCondition {
19716 /// Optional. TimedPromoteReleaseCondition contains rule conditions specific
19717 /// to a an Automation with a timed promote release rule defined.
19718 TimedPromoteReleaseCondition(std::boxed::Box<crate::model::TimedPromoteReleaseCondition>),
19719 }
19720}
19721
19722/// `TimedPromoteReleaseCondition` contains conditions specific to an Automation
19723/// with a Timed Promote Release rule defined.
19724#[derive(Clone, Default, PartialEq)]
19725#[non_exhaustive]
19726pub struct TimedPromoteReleaseCondition {
19727 /// Output only. When the next scheduled promotion(s) will occur.
19728 pub next_promotion_time: std::option::Option<wkt::Timestamp>,
19729
19730 /// Output only. A list of targets involved in the upcoming timed promotion(s).
19731 pub targets_list: std::vec::Vec<crate::model::timed_promote_release_condition::Targets>,
19732
19733 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19734}
19735
19736impl TimedPromoteReleaseCondition {
19737 pub fn new() -> Self {
19738 std::default::Default::default()
19739 }
19740
19741 /// Sets the value of [next_promotion_time][crate::model::TimedPromoteReleaseCondition::next_promotion_time].
19742 ///
19743 /// # Example
19744 /// ```ignore,no_run
19745 /// # use google_cloud_deploy_v1::model::TimedPromoteReleaseCondition;
19746 /// use wkt::Timestamp;
19747 /// let x = TimedPromoteReleaseCondition::new().set_next_promotion_time(Timestamp::default()/* use setters */);
19748 /// ```
19749 pub fn set_next_promotion_time<T>(mut self, v: T) -> Self
19750 where
19751 T: std::convert::Into<wkt::Timestamp>,
19752 {
19753 self.next_promotion_time = std::option::Option::Some(v.into());
19754 self
19755 }
19756
19757 /// Sets or clears the value of [next_promotion_time][crate::model::TimedPromoteReleaseCondition::next_promotion_time].
19758 ///
19759 /// # Example
19760 /// ```ignore,no_run
19761 /// # use google_cloud_deploy_v1::model::TimedPromoteReleaseCondition;
19762 /// use wkt::Timestamp;
19763 /// let x = TimedPromoteReleaseCondition::new().set_or_clear_next_promotion_time(Some(Timestamp::default()/* use setters */));
19764 /// let x = TimedPromoteReleaseCondition::new().set_or_clear_next_promotion_time(None::<Timestamp>);
19765 /// ```
19766 pub fn set_or_clear_next_promotion_time<T>(mut self, v: std::option::Option<T>) -> Self
19767 where
19768 T: std::convert::Into<wkt::Timestamp>,
19769 {
19770 self.next_promotion_time = v.map(|x| x.into());
19771 self
19772 }
19773
19774 /// Sets the value of [targets_list][crate::model::TimedPromoteReleaseCondition::targets_list].
19775 ///
19776 /// # Example
19777 /// ```ignore,no_run
19778 /// # use google_cloud_deploy_v1::model::TimedPromoteReleaseCondition;
19779 /// use google_cloud_deploy_v1::model::timed_promote_release_condition::Targets;
19780 /// let x = TimedPromoteReleaseCondition::new()
19781 /// .set_targets_list([
19782 /// Targets::default()/* use setters */,
19783 /// Targets::default()/* use (different) setters */,
19784 /// ]);
19785 /// ```
19786 pub fn set_targets_list<T, V>(mut self, v: T) -> Self
19787 where
19788 T: std::iter::IntoIterator<Item = V>,
19789 V: std::convert::Into<crate::model::timed_promote_release_condition::Targets>,
19790 {
19791 use std::iter::Iterator;
19792 self.targets_list = v.into_iter().map(|i| i.into()).collect();
19793 self
19794 }
19795}
19796
19797impl wkt::message::Message for TimedPromoteReleaseCondition {
19798 fn typename() -> &'static str {
19799 "type.googleapis.com/google.cloud.deploy.v1.TimedPromoteReleaseCondition"
19800 }
19801}
19802
19803/// Defines additional types related to [TimedPromoteReleaseCondition].
19804pub mod timed_promote_release_condition {
19805 #[allow(unused_imports)]
19806 use super::*;
19807
19808 /// The targets involved in a single timed promotion.
19809 #[derive(Clone, Default, PartialEq)]
19810 #[non_exhaustive]
19811 pub struct Targets {
19812 /// Optional. The source target ID.
19813 pub source_target_id: std::string::String,
19814
19815 /// Optional. The destination target ID.
19816 pub destination_target_id: std::string::String,
19817
19818 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19819 }
19820
19821 impl Targets {
19822 pub fn new() -> Self {
19823 std::default::Default::default()
19824 }
19825
19826 /// Sets the value of [source_target_id][crate::model::timed_promote_release_condition::Targets::source_target_id].
19827 ///
19828 /// # Example
19829 /// ```ignore,no_run
19830 /// # use google_cloud_deploy_v1::model::timed_promote_release_condition::Targets;
19831 /// let x = Targets::new().set_source_target_id("example");
19832 /// ```
19833 pub fn set_source_target_id<T: std::convert::Into<std::string::String>>(
19834 mut self,
19835 v: T,
19836 ) -> Self {
19837 self.source_target_id = v.into();
19838 self
19839 }
19840
19841 /// Sets the value of [destination_target_id][crate::model::timed_promote_release_condition::Targets::destination_target_id].
19842 ///
19843 /// # Example
19844 /// ```ignore,no_run
19845 /// # use google_cloud_deploy_v1::model::timed_promote_release_condition::Targets;
19846 /// let x = Targets::new().set_destination_target_id("example");
19847 /// ```
19848 pub fn set_destination_target_id<T: std::convert::Into<std::string::String>>(
19849 mut self,
19850 v: T,
19851 ) -> Self {
19852 self.destination_target_id = v.into();
19853 self
19854 }
19855 }
19856
19857 impl wkt::message::Message for Targets {
19858 fn typename() -> &'static str {
19859 "type.googleapis.com/google.cloud.deploy.v1.TimedPromoteReleaseCondition.Targets"
19860 }
19861 }
19862}
19863
19864/// The request object for `CreateAutomation`.
19865#[derive(Clone, Default, PartialEq)]
19866#[non_exhaustive]
19867pub struct CreateAutomationRequest {
19868 /// Required. The parent collection in which the `Automation` must be created.
19869 /// The format is
19870 /// `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}`.
19871 pub parent: std::string::String,
19872
19873 /// Required. ID of the `Automation`.
19874 pub automation_id: std::string::String,
19875
19876 /// Required. The `Automation` to create.
19877 pub automation: std::option::Option<crate::model::Automation>,
19878
19879 /// Optional. A request ID to identify requests. Specify a unique request ID
19880 /// so that if you must retry your request, the server knows to ignore the
19881 /// request if it has already been completed. The server guarantees that for
19882 /// at least 60 minutes after the first request.
19883 ///
19884 /// For example, consider a situation where you make an initial request and the
19885 /// request times out. If you make the request again with the same request ID,
19886 /// the server can check if original operation with the same request ID was
19887 /// received, and if so, will ignore the second request. This prevents clients
19888 /// from accidentally creating duplicate commitments.
19889 ///
19890 /// The request ID must be a valid UUID with the exception that zero UUID is
19891 /// not supported (00000000-0000-0000-0000-000000000000).
19892 pub request_id: std::string::String,
19893
19894 /// Optional. If set to true, the request is validated and the user is provided
19895 /// with an expected result, but no actual change is made.
19896 pub validate_only: bool,
19897
19898 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19899}
19900
19901impl CreateAutomationRequest {
19902 pub fn new() -> Self {
19903 std::default::Default::default()
19904 }
19905
19906 /// Sets the value of [parent][crate::model::CreateAutomationRequest::parent].
19907 ///
19908 /// # Example
19909 /// ```ignore,no_run
19910 /// # use google_cloud_deploy_v1::model::CreateAutomationRequest;
19911 /// let x = CreateAutomationRequest::new().set_parent("example");
19912 /// ```
19913 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19914 self.parent = v.into();
19915 self
19916 }
19917
19918 /// Sets the value of [automation_id][crate::model::CreateAutomationRequest::automation_id].
19919 ///
19920 /// # Example
19921 /// ```ignore,no_run
19922 /// # use google_cloud_deploy_v1::model::CreateAutomationRequest;
19923 /// let x = CreateAutomationRequest::new().set_automation_id("example");
19924 /// ```
19925 pub fn set_automation_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19926 self.automation_id = v.into();
19927 self
19928 }
19929
19930 /// Sets the value of [automation][crate::model::CreateAutomationRequest::automation].
19931 ///
19932 /// # Example
19933 /// ```ignore,no_run
19934 /// # use google_cloud_deploy_v1::model::CreateAutomationRequest;
19935 /// use google_cloud_deploy_v1::model::Automation;
19936 /// let x = CreateAutomationRequest::new().set_automation(Automation::default()/* use setters */);
19937 /// ```
19938 pub fn set_automation<T>(mut self, v: T) -> Self
19939 where
19940 T: std::convert::Into<crate::model::Automation>,
19941 {
19942 self.automation = std::option::Option::Some(v.into());
19943 self
19944 }
19945
19946 /// Sets or clears the value of [automation][crate::model::CreateAutomationRequest::automation].
19947 ///
19948 /// # Example
19949 /// ```ignore,no_run
19950 /// # use google_cloud_deploy_v1::model::CreateAutomationRequest;
19951 /// use google_cloud_deploy_v1::model::Automation;
19952 /// let x = CreateAutomationRequest::new().set_or_clear_automation(Some(Automation::default()/* use setters */));
19953 /// let x = CreateAutomationRequest::new().set_or_clear_automation(None::<Automation>);
19954 /// ```
19955 pub fn set_or_clear_automation<T>(mut self, v: std::option::Option<T>) -> Self
19956 where
19957 T: std::convert::Into<crate::model::Automation>,
19958 {
19959 self.automation = v.map(|x| x.into());
19960 self
19961 }
19962
19963 /// Sets the value of [request_id][crate::model::CreateAutomationRequest::request_id].
19964 ///
19965 /// # Example
19966 /// ```ignore,no_run
19967 /// # use google_cloud_deploy_v1::model::CreateAutomationRequest;
19968 /// let x = CreateAutomationRequest::new().set_request_id("example");
19969 /// ```
19970 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19971 self.request_id = v.into();
19972 self
19973 }
19974
19975 /// Sets the value of [validate_only][crate::model::CreateAutomationRequest::validate_only].
19976 ///
19977 /// # Example
19978 /// ```ignore,no_run
19979 /// # use google_cloud_deploy_v1::model::CreateAutomationRequest;
19980 /// let x = CreateAutomationRequest::new().set_validate_only(true);
19981 /// ```
19982 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
19983 self.validate_only = v.into();
19984 self
19985 }
19986}
19987
19988impl wkt::message::Message for CreateAutomationRequest {
19989 fn typename() -> &'static str {
19990 "type.googleapis.com/google.cloud.deploy.v1.CreateAutomationRequest"
19991 }
19992}
19993
19994/// The request object for `UpdateAutomation`.
19995#[derive(Clone, Default, PartialEq)]
19996#[non_exhaustive]
19997pub struct UpdateAutomationRequest {
19998 /// Required. Field mask is used to specify the fields to be overwritten by the
19999 /// update in the `Automation` resource. The fields specified in the
20000 /// update_mask are relative to the resource, not the full request. A field
20001 /// will be overwritten if it's in the mask. If the user doesn't provide a mask
20002 /// then all fields are overwritten.
20003 pub update_mask: std::option::Option<wkt::FieldMask>,
20004
20005 /// Required. The `Automation` to update.
20006 pub automation: std::option::Option<crate::model::Automation>,
20007
20008 /// Optional. A request ID to identify requests. Specify a unique request ID
20009 /// so that if you must retry your request, the server knows to ignore the
20010 /// request if it has already been completed. The server guarantees that for
20011 /// at least 60 minutes after the first request.
20012 ///
20013 /// For example, consider a situation where you make an initial request and the
20014 /// request times out. If you make the request again with the same request ID,
20015 /// the server can check if original operation with the same request ID was
20016 /// received, and if so, will ignore the second request. This prevents clients
20017 /// from accidentally creating duplicate commitments.
20018 ///
20019 /// The request ID must be a valid UUID with the exception that zero UUID is
20020 /// not supported (00000000-0000-0000-0000-000000000000).
20021 pub request_id: std::string::String,
20022
20023 /// Optional. If set to true, updating a `Automation` that does not exist will
20024 /// result in the creation of a new `Automation`.
20025 pub allow_missing: bool,
20026
20027 /// Optional. If set to true, the request is validated and the user is provided
20028 /// with an expected result, but no actual change is made.
20029 pub validate_only: bool,
20030
20031 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20032}
20033
20034impl UpdateAutomationRequest {
20035 pub fn new() -> Self {
20036 std::default::Default::default()
20037 }
20038
20039 /// Sets the value of [update_mask][crate::model::UpdateAutomationRequest::update_mask].
20040 ///
20041 /// # Example
20042 /// ```ignore,no_run
20043 /// # use google_cloud_deploy_v1::model::UpdateAutomationRequest;
20044 /// use wkt::FieldMask;
20045 /// let x = UpdateAutomationRequest::new().set_update_mask(FieldMask::default()/* use setters */);
20046 /// ```
20047 pub fn set_update_mask<T>(mut self, v: T) -> Self
20048 where
20049 T: std::convert::Into<wkt::FieldMask>,
20050 {
20051 self.update_mask = std::option::Option::Some(v.into());
20052 self
20053 }
20054
20055 /// Sets or clears the value of [update_mask][crate::model::UpdateAutomationRequest::update_mask].
20056 ///
20057 /// # Example
20058 /// ```ignore,no_run
20059 /// # use google_cloud_deploy_v1::model::UpdateAutomationRequest;
20060 /// use wkt::FieldMask;
20061 /// let x = UpdateAutomationRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
20062 /// let x = UpdateAutomationRequest::new().set_or_clear_update_mask(None::<FieldMask>);
20063 /// ```
20064 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
20065 where
20066 T: std::convert::Into<wkt::FieldMask>,
20067 {
20068 self.update_mask = v.map(|x| x.into());
20069 self
20070 }
20071
20072 /// Sets the value of [automation][crate::model::UpdateAutomationRequest::automation].
20073 ///
20074 /// # Example
20075 /// ```ignore,no_run
20076 /// # use google_cloud_deploy_v1::model::UpdateAutomationRequest;
20077 /// use google_cloud_deploy_v1::model::Automation;
20078 /// let x = UpdateAutomationRequest::new().set_automation(Automation::default()/* use setters */);
20079 /// ```
20080 pub fn set_automation<T>(mut self, v: T) -> Self
20081 where
20082 T: std::convert::Into<crate::model::Automation>,
20083 {
20084 self.automation = std::option::Option::Some(v.into());
20085 self
20086 }
20087
20088 /// Sets or clears the value of [automation][crate::model::UpdateAutomationRequest::automation].
20089 ///
20090 /// # Example
20091 /// ```ignore,no_run
20092 /// # use google_cloud_deploy_v1::model::UpdateAutomationRequest;
20093 /// use google_cloud_deploy_v1::model::Automation;
20094 /// let x = UpdateAutomationRequest::new().set_or_clear_automation(Some(Automation::default()/* use setters */));
20095 /// let x = UpdateAutomationRequest::new().set_or_clear_automation(None::<Automation>);
20096 /// ```
20097 pub fn set_or_clear_automation<T>(mut self, v: std::option::Option<T>) -> Self
20098 where
20099 T: std::convert::Into<crate::model::Automation>,
20100 {
20101 self.automation = v.map(|x| x.into());
20102 self
20103 }
20104
20105 /// Sets the value of [request_id][crate::model::UpdateAutomationRequest::request_id].
20106 ///
20107 /// # Example
20108 /// ```ignore,no_run
20109 /// # use google_cloud_deploy_v1::model::UpdateAutomationRequest;
20110 /// let x = UpdateAutomationRequest::new().set_request_id("example");
20111 /// ```
20112 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20113 self.request_id = v.into();
20114 self
20115 }
20116
20117 /// Sets the value of [allow_missing][crate::model::UpdateAutomationRequest::allow_missing].
20118 ///
20119 /// # Example
20120 /// ```ignore,no_run
20121 /// # use google_cloud_deploy_v1::model::UpdateAutomationRequest;
20122 /// let x = UpdateAutomationRequest::new().set_allow_missing(true);
20123 /// ```
20124 pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
20125 self.allow_missing = v.into();
20126 self
20127 }
20128
20129 /// Sets the value of [validate_only][crate::model::UpdateAutomationRequest::validate_only].
20130 ///
20131 /// # Example
20132 /// ```ignore,no_run
20133 /// # use google_cloud_deploy_v1::model::UpdateAutomationRequest;
20134 /// let x = UpdateAutomationRequest::new().set_validate_only(true);
20135 /// ```
20136 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
20137 self.validate_only = v.into();
20138 self
20139 }
20140}
20141
20142impl wkt::message::Message for UpdateAutomationRequest {
20143 fn typename() -> &'static str {
20144 "type.googleapis.com/google.cloud.deploy.v1.UpdateAutomationRequest"
20145 }
20146}
20147
20148/// The request object for `DeleteAutomation`.
20149#[derive(Clone, Default, PartialEq)]
20150#[non_exhaustive]
20151pub struct DeleteAutomationRequest {
20152 /// Required. The name of the `Automation` to delete. The format is
20153 /// `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/automations/{automation_name}`.
20154 pub name: std::string::String,
20155
20156 /// Optional. A request ID to identify requests. Specify a unique request ID
20157 /// so that if you must retry your request, the server knows to ignore the
20158 /// request if it has already been completed. The server guarantees that for
20159 /// at least 60 minutes after the first request.
20160 ///
20161 /// For example, consider a situation where you make an initial request and the
20162 /// request times out. If you make the request again with the same request ID,
20163 /// the server can check if original operation with the same request ID was
20164 /// received, and if so, will ignore the second request. This prevents clients
20165 /// from accidentally creating duplicate commitments.
20166 ///
20167 /// The request ID must be a valid UUID with the exception that zero UUID is
20168 /// not supported (00000000-0000-0000-0000-000000000000).
20169 pub request_id: std::string::String,
20170
20171 /// Optional. If set to true, then deleting an already deleted or non-existing
20172 /// `Automation` will succeed.
20173 pub allow_missing: bool,
20174
20175 /// Optional. If set, validate the request and verify whether the resource
20176 /// exists, but do not actually post it.
20177 pub validate_only: bool,
20178
20179 /// Optional. The weak etag of the request.
20180 /// This checksum is computed by the server based on the value of other
20181 /// fields, and may be sent on update and delete requests to ensure the
20182 /// client has an up-to-date value before proceeding.
20183 pub etag: std::string::String,
20184
20185 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20186}
20187
20188impl DeleteAutomationRequest {
20189 pub fn new() -> Self {
20190 std::default::Default::default()
20191 }
20192
20193 /// Sets the value of [name][crate::model::DeleteAutomationRequest::name].
20194 ///
20195 /// # Example
20196 /// ```ignore,no_run
20197 /// # use google_cloud_deploy_v1::model::DeleteAutomationRequest;
20198 /// let x = DeleteAutomationRequest::new().set_name("example");
20199 /// ```
20200 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20201 self.name = v.into();
20202 self
20203 }
20204
20205 /// Sets the value of [request_id][crate::model::DeleteAutomationRequest::request_id].
20206 ///
20207 /// # Example
20208 /// ```ignore,no_run
20209 /// # use google_cloud_deploy_v1::model::DeleteAutomationRequest;
20210 /// let x = DeleteAutomationRequest::new().set_request_id("example");
20211 /// ```
20212 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20213 self.request_id = v.into();
20214 self
20215 }
20216
20217 /// Sets the value of [allow_missing][crate::model::DeleteAutomationRequest::allow_missing].
20218 ///
20219 /// # Example
20220 /// ```ignore,no_run
20221 /// # use google_cloud_deploy_v1::model::DeleteAutomationRequest;
20222 /// let x = DeleteAutomationRequest::new().set_allow_missing(true);
20223 /// ```
20224 pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
20225 self.allow_missing = v.into();
20226 self
20227 }
20228
20229 /// Sets the value of [validate_only][crate::model::DeleteAutomationRequest::validate_only].
20230 ///
20231 /// # Example
20232 /// ```ignore,no_run
20233 /// # use google_cloud_deploy_v1::model::DeleteAutomationRequest;
20234 /// let x = DeleteAutomationRequest::new().set_validate_only(true);
20235 /// ```
20236 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
20237 self.validate_only = v.into();
20238 self
20239 }
20240
20241 /// Sets the value of [etag][crate::model::DeleteAutomationRequest::etag].
20242 ///
20243 /// # Example
20244 /// ```ignore,no_run
20245 /// # use google_cloud_deploy_v1::model::DeleteAutomationRequest;
20246 /// let x = DeleteAutomationRequest::new().set_etag("example");
20247 /// ```
20248 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20249 self.etag = v.into();
20250 self
20251 }
20252}
20253
20254impl wkt::message::Message for DeleteAutomationRequest {
20255 fn typename() -> &'static str {
20256 "type.googleapis.com/google.cloud.deploy.v1.DeleteAutomationRequest"
20257 }
20258}
20259
20260/// The request object for `ListAutomations`.
20261#[derive(Clone, Default, PartialEq)]
20262#[non_exhaustive]
20263pub struct ListAutomationsRequest {
20264 /// Required. The parent `Delivery Pipeline`, which owns this collection of
20265 /// automations. Format must be
20266 /// `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}`.
20267 pub parent: std::string::String,
20268
20269 /// The maximum number of automations to return. The service may return
20270 /// fewer than this value. If unspecified, at most 50 automations will
20271 /// be returned. The maximum value is 1000; values above 1000 will be set
20272 /// to 1000.
20273 pub page_size: i32,
20274
20275 /// A page token, received from a previous `ListAutomations` call.
20276 /// Provide this to retrieve the subsequent page.
20277 ///
20278 /// When paginating, all other provided parameters match
20279 /// the call that provided the page token.
20280 pub page_token: std::string::String,
20281
20282 /// Filter automations to be returned. All fields can be used in the
20283 /// filter.
20284 pub filter: std::string::String,
20285
20286 /// Field to sort by.
20287 pub order_by: std::string::String,
20288
20289 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20290}
20291
20292impl ListAutomationsRequest {
20293 pub fn new() -> Self {
20294 std::default::Default::default()
20295 }
20296
20297 /// Sets the value of [parent][crate::model::ListAutomationsRequest::parent].
20298 ///
20299 /// # Example
20300 /// ```ignore,no_run
20301 /// # use google_cloud_deploy_v1::model::ListAutomationsRequest;
20302 /// let x = ListAutomationsRequest::new().set_parent("example");
20303 /// ```
20304 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20305 self.parent = v.into();
20306 self
20307 }
20308
20309 /// Sets the value of [page_size][crate::model::ListAutomationsRequest::page_size].
20310 ///
20311 /// # Example
20312 /// ```ignore,no_run
20313 /// # use google_cloud_deploy_v1::model::ListAutomationsRequest;
20314 /// let x = ListAutomationsRequest::new().set_page_size(42);
20315 /// ```
20316 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
20317 self.page_size = v.into();
20318 self
20319 }
20320
20321 /// Sets the value of [page_token][crate::model::ListAutomationsRequest::page_token].
20322 ///
20323 /// # Example
20324 /// ```ignore,no_run
20325 /// # use google_cloud_deploy_v1::model::ListAutomationsRequest;
20326 /// let x = ListAutomationsRequest::new().set_page_token("example");
20327 /// ```
20328 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20329 self.page_token = v.into();
20330 self
20331 }
20332
20333 /// Sets the value of [filter][crate::model::ListAutomationsRequest::filter].
20334 ///
20335 /// # Example
20336 /// ```ignore,no_run
20337 /// # use google_cloud_deploy_v1::model::ListAutomationsRequest;
20338 /// let x = ListAutomationsRequest::new().set_filter("example");
20339 /// ```
20340 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20341 self.filter = v.into();
20342 self
20343 }
20344
20345 /// Sets the value of [order_by][crate::model::ListAutomationsRequest::order_by].
20346 ///
20347 /// # Example
20348 /// ```ignore,no_run
20349 /// # use google_cloud_deploy_v1::model::ListAutomationsRequest;
20350 /// let x = ListAutomationsRequest::new().set_order_by("example");
20351 /// ```
20352 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20353 self.order_by = v.into();
20354 self
20355 }
20356}
20357
20358impl wkt::message::Message for ListAutomationsRequest {
20359 fn typename() -> &'static str {
20360 "type.googleapis.com/google.cloud.deploy.v1.ListAutomationsRequest"
20361 }
20362}
20363
20364/// The response object from `ListAutomations`.
20365#[derive(Clone, Default, PartialEq)]
20366#[non_exhaustive]
20367pub struct ListAutomationsResponse {
20368 /// The `Automation` objects.
20369 pub automations: std::vec::Vec<crate::model::Automation>,
20370
20371 /// A token, which can be sent as `page_token` to retrieve the next page.
20372 /// If this field is omitted, there are no subsequent pages.
20373 pub next_page_token: std::string::String,
20374
20375 /// Locations that could not be reached.
20376 pub unreachable: std::vec::Vec<std::string::String>,
20377
20378 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20379}
20380
20381impl ListAutomationsResponse {
20382 pub fn new() -> Self {
20383 std::default::Default::default()
20384 }
20385
20386 /// Sets the value of [automations][crate::model::ListAutomationsResponse::automations].
20387 ///
20388 /// # Example
20389 /// ```ignore,no_run
20390 /// # use google_cloud_deploy_v1::model::ListAutomationsResponse;
20391 /// use google_cloud_deploy_v1::model::Automation;
20392 /// let x = ListAutomationsResponse::new()
20393 /// .set_automations([
20394 /// Automation::default()/* use setters */,
20395 /// Automation::default()/* use (different) setters */,
20396 /// ]);
20397 /// ```
20398 pub fn set_automations<T, V>(mut self, v: T) -> Self
20399 where
20400 T: std::iter::IntoIterator<Item = V>,
20401 V: std::convert::Into<crate::model::Automation>,
20402 {
20403 use std::iter::Iterator;
20404 self.automations = v.into_iter().map(|i| i.into()).collect();
20405 self
20406 }
20407
20408 /// Sets the value of [next_page_token][crate::model::ListAutomationsResponse::next_page_token].
20409 ///
20410 /// # Example
20411 /// ```ignore,no_run
20412 /// # use google_cloud_deploy_v1::model::ListAutomationsResponse;
20413 /// let x = ListAutomationsResponse::new().set_next_page_token("example");
20414 /// ```
20415 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20416 self.next_page_token = v.into();
20417 self
20418 }
20419
20420 /// Sets the value of [unreachable][crate::model::ListAutomationsResponse::unreachable].
20421 ///
20422 /// # Example
20423 /// ```ignore,no_run
20424 /// # use google_cloud_deploy_v1::model::ListAutomationsResponse;
20425 /// let x = ListAutomationsResponse::new().set_unreachable(["a", "b", "c"]);
20426 /// ```
20427 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
20428 where
20429 T: std::iter::IntoIterator<Item = V>,
20430 V: std::convert::Into<std::string::String>,
20431 {
20432 use std::iter::Iterator;
20433 self.unreachable = v.into_iter().map(|i| i.into()).collect();
20434 self
20435 }
20436}
20437
20438impl wkt::message::Message for ListAutomationsResponse {
20439 fn typename() -> &'static str {
20440 "type.googleapis.com/google.cloud.deploy.v1.ListAutomationsResponse"
20441 }
20442}
20443
20444#[doc(hidden)]
20445impl google_cloud_gax::paginator::internal::PageableResponse for ListAutomationsResponse {
20446 type PageItem = crate::model::Automation;
20447
20448 fn items(self) -> std::vec::Vec<Self::PageItem> {
20449 self.automations
20450 }
20451
20452 fn next_page_token(&self) -> std::string::String {
20453 use std::clone::Clone;
20454 self.next_page_token.clone()
20455 }
20456}
20457
20458/// The request object for `GetAutomation`
20459#[derive(Clone, Default, PartialEq)]
20460#[non_exhaustive]
20461pub struct GetAutomationRequest {
20462 /// Required. Name of the `Automation`. Format must be
20463 /// `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/automations/{automation_name}`.
20464 pub name: std::string::String,
20465
20466 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20467}
20468
20469impl GetAutomationRequest {
20470 pub fn new() -> Self {
20471 std::default::Default::default()
20472 }
20473
20474 /// Sets the value of [name][crate::model::GetAutomationRequest::name].
20475 ///
20476 /// # Example
20477 /// ```ignore,no_run
20478 /// # use google_cloud_deploy_v1::model::GetAutomationRequest;
20479 /// let x = GetAutomationRequest::new().set_name("example");
20480 /// ```
20481 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20482 self.name = v.into();
20483 self
20484 }
20485}
20486
20487impl wkt::message::Message for GetAutomationRequest {
20488 fn typename() -> &'static str {
20489 "type.googleapis.com/google.cloud.deploy.v1.GetAutomationRequest"
20490 }
20491}
20492
20493/// An `AutomationRun` resource in the Cloud Deploy API.
20494///
20495/// An `AutomationRun` represents an execution instance of an
20496/// automation rule.
20497#[derive(Clone, Default, PartialEq)]
20498#[non_exhaustive]
20499pub struct AutomationRun {
20500 /// Output only. Name of the `AutomationRun`. Format is
20501 /// `projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/automationRuns/{automation_run}`.
20502 pub name: std::string::String,
20503
20504 /// Output only. Time at which the `AutomationRun` was created.
20505 pub create_time: std::option::Option<wkt::Timestamp>,
20506
20507 /// Output only. Time at which the automationRun was updated.
20508 pub update_time: std::option::Option<wkt::Timestamp>,
20509
20510 /// Output only. The weak etag of the `AutomationRun` resource.
20511 /// This checksum is computed by the server based on the value of other
20512 /// fields, and may be sent on update and delete requests to ensure the
20513 /// client has an up-to-date value before proceeding.
20514 pub etag: std::string::String,
20515
20516 /// Output only. Email address of the user-managed IAM service account that
20517 /// performs the operations against Cloud Deploy resources.
20518 pub service_account: std::string::String,
20519
20520 /// Output only. Snapshot of the Automation taken at AutomationRun creation
20521 /// time.
20522 pub automation_snapshot: std::option::Option<crate::model::Automation>,
20523
20524 /// Output only. The ID of the source target that initiates the
20525 /// `AutomationRun`. The value of this field is the last segment of a target
20526 /// name.
20527 pub target_id: std::string::String,
20528
20529 /// Output only. Current state of the `AutomationRun`.
20530 pub state: crate::model::automation_run::State,
20531
20532 /// Output only. Explains the current state of the `AutomationRun`. Present
20533 /// only when an explanation is needed.
20534 pub state_description: std::string::String,
20535
20536 /// Output only. Contains information about what policies prevented the
20537 /// `AutomationRun` from proceeding.
20538 pub policy_violation: std::option::Option<crate::model::PolicyViolation>,
20539
20540 /// Output only. Time the `AutomationRun` expires. An `AutomationRun` expires
20541 /// after 14 days from its creation date.
20542 pub expire_time: std::option::Option<wkt::Timestamp>,
20543
20544 /// Output only. The ID of the automation rule that initiated the operation.
20545 pub rule_id: std::string::String,
20546
20547 /// Output only. The ID of the automation that initiated the operation.
20548 pub automation_id: std::string::String,
20549
20550 /// Output only. Earliest time the `AutomationRun` will attempt to resume.
20551 /// Wait-time is configured by `wait` in automation rule.
20552 pub wait_until_time: std::option::Option<wkt::Timestamp>,
20553
20554 /// The operation that the `AutomationRun` will perform.
20555 pub operation: std::option::Option<crate::model::automation_run::Operation>,
20556
20557 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20558}
20559
20560impl AutomationRun {
20561 pub fn new() -> Self {
20562 std::default::Default::default()
20563 }
20564
20565 /// Sets the value of [name][crate::model::AutomationRun::name].
20566 ///
20567 /// # Example
20568 /// ```ignore,no_run
20569 /// # use google_cloud_deploy_v1::model::AutomationRun;
20570 /// let x = AutomationRun::new().set_name("example");
20571 /// ```
20572 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20573 self.name = v.into();
20574 self
20575 }
20576
20577 /// Sets the value of [create_time][crate::model::AutomationRun::create_time].
20578 ///
20579 /// # Example
20580 /// ```ignore,no_run
20581 /// # use google_cloud_deploy_v1::model::AutomationRun;
20582 /// use wkt::Timestamp;
20583 /// let x = AutomationRun::new().set_create_time(Timestamp::default()/* use setters */);
20584 /// ```
20585 pub fn set_create_time<T>(mut self, v: T) -> Self
20586 where
20587 T: std::convert::Into<wkt::Timestamp>,
20588 {
20589 self.create_time = std::option::Option::Some(v.into());
20590 self
20591 }
20592
20593 /// Sets or clears the value of [create_time][crate::model::AutomationRun::create_time].
20594 ///
20595 /// # Example
20596 /// ```ignore,no_run
20597 /// # use google_cloud_deploy_v1::model::AutomationRun;
20598 /// use wkt::Timestamp;
20599 /// let x = AutomationRun::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
20600 /// let x = AutomationRun::new().set_or_clear_create_time(None::<Timestamp>);
20601 /// ```
20602 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
20603 where
20604 T: std::convert::Into<wkt::Timestamp>,
20605 {
20606 self.create_time = v.map(|x| x.into());
20607 self
20608 }
20609
20610 /// Sets the value of [update_time][crate::model::AutomationRun::update_time].
20611 ///
20612 /// # Example
20613 /// ```ignore,no_run
20614 /// # use google_cloud_deploy_v1::model::AutomationRun;
20615 /// use wkt::Timestamp;
20616 /// let x = AutomationRun::new().set_update_time(Timestamp::default()/* use setters */);
20617 /// ```
20618 pub fn set_update_time<T>(mut self, v: T) -> Self
20619 where
20620 T: std::convert::Into<wkt::Timestamp>,
20621 {
20622 self.update_time = std::option::Option::Some(v.into());
20623 self
20624 }
20625
20626 /// Sets or clears the value of [update_time][crate::model::AutomationRun::update_time].
20627 ///
20628 /// # Example
20629 /// ```ignore,no_run
20630 /// # use google_cloud_deploy_v1::model::AutomationRun;
20631 /// use wkt::Timestamp;
20632 /// let x = AutomationRun::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
20633 /// let x = AutomationRun::new().set_or_clear_update_time(None::<Timestamp>);
20634 /// ```
20635 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
20636 where
20637 T: std::convert::Into<wkt::Timestamp>,
20638 {
20639 self.update_time = v.map(|x| x.into());
20640 self
20641 }
20642
20643 /// Sets the value of [etag][crate::model::AutomationRun::etag].
20644 ///
20645 /// # Example
20646 /// ```ignore,no_run
20647 /// # use google_cloud_deploy_v1::model::AutomationRun;
20648 /// let x = AutomationRun::new().set_etag("example");
20649 /// ```
20650 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20651 self.etag = v.into();
20652 self
20653 }
20654
20655 /// Sets the value of [service_account][crate::model::AutomationRun::service_account].
20656 ///
20657 /// # Example
20658 /// ```ignore,no_run
20659 /// # use google_cloud_deploy_v1::model::AutomationRun;
20660 /// let x = AutomationRun::new().set_service_account("example");
20661 /// ```
20662 pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20663 self.service_account = v.into();
20664 self
20665 }
20666
20667 /// Sets the value of [automation_snapshot][crate::model::AutomationRun::automation_snapshot].
20668 ///
20669 /// # Example
20670 /// ```ignore,no_run
20671 /// # use google_cloud_deploy_v1::model::AutomationRun;
20672 /// use google_cloud_deploy_v1::model::Automation;
20673 /// let x = AutomationRun::new().set_automation_snapshot(Automation::default()/* use setters */);
20674 /// ```
20675 pub fn set_automation_snapshot<T>(mut self, v: T) -> Self
20676 where
20677 T: std::convert::Into<crate::model::Automation>,
20678 {
20679 self.automation_snapshot = std::option::Option::Some(v.into());
20680 self
20681 }
20682
20683 /// Sets or clears the value of [automation_snapshot][crate::model::AutomationRun::automation_snapshot].
20684 ///
20685 /// # Example
20686 /// ```ignore,no_run
20687 /// # use google_cloud_deploy_v1::model::AutomationRun;
20688 /// use google_cloud_deploy_v1::model::Automation;
20689 /// let x = AutomationRun::new().set_or_clear_automation_snapshot(Some(Automation::default()/* use setters */));
20690 /// let x = AutomationRun::new().set_or_clear_automation_snapshot(None::<Automation>);
20691 /// ```
20692 pub fn set_or_clear_automation_snapshot<T>(mut self, v: std::option::Option<T>) -> Self
20693 where
20694 T: std::convert::Into<crate::model::Automation>,
20695 {
20696 self.automation_snapshot = v.map(|x| x.into());
20697 self
20698 }
20699
20700 /// Sets the value of [target_id][crate::model::AutomationRun::target_id].
20701 ///
20702 /// # Example
20703 /// ```ignore,no_run
20704 /// # use google_cloud_deploy_v1::model::AutomationRun;
20705 /// let x = AutomationRun::new().set_target_id("example");
20706 /// ```
20707 pub fn set_target_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20708 self.target_id = v.into();
20709 self
20710 }
20711
20712 /// Sets the value of [state][crate::model::AutomationRun::state].
20713 ///
20714 /// # Example
20715 /// ```ignore,no_run
20716 /// # use google_cloud_deploy_v1::model::AutomationRun;
20717 /// use google_cloud_deploy_v1::model::automation_run::State;
20718 /// let x0 = AutomationRun::new().set_state(State::Succeeded);
20719 /// let x1 = AutomationRun::new().set_state(State::Cancelled);
20720 /// let x2 = AutomationRun::new().set_state(State::Failed);
20721 /// ```
20722 pub fn set_state<T: std::convert::Into<crate::model::automation_run::State>>(
20723 mut self,
20724 v: T,
20725 ) -> Self {
20726 self.state = v.into();
20727 self
20728 }
20729
20730 /// Sets the value of [state_description][crate::model::AutomationRun::state_description].
20731 ///
20732 /// # Example
20733 /// ```ignore,no_run
20734 /// # use google_cloud_deploy_v1::model::AutomationRun;
20735 /// let x = AutomationRun::new().set_state_description("example");
20736 /// ```
20737 pub fn set_state_description<T: std::convert::Into<std::string::String>>(
20738 mut self,
20739 v: T,
20740 ) -> Self {
20741 self.state_description = v.into();
20742 self
20743 }
20744
20745 /// Sets the value of [policy_violation][crate::model::AutomationRun::policy_violation].
20746 ///
20747 /// # Example
20748 /// ```ignore,no_run
20749 /// # use google_cloud_deploy_v1::model::AutomationRun;
20750 /// use google_cloud_deploy_v1::model::PolicyViolation;
20751 /// let x = AutomationRun::new().set_policy_violation(PolicyViolation::default()/* use setters */);
20752 /// ```
20753 pub fn set_policy_violation<T>(mut self, v: T) -> Self
20754 where
20755 T: std::convert::Into<crate::model::PolicyViolation>,
20756 {
20757 self.policy_violation = std::option::Option::Some(v.into());
20758 self
20759 }
20760
20761 /// Sets or clears the value of [policy_violation][crate::model::AutomationRun::policy_violation].
20762 ///
20763 /// # Example
20764 /// ```ignore,no_run
20765 /// # use google_cloud_deploy_v1::model::AutomationRun;
20766 /// use google_cloud_deploy_v1::model::PolicyViolation;
20767 /// let x = AutomationRun::new().set_or_clear_policy_violation(Some(PolicyViolation::default()/* use setters */));
20768 /// let x = AutomationRun::new().set_or_clear_policy_violation(None::<PolicyViolation>);
20769 /// ```
20770 pub fn set_or_clear_policy_violation<T>(mut self, v: std::option::Option<T>) -> Self
20771 where
20772 T: std::convert::Into<crate::model::PolicyViolation>,
20773 {
20774 self.policy_violation = v.map(|x| x.into());
20775 self
20776 }
20777
20778 /// Sets the value of [expire_time][crate::model::AutomationRun::expire_time].
20779 ///
20780 /// # Example
20781 /// ```ignore,no_run
20782 /// # use google_cloud_deploy_v1::model::AutomationRun;
20783 /// use wkt::Timestamp;
20784 /// let x = AutomationRun::new().set_expire_time(Timestamp::default()/* use setters */);
20785 /// ```
20786 pub fn set_expire_time<T>(mut self, v: T) -> Self
20787 where
20788 T: std::convert::Into<wkt::Timestamp>,
20789 {
20790 self.expire_time = std::option::Option::Some(v.into());
20791 self
20792 }
20793
20794 /// Sets or clears the value of [expire_time][crate::model::AutomationRun::expire_time].
20795 ///
20796 /// # Example
20797 /// ```ignore,no_run
20798 /// # use google_cloud_deploy_v1::model::AutomationRun;
20799 /// use wkt::Timestamp;
20800 /// let x = AutomationRun::new().set_or_clear_expire_time(Some(Timestamp::default()/* use setters */));
20801 /// let x = AutomationRun::new().set_or_clear_expire_time(None::<Timestamp>);
20802 /// ```
20803 pub fn set_or_clear_expire_time<T>(mut self, v: std::option::Option<T>) -> Self
20804 where
20805 T: std::convert::Into<wkt::Timestamp>,
20806 {
20807 self.expire_time = v.map(|x| x.into());
20808 self
20809 }
20810
20811 /// Sets the value of [rule_id][crate::model::AutomationRun::rule_id].
20812 ///
20813 /// # Example
20814 /// ```ignore,no_run
20815 /// # use google_cloud_deploy_v1::model::AutomationRun;
20816 /// let x = AutomationRun::new().set_rule_id("example");
20817 /// ```
20818 pub fn set_rule_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20819 self.rule_id = v.into();
20820 self
20821 }
20822
20823 /// Sets the value of [automation_id][crate::model::AutomationRun::automation_id].
20824 ///
20825 /// # Example
20826 /// ```ignore,no_run
20827 /// # use google_cloud_deploy_v1::model::AutomationRun;
20828 /// let x = AutomationRun::new().set_automation_id("example");
20829 /// ```
20830 pub fn set_automation_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20831 self.automation_id = v.into();
20832 self
20833 }
20834
20835 /// Sets the value of [wait_until_time][crate::model::AutomationRun::wait_until_time].
20836 ///
20837 /// # Example
20838 /// ```ignore,no_run
20839 /// # use google_cloud_deploy_v1::model::AutomationRun;
20840 /// use wkt::Timestamp;
20841 /// let x = AutomationRun::new().set_wait_until_time(Timestamp::default()/* use setters */);
20842 /// ```
20843 pub fn set_wait_until_time<T>(mut self, v: T) -> Self
20844 where
20845 T: std::convert::Into<wkt::Timestamp>,
20846 {
20847 self.wait_until_time = std::option::Option::Some(v.into());
20848 self
20849 }
20850
20851 /// Sets or clears the value of [wait_until_time][crate::model::AutomationRun::wait_until_time].
20852 ///
20853 /// # Example
20854 /// ```ignore,no_run
20855 /// # use google_cloud_deploy_v1::model::AutomationRun;
20856 /// use wkt::Timestamp;
20857 /// let x = AutomationRun::new().set_or_clear_wait_until_time(Some(Timestamp::default()/* use setters */));
20858 /// let x = AutomationRun::new().set_or_clear_wait_until_time(None::<Timestamp>);
20859 /// ```
20860 pub fn set_or_clear_wait_until_time<T>(mut self, v: std::option::Option<T>) -> Self
20861 where
20862 T: std::convert::Into<wkt::Timestamp>,
20863 {
20864 self.wait_until_time = v.map(|x| x.into());
20865 self
20866 }
20867
20868 /// Sets the value of [operation][crate::model::AutomationRun::operation].
20869 ///
20870 /// Note that all the setters affecting `operation` are mutually
20871 /// exclusive.
20872 ///
20873 /// # Example
20874 /// ```ignore,no_run
20875 /// # use google_cloud_deploy_v1::model::AutomationRun;
20876 /// use google_cloud_deploy_v1::model::PromoteReleaseOperation;
20877 /// let x = AutomationRun::new().set_operation(Some(
20878 /// google_cloud_deploy_v1::model::automation_run::Operation::PromoteReleaseOperation(PromoteReleaseOperation::default().into())));
20879 /// ```
20880 pub fn set_operation<
20881 T: std::convert::Into<std::option::Option<crate::model::automation_run::Operation>>,
20882 >(
20883 mut self,
20884 v: T,
20885 ) -> Self {
20886 self.operation = v.into();
20887 self
20888 }
20889
20890 /// The value of [operation][crate::model::AutomationRun::operation]
20891 /// if it holds a `PromoteReleaseOperation`, `None` if the field is not set or
20892 /// holds a different branch.
20893 pub fn promote_release_operation(
20894 &self,
20895 ) -> std::option::Option<&std::boxed::Box<crate::model::PromoteReleaseOperation>> {
20896 #[allow(unreachable_patterns)]
20897 self.operation.as_ref().and_then(|v| match v {
20898 crate::model::automation_run::Operation::PromoteReleaseOperation(v) => {
20899 std::option::Option::Some(v)
20900 }
20901 _ => std::option::Option::None,
20902 })
20903 }
20904
20905 /// Sets the value of [operation][crate::model::AutomationRun::operation]
20906 /// to hold a `PromoteReleaseOperation`.
20907 ///
20908 /// Note that all the setters affecting `operation` are
20909 /// mutually exclusive.
20910 ///
20911 /// # Example
20912 /// ```ignore,no_run
20913 /// # use google_cloud_deploy_v1::model::AutomationRun;
20914 /// use google_cloud_deploy_v1::model::PromoteReleaseOperation;
20915 /// let x = AutomationRun::new().set_promote_release_operation(PromoteReleaseOperation::default()/* use setters */);
20916 /// assert!(x.promote_release_operation().is_some());
20917 /// assert!(x.advance_rollout_operation().is_none());
20918 /// assert!(x.repair_rollout_operation().is_none());
20919 /// assert!(x.timed_promote_release_operation().is_none());
20920 /// ```
20921 pub fn set_promote_release_operation<
20922 T: std::convert::Into<std::boxed::Box<crate::model::PromoteReleaseOperation>>,
20923 >(
20924 mut self,
20925 v: T,
20926 ) -> Self {
20927 self.operation = std::option::Option::Some(
20928 crate::model::automation_run::Operation::PromoteReleaseOperation(v.into()),
20929 );
20930 self
20931 }
20932
20933 /// The value of [operation][crate::model::AutomationRun::operation]
20934 /// if it holds a `AdvanceRolloutOperation`, `None` if the field is not set or
20935 /// holds a different branch.
20936 pub fn advance_rollout_operation(
20937 &self,
20938 ) -> std::option::Option<&std::boxed::Box<crate::model::AdvanceRolloutOperation>> {
20939 #[allow(unreachable_patterns)]
20940 self.operation.as_ref().and_then(|v| match v {
20941 crate::model::automation_run::Operation::AdvanceRolloutOperation(v) => {
20942 std::option::Option::Some(v)
20943 }
20944 _ => std::option::Option::None,
20945 })
20946 }
20947
20948 /// Sets the value of [operation][crate::model::AutomationRun::operation]
20949 /// to hold a `AdvanceRolloutOperation`.
20950 ///
20951 /// Note that all the setters affecting `operation` are
20952 /// mutually exclusive.
20953 ///
20954 /// # Example
20955 /// ```ignore,no_run
20956 /// # use google_cloud_deploy_v1::model::AutomationRun;
20957 /// use google_cloud_deploy_v1::model::AdvanceRolloutOperation;
20958 /// let x = AutomationRun::new().set_advance_rollout_operation(AdvanceRolloutOperation::default()/* use setters */);
20959 /// assert!(x.advance_rollout_operation().is_some());
20960 /// assert!(x.promote_release_operation().is_none());
20961 /// assert!(x.repair_rollout_operation().is_none());
20962 /// assert!(x.timed_promote_release_operation().is_none());
20963 /// ```
20964 pub fn set_advance_rollout_operation<
20965 T: std::convert::Into<std::boxed::Box<crate::model::AdvanceRolloutOperation>>,
20966 >(
20967 mut self,
20968 v: T,
20969 ) -> Self {
20970 self.operation = std::option::Option::Some(
20971 crate::model::automation_run::Operation::AdvanceRolloutOperation(v.into()),
20972 );
20973 self
20974 }
20975
20976 /// The value of [operation][crate::model::AutomationRun::operation]
20977 /// if it holds a `RepairRolloutOperation`, `None` if the field is not set or
20978 /// holds a different branch.
20979 pub fn repair_rollout_operation(
20980 &self,
20981 ) -> std::option::Option<&std::boxed::Box<crate::model::RepairRolloutOperation>> {
20982 #[allow(unreachable_patterns)]
20983 self.operation.as_ref().and_then(|v| match v {
20984 crate::model::automation_run::Operation::RepairRolloutOperation(v) => {
20985 std::option::Option::Some(v)
20986 }
20987 _ => std::option::Option::None,
20988 })
20989 }
20990
20991 /// Sets the value of [operation][crate::model::AutomationRun::operation]
20992 /// to hold a `RepairRolloutOperation`.
20993 ///
20994 /// Note that all the setters affecting `operation` are
20995 /// mutually exclusive.
20996 ///
20997 /// # Example
20998 /// ```ignore,no_run
20999 /// # use google_cloud_deploy_v1::model::AutomationRun;
21000 /// use google_cloud_deploy_v1::model::RepairRolloutOperation;
21001 /// let x = AutomationRun::new().set_repair_rollout_operation(RepairRolloutOperation::default()/* use setters */);
21002 /// assert!(x.repair_rollout_operation().is_some());
21003 /// assert!(x.promote_release_operation().is_none());
21004 /// assert!(x.advance_rollout_operation().is_none());
21005 /// assert!(x.timed_promote_release_operation().is_none());
21006 /// ```
21007 pub fn set_repair_rollout_operation<
21008 T: std::convert::Into<std::boxed::Box<crate::model::RepairRolloutOperation>>,
21009 >(
21010 mut self,
21011 v: T,
21012 ) -> Self {
21013 self.operation = std::option::Option::Some(
21014 crate::model::automation_run::Operation::RepairRolloutOperation(v.into()),
21015 );
21016 self
21017 }
21018
21019 /// The value of [operation][crate::model::AutomationRun::operation]
21020 /// if it holds a `TimedPromoteReleaseOperation`, `None` if the field is not set or
21021 /// holds a different branch.
21022 pub fn timed_promote_release_operation(
21023 &self,
21024 ) -> std::option::Option<&std::boxed::Box<crate::model::TimedPromoteReleaseOperation>> {
21025 #[allow(unreachable_patterns)]
21026 self.operation.as_ref().and_then(|v| match v {
21027 crate::model::automation_run::Operation::TimedPromoteReleaseOperation(v) => {
21028 std::option::Option::Some(v)
21029 }
21030 _ => std::option::Option::None,
21031 })
21032 }
21033
21034 /// Sets the value of [operation][crate::model::AutomationRun::operation]
21035 /// to hold a `TimedPromoteReleaseOperation`.
21036 ///
21037 /// Note that all the setters affecting `operation` are
21038 /// mutually exclusive.
21039 ///
21040 /// # Example
21041 /// ```ignore,no_run
21042 /// # use google_cloud_deploy_v1::model::AutomationRun;
21043 /// use google_cloud_deploy_v1::model::TimedPromoteReleaseOperation;
21044 /// let x = AutomationRun::new().set_timed_promote_release_operation(TimedPromoteReleaseOperation::default()/* use setters */);
21045 /// assert!(x.timed_promote_release_operation().is_some());
21046 /// assert!(x.promote_release_operation().is_none());
21047 /// assert!(x.advance_rollout_operation().is_none());
21048 /// assert!(x.repair_rollout_operation().is_none());
21049 /// ```
21050 pub fn set_timed_promote_release_operation<
21051 T: std::convert::Into<std::boxed::Box<crate::model::TimedPromoteReleaseOperation>>,
21052 >(
21053 mut self,
21054 v: T,
21055 ) -> Self {
21056 self.operation = std::option::Option::Some(
21057 crate::model::automation_run::Operation::TimedPromoteReleaseOperation(v.into()),
21058 );
21059 self
21060 }
21061}
21062
21063impl wkt::message::Message for AutomationRun {
21064 fn typename() -> &'static str {
21065 "type.googleapis.com/google.cloud.deploy.v1.AutomationRun"
21066 }
21067}
21068
21069/// Defines additional types related to [AutomationRun].
21070pub mod automation_run {
21071 #[allow(unused_imports)]
21072 use super::*;
21073
21074 /// Valid state of an `AutomationRun`.
21075 ///
21076 /// # Working with unknown values
21077 ///
21078 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
21079 /// additional enum variants at any time. Adding new variants is not considered
21080 /// a breaking change. Applications should write their code in anticipation of:
21081 ///
21082 /// - New values appearing in future releases of the client library, **and**
21083 /// - New values received dynamically, without application changes.
21084 ///
21085 /// Please consult the [Working with enums] section in the user guide for some
21086 /// guidelines.
21087 ///
21088 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
21089 #[derive(Clone, Debug, PartialEq)]
21090 #[non_exhaustive]
21091 pub enum State {
21092 /// The `AutomationRun` has an unspecified state.
21093 Unspecified,
21094 /// The `AutomationRun` has succeeded.
21095 Succeeded,
21096 /// The `AutomationRun` was cancelled.
21097 Cancelled,
21098 /// The `AutomationRun` has failed.
21099 Failed,
21100 /// The `AutomationRun` is in progress.
21101 InProgress,
21102 /// The `AutomationRun` is pending.
21103 Pending,
21104 /// The `AutomationRun` was aborted.
21105 Aborted,
21106 /// If set, the enum was initialized with an unknown value.
21107 ///
21108 /// Applications can examine the value using [State::value] or
21109 /// [State::name].
21110 UnknownValue(state::UnknownValue),
21111 }
21112
21113 #[doc(hidden)]
21114 pub mod state {
21115 #[allow(unused_imports)]
21116 use super::*;
21117 #[derive(Clone, Debug, PartialEq)]
21118 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
21119 }
21120
21121 impl State {
21122 /// Gets the enum value.
21123 ///
21124 /// Returns `None` if the enum contains an unknown value deserialized from
21125 /// the string representation of enums.
21126 pub fn value(&self) -> std::option::Option<i32> {
21127 match self {
21128 Self::Unspecified => std::option::Option::Some(0),
21129 Self::Succeeded => std::option::Option::Some(1),
21130 Self::Cancelled => std::option::Option::Some(2),
21131 Self::Failed => std::option::Option::Some(3),
21132 Self::InProgress => std::option::Option::Some(4),
21133 Self::Pending => std::option::Option::Some(5),
21134 Self::Aborted => std::option::Option::Some(6),
21135 Self::UnknownValue(u) => u.0.value(),
21136 }
21137 }
21138
21139 /// Gets the enum value as a string.
21140 ///
21141 /// Returns `None` if the enum contains an unknown value deserialized from
21142 /// the integer representation of enums.
21143 pub fn name(&self) -> std::option::Option<&str> {
21144 match self {
21145 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
21146 Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
21147 Self::Cancelled => std::option::Option::Some("CANCELLED"),
21148 Self::Failed => std::option::Option::Some("FAILED"),
21149 Self::InProgress => std::option::Option::Some("IN_PROGRESS"),
21150 Self::Pending => std::option::Option::Some("PENDING"),
21151 Self::Aborted => std::option::Option::Some("ABORTED"),
21152 Self::UnknownValue(u) => u.0.name(),
21153 }
21154 }
21155 }
21156
21157 impl std::default::Default for State {
21158 fn default() -> Self {
21159 use std::convert::From;
21160 Self::from(0)
21161 }
21162 }
21163
21164 impl std::fmt::Display for State {
21165 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
21166 wkt::internal::display_enum(f, self.name(), self.value())
21167 }
21168 }
21169
21170 impl std::convert::From<i32> for State {
21171 fn from(value: i32) -> Self {
21172 match value {
21173 0 => Self::Unspecified,
21174 1 => Self::Succeeded,
21175 2 => Self::Cancelled,
21176 3 => Self::Failed,
21177 4 => Self::InProgress,
21178 5 => Self::Pending,
21179 6 => Self::Aborted,
21180 _ => Self::UnknownValue(state::UnknownValue(
21181 wkt::internal::UnknownEnumValue::Integer(value),
21182 )),
21183 }
21184 }
21185 }
21186
21187 impl std::convert::From<&str> for State {
21188 fn from(value: &str) -> Self {
21189 use std::string::ToString;
21190 match value {
21191 "STATE_UNSPECIFIED" => Self::Unspecified,
21192 "SUCCEEDED" => Self::Succeeded,
21193 "CANCELLED" => Self::Cancelled,
21194 "FAILED" => Self::Failed,
21195 "IN_PROGRESS" => Self::InProgress,
21196 "PENDING" => Self::Pending,
21197 "ABORTED" => Self::Aborted,
21198 _ => Self::UnknownValue(state::UnknownValue(
21199 wkt::internal::UnknownEnumValue::String(value.to_string()),
21200 )),
21201 }
21202 }
21203 }
21204
21205 impl serde::ser::Serialize for State {
21206 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
21207 where
21208 S: serde::Serializer,
21209 {
21210 match self {
21211 Self::Unspecified => serializer.serialize_i32(0),
21212 Self::Succeeded => serializer.serialize_i32(1),
21213 Self::Cancelled => serializer.serialize_i32(2),
21214 Self::Failed => serializer.serialize_i32(3),
21215 Self::InProgress => serializer.serialize_i32(4),
21216 Self::Pending => serializer.serialize_i32(5),
21217 Self::Aborted => serializer.serialize_i32(6),
21218 Self::UnknownValue(u) => u.0.serialize(serializer),
21219 }
21220 }
21221 }
21222
21223 impl<'de> serde::de::Deserialize<'de> for State {
21224 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
21225 where
21226 D: serde::Deserializer<'de>,
21227 {
21228 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
21229 ".google.cloud.deploy.v1.AutomationRun.State",
21230 ))
21231 }
21232 }
21233
21234 /// The operation that the `AutomationRun` will perform.
21235 #[derive(Clone, Debug, PartialEq)]
21236 #[non_exhaustive]
21237 pub enum Operation {
21238 /// Output only. Promotes a release to a specified 'Target'.
21239 PromoteReleaseOperation(std::boxed::Box<crate::model::PromoteReleaseOperation>),
21240 /// Output only. Advances a rollout to the next phase.
21241 AdvanceRolloutOperation(std::boxed::Box<crate::model::AdvanceRolloutOperation>),
21242 /// Output only. Repairs a failed 'Rollout'.
21243 RepairRolloutOperation(std::boxed::Box<crate::model::RepairRolloutOperation>),
21244 /// Output only. Promotes a release to a specified 'Target' as defined in a
21245 /// Timed Promote Release rule.
21246 TimedPromoteReleaseOperation(std::boxed::Box<crate::model::TimedPromoteReleaseOperation>),
21247 }
21248}
21249
21250/// Contains the information of an automated promote-release operation.
21251#[derive(Clone, Default, PartialEq)]
21252#[non_exhaustive]
21253pub struct PromoteReleaseOperation {
21254 /// Output only. The ID of the target that represents the promotion stage to
21255 /// which the release will be promoted. The value of this field is the last
21256 /// segment of a target name.
21257 pub target_id: std::string::String,
21258
21259 /// Output only. How long the operation will be paused.
21260 pub wait: std::option::Option<wkt::Duration>,
21261
21262 /// Output only. The name of the rollout that initiates the `AutomationRun`.
21263 pub rollout: std::string::String,
21264
21265 /// Output only. The starting phase of the rollout created by this operation.
21266 pub phase: std::string::String,
21267
21268 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21269}
21270
21271impl PromoteReleaseOperation {
21272 pub fn new() -> Self {
21273 std::default::Default::default()
21274 }
21275
21276 /// Sets the value of [target_id][crate::model::PromoteReleaseOperation::target_id].
21277 ///
21278 /// # Example
21279 /// ```ignore,no_run
21280 /// # use google_cloud_deploy_v1::model::PromoteReleaseOperation;
21281 /// let x = PromoteReleaseOperation::new().set_target_id("example");
21282 /// ```
21283 pub fn set_target_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21284 self.target_id = v.into();
21285 self
21286 }
21287
21288 /// Sets the value of [wait][crate::model::PromoteReleaseOperation::wait].
21289 ///
21290 /// # Example
21291 /// ```ignore,no_run
21292 /// # use google_cloud_deploy_v1::model::PromoteReleaseOperation;
21293 /// use wkt::Duration;
21294 /// let x = PromoteReleaseOperation::new().set_wait(Duration::default()/* use setters */);
21295 /// ```
21296 pub fn set_wait<T>(mut self, v: T) -> Self
21297 where
21298 T: std::convert::Into<wkt::Duration>,
21299 {
21300 self.wait = std::option::Option::Some(v.into());
21301 self
21302 }
21303
21304 /// Sets or clears the value of [wait][crate::model::PromoteReleaseOperation::wait].
21305 ///
21306 /// # Example
21307 /// ```ignore,no_run
21308 /// # use google_cloud_deploy_v1::model::PromoteReleaseOperation;
21309 /// use wkt::Duration;
21310 /// let x = PromoteReleaseOperation::new().set_or_clear_wait(Some(Duration::default()/* use setters */));
21311 /// let x = PromoteReleaseOperation::new().set_or_clear_wait(None::<Duration>);
21312 /// ```
21313 pub fn set_or_clear_wait<T>(mut self, v: std::option::Option<T>) -> Self
21314 where
21315 T: std::convert::Into<wkt::Duration>,
21316 {
21317 self.wait = v.map(|x| x.into());
21318 self
21319 }
21320
21321 /// Sets the value of [rollout][crate::model::PromoteReleaseOperation::rollout].
21322 ///
21323 /// # Example
21324 /// ```ignore,no_run
21325 /// # use google_cloud_deploy_v1::model::PromoteReleaseOperation;
21326 /// let x = PromoteReleaseOperation::new().set_rollout("example");
21327 /// ```
21328 pub fn set_rollout<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21329 self.rollout = v.into();
21330 self
21331 }
21332
21333 /// Sets the value of [phase][crate::model::PromoteReleaseOperation::phase].
21334 ///
21335 /// # Example
21336 /// ```ignore,no_run
21337 /// # use google_cloud_deploy_v1::model::PromoteReleaseOperation;
21338 /// let x = PromoteReleaseOperation::new().set_phase("example");
21339 /// ```
21340 pub fn set_phase<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21341 self.phase = v.into();
21342 self
21343 }
21344}
21345
21346impl wkt::message::Message for PromoteReleaseOperation {
21347 fn typename() -> &'static str {
21348 "type.googleapis.com/google.cloud.deploy.v1.PromoteReleaseOperation"
21349 }
21350}
21351
21352/// Contains the information of an automated advance-rollout operation.
21353#[derive(Clone, Default, PartialEq)]
21354#[non_exhaustive]
21355pub struct AdvanceRolloutOperation {
21356 /// Output only. The phase of a deployment that initiated the operation.
21357 pub source_phase: std::string::String,
21358
21359 /// Output only. How long the operation will be paused.
21360 pub wait: std::option::Option<wkt::Duration>,
21361
21362 /// Output only. The name of the rollout that initiates the `AutomationRun`.
21363 pub rollout: std::string::String,
21364
21365 /// Output only. The phase the rollout will be advanced to.
21366 pub destination_phase: std::string::String,
21367
21368 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21369}
21370
21371impl AdvanceRolloutOperation {
21372 pub fn new() -> Self {
21373 std::default::Default::default()
21374 }
21375
21376 /// Sets the value of [source_phase][crate::model::AdvanceRolloutOperation::source_phase].
21377 ///
21378 /// # Example
21379 /// ```ignore,no_run
21380 /// # use google_cloud_deploy_v1::model::AdvanceRolloutOperation;
21381 /// let x = AdvanceRolloutOperation::new().set_source_phase("example");
21382 /// ```
21383 pub fn set_source_phase<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21384 self.source_phase = v.into();
21385 self
21386 }
21387
21388 /// Sets the value of [wait][crate::model::AdvanceRolloutOperation::wait].
21389 ///
21390 /// # Example
21391 /// ```ignore,no_run
21392 /// # use google_cloud_deploy_v1::model::AdvanceRolloutOperation;
21393 /// use wkt::Duration;
21394 /// let x = AdvanceRolloutOperation::new().set_wait(Duration::default()/* use setters */);
21395 /// ```
21396 pub fn set_wait<T>(mut self, v: T) -> Self
21397 where
21398 T: std::convert::Into<wkt::Duration>,
21399 {
21400 self.wait = std::option::Option::Some(v.into());
21401 self
21402 }
21403
21404 /// Sets or clears the value of [wait][crate::model::AdvanceRolloutOperation::wait].
21405 ///
21406 /// # Example
21407 /// ```ignore,no_run
21408 /// # use google_cloud_deploy_v1::model::AdvanceRolloutOperation;
21409 /// use wkt::Duration;
21410 /// let x = AdvanceRolloutOperation::new().set_or_clear_wait(Some(Duration::default()/* use setters */));
21411 /// let x = AdvanceRolloutOperation::new().set_or_clear_wait(None::<Duration>);
21412 /// ```
21413 pub fn set_or_clear_wait<T>(mut self, v: std::option::Option<T>) -> Self
21414 where
21415 T: std::convert::Into<wkt::Duration>,
21416 {
21417 self.wait = v.map(|x| x.into());
21418 self
21419 }
21420
21421 /// Sets the value of [rollout][crate::model::AdvanceRolloutOperation::rollout].
21422 ///
21423 /// # Example
21424 /// ```ignore,no_run
21425 /// # use google_cloud_deploy_v1::model::AdvanceRolloutOperation;
21426 /// let x = AdvanceRolloutOperation::new().set_rollout("example");
21427 /// ```
21428 pub fn set_rollout<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21429 self.rollout = v.into();
21430 self
21431 }
21432
21433 /// Sets the value of [destination_phase][crate::model::AdvanceRolloutOperation::destination_phase].
21434 ///
21435 /// # Example
21436 /// ```ignore,no_run
21437 /// # use google_cloud_deploy_v1::model::AdvanceRolloutOperation;
21438 /// let x = AdvanceRolloutOperation::new().set_destination_phase("example");
21439 /// ```
21440 pub fn set_destination_phase<T: std::convert::Into<std::string::String>>(
21441 mut self,
21442 v: T,
21443 ) -> Self {
21444 self.destination_phase = v.into();
21445 self
21446 }
21447}
21448
21449impl wkt::message::Message for AdvanceRolloutOperation {
21450 fn typename() -> &'static str {
21451 "type.googleapis.com/google.cloud.deploy.v1.AdvanceRolloutOperation"
21452 }
21453}
21454
21455/// Contains the information for an automated `repair rollout` operation.
21456#[derive(Clone, Default, PartialEq)]
21457#[non_exhaustive]
21458pub struct RepairRolloutOperation {
21459 /// Output only. The name of the rollout that initiates the `AutomationRun`.
21460 pub rollout: std::string::String,
21461
21462 /// Output only. The index of the current repair action in the repair sequence.
21463 pub current_repair_phase_index: i64,
21464
21465 /// Output only. Records of the repair attempts. Each repair phase may have
21466 /// multiple retry attempts or single rollback attempt.
21467 pub repair_phases: std::vec::Vec<crate::model::RepairPhase>,
21468
21469 /// Output only. The phase ID of the phase that includes the job being
21470 /// repaired.
21471 pub phase_id: std::string::String,
21472
21473 /// Output only. The job ID for the Job to repair.
21474 pub job_id: std::string::String,
21475
21476 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21477}
21478
21479impl RepairRolloutOperation {
21480 pub fn new() -> Self {
21481 std::default::Default::default()
21482 }
21483
21484 /// Sets the value of [rollout][crate::model::RepairRolloutOperation::rollout].
21485 ///
21486 /// # Example
21487 /// ```ignore,no_run
21488 /// # use google_cloud_deploy_v1::model::RepairRolloutOperation;
21489 /// let x = RepairRolloutOperation::new().set_rollout("example");
21490 /// ```
21491 pub fn set_rollout<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21492 self.rollout = v.into();
21493 self
21494 }
21495
21496 /// Sets the value of [current_repair_phase_index][crate::model::RepairRolloutOperation::current_repair_phase_index].
21497 ///
21498 /// # Example
21499 /// ```ignore,no_run
21500 /// # use google_cloud_deploy_v1::model::RepairRolloutOperation;
21501 /// let x = RepairRolloutOperation::new().set_current_repair_phase_index(42);
21502 /// ```
21503 pub fn set_current_repair_phase_index<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
21504 self.current_repair_phase_index = v.into();
21505 self
21506 }
21507
21508 /// Sets the value of [repair_phases][crate::model::RepairRolloutOperation::repair_phases].
21509 ///
21510 /// # Example
21511 /// ```ignore,no_run
21512 /// # use google_cloud_deploy_v1::model::RepairRolloutOperation;
21513 /// use google_cloud_deploy_v1::model::RepairPhase;
21514 /// let x = RepairRolloutOperation::new()
21515 /// .set_repair_phases([
21516 /// RepairPhase::default()/* use setters */,
21517 /// RepairPhase::default()/* use (different) setters */,
21518 /// ]);
21519 /// ```
21520 pub fn set_repair_phases<T, V>(mut self, v: T) -> Self
21521 where
21522 T: std::iter::IntoIterator<Item = V>,
21523 V: std::convert::Into<crate::model::RepairPhase>,
21524 {
21525 use std::iter::Iterator;
21526 self.repair_phases = v.into_iter().map(|i| i.into()).collect();
21527 self
21528 }
21529
21530 /// Sets the value of [phase_id][crate::model::RepairRolloutOperation::phase_id].
21531 ///
21532 /// # Example
21533 /// ```ignore,no_run
21534 /// # use google_cloud_deploy_v1::model::RepairRolloutOperation;
21535 /// let x = RepairRolloutOperation::new().set_phase_id("example");
21536 /// ```
21537 pub fn set_phase_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21538 self.phase_id = v.into();
21539 self
21540 }
21541
21542 /// Sets the value of [job_id][crate::model::RepairRolloutOperation::job_id].
21543 ///
21544 /// # Example
21545 /// ```ignore,no_run
21546 /// # use google_cloud_deploy_v1::model::RepairRolloutOperation;
21547 /// let x = RepairRolloutOperation::new().set_job_id("example");
21548 /// ```
21549 pub fn set_job_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21550 self.job_id = v.into();
21551 self
21552 }
21553}
21554
21555impl wkt::message::Message for RepairRolloutOperation {
21556 fn typename() -> &'static str {
21557 "type.googleapis.com/google.cloud.deploy.v1.RepairRolloutOperation"
21558 }
21559}
21560
21561/// Contains the information of an automated timed promote-release operation.
21562#[derive(Clone, Default, PartialEq)]
21563#[non_exhaustive]
21564pub struct TimedPromoteReleaseOperation {
21565 /// Output only. The ID of the target that represents the promotion stage to
21566 /// which the release will be promoted. The value of this field is the last
21567 /// segment of a target name.
21568 pub target_id: std::string::String,
21569
21570 /// Output only. The name of the release to be promoted.
21571 pub release: std::string::String,
21572
21573 /// Output only. The starting phase of the rollout created by this operation.
21574 pub phase: std::string::String,
21575
21576 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21577}
21578
21579impl TimedPromoteReleaseOperation {
21580 pub fn new() -> Self {
21581 std::default::Default::default()
21582 }
21583
21584 /// Sets the value of [target_id][crate::model::TimedPromoteReleaseOperation::target_id].
21585 ///
21586 /// # Example
21587 /// ```ignore,no_run
21588 /// # use google_cloud_deploy_v1::model::TimedPromoteReleaseOperation;
21589 /// let x = TimedPromoteReleaseOperation::new().set_target_id("example");
21590 /// ```
21591 pub fn set_target_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21592 self.target_id = v.into();
21593 self
21594 }
21595
21596 /// Sets the value of [release][crate::model::TimedPromoteReleaseOperation::release].
21597 ///
21598 /// # Example
21599 /// ```ignore,no_run
21600 /// # use google_cloud_deploy_v1::model::TimedPromoteReleaseOperation;
21601 /// let x = TimedPromoteReleaseOperation::new().set_release("example");
21602 /// ```
21603 pub fn set_release<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21604 self.release = v.into();
21605 self
21606 }
21607
21608 /// Sets the value of [phase][crate::model::TimedPromoteReleaseOperation::phase].
21609 ///
21610 /// # Example
21611 /// ```ignore,no_run
21612 /// # use google_cloud_deploy_v1::model::TimedPromoteReleaseOperation;
21613 /// let x = TimedPromoteReleaseOperation::new().set_phase("example");
21614 /// ```
21615 pub fn set_phase<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21616 self.phase = v.into();
21617 self
21618 }
21619}
21620
21621impl wkt::message::Message for TimedPromoteReleaseOperation {
21622 fn typename() -> &'static str {
21623 "type.googleapis.com/google.cloud.deploy.v1.TimedPromoteReleaseOperation"
21624 }
21625}
21626
21627/// RepairPhase tracks the repair attempts that have been made for
21628/// each `RepairPhaseConfig` specified in the `Automation` resource.
21629#[derive(Clone, Default, PartialEq)]
21630#[non_exhaustive]
21631pub struct RepairPhase {
21632 /// The `RepairPhase` type and the information for that type.
21633 pub repair_phase: std::option::Option<crate::model::repair_phase::RepairPhase>,
21634
21635 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21636}
21637
21638impl RepairPhase {
21639 pub fn new() -> Self {
21640 std::default::Default::default()
21641 }
21642
21643 /// Sets the value of [repair_phase][crate::model::RepairPhase::repair_phase].
21644 ///
21645 /// Note that all the setters affecting `repair_phase` are mutually
21646 /// exclusive.
21647 ///
21648 /// # Example
21649 /// ```ignore,no_run
21650 /// # use google_cloud_deploy_v1::model::RepairPhase;
21651 /// use google_cloud_deploy_v1::model::RetryPhase;
21652 /// let x = RepairPhase::new().set_repair_phase(Some(
21653 /// google_cloud_deploy_v1::model::repair_phase::RepairPhase::Retry(RetryPhase::default().into())));
21654 /// ```
21655 pub fn set_repair_phase<
21656 T: std::convert::Into<std::option::Option<crate::model::repair_phase::RepairPhase>>,
21657 >(
21658 mut self,
21659 v: T,
21660 ) -> Self {
21661 self.repair_phase = v.into();
21662 self
21663 }
21664
21665 /// The value of [repair_phase][crate::model::RepairPhase::repair_phase]
21666 /// if it holds a `Retry`, `None` if the field is not set or
21667 /// holds a different branch.
21668 pub fn retry(&self) -> std::option::Option<&std::boxed::Box<crate::model::RetryPhase>> {
21669 #[allow(unreachable_patterns)]
21670 self.repair_phase.as_ref().and_then(|v| match v {
21671 crate::model::repair_phase::RepairPhase::Retry(v) => std::option::Option::Some(v),
21672 _ => std::option::Option::None,
21673 })
21674 }
21675
21676 /// Sets the value of [repair_phase][crate::model::RepairPhase::repair_phase]
21677 /// to hold a `Retry`.
21678 ///
21679 /// Note that all the setters affecting `repair_phase` are
21680 /// mutually exclusive.
21681 ///
21682 /// # Example
21683 /// ```ignore,no_run
21684 /// # use google_cloud_deploy_v1::model::RepairPhase;
21685 /// use google_cloud_deploy_v1::model::RetryPhase;
21686 /// let x = RepairPhase::new().set_retry(RetryPhase::default()/* use setters */);
21687 /// assert!(x.retry().is_some());
21688 /// assert!(x.rollback().is_none());
21689 /// ```
21690 pub fn set_retry<T: std::convert::Into<std::boxed::Box<crate::model::RetryPhase>>>(
21691 mut self,
21692 v: T,
21693 ) -> Self {
21694 self.repair_phase =
21695 std::option::Option::Some(crate::model::repair_phase::RepairPhase::Retry(v.into()));
21696 self
21697 }
21698
21699 /// The value of [repair_phase][crate::model::RepairPhase::repair_phase]
21700 /// if it holds a `Rollback`, `None` if the field is not set or
21701 /// holds a different branch.
21702 pub fn rollback(&self) -> std::option::Option<&std::boxed::Box<crate::model::RollbackAttempt>> {
21703 #[allow(unreachable_patterns)]
21704 self.repair_phase.as_ref().and_then(|v| match v {
21705 crate::model::repair_phase::RepairPhase::Rollback(v) => std::option::Option::Some(v),
21706 _ => std::option::Option::None,
21707 })
21708 }
21709
21710 /// Sets the value of [repair_phase][crate::model::RepairPhase::repair_phase]
21711 /// to hold a `Rollback`.
21712 ///
21713 /// Note that all the setters affecting `repair_phase` are
21714 /// mutually exclusive.
21715 ///
21716 /// # Example
21717 /// ```ignore,no_run
21718 /// # use google_cloud_deploy_v1::model::RepairPhase;
21719 /// use google_cloud_deploy_v1::model::RollbackAttempt;
21720 /// let x = RepairPhase::new().set_rollback(RollbackAttempt::default()/* use setters */);
21721 /// assert!(x.rollback().is_some());
21722 /// assert!(x.retry().is_none());
21723 /// ```
21724 pub fn set_rollback<T: std::convert::Into<std::boxed::Box<crate::model::RollbackAttempt>>>(
21725 mut self,
21726 v: T,
21727 ) -> Self {
21728 self.repair_phase =
21729 std::option::Option::Some(crate::model::repair_phase::RepairPhase::Rollback(v.into()));
21730 self
21731 }
21732}
21733
21734impl wkt::message::Message for RepairPhase {
21735 fn typename() -> &'static str {
21736 "type.googleapis.com/google.cloud.deploy.v1.RepairPhase"
21737 }
21738}
21739
21740/// Defines additional types related to [RepairPhase].
21741pub mod repair_phase {
21742 #[allow(unused_imports)]
21743 use super::*;
21744
21745 /// The `RepairPhase` type and the information for that type.
21746 #[derive(Clone, Debug, PartialEq)]
21747 #[non_exhaustive]
21748 pub enum RepairPhase {
21749 /// Output only. Records of the retry attempts for retry repair mode.
21750 Retry(std::boxed::Box<crate::model::RetryPhase>),
21751 /// Output only. Rollback attempt for rollback repair mode .
21752 Rollback(std::boxed::Box<crate::model::RollbackAttempt>),
21753 }
21754}
21755
21756/// RetryPhase contains the retry attempts and the metadata for initiating a
21757/// new attempt.
21758#[derive(Clone, Default, PartialEq)]
21759#[non_exhaustive]
21760pub struct RetryPhase {
21761 /// Output only. The number of attempts that have been made.
21762 pub total_attempts: i64,
21763
21764 /// Output only. The pattern of how the wait time of the retry attempt is
21765 /// calculated.
21766 pub backoff_mode: crate::model::BackoffMode,
21767
21768 /// Output only. Detail of a retry action.
21769 pub attempts: std::vec::Vec<crate::model::RetryAttempt>,
21770
21771 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21772}
21773
21774impl RetryPhase {
21775 pub fn new() -> Self {
21776 std::default::Default::default()
21777 }
21778
21779 /// Sets the value of [total_attempts][crate::model::RetryPhase::total_attempts].
21780 ///
21781 /// # Example
21782 /// ```ignore,no_run
21783 /// # use google_cloud_deploy_v1::model::RetryPhase;
21784 /// let x = RetryPhase::new().set_total_attempts(42);
21785 /// ```
21786 pub fn set_total_attempts<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
21787 self.total_attempts = v.into();
21788 self
21789 }
21790
21791 /// Sets the value of [backoff_mode][crate::model::RetryPhase::backoff_mode].
21792 ///
21793 /// # Example
21794 /// ```ignore,no_run
21795 /// # use google_cloud_deploy_v1::model::RetryPhase;
21796 /// use google_cloud_deploy_v1::model::BackoffMode;
21797 /// let x0 = RetryPhase::new().set_backoff_mode(BackoffMode::Linear);
21798 /// let x1 = RetryPhase::new().set_backoff_mode(BackoffMode::Exponential);
21799 /// ```
21800 pub fn set_backoff_mode<T: std::convert::Into<crate::model::BackoffMode>>(
21801 mut self,
21802 v: T,
21803 ) -> Self {
21804 self.backoff_mode = v.into();
21805 self
21806 }
21807
21808 /// Sets the value of [attempts][crate::model::RetryPhase::attempts].
21809 ///
21810 /// # Example
21811 /// ```ignore,no_run
21812 /// # use google_cloud_deploy_v1::model::RetryPhase;
21813 /// use google_cloud_deploy_v1::model::RetryAttempt;
21814 /// let x = RetryPhase::new()
21815 /// .set_attempts([
21816 /// RetryAttempt::default()/* use setters */,
21817 /// RetryAttempt::default()/* use (different) setters */,
21818 /// ]);
21819 /// ```
21820 pub fn set_attempts<T, V>(mut self, v: T) -> Self
21821 where
21822 T: std::iter::IntoIterator<Item = V>,
21823 V: std::convert::Into<crate::model::RetryAttempt>,
21824 {
21825 use std::iter::Iterator;
21826 self.attempts = v.into_iter().map(|i| i.into()).collect();
21827 self
21828 }
21829}
21830
21831impl wkt::message::Message for RetryPhase {
21832 fn typename() -> &'static str {
21833 "type.googleapis.com/google.cloud.deploy.v1.RetryPhase"
21834 }
21835}
21836
21837/// RetryAttempt represents an action of retrying the failed Cloud Deploy job.
21838#[derive(Clone, Default, PartialEq)]
21839#[non_exhaustive]
21840pub struct RetryAttempt {
21841 /// Output only. The index of this retry attempt.
21842 pub attempt: i64,
21843
21844 /// Output only. How long the operation will be paused.
21845 pub wait: std::option::Option<wkt::Duration>,
21846
21847 /// Output only. Valid state of this retry action.
21848 pub state: crate::model::RepairState,
21849
21850 /// Output only. Description of the state of the Retry.
21851 pub state_desc: std::string::String,
21852
21853 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21854}
21855
21856impl RetryAttempt {
21857 pub fn new() -> Self {
21858 std::default::Default::default()
21859 }
21860
21861 /// Sets the value of [attempt][crate::model::RetryAttempt::attempt].
21862 ///
21863 /// # Example
21864 /// ```ignore,no_run
21865 /// # use google_cloud_deploy_v1::model::RetryAttempt;
21866 /// let x = RetryAttempt::new().set_attempt(42);
21867 /// ```
21868 pub fn set_attempt<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
21869 self.attempt = v.into();
21870 self
21871 }
21872
21873 /// Sets the value of [wait][crate::model::RetryAttempt::wait].
21874 ///
21875 /// # Example
21876 /// ```ignore,no_run
21877 /// # use google_cloud_deploy_v1::model::RetryAttempt;
21878 /// use wkt::Duration;
21879 /// let x = RetryAttempt::new().set_wait(Duration::default()/* use setters */);
21880 /// ```
21881 pub fn set_wait<T>(mut self, v: T) -> Self
21882 where
21883 T: std::convert::Into<wkt::Duration>,
21884 {
21885 self.wait = std::option::Option::Some(v.into());
21886 self
21887 }
21888
21889 /// Sets or clears the value of [wait][crate::model::RetryAttempt::wait].
21890 ///
21891 /// # Example
21892 /// ```ignore,no_run
21893 /// # use google_cloud_deploy_v1::model::RetryAttempt;
21894 /// use wkt::Duration;
21895 /// let x = RetryAttempt::new().set_or_clear_wait(Some(Duration::default()/* use setters */));
21896 /// let x = RetryAttempt::new().set_or_clear_wait(None::<Duration>);
21897 /// ```
21898 pub fn set_or_clear_wait<T>(mut self, v: std::option::Option<T>) -> Self
21899 where
21900 T: std::convert::Into<wkt::Duration>,
21901 {
21902 self.wait = v.map(|x| x.into());
21903 self
21904 }
21905
21906 /// Sets the value of [state][crate::model::RetryAttempt::state].
21907 ///
21908 /// # Example
21909 /// ```ignore,no_run
21910 /// # use google_cloud_deploy_v1::model::RetryAttempt;
21911 /// use google_cloud_deploy_v1::model::RepairState;
21912 /// let x0 = RetryAttempt::new().set_state(RepairState::Succeeded);
21913 /// let x1 = RetryAttempt::new().set_state(RepairState::Cancelled);
21914 /// let x2 = RetryAttempt::new().set_state(RepairState::Failed);
21915 /// ```
21916 pub fn set_state<T: std::convert::Into<crate::model::RepairState>>(mut self, v: T) -> Self {
21917 self.state = v.into();
21918 self
21919 }
21920
21921 /// Sets the value of [state_desc][crate::model::RetryAttempt::state_desc].
21922 ///
21923 /// # Example
21924 /// ```ignore,no_run
21925 /// # use google_cloud_deploy_v1::model::RetryAttempt;
21926 /// let x = RetryAttempt::new().set_state_desc("example");
21927 /// ```
21928 pub fn set_state_desc<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21929 self.state_desc = v.into();
21930 self
21931 }
21932}
21933
21934impl wkt::message::Message for RetryAttempt {
21935 fn typename() -> &'static str {
21936 "type.googleapis.com/google.cloud.deploy.v1.RetryAttempt"
21937 }
21938}
21939
21940/// RollbackAttempt represents an action of rolling back a Cloud Deploy 'Target'.
21941#[derive(Clone, Default, PartialEq)]
21942#[non_exhaustive]
21943pub struct RollbackAttempt {
21944 /// Output only. The phase to which the rollout will be rolled back to.
21945 pub destination_phase: std::string::String,
21946
21947 /// Output only. ID of the rollback `Rollout` to create.
21948 pub rollout_id: std::string::String,
21949
21950 /// Output only. Valid state of this rollback action.
21951 pub state: crate::model::RepairState,
21952
21953 /// Output only. Description of the state of the Rollback.
21954 pub state_desc: std::string::String,
21955
21956 /// Output only. If active rollout exists on the target, abort this rollback.
21957 pub disable_rollback_if_rollout_pending: bool,
21958
21959 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21960}
21961
21962impl RollbackAttempt {
21963 pub fn new() -> Self {
21964 std::default::Default::default()
21965 }
21966
21967 /// Sets the value of [destination_phase][crate::model::RollbackAttempt::destination_phase].
21968 ///
21969 /// # Example
21970 /// ```ignore,no_run
21971 /// # use google_cloud_deploy_v1::model::RollbackAttempt;
21972 /// let x = RollbackAttempt::new().set_destination_phase("example");
21973 /// ```
21974 pub fn set_destination_phase<T: std::convert::Into<std::string::String>>(
21975 mut self,
21976 v: T,
21977 ) -> Self {
21978 self.destination_phase = v.into();
21979 self
21980 }
21981
21982 /// Sets the value of [rollout_id][crate::model::RollbackAttempt::rollout_id].
21983 ///
21984 /// # Example
21985 /// ```ignore,no_run
21986 /// # use google_cloud_deploy_v1::model::RollbackAttempt;
21987 /// let x = RollbackAttempt::new().set_rollout_id("example");
21988 /// ```
21989 pub fn set_rollout_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21990 self.rollout_id = v.into();
21991 self
21992 }
21993
21994 /// Sets the value of [state][crate::model::RollbackAttempt::state].
21995 ///
21996 /// # Example
21997 /// ```ignore,no_run
21998 /// # use google_cloud_deploy_v1::model::RollbackAttempt;
21999 /// use google_cloud_deploy_v1::model::RepairState;
22000 /// let x0 = RollbackAttempt::new().set_state(RepairState::Succeeded);
22001 /// let x1 = RollbackAttempt::new().set_state(RepairState::Cancelled);
22002 /// let x2 = RollbackAttempt::new().set_state(RepairState::Failed);
22003 /// ```
22004 pub fn set_state<T: std::convert::Into<crate::model::RepairState>>(mut self, v: T) -> Self {
22005 self.state = v.into();
22006 self
22007 }
22008
22009 /// Sets the value of [state_desc][crate::model::RollbackAttempt::state_desc].
22010 ///
22011 /// # Example
22012 /// ```ignore,no_run
22013 /// # use google_cloud_deploy_v1::model::RollbackAttempt;
22014 /// let x = RollbackAttempt::new().set_state_desc("example");
22015 /// ```
22016 pub fn set_state_desc<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22017 self.state_desc = v.into();
22018 self
22019 }
22020
22021 /// Sets the value of [disable_rollback_if_rollout_pending][crate::model::RollbackAttempt::disable_rollback_if_rollout_pending].
22022 ///
22023 /// # Example
22024 /// ```ignore,no_run
22025 /// # use google_cloud_deploy_v1::model::RollbackAttempt;
22026 /// let x = RollbackAttempt::new().set_disable_rollback_if_rollout_pending(true);
22027 /// ```
22028 pub fn set_disable_rollback_if_rollout_pending<T: std::convert::Into<bool>>(
22029 mut self,
22030 v: T,
22031 ) -> Self {
22032 self.disable_rollback_if_rollout_pending = v.into();
22033 self
22034 }
22035}
22036
22037impl wkt::message::Message for RollbackAttempt {
22038 fn typename() -> &'static str {
22039 "type.googleapis.com/google.cloud.deploy.v1.RollbackAttempt"
22040 }
22041}
22042
22043/// The request object for `ListAutomationRuns`.
22044#[derive(Clone, Default, PartialEq)]
22045#[non_exhaustive]
22046pub struct ListAutomationRunsRequest {
22047 /// Required. The parent `Delivery Pipeline`, which owns this collection of
22048 /// automationRuns. Format must be
22049 /// `projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}`.
22050 pub parent: std::string::String,
22051
22052 /// The maximum number of automationRuns to return. The service may return
22053 /// fewer than this value. If unspecified, at most 50 automationRuns will
22054 /// be returned. The maximum value is 1000; values above 1000 will be set
22055 /// to 1000.
22056 pub page_size: i32,
22057
22058 /// A page token, received from a previous `ListAutomationRuns` call.
22059 /// Provide this to retrieve the subsequent page.
22060 ///
22061 /// When paginating, all other provided parameters match
22062 /// the call that provided the page token.
22063 pub page_token: std::string::String,
22064
22065 /// Filter automationRuns to be returned. All fields can be used in the
22066 /// filter.
22067 pub filter: std::string::String,
22068
22069 /// Field to sort by.
22070 pub order_by: std::string::String,
22071
22072 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22073}
22074
22075impl ListAutomationRunsRequest {
22076 pub fn new() -> Self {
22077 std::default::Default::default()
22078 }
22079
22080 /// Sets the value of [parent][crate::model::ListAutomationRunsRequest::parent].
22081 ///
22082 /// # Example
22083 /// ```ignore,no_run
22084 /// # use google_cloud_deploy_v1::model::ListAutomationRunsRequest;
22085 /// let x = ListAutomationRunsRequest::new().set_parent("example");
22086 /// ```
22087 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22088 self.parent = v.into();
22089 self
22090 }
22091
22092 /// Sets the value of [page_size][crate::model::ListAutomationRunsRequest::page_size].
22093 ///
22094 /// # Example
22095 /// ```ignore,no_run
22096 /// # use google_cloud_deploy_v1::model::ListAutomationRunsRequest;
22097 /// let x = ListAutomationRunsRequest::new().set_page_size(42);
22098 /// ```
22099 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
22100 self.page_size = v.into();
22101 self
22102 }
22103
22104 /// Sets the value of [page_token][crate::model::ListAutomationRunsRequest::page_token].
22105 ///
22106 /// # Example
22107 /// ```ignore,no_run
22108 /// # use google_cloud_deploy_v1::model::ListAutomationRunsRequest;
22109 /// let x = ListAutomationRunsRequest::new().set_page_token("example");
22110 /// ```
22111 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22112 self.page_token = v.into();
22113 self
22114 }
22115
22116 /// Sets the value of [filter][crate::model::ListAutomationRunsRequest::filter].
22117 ///
22118 /// # Example
22119 /// ```ignore,no_run
22120 /// # use google_cloud_deploy_v1::model::ListAutomationRunsRequest;
22121 /// let x = ListAutomationRunsRequest::new().set_filter("example");
22122 /// ```
22123 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22124 self.filter = v.into();
22125 self
22126 }
22127
22128 /// Sets the value of [order_by][crate::model::ListAutomationRunsRequest::order_by].
22129 ///
22130 /// # Example
22131 /// ```ignore,no_run
22132 /// # use google_cloud_deploy_v1::model::ListAutomationRunsRequest;
22133 /// let x = ListAutomationRunsRequest::new().set_order_by("example");
22134 /// ```
22135 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22136 self.order_by = v.into();
22137 self
22138 }
22139}
22140
22141impl wkt::message::Message for ListAutomationRunsRequest {
22142 fn typename() -> &'static str {
22143 "type.googleapis.com/google.cloud.deploy.v1.ListAutomationRunsRequest"
22144 }
22145}
22146
22147/// The response object from `ListAutomationRuns`.
22148#[derive(Clone, Default, PartialEq)]
22149#[non_exhaustive]
22150pub struct ListAutomationRunsResponse {
22151 /// The `AutomationRuns` objects.
22152 pub automation_runs: std::vec::Vec<crate::model::AutomationRun>,
22153
22154 /// A token, which can be sent as `page_token` to retrieve the next page.
22155 /// If this field is omitted, there are no subsequent pages.
22156 pub next_page_token: std::string::String,
22157
22158 /// Locations that could not be reached.
22159 pub unreachable: std::vec::Vec<std::string::String>,
22160
22161 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22162}
22163
22164impl ListAutomationRunsResponse {
22165 pub fn new() -> Self {
22166 std::default::Default::default()
22167 }
22168
22169 /// Sets the value of [automation_runs][crate::model::ListAutomationRunsResponse::automation_runs].
22170 ///
22171 /// # Example
22172 /// ```ignore,no_run
22173 /// # use google_cloud_deploy_v1::model::ListAutomationRunsResponse;
22174 /// use google_cloud_deploy_v1::model::AutomationRun;
22175 /// let x = ListAutomationRunsResponse::new()
22176 /// .set_automation_runs([
22177 /// AutomationRun::default()/* use setters */,
22178 /// AutomationRun::default()/* use (different) setters */,
22179 /// ]);
22180 /// ```
22181 pub fn set_automation_runs<T, V>(mut self, v: T) -> Self
22182 where
22183 T: std::iter::IntoIterator<Item = V>,
22184 V: std::convert::Into<crate::model::AutomationRun>,
22185 {
22186 use std::iter::Iterator;
22187 self.automation_runs = v.into_iter().map(|i| i.into()).collect();
22188 self
22189 }
22190
22191 /// Sets the value of [next_page_token][crate::model::ListAutomationRunsResponse::next_page_token].
22192 ///
22193 /// # Example
22194 /// ```ignore,no_run
22195 /// # use google_cloud_deploy_v1::model::ListAutomationRunsResponse;
22196 /// let x = ListAutomationRunsResponse::new().set_next_page_token("example");
22197 /// ```
22198 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22199 self.next_page_token = v.into();
22200 self
22201 }
22202
22203 /// Sets the value of [unreachable][crate::model::ListAutomationRunsResponse::unreachable].
22204 ///
22205 /// # Example
22206 /// ```ignore,no_run
22207 /// # use google_cloud_deploy_v1::model::ListAutomationRunsResponse;
22208 /// let x = ListAutomationRunsResponse::new().set_unreachable(["a", "b", "c"]);
22209 /// ```
22210 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
22211 where
22212 T: std::iter::IntoIterator<Item = V>,
22213 V: std::convert::Into<std::string::String>,
22214 {
22215 use std::iter::Iterator;
22216 self.unreachable = v.into_iter().map(|i| i.into()).collect();
22217 self
22218 }
22219}
22220
22221impl wkt::message::Message for ListAutomationRunsResponse {
22222 fn typename() -> &'static str {
22223 "type.googleapis.com/google.cloud.deploy.v1.ListAutomationRunsResponse"
22224 }
22225}
22226
22227#[doc(hidden)]
22228impl google_cloud_gax::paginator::internal::PageableResponse for ListAutomationRunsResponse {
22229 type PageItem = crate::model::AutomationRun;
22230
22231 fn items(self) -> std::vec::Vec<Self::PageItem> {
22232 self.automation_runs
22233 }
22234
22235 fn next_page_token(&self) -> std::string::String {
22236 use std::clone::Clone;
22237 self.next_page_token.clone()
22238 }
22239}
22240
22241/// The request object for `GetAutomationRun`
22242#[derive(Clone, Default, PartialEq)]
22243#[non_exhaustive]
22244pub struct GetAutomationRunRequest {
22245 /// Required. Name of the `AutomationRun`. Format must be
22246 /// `projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/automationRuns/{automation_run}`.
22247 pub name: std::string::String,
22248
22249 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22250}
22251
22252impl GetAutomationRunRequest {
22253 pub fn new() -> Self {
22254 std::default::Default::default()
22255 }
22256
22257 /// Sets the value of [name][crate::model::GetAutomationRunRequest::name].
22258 ///
22259 /// # Example
22260 /// ```ignore,no_run
22261 /// # use google_cloud_deploy_v1::model::GetAutomationRunRequest;
22262 /// let x = GetAutomationRunRequest::new().set_name("example");
22263 /// ```
22264 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22265 self.name = v.into();
22266 self
22267 }
22268}
22269
22270impl wkt::message::Message for GetAutomationRunRequest {
22271 fn typename() -> &'static str {
22272 "type.googleapis.com/google.cloud.deploy.v1.GetAutomationRunRequest"
22273 }
22274}
22275
22276/// The request object used by `CancelAutomationRun`.
22277#[derive(Clone, Default, PartialEq)]
22278#[non_exhaustive]
22279pub struct CancelAutomationRunRequest {
22280 /// Required. Name of the `AutomationRun`. Format is
22281 /// `projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/automationRuns/{automation_run}`.
22282 pub name: std::string::String,
22283
22284 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22285}
22286
22287impl CancelAutomationRunRequest {
22288 pub fn new() -> Self {
22289 std::default::Default::default()
22290 }
22291
22292 /// Sets the value of [name][crate::model::CancelAutomationRunRequest::name].
22293 ///
22294 /// # Example
22295 /// ```ignore,no_run
22296 /// # use google_cloud_deploy_v1::model::CancelAutomationRunRequest;
22297 /// let x = CancelAutomationRunRequest::new().set_name("example");
22298 /// ```
22299 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22300 self.name = v.into();
22301 self
22302 }
22303}
22304
22305impl wkt::message::Message for CancelAutomationRunRequest {
22306 fn typename() -> &'static str {
22307 "type.googleapis.com/google.cloud.deploy.v1.CancelAutomationRunRequest"
22308 }
22309}
22310
22311/// The response object from `CancelAutomationRun`.
22312#[derive(Clone, Default, PartialEq)]
22313#[non_exhaustive]
22314pub struct CancelAutomationRunResponse {
22315 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22316}
22317
22318impl CancelAutomationRunResponse {
22319 pub fn new() -> Self {
22320 std::default::Default::default()
22321 }
22322}
22323
22324impl wkt::message::Message for CancelAutomationRunResponse {
22325 fn typename() -> &'static str {
22326 "type.googleapis.com/google.cloud.deploy.v1.CancelAutomationRunResponse"
22327 }
22328}
22329
22330/// Payload proto for "clouddeploy.googleapis.com/customtargettype_notification"
22331/// Platform Log event that describes the failure to send a custom target type
22332/// status change Pub/Sub notification.
22333#[derive(Clone, Default, PartialEq)]
22334#[non_exhaustive]
22335pub struct CustomTargetTypeNotificationEvent {
22336 /// Debug message for when a notification fails to send.
22337 pub message: std::string::String,
22338
22339 /// Unique identifier of the `CustomTargetType`.
22340 pub custom_target_type_uid: std::string::String,
22341
22342 /// The name of the `CustomTargetType`.
22343 pub custom_target_type: std::string::String,
22344
22345 /// Type of this notification, e.g. for a Pub/Sub failure.
22346 pub r#type: crate::model::Type,
22347
22348 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22349}
22350
22351impl CustomTargetTypeNotificationEvent {
22352 pub fn new() -> Self {
22353 std::default::Default::default()
22354 }
22355
22356 /// Sets the value of [message][crate::model::CustomTargetTypeNotificationEvent::message].
22357 ///
22358 /// # Example
22359 /// ```ignore,no_run
22360 /// # use google_cloud_deploy_v1::model::CustomTargetTypeNotificationEvent;
22361 /// let x = CustomTargetTypeNotificationEvent::new().set_message("example");
22362 /// ```
22363 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22364 self.message = v.into();
22365 self
22366 }
22367
22368 /// Sets the value of [custom_target_type_uid][crate::model::CustomTargetTypeNotificationEvent::custom_target_type_uid].
22369 ///
22370 /// # Example
22371 /// ```ignore,no_run
22372 /// # use google_cloud_deploy_v1::model::CustomTargetTypeNotificationEvent;
22373 /// let x = CustomTargetTypeNotificationEvent::new().set_custom_target_type_uid("example");
22374 /// ```
22375 pub fn set_custom_target_type_uid<T: std::convert::Into<std::string::String>>(
22376 mut self,
22377 v: T,
22378 ) -> Self {
22379 self.custom_target_type_uid = v.into();
22380 self
22381 }
22382
22383 /// Sets the value of [custom_target_type][crate::model::CustomTargetTypeNotificationEvent::custom_target_type].
22384 ///
22385 /// # Example
22386 /// ```ignore,no_run
22387 /// # use google_cloud_deploy_v1::model::CustomTargetTypeNotificationEvent;
22388 /// let x = CustomTargetTypeNotificationEvent::new().set_custom_target_type("example");
22389 /// ```
22390 pub fn set_custom_target_type<T: std::convert::Into<std::string::String>>(
22391 mut self,
22392 v: T,
22393 ) -> Self {
22394 self.custom_target_type = v.into();
22395 self
22396 }
22397
22398 /// Sets the value of [r#type][crate::model::CustomTargetTypeNotificationEvent::type].
22399 ///
22400 /// # Example
22401 /// ```ignore,no_run
22402 /// # use google_cloud_deploy_v1::model::CustomTargetTypeNotificationEvent;
22403 /// use google_cloud_deploy_v1::model::Type;
22404 /// let x0 = CustomTargetTypeNotificationEvent::new().set_type(Type::PubsubNotificationFailure);
22405 /// let x1 = CustomTargetTypeNotificationEvent::new().set_type(Type::ResourceStateChange);
22406 /// let x2 = CustomTargetTypeNotificationEvent::new().set_type(Type::ProcessAborted);
22407 /// ```
22408 pub fn set_type<T: std::convert::Into<crate::model::Type>>(mut self, v: T) -> Self {
22409 self.r#type = v.into();
22410 self
22411 }
22412}
22413
22414impl wkt::message::Message for CustomTargetTypeNotificationEvent {
22415 fn typename() -> &'static str {
22416 "type.googleapis.com/google.cloud.deploy.v1.CustomTargetTypeNotificationEvent"
22417 }
22418}
22419
22420/// Payload proto for "clouddeploy.googleapis.com/deliverypipeline_notification"
22421/// Platform Log event that describes the failure to send delivery pipeline
22422/// status change Pub/Sub notification.
22423#[derive(Clone, Default, PartialEq)]
22424#[non_exhaustive]
22425pub struct DeliveryPipelineNotificationEvent {
22426 /// Debug message for when a notification fails to send.
22427 pub message: std::string::String,
22428
22429 /// Unique identifier of the `DeliveryPipeline`.
22430 pub pipeline_uid: std::string::String,
22431
22432 /// The name of the `Delivery Pipeline`.
22433 pub delivery_pipeline: std::string::String,
22434
22435 /// Type of this notification, e.g. for a Pub/Sub failure.
22436 pub r#type: crate::model::Type,
22437
22438 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22439}
22440
22441impl DeliveryPipelineNotificationEvent {
22442 pub fn new() -> Self {
22443 std::default::Default::default()
22444 }
22445
22446 /// Sets the value of [message][crate::model::DeliveryPipelineNotificationEvent::message].
22447 ///
22448 /// # Example
22449 /// ```ignore,no_run
22450 /// # use google_cloud_deploy_v1::model::DeliveryPipelineNotificationEvent;
22451 /// let x = DeliveryPipelineNotificationEvent::new().set_message("example");
22452 /// ```
22453 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22454 self.message = v.into();
22455 self
22456 }
22457
22458 /// Sets the value of [pipeline_uid][crate::model::DeliveryPipelineNotificationEvent::pipeline_uid].
22459 ///
22460 /// # Example
22461 /// ```ignore,no_run
22462 /// # use google_cloud_deploy_v1::model::DeliveryPipelineNotificationEvent;
22463 /// let x = DeliveryPipelineNotificationEvent::new().set_pipeline_uid("example");
22464 /// ```
22465 pub fn set_pipeline_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22466 self.pipeline_uid = v.into();
22467 self
22468 }
22469
22470 /// Sets the value of [delivery_pipeline][crate::model::DeliveryPipelineNotificationEvent::delivery_pipeline].
22471 ///
22472 /// # Example
22473 /// ```ignore,no_run
22474 /// # use google_cloud_deploy_v1::model::DeliveryPipelineNotificationEvent;
22475 /// let x = DeliveryPipelineNotificationEvent::new().set_delivery_pipeline("example");
22476 /// ```
22477 pub fn set_delivery_pipeline<T: std::convert::Into<std::string::String>>(
22478 mut self,
22479 v: T,
22480 ) -> Self {
22481 self.delivery_pipeline = v.into();
22482 self
22483 }
22484
22485 /// Sets the value of [r#type][crate::model::DeliveryPipelineNotificationEvent::type].
22486 ///
22487 /// # Example
22488 /// ```ignore,no_run
22489 /// # use google_cloud_deploy_v1::model::DeliveryPipelineNotificationEvent;
22490 /// use google_cloud_deploy_v1::model::Type;
22491 /// let x0 = DeliveryPipelineNotificationEvent::new().set_type(Type::PubsubNotificationFailure);
22492 /// let x1 = DeliveryPipelineNotificationEvent::new().set_type(Type::ResourceStateChange);
22493 /// let x2 = DeliveryPipelineNotificationEvent::new().set_type(Type::ProcessAborted);
22494 /// ```
22495 pub fn set_type<T: std::convert::Into<crate::model::Type>>(mut self, v: T) -> Self {
22496 self.r#type = v.into();
22497 self
22498 }
22499}
22500
22501impl wkt::message::Message for DeliveryPipelineNotificationEvent {
22502 fn typename() -> &'static str {
22503 "type.googleapis.com/google.cloud.deploy.v1.DeliveryPipelineNotificationEvent"
22504 }
22505}
22506
22507/// Payload proto for "clouddeploy.googleapis.com/deploypolicy_evaluation"
22508/// Platform Log event that describes the deploy policy evaluation event.
22509#[derive(Clone, Default, PartialEq)]
22510#[non_exhaustive]
22511pub struct DeployPolicyEvaluationEvent {
22512 /// Debug message for when a deploy policy event occurs.
22513 pub message: std::string::String,
22514
22515 /// Rule type (e.g. Restrict Rollouts).
22516 pub rule_type: std::string::String,
22517
22518 /// Rule id.
22519 pub rule: std::string::String,
22520
22521 /// Unique identifier of the `Delivery Pipeline`.
22522 pub pipeline_uid: std::string::String,
22523
22524 /// The name of the `Delivery Pipeline`.
22525 pub delivery_pipeline: std::string::String,
22526
22527 /// Unique identifier of the `Target`. This is an optional field, as a `Target`
22528 /// may not always be applicable to a policy.
22529 pub target_uid: std::string::String,
22530
22531 /// The name of the `Target`. This is an optional field, as a `Target` may not
22532 /// always be applicable to a policy.
22533 pub target: std::string::String,
22534
22535 /// What invoked the action (e.g. a user or automation).
22536 pub invoker: crate::model::deploy_policy::Invoker,
22537
22538 /// The name of the `DeployPolicy`.
22539 pub deploy_policy: std::string::String,
22540
22541 /// Unique identifier of the `DeployPolicy`.
22542 pub deploy_policy_uid: std::string::String,
22543
22544 /// Whether the request is allowed. Allowed is set as true if:
22545 /// (1) the request complies with the policy; or
22546 /// (2) the request doesn't comply with the policy but the policy was
22547 /// overridden; or
22548 /// (3) the request doesn't comply with the policy but the policy was suspended
22549 pub allowed: bool,
22550
22551 /// The policy verdict of the request.
22552 pub verdict: crate::model::deploy_policy_evaluation_event::PolicyVerdict,
22553
22554 /// Things that could have overridden the policy verdict. Overrides together
22555 /// with verdict decide whether the request is allowed.
22556 pub overrides:
22557 std::vec::Vec<crate::model::deploy_policy_evaluation_event::PolicyVerdictOverride>,
22558
22559 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22560}
22561
22562impl DeployPolicyEvaluationEvent {
22563 pub fn new() -> Self {
22564 std::default::Default::default()
22565 }
22566
22567 /// Sets the value of [message][crate::model::DeployPolicyEvaluationEvent::message].
22568 ///
22569 /// # Example
22570 /// ```ignore,no_run
22571 /// # use google_cloud_deploy_v1::model::DeployPolicyEvaluationEvent;
22572 /// let x = DeployPolicyEvaluationEvent::new().set_message("example");
22573 /// ```
22574 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22575 self.message = v.into();
22576 self
22577 }
22578
22579 /// Sets the value of [rule_type][crate::model::DeployPolicyEvaluationEvent::rule_type].
22580 ///
22581 /// # Example
22582 /// ```ignore,no_run
22583 /// # use google_cloud_deploy_v1::model::DeployPolicyEvaluationEvent;
22584 /// let x = DeployPolicyEvaluationEvent::new().set_rule_type("example");
22585 /// ```
22586 pub fn set_rule_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22587 self.rule_type = v.into();
22588 self
22589 }
22590
22591 /// Sets the value of [rule][crate::model::DeployPolicyEvaluationEvent::rule].
22592 ///
22593 /// # Example
22594 /// ```ignore,no_run
22595 /// # use google_cloud_deploy_v1::model::DeployPolicyEvaluationEvent;
22596 /// let x = DeployPolicyEvaluationEvent::new().set_rule("example");
22597 /// ```
22598 pub fn set_rule<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22599 self.rule = v.into();
22600 self
22601 }
22602
22603 /// Sets the value of [pipeline_uid][crate::model::DeployPolicyEvaluationEvent::pipeline_uid].
22604 ///
22605 /// # Example
22606 /// ```ignore,no_run
22607 /// # use google_cloud_deploy_v1::model::DeployPolicyEvaluationEvent;
22608 /// let x = DeployPolicyEvaluationEvent::new().set_pipeline_uid("example");
22609 /// ```
22610 pub fn set_pipeline_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22611 self.pipeline_uid = v.into();
22612 self
22613 }
22614
22615 /// Sets the value of [delivery_pipeline][crate::model::DeployPolicyEvaluationEvent::delivery_pipeline].
22616 ///
22617 /// # Example
22618 /// ```ignore,no_run
22619 /// # use google_cloud_deploy_v1::model::DeployPolicyEvaluationEvent;
22620 /// let x = DeployPolicyEvaluationEvent::new().set_delivery_pipeline("example");
22621 /// ```
22622 pub fn set_delivery_pipeline<T: std::convert::Into<std::string::String>>(
22623 mut self,
22624 v: T,
22625 ) -> Self {
22626 self.delivery_pipeline = v.into();
22627 self
22628 }
22629
22630 /// Sets the value of [target_uid][crate::model::DeployPolicyEvaluationEvent::target_uid].
22631 ///
22632 /// # Example
22633 /// ```ignore,no_run
22634 /// # use google_cloud_deploy_v1::model::DeployPolicyEvaluationEvent;
22635 /// let x = DeployPolicyEvaluationEvent::new().set_target_uid("example");
22636 /// ```
22637 pub fn set_target_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22638 self.target_uid = v.into();
22639 self
22640 }
22641
22642 /// Sets the value of [target][crate::model::DeployPolicyEvaluationEvent::target].
22643 ///
22644 /// # Example
22645 /// ```ignore,no_run
22646 /// # use google_cloud_deploy_v1::model::DeployPolicyEvaluationEvent;
22647 /// let x = DeployPolicyEvaluationEvent::new().set_target("example");
22648 /// ```
22649 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22650 self.target = v.into();
22651 self
22652 }
22653
22654 /// Sets the value of [invoker][crate::model::DeployPolicyEvaluationEvent::invoker].
22655 ///
22656 /// # Example
22657 /// ```ignore,no_run
22658 /// # use google_cloud_deploy_v1::model::DeployPolicyEvaluationEvent;
22659 /// use google_cloud_deploy_v1::model::deploy_policy::Invoker;
22660 /// let x0 = DeployPolicyEvaluationEvent::new().set_invoker(Invoker::User);
22661 /// let x1 = DeployPolicyEvaluationEvent::new().set_invoker(Invoker::DeployAutomation);
22662 /// ```
22663 pub fn set_invoker<T: std::convert::Into<crate::model::deploy_policy::Invoker>>(
22664 mut self,
22665 v: T,
22666 ) -> Self {
22667 self.invoker = v.into();
22668 self
22669 }
22670
22671 /// Sets the value of [deploy_policy][crate::model::DeployPolicyEvaluationEvent::deploy_policy].
22672 ///
22673 /// # Example
22674 /// ```ignore,no_run
22675 /// # use google_cloud_deploy_v1::model::DeployPolicyEvaluationEvent;
22676 /// let x = DeployPolicyEvaluationEvent::new().set_deploy_policy("example");
22677 /// ```
22678 pub fn set_deploy_policy<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22679 self.deploy_policy = v.into();
22680 self
22681 }
22682
22683 /// Sets the value of [deploy_policy_uid][crate::model::DeployPolicyEvaluationEvent::deploy_policy_uid].
22684 ///
22685 /// # Example
22686 /// ```ignore,no_run
22687 /// # use google_cloud_deploy_v1::model::DeployPolicyEvaluationEvent;
22688 /// let x = DeployPolicyEvaluationEvent::new().set_deploy_policy_uid("example");
22689 /// ```
22690 pub fn set_deploy_policy_uid<T: std::convert::Into<std::string::String>>(
22691 mut self,
22692 v: T,
22693 ) -> Self {
22694 self.deploy_policy_uid = v.into();
22695 self
22696 }
22697
22698 /// Sets the value of [allowed][crate::model::DeployPolicyEvaluationEvent::allowed].
22699 ///
22700 /// # Example
22701 /// ```ignore,no_run
22702 /// # use google_cloud_deploy_v1::model::DeployPolicyEvaluationEvent;
22703 /// let x = DeployPolicyEvaluationEvent::new().set_allowed(true);
22704 /// ```
22705 pub fn set_allowed<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
22706 self.allowed = v.into();
22707 self
22708 }
22709
22710 /// Sets the value of [verdict][crate::model::DeployPolicyEvaluationEvent::verdict].
22711 ///
22712 /// # Example
22713 /// ```ignore,no_run
22714 /// # use google_cloud_deploy_v1::model::DeployPolicyEvaluationEvent;
22715 /// use google_cloud_deploy_v1::model::deploy_policy_evaluation_event::PolicyVerdict;
22716 /// let x0 = DeployPolicyEvaluationEvent::new().set_verdict(PolicyVerdict::AllowedByPolicy);
22717 /// let x1 = DeployPolicyEvaluationEvent::new().set_verdict(PolicyVerdict::DeniedByPolicy);
22718 /// ```
22719 pub fn set_verdict<
22720 T: std::convert::Into<crate::model::deploy_policy_evaluation_event::PolicyVerdict>,
22721 >(
22722 mut self,
22723 v: T,
22724 ) -> Self {
22725 self.verdict = v.into();
22726 self
22727 }
22728
22729 /// Sets the value of [overrides][crate::model::DeployPolicyEvaluationEvent::overrides].
22730 ///
22731 /// # Example
22732 /// ```ignore,no_run
22733 /// # use google_cloud_deploy_v1::model::DeployPolicyEvaluationEvent;
22734 /// use google_cloud_deploy_v1::model::deploy_policy_evaluation_event::PolicyVerdictOverride;
22735 /// let x = DeployPolicyEvaluationEvent::new().set_overrides([
22736 /// PolicyVerdictOverride::PolicyOverridden,
22737 /// PolicyVerdictOverride::PolicySuspended,
22738 /// ]);
22739 /// ```
22740 pub fn set_overrides<T, V>(mut self, v: T) -> Self
22741 where
22742 T: std::iter::IntoIterator<Item = V>,
22743 V: std::convert::Into<crate::model::deploy_policy_evaluation_event::PolicyVerdictOverride>,
22744 {
22745 use std::iter::Iterator;
22746 self.overrides = v.into_iter().map(|i| i.into()).collect();
22747 self
22748 }
22749}
22750
22751impl wkt::message::Message for DeployPolicyEvaluationEvent {
22752 fn typename() -> &'static str {
22753 "type.googleapis.com/google.cloud.deploy.v1.DeployPolicyEvaluationEvent"
22754 }
22755}
22756
22757/// Defines additional types related to [DeployPolicyEvaluationEvent].
22758pub mod deploy_policy_evaluation_event {
22759 #[allow(unused_imports)]
22760 use super::*;
22761
22762 /// The policy verdict of the request.
22763 ///
22764 /// # Working with unknown values
22765 ///
22766 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
22767 /// additional enum variants at any time. Adding new variants is not considered
22768 /// a breaking change. Applications should write their code in anticipation of:
22769 ///
22770 /// - New values appearing in future releases of the client library, **and**
22771 /// - New values received dynamically, without application changes.
22772 ///
22773 /// Please consult the [Working with enums] section in the user guide for some
22774 /// guidelines.
22775 ///
22776 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
22777 #[derive(Clone, Debug, PartialEq)]
22778 #[non_exhaustive]
22779 pub enum PolicyVerdict {
22780 /// This should never happen.
22781 Unspecified,
22782 /// Allowed by policy. This enum value is not currently used but may be used
22783 /// in the future. Currently logs are only generated when a request is denied
22784 /// by policy.
22785 AllowedByPolicy,
22786 /// Denied by policy.
22787 DeniedByPolicy,
22788 /// If set, the enum was initialized with an unknown value.
22789 ///
22790 /// Applications can examine the value using [PolicyVerdict::value] or
22791 /// [PolicyVerdict::name].
22792 UnknownValue(policy_verdict::UnknownValue),
22793 }
22794
22795 #[doc(hidden)]
22796 pub mod policy_verdict {
22797 #[allow(unused_imports)]
22798 use super::*;
22799 #[derive(Clone, Debug, PartialEq)]
22800 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
22801 }
22802
22803 impl PolicyVerdict {
22804 /// Gets the enum value.
22805 ///
22806 /// Returns `None` if the enum contains an unknown value deserialized from
22807 /// the string representation of enums.
22808 pub fn value(&self) -> std::option::Option<i32> {
22809 match self {
22810 Self::Unspecified => std::option::Option::Some(0),
22811 Self::AllowedByPolicy => std::option::Option::Some(1),
22812 Self::DeniedByPolicy => std::option::Option::Some(2),
22813 Self::UnknownValue(u) => u.0.value(),
22814 }
22815 }
22816
22817 /// Gets the enum value as a string.
22818 ///
22819 /// Returns `None` if the enum contains an unknown value deserialized from
22820 /// the integer representation of enums.
22821 pub fn name(&self) -> std::option::Option<&str> {
22822 match self {
22823 Self::Unspecified => std::option::Option::Some("POLICY_VERDICT_UNSPECIFIED"),
22824 Self::AllowedByPolicy => std::option::Option::Some("ALLOWED_BY_POLICY"),
22825 Self::DeniedByPolicy => std::option::Option::Some("DENIED_BY_POLICY"),
22826 Self::UnknownValue(u) => u.0.name(),
22827 }
22828 }
22829 }
22830
22831 impl std::default::Default for PolicyVerdict {
22832 fn default() -> Self {
22833 use std::convert::From;
22834 Self::from(0)
22835 }
22836 }
22837
22838 impl std::fmt::Display for PolicyVerdict {
22839 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
22840 wkt::internal::display_enum(f, self.name(), self.value())
22841 }
22842 }
22843
22844 impl std::convert::From<i32> for PolicyVerdict {
22845 fn from(value: i32) -> Self {
22846 match value {
22847 0 => Self::Unspecified,
22848 1 => Self::AllowedByPolicy,
22849 2 => Self::DeniedByPolicy,
22850 _ => Self::UnknownValue(policy_verdict::UnknownValue(
22851 wkt::internal::UnknownEnumValue::Integer(value),
22852 )),
22853 }
22854 }
22855 }
22856
22857 impl std::convert::From<&str> for PolicyVerdict {
22858 fn from(value: &str) -> Self {
22859 use std::string::ToString;
22860 match value {
22861 "POLICY_VERDICT_UNSPECIFIED" => Self::Unspecified,
22862 "ALLOWED_BY_POLICY" => Self::AllowedByPolicy,
22863 "DENIED_BY_POLICY" => Self::DeniedByPolicy,
22864 _ => Self::UnknownValue(policy_verdict::UnknownValue(
22865 wkt::internal::UnknownEnumValue::String(value.to_string()),
22866 )),
22867 }
22868 }
22869 }
22870
22871 impl serde::ser::Serialize for PolicyVerdict {
22872 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
22873 where
22874 S: serde::Serializer,
22875 {
22876 match self {
22877 Self::Unspecified => serializer.serialize_i32(0),
22878 Self::AllowedByPolicy => serializer.serialize_i32(1),
22879 Self::DeniedByPolicy => serializer.serialize_i32(2),
22880 Self::UnknownValue(u) => u.0.serialize(serializer),
22881 }
22882 }
22883 }
22884
22885 impl<'de> serde::de::Deserialize<'de> for PolicyVerdict {
22886 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
22887 where
22888 D: serde::Deserializer<'de>,
22889 {
22890 deserializer.deserialize_any(wkt::internal::EnumVisitor::<PolicyVerdict>::new(
22891 ".google.cloud.deploy.v1.DeployPolicyEvaluationEvent.PolicyVerdict",
22892 ))
22893 }
22894 }
22895
22896 /// Things that could have overridden the policy verdict. When overrides are
22897 /// used, the request will be allowed even if it is DENIED_BY_POLICY.
22898 ///
22899 /// # Working with unknown values
22900 ///
22901 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
22902 /// additional enum variants at any time. Adding new variants is not considered
22903 /// a breaking change. Applications should write their code in anticipation of:
22904 ///
22905 /// - New values appearing in future releases of the client library, **and**
22906 /// - New values received dynamically, without application changes.
22907 ///
22908 /// Please consult the [Working with enums] section in the user guide for some
22909 /// guidelines.
22910 ///
22911 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
22912 #[derive(Clone, Debug, PartialEq)]
22913 #[non_exhaustive]
22914 pub enum PolicyVerdictOverride {
22915 /// This should never happen.
22916 Unspecified,
22917 /// The policy was overridden.
22918 PolicyOverridden,
22919 /// The policy was suspended.
22920 PolicySuspended,
22921 /// If set, the enum was initialized with an unknown value.
22922 ///
22923 /// Applications can examine the value using [PolicyVerdictOverride::value] or
22924 /// [PolicyVerdictOverride::name].
22925 UnknownValue(policy_verdict_override::UnknownValue),
22926 }
22927
22928 #[doc(hidden)]
22929 pub mod policy_verdict_override {
22930 #[allow(unused_imports)]
22931 use super::*;
22932 #[derive(Clone, Debug, PartialEq)]
22933 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
22934 }
22935
22936 impl PolicyVerdictOverride {
22937 /// Gets the enum value.
22938 ///
22939 /// Returns `None` if the enum contains an unknown value deserialized from
22940 /// the string representation of enums.
22941 pub fn value(&self) -> std::option::Option<i32> {
22942 match self {
22943 Self::Unspecified => std::option::Option::Some(0),
22944 Self::PolicyOverridden => std::option::Option::Some(1),
22945 Self::PolicySuspended => std::option::Option::Some(2),
22946 Self::UnknownValue(u) => u.0.value(),
22947 }
22948 }
22949
22950 /// Gets the enum value as a string.
22951 ///
22952 /// Returns `None` if the enum contains an unknown value deserialized from
22953 /// the integer representation of enums.
22954 pub fn name(&self) -> std::option::Option<&str> {
22955 match self {
22956 Self::Unspecified => {
22957 std::option::Option::Some("POLICY_VERDICT_OVERRIDE_UNSPECIFIED")
22958 }
22959 Self::PolicyOverridden => std::option::Option::Some("POLICY_OVERRIDDEN"),
22960 Self::PolicySuspended => std::option::Option::Some("POLICY_SUSPENDED"),
22961 Self::UnknownValue(u) => u.0.name(),
22962 }
22963 }
22964 }
22965
22966 impl std::default::Default for PolicyVerdictOverride {
22967 fn default() -> Self {
22968 use std::convert::From;
22969 Self::from(0)
22970 }
22971 }
22972
22973 impl std::fmt::Display for PolicyVerdictOverride {
22974 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
22975 wkt::internal::display_enum(f, self.name(), self.value())
22976 }
22977 }
22978
22979 impl std::convert::From<i32> for PolicyVerdictOverride {
22980 fn from(value: i32) -> Self {
22981 match value {
22982 0 => Self::Unspecified,
22983 1 => Self::PolicyOverridden,
22984 2 => Self::PolicySuspended,
22985 _ => Self::UnknownValue(policy_verdict_override::UnknownValue(
22986 wkt::internal::UnknownEnumValue::Integer(value),
22987 )),
22988 }
22989 }
22990 }
22991
22992 impl std::convert::From<&str> for PolicyVerdictOverride {
22993 fn from(value: &str) -> Self {
22994 use std::string::ToString;
22995 match value {
22996 "POLICY_VERDICT_OVERRIDE_UNSPECIFIED" => Self::Unspecified,
22997 "POLICY_OVERRIDDEN" => Self::PolicyOverridden,
22998 "POLICY_SUSPENDED" => Self::PolicySuspended,
22999 _ => Self::UnknownValue(policy_verdict_override::UnknownValue(
23000 wkt::internal::UnknownEnumValue::String(value.to_string()),
23001 )),
23002 }
23003 }
23004 }
23005
23006 impl serde::ser::Serialize for PolicyVerdictOverride {
23007 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
23008 where
23009 S: serde::Serializer,
23010 {
23011 match self {
23012 Self::Unspecified => serializer.serialize_i32(0),
23013 Self::PolicyOverridden => serializer.serialize_i32(1),
23014 Self::PolicySuspended => serializer.serialize_i32(2),
23015 Self::UnknownValue(u) => u.0.serialize(serializer),
23016 }
23017 }
23018 }
23019
23020 impl<'de> serde::de::Deserialize<'de> for PolicyVerdictOverride {
23021 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
23022 where
23023 D: serde::Deserializer<'de>,
23024 {
23025 deserializer.deserialize_any(wkt::internal::EnumVisitor::<PolicyVerdictOverride>::new(
23026 ".google.cloud.deploy.v1.DeployPolicyEvaluationEvent.PolicyVerdictOverride",
23027 ))
23028 }
23029 }
23030}
23031
23032/// Payload proto for "clouddeploy.googleapis.com/deploypolicy_notification".
23033/// Platform Log event that describes the failure to send a pub/sub notification
23034/// when there is a DeployPolicy status change.
23035#[derive(Clone, Default, PartialEq)]
23036#[non_exhaustive]
23037pub struct DeployPolicyNotificationEvent {
23038 /// Debug message for when a deploy policy fails to send a pub/sub
23039 /// notification.
23040 pub message: std::string::String,
23041
23042 /// The name of the `DeployPolicy`.
23043 pub deploy_policy: std::string::String,
23044
23045 /// Unique identifier of the deploy policy.
23046 pub deploy_policy_uid: std::string::String,
23047
23048 /// Type of this notification, e.g. for a Pub/Sub failure.
23049 pub r#type: crate::model::Type,
23050
23051 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23052}
23053
23054impl DeployPolicyNotificationEvent {
23055 pub fn new() -> Self {
23056 std::default::Default::default()
23057 }
23058
23059 /// Sets the value of [message][crate::model::DeployPolicyNotificationEvent::message].
23060 ///
23061 /// # Example
23062 /// ```ignore,no_run
23063 /// # use google_cloud_deploy_v1::model::DeployPolicyNotificationEvent;
23064 /// let x = DeployPolicyNotificationEvent::new().set_message("example");
23065 /// ```
23066 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23067 self.message = v.into();
23068 self
23069 }
23070
23071 /// Sets the value of [deploy_policy][crate::model::DeployPolicyNotificationEvent::deploy_policy].
23072 ///
23073 /// # Example
23074 /// ```ignore,no_run
23075 /// # use google_cloud_deploy_v1::model::DeployPolicyNotificationEvent;
23076 /// let x = DeployPolicyNotificationEvent::new().set_deploy_policy("example");
23077 /// ```
23078 pub fn set_deploy_policy<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23079 self.deploy_policy = v.into();
23080 self
23081 }
23082
23083 /// Sets the value of [deploy_policy_uid][crate::model::DeployPolicyNotificationEvent::deploy_policy_uid].
23084 ///
23085 /// # Example
23086 /// ```ignore,no_run
23087 /// # use google_cloud_deploy_v1::model::DeployPolicyNotificationEvent;
23088 /// let x = DeployPolicyNotificationEvent::new().set_deploy_policy_uid("example");
23089 /// ```
23090 pub fn set_deploy_policy_uid<T: std::convert::Into<std::string::String>>(
23091 mut self,
23092 v: T,
23093 ) -> Self {
23094 self.deploy_policy_uid = v.into();
23095 self
23096 }
23097
23098 /// Sets the value of [r#type][crate::model::DeployPolicyNotificationEvent::type].
23099 ///
23100 /// # Example
23101 /// ```ignore,no_run
23102 /// # use google_cloud_deploy_v1::model::DeployPolicyNotificationEvent;
23103 /// use google_cloud_deploy_v1::model::Type;
23104 /// let x0 = DeployPolicyNotificationEvent::new().set_type(Type::PubsubNotificationFailure);
23105 /// let x1 = DeployPolicyNotificationEvent::new().set_type(Type::ResourceStateChange);
23106 /// let x2 = DeployPolicyNotificationEvent::new().set_type(Type::ProcessAborted);
23107 /// ```
23108 pub fn set_type<T: std::convert::Into<crate::model::Type>>(mut self, v: T) -> Self {
23109 self.r#type = v.into();
23110 self
23111 }
23112}
23113
23114impl wkt::message::Message for DeployPolicyNotificationEvent {
23115 fn typename() -> &'static str {
23116 "type.googleapis.com/google.cloud.deploy.v1.DeployPolicyNotificationEvent"
23117 }
23118}
23119
23120/// Payload proto for "clouddeploy.googleapis.com/jobrun_notification"
23121/// Platform Log event that describes the failure to send JobRun resource update
23122/// Pub/Sub notification.
23123#[derive(Clone, Default, PartialEq)]
23124#[non_exhaustive]
23125pub struct JobRunNotificationEvent {
23126 /// Debug message for when a notification fails to send.
23127 pub message: std::string::String,
23128
23129 /// The name of the `JobRun`.
23130 pub job_run: std::string::String,
23131
23132 /// Unique identifier of the `DeliveryPipeline`.
23133 pub pipeline_uid: std::string::String,
23134
23135 /// Unique identifier of the `Release`.
23136 pub release_uid: std::string::String,
23137
23138 /// The name of the `Release`.
23139 pub release: std::string::String,
23140
23141 /// Unique identifier of the `Rollout`.
23142 pub rollout_uid: std::string::String,
23143
23144 /// The name of the `Rollout`.
23145 pub rollout: std::string::String,
23146
23147 /// ID of the `Target`.
23148 pub target_id: std::string::String,
23149
23150 /// Type of this notification, e.g. for a Pub/Sub failure.
23151 pub r#type: crate::model::Type,
23152
23153 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23154}
23155
23156impl JobRunNotificationEvent {
23157 pub fn new() -> Self {
23158 std::default::Default::default()
23159 }
23160
23161 /// Sets the value of [message][crate::model::JobRunNotificationEvent::message].
23162 ///
23163 /// # Example
23164 /// ```ignore,no_run
23165 /// # use google_cloud_deploy_v1::model::JobRunNotificationEvent;
23166 /// let x = JobRunNotificationEvent::new().set_message("example");
23167 /// ```
23168 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23169 self.message = v.into();
23170 self
23171 }
23172
23173 /// Sets the value of [job_run][crate::model::JobRunNotificationEvent::job_run].
23174 ///
23175 /// # Example
23176 /// ```ignore,no_run
23177 /// # use google_cloud_deploy_v1::model::JobRunNotificationEvent;
23178 /// let x = JobRunNotificationEvent::new().set_job_run("example");
23179 /// ```
23180 pub fn set_job_run<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23181 self.job_run = v.into();
23182 self
23183 }
23184
23185 /// Sets the value of [pipeline_uid][crate::model::JobRunNotificationEvent::pipeline_uid].
23186 ///
23187 /// # Example
23188 /// ```ignore,no_run
23189 /// # use google_cloud_deploy_v1::model::JobRunNotificationEvent;
23190 /// let x = JobRunNotificationEvent::new().set_pipeline_uid("example");
23191 /// ```
23192 pub fn set_pipeline_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23193 self.pipeline_uid = v.into();
23194 self
23195 }
23196
23197 /// Sets the value of [release_uid][crate::model::JobRunNotificationEvent::release_uid].
23198 ///
23199 /// # Example
23200 /// ```ignore,no_run
23201 /// # use google_cloud_deploy_v1::model::JobRunNotificationEvent;
23202 /// let x = JobRunNotificationEvent::new().set_release_uid("example");
23203 /// ```
23204 pub fn set_release_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23205 self.release_uid = v.into();
23206 self
23207 }
23208
23209 /// Sets the value of [release][crate::model::JobRunNotificationEvent::release].
23210 ///
23211 /// # Example
23212 /// ```ignore,no_run
23213 /// # use google_cloud_deploy_v1::model::JobRunNotificationEvent;
23214 /// let x = JobRunNotificationEvent::new().set_release("example");
23215 /// ```
23216 pub fn set_release<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23217 self.release = v.into();
23218 self
23219 }
23220
23221 /// Sets the value of [rollout_uid][crate::model::JobRunNotificationEvent::rollout_uid].
23222 ///
23223 /// # Example
23224 /// ```ignore,no_run
23225 /// # use google_cloud_deploy_v1::model::JobRunNotificationEvent;
23226 /// let x = JobRunNotificationEvent::new().set_rollout_uid("example");
23227 /// ```
23228 pub fn set_rollout_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23229 self.rollout_uid = v.into();
23230 self
23231 }
23232
23233 /// Sets the value of [rollout][crate::model::JobRunNotificationEvent::rollout].
23234 ///
23235 /// # Example
23236 /// ```ignore,no_run
23237 /// # use google_cloud_deploy_v1::model::JobRunNotificationEvent;
23238 /// let x = JobRunNotificationEvent::new().set_rollout("example");
23239 /// ```
23240 pub fn set_rollout<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23241 self.rollout = v.into();
23242 self
23243 }
23244
23245 /// Sets the value of [target_id][crate::model::JobRunNotificationEvent::target_id].
23246 ///
23247 /// # Example
23248 /// ```ignore,no_run
23249 /// # use google_cloud_deploy_v1::model::JobRunNotificationEvent;
23250 /// let x = JobRunNotificationEvent::new().set_target_id("example");
23251 /// ```
23252 pub fn set_target_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23253 self.target_id = v.into();
23254 self
23255 }
23256
23257 /// Sets the value of [r#type][crate::model::JobRunNotificationEvent::type].
23258 ///
23259 /// # Example
23260 /// ```ignore,no_run
23261 /// # use google_cloud_deploy_v1::model::JobRunNotificationEvent;
23262 /// use google_cloud_deploy_v1::model::Type;
23263 /// let x0 = JobRunNotificationEvent::new().set_type(Type::PubsubNotificationFailure);
23264 /// let x1 = JobRunNotificationEvent::new().set_type(Type::ResourceStateChange);
23265 /// let x2 = JobRunNotificationEvent::new().set_type(Type::ProcessAborted);
23266 /// ```
23267 pub fn set_type<T: std::convert::Into<crate::model::Type>>(mut self, v: T) -> Self {
23268 self.r#type = v.into();
23269 self
23270 }
23271}
23272
23273impl wkt::message::Message for JobRunNotificationEvent {
23274 fn typename() -> &'static str {
23275 "type.googleapis.com/google.cloud.deploy.v1.JobRunNotificationEvent"
23276 }
23277}
23278
23279/// Payload proto for "clouddeploy.googleapis.com/release_notification"
23280/// Platform Log event that describes the failure to send release status change
23281/// Pub/Sub notification.
23282#[derive(Clone, Default, PartialEq)]
23283#[non_exhaustive]
23284pub struct ReleaseNotificationEvent {
23285 /// Debug message for when a notification fails to send.
23286 pub message: std::string::String,
23287
23288 /// Unique identifier of the `DeliveryPipeline`.
23289 pub pipeline_uid: std::string::String,
23290
23291 /// Unique identifier of the `Release`.
23292 pub release_uid: std::string::String,
23293
23294 /// The name of the `Release`.
23295 pub release: std::string::String,
23296
23297 /// Type of this notification, e.g. for a Pub/Sub failure.
23298 pub r#type: crate::model::Type,
23299
23300 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23301}
23302
23303impl ReleaseNotificationEvent {
23304 pub fn new() -> Self {
23305 std::default::Default::default()
23306 }
23307
23308 /// Sets the value of [message][crate::model::ReleaseNotificationEvent::message].
23309 ///
23310 /// # Example
23311 /// ```ignore,no_run
23312 /// # use google_cloud_deploy_v1::model::ReleaseNotificationEvent;
23313 /// let x = ReleaseNotificationEvent::new().set_message("example");
23314 /// ```
23315 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23316 self.message = v.into();
23317 self
23318 }
23319
23320 /// Sets the value of [pipeline_uid][crate::model::ReleaseNotificationEvent::pipeline_uid].
23321 ///
23322 /// # Example
23323 /// ```ignore,no_run
23324 /// # use google_cloud_deploy_v1::model::ReleaseNotificationEvent;
23325 /// let x = ReleaseNotificationEvent::new().set_pipeline_uid("example");
23326 /// ```
23327 pub fn set_pipeline_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23328 self.pipeline_uid = v.into();
23329 self
23330 }
23331
23332 /// Sets the value of [release_uid][crate::model::ReleaseNotificationEvent::release_uid].
23333 ///
23334 /// # Example
23335 /// ```ignore,no_run
23336 /// # use google_cloud_deploy_v1::model::ReleaseNotificationEvent;
23337 /// let x = ReleaseNotificationEvent::new().set_release_uid("example");
23338 /// ```
23339 pub fn set_release_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23340 self.release_uid = v.into();
23341 self
23342 }
23343
23344 /// Sets the value of [release][crate::model::ReleaseNotificationEvent::release].
23345 ///
23346 /// # Example
23347 /// ```ignore,no_run
23348 /// # use google_cloud_deploy_v1::model::ReleaseNotificationEvent;
23349 /// let x = ReleaseNotificationEvent::new().set_release("example");
23350 /// ```
23351 pub fn set_release<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23352 self.release = v.into();
23353 self
23354 }
23355
23356 /// Sets the value of [r#type][crate::model::ReleaseNotificationEvent::type].
23357 ///
23358 /// # Example
23359 /// ```ignore,no_run
23360 /// # use google_cloud_deploy_v1::model::ReleaseNotificationEvent;
23361 /// use google_cloud_deploy_v1::model::Type;
23362 /// let x0 = ReleaseNotificationEvent::new().set_type(Type::PubsubNotificationFailure);
23363 /// let x1 = ReleaseNotificationEvent::new().set_type(Type::ResourceStateChange);
23364 /// let x2 = ReleaseNotificationEvent::new().set_type(Type::ProcessAborted);
23365 /// ```
23366 pub fn set_type<T: std::convert::Into<crate::model::Type>>(mut self, v: T) -> Self {
23367 self.r#type = v.into();
23368 self
23369 }
23370}
23371
23372impl wkt::message::Message for ReleaseNotificationEvent {
23373 fn typename() -> &'static str {
23374 "type.googleapis.com/google.cloud.deploy.v1.ReleaseNotificationEvent"
23375 }
23376}
23377
23378/// Payload proto for "clouddeploy.googleapis.com/release_render"
23379/// Platform Log event that describes the render status change.
23380#[derive(Clone, Default, PartialEq)]
23381#[non_exhaustive]
23382pub struct ReleaseRenderEvent {
23383 /// Debug message for when a render transition occurs. Provides further
23384 /// details as rendering progresses through render states.
23385 pub message: std::string::String,
23386
23387 /// Unique identifier of the `DeliveryPipeline`.
23388 pub pipeline_uid: std::string::String,
23389
23390 /// The name of the release.
23391 /// release_uid is not in this log message because we write some of these log
23392 /// messages at release creation time, before we've generated the uid.
23393 pub release: std::string::String,
23394
23395 /// Type of this notification, e.g. for a release render state change event.
23396 pub r#type: crate::model::Type,
23397
23398 /// The state of the release render.
23399 pub release_render_state: crate::model::release::RenderState,
23400
23401 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23402}
23403
23404impl ReleaseRenderEvent {
23405 pub fn new() -> Self {
23406 std::default::Default::default()
23407 }
23408
23409 /// Sets the value of [message][crate::model::ReleaseRenderEvent::message].
23410 ///
23411 /// # Example
23412 /// ```ignore,no_run
23413 /// # use google_cloud_deploy_v1::model::ReleaseRenderEvent;
23414 /// let x = ReleaseRenderEvent::new().set_message("example");
23415 /// ```
23416 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23417 self.message = v.into();
23418 self
23419 }
23420
23421 /// Sets the value of [pipeline_uid][crate::model::ReleaseRenderEvent::pipeline_uid].
23422 ///
23423 /// # Example
23424 /// ```ignore,no_run
23425 /// # use google_cloud_deploy_v1::model::ReleaseRenderEvent;
23426 /// let x = ReleaseRenderEvent::new().set_pipeline_uid("example");
23427 /// ```
23428 pub fn set_pipeline_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23429 self.pipeline_uid = v.into();
23430 self
23431 }
23432
23433 /// Sets the value of [release][crate::model::ReleaseRenderEvent::release].
23434 ///
23435 /// # Example
23436 /// ```ignore,no_run
23437 /// # use google_cloud_deploy_v1::model::ReleaseRenderEvent;
23438 /// let x = ReleaseRenderEvent::new().set_release("example");
23439 /// ```
23440 pub fn set_release<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23441 self.release = v.into();
23442 self
23443 }
23444
23445 /// Sets the value of [r#type][crate::model::ReleaseRenderEvent::type].
23446 ///
23447 /// # Example
23448 /// ```ignore,no_run
23449 /// # use google_cloud_deploy_v1::model::ReleaseRenderEvent;
23450 /// use google_cloud_deploy_v1::model::Type;
23451 /// let x0 = ReleaseRenderEvent::new().set_type(Type::PubsubNotificationFailure);
23452 /// let x1 = ReleaseRenderEvent::new().set_type(Type::ResourceStateChange);
23453 /// let x2 = ReleaseRenderEvent::new().set_type(Type::ProcessAborted);
23454 /// ```
23455 pub fn set_type<T: std::convert::Into<crate::model::Type>>(mut self, v: T) -> Self {
23456 self.r#type = v.into();
23457 self
23458 }
23459
23460 /// Sets the value of [release_render_state][crate::model::ReleaseRenderEvent::release_render_state].
23461 ///
23462 /// # Example
23463 /// ```ignore,no_run
23464 /// # use google_cloud_deploy_v1::model::ReleaseRenderEvent;
23465 /// use google_cloud_deploy_v1::model::release::RenderState;
23466 /// let x0 = ReleaseRenderEvent::new().set_release_render_state(RenderState::Succeeded);
23467 /// let x1 = ReleaseRenderEvent::new().set_release_render_state(RenderState::Failed);
23468 /// let x2 = ReleaseRenderEvent::new().set_release_render_state(RenderState::InProgress);
23469 /// ```
23470 pub fn set_release_render_state<T: std::convert::Into<crate::model::release::RenderState>>(
23471 mut self,
23472 v: T,
23473 ) -> Self {
23474 self.release_render_state = v.into();
23475 self
23476 }
23477}
23478
23479impl wkt::message::Message for ReleaseRenderEvent {
23480 fn typename() -> &'static str {
23481 "type.googleapis.com/google.cloud.deploy.v1.ReleaseRenderEvent"
23482 }
23483}
23484
23485/// Payload proto for "clouddeploy.googleapis.com/rollout_notification"
23486/// Platform Log event that describes the failure to send rollout status change
23487/// Pub/Sub notification.
23488#[derive(Clone, Default, PartialEq)]
23489#[non_exhaustive]
23490pub struct RolloutNotificationEvent {
23491 /// Debug message for when a notification fails to send.
23492 pub message: std::string::String,
23493
23494 /// Unique identifier of the `DeliveryPipeline`.
23495 pub pipeline_uid: std::string::String,
23496
23497 /// Unique identifier of the `Release`.
23498 pub release_uid: std::string::String,
23499
23500 /// The name of the `Release`.
23501 pub release: std::string::String,
23502
23503 /// Unique identifier of the `Rollout`.
23504 pub rollout_uid: std::string::String,
23505
23506 /// The name of the `Rollout`.
23507 pub rollout: std::string::String,
23508
23509 /// ID of the `Target` that the rollout is deployed to.
23510 pub target_id: std::string::String,
23511
23512 /// Type of this notification, e.g. for a Pub/Sub failure.
23513 pub r#type: crate::model::Type,
23514
23515 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23516}
23517
23518impl RolloutNotificationEvent {
23519 pub fn new() -> Self {
23520 std::default::Default::default()
23521 }
23522
23523 /// Sets the value of [message][crate::model::RolloutNotificationEvent::message].
23524 ///
23525 /// # Example
23526 /// ```ignore,no_run
23527 /// # use google_cloud_deploy_v1::model::RolloutNotificationEvent;
23528 /// let x = RolloutNotificationEvent::new().set_message("example");
23529 /// ```
23530 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23531 self.message = v.into();
23532 self
23533 }
23534
23535 /// Sets the value of [pipeline_uid][crate::model::RolloutNotificationEvent::pipeline_uid].
23536 ///
23537 /// # Example
23538 /// ```ignore,no_run
23539 /// # use google_cloud_deploy_v1::model::RolloutNotificationEvent;
23540 /// let x = RolloutNotificationEvent::new().set_pipeline_uid("example");
23541 /// ```
23542 pub fn set_pipeline_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23543 self.pipeline_uid = v.into();
23544 self
23545 }
23546
23547 /// Sets the value of [release_uid][crate::model::RolloutNotificationEvent::release_uid].
23548 ///
23549 /// # Example
23550 /// ```ignore,no_run
23551 /// # use google_cloud_deploy_v1::model::RolloutNotificationEvent;
23552 /// let x = RolloutNotificationEvent::new().set_release_uid("example");
23553 /// ```
23554 pub fn set_release_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23555 self.release_uid = v.into();
23556 self
23557 }
23558
23559 /// Sets the value of [release][crate::model::RolloutNotificationEvent::release].
23560 ///
23561 /// # Example
23562 /// ```ignore,no_run
23563 /// # use google_cloud_deploy_v1::model::RolloutNotificationEvent;
23564 /// let x = RolloutNotificationEvent::new().set_release("example");
23565 /// ```
23566 pub fn set_release<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23567 self.release = v.into();
23568 self
23569 }
23570
23571 /// Sets the value of [rollout_uid][crate::model::RolloutNotificationEvent::rollout_uid].
23572 ///
23573 /// # Example
23574 /// ```ignore,no_run
23575 /// # use google_cloud_deploy_v1::model::RolloutNotificationEvent;
23576 /// let x = RolloutNotificationEvent::new().set_rollout_uid("example");
23577 /// ```
23578 pub fn set_rollout_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23579 self.rollout_uid = v.into();
23580 self
23581 }
23582
23583 /// Sets the value of [rollout][crate::model::RolloutNotificationEvent::rollout].
23584 ///
23585 /// # Example
23586 /// ```ignore,no_run
23587 /// # use google_cloud_deploy_v1::model::RolloutNotificationEvent;
23588 /// let x = RolloutNotificationEvent::new().set_rollout("example");
23589 /// ```
23590 pub fn set_rollout<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23591 self.rollout = v.into();
23592 self
23593 }
23594
23595 /// Sets the value of [target_id][crate::model::RolloutNotificationEvent::target_id].
23596 ///
23597 /// # Example
23598 /// ```ignore,no_run
23599 /// # use google_cloud_deploy_v1::model::RolloutNotificationEvent;
23600 /// let x = RolloutNotificationEvent::new().set_target_id("example");
23601 /// ```
23602 pub fn set_target_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23603 self.target_id = v.into();
23604 self
23605 }
23606
23607 /// Sets the value of [r#type][crate::model::RolloutNotificationEvent::type].
23608 ///
23609 /// # Example
23610 /// ```ignore,no_run
23611 /// # use google_cloud_deploy_v1::model::RolloutNotificationEvent;
23612 /// use google_cloud_deploy_v1::model::Type;
23613 /// let x0 = RolloutNotificationEvent::new().set_type(Type::PubsubNotificationFailure);
23614 /// let x1 = RolloutNotificationEvent::new().set_type(Type::ResourceStateChange);
23615 /// let x2 = RolloutNotificationEvent::new().set_type(Type::ProcessAborted);
23616 /// ```
23617 pub fn set_type<T: std::convert::Into<crate::model::Type>>(mut self, v: T) -> Self {
23618 self.r#type = v.into();
23619 self
23620 }
23621}
23622
23623impl wkt::message::Message for RolloutNotificationEvent {
23624 fn typename() -> &'static str {
23625 "type.googleapis.com/google.cloud.deploy.v1.RolloutNotificationEvent"
23626 }
23627}
23628
23629/// Payload proto for "clouddeploy.googleapis.com/rollout_update"
23630/// Platform Log event that describes the rollout update event.
23631#[derive(Clone, Default, PartialEq)]
23632#[non_exhaustive]
23633pub struct RolloutUpdateEvent {
23634 /// Debug message for when a rollout update event occurs.
23635 pub message: std::string::String,
23636
23637 /// Unique identifier of the pipeline.
23638 pub pipeline_uid: std::string::String,
23639
23640 /// Unique identifier of the release.
23641 pub release_uid: std::string::String,
23642
23643 /// The name of the `Release`.
23644 pub release: std::string::String,
23645
23646 /// The name of the rollout.
23647 /// rollout_uid is not in this log message because we write some of these log
23648 /// messages at rollout creation time, before we've generated the uid.
23649 pub rollout: std::string::String,
23650
23651 /// ID of the target.
23652 pub target_id: std::string::String,
23653
23654 /// Type of this notification, e.g. for a rollout update event.
23655 pub r#type: crate::model::Type,
23656
23657 /// The type of the rollout update.
23658 pub rollout_update_type: crate::model::rollout_update_event::RolloutUpdateType,
23659
23660 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23661}
23662
23663impl RolloutUpdateEvent {
23664 pub fn new() -> Self {
23665 std::default::Default::default()
23666 }
23667
23668 /// Sets the value of [message][crate::model::RolloutUpdateEvent::message].
23669 ///
23670 /// # Example
23671 /// ```ignore,no_run
23672 /// # use google_cloud_deploy_v1::model::RolloutUpdateEvent;
23673 /// let x = RolloutUpdateEvent::new().set_message("example");
23674 /// ```
23675 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23676 self.message = v.into();
23677 self
23678 }
23679
23680 /// Sets the value of [pipeline_uid][crate::model::RolloutUpdateEvent::pipeline_uid].
23681 ///
23682 /// # Example
23683 /// ```ignore,no_run
23684 /// # use google_cloud_deploy_v1::model::RolloutUpdateEvent;
23685 /// let x = RolloutUpdateEvent::new().set_pipeline_uid("example");
23686 /// ```
23687 pub fn set_pipeline_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23688 self.pipeline_uid = v.into();
23689 self
23690 }
23691
23692 /// Sets the value of [release_uid][crate::model::RolloutUpdateEvent::release_uid].
23693 ///
23694 /// # Example
23695 /// ```ignore,no_run
23696 /// # use google_cloud_deploy_v1::model::RolloutUpdateEvent;
23697 /// let x = RolloutUpdateEvent::new().set_release_uid("example");
23698 /// ```
23699 pub fn set_release_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23700 self.release_uid = v.into();
23701 self
23702 }
23703
23704 /// Sets the value of [release][crate::model::RolloutUpdateEvent::release].
23705 ///
23706 /// # Example
23707 /// ```ignore,no_run
23708 /// # use google_cloud_deploy_v1::model::RolloutUpdateEvent;
23709 /// let x = RolloutUpdateEvent::new().set_release("example");
23710 /// ```
23711 pub fn set_release<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23712 self.release = v.into();
23713 self
23714 }
23715
23716 /// Sets the value of [rollout][crate::model::RolloutUpdateEvent::rollout].
23717 ///
23718 /// # Example
23719 /// ```ignore,no_run
23720 /// # use google_cloud_deploy_v1::model::RolloutUpdateEvent;
23721 /// let x = RolloutUpdateEvent::new().set_rollout("example");
23722 /// ```
23723 pub fn set_rollout<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23724 self.rollout = v.into();
23725 self
23726 }
23727
23728 /// Sets the value of [target_id][crate::model::RolloutUpdateEvent::target_id].
23729 ///
23730 /// # Example
23731 /// ```ignore,no_run
23732 /// # use google_cloud_deploy_v1::model::RolloutUpdateEvent;
23733 /// let x = RolloutUpdateEvent::new().set_target_id("example");
23734 /// ```
23735 pub fn set_target_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23736 self.target_id = v.into();
23737 self
23738 }
23739
23740 /// Sets the value of [r#type][crate::model::RolloutUpdateEvent::type].
23741 ///
23742 /// # Example
23743 /// ```ignore,no_run
23744 /// # use google_cloud_deploy_v1::model::RolloutUpdateEvent;
23745 /// use google_cloud_deploy_v1::model::Type;
23746 /// let x0 = RolloutUpdateEvent::new().set_type(Type::PubsubNotificationFailure);
23747 /// let x1 = RolloutUpdateEvent::new().set_type(Type::ResourceStateChange);
23748 /// let x2 = RolloutUpdateEvent::new().set_type(Type::ProcessAborted);
23749 /// ```
23750 pub fn set_type<T: std::convert::Into<crate::model::Type>>(mut self, v: T) -> Self {
23751 self.r#type = v.into();
23752 self
23753 }
23754
23755 /// Sets the value of [rollout_update_type][crate::model::RolloutUpdateEvent::rollout_update_type].
23756 ///
23757 /// # Example
23758 /// ```ignore,no_run
23759 /// # use google_cloud_deploy_v1::model::RolloutUpdateEvent;
23760 /// use google_cloud_deploy_v1::model::rollout_update_event::RolloutUpdateType;
23761 /// let x0 = RolloutUpdateEvent::new().set_rollout_update_type(RolloutUpdateType::Pending);
23762 /// let x1 = RolloutUpdateEvent::new().set_rollout_update_type(RolloutUpdateType::PendingRelease);
23763 /// let x2 = RolloutUpdateEvent::new().set_rollout_update_type(RolloutUpdateType::InProgress);
23764 /// ```
23765 pub fn set_rollout_update_type<
23766 T: std::convert::Into<crate::model::rollout_update_event::RolloutUpdateType>,
23767 >(
23768 mut self,
23769 v: T,
23770 ) -> Self {
23771 self.rollout_update_type = v.into();
23772 self
23773 }
23774}
23775
23776impl wkt::message::Message for RolloutUpdateEvent {
23777 fn typename() -> &'static str {
23778 "type.googleapis.com/google.cloud.deploy.v1.RolloutUpdateEvent"
23779 }
23780}
23781
23782/// Defines additional types related to [RolloutUpdateEvent].
23783pub mod rollout_update_event {
23784 #[allow(unused_imports)]
23785 use super::*;
23786
23787 /// RolloutUpdateType indicates the type of the rollout update.
23788 ///
23789 /// # Working with unknown values
23790 ///
23791 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
23792 /// additional enum variants at any time. Adding new variants is not considered
23793 /// a breaking change. Applications should write their code in anticipation of:
23794 ///
23795 /// - New values appearing in future releases of the client library, **and**
23796 /// - New values received dynamically, without application changes.
23797 ///
23798 /// Please consult the [Working with enums] section in the user guide for some
23799 /// guidelines.
23800 ///
23801 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
23802 #[derive(Clone, Debug, PartialEq)]
23803 #[non_exhaustive]
23804 pub enum RolloutUpdateType {
23805 /// Rollout update type unspecified.
23806 Unspecified,
23807 /// rollout state updated to pending.
23808 Pending,
23809 /// Rollout state updated to pending release.
23810 PendingRelease,
23811 /// Rollout state updated to in progress.
23812 InProgress,
23813 /// Rollout state updated to cancelling.
23814 Cancelling,
23815 /// Rollout state updated to cancelled.
23816 Cancelled,
23817 /// Rollout state updated to halted.
23818 Halted,
23819 /// Rollout state updated to succeeded.
23820 Succeeded,
23821 /// Rollout state updated to failed.
23822 Failed,
23823 /// Rollout requires approval.
23824 ApprovalRequired,
23825 /// Rollout has been approved.
23826 Approved,
23827 /// Rollout has been rejected.
23828 Rejected,
23829 /// Rollout requires advance to the next phase.
23830 AdvanceRequired,
23831 /// Rollout has been advanced.
23832 Advanced,
23833 /// If set, the enum was initialized with an unknown value.
23834 ///
23835 /// Applications can examine the value using [RolloutUpdateType::value] or
23836 /// [RolloutUpdateType::name].
23837 UnknownValue(rollout_update_type::UnknownValue),
23838 }
23839
23840 #[doc(hidden)]
23841 pub mod rollout_update_type {
23842 #[allow(unused_imports)]
23843 use super::*;
23844 #[derive(Clone, Debug, PartialEq)]
23845 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
23846 }
23847
23848 impl RolloutUpdateType {
23849 /// Gets the enum value.
23850 ///
23851 /// Returns `None` if the enum contains an unknown value deserialized from
23852 /// the string representation of enums.
23853 pub fn value(&self) -> std::option::Option<i32> {
23854 match self {
23855 Self::Unspecified => std::option::Option::Some(0),
23856 Self::Pending => std::option::Option::Some(1),
23857 Self::PendingRelease => std::option::Option::Some(2),
23858 Self::InProgress => std::option::Option::Some(3),
23859 Self::Cancelling => std::option::Option::Some(4),
23860 Self::Cancelled => std::option::Option::Some(5),
23861 Self::Halted => std::option::Option::Some(6),
23862 Self::Succeeded => std::option::Option::Some(7),
23863 Self::Failed => std::option::Option::Some(8),
23864 Self::ApprovalRequired => std::option::Option::Some(9),
23865 Self::Approved => std::option::Option::Some(10),
23866 Self::Rejected => std::option::Option::Some(11),
23867 Self::AdvanceRequired => std::option::Option::Some(12),
23868 Self::Advanced => std::option::Option::Some(13),
23869 Self::UnknownValue(u) => u.0.value(),
23870 }
23871 }
23872
23873 /// Gets the enum value as a string.
23874 ///
23875 /// Returns `None` if the enum contains an unknown value deserialized from
23876 /// the integer representation of enums.
23877 pub fn name(&self) -> std::option::Option<&str> {
23878 match self {
23879 Self::Unspecified => std::option::Option::Some("ROLLOUT_UPDATE_TYPE_UNSPECIFIED"),
23880 Self::Pending => std::option::Option::Some("PENDING"),
23881 Self::PendingRelease => std::option::Option::Some("PENDING_RELEASE"),
23882 Self::InProgress => std::option::Option::Some("IN_PROGRESS"),
23883 Self::Cancelling => std::option::Option::Some("CANCELLING"),
23884 Self::Cancelled => std::option::Option::Some("CANCELLED"),
23885 Self::Halted => std::option::Option::Some("HALTED"),
23886 Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
23887 Self::Failed => std::option::Option::Some("FAILED"),
23888 Self::ApprovalRequired => std::option::Option::Some("APPROVAL_REQUIRED"),
23889 Self::Approved => std::option::Option::Some("APPROVED"),
23890 Self::Rejected => std::option::Option::Some("REJECTED"),
23891 Self::AdvanceRequired => std::option::Option::Some("ADVANCE_REQUIRED"),
23892 Self::Advanced => std::option::Option::Some("ADVANCED"),
23893 Self::UnknownValue(u) => u.0.name(),
23894 }
23895 }
23896 }
23897
23898 impl std::default::Default for RolloutUpdateType {
23899 fn default() -> Self {
23900 use std::convert::From;
23901 Self::from(0)
23902 }
23903 }
23904
23905 impl std::fmt::Display for RolloutUpdateType {
23906 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
23907 wkt::internal::display_enum(f, self.name(), self.value())
23908 }
23909 }
23910
23911 impl std::convert::From<i32> for RolloutUpdateType {
23912 fn from(value: i32) -> Self {
23913 match value {
23914 0 => Self::Unspecified,
23915 1 => Self::Pending,
23916 2 => Self::PendingRelease,
23917 3 => Self::InProgress,
23918 4 => Self::Cancelling,
23919 5 => Self::Cancelled,
23920 6 => Self::Halted,
23921 7 => Self::Succeeded,
23922 8 => Self::Failed,
23923 9 => Self::ApprovalRequired,
23924 10 => Self::Approved,
23925 11 => Self::Rejected,
23926 12 => Self::AdvanceRequired,
23927 13 => Self::Advanced,
23928 _ => Self::UnknownValue(rollout_update_type::UnknownValue(
23929 wkt::internal::UnknownEnumValue::Integer(value),
23930 )),
23931 }
23932 }
23933 }
23934
23935 impl std::convert::From<&str> for RolloutUpdateType {
23936 fn from(value: &str) -> Self {
23937 use std::string::ToString;
23938 match value {
23939 "ROLLOUT_UPDATE_TYPE_UNSPECIFIED" => Self::Unspecified,
23940 "PENDING" => Self::Pending,
23941 "PENDING_RELEASE" => Self::PendingRelease,
23942 "IN_PROGRESS" => Self::InProgress,
23943 "CANCELLING" => Self::Cancelling,
23944 "CANCELLED" => Self::Cancelled,
23945 "HALTED" => Self::Halted,
23946 "SUCCEEDED" => Self::Succeeded,
23947 "FAILED" => Self::Failed,
23948 "APPROVAL_REQUIRED" => Self::ApprovalRequired,
23949 "APPROVED" => Self::Approved,
23950 "REJECTED" => Self::Rejected,
23951 "ADVANCE_REQUIRED" => Self::AdvanceRequired,
23952 "ADVANCED" => Self::Advanced,
23953 _ => Self::UnknownValue(rollout_update_type::UnknownValue(
23954 wkt::internal::UnknownEnumValue::String(value.to_string()),
23955 )),
23956 }
23957 }
23958 }
23959
23960 impl serde::ser::Serialize for RolloutUpdateType {
23961 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
23962 where
23963 S: serde::Serializer,
23964 {
23965 match self {
23966 Self::Unspecified => serializer.serialize_i32(0),
23967 Self::Pending => serializer.serialize_i32(1),
23968 Self::PendingRelease => serializer.serialize_i32(2),
23969 Self::InProgress => serializer.serialize_i32(3),
23970 Self::Cancelling => serializer.serialize_i32(4),
23971 Self::Cancelled => serializer.serialize_i32(5),
23972 Self::Halted => serializer.serialize_i32(6),
23973 Self::Succeeded => serializer.serialize_i32(7),
23974 Self::Failed => serializer.serialize_i32(8),
23975 Self::ApprovalRequired => serializer.serialize_i32(9),
23976 Self::Approved => serializer.serialize_i32(10),
23977 Self::Rejected => serializer.serialize_i32(11),
23978 Self::AdvanceRequired => serializer.serialize_i32(12),
23979 Self::Advanced => serializer.serialize_i32(13),
23980 Self::UnknownValue(u) => u.0.serialize(serializer),
23981 }
23982 }
23983 }
23984
23985 impl<'de> serde::de::Deserialize<'de> for RolloutUpdateType {
23986 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
23987 where
23988 D: serde::Deserializer<'de>,
23989 {
23990 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RolloutUpdateType>::new(
23991 ".google.cloud.deploy.v1.RolloutUpdateEvent.RolloutUpdateType",
23992 ))
23993 }
23994 }
23995}
23996
23997/// Payload proto for "clouddeploy.googleapis.com/target_notification"
23998/// Platform Log event that describes the failure to send target status change
23999/// Pub/Sub notification.
24000#[derive(Clone, Default, PartialEq)]
24001#[non_exhaustive]
24002pub struct TargetNotificationEvent {
24003 /// Debug message for when a notification fails to send.
24004 pub message: std::string::String,
24005
24006 /// The name of the `Target`.
24007 pub target: std::string::String,
24008
24009 /// Type of this notification, e.g. for a Pub/Sub failure.
24010 pub r#type: crate::model::Type,
24011
24012 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24013}
24014
24015impl TargetNotificationEvent {
24016 pub fn new() -> Self {
24017 std::default::Default::default()
24018 }
24019
24020 /// Sets the value of [message][crate::model::TargetNotificationEvent::message].
24021 ///
24022 /// # Example
24023 /// ```ignore,no_run
24024 /// # use google_cloud_deploy_v1::model::TargetNotificationEvent;
24025 /// let x = TargetNotificationEvent::new().set_message("example");
24026 /// ```
24027 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24028 self.message = v.into();
24029 self
24030 }
24031
24032 /// Sets the value of [target][crate::model::TargetNotificationEvent::target].
24033 ///
24034 /// # Example
24035 /// ```ignore,no_run
24036 /// # use google_cloud_deploy_v1::model::TargetNotificationEvent;
24037 /// let x = TargetNotificationEvent::new().set_target("example");
24038 /// ```
24039 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24040 self.target = v.into();
24041 self
24042 }
24043
24044 /// Sets the value of [r#type][crate::model::TargetNotificationEvent::type].
24045 ///
24046 /// # Example
24047 /// ```ignore,no_run
24048 /// # use google_cloud_deploy_v1::model::TargetNotificationEvent;
24049 /// use google_cloud_deploy_v1::model::Type;
24050 /// let x0 = TargetNotificationEvent::new().set_type(Type::PubsubNotificationFailure);
24051 /// let x1 = TargetNotificationEvent::new().set_type(Type::ResourceStateChange);
24052 /// let x2 = TargetNotificationEvent::new().set_type(Type::ProcessAborted);
24053 /// ```
24054 pub fn set_type<T: std::convert::Into<crate::model::Type>>(mut self, v: T) -> Self {
24055 self.r#type = v.into();
24056 self
24057 }
24058}
24059
24060impl wkt::message::Message for TargetNotificationEvent {
24061 fn typename() -> &'static str {
24062 "type.googleapis.com/google.cloud.deploy.v1.TargetNotificationEvent"
24063 }
24064}
24065
24066/// The support state of a specific Skaffold version.
24067///
24068/// # Working with unknown values
24069///
24070/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
24071/// additional enum variants at any time. Adding new variants is not considered
24072/// a breaking change. Applications should write their code in anticipation of:
24073///
24074/// - New values appearing in future releases of the client library, **and**
24075/// - New values received dynamically, without application changes.
24076///
24077/// Please consult the [Working with enums] section in the user guide for some
24078/// guidelines.
24079///
24080/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
24081#[derive(Clone, Debug, PartialEq)]
24082#[non_exhaustive]
24083pub enum SkaffoldSupportState {
24084 /// Default value. This value is unused.
24085 Unspecified,
24086 /// This Skaffold version is currently supported.
24087 Supported,
24088 /// This Skaffold version is in maintenance mode.
24089 MaintenanceMode,
24090 /// This Skaffold version is no longer supported.
24091 Unsupported,
24092 /// If set, the enum was initialized with an unknown value.
24093 ///
24094 /// Applications can examine the value using [SkaffoldSupportState::value] or
24095 /// [SkaffoldSupportState::name].
24096 UnknownValue(skaffold_support_state::UnknownValue),
24097}
24098
24099#[doc(hidden)]
24100pub mod skaffold_support_state {
24101 #[allow(unused_imports)]
24102 use super::*;
24103 #[derive(Clone, Debug, PartialEq)]
24104 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
24105}
24106
24107impl SkaffoldSupportState {
24108 /// Gets the enum value.
24109 ///
24110 /// Returns `None` if the enum contains an unknown value deserialized from
24111 /// the string representation of enums.
24112 pub fn value(&self) -> std::option::Option<i32> {
24113 match self {
24114 Self::Unspecified => std::option::Option::Some(0),
24115 Self::Supported => std::option::Option::Some(1),
24116 Self::MaintenanceMode => std::option::Option::Some(2),
24117 Self::Unsupported => std::option::Option::Some(3),
24118 Self::UnknownValue(u) => u.0.value(),
24119 }
24120 }
24121
24122 /// Gets the enum value as a string.
24123 ///
24124 /// Returns `None` if the enum contains an unknown value deserialized from
24125 /// the integer representation of enums.
24126 pub fn name(&self) -> std::option::Option<&str> {
24127 match self {
24128 Self::Unspecified => std::option::Option::Some("SKAFFOLD_SUPPORT_STATE_UNSPECIFIED"),
24129 Self::Supported => std::option::Option::Some("SKAFFOLD_SUPPORT_STATE_SUPPORTED"),
24130 Self::MaintenanceMode => {
24131 std::option::Option::Some("SKAFFOLD_SUPPORT_STATE_MAINTENANCE_MODE")
24132 }
24133 Self::Unsupported => std::option::Option::Some("SKAFFOLD_SUPPORT_STATE_UNSUPPORTED"),
24134 Self::UnknownValue(u) => u.0.name(),
24135 }
24136 }
24137}
24138
24139impl std::default::Default for SkaffoldSupportState {
24140 fn default() -> Self {
24141 use std::convert::From;
24142 Self::from(0)
24143 }
24144}
24145
24146impl std::fmt::Display for SkaffoldSupportState {
24147 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
24148 wkt::internal::display_enum(f, self.name(), self.value())
24149 }
24150}
24151
24152impl std::convert::From<i32> for SkaffoldSupportState {
24153 fn from(value: i32) -> Self {
24154 match value {
24155 0 => Self::Unspecified,
24156 1 => Self::Supported,
24157 2 => Self::MaintenanceMode,
24158 3 => Self::Unsupported,
24159 _ => Self::UnknownValue(skaffold_support_state::UnknownValue(
24160 wkt::internal::UnknownEnumValue::Integer(value),
24161 )),
24162 }
24163 }
24164}
24165
24166impl std::convert::From<&str> for SkaffoldSupportState {
24167 fn from(value: &str) -> Self {
24168 use std::string::ToString;
24169 match value {
24170 "SKAFFOLD_SUPPORT_STATE_UNSPECIFIED" => Self::Unspecified,
24171 "SKAFFOLD_SUPPORT_STATE_SUPPORTED" => Self::Supported,
24172 "SKAFFOLD_SUPPORT_STATE_MAINTENANCE_MODE" => Self::MaintenanceMode,
24173 "SKAFFOLD_SUPPORT_STATE_UNSUPPORTED" => Self::Unsupported,
24174 _ => Self::UnknownValue(skaffold_support_state::UnknownValue(
24175 wkt::internal::UnknownEnumValue::String(value.to_string()),
24176 )),
24177 }
24178 }
24179}
24180
24181impl serde::ser::Serialize for SkaffoldSupportState {
24182 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
24183 where
24184 S: serde::Serializer,
24185 {
24186 match self {
24187 Self::Unspecified => serializer.serialize_i32(0),
24188 Self::Supported => serializer.serialize_i32(1),
24189 Self::MaintenanceMode => serializer.serialize_i32(2),
24190 Self::Unsupported => serializer.serialize_i32(3),
24191 Self::UnknownValue(u) => u.0.serialize(serializer),
24192 }
24193 }
24194}
24195
24196impl<'de> serde::de::Deserialize<'de> for SkaffoldSupportState {
24197 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
24198 where
24199 D: serde::Deserializer<'de>,
24200 {
24201 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SkaffoldSupportState>::new(
24202 ".google.cloud.deploy.v1.SkaffoldSupportState",
24203 ))
24204 }
24205}
24206
24207/// The pattern of how wait time is increased.
24208///
24209/// # Working with unknown values
24210///
24211/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
24212/// additional enum variants at any time. Adding new variants is not considered
24213/// a breaking change. Applications should write their code in anticipation of:
24214///
24215/// - New values appearing in future releases of the client library, **and**
24216/// - New values received dynamically, without application changes.
24217///
24218/// Please consult the [Working with enums] section in the user guide for some
24219/// guidelines.
24220///
24221/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
24222#[derive(Clone, Debug, PartialEq)]
24223#[non_exhaustive]
24224pub enum BackoffMode {
24225 /// No WaitMode is specified.
24226 Unspecified,
24227 /// Increases the wait time linearly.
24228 Linear,
24229 /// Increases the wait time exponentially.
24230 Exponential,
24231 /// If set, the enum was initialized with an unknown value.
24232 ///
24233 /// Applications can examine the value using [BackoffMode::value] or
24234 /// [BackoffMode::name].
24235 UnknownValue(backoff_mode::UnknownValue),
24236}
24237
24238#[doc(hidden)]
24239pub mod backoff_mode {
24240 #[allow(unused_imports)]
24241 use super::*;
24242 #[derive(Clone, Debug, PartialEq)]
24243 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
24244}
24245
24246impl BackoffMode {
24247 /// Gets the enum value.
24248 ///
24249 /// Returns `None` if the enum contains an unknown value deserialized from
24250 /// the string representation of enums.
24251 pub fn value(&self) -> std::option::Option<i32> {
24252 match self {
24253 Self::Unspecified => std::option::Option::Some(0),
24254 Self::Linear => std::option::Option::Some(1),
24255 Self::Exponential => std::option::Option::Some(2),
24256 Self::UnknownValue(u) => u.0.value(),
24257 }
24258 }
24259
24260 /// Gets the enum value as a string.
24261 ///
24262 /// Returns `None` if the enum contains an unknown value deserialized from
24263 /// the integer representation of enums.
24264 pub fn name(&self) -> std::option::Option<&str> {
24265 match self {
24266 Self::Unspecified => std::option::Option::Some("BACKOFF_MODE_UNSPECIFIED"),
24267 Self::Linear => std::option::Option::Some("BACKOFF_MODE_LINEAR"),
24268 Self::Exponential => std::option::Option::Some("BACKOFF_MODE_EXPONENTIAL"),
24269 Self::UnknownValue(u) => u.0.name(),
24270 }
24271 }
24272}
24273
24274impl std::default::Default for BackoffMode {
24275 fn default() -> Self {
24276 use std::convert::From;
24277 Self::from(0)
24278 }
24279}
24280
24281impl std::fmt::Display for BackoffMode {
24282 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
24283 wkt::internal::display_enum(f, self.name(), self.value())
24284 }
24285}
24286
24287impl std::convert::From<i32> for BackoffMode {
24288 fn from(value: i32) -> Self {
24289 match value {
24290 0 => Self::Unspecified,
24291 1 => Self::Linear,
24292 2 => Self::Exponential,
24293 _ => Self::UnknownValue(backoff_mode::UnknownValue(
24294 wkt::internal::UnknownEnumValue::Integer(value),
24295 )),
24296 }
24297 }
24298}
24299
24300impl std::convert::From<&str> for BackoffMode {
24301 fn from(value: &str) -> Self {
24302 use std::string::ToString;
24303 match value {
24304 "BACKOFF_MODE_UNSPECIFIED" => Self::Unspecified,
24305 "BACKOFF_MODE_LINEAR" => Self::Linear,
24306 "BACKOFF_MODE_EXPONENTIAL" => Self::Exponential,
24307 _ => Self::UnknownValue(backoff_mode::UnknownValue(
24308 wkt::internal::UnknownEnumValue::String(value.to_string()),
24309 )),
24310 }
24311 }
24312}
24313
24314impl serde::ser::Serialize for BackoffMode {
24315 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
24316 where
24317 S: serde::Serializer,
24318 {
24319 match self {
24320 Self::Unspecified => serializer.serialize_i32(0),
24321 Self::Linear => serializer.serialize_i32(1),
24322 Self::Exponential => serializer.serialize_i32(2),
24323 Self::UnknownValue(u) => u.0.serialize(serializer),
24324 }
24325 }
24326}
24327
24328impl<'de> serde::de::Deserialize<'de> for BackoffMode {
24329 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
24330 where
24331 D: serde::Deserializer<'de>,
24332 {
24333 deserializer.deserialize_any(wkt::internal::EnumVisitor::<BackoffMode>::new(
24334 ".google.cloud.deploy.v1.BackoffMode",
24335 ))
24336 }
24337}
24338
24339/// Valid state of a repair attempt.
24340///
24341/// # Working with unknown values
24342///
24343/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
24344/// additional enum variants at any time. Adding new variants is not considered
24345/// a breaking change. Applications should write their code in anticipation of:
24346///
24347/// - New values appearing in future releases of the client library, **and**
24348/// - New values received dynamically, without application changes.
24349///
24350/// Please consult the [Working with enums] section in the user guide for some
24351/// guidelines.
24352///
24353/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
24354#[derive(Clone, Debug, PartialEq)]
24355#[non_exhaustive]
24356pub enum RepairState {
24357 /// The `repair` has an unspecified state.
24358 Unspecified,
24359 /// The `repair` action has succeeded.
24360 Succeeded,
24361 /// The `repair` action was cancelled.
24362 Cancelled,
24363 /// The `repair` action has failed.
24364 Failed,
24365 /// The `repair` action is in progress.
24366 InProgress,
24367 /// The `repair` action is pending.
24368 Pending,
24369 /// The `repair` action was aborted.
24370 Aborted,
24371 /// If set, the enum was initialized with an unknown value.
24372 ///
24373 /// Applications can examine the value using [RepairState::value] or
24374 /// [RepairState::name].
24375 UnknownValue(repair_state::UnknownValue),
24376}
24377
24378#[doc(hidden)]
24379pub mod repair_state {
24380 #[allow(unused_imports)]
24381 use super::*;
24382 #[derive(Clone, Debug, PartialEq)]
24383 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
24384}
24385
24386impl RepairState {
24387 /// Gets the enum value.
24388 ///
24389 /// Returns `None` if the enum contains an unknown value deserialized from
24390 /// the string representation of enums.
24391 pub fn value(&self) -> std::option::Option<i32> {
24392 match self {
24393 Self::Unspecified => std::option::Option::Some(0),
24394 Self::Succeeded => std::option::Option::Some(1),
24395 Self::Cancelled => std::option::Option::Some(2),
24396 Self::Failed => std::option::Option::Some(3),
24397 Self::InProgress => std::option::Option::Some(4),
24398 Self::Pending => std::option::Option::Some(5),
24399 Self::Aborted => std::option::Option::Some(7),
24400 Self::UnknownValue(u) => u.0.value(),
24401 }
24402 }
24403
24404 /// Gets the enum value as a string.
24405 ///
24406 /// Returns `None` if the enum contains an unknown value deserialized from
24407 /// the integer representation of enums.
24408 pub fn name(&self) -> std::option::Option<&str> {
24409 match self {
24410 Self::Unspecified => std::option::Option::Some("REPAIR_STATE_UNSPECIFIED"),
24411 Self::Succeeded => std::option::Option::Some("REPAIR_STATE_SUCCEEDED"),
24412 Self::Cancelled => std::option::Option::Some("REPAIR_STATE_CANCELLED"),
24413 Self::Failed => std::option::Option::Some("REPAIR_STATE_FAILED"),
24414 Self::InProgress => std::option::Option::Some("REPAIR_STATE_IN_PROGRESS"),
24415 Self::Pending => std::option::Option::Some("REPAIR_STATE_PENDING"),
24416 Self::Aborted => std::option::Option::Some("REPAIR_STATE_ABORTED"),
24417 Self::UnknownValue(u) => u.0.name(),
24418 }
24419 }
24420}
24421
24422impl std::default::Default for RepairState {
24423 fn default() -> Self {
24424 use std::convert::From;
24425 Self::from(0)
24426 }
24427}
24428
24429impl std::fmt::Display for RepairState {
24430 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
24431 wkt::internal::display_enum(f, self.name(), self.value())
24432 }
24433}
24434
24435impl std::convert::From<i32> for RepairState {
24436 fn from(value: i32) -> Self {
24437 match value {
24438 0 => Self::Unspecified,
24439 1 => Self::Succeeded,
24440 2 => Self::Cancelled,
24441 3 => Self::Failed,
24442 4 => Self::InProgress,
24443 5 => Self::Pending,
24444 7 => Self::Aborted,
24445 _ => Self::UnknownValue(repair_state::UnknownValue(
24446 wkt::internal::UnknownEnumValue::Integer(value),
24447 )),
24448 }
24449 }
24450}
24451
24452impl std::convert::From<&str> for RepairState {
24453 fn from(value: &str) -> Self {
24454 use std::string::ToString;
24455 match value {
24456 "REPAIR_STATE_UNSPECIFIED" => Self::Unspecified,
24457 "REPAIR_STATE_SUCCEEDED" => Self::Succeeded,
24458 "REPAIR_STATE_CANCELLED" => Self::Cancelled,
24459 "REPAIR_STATE_FAILED" => Self::Failed,
24460 "REPAIR_STATE_IN_PROGRESS" => Self::InProgress,
24461 "REPAIR_STATE_PENDING" => Self::Pending,
24462 "REPAIR_STATE_ABORTED" => Self::Aborted,
24463 _ => Self::UnknownValue(repair_state::UnknownValue(
24464 wkt::internal::UnknownEnumValue::String(value.to_string()),
24465 )),
24466 }
24467 }
24468}
24469
24470impl serde::ser::Serialize for RepairState {
24471 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
24472 where
24473 S: serde::Serializer,
24474 {
24475 match self {
24476 Self::Unspecified => serializer.serialize_i32(0),
24477 Self::Succeeded => serializer.serialize_i32(1),
24478 Self::Cancelled => serializer.serialize_i32(2),
24479 Self::Failed => serializer.serialize_i32(3),
24480 Self::InProgress => serializer.serialize_i32(4),
24481 Self::Pending => serializer.serialize_i32(5),
24482 Self::Aborted => serializer.serialize_i32(7),
24483 Self::UnknownValue(u) => u.0.serialize(serializer),
24484 }
24485 }
24486}
24487
24488impl<'de> serde::de::Deserialize<'de> for RepairState {
24489 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
24490 where
24491 D: serde::Deserializer<'de>,
24492 {
24493 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RepairState>::new(
24494 ".google.cloud.deploy.v1.RepairState",
24495 ))
24496 }
24497}
24498
24499/// Type indicates the type of the log entry and can be used as a filter.
24500///
24501/// # Working with unknown values
24502///
24503/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
24504/// additional enum variants at any time. Adding new variants is not considered
24505/// a breaking change. Applications should write their code in anticipation of:
24506///
24507/// - New values appearing in future releases of the client library, **and**
24508/// - New values received dynamically, without application changes.
24509///
24510/// Please consult the [Working with enums] section in the user guide for some
24511/// guidelines.
24512///
24513/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
24514#[derive(Clone, Debug, PartialEq)]
24515#[non_exhaustive]
24516pub enum Type {
24517 /// Type is unspecified.
24518 Unspecified,
24519 /// A Pub/Sub notification failed to be sent.
24520 PubsubNotificationFailure,
24521 /// Resource state changed.
24522 ResourceStateChange,
24523 /// A process aborted.
24524 ProcessAborted,
24525 /// Restriction check failed.
24526 RestrictionViolated,
24527 /// Resource deleted.
24528 ResourceDeleted,
24529 /// Rollout updated.
24530 RolloutUpdate,
24531 /// Deploy Policy evaluation.
24532 DeployPolicyEvaluation,
24533 /// Deprecated: This field is never used. Use release_render log type instead.
24534 #[deprecated]
24535 RenderStatuesChange,
24536 /// If set, the enum was initialized with an unknown value.
24537 ///
24538 /// Applications can examine the value using [Type::value] or
24539 /// [Type::name].
24540 UnknownValue(r#type::UnknownValue),
24541}
24542
24543#[doc(hidden)]
24544pub mod r#type {
24545 #[allow(unused_imports)]
24546 use super::*;
24547 #[derive(Clone, Debug, PartialEq)]
24548 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
24549}
24550
24551impl Type {
24552 /// Gets the enum value.
24553 ///
24554 /// Returns `None` if the enum contains an unknown value deserialized from
24555 /// the string representation of enums.
24556 pub fn value(&self) -> std::option::Option<i32> {
24557 match self {
24558 Self::Unspecified => std::option::Option::Some(0),
24559 Self::PubsubNotificationFailure => std::option::Option::Some(1),
24560 Self::ResourceStateChange => std::option::Option::Some(3),
24561 Self::ProcessAborted => std::option::Option::Some(4),
24562 Self::RestrictionViolated => std::option::Option::Some(5),
24563 Self::ResourceDeleted => std::option::Option::Some(6),
24564 Self::RolloutUpdate => std::option::Option::Some(7),
24565 Self::DeployPolicyEvaluation => std::option::Option::Some(8),
24566 Self::RenderStatuesChange => std::option::Option::Some(2),
24567 Self::UnknownValue(u) => u.0.value(),
24568 }
24569 }
24570
24571 /// Gets the enum value as a string.
24572 ///
24573 /// Returns `None` if the enum contains an unknown value deserialized from
24574 /// the integer representation of enums.
24575 pub fn name(&self) -> std::option::Option<&str> {
24576 match self {
24577 Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
24578 Self::PubsubNotificationFailure => {
24579 std::option::Option::Some("TYPE_PUBSUB_NOTIFICATION_FAILURE")
24580 }
24581 Self::ResourceStateChange => std::option::Option::Some("TYPE_RESOURCE_STATE_CHANGE"),
24582 Self::ProcessAborted => std::option::Option::Some("TYPE_PROCESS_ABORTED"),
24583 Self::RestrictionViolated => std::option::Option::Some("TYPE_RESTRICTION_VIOLATED"),
24584 Self::ResourceDeleted => std::option::Option::Some("TYPE_RESOURCE_DELETED"),
24585 Self::RolloutUpdate => std::option::Option::Some("TYPE_ROLLOUT_UPDATE"),
24586 Self::DeployPolicyEvaluation => {
24587 std::option::Option::Some("TYPE_DEPLOY_POLICY_EVALUATION")
24588 }
24589 Self::RenderStatuesChange => std::option::Option::Some("TYPE_RENDER_STATUES_CHANGE"),
24590 Self::UnknownValue(u) => u.0.name(),
24591 }
24592 }
24593}
24594
24595impl std::default::Default for Type {
24596 fn default() -> Self {
24597 use std::convert::From;
24598 Self::from(0)
24599 }
24600}
24601
24602impl std::fmt::Display for Type {
24603 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
24604 wkt::internal::display_enum(f, self.name(), self.value())
24605 }
24606}
24607
24608impl std::convert::From<i32> for Type {
24609 fn from(value: i32) -> Self {
24610 match value {
24611 0 => Self::Unspecified,
24612 1 => Self::PubsubNotificationFailure,
24613 2 => Self::RenderStatuesChange,
24614 3 => Self::ResourceStateChange,
24615 4 => Self::ProcessAborted,
24616 5 => Self::RestrictionViolated,
24617 6 => Self::ResourceDeleted,
24618 7 => Self::RolloutUpdate,
24619 8 => Self::DeployPolicyEvaluation,
24620 _ => Self::UnknownValue(r#type::UnknownValue(
24621 wkt::internal::UnknownEnumValue::Integer(value),
24622 )),
24623 }
24624 }
24625}
24626
24627impl std::convert::From<&str> for Type {
24628 fn from(value: &str) -> Self {
24629 use std::string::ToString;
24630 match value {
24631 "TYPE_UNSPECIFIED" => Self::Unspecified,
24632 "TYPE_PUBSUB_NOTIFICATION_FAILURE" => Self::PubsubNotificationFailure,
24633 "TYPE_RESOURCE_STATE_CHANGE" => Self::ResourceStateChange,
24634 "TYPE_PROCESS_ABORTED" => Self::ProcessAborted,
24635 "TYPE_RESTRICTION_VIOLATED" => Self::RestrictionViolated,
24636 "TYPE_RESOURCE_DELETED" => Self::ResourceDeleted,
24637 "TYPE_ROLLOUT_UPDATE" => Self::RolloutUpdate,
24638 "TYPE_DEPLOY_POLICY_EVALUATION" => Self::DeployPolicyEvaluation,
24639 "TYPE_RENDER_STATUES_CHANGE" => Self::RenderStatuesChange,
24640 _ => Self::UnknownValue(r#type::UnknownValue(
24641 wkt::internal::UnknownEnumValue::String(value.to_string()),
24642 )),
24643 }
24644 }
24645}
24646
24647impl serde::ser::Serialize for Type {
24648 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
24649 where
24650 S: serde::Serializer,
24651 {
24652 match self {
24653 Self::Unspecified => serializer.serialize_i32(0),
24654 Self::PubsubNotificationFailure => serializer.serialize_i32(1),
24655 Self::ResourceStateChange => serializer.serialize_i32(3),
24656 Self::ProcessAborted => serializer.serialize_i32(4),
24657 Self::RestrictionViolated => serializer.serialize_i32(5),
24658 Self::ResourceDeleted => serializer.serialize_i32(6),
24659 Self::RolloutUpdate => serializer.serialize_i32(7),
24660 Self::DeployPolicyEvaluation => serializer.serialize_i32(8),
24661 Self::RenderStatuesChange => serializer.serialize_i32(2),
24662 Self::UnknownValue(u) => u.0.serialize(serializer),
24663 }
24664 }
24665}
24666
24667impl<'de> serde::de::Deserialize<'de> for Type {
24668 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
24669 where
24670 D: serde::Deserializer<'de>,
24671 {
24672 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
24673 ".google.cloud.deploy.v1.Type",
24674 ))
24675 }
24676}