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::bare_urls)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![allow(rustdoc::invalid_html_tags)]
20#![allow(rustdoc::redundant_explicit_links)]
21#![no_implicit_prelude]
22extern crate async_trait;
23extern crate bytes;
24extern crate gaxi;
25extern crate google_cloud_gax;
26extern crate google_cloud_iam_v1;
27extern crate google_cloud_location;
28extern crate google_cloud_longrunning;
29extern crate google_cloud_lro;
30extern crate google_cloud_type;
31extern crate serde;
32extern crate serde_json;
33extern crate serde_with;
34extern crate std;
35extern crate tracing;
36extern crate wkt;
37
38mod debug;
39mod deserialize;
40mod serialize;
41
42/// Payload proto for "clouddeploy.googleapis.com/automation"
43/// Platform Log event that describes the Automation related events.
44#[derive(Clone, Default, PartialEq)]
45#[non_exhaustive]
46pub struct AutomationEvent {
47 /// Debug message for when there is an update on the AutomationRun.
48 /// Provides further details about the resource creation or state change.
49 pub message: std::string::String,
50
51 /// The name of the `AutomationRun`.
52 pub automation: std::string::String,
53
54 /// Unique identifier of the `DeliveryPipeline`.
55 pub pipeline_uid: std::string::String,
56
57 /// Type of this notification, e.g. for a Pub/Sub failure.
58 pub r#type: crate::model::Type,
59
60 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
61}
62
63impl AutomationEvent {
64 /// Creates a new default instance.
65 pub fn new() -> Self {
66 std::default::Default::default()
67 }
68
69 /// Sets the value of [message][crate::model::AutomationEvent::message].
70 ///
71 /// # Example
72 /// ```ignore,no_run
73 /// # use google_cloud_deploy_v1::model::AutomationEvent;
74 /// let x = AutomationEvent::new().set_message("example");
75 /// ```
76 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
77 self.message = v.into();
78 self
79 }
80
81 /// Sets the value of [automation][crate::model::AutomationEvent::automation].
82 ///
83 /// # Example
84 /// ```ignore,no_run
85 /// # use google_cloud_deploy_v1::model::AutomationEvent;
86 /// let x = AutomationEvent::new().set_automation("example");
87 /// ```
88 pub fn set_automation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
89 self.automation = v.into();
90 self
91 }
92
93 /// Sets the value of [pipeline_uid][crate::model::AutomationEvent::pipeline_uid].
94 ///
95 /// # Example
96 /// ```ignore,no_run
97 /// # use google_cloud_deploy_v1::model::AutomationEvent;
98 /// let x = AutomationEvent::new().set_pipeline_uid("example");
99 /// ```
100 pub fn set_pipeline_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
101 self.pipeline_uid = v.into();
102 self
103 }
104
105 /// Sets the value of [r#type][crate::model::AutomationEvent::type].
106 ///
107 /// # Example
108 /// ```ignore,no_run
109 /// # use google_cloud_deploy_v1::model::AutomationEvent;
110 /// use google_cloud_deploy_v1::model::Type;
111 /// let x0 = AutomationEvent::new().set_type(Type::PubsubNotificationFailure);
112 /// let x1 = AutomationEvent::new().set_type(Type::ResourceStateChange);
113 /// let x2 = AutomationEvent::new().set_type(Type::ProcessAborted);
114 /// ```
115 pub fn set_type<T: std::convert::Into<crate::model::Type>>(mut self, v: T) -> Self {
116 self.r#type = v.into();
117 self
118 }
119}
120
121impl wkt::message::Message for AutomationEvent {
122 fn typename() -> &'static str {
123 "type.googleapis.com/google.cloud.deploy.v1.AutomationEvent"
124 }
125}
126
127/// Payload proto for "clouddeploy.googleapis.com/automation_run"
128/// Platform Log event that describes the AutomationRun related events.
129#[derive(Clone, Default, PartialEq)]
130#[non_exhaustive]
131pub struct AutomationRunEvent {
132 /// Debug message for when there is an update on the AutomationRun.
133 /// Provides further details about the resource creation or state change.
134 pub message: std::string::String,
135
136 /// The name of the `AutomationRun`.
137 pub automation_run: std::string::String,
138
139 /// Unique identifier of the `DeliveryPipeline`.
140 pub pipeline_uid: std::string::String,
141
142 /// Identifier of the `Automation`.
143 pub automation_id: std::string::String,
144
145 /// Identifier of the `Automation` rule.
146 pub rule_id: std::string::String,
147
148 /// ID of the `Target` to which the `AutomationRun` is created.
149 pub destination_target_id: std::string::String,
150
151 /// Type of this notification, e.g. for a Pub/Sub failure.
152 pub r#type: crate::model::Type,
153
154 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
155}
156
157impl AutomationRunEvent {
158 /// Creates a new default instance.
159 pub fn new() -> Self {
160 std::default::Default::default()
161 }
162
163 /// Sets the value of [message][crate::model::AutomationRunEvent::message].
164 ///
165 /// # Example
166 /// ```ignore,no_run
167 /// # use google_cloud_deploy_v1::model::AutomationRunEvent;
168 /// let x = AutomationRunEvent::new().set_message("example");
169 /// ```
170 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
171 self.message = v.into();
172 self
173 }
174
175 /// Sets the value of [automation_run][crate::model::AutomationRunEvent::automation_run].
176 ///
177 /// # Example
178 /// ```ignore,no_run
179 /// # use google_cloud_deploy_v1::model::AutomationRunEvent;
180 /// let x = AutomationRunEvent::new().set_automation_run("example");
181 /// ```
182 pub fn set_automation_run<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
183 self.automation_run = v.into();
184 self
185 }
186
187 /// Sets the value of [pipeline_uid][crate::model::AutomationRunEvent::pipeline_uid].
188 ///
189 /// # Example
190 /// ```ignore,no_run
191 /// # use google_cloud_deploy_v1::model::AutomationRunEvent;
192 /// let x = AutomationRunEvent::new().set_pipeline_uid("example");
193 /// ```
194 pub fn set_pipeline_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
195 self.pipeline_uid = v.into();
196 self
197 }
198
199 /// Sets the value of [automation_id][crate::model::AutomationRunEvent::automation_id].
200 ///
201 /// # Example
202 /// ```ignore,no_run
203 /// # use google_cloud_deploy_v1::model::AutomationRunEvent;
204 /// let x = AutomationRunEvent::new().set_automation_id("example");
205 /// ```
206 pub fn set_automation_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
207 self.automation_id = v.into();
208 self
209 }
210
211 /// Sets the value of [rule_id][crate::model::AutomationRunEvent::rule_id].
212 ///
213 /// # Example
214 /// ```ignore,no_run
215 /// # use google_cloud_deploy_v1::model::AutomationRunEvent;
216 /// let x = AutomationRunEvent::new().set_rule_id("example");
217 /// ```
218 pub fn set_rule_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
219 self.rule_id = v.into();
220 self
221 }
222
223 /// Sets the value of [destination_target_id][crate::model::AutomationRunEvent::destination_target_id].
224 ///
225 /// # Example
226 /// ```ignore,no_run
227 /// # use google_cloud_deploy_v1::model::AutomationRunEvent;
228 /// let x = AutomationRunEvent::new().set_destination_target_id("example");
229 /// ```
230 pub fn set_destination_target_id<T: std::convert::Into<std::string::String>>(
231 mut self,
232 v: T,
233 ) -> Self {
234 self.destination_target_id = v.into();
235 self
236 }
237
238 /// Sets the value of [r#type][crate::model::AutomationRunEvent::type].
239 ///
240 /// # Example
241 /// ```ignore,no_run
242 /// # use google_cloud_deploy_v1::model::AutomationRunEvent;
243 /// use google_cloud_deploy_v1::model::Type;
244 /// let x0 = AutomationRunEvent::new().set_type(Type::PubsubNotificationFailure);
245 /// let x1 = AutomationRunEvent::new().set_type(Type::ResourceStateChange);
246 /// let x2 = AutomationRunEvent::new().set_type(Type::ProcessAborted);
247 /// ```
248 pub fn set_type<T: std::convert::Into<crate::model::Type>>(mut self, v: T) -> Self {
249 self.r#type = v.into();
250 self
251 }
252}
253
254impl wkt::message::Message for AutomationRunEvent {
255 fn typename() -> &'static str {
256 "type.googleapis.com/google.cloud.deploy.v1.AutomationRunEvent"
257 }
258}
259
260/// A `DeliveryPipeline` resource in the Cloud Deploy API.
261///
262/// A `DeliveryPipeline` defines a pipeline through which a Skaffold
263/// configuration can progress.
264#[derive(Clone, Default, PartialEq)]
265#[non_exhaustive]
266pub struct DeliveryPipeline {
267 /// Identifier. Name of the `DeliveryPipeline`. Format is
268 /// `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}`.
269 /// The `deliveryPipeline` component must match
270 /// `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`
271 pub name: std::string::String,
272
273 /// Output only. Unique identifier of the `DeliveryPipeline`.
274 pub uid: std::string::String,
275
276 /// Optional. Description of the `DeliveryPipeline`. Max length is 255
277 /// characters.
278 pub description: std::string::String,
279
280 /// Optional. User annotations. These attributes can only be set and used by
281 /// the user, and not by Cloud Deploy.
282 pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
283
284 /// Labels are attributes that can be set and used by both the
285 /// user and by Cloud Deploy. Labels must meet the following constraints:
286 ///
287 /// * Keys and values can contain only lowercase letters, numeric characters,
288 /// underscores, and dashes.
289 /// * All characters must use UTF-8 encoding, and international characters are
290 /// allowed.
291 /// * Keys must start with a lowercase letter or international character.
292 /// * Each resource is limited to a maximum of 64 labels.
293 ///
294 /// Both keys and values are additionally constrained to be <= 128 bytes.
295 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
296
297 /// Output only. Time at which the pipeline was created.
298 pub create_time: std::option::Option<wkt::Timestamp>,
299
300 /// Output only. Most recent time at which the pipeline was updated.
301 pub update_time: std::option::Option<wkt::Timestamp>,
302
303 /// Output only. Information around the state of the Delivery Pipeline.
304 pub condition: std::option::Option<crate::model::PipelineCondition>,
305
306 /// This checksum is computed by the server based on the value of other
307 /// fields, and may be sent on update and delete requests to ensure the
308 /// client has an up-to-date value before proceeding.
309 pub etag: std::string::String,
310
311 /// Optional. When suspended, no new releases or rollouts can be created,
312 /// but in-progress ones will complete.
313 pub suspended: bool,
314
315 /// The ordering configuration of the `DeliveryPipeline`.
316 pub pipeline: std::option::Option<crate::model::delivery_pipeline::Pipeline>,
317
318 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
319}
320
321impl DeliveryPipeline {
322 /// Creates a new default instance.
323 pub fn new() -> Self {
324 std::default::Default::default()
325 }
326
327 /// Sets the value of [name][crate::model::DeliveryPipeline::name].
328 ///
329 /// # Example
330 /// ```ignore,no_run
331 /// # use google_cloud_deploy_v1::model::DeliveryPipeline;
332 /// # let project_id = "project_id";
333 /// # let location_id = "location_id";
334 /// # let delivery_pipeline_id = "delivery_pipeline_id";
335 /// let x = DeliveryPipeline::new().set_name(format!("projects/{project_id}/locations/{location_id}/deliveryPipelines/{delivery_pipeline_id}"));
336 /// ```
337 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
338 self.name = v.into();
339 self
340 }
341
342 /// Sets the value of [uid][crate::model::DeliveryPipeline::uid].
343 ///
344 /// # Example
345 /// ```ignore,no_run
346 /// # use google_cloud_deploy_v1::model::DeliveryPipeline;
347 /// let x = DeliveryPipeline::new().set_uid("example");
348 /// ```
349 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
350 self.uid = v.into();
351 self
352 }
353
354 /// Sets the value of [description][crate::model::DeliveryPipeline::description].
355 ///
356 /// # Example
357 /// ```ignore,no_run
358 /// # use google_cloud_deploy_v1::model::DeliveryPipeline;
359 /// let x = DeliveryPipeline::new().set_description("example");
360 /// ```
361 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
362 self.description = v.into();
363 self
364 }
365
366 /// Sets the value of [annotations][crate::model::DeliveryPipeline::annotations].
367 ///
368 /// # Example
369 /// ```ignore,no_run
370 /// # use google_cloud_deploy_v1::model::DeliveryPipeline;
371 /// let x = DeliveryPipeline::new().set_annotations([
372 /// ("key0", "abc"),
373 /// ("key1", "xyz"),
374 /// ]);
375 /// ```
376 pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
377 where
378 T: std::iter::IntoIterator<Item = (K, V)>,
379 K: std::convert::Into<std::string::String>,
380 V: std::convert::Into<std::string::String>,
381 {
382 use std::iter::Iterator;
383 self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
384 self
385 }
386
387 /// Sets the value of [labels][crate::model::DeliveryPipeline::labels].
388 ///
389 /// # Example
390 /// ```ignore,no_run
391 /// # use google_cloud_deploy_v1::model::DeliveryPipeline;
392 /// let x = DeliveryPipeline::new().set_labels([
393 /// ("key0", "abc"),
394 /// ("key1", "xyz"),
395 /// ]);
396 /// ```
397 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
398 where
399 T: std::iter::IntoIterator<Item = (K, V)>,
400 K: std::convert::Into<std::string::String>,
401 V: std::convert::Into<std::string::String>,
402 {
403 use std::iter::Iterator;
404 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
405 self
406 }
407
408 /// Sets the value of [create_time][crate::model::DeliveryPipeline::create_time].
409 ///
410 /// # Example
411 /// ```ignore,no_run
412 /// # use google_cloud_deploy_v1::model::DeliveryPipeline;
413 /// use wkt::Timestamp;
414 /// let x = DeliveryPipeline::new().set_create_time(Timestamp::default()/* use setters */);
415 /// ```
416 pub fn set_create_time<T>(mut self, v: T) -> Self
417 where
418 T: std::convert::Into<wkt::Timestamp>,
419 {
420 self.create_time = std::option::Option::Some(v.into());
421 self
422 }
423
424 /// Sets or clears the value of [create_time][crate::model::DeliveryPipeline::create_time].
425 ///
426 /// # Example
427 /// ```ignore,no_run
428 /// # use google_cloud_deploy_v1::model::DeliveryPipeline;
429 /// use wkt::Timestamp;
430 /// let x = DeliveryPipeline::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
431 /// let x = DeliveryPipeline::new().set_or_clear_create_time(None::<Timestamp>);
432 /// ```
433 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
434 where
435 T: std::convert::Into<wkt::Timestamp>,
436 {
437 self.create_time = v.map(|x| x.into());
438 self
439 }
440
441 /// Sets the value of [update_time][crate::model::DeliveryPipeline::update_time].
442 ///
443 /// # Example
444 /// ```ignore,no_run
445 /// # use google_cloud_deploy_v1::model::DeliveryPipeline;
446 /// use wkt::Timestamp;
447 /// let x = DeliveryPipeline::new().set_update_time(Timestamp::default()/* use setters */);
448 /// ```
449 pub fn set_update_time<T>(mut self, v: T) -> Self
450 where
451 T: std::convert::Into<wkt::Timestamp>,
452 {
453 self.update_time = std::option::Option::Some(v.into());
454 self
455 }
456
457 /// Sets or clears the value of [update_time][crate::model::DeliveryPipeline::update_time].
458 ///
459 /// # Example
460 /// ```ignore,no_run
461 /// # use google_cloud_deploy_v1::model::DeliveryPipeline;
462 /// use wkt::Timestamp;
463 /// let x = DeliveryPipeline::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
464 /// let x = DeliveryPipeline::new().set_or_clear_update_time(None::<Timestamp>);
465 /// ```
466 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
467 where
468 T: std::convert::Into<wkt::Timestamp>,
469 {
470 self.update_time = v.map(|x| x.into());
471 self
472 }
473
474 /// Sets the value of [condition][crate::model::DeliveryPipeline::condition].
475 ///
476 /// # Example
477 /// ```ignore,no_run
478 /// # use google_cloud_deploy_v1::model::DeliveryPipeline;
479 /// use google_cloud_deploy_v1::model::PipelineCondition;
480 /// let x = DeliveryPipeline::new().set_condition(PipelineCondition::default()/* use setters */);
481 /// ```
482 pub fn set_condition<T>(mut self, v: T) -> Self
483 where
484 T: std::convert::Into<crate::model::PipelineCondition>,
485 {
486 self.condition = std::option::Option::Some(v.into());
487 self
488 }
489
490 /// Sets or clears the value of [condition][crate::model::DeliveryPipeline::condition].
491 ///
492 /// # Example
493 /// ```ignore,no_run
494 /// # use google_cloud_deploy_v1::model::DeliveryPipeline;
495 /// use google_cloud_deploy_v1::model::PipelineCondition;
496 /// let x = DeliveryPipeline::new().set_or_clear_condition(Some(PipelineCondition::default()/* use setters */));
497 /// let x = DeliveryPipeline::new().set_or_clear_condition(None::<PipelineCondition>);
498 /// ```
499 pub fn set_or_clear_condition<T>(mut self, v: std::option::Option<T>) -> Self
500 where
501 T: std::convert::Into<crate::model::PipelineCondition>,
502 {
503 self.condition = v.map(|x| x.into());
504 self
505 }
506
507 /// Sets the value of [etag][crate::model::DeliveryPipeline::etag].
508 ///
509 /// # Example
510 /// ```ignore,no_run
511 /// # use google_cloud_deploy_v1::model::DeliveryPipeline;
512 /// let x = DeliveryPipeline::new().set_etag("example");
513 /// ```
514 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
515 self.etag = v.into();
516 self
517 }
518
519 /// Sets the value of [suspended][crate::model::DeliveryPipeline::suspended].
520 ///
521 /// # Example
522 /// ```ignore,no_run
523 /// # use google_cloud_deploy_v1::model::DeliveryPipeline;
524 /// let x = DeliveryPipeline::new().set_suspended(true);
525 /// ```
526 pub fn set_suspended<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
527 self.suspended = v.into();
528 self
529 }
530
531 /// Sets the value of [pipeline][crate::model::DeliveryPipeline::pipeline].
532 ///
533 /// Note that all the setters affecting `pipeline` are mutually
534 /// exclusive.
535 ///
536 /// # Example
537 /// ```ignore,no_run
538 /// # use google_cloud_deploy_v1::model::DeliveryPipeline;
539 /// use google_cloud_deploy_v1::model::SerialPipeline;
540 /// let x = DeliveryPipeline::new().set_pipeline(Some(
541 /// google_cloud_deploy_v1::model::delivery_pipeline::Pipeline::SerialPipeline(SerialPipeline::default().into())));
542 /// ```
543 pub fn set_pipeline<
544 T: std::convert::Into<std::option::Option<crate::model::delivery_pipeline::Pipeline>>,
545 >(
546 mut self,
547 v: T,
548 ) -> Self {
549 self.pipeline = v.into();
550 self
551 }
552
553 /// The value of [pipeline][crate::model::DeliveryPipeline::pipeline]
554 /// if it holds a `SerialPipeline`, `None` if the field is not set or
555 /// holds a different branch.
556 pub fn serial_pipeline(
557 &self,
558 ) -> std::option::Option<&std::boxed::Box<crate::model::SerialPipeline>> {
559 #[allow(unreachable_patterns)]
560 self.pipeline.as_ref().and_then(|v| match v {
561 crate::model::delivery_pipeline::Pipeline::SerialPipeline(v) => {
562 std::option::Option::Some(v)
563 }
564 _ => std::option::Option::None,
565 })
566 }
567
568 /// Sets the value of [pipeline][crate::model::DeliveryPipeline::pipeline]
569 /// to hold a `SerialPipeline`.
570 ///
571 /// Note that all the setters affecting `pipeline` are
572 /// mutually exclusive.
573 ///
574 /// # Example
575 /// ```ignore,no_run
576 /// # use google_cloud_deploy_v1::model::DeliveryPipeline;
577 /// use google_cloud_deploy_v1::model::SerialPipeline;
578 /// let x = DeliveryPipeline::new().set_serial_pipeline(SerialPipeline::default()/* use setters */);
579 /// assert!(x.serial_pipeline().is_some());
580 /// ```
581 pub fn set_serial_pipeline<
582 T: std::convert::Into<std::boxed::Box<crate::model::SerialPipeline>>,
583 >(
584 mut self,
585 v: T,
586 ) -> Self {
587 self.pipeline = std::option::Option::Some(
588 crate::model::delivery_pipeline::Pipeline::SerialPipeline(v.into()),
589 );
590 self
591 }
592}
593
594impl wkt::message::Message for DeliveryPipeline {
595 fn typename() -> &'static str {
596 "type.googleapis.com/google.cloud.deploy.v1.DeliveryPipeline"
597 }
598}
599
600/// Defines additional types related to [DeliveryPipeline].
601pub mod delivery_pipeline {
602 #[allow(unused_imports)]
603 use super::*;
604
605 /// The ordering configuration of the `DeliveryPipeline`.
606 #[derive(Clone, Debug, PartialEq)]
607 #[non_exhaustive]
608 pub enum Pipeline {
609 /// Optional. SerialPipeline defines a sequential set of stages for a
610 /// `DeliveryPipeline`.
611 SerialPipeline(std::boxed::Box<crate::model::SerialPipeline>),
612 }
613}
614
615/// SerialPipeline defines a sequential set of stages for a `DeliveryPipeline`.
616#[derive(Clone, Default, PartialEq)]
617#[non_exhaustive]
618pub struct SerialPipeline {
619 /// Optional. Each stage specifies configuration for a `Target`. The ordering
620 /// of this list defines the promotion flow.
621 pub stages: std::vec::Vec<crate::model::Stage>,
622
623 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
624}
625
626impl SerialPipeline {
627 /// Creates a new default instance.
628 pub fn new() -> Self {
629 std::default::Default::default()
630 }
631
632 /// Sets the value of [stages][crate::model::SerialPipeline::stages].
633 ///
634 /// # Example
635 /// ```ignore,no_run
636 /// # use google_cloud_deploy_v1::model::SerialPipeline;
637 /// use google_cloud_deploy_v1::model::Stage;
638 /// let x = SerialPipeline::new()
639 /// .set_stages([
640 /// Stage::default()/* use setters */,
641 /// Stage::default()/* use (different) setters */,
642 /// ]);
643 /// ```
644 pub fn set_stages<T, V>(mut self, v: T) -> Self
645 where
646 T: std::iter::IntoIterator<Item = V>,
647 V: std::convert::Into<crate::model::Stage>,
648 {
649 use std::iter::Iterator;
650 self.stages = v.into_iter().map(|i| i.into()).collect();
651 self
652 }
653}
654
655impl wkt::message::Message for SerialPipeline {
656 fn typename() -> &'static str {
657 "type.googleapis.com/google.cloud.deploy.v1.SerialPipeline"
658 }
659}
660
661/// Stage specifies a location to which to deploy.
662#[derive(Clone, Default, PartialEq)]
663#[non_exhaustive]
664pub struct Stage {
665 /// Optional. The target_id to which this stage points. This field refers
666 /// exclusively to the last segment of a target name. For example, this field
667 /// would just be `my-target` (rather than
668 /// `projects/project/locations/location/targets/my-target`). The location of
669 /// the `Target` is inferred to be the same as the location of the
670 /// `DeliveryPipeline` that contains this `Stage`.
671 pub target_id: std::string::String,
672
673 /// Optional. Skaffold profiles to use when rendering the manifest for this
674 /// stage's `Target`.
675 pub profiles: std::vec::Vec<std::string::String>,
676
677 /// Optional. The strategy to use for a `Rollout` to this stage.
678 pub strategy: std::option::Option<crate::model::Strategy>,
679
680 /// Optional. The deploy parameters to use for the target in this stage.
681 pub deploy_parameters: std::vec::Vec<crate::model::DeployParameters>,
682
683 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
684}
685
686impl Stage {
687 /// Creates a new default instance.
688 pub fn new() -> Self {
689 std::default::Default::default()
690 }
691
692 /// Sets the value of [target_id][crate::model::Stage::target_id].
693 ///
694 /// # Example
695 /// ```ignore,no_run
696 /// # use google_cloud_deploy_v1::model::Stage;
697 /// let x = Stage::new().set_target_id("example");
698 /// ```
699 pub fn set_target_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
700 self.target_id = v.into();
701 self
702 }
703
704 /// Sets the value of [profiles][crate::model::Stage::profiles].
705 ///
706 /// # Example
707 /// ```ignore,no_run
708 /// # use google_cloud_deploy_v1::model::Stage;
709 /// let x = Stage::new().set_profiles(["a", "b", "c"]);
710 /// ```
711 pub fn set_profiles<T, V>(mut self, v: T) -> Self
712 where
713 T: std::iter::IntoIterator<Item = V>,
714 V: std::convert::Into<std::string::String>,
715 {
716 use std::iter::Iterator;
717 self.profiles = v.into_iter().map(|i| i.into()).collect();
718 self
719 }
720
721 /// Sets the value of [strategy][crate::model::Stage::strategy].
722 ///
723 /// # Example
724 /// ```ignore,no_run
725 /// # use google_cloud_deploy_v1::model::Stage;
726 /// use google_cloud_deploy_v1::model::Strategy;
727 /// let x = Stage::new().set_strategy(Strategy::default()/* use setters */);
728 /// ```
729 pub fn set_strategy<T>(mut self, v: T) -> Self
730 where
731 T: std::convert::Into<crate::model::Strategy>,
732 {
733 self.strategy = std::option::Option::Some(v.into());
734 self
735 }
736
737 /// Sets or clears the value of [strategy][crate::model::Stage::strategy].
738 ///
739 /// # Example
740 /// ```ignore,no_run
741 /// # use google_cloud_deploy_v1::model::Stage;
742 /// use google_cloud_deploy_v1::model::Strategy;
743 /// let x = Stage::new().set_or_clear_strategy(Some(Strategy::default()/* use setters */));
744 /// let x = Stage::new().set_or_clear_strategy(None::<Strategy>);
745 /// ```
746 pub fn set_or_clear_strategy<T>(mut self, v: std::option::Option<T>) -> Self
747 where
748 T: std::convert::Into<crate::model::Strategy>,
749 {
750 self.strategy = v.map(|x| x.into());
751 self
752 }
753
754 /// Sets the value of [deploy_parameters][crate::model::Stage::deploy_parameters].
755 ///
756 /// # Example
757 /// ```ignore,no_run
758 /// # use google_cloud_deploy_v1::model::Stage;
759 /// use google_cloud_deploy_v1::model::DeployParameters;
760 /// let x = Stage::new()
761 /// .set_deploy_parameters([
762 /// DeployParameters::default()/* use setters */,
763 /// DeployParameters::default()/* use (different) setters */,
764 /// ]);
765 /// ```
766 pub fn set_deploy_parameters<T, V>(mut self, v: T) -> Self
767 where
768 T: std::iter::IntoIterator<Item = V>,
769 V: std::convert::Into<crate::model::DeployParameters>,
770 {
771 use std::iter::Iterator;
772 self.deploy_parameters = v.into_iter().map(|i| i.into()).collect();
773 self
774 }
775}
776
777impl wkt::message::Message for Stage {
778 fn typename() -> &'static str {
779 "type.googleapis.com/google.cloud.deploy.v1.Stage"
780 }
781}
782
783/// DeployParameters contains deploy parameters information.
784#[derive(Clone, Default, PartialEq)]
785#[non_exhaustive]
786pub struct DeployParameters {
787 /// Required. Values are deploy parameters in key-value pairs.
788 pub values: std::collections::HashMap<std::string::String, std::string::String>,
789
790 /// Optional. Deploy parameters are applied to targets with match labels.
791 /// If unspecified, deploy parameters are applied to all targets (including
792 /// child targets of a multi-target).
793 pub match_target_labels: std::collections::HashMap<std::string::String, std::string::String>,
794
795 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
796}
797
798impl DeployParameters {
799 /// Creates a new default instance.
800 pub fn new() -> Self {
801 std::default::Default::default()
802 }
803
804 /// Sets the value of [values][crate::model::DeployParameters::values].
805 ///
806 /// # Example
807 /// ```ignore,no_run
808 /// # use google_cloud_deploy_v1::model::DeployParameters;
809 /// let x = DeployParameters::new().set_values([
810 /// ("key0", "abc"),
811 /// ("key1", "xyz"),
812 /// ]);
813 /// ```
814 pub fn set_values<T, K, V>(mut self, v: T) -> Self
815 where
816 T: std::iter::IntoIterator<Item = (K, V)>,
817 K: std::convert::Into<std::string::String>,
818 V: std::convert::Into<std::string::String>,
819 {
820 use std::iter::Iterator;
821 self.values = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
822 self
823 }
824
825 /// Sets the value of [match_target_labels][crate::model::DeployParameters::match_target_labels].
826 ///
827 /// # Example
828 /// ```ignore,no_run
829 /// # use google_cloud_deploy_v1::model::DeployParameters;
830 /// let x = DeployParameters::new().set_match_target_labels([
831 /// ("key0", "abc"),
832 /// ("key1", "xyz"),
833 /// ]);
834 /// ```
835 pub fn set_match_target_labels<T, K, V>(mut self, v: T) -> Self
836 where
837 T: std::iter::IntoIterator<Item = (K, V)>,
838 K: std::convert::Into<std::string::String>,
839 V: std::convert::Into<std::string::String>,
840 {
841 use std::iter::Iterator;
842 self.match_target_labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
843 self
844 }
845}
846
847impl wkt::message::Message for DeployParameters {
848 fn typename() -> &'static str {
849 "type.googleapis.com/google.cloud.deploy.v1.DeployParameters"
850 }
851}
852
853/// Strategy contains deployment strategy information.
854#[derive(Clone, Default, PartialEq)]
855#[non_exhaustive]
856pub struct Strategy {
857 /// Deployment strategy details.
858 pub deployment_strategy: std::option::Option<crate::model::strategy::DeploymentStrategy>,
859
860 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
861}
862
863impl Strategy {
864 /// Creates a new default instance.
865 pub fn new() -> Self {
866 std::default::Default::default()
867 }
868
869 /// Sets the value of [deployment_strategy][crate::model::Strategy::deployment_strategy].
870 ///
871 /// Note that all the setters affecting `deployment_strategy` are mutually
872 /// exclusive.
873 ///
874 /// # Example
875 /// ```ignore,no_run
876 /// # use google_cloud_deploy_v1::model::Strategy;
877 /// use google_cloud_deploy_v1::model::Standard;
878 /// let x = Strategy::new().set_deployment_strategy(Some(
879 /// google_cloud_deploy_v1::model::strategy::DeploymentStrategy::Standard(Standard::default().into())));
880 /// ```
881 pub fn set_deployment_strategy<
882 T: std::convert::Into<std::option::Option<crate::model::strategy::DeploymentStrategy>>,
883 >(
884 mut self,
885 v: T,
886 ) -> Self {
887 self.deployment_strategy = v.into();
888 self
889 }
890
891 /// The value of [deployment_strategy][crate::model::Strategy::deployment_strategy]
892 /// if it holds a `Standard`, `None` if the field is not set or
893 /// holds a different branch.
894 pub fn standard(&self) -> std::option::Option<&std::boxed::Box<crate::model::Standard>> {
895 #[allow(unreachable_patterns)]
896 self.deployment_strategy.as_ref().and_then(|v| match v {
897 crate::model::strategy::DeploymentStrategy::Standard(v) => std::option::Option::Some(v),
898 _ => std::option::Option::None,
899 })
900 }
901
902 /// Sets the value of [deployment_strategy][crate::model::Strategy::deployment_strategy]
903 /// to hold a `Standard`.
904 ///
905 /// Note that all the setters affecting `deployment_strategy` are
906 /// mutually exclusive.
907 ///
908 /// # Example
909 /// ```ignore,no_run
910 /// # use google_cloud_deploy_v1::model::Strategy;
911 /// use google_cloud_deploy_v1::model::Standard;
912 /// let x = Strategy::new().set_standard(Standard::default()/* use setters */);
913 /// assert!(x.standard().is_some());
914 /// assert!(x.canary().is_none());
915 /// ```
916 pub fn set_standard<T: std::convert::Into<std::boxed::Box<crate::model::Standard>>>(
917 mut self,
918 v: T,
919 ) -> Self {
920 self.deployment_strategy = std::option::Option::Some(
921 crate::model::strategy::DeploymentStrategy::Standard(v.into()),
922 );
923 self
924 }
925
926 /// The value of [deployment_strategy][crate::model::Strategy::deployment_strategy]
927 /// if it holds a `Canary`, `None` if the field is not set or
928 /// holds a different branch.
929 pub fn canary(&self) -> std::option::Option<&std::boxed::Box<crate::model::Canary>> {
930 #[allow(unreachable_patterns)]
931 self.deployment_strategy.as_ref().and_then(|v| match v {
932 crate::model::strategy::DeploymentStrategy::Canary(v) => std::option::Option::Some(v),
933 _ => std::option::Option::None,
934 })
935 }
936
937 /// Sets the value of [deployment_strategy][crate::model::Strategy::deployment_strategy]
938 /// to hold a `Canary`.
939 ///
940 /// Note that all the setters affecting `deployment_strategy` are
941 /// mutually exclusive.
942 ///
943 /// # Example
944 /// ```ignore,no_run
945 /// # use google_cloud_deploy_v1::model::Strategy;
946 /// use google_cloud_deploy_v1::model::Canary;
947 /// let x = Strategy::new().set_canary(Canary::default()/* use setters */);
948 /// assert!(x.canary().is_some());
949 /// assert!(x.standard().is_none());
950 /// ```
951 pub fn set_canary<T: std::convert::Into<std::boxed::Box<crate::model::Canary>>>(
952 mut self,
953 v: T,
954 ) -> Self {
955 self.deployment_strategy =
956 std::option::Option::Some(crate::model::strategy::DeploymentStrategy::Canary(v.into()));
957 self
958 }
959}
960
961impl wkt::message::Message for Strategy {
962 fn typename() -> &'static str {
963 "type.googleapis.com/google.cloud.deploy.v1.Strategy"
964 }
965}
966
967/// Defines additional types related to [Strategy].
968pub mod strategy {
969 #[allow(unused_imports)]
970 use super::*;
971
972 /// Deployment strategy details.
973 #[derive(Clone, Debug, PartialEq)]
974 #[non_exhaustive]
975 pub enum DeploymentStrategy {
976 /// Optional. Standard deployment strategy executes a single deploy and
977 /// allows verifying the deployment.
978 Standard(std::boxed::Box<crate::model::Standard>),
979 /// Optional. Canary deployment strategy provides progressive percentage
980 /// based deployments to a Target.
981 Canary(std::boxed::Box<crate::model::Canary>),
982 }
983}
984
985/// Predeploy contains the predeploy job configuration information.
986#[derive(Clone, Default, PartialEq)]
987#[non_exhaustive]
988pub struct Predeploy {
989 /// Optional. A sequence of Skaffold custom actions to invoke during execution
990 /// of the predeploy job.
991 pub actions: std::vec::Vec<std::string::String>,
992
993 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
994}
995
996impl Predeploy {
997 /// Creates a new default instance.
998 pub fn new() -> Self {
999 std::default::Default::default()
1000 }
1001
1002 /// Sets the value of [actions][crate::model::Predeploy::actions].
1003 ///
1004 /// # Example
1005 /// ```ignore,no_run
1006 /// # use google_cloud_deploy_v1::model::Predeploy;
1007 /// let x = Predeploy::new().set_actions(["a", "b", "c"]);
1008 /// ```
1009 pub fn set_actions<T, V>(mut self, v: T) -> Self
1010 where
1011 T: std::iter::IntoIterator<Item = V>,
1012 V: std::convert::Into<std::string::String>,
1013 {
1014 use std::iter::Iterator;
1015 self.actions = v.into_iter().map(|i| i.into()).collect();
1016 self
1017 }
1018}
1019
1020impl wkt::message::Message for Predeploy {
1021 fn typename() -> &'static str {
1022 "type.googleapis.com/google.cloud.deploy.v1.Predeploy"
1023 }
1024}
1025
1026/// Postdeploy contains the postdeploy job configuration information.
1027#[derive(Clone, Default, PartialEq)]
1028#[non_exhaustive]
1029pub struct Postdeploy {
1030 /// Optional. A sequence of Skaffold custom actions to invoke during execution
1031 /// of the postdeploy job.
1032 pub actions: std::vec::Vec<std::string::String>,
1033
1034 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1035}
1036
1037impl Postdeploy {
1038 /// Creates a new default instance.
1039 pub fn new() -> Self {
1040 std::default::Default::default()
1041 }
1042
1043 /// Sets the value of [actions][crate::model::Postdeploy::actions].
1044 ///
1045 /// # Example
1046 /// ```ignore,no_run
1047 /// # use google_cloud_deploy_v1::model::Postdeploy;
1048 /// let x = Postdeploy::new().set_actions(["a", "b", "c"]);
1049 /// ```
1050 pub fn set_actions<T, V>(mut self, v: T) -> Self
1051 where
1052 T: std::iter::IntoIterator<Item = V>,
1053 V: std::convert::Into<std::string::String>,
1054 {
1055 use std::iter::Iterator;
1056 self.actions = v.into_iter().map(|i| i.into()).collect();
1057 self
1058 }
1059}
1060
1061impl wkt::message::Message for Postdeploy {
1062 fn typename() -> &'static str {
1063 "type.googleapis.com/google.cloud.deploy.v1.Postdeploy"
1064 }
1065}
1066
1067/// Standard represents the standard deployment strategy.
1068#[derive(Clone, Default, PartialEq)]
1069#[non_exhaustive]
1070pub struct Standard {
1071 /// Optional. Whether to verify a deployment via `skaffold verify`.
1072 pub verify: bool,
1073
1074 /// Optional. Configuration for the predeploy job. If this is not configured,
1075 /// the predeploy job will not be present.
1076 pub predeploy: std::option::Option<crate::model::Predeploy>,
1077
1078 /// Optional. Configuration for the postdeploy job. If this is not configured,
1079 /// the postdeploy job will not be present.
1080 pub postdeploy: std::option::Option<crate::model::Postdeploy>,
1081
1082 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1083}
1084
1085impl Standard {
1086 /// Creates a new default instance.
1087 pub fn new() -> Self {
1088 std::default::Default::default()
1089 }
1090
1091 /// Sets the value of [verify][crate::model::Standard::verify].
1092 ///
1093 /// # Example
1094 /// ```ignore,no_run
1095 /// # use google_cloud_deploy_v1::model::Standard;
1096 /// let x = Standard::new().set_verify(true);
1097 /// ```
1098 pub fn set_verify<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1099 self.verify = v.into();
1100 self
1101 }
1102
1103 /// Sets the value of [predeploy][crate::model::Standard::predeploy].
1104 ///
1105 /// # Example
1106 /// ```ignore,no_run
1107 /// # use google_cloud_deploy_v1::model::Standard;
1108 /// use google_cloud_deploy_v1::model::Predeploy;
1109 /// let x = Standard::new().set_predeploy(Predeploy::default()/* use setters */);
1110 /// ```
1111 pub fn set_predeploy<T>(mut self, v: T) -> Self
1112 where
1113 T: std::convert::Into<crate::model::Predeploy>,
1114 {
1115 self.predeploy = std::option::Option::Some(v.into());
1116 self
1117 }
1118
1119 /// Sets or clears the value of [predeploy][crate::model::Standard::predeploy].
1120 ///
1121 /// # Example
1122 /// ```ignore,no_run
1123 /// # use google_cloud_deploy_v1::model::Standard;
1124 /// use google_cloud_deploy_v1::model::Predeploy;
1125 /// let x = Standard::new().set_or_clear_predeploy(Some(Predeploy::default()/* use setters */));
1126 /// let x = Standard::new().set_or_clear_predeploy(None::<Predeploy>);
1127 /// ```
1128 pub fn set_or_clear_predeploy<T>(mut self, v: std::option::Option<T>) -> Self
1129 where
1130 T: std::convert::Into<crate::model::Predeploy>,
1131 {
1132 self.predeploy = v.map(|x| x.into());
1133 self
1134 }
1135
1136 /// Sets the value of [postdeploy][crate::model::Standard::postdeploy].
1137 ///
1138 /// # Example
1139 /// ```ignore,no_run
1140 /// # use google_cloud_deploy_v1::model::Standard;
1141 /// use google_cloud_deploy_v1::model::Postdeploy;
1142 /// let x = Standard::new().set_postdeploy(Postdeploy::default()/* use setters */);
1143 /// ```
1144 pub fn set_postdeploy<T>(mut self, v: T) -> Self
1145 where
1146 T: std::convert::Into<crate::model::Postdeploy>,
1147 {
1148 self.postdeploy = std::option::Option::Some(v.into());
1149 self
1150 }
1151
1152 /// Sets or clears the value of [postdeploy][crate::model::Standard::postdeploy].
1153 ///
1154 /// # Example
1155 /// ```ignore,no_run
1156 /// # use google_cloud_deploy_v1::model::Standard;
1157 /// use google_cloud_deploy_v1::model::Postdeploy;
1158 /// let x = Standard::new().set_or_clear_postdeploy(Some(Postdeploy::default()/* use setters */));
1159 /// let x = Standard::new().set_or_clear_postdeploy(None::<Postdeploy>);
1160 /// ```
1161 pub fn set_or_clear_postdeploy<T>(mut self, v: std::option::Option<T>) -> Self
1162 where
1163 T: std::convert::Into<crate::model::Postdeploy>,
1164 {
1165 self.postdeploy = v.map(|x| x.into());
1166 self
1167 }
1168}
1169
1170impl wkt::message::Message for Standard {
1171 fn typename() -> &'static str {
1172 "type.googleapis.com/google.cloud.deploy.v1.Standard"
1173 }
1174}
1175
1176/// Canary represents the canary deployment strategy.
1177#[derive(Clone, Default, PartialEq)]
1178#[non_exhaustive]
1179pub struct Canary {
1180 /// Optional. Runtime specific configurations for the deployment strategy. The
1181 /// runtime configuration is used to determine how Cloud Deploy will split
1182 /// traffic to enable a progressive deployment.
1183 pub runtime_config: std::option::Option<crate::model::RuntimeConfig>,
1184
1185 /// The mode to use for the canary deployment strategy.
1186 pub mode: std::option::Option<crate::model::canary::Mode>,
1187
1188 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1189}
1190
1191impl Canary {
1192 /// Creates a new default instance.
1193 pub fn new() -> Self {
1194 std::default::Default::default()
1195 }
1196
1197 /// Sets 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_runtime_config(RuntimeConfig::default()/* use setters */);
1204 /// ```
1205 pub fn set_runtime_config<T>(mut self, v: T) -> Self
1206 where
1207 T: std::convert::Into<crate::model::RuntimeConfig>,
1208 {
1209 self.runtime_config = std::option::Option::Some(v.into());
1210 self
1211 }
1212
1213 /// Sets or clears the value of [runtime_config][crate::model::Canary::runtime_config].
1214 ///
1215 /// # Example
1216 /// ```ignore,no_run
1217 /// # use google_cloud_deploy_v1::model::Canary;
1218 /// use google_cloud_deploy_v1::model::RuntimeConfig;
1219 /// let x = Canary::new().set_or_clear_runtime_config(Some(RuntimeConfig::default()/* use setters */));
1220 /// let x = Canary::new().set_or_clear_runtime_config(None::<RuntimeConfig>);
1221 /// ```
1222 pub fn set_or_clear_runtime_config<T>(mut self, v: std::option::Option<T>) -> Self
1223 where
1224 T: std::convert::Into<crate::model::RuntimeConfig>,
1225 {
1226 self.runtime_config = v.map(|x| x.into());
1227 self
1228 }
1229
1230 /// Sets the value of [mode][crate::model::Canary::mode].
1231 ///
1232 /// Note that all the setters affecting `mode` are mutually
1233 /// exclusive.
1234 ///
1235 /// # Example
1236 /// ```ignore,no_run
1237 /// # use google_cloud_deploy_v1::model::Canary;
1238 /// use google_cloud_deploy_v1::model::CanaryDeployment;
1239 /// let x = Canary::new().set_mode(Some(
1240 /// google_cloud_deploy_v1::model::canary::Mode::CanaryDeployment(CanaryDeployment::default().into())));
1241 /// ```
1242 pub fn set_mode<T: std::convert::Into<std::option::Option<crate::model::canary::Mode>>>(
1243 mut self,
1244 v: T,
1245 ) -> Self {
1246 self.mode = v.into();
1247 self
1248 }
1249
1250 /// The value of [mode][crate::model::Canary::mode]
1251 /// if it holds a `CanaryDeployment`, `None` if the field is not set or
1252 /// holds a different branch.
1253 pub fn canary_deployment(
1254 &self,
1255 ) -> std::option::Option<&std::boxed::Box<crate::model::CanaryDeployment>> {
1256 #[allow(unreachable_patterns)]
1257 self.mode.as_ref().and_then(|v| match v {
1258 crate::model::canary::Mode::CanaryDeployment(v) => std::option::Option::Some(v),
1259 _ => std::option::Option::None,
1260 })
1261 }
1262
1263 /// Sets the value of [mode][crate::model::Canary::mode]
1264 /// to hold a `CanaryDeployment`.
1265 ///
1266 /// Note that all the setters affecting `mode` are
1267 /// mutually exclusive.
1268 ///
1269 /// # Example
1270 /// ```ignore,no_run
1271 /// # use google_cloud_deploy_v1::model::Canary;
1272 /// use google_cloud_deploy_v1::model::CanaryDeployment;
1273 /// let x = Canary::new().set_canary_deployment(CanaryDeployment::default()/* use setters */);
1274 /// assert!(x.canary_deployment().is_some());
1275 /// assert!(x.custom_canary_deployment().is_none());
1276 /// ```
1277 pub fn set_canary_deployment<
1278 T: std::convert::Into<std::boxed::Box<crate::model::CanaryDeployment>>,
1279 >(
1280 mut self,
1281 v: T,
1282 ) -> Self {
1283 self.mode =
1284 std::option::Option::Some(crate::model::canary::Mode::CanaryDeployment(v.into()));
1285 self
1286 }
1287
1288 /// The value of [mode][crate::model::Canary::mode]
1289 /// if it holds a `CustomCanaryDeployment`, `None` if the field is not set or
1290 /// holds a different branch.
1291 pub fn custom_canary_deployment(
1292 &self,
1293 ) -> std::option::Option<&std::boxed::Box<crate::model::CustomCanaryDeployment>> {
1294 #[allow(unreachable_patterns)]
1295 self.mode.as_ref().and_then(|v| match v {
1296 crate::model::canary::Mode::CustomCanaryDeployment(v) => std::option::Option::Some(v),
1297 _ => std::option::Option::None,
1298 })
1299 }
1300
1301 /// Sets the value of [mode][crate::model::Canary::mode]
1302 /// to hold a `CustomCanaryDeployment`.
1303 ///
1304 /// Note that all the setters affecting `mode` are
1305 /// mutually exclusive.
1306 ///
1307 /// # Example
1308 /// ```ignore,no_run
1309 /// # use google_cloud_deploy_v1::model::Canary;
1310 /// use google_cloud_deploy_v1::model::CustomCanaryDeployment;
1311 /// let x = Canary::new().set_custom_canary_deployment(CustomCanaryDeployment::default()/* use setters */);
1312 /// assert!(x.custom_canary_deployment().is_some());
1313 /// assert!(x.canary_deployment().is_none());
1314 /// ```
1315 pub fn set_custom_canary_deployment<
1316 T: std::convert::Into<std::boxed::Box<crate::model::CustomCanaryDeployment>>,
1317 >(
1318 mut self,
1319 v: T,
1320 ) -> Self {
1321 self.mode =
1322 std::option::Option::Some(crate::model::canary::Mode::CustomCanaryDeployment(v.into()));
1323 self
1324 }
1325}
1326
1327impl wkt::message::Message for Canary {
1328 fn typename() -> &'static str {
1329 "type.googleapis.com/google.cloud.deploy.v1.Canary"
1330 }
1331}
1332
1333/// Defines additional types related to [Canary].
1334pub mod canary {
1335 #[allow(unused_imports)]
1336 use super::*;
1337
1338 /// The mode to use for the canary deployment strategy.
1339 #[derive(Clone, Debug, PartialEq)]
1340 #[non_exhaustive]
1341 pub enum Mode {
1342 /// Optional. Configures the progressive based deployment for a Target.
1343 CanaryDeployment(std::boxed::Box<crate::model::CanaryDeployment>),
1344 /// Optional. Configures the progressive based deployment for a Target, but
1345 /// allows customizing at the phase level where a phase represents each of
1346 /// the percentage deployments.
1347 CustomCanaryDeployment(std::boxed::Box<crate::model::CustomCanaryDeployment>),
1348 }
1349}
1350
1351/// CanaryDeployment represents the canary deployment configuration
1352#[derive(Clone, Default, PartialEq)]
1353#[non_exhaustive]
1354pub struct CanaryDeployment {
1355 /// Required. The percentage based deployments that will occur as a part of a
1356 /// `Rollout`. List is expected in ascending order and each integer n is
1357 /// 0 <= n < 100.
1358 /// If the GatewayServiceMesh is configured for Kubernetes, then the range for
1359 /// n is 0 <= n <= 100.
1360 pub percentages: std::vec::Vec<i32>,
1361
1362 /// Optional. Whether to run verify tests after each percentage deployment via
1363 /// `skaffold verify`.
1364 pub verify: bool,
1365
1366 /// Optional. Configuration for the predeploy job of the first phase. If this
1367 /// is not configured, there will be no predeploy job for this phase.
1368 pub predeploy: std::option::Option<crate::model::Predeploy>,
1369
1370 /// Optional. Configuration for the postdeploy job of the last phase. If this
1371 /// is not configured, there will be no postdeploy job for this phase.
1372 pub postdeploy: std::option::Option<crate::model::Postdeploy>,
1373
1374 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1375}
1376
1377impl CanaryDeployment {
1378 /// Creates a new default instance.
1379 pub fn new() -> Self {
1380 std::default::Default::default()
1381 }
1382
1383 /// Sets the value of [percentages][crate::model::CanaryDeployment::percentages].
1384 ///
1385 /// # Example
1386 /// ```ignore,no_run
1387 /// # use google_cloud_deploy_v1::model::CanaryDeployment;
1388 /// let x = CanaryDeployment::new().set_percentages([1, 2, 3]);
1389 /// ```
1390 pub fn set_percentages<T, V>(mut self, v: T) -> Self
1391 where
1392 T: std::iter::IntoIterator<Item = V>,
1393 V: std::convert::Into<i32>,
1394 {
1395 use std::iter::Iterator;
1396 self.percentages = v.into_iter().map(|i| i.into()).collect();
1397 self
1398 }
1399
1400 /// Sets the value of [verify][crate::model::CanaryDeployment::verify].
1401 ///
1402 /// # Example
1403 /// ```ignore,no_run
1404 /// # use google_cloud_deploy_v1::model::CanaryDeployment;
1405 /// let x = CanaryDeployment::new().set_verify(true);
1406 /// ```
1407 pub fn set_verify<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1408 self.verify = v.into();
1409 self
1410 }
1411
1412 /// Sets the value of [predeploy][crate::model::CanaryDeployment::predeploy].
1413 ///
1414 /// # Example
1415 /// ```ignore,no_run
1416 /// # use google_cloud_deploy_v1::model::CanaryDeployment;
1417 /// use google_cloud_deploy_v1::model::Predeploy;
1418 /// let x = CanaryDeployment::new().set_predeploy(Predeploy::default()/* use setters */);
1419 /// ```
1420 pub fn set_predeploy<T>(mut self, v: T) -> Self
1421 where
1422 T: std::convert::Into<crate::model::Predeploy>,
1423 {
1424 self.predeploy = std::option::Option::Some(v.into());
1425 self
1426 }
1427
1428 /// Sets or clears the value of [predeploy][crate::model::CanaryDeployment::predeploy].
1429 ///
1430 /// # Example
1431 /// ```ignore,no_run
1432 /// # use google_cloud_deploy_v1::model::CanaryDeployment;
1433 /// use google_cloud_deploy_v1::model::Predeploy;
1434 /// let x = CanaryDeployment::new().set_or_clear_predeploy(Some(Predeploy::default()/* use setters */));
1435 /// let x = CanaryDeployment::new().set_or_clear_predeploy(None::<Predeploy>);
1436 /// ```
1437 pub fn set_or_clear_predeploy<T>(mut self, v: std::option::Option<T>) -> Self
1438 where
1439 T: std::convert::Into<crate::model::Predeploy>,
1440 {
1441 self.predeploy = v.map(|x| x.into());
1442 self
1443 }
1444
1445 /// Sets the value of [postdeploy][crate::model::CanaryDeployment::postdeploy].
1446 ///
1447 /// # Example
1448 /// ```ignore,no_run
1449 /// # use google_cloud_deploy_v1::model::CanaryDeployment;
1450 /// use google_cloud_deploy_v1::model::Postdeploy;
1451 /// let x = CanaryDeployment::new().set_postdeploy(Postdeploy::default()/* use setters */);
1452 /// ```
1453 pub fn set_postdeploy<T>(mut self, v: T) -> Self
1454 where
1455 T: std::convert::Into<crate::model::Postdeploy>,
1456 {
1457 self.postdeploy = std::option::Option::Some(v.into());
1458 self
1459 }
1460
1461 /// Sets or clears the value of [postdeploy][crate::model::CanaryDeployment::postdeploy].
1462 ///
1463 /// # Example
1464 /// ```ignore,no_run
1465 /// # use google_cloud_deploy_v1::model::CanaryDeployment;
1466 /// use google_cloud_deploy_v1::model::Postdeploy;
1467 /// let x = CanaryDeployment::new().set_or_clear_postdeploy(Some(Postdeploy::default()/* use setters */));
1468 /// let x = CanaryDeployment::new().set_or_clear_postdeploy(None::<Postdeploy>);
1469 /// ```
1470 pub fn set_or_clear_postdeploy<T>(mut self, v: std::option::Option<T>) -> Self
1471 where
1472 T: std::convert::Into<crate::model::Postdeploy>,
1473 {
1474 self.postdeploy = v.map(|x| x.into());
1475 self
1476 }
1477}
1478
1479impl wkt::message::Message for CanaryDeployment {
1480 fn typename() -> &'static str {
1481 "type.googleapis.com/google.cloud.deploy.v1.CanaryDeployment"
1482 }
1483}
1484
1485/// CustomCanaryDeployment represents the custom canary deployment
1486/// configuration.
1487#[derive(Clone, Default, PartialEq)]
1488#[non_exhaustive]
1489pub struct CustomCanaryDeployment {
1490 /// Required. Configuration for each phase in the canary deployment in the
1491 /// order executed.
1492 pub phase_configs: std::vec::Vec<crate::model::custom_canary_deployment::PhaseConfig>,
1493
1494 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1495}
1496
1497impl CustomCanaryDeployment {
1498 /// Creates a new default instance.
1499 pub fn new() -> Self {
1500 std::default::Default::default()
1501 }
1502
1503 /// Sets the value of [phase_configs][crate::model::CustomCanaryDeployment::phase_configs].
1504 ///
1505 /// # Example
1506 /// ```ignore,no_run
1507 /// # use google_cloud_deploy_v1::model::CustomCanaryDeployment;
1508 /// use google_cloud_deploy_v1::model::custom_canary_deployment::PhaseConfig;
1509 /// let x = CustomCanaryDeployment::new()
1510 /// .set_phase_configs([
1511 /// PhaseConfig::default()/* use setters */,
1512 /// PhaseConfig::default()/* use (different) setters */,
1513 /// ]);
1514 /// ```
1515 pub fn set_phase_configs<T, V>(mut self, v: T) -> Self
1516 where
1517 T: std::iter::IntoIterator<Item = V>,
1518 V: std::convert::Into<crate::model::custom_canary_deployment::PhaseConfig>,
1519 {
1520 use std::iter::Iterator;
1521 self.phase_configs = v.into_iter().map(|i| i.into()).collect();
1522 self
1523 }
1524}
1525
1526impl wkt::message::Message for CustomCanaryDeployment {
1527 fn typename() -> &'static str {
1528 "type.googleapis.com/google.cloud.deploy.v1.CustomCanaryDeployment"
1529 }
1530}
1531
1532/// Defines additional types related to [CustomCanaryDeployment].
1533pub mod custom_canary_deployment {
1534 #[allow(unused_imports)]
1535 use super::*;
1536
1537 /// PhaseConfig represents the configuration for a phase in the custom
1538 /// canary deployment.
1539 #[derive(Clone, Default, PartialEq)]
1540 #[non_exhaustive]
1541 pub struct PhaseConfig {
1542 /// Required. The ID to assign to the `Rollout` phase.
1543 /// This value must consist of lower-case letters, numbers, and hyphens,
1544 /// start with a letter and end with a letter or a number, and have a max
1545 /// length of 63 characters. In other words, it must match the following
1546 /// regex: `^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$`.
1547 pub phase_id: std::string::String,
1548
1549 /// Required. Percentage deployment for the phase.
1550 pub percentage: i32,
1551
1552 /// Optional. Skaffold profiles to use when rendering the manifest for this
1553 /// phase. These are in addition to the profiles list specified in the
1554 /// `DeliveryPipeline` stage.
1555 pub profiles: std::vec::Vec<std::string::String>,
1556
1557 /// Optional. Whether to run verify tests after the deployment via `skaffold
1558 /// verify`.
1559 pub verify: bool,
1560
1561 /// Optional. Configuration for the predeploy job of this phase. If this is
1562 /// not configured, there will be no predeploy job for this phase.
1563 pub predeploy: std::option::Option<crate::model::Predeploy>,
1564
1565 /// Optional. Configuration for the postdeploy job of this phase. If this is
1566 /// not configured, there will be no postdeploy job for this phase.
1567 pub postdeploy: std::option::Option<crate::model::Postdeploy>,
1568
1569 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1570 }
1571
1572 impl PhaseConfig {
1573 /// Creates a new default instance.
1574 pub fn new() -> Self {
1575 std::default::Default::default()
1576 }
1577
1578 /// Sets the value of [phase_id][crate::model::custom_canary_deployment::PhaseConfig::phase_id].
1579 ///
1580 /// # Example
1581 /// ```ignore,no_run
1582 /// # use google_cloud_deploy_v1::model::custom_canary_deployment::PhaseConfig;
1583 /// let x = PhaseConfig::new().set_phase_id("example");
1584 /// ```
1585 pub fn set_phase_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1586 self.phase_id = v.into();
1587 self
1588 }
1589
1590 /// Sets the value of [percentage][crate::model::custom_canary_deployment::PhaseConfig::percentage].
1591 ///
1592 /// # Example
1593 /// ```ignore,no_run
1594 /// # use google_cloud_deploy_v1::model::custom_canary_deployment::PhaseConfig;
1595 /// let x = PhaseConfig::new().set_percentage(42);
1596 /// ```
1597 pub fn set_percentage<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1598 self.percentage = v.into();
1599 self
1600 }
1601
1602 /// Sets the value of [profiles][crate::model::custom_canary_deployment::PhaseConfig::profiles].
1603 ///
1604 /// # Example
1605 /// ```ignore,no_run
1606 /// # use google_cloud_deploy_v1::model::custom_canary_deployment::PhaseConfig;
1607 /// let x = PhaseConfig::new().set_profiles(["a", "b", "c"]);
1608 /// ```
1609 pub fn set_profiles<T, V>(mut self, v: T) -> Self
1610 where
1611 T: std::iter::IntoIterator<Item = V>,
1612 V: std::convert::Into<std::string::String>,
1613 {
1614 use std::iter::Iterator;
1615 self.profiles = v.into_iter().map(|i| i.into()).collect();
1616 self
1617 }
1618
1619 /// Sets the value of [verify][crate::model::custom_canary_deployment::PhaseConfig::verify].
1620 ///
1621 /// # Example
1622 /// ```ignore,no_run
1623 /// # use google_cloud_deploy_v1::model::custom_canary_deployment::PhaseConfig;
1624 /// let x = PhaseConfig::new().set_verify(true);
1625 /// ```
1626 pub fn set_verify<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1627 self.verify = v.into();
1628 self
1629 }
1630
1631 /// Sets the value of [predeploy][crate::model::custom_canary_deployment::PhaseConfig::predeploy].
1632 ///
1633 /// # Example
1634 /// ```ignore,no_run
1635 /// # use google_cloud_deploy_v1::model::custom_canary_deployment::PhaseConfig;
1636 /// use google_cloud_deploy_v1::model::Predeploy;
1637 /// let x = PhaseConfig::new().set_predeploy(Predeploy::default()/* use setters */);
1638 /// ```
1639 pub fn set_predeploy<T>(mut self, v: T) -> Self
1640 where
1641 T: std::convert::Into<crate::model::Predeploy>,
1642 {
1643 self.predeploy = std::option::Option::Some(v.into());
1644 self
1645 }
1646
1647 /// Sets or clears the value of [predeploy][crate::model::custom_canary_deployment::PhaseConfig::predeploy].
1648 ///
1649 /// # Example
1650 /// ```ignore,no_run
1651 /// # use google_cloud_deploy_v1::model::custom_canary_deployment::PhaseConfig;
1652 /// use google_cloud_deploy_v1::model::Predeploy;
1653 /// let x = PhaseConfig::new().set_or_clear_predeploy(Some(Predeploy::default()/* use setters */));
1654 /// let x = PhaseConfig::new().set_or_clear_predeploy(None::<Predeploy>);
1655 /// ```
1656 pub fn set_or_clear_predeploy<T>(mut self, v: std::option::Option<T>) -> Self
1657 where
1658 T: std::convert::Into<crate::model::Predeploy>,
1659 {
1660 self.predeploy = v.map(|x| x.into());
1661 self
1662 }
1663
1664 /// Sets the value of [postdeploy][crate::model::custom_canary_deployment::PhaseConfig::postdeploy].
1665 ///
1666 /// # Example
1667 /// ```ignore,no_run
1668 /// # use google_cloud_deploy_v1::model::custom_canary_deployment::PhaseConfig;
1669 /// use google_cloud_deploy_v1::model::Postdeploy;
1670 /// let x = PhaseConfig::new().set_postdeploy(Postdeploy::default()/* use setters */);
1671 /// ```
1672 pub fn set_postdeploy<T>(mut self, v: T) -> Self
1673 where
1674 T: std::convert::Into<crate::model::Postdeploy>,
1675 {
1676 self.postdeploy = std::option::Option::Some(v.into());
1677 self
1678 }
1679
1680 /// Sets or clears the value of [postdeploy][crate::model::custom_canary_deployment::PhaseConfig::postdeploy].
1681 ///
1682 /// # Example
1683 /// ```ignore,no_run
1684 /// # use google_cloud_deploy_v1::model::custom_canary_deployment::PhaseConfig;
1685 /// use google_cloud_deploy_v1::model::Postdeploy;
1686 /// let x = PhaseConfig::new().set_or_clear_postdeploy(Some(Postdeploy::default()/* use setters */));
1687 /// let x = PhaseConfig::new().set_or_clear_postdeploy(None::<Postdeploy>);
1688 /// ```
1689 pub fn set_or_clear_postdeploy<T>(mut self, v: std::option::Option<T>) -> Self
1690 where
1691 T: std::convert::Into<crate::model::Postdeploy>,
1692 {
1693 self.postdeploy = v.map(|x| x.into());
1694 self
1695 }
1696 }
1697
1698 impl wkt::message::Message for PhaseConfig {
1699 fn typename() -> &'static str {
1700 "type.googleapis.com/google.cloud.deploy.v1.CustomCanaryDeployment.PhaseConfig"
1701 }
1702 }
1703}
1704
1705/// KubernetesConfig contains the Kubernetes runtime configuration.
1706#[derive(Clone, Default, PartialEq)]
1707#[non_exhaustive]
1708pub struct KubernetesConfig {
1709 /// The service definition configuration.
1710 pub service_definition: std::option::Option<crate::model::kubernetes_config::ServiceDefinition>,
1711
1712 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1713}
1714
1715impl KubernetesConfig {
1716 /// Creates a new default instance.
1717 pub fn new() -> Self {
1718 std::default::Default::default()
1719 }
1720
1721 /// Sets the value of [service_definition][crate::model::KubernetesConfig::service_definition].
1722 ///
1723 /// Note that all the setters affecting `service_definition` are mutually
1724 /// exclusive.
1725 ///
1726 /// # Example
1727 /// ```ignore,no_run
1728 /// # use google_cloud_deploy_v1::model::KubernetesConfig;
1729 /// use google_cloud_deploy_v1::model::kubernetes_config::GatewayServiceMesh;
1730 /// let x = KubernetesConfig::new().set_service_definition(Some(
1731 /// google_cloud_deploy_v1::model::kubernetes_config::ServiceDefinition::GatewayServiceMesh(GatewayServiceMesh::default().into())));
1732 /// ```
1733 pub fn set_service_definition<
1734 T: std::convert::Into<std::option::Option<crate::model::kubernetes_config::ServiceDefinition>>,
1735 >(
1736 mut self,
1737 v: T,
1738 ) -> Self {
1739 self.service_definition = v.into();
1740 self
1741 }
1742
1743 /// The value of [service_definition][crate::model::KubernetesConfig::service_definition]
1744 /// if it holds a `GatewayServiceMesh`, `None` if the field is not set or
1745 /// holds a different branch.
1746 pub fn gateway_service_mesh(
1747 &self,
1748 ) -> std::option::Option<&std::boxed::Box<crate::model::kubernetes_config::GatewayServiceMesh>>
1749 {
1750 #[allow(unreachable_patterns)]
1751 self.service_definition.as_ref().and_then(|v| match v {
1752 crate::model::kubernetes_config::ServiceDefinition::GatewayServiceMesh(v) => {
1753 std::option::Option::Some(v)
1754 }
1755 _ => std::option::Option::None,
1756 })
1757 }
1758
1759 /// Sets the value of [service_definition][crate::model::KubernetesConfig::service_definition]
1760 /// to hold a `GatewayServiceMesh`.
1761 ///
1762 /// Note that all the setters affecting `service_definition` are
1763 /// mutually exclusive.
1764 ///
1765 /// # Example
1766 /// ```ignore,no_run
1767 /// # use google_cloud_deploy_v1::model::KubernetesConfig;
1768 /// use google_cloud_deploy_v1::model::kubernetes_config::GatewayServiceMesh;
1769 /// let x = KubernetesConfig::new().set_gateway_service_mesh(GatewayServiceMesh::default()/* use setters */);
1770 /// assert!(x.gateway_service_mesh().is_some());
1771 /// assert!(x.service_networking().is_none());
1772 /// ```
1773 pub fn set_gateway_service_mesh<
1774 T: std::convert::Into<std::boxed::Box<crate::model::kubernetes_config::GatewayServiceMesh>>,
1775 >(
1776 mut self,
1777 v: T,
1778 ) -> Self {
1779 self.service_definition = std::option::Option::Some(
1780 crate::model::kubernetes_config::ServiceDefinition::GatewayServiceMesh(v.into()),
1781 );
1782 self
1783 }
1784
1785 /// The value of [service_definition][crate::model::KubernetesConfig::service_definition]
1786 /// if it holds a `ServiceNetworking`, `None` if the field is not set or
1787 /// holds a different branch.
1788 pub fn service_networking(
1789 &self,
1790 ) -> std::option::Option<&std::boxed::Box<crate::model::kubernetes_config::ServiceNetworking>>
1791 {
1792 #[allow(unreachable_patterns)]
1793 self.service_definition.as_ref().and_then(|v| match v {
1794 crate::model::kubernetes_config::ServiceDefinition::ServiceNetworking(v) => {
1795 std::option::Option::Some(v)
1796 }
1797 _ => std::option::Option::None,
1798 })
1799 }
1800
1801 /// Sets the value of [service_definition][crate::model::KubernetesConfig::service_definition]
1802 /// to hold a `ServiceNetworking`.
1803 ///
1804 /// Note that all the setters affecting `service_definition` are
1805 /// mutually exclusive.
1806 ///
1807 /// # Example
1808 /// ```ignore,no_run
1809 /// # use google_cloud_deploy_v1::model::KubernetesConfig;
1810 /// use google_cloud_deploy_v1::model::kubernetes_config::ServiceNetworking;
1811 /// let x = KubernetesConfig::new().set_service_networking(ServiceNetworking::default()/* use setters */);
1812 /// assert!(x.service_networking().is_some());
1813 /// assert!(x.gateway_service_mesh().is_none());
1814 /// ```
1815 pub fn set_service_networking<
1816 T: std::convert::Into<std::boxed::Box<crate::model::kubernetes_config::ServiceNetworking>>,
1817 >(
1818 mut self,
1819 v: T,
1820 ) -> Self {
1821 self.service_definition = std::option::Option::Some(
1822 crate::model::kubernetes_config::ServiceDefinition::ServiceNetworking(v.into()),
1823 );
1824 self
1825 }
1826}
1827
1828impl wkt::message::Message for KubernetesConfig {
1829 fn typename() -> &'static str {
1830 "type.googleapis.com/google.cloud.deploy.v1.KubernetesConfig"
1831 }
1832}
1833
1834/// Defines additional types related to [KubernetesConfig].
1835pub mod kubernetes_config {
1836 #[allow(unused_imports)]
1837 use super::*;
1838
1839 /// Information about the Kubernetes Gateway API service mesh configuration.
1840 #[derive(Clone, Default, PartialEq)]
1841 #[non_exhaustive]
1842 pub struct GatewayServiceMesh {
1843 /// Required. Name of the Gateway API HTTPRoute.
1844 pub http_route: std::string::String,
1845
1846 /// Required. Name of the Kubernetes Service.
1847 pub service: std::string::String,
1848
1849 /// Required. Name of the Kubernetes Deployment whose traffic is managed by
1850 /// the specified HTTPRoute and Service.
1851 pub deployment: std::string::String,
1852
1853 /// Optional. The time to wait for route updates to propagate. The maximum
1854 /// configurable time is 3 hours, in seconds format. If unspecified, there is
1855 /// no wait time.
1856 pub route_update_wait_time: std::option::Option<wkt::Duration>,
1857
1858 /// Optional. The amount of time to migrate traffic back from the canary
1859 /// Service to the original Service during the stable phase deployment. If
1860 /// specified, must be between 15s and 3600s. If unspecified, there is no
1861 /// cutback time.
1862 pub stable_cutback_duration: std::option::Option<wkt::Duration>,
1863
1864 /// Optional. The label to use when selecting Pods for the Deployment and
1865 /// Service resources. This label must already be present in both resources.
1866 pub pod_selector_label: std::string::String,
1867
1868 /// Optional. Route destinations allow configuring the Gateway API HTTPRoute
1869 /// to be deployed to additional clusters. This option is available for
1870 /// multi-cluster service mesh set ups that require the route to exist in the
1871 /// clusters that call the service. If unspecified, the HTTPRoute will only
1872 /// be deployed to the Target cluster.
1873 pub route_destinations: std::option::Option<
1874 crate::model::kubernetes_config::gateway_service_mesh::RouteDestinations,
1875 >,
1876
1877 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1878 }
1879
1880 impl GatewayServiceMesh {
1881 /// Creates a new default instance.
1882 pub fn new() -> Self {
1883 std::default::Default::default()
1884 }
1885
1886 /// Sets the value of [http_route][crate::model::kubernetes_config::GatewayServiceMesh::http_route].
1887 ///
1888 /// # Example
1889 /// ```ignore,no_run
1890 /// # use google_cloud_deploy_v1::model::kubernetes_config::GatewayServiceMesh;
1891 /// let x = GatewayServiceMesh::new().set_http_route("example");
1892 /// ```
1893 pub fn set_http_route<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1894 self.http_route = v.into();
1895 self
1896 }
1897
1898 /// Sets the value of [service][crate::model::kubernetes_config::GatewayServiceMesh::service].
1899 ///
1900 /// # Example
1901 /// ```ignore,no_run
1902 /// # use google_cloud_deploy_v1::model::kubernetes_config::GatewayServiceMesh;
1903 /// let x = GatewayServiceMesh::new().set_service("example");
1904 /// ```
1905 pub fn set_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1906 self.service = v.into();
1907 self
1908 }
1909
1910 /// Sets the value of [deployment][crate::model::kubernetes_config::GatewayServiceMesh::deployment].
1911 ///
1912 /// # Example
1913 /// ```ignore,no_run
1914 /// # use google_cloud_deploy_v1::model::kubernetes_config::GatewayServiceMesh;
1915 /// let x = GatewayServiceMesh::new().set_deployment("example");
1916 /// ```
1917 pub fn set_deployment<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1918 self.deployment = v.into();
1919 self
1920 }
1921
1922 /// Sets the value of [route_update_wait_time][crate::model::kubernetes_config::GatewayServiceMesh::route_update_wait_time].
1923 ///
1924 /// # Example
1925 /// ```ignore,no_run
1926 /// # use google_cloud_deploy_v1::model::kubernetes_config::GatewayServiceMesh;
1927 /// use wkt::Duration;
1928 /// let x = GatewayServiceMesh::new().set_route_update_wait_time(Duration::default()/* use setters */);
1929 /// ```
1930 pub fn set_route_update_wait_time<T>(mut self, v: T) -> Self
1931 where
1932 T: std::convert::Into<wkt::Duration>,
1933 {
1934 self.route_update_wait_time = std::option::Option::Some(v.into());
1935 self
1936 }
1937
1938 /// Sets or clears the value of [route_update_wait_time][crate::model::kubernetes_config::GatewayServiceMesh::route_update_wait_time].
1939 ///
1940 /// # Example
1941 /// ```ignore,no_run
1942 /// # use google_cloud_deploy_v1::model::kubernetes_config::GatewayServiceMesh;
1943 /// use wkt::Duration;
1944 /// let x = GatewayServiceMesh::new().set_or_clear_route_update_wait_time(Some(Duration::default()/* use setters */));
1945 /// let x = GatewayServiceMesh::new().set_or_clear_route_update_wait_time(None::<Duration>);
1946 /// ```
1947 pub fn set_or_clear_route_update_wait_time<T>(mut self, v: std::option::Option<T>) -> Self
1948 where
1949 T: std::convert::Into<wkt::Duration>,
1950 {
1951 self.route_update_wait_time = v.map(|x| x.into());
1952 self
1953 }
1954
1955 /// Sets the value of [stable_cutback_duration][crate::model::kubernetes_config::GatewayServiceMesh::stable_cutback_duration].
1956 ///
1957 /// # Example
1958 /// ```ignore,no_run
1959 /// # use google_cloud_deploy_v1::model::kubernetes_config::GatewayServiceMesh;
1960 /// use wkt::Duration;
1961 /// let x = GatewayServiceMesh::new().set_stable_cutback_duration(Duration::default()/* use setters */);
1962 /// ```
1963 pub fn set_stable_cutback_duration<T>(mut self, v: T) -> Self
1964 where
1965 T: std::convert::Into<wkt::Duration>,
1966 {
1967 self.stable_cutback_duration = std::option::Option::Some(v.into());
1968 self
1969 }
1970
1971 /// Sets or clears the value of [stable_cutback_duration][crate::model::kubernetes_config::GatewayServiceMesh::stable_cutback_duration].
1972 ///
1973 /// # Example
1974 /// ```ignore,no_run
1975 /// # use google_cloud_deploy_v1::model::kubernetes_config::GatewayServiceMesh;
1976 /// use wkt::Duration;
1977 /// let x = GatewayServiceMesh::new().set_or_clear_stable_cutback_duration(Some(Duration::default()/* use setters */));
1978 /// let x = GatewayServiceMesh::new().set_or_clear_stable_cutback_duration(None::<Duration>);
1979 /// ```
1980 pub fn set_or_clear_stable_cutback_duration<T>(mut self, v: std::option::Option<T>) -> Self
1981 where
1982 T: std::convert::Into<wkt::Duration>,
1983 {
1984 self.stable_cutback_duration = v.map(|x| x.into());
1985 self
1986 }
1987
1988 /// Sets the value of [pod_selector_label][crate::model::kubernetes_config::GatewayServiceMesh::pod_selector_label].
1989 ///
1990 /// # Example
1991 /// ```ignore,no_run
1992 /// # use google_cloud_deploy_v1::model::kubernetes_config::GatewayServiceMesh;
1993 /// let x = GatewayServiceMesh::new().set_pod_selector_label("example");
1994 /// ```
1995 pub fn set_pod_selector_label<T: std::convert::Into<std::string::String>>(
1996 mut self,
1997 v: T,
1998 ) -> Self {
1999 self.pod_selector_label = v.into();
2000 self
2001 }
2002
2003 /// Sets the value of [route_destinations][crate::model::kubernetes_config::GatewayServiceMesh::route_destinations].
2004 ///
2005 /// # Example
2006 /// ```ignore,no_run
2007 /// # use google_cloud_deploy_v1::model::kubernetes_config::GatewayServiceMesh;
2008 /// use google_cloud_deploy_v1::model::kubernetes_config::gateway_service_mesh::RouteDestinations;
2009 /// let x = GatewayServiceMesh::new().set_route_destinations(RouteDestinations::default()/* use setters */);
2010 /// ```
2011 pub fn set_route_destinations<T>(mut self, v: T) -> Self
2012 where
2013 T: std::convert::Into<
2014 crate::model::kubernetes_config::gateway_service_mesh::RouteDestinations,
2015 >,
2016 {
2017 self.route_destinations = std::option::Option::Some(v.into());
2018 self
2019 }
2020
2021 /// Sets or clears the value of [route_destinations][crate::model::kubernetes_config::GatewayServiceMesh::route_destinations].
2022 ///
2023 /// # Example
2024 /// ```ignore,no_run
2025 /// # use google_cloud_deploy_v1::model::kubernetes_config::GatewayServiceMesh;
2026 /// use google_cloud_deploy_v1::model::kubernetes_config::gateway_service_mesh::RouteDestinations;
2027 /// let x = GatewayServiceMesh::new().set_or_clear_route_destinations(Some(RouteDestinations::default()/* use setters */));
2028 /// let x = GatewayServiceMesh::new().set_or_clear_route_destinations(None::<RouteDestinations>);
2029 /// ```
2030 pub fn set_or_clear_route_destinations<T>(mut self, v: std::option::Option<T>) -> Self
2031 where
2032 T: std::convert::Into<
2033 crate::model::kubernetes_config::gateway_service_mesh::RouteDestinations,
2034 >,
2035 {
2036 self.route_destinations = v.map(|x| x.into());
2037 self
2038 }
2039 }
2040
2041 impl wkt::message::Message for GatewayServiceMesh {
2042 fn typename() -> &'static str {
2043 "type.googleapis.com/google.cloud.deploy.v1.KubernetesConfig.GatewayServiceMesh"
2044 }
2045 }
2046
2047 /// Defines additional types related to [GatewayServiceMesh].
2048 pub mod gateway_service_mesh {
2049 #[allow(unused_imports)]
2050 use super::*;
2051
2052 /// Information about route destinations for the Gateway API service mesh.
2053 #[derive(Clone, Default, PartialEq)]
2054 #[non_exhaustive]
2055 pub struct RouteDestinations {
2056 /// Required. The clusters where the Gateway API HTTPRoute resource will be
2057 /// deployed to. Valid entries include the associated entities IDs
2058 /// configured in the Target resource and "@self" to include the Target
2059 /// cluster.
2060 pub destination_ids: std::vec::Vec<std::string::String>,
2061
2062 /// Optional. Whether to propagate the Kubernetes Service to the route
2063 /// destination clusters. The Service will always be deployed to the Target
2064 /// cluster even if the HTTPRoute is not. This option may be used to
2065 /// facilitate successful DNS lookup in the route destination clusters. Can
2066 /// only be set to true if destinations are specified.
2067 pub propagate_service: bool,
2068
2069 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2070 }
2071
2072 impl RouteDestinations {
2073 /// Creates a new default instance.
2074 pub fn new() -> Self {
2075 std::default::Default::default()
2076 }
2077
2078 /// Sets the value of [destination_ids][crate::model::kubernetes_config::gateway_service_mesh::RouteDestinations::destination_ids].
2079 ///
2080 /// # Example
2081 /// ```ignore,no_run
2082 /// # use google_cloud_deploy_v1::model::kubernetes_config::gateway_service_mesh::RouteDestinations;
2083 /// let x = RouteDestinations::new().set_destination_ids(["a", "b", "c"]);
2084 /// ```
2085 pub fn set_destination_ids<T, V>(mut self, v: T) -> Self
2086 where
2087 T: std::iter::IntoIterator<Item = V>,
2088 V: std::convert::Into<std::string::String>,
2089 {
2090 use std::iter::Iterator;
2091 self.destination_ids = v.into_iter().map(|i| i.into()).collect();
2092 self
2093 }
2094
2095 /// Sets the value of [propagate_service][crate::model::kubernetes_config::gateway_service_mesh::RouteDestinations::propagate_service].
2096 ///
2097 /// # Example
2098 /// ```ignore,no_run
2099 /// # use google_cloud_deploy_v1::model::kubernetes_config::gateway_service_mesh::RouteDestinations;
2100 /// let x = RouteDestinations::new().set_propagate_service(true);
2101 /// ```
2102 pub fn set_propagate_service<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2103 self.propagate_service = v.into();
2104 self
2105 }
2106 }
2107
2108 impl wkt::message::Message for RouteDestinations {
2109 fn typename() -> &'static str {
2110 "type.googleapis.com/google.cloud.deploy.v1.KubernetesConfig.GatewayServiceMesh.RouteDestinations"
2111 }
2112 }
2113 }
2114
2115 /// Information about the Kubernetes Service networking configuration.
2116 #[derive(Clone, Default, PartialEq)]
2117 #[non_exhaustive]
2118 pub struct ServiceNetworking {
2119 /// Required. Name of the Kubernetes Service.
2120 pub service: std::string::String,
2121
2122 /// Required. Name of the Kubernetes Deployment whose traffic is managed by
2123 /// the specified Service.
2124 pub deployment: std::string::String,
2125
2126 /// Optional. Whether to disable Pod overprovisioning. If Pod
2127 /// overprovisioning is disabled then Cloud Deploy will limit the number of
2128 /// total Pods used for the deployment strategy to the number of Pods the
2129 /// Deployment has on the cluster.
2130 pub disable_pod_overprovisioning: bool,
2131
2132 /// Optional. The label to use when selecting Pods for the Deployment
2133 /// resource. This label must already be present in the Deployment.
2134 pub pod_selector_label: std::string::String,
2135
2136 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2137 }
2138
2139 impl ServiceNetworking {
2140 /// Creates a new default instance.
2141 pub fn new() -> Self {
2142 std::default::Default::default()
2143 }
2144
2145 /// Sets the value of [service][crate::model::kubernetes_config::ServiceNetworking::service].
2146 ///
2147 /// # Example
2148 /// ```ignore,no_run
2149 /// # use google_cloud_deploy_v1::model::kubernetes_config::ServiceNetworking;
2150 /// let x = ServiceNetworking::new().set_service("example");
2151 /// ```
2152 pub fn set_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2153 self.service = v.into();
2154 self
2155 }
2156
2157 /// Sets the value of [deployment][crate::model::kubernetes_config::ServiceNetworking::deployment].
2158 ///
2159 /// # Example
2160 /// ```ignore,no_run
2161 /// # use google_cloud_deploy_v1::model::kubernetes_config::ServiceNetworking;
2162 /// let x = ServiceNetworking::new().set_deployment("example");
2163 /// ```
2164 pub fn set_deployment<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2165 self.deployment = v.into();
2166 self
2167 }
2168
2169 /// Sets the value of [disable_pod_overprovisioning][crate::model::kubernetes_config::ServiceNetworking::disable_pod_overprovisioning].
2170 ///
2171 /// # Example
2172 /// ```ignore,no_run
2173 /// # use google_cloud_deploy_v1::model::kubernetes_config::ServiceNetworking;
2174 /// let x = ServiceNetworking::new().set_disable_pod_overprovisioning(true);
2175 /// ```
2176 pub fn set_disable_pod_overprovisioning<T: std::convert::Into<bool>>(
2177 mut self,
2178 v: T,
2179 ) -> Self {
2180 self.disable_pod_overprovisioning = v.into();
2181 self
2182 }
2183
2184 /// Sets the value of [pod_selector_label][crate::model::kubernetes_config::ServiceNetworking::pod_selector_label].
2185 ///
2186 /// # Example
2187 /// ```ignore,no_run
2188 /// # use google_cloud_deploy_v1::model::kubernetes_config::ServiceNetworking;
2189 /// let x = ServiceNetworking::new().set_pod_selector_label("example");
2190 /// ```
2191 pub fn set_pod_selector_label<T: std::convert::Into<std::string::String>>(
2192 mut self,
2193 v: T,
2194 ) -> Self {
2195 self.pod_selector_label = v.into();
2196 self
2197 }
2198 }
2199
2200 impl wkt::message::Message for ServiceNetworking {
2201 fn typename() -> &'static str {
2202 "type.googleapis.com/google.cloud.deploy.v1.KubernetesConfig.ServiceNetworking"
2203 }
2204 }
2205
2206 /// The service definition configuration.
2207 #[derive(Clone, Debug, PartialEq)]
2208 #[non_exhaustive]
2209 pub enum ServiceDefinition {
2210 /// Optional. Kubernetes Gateway API service mesh configuration.
2211 GatewayServiceMesh(std::boxed::Box<crate::model::kubernetes_config::GatewayServiceMesh>),
2212 /// Optional. Kubernetes Service networking configuration.
2213 ServiceNetworking(std::boxed::Box<crate::model::kubernetes_config::ServiceNetworking>),
2214 }
2215}
2216
2217/// CloudRunConfig contains the Cloud Run runtime configuration.
2218#[derive(Clone, Default, PartialEq)]
2219#[non_exhaustive]
2220pub struct CloudRunConfig {
2221 /// Optional. Whether Cloud Deploy should update the traffic stanza in a Cloud
2222 /// Run Service on the user's behalf to facilitate traffic splitting. This is
2223 /// required to be true for CanaryDeployments, but optional for
2224 /// CustomCanaryDeployments.
2225 pub automatic_traffic_control: bool,
2226
2227 /// Optional. A list of tags that are added to the canary revision while the
2228 /// canary phase is in progress.
2229 pub canary_revision_tags: std::vec::Vec<std::string::String>,
2230
2231 /// Optional. A list of tags that are added to the prior revision while the
2232 /// canary phase is in progress.
2233 pub prior_revision_tags: std::vec::Vec<std::string::String>,
2234
2235 /// Optional. A list of tags that are added to the final stable revision when
2236 /// the stable phase is applied.
2237 pub stable_revision_tags: std::vec::Vec<std::string::String>,
2238
2239 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2240}
2241
2242impl CloudRunConfig {
2243 /// Creates a new default instance.
2244 pub fn new() -> Self {
2245 std::default::Default::default()
2246 }
2247
2248 /// Sets the value of [automatic_traffic_control][crate::model::CloudRunConfig::automatic_traffic_control].
2249 ///
2250 /// # Example
2251 /// ```ignore,no_run
2252 /// # use google_cloud_deploy_v1::model::CloudRunConfig;
2253 /// let x = CloudRunConfig::new().set_automatic_traffic_control(true);
2254 /// ```
2255 pub fn set_automatic_traffic_control<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2256 self.automatic_traffic_control = v.into();
2257 self
2258 }
2259
2260 /// Sets the value of [canary_revision_tags][crate::model::CloudRunConfig::canary_revision_tags].
2261 ///
2262 /// # Example
2263 /// ```ignore,no_run
2264 /// # use google_cloud_deploy_v1::model::CloudRunConfig;
2265 /// let x = CloudRunConfig::new().set_canary_revision_tags(["a", "b", "c"]);
2266 /// ```
2267 pub fn set_canary_revision_tags<T, V>(mut self, v: T) -> Self
2268 where
2269 T: std::iter::IntoIterator<Item = V>,
2270 V: std::convert::Into<std::string::String>,
2271 {
2272 use std::iter::Iterator;
2273 self.canary_revision_tags = v.into_iter().map(|i| i.into()).collect();
2274 self
2275 }
2276
2277 /// Sets the value of [prior_revision_tags][crate::model::CloudRunConfig::prior_revision_tags].
2278 ///
2279 /// # Example
2280 /// ```ignore,no_run
2281 /// # use google_cloud_deploy_v1::model::CloudRunConfig;
2282 /// let x = CloudRunConfig::new().set_prior_revision_tags(["a", "b", "c"]);
2283 /// ```
2284 pub fn set_prior_revision_tags<T, V>(mut self, v: T) -> Self
2285 where
2286 T: std::iter::IntoIterator<Item = V>,
2287 V: std::convert::Into<std::string::String>,
2288 {
2289 use std::iter::Iterator;
2290 self.prior_revision_tags = v.into_iter().map(|i| i.into()).collect();
2291 self
2292 }
2293
2294 /// Sets the value of [stable_revision_tags][crate::model::CloudRunConfig::stable_revision_tags].
2295 ///
2296 /// # Example
2297 /// ```ignore,no_run
2298 /// # use google_cloud_deploy_v1::model::CloudRunConfig;
2299 /// let x = CloudRunConfig::new().set_stable_revision_tags(["a", "b", "c"]);
2300 /// ```
2301 pub fn set_stable_revision_tags<T, V>(mut self, v: T) -> Self
2302 where
2303 T: std::iter::IntoIterator<Item = V>,
2304 V: std::convert::Into<std::string::String>,
2305 {
2306 use std::iter::Iterator;
2307 self.stable_revision_tags = v.into_iter().map(|i| i.into()).collect();
2308 self
2309 }
2310}
2311
2312impl wkt::message::Message for CloudRunConfig {
2313 fn typename() -> &'static str {
2314 "type.googleapis.com/google.cloud.deploy.v1.CloudRunConfig"
2315 }
2316}
2317
2318/// RuntimeConfig contains the runtime specific configurations for a deployment
2319/// strategy.
2320#[derive(Clone, Default, PartialEq)]
2321#[non_exhaustive]
2322pub struct RuntimeConfig {
2323 /// The runtime configuration details.
2324 pub runtime_config: std::option::Option<crate::model::runtime_config::RuntimeConfig>,
2325
2326 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2327}
2328
2329impl RuntimeConfig {
2330 /// Creates a new default instance.
2331 pub fn new() -> Self {
2332 std::default::Default::default()
2333 }
2334
2335 /// Sets the value of [runtime_config][crate::model::RuntimeConfig::runtime_config].
2336 ///
2337 /// Note that all the setters affecting `runtime_config` are mutually
2338 /// exclusive.
2339 ///
2340 /// # Example
2341 /// ```ignore,no_run
2342 /// # use google_cloud_deploy_v1::model::RuntimeConfig;
2343 /// use google_cloud_deploy_v1::model::KubernetesConfig;
2344 /// let x = RuntimeConfig::new().set_runtime_config(Some(
2345 /// google_cloud_deploy_v1::model::runtime_config::RuntimeConfig::Kubernetes(KubernetesConfig::default().into())));
2346 /// ```
2347 pub fn set_runtime_config<
2348 T: std::convert::Into<std::option::Option<crate::model::runtime_config::RuntimeConfig>>,
2349 >(
2350 mut self,
2351 v: T,
2352 ) -> Self {
2353 self.runtime_config = v.into();
2354 self
2355 }
2356
2357 /// The value of [runtime_config][crate::model::RuntimeConfig::runtime_config]
2358 /// if it holds a `Kubernetes`, `None` if the field is not set or
2359 /// holds a different branch.
2360 pub fn kubernetes(
2361 &self,
2362 ) -> std::option::Option<&std::boxed::Box<crate::model::KubernetesConfig>> {
2363 #[allow(unreachable_patterns)]
2364 self.runtime_config.as_ref().and_then(|v| match v {
2365 crate::model::runtime_config::RuntimeConfig::Kubernetes(v) => {
2366 std::option::Option::Some(v)
2367 }
2368 _ => std::option::Option::None,
2369 })
2370 }
2371
2372 /// Sets the value of [runtime_config][crate::model::RuntimeConfig::runtime_config]
2373 /// to hold a `Kubernetes`.
2374 ///
2375 /// Note that all the setters affecting `runtime_config` are
2376 /// mutually exclusive.
2377 ///
2378 /// # Example
2379 /// ```ignore,no_run
2380 /// # use google_cloud_deploy_v1::model::RuntimeConfig;
2381 /// use google_cloud_deploy_v1::model::KubernetesConfig;
2382 /// let x = RuntimeConfig::new().set_kubernetes(KubernetesConfig::default()/* use setters */);
2383 /// assert!(x.kubernetes().is_some());
2384 /// assert!(x.cloud_run().is_none());
2385 /// ```
2386 pub fn set_kubernetes<
2387 T: std::convert::Into<std::boxed::Box<crate::model::KubernetesConfig>>,
2388 >(
2389 mut self,
2390 v: T,
2391 ) -> Self {
2392 self.runtime_config = std::option::Option::Some(
2393 crate::model::runtime_config::RuntimeConfig::Kubernetes(v.into()),
2394 );
2395 self
2396 }
2397
2398 /// The value of [runtime_config][crate::model::RuntimeConfig::runtime_config]
2399 /// if it holds a `CloudRun`, `None` if the field is not set or
2400 /// holds a different branch.
2401 pub fn cloud_run(&self) -> std::option::Option<&std::boxed::Box<crate::model::CloudRunConfig>> {
2402 #[allow(unreachable_patterns)]
2403 self.runtime_config.as_ref().and_then(|v| match v {
2404 crate::model::runtime_config::RuntimeConfig::CloudRun(v) => {
2405 std::option::Option::Some(v)
2406 }
2407 _ => std::option::Option::None,
2408 })
2409 }
2410
2411 /// Sets the value of [runtime_config][crate::model::RuntimeConfig::runtime_config]
2412 /// to hold a `CloudRun`.
2413 ///
2414 /// Note that all the setters affecting `runtime_config` are
2415 /// mutually exclusive.
2416 ///
2417 /// # Example
2418 /// ```ignore,no_run
2419 /// # use google_cloud_deploy_v1::model::RuntimeConfig;
2420 /// use google_cloud_deploy_v1::model::CloudRunConfig;
2421 /// let x = RuntimeConfig::new().set_cloud_run(CloudRunConfig::default()/* use setters */);
2422 /// assert!(x.cloud_run().is_some());
2423 /// assert!(x.kubernetes().is_none());
2424 /// ```
2425 pub fn set_cloud_run<T: std::convert::Into<std::boxed::Box<crate::model::CloudRunConfig>>>(
2426 mut self,
2427 v: T,
2428 ) -> Self {
2429 self.runtime_config = std::option::Option::Some(
2430 crate::model::runtime_config::RuntimeConfig::CloudRun(v.into()),
2431 );
2432 self
2433 }
2434}
2435
2436impl wkt::message::Message for RuntimeConfig {
2437 fn typename() -> &'static str {
2438 "type.googleapis.com/google.cloud.deploy.v1.RuntimeConfig"
2439 }
2440}
2441
2442/// Defines additional types related to [RuntimeConfig].
2443pub mod runtime_config {
2444 #[allow(unused_imports)]
2445 use super::*;
2446
2447 /// The runtime configuration details.
2448 #[derive(Clone, Debug, PartialEq)]
2449 #[non_exhaustive]
2450 pub enum RuntimeConfig {
2451 /// Optional. Kubernetes runtime configuration.
2452 Kubernetes(std::boxed::Box<crate::model::KubernetesConfig>),
2453 /// Optional. Cloud Run runtime configuration.
2454 CloudRun(std::boxed::Box<crate::model::CloudRunConfig>),
2455 }
2456}
2457
2458/// PipelineReadyCondition contains information around the status of the
2459/// Pipeline.
2460#[derive(Clone, Default, PartialEq)]
2461#[non_exhaustive]
2462pub struct PipelineReadyCondition {
2463 /// True if the Pipeline is in a valid state. Otherwise at least one condition
2464 /// in `PipelineCondition` is in an invalid state. Iterate over those
2465 /// conditions and see which condition(s) has status = false to find out what
2466 /// is wrong with the Pipeline.
2467 pub status: bool,
2468
2469 /// Last time the condition was updated.
2470 pub update_time: std::option::Option<wkt::Timestamp>,
2471
2472 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2473}
2474
2475impl PipelineReadyCondition {
2476 /// Creates a new default instance.
2477 pub fn new() -> Self {
2478 std::default::Default::default()
2479 }
2480
2481 /// Sets the value of [status][crate::model::PipelineReadyCondition::status].
2482 ///
2483 /// # Example
2484 /// ```ignore,no_run
2485 /// # use google_cloud_deploy_v1::model::PipelineReadyCondition;
2486 /// let x = PipelineReadyCondition::new().set_status(true);
2487 /// ```
2488 pub fn set_status<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2489 self.status = v.into();
2490 self
2491 }
2492
2493 /// Sets the value of [update_time][crate::model::PipelineReadyCondition::update_time].
2494 ///
2495 /// # Example
2496 /// ```ignore,no_run
2497 /// # use google_cloud_deploy_v1::model::PipelineReadyCondition;
2498 /// use wkt::Timestamp;
2499 /// let x = PipelineReadyCondition::new().set_update_time(Timestamp::default()/* use setters */);
2500 /// ```
2501 pub fn set_update_time<T>(mut self, v: T) -> Self
2502 where
2503 T: std::convert::Into<wkt::Timestamp>,
2504 {
2505 self.update_time = std::option::Option::Some(v.into());
2506 self
2507 }
2508
2509 /// Sets or clears the value of [update_time][crate::model::PipelineReadyCondition::update_time].
2510 ///
2511 /// # Example
2512 /// ```ignore,no_run
2513 /// # use google_cloud_deploy_v1::model::PipelineReadyCondition;
2514 /// use wkt::Timestamp;
2515 /// let x = PipelineReadyCondition::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
2516 /// let x = PipelineReadyCondition::new().set_or_clear_update_time(None::<Timestamp>);
2517 /// ```
2518 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
2519 where
2520 T: std::convert::Into<wkt::Timestamp>,
2521 {
2522 self.update_time = v.map(|x| x.into());
2523 self
2524 }
2525}
2526
2527impl wkt::message::Message for PipelineReadyCondition {
2528 fn typename() -> &'static str {
2529 "type.googleapis.com/google.cloud.deploy.v1.PipelineReadyCondition"
2530 }
2531}
2532
2533/// `TargetsPresentCondition` contains information on any Targets referenced in
2534/// the Delivery Pipeline that do not actually exist.
2535#[derive(Clone, Default, PartialEq)]
2536#[non_exhaustive]
2537pub struct TargetsPresentCondition {
2538 /// True if there aren't any missing Targets.
2539 pub status: bool,
2540
2541 /// The list of Target names that do not exist. For example,
2542 /// `projects/{project_id}/locations/{location_name}/targets/{target_name}`.
2543 pub missing_targets: std::vec::Vec<std::string::String>,
2544
2545 /// Last time the condition was updated.
2546 pub update_time: std::option::Option<wkt::Timestamp>,
2547
2548 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2549}
2550
2551impl TargetsPresentCondition {
2552 /// Creates a new default instance.
2553 pub fn new() -> Self {
2554 std::default::Default::default()
2555 }
2556
2557 /// Sets the value of [status][crate::model::TargetsPresentCondition::status].
2558 ///
2559 /// # Example
2560 /// ```ignore,no_run
2561 /// # use google_cloud_deploy_v1::model::TargetsPresentCondition;
2562 /// let x = TargetsPresentCondition::new().set_status(true);
2563 /// ```
2564 pub fn set_status<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2565 self.status = v.into();
2566 self
2567 }
2568
2569 /// Sets the value of [missing_targets][crate::model::TargetsPresentCondition::missing_targets].
2570 ///
2571 /// # Example
2572 /// ```ignore,no_run
2573 /// # use google_cloud_deploy_v1::model::TargetsPresentCondition;
2574 /// let x = TargetsPresentCondition::new().set_missing_targets(["a", "b", "c"]);
2575 /// ```
2576 pub fn set_missing_targets<T, V>(mut self, v: T) -> Self
2577 where
2578 T: std::iter::IntoIterator<Item = V>,
2579 V: std::convert::Into<std::string::String>,
2580 {
2581 use std::iter::Iterator;
2582 self.missing_targets = v.into_iter().map(|i| i.into()).collect();
2583 self
2584 }
2585
2586 /// Sets the value of [update_time][crate::model::TargetsPresentCondition::update_time].
2587 ///
2588 /// # Example
2589 /// ```ignore,no_run
2590 /// # use google_cloud_deploy_v1::model::TargetsPresentCondition;
2591 /// use wkt::Timestamp;
2592 /// let x = TargetsPresentCondition::new().set_update_time(Timestamp::default()/* use setters */);
2593 /// ```
2594 pub fn set_update_time<T>(mut self, v: T) -> Self
2595 where
2596 T: std::convert::Into<wkt::Timestamp>,
2597 {
2598 self.update_time = std::option::Option::Some(v.into());
2599 self
2600 }
2601
2602 /// Sets or clears the value of [update_time][crate::model::TargetsPresentCondition::update_time].
2603 ///
2604 /// # Example
2605 /// ```ignore,no_run
2606 /// # use google_cloud_deploy_v1::model::TargetsPresentCondition;
2607 /// use wkt::Timestamp;
2608 /// let x = TargetsPresentCondition::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
2609 /// let x = TargetsPresentCondition::new().set_or_clear_update_time(None::<Timestamp>);
2610 /// ```
2611 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
2612 where
2613 T: std::convert::Into<wkt::Timestamp>,
2614 {
2615 self.update_time = v.map(|x| x.into());
2616 self
2617 }
2618}
2619
2620impl wkt::message::Message for TargetsPresentCondition {
2621 fn typename() -> &'static str {
2622 "type.googleapis.com/google.cloud.deploy.v1.TargetsPresentCondition"
2623 }
2624}
2625
2626/// TargetsTypeCondition contains information on whether the Targets defined in
2627/// the Delivery Pipeline are of the same type.
2628#[derive(Clone, Default, PartialEq)]
2629#[non_exhaustive]
2630pub struct TargetsTypeCondition {
2631 /// True if the targets are all a comparable type. For example this is true if
2632 /// all targets are GKE clusters. This is false if some targets are Cloud Run
2633 /// targets and others are GKE clusters.
2634 pub status: bool,
2635
2636 /// Human readable error message.
2637 pub error_details: std::string::String,
2638
2639 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2640}
2641
2642impl TargetsTypeCondition {
2643 /// Creates a new default instance.
2644 pub fn new() -> Self {
2645 std::default::Default::default()
2646 }
2647
2648 /// Sets the value of [status][crate::model::TargetsTypeCondition::status].
2649 ///
2650 /// # Example
2651 /// ```ignore,no_run
2652 /// # use google_cloud_deploy_v1::model::TargetsTypeCondition;
2653 /// let x = TargetsTypeCondition::new().set_status(true);
2654 /// ```
2655 pub fn set_status<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2656 self.status = v.into();
2657 self
2658 }
2659
2660 /// Sets the value of [error_details][crate::model::TargetsTypeCondition::error_details].
2661 ///
2662 /// # Example
2663 /// ```ignore,no_run
2664 /// # use google_cloud_deploy_v1::model::TargetsTypeCondition;
2665 /// let x = TargetsTypeCondition::new().set_error_details("example");
2666 /// ```
2667 pub fn set_error_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2668 self.error_details = v.into();
2669 self
2670 }
2671}
2672
2673impl wkt::message::Message for TargetsTypeCondition {
2674 fn typename() -> &'static str {
2675 "type.googleapis.com/google.cloud.deploy.v1.TargetsTypeCondition"
2676 }
2677}
2678
2679/// PipelineCondition contains all conditions relevant to a Delivery Pipeline.
2680#[derive(Clone, Default, PartialEq)]
2681#[non_exhaustive]
2682pub struct PipelineCondition {
2683 /// Details around the Pipeline's overall status.
2684 pub pipeline_ready_condition: std::option::Option<crate::model::PipelineReadyCondition>,
2685
2686 /// Details around targets enumerated in the pipeline.
2687 pub targets_present_condition: std::option::Option<crate::model::TargetsPresentCondition>,
2688
2689 /// Details on the whether the targets enumerated in the pipeline are of the
2690 /// same type.
2691 pub targets_type_condition: std::option::Option<crate::model::TargetsTypeCondition>,
2692
2693 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2694}
2695
2696impl PipelineCondition {
2697 /// Creates a new default instance.
2698 pub fn new() -> Self {
2699 std::default::Default::default()
2700 }
2701
2702 /// Sets the value of [pipeline_ready_condition][crate::model::PipelineCondition::pipeline_ready_condition].
2703 ///
2704 /// # Example
2705 /// ```ignore,no_run
2706 /// # use google_cloud_deploy_v1::model::PipelineCondition;
2707 /// use google_cloud_deploy_v1::model::PipelineReadyCondition;
2708 /// let x = PipelineCondition::new().set_pipeline_ready_condition(PipelineReadyCondition::default()/* use setters */);
2709 /// ```
2710 pub fn set_pipeline_ready_condition<T>(mut self, v: T) -> Self
2711 where
2712 T: std::convert::Into<crate::model::PipelineReadyCondition>,
2713 {
2714 self.pipeline_ready_condition = std::option::Option::Some(v.into());
2715 self
2716 }
2717
2718 /// Sets or clears the value of [pipeline_ready_condition][crate::model::PipelineCondition::pipeline_ready_condition].
2719 ///
2720 /// # Example
2721 /// ```ignore,no_run
2722 /// # use google_cloud_deploy_v1::model::PipelineCondition;
2723 /// use google_cloud_deploy_v1::model::PipelineReadyCondition;
2724 /// let x = PipelineCondition::new().set_or_clear_pipeline_ready_condition(Some(PipelineReadyCondition::default()/* use setters */));
2725 /// let x = PipelineCondition::new().set_or_clear_pipeline_ready_condition(None::<PipelineReadyCondition>);
2726 /// ```
2727 pub fn set_or_clear_pipeline_ready_condition<T>(mut self, v: std::option::Option<T>) -> Self
2728 where
2729 T: std::convert::Into<crate::model::PipelineReadyCondition>,
2730 {
2731 self.pipeline_ready_condition = v.map(|x| x.into());
2732 self
2733 }
2734
2735 /// Sets the value of [targets_present_condition][crate::model::PipelineCondition::targets_present_condition].
2736 ///
2737 /// # Example
2738 /// ```ignore,no_run
2739 /// # use google_cloud_deploy_v1::model::PipelineCondition;
2740 /// use google_cloud_deploy_v1::model::TargetsPresentCondition;
2741 /// let x = PipelineCondition::new().set_targets_present_condition(TargetsPresentCondition::default()/* use setters */);
2742 /// ```
2743 pub fn set_targets_present_condition<T>(mut self, v: T) -> Self
2744 where
2745 T: std::convert::Into<crate::model::TargetsPresentCondition>,
2746 {
2747 self.targets_present_condition = std::option::Option::Some(v.into());
2748 self
2749 }
2750
2751 /// Sets or clears the value of [targets_present_condition][crate::model::PipelineCondition::targets_present_condition].
2752 ///
2753 /// # Example
2754 /// ```ignore,no_run
2755 /// # use google_cloud_deploy_v1::model::PipelineCondition;
2756 /// use google_cloud_deploy_v1::model::TargetsPresentCondition;
2757 /// let x = PipelineCondition::new().set_or_clear_targets_present_condition(Some(TargetsPresentCondition::default()/* use setters */));
2758 /// let x = PipelineCondition::new().set_or_clear_targets_present_condition(None::<TargetsPresentCondition>);
2759 /// ```
2760 pub fn set_or_clear_targets_present_condition<T>(mut self, v: std::option::Option<T>) -> Self
2761 where
2762 T: std::convert::Into<crate::model::TargetsPresentCondition>,
2763 {
2764 self.targets_present_condition = v.map(|x| x.into());
2765 self
2766 }
2767
2768 /// Sets the value of [targets_type_condition][crate::model::PipelineCondition::targets_type_condition].
2769 ///
2770 /// # Example
2771 /// ```ignore,no_run
2772 /// # use google_cloud_deploy_v1::model::PipelineCondition;
2773 /// use google_cloud_deploy_v1::model::TargetsTypeCondition;
2774 /// let x = PipelineCondition::new().set_targets_type_condition(TargetsTypeCondition::default()/* use setters */);
2775 /// ```
2776 pub fn set_targets_type_condition<T>(mut self, v: T) -> Self
2777 where
2778 T: std::convert::Into<crate::model::TargetsTypeCondition>,
2779 {
2780 self.targets_type_condition = std::option::Option::Some(v.into());
2781 self
2782 }
2783
2784 /// Sets or clears the value of [targets_type_condition][crate::model::PipelineCondition::targets_type_condition].
2785 ///
2786 /// # Example
2787 /// ```ignore,no_run
2788 /// # use google_cloud_deploy_v1::model::PipelineCondition;
2789 /// use google_cloud_deploy_v1::model::TargetsTypeCondition;
2790 /// let x = PipelineCondition::new().set_or_clear_targets_type_condition(Some(TargetsTypeCondition::default()/* use setters */));
2791 /// let x = PipelineCondition::new().set_or_clear_targets_type_condition(None::<TargetsTypeCondition>);
2792 /// ```
2793 pub fn set_or_clear_targets_type_condition<T>(mut self, v: std::option::Option<T>) -> Self
2794 where
2795 T: std::convert::Into<crate::model::TargetsTypeCondition>,
2796 {
2797 self.targets_type_condition = v.map(|x| x.into());
2798 self
2799 }
2800}
2801
2802impl wkt::message::Message for PipelineCondition {
2803 fn typename() -> &'static str {
2804 "type.googleapis.com/google.cloud.deploy.v1.PipelineCondition"
2805 }
2806}
2807
2808/// The request object for `ListDeliveryPipelines`.
2809#[derive(Clone, Default, PartialEq)]
2810#[non_exhaustive]
2811pub struct ListDeliveryPipelinesRequest {
2812 /// Required. The parent, which owns this collection of pipelines. Format must
2813 /// be `projects/{project_id}/locations/{location_name}`.
2814 pub parent: std::string::String,
2815
2816 /// The maximum number of pipelines to return. The service may return
2817 /// fewer than this value. If unspecified, at most 50 pipelines will
2818 /// be returned. The maximum value is 1000; values above 1000 will be set
2819 /// to 1000.
2820 pub page_size: i32,
2821
2822 /// A page token, received from a previous `ListDeliveryPipelines` call.
2823 /// Provide this to retrieve the subsequent page.
2824 ///
2825 /// When paginating, all other provided parameters match
2826 /// the call that provided the page token.
2827 pub page_token: std::string::String,
2828
2829 /// Filter pipelines to be returned. See <https://google.aip.dev/160> for more
2830 /// details.
2831 pub filter: std::string::String,
2832
2833 /// Field to sort by. See <https://google.aip.dev/132#ordering> for more details.
2834 pub order_by: std::string::String,
2835
2836 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2837}
2838
2839impl ListDeliveryPipelinesRequest {
2840 /// Creates a new default instance.
2841 pub fn new() -> Self {
2842 std::default::Default::default()
2843 }
2844
2845 /// Sets the value of [parent][crate::model::ListDeliveryPipelinesRequest::parent].
2846 ///
2847 /// # Example
2848 /// ```ignore,no_run
2849 /// # use google_cloud_deploy_v1::model::ListDeliveryPipelinesRequest;
2850 /// # let project_id = "project_id";
2851 /// # let location_id = "location_id";
2852 /// let x = ListDeliveryPipelinesRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
2853 /// ```
2854 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2855 self.parent = v.into();
2856 self
2857 }
2858
2859 /// Sets the value of [page_size][crate::model::ListDeliveryPipelinesRequest::page_size].
2860 ///
2861 /// # Example
2862 /// ```ignore,no_run
2863 /// # use google_cloud_deploy_v1::model::ListDeliveryPipelinesRequest;
2864 /// let x = ListDeliveryPipelinesRequest::new().set_page_size(42);
2865 /// ```
2866 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2867 self.page_size = v.into();
2868 self
2869 }
2870
2871 /// Sets the value of [page_token][crate::model::ListDeliveryPipelinesRequest::page_token].
2872 ///
2873 /// # Example
2874 /// ```ignore,no_run
2875 /// # use google_cloud_deploy_v1::model::ListDeliveryPipelinesRequest;
2876 /// let x = ListDeliveryPipelinesRequest::new().set_page_token("example");
2877 /// ```
2878 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2879 self.page_token = v.into();
2880 self
2881 }
2882
2883 /// Sets the value of [filter][crate::model::ListDeliveryPipelinesRequest::filter].
2884 ///
2885 /// # Example
2886 /// ```ignore,no_run
2887 /// # use google_cloud_deploy_v1::model::ListDeliveryPipelinesRequest;
2888 /// let x = ListDeliveryPipelinesRequest::new().set_filter("example");
2889 /// ```
2890 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2891 self.filter = v.into();
2892 self
2893 }
2894
2895 /// Sets the value of [order_by][crate::model::ListDeliveryPipelinesRequest::order_by].
2896 ///
2897 /// # Example
2898 /// ```ignore,no_run
2899 /// # use google_cloud_deploy_v1::model::ListDeliveryPipelinesRequest;
2900 /// let x = ListDeliveryPipelinesRequest::new().set_order_by("example");
2901 /// ```
2902 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2903 self.order_by = v.into();
2904 self
2905 }
2906}
2907
2908impl wkt::message::Message for ListDeliveryPipelinesRequest {
2909 fn typename() -> &'static str {
2910 "type.googleapis.com/google.cloud.deploy.v1.ListDeliveryPipelinesRequest"
2911 }
2912}
2913
2914/// The response object from `ListDeliveryPipelines`.
2915#[derive(Clone, Default, PartialEq)]
2916#[non_exhaustive]
2917pub struct ListDeliveryPipelinesResponse {
2918 /// The `DeliveryPipeline` objects.
2919 pub delivery_pipelines: std::vec::Vec<crate::model::DeliveryPipeline>,
2920
2921 /// A token, which can be sent as `page_token` to retrieve the next page.
2922 /// If this field is omitted, there are no subsequent pages.
2923 pub next_page_token: std::string::String,
2924
2925 /// Locations that could not be reached.
2926 pub unreachable: std::vec::Vec<std::string::String>,
2927
2928 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2929}
2930
2931impl ListDeliveryPipelinesResponse {
2932 /// Creates a new default instance.
2933 pub fn new() -> Self {
2934 std::default::Default::default()
2935 }
2936
2937 /// Sets the value of [delivery_pipelines][crate::model::ListDeliveryPipelinesResponse::delivery_pipelines].
2938 ///
2939 /// # Example
2940 /// ```ignore,no_run
2941 /// # use google_cloud_deploy_v1::model::ListDeliveryPipelinesResponse;
2942 /// use google_cloud_deploy_v1::model::DeliveryPipeline;
2943 /// let x = ListDeliveryPipelinesResponse::new()
2944 /// .set_delivery_pipelines([
2945 /// DeliveryPipeline::default()/* use setters */,
2946 /// DeliveryPipeline::default()/* use (different) setters */,
2947 /// ]);
2948 /// ```
2949 pub fn set_delivery_pipelines<T, V>(mut self, v: T) -> Self
2950 where
2951 T: std::iter::IntoIterator<Item = V>,
2952 V: std::convert::Into<crate::model::DeliveryPipeline>,
2953 {
2954 use std::iter::Iterator;
2955 self.delivery_pipelines = v.into_iter().map(|i| i.into()).collect();
2956 self
2957 }
2958
2959 /// Sets the value of [next_page_token][crate::model::ListDeliveryPipelinesResponse::next_page_token].
2960 ///
2961 /// # Example
2962 /// ```ignore,no_run
2963 /// # use google_cloud_deploy_v1::model::ListDeliveryPipelinesResponse;
2964 /// let x = ListDeliveryPipelinesResponse::new().set_next_page_token("example");
2965 /// ```
2966 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2967 self.next_page_token = v.into();
2968 self
2969 }
2970
2971 /// Sets the value of [unreachable][crate::model::ListDeliveryPipelinesResponse::unreachable].
2972 ///
2973 /// # Example
2974 /// ```ignore,no_run
2975 /// # use google_cloud_deploy_v1::model::ListDeliveryPipelinesResponse;
2976 /// let x = ListDeliveryPipelinesResponse::new().set_unreachable(["a", "b", "c"]);
2977 /// ```
2978 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
2979 where
2980 T: std::iter::IntoIterator<Item = V>,
2981 V: std::convert::Into<std::string::String>,
2982 {
2983 use std::iter::Iterator;
2984 self.unreachable = v.into_iter().map(|i| i.into()).collect();
2985 self
2986 }
2987}
2988
2989impl wkt::message::Message for ListDeliveryPipelinesResponse {
2990 fn typename() -> &'static str {
2991 "type.googleapis.com/google.cloud.deploy.v1.ListDeliveryPipelinesResponse"
2992 }
2993}
2994
2995#[doc(hidden)]
2996impl google_cloud_gax::paginator::internal::PageableResponse for ListDeliveryPipelinesResponse {
2997 type PageItem = crate::model::DeliveryPipeline;
2998
2999 fn items(self) -> std::vec::Vec<Self::PageItem> {
3000 self.delivery_pipelines
3001 }
3002
3003 fn next_page_token(&self) -> std::string::String {
3004 use std::clone::Clone;
3005 self.next_page_token.clone()
3006 }
3007}
3008
3009/// The request object for `GetDeliveryPipeline`
3010#[derive(Clone, Default, PartialEq)]
3011#[non_exhaustive]
3012pub struct GetDeliveryPipelineRequest {
3013 /// Required. Name of the `DeliveryPipeline`. Format must be
3014 /// `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}`.
3015 pub name: std::string::String,
3016
3017 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3018}
3019
3020impl GetDeliveryPipelineRequest {
3021 /// Creates a new default instance.
3022 pub fn new() -> Self {
3023 std::default::Default::default()
3024 }
3025
3026 /// Sets the value of [name][crate::model::GetDeliveryPipelineRequest::name].
3027 ///
3028 /// # Example
3029 /// ```ignore,no_run
3030 /// # use google_cloud_deploy_v1::model::GetDeliveryPipelineRequest;
3031 /// # let project_id = "project_id";
3032 /// # let location_id = "location_id";
3033 /// # let delivery_pipeline_id = "delivery_pipeline_id";
3034 /// let x = GetDeliveryPipelineRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/deliveryPipelines/{delivery_pipeline_id}"));
3035 /// ```
3036 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3037 self.name = v.into();
3038 self
3039 }
3040}
3041
3042impl wkt::message::Message for GetDeliveryPipelineRequest {
3043 fn typename() -> &'static str {
3044 "type.googleapis.com/google.cloud.deploy.v1.GetDeliveryPipelineRequest"
3045 }
3046}
3047
3048/// The request object for `CreateDeliveryPipeline`.
3049#[derive(Clone, Default, PartialEq)]
3050#[non_exhaustive]
3051pub struct CreateDeliveryPipelineRequest {
3052 /// Required. The parent collection in which the `DeliveryPipeline` must be
3053 /// created. The format is `projects/{project_id}/locations/{location_name}`.
3054 pub parent: std::string::String,
3055
3056 /// Required. ID of the `DeliveryPipeline`.
3057 pub delivery_pipeline_id: std::string::String,
3058
3059 /// Required. The `DeliveryPipeline` to create.
3060 pub delivery_pipeline: std::option::Option<crate::model::DeliveryPipeline>,
3061
3062 /// Optional. A request ID to identify requests. Specify a unique request ID
3063 /// so that if you must retry your request, the server knows to ignore the
3064 /// request if it has already been completed. The server guarantees that for
3065 /// at least 60 minutes after the first request.
3066 ///
3067 /// For example, consider a situation where you make an initial request and the
3068 /// request times out. If you make the request again with the same request ID,
3069 /// the server can check if original operation with the same request ID was
3070 /// received, and if so, will ignore the second request. This prevents clients
3071 /// from accidentally creating duplicate commitments.
3072 ///
3073 /// The request ID must be a valid UUID with the exception that zero UUID is
3074 /// not supported (00000000-0000-0000-0000-000000000000).
3075 pub request_id: std::string::String,
3076
3077 /// Optional. If set to true, the request is validated and the user is provided
3078 /// with an expected result, but no actual change is made.
3079 pub validate_only: bool,
3080
3081 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3082}
3083
3084impl CreateDeliveryPipelineRequest {
3085 /// Creates a new default instance.
3086 pub fn new() -> Self {
3087 std::default::Default::default()
3088 }
3089
3090 /// Sets the value of [parent][crate::model::CreateDeliveryPipelineRequest::parent].
3091 ///
3092 /// # Example
3093 /// ```ignore,no_run
3094 /// # use google_cloud_deploy_v1::model::CreateDeliveryPipelineRequest;
3095 /// # let project_id = "project_id";
3096 /// # let location_id = "location_id";
3097 /// let x = CreateDeliveryPipelineRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
3098 /// ```
3099 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3100 self.parent = v.into();
3101 self
3102 }
3103
3104 /// Sets the value of [delivery_pipeline_id][crate::model::CreateDeliveryPipelineRequest::delivery_pipeline_id].
3105 ///
3106 /// # Example
3107 /// ```ignore,no_run
3108 /// # use google_cloud_deploy_v1::model::CreateDeliveryPipelineRequest;
3109 /// let x = CreateDeliveryPipelineRequest::new().set_delivery_pipeline_id("example");
3110 /// ```
3111 pub fn set_delivery_pipeline_id<T: std::convert::Into<std::string::String>>(
3112 mut self,
3113 v: T,
3114 ) -> Self {
3115 self.delivery_pipeline_id = v.into();
3116 self
3117 }
3118
3119 /// Sets the value of [delivery_pipeline][crate::model::CreateDeliveryPipelineRequest::delivery_pipeline].
3120 ///
3121 /// # Example
3122 /// ```ignore,no_run
3123 /// # use google_cloud_deploy_v1::model::CreateDeliveryPipelineRequest;
3124 /// use google_cloud_deploy_v1::model::DeliveryPipeline;
3125 /// let x = CreateDeliveryPipelineRequest::new().set_delivery_pipeline(DeliveryPipeline::default()/* use setters */);
3126 /// ```
3127 pub fn set_delivery_pipeline<T>(mut self, v: T) -> Self
3128 where
3129 T: std::convert::Into<crate::model::DeliveryPipeline>,
3130 {
3131 self.delivery_pipeline = std::option::Option::Some(v.into());
3132 self
3133 }
3134
3135 /// Sets or clears the value of [delivery_pipeline][crate::model::CreateDeliveryPipelineRequest::delivery_pipeline].
3136 ///
3137 /// # Example
3138 /// ```ignore,no_run
3139 /// # use google_cloud_deploy_v1::model::CreateDeliveryPipelineRequest;
3140 /// use google_cloud_deploy_v1::model::DeliveryPipeline;
3141 /// let x = CreateDeliveryPipelineRequest::new().set_or_clear_delivery_pipeline(Some(DeliveryPipeline::default()/* use setters */));
3142 /// let x = CreateDeliveryPipelineRequest::new().set_or_clear_delivery_pipeline(None::<DeliveryPipeline>);
3143 /// ```
3144 pub fn set_or_clear_delivery_pipeline<T>(mut self, v: std::option::Option<T>) -> Self
3145 where
3146 T: std::convert::Into<crate::model::DeliveryPipeline>,
3147 {
3148 self.delivery_pipeline = v.map(|x| x.into());
3149 self
3150 }
3151
3152 /// Sets the value of [request_id][crate::model::CreateDeliveryPipelineRequest::request_id].
3153 ///
3154 /// # Example
3155 /// ```ignore,no_run
3156 /// # use google_cloud_deploy_v1::model::CreateDeliveryPipelineRequest;
3157 /// let x = CreateDeliveryPipelineRequest::new().set_request_id("example");
3158 /// ```
3159 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3160 self.request_id = v.into();
3161 self
3162 }
3163
3164 /// Sets the value of [validate_only][crate::model::CreateDeliveryPipelineRequest::validate_only].
3165 ///
3166 /// # Example
3167 /// ```ignore,no_run
3168 /// # use google_cloud_deploy_v1::model::CreateDeliveryPipelineRequest;
3169 /// let x = CreateDeliveryPipelineRequest::new().set_validate_only(true);
3170 /// ```
3171 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3172 self.validate_only = v.into();
3173 self
3174 }
3175}
3176
3177impl wkt::message::Message for CreateDeliveryPipelineRequest {
3178 fn typename() -> &'static str {
3179 "type.googleapis.com/google.cloud.deploy.v1.CreateDeliveryPipelineRequest"
3180 }
3181}
3182
3183/// The request object for `UpdateDeliveryPipeline`.
3184#[derive(Clone, Default, PartialEq)]
3185#[non_exhaustive]
3186pub struct UpdateDeliveryPipelineRequest {
3187 /// Required. Field mask is used to specify the fields to be overwritten by the
3188 /// update in the `DeliveryPipeline` resource. The fields specified in the
3189 /// update_mask are relative to the resource, not the full request. A field
3190 /// will be overwritten if it's in the mask. If the user doesn't provide a mask
3191 /// then all fields are overwritten.
3192 pub update_mask: std::option::Option<wkt::FieldMask>,
3193
3194 /// Required. The `DeliveryPipeline` to update.
3195 pub delivery_pipeline: std::option::Option<crate::model::DeliveryPipeline>,
3196
3197 /// Optional. A request ID to identify requests. Specify a unique request ID
3198 /// so that if you must retry your request, the server knows to ignore the
3199 /// request if it has already been completed. The server guarantees that for
3200 /// at least 60 minutes after the first request.
3201 ///
3202 /// For example, consider a situation where you make an initial request and the
3203 /// request times out. If you make the request again with the same request ID,
3204 /// the server can check if original operation with the same request ID was
3205 /// received, and if so, will ignore the second request. This prevents clients
3206 /// from accidentally creating duplicate commitments.
3207 ///
3208 /// The request ID must be a valid UUID with the exception that zero UUID is
3209 /// not supported (00000000-0000-0000-0000-000000000000).
3210 pub request_id: std::string::String,
3211
3212 /// Optional. If set to true, updating a `DeliveryPipeline` that does not exist
3213 /// will result in the creation of a new `DeliveryPipeline`.
3214 pub allow_missing: bool,
3215
3216 /// Optional. If set to true, the request is validated and the user is provided
3217 /// with an expected result, but no actual change is made.
3218 pub validate_only: bool,
3219
3220 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3221}
3222
3223impl UpdateDeliveryPipelineRequest {
3224 /// Creates a new default instance.
3225 pub fn new() -> Self {
3226 std::default::Default::default()
3227 }
3228
3229 /// Sets the value of [update_mask][crate::model::UpdateDeliveryPipelineRequest::update_mask].
3230 ///
3231 /// # Example
3232 /// ```ignore,no_run
3233 /// # use google_cloud_deploy_v1::model::UpdateDeliveryPipelineRequest;
3234 /// use wkt::FieldMask;
3235 /// let x = UpdateDeliveryPipelineRequest::new().set_update_mask(FieldMask::default()/* use setters */);
3236 /// ```
3237 pub fn set_update_mask<T>(mut self, v: T) -> Self
3238 where
3239 T: std::convert::Into<wkt::FieldMask>,
3240 {
3241 self.update_mask = std::option::Option::Some(v.into());
3242 self
3243 }
3244
3245 /// Sets or clears the value of [update_mask][crate::model::UpdateDeliveryPipelineRequest::update_mask].
3246 ///
3247 /// # Example
3248 /// ```ignore,no_run
3249 /// # use google_cloud_deploy_v1::model::UpdateDeliveryPipelineRequest;
3250 /// use wkt::FieldMask;
3251 /// let x = UpdateDeliveryPipelineRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
3252 /// let x = UpdateDeliveryPipelineRequest::new().set_or_clear_update_mask(None::<FieldMask>);
3253 /// ```
3254 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3255 where
3256 T: std::convert::Into<wkt::FieldMask>,
3257 {
3258 self.update_mask = v.map(|x| x.into());
3259 self
3260 }
3261
3262 /// Sets the value of [delivery_pipeline][crate::model::UpdateDeliveryPipelineRequest::delivery_pipeline].
3263 ///
3264 /// # Example
3265 /// ```ignore,no_run
3266 /// # use google_cloud_deploy_v1::model::UpdateDeliveryPipelineRequest;
3267 /// use google_cloud_deploy_v1::model::DeliveryPipeline;
3268 /// let x = UpdateDeliveryPipelineRequest::new().set_delivery_pipeline(DeliveryPipeline::default()/* use setters */);
3269 /// ```
3270 pub fn set_delivery_pipeline<T>(mut self, v: T) -> Self
3271 where
3272 T: std::convert::Into<crate::model::DeliveryPipeline>,
3273 {
3274 self.delivery_pipeline = std::option::Option::Some(v.into());
3275 self
3276 }
3277
3278 /// Sets or clears the value of [delivery_pipeline][crate::model::UpdateDeliveryPipelineRequest::delivery_pipeline].
3279 ///
3280 /// # Example
3281 /// ```ignore,no_run
3282 /// # use google_cloud_deploy_v1::model::UpdateDeliveryPipelineRequest;
3283 /// use google_cloud_deploy_v1::model::DeliveryPipeline;
3284 /// let x = UpdateDeliveryPipelineRequest::new().set_or_clear_delivery_pipeline(Some(DeliveryPipeline::default()/* use setters */));
3285 /// let x = UpdateDeliveryPipelineRequest::new().set_or_clear_delivery_pipeline(None::<DeliveryPipeline>);
3286 /// ```
3287 pub fn set_or_clear_delivery_pipeline<T>(mut self, v: std::option::Option<T>) -> Self
3288 where
3289 T: std::convert::Into<crate::model::DeliveryPipeline>,
3290 {
3291 self.delivery_pipeline = v.map(|x| x.into());
3292 self
3293 }
3294
3295 /// Sets the value of [request_id][crate::model::UpdateDeliveryPipelineRequest::request_id].
3296 ///
3297 /// # Example
3298 /// ```ignore,no_run
3299 /// # use google_cloud_deploy_v1::model::UpdateDeliveryPipelineRequest;
3300 /// let x = UpdateDeliveryPipelineRequest::new().set_request_id("example");
3301 /// ```
3302 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3303 self.request_id = v.into();
3304 self
3305 }
3306
3307 /// Sets the value of [allow_missing][crate::model::UpdateDeliveryPipelineRequest::allow_missing].
3308 ///
3309 /// # Example
3310 /// ```ignore,no_run
3311 /// # use google_cloud_deploy_v1::model::UpdateDeliveryPipelineRequest;
3312 /// let x = UpdateDeliveryPipelineRequest::new().set_allow_missing(true);
3313 /// ```
3314 pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3315 self.allow_missing = v.into();
3316 self
3317 }
3318
3319 /// Sets the value of [validate_only][crate::model::UpdateDeliveryPipelineRequest::validate_only].
3320 ///
3321 /// # Example
3322 /// ```ignore,no_run
3323 /// # use google_cloud_deploy_v1::model::UpdateDeliveryPipelineRequest;
3324 /// let x = UpdateDeliveryPipelineRequest::new().set_validate_only(true);
3325 /// ```
3326 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3327 self.validate_only = v.into();
3328 self
3329 }
3330}
3331
3332impl wkt::message::Message for UpdateDeliveryPipelineRequest {
3333 fn typename() -> &'static str {
3334 "type.googleapis.com/google.cloud.deploy.v1.UpdateDeliveryPipelineRequest"
3335 }
3336}
3337
3338/// The request object for `DeleteDeliveryPipeline`.
3339#[derive(Clone, Default, PartialEq)]
3340#[non_exhaustive]
3341pub struct DeleteDeliveryPipelineRequest {
3342 /// Required. The name of the `DeliveryPipeline` to delete. The format is
3343 /// `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}`.
3344 pub name: std::string::String,
3345
3346 /// Optional. A request ID to identify requests. Specify a unique request ID
3347 /// so that if you must retry your request, the server knows to ignore the
3348 /// request if it has already been completed. The server guarantees that for
3349 /// at least 60 minutes after the first request.
3350 ///
3351 /// For example, consider a situation where you make an initial request and the
3352 /// request times out. If you make the request again with the same request ID,
3353 /// the server can check if original operation with the same request ID was
3354 /// received, and if so, will ignore the second request. This prevents clients
3355 /// from accidentally creating duplicate commitments.
3356 ///
3357 /// The request ID must be a valid UUID with the exception that zero UUID is
3358 /// not supported (00000000-0000-0000-0000-000000000000).
3359 pub request_id: std::string::String,
3360
3361 /// Optional. If set to true, then deleting an already deleted or non-existing
3362 /// `DeliveryPipeline` will succeed.
3363 pub allow_missing: bool,
3364
3365 /// Optional. If set, validate the request and preview the review, but do not
3366 /// actually post it.
3367 pub validate_only: bool,
3368
3369 /// Optional. If set to true, all child resources under this pipeline will also
3370 /// be deleted. Otherwise, the request will only work if the pipeline has no
3371 /// child resources.
3372 pub force: bool,
3373
3374 /// Optional. This checksum is computed by the server based on the value of
3375 /// other fields, and may be sent on update and delete requests to ensure the
3376 /// client has an up-to-date value before proceeding.
3377 pub etag: std::string::String,
3378
3379 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3380}
3381
3382impl DeleteDeliveryPipelineRequest {
3383 /// Creates a new default instance.
3384 pub fn new() -> Self {
3385 std::default::Default::default()
3386 }
3387
3388 /// Sets the value of [name][crate::model::DeleteDeliveryPipelineRequest::name].
3389 ///
3390 /// # Example
3391 /// ```ignore,no_run
3392 /// # use google_cloud_deploy_v1::model::DeleteDeliveryPipelineRequest;
3393 /// # let project_id = "project_id";
3394 /// # let location_id = "location_id";
3395 /// # let delivery_pipeline_id = "delivery_pipeline_id";
3396 /// let x = DeleteDeliveryPipelineRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/deliveryPipelines/{delivery_pipeline_id}"));
3397 /// ```
3398 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3399 self.name = v.into();
3400 self
3401 }
3402
3403 /// Sets the value of [request_id][crate::model::DeleteDeliveryPipelineRequest::request_id].
3404 ///
3405 /// # Example
3406 /// ```ignore,no_run
3407 /// # use google_cloud_deploy_v1::model::DeleteDeliveryPipelineRequest;
3408 /// let x = DeleteDeliveryPipelineRequest::new().set_request_id("example");
3409 /// ```
3410 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3411 self.request_id = v.into();
3412 self
3413 }
3414
3415 /// Sets the value of [allow_missing][crate::model::DeleteDeliveryPipelineRequest::allow_missing].
3416 ///
3417 /// # Example
3418 /// ```ignore,no_run
3419 /// # use google_cloud_deploy_v1::model::DeleteDeliveryPipelineRequest;
3420 /// let x = DeleteDeliveryPipelineRequest::new().set_allow_missing(true);
3421 /// ```
3422 pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3423 self.allow_missing = v.into();
3424 self
3425 }
3426
3427 /// Sets the value of [validate_only][crate::model::DeleteDeliveryPipelineRequest::validate_only].
3428 ///
3429 /// # Example
3430 /// ```ignore,no_run
3431 /// # use google_cloud_deploy_v1::model::DeleteDeliveryPipelineRequest;
3432 /// let x = DeleteDeliveryPipelineRequest::new().set_validate_only(true);
3433 /// ```
3434 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3435 self.validate_only = v.into();
3436 self
3437 }
3438
3439 /// Sets the value of [force][crate::model::DeleteDeliveryPipelineRequest::force].
3440 ///
3441 /// # Example
3442 /// ```ignore,no_run
3443 /// # use google_cloud_deploy_v1::model::DeleteDeliveryPipelineRequest;
3444 /// let x = DeleteDeliveryPipelineRequest::new().set_force(true);
3445 /// ```
3446 pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3447 self.force = v.into();
3448 self
3449 }
3450
3451 /// Sets the value of [etag][crate::model::DeleteDeliveryPipelineRequest::etag].
3452 ///
3453 /// # Example
3454 /// ```ignore,no_run
3455 /// # use google_cloud_deploy_v1::model::DeleteDeliveryPipelineRequest;
3456 /// let x = DeleteDeliveryPipelineRequest::new().set_etag("example");
3457 /// ```
3458 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3459 self.etag = v.into();
3460 self
3461 }
3462}
3463
3464impl wkt::message::Message for DeleteDeliveryPipelineRequest {
3465 fn typename() -> &'static str {
3466 "type.googleapis.com/google.cloud.deploy.v1.DeleteDeliveryPipelineRequest"
3467 }
3468}
3469
3470/// Configs for the Rollback rollout.
3471#[derive(Clone, Default, PartialEq)]
3472#[non_exhaustive]
3473pub struct RollbackTargetConfig {
3474 /// Optional. The rollback `Rollout` to create.
3475 pub rollout: std::option::Option<crate::model::Rollout>,
3476
3477 /// Optional. The starting phase ID for the `Rollout`. If unspecified, the
3478 /// `Rollout` will start in the stable phase.
3479 pub starting_phase_id: std::string::String,
3480
3481 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3482}
3483
3484impl RollbackTargetConfig {
3485 /// Creates a new default instance.
3486 pub fn new() -> Self {
3487 std::default::Default::default()
3488 }
3489
3490 /// Sets the value of [rollout][crate::model::RollbackTargetConfig::rollout].
3491 ///
3492 /// # Example
3493 /// ```ignore,no_run
3494 /// # use google_cloud_deploy_v1::model::RollbackTargetConfig;
3495 /// use google_cloud_deploy_v1::model::Rollout;
3496 /// let x = RollbackTargetConfig::new().set_rollout(Rollout::default()/* use setters */);
3497 /// ```
3498 pub fn set_rollout<T>(mut self, v: T) -> Self
3499 where
3500 T: std::convert::Into<crate::model::Rollout>,
3501 {
3502 self.rollout = std::option::Option::Some(v.into());
3503 self
3504 }
3505
3506 /// Sets or clears the value of [rollout][crate::model::RollbackTargetConfig::rollout].
3507 ///
3508 /// # Example
3509 /// ```ignore,no_run
3510 /// # use google_cloud_deploy_v1::model::RollbackTargetConfig;
3511 /// use google_cloud_deploy_v1::model::Rollout;
3512 /// let x = RollbackTargetConfig::new().set_or_clear_rollout(Some(Rollout::default()/* use setters */));
3513 /// let x = RollbackTargetConfig::new().set_or_clear_rollout(None::<Rollout>);
3514 /// ```
3515 pub fn set_or_clear_rollout<T>(mut self, v: std::option::Option<T>) -> Self
3516 where
3517 T: std::convert::Into<crate::model::Rollout>,
3518 {
3519 self.rollout = v.map(|x| x.into());
3520 self
3521 }
3522
3523 /// Sets the value of [starting_phase_id][crate::model::RollbackTargetConfig::starting_phase_id].
3524 ///
3525 /// # Example
3526 /// ```ignore,no_run
3527 /// # use google_cloud_deploy_v1::model::RollbackTargetConfig;
3528 /// let x = RollbackTargetConfig::new().set_starting_phase_id("example");
3529 /// ```
3530 pub fn set_starting_phase_id<T: std::convert::Into<std::string::String>>(
3531 mut self,
3532 v: T,
3533 ) -> Self {
3534 self.starting_phase_id = v.into();
3535 self
3536 }
3537}
3538
3539impl wkt::message::Message for RollbackTargetConfig {
3540 fn typename() -> &'static str {
3541 "type.googleapis.com/google.cloud.deploy.v1.RollbackTargetConfig"
3542 }
3543}
3544
3545/// The request object for `RollbackTarget`.
3546#[derive(Clone, Default, PartialEq)]
3547#[non_exhaustive]
3548pub struct RollbackTargetRequest {
3549 /// Required. The `DeliveryPipeline` for which the rollback `Rollout` must be
3550 /// created. The format is
3551 /// `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}`.
3552 pub name: std::string::String,
3553
3554 /// Required. ID of the `Target` that is being rolled back.
3555 pub target_id: std::string::String,
3556
3557 /// Required. ID of the rollback `Rollout` to create.
3558 pub rollout_id: std::string::String,
3559
3560 /// Optional. ID of the `Release` to roll back to. If this isn't specified, the
3561 /// previous successful `Rollout` to the specified target will be used to
3562 /// determine the `Release`.
3563 pub release_id: std::string::String,
3564
3565 /// Optional. If provided, this must be the latest `Rollout` that is on the
3566 /// `Target`.
3567 pub rollout_to_roll_back: std::string::String,
3568
3569 /// Optional. Configs for the rollback `Rollout`.
3570 pub rollback_config: std::option::Option<crate::model::RollbackTargetConfig>,
3571
3572 /// Optional. If set to true, the request is validated and the user is provided
3573 /// with a `RollbackTargetResponse`.
3574 pub validate_only: bool,
3575
3576 /// Optional. Deploy policies to override. Format is
3577 /// `projects/{project}/locations/{location}/deployPolicies/{deploy_policy}`.
3578 pub override_deploy_policy: std::vec::Vec<std::string::String>,
3579
3580 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3581}
3582
3583impl RollbackTargetRequest {
3584 /// Creates a new default instance.
3585 pub fn new() -> Self {
3586 std::default::Default::default()
3587 }
3588
3589 /// Sets the value of [name][crate::model::RollbackTargetRequest::name].
3590 ///
3591 /// # Example
3592 /// ```ignore,no_run
3593 /// # use google_cloud_deploy_v1::model::RollbackTargetRequest;
3594 /// # let project_id = "project_id";
3595 /// # let location_id = "location_id";
3596 /// # let delivery_pipeline_id = "delivery_pipeline_id";
3597 /// let x = RollbackTargetRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/deliveryPipelines/{delivery_pipeline_id}"));
3598 /// ```
3599 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3600 self.name = v.into();
3601 self
3602 }
3603
3604 /// Sets the value of [target_id][crate::model::RollbackTargetRequest::target_id].
3605 ///
3606 /// # Example
3607 /// ```ignore,no_run
3608 /// # use google_cloud_deploy_v1::model::RollbackTargetRequest;
3609 /// let x = RollbackTargetRequest::new().set_target_id("example");
3610 /// ```
3611 pub fn set_target_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3612 self.target_id = v.into();
3613 self
3614 }
3615
3616 /// Sets the value of [rollout_id][crate::model::RollbackTargetRequest::rollout_id].
3617 ///
3618 /// # Example
3619 /// ```ignore,no_run
3620 /// # use google_cloud_deploy_v1::model::RollbackTargetRequest;
3621 /// let x = RollbackTargetRequest::new().set_rollout_id("example");
3622 /// ```
3623 pub fn set_rollout_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3624 self.rollout_id = v.into();
3625 self
3626 }
3627
3628 /// Sets the value of [release_id][crate::model::RollbackTargetRequest::release_id].
3629 ///
3630 /// # Example
3631 /// ```ignore,no_run
3632 /// # use google_cloud_deploy_v1::model::RollbackTargetRequest;
3633 /// let x = RollbackTargetRequest::new().set_release_id("example");
3634 /// ```
3635 pub fn set_release_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3636 self.release_id = v.into();
3637 self
3638 }
3639
3640 /// Sets the value of [rollout_to_roll_back][crate::model::RollbackTargetRequest::rollout_to_roll_back].
3641 ///
3642 /// # Example
3643 /// ```ignore,no_run
3644 /// # use google_cloud_deploy_v1::model::RollbackTargetRequest;
3645 /// let x = RollbackTargetRequest::new().set_rollout_to_roll_back("example");
3646 /// ```
3647 pub fn set_rollout_to_roll_back<T: std::convert::Into<std::string::String>>(
3648 mut self,
3649 v: T,
3650 ) -> Self {
3651 self.rollout_to_roll_back = v.into();
3652 self
3653 }
3654
3655 /// Sets the value of [rollback_config][crate::model::RollbackTargetRequest::rollback_config].
3656 ///
3657 /// # Example
3658 /// ```ignore,no_run
3659 /// # use google_cloud_deploy_v1::model::RollbackTargetRequest;
3660 /// use google_cloud_deploy_v1::model::RollbackTargetConfig;
3661 /// let x = RollbackTargetRequest::new().set_rollback_config(RollbackTargetConfig::default()/* use setters */);
3662 /// ```
3663 pub fn set_rollback_config<T>(mut self, v: T) -> Self
3664 where
3665 T: std::convert::Into<crate::model::RollbackTargetConfig>,
3666 {
3667 self.rollback_config = std::option::Option::Some(v.into());
3668 self
3669 }
3670
3671 /// Sets or clears the value of [rollback_config][crate::model::RollbackTargetRequest::rollback_config].
3672 ///
3673 /// # Example
3674 /// ```ignore,no_run
3675 /// # use google_cloud_deploy_v1::model::RollbackTargetRequest;
3676 /// use google_cloud_deploy_v1::model::RollbackTargetConfig;
3677 /// let x = RollbackTargetRequest::new().set_or_clear_rollback_config(Some(RollbackTargetConfig::default()/* use setters */));
3678 /// let x = RollbackTargetRequest::new().set_or_clear_rollback_config(None::<RollbackTargetConfig>);
3679 /// ```
3680 pub fn set_or_clear_rollback_config<T>(mut self, v: std::option::Option<T>) -> Self
3681 where
3682 T: std::convert::Into<crate::model::RollbackTargetConfig>,
3683 {
3684 self.rollback_config = v.map(|x| x.into());
3685 self
3686 }
3687
3688 /// Sets the value of [validate_only][crate::model::RollbackTargetRequest::validate_only].
3689 ///
3690 /// # Example
3691 /// ```ignore,no_run
3692 /// # use google_cloud_deploy_v1::model::RollbackTargetRequest;
3693 /// let x = RollbackTargetRequest::new().set_validate_only(true);
3694 /// ```
3695 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3696 self.validate_only = v.into();
3697 self
3698 }
3699
3700 /// Sets the value of [override_deploy_policy][crate::model::RollbackTargetRequest::override_deploy_policy].
3701 ///
3702 /// # Example
3703 /// ```ignore,no_run
3704 /// # use google_cloud_deploy_v1::model::RollbackTargetRequest;
3705 /// let x = RollbackTargetRequest::new().set_override_deploy_policy(["a", "b", "c"]);
3706 /// ```
3707 pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
3708 where
3709 T: std::iter::IntoIterator<Item = V>,
3710 V: std::convert::Into<std::string::String>,
3711 {
3712 use std::iter::Iterator;
3713 self.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
3714 self
3715 }
3716}
3717
3718impl wkt::message::Message for RollbackTargetRequest {
3719 fn typename() -> &'static str {
3720 "type.googleapis.com/google.cloud.deploy.v1.RollbackTargetRequest"
3721 }
3722}
3723
3724/// The response object from `RollbackTarget`.
3725#[derive(Clone, Default, PartialEq)]
3726#[non_exhaustive]
3727pub struct RollbackTargetResponse {
3728 /// The config of the rollback `Rollout` created or will be created.
3729 pub rollback_config: std::option::Option<crate::model::RollbackTargetConfig>,
3730
3731 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3732}
3733
3734impl RollbackTargetResponse {
3735 /// Creates a new default instance.
3736 pub fn new() -> Self {
3737 std::default::Default::default()
3738 }
3739
3740 /// Sets the value of [rollback_config][crate::model::RollbackTargetResponse::rollback_config].
3741 ///
3742 /// # Example
3743 /// ```ignore,no_run
3744 /// # use google_cloud_deploy_v1::model::RollbackTargetResponse;
3745 /// use google_cloud_deploy_v1::model::RollbackTargetConfig;
3746 /// let x = RollbackTargetResponse::new().set_rollback_config(RollbackTargetConfig::default()/* use setters */);
3747 /// ```
3748 pub fn set_rollback_config<T>(mut self, v: T) -> Self
3749 where
3750 T: std::convert::Into<crate::model::RollbackTargetConfig>,
3751 {
3752 self.rollback_config = std::option::Option::Some(v.into());
3753 self
3754 }
3755
3756 /// Sets or clears the value of [rollback_config][crate::model::RollbackTargetResponse::rollback_config].
3757 ///
3758 /// # Example
3759 /// ```ignore,no_run
3760 /// # use google_cloud_deploy_v1::model::RollbackTargetResponse;
3761 /// use google_cloud_deploy_v1::model::RollbackTargetConfig;
3762 /// let x = RollbackTargetResponse::new().set_or_clear_rollback_config(Some(RollbackTargetConfig::default()/* use setters */));
3763 /// let x = RollbackTargetResponse::new().set_or_clear_rollback_config(None::<RollbackTargetConfig>);
3764 /// ```
3765 pub fn set_or_clear_rollback_config<T>(mut self, v: std::option::Option<T>) -> Self
3766 where
3767 T: std::convert::Into<crate::model::RollbackTargetConfig>,
3768 {
3769 self.rollback_config = v.map(|x| x.into());
3770 self
3771 }
3772}
3773
3774impl wkt::message::Message for RollbackTargetResponse {
3775 fn typename() -> &'static str {
3776 "type.googleapis.com/google.cloud.deploy.v1.RollbackTargetResponse"
3777 }
3778}
3779
3780/// A `Target` resource in the Cloud Deploy API.
3781///
3782/// A `Target` defines a location to which a Skaffold configuration
3783/// can be deployed.
3784#[derive(Clone, Default, PartialEq)]
3785#[non_exhaustive]
3786pub struct Target {
3787 /// Identifier. Name of the `Target`. Format is
3788 /// `projects/{project}/locations/{location}/targets/{target}`.
3789 /// The `target` component must match `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`
3790 pub name: std::string::String,
3791
3792 /// Output only. Resource id of the `Target`.
3793 pub target_id: std::string::String,
3794
3795 /// Output only. Unique identifier of the `Target`.
3796 pub uid: std::string::String,
3797
3798 /// Optional. Description of the `Target`. Max length is 255 characters.
3799 pub description: std::string::String,
3800
3801 /// Optional. User annotations. These attributes can only be set and used by
3802 /// the user, and not by Cloud Deploy. See
3803 /// <https://google.aip.dev/128#annotations> for more details such as format and
3804 /// size limitations.
3805 pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
3806
3807 /// Optional. Labels are attributes that can be set and used by both the
3808 /// user and by Cloud Deploy. Labels must meet the following constraints:
3809 ///
3810 /// * Keys and values can contain only lowercase letters, numeric characters,
3811 /// underscores, and dashes.
3812 /// * All characters must use UTF-8 encoding, and international characters are
3813 /// allowed.
3814 /// * Keys must start with a lowercase letter or international character.
3815 /// * Each resource is limited to a maximum of 64 labels.
3816 ///
3817 /// Both keys and values are additionally constrained to be <= 128 bytes.
3818 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
3819
3820 /// Optional. Whether or not the `Target` requires approval.
3821 pub require_approval: bool,
3822
3823 /// Output only. Time at which the `Target` was created.
3824 pub create_time: std::option::Option<wkt::Timestamp>,
3825
3826 /// Output only. Most recent time at which the `Target` was updated.
3827 pub update_time: std::option::Option<wkt::Timestamp>,
3828
3829 /// Optional. Map of entity IDs to their associated entities. Associated
3830 /// entities allows specifying places other than the deployment target for
3831 /// specific features. For example, the Gateway API canary can be configured to
3832 /// deploy the HTTPRoute to a different cluster(s) than the deployment cluster
3833 /// using associated entities. An entity ID must consist of lower-case letters,
3834 /// numbers, and hyphens, start with a letter and end with a letter or a
3835 /// number, and have a max length of 63 characters. In other words, it must
3836 /// match the following regex: `^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$`.
3837 pub associated_entities:
3838 std::collections::HashMap<std::string::String, crate::model::AssociatedEntities>,
3839
3840 /// Optional. This checksum is computed by the server based on the value of
3841 /// other fields, and may be sent on update and delete requests to ensure the
3842 /// client has an up-to-date value before proceeding.
3843 pub etag: std::string::String,
3844
3845 /// Optional. Configurations for all execution that relates to this `Target`.
3846 /// Each `ExecutionEnvironmentUsage` value may only be used in a single
3847 /// configuration; using the same value multiple times is an error.
3848 /// When one or more configurations are specified, they must include the
3849 /// `RENDER` and `DEPLOY` `ExecutionEnvironmentUsage` values.
3850 /// When no configurations are specified, execution will use the default
3851 /// specified in `DefaultPool`.
3852 pub execution_configs: std::vec::Vec<crate::model::ExecutionConfig>,
3853
3854 /// Optional. The deploy parameters to use for this target.
3855 pub deploy_parameters: std::collections::HashMap<std::string::String, std::string::String>,
3856
3857 /// Destination to which the Skaffold configuration is applied during a
3858 /// rollout.
3859 pub deployment_target: std::option::Option<crate::model::target::DeploymentTarget>,
3860
3861 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3862}
3863
3864impl Target {
3865 /// Creates a new default instance.
3866 pub fn new() -> Self {
3867 std::default::Default::default()
3868 }
3869
3870 /// Sets the value of [name][crate::model::Target::name].
3871 ///
3872 /// # Example
3873 /// ```ignore,no_run
3874 /// # use google_cloud_deploy_v1::model::Target;
3875 /// # let project_id = "project_id";
3876 /// # let location_id = "location_id";
3877 /// # let target_id = "target_id";
3878 /// let x = Target::new().set_name(format!("projects/{project_id}/locations/{location_id}/targets/{target_id}"));
3879 /// ```
3880 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3881 self.name = v.into();
3882 self
3883 }
3884
3885 /// Sets the value of [target_id][crate::model::Target::target_id].
3886 ///
3887 /// # Example
3888 /// ```ignore,no_run
3889 /// # use google_cloud_deploy_v1::model::Target;
3890 /// let x = Target::new().set_target_id("example");
3891 /// ```
3892 pub fn set_target_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3893 self.target_id = v.into();
3894 self
3895 }
3896
3897 /// Sets the value of [uid][crate::model::Target::uid].
3898 ///
3899 /// # Example
3900 /// ```ignore,no_run
3901 /// # use google_cloud_deploy_v1::model::Target;
3902 /// let x = Target::new().set_uid("example");
3903 /// ```
3904 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3905 self.uid = v.into();
3906 self
3907 }
3908
3909 /// Sets the value of [description][crate::model::Target::description].
3910 ///
3911 /// # Example
3912 /// ```ignore,no_run
3913 /// # use google_cloud_deploy_v1::model::Target;
3914 /// let x = Target::new().set_description("example");
3915 /// ```
3916 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3917 self.description = v.into();
3918 self
3919 }
3920
3921 /// Sets the value of [annotations][crate::model::Target::annotations].
3922 ///
3923 /// # Example
3924 /// ```ignore,no_run
3925 /// # use google_cloud_deploy_v1::model::Target;
3926 /// let x = Target::new().set_annotations([
3927 /// ("key0", "abc"),
3928 /// ("key1", "xyz"),
3929 /// ]);
3930 /// ```
3931 pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
3932 where
3933 T: std::iter::IntoIterator<Item = (K, V)>,
3934 K: std::convert::Into<std::string::String>,
3935 V: std::convert::Into<std::string::String>,
3936 {
3937 use std::iter::Iterator;
3938 self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
3939 self
3940 }
3941
3942 /// Sets the value of [labels][crate::model::Target::labels].
3943 ///
3944 /// # Example
3945 /// ```ignore,no_run
3946 /// # use google_cloud_deploy_v1::model::Target;
3947 /// let x = Target::new().set_labels([
3948 /// ("key0", "abc"),
3949 /// ("key1", "xyz"),
3950 /// ]);
3951 /// ```
3952 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
3953 where
3954 T: std::iter::IntoIterator<Item = (K, V)>,
3955 K: std::convert::Into<std::string::String>,
3956 V: std::convert::Into<std::string::String>,
3957 {
3958 use std::iter::Iterator;
3959 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
3960 self
3961 }
3962
3963 /// Sets the value of [require_approval][crate::model::Target::require_approval].
3964 ///
3965 /// # Example
3966 /// ```ignore,no_run
3967 /// # use google_cloud_deploy_v1::model::Target;
3968 /// let x = Target::new().set_require_approval(true);
3969 /// ```
3970 pub fn set_require_approval<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3971 self.require_approval = v.into();
3972 self
3973 }
3974
3975 /// Sets the value of [create_time][crate::model::Target::create_time].
3976 ///
3977 /// # Example
3978 /// ```ignore,no_run
3979 /// # use google_cloud_deploy_v1::model::Target;
3980 /// use wkt::Timestamp;
3981 /// let x = Target::new().set_create_time(Timestamp::default()/* use setters */);
3982 /// ```
3983 pub fn set_create_time<T>(mut self, v: T) -> Self
3984 where
3985 T: std::convert::Into<wkt::Timestamp>,
3986 {
3987 self.create_time = std::option::Option::Some(v.into());
3988 self
3989 }
3990
3991 /// Sets or clears the value of [create_time][crate::model::Target::create_time].
3992 ///
3993 /// # Example
3994 /// ```ignore,no_run
3995 /// # use google_cloud_deploy_v1::model::Target;
3996 /// use wkt::Timestamp;
3997 /// let x = Target::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
3998 /// let x = Target::new().set_or_clear_create_time(None::<Timestamp>);
3999 /// ```
4000 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
4001 where
4002 T: std::convert::Into<wkt::Timestamp>,
4003 {
4004 self.create_time = v.map(|x| x.into());
4005 self
4006 }
4007
4008 /// Sets the value of [update_time][crate::model::Target::update_time].
4009 ///
4010 /// # Example
4011 /// ```ignore,no_run
4012 /// # use google_cloud_deploy_v1::model::Target;
4013 /// use wkt::Timestamp;
4014 /// let x = Target::new().set_update_time(Timestamp::default()/* use setters */);
4015 /// ```
4016 pub fn set_update_time<T>(mut self, v: T) -> Self
4017 where
4018 T: std::convert::Into<wkt::Timestamp>,
4019 {
4020 self.update_time = std::option::Option::Some(v.into());
4021 self
4022 }
4023
4024 /// Sets or clears the value of [update_time][crate::model::Target::update_time].
4025 ///
4026 /// # Example
4027 /// ```ignore,no_run
4028 /// # use google_cloud_deploy_v1::model::Target;
4029 /// use wkt::Timestamp;
4030 /// let x = Target::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
4031 /// let x = Target::new().set_or_clear_update_time(None::<Timestamp>);
4032 /// ```
4033 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
4034 where
4035 T: std::convert::Into<wkt::Timestamp>,
4036 {
4037 self.update_time = v.map(|x| x.into());
4038 self
4039 }
4040
4041 /// Sets the value of [associated_entities][crate::model::Target::associated_entities].
4042 ///
4043 /// # Example
4044 /// ```ignore,no_run
4045 /// # use google_cloud_deploy_v1::model::Target;
4046 /// use google_cloud_deploy_v1::model::AssociatedEntities;
4047 /// let x = Target::new().set_associated_entities([
4048 /// ("key0", AssociatedEntities::default()/* use setters */),
4049 /// ("key1", AssociatedEntities::default()/* use (different) setters */),
4050 /// ]);
4051 /// ```
4052 pub fn set_associated_entities<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<crate::model::AssociatedEntities>,
4057 {
4058 use std::iter::Iterator;
4059 self.associated_entities = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
4060 self
4061 }
4062
4063 /// Sets the value of [etag][crate::model::Target::etag].
4064 ///
4065 /// # Example
4066 /// ```ignore,no_run
4067 /// # use google_cloud_deploy_v1::model::Target;
4068 /// let x = Target::new().set_etag("example");
4069 /// ```
4070 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4071 self.etag = v.into();
4072 self
4073 }
4074
4075 /// Sets the value of [execution_configs][crate::model::Target::execution_configs].
4076 ///
4077 /// # Example
4078 /// ```ignore,no_run
4079 /// # use google_cloud_deploy_v1::model::Target;
4080 /// use google_cloud_deploy_v1::model::ExecutionConfig;
4081 /// let x = Target::new()
4082 /// .set_execution_configs([
4083 /// ExecutionConfig::default()/* use setters */,
4084 /// ExecutionConfig::default()/* use (different) setters */,
4085 /// ]);
4086 /// ```
4087 pub fn set_execution_configs<T, V>(mut self, v: T) -> Self
4088 where
4089 T: std::iter::IntoIterator<Item = V>,
4090 V: std::convert::Into<crate::model::ExecutionConfig>,
4091 {
4092 use std::iter::Iterator;
4093 self.execution_configs = v.into_iter().map(|i| i.into()).collect();
4094 self
4095 }
4096
4097 /// Sets the value of [deploy_parameters][crate::model::Target::deploy_parameters].
4098 ///
4099 /// # Example
4100 /// ```ignore,no_run
4101 /// # use google_cloud_deploy_v1::model::Target;
4102 /// let x = Target::new().set_deploy_parameters([
4103 /// ("key0", "abc"),
4104 /// ("key1", "xyz"),
4105 /// ]);
4106 /// ```
4107 pub fn set_deploy_parameters<T, K, V>(mut self, v: T) -> Self
4108 where
4109 T: std::iter::IntoIterator<Item = (K, V)>,
4110 K: std::convert::Into<std::string::String>,
4111 V: std::convert::Into<std::string::String>,
4112 {
4113 use std::iter::Iterator;
4114 self.deploy_parameters = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
4115 self
4116 }
4117
4118 /// Sets the value of [deployment_target][crate::model::Target::deployment_target].
4119 ///
4120 /// Note that all the setters affecting `deployment_target` are mutually
4121 /// exclusive.
4122 ///
4123 /// # Example
4124 /// ```ignore,no_run
4125 /// # use google_cloud_deploy_v1::model::Target;
4126 /// use google_cloud_deploy_v1::model::GkeCluster;
4127 /// let x = Target::new().set_deployment_target(Some(
4128 /// google_cloud_deploy_v1::model::target::DeploymentTarget::Gke(GkeCluster::default().into())));
4129 /// ```
4130 pub fn set_deployment_target<
4131 T: std::convert::Into<std::option::Option<crate::model::target::DeploymentTarget>>,
4132 >(
4133 mut self,
4134 v: T,
4135 ) -> Self {
4136 self.deployment_target = v.into();
4137 self
4138 }
4139
4140 /// The value of [deployment_target][crate::model::Target::deployment_target]
4141 /// if it holds a `Gke`, `None` if the field is not set or
4142 /// holds a different branch.
4143 pub fn gke(&self) -> std::option::Option<&std::boxed::Box<crate::model::GkeCluster>> {
4144 #[allow(unreachable_patterns)]
4145 self.deployment_target.as_ref().and_then(|v| match v {
4146 crate::model::target::DeploymentTarget::Gke(v) => std::option::Option::Some(v),
4147 _ => std::option::Option::None,
4148 })
4149 }
4150
4151 /// Sets the value of [deployment_target][crate::model::Target::deployment_target]
4152 /// to hold a `Gke`.
4153 ///
4154 /// Note that all the setters affecting `deployment_target` are
4155 /// mutually exclusive.
4156 ///
4157 /// # Example
4158 /// ```ignore,no_run
4159 /// # use google_cloud_deploy_v1::model::Target;
4160 /// use google_cloud_deploy_v1::model::GkeCluster;
4161 /// let x = Target::new().set_gke(GkeCluster::default()/* use setters */);
4162 /// assert!(x.gke().is_some());
4163 /// assert!(x.anthos_cluster().is_none());
4164 /// assert!(x.run().is_none());
4165 /// assert!(x.multi_target().is_none());
4166 /// assert!(x.custom_target().is_none());
4167 /// ```
4168 pub fn set_gke<T: std::convert::Into<std::boxed::Box<crate::model::GkeCluster>>>(
4169 mut self,
4170 v: T,
4171 ) -> Self {
4172 self.deployment_target =
4173 std::option::Option::Some(crate::model::target::DeploymentTarget::Gke(v.into()));
4174 self
4175 }
4176
4177 /// The value of [deployment_target][crate::model::Target::deployment_target]
4178 /// if it holds a `AnthosCluster`, `None` if the field is not set or
4179 /// holds a different branch.
4180 pub fn anthos_cluster(
4181 &self,
4182 ) -> std::option::Option<&std::boxed::Box<crate::model::AnthosCluster>> {
4183 #[allow(unreachable_patterns)]
4184 self.deployment_target.as_ref().and_then(|v| match v {
4185 crate::model::target::DeploymentTarget::AnthosCluster(v) => {
4186 std::option::Option::Some(v)
4187 }
4188 _ => std::option::Option::None,
4189 })
4190 }
4191
4192 /// Sets the value of [deployment_target][crate::model::Target::deployment_target]
4193 /// to hold a `AnthosCluster`.
4194 ///
4195 /// Note that all the setters affecting `deployment_target` are
4196 /// mutually exclusive.
4197 ///
4198 /// # Example
4199 /// ```ignore,no_run
4200 /// # use google_cloud_deploy_v1::model::Target;
4201 /// use google_cloud_deploy_v1::model::AnthosCluster;
4202 /// let x = Target::new().set_anthos_cluster(AnthosCluster::default()/* use setters */);
4203 /// assert!(x.anthos_cluster().is_some());
4204 /// assert!(x.gke().is_none());
4205 /// assert!(x.run().is_none());
4206 /// assert!(x.multi_target().is_none());
4207 /// assert!(x.custom_target().is_none());
4208 /// ```
4209 pub fn set_anthos_cluster<
4210 T: std::convert::Into<std::boxed::Box<crate::model::AnthosCluster>>,
4211 >(
4212 mut self,
4213 v: T,
4214 ) -> Self {
4215 self.deployment_target = std::option::Option::Some(
4216 crate::model::target::DeploymentTarget::AnthosCluster(v.into()),
4217 );
4218 self
4219 }
4220
4221 /// The value of [deployment_target][crate::model::Target::deployment_target]
4222 /// if it holds a `Run`, `None` if the field is not set or
4223 /// holds a different branch.
4224 pub fn run(&self) -> std::option::Option<&std::boxed::Box<crate::model::CloudRunLocation>> {
4225 #[allow(unreachable_patterns)]
4226 self.deployment_target.as_ref().and_then(|v| match v {
4227 crate::model::target::DeploymentTarget::Run(v) => std::option::Option::Some(v),
4228 _ => std::option::Option::None,
4229 })
4230 }
4231
4232 /// Sets the value of [deployment_target][crate::model::Target::deployment_target]
4233 /// to hold a `Run`.
4234 ///
4235 /// Note that all the setters affecting `deployment_target` are
4236 /// mutually exclusive.
4237 ///
4238 /// # Example
4239 /// ```ignore,no_run
4240 /// # use google_cloud_deploy_v1::model::Target;
4241 /// use google_cloud_deploy_v1::model::CloudRunLocation;
4242 /// let x = Target::new().set_run(CloudRunLocation::default()/* use setters */);
4243 /// assert!(x.run().is_some());
4244 /// assert!(x.gke().is_none());
4245 /// assert!(x.anthos_cluster().is_none());
4246 /// assert!(x.multi_target().is_none());
4247 /// assert!(x.custom_target().is_none());
4248 /// ```
4249 pub fn set_run<T: std::convert::Into<std::boxed::Box<crate::model::CloudRunLocation>>>(
4250 mut self,
4251 v: T,
4252 ) -> Self {
4253 self.deployment_target =
4254 std::option::Option::Some(crate::model::target::DeploymentTarget::Run(v.into()));
4255 self
4256 }
4257
4258 /// The value of [deployment_target][crate::model::Target::deployment_target]
4259 /// if it holds a `MultiTarget`, `None` if the field is not set or
4260 /// holds a different branch.
4261 pub fn multi_target(&self) -> std::option::Option<&std::boxed::Box<crate::model::MultiTarget>> {
4262 #[allow(unreachable_patterns)]
4263 self.deployment_target.as_ref().and_then(|v| match v {
4264 crate::model::target::DeploymentTarget::MultiTarget(v) => std::option::Option::Some(v),
4265 _ => std::option::Option::None,
4266 })
4267 }
4268
4269 /// Sets the value of [deployment_target][crate::model::Target::deployment_target]
4270 /// to hold a `MultiTarget`.
4271 ///
4272 /// Note that all the setters affecting `deployment_target` are
4273 /// mutually exclusive.
4274 ///
4275 /// # Example
4276 /// ```ignore,no_run
4277 /// # use google_cloud_deploy_v1::model::Target;
4278 /// use google_cloud_deploy_v1::model::MultiTarget;
4279 /// let x = Target::new().set_multi_target(MultiTarget::default()/* use setters */);
4280 /// assert!(x.multi_target().is_some());
4281 /// assert!(x.gke().is_none());
4282 /// assert!(x.anthos_cluster().is_none());
4283 /// assert!(x.run().is_none());
4284 /// assert!(x.custom_target().is_none());
4285 /// ```
4286 pub fn set_multi_target<T: std::convert::Into<std::boxed::Box<crate::model::MultiTarget>>>(
4287 mut self,
4288 v: T,
4289 ) -> Self {
4290 self.deployment_target = std::option::Option::Some(
4291 crate::model::target::DeploymentTarget::MultiTarget(v.into()),
4292 );
4293 self
4294 }
4295
4296 /// The value of [deployment_target][crate::model::Target::deployment_target]
4297 /// if it holds a `CustomTarget`, `None` if the field is not set or
4298 /// holds a different branch.
4299 pub fn custom_target(
4300 &self,
4301 ) -> std::option::Option<&std::boxed::Box<crate::model::CustomTarget>> {
4302 #[allow(unreachable_patterns)]
4303 self.deployment_target.as_ref().and_then(|v| match v {
4304 crate::model::target::DeploymentTarget::CustomTarget(v) => std::option::Option::Some(v),
4305 _ => std::option::Option::None,
4306 })
4307 }
4308
4309 /// Sets the value of [deployment_target][crate::model::Target::deployment_target]
4310 /// to hold a `CustomTarget`.
4311 ///
4312 /// Note that all the setters affecting `deployment_target` are
4313 /// mutually exclusive.
4314 ///
4315 /// # Example
4316 /// ```ignore,no_run
4317 /// # use google_cloud_deploy_v1::model::Target;
4318 /// use google_cloud_deploy_v1::model::CustomTarget;
4319 /// let x = Target::new().set_custom_target(CustomTarget::default()/* use setters */);
4320 /// assert!(x.custom_target().is_some());
4321 /// assert!(x.gke().is_none());
4322 /// assert!(x.anthos_cluster().is_none());
4323 /// assert!(x.run().is_none());
4324 /// assert!(x.multi_target().is_none());
4325 /// ```
4326 pub fn set_custom_target<T: std::convert::Into<std::boxed::Box<crate::model::CustomTarget>>>(
4327 mut self,
4328 v: T,
4329 ) -> Self {
4330 self.deployment_target = std::option::Option::Some(
4331 crate::model::target::DeploymentTarget::CustomTarget(v.into()),
4332 );
4333 self
4334 }
4335}
4336
4337impl wkt::message::Message for Target {
4338 fn typename() -> &'static str {
4339 "type.googleapis.com/google.cloud.deploy.v1.Target"
4340 }
4341}
4342
4343/// Defines additional types related to [Target].
4344pub mod target {
4345 #[allow(unused_imports)]
4346 use super::*;
4347
4348 /// Destination to which the Skaffold configuration is applied during a
4349 /// rollout.
4350 #[derive(Clone, Debug, PartialEq)]
4351 #[non_exhaustive]
4352 pub enum DeploymentTarget {
4353 /// Optional. Information specifying a GKE Cluster.
4354 Gke(std::boxed::Box<crate::model::GkeCluster>),
4355 /// Optional. Information specifying an Anthos Cluster.
4356 AnthosCluster(std::boxed::Box<crate::model::AnthosCluster>),
4357 /// Optional. Information specifying a Cloud Run deployment target.
4358 Run(std::boxed::Box<crate::model::CloudRunLocation>),
4359 /// Optional. Information specifying a multiTarget.
4360 MultiTarget(std::boxed::Box<crate::model::MultiTarget>),
4361 /// Optional. Information specifying a Custom Target.
4362 CustomTarget(std::boxed::Box<crate::model::CustomTarget>),
4363 }
4364}
4365
4366/// Configuration of the environment to use when calling Skaffold.
4367#[derive(Clone, Default, PartialEq)]
4368#[non_exhaustive]
4369pub struct ExecutionConfig {
4370 /// Required. Usages when this configuration should be applied.
4371 pub usages: std::vec::Vec<crate::model::execution_config::ExecutionEnvironmentUsage>,
4372
4373 /// Optional. The resource name of the `WorkerPool`, with the format
4374 /// `projects/{project}/locations/{location}/workerPools/{worker_pool}`.
4375 /// If this optional field is unspecified, the default Cloud Build pool will be
4376 /// used.
4377 pub worker_pool: std::string::String,
4378
4379 /// Optional. Google service account to use for execution. If unspecified,
4380 /// the project execution service account
4381 /// (<PROJECT_NUMBER>-compute@developer.gserviceaccount.com) is used.
4382 pub service_account: std::string::String,
4383
4384 /// Optional. Cloud Storage location in which to store execution outputs. This
4385 /// can either be a bucket ("gs://my-bucket") or a path within a bucket
4386 /// ("gs://my-bucket/my-dir").
4387 /// If unspecified, a default bucket located in the same region will be used.
4388 pub artifact_storage: std::string::String,
4389
4390 /// Optional. Execution timeout for a Cloud Build Execution. This must be
4391 /// between 10m and 24h in seconds format. If unspecified, a default timeout of
4392 /// 1h is used.
4393 pub execution_timeout: std::option::Option<wkt::Duration>,
4394
4395 /// Optional. If true, additional logging will be enabled when running builds
4396 /// in this execution environment.
4397 pub verbose: bool,
4398
4399 /// Details of the environment.
4400 pub execution_environment:
4401 std::option::Option<crate::model::execution_config::ExecutionEnvironment>,
4402
4403 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4404}
4405
4406impl ExecutionConfig {
4407 /// Creates a new default instance.
4408 pub fn new() -> Self {
4409 std::default::Default::default()
4410 }
4411
4412 /// Sets the value of [usages][crate::model::ExecutionConfig::usages].
4413 ///
4414 /// # Example
4415 /// ```ignore,no_run
4416 /// # use google_cloud_deploy_v1::model::ExecutionConfig;
4417 /// use google_cloud_deploy_v1::model::execution_config::ExecutionEnvironmentUsage;
4418 /// let x = ExecutionConfig::new().set_usages([
4419 /// ExecutionEnvironmentUsage::Render,
4420 /// ExecutionEnvironmentUsage::Deploy,
4421 /// ExecutionEnvironmentUsage::Verify,
4422 /// ]);
4423 /// ```
4424 pub fn set_usages<T, V>(mut self, v: T) -> Self
4425 where
4426 T: std::iter::IntoIterator<Item = V>,
4427 V: std::convert::Into<crate::model::execution_config::ExecutionEnvironmentUsage>,
4428 {
4429 use std::iter::Iterator;
4430 self.usages = v.into_iter().map(|i| i.into()).collect();
4431 self
4432 }
4433
4434 /// Sets the value of [worker_pool][crate::model::ExecutionConfig::worker_pool].
4435 ///
4436 /// # Example
4437 /// ```ignore,no_run
4438 /// # use google_cloud_deploy_v1::model::ExecutionConfig;
4439 /// let x = ExecutionConfig::new().set_worker_pool("example");
4440 /// ```
4441 pub fn set_worker_pool<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4442 self.worker_pool = v.into();
4443 self
4444 }
4445
4446 /// Sets the value of [service_account][crate::model::ExecutionConfig::service_account].
4447 ///
4448 /// # Example
4449 /// ```ignore,no_run
4450 /// # use google_cloud_deploy_v1::model::ExecutionConfig;
4451 /// let x = ExecutionConfig::new().set_service_account("example");
4452 /// ```
4453 pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4454 self.service_account = v.into();
4455 self
4456 }
4457
4458 /// Sets the value of [artifact_storage][crate::model::ExecutionConfig::artifact_storage].
4459 ///
4460 /// # Example
4461 /// ```ignore,no_run
4462 /// # use google_cloud_deploy_v1::model::ExecutionConfig;
4463 /// let x = ExecutionConfig::new().set_artifact_storage("example");
4464 /// ```
4465 pub fn set_artifact_storage<T: std::convert::Into<std::string::String>>(
4466 mut self,
4467 v: T,
4468 ) -> Self {
4469 self.artifact_storage = v.into();
4470 self
4471 }
4472
4473 /// Sets the value of [execution_timeout][crate::model::ExecutionConfig::execution_timeout].
4474 ///
4475 /// # Example
4476 /// ```ignore,no_run
4477 /// # use google_cloud_deploy_v1::model::ExecutionConfig;
4478 /// use wkt::Duration;
4479 /// let x = ExecutionConfig::new().set_execution_timeout(Duration::default()/* use setters */);
4480 /// ```
4481 pub fn set_execution_timeout<T>(mut self, v: T) -> Self
4482 where
4483 T: std::convert::Into<wkt::Duration>,
4484 {
4485 self.execution_timeout = std::option::Option::Some(v.into());
4486 self
4487 }
4488
4489 /// Sets or clears the value of [execution_timeout][crate::model::ExecutionConfig::execution_timeout].
4490 ///
4491 /// # Example
4492 /// ```ignore,no_run
4493 /// # use google_cloud_deploy_v1::model::ExecutionConfig;
4494 /// use wkt::Duration;
4495 /// let x = ExecutionConfig::new().set_or_clear_execution_timeout(Some(Duration::default()/* use setters */));
4496 /// let x = ExecutionConfig::new().set_or_clear_execution_timeout(None::<Duration>);
4497 /// ```
4498 pub fn set_or_clear_execution_timeout<T>(mut self, v: std::option::Option<T>) -> Self
4499 where
4500 T: std::convert::Into<wkt::Duration>,
4501 {
4502 self.execution_timeout = v.map(|x| x.into());
4503 self
4504 }
4505
4506 /// Sets the value of [verbose][crate::model::ExecutionConfig::verbose].
4507 ///
4508 /// # Example
4509 /// ```ignore,no_run
4510 /// # use google_cloud_deploy_v1::model::ExecutionConfig;
4511 /// let x = ExecutionConfig::new().set_verbose(true);
4512 /// ```
4513 pub fn set_verbose<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4514 self.verbose = v.into();
4515 self
4516 }
4517
4518 /// Sets the value of [execution_environment][crate::model::ExecutionConfig::execution_environment].
4519 ///
4520 /// Note that all the setters affecting `execution_environment` are mutually
4521 /// exclusive.
4522 ///
4523 /// # Example
4524 /// ```ignore,no_run
4525 /// # use google_cloud_deploy_v1::model::ExecutionConfig;
4526 /// use google_cloud_deploy_v1::model::DefaultPool;
4527 /// let x = ExecutionConfig::new().set_execution_environment(Some(
4528 /// google_cloud_deploy_v1::model::execution_config::ExecutionEnvironment::DefaultPool(DefaultPool::default().into())));
4529 /// ```
4530 pub fn set_execution_environment<
4531 T: std::convert::Into<
4532 std::option::Option<crate::model::execution_config::ExecutionEnvironment>,
4533 >,
4534 >(
4535 mut self,
4536 v: T,
4537 ) -> Self {
4538 self.execution_environment = v.into();
4539 self
4540 }
4541
4542 /// The value of [execution_environment][crate::model::ExecutionConfig::execution_environment]
4543 /// if it holds a `DefaultPool`, `None` if the field is not set or
4544 /// holds a different branch.
4545 pub fn default_pool(&self) -> std::option::Option<&std::boxed::Box<crate::model::DefaultPool>> {
4546 #[allow(unreachable_patterns)]
4547 self.execution_environment.as_ref().and_then(|v| match v {
4548 crate::model::execution_config::ExecutionEnvironment::DefaultPool(v) => {
4549 std::option::Option::Some(v)
4550 }
4551 _ => std::option::Option::None,
4552 })
4553 }
4554
4555 /// Sets the value of [execution_environment][crate::model::ExecutionConfig::execution_environment]
4556 /// to hold a `DefaultPool`.
4557 ///
4558 /// Note that all the setters affecting `execution_environment` are
4559 /// mutually exclusive.
4560 ///
4561 /// # Example
4562 /// ```ignore,no_run
4563 /// # use google_cloud_deploy_v1::model::ExecutionConfig;
4564 /// use google_cloud_deploy_v1::model::DefaultPool;
4565 /// let x = ExecutionConfig::new().set_default_pool(DefaultPool::default()/* use setters */);
4566 /// assert!(x.default_pool().is_some());
4567 /// assert!(x.private_pool().is_none());
4568 /// ```
4569 pub fn set_default_pool<T: std::convert::Into<std::boxed::Box<crate::model::DefaultPool>>>(
4570 mut self,
4571 v: T,
4572 ) -> Self {
4573 self.execution_environment = std::option::Option::Some(
4574 crate::model::execution_config::ExecutionEnvironment::DefaultPool(v.into()),
4575 );
4576 self
4577 }
4578
4579 /// The value of [execution_environment][crate::model::ExecutionConfig::execution_environment]
4580 /// if it holds a `PrivatePool`, `None` if the field is not set or
4581 /// holds a different branch.
4582 pub fn private_pool(&self) -> std::option::Option<&std::boxed::Box<crate::model::PrivatePool>> {
4583 #[allow(unreachable_patterns)]
4584 self.execution_environment.as_ref().and_then(|v| match v {
4585 crate::model::execution_config::ExecutionEnvironment::PrivatePool(v) => {
4586 std::option::Option::Some(v)
4587 }
4588 _ => std::option::Option::None,
4589 })
4590 }
4591
4592 /// Sets the value of [execution_environment][crate::model::ExecutionConfig::execution_environment]
4593 /// to hold a `PrivatePool`.
4594 ///
4595 /// Note that all the setters affecting `execution_environment` are
4596 /// mutually exclusive.
4597 ///
4598 /// # Example
4599 /// ```ignore,no_run
4600 /// # use google_cloud_deploy_v1::model::ExecutionConfig;
4601 /// use google_cloud_deploy_v1::model::PrivatePool;
4602 /// let x = ExecutionConfig::new().set_private_pool(PrivatePool::default()/* use setters */);
4603 /// assert!(x.private_pool().is_some());
4604 /// assert!(x.default_pool().is_none());
4605 /// ```
4606 pub fn set_private_pool<T: std::convert::Into<std::boxed::Box<crate::model::PrivatePool>>>(
4607 mut self,
4608 v: T,
4609 ) -> Self {
4610 self.execution_environment = std::option::Option::Some(
4611 crate::model::execution_config::ExecutionEnvironment::PrivatePool(v.into()),
4612 );
4613 self
4614 }
4615}
4616
4617impl wkt::message::Message for ExecutionConfig {
4618 fn typename() -> &'static str {
4619 "type.googleapis.com/google.cloud.deploy.v1.ExecutionConfig"
4620 }
4621}
4622
4623/// Defines additional types related to [ExecutionConfig].
4624pub mod execution_config {
4625 #[allow(unused_imports)]
4626 use super::*;
4627
4628 /// Possible usages of this configuration.
4629 ///
4630 /// # Working with unknown values
4631 ///
4632 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4633 /// additional enum variants at any time. Adding new variants is not considered
4634 /// a breaking change. Applications should write their code in anticipation of:
4635 ///
4636 /// - New values appearing in future releases of the client library, **and**
4637 /// - New values received dynamically, without application changes.
4638 ///
4639 /// Please consult the [Working with enums] section in the user guide for some
4640 /// guidelines.
4641 ///
4642 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
4643 #[derive(Clone, Debug, PartialEq)]
4644 #[non_exhaustive]
4645 pub enum ExecutionEnvironmentUsage {
4646 /// Default value. This value is unused.
4647 Unspecified,
4648 /// Use for rendering.
4649 Render,
4650 /// Use for deploying and deployment hooks.
4651 Deploy,
4652 /// Use for deployment verification.
4653 Verify,
4654 /// Use for predeploy job execution.
4655 Predeploy,
4656 /// Use for postdeploy job execution.
4657 Postdeploy,
4658 /// If set, the enum was initialized with an unknown value.
4659 ///
4660 /// Applications can examine the value using [ExecutionEnvironmentUsage::value] or
4661 /// [ExecutionEnvironmentUsage::name].
4662 UnknownValue(execution_environment_usage::UnknownValue),
4663 }
4664
4665 #[doc(hidden)]
4666 pub mod execution_environment_usage {
4667 #[allow(unused_imports)]
4668 use super::*;
4669 #[derive(Clone, Debug, PartialEq)]
4670 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4671 }
4672
4673 impl ExecutionEnvironmentUsage {
4674 /// Gets the enum value.
4675 ///
4676 /// Returns `None` if the enum contains an unknown value deserialized from
4677 /// the string representation of enums.
4678 pub fn value(&self) -> std::option::Option<i32> {
4679 match self {
4680 Self::Unspecified => std::option::Option::Some(0),
4681 Self::Render => std::option::Option::Some(1),
4682 Self::Deploy => std::option::Option::Some(2),
4683 Self::Verify => std::option::Option::Some(3),
4684 Self::Predeploy => std::option::Option::Some(4),
4685 Self::Postdeploy => std::option::Option::Some(5),
4686 Self::UnknownValue(u) => u.0.value(),
4687 }
4688 }
4689
4690 /// Gets the enum value as a string.
4691 ///
4692 /// Returns `None` if the enum contains an unknown value deserialized from
4693 /// the integer representation of enums.
4694 pub fn name(&self) -> std::option::Option<&str> {
4695 match self {
4696 Self::Unspecified => {
4697 std::option::Option::Some("EXECUTION_ENVIRONMENT_USAGE_UNSPECIFIED")
4698 }
4699 Self::Render => std::option::Option::Some("RENDER"),
4700 Self::Deploy => std::option::Option::Some("DEPLOY"),
4701 Self::Verify => std::option::Option::Some("VERIFY"),
4702 Self::Predeploy => std::option::Option::Some("PREDEPLOY"),
4703 Self::Postdeploy => std::option::Option::Some("POSTDEPLOY"),
4704 Self::UnknownValue(u) => u.0.name(),
4705 }
4706 }
4707 }
4708
4709 impl std::default::Default for ExecutionEnvironmentUsage {
4710 fn default() -> Self {
4711 use std::convert::From;
4712 Self::from(0)
4713 }
4714 }
4715
4716 impl std::fmt::Display for ExecutionEnvironmentUsage {
4717 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4718 wkt::internal::display_enum(f, self.name(), self.value())
4719 }
4720 }
4721
4722 impl std::convert::From<i32> for ExecutionEnvironmentUsage {
4723 fn from(value: i32) -> Self {
4724 match value {
4725 0 => Self::Unspecified,
4726 1 => Self::Render,
4727 2 => Self::Deploy,
4728 3 => Self::Verify,
4729 4 => Self::Predeploy,
4730 5 => Self::Postdeploy,
4731 _ => Self::UnknownValue(execution_environment_usage::UnknownValue(
4732 wkt::internal::UnknownEnumValue::Integer(value),
4733 )),
4734 }
4735 }
4736 }
4737
4738 impl std::convert::From<&str> for ExecutionEnvironmentUsage {
4739 fn from(value: &str) -> Self {
4740 use std::string::ToString;
4741 match value {
4742 "EXECUTION_ENVIRONMENT_USAGE_UNSPECIFIED" => Self::Unspecified,
4743 "RENDER" => Self::Render,
4744 "DEPLOY" => Self::Deploy,
4745 "VERIFY" => Self::Verify,
4746 "PREDEPLOY" => Self::Predeploy,
4747 "POSTDEPLOY" => Self::Postdeploy,
4748 _ => Self::UnknownValue(execution_environment_usage::UnknownValue(
4749 wkt::internal::UnknownEnumValue::String(value.to_string()),
4750 )),
4751 }
4752 }
4753 }
4754
4755 impl serde::ser::Serialize for ExecutionEnvironmentUsage {
4756 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4757 where
4758 S: serde::Serializer,
4759 {
4760 match self {
4761 Self::Unspecified => serializer.serialize_i32(0),
4762 Self::Render => serializer.serialize_i32(1),
4763 Self::Deploy => serializer.serialize_i32(2),
4764 Self::Verify => serializer.serialize_i32(3),
4765 Self::Predeploy => serializer.serialize_i32(4),
4766 Self::Postdeploy => serializer.serialize_i32(5),
4767 Self::UnknownValue(u) => u.0.serialize(serializer),
4768 }
4769 }
4770 }
4771
4772 impl<'de> serde::de::Deserialize<'de> for ExecutionEnvironmentUsage {
4773 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4774 where
4775 D: serde::Deserializer<'de>,
4776 {
4777 deserializer.deserialize_any(
4778 wkt::internal::EnumVisitor::<ExecutionEnvironmentUsage>::new(
4779 ".google.cloud.deploy.v1.ExecutionConfig.ExecutionEnvironmentUsage",
4780 ),
4781 )
4782 }
4783 }
4784
4785 /// Details of the environment.
4786 #[derive(Clone, Debug, PartialEq)]
4787 #[non_exhaustive]
4788 pub enum ExecutionEnvironment {
4789 /// Optional. Use default Cloud Build pool.
4790 DefaultPool(std::boxed::Box<crate::model::DefaultPool>),
4791 /// Optional. Use private Cloud Build pool.
4792 PrivatePool(std::boxed::Box<crate::model::PrivatePool>),
4793 }
4794}
4795
4796/// Execution using the default Cloud Build pool.
4797#[derive(Clone, Default, PartialEq)]
4798#[non_exhaustive]
4799pub struct DefaultPool {
4800 /// Optional. Google service account to use for execution. If unspecified,
4801 /// the project execution service account
4802 /// (<PROJECT_NUMBER>-compute@developer.gserviceaccount.com) will be used.
4803 pub service_account: std::string::String,
4804
4805 /// Optional. Cloud Storage location where execution outputs should be stored.
4806 /// This can either be a bucket ("gs://my-bucket") or a path within a bucket
4807 /// ("gs://my-bucket/my-dir").
4808 /// If unspecified, a default bucket located in the same region will be used.
4809 pub artifact_storage: std::string::String,
4810
4811 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4812}
4813
4814impl DefaultPool {
4815 /// Creates a new default instance.
4816 pub fn new() -> Self {
4817 std::default::Default::default()
4818 }
4819
4820 /// Sets the value of [service_account][crate::model::DefaultPool::service_account].
4821 ///
4822 /// # Example
4823 /// ```ignore,no_run
4824 /// # use google_cloud_deploy_v1::model::DefaultPool;
4825 /// let x = DefaultPool::new().set_service_account("example");
4826 /// ```
4827 pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4828 self.service_account = v.into();
4829 self
4830 }
4831
4832 /// Sets the value of [artifact_storage][crate::model::DefaultPool::artifact_storage].
4833 ///
4834 /// # Example
4835 /// ```ignore,no_run
4836 /// # use google_cloud_deploy_v1::model::DefaultPool;
4837 /// let x = DefaultPool::new().set_artifact_storage("example");
4838 /// ```
4839 pub fn set_artifact_storage<T: std::convert::Into<std::string::String>>(
4840 mut self,
4841 v: T,
4842 ) -> Self {
4843 self.artifact_storage = v.into();
4844 self
4845 }
4846}
4847
4848impl wkt::message::Message for DefaultPool {
4849 fn typename() -> &'static str {
4850 "type.googleapis.com/google.cloud.deploy.v1.DefaultPool"
4851 }
4852}
4853
4854/// Execution using a private Cloud Build pool.
4855#[derive(Clone, Default, PartialEq)]
4856#[non_exhaustive]
4857pub struct PrivatePool {
4858 /// Required. Resource name of the Cloud Build worker pool to use. The format
4859 /// is `projects/{project}/locations/{location}/workerPools/{pool}`.
4860 pub worker_pool: std::string::String,
4861
4862 /// Optional. Google service account to use for execution. If unspecified,
4863 /// the project execution service account
4864 /// (<PROJECT_NUMBER>-compute@developer.gserviceaccount.com) will be used.
4865 pub service_account: std::string::String,
4866
4867 /// Optional. Cloud Storage location where execution outputs should be stored.
4868 /// This can either be a bucket ("gs://my-bucket") or a path within a bucket
4869 /// ("gs://my-bucket/my-dir").
4870 /// If unspecified, a default bucket located in the same region will be used.
4871 pub artifact_storage: std::string::String,
4872
4873 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4874}
4875
4876impl PrivatePool {
4877 /// Creates a new default instance.
4878 pub fn new() -> Self {
4879 std::default::Default::default()
4880 }
4881
4882 /// Sets the value of [worker_pool][crate::model::PrivatePool::worker_pool].
4883 ///
4884 /// # Example
4885 /// ```ignore,no_run
4886 /// # use google_cloud_deploy_v1::model::PrivatePool;
4887 /// let x = PrivatePool::new().set_worker_pool("example");
4888 /// ```
4889 pub fn set_worker_pool<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4890 self.worker_pool = v.into();
4891 self
4892 }
4893
4894 /// Sets the value of [service_account][crate::model::PrivatePool::service_account].
4895 ///
4896 /// # Example
4897 /// ```ignore,no_run
4898 /// # use google_cloud_deploy_v1::model::PrivatePool;
4899 /// let x = PrivatePool::new().set_service_account("example");
4900 /// ```
4901 pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4902 self.service_account = v.into();
4903 self
4904 }
4905
4906 /// Sets the value of [artifact_storage][crate::model::PrivatePool::artifact_storage].
4907 ///
4908 /// # Example
4909 /// ```ignore,no_run
4910 /// # use google_cloud_deploy_v1::model::PrivatePool;
4911 /// let x = PrivatePool::new().set_artifact_storage("example");
4912 /// ```
4913 pub fn set_artifact_storage<T: std::convert::Into<std::string::String>>(
4914 mut self,
4915 v: T,
4916 ) -> Self {
4917 self.artifact_storage = v.into();
4918 self
4919 }
4920}
4921
4922impl wkt::message::Message for PrivatePool {
4923 fn typename() -> &'static str {
4924 "type.googleapis.com/google.cloud.deploy.v1.PrivatePool"
4925 }
4926}
4927
4928/// Information specifying a GKE Cluster.
4929#[derive(Clone, Default, PartialEq)]
4930#[non_exhaustive]
4931pub struct GkeCluster {
4932 /// Optional. Information specifying a GKE Cluster. Format is
4933 /// `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}`.
4934 pub cluster: std::string::String,
4935
4936 /// Optional. If true, `cluster` is accessed using the private IP address of
4937 /// the control plane endpoint. Otherwise, the default IP address of the
4938 /// control plane endpoint is used. The default IP address is the private IP
4939 /// address for clusters with private control-plane endpoints and the public IP
4940 /// address otherwise.
4941 ///
4942 /// Only specify this option when `cluster` is a [private GKE
4943 /// cluster](https://cloud.google.com/kubernetes-engine/docs/concepts/private-cluster-concept).
4944 /// Note that `internal_ip` and `dns_endpoint` cannot both be set to true.
4945 pub internal_ip: bool,
4946
4947 /// Optional. If set, used to configure a
4948 /// [proxy](https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/#proxy)
4949 /// to the Kubernetes server.
4950 pub proxy_url: std::string::String,
4951
4952 /// Optional. If set, the cluster will be accessed using the DNS endpoint. Note
4953 /// that both `dns_endpoint` and `internal_ip` cannot be set to true.
4954 pub dns_endpoint: bool,
4955
4956 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4957}
4958
4959impl GkeCluster {
4960 /// Creates a new default instance.
4961 pub fn new() -> Self {
4962 std::default::Default::default()
4963 }
4964
4965 /// Sets the value of [cluster][crate::model::GkeCluster::cluster].
4966 ///
4967 /// # Example
4968 /// ```ignore,no_run
4969 /// # use google_cloud_deploy_v1::model::GkeCluster;
4970 /// let x = GkeCluster::new().set_cluster("example");
4971 /// ```
4972 pub fn set_cluster<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4973 self.cluster = v.into();
4974 self
4975 }
4976
4977 /// Sets the value of [internal_ip][crate::model::GkeCluster::internal_ip].
4978 ///
4979 /// # Example
4980 /// ```ignore,no_run
4981 /// # use google_cloud_deploy_v1::model::GkeCluster;
4982 /// let x = GkeCluster::new().set_internal_ip(true);
4983 /// ```
4984 pub fn set_internal_ip<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4985 self.internal_ip = v.into();
4986 self
4987 }
4988
4989 /// Sets the value of [proxy_url][crate::model::GkeCluster::proxy_url].
4990 ///
4991 /// # Example
4992 /// ```ignore,no_run
4993 /// # use google_cloud_deploy_v1::model::GkeCluster;
4994 /// let x = GkeCluster::new().set_proxy_url("example");
4995 /// ```
4996 pub fn set_proxy_url<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4997 self.proxy_url = v.into();
4998 self
4999 }
5000
5001 /// Sets the value of [dns_endpoint][crate::model::GkeCluster::dns_endpoint].
5002 ///
5003 /// # Example
5004 /// ```ignore,no_run
5005 /// # use google_cloud_deploy_v1::model::GkeCluster;
5006 /// let x = GkeCluster::new().set_dns_endpoint(true);
5007 /// ```
5008 pub fn set_dns_endpoint<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5009 self.dns_endpoint = v.into();
5010 self
5011 }
5012}
5013
5014impl wkt::message::Message for GkeCluster {
5015 fn typename() -> &'static str {
5016 "type.googleapis.com/google.cloud.deploy.v1.GkeCluster"
5017 }
5018}
5019
5020/// Information specifying an Anthos Cluster.
5021#[derive(Clone, Default, PartialEq)]
5022#[non_exhaustive]
5023pub struct AnthosCluster {
5024 /// Optional. Membership of the GKE Hub-registered cluster to which to apply
5025 /// the Skaffold configuration. Format is
5026 /// `projects/{project}/locations/{location}/memberships/{membership_name}`.
5027 pub membership: std::string::String,
5028
5029 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5030}
5031
5032impl AnthosCluster {
5033 /// Creates a new default instance.
5034 pub fn new() -> Self {
5035 std::default::Default::default()
5036 }
5037
5038 /// Sets the value of [membership][crate::model::AnthosCluster::membership].
5039 ///
5040 /// # Example
5041 /// ```ignore,no_run
5042 /// # use google_cloud_deploy_v1::model::AnthosCluster;
5043 /// let x = AnthosCluster::new().set_membership("example");
5044 /// ```
5045 pub fn set_membership<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5046 self.membership = v.into();
5047 self
5048 }
5049}
5050
5051impl wkt::message::Message for AnthosCluster {
5052 fn typename() -> &'static str {
5053 "type.googleapis.com/google.cloud.deploy.v1.AnthosCluster"
5054 }
5055}
5056
5057/// Information specifying where to deploy a Cloud Run Service.
5058#[derive(Clone, Default, PartialEq)]
5059#[non_exhaustive]
5060pub struct CloudRunLocation {
5061 /// Required. The location for the Cloud Run Service. Format must be
5062 /// `projects/{project}/locations/{location}`.
5063 pub location: std::string::String,
5064
5065 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5066}
5067
5068impl CloudRunLocation {
5069 /// Creates a new default instance.
5070 pub fn new() -> Self {
5071 std::default::Default::default()
5072 }
5073
5074 /// Sets the value of [location][crate::model::CloudRunLocation::location].
5075 ///
5076 /// # Example
5077 /// ```ignore,no_run
5078 /// # use google_cloud_deploy_v1::model::CloudRunLocation;
5079 /// let x = CloudRunLocation::new().set_location("example");
5080 /// ```
5081 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5082 self.location = v.into();
5083 self
5084 }
5085}
5086
5087impl wkt::message::Message for CloudRunLocation {
5088 fn typename() -> &'static str {
5089 "type.googleapis.com/google.cloud.deploy.v1.CloudRunLocation"
5090 }
5091}
5092
5093/// Information specifying a multiTarget.
5094#[derive(Clone, Default, PartialEq)]
5095#[non_exhaustive]
5096pub struct MultiTarget {
5097 /// Required. The target_ids of this multiTarget.
5098 pub target_ids: std::vec::Vec<std::string::String>,
5099
5100 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5101}
5102
5103impl MultiTarget {
5104 /// Creates a new default instance.
5105 pub fn new() -> Self {
5106 std::default::Default::default()
5107 }
5108
5109 /// Sets the value of [target_ids][crate::model::MultiTarget::target_ids].
5110 ///
5111 /// # Example
5112 /// ```ignore,no_run
5113 /// # use google_cloud_deploy_v1::model::MultiTarget;
5114 /// let x = MultiTarget::new().set_target_ids(["a", "b", "c"]);
5115 /// ```
5116 pub fn set_target_ids<T, V>(mut self, v: T) -> Self
5117 where
5118 T: std::iter::IntoIterator<Item = V>,
5119 V: std::convert::Into<std::string::String>,
5120 {
5121 use std::iter::Iterator;
5122 self.target_ids = v.into_iter().map(|i| i.into()).collect();
5123 self
5124 }
5125}
5126
5127impl wkt::message::Message for MultiTarget {
5128 fn typename() -> &'static str {
5129 "type.googleapis.com/google.cloud.deploy.v1.MultiTarget"
5130 }
5131}
5132
5133/// Information specifying a Custom Target.
5134#[derive(Clone, Default, PartialEq)]
5135#[non_exhaustive]
5136pub struct CustomTarget {
5137 /// Required. The name of the CustomTargetType. Format must be
5138 /// `projects/{project}/locations/{location}/customTargetTypes/{custom_target_type}`.
5139 pub custom_target_type: std::string::String,
5140
5141 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5142}
5143
5144impl CustomTarget {
5145 /// Creates a new default instance.
5146 pub fn new() -> Self {
5147 std::default::Default::default()
5148 }
5149
5150 /// Sets the value of [custom_target_type][crate::model::CustomTarget::custom_target_type].
5151 ///
5152 /// # Example
5153 /// ```ignore,no_run
5154 /// # use google_cloud_deploy_v1::model::CustomTarget;
5155 /// # let project_id = "project_id";
5156 /// # let location_id = "location_id";
5157 /// # let custom_target_type_id = "custom_target_type_id";
5158 /// let x = CustomTarget::new().set_custom_target_type(format!("projects/{project_id}/locations/{location_id}/customTargetTypes/{custom_target_type_id}"));
5159 /// ```
5160 pub fn set_custom_target_type<T: std::convert::Into<std::string::String>>(
5161 mut self,
5162 v: T,
5163 ) -> Self {
5164 self.custom_target_type = v.into();
5165 self
5166 }
5167}
5168
5169impl wkt::message::Message for CustomTarget {
5170 fn typename() -> &'static str {
5171 "type.googleapis.com/google.cloud.deploy.v1.CustomTarget"
5172 }
5173}
5174
5175/// Information about entities associated with a `Target`.
5176#[derive(Clone, Default, PartialEq)]
5177#[non_exhaustive]
5178pub struct AssociatedEntities {
5179 /// Optional. Information specifying GKE clusters as associated entities.
5180 pub gke_clusters: std::vec::Vec<crate::model::GkeCluster>,
5181
5182 /// Optional. Information specifying Anthos clusters as associated entities.
5183 pub anthos_clusters: std::vec::Vec<crate::model::AnthosCluster>,
5184
5185 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5186}
5187
5188impl AssociatedEntities {
5189 /// Creates a new default instance.
5190 pub fn new() -> Self {
5191 std::default::Default::default()
5192 }
5193
5194 /// Sets the value of [gke_clusters][crate::model::AssociatedEntities::gke_clusters].
5195 ///
5196 /// # Example
5197 /// ```ignore,no_run
5198 /// # use google_cloud_deploy_v1::model::AssociatedEntities;
5199 /// use google_cloud_deploy_v1::model::GkeCluster;
5200 /// let x = AssociatedEntities::new()
5201 /// .set_gke_clusters([
5202 /// GkeCluster::default()/* use setters */,
5203 /// GkeCluster::default()/* use (different) setters */,
5204 /// ]);
5205 /// ```
5206 pub fn set_gke_clusters<T, V>(mut self, v: T) -> Self
5207 where
5208 T: std::iter::IntoIterator<Item = V>,
5209 V: std::convert::Into<crate::model::GkeCluster>,
5210 {
5211 use std::iter::Iterator;
5212 self.gke_clusters = v.into_iter().map(|i| i.into()).collect();
5213 self
5214 }
5215
5216 /// Sets the value of [anthos_clusters][crate::model::AssociatedEntities::anthos_clusters].
5217 ///
5218 /// # Example
5219 /// ```ignore,no_run
5220 /// # use google_cloud_deploy_v1::model::AssociatedEntities;
5221 /// use google_cloud_deploy_v1::model::AnthosCluster;
5222 /// let x = AssociatedEntities::new()
5223 /// .set_anthos_clusters([
5224 /// AnthosCluster::default()/* use setters */,
5225 /// AnthosCluster::default()/* use (different) setters */,
5226 /// ]);
5227 /// ```
5228 pub fn set_anthos_clusters<T, V>(mut self, v: T) -> Self
5229 where
5230 T: std::iter::IntoIterator<Item = V>,
5231 V: std::convert::Into<crate::model::AnthosCluster>,
5232 {
5233 use std::iter::Iterator;
5234 self.anthos_clusters = v.into_iter().map(|i| i.into()).collect();
5235 self
5236 }
5237}
5238
5239impl wkt::message::Message for AssociatedEntities {
5240 fn typename() -> &'static str {
5241 "type.googleapis.com/google.cloud.deploy.v1.AssociatedEntities"
5242 }
5243}
5244
5245/// The request object for `ListTargets`.
5246#[derive(Clone, Default, PartialEq)]
5247#[non_exhaustive]
5248pub struct ListTargetsRequest {
5249 /// Required. The parent, which owns this collection of targets. Format must be
5250 /// `projects/{project_id}/locations/{location_name}`.
5251 pub parent: std::string::String,
5252
5253 /// Optional. The maximum number of `Target` objects to return. The service may
5254 /// return fewer than this value. If unspecified, at most 50 `Target` objects
5255 /// will be returned. The maximum value is 1000; values above 1000 will be set
5256 /// to 1000.
5257 pub page_size: i32,
5258
5259 /// Optional. A page token, received from a previous `ListTargets` call.
5260 /// Provide this to retrieve the subsequent page.
5261 ///
5262 /// When paginating, all other provided parameters match
5263 /// the call that provided the page token.
5264 pub page_token: std::string::String,
5265
5266 /// Optional. Filter targets to be returned. See <https://google.aip.dev/160> for
5267 /// more details.
5268 pub filter: std::string::String,
5269
5270 /// Optional. Field to sort by. See <https://google.aip.dev/132#ordering> for
5271 /// more details.
5272 pub order_by: std::string::String,
5273
5274 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5275}
5276
5277impl ListTargetsRequest {
5278 /// Creates a new default instance.
5279 pub fn new() -> Self {
5280 std::default::Default::default()
5281 }
5282
5283 /// Sets the value of [parent][crate::model::ListTargetsRequest::parent].
5284 ///
5285 /// # Example
5286 /// ```ignore,no_run
5287 /// # use google_cloud_deploy_v1::model::ListTargetsRequest;
5288 /// # let project_id = "project_id";
5289 /// # let location_id = "location_id";
5290 /// let x = ListTargetsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
5291 /// ```
5292 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5293 self.parent = v.into();
5294 self
5295 }
5296
5297 /// Sets the value of [page_size][crate::model::ListTargetsRequest::page_size].
5298 ///
5299 /// # Example
5300 /// ```ignore,no_run
5301 /// # use google_cloud_deploy_v1::model::ListTargetsRequest;
5302 /// let x = ListTargetsRequest::new().set_page_size(42);
5303 /// ```
5304 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5305 self.page_size = v.into();
5306 self
5307 }
5308
5309 /// Sets the value of [page_token][crate::model::ListTargetsRequest::page_token].
5310 ///
5311 /// # Example
5312 /// ```ignore,no_run
5313 /// # use google_cloud_deploy_v1::model::ListTargetsRequest;
5314 /// let x = ListTargetsRequest::new().set_page_token("example");
5315 /// ```
5316 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5317 self.page_token = v.into();
5318 self
5319 }
5320
5321 /// Sets the value of [filter][crate::model::ListTargetsRequest::filter].
5322 ///
5323 /// # Example
5324 /// ```ignore,no_run
5325 /// # use google_cloud_deploy_v1::model::ListTargetsRequest;
5326 /// let x = ListTargetsRequest::new().set_filter("example");
5327 /// ```
5328 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5329 self.filter = v.into();
5330 self
5331 }
5332
5333 /// Sets the value of [order_by][crate::model::ListTargetsRequest::order_by].
5334 ///
5335 /// # Example
5336 /// ```ignore,no_run
5337 /// # use google_cloud_deploy_v1::model::ListTargetsRequest;
5338 /// let x = ListTargetsRequest::new().set_order_by("example");
5339 /// ```
5340 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5341 self.order_by = v.into();
5342 self
5343 }
5344}
5345
5346impl wkt::message::Message for ListTargetsRequest {
5347 fn typename() -> &'static str {
5348 "type.googleapis.com/google.cloud.deploy.v1.ListTargetsRequest"
5349 }
5350}
5351
5352/// The response object from `ListTargets`.
5353#[derive(Clone, Default, PartialEq)]
5354#[non_exhaustive]
5355pub struct ListTargetsResponse {
5356 /// The `Target` objects.
5357 pub targets: std::vec::Vec<crate::model::Target>,
5358
5359 /// A token, which can be sent as `page_token` to retrieve the next page.
5360 /// If this field is omitted, there are no subsequent pages.
5361 pub next_page_token: std::string::String,
5362
5363 /// Locations that could not be reached.
5364 pub unreachable: std::vec::Vec<std::string::String>,
5365
5366 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5367}
5368
5369impl ListTargetsResponse {
5370 /// Creates a new default instance.
5371 pub fn new() -> Self {
5372 std::default::Default::default()
5373 }
5374
5375 /// Sets the value of [targets][crate::model::ListTargetsResponse::targets].
5376 ///
5377 /// # Example
5378 /// ```ignore,no_run
5379 /// # use google_cloud_deploy_v1::model::ListTargetsResponse;
5380 /// use google_cloud_deploy_v1::model::Target;
5381 /// let x = ListTargetsResponse::new()
5382 /// .set_targets([
5383 /// Target::default()/* use setters */,
5384 /// Target::default()/* use (different) setters */,
5385 /// ]);
5386 /// ```
5387 pub fn set_targets<T, V>(mut self, v: T) -> Self
5388 where
5389 T: std::iter::IntoIterator<Item = V>,
5390 V: std::convert::Into<crate::model::Target>,
5391 {
5392 use std::iter::Iterator;
5393 self.targets = v.into_iter().map(|i| i.into()).collect();
5394 self
5395 }
5396
5397 /// Sets the value of [next_page_token][crate::model::ListTargetsResponse::next_page_token].
5398 ///
5399 /// # Example
5400 /// ```ignore,no_run
5401 /// # use google_cloud_deploy_v1::model::ListTargetsResponse;
5402 /// let x = ListTargetsResponse::new().set_next_page_token("example");
5403 /// ```
5404 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5405 self.next_page_token = v.into();
5406 self
5407 }
5408
5409 /// Sets the value of [unreachable][crate::model::ListTargetsResponse::unreachable].
5410 ///
5411 /// # Example
5412 /// ```ignore,no_run
5413 /// # use google_cloud_deploy_v1::model::ListTargetsResponse;
5414 /// let x = ListTargetsResponse::new().set_unreachable(["a", "b", "c"]);
5415 /// ```
5416 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
5417 where
5418 T: std::iter::IntoIterator<Item = V>,
5419 V: std::convert::Into<std::string::String>,
5420 {
5421 use std::iter::Iterator;
5422 self.unreachable = v.into_iter().map(|i| i.into()).collect();
5423 self
5424 }
5425}
5426
5427impl wkt::message::Message for ListTargetsResponse {
5428 fn typename() -> &'static str {
5429 "type.googleapis.com/google.cloud.deploy.v1.ListTargetsResponse"
5430 }
5431}
5432
5433#[doc(hidden)]
5434impl google_cloud_gax::paginator::internal::PageableResponse for ListTargetsResponse {
5435 type PageItem = crate::model::Target;
5436
5437 fn items(self) -> std::vec::Vec<Self::PageItem> {
5438 self.targets
5439 }
5440
5441 fn next_page_token(&self) -> std::string::String {
5442 use std::clone::Clone;
5443 self.next_page_token.clone()
5444 }
5445}
5446
5447/// The request object for `GetTarget`.
5448#[derive(Clone, Default, PartialEq)]
5449#[non_exhaustive]
5450pub struct GetTargetRequest {
5451 /// Required. Name of the `Target`. Format must be
5452 /// `projects/{project_id}/locations/{location_name}/targets/{target_name}`.
5453 pub name: std::string::String,
5454
5455 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5456}
5457
5458impl GetTargetRequest {
5459 /// Creates a new default instance.
5460 pub fn new() -> Self {
5461 std::default::Default::default()
5462 }
5463
5464 /// Sets the value of [name][crate::model::GetTargetRequest::name].
5465 ///
5466 /// # Example
5467 /// ```ignore,no_run
5468 /// # use google_cloud_deploy_v1::model::GetTargetRequest;
5469 /// # let project_id = "project_id";
5470 /// # let location_id = "location_id";
5471 /// # let target_id = "target_id";
5472 /// let x = GetTargetRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/targets/{target_id}"));
5473 /// ```
5474 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5475 self.name = v.into();
5476 self
5477 }
5478}
5479
5480impl wkt::message::Message for GetTargetRequest {
5481 fn typename() -> &'static str {
5482 "type.googleapis.com/google.cloud.deploy.v1.GetTargetRequest"
5483 }
5484}
5485
5486/// The request object for `CreateTarget`.
5487#[derive(Clone, Default, PartialEq)]
5488#[non_exhaustive]
5489pub struct CreateTargetRequest {
5490 /// Required. The parent collection in which the `Target` must be created.
5491 /// The format is
5492 /// `projects/{project_id}/locations/{location_name}`.
5493 pub parent: std::string::String,
5494
5495 /// Required. ID of the `Target`.
5496 pub target_id: std::string::String,
5497
5498 /// Required. The `Target` to create.
5499 pub target: std::option::Option<crate::model::Target>,
5500
5501 /// Optional. A request ID to identify requests. Specify a unique request ID
5502 /// so that if you must retry your request, the server knows to ignore the
5503 /// request if it has already been completed. The server guarantees that for
5504 /// at least 60 minutes after the first request.
5505 ///
5506 /// For example, consider a situation where you make an initial request and the
5507 /// request times out. If you make the request again with the same request ID,
5508 /// the server can check if original operation with the same request ID was
5509 /// received, and if so, will ignore the second request. This prevents clients
5510 /// from accidentally creating duplicate commitments.
5511 ///
5512 /// The request ID must be a valid UUID with the exception that zero UUID is
5513 /// not supported (00000000-0000-0000-0000-000000000000).
5514 pub request_id: std::string::String,
5515
5516 /// Optional. If set to true, the request is validated and the user is provided
5517 /// with an expected result, but no actual change is made.
5518 pub validate_only: bool,
5519
5520 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5521}
5522
5523impl CreateTargetRequest {
5524 /// Creates a new default instance.
5525 pub fn new() -> Self {
5526 std::default::Default::default()
5527 }
5528
5529 /// Sets the value of [parent][crate::model::CreateTargetRequest::parent].
5530 ///
5531 /// # Example
5532 /// ```ignore,no_run
5533 /// # use google_cloud_deploy_v1::model::CreateTargetRequest;
5534 /// # let project_id = "project_id";
5535 /// # let location_id = "location_id";
5536 /// let x = CreateTargetRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
5537 /// ```
5538 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5539 self.parent = v.into();
5540 self
5541 }
5542
5543 /// Sets the value of [target_id][crate::model::CreateTargetRequest::target_id].
5544 ///
5545 /// # Example
5546 /// ```ignore,no_run
5547 /// # use google_cloud_deploy_v1::model::CreateTargetRequest;
5548 /// let x = CreateTargetRequest::new().set_target_id("example");
5549 /// ```
5550 pub fn set_target_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5551 self.target_id = v.into();
5552 self
5553 }
5554
5555 /// Sets the value of [target][crate::model::CreateTargetRequest::target].
5556 ///
5557 /// # Example
5558 /// ```ignore,no_run
5559 /// # use google_cloud_deploy_v1::model::CreateTargetRequest;
5560 /// use google_cloud_deploy_v1::model::Target;
5561 /// let x = CreateTargetRequest::new().set_target(Target::default()/* use setters */);
5562 /// ```
5563 pub fn set_target<T>(mut self, v: T) -> Self
5564 where
5565 T: std::convert::Into<crate::model::Target>,
5566 {
5567 self.target = std::option::Option::Some(v.into());
5568 self
5569 }
5570
5571 /// Sets or clears the value of [target][crate::model::CreateTargetRequest::target].
5572 ///
5573 /// # Example
5574 /// ```ignore,no_run
5575 /// # use google_cloud_deploy_v1::model::CreateTargetRequest;
5576 /// use google_cloud_deploy_v1::model::Target;
5577 /// let x = CreateTargetRequest::new().set_or_clear_target(Some(Target::default()/* use setters */));
5578 /// let x = CreateTargetRequest::new().set_or_clear_target(None::<Target>);
5579 /// ```
5580 pub fn set_or_clear_target<T>(mut self, v: std::option::Option<T>) -> Self
5581 where
5582 T: std::convert::Into<crate::model::Target>,
5583 {
5584 self.target = v.map(|x| x.into());
5585 self
5586 }
5587
5588 /// Sets the value of [request_id][crate::model::CreateTargetRequest::request_id].
5589 ///
5590 /// # Example
5591 /// ```ignore,no_run
5592 /// # use google_cloud_deploy_v1::model::CreateTargetRequest;
5593 /// let x = CreateTargetRequest::new().set_request_id("example");
5594 /// ```
5595 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5596 self.request_id = v.into();
5597 self
5598 }
5599
5600 /// Sets the value of [validate_only][crate::model::CreateTargetRequest::validate_only].
5601 ///
5602 /// # Example
5603 /// ```ignore,no_run
5604 /// # use google_cloud_deploy_v1::model::CreateTargetRequest;
5605 /// let x = CreateTargetRequest::new().set_validate_only(true);
5606 /// ```
5607 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5608 self.validate_only = v.into();
5609 self
5610 }
5611}
5612
5613impl wkt::message::Message for CreateTargetRequest {
5614 fn typename() -> &'static str {
5615 "type.googleapis.com/google.cloud.deploy.v1.CreateTargetRequest"
5616 }
5617}
5618
5619/// The request object for `UpdateTarget`.
5620#[derive(Clone, Default, PartialEq)]
5621#[non_exhaustive]
5622pub struct UpdateTargetRequest {
5623 /// Required. Field mask is used to specify the fields to be overwritten by the
5624 /// update in the `Target` resource. The fields specified in the update_mask
5625 /// are relative to the resource, not the full request. A field will be
5626 /// overwritten if it's in the mask. If the user doesn't provide a mask then
5627 /// all fields are overwritten.
5628 pub update_mask: std::option::Option<wkt::FieldMask>,
5629
5630 /// Required. The `Target` to update.
5631 pub target: std::option::Option<crate::model::Target>,
5632
5633 /// Optional. A request ID to identify requests. Specify a unique request ID
5634 /// so that if you must retry your request, the server knows to ignore the
5635 /// request if it has already been completed. The server guarantees that for
5636 /// at least 60 minutes after the first request.
5637 ///
5638 /// For example, consider a situation where you make an initial request and the
5639 /// request times out. If you make the request again with the same request ID,
5640 /// the server can check if original operation with the same request ID was
5641 /// received, and if so, will ignore the second request. This prevents clients
5642 /// from accidentally creating duplicate commitments.
5643 ///
5644 /// The request ID must be a valid UUID with the exception that zero UUID is
5645 /// not supported (00000000-0000-0000-0000-000000000000).
5646 pub request_id: std::string::String,
5647
5648 /// Optional. If set to true, updating a `Target` that does not exist will
5649 /// result in the creation of a new `Target`.
5650 pub allow_missing: bool,
5651
5652 /// Optional. If set to true, the request is validated and the user is provided
5653 /// with an expected result, but no actual change is made.
5654 pub validate_only: bool,
5655
5656 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5657}
5658
5659impl UpdateTargetRequest {
5660 /// Creates a new default instance.
5661 pub fn new() -> Self {
5662 std::default::Default::default()
5663 }
5664
5665 /// Sets the value of [update_mask][crate::model::UpdateTargetRequest::update_mask].
5666 ///
5667 /// # Example
5668 /// ```ignore,no_run
5669 /// # use google_cloud_deploy_v1::model::UpdateTargetRequest;
5670 /// use wkt::FieldMask;
5671 /// let x = UpdateTargetRequest::new().set_update_mask(FieldMask::default()/* use setters */);
5672 /// ```
5673 pub fn set_update_mask<T>(mut self, v: T) -> Self
5674 where
5675 T: std::convert::Into<wkt::FieldMask>,
5676 {
5677 self.update_mask = std::option::Option::Some(v.into());
5678 self
5679 }
5680
5681 /// Sets or clears the value of [update_mask][crate::model::UpdateTargetRequest::update_mask].
5682 ///
5683 /// # Example
5684 /// ```ignore,no_run
5685 /// # use google_cloud_deploy_v1::model::UpdateTargetRequest;
5686 /// use wkt::FieldMask;
5687 /// let x = UpdateTargetRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
5688 /// let x = UpdateTargetRequest::new().set_or_clear_update_mask(None::<FieldMask>);
5689 /// ```
5690 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5691 where
5692 T: std::convert::Into<wkt::FieldMask>,
5693 {
5694 self.update_mask = v.map(|x| x.into());
5695 self
5696 }
5697
5698 /// Sets the value of [target][crate::model::UpdateTargetRequest::target].
5699 ///
5700 /// # Example
5701 /// ```ignore,no_run
5702 /// # use google_cloud_deploy_v1::model::UpdateTargetRequest;
5703 /// use google_cloud_deploy_v1::model::Target;
5704 /// let x = UpdateTargetRequest::new().set_target(Target::default()/* use setters */);
5705 /// ```
5706 pub fn set_target<T>(mut self, v: T) -> Self
5707 where
5708 T: std::convert::Into<crate::model::Target>,
5709 {
5710 self.target = std::option::Option::Some(v.into());
5711 self
5712 }
5713
5714 /// Sets or clears the value of [target][crate::model::UpdateTargetRequest::target].
5715 ///
5716 /// # Example
5717 /// ```ignore,no_run
5718 /// # use google_cloud_deploy_v1::model::UpdateTargetRequest;
5719 /// use google_cloud_deploy_v1::model::Target;
5720 /// let x = UpdateTargetRequest::new().set_or_clear_target(Some(Target::default()/* use setters */));
5721 /// let x = UpdateTargetRequest::new().set_or_clear_target(None::<Target>);
5722 /// ```
5723 pub fn set_or_clear_target<T>(mut self, v: std::option::Option<T>) -> Self
5724 where
5725 T: std::convert::Into<crate::model::Target>,
5726 {
5727 self.target = v.map(|x| x.into());
5728 self
5729 }
5730
5731 /// Sets the value of [request_id][crate::model::UpdateTargetRequest::request_id].
5732 ///
5733 /// # Example
5734 /// ```ignore,no_run
5735 /// # use google_cloud_deploy_v1::model::UpdateTargetRequest;
5736 /// let x = UpdateTargetRequest::new().set_request_id("example");
5737 /// ```
5738 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5739 self.request_id = v.into();
5740 self
5741 }
5742
5743 /// Sets the value of [allow_missing][crate::model::UpdateTargetRequest::allow_missing].
5744 ///
5745 /// # Example
5746 /// ```ignore,no_run
5747 /// # use google_cloud_deploy_v1::model::UpdateTargetRequest;
5748 /// let x = UpdateTargetRequest::new().set_allow_missing(true);
5749 /// ```
5750 pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5751 self.allow_missing = v.into();
5752 self
5753 }
5754
5755 /// Sets the value of [validate_only][crate::model::UpdateTargetRequest::validate_only].
5756 ///
5757 /// # Example
5758 /// ```ignore,no_run
5759 /// # use google_cloud_deploy_v1::model::UpdateTargetRequest;
5760 /// let x = UpdateTargetRequest::new().set_validate_only(true);
5761 /// ```
5762 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5763 self.validate_only = v.into();
5764 self
5765 }
5766}
5767
5768impl wkt::message::Message for UpdateTargetRequest {
5769 fn typename() -> &'static str {
5770 "type.googleapis.com/google.cloud.deploy.v1.UpdateTargetRequest"
5771 }
5772}
5773
5774/// The request object for `DeleteTarget`.
5775#[derive(Clone, Default, PartialEq)]
5776#[non_exhaustive]
5777pub struct DeleteTargetRequest {
5778 /// Required. The name of the `Target` to delete. The format is
5779 /// `projects/{project_id}/locations/{location_name}/targets/{target_name}`.
5780 pub name: std::string::String,
5781
5782 /// Optional. A request ID to identify requests. Specify a unique request ID
5783 /// so that if you must retry your request, the server knows to ignore the
5784 /// request if it has already been completed. The server guarantees that for
5785 /// at least 60 minutes after the first request.
5786 ///
5787 /// For example, consider a situation where you make an initial request and the
5788 /// request times out. If you make the request again with the same request ID,
5789 /// the server can check if original operation with the same request ID was
5790 /// received, and if so, will ignore the second request. This prevents clients
5791 /// from accidentally creating duplicate commitments.
5792 ///
5793 /// The request ID must be a valid UUID with the exception that zero UUID is
5794 /// not supported (00000000-0000-0000-0000-000000000000).
5795 pub request_id: std::string::String,
5796
5797 /// Optional. If set to true, then deleting an already deleted or non-existing
5798 /// `Target` will succeed.
5799 pub allow_missing: bool,
5800
5801 /// Optional. If set, validate the request and preview the review, but do not
5802 /// actually post it.
5803 pub validate_only: bool,
5804
5805 /// Optional. This checksum is computed by the server based on the value of
5806 /// other fields, and may be sent on update and delete requests to ensure the
5807 /// client has an up-to-date value before proceeding.
5808 pub etag: std::string::String,
5809
5810 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5811}
5812
5813impl DeleteTargetRequest {
5814 /// Creates a new default instance.
5815 pub fn new() -> Self {
5816 std::default::Default::default()
5817 }
5818
5819 /// Sets the value of [name][crate::model::DeleteTargetRequest::name].
5820 ///
5821 /// # Example
5822 /// ```ignore,no_run
5823 /// # use google_cloud_deploy_v1::model::DeleteTargetRequest;
5824 /// # let project_id = "project_id";
5825 /// # let location_id = "location_id";
5826 /// # let target_id = "target_id";
5827 /// let x = DeleteTargetRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/targets/{target_id}"));
5828 /// ```
5829 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5830 self.name = v.into();
5831 self
5832 }
5833
5834 /// Sets the value of [request_id][crate::model::DeleteTargetRequest::request_id].
5835 ///
5836 /// # Example
5837 /// ```ignore,no_run
5838 /// # use google_cloud_deploy_v1::model::DeleteTargetRequest;
5839 /// let x = DeleteTargetRequest::new().set_request_id("example");
5840 /// ```
5841 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5842 self.request_id = v.into();
5843 self
5844 }
5845
5846 /// Sets the value of [allow_missing][crate::model::DeleteTargetRequest::allow_missing].
5847 ///
5848 /// # Example
5849 /// ```ignore,no_run
5850 /// # use google_cloud_deploy_v1::model::DeleteTargetRequest;
5851 /// let x = DeleteTargetRequest::new().set_allow_missing(true);
5852 /// ```
5853 pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5854 self.allow_missing = v.into();
5855 self
5856 }
5857
5858 /// Sets the value of [validate_only][crate::model::DeleteTargetRequest::validate_only].
5859 ///
5860 /// # Example
5861 /// ```ignore,no_run
5862 /// # use google_cloud_deploy_v1::model::DeleteTargetRequest;
5863 /// let x = DeleteTargetRequest::new().set_validate_only(true);
5864 /// ```
5865 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5866 self.validate_only = v.into();
5867 self
5868 }
5869
5870 /// Sets the value of [etag][crate::model::DeleteTargetRequest::etag].
5871 ///
5872 /// # Example
5873 /// ```ignore,no_run
5874 /// # use google_cloud_deploy_v1::model::DeleteTargetRequest;
5875 /// let x = DeleteTargetRequest::new().set_etag("example");
5876 /// ```
5877 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5878 self.etag = v.into();
5879 self
5880 }
5881}
5882
5883impl wkt::message::Message for DeleteTargetRequest {
5884 fn typename() -> &'static str {
5885 "type.googleapis.com/google.cloud.deploy.v1.DeleteTargetRequest"
5886 }
5887}
5888
5889/// A `CustomTargetType` resource in the Cloud Deploy API.
5890///
5891/// A `CustomTargetType` defines a type of custom target that can be referenced
5892/// in a `Target` in order to facilitate deploying to other systems besides the
5893/// supported runtimes.
5894#[derive(Clone, Default, PartialEq)]
5895#[non_exhaustive]
5896pub struct CustomTargetType {
5897 /// Identifier. Name of the `CustomTargetType`. Format is
5898 /// `projects/{project}/locations/{location}/customTargetTypes/{customTargetType}`.
5899 /// The `customTargetType` component must match
5900 /// `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`
5901 pub name: std::string::String,
5902
5903 /// Output only. Resource id of the `CustomTargetType`.
5904 pub custom_target_type_id: std::string::String,
5905
5906 /// Output only. Unique identifier of the `CustomTargetType`.
5907 pub uid: std::string::String,
5908
5909 /// Optional. Description of the `CustomTargetType`. Max length is 255
5910 /// characters.
5911 pub description: std::string::String,
5912
5913 /// Optional. User annotations. These attributes can only be set and used by
5914 /// the user, and not by Cloud Deploy. See
5915 /// <https://google.aip.dev/128#annotations> for more details such as format and
5916 /// size limitations.
5917 pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
5918
5919 /// Optional. Labels are attributes that can be set and used by both the
5920 /// user and by Cloud Deploy. Labels must meet the following constraints:
5921 ///
5922 /// * Keys and values can contain only lowercase letters, numeric characters,
5923 /// underscores, and dashes.
5924 /// * All characters must use UTF-8 encoding, and international characters are
5925 /// allowed.
5926 /// * Keys must start with a lowercase letter or international character.
5927 /// * Each resource is limited to a maximum of 64 labels.
5928 ///
5929 /// Both keys and values are additionally constrained to be <= 128 bytes.
5930 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
5931
5932 /// Output only. Time at which the `CustomTargetType` was created.
5933 pub create_time: std::option::Option<wkt::Timestamp>,
5934
5935 /// Output only. Most recent time at which the `CustomTargetType` was updated.
5936 pub update_time: std::option::Option<wkt::Timestamp>,
5937
5938 /// Optional. This checksum is computed by the server based on the value of
5939 /// other fields, and may be sent on update and delete requests to ensure the
5940 /// client has an up-to-date value before proceeding.
5941 pub etag: std::string::String,
5942
5943 /// Defines the `CustomTargetType` renderer and deployer.
5944 pub definition: std::option::Option<crate::model::custom_target_type::Definition>,
5945
5946 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5947}
5948
5949impl CustomTargetType {
5950 /// Creates a new default instance.
5951 pub fn new() -> Self {
5952 std::default::Default::default()
5953 }
5954
5955 /// Sets the value of [name][crate::model::CustomTargetType::name].
5956 ///
5957 /// # Example
5958 /// ```ignore,no_run
5959 /// # use google_cloud_deploy_v1::model::CustomTargetType;
5960 /// # let project_id = "project_id";
5961 /// # let location_id = "location_id";
5962 /// # let custom_target_type_id = "custom_target_type_id";
5963 /// let x = CustomTargetType::new().set_name(format!("projects/{project_id}/locations/{location_id}/customTargetTypes/{custom_target_type_id}"));
5964 /// ```
5965 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5966 self.name = v.into();
5967 self
5968 }
5969
5970 /// Sets the value of [custom_target_type_id][crate::model::CustomTargetType::custom_target_type_id].
5971 ///
5972 /// # Example
5973 /// ```ignore,no_run
5974 /// # use google_cloud_deploy_v1::model::CustomTargetType;
5975 /// let x = CustomTargetType::new().set_custom_target_type_id("example");
5976 /// ```
5977 pub fn set_custom_target_type_id<T: std::convert::Into<std::string::String>>(
5978 mut self,
5979 v: T,
5980 ) -> Self {
5981 self.custom_target_type_id = v.into();
5982 self
5983 }
5984
5985 /// Sets the value of [uid][crate::model::CustomTargetType::uid].
5986 ///
5987 /// # Example
5988 /// ```ignore,no_run
5989 /// # use google_cloud_deploy_v1::model::CustomTargetType;
5990 /// let x = CustomTargetType::new().set_uid("example");
5991 /// ```
5992 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5993 self.uid = v.into();
5994 self
5995 }
5996
5997 /// Sets the value of [description][crate::model::CustomTargetType::description].
5998 ///
5999 /// # Example
6000 /// ```ignore,no_run
6001 /// # use google_cloud_deploy_v1::model::CustomTargetType;
6002 /// let x = CustomTargetType::new().set_description("example");
6003 /// ```
6004 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6005 self.description = v.into();
6006 self
6007 }
6008
6009 /// Sets the value of [annotations][crate::model::CustomTargetType::annotations].
6010 ///
6011 /// # Example
6012 /// ```ignore,no_run
6013 /// # use google_cloud_deploy_v1::model::CustomTargetType;
6014 /// let x = CustomTargetType::new().set_annotations([
6015 /// ("key0", "abc"),
6016 /// ("key1", "xyz"),
6017 /// ]);
6018 /// ```
6019 pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
6020 where
6021 T: std::iter::IntoIterator<Item = (K, V)>,
6022 K: std::convert::Into<std::string::String>,
6023 V: std::convert::Into<std::string::String>,
6024 {
6025 use std::iter::Iterator;
6026 self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
6027 self
6028 }
6029
6030 /// Sets the value of [labels][crate::model::CustomTargetType::labels].
6031 ///
6032 /// # Example
6033 /// ```ignore,no_run
6034 /// # use google_cloud_deploy_v1::model::CustomTargetType;
6035 /// let x = CustomTargetType::new().set_labels([
6036 /// ("key0", "abc"),
6037 /// ("key1", "xyz"),
6038 /// ]);
6039 /// ```
6040 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
6041 where
6042 T: std::iter::IntoIterator<Item = (K, V)>,
6043 K: std::convert::Into<std::string::String>,
6044 V: std::convert::Into<std::string::String>,
6045 {
6046 use std::iter::Iterator;
6047 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
6048 self
6049 }
6050
6051 /// Sets the value of [create_time][crate::model::CustomTargetType::create_time].
6052 ///
6053 /// # Example
6054 /// ```ignore,no_run
6055 /// # use google_cloud_deploy_v1::model::CustomTargetType;
6056 /// use wkt::Timestamp;
6057 /// let x = CustomTargetType::new().set_create_time(Timestamp::default()/* use setters */);
6058 /// ```
6059 pub fn set_create_time<T>(mut self, v: T) -> Self
6060 where
6061 T: std::convert::Into<wkt::Timestamp>,
6062 {
6063 self.create_time = std::option::Option::Some(v.into());
6064 self
6065 }
6066
6067 /// Sets or clears the value of [create_time][crate::model::CustomTargetType::create_time].
6068 ///
6069 /// # Example
6070 /// ```ignore,no_run
6071 /// # use google_cloud_deploy_v1::model::CustomTargetType;
6072 /// use wkt::Timestamp;
6073 /// let x = CustomTargetType::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
6074 /// let x = CustomTargetType::new().set_or_clear_create_time(None::<Timestamp>);
6075 /// ```
6076 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
6077 where
6078 T: std::convert::Into<wkt::Timestamp>,
6079 {
6080 self.create_time = v.map(|x| x.into());
6081 self
6082 }
6083
6084 /// Sets the value of [update_time][crate::model::CustomTargetType::update_time].
6085 ///
6086 /// # Example
6087 /// ```ignore,no_run
6088 /// # use google_cloud_deploy_v1::model::CustomTargetType;
6089 /// use wkt::Timestamp;
6090 /// let x = CustomTargetType::new().set_update_time(Timestamp::default()/* use setters */);
6091 /// ```
6092 pub fn set_update_time<T>(mut self, v: T) -> Self
6093 where
6094 T: std::convert::Into<wkt::Timestamp>,
6095 {
6096 self.update_time = std::option::Option::Some(v.into());
6097 self
6098 }
6099
6100 /// Sets or clears the value of [update_time][crate::model::CustomTargetType::update_time].
6101 ///
6102 /// # Example
6103 /// ```ignore,no_run
6104 /// # use google_cloud_deploy_v1::model::CustomTargetType;
6105 /// use wkt::Timestamp;
6106 /// let x = CustomTargetType::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
6107 /// let x = CustomTargetType::new().set_or_clear_update_time(None::<Timestamp>);
6108 /// ```
6109 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
6110 where
6111 T: std::convert::Into<wkt::Timestamp>,
6112 {
6113 self.update_time = v.map(|x| x.into());
6114 self
6115 }
6116
6117 /// Sets the value of [etag][crate::model::CustomTargetType::etag].
6118 ///
6119 /// # Example
6120 /// ```ignore,no_run
6121 /// # use google_cloud_deploy_v1::model::CustomTargetType;
6122 /// let x = CustomTargetType::new().set_etag("example");
6123 /// ```
6124 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6125 self.etag = v.into();
6126 self
6127 }
6128
6129 /// Sets the value of [definition][crate::model::CustomTargetType::definition].
6130 ///
6131 /// Note that all the setters affecting `definition` are mutually
6132 /// exclusive.
6133 ///
6134 /// # Example
6135 /// ```ignore,no_run
6136 /// # use google_cloud_deploy_v1::model::CustomTargetType;
6137 /// use google_cloud_deploy_v1::model::CustomTargetSkaffoldActions;
6138 /// let x = CustomTargetType::new().set_definition(Some(
6139 /// google_cloud_deploy_v1::model::custom_target_type::Definition::CustomActions(CustomTargetSkaffoldActions::default().into())));
6140 /// ```
6141 pub fn set_definition<
6142 T: std::convert::Into<std::option::Option<crate::model::custom_target_type::Definition>>,
6143 >(
6144 mut self,
6145 v: T,
6146 ) -> Self {
6147 self.definition = v.into();
6148 self
6149 }
6150
6151 /// The value of [definition][crate::model::CustomTargetType::definition]
6152 /// if it holds a `CustomActions`, `None` if the field is not set or
6153 /// holds a different branch.
6154 pub fn custom_actions(
6155 &self,
6156 ) -> std::option::Option<&std::boxed::Box<crate::model::CustomTargetSkaffoldActions>> {
6157 #[allow(unreachable_patterns)]
6158 self.definition.as_ref().and_then(|v| match v {
6159 crate::model::custom_target_type::Definition::CustomActions(v) => {
6160 std::option::Option::Some(v)
6161 }
6162 _ => std::option::Option::None,
6163 })
6164 }
6165
6166 /// Sets the value of [definition][crate::model::CustomTargetType::definition]
6167 /// to hold a `CustomActions`.
6168 ///
6169 /// Note that all the setters affecting `definition` are
6170 /// mutually exclusive.
6171 ///
6172 /// # Example
6173 /// ```ignore,no_run
6174 /// # use google_cloud_deploy_v1::model::CustomTargetType;
6175 /// use google_cloud_deploy_v1::model::CustomTargetSkaffoldActions;
6176 /// let x = CustomTargetType::new().set_custom_actions(CustomTargetSkaffoldActions::default()/* use setters */);
6177 /// assert!(x.custom_actions().is_some());
6178 /// ```
6179 pub fn set_custom_actions<
6180 T: std::convert::Into<std::boxed::Box<crate::model::CustomTargetSkaffoldActions>>,
6181 >(
6182 mut self,
6183 v: T,
6184 ) -> Self {
6185 self.definition = std::option::Option::Some(
6186 crate::model::custom_target_type::Definition::CustomActions(v.into()),
6187 );
6188 self
6189 }
6190}
6191
6192impl wkt::message::Message for CustomTargetType {
6193 fn typename() -> &'static str {
6194 "type.googleapis.com/google.cloud.deploy.v1.CustomTargetType"
6195 }
6196}
6197
6198/// Defines additional types related to [CustomTargetType].
6199pub mod custom_target_type {
6200 #[allow(unused_imports)]
6201 use super::*;
6202
6203 /// Defines the `CustomTargetType` renderer and deployer.
6204 #[derive(Clone, Debug, PartialEq)]
6205 #[non_exhaustive]
6206 pub enum Definition {
6207 /// Optional. Configures render and deploy for the `CustomTargetType` using
6208 /// Skaffold custom actions.
6209 CustomActions(std::boxed::Box<crate::model::CustomTargetSkaffoldActions>),
6210 }
6211}
6212
6213/// CustomTargetSkaffoldActions represents the `CustomTargetType` configuration
6214/// using Skaffold custom actions.
6215#[derive(Clone, Default, PartialEq)]
6216#[non_exhaustive]
6217pub struct CustomTargetSkaffoldActions {
6218 /// Optional. The Skaffold custom action responsible for render operations. If
6219 /// not provided then Cloud Deploy will perform the render operations via
6220 /// `skaffold render`.
6221 pub render_action: std::string::String,
6222
6223 /// Required. The Skaffold custom action responsible for deploy operations.
6224 pub deploy_action: std::string::String,
6225
6226 /// Optional. List of Skaffold modules Cloud Deploy will include in the
6227 /// Skaffold Config as required before performing diagnose.
6228 pub include_skaffold_modules: std::vec::Vec<crate::model::SkaffoldModules>,
6229
6230 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6231}
6232
6233impl CustomTargetSkaffoldActions {
6234 /// Creates a new default instance.
6235 pub fn new() -> Self {
6236 std::default::Default::default()
6237 }
6238
6239 /// Sets the value of [render_action][crate::model::CustomTargetSkaffoldActions::render_action].
6240 ///
6241 /// # Example
6242 /// ```ignore,no_run
6243 /// # use google_cloud_deploy_v1::model::CustomTargetSkaffoldActions;
6244 /// let x = CustomTargetSkaffoldActions::new().set_render_action("example");
6245 /// ```
6246 pub fn set_render_action<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6247 self.render_action = v.into();
6248 self
6249 }
6250
6251 /// Sets the value of [deploy_action][crate::model::CustomTargetSkaffoldActions::deploy_action].
6252 ///
6253 /// # Example
6254 /// ```ignore,no_run
6255 /// # use google_cloud_deploy_v1::model::CustomTargetSkaffoldActions;
6256 /// let x = CustomTargetSkaffoldActions::new().set_deploy_action("example");
6257 /// ```
6258 pub fn set_deploy_action<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6259 self.deploy_action = v.into();
6260 self
6261 }
6262
6263 /// Sets the value of [include_skaffold_modules][crate::model::CustomTargetSkaffoldActions::include_skaffold_modules].
6264 ///
6265 /// # Example
6266 /// ```ignore,no_run
6267 /// # use google_cloud_deploy_v1::model::CustomTargetSkaffoldActions;
6268 /// use google_cloud_deploy_v1::model::SkaffoldModules;
6269 /// let x = CustomTargetSkaffoldActions::new()
6270 /// .set_include_skaffold_modules([
6271 /// SkaffoldModules::default()/* use setters */,
6272 /// SkaffoldModules::default()/* use (different) setters */,
6273 /// ]);
6274 /// ```
6275 pub fn set_include_skaffold_modules<T, V>(mut self, v: T) -> Self
6276 where
6277 T: std::iter::IntoIterator<Item = V>,
6278 V: std::convert::Into<crate::model::SkaffoldModules>,
6279 {
6280 use std::iter::Iterator;
6281 self.include_skaffold_modules = v.into_iter().map(|i| i.into()).collect();
6282 self
6283 }
6284}
6285
6286impl wkt::message::Message for CustomTargetSkaffoldActions {
6287 fn typename() -> &'static str {
6288 "type.googleapis.com/google.cloud.deploy.v1.CustomTargetSkaffoldActions"
6289 }
6290}
6291
6292/// Skaffold Config modules and their remote source.
6293#[derive(Clone, Default, PartialEq)]
6294#[non_exhaustive]
6295pub struct SkaffoldModules {
6296 /// Optional. The Skaffold Config modules to use from the specified source.
6297 pub configs: std::vec::Vec<std::string::String>,
6298
6299 /// The source that contains the Skaffold Config modules.
6300 pub source: std::option::Option<crate::model::skaffold_modules::Source>,
6301
6302 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6303}
6304
6305impl SkaffoldModules {
6306 /// Creates a new default instance.
6307 pub fn new() -> Self {
6308 std::default::Default::default()
6309 }
6310
6311 /// Sets the value of [configs][crate::model::SkaffoldModules::configs].
6312 ///
6313 /// # Example
6314 /// ```ignore,no_run
6315 /// # use google_cloud_deploy_v1::model::SkaffoldModules;
6316 /// let x = SkaffoldModules::new().set_configs(["a", "b", "c"]);
6317 /// ```
6318 pub fn set_configs<T, V>(mut self, v: T) -> Self
6319 where
6320 T: std::iter::IntoIterator<Item = V>,
6321 V: std::convert::Into<std::string::String>,
6322 {
6323 use std::iter::Iterator;
6324 self.configs = v.into_iter().map(|i| i.into()).collect();
6325 self
6326 }
6327
6328 /// Sets the value of [source][crate::model::SkaffoldModules::source].
6329 ///
6330 /// Note that all the setters affecting `source` are mutually
6331 /// exclusive.
6332 ///
6333 /// # Example
6334 /// ```ignore,no_run
6335 /// # use google_cloud_deploy_v1::model::SkaffoldModules;
6336 /// use google_cloud_deploy_v1::model::skaffold_modules::SkaffoldGitSource;
6337 /// let x = SkaffoldModules::new().set_source(Some(
6338 /// google_cloud_deploy_v1::model::skaffold_modules::Source::Git(SkaffoldGitSource::default().into())));
6339 /// ```
6340 pub fn set_source<
6341 T: std::convert::Into<std::option::Option<crate::model::skaffold_modules::Source>>,
6342 >(
6343 mut self,
6344 v: T,
6345 ) -> Self {
6346 self.source = v.into();
6347 self
6348 }
6349
6350 /// The value of [source][crate::model::SkaffoldModules::source]
6351 /// if it holds a `Git`, `None` if the field is not set or
6352 /// holds a different branch.
6353 pub fn git(
6354 &self,
6355 ) -> std::option::Option<&std::boxed::Box<crate::model::skaffold_modules::SkaffoldGitSource>>
6356 {
6357 #[allow(unreachable_patterns)]
6358 self.source.as_ref().and_then(|v| match v {
6359 crate::model::skaffold_modules::Source::Git(v) => std::option::Option::Some(v),
6360 _ => std::option::Option::None,
6361 })
6362 }
6363
6364 /// Sets the value of [source][crate::model::SkaffoldModules::source]
6365 /// to hold a `Git`.
6366 ///
6367 /// Note that all the setters affecting `source` are
6368 /// mutually exclusive.
6369 ///
6370 /// # Example
6371 /// ```ignore,no_run
6372 /// # use google_cloud_deploy_v1::model::SkaffoldModules;
6373 /// use google_cloud_deploy_v1::model::skaffold_modules::SkaffoldGitSource;
6374 /// let x = SkaffoldModules::new().set_git(SkaffoldGitSource::default()/* use setters */);
6375 /// assert!(x.git().is_some());
6376 /// assert!(x.google_cloud_storage().is_none());
6377 /// assert!(x.google_cloud_build_repo().is_none());
6378 /// ```
6379 pub fn set_git<
6380 T: std::convert::Into<std::boxed::Box<crate::model::skaffold_modules::SkaffoldGitSource>>,
6381 >(
6382 mut self,
6383 v: T,
6384 ) -> Self {
6385 self.source =
6386 std::option::Option::Some(crate::model::skaffold_modules::Source::Git(v.into()));
6387 self
6388 }
6389
6390 /// The value of [source][crate::model::SkaffoldModules::source]
6391 /// if it holds a `GoogleCloudStorage`, `None` if the field is not set or
6392 /// holds a different branch.
6393 pub fn google_cloud_storage(
6394 &self,
6395 ) -> std::option::Option<&std::boxed::Box<crate::model::skaffold_modules::SkaffoldGCSSource>>
6396 {
6397 #[allow(unreachable_patterns)]
6398 self.source.as_ref().and_then(|v| match v {
6399 crate::model::skaffold_modules::Source::GoogleCloudStorage(v) => {
6400 std::option::Option::Some(v)
6401 }
6402 _ => std::option::Option::None,
6403 })
6404 }
6405
6406 /// Sets the value of [source][crate::model::SkaffoldModules::source]
6407 /// to hold a `GoogleCloudStorage`.
6408 ///
6409 /// Note that all the setters affecting `source` are
6410 /// mutually exclusive.
6411 ///
6412 /// # Example
6413 /// ```ignore,no_run
6414 /// # use google_cloud_deploy_v1::model::SkaffoldModules;
6415 /// use google_cloud_deploy_v1::model::skaffold_modules::SkaffoldGCSSource;
6416 /// let x = SkaffoldModules::new().set_google_cloud_storage(SkaffoldGCSSource::default()/* use setters */);
6417 /// assert!(x.google_cloud_storage().is_some());
6418 /// assert!(x.git().is_none());
6419 /// assert!(x.google_cloud_build_repo().is_none());
6420 /// ```
6421 pub fn set_google_cloud_storage<
6422 T: std::convert::Into<std::boxed::Box<crate::model::skaffold_modules::SkaffoldGCSSource>>,
6423 >(
6424 mut self,
6425 v: T,
6426 ) -> Self {
6427 self.source = std::option::Option::Some(
6428 crate::model::skaffold_modules::Source::GoogleCloudStorage(v.into()),
6429 );
6430 self
6431 }
6432
6433 /// The value of [source][crate::model::SkaffoldModules::source]
6434 /// if it holds a `GoogleCloudBuildRepo`, `None` if the field is not set or
6435 /// holds a different branch.
6436 pub fn google_cloud_build_repo(
6437 &self,
6438 ) -> std::option::Option<&std::boxed::Box<crate::model::skaffold_modules::SkaffoldGCBRepoSource>>
6439 {
6440 #[allow(unreachable_patterns)]
6441 self.source.as_ref().and_then(|v| match v {
6442 crate::model::skaffold_modules::Source::GoogleCloudBuildRepo(v) => {
6443 std::option::Option::Some(v)
6444 }
6445 _ => std::option::Option::None,
6446 })
6447 }
6448
6449 /// Sets the value of [source][crate::model::SkaffoldModules::source]
6450 /// to hold a `GoogleCloudBuildRepo`.
6451 ///
6452 /// Note that all the setters affecting `source` are
6453 /// mutually exclusive.
6454 ///
6455 /// # Example
6456 /// ```ignore,no_run
6457 /// # use google_cloud_deploy_v1::model::SkaffoldModules;
6458 /// use google_cloud_deploy_v1::model::skaffold_modules::SkaffoldGCBRepoSource;
6459 /// let x = SkaffoldModules::new().set_google_cloud_build_repo(SkaffoldGCBRepoSource::default()/* use setters */);
6460 /// assert!(x.google_cloud_build_repo().is_some());
6461 /// assert!(x.git().is_none());
6462 /// assert!(x.google_cloud_storage().is_none());
6463 /// ```
6464 pub fn set_google_cloud_build_repo<
6465 T: std::convert::Into<std::boxed::Box<crate::model::skaffold_modules::SkaffoldGCBRepoSource>>,
6466 >(
6467 mut self,
6468 v: T,
6469 ) -> Self {
6470 self.source = std::option::Option::Some(
6471 crate::model::skaffold_modules::Source::GoogleCloudBuildRepo(v.into()),
6472 );
6473 self
6474 }
6475}
6476
6477impl wkt::message::Message for SkaffoldModules {
6478 fn typename() -> &'static str {
6479 "type.googleapis.com/google.cloud.deploy.v1.SkaffoldModules"
6480 }
6481}
6482
6483/// Defines additional types related to [SkaffoldModules].
6484pub mod skaffold_modules {
6485 #[allow(unused_imports)]
6486 use super::*;
6487
6488 /// Git repository containing Skaffold Config modules.
6489 #[derive(Clone, Default, PartialEq)]
6490 #[non_exhaustive]
6491 pub struct SkaffoldGitSource {
6492 /// Required. Git repository the package should be cloned from.
6493 pub repo: std::string::String,
6494
6495 /// Optional. Relative path from the repository root to the Skaffold file.
6496 pub path: std::string::String,
6497
6498 /// Optional. Git branch or tag to use when cloning the repository.
6499 pub r#ref: std::string::String,
6500
6501 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6502 }
6503
6504 impl SkaffoldGitSource {
6505 /// Creates a new default instance.
6506 pub fn new() -> Self {
6507 std::default::Default::default()
6508 }
6509
6510 /// Sets the value of [repo][crate::model::skaffold_modules::SkaffoldGitSource::repo].
6511 ///
6512 /// # Example
6513 /// ```ignore,no_run
6514 /// # use google_cloud_deploy_v1::model::skaffold_modules::SkaffoldGitSource;
6515 /// let x = SkaffoldGitSource::new().set_repo("example");
6516 /// ```
6517 pub fn set_repo<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6518 self.repo = v.into();
6519 self
6520 }
6521
6522 /// Sets the value of [path][crate::model::skaffold_modules::SkaffoldGitSource::path].
6523 ///
6524 /// # Example
6525 /// ```ignore,no_run
6526 /// # use google_cloud_deploy_v1::model::skaffold_modules::SkaffoldGitSource;
6527 /// let x = SkaffoldGitSource::new().set_path("example");
6528 /// ```
6529 pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6530 self.path = v.into();
6531 self
6532 }
6533
6534 /// Sets the value of [r#ref][crate::model::skaffold_modules::SkaffoldGitSource::ref].
6535 ///
6536 /// # Example
6537 /// ```ignore,no_run
6538 /// # use google_cloud_deploy_v1::model::skaffold_modules::SkaffoldGitSource;
6539 /// let x = SkaffoldGitSource::new().set_ref("example");
6540 /// ```
6541 pub fn set_ref<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6542 self.r#ref = v.into();
6543 self
6544 }
6545 }
6546
6547 impl wkt::message::Message for SkaffoldGitSource {
6548 fn typename() -> &'static str {
6549 "type.googleapis.com/google.cloud.deploy.v1.SkaffoldModules.SkaffoldGitSource"
6550 }
6551 }
6552
6553 /// Cloud Storage bucket containing Skaffold Config modules.
6554 #[derive(Clone, Default, PartialEq)]
6555 #[non_exhaustive]
6556 pub struct SkaffoldGCSSource {
6557 /// Required. Cloud Storage source paths to copy recursively. For example,
6558 /// providing "gs://my-bucket/dir/configs/*" will result in Skaffold copying
6559 /// all files within the "dir/configs" directory in the bucket "my-bucket".
6560 pub source: std::string::String,
6561
6562 /// Optional. Relative path from the source to the Skaffold file.
6563 pub path: std::string::String,
6564
6565 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6566 }
6567
6568 impl SkaffoldGCSSource {
6569 /// Creates a new default instance.
6570 pub fn new() -> Self {
6571 std::default::Default::default()
6572 }
6573
6574 /// Sets the value of [source][crate::model::skaffold_modules::SkaffoldGCSSource::source].
6575 ///
6576 /// # Example
6577 /// ```ignore,no_run
6578 /// # use google_cloud_deploy_v1::model::skaffold_modules::SkaffoldGCSSource;
6579 /// let x = SkaffoldGCSSource::new().set_source("example");
6580 /// ```
6581 pub fn set_source<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6582 self.source = v.into();
6583 self
6584 }
6585
6586 /// Sets the value of [path][crate::model::skaffold_modules::SkaffoldGCSSource::path].
6587 ///
6588 /// # Example
6589 /// ```ignore,no_run
6590 /// # use google_cloud_deploy_v1::model::skaffold_modules::SkaffoldGCSSource;
6591 /// let x = SkaffoldGCSSource::new().set_path("example");
6592 /// ```
6593 pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6594 self.path = v.into();
6595 self
6596 }
6597 }
6598
6599 impl wkt::message::Message for SkaffoldGCSSource {
6600 fn typename() -> &'static str {
6601 "type.googleapis.com/google.cloud.deploy.v1.SkaffoldModules.SkaffoldGCSSource"
6602 }
6603 }
6604
6605 /// Cloud Build V2 Repository containing Skaffold Configs.
6606 #[derive(Clone, Default, PartialEq)]
6607 #[non_exhaustive]
6608 pub struct SkaffoldGCBRepoSource {
6609 /// Required. Name of the Cloud Build V2 Repository.
6610 /// Format is
6611 /// projects/{project}/locations/{location}/connections/{connection}/repositories/{repository}.
6612 pub repository: std::string::String,
6613
6614 /// Optional. Relative path from the repository root to the Skaffold Config
6615 /// file.
6616 pub path: std::string::String,
6617
6618 /// Optional. Branch or tag to use when cloning the repository.
6619 pub r#ref: std::string::String,
6620
6621 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6622 }
6623
6624 impl SkaffoldGCBRepoSource {
6625 /// Creates a new default instance.
6626 pub fn new() -> Self {
6627 std::default::Default::default()
6628 }
6629
6630 /// Sets the value of [repository][crate::model::skaffold_modules::SkaffoldGCBRepoSource::repository].
6631 ///
6632 /// # Example
6633 /// ```ignore,no_run
6634 /// # use google_cloud_deploy_v1::model::skaffold_modules::SkaffoldGCBRepoSource;
6635 /// let x = SkaffoldGCBRepoSource::new().set_repository("example");
6636 /// ```
6637 pub fn set_repository<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6638 self.repository = v.into();
6639 self
6640 }
6641
6642 /// Sets the value of [path][crate::model::skaffold_modules::SkaffoldGCBRepoSource::path].
6643 ///
6644 /// # Example
6645 /// ```ignore,no_run
6646 /// # use google_cloud_deploy_v1::model::skaffold_modules::SkaffoldGCBRepoSource;
6647 /// let x = SkaffoldGCBRepoSource::new().set_path("example");
6648 /// ```
6649 pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6650 self.path = v.into();
6651 self
6652 }
6653
6654 /// Sets the value of [r#ref][crate::model::skaffold_modules::SkaffoldGCBRepoSource::ref].
6655 ///
6656 /// # Example
6657 /// ```ignore,no_run
6658 /// # use google_cloud_deploy_v1::model::skaffold_modules::SkaffoldGCBRepoSource;
6659 /// let x = SkaffoldGCBRepoSource::new().set_ref("example");
6660 /// ```
6661 pub fn set_ref<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6662 self.r#ref = v.into();
6663 self
6664 }
6665 }
6666
6667 impl wkt::message::Message for SkaffoldGCBRepoSource {
6668 fn typename() -> &'static str {
6669 "type.googleapis.com/google.cloud.deploy.v1.SkaffoldModules.SkaffoldGCBRepoSource"
6670 }
6671 }
6672
6673 /// The source that contains the Skaffold Config modules.
6674 #[derive(Clone, Debug, PartialEq)]
6675 #[non_exhaustive]
6676 pub enum Source {
6677 /// Optional. Remote git repository containing the Skaffold Config modules.
6678 Git(std::boxed::Box<crate::model::skaffold_modules::SkaffoldGitSource>),
6679 /// Optional. Cloud Storage bucket containing the Skaffold Config modules.
6680 GoogleCloudStorage(std::boxed::Box<crate::model::skaffold_modules::SkaffoldGCSSource>),
6681 /// Optional. Cloud Build V2 repository containing the Skaffold Config
6682 /// modules.
6683 GoogleCloudBuildRepo(
6684 std::boxed::Box<crate::model::skaffold_modules::SkaffoldGCBRepoSource>,
6685 ),
6686 }
6687}
6688
6689/// The request object for `ListCustomTargetTypes`.
6690#[derive(Clone, Default, PartialEq)]
6691#[non_exhaustive]
6692pub struct ListCustomTargetTypesRequest {
6693 /// Required. The parent that owns this collection of custom target types.
6694 /// Format must be `projects/{project_id}/locations/{location_name}`.
6695 pub parent: std::string::String,
6696
6697 /// Optional. The maximum number of `CustomTargetType` objects to return. The
6698 /// service may return fewer than this value. If unspecified, at most 50
6699 /// `CustomTargetType` objects will be returned. The maximum value is 1000;
6700 /// values above 1000 will be set to 1000.
6701 pub page_size: i32,
6702
6703 /// Optional. A page token, received from a previous `ListCustomTargetTypes`
6704 /// call. Provide this to retrieve the subsequent page.
6705 ///
6706 /// When paginating, all other provided parameters match
6707 /// the call that provided the page token.
6708 pub page_token: std::string::String,
6709
6710 /// Optional. Filter custom target types to be returned. See
6711 /// <https://google.aip.dev/160> for more details.
6712 pub filter: std::string::String,
6713
6714 /// Optional. Field to sort by. See <https://google.aip.dev/132#ordering> for
6715 /// more details.
6716 pub order_by: std::string::String,
6717
6718 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6719}
6720
6721impl ListCustomTargetTypesRequest {
6722 /// Creates a new default instance.
6723 pub fn new() -> Self {
6724 std::default::Default::default()
6725 }
6726
6727 /// Sets the value of [parent][crate::model::ListCustomTargetTypesRequest::parent].
6728 ///
6729 /// # Example
6730 /// ```ignore,no_run
6731 /// # use google_cloud_deploy_v1::model::ListCustomTargetTypesRequest;
6732 /// # let project_id = "project_id";
6733 /// # let location_id = "location_id";
6734 /// let x = ListCustomTargetTypesRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
6735 /// ```
6736 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6737 self.parent = v.into();
6738 self
6739 }
6740
6741 /// Sets the value of [page_size][crate::model::ListCustomTargetTypesRequest::page_size].
6742 ///
6743 /// # Example
6744 /// ```ignore,no_run
6745 /// # use google_cloud_deploy_v1::model::ListCustomTargetTypesRequest;
6746 /// let x = ListCustomTargetTypesRequest::new().set_page_size(42);
6747 /// ```
6748 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6749 self.page_size = v.into();
6750 self
6751 }
6752
6753 /// Sets the value of [page_token][crate::model::ListCustomTargetTypesRequest::page_token].
6754 ///
6755 /// # Example
6756 /// ```ignore,no_run
6757 /// # use google_cloud_deploy_v1::model::ListCustomTargetTypesRequest;
6758 /// let x = ListCustomTargetTypesRequest::new().set_page_token("example");
6759 /// ```
6760 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6761 self.page_token = v.into();
6762 self
6763 }
6764
6765 /// Sets the value of [filter][crate::model::ListCustomTargetTypesRequest::filter].
6766 ///
6767 /// # Example
6768 /// ```ignore,no_run
6769 /// # use google_cloud_deploy_v1::model::ListCustomTargetTypesRequest;
6770 /// let x = ListCustomTargetTypesRequest::new().set_filter("example");
6771 /// ```
6772 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6773 self.filter = v.into();
6774 self
6775 }
6776
6777 /// Sets the value of [order_by][crate::model::ListCustomTargetTypesRequest::order_by].
6778 ///
6779 /// # Example
6780 /// ```ignore,no_run
6781 /// # use google_cloud_deploy_v1::model::ListCustomTargetTypesRequest;
6782 /// let x = ListCustomTargetTypesRequest::new().set_order_by("example");
6783 /// ```
6784 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6785 self.order_by = v.into();
6786 self
6787 }
6788}
6789
6790impl wkt::message::Message for ListCustomTargetTypesRequest {
6791 fn typename() -> &'static str {
6792 "type.googleapis.com/google.cloud.deploy.v1.ListCustomTargetTypesRequest"
6793 }
6794}
6795
6796/// The response object from `ListCustomTargetTypes.`
6797#[derive(Clone, Default, PartialEq)]
6798#[non_exhaustive]
6799pub struct ListCustomTargetTypesResponse {
6800 /// The `CustomTargetType` objects.
6801 pub custom_target_types: std::vec::Vec<crate::model::CustomTargetType>,
6802
6803 /// A token, which can be sent as `page_token` to retrieve the next page.
6804 /// If this field is omitted, there are no subsequent pages.
6805 pub next_page_token: std::string::String,
6806
6807 /// Locations that could not be reached.
6808 pub unreachable: std::vec::Vec<std::string::String>,
6809
6810 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6811}
6812
6813impl ListCustomTargetTypesResponse {
6814 /// Creates a new default instance.
6815 pub fn new() -> Self {
6816 std::default::Default::default()
6817 }
6818
6819 /// Sets the value of [custom_target_types][crate::model::ListCustomTargetTypesResponse::custom_target_types].
6820 ///
6821 /// # Example
6822 /// ```ignore,no_run
6823 /// # use google_cloud_deploy_v1::model::ListCustomTargetTypesResponse;
6824 /// use google_cloud_deploy_v1::model::CustomTargetType;
6825 /// let x = ListCustomTargetTypesResponse::new()
6826 /// .set_custom_target_types([
6827 /// CustomTargetType::default()/* use setters */,
6828 /// CustomTargetType::default()/* use (different) setters */,
6829 /// ]);
6830 /// ```
6831 pub fn set_custom_target_types<T, V>(mut self, v: T) -> Self
6832 where
6833 T: std::iter::IntoIterator<Item = V>,
6834 V: std::convert::Into<crate::model::CustomTargetType>,
6835 {
6836 use std::iter::Iterator;
6837 self.custom_target_types = v.into_iter().map(|i| i.into()).collect();
6838 self
6839 }
6840
6841 /// Sets the value of [next_page_token][crate::model::ListCustomTargetTypesResponse::next_page_token].
6842 ///
6843 /// # Example
6844 /// ```ignore,no_run
6845 /// # use google_cloud_deploy_v1::model::ListCustomTargetTypesResponse;
6846 /// let x = ListCustomTargetTypesResponse::new().set_next_page_token("example");
6847 /// ```
6848 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6849 self.next_page_token = v.into();
6850 self
6851 }
6852
6853 /// Sets the value of [unreachable][crate::model::ListCustomTargetTypesResponse::unreachable].
6854 ///
6855 /// # Example
6856 /// ```ignore,no_run
6857 /// # use google_cloud_deploy_v1::model::ListCustomTargetTypesResponse;
6858 /// let x = ListCustomTargetTypesResponse::new().set_unreachable(["a", "b", "c"]);
6859 /// ```
6860 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
6861 where
6862 T: std::iter::IntoIterator<Item = V>,
6863 V: std::convert::Into<std::string::String>,
6864 {
6865 use std::iter::Iterator;
6866 self.unreachable = v.into_iter().map(|i| i.into()).collect();
6867 self
6868 }
6869}
6870
6871impl wkt::message::Message for ListCustomTargetTypesResponse {
6872 fn typename() -> &'static str {
6873 "type.googleapis.com/google.cloud.deploy.v1.ListCustomTargetTypesResponse"
6874 }
6875}
6876
6877#[doc(hidden)]
6878impl google_cloud_gax::paginator::internal::PageableResponse for ListCustomTargetTypesResponse {
6879 type PageItem = crate::model::CustomTargetType;
6880
6881 fn items(self) -> std::vec::Vec<Self::PageItem> {
6882 self.custom_target_types
6883 }
6884
6885 fn next_page_token(&self) -> std::string::String {
6886 use std::clone::Clone;
6887 self.next_page_token.clone()
6888 }
6889}
6890
6891/// The request object for `GetCustomTargetType`.
6892#[derive(Clone, Default, PartialEq)]
6893#[non_exhaustive]
6894pub struct GetCustomTargetTypeRequest {
6895 /// Required. Name of the `CustomTargetType`. Format must be
6896 /// `projects/{project_id}/locations/{location_name}/customTargetTypes/{custom_target_type}`.
6897 pub name: std::string::String,
6898
6899 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6900}
6901
6902impl GetCustomTargetTypeRequest {
6903 /// Creates a new default instance.
6904 pub fn new() -> Self {
6905 std::default::Default::default()
6906 }
6907
6908 /// Sets the value of [name][crate::model::GetCustomTargetTypeRequest::name].
6909 ///
6910 /// # Example
6911 /// ```ignore,no_run
6912 /// # use google_cloud_deploy_v1::model::GetCustomTargetTypeRequest;
6913 /// # let project_id = "project_id";
6914 /// # let location_id = "location_id";
6915 /// # let custom_target_type_id = "custom_target_type_id";
6916 /// let x = GetCustomTargetTypeRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/customTargetTypes/{custom_target_type_id}"));
6917 /// ```
6918 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6919 self.name = v.into();
6920 self
6921 }
6922}
6923
6924impl wkt::message::Message for GetCustomTargetTypeRequest {
6925 fn typename() -> &'static str {
6926 "type.googleapis.com/google.cloud.deploy.v1.GetCustomTargetTypeRequest"
6927 }
6928}
6929
6930/// The request object for `CreateCustomTargetType`.
6931#[derive(Clone, Default, PartialEq)]
6932#[non_exhaustive]
6933pub struct CreateCustomTargetTypeRequest {
6934 /// Required. The parent collection in which the `CustomTargetType` must be
6935 /// created. The format is `projects/{project_id}/locations/{location_name}`.
6936 pub parent: std::string::String,
6937
6938 /// Required. ID of the `CustomTargetType`.
6939 pub custom_target_type_id: std::string::String,
6940
6941 /// Required. The `CustomTargetType` to create.
6942 pub custom_target_type: std::option::Option<crate::model::CustomTargetType>,
6943
6944 /// Optional. A request ID to identify requests. Specify a unique request ID
6945 /// so that if you must retry your request, the server knows to ignore the
6946 /// request if it has already been completed. The server guarantees that for
6947 /// at least 60 minutes after the first request.
6948 ///
6949 /// For example, consider a situation where you make an initial request and the
6950 /// request times out. If you make the request again with the same request ID,
6951 /// the server can check if original operation with the same request ID was
6952 /// received, and if so, will ignore the second request. This prevents clients
6953 /// from accidentally creating duplicate commitments.
6954 ///
6955 /// The request ID must be a valid UUID with the exception that zero UUID is
6956 /// not supported (00000000-0000-0000-0000-000000000000).
6957 pub request_id: std::string::String,
6958
6959 /// Optional. If set to true, the request is validated and the user is provided
6960 /// with an expected result, but no actual change is made.
6961 pub validate_only: bool,
6962
6963 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6964}
6965
6966impl CreateCustomTargetTypeRequest {
6967 /// Creates a new default instance.
6968 pub fn new() -> Self {
6969 std::default::Default::default()
6970 }
6971
6972 /// Sets the value of [parent][crate::model::CreateCustomTargetTypeRequest::parent].
6973 ///
6974 /// # Example
6975 /// ```ignore,no_run
6976 /// # use google_cloud_deploy_v1::model::CreateCustomTargetTypeRequest;
6977 /// # let project_id = "project_id";
6978 /// # let location_id = "location_id";
6979 /// let x = CreateCustomTargetTypeRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
6980 /// ```
6981 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6982 self.parent = v.into();
6983 self
6984 }
6985
6986 /// Sets the value of [custom_target_type_id][crate::model::CreateCustomTargetTypeRequest::custom_target_type_id].
6987 ///
6988 /// # Example
6989 /// ```ignore,no_run
6990 /// # use google_cloud_deploy_v1::model::CreateCustomTargetTypeRequest;
6991 /// let x = CreateCustomTargetTypeRequest::new().set_custom_target_type_id("example");
6992 /// ```
6993 pub fn set_custom_target_type_id<T: std::convert::Into<std::string::String>>(
6994 mut self,
6995 v: T,
6996 ) -> Self {
6997 self.custom_target_type_id = v.into();
6998 self
6999 }
7000
7001 /// Sets the value of [custom_target_type][crate::model::CreateCustomTargetTypeRequest::custom_target_type].
7002 ///
7003 /// # Example
7004 /// ```ignore,no_run
7005 /// # use google_cloud_deploy_v1::model::CreateCustomTargetTypeRequest;
7006 /// use google_cloud_deploy_v1::model::CustomTargetType;
7007 /// let x = CreateCustomTargetTypeRequest::new().set_custom_target_type(CustomTargetType::default()/* use setters */);
7008 /// ```
7009 pub fn set_custom_target_type<T>(mut self, v: T) -> Self
7010 where
7011 T: std::convert::Into<crate::model::CustomTargetType>,
7012 {
7013 self.custom_target_type = std::option::Option::Some(v.into());
7014 self
7015 }
7016
7017 /// Sets or clears the value of [custom_target_type][crate::model::CreateCustomTargetTypeRequest::custom_target_type].
7018 ///
7019 /// # Example
7020 /// ```ignore,no_run
7021 /// # use google_cloud_deploy_v1::model::CreateCustomTargetTypeRequest;
7022 /// use google_cloud_deploy_v1::model::CustomTargetType;
7023 /// let x = CreateCustomTargetTypeRequest::new().set_or_clear_custom_target_type(Some(CustomTargetType::default()/* use setters */));
7024 /// let x = CreateCustomTargetTypeRequest::new().set_or_clear_custom_target_type(None::<CustomTargetType>);
7025 /// ```
7026 pub fn set_or_clear_custom_target_type<T>(mut self, v: std::option::Option<T>) -> Self
7027 where
7028 T: std::convert::Into<crate::model::CustomTargetType>,
7029 {
7030 self.custom_target_type = v.map(|x| x.into());
7031 self
7032 }
7033
7034 /// Sets the value of [request_id][crate::model::CreateCustomTargetTypeRequest::request_id].
7035 ///
7036 /// # Example
7037 /// ```ignore,no_run
7038 /// # use google_cloud_deploy_v1::model::CreateCustomTargetTypeRequest;
7039 /// let x = CreateCustomTargetTypeRequest::new().set_request_id("example");
7040 /// ```
7041 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7042 self.request_id = v.into();
7043 self
7044 }
7045
7046 /// Sets the value of [validate_only][crate::model::CreateCustomTargetTypeRequest::validate_only].
7047 ///
7048 /// # Example
7049 /// ```ignore,no_run
7050 /// # use google_cloud_deploy_v1::model::CreateCustomTargetTypeRequest;
7051 /// let x = CreateCustomTargetTypeRequest::new().set_validate_only(true);
7052 /// ```
7053 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7054 self.validate_only = v.into();
7055 self
7056 }
7057}
7058
7059impl wkt::message::Message for CreateCustomTargetTypeRequest {
7060 fn typename() -> &'static str {
7061 "type.googleapis.com/google.cloud.deploy.v1.CreateCustomTargetTypeRequest"
7062 }
7063}
7064
7065/// The request object for `UpdateCustomTargetType`.
7066#[derive(Clone, Default, PartialEq)]
7067#[non_exhaustive]
7068pub struct UpdateCustomTargetTypeRequest {
7069 /// Required. Field mask is used to specify the fields to be overwritten by the
7070 /// update in the `CustomTargetType` resource. The fields specified in the
7071 /// update_mask are relative to the resource, not the full request. A field
7072 /// will be overwritten if it's in the mask. If the user doesn't provide a mask
7073 /// then all fields are overwritten.
7074 pub update_mask: std::option::Option<wkt::FieldMask>,
7075
7076 /// Required. The `CustomTargetType` to update.
7077 pub custom_target_type: std::option::Option<crate::model::CustomTargetType>,
7078
7079 /// Optional. A request ID to identify requests. Specify a unique request ID
7080 /// so that if you must retry your request, the server knows to ignore the
7081 /// request if it has already been completed. The server guarantees that for
7082 /// at least 60 minutes after the first request.
7083 ///
7084 /// For example, consider a situation where you make an initial request and the
7085 /// request times out. If you make the request again with the same request ID,
7086 /// the server can check if original operation with the same request ID was
7087 /// received, and if so, will ignore the second request. This prevents clients
7088 /// from accidentally creating duplicate commitments.
7089 ///
7090 /// The request ID must be a valid UUID with the exception that zero UUID is
7091 /// not supported (00000000-0000-0000-0000-000000000000).
7092 pub request_id: std::string::String,
7093
7094 /// Optional. If set to true, updating a `CustomTargetType` that does not exist
7095 /// will result in the creation of a new `CustomTargetType`.
7096 pub allow_missing: bool,
7097
7098 /// Optional. If set to true, the request is validated and the user is provided
7099 /// with an expected result, but no actual change is made.
7100 pub validate_only: bool,
7101
7102 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7103}
7104
7105impl UpdateCustomTargetTypeRequest {
7106 /// Creates a new default instance.
7107 pub fn new() -> Self {
7108 std::default::Default::default()
7109 }
7110
7111 /// Sets the value of [update_mask][crate::model::UpdateCustomTargetTypeRequest::update_mask].
7112 ///
7113 /// # Example
7114 /// ```ignore,no_run
7115 /// # use google_cloud_deploy_v1::model::UpdateCustomTargetTypeRequest;
7116 /// use wkt::FieldMask;
7117 /// let x = UpdateCustomTargetTypeRequest::new().set_update_mask(FieldMask::default()/* use setters */);
7118 /// ```
7119 pub fn set_update_mask<T>(mut self, v: T) -> Self
7120 where
7121 T: std::convert::Into<wkt::FieldMask>,
7122 {
7123 self.update_mask = std::option::Option::Some(v.into());
7124 self
7125 }
7126
7127 /// Sets or clears the value of [update_mask][crate::model::UpdateCustomTargetTypeRequest::update_mask].
7128 ///
7129 /// # Example
7130 /// ```ignore,no_run
7131 /// # use google_cloud_deploy_v1::model::UpdateCustomTargetTypeRequest;
7132 /// use wkt::FieldMask;
7133 /// let x = UpdateCustomTargetTypeRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
7134 /// let x = UpdateCustomTargetTypeRequest::new().set_or_clear_update_mask(None::<FieldMask>);
7135 /// ```
7136 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
7137 where
7138 T: std::convert::Into<wkt::FieldMask>,
7139 {
7140 self.update_mask = v.map(|x| x.into());
7141 self
7142 }
7143
7144 /// Sets the value of [custom_target_type][crate::model::UpdateCustomTargetTypeRequest::custom_target_type].
7145 ///
7146 /// # Example
7147 /// ```ignore,no_run
7148 /// # use google_cloud_deploy_v1::model::UpdateCustomTargetTypeRequest;
7149 /// use google_cloud_deploy_v1::model::CustomTargetType;
7150 /// let x = UpdateCustomTargetTypeRequest::new().set_custom_target_type(CustomTargetType::default()/* use setters */);
7151 /// ```
7152 pub fn set_custom_target_type<T>(mut self, v: T) -> Self
7153 where
7154 T: std::convert::Into<crate::model::CustomTargetType>,
7155 {
7156 self.custom_target_type = std::option::Option::Some(v.into());
7157 self
7158 }
7159
7160 /// Sets or clears the value of [custom_target_type][crate::model::UpdateCustomTargetTypeRequest::custom_target_type].
7161 ///
7162 /// # Example
7163 /// ```ignore,no_run
7164 /// # use google_cloud_deploy_v1::model::UpdateCustomTargetTypeRequest;
7165 /// use google_cloud_deploy_v1::model::CustomTargetType;
7166 /// let x = UpdateCustomTargetTypeRequest::new().set_or_clear_custom_target_type(Some(CustomTargetType::default()/* use setters */));
7167 /// let x = UpdateCustomTargetTypeRequest::new().set_or_clear_custom_target_type(None::<CustomTargetType>);
7168 /// ```
7169 pub fn set_or_clear_custom_target_type<T>(mut self, v: std::option::Option<T>) -> Self
7170 where
7171 T: std::convert::Into<crate::model::CustomTargetType>,
7172 {
7173 self.custom_target_type = v.map(|x| x.into());
7174 self
7175 }
7176
7177 /// Sets the value of [request_id][crate::model::UpdateCustomTargetTypeRequest::request_id].
7178 ///
7179 /// # Example
7180 /// ```ignore,no_run
7181 /// # use google_cloud_deploy_v1::model::UpdateCustomTargetTypeRequest;
7182 /// let x = UpdateCustomTargetTypeRequest::new().set_request_id("example");
7183 /// ```
7184 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7185 self.request_id = v.into();
7186 self
7187 }
7188
7189 /// Sets the value of [allow_missing][crate::model::UpdateCustomTargetTypeRequest::allow_missing].
7190 ///
7191 /// # Example
7192 /// ```ignore,no_run
7193 /// # use google_cloud_deploy_v1::model::UpdateCustomTargetTypeRequest;
7194 /// let x = UpdateCustomTargetTypeRequest::new().set_allow_missing(true);
7195 /// ```
7196 pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7197 self.allow_missing = v.into();
7198 self
7199 }
7200
7201 /// Sets the value of [validate_only][crate::model::UpdateCustomTargetTypeRequest::validate_only].
7202 ///
7203 /// # Example
7204 /// ```ignore,no_run
7205 /// # use google_cloud_deploy_v1::model::UpdateCustomTargetTypeRequest;
7206 /// let x = UpdateCustomTargetTypeRequest::new().set_validate_only(true);
7207 /// ```
7208 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7209 self.validate_only = v.into();
7210 self
7211 }
7212}
7213
7214impl wkt::message::Message for UpdateCustomTargetTypeRequest {
7215 fn typename() -> &'static str {
7216 "type.googleapis.com/google.cloud.deploy.v1.UpdateCustomTargetTypeRequest"
7217 }
7218}
7219
7220/// The request object for `DeleteCustomTargetType`.
7221#[derive(Clone, Default, PartialEq)]
7222#[non_exhaustive]
7223pub struct DeleteCustomTargetTypeRequest {
7224 /// Required. The name of the `CustomTargetType` to delete. Format must be
7225 /// `projects/{project_id}/locations/{location_name}/customTargetTypes/{custom_target_type}`.
7226 pub name: std::string::String,
7227
7228 /// Optional. A request ID to identify requests. Specify a unique request ID
7229 /// so that if you must retry your request, the server knows to ignore the
7230 /// request if it has already been completed. The server guarantees that for
7231 /// at least 60 minutes after the first request.
7232 ///
7233 /// For example, consider a situation where you make an initial request and the
7234 /// request times out. If you make the request again with the same request ID,
7235 /// the server can check if original operation with the same request ID was
7236 /// received, and if so, will ignore the second request. This prevents clients
7237 /// from accidentally creating duplicate commitments.
7238 ///
7239 /// The request ID must be a valid UUID with the exception that zero UUID is
7240 /// not supported (00000000-0000-0000-0000-000000000000).
7241 pub request_id: std::string::String,
7242
7243 /// Optional. If set to true, then deleting an already deleted or non-existing
7244 /// `CustomTargetType` will succeed.
7245 pub allow_missing: bool,
7246
7247 /// Optional. If set to true, the request is validated but no actual change is
7248 /// made.
7249 pub validate_only: bool,
7250
7251 /// Optional. This checksum is computed by the server based on the value of
7252 /// other fields, and may be sent on update and delete requests to ensure the
7253 /// client has an up-to-date value before proceeding.
7254 pub etag: std::string::String,
7255
7256 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7257}
7258
7259impl DeleteCustomTargetTypeRequest {
7260 /// Creates a new default instance.
7261 pub fn new() -> Self {
7262 std::default::Default::default()
7263 }
7264
7265 /// Sets the value of [name][crate::model::DeleteCustomTargetTypeRequest::name].
7266 ///
7267 /// # Example
7268 /// ```ignore,no_run
7269 /// # use google_cloud_deploy_v1::model::DeleteCustomTargetTypeRequest;
7270 /// # let project_id = "project_id";
7271 /// # let location_id = "location_id";
7272 /// # let custom_target_type_id = "custom_target_type_id";
7273 /// let x = DeleteCustomTargetTypeRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/customTargetTypes/{custom_target_type_id}"));
7274 /// ```
7275 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7276 self.name = v.into();
7277 self
7278 }
7279
7280 /// Sets the value of [request_id][crate::model::DeleteCustomTargetTypeRequest::request_id].
7281 ///
7282 /// # Example
7283 /// ```ignore,no_run
7284 /// # use google_cloud_deploy_v1::model::DeleteCustomTargetTypeRequest;
7285 /// let x = DeleteCustomTargetTypeRequest::new().set_request_id("example");
7286 /// ```
7287 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7288 self.request_id = v.into();
7289 self
7290 }
7291
7292 /// Sets the value of [allow_missing][crate::model::DeleteCustomTargetTypeRequest::allow_missing].
7293 ///
7294 /// # Example
7295 /// ```ignore,no_run
7296 /// # use google_cloud_deploy_v1::model::DeleteCustomTargetTypeRequest;
7297 /// let x = DeleteCustomTargetTypeRequest::new().set_allow_missing(true);
7298 /// ```
7299 pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7300 self.allow_missing = v.into();
7301 self
7302 }
7303
7304 /// Sets the value of [validate_only][crate::model::DeleteCustomTargetTypeRequest::validate_only].
7305 ///
7306 /// # Example
7307 /// ```ignore,no_run
7308 /// # use google_cloud_deploy_v1::model::DeleteCustomTargetTypeRequest;
7309 /// let x = DeleteCustomTargetTypeRequest::new().set_validate_only(true);
7310 /// ```
7311 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7312 self.validate_only = v.into();
7313 self
7314 }
7315
7316 /// Sets the value of [etag][crate::model::DeleteCustomTargetTypeRequest::etag].
7317 ///
7318 /// # Example
7319 /// ```ignore,no_run
7320 /// # use google_cloud_deploy_v1::model::DeleteCustomTargetTypeRequest;
7321 /// let x = DeleteCustomTargetTypeRequest::new().set_etag("example");
7322 /// ```
7323 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7324 self.etag = v.into();
7325 self
7326 }
7327}
7328
7329impl wkt::message::Message for DeleteCustomTargetTypeRequest {
7330 fn typename() -> &'static str {
7331 "type.googleapis.com/google.cloud.deploy.v1.DeleteCustomTargetTypeRequest"
7332 }
7333}
7334
7335/// A `DeployPolicy` resource in the Cloud Deploy API.
7336///
7337/// A `DeployPolicy` inhibits manual or automation-driven actions within a
7338/// Delivery Pipeline or Target.
7339#[derive(Clone, Default, PartialEq)]
7340#[non_exhaustive]
7341pub struct DeployPolicy {
7342 /// Output only. Name of the `DeployPolicy`. Format is
7343 /// `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`.
7344 /// The `deployPolicy` component must match `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`
7345 pub name: std::string::String,
7346
7347 /// Output only. Unique identifier of the `DeployPolicy`.
7348 pub uid: std::string::String,
7349
7350 /// Optional. Description of the `DeployPolicy`. Max length is 255 characters.
7351 pub description: std::string::String,
7352
7353 /// Optional. User annotations. These attributes can only be set and used by
7354 /// the user, and not by Cloud Deploy. Annotations must meet the following
7355 /// constraints:
7356 ///
7357 /// * Annotations are key/value pairs.
7358 /// * Valid annotation keys have two segments: an optional prefix and name,
7359 /// separated by a slash (`/`).
7360 /// * The name segment is required and must be 63 characters or less,
7361 /// beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with
7362 /// dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between.
7363 /// * The prefix is optional. If specified, the prefix must be a DNS subdomain:
7364 /// a series of DNS labels separated by dots(`.`), not longer than 253
7365 /// characters in total, followed by a slash (`/`).
7366 ///
7367 /// See
7368 /// <https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/#syntax-and-character-set>
7369 /// for more details.
7370 pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
7371
7372 /// Labels are attributes that can be set and used by both the
7373 /// user and by Cloud Deploy. Labels must meet the following constraints:
7374 ///
7375 /// * Keys and values can contain only lowercase letters, numeric characters,
7376 /// underscores, and dashes.
7377 /// * All characters must use UTF-8 encoding, and international characters are
7378 /// allowed.
7379 /// * Keys must start with a lowercase letter or international character.
7380 /// * Each resource is limited to a maximum of 64 labels.
7381 ///
7382 /// Both keys and values are additionally constrained to be <= 128 bytes.
7383 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
7384
7385 /// Output only. Time at which the deploy policy was created.
7386 pub create_time: std::option::Option<wkt::Timestamp>,
7387
7388 /// Output only. Most recent time at which the deploy policy was updated.
7389 pub update_time: std::option::Option<wkt::Timestamp>,
7390
7391 /// Optional. When suspended, the policy will not prevent actions from
7392 /// occurring, even if the action violates the policy.
7393 pub suspended: bool,
7394
7395 /// Required. Selected resources to which the policy will be applied. At least
7396 /// one selector is required. If one selector matches the resource the policy
7397 /// applies. For example, if there are two selectors and the action being
7398 /// attempted matches one of them, the policy will apply to that action.
7399 pub selectors: std::vec::Vec<crate::model::DeployPolicyResourceSelector>,
7400
7401 /// Required. Rules to apply. At least one rule must be present.
7402 pub rules: std::vec::Vec<crate::model::PolicyRule>,
7403
7404 /// The weak etag of the `DeployPolicy` resource.
7405 /// This checksum is computed by the server based on the value of other
7406 /// fields, and may be sent on update and delete requests to ensure the
7407 /// client has an up-to-date value before proceeding.
7408 pub etag: std::string::String,
7409
7410 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7411}
7412
7413impl DeployPolicy {
7414 /// Creates a new default instance.
7415 pub fn new() -> Self {
7416 std::default::Default::default()
7417 }
7418
7419 /// Sets the value of [name][crate::model::DeployPolicy::name].
7420 ///
7421 /// # Example
7422 /// ```ignore,no_run
7423 /// # use google_cloud_deploy_v1::model::DeployPolicy;
7424 /// # let project_id = "project_id";
7425 /// # let location_id = "location_id";
7426 /// # let deploy_policy_id = "deploy_policy_id";
7427 /// let x = DeployPolicy::new().set_name(format!("projects/{project_id}/locations/{location_id}/deployPolicies/{deploy_policy_id}"));
7428 /// ```
7429 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7430 self.name = v.into();
7431 self
7432 }
7433
7434 /// Sets the value of [uid][crate::model::DeployPolicy::uid].
7435 ///
7436 /// # Example
7437 /// ```ignore,no_run
7438 /// # use google_cloud_deploy_v1::model::DeployPolicy;
7439 /// let x = DeployPolicy::new().set_uid("example");
7440 /// ```
7441 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7442 self.uid = v.into();
7443 self
7444 }
7445
7446 /// Sets the value of [description][crate::model::DeployPolicy::description].
7447 ///
7448 /// # Example
7449 /// ```ignore,no_run
7450 /// # use google_cloud_deploy_v1::model::DeployPolicy;
7451 /// let x = DeployPolicy::new().set_description("example");
7452 /// ```
7453 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7454 self.description = v.into();
7455 self
7456 }
7457
7458 /// Sets the value of [annotations][crate::model::DeployPolicy::annotations].
7459 ///
7460 /// # Example
7461 /// ```ignore,no_run
7462 /// # use google_cloud_deploy_v1::model::DeployPolicy;
7463 /// let x = DeployPolicy::new().set_annotations([
7464 /// ("key0", "abc"),
7465 /// ("key1", "xyz"),
7466 /// ]);
7467 /// ```
7468 pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
7469 where
7470 T: std::iter::IntoIterator<Item = (K, V)>,
7471 K: std::convert::Into<std::string::String>,
7472 V: std::convert::Into<std::string::String>,
7473 {
7474 use std::iter::Iterator;
7475 self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7476 self
7477 }
7478
7479 /// Sets the value of [labels][crate::model::DeployPolicy::labels].
7480 ///
7481 /// # Example
7482 /// ```ignore,no_run
7483 /// # use google_cloud_deploy_v1::model::DeployPolicy;
7484 /// let x = DeployPolicy::new().set_labels([
7485 /// ("key0", "abc"),
7486 /// ("key1", "xyz"),
7487 /// ]);
7488 /// ```
7489 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
7490 where
7491 T: std::iter::IntoIterator<Item = (K, V)>,
7492 K: std::convert::Into<std::string::String>,
7493 V: std::convert::Into<std::string::String>,
7494 {
7495 use std::iter::Iterator;
7496 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7497 self
7498 }
7499
7500 /// Sets the value of [create_time][crate::model::DeployPolicy::create_time].
7501 ///
7502 /// # Example
7503 /// ```ignore,no_run
7504 /// # use google_cloud_deploy_v1::model::DeployPolicy;
7505 /// use wkt::Timestamp;
7506 /// let x = DeployPolicy::new().set_create_time(Timestamp::default()/* use setters */);
7507 /// ```
7508 pub fn set_create_time<T>(mut self, v: T) -> Self
7509 where
7510 T: std::convert::Into<wkt::Timestamp>,
7511 {
7512 self.create_time = std::option::Option::Some(v.into());
7513 self
7514 }
7515
7516 /// Sets or clears the value of [create_time][crate::model::DeployPolicy::create_time].
7517 ///
7518 /// # Example
7519 /// ```ignore,no_run
7520 /// # use google_cloud_deploy_v1::model::DeployPolicy;
7521 /// use wkt::Timestamp;
7522 /// let x = DeployPolicy::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
7523 /// let x = DeployPolicy::new().set_or_clear_create_time(None::<Timestamp>);
7524 /// ```
7525 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
7526 where
7527 T: std::convert::Into<wkt::Timestamp>,
7528 {
7529 self.create_time = v.map(|x| x.into());
7530 self
7531 }
7532
7533 /// Sets the value of [update_time][crate::model::DeployPolicy::update_time].
7534 ///
7535 /// # Example
7536 /// ```ignore,no_run
7537 /// # use google_cloud_deploy_v1::model::DeployPolicy;
7538 /// use wkt::Timestamp;
7539 /// let x = DeployPolicy::new().set_update_time(Timestamp::default()/* use setters */);
7540 /// ```
7541 pub fn set_update_time<T>(mut self, v: T) -> Self
7542 where
7543 T: std::convert::Into<wkt::Timestamp>,
7544 {
7545 self.update_time = std::option::Option::Some(v.into());
7546 self
7547 }
7548
7549 /// Sets or clears the value of [update_time][crate::model::DeployPolicy::update_time].
7550 ///
7551 /// # Example
7552 /// ```ignore,no_run
7553 /// # use google_cloud_deploy_v1::model::DeployPolicy;
7554 /// use wkt::Timestamp;
7555 /// let x = DeployPolicy::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
7556 /// let x = DeployPolicy::new().set_or_clear_update_time(None::<Timestamp>);
7557 /// ```
7558 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
7559 where
7560 T: std::convert::Into<wkt::Timestamp>,
7561 {
7562 self.update_time = v.map(|x| x.into());
7563 self
7564 }
7565
7566 /// Sets the value of [suspended][crate::model::DeployPolicy::suspended].
7567 ///
7568 /// # Example
7569 /// ```ignore,no_run
7570 /// # use google_cloud_deploy_v1::model::DeployPolicy;
7571 /// let x = DeployPolicy::new().set_suspended(true);
7572 /// ```
7573 pub fn set_suspended<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7574 self.suspended = v.into();
7575 self
7576 }
7577
7578 /// Sets the value of [selectors][crate::model::DeployPolicy::selectors].
7579 ///
7580 /// # Example
7581 /// ```ignore,no_run
7582 /// # use google_cloud_deploy_v1::model::DeployPolicy;
7583 /// use google_cloud_deploy_v1::model::DeployPolicyResourceSelector;
7584 /// let x = DeployPolicy::new()
7585 /// .set_selectors([
7586 /// DeployPolicyResourceSelector::default()/* use setters */,
7587 /// DeployPolicyResourceSelector::default()/* use (different) setters */,
7588 /// ]);
7589 /// ```
7590 pub fn set_selectors<T, V>(mut self, v: T) -> Self
7591 where
7592 T: std::iter::IntoIterator<Item = V>,
7593 V: std::convert::Into<crate::model::DeployPolicyResourceSelector>,
7594 {
7595 use std::iter::Iterator;
7596 self.selectors = v.into_iter().map(|i| i.into()).collect();
7597 self
7598 }
7599
7600 /// Sets the value of [rules][crate::model::DeployPolicy::rules].
7601 ///
7602 /// # Example
7603 /// ```ignore,no_run
7604 /// # use google_cloud_deploy_v1::model::DeployPolicy;
7605 /// use google_cloud_deploy_v1::model::PolicyRule;
7606 /// let x = DeployPolicy::new()
7607 /// .set_rules([
7608 /// PolicyRule::default()/* use setters */,
7609 /// PolicyRule::default()/* use (different) setters */,
7610 /// ]);
7611 /// ```
7612 pub fn set_rules<T, V>(mut self, v: T) -> Self
7613 where
7614 T: std::iter::IntoIterator<Item = V>,
7615 V: std::convert::Into<crate::model::PolicyRule>,
7616 {
7617 use std::iter::Iterator;
7618 self.rules = v.into_iter().map(|i| i.into()).collect();
7619 self
7620 }
7621
7622 /// Sets the value of [etag][crate::model::DeployPolicy::etag].
7623 ///
7624 /// # Example
7625 /// ```ignore,no_run
7626 /// # use google_cloud_deploy_v1::model::DeployPolicy;
7627 /// let x = DeployPolicy::new().set_etag("example");
7628 /// ```
7629 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7630 self.etag = v.into();
7631 self
7632 }
7633}
7634
7635impl wkt::message::Message for DeployPolicy {
7636 fn typename() -> &'static str {
7637 "type.googleapis.com/google.cloud.deploy.v1.DeployPolicy"
7638 }
7639}
7640
7641/// Defines additional types related to [DeployPolicy].
7642pub mod deploy_policy {
7643 #[allow(unused_imports)]
7644 use super::*;
7645
7646 /// What invoked the action. Filters enforcing the policy depending on what
7647 /// invoked the action.
7648 ///
7649 /// # Working with unknown values
7650 ///
7651 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7652 /// additional enum variants at any time. Adding new variants is not considered
7653 /// a breaking change. Applications should write their code in anticipation of:
7654 ///
7655 /// - New values appearing in future releases of the client library, **and**
7656 /// - New values received dynamically, without application changes.
7657 ///
7658 /// Please consult the [Working with enums] section in the user guide for some
7659 /// guidelines.
7660 ///
7661 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
7662 #[derive(Clone, Debug, PartialEq)]
7663 #[non_exhaustive]
7664 pub enum Invoker {
7665 /// Unspecified.
7666 Unspecified,
7667 /// The action is user-driven. For example, creating a rollout manually via a
7668 /// gcloud create command.
7669 User,
7670 /// Automated action by Cloud Deploy.
7671 DeployAutomation,
7672 /// If set, the enum was initialized with an unknown value.
7673 ///
7674 /// Applications can examine the value using [Invoker::value] or
7675 /// [Invoker::name].
7676 UnknownValue(invoker::UnknownValue),
7677 }
7678
7679 #[doc(hidden)]
7680 pub mod invoker {
7681 #[allow(unused_imports)]
7682 use super::*;
7683 #[derive(Clone, Debug, PartialEq)]
7684 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7685 }
7686
7687 impl Invoker {
7688 /// Gets the enum value.
7689 ///
7690 /// Returns `None` if the enum contains an unknown value deserialized from
7691 /// the string representation of enums.
7692 pub fn value(&self) -> std::option::Option<i32> {
7693 match self {
7694 Self::Unspecified => std::option::Option::Some(0),
7695 Self::User => std::option::Option::Some(1),
7696 Self::DeployAutomation => std::option::Option::Some(2),
7697 Self::UnknownValue(u) => u.0.value(),
7698 }
7699 }
7700
7701 /// Gets the enum value as a string.
7702 ///
7703 /// Returns `None` if the enum contains an unknown value deserialized from
7704 /// the integer representation of enums.
7705 pub fn name(&self) -> std::option::Option<&str> {
7706 match self {
7707 Self::Unspecified => std::option::Option::Some("INVOKER_UNSPECIFIED"),
7708 Self::User => std::option::Option::Some("USER"),
7709 Self::DeployAutomation => std::option::Option::Some("DEPLOY_AUTOMATION"),
7710 Self::UnknownValue(u) => u.0.name(),
7711 }
7712 }
7713 }
7714
7715 impl std::default::Default for Invoker {
7716 fn default() -> Self {
7717 use std::convert::From;
7718 Self::from(0)
7719 }
7720 }
7721
7722 impl std::fmt::Display for Invoker {
7723 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7724 wkt::internal::display_enum(f, self.name(), self.value())
7725 }
7726 }
7727
7728 impl std::convert::From<i32> for Invoker {
7729 fn from(value: i32) -> Self {
7730 match value {
7731 0 => Self::Unspecified,
7732 1 => Self::User,
7733 2 => Self::DeployAutomation,
7734 _ => Self::UnknownValue(invoker::UnknownValue(
7735 wkt::internal::UnknownEnumValue::Integer(value),
7736 )),
7737 }
7738 }
7739 }
7740
7741 impl std::convert::From<&str> for Invoker {
7742 fn from(value: &str) -> Self {
7743 use std::string::ToString;
7744 match value {
7745 "INVOKER_UNSPECIFIED" => Self::Unspecified,
7746 "USER" => Self::User,
7747 "DEPLOY_AUTOMATION" => Self::DeployAutomation,
7748 _ => Self::UnknownValue(invoker::UnknownValue(
7749 wkt::internal::UnknownEnumValue::String(value.to_string()),
7750 )),
7751 }
7752 }
7753 }
7754
7755 impl serde::ser::Serialize for Invoker {
7756 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7757 where
7758 S: serde::Serializer,
7759 {
7760 match self {
7761 Self::Unspecified => serializer.serialize_i32(0),
7762 Self::User => serializer.serialize_i32(1),
7763 Self::DeployAutomation => serializer.serialize_i32(2),
7764 Self::UnknownValue(u) => u.0.serialize(serializer),
7765 }
7766 }
7767 }
7768
7769 impl<'de> serde::de::Deserialize<'de> for Invoker {
7770 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7771 where
7772 D: serde::Deserializer<'de>,
7773 {
7774 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Invoker>::new(
7775 ".google.cloud.deploy.v1.DeployPolicy.Invoker",
7776 ))
7777 }
7778 }
7779}
7780
7781/// Contains information on the resources to select for a deploy policy.
7782/// Attributes provided must all match the resource in order for policy
7783/// restrictions to apply. For example, if delivery pipelines attributes given
7784/// are an id "prod" and labels "foo: bar", a delivery pipeline resource must
7785/// match both that id and have that label in order to be subject to the policy.
7786#[derive(Clone, Default, PartialEq)]
7787#[non_exhaustive]
7788pub struct DeployPolicyResourceSelector {
7789 /// Optional. Contains attributes about a delivery pipeline.
7790 pub delivery_pipeline: std::option::Option<crate::model::DeliveryPipelineAttribute>,
7791
7792 /// Optional. Contains attributes about a target.
7793 pub target: std::option::Option<crate::model::TargetAttribute>,
7794
7795 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7796}
7797
7798impl DeployPolicyResourceSelector {
7799 /// Creates a new default instance.
7800 pub fn new() -> Self {
7801 std::default::Default::default()
7802 }
7803
7804 /// Sets the value of [delivery_pipeline][crate::model::DeployPolicyResourceSelector::delivery_pipeline].
7805 ///
7806 /// # Example
7807 /// ```ignore,no_run
7808 /// # use google_cloud_deploy_v1::model::DeployPolicyResourceSelector;
7809 /// use google_cloud_deploy_v1::model::DeliveryPipelineAttribute;
7810 /// let x = DeployPolicyResourceSelector::new().set_delivery_pipeline(DeliveryPipelineAttribute::default()/* use setters */);
7811 /// ```
7812 pub fn set_delivery_pipeline<T>(mut self, v: T) -> Self
7813 where
7814 T: std::convert::Into<crate::model::DeliveryPipelineAttribute>,
7815 {
7816 self.delivery_pipeline = std::option::Option::Some(v.into());
7817 self
7818 }
7819
7820 /// Sets or clears the value of [delivery_pipeline][crate::model::DeployPolicyResourceSelector::delivery_pipeline].
7821 ///
7822 /// # Example
7823 /// ```ignore,no_run
7824 /// # use google_cloud_deploy_v1::model::DeployPolicyResourceSelector;
7825 /// use google_cloud_deploy_v1::model::DeliveryPipelineAttribute;
7826 /// let x = DeployPolicyResourceSelector::new().set_or_clear_delivery_pipeline(Some(DeliveryPipelineAttribute::default()/* use setters */));
7827 /// let x = DeployPolicyResourceSelector::new().set_or_clear_delivery_pipeline(None::<DeliveryPipelineAttribute>);
7828 /// ```
7829 pub fn set_or_clear_delivery_pipeline<T>(mut self, v: std::option::Option<T>) -> Self
7830 where
7831 T: std::convert::Into<crate::model::DeliveryPipelineAttribute>,
7832 {
7833 self.delivery_pipeline = v.map(|x| x.into());
7834 self
7835 }
7836
7837 /// Sets the value of [target][crate::model::DeployPolicyResourceSelector::target].
7838 ///
7839 /// # Example
7840 /// ```ignore,no_run
7841 /// # use google_cloud_deploy_v1::model::DeployPolicyResourceSelector;
7842 /// use google_cloud_deploy_v1::model::TargetAttribute;
7843 /// let x = DeployPolicyResourceSelector::new().set_target(TargetAttribute::default()/* use setters */);
7844 /// ```
7845 pub fn set_target<T>(mut self, v: T) -> Self
7846 where
7847 T: std::convert::Into<crate::model::TargetAttribute>,
7848 {
7849 self.target = std::option::Option::Some(v.into());
7850 self
7851 }
7852
7853 /// Sets or clears the value of [target][crate::model::DeployPolicyResourceSelector::target].
7854 ///
7855 /// # Example
7856 /// ```ignore,no_run
7857 /// # use google_cloud_deploy_v1::model::DeployPolicyResourceSelector;
7858 /// use google_cloud_deploy_v1::model::TargetAttribute;
7859 /// let x = DeployPolicyResourceSelector::new().set_or_clear_target(Some(TargetAttribute::default()/* use setters */));
7860 /// let x = DeployPolicyResourceSelector::new().set_or_clear_target(None::<TargetAttribute>);
7861 /// ```
7862 pub fn set_or_clear_target<T>(mut self, v: std::option::Option<T>) -> Self
7863 where
7864 T: std::convert::Into<crate::model::TargetAttribute>,
7865 {
7866 self.target = v.map(|x| x.into());
7867 self
7868 }
7869}
7870
7871impl wkt::message::Message for DeployPolicyResourceSelector {
7872 fn typename() -> &'static str {
7873 "type.googleapis.com/google.cloud.deploy.v1.DeployPolicyResourceSelector"
7874 }
7875}
7876
7877/// Contains criteria for selecting DeliveryPipelines.
7878#[derive(Clone, Default, PartialEq)]
7879#[non_exhaustive]
7880pub struct DeliveryPipelineAttribute {
7881 /// Optional. ID of the `DeliveryPipeline`. The value of this field could be
7882 /// one of the following:
7883 ///
7884 /// * The last segment of a pipeline name
7885 /// * "*", all delivery pipelines in a location
7886 pub id: std::string::String,
7887
7888 /// DeliveryPipeline labels.
7889 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
7890
7891 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7892}
7893
7894impl DeliveryPipelineAttribute {
7895 /// Creates a new default instance.
7896 pub fn new() -> Self {
7897 std::default::Default::default()
7898 }
7899
7900 /// Sets the value of [id][crate::model::DeliveryPipelineAttribute::id].
7901 ///
7902 /// # Example
7903 /// ```ignore,no_run
7904 /// # use google_cloud_deploy_v1::model::DeliveryPipelineAttribute;
7905 /// let x = DeliveryPipelineAttribute::new().set_id("example");
7906 /// ```
7907 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7908 self.id = v.into();
7909 self
7910 }
7911
7912 /// Sets the value of [labels][crate::model::DeliveryPipelineAttribute::labels].
7913 ///
7914 /// # Example
7915 /// ```ignore,no_run
7916 /// # use google_cloud_deploy_v1::model::DeliveryPipelineAttribute;
7917 /// let x = DeliveryPipelineAttribute::new().set_labels([
7918 /// ("key0", "abc"),
7919 /// ("key1", "xyz"),
7920 /// ]);
7921 /// ```
7922 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
7923 where
7924 T: std::iter::IntoIterator<Item = (K, V)>,
7925 K: std::convert::Into<std::string::String>,
7926 V: std::convert::Into<std::string::String>,
7927 {
7928 use std::iter::Iterator;
7929 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7930 self
7931 }
7932}
7933
7934impl wkt::message::Message for DeliveryPipelineAttribute {
7935 fn typename() -> &'static str {
7936 "type.googleapis.com/google.cloud.deploy.v1.DeliveryPipelineAttribute"
7937 }
7938}
7939
7940/// Contains criteria for selecting Targets. This could be used to select targets
7941/// for a Deploy Policy or for an Automation.
7942#[derive(Clone, Default, PartialEq)]
7943#[non_exhaustive]
7944pub struct TargetAttribute {
7945 /// Optional. ID of the `Target`. The value of this field could be one of the
7946 /// following:
7947 ///
7948 /// * The last segment of a target name
7949 /// * "*", all targets in a location
7950 pub id: std::string::String,
7951
7952 /// Target labels.
7953 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
7954
7955 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7956}
7957
7958impl TargetAttribute {
7959 /// Creates a new default instance.
7960 pub fn new() -> Self {
7961 std::default::Default::default()
7962 }
7963
7964 /// Sets the value of [id][crate::model::TargetAttribute::id].
7965 ///
7966 /// # Example
7967 /// ```ignore,no_run
7968 /// # use google_cloud_deploy_v1::model::TargetAttribute;
7969 /// let x = TargetAttribute::new().set_id("example");
7970 /// ```
7971 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7972 self.id = v.into();
7973 self
7974 }
7975
7976 /// Sets the value of [labels][crate::model::TargetAttribute::labels].
7977 ///
7978 /// # Example
7979 /// ```ignore,no_run
7980 /// # use google_cloud_deploy_v1::model::TargetAttribute;
7981 /// let x = TargetAttribute::new().set_labels([
7982 /// ("key0", "abc"),
7983 /// ("key1", "xyz"),
7984 /// ]);
7985 /// ```
7986 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
7987 where
7988 T: std::iter::IntoIterator<Item = (K, V)>,
7989 K: std::convert::Into<std::string::String>,
7990 V: std::convert::Into<std::string::String>,
7991 {
7992 use std::iter::Iterator;
7993 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7994 self
7995 }
7996}
7997
7998impl wkt::message::Message for TargetAttribute {
7999 fn typename() -> &'static str {
8000 "type.googleapis.com/google.cloud.deploy.v1.TargetAttribute"
8001 }
8002}
8003
8004/// Deploy Policy rule.
8005#[derive(Clone, Default, PartialEq)]
8006#[non_exhaustive]
8007pub struct PolicyRule {
8008 #[allow(missing_docs)]
8009 pub rule: std::option::Option<crate::model::policy_rule::Rule>,
8010
8011 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8012}
8013
8014impl PolicyRule {
8015 /// Creates a new default instance.
8016 pub fn new() -> Self {
8017 std::default::Default::default()
8018 }
8019
8020 /// Sets the value of [rule][crate::model::PolicyRule::rule].
8021 ///
8022 /// Note that all the setters affecting `rule` are mutually
8023 /// exclusive.
8024 ///
8025 /// # Example
8026 /// ```ignore,no_run
8027 /// # use google_cloud_deploy_v1::model::PolicyRule;
8028 /// use google_cloud_deploy_v1::model::RolloutRestriction;
8029 /// let x = PolicyRule::new().set_rule(Some(
8030 /// google_cloud_deploy_v1::model::policy_rule::Rule::RolloutRestriction(RolloutRestriction::default().into())));
8031 /// ```
8032 pub fn set_rule<T: std::convert::Into<std::option::Option<crate::model::policy_rule::Rule>>>(
8033 mut self,
8034 v: T,
8035 ) -> Self {
8036 self.rule = v.into();
8037 self
8038 }
8039
8040 /// The value of [rule][crate::model::PolicyRule::rule]
8041 /// if it holds a `RolloutRestriction`, `None` if the field is not set or
8042 /// holds a different branch.
8043 pub fn rollout_restriction(
8044 &self,
8045 ) -> std::option::Option<&std::boxed::Box<crate::model::RolloutRestriction>> {
8046 #[allow(unreachable_patterns)]
8047 self.rule.as_ref().and_then(|v| match v {
8048 crate::model::policy_rule::Rule::RolloutRestriction(v) => std::option::Option::Some(v),
8049 _ => std::option::Option::None,
8050 })
8051 }
8052
8053 /// Sets the value of [rule][crate::model::PolicyRule::rule]
8054 /// to hold a `RolloutRestriction`.
8055 ///
8056 /// Note that all the setters affecting `rule` are
8057 /// mutually exclusive.
8058 ///
8059 /// # Example
8060 /// ```ignore,no_run
8061 /// # use google_cloud_deploy_v1::model::PolicyRule;
8062 /// use google_cloud_deploy_v1::model::RolloutRestriction;
8063 /// let x = PolicyRule::new().set_rollout_restriction(RolloutRestriction::default()/* use setters */);
8064 /// assert!(x.rollout_restriction().is_some());
8065 /// ```
8066 pub fn set_rollout_restriction<
8067 T: std::convert::Into<std::boxed::Box<crate::model::RolloutRestriction>>,
8068 >(
8069 mut self,
8070 v: T,
8071 ) -> Self {
8072 self.rule = std::option::Option::Some(crate::model::policy_rule::Rule::RolloutRestriction(
8073 v.into(),
8074 ));
8075 self
8076 }
8077}
8078
8079impl wkt::message::Message for PolicyRule {
8080 fn typename() -> &'static str {
8081 "type.googleapis.com/google.cloud.deploy.v1.PolicyRule"
8082 }
8083}
8084
8085/// Defines additional types related to [PolicyRule].
8086pub mod policy_rule {
8087 #[allow(unused_imports)]
8088 use super::*;
8089
8090 #[allow(missing_docs)]
8091 #[derive(Clone, Debug, PartialEq)]
8092 #[non_exhaustive]
8093 pub enum Rule {
8094 /// Optional. Rollout restrictions.
8095 RolloutRestriction(std::boxed::Box<crate::model::RolloutRestriction>),
8096 }
8097}
8098
8099/// Rollout restrictions.
8100#[derive(Clone, Default, PartialEq)]
8101#[non_exhaustive]
8102pub struct RolloutRestriction {
8103 /// Required. Restriction rule ID. Required and must be unique within a
8104 /// DeployPolicy. The format is `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`.
8105 pub id: std::string::String,
8106
8107 /// Optional. What invoked the action. If left empty, all invoker types will be
8108 /// restricted.
8109 pub invokers: std::vec::Vec<crate::model::deploy_policy::Invoker>,
8110
8111 /// Optional. Rollout actions to be restricted as part of the policy. If left
8112 /// empty, all actions will be restricted.
8113 pub actions: std::vec::Vec<crate::model::rollout_restriction::RolloutActions>,
8114
8115 /// Required. Time window within which actions are restricted.
8116 pub time_windows: std::option::Option<crate::model::TimeWindows>,
8117
8118 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8119}
8120
8121impl RolloutRestriction {
8122 /// Creates a new default instance.
8123 pub fn new() -> Self {
8124 std::default::Default::default()
8125 }
8126
8127 /// Sets the value of [id][crate::model::RolloutRestriction::id].
8128 ///
8129 /// # Example
8130 /// ```ignore,no_run
8131 /// # use google_cloud_deploy_v1::model::RolloutRestriction;
8132 /// let x = RolloutRestriction::new().set_id("example");
8133 /// ```
8134 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8135 self.id = v.into();
8136 self
8137 }
8138
8139 /// Sets the value of [invokers][crate::model::RolloutRestriction::invokers].
8140 ///
8141 /// # Example
8142 /// ```ignore,no_run
8143 /// # use google_cloud_deploy_v1::model::RolloutRestriction;
8144 /// use google_cloud_deploy_v1::model::deploy_policy::Invoker;
8145 /// let x = RolloutRestriction::new().set_invokers([
8146 /// Invoker::User,
8147 /// Invoker::DeployAutomation,
8148 /// ]);
8149 /// ```
8150 pub fn set_invokers<T, V>(mut self, v: T) -> Self
8151 where
8152 T: std::iter::IntoIterator<Item = V>,
8153 V: std::convert::Into<crate::model::deploy_policy::Invoker>,
8154 {
8155 use std::iter::Iterator;
8156 self.invokers = v.into_iter().map(|i| i.into()).collect();
8157 self
8158 }
8159
8160 /// Sets the value of [actions][crate::model::RolloutRestriction::actions].
8161 ///
8162 /// # Example
8163 /// ```ignore,no_run
8164 /// # use google_cloud_deploy_v1::model::RolloutRestriction;
8165 /// use google_cloud_deploy_v1::model::rollout_restriction::RolloutActions;
8166 /// let x = RolloutRestriction::new().set_actions([
8167 /// RolloutActions::Advance,
8168 /// RolloutActions::Approve,
8169 /// RolloutActions::Cancel,
8170 /// ]);
8171 /// ```
8172 pub fn set_actions<T, V>(mut self, v: T) -> Self
8173 where
8174 T: std::iter::IntoIterator<Item = V>,
8175 V: std::convert::Into<crate::model::rollout_restriction::RolloutActions>,
8176 {
8177 use std::iter::Iterator;
8178 self.actions = v.into_iter().map(|i| i.into()).collect();
8179 self
8180 }
8181
8182 /// Sets the value of [time_windows][crate::model::RolloutRestriction::time_windows].
8183 ///
8184 /// # Example
8185 /// ```ignore,no_run
8186 /// # use google_cloud_deploy_v1::model::RolloutRestriction;
8187 /// use google_cloud_deploy_v1::model::TimeWindows;
8188 /// let x = RolloutRestriction::new().set_time_windows(TimeWindows::default()/* use setters */);
8189 /// ```
8190 pub fn set_time_windows<T>(mut self, v: T) -> Self
8191 where
8192 T: std::convert::Into<crate::model::TimeWindows>,
8193 {
8194 self.time_windows = std::option::Option::Some(v.into());
8195 self
8196 }
8197
8198 /// Sets or clears the value of [time_windows][crate::model::RolloutRestriction::time_windows].
8199 ///
8200 /// # Example
8201 /// ```ignore,no_run
8202 /// # use google_cloud_deploy_v1::model::RolloutRestriction;
8203 /// use google_cloud_deploy_v1::model::TimeWindows;
8204 /// let x = RolloutRestriction::new().set_or_clear_time_windows(Some(TimeWindows::default()/* use setters */));
8205 /// let x = RolloutRestriction::new().set_or_clear_time_windows(None::<TimeWindows>);
8206 /// ```
8207 pub fn set_or_clear_time_windows<T>(mut self, v: std::option::Option<T>) -> Self
8208 where
8209 T: std::convert::Into<crate::model::TimeWindows>,
8210 {
8211 self.time_windows = v.map(|x| x.into());
8212 self
8213 }
8214}
8215
8216impl wkt::message::Message for RolloutRestriction {
8217 fn typename() -> &'static str {
8218 "type.googleapis.com/google.cloud.deploy.v1.RolloutRestriction"
8219 }
8220}
8221
8222/// Defines additional types related to [RolloutRestriction].
8223pub mod rollout_restriction {
8224 #[allow(unused_imports)]
8225 use super::*;
8226
8227 /// Rollout actions to be restricted as part of the policy.
8228 ///
8229 /// # Working with unknown values
8230 ///
8231 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8232 /// additional enum variants at any time. Adding new variants is not considered
8233 /// a breaking change. Applications should write their code in anticipation of:
8234 ///
8235 /// - New values appearing in future releases of the client library, **and**
8236 /// - New values received dynamically, without application changes.
8237 ///
8238 /// Please consult the [Working with enums] section in the user guide for some
8239 /// guidelines.
8240 ///
8241 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
8242 #[derive(Clone, Debug, PartialEq)]
8243 #[non_exhaustive]
8244 pub enum RolloutActions {
8245 /// Unspecified.
8246 Unspecified,
8247 /// Advance the rollout to the next phase.
8248 Advance,
8249 /// Approve the rollout.
8250 Approve,
8251 /// Cancel the rollout.
8252 Cancel,
8253 /// Create a rollout.
8254 Create,
8255 /// Ignore a job result on the rollout.
8256 IgnoreJob,
8257 /// Retry a job for a rollout.
8258 RetryJob,
8259 /// Rollback a rollout.
8260 Rollback,
8261 /// Terminate a jobrun.
8262 TerminateJobrun,
8263 /// If set, the enum was initialized with an unknown value.
8264 ///
8265 /// Applications can examine the value using [RolloutActions::value] or
8266 /// [RolloutActions::name].
8267 UnknownValue(rollout_actions::UnknownValue),
8268 }
8269
8270 #[doc(hidden)]
8271 pub mod rollout_actions {
8272 #[allow(unused_imports)]
8273 use super::*;
8274 #[derive(Clone, Debug, PartialEq)]
8275 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8276 }
8277
8278 impl RolloutActions {
8279 /// Gets the enum value.
8280 ///
8281 /// Returns `None` if the enum contains an unknown value deserialized from
8282 /// the string representation of enums.
8283 pub fn value(&self) -> std::option::Option<i32> {
8284 match self {
8285 Self::Unspecified => std::option::Option::Some(0),
8286 Self::Advance => std::option::Option::Some(1),
8287 Self::Approve => std::option::Option::Some(2),
8288 Self::Cancel => std::option::Option::Some(3),
8289 Self::Create => std::option::Option::Some(4),
8290 Self::IgnoreJob => std::option::Option::Some(5),
8291 Self::RetryJob => std::option::Option::Some(6),
8292 Self::Rollback => std::option::Option::Some(7),
8293 Self::TerminateJobrun => std::option::Option::Some(8),
8294 Self::UnknownValue(u) => u.0.value(),
8295 }
8296 }
8297
8298 /// Gets the enum value as a string.
8299 ///
8300 /// Returns `None` if the enum contains an unknown value deserialized from
8301 /// the integer representation of enums.
8302 pub fn name(&self) -> std::option::Option<&str> {
8303 match self {
8304 Self::Unspecified => std::option::Option::Some("ROLLOUT_ACTIONS_UNSPECIFIED"),
8305 Self::Advance => std::option::Option::Some("ADVANCE"),
8306 Self::Approve => std::option::Option::Some("APPROVE"),
8307 Self::Cancel => std::option::Option::Some("CANCEL"),
8308 Self::Create => std::option::Option::Some("CREATE"),
8309 Self::IgnoreJob => std::option::Option::Some("IGNORE_JOB"),
8310 Self::RetryJob => std::option::Option::Some("RETRY_JOB"),
8311 Self::Rollback => std::option::Option::Some("ROLLBACK"),
8312 Self::TerminateJobrun => std::option::Option::Some("TERMINATE_JOBRUN"),
8313 Self::UnknownValue(u) => u.0.name(),
8314 }
8315 }
8316 }
8317
8318 impl std::default::Default for RolloutActions {
8319 fn default() -> Self {
8320 use std::convert::From;
8321 Self::from(0)
8322 }
8323 }
8324
8325 impl std::fmt::Display for RolloutActions {
8326 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8327 wkt::internal::display_enum(f, self.name(), self.value())
8328 }
8329 }
8330
8331 impl std::convert::From<i32> for RolloutActions {
8332 fn from(value: i32) -> Self {
8333 match value {
8334 0 => Self::Unspecified,
8335 1 => Self::Advance,
8336 2 => Self::Approve,
8337 3 => Self::Cancel,
8338 4 => Self::Create,
8339 5 => Self::IgnoreJob,
8340 6 => Self::RetryJob,
8341 7 => Self::Rollback,
8342 8 => Self::TerminateJobrun,
8343 _ => Self::UnknownValue(rollout_actions::UnknownValue(
8344 wkt::internal::UnknownEnumValue::Integer(value),
8345 )),
8346 }
8347 }
8348 }
8349
8350 impl std::convert::From<&str> for RolloutActions {
8351 fn from(value: &str) -> Self {
8352 use std::string::ToString;
8353 match value {
8354 "ROLLOUT_ACTIONS_UNSPECIFIED" => Self::Unspecified,
8355 "ADVANCE" => Self::Advance,
8356 "APPROVE" => Self::Approve,
8357 "CANCEL" => Self::Cancel,
8358 "CREATE" => Self::Create,
8359 "IGNORE_JOB" => Self::IgnoreJob,
8360 "RETRY_JOB" => Self::RetryJob,
8361 "ROLLBACK" => Self::Rollback,
8362 "TERMINATE_JOBRUN" => Self::TerminateJobrun,
8363 _ => Self::UnknownValue(rollout_actions::UnknownValue(
8364 wkt::internal::UnknownEnumValue::String(value.to_string()),
8365 )),
8366 }
8367 }
8368 }
8369
8370 impl serde::ser::Serialize for RolloutActions {
8371 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8372 where
8373 S: serde::Serializer,
8374 {
8375 match self {
8376 Self::Unspecified => serializer.serialize_i32(0),
8377 Self::Advance => serializer.serialize_i32(1),
8378 Self::Approve => serializer.serialize_i32(2),
8379 Self::Cancel => serializer.serialize_i32(3),
8380 Self::Create => serializer.serialize_i32(4),
8381 Self::IgnoreJob => serializer.serialize_i32(5),
8382 Self::RetryJob => serializer.serialize_i32(6),
8383 Self::Rollback => serializer.serialize_i32(7),
8384 Self::TerminateJobrun => serializer.serialize_i32(8),
8385 Self::UnknownValue(u) => u.0.serialize(serializer),
8386 }
8387 }
8388 }
8389
8390 impl<'de> serde::de::Deserialize<'de> for RolloutActions {
8391 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8392 where
8393 D: serde::Deserializer<'de>,
8394 {
8395 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RolloutActions>::new(
8396 ".google.cloud.deploy.v1.RolloutRestriction.RolloutActions",
8397 ))
8398 }
8399 }
8400}
8401
8402/// Time windows within which actions are restricted. See the
8403/// [documentation](https://cloud.google.com/deploy/docs/deploy-policy#dates_times)
8404/// for more information on how to configure dates/times.
8405#[derive(Clone, Default, PartialEq)]
8406#[non_exhaustive]
8407pub struct TimeWindows {
8408 /// Required. The time zone in IANA format [IANA Time Zone
8409 /// Database](https://www.iana.org/time-zones) (e.g. America/New_York).
8410 pub time_zone: std::string::String,
8411
8412 /// Optional. One-time windows within which actions are restricted.
8413 pub one_time_windows: std::vec::Vec<crate::model::OneTimeWindow>,
8414
8415 /// Optional. Recurring weekly windows within which actions are restricted.
8416 pub weekly_windows: std::vec::Vec<crate::model::WeeklyWindow>,
8417
8418 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8419}
8420
8421impl TimeWindows {
8422 /// Creates a new default instance.
8423 pub fn new() -> Self {
8424 std::default::Default::default()
8425 }
8426
8427 /// Sets the value of [time_zone][crate::model::TimeWindows::time_zone].
8428 ///
8429 /// # Example
8430 /// ```ignore,no_run
8431 /// # use google_cloud_deploy_v1::model::TimeWindows;
8432 /// let x = TimeWindows::new().set_time_zone("example");
8433 /// ```
8434 pub fn set_time_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8435 self.time_zone = v.into();
8436 self
8437 }
8438
8439 /// Sets the value of [one_time_windows][crate::model::TimeWindows::one_time_windows].
8440 ///
8441 /// # Example
8442 /// ```ignore,no_run
8443 /// # use google_cloud_deploy_v1::model::TimeWindows;
8444 /// use google_cloud_deploy_v1::model::OneTimeWindow;
8445 /// let x = TimeWindows::new()
8446 /// .set_one_time_windows([
8447 /// OneTimeWindow::default()/* use setters */,
8448 /// OneTimeWindow::default()/* use (different) setters */,
8449 /// ]);
8450 /// ```
8451 pub fn set_one_time_windows<T, V>(mut self, v: T) -> Self
8452 where
8453 T: std::iter::IntoIterator<Item = V>,
8454 V: std::convert::Into<crate::model::OneTimeWindow>,
8455 {
8456 use std::iter::Iterator;
8457 self.one_time_windows = v.into_iter().map(|i| i.into()).collect();
8458 self
8459 }
8460
8461 /// Sets the value of [weekly_windows][crate::model::TimeWindows::weekly_windows].
8462 ///
8463 /// # Example
8464 /// ```ignore,no_run
8465 /// # use google_cloud_deploy_v1::model::TimeWindows;
8466 /// use google_cloud_deploy_v1::model::WeeklyWindow;
8467 /// let x = TimeWindows::new()
8468 /// .set_weekly_windows([
8469 /// WeeklyWindow::default()/* use setters */,
8470 /// WeeklyWindow::default()/* use (different) setters */,
8471 /// ]);
8472 /// ```
8473 pub fn set_weekly_windows<T, V>(mut self, v: T) -> Self
8474 where
8475 T: std::iter::IntoIterator<Item = V>,
8476 V: std::convert::Into<crate::model::WeeklyWindow>,
8477 {
8478 use std::iter::Iterator;
8479 self.weekly_windows = v.into_iter().map(|i| i.into()).collect();
8480 self
8481 }
8482}
8483
8484impl wkt::message::Message for TimeWindows {
8485 fn typename() -> &'static str {
8486 "type.googleapis.com/google.cloud.deploy.v1.TimeWindows"
8487 }
8488}
8489
8490/// One-time window within which actions are restricted. For example, blocking
8491/// actions over New Year's Eve from December 31st at 5pm to January 1st at 9am.
8492#[derive(Clone, Default, PartialEq)]
8493#[non_exhaustive]
8494pub struct OneTimeWindow {
8495 /// Required. Start date.
8496 pub start_date: std::option::Option<google_cloud_type::model::Date>,
8497
8498 /// Required. Start time (inclusive). Use 00:00 for the beginning of the day.
8499 pub start_time: std::option::Option<google_cloud_type::model::TimeOfDay>,
8500
8501 /// Required. End date.
8502 pub end_date: std::option::Option<google_cloud_type::model::Date>,
8503
8504 /// Required. End time (exclusive). You may use 24:00 for the end of the day.
8505 pub end_time: std::option::Option<google_cloud_type::model::TimeOfDay>,
8506
8507 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8508}
8509
8510impl OneTimeWindow {
8511 /// Creates a new default instance.
8512 pub fn new() -> Self {
8513 std::default::Default::default()
8514 }
8515
8516 /// Sets the value of [start_date][crate::model::OneTimeWindow::start_date].
8517 ///
8518 /// # Example
8519 /// ```ignore,no_run
8520 /// # use google_cloud_deploy_v1::model::OneTimeWindow;
8521 /// use google_cloud_type::model::Date;
8522 /// let x = OneTimeWindow::new().set_start_date(Date::default()/* use setters */);
8523 /// ```
8524 pub fn set_start_date<T>(mut self, v: T) -> Self
8525 where
8526 T: std::convert::Into<google_cloud_type::model::Date>,
8527 {
8528 self.start_date = std::option::Option::Some(v.into());
8529 self
8530 }
8531
8532 /// Sets or clears the value of [start_date][crate::model::OneTimeWindow::start_date].
8533 ///
8534 /// # Example
8535 /// ```ignore,no_run
8536 /// # use google_cloud_deploy_v1::model::OneTimeWindow;
8537 /// use google_cloud_type::model::Date;
8538 /// let x = OneTimeWindow::new().set_or_clear_start_date(Some(Date::default()/* use setters */));
8539 /// let x = OneTimeWindow::new().set_or_clear_start_date(None::<Date>);
8540 /// ```
8541 pub fn set_or_clear_start_date<T>(mut self, v: std::option::Option<T>) -> Self
8542 where
8543 T: std::convert::Into<google_cloud_type::model::Date>,
8544 {
8545 self.start_date = v.map(|x| x.into());
8546 self
8547 }
8548
8549 /// Sets the value of [start_time][crate::model::OneTimeWindow::start_time].
8550 ///
8551 /// # Example
8552 /// ```ignore,no_run
8553 /// # use google_cloud_deploy_v1::model::OneTimeWindow;
8554 /// use google_cloud_type::model::TimeOfDay;
8555 /// let x = OneTimeWindow::new().set_start_time(TimeOfDay::default()/* use setters */);
8556 /// ```
8557 pub fn set_start_time<T>(mut self, v: T) -> Self
8558 where
8559 T: std::convert::Into<google_cloud_type::model::TimeOfDay>,
8560 {
8561 self.start_time = std::option::Option::Some(v.into());
8562 self
8563 }
8564
8565 /// Sets or clears the value of [start_time][crate::model::OneTimeWindow::start_time].
8566 ///
8567 /// # Example
8568 /// ```ignore,no_run
8569 /// # use google_cloud_deploy_v1::model::OneTimeWindow;
8570 /// use google_cloud_type::model::TimeOfDay;
8571 /// let x = OneTimeWindow::new().set_or_clear_start_time(Some(TimeOfDay::default()/* use setters */));
8572 /// let x = OneTimeWindow::new().set_or_clear_start_time(None::<TimeOfDay>);
8573 /// ```
8574 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
8575 where
8576 T: std::convert::Into<google_cloud_type::model::TimeOfDay>,
8577 {
8578 self.start_time = v.map(|x| x.into());
8579 self
8580 }
8581
8582 /// Sets the value of [end_date][crate::model::OneTimeWindow::end_date].
8583 ///
8584 /// # Example
8585 /// ```ignore,no_run
8586 /// # use google_cloud_deploy_v1::model::OneTimeWindow;
8587 /// use google_cloud_type::model::Date;
8588 /// let x = OneTimeWindow::new().set_end_date(Date::default()/* use setters */);
8589 /// ```
8590 pub fn set_end_date<T>(mut self, v: T) -> Self
8591 where
8592 T: std::convert::Into<google_cloud_type::model::Date>,
8593 {
8594 self.end_date = std::option::Option::Some(v.into());
8595 self
8596 }
8597
8598 /// Sets or clears the value of [end_date][crate::model::OneTimeWindow::end_date].
8599 ///
8600 /// # Example
8601 /// ```ignore,no_run
8602 /// # use google_cloud_deploy_v1::model::OneTimeWindow;
8603 /// use google_cloud_type::model::Date;
8604 /// let x = OneTimeWindow::new().set_or_clear_end_date(Some(Date::default()/* use setters */));
8605 /// let x = OneTimeWindow::new().set_or_clear_end_date(None::<Date>);
8606 /// ```
8607 pub fn set_or_clear_end_date<T>(mut self, v: std::option::Option<T>) -> Self
8608 where
8609 T: std::convert::Into<google_cloud_type::model::Date>,
8610 {
8611 self.end_date = v.map(|x| x.into());
8612 self
8613 }
8614
8615 /// Sets the value of [end_time][crate::model::OneTimeWindow::end_time].
8616 ///
8617 /// # Example
8618 /// ```ignore,no_run
8619 /// # use google_cloud_deploy_v1::model::OneTimeWindow;
8620 /// use google_cloud_type::model::TimeOfDay;
8621 /// let x = OneTimeWindow::new().set_end_time(TimeOfDay::default()/* use setters */);
8622 /// ```
8623 pub fn set_end_time<T>(mut self, v: T) -> Self
8624 where
8625 T: std::convert::Into<google_cloud_type::model::TimeOfDay>,
8626 {
8627 self.end_time = std::option::Option::Some(v.into());
8628 self
8629 }
8630
8631 /// Sets or clears the value of [end_time][crate::model::OneTimeWindow::end_time].
8632 ///
8633 /// # Example
8634 /// ```ignore,no_run
8635 /// # use google_cloud_deploy_v1::model::OneTimeWindow;
8636 /// use google_cloud_type::model::TimeOfDay;
8637 /// let x = OneTimeWindow::new().set_or_clear_end_time(Some(TimeOfDay::default()/* use setters */));
8638 /// let x = OneTimeWindow::new().set_or_clear_end_time(None::<TimeOfDay>);
8639 /// ```
8640 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
8641 where
8642 T: std::convert::Into<google_cloud_type::model::TimeOfDay>,
8643 {
8644 self.end_time = v.map(|x| x.into());
8645 self
8646 }
8647}
8648
8649impl wkt::message::Message for OneTimeWindow {
8650 fn typename() -> &'static str {
8651 "type.googleapis.com/google.cloud.deploy.v1.OneTimeWindow"
8652 }
8653}
8654
8655/// Weekly windows. For example, blocking actions every Saturday and Sunday.
8656/// Another example would be blocking actions every weekday from 5pm to midnight.
8657#[derive(Clone, Default, PartialEq)]
8658#[non_exhaustive]
8659pub struct WeeklyWindow {
8660 /// Optional. Days of week. If left empty, all days of the week will be
8661 /// included.
8662 pub days_of_week: std::vec::Vec<google_cloud_type::model::DayOfWeek>,
8663
8664 /// Optional. Start time (inclusive). Use 00:00 for the beginning of the day.
8665 /// If you specify start_time you must also specify end_time. If left empty,
8666 /// this will block for the entire day for the days specified in days_of_week.
8667 pub start_time: std::option::Option<google_cloud_type::model::TimeOfDay>,
8668
8669 /// Optional. End time (exclusive). Use 24:00 to indicate midnight. If you
8670 /// specify end_time you must also specify start_time. If left empty, this will
8671 /// block for the entire day for the days specified in days_of_week.
8672 pub end_time: std::option::Option<google_cloud_type::model::TimeOfDay>,
8673
8674 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8675}
8676
8677impl WeeklyWindow {
8678 /// Creates a new default instance.
8679 pub fn new() -> Self {
8680 std::default::Default::default()
8681 }
8682
8683 /// Sets the value of [days_of_week][crate::model::WeeklyWindow::days_of_week].
8684 ///
8685 /// # Example
8686 /// ```ignore,no_run
8687 /// # use google_cloud_deploy_v1::model::WeeklyWindow;
8688 /// use google_cloud_type::model::DayOfWeek;
8689 /// let x = WeeklyWindow::new().set_days_of_week([
8690 /// DayOfWeek::Monday,
8691 /// DayOfWeek::Tuesday,
8692 /// DayOfWeek::Wednesday,
8693 /// ]);
8694 /// ```
8695 pub fn set_days_of_week<T, V>(mut self, v: T) -> Self
8696 where
8697 T: std::iter::IntoIterator<Item = V>,
8698 V: std::convert::Into<google_cloud_type::model::DayOfWeek>,
8699 {
8700 use std::iter::Iterator;
8701 self.days_of_week = v.into_iter().map(|i| i.into()).collect();
8702 self
8703 }
8704
8705 /// Sets the value of [start_time][crate::model::WeeklyWindow::start_time].
8706 ///
8707 /// # Example
8708 /// ```ignore,no_run
8709 /// # use google_cloud_deploy_v1::model::WeeklyWindow;
8710 /// use google_cloud_type::model::TimeOfDay;
8711 /// let x = WeeklyWindow::new().set_start_time(TimeOfDay::default()/* use setters */);
8712 /// ```
8713 pub fn set_start_time<T>(mut self, v: T) -> Self
8714 where
8715 T: std::convert::Into<google_cloud_type::model::TimeOfDay>,
8716 {
8717 self.start_time = std::option::Option::Some(v.into());
8718 self
8719 }
8720
8721 /// Sets or clears the value of [start_time][crate::model::WeeklyWindow::start_time].
8722 ///
8723 /// # Example
8724 /// ```ignore,no_run
8725 /// # use google_cloud_deploy_v1::model::WeeklyWindow;
8726 /// use google_cloud_type::model::TimeOfDay;
8727 /// let x = WeeklyWindow::new().set_or_clear_start_time(Some(TimeOfDay::default()/* use setters */));
8728 /// let x = WeeklyWindow::new().set_or_clear_start_time(None::<TimeOfDay>);
8729 /// ```
8730 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
8731 where
8732 T: std::convert::Into<google_cloud_type::model::TimeOfDay>,
8733 {
8734 self.start_time = v.map(|x| x.into());
8735 self
8736 }
8737
8738 /// Sets the value of [end_time][crate::model::WeeklyWindow::end_time].
8739 ///
8740 /// # Example
8741 /// ```ignore,no_run
8742 /// # use google_cloud_deploy_v1::model::WeeklyWindow;
8743 /// use google_cloud_type::model::TimeOfDay;
8744 /// let x = WeeklyWindow::new().set_end_time(TimeOfDay::default()/* use setters */);
8745 /// ```
8746 pub fn set_end_time<T>(mut self, v: T) -> Self
8747 where
8748 T: std::convert::Into<google_cloud_type::model::TimeOfDay>,
8749 {
8750 self.end_time = std::option::Option::Some(v.into());
8751 self
8752 }
8753
8754 /// Sets or clears the value of [end_time][crate::model::WeeklyWindow::end_time].
8755 ///
8756 /// # Example
8757 /// ```ignore,no_run
8758 /// # use google_cloud_deploy_v1::model::WeeklyWindow;
8759 /// use google_cloud_type::model::TimeOfDay;
8760 /// let x = WeeklyWindow::new().set_or_clear_end_time(Some(TimeOfDay::default()/* use setters */));
8761 /// let x = WeeklyWindow::new().set_or_clear_end_time(None::<TimeOfDay>);
8762 /// ```
8763 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
8764 where
8765 T: std::convert::Into<google_cloud_type::model::TimeOfDay>,
8766 {
8767 self.end_time = v.map(|x| x.into());
8768 self
8769 }
8770}
8771
8772impl wkt::message::Message for WeeklyWindow {
8773 fn typename() -> &'static str {
8774 "type.googleapis.com/google.cloud.deploy.v1.WeeklyWindow"
8775 }
8776}
8777
8778/// Returned from an action if one or more policies were
8779/// violated, and therefore the action was prevented. Contains information about
8780/// what policies were violated and why.
8781#[derive(Clone, Default, PartialEq)]
8782#[non_exhaustive]
8783pub struct PolicyViolation {
8784 /// Policy violation details.
8785 pub policy_violation_details: std::vec::Vec<crate::model::PolicyViolationDetails>,
8786
8787 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8788}
8789
8790impl PolicyViolation {
8791 /// Creates a new default instance.
8792 pub fn new() -> Self {
8793 std::default::Default::default()
8794 }
8795
8796 /// Sets the value of [policy_violation_details][crate::model::PolicyViolation::policy_violation_details].
8797 ///
8798 /// # Example
8799 /// ```ignore,no_run
8800 /// # use google_cloud_deploy_v1::model::PolicyViolation;
8801 /// use google_cloud_deploy_v1::model::PolicyViolationDetails;
8802 /// let x = PolicyViolation::new()
8803 /// .set_policy_violation_details([
8804 /// PolicyViolationDetails::default()/* use setters */,
8805 /// PolicyViolationDetails::default()/* use (different) setters */,
8806 /// ]);
8807 /// ```
8808 pub fn set_policy_violation_details<T, V>(mut self, v: T) -> Self
8809 where
8810 T: std::iter::IntoIterator<Item = V>,
8811 V: std::convert::Into<crate::model::PolicyViolationDetails>,
8812 {
8813 use std::iter::Iterator;
8814 self.policy_violation_details = v.into_iter().map(|i| i.into()).collect();
8815 self
8816 }
8817}
8818
8819impl wkt::message::Message for PolicyViolation {
8820 fn typename() -> &'static str {
8821 "type.googleapis.com/google.cloud.deploy.v1.PolicyViolation"
8822 }
8823}
8824
8825/// Policy violation details.
8826#[derive(Clone, Default, PartialEq)]
8827#[non_exhaustive]
8828pub struct PolicyViolationDetails {
8829 /// Name of the policy that was violated.
8830 /// Policy resource will be in the format of
8831 /// `projects/{project}/locations/{location}/policies/{policy}`.
8832 pub policy: std::string::String,
8833
8834 /// Id of the rule that triggered the policy violation.
8835 pub rule_id: std::string::String,
8836
8837 /// User readable message about why the request violated a policy. This is not
8838 /// intended for machine parsing.
8839 pub failure_message: std::string::String,
8840
8841 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8842}
8843
8844impl PolicyViolationDetails {
8845 /// Creates a new default instance.
8846 pub fn new() -> Self {
8847 std::default::Default::default()
8848 }
8849
8850 /// Sets the value of [policy][crate::model::PolicyViolationDetails::policy].
8851 ///
8852 /// # Example
8853 /// ```ignore,no_run
8854 /// # use google_cloud_deploy_v1::model::PolicyViolationDetails;
8855 /// let x = PolicyViolationDetails::new().set_policy("example");
8856 /// ```
8857 pub fn set_policy<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8858 self.policy = v.into();
8859 self
8860 }
8861
8862 /// Sets the value of [rule_id][crate::model::PolicyViolationDetails::rule_id].
8863 ///
8864 /// # Example
8865 /// ```ignore,no_run
8866 /// # use google_cloud_deploy_v1::model::PolicyViolationDetails;
8867 /// let x = PolicyViolationDetails::new().set_rule_id("example");
8868 /// ```
8869 pub fn set_rule_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8870 self.rule_id = v.into();
8871 self
8872 }
8873
8874 /// Sets the value of [failure_message][crate::model::PolicyViolationDetails::failure_message].
8875 ///
8876 /// # Example
8877 /// ```ignore,no_run
8878 /// # use google_cloud_deploy_v1::model::PolicyViolationDetails;
8879 /// let x = PolicyViolationDetails::new().set_failure_message("example");
8880 /// ```
8881 pub fn set_failure_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8882 self.failure_message = v.into();
8883 self
8884 }
8885}
8886
8887impl wkt::message::Message for PolicyViolationDetails {
8888 fn typename() -> &'static str {
8889 "type.googleapis.com/google.cloud.deploy.v1.PolicyViolationDetails"
8890 }
8891}
8892
8893/// A `Release` resource in the Cloud Deploy API.
8894///
8895/// A `Release` defines a specific Skaffold configuration instance
8896/// that can be deployed.
8897#[derive(Clone, Default, PartialEq)]
8898#[non_exhaustive]
8899pub struct Release {
8900 /// Identifier. Name of the `Release`. Format is
8901 /// `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}`.
8902 /// The `release` component must match `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`
8903 pub name: std::string::String,
8904
8905 /// Output only. Unique identifier of the `Release`.
8906 pub uid: std::string::String,
8907
8908 /// Optional. Description of the `Release`. Max length is 255 characters.
8909 pub description: std::string::String,
8910
8911 /// Optional. User annotations. These attributes can only be set and used by
8912 /// the user, and not by Cloud Deploy. See
8913 /// <https://google.aip.dev/128#annotations> for more details such as format and
8914 /// size limitations.
8915 pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
8916
8917 /// Labels are attributes that can be set and used by both the
8918 /// user and by Cloud Deploy. Labels must meet the following constraints:
8919 ///
8920 /// * Keys and values can contain only lowercase letters, numeric characters,
8921 /// underscores, and dashes.
8922 /// * All characters must use UTF-8 encoding, and international characters are
8923 /// allowed.
8924 /// * Keys must start with a lowercase letter or international character.
8925 /// * Each resource is limited to a maximum of 64 labels.
8926 ///
8927 /// Both keys and values are additionally constrained to be <= 128 bytes.
8928 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
8929
8930 /// Output only. Indicates whether this is an abandoned release.
8931 pub abandoned: bool,
8932
8933 /// Output only. Time at which the `Release` was created.
8934 pub create_time: std::option::Option<wkt::Timestamp>,
8935
8936 /// Output only. Time at which the render began.
8937 pub render_start_time: std::option::Option<wkt::Timestamp>,
8938
8939 /// Output only. Time at which the render completed.
8940 pub render_end_time: std::option::Option<wkt::Timestamp>,
8941
8942 /// Optional. Cloud Storage URI of tar.gz archive containing Skaffold
8943 /// configuration.
8944 pub skaffold_config_uri: std::string::String,
8945
8946 /// Optional. Filepath of the Skaffold config inside of the config URI.
8947 pub skaffold_config_path: std::string::String,
8948
8949 /// Optional. List of artifacts to pass through to Skaffold command.
8950 pub build_artifacts: std::vec::Vec<crate::model::BuildArtifact>,
8951
8952 /// Output only. Snapshot of the parent pipeline taken at release creation
8953 /// time.
8954 pub delivery_pipeline_snapshot: std::option::Option<crate::model::DeliveryPipeline>,
8955
8956 /// Output only. Snapshot of the targets taken at release creation time.
8957 pub target_snapshots: std::vec::Vec<crate::model::Target>,
8958
8959 /// Output only. Snapshot of the custom target types referenced by the targets
8960 /// taken at release creation time.
8961 pub custom_target_type_snapshots: std::vec::Vec<crate::model::CustomTargetType>,
8962
8963 /// Output only. Current state of the render operation.
8964 pub render_state: crate::model::release::RenderState,
8965
8966 /// This checksum is computed by the server based on the value of other
8967 /// fields, and may be sent on update and delete requests to ensure the
8968 /// client has an up-to-date value before proceeding.
8969 pub etag: std::string::String,
8970
8971 /// Optional. The Skaffold version to use when operating on this release, such
8972 /// as "1.20.0". Not all versions are valid; Cloud Deploy supports a specific
8973 /// set of versions.
8974 ///
8975 /// If unset, the most recent supported Skaffold version will be used.
8976 pub skaffold_version: std::string::String,
8977
8978 /// Output only. Map from target ID to the target artifacts created
8979 /// during the render operation.
8980 pub target_artifacts:
8981 std::collections::HashMap<std::string::String, crate::model::TargetArtifact>,
8982
8983 /// Output only. Map from target ID to details of the render operation for that
8984 /// target.
8985 pub target_renders:
8986 std::collections::HashMap<std::string::String, crate::model::release::TargetRender>,
8987
8988 /// Output only. Information around the state of the Release.
8989 pub condition: std::option::Option<crate::model::release::ReleaseCondition>,
8990
8991 /// Optional. The deploy parameters to use for all targets in this release.
8992 pub deploy_parameters: std::collections::HashMap<std::string::String, std::string::String>,
8993
8994 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8995}
8996
8997impl Release {
8998 /// Creates a new default instance.
8999 pub fn new() -> Self {
9000 std::default::Default::default()
9001 }
9002
9003 /// Sets the value of [name][crate::model::Release::name].
9004 ///
9005 /// # Example
9006 /// ```ignore,no_run
9007 /// # use google_cloud_deploy_v1::model::Release;
9008 /// # let project_id = "project_id";
9009 /// # let location_id = "location_id";
9010 /// # let delivery_pipeline_id = "delivery_pipeline_id";
9011 /// # let release_id = "release_id";
9012 /// let x = Release::new().set_name(format!("projects/{project_id}/locations/{location_id}/deliveryPipelines/{delivery_pipeline_id}/releases/{release_id}"));
9013 /// ```
9014 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9015 self.name = v.into();
9016 self
9017 }
9018
9019 /// Sets the value of [uid][crate::model::Release::uid].
9020 ///
9021 /// # Example
9022 /// ```ignore,no_run
9023 /// # use google_cloud_deploy_v1::model::Release;
9024 /// let x = Release::new().set_uid("example");
9025 /// ```
9026 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9027 self.uid = v.into();
9028 self
9029 }
9030
9031 /// Sets the value of [description][crate::model::Release::description].
9032 ///
9033 /// # Example
9034 /// ```ignore,no_run
9035 /// # use google_cloud_deploy_v1::model::Release;
9036 /// let x = Release::new().set_description("example");
9037 /// ```
9038 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9039 self.description = v.into();
9040 self
9041 }
9042
9043 /// Sets the value of [annotations][crate::model::Release::annotations].
9044 ///
9045 /// # Example
9046 /// ```ignore,no_run
9047 /// # use google_cloud_deploy_v1::model::Release;
9048 /// let x = Release::new().set_annotations([
9049 /// ("key0", "abc"),
9050 /// ("key1", "xyz"),
9051 /// ]);
9052 /// ```
9053 pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
9054 where
9055 T: std::iter::IntoIterator<Item = (K, V)>,
9056 K: std::convert::Into<std::string::String>,
9057 V: std::convert::Into<std::string::String>,
9058 {
9059 use std::iter::Iterator;
9060 self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
9061 self
9062 }
9063
9064 /// Sets the value of [labels][crate::model::Release::labels].
9065 ///
9066 /// # Example
9067 /// ```ignore,no_run
9068 /// # use google_cloud_deploy_v1::model::Release;
9069 /// let x = Release::new().set_labels([
9070 /// ("key0", "abc"),
9071 /// ("key1", "xyz"),
9072 /// ]);
9073 /// ```
9074 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
9075 where
9076 T: std::iter::IntoIterator<Item = (K, V)>,
9077 K: std::convert::Into<std::string::String>,
9078 V: std::convert::Into<std::string::String>,
9079 {
9080 use std::iter::Iterator;
9081 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
9082 self
9083 }
9084
9085 /// Sets the value of [abandoned][crate::model::Release::abandoned].
9086 ///
9087 /// # Example
9088 /// ```ignore,no_run
9089 /// # use google_cloud_deploy_v1::model::Release;
9090 /// let x = Release::new().set_abandoned(true);
9091 /// ```
9092 pub fn set_abandoned<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9093 self.abandoned = v.into();
9094 self
9095 }
9096
9097 /// Sets the value of [create_time][crate::model::Release::create_time].
9098 ///
9099 /// # Example
9100 /// ```ignore,no_run
9101 /// # use google_cloud_deploy_v1::model::Release;
9102 /// use wkt::Timestamp;
9103 /// let x = Release::new().set_create_time(Timestamp::default()/* use setters */);
9104 /// ```
9105 pub fn set_create_time<T>(mut self, v: T) -> Self
9106 where
9107 T: std::convert::Into<wkt::Timestamp>,
9108 {
9109 self.create_time = std::option::Option::Some(v.into());
9110 self
9111 }
9112
9113 /// Sets or clears the value of [create_time][crate::model::Release::create_time].
9114 ///
9115 /// # Example
9116 /// ```ignore,no_run
9117 /// # use google_cloud_deploy_v1::model::Release;
9118 /// use wkt::Timestamp;
9119 /// let x = Release::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
9120 /// let x = Release::new().set_or_clear_create_time(None::<Timestamp>);
9121 /// ```
9122 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
9123 where
9124 T: std::convert::Into<wkt::Timestamp>,
9125 {
9126 self.create_time = v.map(|x| x.into());
9127 self
9128 }
9129
9130 /// Sets the value of [render_start_time][crate::model::Release::render_start_time].
9131 ///
9132 /// # Example
9133 /// ```ignore,no_run
9134 /// # use google_cloud_deploy_v1::model::Release;
9135 /// use wkt::Timestamp;
9136 /// let x = Release::new().set_render_start_time(Timestamp::default()/* use setters */);
9137 /// ```
9138 pub fn set_render_start_time<T>(mut self, v: T) -> Self
9139 where
9140 T: std::convert::Into<wkt::Timestamp>,
9141 {
9142 self.render_start_time = std::option::Option::Some(v.into());
9143 self
9144 }
9145
9146 /// Sets or clears the value of [render_start_time][crate::model::Release::render_start_time].
9147 ///
9148 /// # Example
9149 /// ```ignore,no_run
9150 /// # use google_cloud_deploy_v1::model::Release;
9151 /// use wkt::Timestamp;
9152 /// let x = Release::new().set_or_clear_render_start_time(Some(Timestamp::default()/* use setters */));
9153 /// let x = Release::new().set_or_clear_render_start_time(None::<Timestamp>);
9154 /// ```
9155 pub fn set_or_clear_render_start_time<T>(mut self, v: std::option::Option<T>) -> Self
9156 where
9157 T: std::convert::Into<wkt::Timestamp>,
9158 {
9159 self.render_start_time = v.map(|x| x.into());
9160 self
9161 }
9162
9163 /// Sets the value of [render_end_time][crate::model::Release::render_end_time].
9164 ///
9165 /// # Example
9166 /// ```ignore,no_run
9167 /// # use google_cloud_deploy_v1::model::Release;
9168 /// use wkt::Timestamp;
9169 /// let x = Release::new().set_render_end_time(Timestamp::default()/* use setters */);
9170 /// ```
9171 pub fn set_render_end_time<T>(mut self, v: T) -> Self
9172 where
9173 T: std::convert::Into<wkt::Timestamp>,
9174 {
9175 self.render_end_time = std::option::Option::Some(v.into());
9176 self
9177 }
9178
9179 /// Sets or clears the value of [render_end_time][crate::model::Release::render_end_time].
9180 ///
9181 /// # Example
9182 /// ```ignore,no_run
9183 /// # use google_cloud_deploy_v1::model::Release;
9184 /// use wkt::Timestamp;
9185 /// let x = Release::new().set_or_clear_render_end_time(Some(Timestamp::default()/* use setters */));
9186 /// let x = Release::new().set_or_clear_render_end_time(None::<Timestamp>);
9187 /// ```
9188 pub fn set_or_clear_render_end_time<T>(mut self, v: std::option::Option<T>) -> Self
9189 where
9190 T: std::convert::Into<wkt::Timestamp>,
9191 {
9192 self.render_end_time = v.map(|x| x.into());
9193 self
9194 }
9195
9196 /// Sets the value of [skaffold_config_uri][crate::model::Release::skaffold_config_uri].
9197 ///
9198 /// # Example
9199 /// ```ignore,no_run
9200 /// # use google_cloud_deploy_v1::model::Release;
9201 /// let x = Release::new().set_skaffold_config_uri("example");
9202 /// ```
9203 pub fn set_skaffold_config_uri<T: std::convert::Into<std::string::String>>(
9204 mut self,
9205 v: T,
9206 ) -> Self {
9207 self.skaffold_config_uri = v.into();
9208 self
9209 }
9210
9211 /// Sets the value of [skaffold_config_path][crate::model::Release::skaffold_config_path].
9212 ///
9213 /// # Example
9214 /// ```ignore,no_run
9215 /// # use google_cloud_deploy_v1::model::Release;
9216 /// let x = Release::new().set_skaffold_config_path("example");
9217 /// ```
9218 pub fn set_skaffold_config_path<T: std::convert::Into<std::string::String>>(
9219 mut self,
9220 v: T,
9221 ) -> Self {
9222 self.skaffold_config_path = v.into();
9223 self
9224 }
9225
9226 /// Sets the value of [build_artifacts][crate::model::Release::build_artifacts].
9227 ///
9228 /// # Example
9229 /// ```ignore,no_run
9230 /// # use google_cloud_deploy_v1::model::Release;
9231 /// use google_cloud_deploy_v1::model::BuildArtifact;
9232 /// let x = Release::new()
9233 /// .set_build_artifacts([
9234 /// BuildArtifact::default()/* use setters */,
9235 /// BuildArtifact::default()/* use (different) setters */,
9236 /// ]);
9237 /// ```
9238 pub fn set_build_artifacts<T, V>(mut self, v: T) -> Self
9239 where
9240 T: std::iter::IntoIterator<Item = V>,
9241 V: std::convert::Into<crate::model::BuildArtifact>,
9242 {
9243 use std::iter::Iterator;
9244 self.build_artifacts = v.into_iter().map(|i| i.into()).collect();
9245 self
9246 }
9247
9248 /// Sets the value of [delivery_pipeline_snapshot][crate::model::Release::delivery_pipeline_snapshot].
9249 ///
9250 /// # Example
9251 /// ```ignore,no_run
9252 /// # use google_cloud_deploy_v1::model::Release;
9253 /// use google_cloud_deploy_v1::model::DeliveryPipeline;
9254 /// let x = Release::new().set_delivery_pipeline_snapshot(DeliveryPipeline::default()/* use setters */);
9255 /// ```
9256 pub fn set_delivery_pipeline_snapshot<T>(mut self, v: T) -> Self
9257 where
9258 T: std::convert::Into<crate::model::DeliveryPipeline>,
9259 {
9260 self.delivery_pipeline_snapshot = std::option::Option::Some(v.into());
9261 self
9262 }
9263
9264 /// Sets or clears the value of [delivery_pipeline_snapshot][crate::model::Release::delivery_pipeline_snapshot].
9265 ///
9266 /// # Example
9267 /// ```ignore,no_run
9268 /// # use google_cloud_deploy_v1::model::Release;
9269 /// use google_cloud_deploy_v1::model::DeliveryPipeline;
9270 /// let x = Release::new().set_or_clear_delivery_pipeline_snapshot(Some(DeliveryPipeline::default()/* use setters */));
9271 /// let x = Release::new().set_or_clear_delivery_pipeline_snapshot(None::<DeliveryPipeline>);
9272 /// ```
9273 pub fn set_or_clear_delivery_pipeline_snapshot<T>(mut self, v: std::option::Option<T>) -> Self
9274 where
9275 T: std::convert::Into<crate::model::DeliveryPipeline>,
9276 {
9277 self.delivery_pipeline_snapshot = v.map(|x| x.into());
9278 self
9279 }
9280
9281 /// Sets the value of [target_snapshots][crate::model::Release::target_snapshots].
9282 ///
9283 /// # Example
9284 /// ```ignore,no_run
9285 /// # use google_cloud_deploy_v1::model::Release;
9286 /// use google_cloud_deploy_v1::model::Target;
9287 /// let x = Release::new()
9288 /// .set_target_snapshots([
9289 /// Target::default()/* use setters */,
9290 /// Target::default()/* use (different) setters */,
9291 /// ]);
9292 /// ```
9293 pub fn set_target_snapshots<T, V>(mut self, v: T) -> Self
9294 where
9295 T: std::iter::IntoIterator<Item = V>,
9296 V: std::convert::Into<crate::model::Target>,
9297 {
9298 use std::iter::Iterator;
9299 self.target_snapshots = v.into_iter().map(|i| i.into()).collect();
9300 self
9301 }
9302
9303 /// Sets the value of [custom_target_type_snapshots][crate::model::Release::custom_target_type_snapshots].
9304 ///
9305 /// # Example
9306 /// ```ignore,no_run
9307 /// # use google_cloud_deploy_v1::model::Release;
9308 /// use google_cloud_deploy_v1::model::CustomTargetType;
9309 /// let x = Release::new()
9310 /// .set_custom_target_type_snapshots([
9311 /// CustomTargetType::default()/* use setters */,
9312 /// CustomTargetType::default()/* use (different) setters */,
9313 /// ]);
9314 /// ```
9315 pub fn set_custom_target_type_snapshots<T, V>(mut self, v: T) -> Self
9316 where
9317 T: std::iter::IntoIterator<Item = V>,
9318 V: std::convert::Into<crate::model::CustomTargetType>,
9319 {
9320 use std::iter::Iterator;
9321 self.custom_target_type_snapshots = v.into_iter().map(|i| i.into()).collect();
9322 self
9323 }
9324
9325 /// Sets the value of [render_state][crate::model::Release::render_state].
9326 ///
9327 /// # Example
9328 /// ```ignore,no_run
9329 /// # use google_cloud_deploy_v1::model::Release;
9330 /// use google_cloud_deploy_v1::model::release::RenderState;
9331 /// let x0 = Release::new().set_render_state(RenderState::Succeeded);
9332 /// let x1 = Release::new().set_render_state(RenderState::Failed);
9333 /// let x2 = Release::new().set_render_state(RenderState::InProgress);
9334 /// ```
9335 pub fn set_render_state<T: std::convert::Into<crate::model::release::RenderState>>(
9336 mut self,
9337 v: T,
9338 ) -> Self {
9339 self.render_state = v.into();
9340 self
9341 }
9342
9343 /// Sets the value of [etag][crate::model::Release::etag].
9344 ///
9345 /// # Example
9346 /// ```ignore,no_run
9347 /// # use google_cloud_deploy_v1::model::Release;
9348 /// let x = Release::new().set_etag("example");
9349 /// ```
9350 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9351 self.etag = v.into();
9352 self
9353 }
9354
9355 /// Sets the value of [skaffold_version][crate::model::Release::skaffold_version].
9356 ///
9357 /// # Example
9358 /// ```ignore,no_run
9359 /// # use google_cloud_deploy_v1::model::Release;
9360 /// let x = Release::new().set_skaffold_version("example");
9361 /// ```
9362 pub fn set_skaffold_version<T: std::convert::Into<std::string::String>>(
9363 mut self,
9364 v: T,
9365 ) -> Self {
9366 self.skaffold_version = v.into();
9367 self
9368 }
9369
9370 /// Sets the value of [target_artifacts][crate::model::Release::target_artifacts].
9371 ///
9372 /// # Example
9373 /// ```ignore,no_run
9374 /// # use google_cloud_deploy_v1::model::Release;
9375 /// use google_cloud_deploy_v1::model::TargetArtifact;
9376 /// let x = Release::new().set_target_artifacts([
9377 /// ("key0", TargetArtifact::default()/* use setters */),
9378 /// ("key1", TargetArtifact::default()/* use (different) setters */),
9379 /// ]);
9380 /// ```
9381 pub fn set_target_artifacts<T, K, V>(mut self, v: T) -> Self
9382 where
9383 T: std::iter::IntoIterator<Item = (K, V)>,
9384 K: std::convert::Into<std::string::String>,
9385 V: std::convert::Into<crate::model::TargetArtifact>,
9386 {
9387 use std::iter::Iterator;
9388 self.target_artifacts = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
9389 self
9390 }
9391
9392 /// Sets the value of [target_renders][crate::model::Release::target_renders].
9393 ///
9394 /// # Example
9395 /// ```ignore,no_run
9396 /// # use google_cloud_deploy_v1::model::Release;
9397 /// use google_cloud_deploy_v1::model::release::TargetRender;
9398 /// let x = Release::new().set_target_renders([
9399 /// ("key0", TargetRender::default()/* use setters */),
9400 /// ("key1", TargetRender::default()/* use (different) setters */),
9401 /// ]);
9402 /// ```
9403 pub fn set_target_renders<T, K, V>(mut self, v: T) -> Self
9404 where
9405 T: std::iter::IntoIterator<Item = (K, V)>,
9406 K: std::convert::Into<std::string::String>,
9407 V: std::convert::Into<crate::model::release::TargetRender>,
9408 {
9409 use std::iter::Iterator;
9410 self.target_renders = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
9411 self
9412 }
9413
9414 /// Sets the value of [condition][crate::model::Release::condition].
9415 ///
9416 /// # Example
9417 /// ```ignore,no_run
9418 /// # use google_cloud_deploy_v1::model::Release;
9419 /// use google_cloud_deploy_v1::model::release::ReleaseCondition;
9420 /// let x = Release::new().set_condition(ReleaseCondition::default()/* use setters */);
9421 /// ```
9422 pub fn set_condition<T>(mut self, v: T) -> Self
9423 where
9424 T: std::convert::Into<crate::model::release::ReleaseCondition>,
9425 {
9426 self.condition = std::option::Option::Some(v.into());
9427 self
9428 }
9429
9430 /// Sets or clears the value of [condition][crate::model::Release::condition].
9431 ///
9432 /// # Example
9433 /// ```ignore,no_run
9434 /// # use google_cloud_deploy_v1::model::Release;
9435 /// use google_cloud_deploy_v1::model::release::ReleaseCondition;
9436 /// let x = Release::new().set_or_clear_condition(Some(ReleaseCondition::default()/* use setters */));
9437 /// let x = Release::new().set_or_clear_condition(None::<ReleaseCondition>);
9438 /// ```
9439 pub fn set_or_clear_condition<T>(mut self, v: std::option::Option<T>) -> Self
9440 where
9441 T: std::convert::Into<crate::model::release::ReleaseCondition>,
9442 {
9443 self.condition = v.map(|x| x.into());
9444 self
9445 }
9446
9447 /// Sets the value of [deploy_parameters][crate::model::Release::deploy_parameters].
9448 ///
9449 /// # Example
9450 /// ```ignore,no_run
9451 /// # use google_cloud_deploy_v1::model::Release;
9452 /// let x = Release::new().set_deploy_parameters([
9453 /// ("key0", "abc"),
9454 /// ("key1", "xyz"),
9455 /// ]);
9456 /// ```
9457 pub fn set_deploy_parameters<T, K, V>(mut self, v: T) -> Self
9458 where
9459 T: std::iter::IntoIterator<Item = (K, V)>,
9460 K: std::convert::Into<std::string::String>,
9461 V: std::convert::Into<std::string::String>,
9462 {
9463 use std::iter::Iterator;
9464 self.deploy_parameters = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
9465 self
9466 }
9467}
9468
9469impl wkt::message::Message for Release {
9470 fn typename() -> &'static str {
9471 "type.googleapis.com/google.cloud.deploy.v1.Release"
9472 }
9473}
9474
9475/// Defines additional types related to [Release].
9476pub mod release {
9477 #[allow(unused_imports)]
9478 use super::*;
9479
9480 /// Details of rendering for a single target.
9481 #[derive(Clone, Default, PartialEq)]
9482 #[non_exhaustive]
9483 pub struct TargetRender {
9484 /// Output only. The resource name of the Cloud Build `Build` object that is
9485 /// used to render the manifest for this target. Format is
9486 /// `projects/{project}/locations/{location}/builds/{build}`.
9487 pub rendering_build: std::string::String,
9488
9489 /// Output only. Current state of the render operation for this Target.
9490 pub rendering_state: crate::model::release::target_render::TargetRenderState,
9491
9492 /// Output only. Metadata related to the `Release` render for this Target.
9493 pub metadata: std::option::Option<crate::model::RenderMetadata>,
9494
9495 /// Output only. Reason this render failed. This will always be unspecified
9496 /// while the render in progress.
9497 pub failure_cause: crate::model::release::target_render::FailureCause,
9498
9499 /// Output only. Additional information about the render failure, if
9500 /// available.
9501 pub failure_message: std::string::String,
9502
9503 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9504 }
9505
9506 impl TargetRender {
9507 /// Creates a new default instance.
9508 pub fn new() -> Self {
9509 std::default::Default::default()
9510 }
9511
9512 /// Sets the value of [rendering_build][crate::model::release::TargetRender::rendering_build].
9513 ///
9514 /// # Example
9515 /// ```ignore,no_run
9516 /// # use google_cloud_deploy_v1::model::release::TargetRender;
9517 /// let x = TargetRender::new().set_rendering_build("example");
9518 /// ```
9519 pub fn set_rendering_build<T: std::convert::Into<std::string::String>>(
9520 mut self,
9521 v: T,
9522 ) -> Self {
9523 self.rendering_build = v.into();
9524 self
9525 }
9526
9527 /// Sets the value of [rendering_state][crate::model::release::TargetRender::rendering_state].
9528 ///
9529 /// # Example
9530 /// ```ignore,no_run
9531 /// # use google_cloud_deploy_v1::model::release::TargetRender;
9532 /// use google_cloud_deploy_v1::model::release::target_render::TargetRenderState;
9533 /// let x0 = TargetRender::new().set_rendering_state(TargetRenderState::Succeeded);
9534 /// let x1 = TargetRender::new().set_rendering_state(TargetRenderState::Failed);
9535 /// let x2 = TargetRender::new().set_rendering_state(TargetRenderState::InProgress);
9536 /// ```
9537 pub fn set_rendering_state<
9538 T: std::convert::Into<crate::model::release::target_render::TargetRenderState>,
9539 >(
9540 mut self,
9541 v: T,
9542 ) -> Self {
9543 self.rendering_state = v.into();
9544 self
9545 }
9546
9547 /// Sets the value of [metadata][crate::model::release::TargetRender::metadata].
9548 ///
9549 /// # Example
9550 /// ```ignore,no_run
9551 /// # use google_cloud_deploy_v1::model::release::TargetRender;
9552 /// use google_cloud_deploy_v1::model::RenderMetadata;
9553 /// let x = TargetRender::new().set_metadata(RenderMetadata::default()/* use setters */);
9554 /// ```
9555 pub fn set_metadata<T>(mut self, v: T) -> Self
9556 where
9557 T: std::convert::Into<crate::model::RenderMetadata>,
9558 {
9559 self.metadata = std::option::Option::Some(v.into());
9560 self
9561 }
9562
9563 /// Sets or clears the value of [metadata][crate::model::release::TargetRender::metadata].
9564 ///
9565 /// # Example
9566 /// ```ignore,no_run
9567 /// # use google_cloud_deploy_v1::model::release::TargetRender;
9568 /// use google_cloud_deploy_v1::model::RenderMetadata;
9569 /// let x = TargetRender::new().set_or_clear_metadata(Some(RenderMetadata::default()/* use setters */));
9570 /// let x = TargetRender::new().set_or_clear_metadata(None::<RenderMetadata>);
9571 /// ```
9572 pub fn set_or_clear_metadata<T>(mut self, v: std::option::Option<T>) -> Self
9573 where
9574 T: std::convert::Into<crate::model::RenderMetadata>,
9575 {
9576 self.metadata = v.map(|x| x.into());
9577 self
9578 }
9579
9580 /// Sets the value of [failure_cause][crate::model::release::TargetRender::failure_cause].
9581 ///
9582 /// # Example
9583 /// ```ignore,no_run
9584 /// # use google_cloud_deploy_v1::model::release::TargetRender;
9585 /// use google_cloud_deploy_v1::model::release::target_render::FailureCause;
9586 /// let x0 = TargetRender::new().set_failure_cause(FailureCause::CloudBuildUnavailable);
9587 /// let x1 = TargetRender::new().set_failure_cause(FailureCause::ExecutionFailed);
9588 /// let x2 = TargetRender::new().set_failure_cause(FailureCause::CloudBuildRequestFailed);
9589 /// ```
9590 pub fn set_failure_cause<
9591 T: std::convert::Into<crate::model::release::target_render::FailureCause>,
9592 >(
9593 mut self,
9594 v: T,
9595 ) -> Self {
9596 self.failure_cause = v.into();
9597 self
9598 }
9599
9600 /// Sets the value of [failure_message][crate::model::release::TargetRender::failure_message].
9601 ///
9602 /// # Example
9603 /// ```ignore,no_run
9604 /// # use google_cloud_deploy_v1::model::release::TargetRender;
9605 /// let x = TargetRender::new().set_failure_message("example");
9606 /// ```
9607 pub fn set_failure_message<T: std::convert::Into<std::string::String>>(
9608 mut self,
9609 v: T,
9610 ) -> Self {
9611 self.failure_message = v.into();
9612 self
9613 }
9614 }
9615
9616 impl wkt::message::Message for TargetRender {
9617 fn typename() -> &'static str {
9618 "type.googleapis.com/google.cloud.deploy.v1.Release.TargetRender"
9619 }
9620 }
9621
9622 /// Defines additional types related to [TargetRender].
9623 pub mod target_render {
9624 #[allow(unused_imports)]
9625 use super::*;
9626
9627 /// Valid states of the render operation.
9628 ///
9629 /// # Working with unknown values
9630 ///
9631 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9632 /// additional enum variants at any time. Adding new variants is not considered
9633 /// a breaking change. Applications should write their code in anticipation of:
9634 ///
9635 /// - New values appearing in future releases of the client library, **and**
9636 /// - New values received dynamically, without application changes.
9637 ///
9638 /// Please consult the [Working with enums] section in the user guide for some
9639 /// guidelines.
9640 ///
9641 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
9642 #[derive(Clone, Debug, PartialEq)]
9643 #[non_exhaustive]
9644 pub enum TargetRenderState {
9645 /// The render operation state is unspecified.
9646 Unspecified,
9647 /// The render operation has completed successfully.
9648 Succeeded,
9649 /// The render operation has failed.
9650 Failed,
9651 /// The render operation is in progress.
9652 InProgress,
9653 /// If set, the enum was initialized with an unknown value.
9654 ///
9655 /// Applications can examine the value using [TargetRenderState::value] or
9656 /// [TargetRenderState::name].
9657 UnknownValue(target_render_state::UnknownValue),
9658 }
9659
9660 #[doc(hidden)]
9661 pub mod target_render_state {
9662 #[allow(unused_imports)]
9663 use super::*;
9664 #[derive(Clone, Debug, PartialEq)]
9665 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9666 }
9667
9668 impl TargetRenderState {
9669 /// Gets the enum value.
9670 ///
9671 /// Returns `None` if the enum contains an unknown value deserialized from
9672 /// the string representation of enums.
9673 pub fn value(&self) -> std::option::Option<i32> {
9674 match self {
9675 Self::Unspecified => std::option::Option::Some(0),
9676 Self::Succeeded => std::option::Option::Some(1),
9677 Self::Failed => std::option::Option::Some(2),
9678 Self::InProgress => std::option::Option::Some(3),
9679 Self::UnknownValue(u) => u.0.value(),
9680 }
9681 }
9682
9683 /// Gets the enum value as a string.
9684 ///
9685 /// Returns `None` if the enum contains an unknown value deserialized from
9686 /// the integer representation of enums.
9687 pub fn name(&self) -> std::option::Option<&str> {
9688 match self {
9689 Self::Unspecified => {
9690 std::option::Option::Some("TARGET_RENDER_STATE_UNSPECIFIED")
9691 }
9692 Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
9693 Self::Failed => std::option::Option::Some("FAILED"),
9694 Self::InProgress => std::option::Option::Some("IN_PROGRESS"),
9695 Self::UnknownValue(u) => u.0.name(),
9696 }
9697 }
9698 }
9699
9700 impl std::default::Default for TargetRenderState {
9701 fn default() -> Self {
9702 use std::convert::From;
9703 Self::from(0)
9704 }
9705 }
9706
9707 impl std::fmt::Display for TargetRenderState {
9708 fn fmt(
9709 &self,
9710 f: &mut std::fmt::Formatter<'_>,
9711 ) -> std::result::Result<(), std::fmt::Error> {
9712 wkt::internal::display_enum(f, self.name(), self.value())
9713 }
9714 }
9715
9716 impl std::convert::From<i32> for TargetRenderState {
9717 fn from(value: i32) -> Self {
9718 match value {
9719 0 => Self::Unspecified,
9720 1 => Self::Succeeded,
9721 2 => Self::Failed,
9722 3 => Self::InProgress,
9723 _ => Self::UnknownValue(target_render_state::UnknownValue(
9724 wkt::internal::UnknownEnumValue::Integer(value),
9725 )),
9726 }
9727 }
9728 }
9729
9730 impl std::convert::From<&str> for TargetRenderState {
9731 fn from(value: &str) -> Self {
9732 use std::string::ToString;
9733 match value {
9734 "TARGET_RENDER_STATE_UNSPECIFIED" => Self::Unspecified,
9735 "SUCCEEDED" => Self::Succeeded,
9736 "FAILED" => Self::Failed,
9737 "IN_PROGRESS" => Self::InProgress,
9738 _ => Self::UnknownValue(target_render_state::UnknownValue(
9739 wkt::internal::UnknownEnumValue::String(value.to_string()),
9740 )),
9741 }
9742 }
9743 }
9744
9745 impl serde::ser::Serialize for TargetRenderState {
9746 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9747 where
9748 S: serde::Serializer,
9749 {
9750 match self {
9751 Self::Unspecified => serializer.serialize_i32(0),
9752 Self::Succeeded => serializer.serialize_i32(1),
9753 Self::Failed => serializer.serialize_i32(2),
9754 Self::InProgress => serializer.serialize_i32(3),
9755 Self::UnknownValue(u) => u.0.serialize(serializer),
9756 }
9757 }
9758 }
9759
9760 impl<'de> serde::de::Deserialize<'de> for TargetRenderState {
9761 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9762 where
9763 D: serde::Deserializer<'de>,
9764 {
9765 deserializer.deserialize_any(wkt::internal::EnumVisitor::<TargetRenderState>::new(
9766 ".google.cloud.deploy.v1.Release.TargetRender.TargetRenderState",
9767 ))
9768 }
9769 }
9770
9771 /// Well-known rendering failures.
9772 ///
9773 /// # Working with unknown values
9774 ///
9775 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9776 /// additional enum variants at any time. Adding new variants is not considered
9777 /// a breaking change. Applications should write their code in anticipation of:
9778 ///
9779 /// - New values appearing in future releases of the client library, **and**
9780 /// - New values received dynamically, without application changes.
9781 ///
9782 /// Please consult the [Working with enums] section in the user guide for some
9783 /// guidelines.
9784 ///
9785 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
9786 #[derive(Clone, Debug, PartialEq)]
9787 #[non_exhaustive]
9788 pub enum FailureCause {
9789 /// No reason for failure is specified.
9790 Unspecified,
9791 /// Cloud Build is not available, either because it is not enabled or
9792 /// because Cloud Deploy has insufficient permissions. See [required
9793 /// permission](https://cloud.google.com/deploy/docs/cloud-deploy-service-account#required_permissions).
9794 CloudBuildUnavailable,
9795 /// The render operation did not complete successfully; check Cloud Build
9796 /// logs.
9797 ExecutionFailed,
9798 /// Cloud Build failed to fulfill Cloud Deploy's request. See
9799 /// failure_message for additional details.
9800 CloudBuildRequestFailed,
9801 /// The render operation did not complete successfully because the
9802 /// verification stanza required for verify was not found on the Skaffold
9803 /// configuration.
9804 VerificationConfigNotFound,
9805 /// The render operation did not complete successfully because the custom
9806 /// action(s) required for Rollout jobs were not found in the Skaffold
9807 /// configuration. See failure_message for additional details.
9808 CustomActionNotFound,
9809 /// Release failed during rendering because the release configuration is
9810 /// not supported with the specified deployment strategy.
9811 DeploymentStrategyNotSupported,
9812 /// The render operation had a feature configured that is not supported.
9813 RenderFeatureNotSupported,
9814 /// If set, the enum was initialized with an unknown value.
9815 ///
9816 /// Applications can examine the value using [FailureCause::value] or
9817 /// [FailureCause::name].
9818 UnknownValue(failure_cause::UnknownValue),
9819 }
9820
9821 #[doc(hidden)]
9822 pub mod failure_cause {
9823 #[allow(unused_imports)]
9824 use super::*;
9825 #[derive(Clone, Debug, PartialEq)]
9826 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9827 }
9828
9829 impl FailureCause {
9830 /// Gets the enum value.
9831 ///
9832 /// Returns `None` if the enum contains an unknown value deserialized from
9833 /// the string representation of enums.
9834 pub fn value(&self) -> std::option::Option<i32> {
9835 match self {
9836 Self::Unspecified => std::option::Option::Some(0),
9837 Self::CloudBuildUnavailable => std::option::Option::Some(1),
9838 Self::ExecutionFailed => std::option::Option::Some(2),
9839 Self::CloudBuildRequestFailed => std::option::Option::Some(3),
9840 Self::VerificationConfigNotFound => std::option::Option::Some(4),
9841 Self::CustomActionNotFound => std::option::Option::Some(5),
9842 Self::DeploymentStrategyNotSupported => std::option::Option::Some(6),
9843 Self::RenderFeatureNotSupported => std::option::Option::Some(7),
9844 Self::UnknownValue(u) => u.0.value(),
9845 }
9846 }
9847
9848 /// Gets the enum value as a string.
9849 ///
9850 /// Returns `None` if the enum contains an unknown value deserialized from
9851 /// the integer representation of enums.
9852 pub fn name(&self) -> std::option::Option<&str> {
9853 match self {
9854 Self::Unspecified => std::option::Option::Some("FAILURE_CAUSE_UNSPECIFIED"),
9855 Self::CloudBuildUnavailable => {
9856 std::option::Option::Some("CLOUD_BUILD_UNAVAILABLE")
9857 }
9858 Self::ExecutionFailed => std::option::Option::Some("EXECUTION_FAILED"),
9859 Self::CloudBuildRequestFailed => {
9860 std::option::Option::Some("CLOUD_BUILD_REQUEST_FAILED")
9861 }
9862 Self::VerificationConfigNotFound => {
9863 std::option::Option::Some("VERIFICATION_CONFIG_NOT_FOUND")
9864 }
9865 Self::CustomActionNotFound => {
9866 std::option::Option::Some("CUSTOM_ACTION_NOT_FOUND")
9867 }
9868 Self::DeploymentStrategyNotSupported => {
9869 std::option::Option::Some("DEPLOYMENT_STRATEGY_NOT_SUPPORTED")
9870 }
9871 Self::RenderFeatureNotSupported => {
9872 std::option::Option::Some("RENDER_FEATURE_NOT_SUPPORTED")
9873 }
9874 Self::UnknownValue(u) => u.0.name(),
9875 }
9876 }
9877 }
9878
9879 impl std::default::Default for FailureCause {
9880 fn default() -> Self {
9881 use std::convert::From;
9882 Self::from(0)
9883 }
9884 }
9885
9886 impl std::fmt::Display for FailureCause {
9887 fn fmt(
9888 &self,
9889 f: &mut std::fmt::Formatter<'_>,
9890 ) -> std::result::Result<(), std::fmt::Error> {
9891 wkt::internal::display_enum(f, self.name(), self.value())
9892 }
9893 }
9894
9895 impl std::convert::From<i32> for FailureCause {
9896 fn from(value: i32) -> Self {
9897 match value {
9898 0 => Self::Unspecified,
9899 1 => Self::CloudBuildUnavailable,
9900 2 => Self::ExecutionFailed,
9901 3 => Self::CloudBuildRequestFailed,
9902 4 => Self::VerificationConfigNotFound,
9903 5 => Self::CustomActionNotFound,
9904 6 => Self::DeploymentStrategyNotSupported,
9905 7 => Self::RenderFeatureNotSupported,
9906 _ => Self::UnknownValue(failure_cause::UnknownValue(
9907 wkt::internal::UnknownEnumValue::Integer(value),
9908 )),
9909 }
9910 }
9911 }
9912
9913 impl std::convert::From<&str> for FailureCause {
9914 fn from(value: &str) -> Self {
9915 use std::string::ToString;
9916 match value {
9917 "FAILURE_CAUSE_UNSPECIFIED" => Self::Unspecified,
9918 "CLOUD_BUILD_UNAVAILABLE" => Self::CloudBuildUnavailable,
9919 "EXECUTION_FAILED" => Self::ExecutionFailed,
9920 "CLOUD_BUILD_REQUEST_FAILED" => Self::CloudBuildRequestFailed,
9921 "VERIFICATION_CONFIG_NOT_FOUND" => Self::VerificationConfigNotFound,
9922 "CUSTOM_ACTION_NOT_FOUND" => Self::CustomActionNotFound,
9923 "DEPLOYMENT_STRATEGY_NOT_SUPPORTED" => Self::DeploymentStrategyNotSupported,
9924 "RENDER_FEATURE_NOT_SUPPORTED" => Self::RenderFeatureNotSupported,
9925 _ => Self::UnknownValue(failure_cause::UnknownValue(
9926 wkt::internal::UnknownEnumValue::String(value.to_string()),
9927 )),
9928 }
9929 }
9930 }
9931
9932 impl serde::ser::Serialize for FailureCause {
9933 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9934 where
9935 S: serde::Serializer,
9936 {
9937 match self {
9938 Self::Unspecified => serializer.serialize_i32(0),
9939 Self::CloudBuildUnavailable => serializer.serialize_i32(1),
9940 Self::ExecutionFailed => serializer.serialize_i32(2),
9941 Self::CloudBuildRequestFailed => serializer.serialize_i32(3),
9942 Self::VerificationConfigNotFound => serializer.serialize_i32(4),
9943 Self::CustomActionNotFound => serializer.serialize_i32(5),
9944 Self::DeploymentStrategyNotSupported => serializer.serialize_i32(6),
9945 Self::RenderFeatureNotSupported => serializer.serialize_i32(7),
9946 Self::UnknownValue(u) => u.0.serialize(serializer),
9947 }
9948 }
9949 }
9950
9951 impl<'de> serde::de::Deserialize<'de> for FailureCause {
9952 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9953 where
9954 D: serde::Deserializer<'de>,
9955 {
9956 deserializer.deserialize_any(wkt::internal::EnumVisitor::<FailureCause>::new(
9957 ".google.cloud.deploy.v1.Release.TargetRender.FailureCause",
9958 ))
9959 }
9960 }
9961 }
9962
9963 /// ReleaseReadyCondition contains information around the status of the
9964 /// Release. If a release is not ready, you cannot create a rollout with the
9965 /// release.
9966 #[derive(Clone, Default, PartialEq)]
9967 #[non_exhaustive]
9968 pub struct ReleaseReadyCondition {
9969 /// True if the Release is in a valid state. Otherwise at least one condition
9970 /// in `ReleaseCondition` is in an invalid state. Iterate over those
9971 /// conditions and see which condition(s) has status = false to find out what
9972 /// is wrong with the Release.
9973 pub status: bool,
9974
9975 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9976 }
9977
9978 impl ReleaseReadyCondition {
9979 /// Creates a new default instance.
9980 pub fn new() -> Self {
9981 std::default::Default::default()
9982 }
9983
9984 /// Sets the value of [status][crate::model::release::ReleaseReadyCondition::status].
9985 ///
9986 /// # Example
9987 /// ```ignore,no_run
9988 /// # use google_cloud_deploy_v1::model::release::ReleaseReadyCondition;
9989 /// let x = ReleaseReadyCondition::new().set_status(true);
9990 /// ```
9991 pub fn set_status<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9992 self.status = v.into();
9993 self
9994 }
9995 }
9996
9997 impl wkt::message::Message for ReleaseReadyCondition {
9998 fn typename() -> &'static str {
9999 "type.googleapis.com/google.cloud.deploy.v1.Release.ReleaseReadyCondition"
10000 }
10001 }
10002
10003 /// SkaffoldSupportedCondition contains information about when support for the
10004 /// release's version of Skaffold ends.
10005 #[derive(Clone, Default, PartialEq)]
10006 #[non_exhaustive]
10007 pub struct SkaffoldSupportedCondition {
10008 /// True if the version of Skaffold used by this release is supported.
10009 pub status: bool,
10010
10011 /// The Skaffold support state for this release's version of Skaffold.
10012 pub skaffold_support_state: crate::model::SkaffoldSupportState,
10013
10014 /// The time at which this release's version of Skaffold will enter
10015 /// maintenance mode.
10016 pub maintenance_mode_time: std::option::Option<wkt::Timestamp>,
10017
10018 /// The time at which this release's version of Skaffold will no longer be
10019 /// supported.
10020 pub support_expiration_time: std::option::Option<wkt::Timestamp>,
10021
10022 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10023 }
10024
10025 impl SkaffoldSupportedCondition {
10026 /// Creates a new default instance.
10027 pub fn new() -> Self {
10028 std::default::Default::default()
10029 }
10030
10031 /// Sets the value of [status][crate::model::release::SkaffoldSupportedCondition::status].
10032 ///
10033 /// # Example
10034 /// ```ignore,no_run
10035 /// # use google_cloud_deploy_v1::model::release::SkaffoldSupportedCondition;
10036 /// let x = SkaffoldSupportedCondition::new().set_status(true);
10037 /// ```
10038 pub fn set_status<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10039 self.status = v.into();
10040 self
10041 }
10042
10043 /// Sets the value of [skaffold_support_state][crate::model::release::SkaffoldSupportedCondition::skaffold_support_state].
10044 ///
10045 /// # Example
10046 /// ```ignore,no_run
10047 /// # use google_cloud_deploy_v1::model::release::SkaffoldSupportedCondition;
10048 /// use google_cloud_deploy_v1::model::SkaffoldSupportState;
10049 /// let x0 = SkaffoldSupportedCondition::new().set_skaffold_support_state(SkaffoldSupportState::Supported);
10050 /// let x1 = SkaffoldSupportedCondition::new().set_skaffold_support_state(SkaffoldSupportState::MaintenanceMode);
10051 /// let x2 = SkaffoldSupportedCondition::new().set_skaffold_support_state(SkaffoldSupportState::Unsupported);
10052 /// ```
10053 pub fn set_skaffold_support_state<
10054 T: std::convert::Into<crate::model::SkaffoldSupportState>,
10055 >(
10056 mut self,
10057 v: T,
10058 ) -> Self {
10059 self.skaffold_support_state = v.into();
10060 self
10061 }
10062
10063 /// Sets the value of [maintenance_mode_time][crate::model::release::SkaffoldSupportedCondition::maintenance_mode_time].
10064 ///
10065 /// # Example
10066 /// ```ignore,no_run
10067 /// # use google_cloud_deploy_v1::model::release::SkaffoldSupportedCondition;
10068 /// use wkt::Timestamp;
10069 /// let x = SkaffoldSupportedCondition::new().set_maintenance_mode_time(Timestamp::default()/* use setters */);
10070 /// ```
10071 pub fn set_maintenance_mode_time<T>(mut self, v: T) -> Self
10072 where
10073 T: std::convert::Into<wkt::Timestamp>,
10074 {
10075 self.maintenance_mode_time = std::option::Option::Some(v.into());
10076 self
10077 }
10078
10079 /// Sets or clears the value of [maintenance_mode_time][crate::model::release::SkaffoldSupportedCondition::maintenance_mode_time].
10080 ///
10081 /// # Example
10082 /// ```ignore,no_run
10083 /// # use google_cloud_deploy_v1::model::release::SkaffoldSupportedCondition;
10084 /// use wkt::Timestamp;
10085 /// let x = SkaffoldSupportedCondition::new().set_or_clear_maintenance_mode_time(Some(Timestamp::default()/* use setters */));
10086 /// let x = SkaffoldSupportedCondition::new().set_or_clear_maintenance_mode_time(None::<Timestamp>);
10087 /// ```
10088 pub fn set_or_clear_maintenance_mode_time<T>(mut self, v: std::option::Option<T>) -> Self
10089 where
10090 T: std::convert::Into<wkt::Timestamp>,
10091 {
10092 self.maintenance_mode_time = v.map(|x| x.into());
10093 self
10094 }
10095
10096 /// Sets the value of [support_expiration_time][crate::model::release::SkaffoldSupportedCondition::support_expiration_time].
10097 ///
10098 /// # Example
10099 /// ```ignore,no_run
10100 /// # use google_cloud_deploy_v1::model::release::SkaffoldSupportedCondition;
10101 /// use wkt::Timestamp;
10102 /// let x = SkaffoldSupportedCondition::new().set_support_expiration_time(Timestamp::default()/* use setters */);
10103 /// ```
10104 pub fn set_support_expiration_time<T>(mut self, v: T) -> Self
10105 where
10106 T: std::convert::Into<wkt::Timestamp>,
10107 {
10108 self.support_expiration_time = std::option::Option::Some(v.into());
10109 self
10110 }
10111
10112 /// Sets or clears the value of [support_expiration_time][crate::model::release::SkaffoldSupportedCondition::support_expiration_time].
10113 ///
10114 /// # Example
10115 /// ```ignore,no_run
10116 /// # use google_cloud_deploy_v1::model::release::SkaffoldSupportedCondition;
10117 /// use wkt::Timestamp;
10118 /// let x = SkaffoldSupportedCondition::new().set_or_clear_support_expiration_time(Some(Timestamp::default()/* use setters */));
10119 /// let x = SkaffoldSupportedCondition::new().set_or_clear_support_expiration_time(None::<Timestamp>);
10120 /// ```
10121 pub fn set_or_clear_support_expiration_time<T>(mut self, v: std::option::Option<T>) -> Self
10122 where
10123 T: std::convert::Into<wkt::Timestamp>,
10124 {
10125 self.support_expiration_time = v.map(|x| x.into());
10126 self
10127 }
10128 }
10129
10130 impl wkt::message::Message for SkaffoldSupportedCondition {
10131 fn typename() -> &'static str {
10132 "type.googleapis.com/google.cloud.deploy.v1.Release.SkaffoldSupportedCondition"
10133 }
10134 }
10135
10136 /// ReleaseCondition contains all conditions relevant to a Release.
10137 #[derive(Clone, Default, PartialEq)]
10138 #[non_exhaustive]
10139 pub struct ReleaseCondition {
10140 /// Details around the Releases's overall status.
10141 pub release_ready_condition:
10142 std::option::Option<crate::model::release::ReleaseReadyCondition>,
10143
10144 /// Details around the support state of the release's Skaffold
10145 /// version.
10146 pub skaffold_supported_condition:
10147 std::option::Option<crate::model::release::SkaffoldSupportedCondition>,
10148
10149 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10150 }
10151
10152 impl ReleaseCondition {
10153 /// Creates a new default instance.
10154 pub fn new() -> Self {
10155 std::default::Default::default()
10156 }
10157
10158 /// Sets the value of [release_ready_condition][crate::model::release::ReleaseCondition::release_ready_condition].
10159 ///
10160 /// # Example
10161 /// ```ignore,no_run
10162 /// # use google_cloud_deploy_v1::model::release::ReleaseCondition;
10163 /// use google_cloud_deploy_v1::model::release::ReleaseReadyCondition;
10164 /// let x = ReleaseCondition::new().set_release_ready_condition(ReleaseReadyCondition::default()/* use setters */);
10165 /// ```
10166 pub fn set_release_ready_condition<T>(mut self, v: T) -> Self
10167 where
10168 T: std::convert::Into<crate::model::release::ReleaseReadyCondition>,
10169 {
10170 self.release_ready_condition = std::option::Option::Some(v.into());
10171 self
10172 }
10173
10174 /// Sets or clears the value of [release_ready_condition][crate::model::release::ReleaseCondition::release_ready_condition].
10175 ///
10176 /// # Example
10177 /// ```ignore,no_run
10178 /// # use google_cloud_deploy_v1::model::release::ReleaseCondition;
10179 /// use google_cloud_deploy_v1::model::release::ReleaseReadyCondition;
10180 /// let x = ReleaseCondition::new().set_or_clear_release_ready_condition(Some(ReleaseReadyCondition::default()/* use setters */));
10181 /// let x = ReleaseCondition::new().set_or_clear_release_ready_condition(None::<ReleaseReadyCondition>);
10182 /// ```
10183 pub fn set_or_clear_release_ready_condition<T>(mut self, v: std::option::Option<T>) -> Self
10184 where
10185 T: std::convert::Into<crate::model::release::ReleaseReadyCondition>,
10186 {
10187 self.release_ready_condition = v.map(|x| x.into());
10188 self
10189 }
10190
10191 /// Sets the value of [skaffold_supported_condition][crate::model::release::ReleaseCondition::skaffold_supported_condition].
10192 ///
10193 /// # Example
10194 /// ```ignore,no_run
10195 /// # use google_cloud_deploy_v1::model::release::ReleaseCondition;
10196 /// use google_cloud_deploy_v1::model::release::SkaffoldSupportedCondition;
10197 /// let x = ReleaseCondition::new().set_skaffold_supported_condition(SkaffoldSupportedCondition::default()/* use setters */);
10198 /// ```
10199 pub fn set_skaffold_supported_condition<T>(mut self, v: T) -> Self
10200 where
10201 T: std::convert::Into<crate::model::release::SkaffoldSupportedCondition>,
10202 {
10203 self.skaffold_supported_condition = std::option::Option::Some(v.into());
10204 self
10205 }
10206
10207 /// Sets or clears the value of [skaffold_supported_condition][crate::model::release::ReleaseCondition::skaffold_supported_condition].
10208 ///
10209 /// # Example
10210 /// ```ignore,no_run
10211 /// # use google_cloud_deploy_v1::model::release::ReleaseCondition;
10212 /// use google_cloud_deploy_v1::model::release::SkaffoldSupportedCondition;
10213 /// let x = ReleaseCondition::new().set_or_clear_skaffold_supported_condition(Some(SkaffoldSupportedCondition::default()/* use setters */));
10214 /// let x = ReleaseCondition::new().set_or_clear_skaffold_supported_condition(None::<SkaffoldSupportedCondition>);
10215 /// ```
10216 pub fn set_or_clear_skaffold_supported_condition<T>(
10217 mut self,
10218 v: std::option::Option<T>,
10219 ) -> Self
10220 where
10221 T: std::convert::Into<crate::model::release::SkaffoldSupportedCondition>,
10222 {
10223 self.skaffold_supported_condition = v.map(|x| x.into());
10224 self
10225 }
10226 }
10227
10228 impl wkt::message::Message for ReleaseCondition {
10229 fn typename() -> &'static str {
10230 "type.googleapis.com/google.cloud.deploy.v1.Release.ReleaseCondition"
10231 }
10232 }
10233
10234 /// Valid states of the render operation.
10235 ///
10236 /// # Working with unknown values
10237 ///
10238 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10239 /// additional enum variants at any time. Adding new variants is not considered
10240 /// a breaking change. Applications should write their code in anticipation of:
10241 ///
10242 /// - New values appearing in future releases of the client library, **and**
10243 /// - New values received dynamically, without application changes.
10244 ///
10245 /// Please consult the [Working with enums] section in the user guide for some
10246 /// guidelines.
10247 ///
10248 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
10249 #[derive(Clone, Debug, PartialEq)]
10250 #[non_exhaustive]
10251 pub enum RenderState {
10252 /// The render state is unspecified.
10253 Unspecified,
10254 /// All rendering operations have completed successfully.
10255 Succeeded,
10256 /// All rendering operations have completed, and one or more have failed.
10257 Failed,
10258 /// Rendering has started and is not complete.
10259 InProgress,
10260 /// If set, the enum was initialized with an unknown value.
10261 ///
10262 /// Applications can examine the value using [RenderState::value] or
10263 /// [RenderState::name].
10264 UnknownValue(render_state::UnknownValue),
10265 }
10266
10267 #[doc(hidden)]
10268 pub mod render_state {
10269 #[allow(unused_imports)]
10270 use super::*;
10271 #[derive(Clone, Debug, PartialEq)]
10272 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10273 }
10274
10275 impl RenderState {
10276 /// Gets the enum value.
10277 ///
10278 /// Returns `None` if the enum contains an unknown value deserialized from
10279 /// the string representation of enums.
10280 pub fn value(&self) -> std::option::Option<i32> {
10281 match self {
10282 Self::Unspecified => std::option::Option::Some(0),
10283 Self::Succeeded => std::option::Option::Some(1),
10284 Self::Failed => std::option::Option::Some(2),
10285 Self::InProgress => std::option::Option::Some(3),
10286 Self::UnknownValue(u) => u.0.value(),
10287 }
10288 }
10289
10290 /// Gets the enum value as a string.
10291 ///
10292 /// Returns `None` if the enum contains an unknown value deserialized from
10293 /// the integer representation of enums.
10294 pub fn name(&self) -> std::option::Option<&str> {
10295 match self {
10296 Self::Unspecified => std::option::Option::Some("RENDER_STATE_UNSPECIFIED"),
10297 Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
10298 Self::Failed => std::option::Option::Some("FAILED"),
10299 Self::InProgress => std::option::Option::Some("IN_PROGRESS"),
10300 Self::UnknownValue(u) => u.0.name(),
10301 }
10302 }
10303 }
10304
10305 impl std::default::Default for RenderState {
10306 fn default() -> Self {
10307 use std::convert::From;
10308 Self::from(0)
10309 }
10310 }
10311
10312 impl std::fmt::Display for RenderState {
10313 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10314 wkt::internal::display_enum(f, self.name(), self.value())
10315 }
10316 }
10317
10318 impl std::convert::From<i32> for RenderState {
10319 fn from(value: i32) -> Self {
10320 match value {
10321 0 => Self::Unspecified,
10322 1 => Self::Succeeded,
10323 2 => Self::Failed,
10324 3 => Self::InProgress,
10325 _ => Self::UnknownValue(render_state::UnknownValue(
10326 wkt::internal::UnknownEnumValue::Integer(value),
10327 )),
10328 }
10329 }
10330 }
10331
10332 impl std::convert::From<&str> for RenderState {
10333 fn from(value: &str) -> Self {
10334 use std::string::ToString;
10335 match value {
10336 "RENDER_STATE_UNSPECIFIED" => Self::Unspecified,
10337 "SUCCEEDED" => Self::Succeeded,
10338 "FAILED" => Self::Failed,
10339 "IN_PROGRESS" => Self::InProgress,
10340 _ => Self::UnknownValue(render_state::UnknownValue(
10341 wkt::internal::UnknownEnumValue::String(value.to_string()),
10342 )),
10343 }
10344 }
10345 }
10346
10347 impl serde::ser::Serialize for RenderState {
10348 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10349 where
10350 S: serde::Serializer,
10351 {
10352 match self {
10353 Self::Unspecified => serializer.serialize_i32(0),
10354 Self::Succeeded => serializer.serialize_i32(1),
10355 Self::Failed => serializer.serialize_i32(2),
10356 Self::InProgress => serializer.serialize_i32(3),
10357 Self::UnknownValue(u) => u.0.serialize(serializer),
10358 }
10359 }
10360 }
10361
10362 impl<'de> serde::de::Deserialize<'de> for RenderState {
10363 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10364 where
10365 D: serde::Deserializer<'de>,
10366 {
10367 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RenderState>::new(
10368 ".google.cloud.deploy.v1.Release.RenderState",
10369 ))
10370 }
10371 }
10372}
10373
10374/// The request object for `CreateDeployPolicy`.
10375#[derive(Clone, Default, PartialEq)]
10376#[non_exhaustive]
10377pub struct CreateDeployPolicyRequest {
10378 /// Required. The parent collection in which the `DeployPolicy` must be
10379 /// created. The format is `projects/{project_id}/locations/{location_name}`.
10380 pub parent: std::string::String,
10381
10382 /// Required. ID of the `DeployPolicy`.
10383 pub deploy_policy_id: std::string::String,
10384
10385 /// Required. The `DeployPolicy` to create.
10386 pub deploy_policy: std::option::Option<crate::model::DeployPolicy>,
10387
10388 /// Optional. A request ID to identify requests. Specify a unique request ID
10389 /// so that if you must retry your request, the server knows to ignore the
10390 /// request if it has already been completed. The server guarantees that for
10391 /// at least 60 minutes after the first request.
10392 ///
10393 /// For example, consider a situation where you make an initial request and the
10394 /// request times out. If you make the request again with the same request ID,
10395 /// the server can check if original operation with the same request ID was
10396 /// received, and if so, will ignore the second request. This prevents clients
10397 /// from accidentally creating duplicate commitments.
10398 ///
10399 /// The request ID must be a valid UUID with the exception that zero UUID is
10400 /// not supported (00000000-0000-0000-0000-000000000000).
10401 pub request_id: std::string::String,
10402
10403 /// Optional. If set to true, the request is validated and the user is provided
10404 /// with an expected result, but no actual change is made.
10405 pub validate_only: bool,
10406
10407 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10408}
10409
10410impl CreateDeployPolicyRequest {
10411 /// Creates a new default instance.
10412 pub fn new() -> Self {
10413 std::default::Default::default()
10414 }
10415
10416 /// Sets the value of [parent][crate::model::CreateDeployPolicyRequest::parent].
10417 ///
10418 /// # Example
10419 /// ```ignore,no_run
10420 /// # use google_cloud_deploy_v1::model::CreateDeployPolicyRequest;
10421 /// # let project_id = "project_id";
10422 /// # let location_id = "location_id";
10423 /// let x = CreateDeployPolicyRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
10424 /// ```
10425 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10426 self.parent = v.into();
10427 self
10428 }
10429
10430 /// Sets the value of [deploy_policy_id][crate::model::CreateDeployPolicyRequest::deploy_policy_id].
10431 ///
10432 /// # Example
10433 /// ```ignore,no_run
10434 /// # use google_cloud_deploy_v1::model::CreateDeployPolicyRequest;
10435 /// let x = CreateDeployPolicyRequest::new().set_deploy_policy_id("example");
10436 /// ```
10437 pub fn set_deploy_policy_id<T: std::convert::Into<std::string::String>>(
10438 mut self,
10439 v: T,
10440 ) -> Self {
10441 self.deploy_policy_id = v.into();
10442 self
10443 }
10444
10445 /// Sets the value of [deploy_policy][crate::model::CreateDeployPolicyRequest::deploy_policy].
10446 ///
10447 /// # Example
10448 /// ```ignore,no_run
10449 /// # use google_cloud_deploy_v1::model::CreateDeployPolicyRequest;
10450 /// use google_cloud_deploy_v1::model::DeployPolicy;
10451 /// let x = CreateDeployPolicyRequest::new().set_deploy_policy(DeployPolicy::default()/* use setters */);
10452 /// ```
10453 pub fn set_deploy_policy<T>(mut self, v: T) -> Self
10454 where
10455 T: std::convert::Into<crate::model::DeployPolicy>,
10456 {
10457 self.deploy_policy = std::option::Option::Some(v.into());
10458 self
10459 }
10460
10461 /// Sets or clears the value of [deploy_policy][crate::model::CreateDeployPolicyRequest::deploy_policy].
10462 ///
10463 /// # Example
10464 /// ```ignore,no_run
10465 /// # use google_cloud_deploy_v1::model::CreateDeployPolicyRequest;
10466 /// use google_cloud_deploy_v1::model::DeployPolicy;
10467 /// let x = CreateDeployPolicyRequest::new().set_or_clear_deploy_policy(Some(DeployPolicy::default()/* use setters */));
10468 /// let x = CreateDeployPolicyRequest::new().set_or_clear_deploy_policy(None::<DeployPolicy>);
10469 /// ```
10470 pub fn set_or_clear_deploy_policy<T>(mut self, v: std::option::Option<T>) -> Self
10471 where
10472 T: std::convert::Into<crate::model::DeployPolicy>,
10473 {
10474 self.deploy_policy = v.map(|x| x.into());
10475 self
10476 }
10477
10478 /// Sets the value of [request_id][crate::model::CreateDeployPolicyRequest::request_id].
10479 ///
10480 /// # Example
10481 /// ```ignore,no_run
10482 /// # use google_cloud_deploy_v1::model::CreateDeployPolicyRequest;
10483 /// let x = CreateDeployPolicyRequest::new().set_request_id("example");
10484 /// ```
10485 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10486 self.request_id = v.into();
10487 self
10488 }
10489
10490 /// Sets the value of [validate_only][crate::model::CreateDeployPolicyRequest::validate_only].
10491 ///
10492 /// # Example
10493 /// ```ignore,no_run
10494 /// # use google_cloud_deploy_v1::model::CreateDeployPolicyRequest;
10495 /// let x = CreateDeployPolicyRequest::new().set_validate_only(true);
10496 /// ```
10497 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10498 self.validate_only = v.into();
10499 self
10500 }
10501}
10502
10503impl wkt::message::Message for CreateDeployPolicyRequest {
10504 fn typename() -> &'static str {
10505 "type.googleapis.com/google.cloud.deploy.v1.CreateDeployPolicyRequest"
10506 }
10507}
10508
10509/// The request object for `UpdateDeployPolicy`.
10510#[derive(Clone, Default, PartialEq)]
10511#[non_exhaustive]
10512pub struct UpdateDeployPolicyRequest {
10513 /// Required. Field mask is used to specify the fields to be overwritten by the
10514 /// update in the `DeployPolicy` resource. The fields specified in the
10515 /// update_mask are relative to the resource, not the full request. A field
10516 /// will be overwritten if it's in the mask. If the user doesn't provide a mask
10517 /// then all fields are overwritten.
10518 pub update_mask: std::option::Option<wkt::FieldMask>,
10519
10520 /// Required. The `DeployPolicy` to update.
10521 pub deploy_policy: std::option::Option<crate::model::DeployPolicy>,
10522
10523 /// Optional. A request ID to identify requests. Specify a unique request ID
10524 /// so that if you must retry your request, the server knows to ignore the
10525 /// request if it has already been completed. The server guarantees that for
10526 /// at least 60 minutes after the first request.
10527 ///
10528 /// For example, consider a situation where you make an initial request and the
10529 /// request times out. If you make the request again with the same request ID,
10530 /// the server can check if original operation with the same request ID was
10531 /// received, and if so, will ignore the second request. This prevents clients
10532 /// from accidentally creating duplicate commitments.
10533 ///
10534 /// The request ID must be a valid UUID with the exception that zero UUID is
10535 /// not supported (00000000-0000-0000-0000-000000000000).
10536 pub request_id: std::string::String,
10537
10538 /// Optional. If set to true, updating a `DeployPolicy` that does not exist
10539 /// will result in the creation of a new `DeployPolicy`.
10540 pub allow_missing: bool,
10541
10542 /// Optional. If set to true, the request is validated and the user is provided
10543 /// with an expected result, but no actual change is made.
10544 pub validate_only: bool,
10545
10546 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10547}
10548
10549impl UpdateDeployPolicyRequest {
10550 /// Creates a new default instance.
10551 pub fn new() -> Self {
10552 std::default::Default::default()
10553 }
10554
10555 /// Sets the value of [update_mask][crate::model::UpdateDeployPolicyRequest::update_mask].
10556 ///
10557 /// # Example
10558 /// ```ignore,no_run
10559 /// # use google_cloud_deploy_v1::model::UpdateDeployPolicyRequest;
10560 /// use wkt::FieldMask;
10561 /// let x = UpdateDeployPolicyRequest::new().set_update_mask(FieldMask::default()/* use setters */);
10562 /// ```
10563 pub fn set_update_mask<T>(mut self, v: T) -> Self
10564 where
10565 T: std::convert::Into<wkt::FieldMask>,
10566 {
10567 self.update_mask = std::option::Option::Some(v.into());
10568 self
10569 }
10570
10571 /// Sets or clears the value of [update_mask][crate::model::UpdateDeployPolicyRequest::update_mask].
10572 ///
10573 /// # Example
10574 /// ```ignore,no_run
10575 /// # use google_cloud_deploy_v1::model::UpdateDeployPolicyRequest;
10576 /// use wkt::FieldMask;
10577 /// let x = UpdateDeployPolicyRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
10578 /// let x = UpdateDeployPolicyRequest::new().set_or_clear_update_mask(None::<FieldMask>);
10579 /// ```
10580 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
10581 where
10582 T: std::convert::Into<wkt::FieldMask>,
10583 {
10584 self.update_mask = v.map(|x| x.into());
10585 self
10586 }
10587
10588 /// Sets the value of [deploy_policy][crate::model::UpdateDeployPolicyRequest::deploy_policy].
10589 ///
10590 /// # Example
10591 /// ```ignore,no_run
10592 /// # use google_cloud_deploy_v1::model::UpdateDeployPolicyRequest;
10593 /// use google_cloud_deploy_v1::model::DeployPolicy;
10594 /// let x = UpdateDeployPolicyRequest::new().set_deploy_policy(DeployPolicy::default()/* use setters */);
10595 /// ```
10596 pub fn set_deploy_policy<T>(mut self, v: T) -> Self
10597 where
10598 T: std::convert::Into<crate::model::DeployPolicy>,
10599 {
10600 self.deploy_policy = std::option::Option::Some(v.into());
10601 self
10602 }
10603
10604 /// Sets or clears the value of [deploy_policy][crate::model::UpdateDeployPolicyRequest::deploy_policy].
10605 ///
10606 /// # Example
10607 /// ```ignore,no_run
10608 /// # use google_cloud_deploy_v1::model::UpdateDeployPolicyRequest;
10609 /// use google_cloud_deploy_v1::model::DeployPolicy;
10610 /// let x = UpdateDeployPolicyRequest::new().set_or_clear_deploy_policy(Some(DeployPolicy::default()/* use setters */));
10611 /// let x = UpdateDeployPolicyRequest::new().set_or_clear_deploy_policy(None::<DeployPolicy>);
10612 /// ```
10613 pub fn set_or_clear_deploy_policy<T>(mut self, v: std::option::Option<T>) -> Self
10614 where
10615 T: std::convert::Into<crate::model::DeployPolicy>,
10616 {
10617 self.deploy_policy = v.map(|x| x.into());
10618 self
10619 }
10620
10621 /// Sets the value of [request_id][crate::model::UpdateDeployPolicyRequest::request_id].
10622 ///
10623 /// # Example
10624 /// ```ignore,no_run
10625 /// # use google_cloud_deploy_v1::model::UpdateDeployPolicyRequest;
10626 /// let x = UpdateDeployPolicyRequest::new().set_request_id("example");
10627 /// ```
10628 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10629 self.request_id = v.into();
10630 self
10631 }
10632
10633 /// Sets the value of [allow_missing][crate::model::UpdateDeployPolicyRequest::allow_missing].
10634 ///
10635 /// # Example
10636 /// ```ignore,no_run
10637 /// # use google_cloud_deploy_v1::model::UpdateDeployPolicyRequest;
10638 /// let x = UpdateDeployPolicyRequest::new().set_allow_missing(true);
10639 /// ```
10640 pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10641 self.allow_missing = v.into();
10642 self
10643 }
10644
10645 /// Sets the value of [validate_only][crate::model::UpdateDeployPolicyRequest::validate_only].
10646 ///
10647 /// # Example
10648 /// ```ignore,no_run
10649 /// # use google_cloud_deploy_v1::model::UpdateDeployPolicyRequest;
10650 /// let x = UpdateDeployPolicyRequest::new().set_validate_only(true);
10651 /// ```
10652 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10653 self.validate_only = v.into();
10654 self
10655 }
10656}
10657
10658impl wkt::message::Message for UpdateDeployPolicyRequest {
10659 fn typename() -> &'static str {
10660 "type.googleapis.com/google.cloud.deploy.v1.UpdateDeployPolicyRequest"
10661 }
10662}
10663
10664/// The request object for `DeleteDeployPolicy`.
10665#[derive(Clone, Default, PartialEq)]
10666#[non_exhaustive]
10667pub struct DeleteDeployPolicyRequest {
10668 /// Required. The name of the `DeployPolicy` to delete. The format is
10669 /// `projects/{project_id}/locations/{location_name}/deployPolicies/{deploy_policy_name}`.
10670 pub name: std::string::String,
10671
10672 /// Optional. A request ID to identify requests. Specify a unique request ID
10673 /// so that if you must retry your request, the server knows to ignore the
10674 /// request if it has already been completed. The server guarantees that for
10675 /// at least 60 minutes after the first request.
10676 ///
10677 /// For example, consider a situation where you make an initial request and the
10678 /// request times out. If you make the request again with the same request ID,
10679 /// the server can check if original operation with the same request ID was
10680 /// received, and if so, will ignore the second request. This prevents clients
10681 /// from accidentally creating duplicate commitments.
10682 ///
10683 /// The request ID must be a valid UUID with the exception that zero UUID is
10684 /// not supported (00000000-0000-0000-0000-000000000000).
10685 pub request_id: std::string::String,
10686
10687 /// Optional. If set to true, then deleting an already deleted or non-existing
10688 /// `DeployPolicy` will succeed.
10689 pub allow_missing: bool,
10690
10691 /// Optional. If set, validate the request and preview the review, but do not
10692 /// actually post it.
10693 pub validate_only: bool,
10694
10695 /// Optional. This checksum is computed by the server based on the value of
10696 /// other fields, and may be sent on update and delete requests to ensure the
10697 /// client has an up-to-date value before proceeding.
10698 pub etag: std::string::String,
10699
10700 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10701}
10702
10703impl DeleteDeployPolicyRequest {
10704 /// Creates a new default instance.
10705 pub fn new() -> Self {
10706 std::default::Default::default()
10707 }
10708
10709 /// Sets the value of [name][crate::model::DeleteDeployPolicyRequest::name].
10710 ///
10711 /// # Example
10712 /// ```ignore,no_run
10713 /// # use google_cloud_deploy_v1::model::DeleteDeployPolicyRequest;
10714 /// # let project_id = "project_id";
10715 /// # let location_id = "location_id";
10716 /// # let deploy_policy_id = "deploy_policy_id";
10717 /// let x = DeleteDeployPolicyRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/deployPolicies/{deploy_policy_id}"));
10718 /// ```
10719 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10720 self.name = v.into();
10721 self
10722 }
10723
10724 /// Sets the value of [request_id][crate::model::DeleteDeployPolicyRequest::request_id].
10725 ///
10726 /// # Example
10727 /// ```ignore,no_run
10728 /// # use google_cloud_deploy_v1::model::DeleteDeployPolicyRequest;
10729 /// let x = DeleteDeployPolicyRequest::new().set_request_id("example");
10730 /// ```
10731 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10732 self.request_id = v.into();
10733 self
10734 }
10735
10736 /// Sets the value of [allow_missing][crate::model::DeleteDeployPolicyRequest::allow_missing].
10737 ///
10738 /// # Example
10739 /// ```ignore,no_run
10740 /// # use google_cloud_deploy_v1::model::DeleteDeployPolicyRequest;
10741 /// let x = DeleteDeployPolicyRequest::new().set_allow_missing(true);
10742 /// ```
10743 pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10744 self.allow_missing = v.into();
10745 self
10746 }
10747
10748 /// Sets the value of [validate_only][crate::model::DeleteDeployPolicyRequest::validate_only].
10749 ///
10750 /// # Example
10751 /// ```ignore,no_run
10752 /// # use google_cloud_deploy_v1::model::DeleteDeployPolicyRequest;
10753 /// let x = DeleteDeployPolicyRequest::new().set_validate_only(true);
10754 /// ```
10755 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10756 self.validate_only = v.into();
10757 self
10758 }
10759
10760 /// Sets the value of [etag][crate::model::DeleteDeployPolicyRequest::etag].
10761 ///
10762 /// # Example
10763 /// ```ignore,no_run
10764 /// # use google_cloud_deploy_v1::model::DeleteDeployPolicyRequest;
10765 /// let x = DeleteDeployPolicyRequest::new().set_etag("example");
10766 /// ```
10767 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10768 self.etag = v.into();
10769 self
10770 }
10771}
10772
10773impl wkt::message::Message for DeleteDeployPolicyRequest {
10774 fn typename() -> &'static str {
10775 "type.googleapis.com/google.cloud.deploy.v1.DeleteDeployPolicyRequest"
10776 }
10777}
10778
10779/// The request object for `ListDeployPolicies`.
10780#[derive(Clone, Default, PartialEq)]
10781#[non_exhaustive]
10782pub struct ListDeployPoliciesRequest {
10783 /// Required. The parent, which owns this collection of deploy policies. Format
10784 /// must be `projects/{project_id}/locations/{location_name}`.
10785 pub parent: std::string::String,
10786
10787 /// The maximum number of deploy policies to return. The service may return
10788 /// fewer than this value. If unspecified, at most 50 deploy policies will
10789 /// be returned. The maximum value is 1000; values above 1000 will be set
10790 /// to 1000.
10791 pub page_size: i32,
10792
10793 /// A page token, received from a previous `ListDeployPolicies` call.
10794 /// Provide this to retrieve the subsequent page.
10795 ///
10796 /// When paginating, all other provided parameters match
10797 /// the call that provided the page token.
10798 pub page_token: std::string::String,
10799
10800 /// Filter deploy policies to be returned. See <https://google.aip.dev/160> for
10801 /// more details. All fields can be used in the filter.
10802 pub filter: std::string::String,
10803
10804 /// Field to sort by. See <https://google.aip.dev/132#ordering> for more details.
10805 pub order_by: std::string::String,
10806
10807 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10808}
10809
10810impl ListDeployPoliciesRequest {
10811 /// Creates a new default instance.
10812 pub fn new() -> Self {
10813 std::default::Default::default()
10814 }
10815
10816 /// Sets the value of [parent][crate::model::ListDeployPoliciesRequest::parent].
10817 ///
10818 /// # Example
10819 /// ```ignore,no_run
10820 /// # use google_cloud_deploy_v1::model::ListDeployPoliciesRequest;
10821 /// # let project_id = "project_id";
10822 /// # let location_id = "location_id";
10823 /// let x = ListDeployPoliciesRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
10824 /// ```
10825 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10826 self.parent = v.into();
10827 self
10828 }
10829
10830 /// Sets the value of [page_size][crate::model::ListDeployPoliciesRequest::page_size].
10831 ///
10832 /// # Example
10833 /// ```ignore,no_run
10834 /// # use google_cloud_deploy_v1::model::ListDeployPoliciesRequest;
10835 /// let x = ListDeployPoliciesRequest::new().set_page_size(42);
10836 /// ```
10837 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10838 self.page_size = v.into();
10839 self
10840 }
10841
10842 /// Sets the value of [page_token][crate::model::ListDeployPoliciesRequest::page_token].
10843 ///
10844 /// # Example
10845 /// ```ignore,no_run
10846 /// # use google_cloud_deploy_v1::model::ListDeployPoliciesRequest;
10847 /// let x = ListDeployPoliciesRequest::new().set_page_token("example");
10848 /// ```
10849 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10850 self.page_token = v.into();
10851 self
10852 }
10853
10854 /// Sets the value of [filter][crate::model::ListDeployPoliciesRequest::filter].
10855 ///
10856 /// # Example
10857 /// ```ignore,no_run
10858 /// # use google_cloud_deploy_v1::model::ListDeployPoliciesRequest;
10859 /// let x = ListDeployPoliciesRequest::new().set_filter("example");
10860 /// ```
10861 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10862 self.filter = v.into();
10863 self
10864 }
10865
10866 /// Sets the value of [order_by][crate::model::ListDeployPoliciesRequest::order_by].
10867 ///
10868 /// # Example
10869 /// ```ignore,no_run
10870 /// # use google_cloud_deploy_v1::model::ListDeployPoliciesRequest;
10871 /// let x = ListDeployPoliciesRequest::new().set_order_by("example");
10872 /// ```
10873 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10874 self.order_by = v.into();
10875 self
10876 }
10877}
10878
10879impl wkt::message::Message for ListDeployPoliciesRequest {
10880 fn typename() -> &'static str {
10881 "type.googleapis.com/google.cloud.deploy.v1.ListDeployPoliciesRequest"
10882 }
10883}
10884
10885/// The response object from `ListDeployPolicies`.
10886#[derive(Clone, Default, PartialEq)]
10887#[non_exhaustive]
10888pub struct ListDeployPoliciesResponse {
10889 /// The `DeployPolicy` objects.
10890 pub deploy_policies: std::vec::Vec<crate::model::DeployPolicy>,
10891
10892 /// A token, which can be sent as `page_token` to retrieve the next page.
10893 /// If this field is omitted, there are no subsequent pages.
10894 pub next_page_token: std::string::String,
10895
10896 /// Locations that could not be reached.
10897 pub unreachable: std::vec::Vec<std::string::String>,
10898
10899 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10900}
10901
10902impl ListDeployPoliciesResponse {
10903 /// Creates a new default instance.
10904 pub fn new() -> Self {
10905 std::default::Default::default()
10906 }
10907
10908 /// Sets the value of [deploy_policies][crate::model::ListDeployPoliciesResponse::deploy_policies].
10909 ///
10910 /// # Example
10911 /// ```ignore,no_run
10912 /// # use google_cloud_deploy_v1::model::ListDeployPoliciesResponse;
10913 /// use google_cloud_deploy_v1::model::DeployPolicy;
10914 /// let x = ListDeployPoliciesResponse::new()
10915 /// .set_deploy_policies([
10916 /// DeployPolicy::default()/* use setters */,
10917 /// DeployPolicy::default()/* use (different) setters */,
10918 /// ]);
10919 /// ```
10920 pub fn set_deploy_policies<T, V>(mut self, v: T) -> Self
10921 where
10922 T: std::iter::IntoIterator<Item = V>,
10923 V: std::convert::Into<crate::model::DeployPolicy>,
10924 {
10925 use std::iter::Iterator;
10926 self.deploy_policies = v.into_iter().map(|i| i.into()).collect();
10927 self
10928 }
10929
10930 /// Sets the value of [next_page_token][crate::model::ListDeployPoliciesResponse::next_page_token].
10931 ///
10932 /// # Example
10933 /// ```ignore,no_run
10934 /// # use google_cloud_deploy_v1::model::ListDeployPoliciesResponse;
10935 /// let x = ListDeployPoliciesResponse::new().set_next_page_token("example");
10936 /// ```
10937 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10938 self.next_page_token = v.into();
10939 self
10940 }
10941
10942 /// Sets the value of [unreachable][crate::model::ListDeployPoliciesResponse::unreachable].
10943 ///
10944 /// # Example
10945 /// ```ignore,no_run
10946 /// # use google_cloud_deploy_v1::model::ListDeployPoliciesResponse;
10947 /// let x = ListDeployPoliciesResponse::new().set_unreachable(["a", "b", "c"]);
10948 /// ```
10949 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
10950 where
10951 T: std::iter::IntoIterator<Item = V>,
10952 V: std::convert::Into<std::string::String>,
10953 {
10954 use std::iter::Iterator;
10955 self.unreachable = v.into_iter().map(|i| i.into()).collect();
10956 self
10957 }
10958}
10959
10960impl wkt::message::Message for ListDeployPoliciesResponse {
10961 fn typename() -> &'static str {
10962 "type.googleapis.com/google.cloud.deploy.v1.ListDeployPoliciesResponse"
10963 }
10964}
10965
10966#[doc(hidden)]
10967impl google_cloud_gax::paginator::internal::PageableResponse for ListDeployPoliciesResponse {
10968 type PageItem = crate::model::DeployPolicy;
10969
10970 fn items(self) -> std::vec::Vec<Self::PageItem> {
10971 self.deploy_policies
10972 }
10973
10974 fn next_page_token(&self) -> std::string::String {
10975 use std::clone::Clone;
10976 self.next_page_token.clone()
10977 }
10978}
10979
10980/// The request object for `GetDeployPolicy`
10981#[derive(Clone, Default, PartialEq)]
10982#[non_exhaustive]
10983pub struct GetDeployPolicyRequest {
10984 /// Required. Name of the `DeployPolicy`. Format must be
10985 /// `projects/{project_id}/locations/{location_name}/deployPolicies/{deploy_policy_name}`.
10986 pub name: std::string::String,
10987
10988 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10989}
10990
10991impl GetDeployPolicyRequest {
10992 /// Creates a new default instance.
10993 pub fn new() -> Self {
10994 std::default::Default::default()
10995 }
10996
10997 /// Sets the value of [name][crate::model::GetDeployPolicyRequest::name].
10998 ///
10999 /// # Example
11000 /// ```ignore,no_run
11001 /// # use google_cloud_deploy_v1::model::GetDeployPolicyRequest;
11002 /// # let project_id = "project_id";
11003 /// # let location_id = "location_id";
11004 /// # let deploy_policy_id = "deploy_policy_id";
11005 /// let x = GetDeployPolicyRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/deployPolicies/{deploy_policy_id}"));
11006 /// ```
11007 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11008 self.name = v.into();
11009 self
11010 }
11011}
11012
11013impl wkt::message::Message for GetDeployPolicyRequest {
11014 fn typename() -> &'static str {
11015 "type.googleapis.com/google.cloud.deploy.v1.GetDeployPolicyRequest"
11016 }
11017}
11018
11019/// Description of an a image to use during Skaffold rendering.
11020#[derive(Clone, Default, PartialEq)]
11021#[non_exhaustive]
11022pub struct BuildArtifact {
11023 /// Optional. Image name in Skaffold configuration.
11024 pub image: std::string::String,
11025
11026 /// Optional. Image tag to use. This will generally be the full path to an
11027 /// image, such as "gcr.io/my-project/busybox:1.2.3" or
11028 /// "gcr.io/my-project/busybox@sha256:abc123".
11029 pub tag: std::string::String,
11030
11031 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11032}
11033
11034impl BuildArtifact {
11035 /// Creates a new default instance.
11036 pub fn new() -> Self {
11037 std::default::Default::default()
11038 }
11039
11040 /// Sets the value of [image][crate::model::BuildArtifact::image].
11041 ///
11042 /// # Example
11043 /// ```ignore,no_run
11044 /// # use google_cloud_deploy_v1::model::BuildArtifact;
11045 /// let x = BuildArtifact::new().set_image("example");
11046 /// ```
11047 pub fn set_image<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11048 self.image = v.into();
11049 self
11050 }
11051
11052 /// Sets the value of [tag][crate::model::BuildArtifact::tag].
11053 ///
11054 /// # Example
11055 /// ```ignore,no_run
11056 /// # use google_cloud_deploy_v1::model::BuildArtifact;
11057 /// let x = BuildArtifact::new().set_tag("example");
11058 /// ```
11059 pub fn set_tag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11060 self.tag = v.into();
11061 self
11062 }
11063}
11064
11065impl wkt::message::Message for BuildArtifact {
11066 fn typename() -> &'static str {
11067 "type.googleapis.com/google.cloud.deploy.v1.BuildArtifact"
11068 }
11069}
11070
11071/// The artifacts produced by a target render operation.
11072#[derive(Clone, Default, PartialEq)]
11073#[non_exhaustive]
11074pub struct TargetArtifact {
11075 /// Output only. File path of the resolved Skaffold configuration for the
11076 /// stable phase, relative to the URI.
11077 pub skaffold_config_path: std::string::String,
11078
11079 /// Output only. File path of the rendered manifest relative to the URI for the
11080 /// stable phase.
11081 pub manifest_path: std::string::String,
11082
11083 /// Output only. Map from the phase ID to the phase artifacts for the `Target`.
11084 pub phase_artifacts: std::collections::HashMap<
11085 std::string::String,
11086 crate::model::target_artifact::PhaseArtifact,
11087 >,
11088
11089 #[allow(missing_docs)]
11090 pub uri: std::option::Option<crate::model::target_artifact::Uri>,
11091
11092 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11093}
11094
11095impl TargetArtifact {
11096 /// Creates a new default instance.
11097 pub fn new() -> Self {
11098 std::default::Default::default()
11099 }
11100
11101 /// Sets the value of [skaffold_config_path][crate::model::TargetArtifact::skaffold_config_path].
11102 ///
11103 /// # Example
11104 /// ```ignore,no_run
11105 /// # use google_cloud_deploy_v1::model::TargetArtifact;
11106 /// let x = TargetArtifact::new().set_skaffold_config_path("example");
11107 /// ```
11108 pub fn set_skaffold_config_path<T: std::convert::Into<std::string::String>>(
11109 mut self,
11110 v: T,
11111 ) -> Self {
11112 self.skaffold_config_path = v.into();
11113 self
11114 }
11115
11116 /// Sets the value of [manifest_path][crate::model::TargetArtifact::manifest_path].
11117 ///
11118 /// # Example
11119 /// ```ignore,no_run
11120 /// # use google_cloud_deploy_v1::model::TargetArtifact;
11121 /// let x = TargetArtifact::new().set_manifest_path("example");
11122 /// ```
11123 pub fn set_manifest_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11124 self.manifest_path = v.into();
11125 self
11126 }
11127
11128 /// Sets the value of [phase_artifacts][crate::model::TargetArtifact::phase_artifacts].
11129 ///
11130 /// # Example
11131 /// ```ignore,no_run
11132 /// # use google_cloud_deploy_v1::model::TargetArtifact;
11133 /// use google_cloud_deploy_v1::model::target_artifact::PhaseArtifact;
11134 /// let x = TargetArtifact::new().set_phase_artifacts([
11135 /// ("key0", PhaseArtifact::default()/* use setters */),
11136 /// ("key1", PhaseArtifact::default()/* use (different) setters */),
11137 /// ]);
11138 /// ```
11139 pub fn set_phase_artifacts<T, K, V>(mut self, v: T) -> Self
11140 where
11141 T: std::iter::IntoIterator<Item = (K, V)>,
11142 K: std::convert::Into<std::string::String>,
11143 V: std::convert::Into<crate::model::target_artifact::PhaseArtifact>,
11144 {
11145 use std::iter::Iterator;
11146 self.phase_artifacts = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
11147 self
11148 }
11149
11150 /// Sets the value of [uri][crate::model::TargetArtifact::uri].
11151 ///
11152 /// Note that all the setters affecting `uri` are mutually
11153 /// exclusive.
11154 ///
11155 /// # Example
11156 /// ```ignore,no_run
11157 /// # use google_cloud_deploy_v1::model::TargetArtifact;
11158 /// use google_cloud_deploy_v1::model::target_artifact::Uri;
11159 /// let x = TargetArtifact::new().set_uri(Some(Uri::ArtifactUri("example".to_string())));
11160 /// ```
11161 pub fn set_uri<
11162 T: std::convert::Into<std::option::Option<crate::model::target_artifact::Uri>>,
11163 >(
11164 mut self,
11165 v: T,
11166 ) -> Self {
11167 self.uri = v.into();
11168 self
11169 }
11170
11171 /// The value of [uri][crate::model::TargetArtifact::uri]
11172 /// if it holds a `ArtifactUri`, `None` if the field is not set or
11173 /// holds a different branch.
11174 pub fn artifact_uri(&self) -> std::option::Option<&std::string::String> {
11175 #[allow(unreachable_patterns)]
11176 self.uri.as_ref().and_then(|v| match v {
11177 crate::model::target_artifact::Uri::ArtifactUri(v) => std::option::Option::Some(v),
11178 _ => std::option::Option::None,
11179 })
11180 }
11181
11182 /// Sets the value of [uri][crate::model::TargetArtifact::uri]
11183 /// to hold a `ArtifactUri`.
11184 ///
11185 /// Note that all the setters affecting `uri` are
11186 /// mutually exclusive.
11187 ///
11188 /// # Example
11189 /// ```ignore,no_run
11190 /// # use google_cloud_deploy_v1::model::TargetArtifact;
11191 /// let x = TargetArtifact::new().set_artifact_uri("example");
11192 /// assert!(x.artifact_uri().is_some());
11193 /// ```
11194 pub fn set_artifact_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11195 self.uri =
11196 std::option::Option::Some(crate::model::target_artifact::Uri::ArtifactUri(v.into()));
11197 self
11198 }
11199}
11200
11201impl wkt::message::Message for TargetArtifact {
11202 fn typename() -> &'static str {
11203 "type.googleapis.com/google.cloud.deploy.v1.TargetArtifact"
11204 }
11205}
11206
11207/// Defines additional types related to [TargetArtifact].
11208pub mod target_artifact {
11209 #[allow(unused_imports)]
11210 use super::*;
11211
11212 /// Contains the paths to the artifacts, relative to the URI, for a phase.
11213 #[derive(Clone, Default, PartialEq)]
11214 #[non_exhaustive]
11215 pub struct PhaseArtifact {
11216 /// Output only. File path of the resolved Skaffold configuration relative to
11217 /// the URI.
11218 pub skaffold_config_path: std::string::String,
11219
11220 /// Output only. File path of the rendered manifest relative to the URI.
11221 pub manifest_path: std::string::String,
11222
11223 /// Output only. File path of the directory of rendered job manifests
11224 /// relative to the URI. This is only set if it is applicable.
11225 pub job_manifests_path: std::string::String,
11226
11227 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11228 }
11229
11230 impl PhaseArtifact {
11231 /// Creates a new default instance.
11232 pub fn new() -> Self {
11233 std::default::Default::default()
11234 }
11235
11236 /// Sets the value of [skaffold_config_path][crate::model::target_artifact::PhaseArtifact::skaffold_config_path].
11237 ///
11238 /// # Example
11239 /// ```ignore,no_run
11240 /// # use google_cloud_deploy_v1::model::target_artifact::PhaseArtifact;
11241 /// let x = PhaseArtifact::new().set_skaffold_config_path("example");
11242 /// ```
11243 pub fn set_skaffold_config_path<T: std::convert::Into<std::string::String>>(
11244 mut self,
11245 v: T,
11246 ) -> Self {
11247 self.skaffold_config_path = v.into();
11248 self
11249 }
11250
11251 /// Sets the value of [manifest_path][crate::model::target_artifact::PhaseArtifact::manifest_path].
11252 ///
11253 /// # Example
11254 /// ```ignore,no_run
11255 /// # use google_cloud_deploy_v1::model::target_artifact::PhaseArtifact;
11256 /// let x = PhaseArtifact::new().set_manifest_path("example");
11257 /// ```
11258 pub fn set_manifest_path<T: std::convert::Into<std::string::String>>(
11259 mut self,
11260 v: T,
11261 ) -> Self {
11262 self.manifest_path = v.into();
11263 self
11264 }
11265
11266 /// Sets the value of [job_manifests_path][crate::model::target_artifact::PhaseArtifact::job_manifests_path].
11267 ///
11268 /// # Example
11269 /// ```ignore,no_run
11270 /// # use google_cloud_deploy_v1::model::target_artifact::PhaseArtifact;
11271 /// let x = PhaseArtifact::new().set_job_manifests_path("example");
11272 /// ```
11273 pub fn set_job_manifests_path<T: std::convert::Into<std::string::String>>(
11274 mut self,
11275 v: T,
11276 ) -> Self {
11277 self.job_manifests_path = v.into();
11278 self
11279 }
11280 }
11281
11282 impl wkt::message::Message for PhaseArtifact {
11283 fn typename() -> &'static str {
11284 "type.googleapis.com/google.cloud.deploy.v1.TargetArtifact.PhaseArtifact"
11285 }
11286 }
11287
11288 #[allow(missing_docs)]
11289 #[derive(Clone, Debug, PartialEq)]
11290 #[non_exhaustive]
11291 pub enum Uri {
11292 /// Output only. URI of a directory containing the artifacts. This contains
11293 /// deployment configuration used by Skaffold during a rollout, and all
11294 /// paths are relative to this location.
11295 ArtifactUri(std::string::String),
11296 }
11297}
11298
11299/// The artifacts produced by a deploy operation.
11300#[derive(Clone, Default, PartialEq)]
11301#[non_exhaustive]
11302pub struct DeployArtifact {
11303 /// Output only. URI of a directory containing the artifacts. All paths are
11304 /// relative to this location.
11305 pub artifact_uri: std::string::String,
11306
11307 /// Output only. File paths of the manifests applied during the deploy
11308 /// operation relative to the URI.
11309 pub manifest_paths: std::vec::Vec<std::string::String>,
11310
11311 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11312}
11313
11314impl DeployArtifact {
11315 /// Creates a new default instance.
11316 pub fn new() -> Self {
11317 std::default::Default::default()
11318 }
11319
11320 /// Sets the value of [artifact_uri][crate::model::DeployArtifact::artifact_uri].
11321 ///
11322 /// # Example
11323 /// ```ignore,no_run
11324 /// # use google_cloud_deploy_v1::model::DeployArtifact;
11325 /// let x = DeployArtifact::new().set_artifact_uri("example");
11326 /// ```
11327 pub fn set_artifact_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11328 self.artifact_uri = v.into();
11329 self
11330 }
11331
11332 /// Sets the value of [manifest_paths][crate::model::DeployArtifact::manifest_paths].
11333 ///
11334 /// # Example
11335 /// ```ignore,no_run
11336 /// # use google_cloud_deploy_v1::model::DeployArtifact;
11337 /// let x = DeployArtifact::new().set_manifest_paths(["a", "b", "c"]);
11338 /// ```
11339 pub fn set_manifest_paths<T, V>(mut self, v: T) -> Self
11340 where
11341 T: std::iter::IntoIterator<Item = V>,
11342 V: std::convert::Into<std::string::String>,
11343 {
11344 use std::iter::Iterator;
11345 self.manifest_paths = v.into_iter().map(|i| i.into()).collect();
11346 self
11347 }
11348}
11349
11350impl wkt::message::Message for DeployArtifact {
11351 fn typename() -> &'static str {
11352 "type.googleapis.com/google.cloud.deploy.v1.DeployArtifact"
11353 }
11354}
11355
11356/// CloudRunRenderMetadata contains Cloud Run information associated with a
11357/// `Release` render.
11358#[derive(Clone, Default, PartialEq)]
11359#[non_exhaustive]
11360pub struct CloudRunRenderMetadata {
11361 /// Output only. The name of the Cloud Run Service in the rendered manifest.
11362 /// Format is `projects/{project}/locations/{location}/services/{service}`.
11363 pub service: std::string::String,
11364
11365 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11366}
11367
11368impl CloudRunRenderMetadata {
11369 /// Creates a new default instance.
11370 pub fn new() -> Self {
11371 std::default::Default::default()
11372 }
11373
11374 /// Sets the value of [service][crate::model::CloudRunRenderMetadata::service].
11375 ///
11376 /// # Example
11377 /// ```ignore,no_run
11378 /// # use google_cloud_deploy_v1::model::CloudRunRenderMetadata;
11379 /// let x = CloudRunRenderMetadata::new().set_service("example");
11380 /// ```
11381 pub fn set_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11382 self.service = v.into();
11383 self
11384 }
11385}
11386
11387impl wkt::message::Message for CloudRunRenderMetadata {
11388 fn typename() -> &'static str {
11389 "type.googleapis.com/google.cloud.deploy.v1.CloudRunRenderMetadata"
11390 }
11391}
11392
11393/// RenderMetadata includes information associated with a `Release` render.
11394#[derive(Clone, Default, PartialEq)]
11395#[non_exhaustive]
11396pub struct RenderMetadata {
11397 /// Output only. Metadata associated with rendering for Cloud Run.
11398 pub cloud_run: std::option::Option<crate::model::CloudRunRenderMetadata>,
11399
11400 /// Output only. Custom metadata provided by user-defined render operation.
11401 pub custom: std::option::Option<crate::model::CustomMetadata>,
11402
11403 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11404}
11405
11406impl RenderMetadata {
11407 /// Creates a new default instance.
11408 pub fn new() -> Self {
11409 std::default::Default::default()
11410 }
11411
11412 /// Sets the value of [cloud_run][crate::model::RenderMetadata::cloud_run].
11413 ///
11414 /// # Example
11415 /// ```ignore,no_run
11416 /// # use google_cloud_deploy_v1::model::RenderMetadata;
11417 /// use google_cloud_deploy_v1::model::CloudRunRenderMetadata;
11418 /// let x = RenderMetadata::new().set_cloud_run(CloudRunRenderMetadata::default()/* use setters */);
11419 /// ```
11420 pub fn set_cloud_run<T>(mut self, v: T) -> Self
11421 where
11422 T: std::convert::Into<crate::model::CloudRunRenderMetadata>,
11423 {
11424 self.cloud_run = std::option::Option::Some(v.into());
11425 self
11426 }
11427
11428 /// Sets or clears the value of [cloud_run][crate::model::RenderMetadata::cloud_run].
11429 ///
11430 /// # Example
11431 /// ```ignore,no_run
11432 /// # use google_cloud_deploy_v1::model::RenderMetadata;
11433 /// use google_cloud_deploy_v1::model::CloudRunRenderMetadata;
11434 /// let x = RenderMetadata::new().set_or_clear_cloud_run(Some(CloudRunRenderMetadata::default()/* use setters */));
11435 /// let x = RenderMetadata::new().set_or_clear_cloud_run(None::<CloudRunRenderMetadata>);
11436 /// ```
11437 pub fn set_or_clear_cloud_run<T>(mut self, v: std::option::Option<T>) -> Self
11438 where
11439 T: std::convert::Into<crate::model::CloudRunRenderMetadata>,
11440 {
11441 self.cloud_run = v.map(|x| x.into());
11442 self
11443 }
11444
11445 /// Sets the value of [custom][crate::model::RenderMetadata::custom].
11446 ///
11447 /// # Example
11448 /// ```ignore,no_run
11449 /// # use google_cloud_deploy_v1::model::RenderMetadata;
11450 /// use google_cloud_deploy_v1::model::CustomMetadata;
11451 /// let x = RenderMetadata::new().set_custom(CustomMetadata::default()/* use setters */);
11452 /// ```
11453 pub fn set_custom<T>(mut self, v: T) -> Self
11454 where
11455 T: std::convert::Into<crate::model::CustomMetadata>,
11456 {
11457 self.custom = std::option::Option::Some(v.into());
11458 self
11459 }
11460
11461 /// Sets or clears the value of [custom][crate::model::RenderMetadata::custom].
11462 ///
11463 /// # Example
11464 /// ```ignore,no_run
11465 /// # use google_cloud_deploy_v1::model::RenderMetadata;
11466 /// use google_cloud_deploy_v1::model::CustomMetadata;
11467 /// let x = RenderMetadata::new().set_or_clear_custom(Some(CustomMetadata::default()/* use setters */));
11468 /// let x = RenderMetadata::new().set_or_clear_custom(None::<CustomMetadata>);
11469 /// ```
11470 pub fn set_or_clear_custom<T>(mut self, v: std::option::Option<T>) -> Self
11471 where
11472 T: std::convert::Into<crate::model::CustomMetadata>,
11473 {
11474 self.custom = v.map(|x| x.into());
11475 self
11476 }
11477}
11478
11479impl wkt::message::Message for RenderMetadata {
11480 fn typename() -> &'static str {
11481 "type.googleapis.com/google.cloud.deploy.v1.RenderMetadata"
11482 }
11483}
11484
11485/// The request object for `ListReleases`.
11486#[derive(Clone, Default, PartialEq)]
11487#[non_exhaustive]
11488pub struct ListReleasesRequest {
11489 /// Required. The `DeliveryPipeline` which owns this collection of `Release`
11490 /// objects.
11491 pub parent: std::string::String,
11492
11493 /// Optional. The maximum number of `Release` objects to return. The service
11494 /// may return fewer than this value. If unspecified, at most 50 `Release`
11495 /// objects will be returned. The maximum value is 1000; values above 1000 will
11496 /// be set to 1000.
11497 pub page_size: i32,
11498
11499 /// Optional. A page token, received from a previous `ListReleases` call.
11500 /// Provide this to retrieve the subsequent page.
11501 ///
11502 /// When paginating, all other provided parameters match
11503 /// the call that provided the page token.
11504 pub page_token: std::string::String,
11505
11506 /// Optional. Filter releases to be returned. See <https://google.aip.dev/160>
11507 /// for more details.
11508 pub filter: std::string::String,
11509
11510 /// Optional. Field to sort by. See <https://google.aip.dev/132#ordering> for
11511 /// more details.
11512 pub order_by: std::string::String,
11513
11514 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11515}
11516
11517impl ListReleasesRequest {
11518 /// Creates a new default instance.
11519 pub fn new() -> Self {
11520 std::default::Default::default()
11521 }
11522
11523 /// Sets the value of [parent][crate::model::ListReleasesRequest::parent].
11524 ///
11525 /// # Example
11526 /// ```ignore,no_run
11527 /// # use google_cloud_deploy_v1::model::ListReleasesRequest;
11528 /// # let project_id = "project_id";
11529 /// # let location_id = "location_id";
11530 /// # let delivery_pipeline_id = "delivery_pipeline_id";
11531 /// let x = ListReleasesRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/deliveryPipelines/{delivery_pipeline_id}"));
11532 /// ```
11533 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11534 self.parent = v.into();
11535 self
11536 }
11537
11538 /// Sets the value of [page_size][crate::model::ListReleasesRequest::page_size].
11539 ///
11540 /// # Example
11541 /// ```ignore,no_run
11542 /// # use google_cloud_deploy_v1::model::ListReleasesRequest;
11543 /// let x = ListReleasesRequest::new().set_page_size(42);
11544 /// ```
11545 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11546 self.page_size = v.into();
11547 self
11548 }
11549
11550 /// Sets the value of [page_token][crate::model::ListReleasesRequest::page_token].
11551 ///
11552 /// # Example
11553 /// ```ignore,no_run
11554 /// # use google_cloud_deploy_v1::model::ListReleasesRequest;
11555 /// let x = ListReleasesRequest::new().set_page_token("example");
11556 /// ```
11557 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11558 self.page_token = v.into();
11559 self
11560 }
11561
11562 /// Sets the value of [filter][crate::model::ListReleasesRequest::filter].
11563 ///
11564 /// # Example
11565 /// ```ignore,no_run
11566 /// # use google_cloud_deploy_v1::model::ListReleasesRequest;
11567 /// let x = ListReleasesRequest::new().set_filter("example");
11568 /// ```
11569 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11570 self.filter = v.into();
11571 self
11572 }
11573
11574 /// Sets the value of [order_by][crate::model::ListReleasesRequest::order_by].
11575 ///
11576 /// # Example
11577 /// ```ignore,no_run
11578 /// # use google_cloud_deploy_v1::model::ListReleasesRequest;
11579 /// let x = ListReleasesRequest::new().set_order_by("example");
11580 /// ```
11581 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11582 self.order_by = v.into();
11583 self
11584 }
11585}
11586
11587impl wkt::message::Message for ListReleasesRequest {
11588 fn typename() -> &'static str {
11589 "type.googleapis.com/google.cloud.deploy.v1.ListReleasesRequest"
11590 }
11591}
11592
11593/// The response object from `ListReleases`.
11594#[derive(Clone, Default, PartialEq)]
11595#[non_exhaustive]
11596pub struct ListReleasesResponse {
11597 /// The `Release` objects.
11598 pub releases: std::vec::Vec<crate::model::Release>,
11599
11600 /// A token, which can be sent as `page_token` to retrieve the next page.
11601 /// If this field is omitted, there are no subsequent pages.
11602 pub next_page_token: std::string::String,
11603
11604 /// Locations that could not be reached.
11605 pub unreachable: std::vec::Vec<std::string::String>,
11606
11607 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11608}
11609
11610impl ListReleasesResponse {
11611 /// Creates a new default instance.
11612 pub fn new() -> Self {
11613 std::default::Default::default()
11614 }
11615
11616 /// Sets the value of [releases][crate::model::ListReleasesResponse::releases].
11617 ///
11618 /// # Example
11619 /// ```ignore,no_run
11620 /// # use google_cloud_deploy_v1::model::ListReleasesResponse;
11621 /// use google_cloud_deploy_v1::model::Release;
11622 /// let x = ListReleasesResponse::new()
11623 /// .set_releases([
11624 /// Release::default()/* use setters */,
11625 /// Release::default()/* use (different) setters */,
11626 /// ]);
11627 /// ```
11628 pub fn set_releases<T, V>(mut self, v: T) -> Self
11629 where
11630 T: std::iter::IntoIterator<Item = V>,
11631 V: std::convert::Into<crate::model::Release>,
11632 {
11633 use std::iter::Iterator;
11634 self.releases = v.into_iter().map(|i| i.into()).collect();
11635 self
11636 }
11637
11638 /// Sets the value of [next_page_token][crate::model::ListReleasesResponse::next_page_token].
11639 ///
11640 /// # Example
11641 /// ```ignore,no_run
11642 /// # use google_cloud_deploy_v1::model::ListReleasesResponse;
11643 /// let x = ListReleasesResponse::new().set_next_page_token("example");
11644 /// ```
11645 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11646 self.next_page_token = v.into();
11647 self
11648 }
11649
11650 /// Sets the value of [unreachable][crate::model::ListReleasesResponse::unreachable].
11651 ///
11652 /// # Example
11653 /// ```ignore,no_run
11654 /// # use google_cloud_deploy_v1::model::ListReleasesResponse;
11655 /// let x = ListReleasesResponse::new().set_unreachable(["a", "b", "c"]);
11656 /// ```
11657 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
11658 where
11659 T: std::iter::IntoIterator<Item = V>,
11660 V: std::convert::Into<std::string::String>,
11661 {
11662 use std::iter::Iterator;
11663 self.unreachable = v.into_iter().map(|i| i.into()).collect();
11664 self
11665 }
11666}
11667
11668impl wkt::message::Message for ListReleasesResponse {
11669 fn typename() -> &'static str {
11670 "type.googleapis.com/google.cloud.deploy.v1.ListReleasesResponse"
11671 }
11672}
11673
11674#[doc(hidden)]
11675impl google_cloud_gax::paginator::internal::PageableResponse for ListReleasesResponse {
11676 type PageItem = crate::model::Release;
11677
11678 fn items(self) -> std::vec::Vec<Self::PageItem> {
11679 self.releases
11680 }
11681
11682 fn next_page_token(&self) -> std::string::String {
11683 use std::clone::Clone;
11684 self.next_page_token.clone()
11685 }
11686}
11687
11688/// The request object for `GetRelease`.
11689#[derive(Clone, Default, PartialEq)]
11690#[non_exhaustive]
11691pub struct GetReleaseRequest {
11692 /// Required. Name of the `Release`. Format must be
11693 /// `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}`.
11694 pub name: std::string::String,
11695
11696 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11697}
11698
11699impl GetReleaseRequest {
11700 /// Creates a new default instance.
11701 pub fn new() -> Self {
11702 std::default::Default::default()
11703 }
11704
11705 /// Sets the value of [name][crate::model::GetReleaseRequest::name].
11706 ///
11707 /// # Example
11708 /// ```ignore,no_run
11709 /// # use google_cloud_deploy_v1::model::GetReleaseRequest;
11710 /// # let project_id = "project_id";
11711 /// # let location_id = "location_id";
11712 /// # let delivery_pipeline_id = "delivery_pipeline_id";
11713 /// # let release_id = "release_id";
11714 /// let x = GetReleaseRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/deliveryPipelines/{delivery_pipeline_id}/releases/{release_id}"));
11715 /// ```
11716 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11717 self.name = v.into();
11718 self
11719 }
11720}
11721
11722impl wkt::message::Message for GetReleaseRequest {
11723 fn typename() -> &'static str {
11724 "type.googleapis.com/google.cloud.deploy.v1.GetReleaseRequest"
11725 }
11726}
11727
11728/// The request object for `CreateRelease`,
11729#[derive(Clone, Default, PartialEq)]
11730#[non_exhaustive]
11731pub struct CreateReleaseRequest {
11732 /// Required. The parent collection in which the `Release` is created.
11733 /// The format is
11734 /// `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}`.
11735 pub parent: std::string::String,
11736
11737 /// Required. ID of the `Release`.
11738 pub release_id: std::string::String,
11739
11740 /// Required. The `Release` to create.
11741 pub release: std::option::Option<crate::model::Release>,
11742
11743 /// Optional. A request ID to identify requests. Specify a unique request ID
11744 /// so that if you must retry your request, the server knows to ignore the
11745 /// request if it has already been completed. The server guarantees that for
11746 /// at least 60 minutes after the first request.
11747 ///
11748 /// For example, consider a situation where you make an initial request and the
11749 /// request times out. If you make the request again with the same request ID,
11750 /// the server can check if original operation with the same request ID was
11751 /// received, and if so, will ignore the second request. This prevents clients
11752 /// from accidentally creating duplicate commitments.
11753 ///
11754 /// The request ID must be a valid UUID with the exception that zero UUID is
11755 /// not supported (00000000-0000-0000-0000-000000000000).
11756 pub request_id: std::string::String,
11757
11758 /// Optional. If set to true, the request is validated and the user is provided
11759 /// with an expected result, but no actual change is made.
11760 pub validate_only: bool,
11761
11762 /// Optional. Deploy policies to override. Format is
11763 /// `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`.
11764 pub override_deploy_policy: std::vec::Vec<std::string::String>,
11765
11766 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11767}
11768
11769impl CreateReleaseRequest {
11770 /// Creates a new default instance.
11771 pub fn new() -> Self {
11772 std::default::Default::default()
11773 }
11774
11775 /// Sets the value of [parent][crate::model::CreateReleaseRequest::parent].
11776 ///
11777 /// # Example
11778 /// ```ignore,no_run
11779 /// # use google_cloud_deploy_v1::model::CreateReleaseRequest;
11780 /// # let project_id = "project_id";
11781 /// # let location_id = "location_id";
11782 /// # let delivery_pipeline_id = "delivery_pipeline_id";
11783 /// let x = CreateReleaseRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/deliveryPipelines/{delivery_pipeline_id}"));
11784 /// ```
11785 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11786 self.parent = v.into();
11787 self
11788 }
11789
11790 /// Sets the value of [release_id][crate::model::CreateReleaseRequest::release_id].
11791 ///
11792 /// # Example
11793 /// ```ignore,no_run
11794 /// # use google_cloud_deploy_v1::model::CreateReleaseRequest;
11795 /// let x = CreateReleaseRequest::new().set_release_id("example");
11796 /// ```
11797 pub fn set_release_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11798 self.release_id = v.into();
11799 self
11800 }
11801
11802 /// Sets the value of [release][crate::model::CreateReleaseRequest::release].
11803 ///
11804 /// # Example
11805 /// ```ignore,no_run
11806 /// # use google_cloud_deploy_v1::model::CreateReleaseRequest;
11807 /// use google_cloud_deploy_v1::model::Release;
11808 /// let x = CreateReleaseRequest::new().set_release(Release::default()/* use setters */);
11809 /// ```
11810 pub fn set_release<T>(mut self, v: T) -> Self
11811 where
11812 T: std::convert::Into<crate::model::Release>,
11813 {
11814 self.release = std::option::Option::Some(v.into());
11815 self
11816 }
11817
11818 /// Sets or clears the value of [release][crate::model::CreateReleaseRequest::release].
11819 ///
11820 /// # Example
11821 /// ```ignore,no_run
11822 /// # use google_cloud_deploy_v1::model::CreateReleaseRequest;
11823 /// use google_cloud_deploy_v1::model::Release;
11824 /// let x = CreateReleaseRequest::new().set_or_clear_release(Some(Release::default()/* use setters */));
11825 /// let x = CreateReleaseRequest::new().set_or_clear_release(None::<Release>);
11826 /// ```
11827 pub fn set_or_clear_release<T>(mut self, v: std::option::Option<T>) -> Self
11828 where
11829 T: std::convert::Into<crate::model::Release>,
11830 {
11831 self.release = v.map(|x| x.into());
11832 self
11833 }
11834
11835 /// Sets the value of [request_id][crate::model::CreateReleaseRequest::request_id].
11836 ///
11837 /// # Example
11838 /// ```ignore,no_run
11839 /// # use google_cloud_deploy_v1::model::CreateReleaseRequest;
11840 /// let x = CreateReleaseRequest::new().set_request_id("example");
11841 /// ```
11842 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11843 self.request_id = v.into();
11844 self
11845 }
11846
11847 /// Sets the value of [validate_only][crate::model::CreateReleaseRequest::validate_only].
11848 ///
11849 /// # Example
11850 /// ```ignore,no_run
11851 /// # use google_cloud_deploy_v1::model::CreateReleaseRequest;
11852 /// let x = CreateReleaseRequest::new().set_validate_only(true);
11853 /// ```
11854 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
11855 self.validate_only = v.into();
11856 self
11857 }
11858
11859 /// Sets the value of [override_deploy_policy][crate::model::CreateReleaseRequest::override_deploy_policy].
11860 ///
11861 /// # Example
11862 /// ```ignore,no_run
11863 /// # use google_cloud_deploy_v1::model::CreateReleaseRequest;
11864 /// let x = CreateReleaseRequest::new().set_override_deploy_policy(["a", "b", "c"]);
11865 /// ```
11866 pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
11867 where
11868 T: std::iter::IntoIterator<Item = V>,
11869 V: std::convert::Into<std::string::String>,
11870 {
11871 use std::iter::Iterator;
11872 self.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
11873 self
11874 }
11875}
11876
11877impl wkt::message::Message for CreateReleaseRequest {
11878 fn typename() -> &'static str {
11879 "type.googleapis.com/google.cloud.deploy.v1.CreateReleaseRequest"
11880 }
11881}
11882
11883/// A `Rollout` resource in the Cloud Deploy API.
11884///
11885/// A `Rollout` contains information around a specific deployment to a `Target`.
11886#[derive(Clone, Default, PartialEq)]
11887#[non_exhaustive]
11888pub struct Rollout {
11889 /// Identifier. Name of the `Rollout`. Format is
11890 /// `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`.
11891 /// The `rollout` component must match `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`
11892 pub name: std::string::String,
11893
11894 /// Output only. Unique identifier of the `Rollout`.
11895 pub uid: std::string::String,
11896
11897 /// Optional. Description of the `Rollout` for user purposes. Max length is 255
11898 /// characters.
11899 pub description: std::string::String,
11900
11901 /// Optional. User annotations. These attributes can only be set and used by
11902 /// the user, and not by Cloud Deploy. See
11903 /// <https://google.aip.dev/128#annotations> for more details such as format and
11904 /// size limitations.
11905 pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
11906
11907 /// Labels are attributes that can be set and used by both the
11908 /// user and by Cloud Deploy. Labels must meet the following constraints:
11909 ///
11910 /// * Keys and values can contain only lowercase letters, numeric characters,
11911 /// underscores, and dashes.
11912 /// * All characters must use UTF-8 encoding, and international characters are
11913 /// allowed.
11914 /// * Keys must start with a lowercase letter or international character.
11915 /// * Each resource is limited to a maximum of 64 labels.
11916 ///
11917 /// Both keys and values are additionally constrained to be <= 128 bytes.
11918 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
11919
11920 /// Output only. Time at which the `Rollout` was created.
11921 pub create_time: std::option::Option<wkt::Timestamp>,
11922
11923 /// Output only. Time at which the `Rollout` was approved.
11924 pub approve_time: std::option::Option<wkt::Timestamp>,
11925
11926 /// Output only. Time at which the `Rollout` was enqueued.
11927 pub enqueue_time: std::option::Option<wkt::Timestamp>,
11928
11929 /// Output only. Time at which the `Rollout` started deploying.
11930 pub deploy_start_time: std::option::Option<wkt::Timestamp>,
11931
11932 /// Output only. Time at which the `Rollout` finished deploying.
11933 pub deploy_end_time: std::option::Option<wkt::Timestamp>,
11934
11935 /// Required. The ID of Target to which this `Rollout` is deploying.
11936 pub target_id: std::string::String,
11937
11938 /// Output only. Approval state of the `Rollout`.
11939 pub approval_state: crate::model::rollout::ApprovalState,
11940
11941 /// Output only. Current state of the `Rollout`.
11942 pub state: crate::model::rollout::State,
11943
11944 /// Output only. Additional information about the rollout failure, if
11945 /// available.
11946 pub failure_reason: std::string::String,
11947
11948 /// Output only. The resource name of the Cloud Build `Build` object that is
11949 /// used to deploy the Rollout. Format is
11950 /// `projects/{project}/locations/{location}/builds/{build}`.
11951 pub deploying_build: std::string::String,
11952
11953 /// This checksum is computed by the server based on the value of other
11954 /// fields, and may be sent on update and delete requests to ensure the
11955 /// client has an up-to-date value before proceeding.
11956 pub etag: std::string::String,
11957
11958 /// Output only. The reason this rollout failed. This will always be
11959 /// unspecified while the rollout is in progress.
11960 pub deploy_failure_cause: crate::model::rollout::FailureCause,
11961
11962 /// Output only. The phases that represent the workflows of this `Rollout`.
11963 pub phases: std::vec::Vec<crate::model::Phase>,
11964
11965 /// Output only. Metadata contains information about the rollout.
11966 pub metadata: std::option::Option<crate::model::Metadata>,
11967
11968 /// Output only. Name of the `ControllerRollout`. Format is
11969 /// `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`.
11970 pub controller_rollout: std::string::String,
11971
11972 /// Output only. Name of the `Rollout` that is rolled back by this `Rollout`.
11973 /// Empty if this `Rollout` wasn't created as a rollback.
11974 pub rollback_of_rollout: std::string::String,
11975
11976 /// Output only. Names of `Rollouts` that rolled back this `Rollout`.
11977 pub rolled_back_by_rollouts: std::vec::Vec<std::string::String>,
11978
11979 /// Output only. The AutomationRun actively repairing the rollout.
11980 pub active_repair_automation_run: std::string::String,
11981
11982 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11983}
11984
11985impl Rollout {
11986 /// Creates a new default instance.
11987 pub fn new() -> Self {
11988 std::default::Default::default()
11989 }
11990
11991 /// Sets the value of [name][crate::model::Rollout::name].
11992 ///
11993 /// # Example
11994 /// ```ignore,no_run
11995 /// # use google_cloud_deploy_v1::model::Rollout;
11996 /// # let project_id = "project_id";
11997 /// # let location_id = "location_id";
11998 /// # let delivery_pipeline_id = "delivery_pipeline_id";
11999 /// # let release_id = "release_id";
12000 /// # let rollout_id = "rollout_id";
12001 /// let x = Rollout::new().set_name(format!("projects/{project_id}/locations/{location_id}/deliveryPipelines/{delivery_pipeline_id}/releases/{release_id}/rollouts/{rollout_id}"));
12002 /// ```
12003 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12004 self.name = v.into();
12005 self
12006 }
12007
12008 /// Sets the value of [uid][crate::model::Rollout::uid].
12009 ///
12010 /// # Example
12011 /// ```ignore,no_run
12012 /// # use google_cloud_deploy_v1::model::Rollout;
12013 /// let x = Rollout::new().set_uid("example");
12014 /// ```
12015 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12016 self.uid = v.into();
12017 self
12018 }
12019
12020 /// Sets the value of [description][crate::model::Rollout::description].
12021 ///
12022 /// # Example
12023 /// ```ignore,no_run
12024 /// # use google_cloud_deploy_v1::model::Rollout;
12025 /// let x = Rollout::new().set_description("example");
12026 /// ```
12027 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12028 self.description = v.into();
12029 self
12030 }
12031
12032 /// Sets the value of [annotations][crate::model::Rollout::annotations].
12033 ///
12034 /// # Example
12035 /// ```ignore,no_run
12036 /// # use google_cloud_deploy_v1::model::Rollout;
12037 /// let x = Rollout::new().set_annotations([
12038 /// ("key0", "abc"),
12039 /// ("key1", "xyz"),
12040 /// ]);
12041 /// ```
12042 pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
12043 where
12044 T: std::iter::IntoIterator<Item = (K, V)>,
12045 K: std::convert::Into<std::string::String>,
12046 V: std::convert::Into<std::string::String>,
12047 {
12048 use std::iter::Iterator;
12049 self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
12050 self
12051 }
12052
12053 /// Sets the value of [labels][crate::model::Rollout::labels].
12054 ///
12055 /// # Example
12056 /// ```ignore,no_run
12057 /// # use google_cloud_deploy_v1::model::Rollout;
12058 /// let x = Rollout::new().set_labels([
12059 /// ("key0", "abc"),
12060 /// ("key1", "xyz"),
12061 /// ]);
12062 /// ```
12063 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
12064 where
12065 T: std::iter::IntoIterator<Item = (K, V)>,
12066 K: std::convert::Into<std::string::String>,
12067 V: std::convert::Into<std::string::String>,
12068 {
12069 use std::iter::Iterator;
12070 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
12071 self
12072 }
12073
12074 /// Sets the value of [create_time][crate::model::Rollout::create_time].
12075 ///
12076 /// # Example
12077 /// ```ignore,no_run
12078 /// # use google_cloud_deploy_v1::model::Rollout;
12079 /// use wkt::Timestamp;
12080 /// let x = Rollout::new().set_create_time(Timestamp::default()/* use setters */);
12081 /// ```
12082 pub fn set_create_time<T>(mut self, v: T) -> Self
12083 where
12084 T: std::convert::Into<wkt::Timestamp>,
12085 {
12086 self.create_time = std::option::Option::Some(v.into());
12087 self
12088 }
12089
12090 /// Sets or clears the value of [create_time][crate::model::Rollout::create_time].
12091 ///
12092 /// # Example
12093 /// ```ignore,no_run
12094 /// # use google_cloud_deploy_v1::model::Rollout;
12095 /// use wkt::Timestamp;
12096 /// let x = Rollout::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
12097 /// let x = Rollout::new().set_or_clear_create_time(None::<Timestamp>);
12098 /// ```
12099 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
12100 where
12101 T: std::convert::Into<wkt::Timestamp>,
12102 {
12103 self.create_time = v.map(|x| x.into());
12104 self
12105 }
12106
12107 /// Sets the value of [approve_time][crate::model::Rollout::approve_time].
12108 ///
12109 /// # Example
12110 /// ```ignore,no_run
12111 /// # use google_cloud_deploy_v1::model::Rollout;
12112 /// use wkt::Timestamp;
12113 /// let x = Rollout::new().set_approve_time(Timestamp::default()/* use setters */);
12114 /// ```
12115 pub fn set_approve_time<T>(mut self, v: T) -> Self
12116 where
12117 T: std::convert::Into<wkt::Timestamp>,
12118 {
12119 self.approve_time = std::option::Option::Some(v.into());
12120 self
12121 }
12122
12123 /// Sets or clears the value of [approve_time][crate::model::Rollout::approve_time].
12124 ///
12125 /// # Example
12126 /// ```ignore,no_run
12127 /// # use google_cloud_deploy_v1::model::Rollout;
12128 /// use wkt::Timestamp;
12129 /// let x = Rollout::new().set_or_clear_approve_time(Some(Timestamp::default()/* use setters */));
12130 /// let x = Rollout::new().set_or_clear_approve_time(None::<Timestamp>);
12131 /// ```
12132 pub fn set_or_clear_approve_time<T>(mut self, v: std::option::Option<T>) -> Self
12133 where
12134 T: std::convert::Into<wkt::Timestamp>,
12135 {
12136 self.approve_time = v.map(|x| x.into());
12137 self
12138 }
12139
12140 /// Sets the value of [enqueue_time][crate::model::Rollout::enqueue_time].
12141 ///
12142 /// # Example
12143 /// ```ignore,no_run
12144 /// # use google_cloud_deploy_v1::model::Rollout;
12145 /// use wkt::Timestamp;
12146 /// let x = Rollout::new().set_enqueue_time(Timestamp::default()/* use setters */);
12147 /// ```
12148 pub fn set_enqueue_time<T>(mut self, v: T) -> Self
12149 where
12150 T: std::convert::Into<wkt::Timestamp>,
12151 {
12152 self.enqueue_time = std::option::Option::Some(v.into());
12153 self
12154 }
12155
12156 /// Sets or clears the value of [enqueue_time][crate::model::Rollout::enqueue_time].
12157 ///
12158 /// # Example
12159 /// ```ignore,no_run
12160 /// # use google_cloud_deploy_v1::model::Rollout;
12161 /// use wkt::Timestamp;
12162 /// let x = Rollout::new().set_or_clear_enqueue_time(Some(Timestamp::default()/* use setters */));
12163 /// let x = Rollout::new().set_or_clear_enqueue_time(None::<Timestamp>);
12164 /// ```
12165 pub fn set_or_clear_enqueue_time<T>(mut self, v: std::option::Option<T>) -> Self
12166 where
12167 T: std::convert::Into<wkt::Timestamp>,
12168 {
12169 self.enqueue_time = v.map(|x| x.into());
12170 self
12171 }
12172
12173 /// Sets the value of [deploy_start_time][crate::model::Rollout::deploy_start_time].
12174 ///
12175 /// # Example
12176 /// ```ignore,no_run
12177 /// # use google_cloud_deploy_v1::model::Rollout;
12178 /// use wkt::Timestamp;
12179 /// let x = Rollout::new().set_deploy_start_time(Timestamp::default()/* use setters */);
12180 /// ```
12181 pub fn set_deploy_start_time<T>(mut self, v: T) -> Self
12182 where
12183 T: std::convert::Into<wkt::Timestamp>,
12184 {
12185 self.deploy_start_time = std::option::Option::Some(v.into());
12186 self
12187 }
12188
12189 /// Sets or clears the value of [deploy_start_time][crate::model::Rollout::deploy_start_time].
12190 ///
12191 /// # Example
12192 /// ```ignore,no_run
12193 /// # use google_cloud_deploy_v1::model::Rollout;
12194 /// use wkt::Timestamp;
12195 /// let x = Rollout::new().set_or_clear_deploy_start_time(Some(Timestamp::default()/* use setters */));
12196 /// let x = Rollout::new().set_or_clear_deploy_start_time(None::<Timestamp>);
12197 /// ```
12198 pub fn set_or_clear_deploy_start_time<T>(mut self, v: std::option::Option<T>) -> Self
12199 where
12200 T: std::convert::Into<wkt::Timestamp>,
12201 {
12202 self.deploy_start_time = v.map(|x| x.into());
12203 self
12204 }
12205
12206 /// Sets the value of [deploy_end_time][crate::model::Rollout::deploy_end_time].
12207 ///
12208 /// # Example
12209 /// ```ignore,no_run
12210 /// # use google_cloud_deploy_v1::model::Rollout;
12211 /// use wkt::Timestamp;
12212 /// let x = Rollout::new().set_deploy_end_time(Timestamp::default()/* use setters */);
12213 /// ```
12214 pub fn set_deploy_end_time<T>(mut self, v: T) -> Self
12215 where
12216 T: std::convert::Into<wkt::Timestamp>,
12217 {
12218 self.deploy_end_time = std::option::Option::Some(v.into());
12219 self
12220 }
12221
12222 /// Sets or clears the value of [deploy_end_time][crate::model::Rollout::deploy_end_time].
12223 ///
12224 /// # Example
12225 /// ```ignore,no_run
12226 /// # use google_cloud_deploy_v1::model::Rollout;
12227 /// use wkt::Timestamp;
12228 /// let x = Rollout::new().set_or_clear_deploy_end_time(Some(Timestamp::default()/* use setters */));
12229 /// let x = Rollout::new().set_or_clear_deploy_end_time(None::<Timestamp>);
12230 /// ```
12231 pub fn set_or_clear_deploy_end_time<T>(mut self, v: std::option::Option<T>) -> Self
12232 where
12233 T: std::convert::Into<wkt::Timestamp>,
12234 {
12235 self.deploy_end_time = v.map(|x| x.into());
12236 self
12237 }
12238
12239 /// Sets the value of [target_id][crate::model::Rollout::target_id].
12240 ///
12241 /// # Example
12242 /// ```ignore,no_run
12243 /// # use google_cloud_deploy_v1::model::Rollout;
12244 /// let x = Rollout::new().set_target_id("example");
12245 /// ```
12246 pub fn set_target_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12247 self.target_id = v.into();
12248 self
12249 }
12250
12251 /// Sets the value of [approval_state][crate::model::Rollout::approval_state].
12252 ///
12253 /// # Example
12254 /// ```ignore,no_run
12255 /// # use google_cloud_deploy_v1::model::Rollout;
12256 /// use google_cloud_deploy_v1::model::rollout::ApprovalState;
12257 /// let x0 = Rollout::new().set_approval_state(ApprovalState::NeedsApproval);
12258 /// let x1 = Rollout::new().set_approval_state(ApprovalState::DoesNotNeedApproval);
12259 /// let x2 = Rollout::new().set_approval_state(ApprovalState::Approved);
12260 /// ```
12261 pub fn set_approval_state<T: std::convert::Into<crate::model::rollout::ApprovalState>>(
12262 mut self,
12263 v: T,
12264 ) -> Self {
12265 self.approval_state = v.into();
12266 self
12267 }
12268
12269 /// Sets the value of [state][crate::model::Rollout::state].
12270 ///
12271 /// # Example
12272 /// ```ignore,no_run
12273 /// # use google_cloud_deploy_v1::model::Rollout;
12274 /// use google_cloud_deploy_v1::model::rollout::State;
12275 /// let x0 = Rollout::new().set_state(State::Succeeded);
12276 /// let x1 = Rollout::new().set_state(State::Failed);
12277 /// let x2 = Rollout::new().set_state(State::InProgress);
12278 /// ```
12279 pub fn set_state<T: std::convert::Into<crate::model::rollout::State>>(mut self, v: T) -> Self {
12280 self.state = v.into();
12281 self
12282 }
12283
12284 /// Sets the value of [failure_reason][crate::model::Rollout::failure_reason].
12285 ///
12286 /// # Example
12287 /// ```ignore,no_run
12288 /// # use google_cloud_deploy_v1::model::Rollout;
12289 /// let x = Rollout::new().set_failure_reason("example");
12290 /// ```
12291 pub fn set_failure_reason<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12292 self.failure_reason = v.into();
12293 self
12294 }
12295
12296 /// Sets the value of [deploying_build][crate::model::Rollout::deploying_build].
12297 ///
12298 /// # Example
12299 /// ```ignore,no_run
12300 /// # use google_cloud_deploy_v1::model::Rollout;
12301 /// let x = Rollout::new().set_deploying_build("example");
12302 /// ```
12303 pub fn set_deploying_build<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12304 self.deploying_build = v.into();
12305 self
12306 }
12307
12308 /// Sets the value of [etag][crate::model::Rollout::etag].
12309 ///
12310 /// # Example
12311 /// ```ignore,no_run
12312 /// # use google_cloud_deploy_v1::model::Rollout;
12313 /// let x = Rollout::new().set_etag("example");
12314 /// ```
12315 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12316 self.etag = v.into();
12317 self
12318 }
12319
12320 /// Sets the value of [deploy_failure_cause][crate::model::Rollout::deploy_failure_cause].
12321 ///
12322 /// # Example
12323 /// ```ignore,no_run
12324 /// # use google_cloud_deploy_v1::model::Rollout;
12325 /// use google_cloud_deploy_v1::model::rollout::FailureCause;
12326 /// let x0 = Rollout::new().set_deploy_failure_cause(FailureCause::CloudBuildUnavailable);
12327 /// let x1 = Rollout::new().set_deploy_failure_cause(FailureCause::ExecutionFailed);
12328 /// let x2 = Rollout::new().set_deploy_failure_cause(FailureCause::DeadlineExceeded);
12329 /// ```
12330 pub fn set_deploy_failure_cause<T: std::convert::Into<crate::model::rollout::FailureCause>>(
12331 mut self,
12332 v: T,
12333 ) -> Self {
12334 self.deploy_failure_cause = v.into();
12335 self
12336 }
12337
12338 /// Sets the value of [phases][crate::model::Rollout::phases].
12339 ///
12340 /// # Example
12341 /// ```ignore,no_run
12342 /// # use google_cloud_deploy_v1::model::Rollout;
12343 /// use google_cloud_deploy_v1::model::Phase;
12344 /// let x = Rollout::new()
12345 /// .set_phases([
12346 /// Phase::default()/* use setters */,
12347 /// Phase::default()/* use (different) setters */,
12348 /// ]);
12349 /// ```
12350 pub fn set_phases<T, V>(mut self, v: T) -> Self
12351 where
12352 T: std::iter::IntoIterator<Item = V>,
12353 V: std::convert::Into<crate::model::Phase>,
12354 {
12355 use std::iter::Iterator;
12356 self.phases = v.into_iter().map(|i| i.into()).collect();
12357 self
12358 }
12359
12360 /// Sets the value of [metadata][crate::model::Rollout::metadata].
12361 ///
12362 /// # Example
12363 /// ```ignore,no_run
12364 /// # use google_cloud_deploy_v1::model::Rollout;
12365 /// use google_cloud_deploy_v1::model::Metadata;
12366 /// let x = Rollout::new().set_metadata(Metadata::default()/* use setters */);
12367 /// ```
12368 pub fn set_metadata<T>(mut self, v: T) -> Self
12369 where
12370 T: std::convert::Into<crate::model::Metadata>,
12371 {
12372 self.metadata = std::option::Option::Some(v.into());
12373 self
12374 }
12375
12376 /// Sets or clears the value of [metadata][crate::model::Rollout::metadata].
12377 ///
12378 /// # Example
12379 /// ```ignore,no_run
12380 /// # use google_cloud_deploy_v1::model::Rollout;
12381 /// use google_cloud_deploy_v1::model::Metadata;
12382 /// let x = Rollout::new().set_or_clear_metadata(Some(Metadata::default()/* use setters */));
12383 /// let x = Rollout::new().set_or_clear_metadata(None::<Metadata>);
12384 /// ```
12385 pub fn set_or_clear_metadata<T>(mut self, v: std::option::Option<T>) -> Self
12386 where
12387 T: std::convert::Into<crate::model::Metadata>,
12388 {
12389 self.metadata = v.map(|x| x.into());
12390 self
12391 }
12392
12393 /// Sets the value of [controller_rollout][crate::model::Rollout::controller_rollout].
12394 ///
12395 /// # Example
12396 /// ```ignore,no_run
12397 /// # use google_cloud_deploy_v1::model::Rollout;
12398 /// let x = Rollout::new().set_controller_rollout("example");
12399 /// ```
12400 pub fn set_controller_rollout<T: std::convert::Into<std::string::String>>(
12401 mut self,
12402 v: T,
12403 ) -> Self {
12404 self.controller_rollout = v.into();
12405 self
12406 }
12407
12408 /// Sets the value of [rollback_of_rollout][crate::model::Rollout::rollback_of_rollout].
12409 ///
12410 /// # Example
12411 /// ```ignore,no_run
12412 /// # use google_cloud_deploy_v1::model::Rollout;
12413 /// let x = Rollout::new().set_rollback_of_rollout("example");
12414 /// ```
12415 pub fn set_rollback_of_rollout<T: std::convert::Into<std::string::String>>(
12416 mut self,
12417 v: T,
12418 ) -> Self {
12419 self.rollback_of_rollout = v.into();
12420 self
12421 }
12422
12423 /// Sets the value of [rolled_back_by_rollouts][crate::model::Rollout::rolled_back_by_rollouts].
12424 ///
12425 /// # Example
12426 /// ```ignore,no_run
12427 /// # use google_cloud_deploy_v1::model::Rollout;
12428 /// let x = Rollout::new().set_rolled_back_by_rollouts(["a", "b", "c"]);
12429 /// ```
12430 pub fn set_rolled_back_by_rollouts<T, V>(mut self, v: T) -> Self
12431 where
12432 T: std::iter::IntoIterator<Item = V>,
12433 V: std::convert::Into<std::string::String>,
12434 {
12435 use std::iter::Iterator;
12436 self.rolled_back_by_rollouts = v.into_iter().map(|i| i.into()).collect();
12437 self
12438 }
12439
12440 /// Sets the value of [active_repair_automation_run][crate::model::Rollout::active_repair_automation_run].
12441 ///
12442 /// # Example
12443 /// ```ignore,no_run
12444 /// # use google_cloud_deploy_v1::model::Rollout;
12445 /// let x = Rollout::new().set_active_repair_automation_run("example");
12446 /// ```
12447 pub fn set_active_repair_automation_run<T: std::convert::Into<std::string::String>>(
12448 mut self,
12449 v: T,
12450 ) -> Self {
12451 self.active_repair_automation_run = v.into();
12452 self
12453 }
12454}
12455
12456impl wkt::message::Message for Rollout {
12457 fn typename() -> &'static str {
12458 "type.googleapis.com/google.cloud.deploy.v1.Rollout"
12459 }
12460}
12461
12462/// Defines additional types related to [Rollout].
12463pub mod rollout {
12464 #[allow(unused_imports)]
12465 use super::*;
12466
12467 /// Valid approval states of a `Rollout`.
12468 ///
12469 /// # Working with unknown values
12470 ///
12471 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12472 /// additional enum variants at any time. Adding new variants is not considered
12473 /// a breaking change. Applications should write their code in anticipation of:
12474 ///
12475 /// - New values appearing in future releases of the client library, **and**
12476 /// - New values received dynamically, without application changes.
12477 ///
12478 /// Please consult the [Working with enums] section in the user guide for some
12479 /// guidelines.
12480 ///
12481 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
12482 #[derive(Clone, Debug, PartialEq)]
12483 #[non_exhaustive]
12484 pub enum ApprovalState {
12485 /// The `Rollout` has an unspecified approval state.
12486 Unspecified,
12487 /// The `Rollout` requires approval.
12488 NeedsApproval,
12489 /// The `Rollout` does not require approval.
12490 DoesNotNeedApproval,
12491 /// The `Rollout` has been approved.
12492 Approved,
12493 /// The `Rollout` has been rejected.
12494 Rejected,
12495 /// If set, the enum was initialized with an unknown value.
12496 ///
12497 /// Applications can examine the value using [ApprovalState::value] or
12498 /// [ApprovalState::name].
12499 UnknownValue(approval_state::UnknownValue),
12500 }
12501
12502 #[doc(hidden)]
12503 pub mod approval_state {
12504 #[allow(unused_imports)]
12505 use super::*;
12506 #[derive(Clone, Debug, PartialEq)]
12507 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12508 }
12509
12510 impl ApprovalState {
12511 /// Gets the enum value.
12512 ///
12513 /// Returns `None` if the enum contains an unknown value deserialized from
12514 /// the string representation of enums.
12515 pub fn value(&self) -> std::option::Option<i32> {
12516 match self {
12517 Self::Unspecified => std::option::Option::Some(0),
12518 Self::NeedsApproval => std::option::Option::Some(1),
12519 Self::DoesNotNeedApproval => std::option::Option::Some(2),
12520 Self::Approved => std::option::Option::Some(3),
12521 Self::Rejected => std::option::Option::Some(4),
12522 Self::UnknownValue(u) => u.0.value(),
12523 }
12524 }
12525
12526 /// Gets the enum value as a string.
12527 ///
12528 /// Returns `None` if the enum contains an unknown value deserialized from
12529 /// the integer representation of enums.
12530 pub fn name(&self) -> std::option::Option<&str> {
12531 match self {
12532 Self::Unspecified => std::option::Option::Some("APPROVAL_STATE_UNSPECIFIED"),
12533 Self::NeedsApproval => std::option::Option::Some("NEEDS_APPROVAL"),
12534 Self::DoesNotNeedApproval => std::option::Option::Some("DOES_NOT_NEED_APPROVAL"),
12535 Self::Approved => std::option::Option::Some("APPROVED"),
12536 Self::Rejected => std::option::Option::Some("REJECTED"),
12537 Self::UnknownValue(u) => u.0.name(),
12538 }
12539 }
12540 }
12541
12542 impl std::default::Default for ApprovalState {
12543 fn default() -> Self {
12544 use std::convert::From;
12545 Self::from(0)
12546 }
12547 }
12548
12549 impl std::fmt::Display for ApprovalState {
12550 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12551 wkt::internal::display_enum(f, self.name(), self.value())
12552 }
12553 }
12554
12555 impl std::convert::From<i32> for ApprovalState {
12556 fn from(value: i32) -> Self {
12557 match value {
12558 0 => Self::Unspecified,
12559 1 => Self::NeedsApproval,
12560 2 => Self::DoesNotNeedApproval,
12561 3 => Self::Approved,
12562 4 => Self::Rejected,
12563 _ => Self::UnknownValue(approval_state::UnknownValue(
12564 wkt::internal::UnknownEnumValue::Integer(value),
12565 )),
12566 }
12567 }
12568 }
12569
12570 impl std::convert::From<&str> for ApprovalState {
12571 fn from(value: &str) -> Self {
12572 use std::string::ToString;
12573 match value {
12574 "APPROVAL_STATE_UNSPECIFIED" => Self::Unspecified,
12575 "NEEDS_APPROVAL" => Self::NeedsApproval,
12576 "DOES_NOT_NEED_APPROVAL" => Self::DoesNotNeedApproval,
12577 "APPROVED" => Self::Approved,
12578 "REJECTED" => Self::Rejected,
12579 _ => Self::UnknownValue(approval_state::UnknownValue(
12580 wkt::internal::UnknownEnumValue::String(value.to_string()),
12581 )),
12582 }
12583 }
12584 }
12585
12586 impl serde::ser::Serialize for ApprovalState {
12587 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12588 where
12589 S: serde::Serializer,
12590 {
12591 match self {
12592 Self::Unspecified => serializer.serialize_i32(0),
12593 Self::NeedsApproval => serializer.serialize_i32(1),
12594 Self::DoesNotNeedApproval => serializer.serialize_i32(2),
12595 Self::Approved => serializer.serialize_i32(3),
12596 Self::Rejected => serializer.serialize_i32(4),
12597 Self::UnknownValue(u) => u.0.serialize(serializer),
12598 }
12599 }
12600 }
12601
12602 impl<'de> serde::de::Deserialize<'de> for ApprovalState {
12603 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12604 where
12605 D: serde::Deserializer<'de>,
12606 {
12607 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ApprovalState>::new(
12608 ".google.cloud.deploy.v1.Rollout.ApprovalState",
12609 ))
12610 }
12611 }
12612
12613 /// Valid states of a `Rollout`.
12614 ///
12615 /// # Working with unknown values
12616 ///
12617 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12618 /// additional enum variants at any time. Adding new variants is not considered
12619 /// a breaking change. Applications should write their code in anticipation of:
12620 ///
12621 /// - New values appearing in future releases of the client library, **and**
12622 /// - New values received dynamically, without application changes.
12623 ///
12624 /// Please consult the [Working with enums] section in the user guide for some
12625 /// guidelines.
12626 ///
12627 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
12628 #[derive(Clone, Debug, PartialEq)]
12629 #[non_exhaustive]
12630 pub enum State {
12631 /// The `Rollout` has an unspecified state.
12632 Unspecified,
12633 /// The `Rollout` has completed successfully.
12634 Succeeded,
12635 /// The `Rollout` has failed.
12636 Failed,
12637 /// The `Rollout` is being deployed.
12638 InProgress,
12639 /// The `Rollout` needs approval.
12640 PendingApproval,
12641 /// An approver rejected the `Rollout`.
12642 ApprovalRejected,
12643 /// The `Rollout` is waiting for an earlier Rollout(s) to complete on this
12644 /// `Target`.
12645 Pending,
12646 /// The `Rollout` is waiting for the `Release` to be fully rendered.
12647 PendingRelease,
12648 /// The `Rollout` is in the process of being cancelled.
12649 Cancelling,
12650 /// The `Rollout` has been cancelled.
12651 Cancelled,
12652 /// The `Rollout` is halted.
12653 Halted,
12654 /// If set, the enum was initialized with an unknown value.
12655 ///
12656 /// Applications can examine the value using [State::value] or
12657 /// [State::name].
12658 UnknownValue(state::UnknownValue),
12659 }
12660
12661 #[doc(hidden)]
12662 pub mod state {
12663 #[allow(unused_imports)]
12664 use super::*;
12665 #[derive(Clone, Debug, PartialEq)]
12666 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12667 }
12668
12669 impl State {
12670 /// Gets the enum value.
12671 ///
12672 /// Returns `None` if the enum contains an unknown value deserialized from
12673 /// the string representation of enums.
12674 pub fn value(&self) -> std::option::Option<i32> {
12675 match self {
12676 Self::Unspecified => std::option::Option::Some(0),
12677 Self::Succeeded => std::option::Option::Some(1),
12678 Self::Failed => std::option::Option::Some(2),
12679 Self::InProgress => std::option::Option::Some(3),
12680 Self::PendingApproval => std::option::Option::Some(4),
12681 Self::ApprovalRejected => std::option::Option::Some(5),
12682 Self::Pending => std::option::Option::Some(6),
12683 Self::PendingRelease => std::option::Option::Some(7),
12684 Self::Cancelling => std::option::Option::Some(8),
12685 Self::Cancelled => std::option::Option::Some(9),
12686 Self::Halted => std::option::Option::Some(10),
12687 Self::UnknownValue(u) => u.0.value(),
12688 }
12689 }
12690
12691 /// Gets the enum value as a string.
12692 ///
12693 /// Returns `None` if the enum contains an unknown value deserialized from
12694 /// the integer representation of enums.
12695 pub fn name(&self) -> std::option::Option<&str> {
12696 match self {
12697 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
12698 Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
12699 Self::Failed => std::option::Option::Some("FAILED"),
12700 Self::InProgress => std::option::Option::Some("IN_PROGRESS"),
12701 Self::PendingApproval => std::option::Option::Some("PENDING_APPROVAL"),
12702 Self::ApprovalRejected => std::option::Option::Some("APPROVAL_REJECTED"),
12703 Self::Pending => std::option::Option::Some("PENDING"),
12704 Self::PendingRelease => std::option::Option::Some("PENDING_RELEASE"),
12705 Self::Cancelling => std::option::Option::Some("CANCELLING"),
12706 Self::Cancelled => std::option::Option::Some("CANCELLED"),
12707 Self::Halted => std::option::Option::Some("HALTED"),
12708 Self::UnknownValue(u) => u.0.name(),
12709 }
12710 }
12711 }
12712
12713 impl std::default::Default for State {
12714 fn default() -> Self {
12715 use std::convert::From;
12716 Self::from(0)
12717 }
12718 }
12719
12720 impl std::fmt::Display for State {
12721 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12722 wkt::internal::display_enum(f, self.name(), self.value())
12723 }
12724 }
12725
12726 impl std::convert::From<i32> for State {
12727 fn from(value: i32) -> Self {
12728 match value {
12729 0 => Self::Unspecified,
12730 1 => Self::Succeeded,
12731 2 => Self::Failed,
12732 3 => Self::InProgress,
12733 4 => Self::PendingApproval,
12734 5 => Self::ApprovalRejected,
12735 6 => Self::Pending,
12736 7 => Self::PendingRelease,
12737 8 => Self::Cancelling,
12738 9 => Self::Cancelled,
12739 10 => Self::Halted,
12740 _ => Self::UnknownValue(state::UnknownValue(
12741 wkt::internal::UnknownEnumValue::Integer(value),
12742 )),
12743 }
12744 }
12745 }
12746
12747 impl std::convert::From<&str> for State {
12748 fn from(value: &str) -> Self {
12749 use std::string::ToString;
12750 match value {
12751 "STATE_UNSPECIFIED" => Self::Unspecified,
12752 "SUCCEEDED" => Self::Succeeded,
12753 "FAILED" => Self::Failed,
12754 "IN_PROGRESS" => Self::InProgress,
12755 "PENDING_APPROVAL" => Self::PendingApproval,
12756 "APPROVAL_REJECTED" => Self::ApprovalRejected,
12757 "PENDING" => Self::Pending,
12758 "PENDING_RELEASE" => Self::PendingRelease,
12759 "CANCELLING" => Self::Cancelling,
12760 "CANCELLED" => Self::Cancelled,
12761 "HALTED" => Self::Halted,
12762 _ => Self::UnknownValue(state::UnknownValue(
12763 wkt::internal::UnknownEnumValue::String(value.to_string()),
12764 )),
12765 }
12766 }
12767 }
12768
12769 impl serde::ser::Serialize for State {
12770 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12771 where
12772 S: serde::Serializer,
12773 {
12774 match self {
12775 Self::Unspecified => serializer.serialize_i32(0),
12776 Self::Succeeded => serializer.serialize_i32(1),
12777 Self::Failed => serializer.serialize_i32(2),
12778 Self::InProgress => serializer.serialize_i32(3),
12779 Self::PendingApproval => serializer.serialize_i32(4),
12780 Self::ApprovalRejected => serializer.serialize_i32(5),
12781 Self::Pending => serializer.serialize_i32(6),
12782 Self::PendingRelease => serializer.serialize_i32(7),
12783 Self::Cancelling => serializer.serialize_i32(8),
12784 Self::Cancelled => serializer.serialize_i32(9),
12785 Self::Halted => serializer.serialize_i32(10),
12786 Self::UnknownValue(u) => u.0.serialize(serializer),
12787 }
12788 }
12789 }
12790
12791 impl<'de> serde::de::Deserialize<'de> for State {
12792 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12793 where
12794 D: serde::Deserializer<'de>,
12795 {
12796 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
12797 ".google.cloud.deploy.v1.Rollout.State",
12798 ))
12799 }
12800 }
12801
12802 /// Well-known rollout failures.
12803 ///
12804 /// # Working with unknown values
12805 ///
12806 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12807 /// additional enum variants at any time. Adding new variants is not considered
12808 /// a breaking change. Applications should write their code in anticipation of:
12809 ///
12810 /// - New values appearing in future releases of the client library, **and**
12811 /// - New values received dynamically, without application changes.
12812 ///
12813 /// Please consult the [Working with enums] section in the user guide for some
12814 /// guidelines.
12815 ///
12816 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
12817 #[derive(Clone, Debug, PartialEq)]
12818 #[non_exhaustive]
12819 pub enum FailureCause {
12820 /// No reason for failure is specified.
12821 Unspecified,
12822 /// Cloud Build is not available, either because it is not enabled or because
12823 /// Cloud Deploy has insufficient permissions. See [required
12824 /// permission](https://cloud.google.com/deploy/docs/cloud-deploy-service-account#required_permissions).
12825 CloudBuildUnavailable,
12826 /// The deploy operation did not complete successfully; check Cloud Build
12827 /// logs.
12828 ExecutionFailed,
12829 /// Deployment did not complete within the allotted time.
12830 DeadlineExceeded,
12831 /// Release is in a failed state.
12832 ReleaseFailed,
12833 /// Release is abandoned.
12834 ReleaseAbandoned,
12835 /// No Skaffold verify configuration was found.
12836 VerificationConfigNotFound,
12837 /// Cloud Build failed to fulfill Cloud Deploy's request. See failure_message
12838 /// for additional details.
12839 CloudBuildRequestFailed,
12840 /// A Rollout operation had a feature configured that is not supported.
12841 OperationFeatureNotSupported,
12842 /// If set, the enum was initialized with an unknown value.
12843 ///
12844 /// Applications can examine the value using [FailureCause::value] or
12845 /// [FailureCause::name].
12846 UnknownValue(failure_cause::UnknownValue),
12847 }
12848
12849 #[doc(hidden)]
12850 pub mod failure_cause {
12851 #[allow(unused_imports)]
12852 use super::*;
12853 #[derive(Clone, Debug, PartialEq)]
12854 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12855 }
12856
12857 impl FailureCause {
12858 /// Gets the enum value.
12859 ///
12860 /// Returns `None` if the enum contains an unknown value deserialized from
12861 /// the string representation of enums.
12862 pub fn value(&self) -> std::option::Option<i32> {
12863 match self {
12864 Self::Unspecified => std::option::Option::Some(0),
12865 Self::CloudBuildUnavailable => std::option::Option::Some(1),
12866 Self::ExecutionFailed => std::option::Option::Some(2),
12867 Self::DeadlineExceeded => std::option::Option::Some(3),
12868 Self::ReleaseFailed => std::option::Option::Some(4),
12869 Self::ReleaseAbandoned => std::option::Option::Some(5),
12870 Self::VerificationConfigNotFound => std::option::Option::Some(6),
12871 Self::CloudBuildRequestFailed => std::option::Option::Some(7),
12872 Self::OperationFeatureNotSupported => std::option::Option::Some(8),
12873 Self::UnknownValue(u) => u.0.value(),
12874 }
12875 }
12876
12877 /// Gets the enum value as a string.
12878 ///
12879 /// Returns `None` if the enum contains an unknown value deserialized from
12880 /// the integer representation of enums.
12881 pub fn name(&self) -> std::option::Option<&str> {
12882 match self {
12883 Self::Unspecified => std::option::Option::Some("FAILURE_CAUSE_UNSPECIFIED"),
12884 Self::CloudBuildUnavailable => std::option::Option::Some("CLOUD_BUILD_UNAVAILABLE"),
12885 Self::ExecutionFailed => std::option::Option::Some("EXECUTION_FAILED"),
12886 Self::DeadlineExceeded => std::option::Option::Some("DEADLINE_EXCEEDED"),
12887 Self::ReleaseFailed => std::option::Option::Some("RELEASE_FAILED"),
12888 Self::ReleaseAbandoned => std::option::Option::Some("RELEASE_ABANDONED"),
12889 Self::VerificationConfigNotFound => {
12890 std::option::Option::Some("VERIFICATION_CONFIG_NOT_FOUND")
12891 }
12892 Self::CloudBuildRequestFailed => {
12893 std::option::Option::Some("CLOUD_BUILD_REQUEST_FAILED")
12894 }
12895 Self::OperationFeatureNotSupported => {
12896 std::option::Option::Some("OPERATION_FEATURE_NOT_SUPPORTED")
12897 }
12898 Self::UnknownValue(u) => u.0.name(),
12899 }
12900 }
12901 }
12902
12903 impl std::default::Default for FailureCause {
12904 fn default() -> Self {
12905 use std::convert::From;
12906 Self::from(0)
12907 }
12908 }
12909
12910 impl std::fmt::Display for FailureCause {
12911 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12912 wkt::internal::display_enum(f, self.name(), self.value())
12913 }
12914 }
12915
12916 impl std::convert::From<i32> for FailureCause {
12917 fn from(value: i32) -> Self {
12918 match value {
12919 0 => Self::Unspecified,
12920 1 => Self::CloudBuildUnavailable,
12921 2 => Self::ExecutionFailed,
12922 3 => Self::DeadlineExceeded,
12923 4 => Self::ReleaseFailed,
12924 5 => Self::ReleaseAbandoned,
12925 6 => Self::VerificationConfigNotFound,
12926 7 => Self::CloudBuildRequestFailed,
12927 8 => Self::OperationFeatureNotSupported,
12928 _ => Self::UnknownValue(failure_cause::UnknownValue(
12929 wkt::internal::UnknownEnumValue::Integer(value),
12930 )),
12931 }
12932 }
12933 }
12934
12935 impl std::convert::From<&str> for FailureCause {
12936 fn from(value: &str) -> Self {
12937 use std::string::ToString;
12938 match value {
12939 "FAILURE_CAUSE_UNSPECIFIED" => Self::Unspecified,
12940 "CLOUD_BUILD_UNAVAILABLE" => Self::CloudBuildUnavailable,
12941 "EXECUTION_FAILED" => Self::ExecutionFailed,
12942 "DEADLINE_EXCEEDED" => Self::DeadlineExceeded,
12943 "RELEASE_FAILED" => Self::ReleaseFailed,
12944 "RELEASE_ABANDONED" => Self::ReleaseAbandoned,
12945 "VERIFICATION_CONFIG_NOT_FOUND" => Self::VerificationConfigNotFound,
12946 "CLOUD_BUILD_REQUEST_FAILED" => Self::CloudBuildRequestFailed,
12947 "OPERATION_FEATURE_NOT_SUPPORTED" => Self::OperationFeatureNotSupported,
12948 _ => Self::UnknownValue(failure_cause::UnknownValue(
12949 wkt::internal::UnknownEnumValue::String(value.to_string()),
12950 )),
12951 }
12952 }
12953 }
12954
12955 impl serde::ser::Serialize for FailureCause {
12956 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12957 where
12958 S: serde::Serializer,
12959 {
12960 match self {
12961 Self::Unspecified => serializer.serialize_i32(0),
12962 Self::CloudBuildUnavailable => serializer.serialize_i32(1),
12963 Self::ExecutionFailed => serializer.serialize_i32(2),
12964 Self::DeadlineExceeded => serializer.serialize_i32(3),
12965 Self::ReleaseFailed => serializer.serialize_i32(4),
12966 Self::ReleaseAbandoned => serializer.serialize_i32(5),
12967 Self::VerificationConfigNotFound => serializer.serialize_i32(6),
12968 Self::CloudBuildRequestFailed => serializer.serialize_i32(7),
12969 Self::OperationFeatureNotSupported => serializer.serialize_i32(8),
12970 Self::UnknownValue(u) => u.0.serialize(serializer),
12971 }
12972 }
12973 }
12974
12975 impl<'de> serde::de::Deserialize<'de> for FailureCause {
12976 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12977 where
12978 D: serde::Deserializer<'de>,
12979 {
12980 deserializer.deserialize_any(wkt::internal::EnumVisitor::<FailureCause>::new(
12981 ".google.cloud.deploy.v1.Rollout.FailureCause",
12982 ))
12983 }
12984 }
12985}
12986
12987/// Metadata includes information associated with a `Rollout`.
12988#[derive(Clone, Default, PartialEq)]
12989#[non_exhaustive]
12990pub struct Metadata {
12991 /// Output only. The name of the Cloud Run Service that is associated with a
12992 /// `Rollout`.
12993 pub cloud_run: std::option::Option<crate::model::CloudRunMetadata>,
12994
12995 /// Output only. AutomationRolloutMetadata contains the information about the
12996 /// interactions between Automation service and this rollout.
12997 pub automation: std::option::Option<crate::model::AutomationRolloutMetadata>,
12998
12999 /// Output only. Custom metadata provided by user-defined `Rollout` operations.
13000 pub custom: std::option::Option<crate::model::CustomMetadata>,
13001
13002 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13003}
13004
13005impl Metadata {
13006 /// Creates a new default instance.
13007 pub fn new() -> Self {
13008 std::default::Default::default()
13009 }
13010
13011 /// Sets the value of [cloud_run][crate::model::Metadata::cloud_run].
13012 ///
13013 /// # Example
13014 /// ```ignore,no_run
13015 /// # use google_cloud_deploy_v1::model::Metadata;
13016 /// use google_cloud_deploy_v1::model::CloudRunMetadata;
13017 /// let x = Metadata::new().set_cloud_run(CloudRunMetadata::default()/* use setters */);
13018 /// ```
13019 pub fn set_cloud_run<T>(mut self, v: T) -> Self
13020 where
13021 T: std::convert::Into<crate::model::CloudRunMetadata>,
13022 {
13023 self.cloud_run = std::option::Option::Some(v.into());
13024 self
13025 }
13026
13027 /// Sets or clears the value of [cloud_run][crate::model::Metadata::cloud_run].
13028 ///
13029 /// # Example
13030 /// ```ignore,no_run
13031 /// # use google_cloud_deploy_v1::model::Metadata;
13032 /// use google_cloud_deploy_v1::model::CloudRunMetadata;
13033 /// let x = Metadata::new().set_or_clear_cloud_run(Some(CloudRunMetadata::default()/* use setters */));
13034 /// let x = Metadata::new().set_or_clear_cloud_run(None::<CloudRunMetadata>);
13035 /// ```
13036 pub fn set_or_clear_cloud_run<T>(mut self, v: std::option::Option<T>) -> Self
13037 where
13038 T: std::convert::Into<crate::model::CloudRunMetadata>,
13039 {
13040 self.cloud_run = v.map(|x| x.into());
13041 self
13042 }
13043
13044 /// Sets the value of [automation][crate::model::Metadata::automation].
13045 ///
13046 /// # Example
13047 /// ```ignore,no_run
13048 /// # use google_cloud_deploy_v1::model::Metadata;
13049 /// use google_cloud_deploy_v1::model::AutomationRolloutMetadata;
13050 /// let x = Metadata::new().set_automation(AutomationRolloutMetadata::default()/* use setters */);
13051 /// ```
13052 pub fn set_automation<T>(mut self, v: T) -> Self
13053 where
13054 T: std::convert::Into<crate::model::AutomationRolloutMetadata>,
13055 {
13056 self.automation = std::option::Option::Some(v.into());
13057 self
13058 }
13059
13060 /// Sets or clears the value of [automation][crate::model::Metadata::automation].
13061 ///
13062 /// # Example
13063 /// ```ignore,no_run
13064 /// # use google_cloud_deploy_v1::model::Metadata;
13065 /// use google_cloud_deploy_v1::model::AutomationRolloutMetadata;
13066 /// let x = Metadata::new().set_or_clear_automation(Some(AutomationRolloutMetadata::default()/* use setters */));
13067 /// let x = Metadata::new().set_or_clear_automation(None::<AutomationRolloutMetadata>);
13068 /// ```
13069 pub fn set_or_clear_automation<T>(mut self, v: std::option::Option<T>) -> Self
13070 where
13071 T: std::convert::Into<crate::model::AutomationRolloutMetadata>,
13072 {
13073 self.automation = v.map(|x| x.into());
13074 self
13075 }
13076
13077 /// Sets the value of [custom][crate::model::Metadata::custom].
13078 ///
13079 /// # Example
13080 /// ```ignore,no_run
13081 /// # use google_cloud_deploy_v1::model::Metadata;
13082 /// use google_cloud_deploy_v1::model::CustomMetadata;
13083 /// let x = Metadata::new().set_custom(CustomMetadata::default()/* use setters */);
13084 /// ```
13085 pub fn set_custom<T>(mut self, v: T) -> Self
13086 where
13087 T: std::convert::Into<crate::model::CustomMetadata>,
13088 {
13089 self.custom = std::option::Option::Some(v.into());
13090 self
13091 }
13092
13093 /// Sets or clears the value of [custom][crate::model::Metadata::custom].
13094 ///
13095 /// # Example
13096 /// ```ignore,no_run
13097 /// # use google_cloud_deploy_v1::model::Metadata;
13098 /// use google_cloud_deploy_v1::model::CustomMetadata;
13099 /// let x = Metadata::new().set_or_clear_custom(Some(CustomMetadata::default()/* use setters */));
13100 /// let x = Metadata::new().set_or_clear_custom(None::<CustomMetadata>);
13101 /// ```
13102 pub fn set_or_clear_custom<T>(mut self, v: std::option::Option<T>) -> Self
13103 where
13104 T: std::convert::Into<crate::model::CustomMetadata>,
13105 {
13106 self.custom = v.map(|x| x.into());
13107 self
13108 }
13109}
13110
13111impl wkt::message::Message for Metadata {
13112 fn typename() -> &'static str {
13113 "type.googleapis.com/google.cloud.deploy.v1.Metadata"
13114 }
13115}
13116
13117/// DeployJobRunMetadata surfaces information associated with a `DeployJobRun` to
13118/// the user.
13119#[derive(Clone, Default, PartialEq)]
13120#[non_exhaustive]
13121pub struct DeployJobRunMetadata {
13122 /// Output only. The name of the Cloud Run Service that is associated with a
13123 /// `DeployJobRun`.
13124 pub cloud_run: std::option::Option<crate::model::CloudRunMetadata>,
13125
13126 /// Output only. Custom Target metadata associated with a `DeployJobRun`.
13127 pub custom_target: std::option::Option<crate::model::CustomTargetDeployMetadata>,
13128
13129 /// Output only. Custom metadata provided by user-defined deploy operation.
13130 pub custom: std::option::Option<crate::model::CustomMetadata>,
13131
13132 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13133}
13134
13135impl DeployJobRunMetadata {
13136 /// Creates a new default instance.
13137 pub fn new() -> Self {
13138 std::default::Default::default()
13139 }
13140
13141 /// Sets the value of [cloud_run][crate::model::DeployJobRunMetadata::cloud_run].
13142 ///
13143 /// # Example
13144 /// ```ignore,no_run
13145 /// # use google_cloud_deploy_v1::model::DeployJobRunMetadata;
13146 /// use google_cloud_deploy_v1::model::CloudRunMetadata;
13147 /// let x = DeployJobRunMetadata::new().set_cloud_run(CloudRunMetadata::default()/* use setters */);
13148 /// ```
13149 pub fn set_cloud_run<T>(mut self, v: T) -> Self
13150 where
13151 T: std::convert::Into<crate::model::CloudRunMetadata>,
13152 {
13153 self.cloud_run = std::option::Option::Some(v.into());
13154 self
13155 }
13156
13157 /// Sets or clears the value of [cloud_run][crate::model::DeployJobRunMetadata::cloud_run].
13158 ///
13159 /// # Example
13160 /// ```ignore,no_run
13161 /// # use google_cloud_deploy_v1::model::DeployJobRunMetadata;
13162 /// use google_cloud_deploy_v1::model::CloudRunMetadata;
13163 /// let x = DeployJobRunMetadata::new().set_or_clear_cloud_run(Some(CloudRunMetadata::default()/* use setters */));
13164 /// let x = DeployJobRunMetadata::new().set_or_clear_cloud_run(None::<CloudRunMetadata>);
13165 /// ```
13166 pub fn set_or_clear_cloud_run<T>(mut self, v: std::option::Option<T>) -> Self
13167 where
13168 T: std::convert::Into<crate::model::CloudRunMetadata>,
13169 {
13170 self.cloud_run = v.map(|x| x.into());
13171 self
13172 }
13173
13174 /// Sets the value of [custom_target][crate::model::DeployJobRunMetadata::custom_target].
13175 ///
13176 /// # Example
13177 /// ```ignore,no_run
13178 /// # use google_cloud_deploy_v1::model::DeployJobRunMetadata;
13179 /// use google_cloud_deploy_v1::model::CustomTargetDeployMetadata;
13180 /// let x = DeployJobRunMetadata::new().set_custom_target(CustomTargetDeployMetadata::default()/* use setters */);
13181 /// ```
13182 pub fn set_custom_target<T>(mut self, v: T) -> Self
13183 where
13184 T: std::convert::Into<crate::model::CustomTargetDeployMetadata>,
13185 {
13186 self.custom_target = std::option::Option::Some(v.into());
13187 self
13188 }
13189
13190 /// Sets or clears the value of [custom_target][crate::model::DeployJobRunMetadata::custom_target].
13191 ///
13192 /// # Example
13193 /// ```ignore,no_run
13194 /// # use google_cloud_deploy_v1::model::DeployJobRunMetadata;
13195 /// use google_cloud_deploy_v1::model::CustomTargetDeployMetadata;
13196 /// let x = DeployJobRunMetadata::new().set_or_clear_custom_target(Some(CustomTargetDeployMetadata::default()/* use setters */));
13197 /// let x = DeployJobRunMetadata::new().set_or_clear_custom_target(None::<CustomTargetDeployMetadata>);
13198 /// ```
13199 pub fn set_or_clear_custom_target<T>(mut self, v: std::option::Option<T>) -> Self
13200 where
13201 T: std::convert::Into<crate::model::CustomTargetDeployMetadata>,
13202 {
13203 self.custom_target = v.map(|x| x.into());
13204 self
13205 }
13206
13207 /// Sets the value of [custom][crate::model::DeployJobRunMetadata::custom].
13208 ///
13209 /// # Example
13210 /// ```ignore,no_run
13211 /// # use google_cloud_deploy_v1::model::DeployJobRunMetadata;
13212 /// use google_cloud_deploy_v1::model::CustomMetadata;
13213 /// let x = DeployJobRunMetadata::new().set_custom(CustomMetadata::default()/* use setters */);
13214 /// ```
13215 pub fn set_custom<T>(mut self, v: T) -> Self
13216 where
13217 T: std::convert::Into<crate::model::CustomMetadata>,
13218 {
13219 self.custom = std::option::Option::Some(v.into());
13220 self
13221 }
13222
13223 /// Sets or clears the value of [custom][crate::model::DeployJobRunMetadata::custom].
13224 ///
13225 /// # Example
13226 /// ```ignore,no_run
13227 /// # use google_cloud_deploy_v1::model::DeployJobRunMetadata;
13228 /// use google_cloud_deploy_v1::model::CustomMetadata;
13229 /// let x = DeployJobRunMetadata::new().set_or_clear_custom(Some(CustomMetadata::default()/* use setters */));
13230 /// let x = DeployJobRunMetadata::new().set_or_clear_custom(None::<CustomMetadata>);
13231 /// ```
13232 pub fn set_or_clear_custom<T>(mut self, v: std::option::Option<T>) -> Self
13233 where
13234 T: std::convert::Into<crate::model::CustomMetadata>,
13235 {
13236 self.custom = v.map(|x| x.into());
13237 self
13238 }
13239}
13240
13241impl wkt::message::Message for DeployJobRunMetadata {
13242 fn typename() -> &'static str {
13243 "type.googleapis.com/google.cloud.deploy.v1.DeployJobRunMetadata"
13244 }
13245}
13246
13247/// CloudRunMetadata contains information from a Cloud Run deployment.
13248#[derive(Clone, Default, PartialEq)]
13249#[non_exhaustive]
13250pub struct CloudRunMetadata {
13251 /// Output only. The name of the Cloud Run Service that is associated with a
13252 /// `Rollout`. Format is
13253 /// `projects/{project}/locations/{location}/services/{service}`.
13254 pub service: std::string::String,
13255
13256 /// Output only. The Cloud Run Service urls that are associated with a
13257 /// `Rollout`.
13258 pub service_urls: std::vec::Vec<std::string::String>,
13259
13260 /// Output only. The Cloud Run Revision id associated with a `Rollout`.
13261 pub revision: std::string::String,
13262
13263 /// Output only. The name of the Cloud Run job that is associated with a
13264 /// `Rollout`. Format is
13265 /// `projects/{project}/locations/{location}/jobs/{job_name}`.
13266 pub job: std::string::String,
13267
13268 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13269}
13270
13271impl CloudRunMetadata {
13272 /// Creates a new default instance.
13273 pub fn new() -> Self {
13274 std::default::Default::default()
13275 }
13276
13277 /// Sets the value of [service][crate::model::CloudRunMetadata::service].
13278 ///
13279 /// # Example
13280 /// ```ignore,no_run
13281 /// # use google_cloud_deploy_v1::model::CloudRunMetadata;
13282 /// let x = CloudRunMetadata::new().set_service("example");
13283 /// ```
13284 pub fn set_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13285 self.service = v.into();
13286 self
13287 }
13288
13289 /// Sets the value of [service_urls][crate::model::CloudRunMetadata::service_urls].
13290 ///
13291 /// # Example
13292 /// ```ignore,no_run
13293 /// # use google_cloud_deploy_v1::model::CloudRunMetadata;
13294 /// let x = CloudRunMetadata::new().set_service_urls(["a", "b", "c"]);
13295 /// ```
13296 pub fn set_service_urls<T, V>(mut self, v: T) -> Self
13297 where
13298 T: std::iter::IntoIterator<Item = V>,
13299 V: std::convert::Into<std::string::String>,
13300 {
13301 use std::iter::Iterator;
13302 self.service_urls = v.into_iter().map(|i| i.into()).collect();
13303 self
13304 }
13305
13306 /// Sets the value of [revision][crate::model::CloudRunMetadata::revision].
13307 ///
13308 /// # Example
13309 /// ```ignore,no_run
13310 /// # use google_cloud_deploy_v1::model::CloudRunMetadata;
13311 /// let x = CloudRunMetadata::new().set_revision("example");
13312 /// ```
13313 pub fn set_revision<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13314 self.revision = v.into();
13315 self
13316 }
13317
13318 /// Sets the value of [job][crate::model::CloudRunMetadata::job].
13319 ///
13320 /// # Example
13321 /// ```ignore,no_run
13322 /// # use google_cloud_deploy_v1::model::CloudRunMetadata;
13323 /// let x = CloudRunMetadata::new().set_job("example");
13324 /// ```
13325 pub fn set_job<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13326 self.job = v.into();
13327 self
13328 }
13329}
13330
13331impl wkt::message::Message for CloudRunMetadata {
13332 fn typename() -> &'static str {
13333 "type.googleapis.com/google.cloud.deploy.v1.CloudRunMetadata"
13334 }
13335}
13336
13337/// CustomTargetDeployMetadata contains information from a Custom Target
13338/// deploy operation.
13339#[derive(Clone, Default, PartialEq)]
13340#[non_exhaustive]
13341pub struct CustomTargetDeployMetadata {
13342 /// Output only. Skip message provided in the results of a custom deploy
13343 /// operation.
13344 pub skip_message: std::string::String,
13345
13346 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13347}
13348
13349impl CustomTargetDeployMetadata {
13350 /// Creates a new default instance.
13351 pub fn new() -> Self {
13352 std::default::Default::default()
13353 }
13354
13355 /// Sets the value of [skip_message][crate::model::CustomTargetDeployMetadata::skip_message].
13356 ///
13357 /// # Example
13358 /// ```ignore,no_run
13359 /// # use google_cloud_deploy_v1::model::CustomTargetDeployMetadata;
13360 /// let x = CustomTargetDeployMetadata::new().set_skip_message("example");
13361 /// ```
13362 pub fn set_skip_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13363 self.skip_message = v.into();
13364 self
13365 }
13366}
13367
13368impl wkt::message::Message for CustomTargetDeployMetadata {
13369 fn typename() -> &'static str {
13370 "type.googleapis.com/google.cloud.deploy.v1.CustomTargetDeployMetadata"
13371 }
13372}
13373
13374/// AutomationRolloutMetadata contains Automation-related actions that
13375/// were performed on a rollout.
13376#[derive(Clone, Default, PartialEq)]
13377#[non_exhaustive]
13378pub struct AutomationRolloutMetadata {
13379 /// Output only. The name of the AutomationRun initiated by a promote release
13380 /// rule.
13381 pub promote_automation_run: std::string::String,
13382
13383 /// Output only. The names of the AutomationRuns initiated by an advance
13384 /// rollout rule.
13385 pub advance_automation_runs: std::vec::Vec<std::string::String>,
13386
13387 /// Output only. The names of the AutomationRuns initiated by a repair rollout
13388 /// rule.
13389 pub repair_automation_runs: std::vec::Vec<std::string::String>,
13390
13391 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13392}
13393
13394impl AutomationRolloutMetadata {
13395 /// Creates a new default instance.
13396 pub fn new() -> Self {
13397 std::default::Default::default()
13398 }
13399
13400 /// Sets the value of [promote_automation_run][crate::model::AutomationRolloutMetadata::promote_automation_run].
13401 ///
13402 /// # Example
13403 /// ```ignore,no_run
13404 /// # use google_cloud_deploy_v1::model::AutomationRolloutMetadata;
13405 /// let x = AutomationRolloutMetadata::new().set_promote_automation_run("example");
13406 /// ```
13407 pub fn set_promote_automation_run<T: std::convert::Into<std::string::String>>(
13408 mut self,
13409 v: T,
13410 ) -> Self {
13411 self.promote_automation_run = v.into();
13412 self
13413 }
13414
13415 /// Sets the value of [advance_automation_runs][crate::model::AutomationRolloutMetadata::advance_automation_runs].
13416 ///
13417 /// # Example
13418 /// ```ignore,no_run
13419 /// # use google_cloud_deploy_v1::model::AutomationRolloutMetadata;
13420 /// let x = AutomationRolloutMetadata::new().set_advance_automation_runs(["a", "b", "c"]);
13421 /// ```
13422 pub fn set_advance_automation_runs<T, V>(mut self, v: T) -> Self
13423 where
13424 T: std::iter::IntoIterator<Item = V>,
13425 V: std::convert::Into<std::string::String>,
13426 {
13427 use std::iter::Iterator;
13428 self.advance_automation_runs = v.into_iter().map(|i| i.into()).collect();
13429 self
13430 }
13431
13432 /// Sets the value of [repair_automation_runs][crate::model::AutomationRolloutMetadata::repair_automation_runs].
13433 ///
13434 /// # Example
13435 /// ```ignore,no_run
13436 /// # use google_cloud_deploy_v1::model::AutomationRolloutMetadata;
13437 /// let x = AutomationRolloutMetadata::new().set_repair_automation_runs(["a", "b", "c"]);
13438 /// ```
13439 pub fn set_repair_automation_runs<T, V>(mut self, v: T) -> Self
13440 where
13441 T: std::iter::IntoIterator<Item = V>,
13442 V: std::convert::Into<std::string::String>,
13443 {
13444 use std::iter::Iterator;
13445 self.repair_automation_runs = v.into_iter().map(|i| i.into()).collect();
13446 self
13447 }
13448}
13449
13450impl wkt::message::Message for AutomationRolloutMetadata {
13451 fn typename() -> &'static str {
13452 "type.googleapis.com/google.cloud.deploy.v1.AutomationRolloutMetadata"
13453 }
13454}
13455
13456/// CustomMetadata contains information from a user-defined operation.
13457#[derive(Clone, Default, PartialEq)]
13458#[non_exhaustive]
13459pub struct CustomMetadata {
13460 /// Output only. Key-value pairs provided by the user-defined operation.
13461 pub values: std::collections::HashMap<std::string::String, std::string::String>,
13462
13463 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13464}
13465
13466impl CustomMetadata {
13467 /// Creates a new default instance.
13468 pub fn new() -> Self {
13469 std::default::Default::default()
13470 }
13471
13472 /// Sets the value of [values][crate::model::CustomMetadata::values].
13473 ///
13474 /// # Example
13475 /// ```ignore,no_run
13476 /// # use google_cloud_deploy_v1::model::CustomMetadata;
13477 /// let x = CustomMetadata::new().set_values([
13478 /// ("key0", "abc"),
13479 /// ("key1", "xyz"),
13480 /// ]);
13481 /// ```
13482 pub fn set_values<T, K, V>(mut self, v: T) -> Self
13483 where
13484 T: std::iter::IntoIterator<Item = (K, V)>,
13485 K: std::convert::Into<std::string::String>,
13486 V: std::convert::Into<std::string::String>,
13487 {
13488 use std::iter::Iterator;
13489 self.values = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
13490 self
13491 }
13492}
13493
13494impl wkt::message::Message for CustomMetadata {
13495 fn typename() -> &'static str {
13496 "type.googleapis.com/google.cloud.deploy.v1.CustomMetadata"
13497 }
13498}
13499
13500/// Phase represents a collection of jobs that are logically grouped together
13501/// for a `Rollout`.
13502#[derive(Clone, Default, PartialEq)]
13503#[non_exhaustive]
13504pub struct Phase {
13505 /// Output only. The ID of the Phase.
13506 pub id: std::string::String,
13507
13508 /// Output only. Current state of the Phase.
13509 pub state: crate::model::phase::State,
13510
13511 /// Output only. Additional information on why the Phase was skipped, if
13512 /// available.
13513 pub skip_message: std::string::String,
13514
13515 /// The job composition of this Phase.
13516 pub jobs: std::option::Option<crate::model::phase::Jobs>,
13517
13518 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13519}
13520
13521impl Phase {
13522 /// Creates a new default instance.
13523 pub fn new() -> Self {
13524 std::default::Default::default()
13525 }
13526
13527 /// Sets the value of [id][crate::model::Phase::id].
13528 ///
13529 /// # Example
13530 /// ```ignore,no_run
13531 /// # use google_cloud_deploy_v1::model::Phase;
13532 /// let x = Phase::new().set_id("example");
13533 /// ```
13534 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13535 self.id = v.into();
13536 self
13537 }
13538
13539 /// Sets the value of [state][crate::model::Phase::state].
13540 ///
13541 /// # Example
13542 /// ```ignore,no_run
13543 /// # use google_cloud_deploy_v1::model::Phase;
13544 /// use google_cloud_deploy_v1::model::phase::State;
13545 /// let x0 = Phase::new().set_state(State::Pending);
13546 /// let x1 = Phase::new().set_state(State::InProgress);
13547 /// let x2 = Phase::new().set_state(State::Succeeded);
13548 /// ```
13549 pub fn set_state<T: std::convert::Into<crate::model::phase::State>>(mut self, v: T) -> Self {
13550 self.state = v.into();
13551 self
13552 }
13553
13554 /// Sets the value of [skip_message][crate::model::Phase::skip_message].
13555 ///
13556 /// # Example
13557 /// ```ignore,no_run
13558 /// # use google_cloud_deploy_v1::model::Phase;
13559 /// let x = Phase::new().set_skip_message("example");
13560 /// ```
13561 pub fn set_skip_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13562 self.skip_message = v.into();
13563 self
13564 }
13565
13566 /// Sets the value of [jobs][crate::model::Phase::jobs].
13567 ///
13568 /// Note that all the setters affecting `jobs` are mutually
13569 /// exclusive.
13570 ///
13571 /// # Example
13572 /// ```ignore,no_run
13573 /// # use google_cloud_deploy_v1::model::Phase;
13574 /// use google_cloud_deploy_v1::model::DeploymentJobs;
13575 /// let x = Phase::new().set_jobs(Some(
13576 /// google_cloud_deploy_v1::model::phase::Jobs::DeploymentJobs(DeploymentJobs::default().into())));
13577 /// ```
13578 pub fn set_jobs<T: std::convert::Into<std::option::Option<crate::model::phase::Jobs>>>(
13579 mut self,
13580 v: T,
13581 ) -> Self {
13582 self.jobs = v.into();
13583 self
13584 }
13585
13586 /// The value of [jobs][crate::model::Phase::jobs]
13587 /// if it holds a `DeploymentJobs`, `None` if the field is not set or
13588 /// holds a different branch.
13589 pub fn deployment_jobs(
13590 &self,
13591 ) -> std::option::Option<&std::boxed::Box<crate::model::DeploymentJobs>> {
13592 #[allow(unreachable_patterns)]
13593 self.jobs.as_ref().and_then(|v| match v {
13594 crate::model::phase::Jobs::DeploymentJobs(v) => std::option::Option::Some(v),
13595 _ => std::option::Option::None,
13596 })
13597 }
13598
13599 /// Sets the value of [jobs][crate::model::Phase::jobs]
13600 /// to hold a `DeploymentJobs`.
13601 ///
13602 /// Note that all the setters affecting `jobs` are
13603 /// mutually exclusive.
13604 ///
13605 /// # Example
13606 /// ```ignore,no_run
13607 /// # use google_cloud_deploy_v1::model::Phase;
13608 /// use google_cloud_deploy_v1::model::DeploymentJobs;
13609 /// let x = Phase::new().set_deployment_jobs(DeploymentJobs::default()/* use setters */);
13610 /// assert!(x.deployment_jobs().is_some());
13611 /// assert!(x.child_rollout_jobs().is_none());
13612 /// ```
13613 pub fn set_deployment_jobs<
13614 T: std::convert::Into<std::boxed::Box<crate::model::DeploymentJobs>>,
13615 >(
13616 mut self,
13617 v: T,
13618 ) -> Self {
13619 self.jobs = std::option::Option::Some(crate::model::phase::Jobs::DeploymentJobs(v.into()));
13620 self
13621 }
13622
13623 /// The value of [jobs][crate::model::Phase::jobs]
13624 /// if it holds a `ChildRolloutJobs`, `None` if the field is not set or
13625 /// holds a different branch.
13626 pub fn child_rollout_jobs(
13627 &self,
13628 ) -> std::option::Option<&std::boxed::Box<crate::model::ChildRolloutJobs>> {
13629 #[allow(unreachable_patterns)]
13630 self.jobs.as_ref().and_then(|v| match v {
13631 crate::model::phase::Jobs::ChildRolloutJobs(v) => std::option::Option::Some(v),
13632 _ => std::option::Option::None,
13633 })
13634 }
13635
13636 /// Sets the value of [jobs][crate::model::Phase::jobs]
13637 /// to hold a `ChildRolloutJobs`.
13638 ///
13639 /// Note that all the setters affecting `jobs` are
13640 /// mutually exclusive.
13641 ///
13642 /// # Example
13643 /// ```ignore,no_run
13644 /// # use google_cloud_deploy_v1::model::Phase;
13645 /// use google_cloud_deploy_v1::model::ChildRolloutJobs;
13646 /// let x = Phase::new().set_child_rollout_jobs(ChildRolloutJobs::default()/* use setters */);
13647 /// assert!(x.child_rollout_jobs().is_some());
13648 /// assert!(x.deployment_jobs().is_none());
13649 /// ```
13650 pub fn set_child_rollout_jobs<
13651 T: std::convert::Into<std::boxed::Box<crate::model::ChildRolloutJobs>>,
13652 >(
13653 mut self,
13654 v: T,
13655 ) -> Self {
13656 self.jobs =
13657 std::option::Option::Some(crate::model::phase::Jobs::ChildRolloutJobs(v.into()));
13658 self
13659 }
13660}
13661
13662impl wkt::message::Message for Phase {
13663 fn typename() -> &'static str {
13664 "type.googleapis.com/google.cloud.deploy.v1.Phase"
13665 }
13666}
13667
13668/// Defines additional types related to [Phase].
13669pub mod phase {
13670 #[allow(unused_imports)]
13671 use super::*;
13672
13673 /// Valid states of a Phase.
13674 ///
13675 /// # Working with unknown values
13676 ///
13677 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13678 /// additional enum variants at any time. Adding new variants is not considered
13679 /// a breaking change. Applications should write their code in anticipation of:
13680 ///
13681 /// - New values appearing in future releases of the client library, **and**
13682 /// - New values received dynamically, without application changes.
13683 ///
13684 /// Please consult the [Working with enums] section in the user guide for some
13685 /// guidelines.
13686 ///
13687 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
13688 #[derive(Clone, Debug, PartialEq)]
13689 #[non_exhaustive]
13690 pub enum State {
13691 /// The Phase has an unspecified state.
13692 Unspecified,
13693 /// The Phase is waiting for an earlier Phase(s) to complete.
13694 Pending,
13695 /// The Phase is in progress.
13696 InProgress,
13697 /// The Phase has succeeded.
13698 Succeeded,
13699 /// The Phase has failed.
13700 Failed,
13701 /// The Phase was aborted.
13702 Aborted,
13703 /// The Phase was skipped.
13704 Skipped,
13705 /// If set, the enum was initialized with an unknown value.
13706 ///
13707 /// Applications can examine the value using [State::value] or
13708 /// [State::name].
13709 UnknownValue(state::UnknownValue),
13710 }
13711
13712 #[doc(hidden)]
13713 pub mod state {
13714 #[allow(unused_imports)]
13715 use super::*;
13716 #[derive(Clone, Debug, PartialEq)]
13717 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13718 }
13719
13720 impl State {
13721 /// Gets the enum value.
13722 ///
13723 /// Returns `None` if the enum contains an unknown value deserialized from
13724 /// the string representation of enums.
13725 pub fn value(&self) -> std::option::Option<i32> {
13726 match self {
13727 Self::Unspecified => std::option::Option::Some(0),
13728 Self::Pending => std::option::Option::Some(1),
13729 Self::InProgress => std::option::Option::Some(2),
13730 Self::Succeeded => std::option::Option::Some(3),
13731 Self::Failed => std::option::Option::Some(4),
13732 Self::Aborted => std::option::Option::Some(5),
13733 Self::Skipped => std::option::Option::Some(6),
13734 Self::UnknownValue(u) => u.0.value(),
13735 }
13736 }
13737
13738 /// Gets the enum value as a string.
13739 ///
13740 /// Returns `None` if the enum contains an unknown value deserialized from
13741 /// the integer representation of enums.
13742 pub fn name(&self) -> std::option::Option<&str> {
13743 match self {
13744 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
13745 Self::Pending => std::option::Option::Some("PENDING"),
13746 Self::InProgress => std::option::Option::Some("IN_PROGRESS"),
13747 Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
13748 Self::Failed => std::option::Option::Some("FAILED"),
13749 Self::Aborted => std::option::Option::Some("ABORTED"),
13750 Self::Skipped => std::option::Option::Some("SKIPPED"),
13751 Self::UnknownValue(u) => u.0.name(),
13752 }
13753 }
13754 }
13755
13756 impl std::default::Default for State {
13757 fn default() -> Self {
13758 use std::convert::From;
13759 Self::from(0)
13760 }
13761 }
13762
13763 impl std::fmt::Display for State {
13764 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13765 wkt::internal::display_enum(f, self.name(), self.value())
13766 }
13767 }
13768
13769 impl std::convert::From<i32> for State {
13770 fn from(value: i32) -> Self {
13771 match value {
13772 0 => Self::Unspecified,
13773 1 => Self::Pending,
13774 2 => Self::InProgress,
13775 3 => Self::Succeeded,
13776 4 => Self::Failed,
13777 5 => Self::Aborted,
13778 6 => Self::Skipped,
13779 _ => Self::UnknownValue(state::UnknownValue(
13780 wkt::internal::UnknownEnumValue::Integer(value),
13781 )),
13782 }
13783 }
13784 }
13785
13786 impl std::convert::From<&str> for State {
13787 fn from(value: &str) -> Self {
13788 use std::string::ToString;
13789 match value {
13790 "STATE_UNSPECIFIED" => Self::Unspecified,
13791 "PENDING" => Self::Pending,
13792 "IN_PROGRESS" => Self::InProgress,
13793 "SUCCEEDED" => Self::Succeeded,
13794 "FAILED" => Self::Failed,
13795 "ABORTED" => Self::Aborted,
13796 "SKIPPED" => Self::Skipped,
13797 _ => Self::UnknownValue(state::UnknownValue(
13798 wkt::internal::UnknownEnumValue::String(value.to_string()),
13799 )),
13800 }
13801 }
13802 }
13803
13804 impl serde::ser::Serialize for State {
13805 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13806 where
13807 S: serde::Serializer,
13808 {
13809 match self {
13810 Self::Unspecified => serializer.serialize_i32(0),
13811 Self::Pending => serializer.serialize_i32(1),
13812 Self::InProgress => serializer.serialize_i32(2),
13813 Self::Succeeded => serializer.serialize_i32(3),
13814 Self::Failed => serializer.serialize_i32(4),
13815 Self::Aborted => serializer.serialize_i32(5),
13816 Self::Skipped => serializer.serialize_i32(6),
13817 Self::UnknownValue(u) => u.0.serialize(serializer),
13818 }
13819 }
13820 }
13821
13822 impl<'de> serde::de::Deserialize<'de> for State {
13823 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13824 where
13825 D: serde::Deserializer<'de>,
13826 {
13827 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
13828 ".google.cloud.deploy.v1.Phase.State",
13829 ))
13830 }
13831 }
13832
13833 /// The job composition of this Phase.
13834 #[derive(Clone, Debug, PartialEq)]
13835 #[non_exhaustive]
13836 pub enum Jobs {
13837 /// Output only. Deployment job composition.
13838 DeploymentJobs(std::boxed::Box<crate::model::DeploymentJobs>),
13839 /// Output only. ChildRollout job composition.
13840 ChildRolloutJobs(std::boxed::Box<crate::model::ChildRolloutJobs>),
13841 }
13842}
13843
13844/// Deployment job composition.
13845#[derive(Clone, Default, PartialEq)]
13846#[non_exhaustive]
13847pub struct DeploymentJobs {
13848 /// Output only. The predeploy Job, which is the first job on the phase.
13849 pub predeploy_job: std::option::Option<crate::model::Job>,
13850
13851 /// Output only. The deploy Job. This is the deploy job in the phase.
13852 pub deploy_job: std::option::Option<crate::model::Job>,
13853
13854 /// Output only. The verify Job. Runs after a deploy if the deploy succeeds.
13855 pub verify_job: std::option::Option<crate::model::Job>,
13856
13857 /// Output only. The postdeploy Job, which is the last job on the phase.
13858 pub postdeploy_job: std::option::Option<crate::model::Job>,
13859
13860 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13861}
13862
13863impl DeploymentJobs {
13864 /// Creates a new default instance.
13865 pub fn new() -> Self {
13866 std::default::Default::default()
13867 }
13868
13869 /// Sets the value of [predeploy_job][crate::model::DeploymentJobs::predeploy_job].
13870 ///
13871 /// # Example
13872 /// ```ignore,no_run
13873 /// # use google_cloud_deploy_v1::model::DeploymentJobs;
13874 /// use google_cloud_deploy_v1::model::Job;
13875 /// let x = DeploymentJobs::new().set_predeploy_job(Job::default()/* use setters */);
13876 /// ```
13877 pub fn set_predeploy_job<T>(mut self, v: T) -> Self
13878 where
13879 T: std::convert::Into<crate::model::Job>,
13880 {
13881 self.predeploy_job = std::option::Option::Some(v.into());
13882 self
13883 }
13884
13885 /// Sets or clears the value of [predeploy_job][crate::model::DeploymentJobs::predeploy_job].
13886 ///
13887 /// # Example
13888 /// ```ignore,no_run
13889 /// # use google_cloud_deploy_v1::model::DeploymentJobs;
13890 /// use google_cloud_deploy_v1::model::Job;
13891 /// let x = DeploymentJobs::new().set_or_clear_predeploy_job(Some(Job::default()/* use setters */));
13892 /// let x = DeploymentJobs::new().set_or_clear_predeploy_job(None::<Job>);
13893 /// ```
13894 pub fn set_or_clear_predeploy_job<T>(mut self, v: std::option::Option<T>) -> Self
13895 where
13896 T: std::convert::Into<crate::model::Job>,
13897 {
13898 self.predeploy_job = v.map(|x| x.into());
13899 self
13900 }
13901
13902 /// Sets the value of [deploy_job][crate::model::DeploymentJobs::deploy_job].
13903 ///
13904 /// # Example
13905 /// ```ignore,no_run
13906 /// # use google_cloud_deploy_v1::model::DeploymentJobs;
13907 /// use google_cloud_deploy_v1::model::Job;
13908 /// let x = DeploymentJobs::new().set_deploy_job(Job::default()/* use setters */);
13909 /// ```
13910 pub fn set_deploy_job<T>(mut self, v: T) -> Self
13911 where
13912 T: std::convert::Into<crate::model::Job>,
13913 {
13914 self.deploy_job = std::option::Option::Some(v.into());
13915 self
13916 }
13917
13918 /// Sets or clears the value of [deploy_job][crate::model::DeploymentJobs::deploy_job].
13919 ///
13920 /// # Example
13921 /// ```ignore,no_run
13922 /// # use google_cloud_deploy_v1::model::DeploymentJobs;
13923 /// use google_cloud_deploy_v1::model::Job;
13924 /// let x = DeploymentJobs::new().set_or_clear_deploy_job(Some(Job::default()/* use setters */));
13925 /// let x = DeploymentJobs::new().set_or_clear_deploy_job(None::<Job>);
13926 /// ```
13927 pub fn set_or_clear_deploy_job<T>(mut self, v: std::option::Option<T>) -> Self
13928 where
13929 T: std::convert::Into<crate::model::Job>,
13930 {
13931 self.deploy_job = v.map(|x| x.into());
13932 self
13933 }
13934
13935 /// Sets the value of [verify_job][crate::model::DeploymentJobs::verify_job].
13936 ///
13937 /// # Example
13938 /// ```ignore,no_run
13939 /// # use google_cloud_deploy_v1::model::DeploymentJobs;
13940 /// use google_cloud_deploy_v1::model::Job;
13941 /// let x = DeploymentJobs::new().set_verify_job(Job::default()/* use setters */);
13942 /// ```
13943 pub fn set_verify_job<T>(mut self, v: T) -> Self
13944 where
13945 T: std::convert::Into<crate::model::Job>,
13946 {
13947 self.verify_job = std::option::Option::Some(v.into());
13948 self
13949 }
13950
13951 /// Sets or clears the value of [verify_job][crate::model::DeploymentJobs::verify_job].
13952 ///
13953 /// # Example
13954 /// ```ignore,no_run
13955 /// # use google_cloud_deploy_v1::model::DeploymentJobs;
13956 /// use google_cloud_deploy_v1::model::Job;
13957 /// let x = DeploymentJobs::new().set_or_clear_verify_job(Some(Job::default()/* use setters */));
13958 /// let x = DeploymentJobs::new().set_or_clear_verify_job(None::<Job>);
13959 /// ```
13960 pub fn set_or_clear_verify_job<T>(mut self, v: std::option::Option<T>) -> Self
13961 where
13962 T: std::convert::Into<crate::model::Job>,
13963 {
13964 self.verify_job = v.map(|x| x.into());
13965 self
13966 }
13967
13968 /// Sets the value of [postdeploy_job][crate::model::DeploymentJobs::postdeploy_job].
13969 ///
13970 /// # Example
13971 /// ```ignore,no_run
13972 /// # use google_cloud_deploy_v1::model::DeploymentJobs;
13973 /// use google_cloud_deploy_v1::model::Job;
13974 /// let x = DeploymentJobs::new().set_postdeploy_job(Job::default()/* use setters */);
13975 /// ```
13976 pub fn set_postdeploy_job<T>(mut self, v: T) -> Self
13977 where
13978 T: std::convert::Into<crate::model::Job>,
13979 {
13980 self.postdeploy_job = std::option::Option::Some(v.into());
13981 self
13982 }
13983
13984 /// Sets or clears the value of [postdeploy_job][crate::model::DeploymentJobs::postdeploy_job].
13985 ///
13986 /// # Example
13987 /// ```ignore,no_run
13988 /// # use google_cloud_deploy_v1::model::DeploymentJobs;
13989 /// use google_cloud_deploy_v1::model::Job;
13990 /// let x = DeploymentJobs::new().set_or_clear_postdeploy_job(Some(Job::default()/* use setters */));
13991 /// let x = DeploymentJobs::new().set_or_clear_postdeploy_job(None::<Job>);
13992 /// ```
13993 pub fn set_or_clear_postdeploy_job<T>(mut self, v: std::option::Option<T>) -> Self
13994 where
13995 T: std::convert::Into<crate::model::Job>,
13996 {
13997 self.postdeploy_job = v.map(|x| x.into());
13998 self
13999 }
14000}
14001
14002impl wkt::message::Message for DeploymentJobs {
14003 fn typename() -> &'static str {
14004 "type.googleapis.com/google.cloud.deploy.v1.DeploymentJobs"
14005 }
14006}
14007
14008/// ChildRollouts job composition
14009#[derive(Clone, Default, PartialEq)]
14010#[non_exhaustive]
14011pub struct ChildRolloutJobs {
14012 /// Output only. List of CreateChildRolloutJobs
14013 pub create_rollout_jobs: std::vec::Vec<crate::model::Job>,
14014
14015 /// Output only. List of AdvanceChildRolloutJobs
14016 pub advance_rollout_jobs: std::vec::Vec<crate::model::Job>,
14017
14018 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14019}
14020
14021impl ChildRolloutJobs {
14022 /// Creates a new default instance.
14023 pub fn new() -> Self {
14024 std::default::Default::default()
14025 }
14026
14027 /// Sets the value of [create_rollout_jobs][crate::model::ChildRolloutJobs::create_rollout_jobs].
14028 ///
14029 /// # Example
14030 /// ```ignore,no_run
14031 /// # use google_cloud_deploy_v1::model::ChildRolloutJobs;
14032 /// use google_cloud_deploy_v1::model::Job;
14033 /// let x = ChildRolloutJobs::new()
14034 /// .set_create_rollout_jobs([
14035 /// Job::default()/* use setters */,
14036 /// Job::default()/* use (different) setters */,
14037 /// ]);
14038 /// ```
14039 pub fn set_create_rollout_jobs<T, V>(mut self, v: T) -> Self
14040 where
14041 T: std::iter::IntoIterator<Item = V>,
14042 V: std::convert::Into<crate::model::Job>,
14043 {
14044 use std::iter::Iterator;
14045 self.create_rollout_jobs = v.into_iter().map(|i| i.into()).collect();
14046 self
14047 }
14048
14049 /// Sets the value of [advance_rollout_jobs][crate::model::ChildRolloutJobs::advance_rollout_jobs].
14050 ///
14051 /// # Example
14052 /// ```ignore,no_run
14053 /// # use google_cloud_deploy_v1::model::ChildRolloutJobs;
14054 /// use google_cloud_deploy_v1::model::Job;
14055 /// let x = ChildRolloutJobs::new()
14056 /// .set_advance_rollout_jobs([
14057 /// Job::default()/* use setters */,
14058 /// Job::default()/* use (different) setters */,
14059 /// ]);
14060 /// ```
14061 pub fn set_advance_rollout_jobs<T, V>(mut self, v: T) -> Self
14062 where
14063 T: std::iter::IntoIterator<Item = V>,
14064 V: std::convert::Into<crate::model::Job>,
14065 {
14066 use std::iter::Iterator;
14067 self.advance_rollout_jobs = v.into_iter().map(|i| i.into()).collect();
14068 self
14069 }
14070}
14071
14072impl wkt::message::Message for ChildRolloutJobs {
14073 fn typename() -> &'static str {
14074 "type.googleapis.com/google.cloud.deploy.v1.ChildRolloutJobs"
14075 }
14076}
14077
14078/// Job represents an operation for a `Rollout`.
14079#[derive(Clone, Default, PartialEq)]
14080#[non_exhaustive]
14081pub struct Job {
14082 /// Output only. The ID of the Job.
14083 pub id: std::string::String,
14084
14085 /// Output only. The current state of the Job.
14086 pub state: crate::model::job::State,
14087
14088 /// Output only. Additional information on why the Job was skipped, if
14089 /// available.
14090 pub skip_message: std::string::String,
14091
14092 /// Output only. The name of the `JobRun` responsible for the most recent
14093 /// invocation of this Job.
14094 pub job_run: std::string::String,
14095
14096 /// The type of Job.
14097 pub job_type: std::option::Option<crate::model::job::JobType>,
14098
14099 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14100}
14101
14102impl Job {
14103 /// Creates a new default instance.
14104 pub fn new() -> Self {
14105 std::default::Default::default()
14106 }
14107
14108 /// Sets the value of [id][crate::model::Job::id].
14109 ///
14110 /// # Example
14111 /// ```ignore,no_run
14112 /// # use google_cloud_deploy_v1::model::Job;
14113 /// let x = Job::new().set_id("example");
14114 /// ```
14115 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14116 self.id = v.into();
14117 self
14118 }
14119
14120 /// Sets the value of [state][crate::model::Job::state].
14121 ///
14122 /// # Example
14123 /// ```ignore,no_run
14124 /// # use google_cloud_deploy_v1::model::Job;
14125 /// use google_cloud_deploy_v1::model::job::State;
14126 /// let x0 = Job::new().set_state(State::Pending);
14127 /// let x1 = Job::new().set_state(State::Disabled);
14128 /// let x2 = Job::new().set_state(State::InProgress);
14129 /// ```
14130 pub fn set_state<T: std::convert::Into<crate::model::job::State>>(mut self, v: T) -> Self {
14131 self.state = v.into();
14132 self
14133 }
14134
14135 /// Sets the value of [skip_message][crate::model::Job::skip_message].
14136 ///
14137 /// # Example
14138 /// ```ignore,no_run
14139 /// # use google_cloud_deploy_v1::model::Job;
14140 /// let x = Job::new().set_skip_message("example");
14141 /// ```
14142 pub fn set_skip_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14143 self.skip_message = v.into();
14144 self
14145 }
14146
14147 /// Sets the value of [job_run][crate::model::Job::job_run].
14148 ///
14149 /// # Example
14150 /// ```ignore,no_run
14151 /// # use google_cloud_deploy_v1::model::Job;
14152 /// # let project_id = "project_id";
14153 /// # let location_id = "location_id";
14154 /// # let delivery_pipeline_id = "delivery_pipeline_id";
14155 /// # let release_id = "release_id";
14156 /// # let rollout_id = "rollout_id";
14157 /// # let job_run_id = "job_run_id";
14158 /// let x = Job::new().set_job_run(format!("projects/{project_id}/locations/{location_id}/deliveryPipelines/{delivery_pipeline_id}/releases/{release_id}/rollouts/{rollout_id}/jobRuns/{job_run_id}"));
14159 /// ```
14160 pub fn set_job_run<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14161 self.job_run = v.into();
14162 self
14163 }
14164
14165 /// Sets the value of [job_type][crate::model::Job::job_type].
14166 ///
14167 /// Note that all the setters affecting `job_type` are mutually
14168 /// exclusive.
14169 ///
14170 /// # Example
14171 /// ```ignore,no_run
14172 /// # use google_cloud_deploy_v1::model::Job;
14173 /// use google_cloud_deploy_v1::model::DeployJob;
14174 /// let x = Job::new().set_job_type(Some(
14175 /// google_cloud_deploy_v1::model::job::JobType::DeployJob(DeployJob::default().into())));
14176 /// ```
14177 pub fn set_job_type<T: std::convert::Into<std::option::Option<crate::model::job::JobType>>>(
14178 mut self,
14179 v: T,
14180 ) -> Self {
14181 self.job_type = v.into();
14182 self
14183 }
14184
14185 /// The value of [job_type][crate::model::Job::job_type]
14186 /// if it holds a `DeployJob`, `None` if the field is not set or
14187 /// holds a different branch.
14188 pub fn deploy_job(&self) -> std::option::Option<&std::boxed::Box<crate::model::DeployJob>> {
14189 #[allow(unreachable_patterns)]
14190 self.job_type.as_ref().and_then(|v| match v {
14191 crate::model::job::JobType::DeployJob(v) => std::option::Option::Some(v),
14192 _ => std::option::Option::None,
14193 })
14194 }
14195
14196 /// Sets the value of [job_type][crate::model::Job::job_type]
14197 /// to hold a `DeployJob`.
14198 ///
14199 /// Note that all the setters affecting `job_type` are
14200 /// mutually exclusive.
14201 ///
14202 /// # Example
14203 /// ```ignore,no_run
14204 /// # use google_cloud_deploy_v1::model::Job;
14205 /// use google_cloud_deploy_v1::model::DeployJob;
14206 /// let x = Job::new().set_deploy_job(DeployJob::default()/* use setters */);
14207 /// assert!(x.deploy_job().is_some());
14208 /// assert!(x.verify_job().is_none());
14209 /// assert!(x.predeploy_job().is_none());
14210 /// assert!(x.postdeploy_job().is_none());
14211 /// assert!(x.create_child_rollout_job().is_none());
14212 /// assert!(x.advance_child_rollout_job().is_none());
14213 /// ```
14214 pub fn set_deploy_job<T: std::convert::Into<std::boxed::Box<crate::model::DeployJob>>>(
14215 mut self,
14216 v: T,
14217 ) -> Self {
14218 self.job_type = std::option::Option::Some(crate::model::job::JobType::DeployJob(v.into()));
14219 self
14220 }
14221
14222 /// The value of [job_type][crate::model::Job::job_type]
14223 /// if it holds a `VerifyJob`, `None` if the field is not set or
14224 /// holds a different branch.
14225 pub fn verify_job(&self) -> std::option::Option<&std::boxed::Box<crate::model::VerifyJob>> {
14226 #[allow(unreachable_patterns)]
14227 self.job_type.as_ref().and_then(|v| match v {
14228 crate::model::job::JobType::VerifyJob(v) => std::option::Option::Some(v),
14229 _ => std::option::Option::None,
14230 })
14231 }
14232
14233 /// Sets the value of [job_type][crate::model::Job::job_type]
14234 /// to hold a `VerifyJob`.
14235 ///
14236 /// Note that all the setters affecting `job_type` are
14237 /// mutually exclusive.
14238 ///
14239 /// # Example
14240 /// ```ignore,no_run
14241 /// # use google_cloud_deploy_v1::model::Job;
14242 /// use google_cloud_deploy_v1::model::VerifyJob;
14243 /// let x = Job::new().set_verify_job(VerifyJob::default()/* use setters */);
14244 /// assert!(x.verify_job().is_some());
14245 /// assert!(x.deploy_job().is_none());
14246 /// assert!(x.predeploy_job().is_none());
14247 /// assert!(x.postdeploy_job().is_none());
14248 /// assert!(x.create_child_rollout_job().is_none());
14249 /// assert!(x.advance_child_rollout_job().is_none());
14250 /// ```
14251 pub fn set_verify_job<T: std::convert::Into<std::boxed::Box<crate::model::VerifyJob>>>(
14252 mut self,
14253 v: T,
14254 ) -> Self {
14255 self.job_type = std::option::Option::Some(crate::model::job::JobType::VerifyJob(v.into()));
14256 self
14257 }
14258
14259 /// The value of [job_type][crate::model::Job::job_type]
14260 /// if it holds a `PredeployJob`, `None` if the field is not set or
14261 /// holds a different branch.
14262 pub fn predeploy_job(
14263 &self,
14264 ) -> std::option::Option<&std::boxed::Box<crate::model::PredeployJob>> {
14265 #[allow(unreachable_patterns)]
14266 self.job_type.as_ref().and_then(|v| match v {
14267 crate::model::job::JobType::PredeployJob(v) => std::option::Option::Some(v),
14268 _ => std::option::Option::None,
14269 })
14270 }
14271
14272 /// Sets the value of [job_type][crate::model::Job::job_type]
14273 /// to hold a `PredeployJob`.
14274 ///
14275 /// Note that all the setters affecting `job_type` are
14276 /// mutually exclusive.
14277 ///
14278 /// # Example
14279 /// ```ignore,no_run
14280 /// # use google_cloud_deploy_v1::model::Job;
14281 /// use google_cloud_deploy_v1::model::PredeployJob;
14282 /// let x = Job::new().set_predeploy_job(PredeployJob::default()/* use setters */);
14283 /// assert!(x.predeploy_job().is_some());
14284 /// assert!(x.deploy_job().is_none());
14285 /// assert!(x.verify_job().is_none());
14286 /// assert!(x.postdeploy_job().is_none());
14287 /// assert!(x.create_child_rollout_job().is_none());
14288 /// assert!(x.advance_child_rollout_job().is_none());
14289 /// ```
14290 pub fn set_predeploy_job<T: std::convert::Into<std::boxed::Box<crate::model::PredeployJob>>>(
14291 mut self,
14292 v: T,
14293 ) -> Self {
14294 self.job_type =
14295 std::option::Option::Some(crate::model::job::JobType::PredeployJob(v.into()));
14296 self
14297 }
14298
14299 /// The value of [job_type][crate::model::Job::job_type]
14300 /// if it holds a `PostdeployJob`, `None` if the field is not set or
14301 /// holds a different branch.
14302 pub fn postdeploy_job(
14303 &self,
14304 ) -> std::option::Option<&std::boxed::Box<crate::model::PostdeployJob>> {
14305 #[allow(unreachable_patterns)]
14306 self.job_type.as_ref().and_then(|v| match v {
14307 crate::model::job::JobType::PostdeployJob(v) => std::option::Option::Some(v),
14308 _ => std::option::Option::None,
14309 })
14310 }
14311
14312 /// Sets the value of [job_type][crate::model::Job::job_type]
14313 /// to hold a `PostdeployJob`.
14314 ///
14315 /// Note that all the setters affecting `job_type` are
14316 /// mutually exclusive.
14317 ///
14318 /// # Example
14319 /// ```ignore,no_run
14320 /// # use google_cloud_deploy_v1::model::Job;
14321 /// use google_cloud_deploy_v1::model::PostdeployJob;
14322 /// let x = Job::new().set_postdeploy_job(PostdeployJob::default()/* use setters */);
14323 /// assert!(x.postdeploy_job().is_some());
14324 /// assert!(x.deploy_job().is_none());
14325 /// assert!(x.verify_job().is_none());
14326 /// assert!(x.predeploy_job().is_none());
14327 /// assert!(x.create_child_rollout_job().is_none());
14328 /// assert!(x.advance_child_rollout_job().is_none());
14329 /// ```
14330 pub fn set_postdeploy_job<
14331 T: std::convert::Into<std::boxed::Box<crate::model::PostdeployJob>>,
14332 >(
14333 mut self,
14334 v: T,
14335 ) -> Self {
14336 self.job_type =
14337 std::option::Option::Some(crate::model::job::JobType::PostdeployJob(v.into()));
14338 self
14339 }
14340
14341 /// The value of [job_type][crate::model::Job::job_type]
14342 /// if it holds a `CreateChildRolloutJob`, `None` if the field is not set or
14343 /// holds a different branch.
14344 pub fn create_child_rollout_job(
14345 &self,
14346 ) -> std::option::Option<&std::boxed::Box<crate::model::CreateChildRolloutJob>> {
14347 #[allow(unreachable_patterns)]
14348 self.job_type.as_ref().and_then(|v| match v {
14349 crate::model::job::JobType::CreateChildRolloutJob(v) => std::option::Option::Some(v),
14350 _ => std::option::Option::None,
14351 })
14352 }
14353
14354 /// Sets the value of [job_type][crate::model::Job::job_type]
14355 /// to hold a `CreateChildRolloutJob`.
14356 ///
14357 /// Note that all the setters affecting `job_type` are
14358 /// mutually exclusive.
14359 ///
14360 /// # Example
14361 /// ```ignore,no_run
14362 /// # use google_cloud_deploy_v1::model::Job;
14363 /// use google_cloud_deploy_v1::model::CreateChildRolloutJob;
14364 /// let x = Job::new().set_create_child_rollout_job(CreateChildRolloutJob::default()/* use setters */);
14365 /// assert!(x.create_child_rollout_job().is_some());
14366 /// assert!(x.deploy_job().is_none());
14367 /// assert!(x.verify_job().is_none());
14368 /// assert!(x.predeploy_job().is_none());
14369 /// assert!(x.postdeploy_job().is_none());
14370 /// assert!(x.advance_child_rollout_job().is_none());
14371 /// ```
14372 pub fn set_create_child_rollout_job<
14373 T: std::convert::Into<std::boxed::Box<crate::model::CreateChildRolloutJob>>,
14374 >(
14375 mut self,
14376 v: T,
14377 ) -> Self {
14378 self.job_type =
14379 std::option::Option::Some(crate::model::job::JobType::CreateChildRolloutJob(v.into()));
14380 self
14381 }
14382
14383 /// The value of [job_type][crate::model::Job::job_type]
14384 /// if it holds a `AdvanceChildRolloutJob`, `None` if the field is not set or
14385 /// holds a different branch.
14386 pub fn advance_child_rollout_job(
14387 &self,
14388 ) -> std::option::Option<&std::boxed::Box<crate::model::AdvanceChildRolloutJob>> {
14389 #[allow(unreachable_patterns)]
14390 self.job_type.as_ref().and_then(|v| match v {
14391 crate::model::job::JobType::AdvanceChildRolloutJob(v) => std::option::Option::Some(v),
14392 _ => std::option::Option::None,
14393 })
14394 }
14395
14396 /// Sets the value of [job_type][crate::model::Job::job_type]
14397 /// to hold a `AdvanceChildRolloutJob`.
14398 ///
14399 /// Note that all the setters affecting `job_type` are
14400 /// mutually exclusive.
14401 ///
14402 /// # Example
14403 /// ```ignore,no_run
14404 /// # use google_cloud_deploy_v1::model::Job;
14405 /// use google_cloud_deploy_v1::model::AdvanceChildRolloutJob;
14406 /// let x = Job::new().set_advance_child_rollout_job(AdvanceChildRolloutJob::default()/* use setters */);
14407 /// assert!(x.advance_child_rollout_job().is_some());
14408 /// assert!(x.deploy_job().is_none());
14409 /// assert!(x.verify_job().is_none());
14410 /// assert!(x.predeploy_job().is_none());
14411 /// assert!(x.postdeploy_job().is_none());
14412 /// assert!(x.create_child_rollout_job().is_none());
14413 /// ```
14414 pub fn set_advance_child_rollout_job<
14415 T: std::convert::Into<std::boxed::Box<crate::model::AdvanceChildRolloutJob>>,
14416 >(
14417 mut self,
14418 v: T,
14419 ) -> Self {
14420 self.job_type =
14421 std::option::Option::Some(crate::model::job::JobType::AdvanceChildRolloutJob(v.into()));
14422 self
14423 }
14424}
14425
14426impl wkt::message::Message for Job {
14427 fn typename() -> &'static str {
14428 "type.googleapis.com/google.cloud.deploy.v1.Job"
14429 }
14430}
14431
14432/// Defines additional types related to [Job].
14433pub mod job {
14434 #[allow(unused_imports)]
14435 use super::*;
14436
14437 /// Valid states of a Job.
14438 ///
14439 /// # Working with unknown values
14440 ///
14441 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
14442 /// additional enum variants at any time. Adding new variants is not considered
14443 /// a breaking change. Applications should write their code in anticipation of:
14444 ///
14445 /// - New values appearing in future releases of the client library, **and**
14446 /// - New values received dynamically, without application changes.
14447 ///
14448 /// Please consult the [Working with enums] section in the user guide for some
14449 /// guidelines.
14450 ///
14451 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
14452 #[derive(Clone, Debug, PartialEq)]
14453 #[non_exhaustive]
14454 pub enum State {
14455 /// The Job has an unspecified state.
14456 Unspecified,
14457 /// The Job is waiting for an earlier Phase(s) or Job(s) to complete.
14458 Pending,
14459 /// The Job is disabled.
14460 Disabled,
14461 /// The Job is in progress.
14462 InProgress,
14463 /// The Job succeeded.
14464 Succeeded,
14465 /// The Job failed.
14466 Failed,
14467 /// The Job was aborted.
14468 Aborted,
14469 /// The Job was skipped.
14470 Skipped,
14471 /// The Job was ignored.
14472 Ignored,
14473 /// If set, the enum was initialized with an unknown value.
14474 ///
14475 /// Applications can examine the value using [State::value] or
14476 /// [State::name].
14477 UnknownValue(state::UnknownValue),
14478 }
14479
14480 #[doc(hidden)]
14481 pub mod state {
14482 #[allow(unused_imports)]
14483 use super::*;
14484 #[derive(Clone, Debug, PartialEq)]
14485 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
14486 }
14487
14488 impl State {
14489 /// Gets the enum value.
14490 ///
14491 /// Returns `None` if the enum contains an unknown value deserialized from
14492 /// the string representation of enums.
14493 pub fn value(&self) -> std::option::Option<i32> {
14494 match self {
14495 Self::Unspecified => std::option::Option::Some(0),
14496 Self::Pending => std::option::Option::Some(1),
14497 Self::Disabled => std::option::Option::Some(2),
14498 Self::InProgress => std::option::Option::Some(3),
14499 Self::Succeeded => std::option::Option::Some(4),
14500 Self::Failed => std::option::Option::Some(5),
14501 Self::Aborted => std::option::Option::Some(6),
14502 Self::Skipped => std::option::Option::Some(7),
14503 Self::Ignored => std::option::Option::Some(8),
14504 Self::UnknownValue(u) => u.0.value(),
14505 }
14506 }
14507
14508 /// Gets the enum value as a string.
14509 ///
14510 /// Returns `None` if the enum contains an unknown value deserialized from
14511 /// the integer representation of enums.
14512 pub fn name(&self) -> std::option::Option<&str> {
14513 match self {
14514 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
14515 Self::Pending => std::option::Option::Some("PENDING"),
14516 Self::Disabled => std::option::Option::Some("DISABLED"),
14517 Self::InProgress => std::option::Option::Some("IN_PROGRESS"),
14518 Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
14519 Self::Failed => std::option::Option::Some("FAILED"),
14520 Self::Aborted => std::option::Option::Some("ABORTED"),
14521 Self::Skipped => std::option::Option::Some("SKIPPED"),
14522 Self::Ignored => std::option::Option::Some("IGNORED"),
14523 Self::UnknownValue(u) => u.0.name(),
14524 }
14525 }
14526 }
14527
14528 impl std::default::Default for State {
14529 fn default() -> Self {
14530 use std::convert::From;
14531 Self::from(0)
14532 }
14533 }
14534
14535 impl std::fmt::Display for State {
14536 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
14537 wkt::internal::display_enum(f, self.name(), self.value())
14538 }
14539 }
14540
14541 impl std::convert::From<i32> for State {
14542 fn from(value: i32) -> Self {
14543 match value {
14544 0 => Self::Unspecified,
14545 1 => Self::Pending,
14546 2 => Self::Disabled,
14547 3 => Self::InProgress,
14548 4 => Self::Succeeded,
14549 5 => Self::Failed,
14550 6 => Self::Aborted,
14551 7 => Self::Skipped,
14552 8 => Self::Ignored,
14553 _ => Self::UnknownValue(state::UnknownValue(
14554 wkt::internal::UnknownEnumValue::Integer(value),
14555 )),
14556 }
14557 }
14558 }
14559
14560 impl std::convert::From<&str> for State {
14561 fn from(value: &str) -> Self {
14562 use std::string::ToString;
14563 match value {
14564 "STATE_UNSPECIFIED" => Self::Unspecified,
14565 "PENDING" => Self::Pending,
14566 "DISABLED" => Self::Disabled,
14567 "IN_PROGRESS" => Self::InProgress,
14568 "SUCCEEDED" => Self::Succeeded,
14569 "FAILED" => Self::Failed,
14570 "ABORTED" => Self::Aborted,
14571 "SKIPPED" => Self::Skipped,
14572 "IGNORED" => Self::Ignored,
14573 _ => Self::UnknownValue(state::UnknownValue(
14574 wkt::internal::UnknownEnumValue::String(value.to_string()),
14575 )),
14576 }
14577 }
14578 }
14579
14580 impl serde::ser::Serialize for State {
14581 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14582 where
14583 S: serde::Serializer,
14584 {
14585 match self {
14586 Self::Unspecified => serializer.serialize_i32(0),
14587 Self::Pending => serializer.serialize_i32(1),
14588 Self::Disabled => serializer.serialize_i32(2),
14589 Self::InProgress => serializer.serialize_i32(3),
14590 Self::Succeeded => serializer.serialize_i32(4),
14591 Self::Failed => serializer.serialize_i32(5),
14592 Self::Aborted => serializer.serialize_i32(6),
14593 Self::Skipped => serializer.serialize_i32(7),
14594 Self::Ignored => serializer.serialize_i32(8),
14595 Self::UnknownValue(u) => u.0.serialize(serializer),
14596 }
14597 }
14598 }
14599
14600 impl<'de> serde::de::Deserialize<'de> for State {
14601 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14602 where
14603 D: serde::Deserializer<'de>,
14604 {
14605 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
14606 ".google.cloud.deploy.v1.Job.State",
14607 ))
14608 }
14609 }
14610
14611 /// The type of Job.
14612 #[derive(Clone, Debug, PartialEq)]
14613 #[non_exhaustive]
14614 pub enum JobType {
14615 /// Output only. A deploy Job.
14616 DeployJob(std::boxed::Box<crate::model::DeployJob>),
14617 /// Output only. A verify Job.
14618 VerifyJob(std::boxed::Box<crate::model::VerifyJob>),
14619 /// Output only. A predeploy Job.
14620 PredeployJob(std::boxed::Box<crate::model::PredeployJob>),
14621 /// Output only. A postdeploy Job.
14622 PostdeployJob(std::boxed::Box<crate::model::PostdeployJob>),
14623 /// Output only. A createChildRollout Job.
14624 CreateChildRolloutJob(std::boxed::Box<crate::model::CreateChildRolloutJob>),
14625 /// Output only. An advanceChildRollout Job.
14626 AdvanceChildRolloutJob(std::boxed::Box<crate::model::AdvanceChildRolloutJob>),
14627 }
14628}
14629
14630/// A deploy Job.
14631#[derive(Clone, Default, PartialEq)]
14632#[non_exhaustive]
14633pub struct DeployJob {
14634 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14635}
14636
14637impl DeployJob {
14638 /// Creates a new default instance.
14639 pub fn new() -> Self {
14640 std::default::Default::default()
14641 }
14642}
14643
14644impl wkt::message::Message for DeployJob {
14645 fn typename() -> &'static str {
14646 "type.googleapis.com/google.cloud.deploy.v1.DeployJob"
14647 }
14648}
14649
14650/// A verify Job.
14651#[derive(Clone, Default, PartialEq)]
14652#[non_exhaustive]
14653pub struct VerifyJob {
14654 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14655}
14656
14657impl VerifyJob {
14658 /// Creates a new default instance.
14659 pub fn new() -> Self {
14660 std::default::Default::default()
14661 }
14662}
14663
14664impl wkt::message::Message for VerifyJob {
14665 fn typename() -> &'static str {
14666 "type.googleapis.com/google.cloud.deploy.v1.VerifyJob"
14667 }
14668}
14669
14670/// A predeploy Job.
14671#[derive(Clone, Default, PartialEq)]
14672#[non_exhaustive]
14673pub struct PredeployJob {
14674 /// Output only. The custom actions that the predeploy Job executes.
14675 pub actions: std::vec::Vec<std::string::String>,
14676
14677 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14678}
14679
14680impl PredeployJob {
14681 /// Creates a new default instance.
14682 pub fn new() -> Self {
14683 std::default::Default::default()
14684 }
14685
14686 /// Sets the value of [actions][crate::model::PredeployJob::actions].
14687 ///
14688 /// # Example
14689 /// ```ignore,no_run
14690 /// # use google_cloud_deploy_v1::model::PredeployJob;
14691 /// let x = PredeployJob::new().set_actions(["a", "b", "c"]);
14692 /// ```
14693 pub fn set_actions<T, V>(mut self, v: T) -> Self
14694 where
14695 T: std::iter::IntoIterator<Item = V>,
14696 V: std::convert::Into<std::string::String>,
14697 {
14698 use std::iter::Iterator;
14699 self.actions = v.into_iter().map(|i| i.into()).collect();
14700 self
14701 }
14702}
14703
14704impl wkt::message::Message for PredeployJob {
14705 fn typename() -> &'static str {
14706 "type.googleapis.com/google.cloud.deploy.v1.PredeployJob"
14707 }
14708}
14709
14710/// A postdeploy Job.
14711#[derive(Clone, Default, PartialEq)]
14712#[non_exhaustive]
14713pub struct PostdeployJob {
14714 /// Output only. The custom actions that the postdeploy Job executes.
14715 pub actions: std::vec::Vec<std::string::String>,
14716
14717 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14718}
14719
14720impl PostdeployJob {
14721 /// Creates a new default instance.
14722 pub fn new() -> Self {
14723 std::default::Default::default()
14724 }
14725
14726 /// Sets the value of [actions][crate::model::PostdeployJob::actions].
14727 ///
14728 /// # Example
14729 /// ```ignore,no_run
14730 /// # use google_cloud_deploy_v1::model::PostdeployJob;
14731 /// let x = PostdeployJob::new().set_actions(["a", "b", "c"]);
14732 /// ```
14733 pub fn set_actions<T, V>(mut self, v: T) -> Self
14734 where
14735 T: std::iter::IntoIterator<Item = V>,
14736 V: std::convert::Into<std::string::String>,
14737 {
14738 use std::iter::Iterator;
14739 self.actions = v.into_iter().map(|i| i.into()).collect();
14740 self
14741 }
14742}
14743
14744impl wkt::message::Message for PostdeployJob {
14745 fn typename() -> &'static str {
14746 "type.googleapis.com/google.cloud.deploy.v1.PostdeployJob"
14747 }
14748}
14749
14750/// A createChildRollout Job.
14751#[derive(Clone, Default, PartialEq)]
14752#[non_exhaustive]
14753pub struct CreateChildRolloutJob {
14754 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14755}
14756
14757impl CreateChildRolloutJob {
14758 /// Creates a new default instance.
14759 pub fn new() -> Self {
14760 std::default::Default::default()
14761 }
14762}
14763
14764impl wkt::message::Message for CreateChildRolloutJob {
14765 fn typename() -> &'static str {
14766 "type.googleapis.com/google.cloud.deploy.v1.CreateChildRolloutJob"
14767 }
14768}
14769
14770/// An advanceChildRollout Job.
14771#[derive(Clone, Default, PartialEq)]
14772#[non_exhaustive]
14773pub struct AdvanceChildRolloutJob {
14774 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14775}
14776
14777impl AdvanceChildRolloutJob {
14778 /// Creates a new default instance.
14779 pub fn new() -> Self {
14780 std::default::Default::default()
14781 }
14782}
14783
14784impl wkt::message::Message for AdvanceChildRolloutJob {
14785 fn typename() -> &'static str {
14786 "type.googleapis.com/google.cloud.deploy.v1.AdvanceChildRolloutJob"
14787 }
14788}
14789
14790/// ListRolloutsRequest is the request object used by `ListRollouts`.
14791#[derive(Clone, Default, PartialEq)]
14792#[non_exhaustive]
14793pub struct ListRolloutsRequest {
14794 /// Required. The `Release` which owns this collection of `Rollout` objects.
14795 pub parent: std::string::String,
14796
14797 /// Optional. The maximum number of `Rollout` objects to return. The service
14798 /// may return fewer than this value. If unspecified, at most 50 `Rollout`
14799 /// objects will be returned. The maximum value is 1000; values above 1000 will
14800 /// be set to 1000.
14801 pub page_size: i32,
14802
14803 /// Optional. A page token, received from a previous `ListRollouts` call.
14804 /// Provide this to retrieve the subsequent page.
14805 ///
14806 /// When paginating, all other provided parameters match
14807 /// the call that provided the page token.
14808 pub page_token: std::string::String,
14809
14810 /// Optional. Filter rollouts to be returned. See <https://google.aip.dev/160>
14811 /// for more details.
14812 pub filter: std::string::String,
14813
14814 /// Optional. Field to sort by. See <https://google.aip.dev/132#ordering> for
14815 /// more details.
14816 pub order_by: std::string::String,
14817
14818 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14819}
14820
14821impl ListRolloutsRequest {
14822 /// Creates a new default instance.
14823 pub fn new() -> Self {
14824 std::default::Default::default()
14825 }
14826
14827 /// Sets the value of [parent][crate::model::ListRolloutsRequest::parent].
14828 ///
14829 /// # Example
14830 /// ```ignore,no_run
14831 /// # use google_cloud_deploy_v1::model::ListRolloutsRequest;
14832 /// # let project_id = "project_id";
14833 /// # let location_id = "location_id";
14834 /// # let delivery_pipeline_id = "delivery_pipeline_id";
14835 /// # let release_id = "release_id";
14836 /// let x = ListRolloutsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/deliveryPipelines/{delivery_pipeline_id}/releases/{release_id}"));
14837 /// ```
14838 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14839 self.parent = v.into();
14840 self
14841 }
14842
14843 /// Sets the value of [page_size][crate::model::ListRolloutsRequest::page_size].
14844 ///
14845 /// # Example
14846 /// ```ignore,no_run
14847 /// # use google_cloud_deploy_v1::model::ListRolloutsRequest;
14848 /// let x = ListRolloutsRequest::new().set_page_size(42);
14849 /// ```
14850 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
14851 self.page_size = v.into();
14852 self
14853 }
14854
14855 /// Sets the value of [page_token][crate::model::ListRolloutsRequest::page_token].
14856 ///
14857 /// # Example
14858 /// ```ignore,no_run
14859 /// # use google_cloud_deploy_v1::model::ListRolloutsRequest;
14860 /// let x = ListRolloutsRequest::new().set_page_token("example");
14861 /// ```
14862 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14863 self.page_token = v.into();
14864 self
14865 }
14866
14867 /// Sets the value of [filter][crate::model::ListRolloutsRequest::filter].
14868 ///
14869 /// # Example
14870 /// ```ignore,no_run
14871 /// # use google_cloud_deploy_v1::model::ListRolloutsRequest;
14872 /// let x = ListRolloutsRequest::new().set_filter("example");
14873 /// ```
14874 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14875 self.filter = v.into();
14876 self
14877 }
14878
14879 /// Sets the value of [order_by][crate::model::ListRolloutsRequest::order_by].
14880 ///
14881 /// # Example
14882 /// ```ignore,no_run
14883 /// # use google_cloud_deploy_v1::model::ListRolloutsRequest;
14884 /// let x = ListRolloutsRequest::new().set_order_by("example");
14885 /// ```
14886 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14887 self.order_by = v.into();
14888 self
14889 }
14890}
14891
14892impl wkt::message::Message for ListRolloutsRequest {
14893 fn typename() -> &'static str {
14894 "type.googleapis.com/google.cloud.deploy.v1.ListRolloutsRequest"
14895 }
14896}
14897
14898/// ListRolloutsResponse is the response object returned by `ListRollouts`.
14899#[derive(Clone, Default, PartialEq)]
14900#[non_exhaustive]
14901pub struct ListRolloutsResponse {
14902 /// The `Rollout` objects.
14903 pub rollouts: std::vec::Vec<crate::model::Rollout>,
14904
14905 /// A token, which can be sent as `page_token` to retrieve the next page.
14906 /// If this field is omitted, there are no subsequent pages.
14907 pub next_page_token: std::string::String,
14908
14909 /// Locations that could not be reached.
14910 pub unreachable: std::vec::Vec<std::string::String>,
14911
14912 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14913}
14914
14915impl ListRolloutsResponse {
14916 /// Creates a new default instance.
14917 pub fn new() -> Self {
14918 std::default::Default::default()
14919 }
14920
14921 /// Sets the value of [rollouts][crate::model::ListRolloutsResponse::rollouts].
14922 ///
14923 /// # Example
14924 /// ```ignore,no_run
14925 /// # use google_cloud_deploy_v1::model::ListRolloutsResponse;
14926 /// use google_cloud_deploy_v1::model::Rollout;
14927 /// let x = ListRolloutsResponse::new()
14928 /// .set_rollouts([
14929 /// Rollout::default()/* use setters */,
14930 /// Rollout::default()/* use (different) setters */,
14931 /// ]);
14932 /// ```
14933 pub fn set_rollouts<T, V>(mut self, v: T) -> Self
14934 where
14935 T: std::iter::IntoIterator<Item = V>,
14936 V: std::convert::Into<crate::model::Rollout>,
14937 {
14938 use std::iter::Iterator;
14939 self.rollouts = v.into_iter().map(|i| i.into()).collect();
14940 self
14941 }
14942
14943 /// Sets the value of [next_page_token][crate::model::ListRolloutsResponse::next_page_token].
14944 ///
14945 /// # Example
14946 /// ```ignore,no_run
14947 /// # use google_cloud_deploy_v1::model::ListRolloutsResponse;
14948 /// let x = ListRolloutsResponse::new().set_next_page_token("example");
14949 /// ```
14950 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14951 self.next_page_token = v.into();
14952 self
14953 }
14954
14955 /// Sets the value of [unreachable][crate::model::ListRolloutsResponse::unreachable].
14956 ///
14957 /// # Example
14958 /// ```ignore,no_run
14959 /// # use google_cloud_deploy_v1::model::ListRolloutsResponse;
14960 /// let x = ListRolloutsResponse::new().set_unreachable(["a", "b", "c"]);
14961 /// ```
14962 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
14963 where
14964 T: std::iter::IntoIterator<Item = V>,
14965 V: std::convert::Into<std::string::String>,
14966 {
14967 use std::iter::Iterator;
14968 self.unreachable = v.into_iter().map(|i| i.into()).collect();
14969 self
14970 }
14971}
14972
14973impl wkt::message::Message for ListRolloutsResponse {
14974 fn typename() -> &'static str {
14975 "type.googleapis.com/google.cloud.deploy.v1.ListRolloutsResponse"
14976 }
14977}
14978
14979#[doc(hidden)]
14980impl google_cloud_gax::paginator::internal::PageableResponse for ListRolloutsResponse {
14981 type PageItem = crate::model::Rollout;
14982
14983 fn items(self) -> std::vec::Vec<Self::PageItem> {
14984 self.rollouts
14985 }
14986
14987 fn next_page_token(&self) -> std::string::String {
14988 use std::clone::Clone;
14989 self.next_page_token.clone()
14990 }
14991}
14992
14993/// GetRolloutRequest is the request object used by `GetRollout`.
14994#[derive(Clone, Default, PartialEq)]
14995#[non_exhaustive]
14996pub struct GetRolloutRequest {
14997 /// Required. Name of the `Rollout`. Format must be
14998 /// `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}/rollouts/{rollout_name}`.
14999 pub name: std::string::String,
15000
15001 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15002}
15003
15004impl GetRolloutRequest {
15005 /// Creates a new default instance.
15006 pub fn new() -> Self {
15007 std::default::Default::default()
15008 }
15009
15010 /// Sets the value of [name][crate::model::GetRolloutRequest::name].
15011 ///
15012 /// # Example
15013 /// ```ignore,no_run
15014 /// # use google_cloud_deploy_v1::model::GetRolloutRequest;
15015 /// # let project_id = "project_id";
15016 /// # let location_id = "location_id";
15017 /// # let delivery_pipeline_id = "delivery_pipeline_id";
15018 /// # let release_id = "release_id";
15019 /// # let rollout_id = "rollout_id";
15020 /// let x = GetRolloutRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/deliveryPipelines/{delivery_pipeline_id}/releases/{release_id}/rollouts/{rollout_id}"));
15021 /// ```
15022 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15023 self.name = v.into();
15024 self
15025 }
15026}
15027
15028impl wkt::message::Message for GetRolloutRequest {
15029 fn typename() -> &'static str {
15030 "type.googleapis.com/google.cloud.deploy.v1.GetRolloutRequest"
15031 }
15032}
15033
15034/// CreateRolloutRequest is the request object used by `CreateRollout`.
15035#[derive(Clone, Default, PartialEq)]
15036#[non_exhaustive]
15037pub struct CreateRolloutRequest {
15038 /// Required. The parent collection in which the `Rollout` must be created.
15039 /// The format is
15040 /// `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}`.
15041 pub parent: std::string::String,
15042
15043 /// Required. ID of the `Rollout`.
15044 pub rollout_id: std::string::String,
15045
15046 /// Required. The `Rollout` to create.
15047 pub rollout: std::option::Option<crate::model::Rollout>,
15048
15049 /// Optional. A request ID to identify requests. Specify a unique request ID
15050 /// so that if you must retry your request, the server knows to ignore the
15051 /// request if it has already been completed. The server guarantees that for
15052 /// at least 60 minutes after the first request.
15053 ///
15054 /// For example, consider a situation where you make an initial request and the
15055 /// request times out. If you make the request again with the same request ID,
15056 /// the server can check if original operation with the same request ID was
15057 /// received, and if so, will ignore the second request. This prevents clients
15058 /// from accidentally creating duplicate commitments.
15059 ///
15060 /// The request ID must be a valid UUID with the exception that zero UUID is
15061 /// not supported (00000000-0000-0000-0000-000000000000).
15062 pub request_id: std::string::String,
15063
15064 /// Optional. If set to true, the request is validated and the user is provided
15065 /// with an expected result, but no actual change is made.
15066 pub validate_only: bool,
15067
15068 /// Optional. Deploy policies to override. Format is
15069 /// `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`.
15070 pub override_deploy_policy: std::vec::Vec<std::string::String>,
15071
15072 /// Optional. The starting phase ID for the `Rollout`. If empty the `Rollout`
15073 /// will start at the first phase.
15074 pub starting_phase_id: std::string::String,
15075
15076 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15077}
15078
15079impl CreateRolloutRequest {
15080 /// Creates a new default instance.
15081 pub fn new() -> Self {
15082 std::default::Default::default()
15083 }
15084
15085 /// Sets the value of [parent][crate::model::CreateRolloutRequest::parent].
15086 ///
15087 /// # Example
15088 /// ```ignore,no_run
15089 /// # use google_cloud_deploy_v1::model::CreateRolloutRequest;
15090 /// # let project_id = "project_id";
15091 /// # let location_id = "location_id";
15092 /// # let delivery_pipeline_id = "delivery_pipeline_id";
15093 /// # let release_id = "release_id";
15094 /// let x = CreateRolloutRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/deliveryPipelines/{delivery_pipeline_id}/releases/{release_id}"));
15095 /// ```
15096 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15097 self.parent = v.into();
15098 self
15099 }
15100
15101 /// Sets the value of [rollout_id][crate::model::CreateRolloutRequest::rollout_id].
15102 ///
15103 /// # Example
15104 /// ```ignore,no_run
15105 /// # use google_cloud_deploy_v1::model::CreateRolloutRequest;
15106 /// let x = CreateRolloutRequest::new().set_rollout_id("example");
15107 /// ```
15108 pub fn set_rollout_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15109 self.rollout_id = v.into();
15110 self
15111 }
15112
15113 /// Sets the value of [rollout][crate::model::CreateRolloutRequest::rollout].
15114 ///
15115 /// # Example
15116 /// ```ignore,no_run
15117 /// # use google_cloud_deploy_v1::model::CreateRolloutRequest;
15118 /// use google_cloud_deploy_v1::model::Rollout;
15119 /// let x = CreateRolloutRequest::new().set_rollout(Rollout::default()/* use setters */);
15120 /// ```
15121 pub fn set_rollout<T>(mut self, v: T) -> Self
15122 where
15123 T: std::convert::Into<crate::model::Rollout>,
15124 {
15125 self.rollout = std::option::Option::Some(v.into());
15126 self
15127 }
15128
15129 /// Sets or clears the value of [rollout][crate::model::CreateRolloutRequest::rollout].
15130 ///
15131 /// # Example
15132 /// ```ignore,no_run
15133 /// # use google_cloud_deploy_v1::model::CreateRolloutRequest;
15134 /// use google_cloud_deploy_v1::model::Rollout;
15135 /// let x = CreateRolloutRequest::new().set_or_clear_rollout(Some(Rollout::default()/* use setters */));
15136 /// let x = CreateRolloutRequest::new().set_or_clear_rollout(None::<Rollout>);
15137 /// ```
15138 pub fn set_or_clear_rollout<T>(mut self, v: std::option::Option<T>) -> Self
15139 where
15140 T: std::convert::Into<crate::model::Rollout>,
15141 {
15142 self.rollout = v.map(|x| x.into());
15143 self
15144 }
15145
15146 /// Sets the value of [request_id][crate::model::CreateRolloutRequest::request_id].
15147 ///
15148 /// # Example
15149 /// ```ignore,no_run
15150 /// # use google_cloud_deploy_v1::model::CreateRolloutRequest;
15151 /// let x = CreateRolloutRequest::new().set_request_id("example");
15152 /// ```
15153 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15154 self.request_id = v.into();
15155 self
15156 }
15157
15158 /// Sets the value of [validate_only][crate::model::CreateRolloutRequest::validate_only].
15159 ///
15160 /// # Example
15161 /// ```ignore,no_run
15162 /// # use google_cloud_deploy_v1::model::CreateRolloutRequest;
15163 /// let x = CreateRolloutRequest::new().set_validate_only(true);
15164 /// ```
15165 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
15166 self.validate_only = v.into();
15167 self
15168 }
15169
15170 /// Sets the value of [override_deploy_policy][crate::model::CreateRolloutRequest::override_deploy_policy].
15171 ///
15172 /// # Example
15173 /// ```ignore,no_run
15174 /// # use google_cloud_deploy_v1::model::CreateRolloutRequest;
15175 /// let x = CreateRolloutRequest::new().set_override_deploy_policy(["a", "b", "c"]);
15176 /// ```
15177 pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
15178 where
15179 T: std::iter::IntoIterator<Item = V>,
15180 V: std::convert::Into<std::string::String>,
15181 {
15182 use std::iter::Iterator;
15183 self.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
15184 self
15185 }
15186
15187 /// Sets the value of [starting_phase_id][crate::model::CreateRolloutRequest::starting_phase_id].
15188 ///
15189 /// # Example
15190 /// ```ignore,no_run
15191 /// # use google_cloud_deploy_v1::model::CreateRolloutRequest;
15192 /// let x = CreateRolloutRequest::new().set_starting_phase_id("example");
15193 /// ```
15194 pub fn set_starting_phase_id<T: std::convert::Into<std::string::String>>(
15195 mut self,
15196 v: T,
15197 ) -> Self {
15198 self.starting_phase_id = v.into();
15199 self
15200 }
15201}
15202
15203impl wkt::message::Message for CreateRolloutRequest {
15204 fn typename() -> &'static str {
15205 "type.googleapis.com/google.cloud.deploy.v1.CreateRolloutRequest"
15206 }
15207}
15208
15209/// Represents the metadata of the long-running operation.
15210#[derive(Clone, Default, PartialEq)]
15211#[non_exhaustive]
15212pub struct OperationMetadata {
15213 /// Output only. The time the operation was created.
15214 pub create_time: std::option::Option<wkt::Timestamp>,
15215
15216 /// Output only. The time the operation finished running.
15217 pub end_time: std::option::Option<wkt::Timestamp>,
15218
15219 /// Output only. Server-defined resource path for the target of the operation.
15220 pub target: std::string::String,
15221
15222 /// Output only. Name of the verb executed by the operation.
15223 pub verb: std::string::String,
15224
15225 /// Output only. Human-readable status of the operation, if any.
15226 pub status_message: std::string::String,
15227
15228 /// Output only. Identifies whether the user has requested cancellation
15229 /// of the operation. Operations that have successfully been cancelled
15230 /// have
15231 /// [google.longrunning.Operation.error][google.longrunning.Operation.error]
15232 /// value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
15233 /// corresponding to `Code.CANCELLED`.
15234 ///
15235 /// [google.longrunning.Operation.error]: google_cloud_longrunning::model::Operation::result
15236 /// [google.rpc.Status.code]: google_cloud_rpc::model::Status::code
15237 pub requested_cancellation: bool,
15238
15239 /// Output only. API version used to start the operation.
15240 pub api_version: std::string::String,
15241
15242 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15243}
15244
15245impl OperationMetadata {
15246 /// Creates a new default instance.
15247 pub fn new() -> Self {
15248 std::default::Default::default()
15249 }
15250
15251 /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
15252 ///
15253 /// # Example
15254 /// ```ignore,no_run
15255 /// # use google_cloud_deploy_v1::model::OperationMetadata;
15256 /// use wkt::Timestamp;
15257 /// let x = OperationMetadata::new().set_create_time(Timestamp::default()/* use setters */);
15258 /// ```
15259 pub fn set_create_time<T>(mut self, v: T) -> Self
15260 where
15261 T: std::convert::Into<wkt::Timestamp>,
15262 {
15263 self.create_time = std::option::Option::Some(v.into());
15264 self
15265 }
15266
15267 /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
15268 ///
15269 /// # Example
15270 /// ```ignore,no_run
15271 /// # use google_cloud_deploy_v1::model::OperationMetadata;
15272 /// use wkt::Timestamp;
15273 /// let x = OperationMetadata::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
15274 /// let x = OperationMetadata::new().set_or_clear_create_time(None::<Timestamp>);
15275 /// ```
15276 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
15277 where
15278 T: std::convert::Into<wkt::Timestamp>,
15279 {
15280 self.create_time = v.map(|x| x.into());
15281 self
15282 }
15283
15284 /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
15285 ///
15286 /// # Example
15287 /// ```ignore,no_run
15288 /// # use google_cloud_deploy_v1::model::OperationMetadata;
15289 /// use wkt::Timestamp;
15290 /// let x = OperationMetadata::new().set_end_time(Timestamp::default()/* use setters */);
15291 /// ```
15292 pub fn set_end_time<T>(mut self, v: T) -> Self
15293 where
15294 T: std::convert::Into<wkt::Timestamp>,
15295 {
15296 self.end_time = std::option::Option::Some(v.into());
15297 self
15298 }
15299
15300 /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
15301 ///
15302 /// # Example
15303 /// ```ignore,no_run
15304 /// # use google_cloud_deploy_v1::model::OperationMetadata;
15305 /// use wkt::Timestamp;
15306 /// let x = OperationMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
15307 /// let x = OperationMetadata::new().set_or_clear_end_time(None::<Timestamp>);
15308 /// ```
15309 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
15310 where
15311 T: std::convert::Into<wkt::Timestamp>,
15312 {
15313 self.end_time = v.map(|x| x.into());
15314 self
15315 }
15316
15317 /// Sets the value of [target][crate::model::OperationMetadata::target].
15318 ///
15319 /// # Example
15320 /// ```ignore,no_run
15321 /// # use google_cloud_deploy_v1::model::OperationMetadata;
15322 /// let x = OperationMetadata::new().set_target("example");
15323 /// ```
15324 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15325 self.target = v.into();
15326 self
15327 }
15328
15329 /// Sets the value of [verb][crate::model::OperationMetadata::verb].
15330 ///
15331 /// # Example
15332 /// ```ignore,no_run
15333 /// # use google_cloud_deploy_v1::model::OperationMetadata;
15334 /// let x = OperationMetadata::new().set_verb("example");
15335 /// ```
15336 pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15337 self.verb = v.into();
15338 self
15339 }
15340
15341 /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
15342 ///
15343 /// # Example
15344 /// ```ignore,no_run
15345 /// # use google_cloud_deploy_v1::model::OperationMetadata;
15346 /// let x = OperationMetadata::new().set_status_message("example");
15347 /// ```
15348 pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15349 self.status_message = v.into();
15350 self
15351 }
15352
15353 /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
15354 ///
15355 /// # Example
15356 /// ```ignore,no_run
15357 /// # use google_cloud_deploy_v1::model::OperationMetadata;
15358 /// let x = OperationMetadata::new().set_requested_cancellation(true);
15359 /// ```
15360 pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
15361 self.requested_cancellation = v.into();
15362 self
15363 }
15364
15365 /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
15366 ///
15367 /// # Example
15368 /// ```ignore,no_run
15369 /// # use google_cloud_deploy_v1::model::OperationMetadata;
15370 /// let x = OperationMetadata::new().set_api_version("example");
15371 /// ```
15372 pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15373 self.api_version = v.into();
15374 self
15375 }
15376}
15377
15378impl wkt::message::Message for OperationMetadata {
15379 fn typename() -> &'static str {
15380 "type.googleapis.com/google.cloud.deploy.v1.OperationMetadata"
15381 }
15382}
15383
15384/// The request object used by `ApproveRollout`.
15385#[derive(Clone, Default, PartialEq)]
15386#[non_exhaustive]
15387pub struct ApproveRolloutRequest {
15388 /// Required. Name of the Rollout. Format is
15389 /// `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`.
15390 pub name: std::string::String,
15391
15392 /// Required. True = approve; false = reject
15393 pub approved: bool,
15394
15395 /// Optional. Deploy policies to override. Format is
15396 /// `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`.
15397 pub override_deploy_policy: std::vec::Vec<std::string::String>,
15398
15399 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15400}
15401
15402impl ApproveRolloutRequest {
15403 /// Creates a new default instance.
15404 pub fn new() -> Self {
15405 std::default::Default::default()
15406 }
15407
15408 /// Sets the value of [name][crate::model::ApproveRolloutRequest::name].
15409 ///
15410 /// # Example
15411 /// ```ignore,no_run
15412 /// # use google_cloud_deploy_v1::model::ApproveRolloutRequest;
15413 /// # let project_id = "project_id";
15414 /// # let location_id = "location_id";
15415 /// # let delivery_pipeline_id = "delivery_pipeline_id";
15416 /// # let release_id = "release_id";
15417 /// # let rollout_id = "rollout_id";
15418 /// let x = ApproveRolloutRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/deliveryPipelines/{delivery_pipeline_id}/releases/{release_id}/rollouts/{rollout_id}"));
15419 /// ```
15420 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15421 self.name = v.into();
15422 self
15423 }
15424
15425 /// Sets the value of [approved][crate::model::ApproveRolloutRequest::approved].
15426 ///
15427 /// # Example
15428 /// ```ignore,no_run
15429 /// # use google_cloud_deploy_v1::model::ApproveRolloutRequest;
15430 /// let x = ApproveRolloutRequest::new().set_approved(true);
15431 /// ```
15432 pub fn set_approved<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
15433 self.approved = v.into();
15434 self
15435 }
15436
15437 /// Sets the value of [override_deploy_policy][crate::model::ApproveRolloutRequest::override_deploy_policy].
15438 ///
15439 /// # Example
15440 /// ```ignore,no_run
15441 /// # use google_cloud_deploy_v1::model::ApproveRolloutRequest;
15442 /// let x = ApproveRolloutRequest::new().set_override_deploy_policy(["a", "b", "c"]);
15443 /// ```
15444 pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
15445 where
15446 T: std::iter::IntoIterator<Item = V>,
15447 V: std::convert::Into<std::string::String>,
15448 {
15449 use std::iter::Iterator;
15450 self.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
15451 self
15452 }
15453}
15454
15455impl wkt::message::Message for ApproveRolloutRequest {
15456 fn typename() -> &'static str {
15457 "type.googleapis.com/google.cloud.deploy.v1.ApproveRolloutRequest"
15458 }
15459}
15460
15461/// The response object from `ApproveRollout`.
15462#[derive(Clone, Default, PartialEq)]
15463#[non_exhaustive]
15464pub struct ApproveRolloutResponse {
15465 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15466}
15467
15468impl ApproveRolloutResponse {
15469 /// Creates a new default instance.
15470 pub fn new() -> Self {
15471 std::default::Default::default()
15472 }
15473}
15474
15475impl wkt::message::Message for ApproveRolloutResponse {
15476 fn typename() -> &'static str {
15477 "type.googleapis.com/google.cloud.deploy.v1.ApproveRolloutResponse"
15478 }
15479}
15480
15481/// The request object used by `AdvanceRollout`.
15482#[derive(Clone, Default, PartialEq)]
15483#[non_exhaustive]
15484pub struct AdvanceRolloutRequest {
15485 /// Required. Name of the Rollout. Format is
15486 /// `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`.
15487 pub name: std::string::String,
15488
15489 /// Required. The phase ID to advance the `Rollout` to.
15490 pub phase_id: std::string::String,
15491
15492 /// Optional. Deploy policies to override. Format is
15493 /// `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`.
15494 pub override_deploy_policy: std::vec::Vec<std::string::String>,
15495
15496 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15497}
15498
15499impl AdvanceRolloutRequest {
15500 /// Creates a new default instance.
15501 pub fn new() -> Self {
15502 std::default::Default::default()
15503 }
15504
15505 /// Sets the value of [name][crate::model::AdvanceRolloutRequest::name].
15506 ///
15507 /// # Example
15508 /// ```ignore,no_run
15509 /// # use google_cloud_deploy_v1::model::AdvanceRolloutRequest;
15510 /// # let project_id = "project_id";
15511 /// # let location_id = "location_id";
15512 /// # let delivery_pipeline_id = "delivery_pipeline_id";
15513 /// # let release_id = "release_id";
15514 /// # let rollout_id = "rollout_id";
15515 /// let x = AdvanceRolloutRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/deliveryPipelines/{delivery_pipeline_id}/releases/{release_id}/rollouts/{rollout_id}"));
15516 /// ```
15517 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15518 self.name = v.into();
15519 self
15520 }
15521
15522 /// Sets the value of [phase_id][crate::model::AdvanceRolloutRequest::phase_id].
15523 ///
15524 /// # Example
15525 /// ```ignore,no_run
15526 /// # use google_cloud_deploy_v1::model::AdvanceRolloutRequest;
15527 /// let x = AdvanceRolloutRequest::new().set_phase_id("example");
15528 /// ```
15529 pub fn set_phase_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15530 self.phase_id = v.into();
15531 self
15532 }
15533
15534 /// Sets the value of [override_deploy_policy][crate::model::AdvanceRolloutRequest::override_deploy_policy].
15535 ///
15536 /// # Example
15537 /// ```ignore,no_run
15538 /// # use google_cloud_deploy_v1::model::AdvanceRolloutRequest;
15539 /// let x = AdvanceRolloutRequest::new().set_override_deploy_policy(["a", "b", "c"]);
15540 /// ```
15541 pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
15542 where
15543 T: std::iter::IntoIterator<Item = V>,
15544 V: std::convert::Into<std::string::String>,
15545 {
15546 use std::iter::Iterator;
15547 self.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
15548 self
15549 }
15550}
15551
15552impl wkt::message::Message for AdvanceRolloutRequest {
15553 fn typename() -> &'static str {
15554 "type.googleapis.com/google.cloud.deploy.v1.AdvanceRolloutRequest"
15555 }
15556}
15557
15558/// The response object from `AdvanceRollout`.
15559#[derive(Clone, Default, PartialEq)]
15560#[non_exhaustive]
15561pub struct AdvanceRolloutResponse {
15562 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15563}
15564
15565impl AdvanceRolloutResponse {
15566 /// Creates a new default instance.
15567 pub fn new() -> Self {
15568 std::default::Default::default()
15569 }
15570}
15571
15572impl wkt::message::Message for AdvanceRolloutResponse {
15573 fn typename() -> &'static str {
15574 "type.googleapis.com/google.cloud.deploy.v1.AdvanceRolloutResponse"
15575 }
15576}
15577
15578/// The request object used by `CancelRollout`.
15579#[derive(Clone, Default, PartialEq)]
15580#[non_exhaustive]
15581pub struct CancelRolloutRequest {
15582 /// Required. Name of the Rollout. Format is
15583 /// `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`.
15584 pub name: std::string::String,
15585
15586 /// Optional. Deploy policies to override. Format is
15587 /// `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`.
15588 pub override_deploy_policy: std::vec::Vec<std::string::String>,
15589
15590 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15591}
15592
15593impl CancelRolloutRequest {
15594 /// Creates a new default instance.
15595 pub fn new() -> Self {
15596 std::default::Default::default()
15597 }
15598
15599 /// Sets the value of [name][crate::model::CancelRolloutRequest::name].
15600 ///
15601 /// # Example
15602 /// ```ignore,no_run
15603 /// # use google_cloud_deploy_v1::model::CancelRolloutRequest;
15604 /// # let project_id = "project_id";
15605 /// # let location_id = "location_id";
15606 /// # let delivery_pipeline_id = "delivery_pipeline_id";
15607 /// # let release_id = "release_id";
15608 /// # let rollout_id = "rollout_id";
15609 /// let x = CancelRolloutRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/deliveryPipelines/{delivery_pipeline_id}/releases/{release_id}/rollouts/{rollout_id}"));
15610 /// ```
15611 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15612 self.name = v.into();
15613 self
15614 }
15615
15616 /// Sets the value of [override_deploy_policy][crate::model::CancelRolloutRequest::override_deploy_policy].
15617 ///
15618 /// # Example
15619 /// ```ignore,no_run
15620 /// # use google_cloud_deploy_v1::model::CancelRolloutRequest;
15621 /// let x = CancelRolloutRequest::new().set_override_deploy_policy(["a", "b", "c"]);
15622 /// ```
15623 pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
15624 where
15625 T: std::iter::IntoIterator<Item = V>,
15626 V: std::convert::Into<std::string::String>,
15627 {
15628 use std::iter::Iterator;
15629 self.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
15630 self
15631 }
15632}
15633
15634impl wkt::message::Message for CancelRolloutRequest {
15635 fn typename() -> &'static str {
15636 "type.googleapis.com/google.cloud.deploy.v1.CancelRolloutRequest"
15637 }
15638}
15639
15640/// The response object from `CancelRollout`.
15641#[derive(Clone, Default, PartialEq)]
15642#[non_exhaustive]
15643pub struct CancelRolloutResponse {
15644 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15645}
15646
15647impl CancelRolloutResponse {
15648 /// Creates a new default instance.
15649 pub fn new() -> Self {
15650 std::default::Default::default()
15651 }
15652}
15653
15654impl wkt::message::Message for CancelRolloutResponse {
15655 fn typename() -> &'static str {
15656 "type.googleapis.com/google.cloud.deploy.v1.CancelRolloutResponse"
15657 }
15658}
15659
15660/// The request object used by `IgnoreJob`.
15661#[derive(Clone, Default, PartialEq)]
15662#[non_exhaustive]
15663pub struct IgnoreJobRequest {
15664 /// Required. Name of the Rollout. Format is
15665 /// `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`.
15666 pub rollout: std::string::String,
15667
15668 /// Required. The phase ID the Job to ignore belongs to.
15669 pub phase_id: std::string::String,
15670
15671 /// Required. The job ID for the Job to ignore.
15672 pub job_id: std::string::String,
15673
15674 /// Optional. Deploy policies to override. Format is
15675 /// `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`.
15676 pub override_deploy_policy: std::vec::Vec<std::string::String>,
15677
15678 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15679}
15680
15681impl IgnoreJobRequest {
15682 /// Creates a new default instance.
15683 pub fn new() -> Self {
15684 std::default::Default::default()
15685 }
15686
15687 /// Sets the value of [rollout][crate::model::IgnoreJobRequest::rollout].
15688 ///
15689 /// # Example
15690 /// ```ignore,no_run
15691 /// # use google_cloud_deploy_v1::model::IgnoreJobRequest;
15692 /// # let project_id = "project_id";
15693 /// # let location_id = "location_id";
15694 /// # let delivery_pipeline_id = "delivery_pipeline_id";
15695 /// # let release_id = "release_id";
15696 /// # let rollout_id = "rollout_id";
15697 /// let x = IgnoreJobRequest::new().set_rollout(format!("projects/{project_id}/locations/{location_id}/deliveryPipelines/{delivery_pipeline_id}/releases/{release_id}/rollouts/{rollout_id}"));
15698 /// ```
15699 pub fn set_rollout<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15700 self.rollout = v.into();
15701 self
15702 }
15703
15704 /// Sets the value of [phase_id][crate::model::IgnoreJobRequest::phase_id].
15705 ///
15706 /// # Example
15707 /// ```ignore,no_run
15708 /// # use google_cloud_deploy_v1::model::IgnoreJobRequest;
15709 /// let x = IgnoreJobRequest::new().set_phase_id("example");
15710 /// ```
15711 pub fn set_phase_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15712 self.phase_id = v.into();
15713 self
15714 }
15715
15716 /// Sets the value of [job_id][crate::model::IgnoreJobRequest::job_id].
15717 ///
15718 /// # Example
15719 /// ```ignore,no_run
15720 /// # use google_cloud_deploy_v1::model::IgnoreJobRequest;
15721 /// let x = IgnoreJobRequest::new().set_job_id("example");
15722 /// ```
15723 pub fn set_job_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15724 self.job_id = v.into();
15725 self
15726 }
15727
15728 /// Sets the value of [override_deploy_policy][crate::model::IgnoreJobRequest::override_deploy_policy].
15729 ///
15730 /// # Example
15731 /// ```ignore,no_run
15732 /// # use google_cloud_deploy_v1::model::IgnoreJobRequest;
15733 /// let x = IgnoreJobRequest::new().set_override_deploy_policy(["a", "b", "c"]);
15734 /// ```
15735 pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
15736 where
15737 T: std::iter::IntoIterator<Item = V>,
15738 V: std::convert::Into<std::string::String>,
15739 {
15740 use std::iter::Iterator;
15741 self.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
15742 self
15743 }
15744}
15745
15746impl wkt::message::Message for IgnoreJobRequest {
15747 fn typename() -> &'static str {
15748 "type.googleapis.com/google.cloud.deploy.v1.IgnoreJobRequest"
15749 }
15750}
15751
15752/// The response object from `IgnoreJob`.
15753#[derive(Clone, Default, PartialEq)]
15754#[non_exhaustive]
15755pub struct IgnoreJobResponse {
15756 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15757}
15758
15759impl IgnoreJobResponse {
15760 /// Creates a new default instance.
15761 pub fn new() -> Self {
15762 std::default::Default::default()
15763 }
15764}
15765
15766impl wkt::message::Message for IgnoreJobResponse {
15767 fn typename() -> &'static str {
15768 "type.googleapis.com/google.cloud.deploy.v1.IgnoreJobResponse"
15769 }
15770}
15771
15772/// RetryJobRequest is the request object used by `RetryJob`.
15773#[derive(Clone, Default, PartialEq)]
15774#[non_exhaustive]
15775pub struct RetryJobRequest {
15776 /// Required. Name of the Rollout. Format is
15777 /// `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`.
15778 pub rollout: std::string::String,
15779
15780 /// Required. The phase ID the Job to retry belongs to.
15781 pub phase_id: std::string::String,
15782
15783 /// Required. The job ID for the Job to retry.
15784 pub job_id: std::string::String,
15785
15786 /// Optional. Deploy policies to override. Format is
15787 /// `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`.
15788 pub override_deploy_policy: std::vec::Vec<std::string::String>,
15789
15790 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15791}
15792
15793impl RetryJobRequest {
15794 /// Creates a new default instance.
15795 pub fn new() -> Self {
15796 std::default::Default::default()
15797 }
15798
15799 /// Sets the value of [rollout][crate::model::RetryJobRequest::rollout].
15800 ///
15801 /// # Example
15802 /// ```ignore,no_run
15803 /// # use google_cloud_deploy_v1::model::RetryJobRequest;
15804 /// # let project_id = "project_id";
15805 /// # let location_id = "location_id";
15806 /// # let delivery_pipeline_id = "delivery_pipeline_id";
15807 /// # let release_id = "release_id";
15808 /// # let rollout_id = "rollout_id";
15809 /// let x = RetryJobRequest::new().set_rollout(format!("projects/{project_id}/locations/{location_id}/deliveryPipelines/{delivery_pipeline_id}/releases/{release_id}/rollouts/{rollout_id}"));
15810 /// ```
15811 pub fn set_rollout<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15812 self.rollout = v.into();
15813 self
15814 }
15815
15816 /// Sets the value of [phase_id][crate::model::RetryJobRequest::phase_id].
15817 ///
15818 /// # Example
15819 /// ```ignore,no_run
15820 /// # use google_cloud_deploy_v1::model::RetryJobRequest;
15821 /// let x = RetryJobRequest::new().set_phase_id("example");
15822 /// ```
15823 pub fn set_phase_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15824 self.phase_id = v.into();
15825 self
15826 }
15827
15828 /// Sets the value of [job_id][crate::model::RetryJobRequest::job_id].
15829 ///
15830 /// # Example
15831 /// ```ignore,no_run
15832 /// # use google_cloud_deploy_v1::model::RetryJobRequest;
15833 /// let x = RetryJobRequest::new().set_job_id("example");
15834 /// ```
15835 pub fn set_job_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15836 self.job_id = v.into();
15837 self
15838 }
15839
15840 /// Sets the value of [override_deploy_policy][crate::model::RetryJobRequest::override_deploy_policy].
15841 ///
15842 /// # Example
15843 /// ```ignore,no_run
15844 /// # use google_cloud_deploy_v1::model::RetryJobRequest;
15845 /// let x = RetryJobRequest::new().set_override_deploy_policy(["a", "b", "c"]);
15846 /// ```
15847 pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
15848 where
15849 T: std::iter::IntoIterator<Item = V>,
15850 V: std::convert::Into<std::string::String>,
15851 {
15852 use std::iter::Iterator;
15853 self.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
15854 self
15855 }
15856}
15857
15858impl wkt::message::Message for RetryJobRequest {
15859 fn typename() -> &'static str {
15860 "type.googleapis.com/google.cloud.deploy.v1.RetryJobRequest"
15861 }
15862}
15863
15864/// The response object from 'RetryJob'.
15865#[derive(Clone, Default, PartialEq)]
15866#[non_exhaustive]
15867pub struct RetryJobResponse {
15868 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15869}
15870
15871impl RetryJobResponse {
15872 /// Creates a new default instance.
15873 pub fn new() -> Self {
15874 std::default::Default::default()
15875 }
15876}
15877
15878impl wkt::message::Message for RetryJobResponse {
15879 fn typename() -> &'static str {
15880 "type.googleapis.com/google.cloud.deploy.v1.RetryJobResponse"
15881 }
15882}
15883
15884/// The request object used by `AbandonRelease`.
15885#[derive(Clone, Default, PartialEq)]
15886#[non_exhaustive]
15887pub struct AbandonReleaseRequest {
15888 /// Required. Name of the Release. Format is
15889 /// `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}`.
15890 pub name: std::string::String,
15891
15892 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15893}
15894
15895impl AbandonReleaseRequest {
15896 /// Creates a new default instance.
15897 pub fn new() -> Self {
15898 std::default::Default::default()
15899 }
15900
15901 /// Sets the value of [name][crate::model::AbandonReleaseRequest::name].
15902 ///
15903 /// # Example
15904 /// ```ignore,no_run
15905 /// # use google_cloud_deploy_v1::model::AbandonReleaseRequest;
15906 /// # let project_id = "project_id";
15907 /// # let location_id = "location_id";
15908 /// # let delivery_pipeline_id = "delivery_pipeline_id";
15909 /// # let release_id = "release_id";
15910 /// let x = AbandonReleaseRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/deliveryPipelines/{delivery_pipeline_id}/releases/{release_id}"));
15911 /// ```
15912 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15913 self.name = v.into();
15914 self
15915 }
15916}
15917
15918impl wkt::message::Message for AbandonReleaseRequest {
15919 fn typename() -> &'static str {
15920 "type.googleapis.com/google.cloud.deploy.v1.AbandonReleaseRequest"
15921 }
15922}
15923
15924/// The response object for `AbandonRelease`.
15925#[derive(Clone, Default, PartialEq)]
15926#[non_exhaustive]
15927pub struct AbandonReleaseResponse {
15928 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15929}
15930
15931impl AbandonReleaseResponse {
15932 /// Creates a new default instance.
15933 pub fn new() -> Self {
15934 std::default::Default::default()
15935 }
15936}
15937
15938impl wkt::message::Message for AbandonReleaseResponse {
15939 fn typename() -> &'static str {
15940 "type.googleapis.com/google.cloud.deploy.v1.AbandonReleaseResponse"
15941 }
15942}
15943
15944/// A `JobRun` resource in the Cloud Deploy API.
15945///
15946/// A `JobRun` contains information of a single `Rollout` job evaluation.
15947#[derive(Clone, Default, PartialEq)]
15948#[non_exhaustive]
15949pub struct JobRun {
15950 /// Output only. Name of the `JobRun`. Format is
15951 /// `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{releases}/rollouts/{rollouts}/jobRuns/{uuid}`.
15952 pub name: std::string::String,
15953
15954 /// Output only. Unique identifier of the `JobRun`.
15955 pub uid: std::string::String,
15956
15957 /// Output only. ID of the `Rollout` phase this `JobRun` belongs in.
15958 pub phase_id: std::string::String,
15959
15960 /// Output only. ID of the `Rollout` job this `JobRun` corresponds to.
15961 pub job_id: std::string::String,
15962
15963 /// Output only. Time at which the `JobRun` was created.
15964 pub create_time: std::option::Option<wkt::Timestamp>,
15965
15966 /// Output only. Time at which the `JobRun` was started.
15967 pub start_time: std::option::Option<wkt::Timestamp>,
15968
15969 /// Output only. Time at which the `JobRun` ended.
15970 pub end_time: std::option::Option<wkt::Timestamp>,
15971
15972 /// Output only. The current state of the `JobRun`.
15973 pub state: crate::model::job_run::State,
15974
15975 /// Output only. This checksum is computed by the server based on the value of
15976 /// other fields, and may be sent on update and delete requests to ensure the
15977 /// client has an up-to-date value before proceeding.
15978 pub etag: std::string::String,
15979
15980 /// The `JobRun` type and the information for that type.
15981 pub job_run: std::option::Option<crate::model::job_run::JobRun>,
15982
15983 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15984}
15985
15986impl JobRun {
15987 /// Creates a new default instance.
15988 pub fn new() -> Self {
15989 std::default::Default::default()
15990 }
15991
15992 /// Sets the value of [name][crate::model::JobRun::name].
15993 ///
15994 /// # Example
15995 /// ```ignore,no_run
15996 /// # use google_cloud_deploy_v1::model::JobRun;
15997 /// # let project_id = "project_id";
15998 /// # let location_id = "location_id";
15999 /// # let delivery_pipeline_id = "delivery_pipeline_id";
16000 /// # let release_id = "release_id";
16001 /// # let rollout_id = "rollout_id";
16002 /// # let job_run_id = "job_run_id";
16003 /// let x = JobRun::new().set_name(format!("projects/{project_id}/locations/{location_id}/deliveryPipelines/{delivery_pipeline_id}/releases/{release_id}/rollouts/{rollout_id}/jobRuns/{job_run_id}"));
16004 /// ```
16005 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16006 self.name = v.into();
16007 self
16008 }
16009
16010 /// Sets the value of [uid][crate::model::JobRun::uid].
16011 ///
16012 /// # Example
16013 /// ```ignore,no_run
16014 /// # use google_cloud_deploy_v1::model::JobRun;
16015 /// let x = JobRun::new().set_uid("example");
16016 /// ```
16017 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16018 self.uid = v.into();
16019 self
16020 }
16021
16022 /// Sets the value of [phase_id][crate::model::JobRun::phase_id].
16023 ///
16024 /// # Example
16025 /// ```ignore,no_run
16026 /// # use google_cloud_deploy_v1::model::JobRun;
16027 /// let x = JobRun::new().set_phase_id("example");
16028 /// ```
16029 pub fn set_phase_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16030 self.phase_id = v.into();
16031 self
16032 }
16033
16034 /// Sets the value of [job_id][crate::model::JobRun::job_id].
16035 ///
16036 /// # Example
16037 /// ```ignore,no_run
16038 /// # use google_cloud_deploy_v1::model::JobRun;
16039 /// let x = JobRun::new().set_job_id("example");
16040 /// ```
16041 pub fn set_job_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16042 self.job_id = v.into();
16043 self
16044 }
16045
16046 /// Sets the value of [create_time][crate::model::JobRun::create_time].
16047 ///
16048 /// # Example
16049 /// ```ignore,no_run
16050 /// # use google_cloud_deploy_v1::model::JobRun;
16051 /// use wkt::Timestamp;
16052 /// let x = JobRun::new().set_create_time(Timestamp::default()/* use setters */);
16053 /// ```
16054 pub fn set_create_time<T>(mut self, v: T) -> Self
16055 where
16056 T: std::convert::Into<wkt::Timestamp>,
16057 {
16058 self.create_time = std::option::Option::Some(v.into());
16059 self
16060 }
16061
16062 /// Sets or clears the value of [create_time][crate::model::JobRun::create_time].
16063 ///
16064 /// # Example
16065 /// ```ignore,no_run
16066 /// # use google_cloud_deploy_v1::model::JobRun;
16067 /// use wkt::Timestamp;
16068 /// let x = JobRun::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
16069 /// let x = JobRun::new().set_or_clear_create_time(None::<Timestamp>);
16070 /// ```
16071 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
16072 where
16073 T: std::convert::Into<wkt::Timestamp>,
16074 {
16075 self.create_time = v.map(|x| x.into());
16076 self
16077 }
16078
16079 /// Sets the value of [start_time][crate::model::JobRun::start_time].
16080 ///
16081 /// # Example
16082 /// ```ignore,no_run
16083 /// # use google_cloud_deploy_v1::model::JobRun;
16084 /// use wkt::Timestamp;
16085 /// let x = JobRun::new().set_start_time(Timestamp::default()/* use setters */);
16086 /// ```
16087 pub fn set_start_time<T>(mut self, v: T) -> Self
16088 where
16089 T: std::convert::Into<wkt::Timestamp>,
16090 {
16091 self.start_time = std::option::Option::Some(v.into());
16092 self
16093 }
16094
16095 /// Sets or clears the value of [start_time][crate::model::JobRun::start_time].
16096 ///
16097 /// # Example
16098 /// ```ignore,no_run
16099 /// # use google_cloud_deploy_v1::model::JobRun;
16100 /// use wkt::Timestamp;
16101 /// let x = JobRun::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
16102 /// let x = JobRun::new().set_or_clear_start_time(None::<Timestamp>);
16103 /// ```
16104 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
16105 where
16106 T: std::convert::Into<wkt::Timestamp>,
16107 {
16108 self.start_time = v.map(|x| x.into());
16109 self
16110 }
16111
16112 /// Sets the value of [end_time][crate::model::JobRun::end_time].
16113 ///
16114 /// # Example
16115 /// ```ignore,no_run
16116 /// # use google_cloud_deploy_v1::model::JobRun;
16117 /// use wkt::Timestamp;
16118 /// let x = JobRun::new().set_end_time(Timestamp::default()/* use setters */);
16119 /// ```
16120 pub fn set_end_time<T>(mut self, v: T) -> Self
16121 where
16122 T: std::convert::Into<wkt::Timestamp>,
16123 {
16124 self.end_time = std::option::Option::Some(v.into());
16125 self
16126 }
16127
16128 /// Sets or clears the value of [end_time][crate::model::JobRun::end_time].
16129 ///
16130 /// # Example
16131 /// ```ignore,no_run
16132 /// # use google_cloud_deploy_v1::model::JobRun;
16133 /// use wkt::Timestamp;
16134 /// let x = JobRun::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
16135 /// let x = JobRun::new().set_or_clear_end_time(None::<Timestamp>);
16136 /// ```
16137 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
16138 where
16139 T: std::convert::Into<wkt::Timestamp>,
16140 {
16141 self.end_time = v.map(|x| x.into());
16142 self
16143 }
16144
16145 /// Sets the value of [state][crate::model::JobRun::state].
16146 ///
16147 /// # Example
16148 /// ```ignore,no_run
16149 /// # use google_cloud_deploy_v1::model::JobRun;
16150 /// use google_cloud_deploy_v1::model::job_run::State;
16151 /// let x0 = JobRun::new().set_state(State::InProgress);
16152 /// let x1 = JobRun::new().set_state(State::Succeeded);
16153 /// let x2 = JobRun::new().set_state(State::Failed);
16154 /// ```
16155 pub fn set_state<T: std::convert::Into<crate::model::job_run::State>>(mut self, v: T) -> Self {
16156 self.state = v.into();
16157 self
16158 }
16159
16160 /// Sets the value of [etag][crate::model::JobRun::etag].
16161 ///
16162 /// # Example
16163 /// ```ignore,no_run
16164 /// # use google_cloud_deploy_v1::model::JobRun;
16165 /// let x = JobRun::new().set_etag("example");
16166 /// ```
16167 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16168 self.etag = v.into();
16169 self
16170 }
16171
16172 /// Sets the value of [job_run][crate::model::JobRun::job_run].
16173 ///
16174 /// Note that all the setters affecting `job_run` are mutually
16175 /// exclusive.
16176 ///
16177 /// # Example
16178 /// ```ignore,no_run
16179 /// # use google_cloud_deploy_v1::model::JobRun;
16180 /// use google_cloud_deploy_v1::model::DeployJobRun;
16181 /// let x = JobRun::new().set_job_run(Some(
16182 /// google_cloud_deploy_v1::model::job_run::JobRun::DeployJobRun(DeployJobRun::default().into())));
16183 /// ```
16184 pub fn set_job_run<
16185 T: std::convert::Into<std::option::Option<crate::model::job_run::JobRun>>,
16186 >(
16187 mut self,
16188 v: T,
16189 ) -> Self {
16190 self.job_run = v.into();
16191 self
16192 }
16193
16194 /// The value of [job_run][crate::model::JobRun::job_run]
16195 /// if it holds a `DeployJobRun`, `None` if the field is not set or
16196 /// holds a different branch.
16197 pub fn deploy_job_run(
16198 &self,
16199 ) -> std::option::Option<&std::boxed::Box<crate::model::DeployJobRun>> {
16200 #[allow(unreachable_patterns)]
16201 self.job_run.as_ref().and_then(|v| match v {
16202 crate::model::job_run::JobRun::DeployJobRun(v) => std::option::Option::Some(v),
16203 _ => std::option::Option::None,
16204 })
16205 }
16206
16207 /// Sets the value of [job_run][crate::model::JobRun::job_run]
16208 /// to hold a `DeployJobRun`.
16209 ///
16210 /// Note that all the setters affecting `job_run` are
16211 /// mutually exclusive.
16212 ///
16213 /// # Example
16214 /// ```ignore,no_run
16215 /// # use google_cloud_deploy_v1::model::JobRun;
16216 /// use google_cloud_deploy_v1::model::DeployJobRun;
16217 /// let x = JobRun::new().set_deploy_job_run(DeployJobRun::default()/* use setters */);
16218 /// assert!(x.deploy_job_run().is_some());
16219 /// assert!(x.verify_job_run().is_none());
16220 /// assert!(x.predeploy_job_run().is_none());
16221 /// assert!(x.postdeploy_job_run().is_none());
16222 /// assert!(x.create_child_rollout_job_run().is_none());
16223 /// assert!(x.advance_child_rollout_job_run().is_none());
16224 /// ```
16225 pub fn set_deploy_job_run<
16226 T: std::convert::Into<std::boxed::Box<crate::model::DeployJobRun>>,
16227 >(
16228 mut self,
16229 v: T,
16230 ) -> Self {
16231 self.job_run =
16232 std::option::Option::Some(crate::model::job_run::JobRun::DeployJobRun(v.into()));
16233 self
16234 }
16235
16236 /// The value of [job_run][crate::model::JobRun::job_run]
16237 /// if it holds a `VerifyJobRun`, `None` if the field is not set or
16238 /// holds a different branch.
16239 pub fn verify_job_run(
16240 &self,
16241 ) -> std::option::Option<&std::boxed::Box<crate::model::VerifyJobRun>> {
16242 #[allow(unreachable_patterns)]
16243 self.job_run.as_ref().and_then(|v| match v {
16244 crate::model::job_run::JobRun::VerifyJobRun(v) => std::option::Option::Some(v),
16245 _ => std::option::Option::None,
16246 })
16247 }
16248
16249 /// Sets the value of [job_run][crate::model::JobRun::job_run]
16250 /// to hold a `VerifyJobRun`.
16251 ///
16252 /// Note that all the setters affecting `job_run` are
16253 /// mutually exclusive.
16254 ///
16255 /// # Example
16256 /// ```ignore,no_run
16257 /// # use google_cloud_deploy_v1::model::JobRun;
16258 /// use google_cloud_deploy_v1::model::VerifyJobRun;
16259 /// let x = JobRun::new().set_verify_job_run(VerifyJobRun::default()/* use setters */);
16260 /// assert!(x.verify_job_run().is_some());
16261 /// assert!(x.deploy_job_run().is_none());
16262 /// assert!(x.predeploy_job_run().is_none());
16263 /// assert!(x.postdeploy_job_run().is_none());
16264 /// assert!(x.create_child_rollout_job_run().is_none());
16265 /// assert!(x.advance_child_rollout_job_run().is_none());
16266 /// ```
16267 pub fn set_verify_job_run<
16268 T: std::convert::Into<std::boxed::Box<crate::model::VerifyJobRun>>,
16269 >(
16270 mut self,
16271 v: T,
16272 ) -> Self {
16273 self.job_run =
16274 std::option::Option::Some(crate::model::job_run::JobRun::VerifyJobRun(v.into()));
16275 self
16276 }
16277
16278 /// The value of [job_run][crate::model::JobRun::job_run]
16279 /// if it holds a `PredeployJobRun`, `None` if the field is not set or
16280 /// holds a different branch.
16281 pub fn predeploy_job_run(
16282 &self,
16283 ) -> std::option::Option<&std::boxed::Box<crate::model::PredeployJobRun>> {
16284 #[allow(unreachable_patterns)]
16285 self.job_run.as_ref().and_then(|v| match v {
16286 crate::model::job_run::JobRun::PredeployJobRun(v) => std::option::Option::Some(v),
16287 _ => std::option::Option::None,
16288 })
16289 }
16290
16291 /// Sets the value of [job_run][crate::model::JobRun::job_run]
16292 /// to hold a `PredeployJobRun`.
16293 ///
16294 /// Note that all the setters affecting `job_run` are
16295 /// mutually exclusive.
16296 ///
16297 /// # Example
16298 /// ```ignore,no_run
16299 /// # use google_cloud_deploy_v1::model::JobRun;
16300 /// use google_cloud_deploy_v1::model::PredeployJobRun;
16301 /// let x = JobRun::new().set_predeploy_job_run(PredeployJobRun::default()/* use setters */);
16302 /// assert!(x.predeploy_job_run().is_some());
16303 /// assert!(x.deploy_job_run().is_none());
16304 /// assert!(x.verify_job_run().is_none());
16305 /// assert!(x.postdeploy_job_run().is_none());
16306 /// assert!(x.create_child_rollout_job_run().is_none());
16307 /// assert!(x.advance_child_rollout_job_run().is_none());
16308 /// ```
16309 pub fn set_predeploy_job_run<
16310 T: std::convert::Into<std::boxed::Box<crate::model::PredeployJobRun>>,
16311 >(
16312 mut self,
16313 v: T,
16314 ) -> Self {
16315 self.job_run =
16316 std::option::Option::Some(crate::model::job_run::JobRun::PredeployJobRun(v.into()));
16317 self
16318 }
16319
16320 /// The value of [job_run][crate::model::JobRun::job_run]
16321 /// if it holds a `PostdeployJobRun`, `None` if the field is not set or
16322 /// holds a different branch.
16323 pub fn postdeploy_job_run(
16324 &self,
16325 ) -> std::option::Option<&std::boxed::Box<crate::model::PostdeployJobRun>> {
16326 #[allow(unreachable_patterns)]
16327 self.job_run.as_ref().and_then(|v| match v {
16328 crate::model::job_run::JobRun::PostdeployJobRun(v) => std::option::Option::Some(v),
16329 _ => std::option::Option::None,
16330 })
16331 }
16332
16333 /// Sets the value of [job_run][crate::model::JobRun::job_run]
16334 /// to hold a `PostdeployJobRun`.
16335 ///
16336 /// Note that all the setters affecting `job_run` are
16337 /// mutually exclusive.
16338 ///
16339 /// # Example
16340 /// ```ignore,no_run
16341 /// # use google_cloud_deploy_v1::model::JobRun;
16342 /// use google_cloud_deploy_v1::model::PostdeployJobRun;
16343 /// let x = JobRun::new().set_postdeploy_job_run(PostdeployJobRun::default()/* use setters */);
16344 /// assert!(x.postdeploy_job_run().is_some());
16345 /// assert!(x.deploy_job_run().is_none());
16346 /// assert!(x.verify_job_run().is_none());
16347 /// assert!(x.predeploy_job_run().is_none());
16348 /// assert!(x.create_child_rollout_job_run().is_none());
16349 /// assert!(x.advance_child_rollout_job_run().is_none());
16350 /// ```
16351 pub fn set_postdeploy_job_run<
16352 T: std::convert::Into<std::boxed::Box<crate::model::PostdeployJobRun>>,
16353 >(
16354 mut self,
16355 v: T,
16356 ) -> Self {
16357 self.job_run =
16358 std::option::Option::Some(crate::model::job_run::JobRun::PostdeployJobRun(v.into()));
16359 self
16360 }
16361
16362 /// The value of [job_run][crate::model::JobRun::job_run]
16363 /// if it holds a `CreateChildRolloutJobRun`, `None` if the field is not set or
16364 /// holds a different branch.
16365 pub fn create_child_rollout_job_run(
16366 &self,
16367 ) -> std::option::Option<&std::boxed::Box<crate::model::CreateChildRolloutJobRun>> {
16368 #[allow(unreachable_patterns)]
16369 self.job_run.as_ref().and_then(|v| match v {
16370 crate::model::job_run::JobRun::CreateChildRolloutJobRun(v) => {
16371 std::option::Option::Some(v)
16372 }
16373 _ => std::option::Option::None,
16374 })
16375 }
16376
16377 /// Sets the value of [job_run][crate::model::JobRun::job_run]
16378 /// to hold a `CreateChildRolloutJobRun`.
16379 ///
16380 /// Note that all the setters affecting `job_run` are
16381 /// mutually exclusive.
16382 ///
16383 /// # Example
16384 /// ```ignore,no_run
16385 /// # use google_cloud_deploy_v1::model::JobRun;
16386 /// use google_cloud_deploy_v1::model::CreateChildRolloutJobRun;
16387 /// let x = JobRun::new().set_create_child_rollout_job_run(CreateChildRolloutJobRun::default()/* use setters */);
16388 /// assert!(x.create_child_rollout_job_run().is_some());
16389 /// assert!(x.deploy_job_run().is_none());
16390 /// assert!(x.verify_job_run().is_none());
16391 /// assert!(x.predeploy_job_run().is_none());
16392 /// assert!(x.postdeploy_job_run().is_none());
16393 /// assert!(x.advance_child_rollout_job_run().is_none());
16394 /// ```
16395 pub fn set_create_child_rollout_job_run<
16396 T: std::convert::Into<std::boxed::Box<crate::model::CreateChildRolloutJobRun>>,
16397 >(
16398 mut self,
16399 v: T,
16400 ) -> Self {
16401 self.job_run = std::option::Option::Some(
16402 crate::model::job_run::JobRun::CreateChildRolloutJobRun(v.into()),
16403 );
16404 self
16405 }
16406
16407 /// The value of [job_run][crate::model::JobRun::job_run]
16408 /// if it holds a `AdvanceChildRolloutJobRun`, `None` if the field is not set or
16409 /// holds a different branch.
16410 pub fn advance_child_rollout_job_run(
16411 &self,
16412 ) -> std::option::Option<&std::boxed::Box<crate::model::AdvanceChildRolloutJobRun>> {
16413 #[allow(unreachable_patterns)]
16414 self.job_run.as_ref().and_then(|v| match v {
16415 crate::model::job_run::JobRun::AdvanceChildRolloutJobRun(v) => {
16416 std::option::Option::Some(v)
16417 }
16418 _ => std::option::Option::None,
16419 })
16420 }
16421
16422 /// Sets the value of [job_run][crate::model::JobRun::job_run]
16423 /// to hold a `AdvanceChildRolloutJobRun`.
16424 ///
16425 /// Note that all the setters affecting `job_run` are
16426 /// mutually exclusive.
16427 ///
16428 /// # Example
16429 /// ```ignore,no_run
16430 /// # use google_cloud_deploy_v1::model::JobRun;
16431 /// use google_cloud_deploy_v1::model::AdvanceChildRolloutJobRun;
16432 /// let x = JobRun::new().set_advance_child_rollout_job_run(AdvanceChildRolloutJobRun::default()/* use setters */);
16433 /// assert!(x.advance_child_rollout_job_run().is_some());
16434 /// assert!(x.deploy_job_run().is_none());
16435 /// assert!(x.verify_job_run().is_none());
16436 /// assert!(x.predeploy_job_run().is_none());
16437 /// assert!(x.postdeploy_job_run().is_none());
16438 /// assert!(x.create_child_rollout_job_run().is_none());
16439 /// ```
16440 pub fn set_advance_child_rollout_job_run<
16441 T: std::convert::Into<std::boxed::Box<crate::model::AdvanceChildRolloutJobRun>>,
16442 >(
16443 mut self,
16444 v: T,
16445 ) -> Self {
16446 self.job_run = std::option::Option::Some(
16447 crate::model::job_run::JobRun::AdvanceChildRolloutJobRun(v.into()),
16448 );
16449 self
16450 }
16451}
16452
16453impl wkt::message::Message for JobRun {
16454 fn typename() -> &'static str {
16455 "type.googleapis.com/google.cloud.deploy.v1.JobRun"
16456 }
16457}
16458
16459/// Defines additional types related to [JobRun].
16460pub mod job_run {
16461 #[allow(unused_imports)]
16462 use super::*;
16463
16464 /// Valid states of a `JobRun`.
16465 ///
16466 /// # Working with unknown values
16467 ///
16468 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16469 /// additional enum variants at any time. Adding new variants is not considered
16470 /// a breaking change. Applications should write their code in anticipation of:
16471 ///
16472 /// - New values appearing in future releases of the client library, **and**
16473 /// - New values received dynamically, without application changes.
16474 ///
16475 /// Please consult the [Working with enums] section in the user guide for some
16476 /// guidelines.
16477 ///
16478 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
16479 #[derive(Clone, Debug, PartialEq)]
16480 #[non_exhaustive]
16481 pub enum State {
16482 /// The `JobRun` has an unspecified state.
16483 Unspecified,
16484 /// The `JobRun` is in progress.
16485 InProgress,
16486 /// The `JobRun` has succeeded.
16487 Succeeded,
16488 /// The `JobRun` has failed.
16489 Failed,
16490 /// The `JobRun` is terminating.
16491 Terminating,
16492 /// The `JobRun` was terminated.
16493 Terminated,
16494 /// If set, the enum was initialized with an unknown value.
16495 ///
16496 /// Applications can examine the value using [State::value] or
16497 /// [State::name].
16498 UnknownValue(state::UnknownValue),
16499 }
16500
16501 #[doc(hidden)]
16502 pub mod state {
16503 #[allow(unused_imports)]
16504 use super::*;
16505 #[derive(Clone, Debug, PartialEq)]
16506 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16507 }
16508
16509 impl State {
16510 /// Gets the enum value.
16511 ///
16512 /// Returns `None` if the enum contains an unknown value deserialized from
16513 /// the string representation of enums.
16514 pub fn value(&self) -> std::option::Option<i32> {
16515 match self {
16516 Self::Unspecified => std::option::Option::Some(0),
16517 Self::InProgress => std::option::Option::Some(1),
16518 Self::Succeeded => std::option::Option::Some(2),
16519 Self::Failed => std::option::Option::Some(3),
16520 Self::Terminating => std::option::Option::Some(4),
16521 Self::Terminated => std::option::Option::Some(5),
16522 Self::UnknownValue(u) => u.0.value(),
16523 }
16524 }
16525
16526 /// Gets the enum value as a string.
16527 ///
16528 /// Returns `None` if the enum contains an unknown value deserialized from
16529 /// the integer representation of enums.
16530 pub fn name(&self) -> std::option::Option<&str> {
16531 match self {
16532 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
16533 Self::InProgress => std::option::Option::Some("IN_PROGRESS"),
16534 Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
16535 Self::Failed => std::option::Option::Some("FAILED"),
16536 Self::Terminating => std::option::Option::Some("TERMINATING"),
16537 Self::Terminated => std::option::Option::Some("TERMINATED"),
16538 Self::UnknownValue(u) => u.0.name(),
16539 }
16540 }
16541 }
16542
16543 impl std::default::Default for State {
16544 fn default() -> Self {
16545 use std::convert::From;
16546 Self::from(0)
16547 }
16548 }
16549
16550 impl std::fmt::Display for State {
16551 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16552 wkt::internal::display_enum(f, self.name(), self.value())
16553 }
16554 }
16555
16556 impl std::convert::From<i32> for State {
16557 fn from(value: i32) -> Self {
16558 match value {
16559 0 => Self::Unspecified,
16560 1 => Self::InProgress,
16561 2 => Self::Succeeded,
16562 3 => Self::Failed,
16563 4 => Self::Terminating,
16564 5 => Self::Terminated,
16565 _ => Self::UnknownValue(state::UnknownValue(
16566 wkt::internal::UnknownEnumValue::Integer(value),
16567 )),
16568 }
16569 }
16570 }
16571
16572 impl std::convert::From<&str> for State {
16573 fn from(value: &str) -> Self {
16574 use std::string::ToString;
16575 match value {
16576 "STATE_UNSPECIFIED" => Self::Unspecified,
16577 "IN_PROGRESS" => Self::InProgress,
16578 "SUCCEEDED" => Self::Succeeded,
16579 "FAILED" => Self::Failed,
16580 "TERMINATING" => Self::Terminating,
16581 "TERMINATED" => Self::Terminated,
16582 _ => Self::UnknownValue(state::UnknownValue(
16583 wkt::internal::UnknownEnumValue::String(value.to_string()),
16584 )),
16585 }
16586 }
16587 }
16588
16589 impl serde::ser::Serialize for State {
16590 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16591 where
16592 S: serde::Serializer,
16593 {
16594 match self {
16595 Self::Unspecified => serializer.serialize_i32(0),
16596 Self::InProgress => serializer.serialize_i32(1),
16597 Self::Succeeded => serializer.serialize_i32(2),
16598 Self::Failed => serializer.serialize_i32(3),
16599 Self::Terminating => serializer.serialize_i32(4),
16600 Self::Terminated => serializer.serialize_i32(5),
16601 Self::UnknownValue(u) => u.0.serialize(serializer),
16602 }
16603 }
16604 }
16605
16606 impl<'de> serde::de::Deserialize<'de> for State {
16607 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16608 where
16609 D: serde::Deserializer<'de>,
16610 {
16611 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
16612 ".google.cloud.deploy.v1.JobRun.State",
16613 ))
16614 }
16615 }
16616
16617 /// The `JobRun` type and the information for that type.
16618 #[derive(Clone, Debug, PartialEq)]
16619 #[non_exhaustive]
16620 pub enum JobRun {
16621 /// Output only. Information specific to a deploy `JobRun`.
16622 DeployJobRun(std::boxed::Box<crate::model::DeployJobRun>),
16623 /// Output only. Information specific to a verify `JobRun`.
16624 VerifyJobRun(std::boxed::Box<crate::model::VerifyJobRun>),
16625 /// Output only. Information specific to a predeploy `JobRun`.
16626 PredeployJobRun(std::boxed::Box<crate::model::PredeployJobRun>),
16627 /// Output only. Information specific to a postdeploy `JobRun`.
16628 PostdeployJobRun(std::boxed::Box<crate::model::PostdeployJobRun>),
16629 /// Output only. Information specific to a createChildRollout `JobRun`.
16630 CreateChildRolloutJobRun(std::boxed::Box<crate::model::CreateChildRolloutJobRun>),
16631 /// Output only. Information specific to an advanceChildRollout `JobRun`
16632 AdvanceChildRolloutJobRun(std::boxed::Box<crate::model::AdvanceChildRolloutJobRun>),
16633 }
16634}
16635
16636/// DeployJobRun contains information specific to a deploy `JobRun`.
16637#[derive(Clone, Default, PartialEq)]
16638#[non_exhaustive]
16639pub struct DeployJobRun {
16640 /// Output only. The resource name of the Cloud Build `Build` object that is
16641 /// used to deploy. Format is
16642 /// `projects/{project}/locations/{location}/builds/{build}`.
16643 pub build: std::string::String,
16644
16645 /// Output only. The reason the deploy failed. This will always be unspecified
16646 /// while the deploy is in progress or if it succeeded.
16647 pub failure_cause: crate::model::deploy_job_run::FailureCause,
16648
16649 /// Output only. Additional information about the deploy failure, if available.
16650 pub failure_message: std::string::String,
16651
16652 /// Output only. Metadata containing information about the deploy job run.
16653 pub metadata: std::option::Option<crate::model::DeployJobRunMetadata>,
16654
16655 /// Output only. The artifact of a deploy job run, if available.
16656 pub artifact: std::option::Option<crate::model::DeployArtifact>,
16657
16658 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16659}
16660
16661impl DeployJobRun {
16662 /// Creates a new default instance.
16663 pub fn new() -> Self {
16664 std::default::Default::default()
16665 }
16666
16667 /// Sets the value of [build][crate::model::DeployJobRun::build].
16668 ///
16669 /// # Example
16670 /// ```ignore,no_run
16671 /// # use google_cloud_deploy_v1::model::DeployJobRun;
16672 /// let x = DeployJobRun::new().set_build("example");
16673 /// ```
16674 pub fn set_build<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16675 self.build = v.into();
16676 self
16677 }
16678
16679 /// Sets the value of [failure_cause][crate::model::DeployJobRun::failure_cause].
16680 ///
16681 /// # Example
16682 /// ```ignore,no_run
16683 /// # use google_cloud_deploy_v1::model::DeployJobRun;
16684 /// use google_cloud_deploy_v1::model::deploy_job_run::FailureCause;
16685 /// let x0 = DeployJobRun::new().set_failure_cause(FailureCause::CloudBuildUnavailable);
16686 /// let x1 = DeployJobRun::new().set_failure_cause(FailureCause::ExecutionFailed);
16687 /// let x2 = DeployJobRun::new().set_failure_cause(FailureCause::DeadlineExceeded);
16688 /// ```
16689 pub fn set_failure_cause<T: std::convert::Into<crate::model::deploy_job_run::FailureCause>>(
16690 mut self,
16691 v: T,
16692 ) -> Self {
16693 self.failure_cause = v.into();
16694 self
16695 }
16696
16697 /// Sets the value of [failure_message][crate::model::DeployJobRun::failure_message].
16698 ///
16699 /// # Example
16700 /// ```ignore,no_run
16701 /// # use google_cloud_deploy_v1::model::DeployJobRun;
16702 /// let x = DeployJobRun::new().set_failure_message("example");
16703 /// ```
16704 pub fn set_failure_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16705 self.failure_message = v.into();
16706 self
16707 }
16708
16709 /// Sets the value of [metadata][crate::model::DeployJobRun::metadata].
16710 ///
16711 /// # Example
16712 /// ```ignore,no_run
16713 /// # use google_cloud_deploy_v1::model::DeployJobRun;
16714 /// use google_cloud_deploy_v1::model::DeployJobRunMetadata;
16715 /// let x = DeployJobRun::new().set_metadata(DeployJobRunMetadata::default()/* use setters */);
16716 /// ```
16717 pub fn set_metadata<T>(mut self, v: T) -> Self
16718 where
16719 T: std::convert::Into<crate::model::DeployJobRunMetadata>,
16720 {
16721 self.metadata = std::option::Option::Some(v.into());
16722 self
16723 }
16724
16725 /// Sets or clears the value of [metadata][crate::model::DeployJobRun::metadata].
16726 ///
16727 /// # Example
16728 /// ```ignore,no_run
16729 /// # use google_cloud_deploy_v1::model::DeployJobRun;
16730 /// use google_cloud_deploy_v1::model::DeployJobRunMetadata;
16731 /// let x = DeployJobRun::new().set_or_clear_metadata(Some(DeployJobRunMetadata::default()/* use setters */));
16732 /// let x = DeployJobRun::new().set_or_clear_metadata(None::<DeployJobRunMetadata>);
16733 /// ```
16734 pub fn set_or_clear_metadata<T>(mut self, v: std::option::Option<T>) -> Self
16735 where
16736 T: std::convert::Into<crate::model::DeployJobRunMetadata>,
16737 {
16738 self.metadata = v.map(|x| x.into());
16739 self
16740 }
16741
16742 /// Sets the value of [artifact][crate::model::DeployJobRun::artifact].
16743 ///
16744 /// # Example
16745 /// ```ignore,no_run
16746 /// # use google_cloud_deploy_v1::model::DeployJobRun;
16747 /// use google_cloud_deploy_v1::model::DeployArtifact;
16748 /// let x = DeployJobRun::new().set_artifact(DeployArtifact::default()/* use setters */);
16749 /// ```
16750 pub fn set_artifact<T>(mut self, v: T) -> Self
16751 where
16752 T: std::convert::Into<crate::model::DeployArtifact>,
16753 {
16754 self.artifact = std::option::Option::Some(v.into());
16755 self
16756 }
16757
16758 /// Sets or clears the value of [artifact][crate::model::DeployJobRun::artifact].
16759 ///
16760 /// # Example
16761 /// ```ignore,no_run
16762 /// # use google_cloud_deploy_v1::model::DeployJobRun;
16763 /// use google_cloud_deploy_v1::model::DeployArtifact;
16764 /// let x = DeployJobRun::new().set_or_clear_artifact(Some(DeployArtifact::default()/* use setters */));
16765 /// let x = DeployJobRun::new().set_or_clear_artifact(None::<DeployArtifact>);
16766 /// ```
16767 pub fn set_or_clear_artifact<T>(mut self, v: std::option::Option<T>) -> Self
16768 where
16769 T: std::convert::Into<crate::model::DeployArtifact>,
16770 {
16771 self.artifact = v.map(|x| x.into());
16772 self
16773 }
16774}
16775
16776impl wkt::message::Message for DeployJobRun {
16777 fn typename() -> &'static str {
16778 "type.googleapis.com/google.cloud.deploy.v1.DeployJobRun"
16779 }
16780}
16781
16782/// Defines additional types related to [DeployJobRun].
16783pub mod deploy_job_run {
16784 #[allow(unused_imports)]
16785 use super::*;
16786
16787 /// Well-known deploy failures.
16788 ///
16789 /// # Working with unknown values
16790 ///
16791 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16792 /// additional enum variants at any time. Adding new variants is not considered
16793 /// a breaking change. Applications should write their code in anticipation of:
16794 ///
16795 /// - New values appearing in future releases of the client library, **and**
16796 /// - New values received dynamically, without application changes.
16797 ///
16798 /// Please consult the [Working with enums] section in the user guide for some
16799 /// guidelines.
16800 ///
16801 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
16802 #[derive(Clone, Debug, PartialEq)]
16803 #[non_exhaustive]
16804 pub enum FailureCause {
16805 /// No reason for failure is specified.
16806 Unspecified,
16807 /// Cloud Build is not available, either because it is not enabled or because
16808 /// Cloud Deploy has insufficient permissions. See [Required
16809 /// permission](https://cloud.google.com/deploy/docs/cloud-deploy-service-account#required_permissions).
16810 CloudBuildUnavailable,
16811 /// The deploy operation did not complete successfully; check Cloud Build
16812 /// logs.
16813 ExecutionFailed,
16814 /// The deploy job run did not complete within the allotted time.
16815 DeadlineExceeded,
16816 /// There were missing resources in the runtime environment required for a
16817 /// canary deployment. Check the Cloud Build logs for more information.
16818 MissingResourcesForCanary,
16819 /// Cloud Build failed to fulfill Cloud Deploy's request. See failure_message
16820 /// for additional details.
16821 CloudBuildRequestFailed,
16822 /// The deploy operation had a feature configured that is not supported.
16823 DeployFeatureNotSupported,
16824 /// If set, the enum was initialized with an unknown value.
16825 ///
16826 /// Applications can examine the value using [FailureCause::value] or
16827 /// [FailureCause::name].
16828 UnknownValue(failure_cause::UnknownValue),
16829 }
16830
16831 #[doc(hidden)]
16832 pub mod failure_cause {
16833 #[allow(unused_imports)]
16834 use super::*;
16835 #[derive(Clone, Debug, PartialEq)]
16836 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16837 }
16838
16839 impl FailureCause {
16840 /// Gets the enum value.
16841 ///
16842 /// Returns `None` if the enum contains an unknown value deserialized from
16843 /// the string representation of enums.
16844 pub fn value(&self) -> std::option::Option<i32> {
16845 match self {
16846 Self::Unspecified => std::option::Option::Some(0),
16847 Self::CloudBuildUnavailable => std::option::Option::Some(1),
16848 Self::ExecutionFailed => std::option::Option::Some(2),
16849 Self::DeadlineExceeded => std::option::Option::Some(3),
16850 Self::MissingResourcesForCanary => std::option::Option::Some(4),
16851 Self::CloudBuildRequestFailed => std::option::Option::Some(5),
16852 Self::DeployFeatureNotSupported => std::option::Option::Some(6),
16853 Self::UnknownValue(u) => u.0.value(),
16854 }
16855 }
16856
16857 /// Gets the enum value as a string.
16858 ///
16859 /// Returns `None` if the enum contains an unknown value deserialized from
16860 /// the integer representation of enums.
16861 pub fn name(&self) -> std::option::Option<&str> {
16862 match self {
16863 Self::Unspecified => std::option::Option::Some("FAILURE_CAUSE_UNSPECIFIED"),
16864 Self::CloudBuildUnavailable => std::option::Option::Some("CLOUD_BUILD_UNAVAILABLE"),
16865 Self::ExecutionFailed => std::option::Option::Some("EXECUTION_FAILED"),
16866 Self::DeadlineExceeded => std::option::Option::Some("DEADLINE_EXCEEDED"),
16867 Self::MissingResourcesForCanary => {
16868 std::option::Option::Some("MISSING_RESOURCES_FOR_CANARY")
16869 }
16870 Self::CloudBuildRequestFailed => {
16871 std::option::Option::Some("CLOUD_BUILD_REQUEST_FAILED")
16872 }
16873 Self::DeployFeatureNotSupported => {
16874 std::option::Option::Some("DEPLOY_FEATURE_NOT_SUPPORTED")
16875 }
16876 Self::UnknownValue(u) => u.0.name(),
16877 }
16878 }
16879 }
16880
16881 impl std::default::Default for FailureCause {
16882 fn default() -> Self {
16883 use std::convert::From;
16884 Self::from(0)
16885 }
16886 }
16887
16888 impl std::fmt::Display for FailureCause {
16889 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16890 wkt::internal::display_enum(f, self.name(), self.value())
16891 }
16892 }
16893
16894 impl std::convert::From<i32> for FailureCause {
16895 fn from(value: i32) -> Self {
16896 match value {
16897 0 => Self::Unspecified,
16898 1 => Self::CloudBuildUnavailable,
16899 2 => Self::ExecutionFailed,
16900 3 => Self::DeadlineExceeded,
16901 4 => Self::MissingResourcesForCanary,
16902 5 => Self::CloudBuildRequestFailed,
16903 6 => Self::DeployFeatureNotSupported,
16904 _ => Self::UnknownValue(failure_cause::UnknownValue(
16905 wkt::internal::UnknownEnumValue::Integer(value),
16906 )),
16907 }
16908 }
16909 }
16910
16911 impl std::convert::From<&str> for FailureCause {
16912 fn from(value: &str) -> Self {
16913 use std::string::ToString;
16914 match value {
16915 "FAILURE_CAUSE_UNSPECIFIED" => Self::Unspecified,
16916 "CLOUD_BUILD_UNAVAILABLE" => Self::CloudBuildUnavailable,
16917 "EXECUTION_FAILED" => Self::ExecutionFailed,
16918 "DEADLINE_EXCEEDED" => Self::DeadlineExceeded,
16919 "MISSING_RESOURCES_FOR_CANARY" => Self::MissingResourcesForCanary,
16920 "CLOUD_BUILD_REQUEST_FAILED" => Self::CloudBuildRequestFailed,
16921 "DEPLOY_FEATURE_NOT_SUPPORTED" => Self::DeployFeatureNotSupported,
16922 _ => Self::UnknownValue(failure_cause::UnknownValue(
16923 wkt::internal::UnknownEnumValue::String(value.to_string()),
16924 )),
16925 }
16926 }
16927 }
16928
16929 impl serde::ser::Serialize for FailureCause {
16930 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16931 where
16932 S: serde::Serializer,
16933 {
16934 match self {
16935 Self::Unspecified => serializer.serialize_i32(0),
16936 Self::CloudBuildUnavailable => serializer.serialize_i32(1),
16937 Self::ExecutionFailed => serializer.serialize_i32(2),
16938 Self::DeadlineExceeded => serializer.serialize_i32(3),
16939 Self::MissingResourcesForCanary => serializer.serialize_i32(4),
16940 Self::CloudBuildRequestFailed => serializer.serialize_i32(5),
16941 Self::DeployFeatureNotSupported => serializer.serialize_i32(6),
16942 Self::UnknownValue(u) => u.0.serialize(serializer),
16943 }
16944 }
16945 }
16946
16947 impl<'de> serde::de::Deserialize<'de> for FailureCause {
16948 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16949 where
16950 D: serde::Deserializer<'de>,
16951 {
16952 deserializer.deserialize_any(wkt::internal::EnumVisitor::<FailureCause>::new(
16953 ".google.cloud.deploy.v1.DeployJobRun.FailureCause",
16954 ))
16955 }
16956 }
16957}
16958
16959/// VerifyJobRun contains information specific to a verify `JobRun`.
16960#[derive(Clone, Default, PartialEq)]
16961#[non_exhaustive]
16962pub struct VerifyJobRun {
16963 /// Output only. The resource name of the Cloud Build `Build` object that is
16964 /// used to verify. Format is
16965 /// `projects/{project}/locations/{location}/builds/{build}`.
16966 pub build: std::string::String,
16967
16968 /// Output only. URI of a directory containing the verify artifacts. This
16969 /// contains the Skaffold event log.
16970 pub artifact_uri: std::string::String,
16971
16972 /// Output only. File path of the Skaffold event log relative to the artifact
16973 /// URI.
16974 pub event_log_path: std::string::String,
16975
16976 /// Output only. The reason the verify failed. This will always be unspecified
16977 /// while the verify is in progress or if it succeeded.
16978 pub failure_cause: crate::model::verify_job_run::FailureCause,
16979
16980 /// Output only. Additional information about the verify failure, if available.
16981 pub failure_message: std::string::String,
16982
16983 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16984}
16985
16986impl VerifyJobRun {
16987 /// Creates a new default instance.
16988 pub fn new() -> Self {
16989 std::default::Default::default()
16990 }
16991
16992 /// Sets the value of [build][crate::model::VerifyJobRun::build].
16993 ///
16994 /// # Example
16995 /// ```ignore,no_run
16996 /// # use google_cloud_deploy_v1::model::VerifyJobRun;
16997 /// let x = VerifyJobRun::new().set_build("example");
16998 /// ```
16999 pub fn set_build<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17000 self.build = v.into();
17001 self
17002 }
17003
17004 /// Sets the value of [artifact_uri][crate::model::VerifyJobRun::artifact_uri].
17005 ///
17006 /// # Example
17007 /// ```ignore,no_run
17008 /// # use google_cloud_deploy_v1::model::VerifyJobRun;
17009 /// let x = VerifyJobRun::new().set_artifact_uri("example");
17010 /// ```
17011 pub fn set_artifact_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17012 self.artifact_uri = v.into();
17013 self
17014 }
17015
17016 /// Sets the value of [event_log_path][crate::model::VerifyJobRun::event_log_path].
17017 ///
17018 /// # Example
17019 /// ```ignore,no_run
17020 /// # use google_cloud_deploy_v1::model::VerifyJobRun;
17021 /// let x = VerifyJobRun::new().set_event_log_path("example");
17022 /// ```
17023 pub fn set_event_log_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17024 self.event_log_path = v.into();
17025 self
17026 }
17027
17028 /// Sets the value of [failure_cause][crate::model::VerifyJobRun::failure_cause].
17029 ///
17030 /// # Example
17031 /// ```ignore,no_run
17032 /// # use google_cloud_deploy_v1::model::VerifyJobRun;
17033 /// use google_cloud_deploy_v1::model::verify_job_run::FailureCause;
17034 /// let x0 = VerifyJobRun::new().set_failure_cause(FailureCause::CloudBuildUnavailable);
17035 /// let x1 = VerifyJobRun::new().set_failure_cause(FailureCause::ExecutionFailed);
17036 /// let x2 = VerifyJobRun::new().set_failure_cause(FailureCause::DeadlineExceeded);
17037 /// ```
17038 pub fn set_failure_cause<T: std::convert::Into<crate::model::verify_job_run::FailureCause>>(
17039 mut self,
17040 v: T,
17041 ) -> Self {
17042 self.failure_cause = v.into();
17043 self
17044 }
17045
17046 /// Sets the value of [failure_message][crate::model::VerifyJobRun::failure_message].
17047 ///
17048 /// # Example
17049 /// ```ignore,no_run
17050 /// # use google_cloud_deploy_v1::model::VerifyJobRun;
17051 /// let x = VerifyJobRun::new().set_failure_message("example");
17052 /// ```
17053 pub fn set_failure_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17054 self.failure_message = v.into();
17055 self
17056 }
17057}
17058
17059impl wkt::message::Message for VerifyJobRun {
17060 fn typename() -> &'static str {
17061 "type.googleapis.com/google.cloud.deploy.v1.VerifyJobRun"
17062 }
17063}
17064
17065/// Defines additional types related to [VerifyJobRun].
17066pub mod verify_job_run {
17067 #[allow(unused_imports)]
17068 use super::*;
17069
17070 /// Well-known verify failures.
17071 ///
17072 /// # Working with unknown values
17073 ///
17074 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17075 /// additional enum variants at any time. Adding new variants is not considered
17076 /// a breaking change. Applications should write their code in anticipation of:
17077 ///
17078 /// - New values appearing in future releases of the client library, **and**
17079 /// - New values received dynamically, without application changes.
17080 ///
17081 /// Please consult the [Working with enums] section in the user guide for some
17082 /// guidelines.
17083 ///
17084 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
17085 #[derive(Clone, Debug, PartialEq)]
17086 #[non_exhaustive]
17087 pub enum FailureCause {
17088 /// No reason for failure is specified.
17089 Unspecified,
17090 /// Cloud Build is not available, either because it is not enabled or because
17091 /// Cloud Deploy has insufficient permissions. See [required
17092 /// permission](https://cloud.google.com/deploy/docs/cloud-deploy-service-account#required_permissions).
17093 CloudBuildUnavailable,
17094 /// The verify operation did not complete successfully; check Cloud Build
17095 /// logs.
17096 ExecutionFailed,
17097 /// The verify job run did not complete within the allotted time.
17098 DeadlineExceeded,
17099 /// No Skaffold verify configuration was found.
17100 VerificationConfigNotFound,
17101 /// Cloud Build failed to fulfill Cloud Deploy's request. See failure_message
17102 /// for additional details.
17103 CloudBuildRequestFailed,
17104 /// If set, the enum was initialized with an unknown value.
17105 ///
17106 /// Applications can examine the value using [FailureCause::value] or
17107 /// [FailureCause::name].
17108 UnknownValue(failure_cause::UnknownValue),
17109 }
17110
17111 #[doc(hidden)]
17112 pub mod failure_cause {
17113 #[allow(unused_imports)]
17114 use super::*;
17115 #[derive(Clone, Debug, PartialEq)]
17116 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17117 }
17118
17119 impl FailureCause {
17120 /// Gets the enum value.
17121 ///
17122 /// Returns `None` if the enum contains an unknown value deserialized from
17123 /// the string representation of enums.
17124 pub fn value(&self) -> std::option::Option<i32> {
17125 match self {
17126 Self::Unspecified => std::option::Option::Some(0),
17127 Self::CloudBuildUnavailable => std::option::Option::Some(1),
17128 Self::ExecutionFailed => std::option::Option::Some(2),
17129 Self::DeadlineExceeded => std::option::Option::Some(3),
17130 Self::VerificationConfigNotFound => std::option::Option::Some(4),
17131 Self::CloudBuildRequestFailed => std::option::Option::Some(5),
17132 Self::UnknownValue(u) => u.0.value(),
17133 }
17134 }
17135
17136 /// Gets the enum value as a string.
17137 ///
17138 /// Returns `None` if the enum contains an unknown value deserialized from
17139 /// the integer representation of enums.
17140 pub fn name(&self) -> std::option::Option<&str> {
17141 match self {
17142 Self::Unspecified => std::option::Option::Some("FAILURE_CAUSE_UNSPECIFIED"),
17143 Self::CloudBuildUnavailable => std::option::Option::Some("CLOUD_BUILD_UNAVAILABLE"),
17144 Self::ExecutionFailed => std::option::Option::Some("EXECUTION_FAILED"),
17145 Self::DeadlineExceeded => std::option::Option::Some("DEADLINE_EXCEEDED"),
17146 Self::VerificationConfigNotFound => {
17147 std::option::Option::Some("VERIFICATION_CONFIG_NOT_FOUND")
17148 }
17149 Self::CloudBuildRequestFailed => {
17150 std::option::Option::Some("CLOUD_BUILD_REQUEST_FAILED")
17151 }
17152 Self::UnknownValue(u) => u.0.name(),
17153 }
17154 }
17155 }
17156
17157 impl std::default::Default for FailureCause {
17158 fn default() -> Self {
17159 use std::convert::From;
17160 Self::from(0)
17161 }
17162 }
17163
17164 impl std::fmt::Display for FailureCause {
17165 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17166 wkt::internal::display_enum(f, self.name(), self.value())
17167 }
17168 }
17169
17170 impl std::convert::From<i32> for FailureCause {
17171 fn from(value: i32) -> Self {
17172 match value {
17173 0 => Self::Unspecified,
17174 1 => Self::CloudBuildUnavailable,
17175 2 => Self::ExecutionFailed,
17176 3 => Self::DeadlineExceeded,
17177 4 => Self::VerificationConfigNotFound,
17178 5 => Self::CloudBuildRequestFailed,
17179 _ => Self::UnknownValue(failure_cause::UnknownValue(
17180 wkt::internal::UnknownEnumValue::Integer(value),
17181 )),
17182 }
17183 }
17184 }
17185
17186 impl std::convert::From<&str> for FailureCause {
17187 fn from(value: &str) -> Self {
17188 use std::string::ToString;
17189 match value {
17190 "FAILURE_CAUSE_UNSPECIFIED" => Self::Unspecified,
17191 "CLOUD_BUILD_UNAVAILABLE" => Self::CloudBuildUnavailable,
17192 "EXECUTION_FAILED" => Self::ExecutionFailed,
17193 "DEADLINE_EXCEEDED" => Self::DeadlineExceeded,
17194 "VERIFICATION_CONFIG_NOT_FOUND" => Self::VerificationConfigNotFound,
17195 "CLOUD_BUILD_REQUEST_FAILED" => Self::CloudBuildRequestFailed,
17196 _ => Self::UnknownValue(failure_cause::UnknownValue(
17197 wkt::internal::UnknownEnumValue::String(value.to_string()),
17198 )),
17199 }
17200 }
17201 }
17202
17203 impl serde::ser::Serialize for FailureCause {
17204 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17205 where
17206 S: serde::Serializer,
17207 {
17208 match self {
17209 Self::Unspecified => serializer.serialize_i32(0),
17210 Self::CloudBuildUnavailable => serializer.serialize_i32(1),
17211 Self::ExecutionFailed => serializer.serialize_i32(2),
17212 Self::DeadlineExceeded => serializer.serialize_i32(3),
17213 Self::VerificationConfigNotFound => serializer.serialize_i32(4),
17214 Self::CloudBuildRequestFailed => serializer.serialize_i32(5),
17215 Self::UnknownValue(u) => u.0.serialize(serializer),
17216 }
17217 }
17218 }
17219
17220 impl<'de> serde::de::Deserialize<'de> for FailureCause {
17221 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17222 where
17223 D: serde::Deserializer<'de>,
17224 {
17225 deserializer.deserialize_any(wkt::internal::EnumVisitor::<FailureCause>::new(
17226 ".google.cloud.deploy.v1.VerifyJobRun.FailureCause",
17227 ))
17228 }
17229 }
17230}
17231
17232/// PredeployJobRun contains information specific to a predeploy `JobRun`.
17233#[derive(Clone, Default, PartialEq)]
17234#[non_exhaustive]
17235pub struct PredeployJobRun {
17236 /// Output only. The resource name of the Cloud Build `Build` object that is
17237 /// used to execute the custom actions associated with the predeploy Job.
17238 /// Format is `projects/{project}/locations/{location}/builds/{build}`.
17239 pub build: std::string::String,
17240
17241 /// Output only. The reason the predeploy failed. This will always be
17242 /// unspecified while the predeploy is in progress or if it succeeded.
17243 pub failure_cause: crate::model::predeploy_job_run::FailureCause,
17244
17245 /// Output only. Additional information about the predeploy failure, if
17246 /// available.
17247 pub failure_message: std::string::String,
17248
17249 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17250}
17251
17252impl PredeployJobRun {
17253 /// Creates a new default instance.
17254 pub fn new() -> Self {
17255 std::default::Default::default()
17256 }
17257
17258 /// Sets the value of [build][crate::model::PredeployJobRun::build].
17259 ///
17260 /// # Example
17261 /// ```ignore,no_run
17262 /// # use google_cloud_deploy_v1::model::PredeployJobRun;
17263 /// let x = PredeployJobRun::new().set_build("example");
17264 /// ```
17265 pub fn set_build<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17266 self.build = v.into();
17267 self
17268 }
17269
17270 /// Sets the value of [failure_cause][crate::model::PredeployJobRun::failure_cause].
17271 ///
17272 /// # Example
17273 /// ```ignore,no_run
17274 /// # use google_cloud_deploy_v1::model::PredeployJobRun;
17275 /// use google_cloud_deploy_v1::model::predeploy_job_run::FailureCause;
17276 /// let x0 = PredeployJobRun::new().set_failure_cause(FailureCause::CloudBuildUnavailable);
17277 /// let x1 = PredeployJobRun::new().set_failure_cause(FailureCause::ExecutionFailed);
17278 /// let x2 = PredeployJobRun::new().set_failure_cause(FailureCause::DeadlineExceeded);
17279 /// ```
17280 pub fn set_failure_cause<
17281 T: std::convert::Into<crate::model::predeploy_job_run::FailureCause>,
17282 >(
17283 mut self,
17284 v: T,
17285 ) -> Self {
17286 self.failure_cause = v.into();
17287 self
17288 }
17289
17290 /// Sets the value of [failure_message][crate::model::PredeployJobRun::failure_message].
17291 ///
17292 /// # Example
17293 /// ```ignore,no_run
17294 /// # use google_cloud_deploy_v1::model::PredeployJobRun;
17295 /// let x = PredeployJobRun::new().set_failure_message("example");
17296 /// ```
17297 pub fn set_failure_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17298 self.failure_message = v.into();
17299 self
17300 }
17301}
17302
17303impl wkt::message::Message for PredeployJobRun {
17304 fn typename() -> &'static str {
17305 "type.googleapis.com/google.cloud.deploy.v1.PredeployJobRun"
17306 }
17307}
17308
17309/// Defines additional types related to [PredeployJobRun].
17310pub mod predeploy_job_run {
17311 #[allow(unused_imports)]
17312 use super::*;
17313
17314 /// Well-known predeploy failures.
17315 ///
17316 /// # Working with unknown values
17317 ///
17318 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17319 /// additional enum variants at any time. Adding new variants is not considered
17320 /// a breaking change. Applications should write their code in anticipation of:
17321 ///
17322 /// - New values appearing in future releases of the client library, **and**
17323 /// - New values received dynamically, without application changes.
17324 ///
17325 /// Please consult the [Working with enums] section in the user guide for some
17326 /// guidelines.
17327 ///
17328 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
17329 #[derive(Clone, Debug, PartialEq)]
17330 #[non_exhaustive]
17331 pub enum FailureCause {
17332 /// No reason for failure is specified.
17333 Unspecified,
17334 /// Cloud Build is not available, either because it is not enabled or because
17335 /// Cloud Deploy has insufficient permissions. See [required
17336 /// permission](https://cloud.google.com/deploy/docs/cloud-deploy-service-account#required_permissions).
17337 CloudBuildUnavailable,
17338 /// The predeploy operation did not complete successfully; check Cloud Build
17339 /// logs.
17340 ExecutionFailed,
17341 /// The predeploy job run did not complete within the allotted time.
17342 DeadlineExceeded,
17343 /// Cloud Build failed to fulfill Cloud Deploy's request. See failure_message
17344 /// for additional details.
17345 CloudBuildRequestFailed,
17346 /// If set, the enum was initialized with an unknown value.
17347 ///
17348 /// Applications can examine the value using [FailureCause::value] or
17349 /// [FailureCause::name].
17350 UnknownValue(failure_cause::UnknownValue),
17351 }
17352
17353 #[doc(hidden)]
17354 pub mod failure_cause {
17355 #[allow(unused_imports)]
17356 use super::*;
17357 #[derive(Clone, Debug, PartialEq)]
17358 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17359 }
17360
17361 impl FailureCause {
17362 /// Gets the enum value.
17363 ///
17364 /// Returns `None` if the enum contains an unknown value deserialized from
17365 /// the string representation of enums.
17366 pub fn value(&self) -> std::option::Option<i32> {
17367 match self {
17368 Self::Unspecified => std::option::Option::Some(0),
17369 Self::CloudBuildUnavailable => std::option::Option::Some(1),
17370 Self::ExecutionFailed => std::option::Option::Some(2),
17371 Self::DeadlineExceeded => std::option::Option::Some(3),
17372 Self::CloudBuildRequestFailed => std::option::Option::Some(4),
17373 Self::UnknownValue(u) => u.0.value(),
17374 }
17375 }
17376
17377 /// Gets the enum value as a string.
17378 ///
17379 /// Returns `None` if the enum contains an unknown value deserialized from
17380 /// the integer representation of enums.
17381 pub fn name(&self) -> std::option::Option<&str> {
17382 match self {
17383 Self::Unspecified => std::option::Option::Some("FAILURE_CAUSE_UNSPECIFIED"),
17384 Self::CloudBuildUnavailable => std::option::Option::Some("CLOUD_BUILD_UNAVAILABLE"),
17385 Self::ExecutionFailed => std::option::Option::Some("EXECUTION_FAILED"),
17386 Self::DeadlineExceeded => std::option::Option::Some("DEADLINE_EXCEEDED"),
17387 Self::CloudBuildRequestFailed => {
17388 std::option::Option::Some("CLOUD_BUILD_REQUEST_FAILED")
17389 }
17390 Self::UnknownValue(u) => u.0.name(),
17391 }
17392 }
17393 }
17394
17395 impl std::default::Default for FailureCause {
17396 fn default() -> Self {
17397 use std::convert::From;
17398 Self::from(0)
17399 }
17400 }
17401
17402 impl std::fmt::Display for FailureCause {
17403 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17404 wkt::internal::display_enum(f, self.name(), self.value())
17405 }
17406 }
17407
17408 impl std::convert::From<i32> for FailureCause {
17409 fn from(value: i32) -> Self {
17410 match value {
17411 0 => Self::Unspecified,
17412 1 => Self::CloudBuildUnavailable,
17413 2 => Self::ExecutionFailed,
17414 3 => Self::DeadlineExceeded,
17415 4 => Self::CloudBuildRequestFailed,
17416 _ => Self::UnknownValue(failure_cause::UnknownValue(
17417 wkt::internal::UnknownEnumValue::Integer(value),
17418 )),
17419 }
17420 }
17421 }
17422
17423 impl std::convert::From<&str> for FailureCause {
17424 fn from(value: &str) -> Self {
17425 use std::string::ToString;
17426 match value {
17427 "FAILURE_CAUSE_UNSPECIFIED" => Self::Unspecified,
17428 "CLOUD_BUILD_UNAVAILABLE" => Self::CloudBuildUnavailable,
17429 "EXECUTION_FAILED" => Self::ExecutionFailed,
17430 "DEADLINE_EXCEEDED" => Self::DeadlineExceeded,
17431 "CLOUD_BUILD_REQUEST_FAILED" => Self::CloudBuildRequestFailed,
17432 _ => Self::UnknownValue(failure_cause::UnknownValue(
17433 wkt::internal::UnknownEnumValue::String(value.to_string()),
17434 )),
17435 }
17436 }
17437 }
17438
17439 impl serde::ser::Serialize for FailureCause {
17440 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17441 where
17442 S: serde::Serializer,
17443 {
17444 match self {
17445 Self::Unspecified => serializer.serialize_i32(0),
17446 Self::CloudBuildUnavailable => serializer.serialize_i32(1),
17447 Self::ExecutionFailed => serializer.serialize_i32(2),
17448 Self::DeadlineExceeded => serializer.serialize_i32(3),
17449 Self::CloudBuildRequestFailed => serializer.serialize_i32(4),
17450 Self::UnknownValue(u) => u.0.serialize(serializer),
17451 }
17452 }
17453 }
17454
17455 impl<'de> serde::de::Deserialize<'de> for FailureCause {
17456 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17457 where
17458 D: serde::Deserializer<'de>,
17459 {
17460 deserializer.deserialize_any(wkt::internal::EnumVisitor::<FailureCause>::new(
17461 ".google.cloud.deploy.v1.PredeployJobRun.FailureCause",
17462 ))
17463 }
17464 }
17465}
17466
17467/// PostdeployJobRun contains information specific to a postdeploy `JobRun`.
17468#[derive(Clone, Default, PartialEq)]
17469#[non_exhaustive]
17470pub struct PostdeployJobRun {
17471 /// Output only. The resource name of the Cloud Build `Build` object that is
17472 /// used to execute the custom actions associated with the postdeploy Job.
17473 /// Format is `projects/{project}/locations/{location}/builds/{build}`.
17474 pub build: std::string::String,
17475
17476 /// Output only. The reason the postdeploy failed. This will always be
17477 /// unspecified while the postdeploy is in progress or if it succeeded.
17478 pub failure_cause: crate::model::postdeploy_job_run::FailureCause,
17479
17480 /// Output only. Additional information about the postdeploy failure, if
17481 /// available.
17482 pub failure_message: std::string::String,
17483
17484 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17485}
17486
17487impl PostdeployJobRun {
17488 /// Creates a new default instance.
17489 pub fn new() -> Self {
17490 std::default::Default::default()
17491 }
17492
17493 /// Sets the value of [build][crate::model::PostdeployJobRun::build].
17494 ///
17495 /// # Example
17496 /// ```ignore,no_run
17497 /// # use google_cloud_deploy_v1::model::PostdeployJobRun;
17498 /// let x = PostdeployJobRun::new().set_build("example");
17499 /// ```
17500 pub fn set_build<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17501 self.build = v.into();
17502 self
17503 }
17504
17505 /// Sets the value of [failure_cause][crate::model::PostdeployJobRun::failure_cause].
17506 ///
17507 /// # Example
17508 /// ```ignore,no_run
17509 /// # use google_cloud_deploy_v1::model::PostdeployJobRun;
17510 /// use google_cloud_deploy_v1::model::postdeploy_job_run::FailureCause;
17511 /// let x0 = PostdeployJobRun::new().set_failure_cause(FailureCause::CloudBuildUnavailable);
17512 /// let x1 = PostdeployJobRun::new().set_failure_cause(FailureCause::ExecutionFailed);
17513 /// let x2 = PostdeployJobRun::new().set_failure_cause(FailureCause::DeadlineExceeded);
17514 /// ```
17515 pub fn set_failure_cause<
17516 T: std::convert::Into<crate::model::postdeploy_job_run::FailureCause>,
17517 >(
17518 mut self,
17519 v: T,
17520 ) -> Self {
17521 self.failure_cause = v.into();
17522 self
17523 }
17524
17525 /// Sets the value of [failure_message][crate::model::PostdeployJobRun::failure_message].
17526 ///
17527 /// # Example
17528 /// ```ignore,no_run
17529 /// # use google_cloud_deploy_v1::model::PostdeployJobRun;
17530 /// let x = PostdeployJobRun::new().set_failure_message("example");
17531 /// ```
17532 pub fn set_failure_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17533 self.failure_message = v.into();
17534 self
17535 }
17536}
17537
17538impl wkt::message::Message for PostdeployJobRun {
17539 fn typename() -> &'static str {
17540 "type.googleapis.com/google.cloud.deploy.v1.PostdeployJobRun"
17541 }
17542}
17543
17544/// Defines additional types related to [PostdeployJobRun].
17545pub mod postdeploy_job_run {
17546 #[allow(unused_imports)]
17547 use super::*;
17548
17549 /// Well-known postdeploy failures.
17550 ///
17551 /// # Working with unknown values
17552 ///
17553 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17554 /// additional enum variants at any time. Adding new variants is not considered
17555 /// a breaking change. Applications should write their code in anticipation of:
17556 ///
17557 /// - New values appearing in future releases of the client library, **and**
17558 /// - New values received dynamically, without application changes.
17559 ///
17560 /// Please consult the [Working with enums] section in the user guide for some
17561 /// guidelines.
17562 ///
17563 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
17564 #[derive(Clone, Debug, PartialEq)]
17565 #[non_exhaustive]
17566 pub enum FailureCause {
17567 /// No reason for failure is specified.
17568 Unspecified,
17569 /// Cloud Build is not available, either because it is not enabled or because
17570 /// Cloud Deploy has insufficient permissions. See [required
17571 /// permission](https://cloud.google.com/deploy/docs/cloud-deploy-service-account#required_permissions).
17572 CloudBuildUnavailable,
17573 /// The postdeploy operation did not complete successfully; check Cloud Build
17574 /// logs.
17575 ExecutionFailed,
17576 /// The postdeploy job run did not complete within the allotted time.
17577 DeadlineExceeded,
17578 /// Cloud Build failed to fulfill Cloud Deploy's request. See failure_message
17579 /// for additional details.
17580 CloudBuildRequestFailed,
17581 /// If set, the enum was initialized with an unknown value.
17582 ///
17583 /// Applications can examine the value using [FailureCause::value] or
17584 /// [FailureCause::name].
17585 UnknownValue(failure_cause::UnknownValue),
17586 }
17587
17588 #[doc(hidden)]
17589 pub mod failure_cause {
17590 #[allow(unused_imports)]
17591 use super::*;
17592 #[derive(Clone, Debug, PartialEq)]
17593 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17594 }
17595
17596 impl FailureCause {
17597 /// Gets the enum value.
17598 ///
17599 /// Returns `None` if the enum contains an unknown value deserialized from
17600 /// the string representation of enums.
17601 pub fn value(&self) -> std::option::Option<i32> {
17602 match self {
17603 Self::Unspecified => std::option::Option::Some(0),
17604 Self::CloudBuildUnavailable => std::option::Option::Some(1),
17605 Self::ExecutionFailed => std::option::Option::Some(2),
17606 Self::DeadlineExceeded => std::option::Option::Some(3),
17607 Self::CloudBuildRequestFailed => std::option::Option::Some(4),
17608 Self::UnknownValue(u) => u.0.value(),
17609 }
17610 }
17611
17612 /// Gets the enum value as a string.
17613 ///
17614 /// Returns `None` if the enum contains an unknown value deserialized from
17615 /// the integer representation of enums.
17616 pub fn name(&self) -> std::option::Option<&str> {
17617 match self {
17618 Self::Unspecified => std::option::Option::Some("FAILURE_CAUSE_UNSPECIFIED"),
17619 Self::CloudBuildUnavailable => std::option::Option::Some("CLOUD_BUILD_UNAVAILABLE"),
17620 Self::ExecutionFailed => std::option::Option::Some("EXECUTION_FAILED"),
17621 Self::DeadlineExceeded => std::option::Option::Some("DEADLINE_EXCEEDED"),
17622 Self::CloudBuildRequestFailed => {
17623 std::option::Option::Some("CLOUD_BUILD_REQUEST_FAILED")
17624 }
17625 Self::UnknownValue(u) => u.0.name(),
17626 }
17627 }
17628 }
17629
17630 impl std::default::Default for FailureCause {
17631 fn default() -> Self {
17632 use std::convert::From;
17633 Self::from(0)
17634 }
17635 }
17636
17637 impl std::fmt::Display for FailureCause {
17638 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17639 wkt::internal::display_enum(f, self.name(), self.value())
17640 }
17641 }
17642
17643 impl std::convert::From<i32> for FailureCause {
17644 fn from(value: i32) -> Self {
17645 match value {
17646 0 => Self::Unspecified,
17647 1 => Self::CloudBuildUnavailable,
17648 2 => Self::ExecutionFailed,
17649 3 => Self::DeadlineExceeded,
17650 4 => Self::CloudBuildRequestFailed,
17651 _ => Self::UnknownValue(failure_cause::UnknownValue(
17652 wkt::internal::UnknownEnumValue::Integer(value),
17653 )),
17654 }
17655 }
17656 }
17657
17658 impl std::convert::From<&str> for FailureCause {
17659 fn from(value: &str) -> Self {
17660 use std::string::ToString;
17661 match value {
17662 "FAILURE_CAUSE_UNSPECIFIED" => Self::Unspecified,
17663 "CLOUD_BUILD_UNAVAILABLE" => Self::CloudBuildUnavailable,
17664 "EXECUTION_FAILED" => Self::ExecutionFailed,
17665 "DEADLINE_EXCEEDED" => Self::DeadlineExceeded,
17666 "CLOUD_BUILD_REQUEST_FAILED" => Self::CloudBuildRequestFailed,
17667 _ => Self::UnknownValue(failure_cause::UnknownValue(
17668 wkt::internal::UnknownEnumValue::String(value.to_string()),
17669 )),
17670 }
17671 }
17672 }
17673
17674 impl serde::ser::Serialize for FailureCause {
17675 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17676 where
17677 S: serde::Serializer,
17678 {
17679 match self {
17680 Self::Unspecified => serializer.serialize_i32(0),
17681 Self::CloudBuildUnavailable => serializer.serialize_i32(1),
17682 Self::ExecutionFailed => serializer.serialize_i32(2),
17683 Self::DeadlineExceeded => serializer.serialize_i32(3),
17684 Self::CloudBuildRequestFailed => serializer.serialize_i32(4),
17685 Self::UnknownValue(u) => u.0.serialize(serializer),
17686 }
17687 }
17688 }
17689
17690 impl<'de> serde::de::Deserialize<'de> for FailureCause {
17691 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17692 where
17693 D: serde::Deserializer<'de>,
17694 {
17695 deserializer.deserialize_any(wkt::internal::EnumVisitor::<FailureCause>::new(
17696 ".google.cloud.deploy.v1.PostdeployJobRun.FailureCause",
17697 ))
17698 }
17699 }
17700}
17701
17702/// CreateChildRolloutJobRun contains information specific to a
17703/// createChildRollout `JobRun`.
17704#[derive(Clone, Default, PartialEq)]
17705#[non_exhaustive]
17706pub struct CreateChildRolloutJobRun {
17707 /// Output only. Name of the `ChildRollout`. Format is
17708 /// `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`.
17709 pub rollout: std::string::String,
17710
17711 /// Output only. The ID of the childRollout Phase initiated by this JobRun.
17712 pub rollout_phase_id: std::string::String,
17713
17714 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17715}
17716
17717impl CreateChildRolloutJobRun {
17718 /// Creates a new default instance.
17719 pub fn new() -> Self {
17720 std::default::Default::default()
17721 }
17722
17723 /// Sets the value of [rollout][crate::model::CreateChildRolloutJobRun::rollout].
17724 ///
17725 /// # Example
17726 /// ```ignore,no_run
17727 /// # use google_cloud_deploy_v1::model::CreateChildRolloutJobRun;
17728 /// let x = CreateChildRolloutJobRun::new().set_rollout("example");
17729 /// ```
17730 pub fn set_rollout<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17731 self.rollout = v.into();
17732 self
17733 }
17734
17735 /// Sets the value of [rollout_phase_id][crate::model::CreateChildRolloutJobRun::rollout_phase_id].
17736 ///
17737 /// # Example
17738 /// ```ignore,no_run
17739 /// # use google_cloud_deploy_v1::model::CreateChildRolloutJobRun;
17740 /// let x = CreateChildRolloutJobRun::new().set_rollout_phase_id("example");
17741 /// ```
17742 pub fn set_rollout_phase_id<T: std::convert::Into<std::string::String>>(
17743 mut self,
17744 v: T,
17745 ) -> Self {
17746 self.rollout_phase_id = v.into();
17747 self
17748 }
17749}
17750
17751impl wkt::message::Message for CreateChildRolloutJobRun {
17752 fn typename() -> &'static str {
17753 "type.googleapis.com/google.cloud.deploy.v1.CreateChildRolloutJobRun"
17754 }
17755}
17756
17757/// AdvanceChildRolloutJobRun contains information specific to a
17758/// advanceChildRollout `JobRun`.
17759#[derive(Clone, Default, PartialEq)]
17760#[non_exhaustive]
17761pub struct AdvanceChildRolloutJobRun {
17762 /// Output only. Name of the `ChildRollout`. Format is
17763 /// `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`.
17764 pub rollout: std::string::String,
17765
17766 /// Output only. the ID of the ChildRollout's Phase.
17767 pub rollout_phase_id: std::string::String,
17768
17769 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17770}
17771
17772impl AdvanceChildRolloutJobRun {
17773 /// Creates a new default instance.
17774 pub fn new() -> Self {
17775 std::default::Default::default()
17776 }
17777
17778 /// Sets the value of [rollout][crate::model::AdvanceChildRolloutJobRun::rollout].
17779 ///
17780 /// # Example
17781 /// ```ignore,no_run
17782 /// # use google_cloud_deploy_v1::model::AdvanceChildRolloutJobRun;
17783 /// let x = AdvanceChildRolloutJobRun::new().set_rollout("example");
17784 /// ```
17785 pub fn set_rollout<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17786 self.rollout = v.into();
17787 self
17788 }
17789
17790 /// Sets the value of [rollout_phase_id][crate::model::AdvanceChildRolloutJobRun::rollout_phase_id].
17791 ///
17792 /// # Example
17793 /// ```ignore,no_run
17794 /// # use google_cloud_deploy_v1::model::AdvanceChildRolloutJobRun;
17795 /// let x = AdvanceChildRolloutJobRun::new().set_rollout_phase_id("example");
17796 /// ```
17797 pub fn set_rollout_phase_id<T: std::convert::Into<std::string::String>>(
17798 mut self,
17799 v: T,
17800 ) -> Self {
17801 self.rollout_phase_id = v.into();
17802 self
17803 }
17804}
17805
17806impl wkt::message::Message for AdvanceChildRolloutJobRun {
17807 fn typename() -> &'static str {
17808 "type.googleapis.com/google.cloud.deploy.v1.AdvanceChildRolloutJobRun"
17809 }
17810}
17811
17812/// ListJobRunsRequest is the request object used by `ListJobRuns`.
17813#[derive(Clone, Default, PartialEq)]
17814#[non_exhaustive]
17815pub struct ListJobRunsRequest {
17816 /// Required. The `Rollout` which owns this collection of `JobRun` objects.
17817 pub parent: std::string::String,
17818
17819 /// Optional. The maximum number of `JobRun` objects to return. The service may
17820 /// return fewer than this value. If unspecified, at most 50 `JobRun` objects
17821 /// will be returned. The maximum value is 1000; values above 1000 will be set
17822 /// to 1000.
17823 pub page_size: i32,
17824
17825 /// Optional. A page token, received from a previous `ListJobRuns` call.
17826 /// Provide this to retrieve the subsequent page.
17827 ///
17828 /// When paginating, all other provided parameters match the call that provided
17829 /// the page token.
17830 pub page_token: std::string::String,
17831
17832 /// Optional. Filter results to be returned. See <https://google.aip.dev/160> for
17833 /// more details.
17834 pub filter: std::string::String,
17835
17836 /// Optional. Field to sort by. See <https://google.aip.dev/132#ordering> for
17837 /// more details.
17838 pub order_by: std::string::String,
17839
17840 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17841}
17842
17843impl ListJobRunsRequest {
17844 /// Creates a new default instance.
17845 pub fn new() -> Self {
17846 std::default::Default::default()
17847 }
17848
17849 /// Sets the value of [parent][crate::model::ListJobRunsRequest::parent].
17850 ///
17851 /// # Example
17852 /// ```ignore,no_run
17853 /// # use google_cloud_deploy_v1::model::ListJobRunsRequest;
17854 /// # let project_id = "project_id";
17855 /// # let location_id = "location_id";
17856 /// # let delivery_pipeline_id = "delivery_pipeline_id";
17857 /// # let release_id = "release_id";
17858 /// # let rollout_id = "rollout_id";
17859 /// let x = ListJobRunsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/deliveryPipelines/{delivery_pipeline_id}/releases/{release_id}/rollouts/{rollout_id}"));
17860 /// ```
17861 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17862 self.parent = v.into();
17863 self
17864 }
17865
17866 /// Sets the value of [page_size][crate::model::ListJobRunsRequest::page_size].
17867 ///
17868 /// # Example
17869 /// ```ignore,no_run
17870 /// # use google_cloud_deploy_v1::model::ListJobRunsRequest;
17871 /// let x = ListJobRunsRequest::new().set_page_size(42);
17872 /// ```
17873 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
17874 self.page_size = v.into();
17875 self
17876 }
17877
17878 /// Sets the value of [page_token][crate::model::ListJobRunsRequest::page_token].
17879 ///
17880 /// # Example
17881 /// ```ignore,no_run
17882 /// # use google_cloud_deploy_v1::model::ListJobRunsRequest;
17883 /// let x = ListJobRunsRequest::new().set_page_token("example");
17884 /// ```
17885 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17886 self.page_token = v.into();
17887 self
17888 }
17889
17890 /// Sets the value of [filter][crate::model::ListJobRunsRequest::filter].
17891 ///
17892 /// # Example
17893 /// ```ignore,no_run
17894 /// # use google_cloud_deploy_v1::model::ListJobRunsRequest;
17895 /// let x = ListJobRunsRequest::new().set_filter("example");
17896 /// ```
17897 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17898 self.filter = v.into();
17899 self
17900 }
17901
17902 /// Sets the value of [order_by][crate::model::ListJobRunsRequest::order_by].
17903 ///
17904 /// # Example
17905 /// ```ignore,no_run
17906 /// # use google_cloud_deploy_v1::model::ListJobRunsRequest;
17907 /// let x = ListJobRunsRequest::new().set_order_by("example");
17908 /// ```
17909 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17910 self.order_by = v.into();
17911 self
17912 }
17913}
17914
17915impl wkt::message::Message for ListJobRunsRequest {
17916 fn typename() -> &'static str {
17917 "type.googleapis.com/google.cloud.deploy.v1.ListJobRunsRequest"
17918 }
17919}
17920
17921/// ListJobRunsResponse is the response object returned by `ListJobRuns`.
17922#[derive(Clone, Default, PartialEq)]
17923#[non_exhaustive]
17924pub struct ListJobRunsResponse {
17925 /// The `JobRun` objects.
17926 pub job_runs: std::vec::Vec<crate::model::JobRun>,
17927
17928 /// A token, which can be sent as `page_token` to retrieve the next page. If
17929 /// this field is omitted, there are no subsequent pages.
17930 pub next_page_token: std::string::String,
17931
17932 /// Locations that could not be reached
17933 pub unreachable: std::vec::Vec<std::string::String>,
17934
17935 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17936}
17937
17938impl ListJobRunsResponse {
17939 /// Creates a new default instance.
17940 pub fn new() -> Self {
17941 std::default::Default::default()
17942 }
17943
17944 /// Sets the value of [job_runs][crate::model::ListJobRunsResponse::job_runs].
17945 ///
17946 /// # Example
17947 /// ```ignore,no_run
17948 /// # use google_cloud_deploy_v1::model::ListJobRunsResponse;
17949 /// use google_cloud_deploy_v1::model::JobRun;
17950 /// let x = ListJobRunsResponse::new()
17951 /// .set_job_runs([
17952 /// JobRun::default()/* use setters */,
17953 /// JobRun::default()/* use (different) setters */,
17954 /// ]);
17955 /// ```
17956 pub fn set_job_runs<T, V>(mut self, v: T) -> Self
17957 where
17958 T: std::iter::IntoIterator<Item = V>,
17959 V: std::convert::Into<crate::model::JobRun>,
17960 {
17961 use std::iter::Iterator;
17962 self.job_runs = v.into_iter().map(|i| i.into()).collect();
17963 self
17964 }
17965
17966 /// Sets the value of [next_page_token][crate::model::ListJobRunsResponse::next_page_token].
17967 ///
17968 /// # Example
17969 /// ```ignore,no_run
17970 /// # use google_cloud_deploy_v1::model::ListJobRunsResponse;
17971 /// let x = ListJobRunsResponse::new().set_next_page_token("example");
17972 /// ```
17973 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17974 self.next_page_token = v.into();
17975 self
17976 }
17977
17978 /// Sets the value of [unreachable][crate::model::ListJobRunsResponse::unreachable].
17979 ///
17980 /// # Example
17981 /// ```ignore,no_run
17982 /// # use google_cloud_deploy_v1::model::ListJobRunsResponse;
17983 /// let x = ListJobRunsResponse::new().set_unreachable(["a", "b", "c"]);
17984 /// ```
17985 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
17986 where
17987 T: std::iter::IntoIterator<Item = V>,
17988 V: std::convert::Into<std::string::String>,
17989 {
17990 use std::iter::Iterator;
17991 self.unreachable = v.into_iter().map(|i| i.into()).collect();
17992 self
17993 }
17994}
17995
17996impl wkt::message::Message for ListJobRunsResponse {
17997 fn typename() -> &'static str {
17998 "type.googleapis.com/google.cloud.deploy.v1.ListJobRunsResponse"
17999 }
18000}
18001
18002#[doc(hidden)]
18003impl google_cloud_gax::paginator::internal::PageableResponse for ListJobRunsResponse {
18004 type PageItem = crate::model::JobRun;
18005
18006 fn items(self) -> std::vec::Vec<Self::PageItem> {
18007 self.job_runs
18008 }
18009
18010 fn next_page_token(&self) -> std::string::String {
18011 use std::clone::Clone;
18012 self.next_page_token.clone()
18013 }
18014}
18015
18016/// GetJobRunRequest is the request object used by `GetJobRun`.
18017#[derive(Clone, Default, PartialEq)]
18018#[non_exhaustive]
18019pub struct GetJobRunRequest {
18020 /// Required. Name of the `JobRun`. Format must be
18021 /// `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}/rollouts/{rollout_name}/jobRuns/{job_run_name}`.
18022 pub name: std::string::String,
18023
18024 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18025}
18026
18027impl GetJobRunRequest {
18028 /// Creates a new default instance.
18029 pub fn new() -> Self {
18030 std::default::Default::default()
18031 }
18032
18033 /// Sets the value of [name][crate::model::GetJobRunRequest::name].
18034 ///
18035 /// # Example
18036 /// ```ignore,no_run
18037 /// # use google_cloud_deploy_v1::model::GetJobRunRequest;
18038 /// # let project_id = "project_id";
18039 /// # let location_id = "location_id";
18040 /// # let delivery_pipeline_id = "delivery_pipeline_id";
18041 /// # let release_id = "release_id";
18042 /// # let rollout_id = "rollout_id";
18043 /// # let job_run_id = "job_run_id";
18044 /// let x = GetJobRunRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/deliveryPipelines/{delivery_pipeline_id}/releases/{release_id}/rollouts/{rollout_id}/jobRuns/{job_run_id}"));
18045 /// ```
18046 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18047 self.name = v.into();
18048 self
18049 }
18050}
18051
18052impl wkt::message::Message for GetJobRunRequest {
18053 fn typename() -> &'static str {
18054 "type.googleapis.com/google.cloud.deploy.v1.GetJobRunRequest"
18055 }
18056}
18057
18058/// The request object used by `TerminateJobRun`.
18059#[derive(Clone, Default, PartialEq)]
18060#[non_exhaustive]
18061pub struct TerminateJobRunRequest {
18062 /// Required. Name of the `JobRun`. Format must be
18063 /// `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}/jobRuns/{jobRun}`.
18064 pub name: std::string::String,
18065
18066 /// Optional. Deploy policies to override. Format is
18067 /// `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`.
18068 pub override_deploy_policy: std::vec::Vec<std::string::String>,
18069
18070 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18071}
18072
18073impl TerminateJobRunRequest {
18074 /// Creates a new default instance.
18075 pub fn new() -> Self {
18076 std::default::Default::default()
18077 }
18078
18079 /// Sets the value of [name][crate::model::TerminateJobRunRequest::name].
18080 ///
18081 /// # Example
18082 /// ```ignore,no_run
18083 /// # use google_cloud_deploy_v1::model::TerminateJobRunRequest;
18084 /// # let project_id = "project_id";
18085 /// # let location_id = "location_id";
18086 /// # let delivery_pipeline_id = "delivery_pipeline_id";
18087 /// # let release_id = "release_id";
18088 /// # let rollout_id = "rollout_id";
18089 /// # let job_run_id = "job_run_id";
18090 /// let x = TerminateJobRunRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/deliveryPipelines/{delivery_pipeline_id}/releases/{release_id}/rollouts/{rollout_id}/jobRuns/{job_run_id}"));
18091 /// ```
18092 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18093 self.name = v.into();
18094 self
18095 }
18096
18097 /// Sets the value of [override_deploy_policy][crate::model::TerminateJobRunRequest::override_deploy_policy].
18098 ///
18099 /// # Example
18100 /// ```ignore,no_run
18101 /// # use google_cloud_deploy_v1::model::TerminateJobRunRequest;
18102 /// let x = TerminateJobRunRequest::new().set_override_deploy_policy(["a", "b", "c"]);
18103 /// ```
18104 pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
18105 where
18106 T: std::iter::IntoIterator<Item = V>,
18107 V: std::convert::Into<std::string::String>,
18108 {
18109 use std::iter::Iterator;
18110 self.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
18111 self
18112 }
18113}
18114
18115impl wkt::message::Message for TerminateJobRunRequest {
18116 fn typename() -> &'static str {
18117 "type.googleapis.com/google.cloud.deploy.v1.TerminateJobRunRequest"
18118 }
18119}
18120
18121/// The response object from `TerminateJobRun`.
18122#[derive(Clone, Default, PartialEq)]
18123#[non_exhaustive]
18124pub struct TerminateJobRunResponse {
18125 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18126}
18127
18128impl TerminateJobRunResponse {
18129 /// Creates a new default instance.
18130 pub fn new() -> Self {
18131 std::default::Default::default()
18132 }
18133}
18134
18135impl wkt::message::Message for TerminateJobRunResponse {
18136 fn typename() -> &'static str {
18137 "type.googleapis.com/google.cloud.deploy.v1.TerminateJobRunResponse"
18138 }
18139}
18140
18141/// Service-wide configuration.
18142#[derive(Clone, Default, PartialEq)]
18143#[non_exhaustive]
18144pub struct Config {
18145 /// Name of the configuration.
18146 pub name: std::string::String,
18147
18148 /// All supported versions of Skaffold.
18149 pub supported_versions: std::vec::Vec<crate::model::SkaffoldVersion>,
18150
18151 /// Default Skaffold version that is assigned when a Release is created without
18152 /// specifying a Skaffold version.
18153 pub default_skaffold_version: std::string::String,
18154
18155 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18156}
18157
18158impl Config {
18159 /// Creates a new default instance.
18160 pub fn new() -> Self {
18161 std::default::Default::default()
18162 }
18163
18164 /// Sets the value of [name][crate::model::Config::name].
18165 ///
18166 /// # Example
18167 /// ```ignore,no_run
18168 /// # use google_cloud_deploy_v1::model::Config;
18169 /// # let project_id = "project_id";
18170 /// # let location_id = "location_id";
18171 /// let x = Config::new().set_name(format!("projects/{project_id}/locations/{location_id}/config"));
18172 /// ```
18173 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18174 self.name = v.into();
18175 self
18176 }
18177
18178 /// Sets the value of [supported_versions][crate::model::Config::supported_versions].
18179 ///
18180 /// # Example
18181 /// ```ignore,no_run
18182 /// # use google_cloud_deploy_v1::model::Config;
18183 /// use google_cloud_deploy_v1::model::SkaffoldVersion;
18184 /// let x = Config::new()
18185 /// .set_supported_versions([
18186 /// SkaffoldVersion::default()/* use setters */,
18187 /// SkaffoldVersion::default()/* use (different) setters */,
18188 /// ]);
18189 /// ```
18190 pub fn set_supported_versions<T, V>(mut self, v: T) -> Self
18191 where
18192 T: std::iter::IntoIterator<Item = V>,
18193 V: std::convert::Into<crate::model::SkaffoldVersion>,
18194 {
18195 use std::iter::Iterator;
18196 self.supported_versions = v.into_iter().map(|i| i.into()).collect();
18197 self
18198 }
18199
18200 /// Sets the value of [default_skaffold_version][crate::model::Config::default_skaffold_version].
18201 ///
18202 /// # Example
18203 /// ```ignore,no_run
18204 /// # use google_cloud_deploy_v1::model::Config;
18205 /// let x = Config::new().set_default_skaffold_version("example");
18206 /// ```
18207 pub fn set_default_skaffold_version<T: std::convert::Into<std::string::String>>(
18208 mut self,
18209 v: T,
18210 ) -> Self {
18211 self.default_skaffold_version = v.into();
18212 self
18213 }
18214}
18215
18216impl wkt::message::Message for Config {
18217 fn typename() -> &'static str {
18218 "type.googleapis.com/google.cloud.deploy.v1.Config"
18219 }
18220}
18221
18222/// Details of a supported Skaffold version.
18223#[derive(Clone, Default, PartialEq)]
18224#[non_exhaustive]
18225pub struct SkaffoldVersion {
18226 /// Release version number. For example, "1.20.3".
18227 pub version: std::string::String,
18228
18229 /// The time at which this version of Skaffold will enter maintenance mode.
18230 pub maintenance_mode_time: std::option::Option<wkt::Timestamp>,
18231
18232 /// The time at which this version of Skaffold will no longer be supported.
18233 pub support_expiration_time: std::option::Option<wkt::Timestamp>,
18234
18235 /// Date when this version is expected to no longer be supported.
18236 pub support_end_date: std::option::Option<google_cloud_type::model::Date>,
18237
18238 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18239}
18240
18241impl SkaffoldVersion {
18242 /// Creates a new default instance.
18243 pub fn new() -> Self {
18244 std::default::Default::default()
18245 }
18246
18247 /// Sets the value of [version][crate::model::SkaffoldVersion::version].
18248 ///
18249 /// # Example
18250 /// ```ignore,no_run
18251 /// # use google_cloud_deploy_v1::model::SkaffoldVersion;
18252 /// let x = SkaffoldVersion::new().set_version("example");
18253 /// ```
18254 pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18255 self.version = v.into();
18256 self
18257 }
18258
18259 /// Sets the value of [maintenance_mode_time][crate::model::SkaffoldVersion::maintenance_mode_time].
18260 ///
18261 /// # Example
18262 /// ```ignore,no_run
18263 /// # use google_cloud_deploy_v1::model::SkaffoldVersion;
18264 /// use wkt::Timestamp;
18265 /// let x = SkaffoldVersion::new().set_maintenance_mode_time(Timestamp::default()/* use setters */);
18266 /// ```
18267 pub fn set_maintenance_mode_time<T>(mut self, v: T) -> Self
18268 where
18269 T: std::convert::Into<wkt::Timestamp>,
18270 {
18271 self.maintenance_mode_time = std::option::Option::Some(v.into());
18272 self
18273 }
18274
18275 /// Sets or clears the value of [maintenance_mode_time][crate::model::SkaffoldVersion::maintenance_mode_time].
18276 ///
18277 /// # Example
18278 /// ```ignore,no_run
18279 /// # use google_cloud_deploy_v1::model::SkaffoldVersion;
18280 /// use wkt::Timestamp;
18281 /// let x = SkaffoldVersion::new().set_or_clear_maintenance_mode_time(Some(Timestamp::default()/* use setters */));
18282 /// let x = SkaffoldVersion::new().set_or_clear_maintenance_mode_time(None::<Timestamp>);
18283 /// ```
18284 pub fn set_or_clear_maintenance_mode_time<T>(mut self, v: std::option::Option<T>) -> Self
18285 where
18286 T: std::convert::Into<wkt::Timestamp>,
18287 {
18288 self.maintenance_mode_time = v.map(|x| x.into());
18289 self
18290 }
18291
18292 /// Sets the value of [support_expiration_time][crate::model::SkaffoldVersion::support_expiration_time].
18293 ///
18294 /// # Example
18295 /// ```ignore,no_run
18296 /// # use google_cloud_deploy_v1::model::SkaffoldVersion;
18297 /// use wkt::Timestamp;
18298 /// let x = SkaffoldVersion::new().set_support_expiration_time(Timestamp::default()/* use setters */);
18299 /// ```
18300 pub fn set_support_expiration_time<T>(mut self, v: T) -> Self
18301 where
18302 T: std::convert::Into<wkt::Timestamp>,
18303 {
18304 self.support_expiration_time = std::option::Option::Some(v.into());
18305 self
18306 }
18307
18308 /// Sets or clears the value of [support_expiration_time][crate::model::SkaffoldVersion::support_expiration_time].
18309 ///
18310 /// # Example
18311 /// ```ignore,no_run
18312 /// # use google_cloud_deploy_v1::model::SkaffoldVersion;
18313 /// use wkt::Timestamp;
18314 /// let x = SkaffoldVersion::new().set_or_clear_support_expiration_time(Some(Timestamp::default()/* use setters */));
18315 /// let x = SkaffoldVersion::new().set_or_clear_support_expiration_time(None::<Timestamp>);
18316 /// ```
18317 pub fn set_or_clear_support_expiration_time<T>(mut self, v: std::option::Option<T>) -> Self
18318 where
18319 T: std::convert::Into<wkt::Timestamp>,
18320 {
18321 self.support_expiration_time = v.map(|x| x.into());
18322 self
18323 }
18324
18325 /// Sets the value of [support_end_date][crate::model::SkaffoldVersion::support_end_date].
18326 ///
18327 /// # Example
18328 /// ```ignore,no_run
18329 /// # use google_cloud_deploy_v1::model::SkaffoldVersion;
18330 /// use google_cloud_type::model::Date;
18331 /// let x = SkaffoldVersion::new().set_support_end_date(Date::default()/* use setters */);
18332 /// ```
18333 pub fn set_support_end_date<T>(mut self, v: T) -> Self
18334 where
18335 T: std::convert::Into<google_cloud_type::model::Date>,
18336 {
18337 self.support_end_date = std::option::Option::Some(v.into());
18338 self
18339 }
18340
18341 /// Sets or clears the value of [support_end_date][crate::model::SkaffoldVersion::support_end_date].
18342 ///
18343 /// # Example
18344 /// ```ignore,no_run
18345 /// # use google_cloud_deploy_v1::model::SkaffoldVersion;
18346 /// use google_cloud_type::model::Date;
18347 /// let x = SkaffoldVersion::new().set_or_clear_support_end_date(Some(Date::default()/* use setters */));
18348 /// let x = SkaffoldVersion::new().set_or_clear_support_end_date(None::<Date>);
18349 /// ```
18350 pub fn set_or_clear_support_end_date<T>(mut self, v: std::option::Option<T>) -> Self
18351 where
18352 T: std::convert::Into<google_cloud_type::model::Date>,
18353 {
18354 self.support_end_date = v.map(|x| x.into());
18355 self
18356 }
18357}
18358
18359impl wkt::message::Message for SkaffoldVersion {
18360 fn typename() -> &'static str {
18361 "type.googleapis.com/google.cloud.deploy.v1.SkaffoldVersion"
18362 }
18363}
18364
18365/// Request to get a configuration.
18366#[derive(Clone, Default, PartialEq)]
18367#[non_exhaustive]
18368pub struct GetConfigRequest {
18369 /// Required. Name of requested configuration.
18370 pub name: std::string::String,
18371
18372 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18373}
18374
18375impl GetConfigRequest {
18376 /// Creates a new default instance.
18377 pub fn new() -> Self {
18378 std::default::Default::default()
18379 }
18380
18381 /// Sets the value of [name][crate::model::GetConfigRequest::name].
18382 ///
18383 /// # Example
18384 /// ```ignore,no_run
18385 /// # use google_cloud_deploy_v1::model::GetConfigRequest;
18386 /// # let project_id = "project_id";
18387 /// # let location_id = "location_id";
18388 /// let x = GetConfigRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/config"));
18389 /// ```
18390 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18391 self.name = v.into();
18392 self
18393 }
18394}
18395
18396impl wkt::message::Message for GetConfigRequest {
18397 fn typename() -> &'static str {
18398 "type.googleapis.com/google.cloud.deploy.v1.GetConfigRequest"
18399 }
18400}
18401
18402/// An `Automation` resource in the Cloud Deploy API.
18403///
18404/// An `Automation` enables the automation of manually driven actions for
18405/// a Delivery Pipeline, which includes Release promotion among Targets,
18406/// Rollout repair and Rollout deployment strategy advancement. The intention
18407/// of Automation is to reduce manual intervention in the continuous delivery
18408/// process.
18409#[derive(Clone, Default, PartialEq)]
18410#[non_exhaustive]
18411pub struct Automation {
18412 /// Output only. Name of the `Automation`. Format is
18413 /// `projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/automations/{automation}`.
18414 pub name: std::string::String,
18415
18416 /// Output only. Unique identifier of the `Automation`.
18417 pub uid: std::string::String,
18418
18419 /// Optional. Description of the `Automation`. Max length is 255 characters.
18420 pub description: std::string::String,
18421
18422 /// Output only. Time at which the automation was created.
18423 pub create_time: std::option::Option<wkt::Timestamp>,
18424
18425 /// Output only. Time at which the automation was updated.
18426 pub update_time: std::option::Option<wkt::Timestamp>,
18427
18428 /// Optional. User annotations. These attributes can only be set and used by
18429 /// the user, and not by Cloud Deploy. Annotations must meet the following
18430 /// constraints:
18431 ///
18432 /// * Annotations are key/value pairs.
18433 /// * Valid annotation keys have two segments: an optional prefix and name,
18434 /// separated by a slash (`/`).
18435 /// * The name segment is required and must be 63 characters or less,
18436 /// beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with
18437 /// dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between.
18438 /// * The prefix is optional. If specified, the prefix must be a DNS subdomain:
18439 /// a series of DNS labels separated by dots(`.`), not longer than 253
18440 /// characters in total, followed by a slash (`/`).
18441 ///
18442 /// See
18443 /// <https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/#syntax-and-character-set>
18444 /// for more details.
18445 pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
18446
18447 /// Optional. Labels are attributes that can be set and used by both the
18448 /// user and by Cloud Deploy. Labels must meet the following constraints:
18449 ///
18450 /// * Keys and values can contain only lowercase letters, numeric characters,
18451 /// underscores, and dashes.
18452 /// * All characters must use UTF-8 encoding, and international characters are
18453 /// allowed.
18454 /// * Keys must start with a lowercase letter or international character.
18455 /// * Each resource is limited to a maximum of 64 labels.
18456 ///
18457 /// Both keys and values are additionally constrained to be <= 63 characters.
18458 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
18459
18460 /// Optional. The weak etag of the `Automation` resource.
18461 /// This checksum is computed by the server based on the value of other
18462 /// fields, and may be sent on update and delete requests to ensure the
18463 /// client has an up-to-date value before proceeding.
18464 pub etag: std::string::String,
18465
18466 /// Optional. When Suspended, automation is deactivated from execution.
18467 pub suspended: bool,
18468
18469 /// Required. Email address of the user-managed IAM service account that
18470 /// creates Cloud Deploy release and rollout resources.
18471 pub service_account: std::string::String,
18472
18473 /// Required. Selected resources to which the automation will be applied.
18474 pub selector: std::option::Option<crate::model::AutomationResourceSelector>,
18475
18476 /// Required. List of Automation rules associated with the Automation resource.
18477 /// Must have at least one rule and limited to 250 rules per Delivery Pipeline.
18478 /// Note: the order of the rules here is not the same as the order of
18479 /// execution.
18480 pub rules: std::vec::Vec<crate::model::AutomationRule>,
18481
18482 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18483}
18484
18485impl Automation {
18486 /// Creates a new default instance.
18487 pub fn new() -> Self {
18488 std::default::Default::default()
18489 }
18490
18491 /// Sets the value of [name][crate::model::Automation::name].
18492 ///
18493 /// # Example
18494 /// ```ignore,no_run
18495 /// # use google_cloud_deploy_v1::model::Automation;
18496 /// # let project_id = "project_id";
18497 /// # let location_id = "location_id";
18498 /// # let delivery_pipeline_id = "delivery_pipeline_id";
18499 /// # let automation_id = "automation_id";
18500 /// let x = Automation::new().set_name(format!("projects/{project_id}/locations/{location_id}/deliveryPipelines/{delivery_pipeline_id}/automations/{automation_id}"));
18501 /// ```
18502 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18503 self.name = v.into();
18504 self
18505 }
18506
18507 /// Sets the value of [uid][crate::model::Automation::uid].
18508 ///
18509 /// # Example
18510 /// ```ignore,no_run
18511 /// # use google_cloud_deploy_v1::model::Automation;
18512 /// let x = Automation::new().set_uid("example");
18513 /// ```
18514 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18515 self.uid = v.into();
18516 self
18517 }
18518
18519 /// Sets the value of [description][crate::model::Automation::description].
18520 ///
18521 /// # Example
18522 /// ```ignore,no_run
18523 /// # use google_cloud_deploy_v1::model::Automation;
18524 /// let x = Automation::new().set_description("example");
18525 /// ```
18526 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18527 self.description = v.into();
18528 self
18529 }
18530
18531 /// Sets the value of [create_time][crate::model::Automation::create_time].
18532 ///
18533 /// # Example
18534 /// ```ignore,no_run
18535 /// # use google_cloud_deploy_v1::model::Automation;
18536 /// use wkt::Timestamp;
18537 /// let x = Automation::new().set_create_time(Timestamp::default()/* use setters */);
18538 /// ```
18539 pub fn set_create_time<T>(mut self, v: T) -> Self
18540 where
18541 T: std::convert::Into<wkt::Timestamp>,
18542 {
18543 self.create_time = std::option::Option::Some(v.into());
18544 self
18545 }
18546
18547 /// Sets or clears the value of [create_time][crate::model::Automation::create_time].
18548 ///
18549 /// # Example
18550 /// ```ignore,no_run
18551 /// # use google_cloud_deploy_v1::model::Automation;
18552 /// use wkt::Timestamp;
18553 /// let x = Automation::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
18554 /// let x = Automation::new().set_or_clear_create_time(None::<Timestamp>);
18555 /// ```
18556 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
18557 where
18558 T: std::convert::Into<wkt::Timestamp>,
18559 {
18560 self.create_time = v.map(|x| x.into());
18561 self
18562 }
18563
18564 /// Sets the value of [update_time][crate::model::Automation::update_time].
18565 ///
18566 /// # Example
18567 /// ```ignore,no_run
18568 /// # use google_cloud_deploy_v1::model::Automation;
18569 /// use wkt::Timestamp;
18570 /// let x = Automation::new().set_update_time(Timestamp::default()/* use setters */);
18571 /// ```
18572 pub fn set_update_time<T>(mut self, v: T) -> Self
18573 where
18574 T: std::convert::Into<wkt::Timestamp>,
18575 {
18576 self.update_time = std::option::Option::Some(v.into());
18577 self
18578 }
18579
18580 /// Sets or clears the value of [update_time][crate::model::Automation::update_time].
18581 ///
18582 /// # Example
18583 /// ```ignore,no_run
18584 /// # use google_cloud_deploy_v1::model::Automation;
18585 /// use wkt::Timestamp;
18586 /// let x = Automation::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
18587 /// let x = Automation::new().set_or_clear_update_time(None::<Timestamp>);
18588 /// ```
18589 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
18590 where
18591 T: std::convert::Into<wkt::Timestamp>,
18592 {
18593 self.update_time = v.map(|x| x.into());
18594 self
18595 }
18596
18597 /// Sets the value of [annotations][crate::model::Automation::annotations].
18598 ///
18599 /// # Example
18600 /// ```ignore,no_run
18601 /// # use google_cloud_deploy_v1::model::Automation;
18602 /// let x = Automation::new().set_annotations([
18603 /// ("key0", "abc"),
18604 /// ("key1", "xyz"),
18605 /// ]);
18606 /// ```
18607 pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
18608 where
18609 T: std::iter::IntoIterator<Item = (K, V)>,
18610 K: std::convert::Into<std::string::String>,
18611 V: std::convert::Into<std::string::String>,
18612 {
18613 use std::iter::Iterator;
18614 self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
18615 self
18616 }
18617
18618 /// Sets the value of [labels][crate::model::Automation::labels].
18619 ///
18620 /// # Example
18621 /// ```ignore,no_run
18622 /// # use google_cloud_deploy_v1::model::Automation;
18623 /// let x = Automation::new().set_labels([
18624 /// ("key0", "abc"),
18625 /// ("key1", "xyz"),
18626 /// ]);
18627 /// ```
18628 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
18629 where
18630 T: std::iter::IntoIterator<Item = (K, V)>,
18631 K: std::convert::Into<std::string::String>,
18632 V: std::convert::Into<std::string::String>,
18633 {
18634 use std::iter::Iterator;
18635 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
18636 self
18637 }
18638
18639 /// Sets the value of [etag][crate::model::Automation::etag].
18640 ///
18641 /// # Example
18642 /// ```ignore,no_run
18643 /// # use google_cloud_deploy_v1::model::Automation;
18644 /// let x = Automation::new().set_etag("example");
18645 /// ```
18646 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18647 self.etag = v.into();
18648 self
18649 }
18650
18651 /// Sets the value of [suspended][crate::model::Automation::suspended].
18652 ///
18653 /// # Example
18654 /// ```ignore,no_run
18655 /// # use google_cloud_deploy_v1::model::Automation;
18656 /// let x = Automation::new().set_suspended(true);
18657 /// ```
18658 pub fn set_suspended<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
18659 self.suspended = v.into();
18660 self
18661 }
18662
18663 /// Sets the value of [service_account][crate::model::Automation::service_account].
18664 ///
18665 /// # Example
18666 /// ```ignore,no_run
18667 /// # use google_cloud_deploy_v1::model::Automation;
18668 /// let x = Automation::new().set_service_account("example");
18669 /// ```
18670 pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18671 self.service_account = v.into();
18672 self
18673 }
18674
18675 /// Sets the value of [selector][crate::model::Automation::selector].
18676 ///
18677 /// # Example
18678 /// ```ignore,no_run
18679 /// # use google_cloud_deploy_v1::model::Automation;
18680 /// use google_cloud_deploy_v1::model::AutomationResourceSelector;
18681 /// let x = Automation::new().set_selector(AutomationResourceSelector::default()/* use setters */);
18682 /// ```
18683 pub fn set_selector<T>(mut self, v: T) -> Self
18684 where
18685 T: std::convert::Into<crate::model::AutomationResourceSelector>,
18686 {
18687 self.selector = std::option::Option::Some(v.into());
18688 self
18689 }
18690
18691 /// Sets or clears the value of [selector][crate::model::Automation::selector].
18692 ///
18693 /// # Example
18694 /// ```ignore,no_run
18695 /// # use google_cloud_deploy_v1::model::Automation;
18696 /// use google_cloud_deploy_v1::model::AutomationResourceSelector;
18697 /// let x = Automation::new().set_or_clear_selector(Some(AutomationResourceSelector::default()/* use setters */));
18698 /// let x = Automation::new().set_or_clear_selector(None::<AutomationResourceSelector>);
18699 /// ```
18700 pub fn set_or_clear_selector<T>(mut self, v: std::option::Option<T>) -> Self
18701 where
18702 T: std::convert::Into<crate::model::AutomationResourceSelector>,
18703 {
18704 self.selector = v.map(|x| x.into());
18705 self
18706 }
18707
18708 /// Sets the value of [rules][crate::model::Automation::rules].
18709 ///
18710 /// # Example
18711 /// ```ignore,no_run
18712 /// # use google_cloud_deploy_v1::model::Automation;
18713 /// use google_cloud_deploy_v1::model::AutomationRule;
18714 /// let x = Automation::new()
18715 /// .set_rules([
18716 /// AutomationRule::default()/* use setters */,
18717 /// AutomationRule::default()/* use (different) setters */,
18718 /// ]);
18719 /// ```
18720 pub fn set_rules<T, V>(mut self, v: T) -> Self
18721 where
18722 T: std::iter::IntoIterator<Item = V>,
18723 V: std::convert::Into<crate::model::AutomationRule>,
18724 {
18725 use std::iter::Iterator;
18726 self.rules = v.into_iter().map(|i| i.into()).collect();
18727 self
18728 }
18729}
18730
18731impl wkt::message::Message for Automation {
18732 fn typename() -> &'static str {
18733 "type.googleapis.com/google.cloud.deploy.v1.Automation"
18734 }
18735}
18736
18737/// AutomationResourceSelector contains the information to select the resources
18738/// to which an Automation is going to be applied.
18739#[derive(Clone, Default, PartialEq)]
18740#[non_exhaustive]
18741pub struct AutomationResourceSelector {
18742 /// Optional. Contains attributes about a target.
18743 pub targets: std::vec::Vec<crate::model::TargetAttribute>,
18744
18745 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18746}
18747
18748impl AutomationResourceSelector {
18749 /// Creates a new default instance.
18750 pub fn new() -> Self {
18751 std::default::Default::default()
18752 }
18753
18754 /// Sets the value of [targets][crate::model::AutomationResourceSelector::targets].
18755 ///
18756 /// # Example
18757 /// ```ignore,no_run
18758 /// # use google_cloud_deploy_v1::model::AutomationResourceSelector;
18759 /// use google_cloud_deploy_v1::model::TargetAttribute;
18760 /// let x = AutomationResourceSelector::new()
18761 /// .set_targets([
18762 /// TargetAttribute::default()/* use setters */,
18763 /// TargetAttribute::default()/* use (different) setters */,
18764 /// ]);
18765 /// ```
18766 pub fn set_targets<T, V>(mut self, v: T) -> Self
18767 where
18768 T: std::iter::IntoIterator<Item = V>,
18769 V: std::convert::Into<crate::model::TargetAttribute>,
18770 {
18771 use std::iter::Iterator;
18772 self.targets = v.into_iter().map(|i| i.into()).collect();
18773 self
18774 }
18775}
18776
18777impl wkt::message::Message for AutomationResourceSelector {
18778 fn typename() -> &'static str {
18779 "type.googleapis.com/google.cloud.deploy.v1.AutomationResourceSelector"
18780 }
18781}
18782
18783/// `AutomationRule` defines the automation activities.
18784#[derive(Clone, Default, PartialEq)]
18785#[non_exhaustive]
18786pub struct AutomationRule {
18787 /// The configuration of the Automation rule.
18788 pub rule: std::option::Option<crate::model::automation_rule::Rule>,
18789
18790 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18791}
18792
18793impl AutomationRule {
18794 /// Creates a new default instance.
18795 pub fn new() -> Self {
18796 std::default::Default::default()
18797 }
18798
18799 /// Sets the value of [rule][crate::model::AutomationRule::rule].
18800 ///
18801 /// Note that all the setters affecting `rule` are mutually
18802 /// exclusive.
18803 ///
18804 /// # Example
18805 /// ```ignore,no_run
18806 /// # use google_cloud_deploy_v1::model::AutomationRule;
18807 /// use google_cloud_deploy_v1::model::PromoteReleaseRule;
18808 /// let x = AutomationRule::new().set_rule(Some(
18809 /// google_cloud_deploy_v1::model::automation_rule::Rule::PromoteReleaseRule(PromoteReleaseRule::default().into())));
18810 /// ```
18811 pub fn set_rule<
18812 T: std::convert::Into<std::option::Option<crate::model::automation_rule::Rule>>,
18813 >(
18814 mut self,
18815 v: T,
18816 ) -> Self {
18817 self.rule = v.into();
18818 self
18819 }
18820
18821 /// The value of [rule][crate::model::AutomationRule::rule]
18822 /// if it holds a `PromoteReleaseRule`, `None` if the field is not set or
18823 /// holds a different branch.
18824 pub fn promote_release_rule(
18825 &self,
18826 ) -> std::option::Option<&std::boxed::Box<crate::model::PromoteReleaseRule>> {
18827 #[allow(unreachable_patterns)]
18828 self.rule.as_ref().and_then(|v| match v {
18829 crate::model::automation_rule::Rule::PromoteReleaseRule(v) => {
18830 std::option::Option::Some(v)
18831 }
18832 _ => std::option::Option::None,
18833 })
18834 }
18835
18836 /// Sets the value of [rule][crate::model::AutomationRule::rule]
18837 /// to hold a `PromoteReleaseRule`.
18838 ///
18839 /// Note that all the setters affecting `rule` are
18840 /// mutually exclusive.
18841 ///
18842 /// # Example
18843 /// ```ignore,no_run
18844 /// # use google_cloud_deploy_v1::model::AutomationRule;
18845 /// use google_cloud_deploy_v1::model::PromoteReleaseRule;
18846 /// let x = AutomationRule::new().set_promote_release_rule(PromoteReleaseRule::default()/* use setters */);
18847 /// assert!(x.promote_release_rule().is_some());
18848 /// assert!(x.advance_rollout_rule().is_none());
18849 /// assert!(x.repair_rollout_rule().is_none());
18850 /// assert!(x.timed_promote_release_rule().is_none());
18851 /// ```
18852 pub fn set_promote_release_rule<
18853 T: std::convert::Into<std::boxed::Box<crate::model::PromoteReleaseRule>>,
18854 >(
18855 mut self,
18856 v: T,
18857 ) -> Self {
18858 self.rule = std::option::Option::Some(
18859 crate::model::automation_rule::Rule::PromoteReleaseRule(v.into()),
18860 );
18861 self
18862 }
18863
18864 /// The value of [rule][crate::model::AutomationRule::rule]
18865 /// if it holds a `AdvanceRolloutRule`, `None` if the field is not set or
18866 /// holds a different branch.
18867 pub fn advance_rollout_rule(
18868 &self,
18869 ) -> std::option::Option<&std::boxed::Box<crate::model::AdvanceRolloutRule>> {
18870 #[allow(unreachable_patterns)]
18871 self.rule.as_ref().and_then(|v| match v {
18872 crate::model::automation_rule::Rule::AdvanceRolloutRule(v) => {
18873 std::option::Option::Some(v)
18874 }
18875 _ => std::option::Option::None,
18876 })
18877 }
18878
18879 /// Sets the value of [rule][crate::model::AutomationRule::rule]
18880 /// to hold a `AdvanceRolloutRule`.
18881 ///
18882 /// Note that all the setters affecting `rule` are
18883 /// mutually exclusive.
18884 ///
18885 /// # Example
18886 /// ```ignore,no_run
18887 /// # use google_cloud_deploy_v1::model::AutomationRule;
18888 /// use google_cloud_deploy_v1::model::AdvanceRolloutRule;
18889 /// let x = AutomationRule::new().set_advance_rollout_rule(AdvanceRolloutRule::default()/* use setters */);
18890 /// assert!(x.advance_rollout_rule().is_some());
18891 /// assert!(x.promote_release_rule().is_none());
18892 /// assert!(x.repair_rollout_rule().is_none());
18893 /// assert!(x.timed_promote_release_rule().is_none());
18894 /// ```
18895 pub fn set_advance_rollout_rule<
18896 T: std::convert::Into<std::boxed::Box<crate::model::AdvanceRolloutRule>>,
18897 >(
18898 mut self,
18899 v: T,
18900 ) -> Self {
18901 self.rule = std::option::Option::Some(
18902 crate::model::automation_rule::Rule::AdvanceRolloutRule(v.into()),
18903 );
18904 self
18905 }
18906
18907 /// The value of [rule][crate::model::AutomationRule::rule]
18908 /// if it holds a `RepairRolloutRule`, `None` if the field is not set or
18909 /// holds a different branch.
18910 pub fn repair_rollout_rule(
18911 &self,
18912 ) -> std::option::Option<&std::boxed::Box<crate::model::RepairRolloutRule>> {
18913 #[allow(unreachable_patterns)]
18914 self.rule.as_ref().and_then(|v| match v {
18915 crate::model::automation_rule::Rule::RepairRolloutRule(v) => {
18916 std::option::Option::Some(v)
18917 }
18918 _ => std::option::Option::None,
18919 })
18920 }
18921
18922 /// Sets the value of [rule][crate::model::AutomationRule::rule]
18923 /// to hold a `RepairRolloutRule`.
18924 ///
18925 /// Note that all the setters affecting `rule` are
18926 /// mutually exclusive.
18927 ///
18928 /// # Example
18929 /// ```ignore,no_run
18930 /// # use google_cloud_deploy_v1::model::AutomationRule;
18931 /// use google_cloud_deploy_v1::model::RepairRolloutRule;
18932 /// let x = AutomationRule::new().set_repair_rollout_rule(RepairRolloutRule::default()/* use setters */);
18933 /// assert!(x.repair_rollout_rule().is_some());
18934 /// assert!(x.promote_release_rule().is_none());
18935 /// assert!(x.advance_rollout_rule().is_none());
18936 /// assert!(x.timed_promote_release_rule().is_none());
18937 /// ```
18938 pub fn set_repair_rollout_rule<
18939 T: std::convert::Into<std::boxed::Box<crate::model::RepairRolloutRule>>,
18940 >(
18941 mut self,
18942 v: T,
18943 ) -> Self {
18944 self.rule = std::option::Option::Some(
18945 crate::model::automation_rule::Rule::RepairRolloutRule(v.into()),
18946 );
18947 self
18948 }
18949
18950 /// The value of [rule][crate::model::AutomationRule::rule]
18951 /// if it holds a `TimedPromoteReleaseRule`, `None` if the field is not set or
18952 /// holds a different branch.
18953 pub fn timed_promote_release_rule(
18954 &self,
18955 ) -> std::option::Option<&std::boxed::Box<crate::model::TimedPromoteReleaseRule>> {
18956 #[allow(unreachable_patterns)]
18957 self.rule.as_ref().and_then(|v| match v {
18958 crate::model::automation_rule::Rule::TimedPromoteReleaseRule(v) => {
18959 std::option::Option::Some(v)
18960 }
18961 _ => std::option::Option::None,
18962 })
18963 }
18964
18965 /// Sets the value of [rule][crate::model::AutomationRule::rule]
18966 /// to hold a `TimedPromoteReleaseRule`.
18967 ///
18968 /// Note that all the setters affecting `rule` are
18969 /// mutually exclusive.
18970 ///
18971 /// # Example
18972 /// ```ignore,no_run
18973 /// # use google_cloud_deploy_v1::model::AutomationRule;
18974 /// use google_cloud_deploy_v1::model::TimedPromoteReleaseRule;
18975 /// let x = AutomationRule::new().set_timed_promote_release_rule(TimedPromoteReleaseRule::default()/* use setters */);
18976 /// assert!(x.timed_promote_release_rule().is_some());
18977 /// assert!(x.promote_release_rule().is_none());
18978 /// assert!(x.advance_rollout_rule().is_none());
18979 /// assert!(x.repair_rollout_rule().is_none());
18980 /// ```
18981 pub fn set_timed_promote_release_rule<
18982 T: std::convert::Into<std::boxed::Box<crate::model::TimedPromoteReleaseRule>>,
18983 >(
18984 mut self,
18985 v: T,
18986 ) -> Self {
18987 self.rule = std::option::Option::Some(
18988 crate::model::automation_rule::Rule::TimedPromoteReleaseRule(v.into()),
18989 );
18990 self
18991 }
18992}
18993
18994impl wkt::message::Message for AutomationRule {
18995 fn typename() -> &'static str {
18996 "type.googleapis.com/google.cloud.deploy.v1.AutomationRule"
18997 }
18998}
18999
19000/// Defines additional types related to [AutomationRule].
19001pub mod automation_rule {
19002 #[allow(unused_imports)]
19003 use super::*;
19004
19005 /// The configuration of the Automation rule.
19006 #[derive(Clone, Debug, PartialEq)]
19007 #[non_exhaustive]
19008 pub enum Rule {
19009 /// Optional. `PromoteReleaseRule` will automatically promote a release from
19010 /// the current target to a specified target.
19011 PromoteReleaseRule(std::boxed::Box<crate::model::PromoteReleaseRule>),
19012 /// Optional. The `AdvanceRolloutRule` will automatically advance a
19013 /// successful Rollout.
19014 AdvanceRolloutRule(std::boxed::Box<crate::model::AdvanceRolloutRule>),
19015 /// Optional. The `RepairRolloutRule` will automatically repair a failed
19016 /// rollout.
19017 RepairRolloutRule(std::boxed::Box<crate::model::RepairRolloutRule>),
19018 /// Optional. The `TimedPromoteReleaseRule` will automatically promote a
19019 /// release from the current target(s) to the specified target(s) on a
19020 /// configured schedule.
19021 TimedPromoteReleaseRule(std::boxed::Box<crate::model::TimedPromoteReleaseRule>),
19022 }
19023}
19024
19025/// The `TimedPromoteReleaseRule` will automatically promote a release from the
19026/// current target(s) to the specified target(s) on a configured schedule.
19027#[derive(Clone, Default, PartialEq)]
19028#[non_exhaustive]
19029pub struct TimedPromoteReleaseRule {
19030 /// Required. ID of the rule. This ID must be unique in the `Automation`
19031 /// resource to which this rule belongs. The format is
19032 /// `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`.
19033 pub id: std::string::String,
19034
19035 /// Optional. The ID of the stage in the pipeline to which this `Release` is
19036 /// deploying. If unspecified, default it to the next stage in the promotion
19037 /// flow. The value of this field could be one of the following:
19038 ///
19039 /// * The last segment of a target name
19040 /// * "@next", the next target in the promotion sequence
19041 pub destination_target_id: std::string::String,
19042
19043 /// Required. Schedule in crontab format. e.g. "0 9 * * 1" for every Monday at
19044 /// 9am.
19045 pub schedule: std::string::String,
19046
19047 /// Required. The time zone in IANA format [IANA Time Zone
19048 /// Database](https://www.iana.org/time-zones) (e.g. America/New_York).
19049 pub time_zone: std::string::String,
19050
19051 /// Output only. Information around the state of the Automation rule.
19052 pub condition: std::option::Option<crate::model::AutomationRuleCondition>,
19053
19054 /// Optional. The starting phase of the rollout created by this rule. Default
19055 /// to the first phase.
19056 pub destination_phase: std::string::String,
19057
19058 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19059}
19060
19061impl TimedPromoteReleaseRule {
19062 /// Creates a new default instance.
19063 pub fn new() -> Self {
19064 std::default::Default::default()
19065 }
19066
19067 /// Sets the value of [id][crate::model::TimedPromoteReleaseRule::id].
19068 ///
19069 /// # Example
19070 /// ```ignore,no_run
19071 /// # use google_cloud_deploy_v1::model::TimedPromoteReleaseRule;
19072 /// let x = TimedPromoteReleaseRule::new().set_id("example");
19073 /// ```
19074 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19075 self.id = v.into();
19076 self
19077 }
19078
19079 /// Sets the value of [destination_target_id][crate::model::TimedPromoteReleaseRule::destination_target_id].
19080 ///
19081 /// # Example
19082 /// ```ignore,no_run
19083 /// # use google_cloud_deploy_v1::model::TimedPromoteReleaseRule;
19084 /// let x = TimedPromoteReleaseRule::new().set_destination_target_id("example");
19085 /// ```
19086 pub fn set_destination_target_id<T: std::convert::Into<std::string::String>>(
19087 mut self,
19088 v: T,
19089 ) -> Self {
19090 self.destination_target_id = v.into();
19091 self
19092 }
19093
19094 /// Sets the value of [schedule][crate::model::TimedPromoteReleaseRule::schedule].
19095 ///
19096 /// # Example
19097 /// ```ignore,no_run
19098 /// # use google_cloud_deploy_v1::model::TimedPromoteReleaseRule;
19099 /// let x = TimedPromoteReleaseRule::new().set_schedule("example");
19100 /// ```
19101 pub fn set_schedule<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19102 self.schedule = v.into();
19103 self
19104 }
19105
19106 /// Sets the value of [time_zone][crate::model::TimedPromoteReleaseRule::time_zone].
19107 ///
19108 /// # Example
19109 /// ```ignore,no_run
19110 /// # use google_cloud_deploy_v1::model::TimedPromoteReleaseRule;
19111 /// let x = TimedPromoteReleaseRule::new().set_time_zone("example");
19112 /// ```
19113 pub fn set_time_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19114 self.time_zone = v.into();
19115 self
19116 }
19117
19118 /// Sets the value of [condition][crate::model::TimedPromoteReleaseRule::condition].
19119 ///
19120 /// # Example
19121 /// ```ignore,no_run
19122 /// # use google_cloud_deploy_v1::model::TimedPromoteReleaseRule;
19123 /// use google_cloud_deploy_v1::model::AutomationRuleCondition;
19124 /// let x = TimedPromoteReleaseRule::new().set_condition(AutomationRuleCondition::default()/* use setters */);
19125 /// ```
19126 pub fn set_condition<T>(mut self, v: T) -> Self
19127 where
19128 T: std::convert::Into<crate::model::AutomationRuleCondition>,
19129 {
19130 self.condition = std::option::Option::Some(v.into());
19131 self
19132 }
19133
19134 /// Sets or clears the value of [condition][crate::model::TimedPromoteReleaseRule::condition].
19135 ///
19136 /// # Example
19137 /// ```ignore,no_run
19138 /// # use google_cloud_deploy_v1::model::TimedPromoteReleaseRule;
19139 /// use google_cloud_deploy_v1::model::AutomationRuleCondition;
19140 /// let x = TimedPromoteReleaseRule::new().set_or_clear_condition(Some(AutomationRuleCondition::default()/* use setters */));
19141 /// let x = TimedPromoteReleaseRule::new().set_or_clear_condition(None::<AutomationRuleCondition>);
19142 /// ```
19143 pub fn set_or_clear_condition<T>(mut self, v: std::option::Option<T>) -> Self
19144 where
19145 T: std::convert::Into<crate::model::AutomationRuleCondition>,
19146 {
19147 self.condition = v.map(|x| x.into());
19148 self
19149 }
19150
19151 /// Sets the value of [destination_phase][crate::model::TimedPromoteReleaseRule::destination_phase].
19152 ///
19153 /// # Example
19154 /// ```ignore,no_run
19155 /// # use google_cloud_deploy_v1::model::TimedPromoteReleaseRule;
19156 /// let x = TimedPromoteReleaseRule::new().set_destination_phase("example");
19157 /// ```
19158 pub fn set_destination_phase<T: std::convert::Into<std::string::String>>(
19159 mut self,
19160 v: T,
19161 ) -> Self {
19162 self.destination_phase = v.into();
19163 self
19164 }
19165}
19166
19167impl wkt::message::Message for TimedPromoteReleaseRule {
19168 fn typename() -> &'static str {
19169 "type.googleapis.com/google.cloud.deploy.v1.TimedPromoteReleaseRule"
19170 }
19171}
19172
19173/// The `PromoteRelease` rule will automatically promote a release from the
19174/// current target to a specified target.
19175#[derive(Clone, Default, PartialEq)]
19176#[non_exhaustive]
19177pub struct PromoteReleaseRule {
19178 /// Required. ID of the rule. This id must be unique in the `Automation`
19179 /// resource to which this rule belongs. The format is
19180 /// `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`.
19181 pub id: std::string::String,
19182
19183 /// Optional. How long the release need to be paused until being promoted to
19184 /// the next target.
19185 pub wait: std::option::Option<wkt::Duration>,
19186
19187 /// Optional. The ID of the stage in the pipeline to which this `Release` is
19188 /// deploying. If unspecified, default it to the next stage in the promotion
19189 /// flow. The value of this field could be one of the following:
19190 ///
19191 /// * The last segment of a target name
19192 /// * "@next", the next target in the promotion sequence
19193 pub destination_target_id: std::string::String,
19194
19195 /// Output only. Information around the state of the Automation rule.
19196 pub condition: std::option::Option<crate::model::AutomationRuleCondition>,
19197
19198 /// Optional. The starting phase of the rollout created by this operation.
19199 /// Default to the first phase.
19200 pub destination_phase: std::string::String,
19201
19202 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19203}
19204
19205impl PromoteReleaseRule {
19206 /// Creates a new default instance.
19207 pub fn new() -> Self {
19208 std::default::Default::default()
19209 }
19210
19211 /// Sets the value of [id][crate::model::PromoteReleaseRule::id].
19212 ///
19213 /// # Example
19214 /// ```ignore,no_run
19215 /// # use google_cloud_deploy_v1::model::PromoteReleaseRule;
19216 /// let x = PromoteReleaseRule::new().set_id("example");
19217 /// ```
19218 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19219 self.id = v.into();
19220 self
19221 }
19222
19223 /// Sets the value of [wait][crate::model::PromoteReleaseRule::wait].
19224 ///
19225 /// # Example
19226 /// ```ignore,no_run
19227 /// # use google_cloud_deploy_v1::model::PromoteReleaseRule;
19228 /// use wkt::Duration;
19229 /// let x = PromoteReleaseRule::new().set_wait(Duration::default()/* use setters */);
19230 /// ```
19231 pub fn set_wait<T>(mut self, v: T) -> Self
19232 where
19233 T: std::convert::Into<wkt::Duration>,
19234 {
19235 self.wait = std::option::Option::Some(v.into());
19236 self
19237 }
19238
19239 /// Sets or clears the value of [wait][crate::model::PromoteReleaseRule::wait].
19240 ///
19241 /// # Example
19242 /// ```ignore,no_run
19243 /// # use google_cloud_deploy_v1::model::PromoteReleaseRule;
19244 /// use wkt::Duration;
19245 /// let x = PromoteReleaseRule::new().set_or_clear_wait(Some(Duration::default()/* use setters */));
19246 /// let x = PromoteReleaseRule::new().set_or_clear_wait(None::<Duration>);
19247 /// ```
19248 pub fn set_or_clear_wait<T>(mut self, v: std::option::Option<T>) -> Self
19249 where
19250 T: std::convert::Into<wkt::Duration>,
19251 {
19252 self.wait = v.map(|x| x.into());
19253 self
19254 }
19255
19256 /// Sets the value of [destination_target_id][crate::model::PromoteReleaseRule::destination_target_id].
19257 ///
19258 /// # Example
19259 /// ```ignore,no_run
19260 /// # use google_cloud_deploy_v1::model::PromoteReleaseRule;
19261 /// let x = PromoteReleaseRule::new().set_destination_target_id("example");
19262 /// ```
19263 pub fn set_destination_target_id<T: std::convert::Into<std::string::String>>(
19264 mut self,
19265 v: T,
19266 ) -> Self {
19267 self.destination_target_id = v.into();
19268 self
19269 }
19270
19271 /// Sets the value of [condition][crate::model::PromoteReleaseRule::condition].
19272 ///
19273 /// # Example
19274 /// ```ignore,no_run
19275 /// # use google_cloud_deploy_v1::model::PromoteReleaseRule;
19276 /// use google_cloud_deploy_v1::model::AutomationRuleCondition;
19277 /// let x = PromoteReleaseRule::new().set_condition(AutomationRuleCondition::default()/* use setters */);
19278 /// ```
19279 pub fn set_condition<T>(mut self, v: T) -> Self
19280 where
19281 T: std::convert::Into<crate::model::AutomationRuleCondition>,
19282 {
19283 self.condition = std::option::Option::Some(v.into());
19284 self
19285 }
19286
19287 /// Sets or clears the value of [condition][crate::model::PromoteReleaseRule::condition].
19288 ///
19289 /// # Example
19290 /// ```ignore,no_run
19291 /// # use google_cloud_deploy_v1::model::PromoteReleaseRule;
19292 /// use google_cloud_deploy_v1::model::AutomationRuleCondition;
19293 /// let x = PromoteReleaseRule::new().set_or_clear_condition(Some(AutomationRuleCondition::default()/* use setters */));
19294 /// let x = PromoteReleaseRule::new().set_or_clear_condition(None::<AutomationRuleCondition>);
19295 /// ```
19296 pub fn set_or_clear_condition<T>(mut self, v: std::option::Option<T>) -> Self
19297 where
19298 T: std::convert::Into<crate::model::AutomationRuleCondition>,
19299 {
19300 self.condition = v.map(|x| x.into());
19301 self
19302 }
19303
19304 /// Sets the value of [destination_phase][crate::model::PromoteReleaseRule::destination_phase].
19305 ///
19306 /// # Example
19307 /// ```ignore,no_run
19308 /// # use google_cloud_deploy_v1::model::PromoteReleaseRule;
19309 /// let x = PromoteReleaseRule::new().set_destination_phase("example");
19310 /// ```
19311 pub fn set_destination_phase<T: std::convert::Into<std::string::String>>(
19312 mut self,
19313 v: T,
19314 ) -> Self {
19315 self.destination_phase = v.into();
19316 self
19317 }
19318}
19319
19320impl wkt::message::Message for PromoteReleaseRule {
19321 fn typename() -> &'static str {
19322 "type.googleapis.com/google.cloud.deploy.v1.PromoteReleaseRule"
19323 }
19324}
19325
19326/// The `AdvanceRollout` automation rule will automatically advance a successful
19327/// Rollout to the next phase.
19328#[derive(Clone, Default, PartialEq)]
19329#[non_exhaustive]
19330pub struct AdvanceRolloutRule {
19331 /// Required. ID of the rule. This id must be unique in the `Automation`
19332 /// resource to which this rule belongs. The format is
19333 /// `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`.
19334 pub id: std::string::String,
19335
19336 /// Optional. Proceeds only after phase name matched any one in the list.
19337 /// This value must consist of lower-case letters, numbers, and hyphens,
19338 /// start with a letter and end with a letter or a number, and have a max
19339 /// length of 63 characters. In other words, it must match the following
19340 /// regex: `^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$`.
19341 pub source_phases: std::vec::Vec<std::string::String>,
19342
19343 /// Optional. How long to wait after a rollout is finished.
19344 pub wait: std::option::Option<wkt::Duration>,
19345
19346 /// Output only. Information around the state of the Automation rule.
19347 pub condition: std::option::Option<crate::model::AutomationRuleCondition>,
19348
19349 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19350}
19351
19352impl AdvanceRolloutRule {
19353 /// Creates a new default instance.
19354 pub fn new() -> Self {
19355 std::default::Default::default()
19356 }
19357
19358 /// Sets the value of [id][crate::model::AdvanceRolloutRule::id].
19359 ///
19360 /// # Example
19361 /// ```ignore,no_run
19362 /// # use google_cloud_deploy_v1::model::AdvanceRolloutRule;
19363 /// let x = AdvanceRolloutRule::new().set_id("example");
19364 /// ```
19365 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19366 self.id = v.into();
19367 self
19368 }
19369
19370 /// Sets the value of [source_phases][crate::model::AdvanceRolloutRule::source_phases].
19371 ///
19372 /// # Example
19373 /// ```ignore,no_run
19374 /// # use google_cloud_deploy_v1::model::AdvanceRolloutRule;
19375 /// let x = AdvanceRolloutRule::new().set_source_phases(["a", "b", "c"]);
19376 /// ```
19377 pub fn set_source_phases<T, V>(mut self, v: T) -> Self
19378 where
19379 T: std::iter::IntoIterator<Item = V>,
19380 V: std::convert::Into<std::string::String>,
19381 {
19382 use std::iter::Iterator;
19383 self.source_phases = v.into_iter().map(|i| i.into()).collect();
19384 self
19385 }
19386
19387 /// Sets the value of [wait][crate::model::AdvanceRolloutRule::wait].
19388 ///
19389 /// # Example
19390 /// ```ignore,no_run
19391 /// # use google_cloud_deploy_v1::model::AdvanceRolloutRule;
19392 /// use wkt::Duration;
19393 /// let x = AdvanceRolloutRule::new().set_wait(Duration::default()/* use setters */);
19394 /// ```
19395 pub fn set_wait<T>(mut self, v: T) -> Self
19396 where
19397 T: std::convert::Into<wkt::Duration>,
19398 {
19399 self.wait = std::option::Option::Some(v.into());
19400 self
19401 }
19402
19403 /// Sets or clears the value of [wait][crate::model::AdvanceRolloutRule::wait].
19404 ///
19405 /// # Example
19406 /// ```ignore,no_run
19407 /// # use google_cloud_deploy_v1::model::AdvanceRolloutRule;
19408 /// use wkt::Duration;
19409 /// let x = AdvanceRolloutRule::new().set_or_clear_wait(Some(Duration::default()/* use setters */));
19410 /// let x = AdvanceRolloutRule::new().set_or_clear_wait(None::<Duration>);
19411 /// ```
19412 pub fn set_or_clear_wait<T>(mut self, v: std::option::Option<T>) -> Self
19413 where
19414 T: std::convert::Into<wkt::Duration>,
19415 {
19416 self.wait = v.map(|x| x.into());
19417 self
19418 }
19419
19420 /// Sets the value of [condition][crate::model::AdvanceRolloutRule::condition].
19421 ///
19422 /// # Example
19423 /// ```ignore,no_run
19424 /// # use google_cloud_deploy_v1::model::AdvanceRolloutRule;
19425 /// use google_cloud_deploy_v1::model::AutomationRuleCondition;
19426 /// let x = AdvanceRolloutRule::new().set_condition(AutomationRuleCondition::default()/* use setters */);
19427 /// ```
19428 pub fn set_condition<T>(mut self, v: T) -> Self
19429 where
19430 T: std::convert::Into<crate::model::AutomationRuleCondition>,
19431 {
19432 self.condition = std::option::Option::Some(v.into());
19433 self
19434 }
19435
19436 /// Sets or clears the value of [condition][crate::model::AdvanceRolloutRule::condition].
19437 ///
19438 /// # Example
19439 /// ```ignore,no_run
19440 /// # use google_cloud_deploy_v1::model::AdvanceRolloutRule;
19441 /// use google_cloud_deploy_v1::model::AutomationRuleCondition;
19442 /// let x = AdvanceRolloutRule::new().set_or_clear_condition(Some(AutomationRuleCondition::default()/* use setters */));
19443 /// let x = AdvanceRolloutRule::new().set_or_clear_condition(None::<AutomationRuleCondition>);
19444 /// ```
19445 pub fn set_or_clear_condition<T>(mut self, v: std::option::Option<T>) -> Self
19446 where
19447 T: std::convert::Into<crate::model::AutomationRuleCondition>,
19448 {
19449 self.condition = v.map(|x| x.into());
19450 self
19451 }
19452}
19453
19454impl wkt::message::Message for AdvanceRolloutRule {
19455 fn typename() -> &'static str {
19456 "type.googleapis.com/google.cloud.deploy.v1.AdvanceRolloutRule"
19457 }
19458}
19459
19460/// The `RepairRolloutRule` automation rule will automatically repair a failed
19461/// `Rollout`.
19462#[derive(Clone, Default, PartialEq)]
19463#[non_exhaustive]
19464pub struct RepairRolloutRule {
19465 /// Required. ID of the rule. This id must be unique in the `Automation`
19466 /// resource to which this rule belongs. The format is
19467 /// `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`.
19468 pub id: std::string::String,
19469
19470 /// Optional. Phases within which jobs are subject to automatic repair actions
19471 /// on failure. Proceeds only after phase name matched any one in the list, or
19472 /// for all phases if unspecified. This value must consist of lower-case
19473 /// letters, numbers, and hyphens, start with a letter and end with a letter or
19474 /// a number, and have a max length of 63 characters. In other words, it must
19475 /// match the following regex: `^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$`.
19476 pub phases: std::vec::Vec<std::string::String>,
19477
19478 /// Optional. Jobs to repair. Proceeds only after job name matched any one in
19479 /// the list, or for all jobs if unspecified or empty. The phase that includes
19480 /// the job must match the phase ID specified in `source_phase`. This value
19481 /// must consist of lower-case letters, numbers, and hyphens, start with a
19482 /// letter and end with a letter or a number, and have a max length of 63
19483 /// characters. In other words, it must match the following regex:
19484 /// `^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$`.
19485 pub jobs: std::vec::Vec<std::string::String>,
19486
19487 /// Output only. Information around the state of the 'Automation' rule.
19488 pub condition: std::option::Option<crate::model::AutomationRuleCondition>,
19489
19490 /// Required. Defines the types of automatic repair phases for failed jobs.
19491 pub repair_phases: std::vec::Vec<crate::model::RepairPhaseConfig>,
19492
19493 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19494}
19495
19496impl RepairRolloutRule {
19497 /// Creates a new default instance.
19498 pub fn new() -> Self {
19499 std::default::Default::default()
19500 }
19501
19502 /// Sets the value of [id][crate::model::RepairRolloutRule::id].
19503 ///
19504 /// # Example
19505 /// ```ignore,no_run
19506 /// # use google_cloud_deploy_v1::model::RepairRolloutRule;
19507 /// let x = RepairRolloutRule::new().set_id("example");
19508 /// ```
19509 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19510 self.id = v.into();
19511 self
19512 }
19513
19514 /// Sets the value of [phases][crate::model::RepairRolloutRule::phases].
19515 ///
19516 /// # Example
19517 /// ```ignore,no_run
19518 /// # use google_cloud_deploy_v1::model::RepairRolloutRule;
19519 /// let x = RepairRolloutRule::new().set_phases(["a", "b", "c"]);
19520 /// ```
19521 pub fn set_phases<T, V>(mut self, v: T) -> Self
19522 where
19523 T: std::iter::IntoIterator<Item = V>,
19524 V: std::convert::Into<std::string::String>,
19525 {
19526 use std::iter::Iterator;
19527 self.phases = v.into_iter().map(|i| i.into()).collect();
19528 self
19529 }
19530
19531 /// Sets the value of [jobs][crate::model::RepairRolloutRule::jobs].
19532 ///
19533 /// # Example
19534 /// ```ignore,no_run
19535 /// # use google_cloud_deploy_v1::model::RepairRolloutRule;
19536 /// let x = RepairRolloutRule::new().set_jobs(["a", "b", "c"]);
19537 /// ```
19538 pub fn set_jobs<T, V>(mut self, v: T) -> Self
19539 where
19540 T: std::iter::IntoIterator<Item = V>,
19541 V: std::convert::Into<std::string::String>,
19542 {
19543 use std::iter::Iterator;
19544 self.jobs = v.into_iter().map(|i| i.into()).collect();
19545 self
19546 }
19547
19548 /// Sets the value of [condition][crate::model::RepairRolloutRule::condition].
19549 ///
19550 /// # Example
19551 /// ```ignore,no_run
19552 /// # use google_cloud_deploy_v1::model::RepairRolloutRule;
19553 /// use google_cloud_deploy_v1::model::AutomationRuleCondition;
19554 /// let x = RepairRolloutRule::new().set_condition(AutomationRuleCondition::default()/* use setters */);
19555 /// ```
19556 pub fn set_condition<T>(mut self, v: T) -> Self
19557 where
19558 T: std::convert::Into<crate::model::AutomationRuleCondition>,
19559 {
19560 self.condition = std::option::Option::Some(v.into());
19561 self
19562 }
19563
19564 /// Sets or clears the value of [condition][crate::model::RepairRolloutRule::condition].
19565 ///
19566 /// # Example
19567 /// ```ignore,no_run
19568 /// # use google_cloud_deploy_v1::model::RepairRolloutRule;
19569 /// use google_cloud_deploy_v1::model::AutomationRuleCondition;
19570 /// let x = RepairRolloutRule::new().set_or_clear_condition(Some(AutomationRuleCondition::default()/* use setters */));
19571 /// let x = RepairRolloutRule::new().set_or_clear_condition(None::<AutomationRuleCondition>);
19572 /// ```
19573 pub fn set_or_clear_condition<T>(mut self, v: std::option::Option<T>) -> Self
19574 where
19575 T: std::convert::Into<crate::model::AutomationRuleCondition>,
19576 {
19577 self.condition = v.map(|x| x.into());
19578 self
19579 }
19580
19581 /// Sets the value of [repair_phases][crate::model::RepairRolloutRule::repair_phases].
19582 ///
19583 /// # Example
19584 /// ```ignore,no_run
19585 /// # use google_cloud_deploy_v1::model::RepairRolloutRule;
19586 /// use google_cloud_deploy_v1::model::RepairPhaseConfig;
19587 /// let x = RepairRolloutRule::new()
19588 /// .set_repair_phases([
19589 /// RepairPhaseConfig::default()/* use setters */,
19590 /// RepairPhaseConfig::default()/* use (different) setters */,
19591 /// ]);
19592 /// ```
19593 pub fn set_repair_phases<T, V>(mut self, v: T) -> Self
19594 where
19595 T: std::iter::IntoIterator<Item = V>,
19596 V: std::convert::Into<crate::model::RepairPhaseConfig>,
19597 {
19598 use std::iter::Iterator;
19599 self.repair_phases = v.into_iter().map(|i| i.into()).collect();
19600 self
19601 }
19602}
19603
19604impl wkt::message::Message for RepairRolloutRule {
19605 fn typename() -> &'static str {
19606 "type.googleapis.com/google.cloud.deploy.v1.RepairRolloutRule"
19607 }
19608}
19609
19610/// Configuration of the repair phase.
19611#[derive(Clone, Default, PartialEq)]
19612#[non_exhaustive]
19613pub struct RepairPhaseConfig {
19614 /// The repair phase to perform.
19615 pub repair_phase: std::option::Option<crate::model::repair_phase_config::RepairPhase>,
19616
19617 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19618}
19619
19620impl RepairPhaseConfig {
19621 /// Creates a new default instance.
19622 pub fn new() -> Self {
19623 std::default::Default::default()
19624 }
19625
19626 /// Sets the value of [repair_phase][crate::model::RepairPhaseConfig::repair_phase].
19627 ///
19628 /// Note that all the setters affecting `repair_phase` are mutually
19629 /// exclusive.
19630 ///
19631 /// # Example
19632 /// ```ignore,no_run
19633 /// # use google_cloud_deploy_v1::model::RepairPhaseConfig;
19634 /// use google_cloud_deploy_v1::model::Retry;
19635 /// let x = RepairPhaseConfig::new().set_repair_phase(Some(
19636 /// google_cloud_deploy_v1::model::repair_phase_config::RepairPhase::Retry(Retry::default().into())));
19637 /// ```
19638 pub fn set_repair_phase<
19639 T: std::convert::Into<std::option::Option<crate::model::repair_phase_config::RepairPhase>>,
19640 >(
19641 mut self,
19642 v: T,
19643 ) -> Self {
19644 self.repair_phase = v.into();
19645 self
19646 }
19647
19648 /// The value of [repair_phase][crate::model::RepairPhaseConfig::repair_phase]
19649 /// if it holds a `Retry`, `None` if the field is not set or
19650 /// holds a different branch.
19651 pub fn retry(&self) -> std::option::Option<&std::boxed::Box<crate::model::Retry>> {
19652 #[allow(unreachable_patterns)]
19653 self.repair_phase.as_ref().and_then(|v| match v {
19654 crate::model::repair_phase_config::RepairPhase::Retry(v) => {
19655 std::option::Option::Some(v)
19656 }
19657 _ => std::option::Option::None,
19658 })
19659 }
19660
19661 /// Sets the value of [repair_phase][crate::model::RepairPhaseConfig::repair_phase]
19662 /// to hold a `Retry`.
19663 ///
19664 /// Note that all the setters affecting `repair_phase` are
19665 /// mutually exclusive.
19666 ///
19667 /// # Example
19668 /// ```ignore,no_run
19669 /// # use google_cloud_deploy_v1::model::RepairPhaseConfig;
19670 /// use google_cloud_deploy_v1::model::Retry;
19671 /// let x = RepairPhaseConfig::new().set_retry(Retry::default()/* use setters */);
19672 /// assert!(x.retry().is_some());
19673 /// assert!(x.rollback().is_none());
19674 /// ```
19675 pub fn set_retry<T: std::convert::Into<std::boxed::Box<crate::model::Retry>>>(
19676 mut self,
19677 v: T,
19678 ) -> Self {
19679 self.repair_phase = std::option::Option::Some(
19680 crate::model::repair_phase_config::RepairPhase::Retry(v.into()),
19681 );
19682 self
19683 }
19684
19685 /// The value of [repair_phase][crate::model::RepairPhaseConfig::repair_phase]
19686 /// if it holds a `Rollback`, `None` if the field is not set or
19687 /// holds a different branch.
19688 pub fn rollback(&self) -> std::option::Option<&std::boxed::Box<crate::model::Rollback>> {
19689 #[allow(unreachable_patterns)]
19690 self.repair_phase.as_ref().and_then(|v| match v {
19691 crate::model::repair_phase_config::RepairPhase::Rollback(v) => {
19692 std::option::Option::Some(v)
19693 }
19694 _ => std::option::Option::None,
19695 })
19696 }
19697
19698 /// Sets the value of [repair_phase][crate::model::RepairPhaseConfig::repair_phase]
19699 /// to hold a `Rollback`.
19700 ///
19701 /// Note that all the setters affecting `repair_phase` are
19702 /// mutually exclusive.
19703 ///
19704 /// # Example
19705 /// ```ignore,no_run
19706 /// # use google_cloud_deploy_v1::model::RepairPhaseConfig;
19707 /// use google_cloud_deploy_v1::model::Rollback;
19708 /// let x = RepairPhaseConfig::new().set_rollback(Rollback::default()/* use setters */);
19709 /// assert!(x.rollback().is_some());
19710 /// assert!(x.retry().is_none());
19711 /// ```
19712 pub fn set_rollback<T: std::convert::Into<std::boxed::Box<crate::model::Rollback>>>(
19713 mut self,
19714 v: T,
19715 ) -> Self {
19716 self.repair_phase = std::option::Option::Some(
19717 crate::model::repair_phase_config::RepairPhase::Rollback(v.into()),
19718 );
19719 self
19720 }
19721}
19722
19723impl wkt::message::Message for RepairPhaseConfig {
19724 fn typename() -> &'static str {
19725 "type.googleapis.com/google.cloud.deploy.v1.RepairPhaseConfig"
19726 }
19727}
19728
19729/// Defines additional types related to [RepairPhaseConfig].
19730pub mod repair_phase_config {
19731 #[allow(unused_imports)]
19732 use super::*;
19733
19734 /// The repair phase to perform.
19735 #[derive(Clone, Debug, PartialEq)]
19736 #[non_exhaustive]
19737 pub enum RepairPhase {
19738 /// Optional. Retries a failed job.
19739 Retry(std::boxed::Box<crate::model::Retry>),
19740 /// Optional. Rolls back a `Rollout`.
19741 Rollback(std::boxed::Box<crate::model::Rollback>),
19742 }
19743}
19744
19745/// Retries the failed job.
19746#[derive(Clone, Default, PartialEq)]
19747#[non_exhaustive]
19748pub struct Retry {
19749 /// Required. Total number of retries. Retry is skipped if set to 0; The
19750 /// minimum value is 1, and the maximum value is 10.
19751 pub attempts: i64,
19752
19753 /// Optional. How long to wait for the first retry. Default is 0, and the
19754 /// maximum value is 14d.
19755 pub wait: std::option::Option<wkt::Duration>,
19756
19757 /// Optional. The pattern of how wait time will be increased. Default is
19758 /// linear. Backoff mode will be ignored if `wait` is 0.
19759 pub backoff_mode: crate::model::BackoffMode,
19760
19761 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19762}
19763
19764impl Retry {
19765 /// Creates a new default instance.
19766 pub fn new() -> Self {
19767 std::default::Default::default()
19768 }
19769
19770 /// Sets the value of [attempts][crate::model::Retry::attempts].
19771 ///
19772 /// # Example
19773 /// ```ignore,no_run
19774 /// # use google_cloud_deploy_v1::model::Retry;
19775 /// let x = Retry::new().set_attempts(42);
19776 /// ```
19777 pub fn set_attempts<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
19778 self.attempts = v.into();
19779 self
19780 }
19781
19782 /// Sets the value of [wait][crate::model::Retry::wait].
19783 ///
19784 /// # Example
19785 /// ```ignore,no_run
19786 /// # use google_cloud_deploy_v1::model::Retry;
19787 /// use wkt::Duration;
19788 /// let x = Retry::new().set_wait(Duration::default()/* use setters */);
19789 /// ```
19790 pub fn set_wait<T>(mut self, v: T) -> Self
19791 where
19792 T: std::convert::Into<wkt::Duration>,
19793 {
19794 self.wait = std::option::Option::Some(v.into());
19795 self
19796 }
19797
19798 /// Sets or clears the value of [wait][crate::model::Retry::wait].
19799 ///
19800 /// # Example
19801 /// ```ignore,no_run
19802 /// # use google_cloud_deploy_v1::model::Retry;
19803 /// use wkt::Duration;
19804 /// let x = Retry::new().set_or_clear_wait(Some(Duration::default()/* use setters */));
19805 /// let x = Retry::new().set_or_clear_wait(None::<Duration>);
19806 /// ```
19807 pub fn set_or_clear_wait<T>(mut self, v: std::option::Option<T>) -> Self
19808 where
19809 T: std::convert::Into<wkt::Duration>,
19810 {
19811 self.wait = v.map(|x| x.into());
19812 self
19813 }
19814
19815 /// Sets the value of [backoff_mode][crate::model::Retry::backoff_mode].
19816 ///
19817 /// # Example
19818 /// ```ignore,no_run
19819 /// # use google_cloud_deploy_v1::model::Retry;
19820 /// use google_cloud_deploy_v1::model::BackoffMode;
19821 /// let x0 = Retry::new().set_backoff_mode(BackoffMode::Linear);
19822 /// let x1 = Retry::new().set_backoff_mode(BackoffMode::Exponential);
19823 /// ```
19824 pub fn set_backoff_mode<T: std::convert::Into<crate::model::BackoffMode>>(
19825 mut self,
19826 v: T,
19827 ) -> Self {
19828 self.backoff_mode = v.into();
19829 self
19830 }
19831}
19832
19833impl wkt::message::Message for Retry {
19834 fn typename() -> &'static str {
19835 "type.googleapis.com/google.cloud.deploy.v1.Retry"
19836 }
19837}
19838
19839/// Rolls back a `Rollout`.
19840#[derive(Clone, Default, PartialEq)]
19841#[non_exhaustive]
19842pub struct Rollback {
19843 /// Optional. The starting phase ID for the `Rollout`. If unspecified, the
19844 /// `Rollout` will start in the stable phase.
19845 pub destination_phase: std::string::String,
19846
19847 /// Optional. If pending rollout exists on the target, the rollback operation
19848 /// will be aborted.
19849 pub disable_rollback_if_rollout_pending: bool,
19850
19851 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19852}
19853
19854impl Rollback {
19855 /// Creates a new default instance.
19856 pub fn new() -> Self {
19857 std::default::Default::default()
19858 }
19859
19860 /// Sets the value of [destination_phase][crate::model::Rollback::destination_phase].
19861 ///
19862 /// # Example
19863 /// ```ignore,no_run
19864 /// # use google_cloud_deploy_v1::model::Rollback;
19865 /// let x = Rollback::new().set_destination_phase("example");
19866 /// ```
19867 pub fn set_destination_phase<T: std::convert::Into<std::string::String>>(
19868 mut self,
19869 v: T,
19870 ) -> Self {
19871 self.destination_phase = v.into();
19872 self
19873 }
19874
19875 /// Sets the value of [disable_rollback_if_rollout_pending][crate::model::Rollback::disable_rollback_if_rollout_pending].
19876 ///
19877 /// # Example
19878 /// ```ignore,no_run
19879 /// # use google_cloud_deploy_v1::model::Rollback;
19880 /// let x = Rollback::new().set_disable_rollback_if_rollout_pending(true);
19881 /// ```
19882 pub fn set_disable_rollback_if_rollout_pending<T: std::convert::Into<bool>>(
19883 mut self,
19884 v: T,
19885 ) -> Self {
19886 self.disable_rollback_if_rollout_pending = v.into();
19887 self
19888 }
19889}
19890
19891impl wkt::message::Message for Rollback {
19892 fn typename() -> &'static str {
19893 "type.googleapis.com/google.cloud.deploy.v1.Rollback"
19894 }
19895}
19896
19897/// `AutomationRuleCondition` contains conditions relevant to an
19898/// `Automation` rule.
19899#[derive(Clone, Default, PartialEq)]
19900#[non_exhaustive]
19901pub struct AutomationRuleCondition {
19902 /// Optional. Details around targets enumerated in the rule.
19903 pub targets_present_condition: std::option::Option<crate::model::TargetsPresentCondition>,
19904
19905 /// Details specific to the automation rule type.
19906 pub rule_type_condition:
19907 std::option::Option<crate::model::automation_rule_condition::RuleTypeCondition>,
19908
19909 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19910}
19911
19912impl AutomationRuleCondition {
19913 /// Creates a new default instance.
19914 pub fn new() -> Self {
19915 std::default::Default::default()
19916 }
19917
19918 /// Sets the value of [targets_present_condition][crate::model::AutomationRuleCondition::targets_present_condition].
19919 ///
19920 /// # Example
19921 /// ```ignore,no_run
19922 /// # use google_cloud_deploy_v1::model::AutomationRuleCondition;
19923 /// use google_cloud_deploy_v1::model::TargetsPresentCondition;
19924 /// let x = AutomationRuleCondition::new().set_targets_present_condition(TargetsPresentCondition::default()/* use setters */);
19925 /// ```
19926 pub fn set_targets_present_condition<T>(mut self, v: T) -> Self
19927 where
19928 T: std::convert::Into<crate::model::TargetsPresentCondition>,
19929 {
19930 self.targets_present_condition = std::option::Option::Some(v.into());
19931 self
19932 }
19933
19934 /// Sets or clears the value of [targets_present_condition][crate::model::AutomationRuleCondition::targets_present_condition].
19935 ///
19936 /// # Example
19937 /// ```ignore,no_run
19938 /// # use google_cloud_deploy_v1::model::AutomationRuleCondition;
19939 /// use google_cloud_deploy_v1::model::TargetsPresentCondition;
19940 /// let x = AutomationRuleCondition::new().set_or_clear_targets_present_condition(Some(TargetsPresentCondition::default()/* use setters */));
19941 /// let x = AutomationRuleCondition::new().set_or_clear_targets_present_condition(None::<TargetsPresentCondition>);
19942 /// ```
19943 pub fn set_or_clear_targets_present_condition<T>(mut self, v: std::option::Option<T>) -> Self
19944 where
19945 T: std::convert::Into<crate::model::TargetsPresentCondition>,
19946 {
19947 self.targets_present_condition = v.map(|x| x.into());
19948 self
19949 }
19950
19951 /// Sets the value of [rule_type_condition][crate::model::AutomationRuleCondition::rule_type_condition].
19952 ///
19953 /// Note that all the setters affecting `rule_type_condition` are mutually
19954 /// exclusive.
19955 ///
19956 /// # Example
19957 /// ```ignore,no_run
19958 /// # use google_cloud_deploy_v1::model::AutomationRuleCondition;
19959 /// use google_cloud_deploy_v1::model::TimedPromoteReleaseCondition;
19960 /// let x = AutomationRuleCondition::new().set_rule_type_condition(Some(
19961 /// google_cloud_deploy_v1::model::automation_rule_condition::RuleTypeCondition::TimedPromoteReleaseCondition(TimedPromoteReleaseCondition::default().into())));
19962 /// ```
19963 pub fn set_rule_type_condition<
19964 T: std::convert::Into<
19965 std::option::Option<crate::model::automation_rule_condition::RuleTypeCondition>,
19966 >,
19967 >(
19968 mut self,
19969 v: T,
19970 ) -> Self {
19971 self.rule_type_condition = v.into();
19972 self
19973 }
19974
19975 /// The value of [rule_type_condition][crate::model::AutomationRuleCondition::rule_type_condition]
19976 /// if it holds a `TimedPromoteReleaseCondition`, `None` if the field is not set or
19977 /// holds a different branch.
19978 pub fn timed_promote_release_condition(
19979 &self,
19980 ) -> std::option::Option<&std::boxed::Box<crate::model::TimedPromoteReleaseCondition>> {
19981 #[allow(unreachable_patterns)]
19982 self.rule_type_condition.as_ref().and_then(|v| match v {
19983 crate::model::automation_rule_condition::RuleTypeCondition::TimedPromoteReleaseCondition(v) => std::option::Option::Some(v),
19984 _ => std::option::Option::None,
19985 })
19986 }
19987
19988 /// Sets the value of [rule_type_condition][crate::model::AutomationRuleCondition::rule_type_condition]
19989 /// to hold a `TimedPromoteReleaseCondition`.
19990 ///
19991 /// Note that all the setters affecting `rule_type_condition` are
19992 /// mutually exclusive.
19993 ///
19994 /// # Example
19995 /// ```ignore,no_run
19996 /// # use google_cloud_deploy_v1::model::AutomationRuleCondition;
19997 /// use google_cloud_deploy_v1::model::TimedPromoteReleaseCondition;
19998 /// let x = AutomationRuleCondition::new().set_timed_promote_release_condition(TimedPromoteReleaseCondition::default()/* use setters */);
19999 /// assert!(x.timed_promote_release_condition().is_some());
20000 /// ```
20001 pub fn set_timed_promote_release_condition<
20002 T: std::convert::Into<std::boxed::Box<crate::model::TimedPromoteReleaseCondition>>,
20003 >(
20004 mut self,
20005 v: T,
20006 ) -> Self {
20007 self.rule_type_condition = std::option::Option::Some(
20008 crate::model::automation_rule_condition::RuleTypeCondition::TimedPromoteReleaseCondition(
20009 v.into()
20010 )
20011 );
20012 self
20013 }
20014}
20015
20016impl wkt::message::Message for AutomationRuleCondition {
20017 fn typename() -> &'static str {
20018 "type.googleapis.com/google.cloud.deploy.v1.AutomationRuleCondition"
20019 }
20020}
20021
20022/// Defines additional types related to [AutomationRuleCondition].
20023pub mod automation_rule_condition {
20024 #[allow(unused_imports)]
20025 use super::*;
20026
20027 /// Details specific to the automation rule type.
20028 #[derive(Clone, Debug, PartialEq)]
20029 #[non_exhaustive]
20030 pub enum RuleTypeCondition {
20031 /// Optional. TimedPromoteReleaseCondition contains rule conditions specific
20032 /// to a an Automation with a timed promote release rule defined.
20033 TimedPromoteReleaseCondition(std::boxed::Box<crate::model::TimedPromoteReleaseCondition>),
20034 }
20035}
20036
20037/// `TimedPromoteReleaseCondition` contains conditions specific to an Automation
20038/// with a Timed Promote Release rule defined.
20039#[derive(Clone, Default, PartialEq)]
20040#[non_exhaustive]
20041pub struct TimedPromoteReleaseCondition {
20042 /// Output only. When the next scheduled promotion(s) will occur.
20043 pub next_promotion_time: std::option::Option<wkt::Timestamp>,
20044
20045 /// Output only. A list of targets involved in the upcoming timed promotion(s).
20046 pub targets_list: std::vec::Vec<crate::model::timed_promote_release_condition::Targets>,
20047
20048 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20049}
20050
20051impl TimedPromoteReleaseCondition {
20052 /// Creates a new default instance.
20053 pub fn new() -> Self {
20054 std::default::Default::default()
20055 }
20056
20057 /// Sets the value of [next_promotion_time][crate::model::TimedPromoteReleaseCondition::next_promotion_time].
20058 ///
20059 /// # Example
20060 /// ```ignore,no_run
20061 /// # use google_cloud_deploy_v1::model::TimedPromoteReleaseCondition;
20062 /// use wkt::Timestamp;
20063 /// let x = TimedPromoteReleaseCondition::new().set_next_promotion_time(Timestamp::default()/* use setters */);
20064 /// ```
20065 pub fn set_next_promotion_time<T>(mut self, v: T) -> Self
20066 where
20067 T: std::convert::Into<wkt::Timestamp>,
20068 {
20069 self.next_promotion_time = std::option::Option::Some(v.into());
20070 self
20071 }
20072
20073 /// Sets or clears the value of [next_promotion_time][crate::model::TimedPromoteReleaseCondition::next_promotion_time].
20074 ///
20075 /// # Example
20076 /// ```ignore,no_run
20077 /// # use google_cloud_deploy_v1::model::TimedPromoteReleaseCondition;
20078 /// use wkt::Timestamp;
20079 /// let x = TimedPromoteReleaseCondition::new().set_or_clear_next_promotion_time(Some(Timestamp::default()/* use setters */));
20080 /// let x = TimedPromoteReleaseCondition::new().set_or_clear_next_promotion_time(None::<Timestamp>);
20081 /// ```
20082 pub fn set_or_clear_next_promotion_time<T>(mut self, v: std::option::Option<T>) -> Self
20083 where
20084 T: std::convert::Into<wkt::Timestamp>,
20085 {
20086 self.next_promotion_time = v.map(|x| x.into());
20087 self
20088 }
20089
20090 /// Sets the value of [targets_list][crate::model::TimedPromoteReleaseCondition::targets_list].
20091 ///
20092 /// # Example
20093 /// ```ignore,no_run
20094 /// # use google_cloud_deploy_v1::model::TimedPromoteReleaseCondition;
20095 /// use google_cloud_deploy_v1::model::timed_promote_release_condition::Targets;
20096 /// let x = TimedPromoteReleaseCondition::new()
20097 /// .set_targets_list([
20098 /// Targets::default()/* use setters */,
20099 /// Targets::default()/* use (different) setters */,
20100 /// ]);
20101 /// ```
20102 pub fn set_targets_list<T, V>(mut self, v: T) -> Self
20103 where
20104 T: std::iter::IntoIterator<Item = V>,
20105 V: std::convert::Into<crate::model::timed_promote_release_condition::Targets>,
20106 {
20107 use std::iter::Iterator;
20108 self.targets_list = v.into_iter().map(|i| i.into()).collect();
20109 self
20110 }
20111}
20112
20113impl wkt::message::Message for TimedPromoteReleaseCondition {
20114 fn typename() -> &'static str {
20115 "type.googleapis.com/google.cloud.deploy.v1.TimedPromoteReleaseCondition"
20116 }
20117}
20118
20119/// Defines additional types related to [TimedPromoteReleaseCondition].
20120pub mod timed_promote_release_condition {
20121 #[allow(unused_imports)]
20122 use super::*;
20123
20124 /// The targets involved in a single timed promotion.
20125 #[derive(Clone, Default, PartialEq)]
20126 #[non_exhaustive]
20127 pub struct Targets {
20128 /// Optional. The source target ID.
20129 pub source_target_id: std::string::String,
20130
20131 /// Optional. The destination target ID.
20132 pub destination_target_id: std::string::String,
20133
20134 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20135 }
20136
20137 impl Targets {
20138 /// Creates a new default instance.
20139 pub fn new() -> Self {
20140 std::default::Default::default()
20141 }
20142
20143 /// Sets the value of [source_target_id][crate::model::timed_promote_release_condition::Targets::source_target_id].
20144 ///
20145 /// # Example
20146 /// ```ignore,no_run
20147 /// # use google_cloud_deploy_v1::model::timed_promote_release_condition::Targets;
20148 /// let x = Targets::new().set_source_target_id("example");
20149 /// ```
20150 pub fn set_source_target_id<T: std::convert::Into<std::string::String>>(
20151 mut self,
20152 v: T,
20153 ) -> Self {
20154 self.source_target_id = v.into();
20155 self
20156 }
20157
20158 /// Sets the value of [destination_target_id][crate::model::timed_promote_release_condition::Targets::destination_target_id].
20159 ///
20160 /// # Example
20161 /// ```ignore,no_run
20162 /// # use google_cloud_deploy_v1::model::timed_promote_release_condition::Targets;
20163 /// let x = Targets::new().set_destination_target_id("example");
20164 /// ```
20165 pub fn set_destination_target_id<T: std::convert::Into<std::string::String>>(
20166 mut self,
20167 v: T,
20168 ) -> Self {
20169 self.destination_target_id = v.into();
20170 self
20171 }
20172 }
20173
20174 impl wkt::message::Message for Targets {
20175 fn typename() -> &'static str {
20176 "type.googleapis.com/google.cloud.deploy.v1.TimedPromoteReleaseCondition.Targets"
20177 }
20178 }
20179}
20180
20181/// The request object for `CreateAutomation`.
20182#[derive(Clone, Default, PartialEq)]
20183#[non_exhaustive]
20184pub struct CreateAutomationRequest {
20185 /// Required. The parent collection in which the `Automation` must be created.
20186 /// The format is
20187 /// `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}`.
20188 pub parent: std::string::String,
20189
20190 /// Required. ID of the `Automation`.
20191 pub automation_id: std::string::String,
20192
20193 /// Required. The `Automation` to create.
20194 pub automation: std::option::Option<crate::model::Automation>,
20195
20196 /// Optional. A request ID to identify requests. Specify a unique request ID
20197 /// so that if you must retry your request, the server knows to ignore the
20198 /// request if it has already been completed. The server guarantees that for
20199 /// at least 60 minutes after the first request.
20200 ///
20201 /// For example, consider a situation where you make an initial request and the
20202 /// request times out. If you make the request again with the same request ID,
20203 /// the server can check if original operation with the same request ID was
20204 /// received, and if so, will ignore the second request. This prevents clients
20205 /// from accidentally creating duplicate commitments.
20206 ///
20207 /// The request ID must be a valid UUID with the exception that zero UUID is
20208 /// not supported (00000000-0000-0000-0000-000000000000).
20209 pub request_id: std::string::String,
20210
20211 /// Optional. If set to true, the request is validated and the user is provided
20212 /// with an expected result, but no actual change is made.
20213 pub validate_only: bool,
20214
20215 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20216}
20217
20218impl CreateAutomationRequest {
20219 /// Creates a new default instance.
20220 pub fn new() -> Self {
20221 std::default::Default::default()
20222 }
20223
20224 /// Sets the value of [parent][crate::model::CreateAutomationRequest::parent].
20225 ///
20226 /// # Example
20227 /// ```ignore,no_run
20228 /// # use google_cloud_deploy_v1::model::CreateAutomationRequest;
20229 /// # let project_id = "project_id";
20230 /// # let location_id = "location_id";
20231 /// # let delivery_pipeline_id = "delivery_pipeline_id";
20232 /// let x = CreateAutomationRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/deliveryPipelines/{delivery_pipeline_id}"));
20233 /// ```
20234 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20235 self.parent = v.into();
20236 self
20237 }
20238
20239 /// Sets the value of [automation_id][crate::model::CreateAutomationRequest::automation_id].
20240 ///
20241 /// # Example
20242 /// ```ignore,no_run
20243 /// # use google_cloud_deploy_v1::model::CreateAutomationRequest;
20244 /// let x = CreateAutomationRequest::new().set_automation_id("example");
20245 /// ```
20246 pub fn set_automation_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20247 self.automation_id = v.into();
20248 self
20249 }
20250
20251 /// Sets the value of [automation][crate::model::CreateAutomationRequest::automation].
20252 ///
20253 /// # Example
20254 /// ```ignore,no_run
20255 /// # use google_cloud_deploy_v1::model::CreateAutomationRequest;
20256 /// use google_cloud_deploy_v1::model::Automation;
20257 /// let x = CreateAutomationRequest::new().set_automation(Automation::default()/* use setters */);
20258 /// ```
20259 pub fn set_automation<T>(mut self, v: T) -> Self
20260 where
20261 T: std::convert::Into<crate::model::Automation>,
20262 {
20263 self.automation = std::option::Option::Some(v.into());
20264 self
20265 }
20266
20267 /// Sets or clears the value of [automation][crate::model::CreateAutomationRequest::automation].
20268 ///
20269 /// # Example
20270 /// ```ignore,no_run
20271 /// # use google_cloud_deploy_v1::model::CreateAutomationRequest;
20272 /// use google_cloud_deploy_v1::model::Automation;
20273 /// let x = CreateAutomationRequest::new().set_or_clear_automation(Some(Automation::default()/* use setters */));
20274 /// let x = CreateAutomationRequest::new().set_or_clear_automation(None::<Automation>);
20275 /// ```
20276 pub fn set_or_clear_automation<T>(mut self, v: std::option::Option<T>) -> Self
20277 where
20278 T: std::convert::Into<crate::model::Automation>,
20279 {
20280 self.automation = v.map(|x| x.into());
20281 self
20282 }
20283
20284 /// Sets the value of [request_id][crate::model::CreateAutomationRequest::request_id].
20285 ///
20286 /// # Example
20287 /// ```ignore,no_run
20288 /// # use google_cloud_deploy_v1::model::CreateAutomationRequest;
20289 /// let x = CreateAutomationRequest::new().set_request_id("example");
20290 /// ```
20291 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20292 self.request_id = v.into();
20293 self
20294 }
20295
20296 /// Sets the value of [validate_only][crate::model::CreateAutomationRequest::validate_only].
20297 ///
20298 /// # Example
20299 /// ```ignore,no_run
20300 /// # use google_cloud_deploy_v1::model::CreateAutomationRequest;
20301 /// let x = CreateAutomationRequest::new().set_validate_only(true);
20302 /// ```
20303 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
20304 self.validate_only = v.into();
20305 self
20306 }
20307}
20308
20309impl wkt::message::Message for CreateAutomationRequest {
20310 fn typename() -> &'static str {
20311 "type.googleapis.com/google.cloud.deploy.v1.CreateAutomationRequest"
20312 }
20313}
20314
20315/// The request object for `UpdateAutomation`.
20316#[derive(Clone, Default, PartialEq)]
20317#[non_exhaustive]
20318pub struct UpdateAutomationRequest {
20319 /// Required. Field mask is used to specify the fields to be overwritten by the
20320 /// update in the `Automation` resource. The fields specified in the
20321 /// update_mask are relative to the resource, not the full request. A field
20322 /// will be overwritten if it's in the mask. If the user doesn't provide a mask
20323 /// then all fields are overwritten.
20324 pub update_mask: std::option::Option<wkt::FieldMask>,
20325
20326 /// Required. The `Automation` to update.
20327 pub automation: std::option::Option<crate::model::Automation>,
20328
20329 /// Optional. A request ID to identify requests. Specify a unique request ID
20330 /// so that if you must retry your request, the server knows to ignore the
20331 /// request if it has already been completed. The server guarantees that for
20332 /// at least 60 minutes after the first request.
20333 ///
20334 /// For example, consider a situation where you make an initial request and the
20335 /// request times out. If you make the request again with the same request ID,
20336 /// the server can check if original operation with the same request ID was
20337 /// received, and if so, will ignore the second request. This prevents clients
20338 /// from accidentally creating duplicate commitments.
20339 ///
20340 /// The request ID must be a valid UUID with the exception that zero UUID is
20341 /// not supported (00000000-0000-0000-0000-000000000000).
20342 pub request_id: std::string::String,
20343
20344 /// Optional. If set to true, updating a `Automation` that does not exist will
20345 /// result in the creation of a new `Automation`.
20346 pub allow_missing: bool,
20347
20348 /// Optional. If set to true, the request is validated and the user is provided
20349 /// with an expected result, but no actual change is made.
20350 pub validate_only: bool,
20351
20352 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20353}
20354
20355impl UpdateAutomationRequest {
20356 /// Creates a new default instance.
20357 pub fn new() -> Self {
20358 std::default::Default::default()
20359 }
20360
20361 /// Sets the value of [update_mask][crate::model::UpdateAutomationRequest::update_mask].
20362 ///
20363 /// # Example
20364 /// ```ignore,no_run
20365 /// # use google_cloud_deploy_v1::model::UpdateAutomationRequest;
20366 /// use wkt::FieldMask;
20367 /// let x = UpdateAutomationRequest::new().set_update_mask(FieldMask::default()/* use setters */);
20368 /// ```
20369 pub fn set_update_mask<T>(mut self, v: T) -> Self
20370 where
20371 T: std::convert::Into<wkt::FieldMask>,
20372 {
20373 self.update_mask = std::option::Option::Some(v.into());
20374 self
20375 }
20376
20377 /// Sets or clears the value of [update_mask][crate::model::UpdateAutomationRequest::update_mask].
20378 ///
20379 /// # Example
20380 /// ```ignore,no_run
20381 /// # use google_cloud_deploy_v1::model::UpdateAutomationRequest;
20382 /// use wkt::FieldMask;
20383 /// let x = UpdateAutomationRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
20384 /// let x = UpdateAutomationRequest::new().set_or_clear_update_mask(None::<FieldMask>);
20385 /// ```
20386 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
20387 where
20388 T: std::convert::Into<wkt::FieldMask>,
20389 {
20390 self.update_mask = v.map(|x| x.into());
20391 self
20392 }
20393
20394 /// Sets the value of [automation][crate::model::UpdateAutomationRequest::automation].
20395 ///
20396 /// # Example
20397 /// ```ignore,no_run
20398 /// # use google_cloud_deploy_v1::model::UpdateAutomationRequest;
20399 /// use google_cloud_deploy_v1::model::Automation;
20400 /// let x = UpdateAutomationRequest::new().set_automation(Automation::default()/* use setters */);
20401 /// ```
20402 pub fn set_automation<T>(mut self, v: T) -> Self
20403 where
20404 T: std::convert::Into<crate::model::Automation>,
20405 {
20406 self.automation = std::option::Option::Some(v.into());
20407 self
20408 }
20409
20410 /// Sets or clears the value of [automation][crate::model::UpdateAutomationRequest::automation].
20411 ///
20412 /// # Example
20413 /// ```ignore,no_run
20414 /// # use google_cloud_deploy_v1::model::UpdateAutomationRequest;
20415 /// use google_cloud_deploy_v1::model::Automation;
20416 /// let x = UpdateAutomationRequest::new().set_or_clear_automation(Some(Automation::default()/* use setters */));
20417 /// let x = UpdateAutomationRequest::new().set_or_clear_automation(None::<Automation>);
20418 /// ```
20419 pub fn set_or_clear_automation<T>(mut self, v: std::option::Option<T>) -> Self
20420 where
20421 T: std::convert::Into<crate::model::Automation>,
20422 {
20423 self.automation = v.map(|x| x.into());
20424 self
20425 }
20426
20427 /// Sets the value of [request_id][crate::model::UpdateAutomationRequest::request_id].
20428 ///
20429 /// # Example
20430 /// ```ignore,no_run
20431 /// # use google_cloud_deploy_v1::model::UpdateAutomationRequest;
20432 /// let x = UpdateAutomationRequest::new().set_request_id("example");
20433 /// ```
20434 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20435 self.request_id = v.into();
20436 self
20437 }
20438
20439 /// Sets the value of [allow_missing][crate::model::UpdateAutomationRequest::allow_missing].
20440 ///
20441 /// # Example
20442 /// ```ignore,no_run
20443 /// # use google_cloud_deploy_v1::model::UpdateAutomationRequest;
20444 /// let x = UpdateAutomationRequest::new().set_allow_missing(true);
20445 /// ```
20446 pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
20447 self.allow_missing = v.into();
20448 self
20449 }
20450
20451 /// Sets the value of [validate_only][crate::model::UpdateAutomationRequest::validate_only].
20452 ///
20453 /// # Example
20454 /// ```ignore,no_run
20455 /// # use google_cloud_deploy_v1::model::UpdateAutomationRequest;
20456 /// let x = UpdateAutomationRequest::new().set_validate_only(true);
20457 /// ```
20458 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
20459 self.validate_only = v.into();
20460 self
20461 }
20462}
20463
20464impl wkt::message::Message for UpdateAutomationRequest {
20465 fn typename() -> &'static str {
20466 "type.googleapis.com/google.cloud.deploy.v1.UpdateAutomationRequest"
20467 }
20468}
20469
20470/// The request object for `DeleteAutomation`.
20471#[derive(Clone, Default, PartialEq)]
20472#[non_exhaustive]
20473pub struct DeleteAutomationRequest {
20474 /// Required. The name of the `Automation` to delete. The format is
20475 /// `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/automations/{automation_name}`.
20476 pub name: std::string::String,
20477
20478 /// Optional. A request ID to identify requests. Specify a unique request ID
20479 /// so that if you must retry your request, the server knows to ignore the
20480 /// request if it has already been completed. The server guarantees that for
20481 /// at least 60 minutes after the first request.
20482 ///
20483 /// For example, consider a situation where you make an initial request and the
20484 /// request times out. If you make the request again with the same request ID,
20485 /// the server can check if original operation with the same request ID was
20486 /// received, and if so, will ignore the second request. This prevents clients
20487 /// from accidentally creating duplicate commitments.
20488 ///
20489 /// The request ID must be a valid UUID with the exception that zero UUID is
20490 /// not supported (00000000-0000-0000-0000-000000000000).
20491 pub request_id: std::string::String,
20492
20493 /// Optional. If set to true, then deleting an already deleted or non-existing
20494 /// `Automation` will succeed.
20495 pub allow_missing: bool,
20496
20497 /// Optional. If set, validate the request and verify whether the resource
20498 /// exists, but do not actually post it.
20499 pub validate_only: bool,
20500
20501 /// Optional. The weak etag of the request.
20502 /// This checksum is computed by the server based on the value of other
20503 /// fields, and may be sent on update and delete requests to ensure the
20504 /// client has an up-to-date value before proceeding.
20505 pub etag: std::string::String,
20506
20507 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20508}
20509
20510impl DeleteAutomationRequest {
20511 /// Creates a new default instance.
20512 pub fn new() -> Self {
20513 std::default::Default::default()
20514 }
20515
20516 /// Sets the value of [name][crate::model::DeleteAutomationRequest::name].
20517 ///
20518 /// # Example
20519 /// ```ignore,no_run
20520 /// # use google_cloud_deploy_v1::model::DeleteAutomationRequest;
20521 /// # let project_id = "project_id";
20522 /// # let location_id = "location_id";
20523 /// # let delivery_pipeline_id = "delivery_pipeline_id";
20524 /// # let automation_id = "automation_id";
20525 /// let x = DeleteAutomationRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/deliveryPipelines/{delivery_pipeline_id}/automations/{automation_id}"));
20526 /// ```
20527 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20528 self.name = v.into();
20529 self
20530 }
20531
20532 /// Sets the value of [request_id][crate::model::DeleteAutomationRequest::request_id].
20533 ///
20534 /// # Example
20535 /// ```ignore,no_run
20536 /// # use google_cloud_deploy_v1::model::DeleteAutomationRequest;
20537 /// let x = DeleteAutomationRequest::new().set_request_id("example");
20538 /// ```
20539 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20540 self.request_id = v.into();
20541 self
20542 }
20543
20544 /// Sets the value of [allow_missing][crate::model::DeleteAutomationRequest::allow_missing].
20545 ///
20546 /// # Example
20547 /// ```ignore,no_run
20548 /// # use google_cloud_deploy_v1::model::DeleteAutomationRequest;
20549 /// let x = DeleteAutomationRequest::new().set_allow_missing(true);
20550 /// ```
20551 pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
20552 self.allow_missing = v.into();
20553 self
20554 }
20555
20556 /// Sets the value of [validate_only][crate::model::DeleteAutomationRequest::validate_only].
20557 ///
20558 /// # Example
20559 /// ```ignore,no_run
20560 /// # use google_cloud_deploy_v1::model::DeleteAutomationRequest;
20561 /// let x = DeleteAutomationRequest::new().set_validate_only(true);
20562 /// ```
20563 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
20564 self.validate_only = v.into();
20565 self
20566 }
20567
20568 /// Sets the value of [etag][crate::model::DeleteAutomationRequest::etag].
20569 ///
20570 /// # Example
20571 /// ```ignore,no_run
20572 /// # use google_cloud_deploy_v1::model::DeleteAutomationRequest;
20573 /// let x = DeleteAutomationRequest::new().set_etag("example");
20574 /// ```
20575 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20576 self.etag = v.into();
20577 self
20578 }
20579}
20580
20581impl wkt::message::Message for DeleteAutomationRequest {
20582 fn typename() -> &'static str {
20583 "type.googleapis.com/google.cloud.deploy.v1.DeleteAutomationRequest"
20584 }
20585}
20586
20587/// The request object for `ListAutomations`.
20588#[derive(Clone, Default, PartialEq)]
20589#[non_exhaustive]
20590pub struct ListAutomationsRequest {
20591 /// Required. The parent `Delivery Pipeline`, which owns this collection of
20592 /// automations. Format must be
20593 /// `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}`.
20594 pub parent: std::string::String,
20595
20596 /// The maximum number of automations to return. The service may return
20597 /// fewer than this value. If unspecified, at most 50 automations will
20598 /// be returned. The maximum value is 1000; values above 1000 will be set
20599 /// to 1000.
20600 pub page_size: i32,
20601
20602 /// A page token, received from a previous `ListAutomations` call.
20603 /// Provide this to retrieve the subsequent page.
20604 ///
20605 /// When paginating, all other provided parameters match
20606 /// the call that provided the page token.
20607 pub page_token: std::string::String,
20608
20609 /// Filter automations to be returned. All fields can be used in the
20610 /// filter.
20611 pub filter: std::string::String,
20612
20613 /// Field to sort by.
20614 pub order_by: std::string::String,
20615
20616 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20617}
20618
20619impl ListAutomationsRequest {
20620 /// Creates a new default instance.
20621 pub fn new() -> Self {
20622 std::default::Default::default()
20623 }
20624
20625 /// Sets the value of [parent][crate::model::ListAutomationsRequest::parent].
20626 ///
20627 /// # Example
20628 /// ```ignore,no_run
20629 /// # use google_cloud_deploy_v1::model::ListAutomationsRequest;
20630 /// # let project_id = "project_id";
20631 /// # let location_id = "location_id";
20632 /// # let delivery_pipeline_id = "delivery_pipeline_id";
20633 /// let x = ListAutomationsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/deliveryPipelines/{delivery_pipeline_id}"));
20634 /// ```
20635 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20636 self.parent = v.into();
20637 self
20638 }
20639
20640 /// Sets the value of [page_size][crate::model::ListAutomationsRequest::page_size].
20641 ///
20642 /// # Example
20643 /// ```ignore,no_run
20644 /// # use google_cloud_deploy_v1::model::ListAutomationsRequest;
20645 /// let x = ListAutomationsRequest::new().set_page_size(42);
20646 /// ```
20647 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
20648 self.page_size = v.into();
20649 self
20650 }
20651
20652 /// Sets the value of [page_token][crate::model::ListAutomationsRequest::page_token].
20653 ///
20654 /// # Example
20655 /// ```ignore,no_run
20656 /// # use google_cloud_deploy_v1::model::ListAutomationsRequest;
20657 /// let x = ListAutomationsRequest::new().set_page_token("example");
20658 /// ```
20659 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20660 self.page_token = v.into();
20661 self
20662 }
20663
20664 /// Sets the value of [filter][crate::model::ListAutomationsRequest::filter].
20665 ///
20666 /// # Example
20667 /// ```ignore,no_run
20668 /// # use google_cloud_deploy_v1::model::ListAutomationsRequest;
20669 /// let x = ListAutomationsRequest::new().set_filter("example");
20670 /// ```
20671 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20672 self.filter = v.into();
20673 self
20674 }
20675
20676 /// Sets the value of [order_by][crate::model::ListAutomationsRequest::order_by].
20677 ///
20678 /// # Example
20679 /// ```ignore,no_run
20680 /// # use google_cloud_deploy_v1::model::ListAutomationsRequest;
20681 /// let x = ListAutomationsRequest::new().set_order_by("example");
20682 /// ```
20683 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20684 self.order_by = v.into();
20685 self
20686 }
20687}
20688
20689impl wkt::message::Message for ListAutomationsRequest {
20690 fn typename() -> &'static str {
20691 "type.googleapis.com/google.cloud.deploy.v1.ListAutomationsRequest"
20692 }
20693}
20694
20695/// The response object from `ListAutomations`.
20696#[derive(Clone, Default, PartialEq)]
20697#[non_exhaustive]
20698pub struct ListAutomationsResponse {
20699 /// The `Automation` objects.
20700 pub automations: std::vec::Vec<crate::model::Automation>,
20701
20702 /// A token, which can be sent as `page_token` to retrieve the next page.
20703 /// If this field is omitted, there are no subsequent pages.
20704 pub next_page_token: std::string::String,
20705
20706 /// Locations that could not be reached.
20707 pub unreachable: std::vec::Vec<std::string::String>,
20708
20709 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20710}
20711
20712impl ListAutomationsResponse {
20713 /// Creates a new default instance.
20714 pub fn new() -> Self {
20715 std::default::Default::default()
20716 }
20717
20718 /// Sets the value of [automations][crate::model::ListAutomationsResponse::automations].
20719 ///
20720 /// # Example
20721 /// ```ignore,no_run
20722 /// # use google_cloud_deploy_v1::model::ListAutomationsResponse;
20723 /// use google_cloud_deploy_v1::model::Automation;
20724 /// let x = ListAutomationsResponse::new()
20725 /// .set_automations([
20726 /// Automation::default()/* use setters */,
20727 /// Automation::default()/* use (different) setters */,
20728 /// ]);
20729 /// ```
20730 pub fn set_automations<T, V>(mut self, v: T) -> Self
20731 where
20732 T: std::iter::IntoIterator<Item = V>,
20733 V: std::convert::Into<crate::model::Automation>,
20734 {
20735 use std::iter::Iterator;
20736 self.automations = v.into_iter().map(|i| i.into()).collect();
20737 self
20738 }
20739
20740 /// Sets the value of [next_page_token][crate::model::ListAutomationsResponse::next_page_token].
20741 ///
20742 /// # Example
20743 /// ```ignore,no_run
20744 /// # use google_cloud_deploy_v1::model::ListAutomationsResponse;
20745 /// let x = ListAutomationsResponse::new().set_next_page_token("example");
20746 /// ```
20747 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20748 self.next_page_token = v.into();
20749 self
20750 }
20751
20752 /// Sets the value of [unreachable][crate::model::ListAutomationsResponse::unreachable].
20753 ///
20754 /// # Example
20755 /// ```ignore,no_run
20756 /// # use google_cloud_deploy_v1::model::ListAutomationsResponse;
20757 /// let x = ListAutomationsResponse::new().set_unreachable(["a", "b", "c"]);
20758 /// ```
20759 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
20760 where
20761 T: std::iter::IntoIterator<Item = V>,
20762 V: std::convert::Into<std::string::String>,
20763 {
20764 use std::iter::Iterator;
20765 self.unreachable = v.into_iter().map(|i| i.into()).collect();
20766 self
20767 }
20768}
20769
20770impl wkt::message::Message for ListAutomationsResponse {
20771 fn typename() -> &'static str {
20772 "type.googleapis.com/google.cloud.deploy.v1.ListAutomationsResponse"
20773 }
20774}
20775
20776#[doc(hidden)]
20777impl google_cloud_gax::paginator::internal::PageableResponse for ListAutomationsResponse {
20778 type PageItem = crate::model::Automation;
20779
20780 fn items(self) -> std::vec::Vec<Self::PageItem> {
20781 self.automations
20782 }
20783
20784 fn next_page_token(&self) -> std::string::String {
20785 use std::clone::Clone;
20786 self.next_page_token.clone()
20787 }
20788}
20789
20790/// The request object for `GetAutomation`
20791#[derive(Clone, Default, PartialEq)]
20792#[non_exhaustive]
20793pub struct GetAutomationRequest {
20794 /// Required. Name of the `Automation`. Format must be
20795 /// `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/automations/{automation_name}`.
20796 pub name: std::string::String,
20797
20798 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20799}
20800
20801impl GetAutomationRequest {
20802 /// Creates a new default instance.
20803 pub fn new() -> Self {
20804 std::default::Default::default()
20805 }
20806
20807 /// Sets the value of [name][crate::model::GetAutomationRequest::name].
20808 ///
20809 /// # Example
20810 /// ```ignore,no_run
20811 /// # use google_cloud_deploy_v1::model::GetAutomationRequest;
20812 /// # let project_id = "project_id";
20813 /// # let location_id = "location_id";
20814 /// # let delivery_pipeline_id = "delivery_pipeline_id";
20815 /// # let automation_id = "automation_id";
20816 /// let x = GetAutomationRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/deliveryPipelines/{delivery_pipeline_id}/automations/{automation_id}"));
20817 /// ```
20818 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20819 self.name = v.into();
20820 self
20821 }
20822}
20823
20824impl wkt::message::Message for GetAutomationRequest {
20825 fn typename() -> &'static str {
20826 "type.googleapis.com/google.cloud.deploy.v1.GetAutomationRequest"
20827 }
20828}
20829
20830/// An `AutomationRun` resource in the Cloud Deploy API.
20831///
20832/// An `AutomationRun` represents an execution instance of an
20833/// automation rule.
20834#[derive(Clone, Default, PartialEq)]
20835#[non_exhaustive]
20836pub struct AutomationRun {
20837 /// Output only. Name of the `AutomationRun`. Format is
20838 /// `projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/automationRuns/{automation_run}`.
20839 pub name: std::string::String,
20840
20841 /// Output only. Time at which the `AutomationRun` was created.
20842 pub create_time: std::option::Option<wkt::Timestamp>,
20843
20844 /// Output only. Time at which the automationRun was updated.
20845 pub update_time: std::option::Option<wkt::Timestamp>,
20846
20847 /// Output only. The weak etag of the `AutomationRun` resource.
20848 /// This checksum is computed by the server based on the value of other
20849 /// fields, and may be sent on update and delete requests to ensure the
20850 /// client has an up-to-date value before proceeding.
20851 pub etag: std::string::String,
20852
20853 /// Output only. Email address of the user-managed IAM service account that
20854 /// performs the operations against Cloud Deploy resources.
20855 pub service_account: std::string::String,
20856
20857 /// Output only. Snapshot of the Automation taken at AutomationRun creation
20858 /// time.
20859 pub automation_snapshot: std::option::Option<crate::model::Automation>,
20860
20861 /// Output only. The ID of the source target that initiates the
20862 /// `AutomationRun`. The value of this field is the last segment of a target
20863 /// name.
20864 pub target_id: std::string::String,
20865
20866 /// Output only. Current state of the `AutomationRun`.
20867 pub state: crate::model::automation_run::State,
20868
20869 /// Output only. Explains the current state of the `AutomationRun`. Present
20870 /// only when an explanation is needed.
20871 pub state_description: std::string::String,
20872
20873 /// Output only. Contains information about what policies prevented the
20874 /// `AutomationRun` from proceeding.
20875 pub policy_violation: std::option::Option<crate::model::PolicyViolation>,
20876
20877 /// Output only. Time the `AutomationRun` expires. An `AutomationRun` expires
20878 /// after 14 days from its creation date.
20879 pub expire_time: std::option::Option<wkt::Timestamp>,
20880
20881 /// Output only. The ID of the automation rule that initiated the operation.
20882 pub rule_id: std::string::String,
20883
20884 /// Output only. The ID of the automation that initiated the operation.
20885 pub automation_id: std::string::String,
20886
20887 /// Output only. Earliest time the `AutomationRun` will attempt to resume.
20888 /// Wait-time is configured by `wait` in automation rule.
20889 pub wait_until_time: std::option::Option<wkt::Timestamp>,
20890
20891 /// The operation that the `AutomationRun` will perform.
20892 pub operation: std::option::Option<crate::model::automation_run::Operation>,
20893
20894 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20895}
20896
20897impl AutomationRun {
20898 /// Creates a new default instance.
20899 pub fn new() -> Self {
20900 std::default::Default::default()
20901 }
20902
20903 /// Sets the value of [name][crate::model::AutomationRun::name].
20904 ///
20905 /// # Example
20906 /// ```ignore,no_run
20907 /// # use google_cloud_deploy_v1::model::AutomationRun;
20908 /// # let project_id = "project_id";
20909 /// # let location_id = "location_id";
20910 /// # let delivery_pipeline_id = "delivery_pipeline_id";
20911 /// # let automation_run_id = "automation_run_id";
20912 /// let x = AutomationRun::new().set_name(format!("projects/{project_id}/locations/{location_id}/deliveryPipelines/{delivery_pipeline_id}/automationRuns/{automation_run_id}"));
20913 /// ```
20914 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20915 self.name = v.into();
20916 self
20917 }
20918
20919 /// Sets the value of [create_time][crate::model::AutomationRun::create_time].
20920 ///
20921 /// # Example
20922 /// ```ignore,no_run
20923 /// # use google_cloud_deploy_v1::model::AutomationRun;
20924 /// use wkt::Timestamp;
20925 /// let x = AutomationRun::new().set_create_time(Timestamp::default()/* use setters */);
20926 /// ```
20927 pub fn set_create_time<T>(mut self, v: T) -> Self
20928 where
20929 T: std::convert::Into<wkt::Timestamp>,
20930 {
20931 self.create_time = std::option::Option::Some(v.into());
20932 self
20933 }
20934
20935 /// Sets or clears the value of [create_time][crate::model::AutomationRun::create_time].
20936 ///
20937 /// # Example
20938 /// ```ignore,no_run
20939 /// # use google_cloud_deploy_v1::model::AutomationRun;
20940 /// use wkt::Timestamp;
20941 /// let x = AutomationRun::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
20942 /// let x = AutomationRun::new().set_or_clear_create_time(None::<Timestamp>);
20943 /// ```
20944 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
20945 where
20946 T: std::convert::Into<wkt::Timestamp>,
20947 {
20948 self.create_time = v.map(|x| x.into());
20949 self
20950 }
20951
20952 /// Sets the value of [update_time][crate::model::AutomationRun::update_time].
20953 ///
20954 /// # Example
20955 /// ```ignore,no_run
20956 /// # use google_cloud_deploy_v1::model::AutomationRun;
20957 /// use wkt::Timestamp;
20958 /// let x = AutomationRun::new().set_update_time(Timestamp::default()/* use setters */);
20959 /// ```
20960 pub fn set_update_time<T>(mut self, v: T) -> Self
20961 where
20962 T: std::convert::Into<wkt::Timestamp>,
20963 {
20964 self.update_time = std::option::Option::Some(v.into());
20965 self
20966 }
20967
20968 /// Sets or clears the value of [update_time][crate::model::AutomationRun::update_time].
20969 ///
20970 /// # Example
20971 /// ```ignore,no_run
20972 /// # use google_cloud_deploy_v1::model::AutomationRun;
20973 /// use wkt::Timestamp;
20974 /// let x = AutomationRun::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
20975 /// let x = AutomationRun::new().set_or_clear_update_time(None::<Timestamp>);
20976 /// ```
20977 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
20978 where
20979 T: std::convert::Into<wkt::Timestamp>,
20980 {
20981 self.update_time = v.map(|x| x.into());
20982 self
20983 }
20984
20985 /// Sets the value of [etag][crate::model::AutomationRun::etag].
20986 ///
20987 /// # Example
20988 /// ```ignore,no_run
20989 /// # use google_cloud_deploy_v1::model::AutomationRun;
20990 /// let x = AutomationRun::new().set_etag("example");
20991 /// ```
20992 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20993 self.etag = v.into();
20994 self
20995 }
20996
20997 /// Sets the value of [service_account][crate::model::AutomationRun::service_account].
20998 ///
20999 /// # Example
21000 /// ```ignore,no_run
21001 /// # use google_cloud_deploy_v1::model::AutomationRun;
21002 /// let x = AutomationRun::new().set_service_account("example");
21003 /// ```
21004 pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21005 self.service_account = v.into();
21006 self
21007 }
21008
21009 /// Sets the value of [automation_snapshot][crate::model::AutomationRun::automation_snapshot].
21010 ///
21011 /// # Example
21012 /// ```ignore,no_run
21013 /// # use google_cloud_deploy_v1::model::AutomationRun;
21014 /// use google_cloud_deploy_v1::model::Automation;
21015 /// let x = AutomationRun::new().set_automation_snapshot(Automation::default()/* use setters */);
21016 /// ```
21017 pub fn set_automation_snapshot<T>(mut self, v: T) -> Self
21018 where
21019 T: std::convert::Into<crate::model::Automation>,
21020 {
21021 self.automation_snapshot = std::option::Option::Some(v.into());
21022 self
21023 }
21024
21025 /// Sets or clears the value of [automation_snapshot][crate::model::AutomationRun::automation_snapshot].
21026 ///
21027 /// # Example
21028 /// ```ignore,no_run
21029 /// # use google_cloud_deploy_v1::model::AutomationRun;
21030 /// use google_cloud_deploy_v1::model::Automation;
21031 /// let x = AutomationRun::new().set_or_clear_automation_snapshot(Some(Automation::default()/* use setters */));
21032 /// let x = AutomationRun::new().set_or_clear_automation_snapshot(None::<Automation>);
21033 /// ```
21034 pub fn set_or_clear_automation_snapshot<T>(mut self, v: std::option::Option<T>) -> Self
21035 where
21036 T: std::convert::Into<crate::model::Automation>,
21037 {
21038 self.automation_snapshot = v.map(|x| x.into());
21039 self
21040 }
21041
21042 /// Sets the value of [target_id][crate::model::AutomationRun::target_id].
21043 ///
21044 /// # Example
21045 /// ```ignore,no_run
21046 /// # use google_cloud_deploy_v1::model::AutomationRun;
21047 /// let x = AutomationRun::new().set_target_id("example");
21048 /// ```
21049 pub fn set_target_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21050 self.target_id = v.into();
21051 self
21052 }
21053
21054 /// Sets the value of [state][crate::model::AutomationRun::state].
21055 ///
21056 /// # Example
21057 /// ```ignore,no_run
21058 /// # use google_cloud_deploy_v1::model::AutomationRun;
21059 /// use google_cloud_deploy_v1::model::automation_run::State;
21060 /// let x0 = AutomationRun::new().set_state(State::Succeeded);
21061 /// let x1 = AutomationRun::new().set_state(State::Cancelled);
21062 /// let x2 = AutomationRun::new().set_state(State::Failed);
21063 /// ```
21064 pub fn set_state<T: std::convert::Into<crate::model::automation_run::State>>(
21065 mut self,
21066 v: T,
21067 ) -> Self {
21068 self.state = v.into();
21069 self
21070 }
21071
21072 /// Sets the value of [state_description][crate::model::AutomationRun::state_description].
21073 ///
21074 /// # Example
21075 /// ```ignore,no_run
21076 /// # use google_cloud_deploy_v1::model::AutomationRun;
21077 /// let x = AutomationRun::new().set_state_description("example");
21078 /// ```
21079 pub fn set_state_description<T: std::convert::Into<std::string::String>>(
21080 mut self,
21081 v: T,
21082 ) -> Self {
21083 self.state_description = v.into();
21084 self
21085 }
21086
21087 /// Sets the value of [policy_violation][crate::model::AutomationRun::policy_violation].
21088 ///
21089 /// # Example
21090 /// ```ignore,no_run
21091 /// # use google_cloud_deploy_v1::model::AutomationRun;
21092 /// use google_cloud_deploy_v1::model::PolicyViolation;
21093 /// let x = AutomationRun::new().set_policy_violation(PolicyViolation::default()/* use setters */);
21094 /// ```
21095 pub fn set_policy_violation<T>(mut self, v: T) -> Self
21096 where
21097 T: std::convert::Into<crate::model::PolicyViolation>,
21098 {
21099 self.policy_violation = std::option::Option::Some(v.into());
21100 self
21101 }
21102
21103 /// Sets or clears the value of [policy_violation][crate::model::AutomationRun::policy_violation].
21104 ///
21105 /// # Example
21106 /// ```ignore,no_run
21107 /// # use google_cloud_deploy_v1::model::AutomationRun;
21108 /// use google_cloud_deploy_v1::model::PolicyViolation;
21109 /// let x = AutomationRun::new().set_or_clear_policy_violation(Some(PolicyViolation::default()/* use setters */));
21110 /// let x = AutomationRun::new().set_or_clear_policy_violation(None::<PolicyViolation>);
21111 /// ```
21112 pub fn set_or_clear_policy_violation<T>(mut self, v: std::option::Option<T>) -> Self
21113 where
21114 T: std::convert::Into<crate::model::PolicyViolation>,
21115 {
21116 self.policy_violation = v.map(|x| x.into());
21117 self
21118 }
21119
21120 /// Sets the value of [expire_time][crate::model::AutomationRun::expire_time].
21121 ///
21122 /// # Example
21123 /// ```ignore,no_run
21124 /// # use google_cloud_deploy_v1::model::AutomationRun;
21125 /// use wkt::Timestamp;
21126 /// let x = AutomationRun::new().set_expire_time(Timestamp::default()/* use setters */);
21127 /// ```
21128 pub fn set_expire_time<T>(mut self, v: T) -> Self
21129 where
21130 T: std::convert::Into<wkt::Timestamp>,
21131 {
21132 self.expire_time = std::option::Option::Some(v.into());
21133 self
21134 }
21135
21136 /// Sets or clears the value of [expire_time][crate::model::AutomationRun::expire_time].
21137 ///
21138 /// # Example
21139 /// ```ignore,no_run
21140 /// # use google_cloud_deploy_v1::model::AutomationRun;
21141 /// use wkt::Timestamp;
21142 /// let x = AutomationRun::new().set_or_clear_expire_time(Some(Timestamp::default()/* use setters */));
21143 /// let x = AutomationRun::new().set_or_clear_expire_time(None::<Timestamp>);
21144 /// ```
21145 pub fn set_or_clear_expire_time<T>(mut self, v: std::option::Option<T>) -> Self
21146 where
21147 T: std::convert::Into<wkt::Timestamp>,
21148 {
21149 self.expire_time = v.map(|x| x.into());
21150 self
21151 }
21152
21153 /// Sets the value of [rule_id][crate::model::AutomationRun::rule_id].
21154 ///
21155 /// # Example
21156 /// ```ignore,no_run
21157 /// # use google_cloud_deploy_v1::model::AutomationRun;
21158 /// let x = AutomationRun::new().set_rule_id("example");
21159 /// ```
21160 pub fn set_rule_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21161 self.rule_id = v.into();
21162 self
21163 }
21164
21165 /// Sets the value of [automation_id][crate::model::AutomationRun::automation_id].
21166 ///
21167 /// # Example
21168 /// ```ignore,no_run
21169 /// # use google_cloud_deploy_v1::model::AutomationRun;
21170 /// let x = AutomationRun::new().set_automation_id("example");
21171 /// ```
21172 pub fn set_automation_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21173 self.automation_id = v.into();
21174 self
21175 }
21176
21177 /// Sets the value of [wait_until_time][crate::model::AutomationRun::wait_until_time].
21178 ///
21179 /// # Example
21180 /// ```ignore,no_run
21181 /// # use google_cloud_deploy_v1::model::AutomationRun;
21182 /// use wkt::Timestamp;
21183 /// let x = AutomationRun::new().set_wait_until_time(Timestamp::default()/* use setters */);
21184 /// ```
21185 pub fn set_wait_until_time<T>(mut self, v: T) -> Self
21186 where
21187 T: std::convert::Into<wkt::Timestamp>,
21188 {
21189 self.wait_until_time = std::option::Option::Some(v.into());
21190 self
21191 }
21192
21193 /// Sets or clears the value of [wait_until_time][crate::model::AutomationRun::wait_until_time].
21194 ///
21195 /// # Example
21196 /// ```ignore,no_run
21197 /// # use google_cloud_deploy_v1::model::AutomationRun;
21198 /// use wkt::Timestamp;
21199 /// let x = AutomationRun::new().set_or_clear_wait_until_time(Some(Timestamp::default()/* use setters */));
21200 /// let x = AutomationRun::new().set_or_clear_wait_until_time(None::<Timestamp>);
21201 /// ```
21202 pub fn set_or_clear_wait_until_time<T>(mut self, v: std::option::Option<T>) -> Self
21203 where
21204 T: std::convert::Into<wkt::Timestamp>,
21205 {
21206 self.wait_until_time = v.map(|x| x.into());
21207 self
21208 }
21209
21210 /// Sets the value of [operation][crate::model::AutomationRun::operation].
21211 ///
21212 /// Note that all the setters affecting `operation` are mutually
21213 /// exclusive.
21214 ///
21215 /// # Example
21216 /// ```ignore,no_run
21217 /// # use google_cloud_deploy_v1::model::AutomationRun;
21218 /// use google_cloud_deploy_v1::model::PromoteReleaseOperation;
21219 /// let x = AutomationRun::new().set_operation(Some(
21220 /// google_cloud_deploy_v1::model::automation_run::Operation::PromoteReleaseOperation(PromoteReleaseOperation::default().into())));
21221 /// ```
21222 pub fn set_operation<
21223 T: std::convert::Into<std::option::Option<crate::model::automation_run::Operation>>,
21224 >(
21225 mut self,
21226 v: T,
21227 ) -> Self {
21228 self.operation = v.into();
21229 self
21230 }
21231
21232 /// The value of [operation][crate::model::AutomationRun::operation]
21233 /// if it holds a `PromoteReleaseOperation`, `None` if the field is not set or
21234 /// holds a different branch.
21235 pub fn promote_release_operation(
21236 &self,
21237 ) -> std::option::Option<&std::boxed::Box<crate::model::PromoteReleaseOperation>> {
21238 #[allow(unreachable_patterns)]
21239 self.operation.as_ref().and_then(|v| match v {
21240 crate::model::automation_run::Operation::PromoteReleaseOperation(v) => {
21241 std::option::Option::Some(v)
21242 }
21243 _ => std::option::Option::None,
21244 })
21245 }
21246
21247 /// Sets the value of [operation][crate::model::AutomationRun::operation]
21248 /// to hold a `PromoteReleaseOperation`.
21249 ///
21250 /// Note that all the setters affecting `operation` are
21251 /// mutually exclusive.
21252 ///
21253 /// # Example
21254 /// ```ignore,no_run
21255 /// # use google_cloud_deploy_v1::model::AutomationRun;
21256 /// use google_cloud_deploy_v1::model::PromoteReleaseOperation;
21257 /// let x = AutomationRun::new().set_promote_release_operation(PromoteReleaseOperation::default()/* use setters */);
21258 /// assert!(x.promote_release_operation().is_some());
21259 /// assert!(x.advance_rollout_operation().is_none());
21260 /// assert!(x.repair_rollout_operation().is_none());
21261 /// assert!(x.timed_promote_release_operation().is_none());
21262 /// ```
21263 pub fn set_promote_release_operation<
21264 T: std::convert::Into<std::boxed::Box<crate::model::PromoteReleaseOperation>>,
21265 >(
21266 mut self,
21267 v: T,
21268 ) -> Self {
21269 self.operation = std::option::Option::Some(
21270 crate::model::automation_run::Operation::PromoteReleaseOperation(v.into()),
21271 );
21272 self
21273 }
21274
21275 /// The value of [operation][crate::model::AutomationRun::operation]
21276 /// if it holds a `AdvanceRolloutOperation`, `None` if the field is not set or
21277 /// holds a different branch.
21278 pub fn advance_rollout_operation(
21279 &self,
21280 ) -> std::option::Option<&std::boxed::Box<crate::model::AdvanceRolloutOperation>> {
21281 #[allow(unreachable_patterns)]
21282 self.operation.as_ref().and_then(|v| match v {
21283 crate::model::automation_run::Operation::AdvanceRolloutOperation(v) => {
21284 std::option::Option::Some(v)
21285 }
21286 _ => std::option::Option::None,
21287 })
21288 }
21289
21290 /// Sets the value of [operation][crate::model::AutomationRun::operation]
21291 /// to hold a `AdvanceRolloutOperation`.
21292 ///
21293 /// Note that all the setters affecting `operation` are
21294 /// mutually exclusive.
21295 ///
21296 /// # Example
21297 /// ```ignore,no_run
21298 /// # use google_cloud_deploy_v1::model::AutomationRun;
21299 /// use google_cloud_deploy_v1::model::AdvanceRolloutOperation;
21300 /// let x = AutomationRun::new().set_advance_rollout_operation(AdvanceRolloutOperation::default()/* use setters */);
21301 /// assert!(x.advance_rollout_operation().is_some());
21302 /// assert!(x.promote_release_operation().is_none());
21303 /// assert!(x.repair_rollout_operation().is_none());
21304 /// assert!(x.timed_promote_release_operation().is_none());
21305 /// ```
21306 pub fn set_advance_rollout_operation<
21307 T: std::convert::Into<std::boxed::Box<crate::model::AdvanceRolloutOperation>>,
21308 >(
21309 mut self,
21310 v: T,
21311 ) -> Self {
21312 self.operation = std::option::Option::Some(
21313 crate::model::automation_run::Operation::AdvanceRolloutOperation(v.into()),
21314 );
21315 self
21316 }
21317
21318 /// The value of [operation][crate::model::AutomationRun::operation]
21319 /// if it holds a `RepairRolloutOperation`, `None` if the field is not set or
21320 /// holds a different branch.
21321 pub fn repair_rollout_operation(
21322 &self,
21323 ) -> std::option::Option<&std::boxed::Box<crate::model::RepairRolloutOperation>> {
21324 #[allow(unreachable_patterns)]
21325 self.operation.as_ref().and_then(|v| match v {
21326 crate::model::automation_run::Operation::RepairRolloutOperation(v) => {
21327 std::option::Option::Some(v)
21328 }
21329 _ => std::option::Option::None,
21330 })
21331 }
21332
21333 /// Sets the value of [operation][crate::model::AutomationRun::operation]
21334 /// to hold a `RepairRolloutOperation`.
21335 ///
21336 /// Note that all the setters affecting `operation` are
21337 /// mutually exclusive.
21338 ///
21339 /// # Example
21340 /// ```ignore,no_run
21341 /// # use google_cloud_deploy_v1::model::AutomationRun;
21342 /// use google_cloud_deploy_v1::model::RepairRolloutOperation;
21343 /// let x = AutomationRun::new().set_repair_rollout_operation(RepairRolloutOperation::default()/* use setters */);
21344 /// assert!(x.repair_rollout_operation().is_some());
21345 /// assert!(x.promote_release_operation().is_none());
21346 /// assert!(x.advance_rollout_operation().is_none());
21347 /// assert!(x.timed_promote_release_operation().is_none());
21348 /// ```
21349 pub fn set_repair_rollout_operation<
21350 T: std::convert::Into<std::boxed::Box<crate::model::RepairRolloutOperation>>,
21351 >(
21352 mut self,
21353 v: T,
21354 ) -> Self {
21355 self.operation = std::option::Option::Some(
21356 crate::model::automation_run::Operation::RepairRolloutOperation(v.into()),
21357 );
21358 self
21359 }
21360
21361 /// The value of [operation][crate::model::AutomationRun::operation]
21362 /// if it holds a `TimedPromoteReleaseOperation`, `None` if the field is not set or
21363 /// holds a different branch.
21364 pub fn timed_promote_release_operation(
21365 &self,
21366 ) -> std::option::Option<&std::boxed::Box<crate::model::TimedPromoteReleaseOperation>> {
21367 #[allow(unreachable_patterns)]
21368 self.operation.as_ref().and_then(|v| match v {
21369 crate::model::automation_run::Operation::TimedPromoteReleaseOperation(v) => {
21370 std::option::Option::Some(v)
21371 }
21372 _ => std::option::Option::None,
21373 })
21374 }
21375
21376 /// Sets the value of [operation][crate::model::AutomationRun::operation]
21377 /// to hold a `TimedPromoteReleaseOperation`.
21378 ///
21379 /// Note that all the setters affecting `operation` are
21380 /// mutually exclusive.
21381 ///
21382 /// # Example
21383 /// ```ignore,no_run
21384 /// # use google_cloud_deploy_v1::model::AutomationRun;
21385 /// use google_cloud_deploy_v1::model::TimedPromoteReleaseOperation;
21386 /// let x = AutomationRun::new().set_timed_promote_release_operation(TimedPromoteReleaseOperation::default()/* use setters */);
21387 /// assert!(x.timed_promote_release_operation().is_some());
21388 /// assert!(x.promote_release_operation().is_none());
21389 /// assert!(x.advance_rollout_operation().is_none());
21390 /// assert!(x.repair_rollout_operation().is_none());
21391 /// ```
21392 pub fn set_timed_promote_release_operation<
21393 T: std::convert::Into<std::boxed::Box<crate::model::TimedPromoteReleaseOperation>>,
21394 >(
21395 mut self,
21396 v: T,
21397 ) -> Self {
21398 self.operation = std::option::Option::Some(
21399 crate::model::automation_run::Operation::TimedPromoteReleaseOperation(v.into()),
21400 );
21401 self
21402 }
21403}
21404
21405impl wkt::message::Message for AutomationRun {
21406 fn typename() -> &'static str {
21407 "type.googleapis.com/google.cloud.deploy.v1.AutomationRun"
21408 }
21409}
21410
21411/// Defines additional types related to [AutomationRun].
21412pub mod automation_run {
21413 #[allow(unused_imports)]
21414 use super::*;
21415
21416 /// Valid state of an `AutomationRun`.
21417 ///
21418 /// # Working with unknown values
21419 ///
21420 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
21421 /// additional enum variants at any time. Adding new variants is not considered
21422 /// a breaking change. Applications should write their code in anticipation of:
21423 ///
21424 /// - New values appearing in future releases of the client library, **and**
21425 /// - New values received dynamically, without application changes.
21426 ///
21427 /// Please consult the [Working with enums] section in the user guide for some
21428 /// guidelines.
21429 ///
21430 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
21431 #[derive(Clone, Debug, PartialEq)]
21432 #[non_exhaustive]
21433 pub enum State {
21434 /// The `AutomationRun` has an unspecified state.
21435 Unspecified,
21436 /// The `AutomationRun` has succeeded.
21437 Succeeded,
21438 /// The `AutomationRun` was cancelled.
21439 Cancelled,
21440 /// The `AutomationRun` has failed.
21441 Failed,
21442 /// The `AutomationRun` is in progress.
21443 InProgress,
21444 /// The `AutomationRun` is pending.
21445 Pending,
21446 /// The `AutomationRun` was aborted.
21447 Aborted,
21448 /// If set, the enum was initialized with an unknown value.
21449 ///
21450 /// Applications can examine the value using [State::value] or
21451 /// [State::name].
21452 UnknownValue(state::UnknownValue),
21453 }
21454
21455 #[doc(hidden)]
21456 pub mod state {
21457 #[allow(unused_imports)]
21458 use super::*;
21459 #[derive(Clone, Debug, PartialEq)]
21460 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
21461 }
21462
21463 impl State {
21464 /// Gets the enum value.
21465 ///
21466 /// Returns `None` if the enum contains an unknown value deserialized from
21467 /// the string representation of enums.
21468 pub fn value(&self) -> std::option::Option<i32> {
21469 match self {
21470 Self::Unspecified => std::option::Option::Some(0),
21471 Self::Succeeded => std::option::Option::Some(1),
21472 Self::Cancelled => std::option::Option::Some(2),
21473 Self::Failed => std::option::Option::Some(3),
21474 Self::InProgress => std::option::Option::Some(4),
21475 Self::Pending => std::option::Option::Some(5),
21476 Self::Aborted => std::option::Option::Some(6),
21477 Self::UnknownValue(u) => u.0.value(),
21478 }
21479 }
21480
21481 /// Gets the enum value as a string.
21482 ///
21483 /// Returns `None` if the enum contains an unknown value deserialized from
21484 /// the integer representation of enums.
21485 pub fn name(&self) -> std::option::Option<&str> {
21486 match self {
21487 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
21488 Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
21489 Self::Cancelled => std::option::Option::Some("CANCELLED"),
21490 Self::Failed => std::option::Option::Some("FAILED"),
21491 Self::InProgress => std::option::Option::Some("IN_PROGRESS"),
21492 Self::Pending => std::option::Option::Some("PENDING"),
21493 Self::Aborted => std::option::Option::Some("ABORTED"),
21494 Self::UnknownValue(u) => u.0.name(),
21495 }
21496 }
21497 }
21498
21499 impl std::default::Default for State {
21500 fn default() -> Self {
21501 use std::convert::From;
21502 Self::from(0)
21503 }
21504 }
21505
21506 impl std::fmt::Display for State {
21507 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
21508 wkt::internal::display_enum(f, self.name(), self.value())
21509 }
21510 }
21511
21512 impl std::convert::From<i32> for State {
21513 fn from(value: i32) -> Self {
21514 match value {
21515 0 => Self::Unspecified,
21516 1 => Self::Succeeded,
21517 2 => Self::Cancelled,
21518 3 => Self::Failed,
21519 4 => Self::InProgress,
21520 5 => Self::Pending,
21521 6 => Self::Aborted,
21522 _ => Self::UnknownValue(state::UnknownValue(
21523 wkt::internal::UnknownEnumValue::Integer(value),
21524 )),
21525 }
21526 }
21527 }
21528
21529 impl std::convert::From<&str> for State {
21530 fn from(value: &str) -> Self {
21531 use std::string::ToString;
21532 match value {
21533 "STATE_UNSPECIFIED" => Self::Unspecified,
21534 "SUCCEEDED" => Self::Succeeded,
21535 "CANCELLED" => Self::Cancelled,
21536 "FAILED" => Self::Failed,
21537 "IN_PROGRESS" => Self::InProgress,
21538 "PENDING" => Self::Pending,
21539 "ABORTED" => Self::Aborted,
21540 _ => Self::UnknownValue(state::UnknownValue(
21541 wkt::internal::UnknownEnumValue::String(value.to_string()),
21542 )),
21543 }
21544 }
21545 }
21546
21547 impl serde::ser::Serialize for State {
21548 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
21549 where
21550 S: serde::Serializer,
21551 {
21552 match self {
21553 Self::Unspecified => serializer.serialize_i32(0),
21554 Self::Succeeded => serializer.serialize_i32(1),
21555 Self::Cancelled => serializer.serialize_i32(2),
21556 Self::Failed => serializer.serialize_i32(3),
21557 Self::InProgress => serializer.serialize_i32(4),
21558 Self::Pending => serializer.serialize_i32(5),
21559 Self::Aborted => serializer.serialize_i32(6),
21560 Self::UnknownValue(u) => u.0.serialize(serializer),
21561 }
21562 }
21563 }
21564
21565 impl<'de> serde::de::Deserialize<'de> for State {
21566 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
21567 where
21568 D: serde::Deserializer<'de>,
21569 {
21570 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
21571 ".google.cloud.deploy.v1.AutomationRun.State",
21572 ))
21573 }
21574 }
21575
21576 /// The operation that the `AutomationRun` will perform.
21577 #[derive(Clone, Debug, PartialEq)]
21578 #[non_exhaustive]
21579 pub enum Operation {
21580 /// Output only. Promotes a release to a specified 'Target'.
21581 PromoteReleaseOperation(std::boxed::Box<crate::model::PromoteReleaseOperation>),
21582 /// Output only. Advances a rollout to the next phase.
21583 AdvanceRolloutOperation(std::boxed::Box<crate::model::AdvanceRolloutOperation>),
21584 /// Output only. Repairs a failed 'Rollout'.
21585 RepairRolloutOperation(std::boxed::Box<crate::model::RepairRolloutOperation>),
21586 /// Output only. Promotes a release to a specified 'Target' as defined in a
21587 /// Timed Promote Release rule.
21588 TimedPromoteReleaseOperation(std::boxed::Box<crate::model::TimedPromoteReleaseOperation>),
21589 }
21590}
21591
21592/// Contains the information of an automated promote-release operation.
21593#[derive(Clone, Default, PartialEq)]
21594#[non_exhaustive]
21595pub struct PromoteReleaseOperation {
21596 /// Output only. The ID of the target that represents the promotion stage to
21597 /// which the release will be promoted. The value of this field is the last
21598 /// segment of a target name.
21599 pub target_id: std::string::String,
21600
21601 /// Output only. How long the operation will be paused.
21602 pub wait: std::option::Option<wkt::Duration>,
21603
21604 /// Output only. The name of the rollout that initiates the `AutomationRun`.
21605 pub rollout: std::string::String,
21606
21607 /// Output only. The starting phase of the rollout created by this operation.
21608 pub phase: std::string::String,
21609
21610 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21611}
21612
21613impl PromoteReleaseOperation {
21614 /// Creates a new default instance.
21615 pub fn new() -> Self {
21616 std::default::Default::default()
21617 }
21618
21619 /// Sets the value of [target_id][crate::model::PromoteReleaseOperation::target_id].
21620 ///
21621 /// # Example
21622 /// ```ignore,no_run
21623 /// # use google_cloud_deploy_v1::model::PromoteReleaseOperation;
21624 /// let x = PromoteReleaseOperation::new().set_target_id("example");
21625 /// ```
21626 pub fn set_target_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21627 self.target_id = v.into();
21628 self
21629 }
21630
21631 /// Sets the value of [wait][crate::model::PromoteReleaseOperation::wait].
21632 ///
21633 /// # Example
21634 /// ```ignore,no_run
21635 /// # use google_cloud_deploy_v1::model::PromoteReleaseOperation;
21636 /// use wkt::Duration;
21637 /// let x = PromoteReleaseOperation::new().set_wait(Duration::default()/* use setters */);
21638 /// ```
21639 pub fn set_wait<T>(mut self, v: T) -> Self
21640 where
21641 T: std::convert::Into<wkt::Duration>,
21642 {
21643 self.wait = std::option::Option::Some(v.into());
21644 self
21645 }
21646
21647 /// Sets or clears the value of [wait][crate::model::PromoteReleaseOperation::wait].
21648 ///
21649 /// # Example
21650 /// ```ignore,no_run
21651 /// # use google_cloud_deploy_v1::model::PromoteReleaseOperation;
21652 /// use wkt::Duration;
21653 /// let x = PromoteReleaseOperation::new().set_or_clear_wait(Some(Duration::default()/* use setters */));
21654 /// let x = PromoteReleaseOperation::new().set_or_clear_wait(None::<Duration>);
21655 /// ```
21656 pub fn set_or_clear_wait<T>(mut self, v: std::option::Option<T>) -> Self
21657 where
21658 T: std::convert::Into<wkt::Duration>,
21659 {
21660 self.wait = v.map(|x| x.into());
21661 self
21662 }
21663
21664 /// Sets the value of [rollout][crate::model::PromoteReleaseOperation::rollout].
21665 ///
21666 /// # Example
21667 /// ```ignore,no_run
21668 /// # use google_cloud_deploy_v1::model::PromoteReleaseOperation;
21669 /// let x = PromoteReleaseOperation::new().set_rollout("example");
21670 /// ```
21671 pub fn set_rollout<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21672 self.rollout = v.into();
21673 self
21674 }
21675
21676 /// Sets the value of [phase][crate::model::PromoteReleaseOperation::phase].
21677 ///
21678 /// # Example
21679 /// ```ignore,no_run
21680 /// # use google_cloud_deploy_v1::model::PromoteReleaseOperation;
21681 /// let x = PromoteReleaseOperation::new().set_phase("example");
21682 /// ```
21683 pub fn set_phase<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21684 self.phase = v.into();
21685 self
21686 }
21687}
21688
21689impl wkt::message::Message for PromoteReleaseOperation {
21690 fn typename() -> &'static str {
21691 "type.googleapis.com/google.cloud.deploy.v1.PromoteReleaseOperation"
21692 }
21693}
21694
21695/// Contains the information of an automated advance-rollout operation.
21696#[derive(Clone, Default, PartialEq)]
21697#[non_exhaustive]
21698pub struct AdvanceRolloutOperation {
21699 /// Output only. The phase of a deployment that initiated the operation.
21700 pub source_phase: std::string::String,
21701
21702 /// Output only. How long the operation will be paused.
21703 pub wait: std::option::Option<wkt::Duration>,
21704
21705 /// Output only. The name of the rollout that initiates the `AutomationRun`.
21706 pub rollout: std::string::String,
21707
21708 /// Output only. The phase the rollout will be advanced to.
21709 pub destination_phase: std::string::String,
21710
21711 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21712}
21713
21714impl AdvanceRolloutOperation {
21715 /// Creates a new default instance.
21716 pub fn new() -> Self {
21717 std::default::Default::default()
21718 }
21719
21720 /// Sets the value of [source_phase][crate::model::AdvanceRolloutOperation::source_phase].
21721 ///
21722 /// # Example
21723 /// ```ignore,no_run
21724 /// # use google_cloud_deploy_v1::model::AdvanceRolloutOperation;
21725 /// let x = AdvanceRolloutOperation::new().set_source_phase("example");
21726 /// ```
21727 pub fn set_source_phase<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21728 self.source_phase = v.into();
21729 self
21730 }
21731
21732 /// Sets the value of [wait][crate::model::AdvanceRolloutOperation::wait].
21733 ///
21734 /// # Example
21735 /// ```ignore,no_run
21736 /// # use google_cloud_deploy_v1::model::AdvanceRolloutOperation;
21737 /// use wkt::Duration;
21738 /// let x = AdvanceRolloutOperation::new().set_wait(Duration::default()/* use setters */);
21739 /// ```
21740 pub fn set_wait<T>(mut self, v: T) -> Self
21741 where
21742 T: std::convert::Into<wkt::Duration>,
21743 {
21744 self.wait = std::option::Option::Some(v.into());
21745 self
21746 }
21747
21748 /// Sets or clears the value of [wait][crate::model::AdvanceRolloutOperation::wait].
21749 ///
21750 /// # Example
21751 /// ```ignore,no_run
21752 /// # use google_cloud_deploy_v1::model::AdvanceRolloutOperation;
21753 /// use wkt::Duration;
21754 /// let x = AdvanceRolloutOperation::new().set_or_clear_wait(Some(Duration::default()/* use setters */));
21755 /// let x = AdvanceRolloutOperation::new().set_or_clear_wait(None::<Duration>);
21756 /// ```
21757 pub fn set_or_clear_wait<T>(mut self, v: std::option::Option<T>) -> Self
21758 where
21759 T: std::convert::Into<wkt::Duration>,
21760 {
21761 self.wait = v.map(|x| x.into());
21762 self
21763 }
21764
21765 /// Sets the value of [rollout][crate::model::AdvanceRolloutOperation::rollout].
21766 ///
21767 /// # Example
21768 /// ```ignore,no_run
21769 /// # use google_cloud_deploy_v1::model::AdvanceRolloutOperation;
21770 /// let x = AdvanceRolloutOperation::new().set_rollout("example");
21771 /// ```
21772 pub fn set_rollout<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21773 self.rollout = v.into();
21774 self
21775 }
21776
21777 /// Sets the value of [destination_phase][crate::model::AdvanceRolloutOperation::destination_phase].
21778 ///
21779 /// # Example
21780 /// ```ignore,no_run
21781 /// # use google_cloud_deploy_v1::model::AdvanceRolloutOperation;
21782 /// let x = AdvanceRolloutOperation::new().set_destination_phase("example");
21783 /// ```
21784 pub fn set_destination_phase<T: std::convert::Into<std::string::String>>(
21785 mut self,
21786 v: T,
21787 ) -> Self {
21788 self.destination_phase = v.into();
21789 self
21790 }
21791}
21792
21793impl wkt::message::Message for AdvanceRolloutOperation {
21794 fn typename() -> &'static str {
21795 "type.googleapis.com/google.cloud.deploy.v1.AdvanceRolloutOperation"
21796 }
21797}
21798
21799/// Contains the information for an automated `repair rollout` operation.
21800#[derive(Clone, Default, PartialEq)]
21801#[non_exhaustive]
21802pub struct RepairRolloutOperation {
21803 /// Output only. The name of the rollout that initiates the `AutomationRun`.
21804 pub rollout: std::string::String,
21805
21806 /// Output only. The index of the current repair action in the repair sequence.
21807 pub current_repair_phase_index: i64,
21808
21809 /// Output only. Records of the repair attempts. Each repair phase may have
21810 /// multiple retry attempts or single rollback attempt.
21811 pub repair_phases: std::vec::Vec<crate::model::RepairPhase>,
21812
21813 /// Output only. The phase ID of the phase that includes the job being
21814 /// repaired.
21815 pub phase_id: std::string::String,
21816
21817 /// Output only. The job ID for the Job to repair.
21818 pub job_id: std::string::String,
21819
21820 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21821}
21822
21823impl RepairRolloutOperation {
21824 /// Creates a new default instance.
21825 pub fn new() -> Self {
21826 std::default::Default::default()
21827 }
21828
21829 /// Sets the value of [rollout][crate::model::RepairRolloutOperation::rollout].
21830 ///
21831 /// # Example
21832 /// ```ignore,no_run
21833 /// # use google_cloud_deploy_v1::model::RepairRolloutOperation;
21834 /// let x = RepairRolloutOperation::new().set_rollout("example");
21835 /// ```
21836 pub fn set_rollout<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21837 self.rollout = v.into();
21838 self
21839 }
21840
21841 /// Sets the value of [current_repair_phase_index][crate::model::RepairRolloutOperation::current_repair_phase_index].
21842 ///
21843 /// # Example
21844 /// ```ignore,no_run
21845 /// # use google_cloud_deploy_v1::model::RepairRolloutOperation;
21846 /// let x = RepairRolloutOperation::new().set_current_repair_phase_index(42);
21847 /// ```
21848 pub fn set_current_repair_phase_index<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
21849 self.current_repair_phase_index = v.into();
21850 self
21851 }
21852
21853 /// Sets the value of [repair_phases][crate::model::RepairRolloutOperation::repair_phases].
21854 ///
21855 /// # Example
21856 /// ```ignore,no_run
21857 /// # use google_cloud_deploy_v1::model::RepairRolloutOperation;
21858 /// use google_cloud_deploy_v1::model::RepairPhase;
21859 /// let x = RepairRolloutOperation::new()
21860 /// .set_repair_phases([
21861 /// RepairPhase::default()/* use setters */,
21862 /// RepairPhase::default()/* use (different) setters */,
21863 /// ]);
21864 /// ```
21865 pub fn set_repair_phases<T, V>(mut self, v: T) -> Self
21866 where
21867 T: std::iter::IntoIterator<Item = V>,
21868 V: std::convert::Into<crate::model::RepairPhase>,
21869 {
21870 use std::iter::Iterator;
21871 self.repair_phases = v.into_iter().map(|i| i.into()).collect();
21872 self
21873 }
21874
21875 /// Sets the value of [phase_id][crate::model::RepairRolloutOperation::phase_id].
21876 ///
21877 /// # Example
21878 /// ```ignore,no_run
21879 /// # use google_cloud_deploy_v1::model::RepairRolloutOperation;
21880 /// let x = RepairRolloutOperation::new().set_phase_id("example");
21881 /// ```
21882 pub fn set_phase_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21883 self.phase_id = v.into();
21884 self
21885 }
21886
21887 /// Sets the value of [job_id][crate::model::RepairRolloutOperation::job_id].
21888 ///
21889 /// # Example
21890 /// ```ignore,no_run
21891 /// # use google_cloud_deploy_v1::model::RepairRolloutOperation;
21892 /// let x = RepairRolloutOperation::new().set_job_id("example");
21893 /// ```
21894 pub fn set_job_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21895 self.job_id = v.into();
21896 self
21897 }
21898}
21899
21900impl wkt::message::Message for RepairRolloutOperation {
21901 fn typename() -> &'static str {
21902 "type.googleapis.com/google.cloud.deploy.v1.RepairRolloutOperation"
21903 }
21904}
21905
21906/// Contains the information of an automated timed promote-release operation.
21907#[derive(Clone, Default, PartialEq)]
21908#[non_exhaustive]
21909pub struct TimedPromoteReleaseOperation {
21910 /// Output only. The ID of the target that represents the promotion stage to
21911 /// which the release will be promoted. The value of this field is the last
21912 /// segment of a target name.
21913 pub target_id: std::string::String,
21914
21915 /// Output only. The name of the release to be promoted.
21916 pub release: std::string::String,
21917
21918 /// Output only. The starting phase of the rollout created by this operation.
21919 pub phase: std::string::String,
21920
21921 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21922}
21923
21924impl TimedPromoteReleaseOperation {
21925 /// Creates a new default instance.
21926 pub fn new() -> Self {
21927 std::default::Default::default()
21928 }
21929
21930 /// Sets the value of [target_id][crate::model::TimedPromoteReleaseOperation::target_id].
21931 ///
21932 /// # Example
21933 /// ```ignore,no_run
21934 /// # use google_cloud_deploy_v1::model::TimedPromoteReleaseOperation;
21935 /// let x = TimedPromoteReleaseOperation::new().set_target_id("example");
21936 /// ```
21937 pub fn set_target_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21938 self.target_id = v.into();
21939 self
21940 }
21941
21942 /// Sets the value of [release][crate::model::TimedPromoteReleaseOperation::release].
21943 ///
21944 /// # Example
21945 /// ```ignore,no_run
21946 /// # use google_cloud_deploy_v1::model::TimedPromoteReleaseOperation;
21947 /// let x = TimedPromoteReleaseOperation::new().set_release("example");
21948 /// ```
21949 pub fn set_release<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21950 self.release = v.into();
21951 self
21952 }
21953
21954 /// Sets the value of [phase][crate::model::TimedPromoteReleaseOperation::phase].
21955 ///
21956 /// # Example
21957 /// ```ignore,no_run
21958 /// # use google_cloud_deploy_v1::model::TimedPromoteReleaseOperation;
21959 /// let x = TimedPromoteReleaseOperation::new().set_phase("example");
21960 /// ```
21961 pub fn set_phase<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21962 self.phase = v.into();
21963 self
21964 }
21965}
21966
21967impl wkt::message::Message for TimedPromoteReleaseOperation {
21968 fn typename() -> &'static str {
21969 "type.googleapis.com/google.cloud.deploy.v1.TimedPromoteReleaseOperation"
21970 }
21971}
21972
21973/// RepairPhase tracks the repair attempts that have been made for
21974/// each `RepairPhaseConfig` specified in the `Automation` resource.
21975#[derive(Clone, Default, PartialEq)]
21976#[non_exhaustive]
21977pub struct RepairPhase {
21978 /// The `RepairPhase` type and the information for that type.
21979 pub repair_phase: std::option::Option<crate::model::repair_phase::RepairPhase>,
21980
21981 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21982}
21983
21984impl RepairPhase {
21985 /// Creates a new default instance.
21986 pub fn new() -> Self {
21987 std::default::Default::default()
21988 }
21989
21990 /// Sets the value of [repair_phase][crate::model::RepairPhase::repair_phase].
21991 ///
21992 /// Note that all the setters affecting `repair_phase` are mutually
21993 /// exclusive.
21994 ///
21995 /// # Example
21996 /// ```ignore,no_run
21997 /// # use google_cloud_deploy_v1::model::RepairPhase;
21998 /// use google_cloud_deploy_v1::model::RetryPhase;
21999 /// let x = RepairPhase::new().set_repair_phase(Some(
22000 /// google_cloud_deploy_v1::model::repair_phase::RepairPhase::Retry(RetryPhase::default().into())));
22001 /// ```
22002 pub fn set_repair_phase<
22003 T: std::convert::Into<std::option::Option<crate::model::repair_phase::RepairPhase>>,
22004 >(
22005 mut self,
22006 v: T,
22007 ) -> Self {
22008 self.repair_phase = v.into();
22009 self
22010 }
22011
22012 /// The value of [repair_phase][crate::model::RepairPhase::repair_phase]
22013 /// if it holds a `Retry`, `None` if the field is not set or
22014 /// holds a different branch.
22015 pub fn retry(&self) -> std::option::Option<&std::boxed::Box<crate::model::RetryPhase>> {
22016 #[allow(unreachable_patterns)]
22017 self.repair_phase.as_ref().and_then(|v| match v {
22018 crate::model::repair_phase::RepairPhase::Retry(v) => std::option::Option::Some(v),
22019 _ => std::option::Option::None,
22020 })
22021 }
22022
22023 /// Sets the value of [repair_phase][crate::model::RepairPhase::repair_phase]
22024 /// to hold a `Retry`.
22025 ///
22026 /// Note that all the setters affecting `repair_phase` are
22027 /// mutually exclusive.
22028 ///
22029 /// # Example
22030 /// ```ignore,no_run
22031 /// # use google_cloud_deploy_v1::model::RepairPhase;
22032 /// use google_cloud_deploy_v1::model::RetryPhase;
22033 /// let x = RepairPhase::new().set_retry(RetryPhase::default()/* use setters */);
22034 /// assert!(x.retry().is_some());
22035 /// assert!(x.rollback().is_none());
22036 /// ```
22037 pub fn set_retry<T: std::convert::Into<std::boxed::Box<crate::model::RetryPhase>>>(
22038 mut self,
22039 v: T,
22040 ) -> Self {
22041 self.repair_phase =
22042 std::option::Option::Some(crate::model::repair_phase::RepairPhase::Retry(v.into()));
22043 self
22044 }
22045
22046 /// The value of [repair_phase][crate::model::RepairPhase::repair_phase]
22047 /// if it holds a `Rollback`, `None` if the field is not set or
22048 /// holds a different branch.
22049 pub fn rollback(&self) -> std::option::Option<&std::boxed::Box<crate::model::RollbackAttempt>> {
22050 #[allow(unreachable_patterns)]
22051 self.repair_phase.as_ref().and_then(|v| match v {
22052 crate::model::repair_phase::RepairPhase::Rollback(v) => std::option::Option::Some(v),
22053 _ => std::option::Option::None,
22054 })
22055 }
22056
22057 /// Sets the value of [repair_phase][crate::model::RepairPhase::repair_phase]
22058 /// to hold a `Rollback`.
22059 ///
22060 /// Note that all the setters affecting `repair_phase` are
22061 /// mutually exclusive.
22062 ///
22063 /// # Example
22064 /// ```ignore,no_run
22065 /// # use google_cloud_deploy_v1::model::RepairPhase;
22066 /// use google_cloud_deploy_v1::model::RollbackAttempt;
22067 /// let x = RepairPhase::new().set_rollback(RollbackAttempt::default()/* use setters */);
22068 /// assert!(x.rollback().is_some());
22069 /// assert!(x.retry().is_none());
22070 /// ```
22071 pub fn set_rollback<T: std::convert::Into<std::boxed::Box<crate::model::RollbackAttempt>>>(
22072 mut self,
22073 v: T,
22074 ) -> Self {
22075 self.repair_phase =
22076 std::option::Option::Some(crate::model::repair_phase::RepairPhase::Rollback(v.into()));
22077 self
22078 }
22079}
22080
22081impl wkt::message::Message for RepairPhase {
22082 fn typename() -> &'static str {
22083 "type.googleapis.com/google.cloud.deploy.v1.RepairPhase"
22084 }
22085}
22086
22087/// Defines additional types related to [RepairPhase].
22088pub mod repair_phase {
22089 #[allow(unused_imports)]
22090 use super::*;
22091
22092 /// The `RepairPhase` type and the information for that type.
22093 #[derive(Clone, Debug, PartialEq)]
22094 #[non_exhaustive]
22095 pub enum RepairPhase {
22096 /// Output only. Records of the retry attempts for retry repair mode.
22097 Retry(std::boxed::Box<crate::model::RetryPhase>),
22098 /// Output only. Rollback attempt for rollback repair mode .
22099 Rollback(std::boxed::Box<crate::model::RollbackAttempt>),
22100 }
22101}
22102
22103/// RetryPhase contains the retry attempts and the metadata for initiating a
22104/// new attempt.
22105#[derive(Clone, Default, PartialEq)]
22106#[non_exhaustive]
22107pub struct RetryPhase {
22108 /// Output only. The number of attempts that have been made.
22109 pub total_attempts: i64,
22110
22111 /// Output only. The pattern of how the wait time of the retry attempt is
22112 /// calculated.
22113 pub backoff_mode: crate::model::BackoffMode,
22114
22115 /// Output only. Detail of a retry action.
22116 pub attempts: std::vec::Vec<crate::model::RetryAttempt>,
22117
22118 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22119}
22120
22121impl RetryPhase {
22122 /// Creates a new default instance.
22123 pub fn new() -> Self {
22124 std::default::Default::default()
22125 }
22126
22127 /// Sets the value of [total_attempts][crate::model::RetryPhase::total_attempts].
22128 ///
22129 /// # Example
22130 /// ```ignore,no_run
22131 /// # use google_cloud_deploy_v1::model::RetryPhase;
22132 /// let x = RetryPhase::new().set_total_attempts(42);
22133 /// ```
22134 pub fn set_total_attempts<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
22135 self.total_attempts = v.into();
22136 self
22137 }
22138
22139 /// Sets the value of [backoff_mode][crate::model::RetryPhase::backoff_mode].
22140 ///
22141 /// # Example
22142 /// ```ignore,no_run
22143 /// # use google_cloud_deploy_v1::model::RetryPhase;
22144 /// use google_cloud_deploy_v1::model::BackoffMode;
22145 /// let x0 = RetryPhase::new().set_backoff_mode(BackoffMode::Linear);
22146 /// let x1 = RetryPhase::new().set_backoff_mode(BackoffMode::Exponential);
22147 /// ```
22148 pub fn set_backoff_mode<T: std::convert::Into<crate::model::BackoffMode>>(
22149 mut self,
22150 v: T,
22151 ) -> Self {
22152 self.backoff_mode = v.into();
22153 self
22154 }
22155
22156 /// Sets the value of [attempts][crate::model::RetryPhase::attempts].
22157 ///
22158 /// # Example
22159 /// ```ignore,no_run
22160 /// # use google_cloud_deploy_v1::model::RetryPhase;
22161 /// use google_cloud_deploy_v1::model::RetryAttempt;
22162 /// let x = RetryPhase::new()
22163 /// .set_attempts([
22164 /// RetryAttempt::default()/* use setters */,
22165 /// RetryAttempt::default()/* use (different) setters */,
22166 /// ]);
22167 /// ```
22168 pub fn set_attempts<T, V>(mut self, v: T) -> Self
22169 where
22170 T: std::iter::IntoIterator<Item = V>,
22171 V: std::convert::Into<crate::model::RetryAttempt>,
22172 {
22173 use std::iter::Iterator;
22174 self.attempts = v.into_iter().map(|i| i.into()).collect();
22175 self
22176 }
22177}
22178
22179impl wkt::message::Message for RetryPhase {
22180 fn typename() -> &'static str {
22181 "type.googleapis.com/google.cloud.deploy.v1.RetryPhase"
22182 }
22183}
22184
22185/// RetryAttempt represents an action of retrying the failed Cloud Deploy job.
22186#[derive(Clone, Default, PartialEq)]
22187#[non_exhaustive]
22188pub struct RetryAttempt {
22189 /// Output only. The index of this retry attempt.
22190 pub attempt: i64,
22191
22192 /// Output only. How long the operation will be paused.
22193 pub wait: std::option::Option<wkt::Duration>,
22194
22195 /// Output only. Valid state of this retry action.
22196 pub state: crate::model::RepairState,
22197
22198 /// Output only. Description of the state of the Retry.
22199 pub state_desc: std::string::String,
22200
22201 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22202}
22203
22204impl RetryAttempt {
22205 /// Creates a new default instance.
22206 pub fn new() -> Self {
22207 std::default::Default::default()
22208 }
22209
22210 /// Sets the value of [attempt][crate::model::RetryAttempt::attempt].
22211 ///
22212 /// # Example
22213 /// ```ignore,no_run
22214 /// # use google_cloud_deploy_v1::model::RetryAttempt;
22215 /// let x = RetryAttempt::new().set_attempt(42);
22216 /// ```
22217 pub fn set_attempt<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
22218 self.attempt = v.into();
22219 self
22220 }
22221
22222 /// Sets the value of [wait][crate::model::RetryAttempt::wait].
22223 ///
22224 /// # Example
22225 /// ```ignore,no_run
22226 /// # use google_cloud_deploy_v1::model::RetryAttempt;
22227 /// use wkt::Duration;
22228 /// let x = RetryAttempt::new().set_wait(Duration::default()/* use setters */);
22229 /// ```
22230 pub fn set_wait<T>(mut self, v: T) -> Self
22231 where
22232 T: std::convert::Into<wkt::Duration>,
22233 {
22234 self.wait = std::option::Option::Some(v.into());
22235 self
22236 }
22237
22238 /// Sets or clears the value of [wait][crate::model::RetryAttempt::wait].
22239 ///
22240 /// # Example
22241 /// ```ignore,no_run
22242 /// # use google_cloud_deploy_v1::model::RetryAttempt;
22243 /// use wkt::Duration;
22244 /// let x = RetryAttempt::new().set_or_clear_wait(Some(Duration::default()/* use setters */));
22245 /// let x = RetryAttempt::new().set_or_clear_wait(None::<Duration>);
22246 /// ```
22247 pub fn set_or_clear_wait<T>(mut self, v: std::option::Option<T>) -> Self
22248 where
22249 T: std::convert::Into<wkt::Duration>,
22250 {
22251 self.wait = v.map(|x| x.into());
22252 self
22253 }
22254
22255 /// Sets the value of [state][crate::model::RetryAttempt::state].
22256 ///
22257 /// # Example
22258 /// ```ignore,no_run
22259 /// # use google_cloud_deploy_v1::model::RetryAttempt;
22260 /// use google_cloud_deploy_v1::model::RepairState;
22261 /// let x0 = RetryAttempt::new().set_state(RepairState::Succeeded);
22262 /// let x1 = RetryAttempt::new().set_state(RepairState::Cancelled);
22263 /// let x2 = RetryAttempt::new().set_state(RepairState::Failed);
22264 /// ```
22265 pub fn set_state<T: std::convert::Into<crate::model::RepairState>>(mut self, v: T) -> Self {
22266 self.state = v.into();
22267 self
22268 }
22269
22270 /// Sets the value of [state_desc][crate::model::RetryAttempt::state_desc].
22271 ///
22272 /// # Example
22273 /// ```ignore,no_run
22274 /// # use google_cloud_deploy_v1::model::RetryAttempt;
22275 /// let x = RetryAttempt::new().set_state_desc("example");
22276 /// ```
22277 pub fn set_state_desc<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22278 self.state_desc = v.into();
22279 self
22280 }
22281}
22282
22283impl wkt::message::Message for RetryAttempt {
22284 fn typename() -> &'static str {
22285 "type.googleapis.com/google.cloud.deploy.v1.RetryAttempt"
22286 }
22287}
22288
22289/// RollbackAttempt represents an action of rolling back a Cloud Deploy 'Target'.
22290#[derive(Clone, Default, PartialEq)]
22291#[non_exhaustive]
22292pub struct RollbackAttempt {
22293 /// Output only. The phase to which the rollout will be rolled back to.
22294 pub destination_phase: std::string::String,
22295
22296 /// Output only. ID of the rollback `Rollout` to create.
22297 pub rollout_id: std::string::String,
22298
22299 /// Output only. Valid state of this rollback action.
22300 pub state: crate::model::RepairState,
22301
22302 /// Output only. Description of the state of the Rollback.
22303 pub state_desc: std::string::String,
22304
22305 /// Output only. If active rollout exists on the target, abort this rollback.
22306 pub disable_rollback_if_rollout_pending: bool,
22307
22308 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22309}
22310
22311impl RollbackAttempt {
22312 /// Creates a new default instance.
22313 pub fn new() -> Self {
22314 std::default::Default::default()
22315 }
22316
22317 /// Sets the value of [destination_phase][crate::model::RollbackAttempt::destination_phase].
22318 ///
22319 /// # Example
22320 /// ```ignore,no_run
22321 /// # use google_cloud_deploy_v1::model::RollbackAttempt;
22322 /// let x = RollbackAttempt::new().set_destination_phase("example");
22323 /// ```
22324 pub fn set_destination_phase<T: std::convert::Into<std::string::String>>(
22325 mut self,
22326 v: T,
22327 ) -> Self {
22328 self.destination_phase = v.into();
22329 self
22330 }
22331
22332 /// Sets the value of [rollout_id][crate::model::RollbackAttempt::rollout_id].
22333 ///
22334 /// # Example
22335 /// ```ignore,no_run
22336 /// # use google_cloud_deploy_v1::model::RollbackAttempt;
22337 /// let x = RollbackAttempt::new().set_rollout_id("example");
22338 /// ```
22339 pub fn set_rollout_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22340 self.rollout_id = v.into();
22341 self
22342 }
22343
22344 /// Sets the value of [state][crate::model::RollbackAttempt::state].
22345 ///
22346 /// # Example
22347 /// ```ignore,no_run
22348 /// # use google_cloud_deploy_v1::model::RollbackAttempt;
22349 /// use google_cloud_deploy_v1::model::RepairState;
22350 /// let x0 = RollbackAttempt::new().set_state(RepairState::Succeeded);
22351 /// let x1 = RollbackAttempt::new().set_state(RepairState::Cancelled);
22352 /// let x2 = RollbackAttempt::new().set_state(RepairState::Failed);
22353 /// ```
22354 pub fn set_state<T: std::convert::Into<crate::model::RepairState>>(mut self, v: T) -> Self {
22355 self.state = v.into();
22356 self
22357 }
22358
22359 /// Sets the value of [state_desc][crate::model::RollbackAttempt::state_desc].
22360 ///
22361 /// # Example
22362 /// ```ignore,no_run
22363 /// # use google_cloud_deploy_v1::model::RollbackAttempt;
22364 /// let x = RollbackAttempt::new().set_state_desc("example");
22365 /// ```
22366 pub fn set_state_desc<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22367 self.state_desc = v.into();
22368 self
22369 }
22370
22371 /// Sets the value of [disable_rollback_if_rollout_pending][crate::model::RollbackAttempt::disable_rollback_if_rollout_pending].
22372 ///
22373 /// # Example
22374 /// ```ignore,no_run
22375 /// # use google_cloud_deploy_v1::model::RollbackAttempt;
22376 /// let x = RollbackAttempt::new().set_disable_rollback_if_rollout_pending(true);
22377 /// ```
22378 pub fn set_disable_rollback_if_rollout_pending<T: std::convert::Into<bool>>(
22379 mut self,
22380 v: T,
22381 ) -> Self {
22382 self.disable_rollback_if_rollout_pending = v.into();
22383 self
22384 }
22385}
22386
22387impl wkt::message::Message for RollbackAttempt {
22388 fn typename() -> &'static str {
22389 "type.googleapis.com/google.cloud.deploy.v1.RollbackAttempt"
22390 }
22391}
22392
22393/// The request object for `ListAutomationRuns`.
22394#[derive(Clone, Default, PartialEq)]
22395#[non_exhaustive]
22396pub struct ListAutomationRunsRequest {
22397 /// Required. The parent `Delivery Pipeline`, which owns this collection of
22398 /// automationRuns. Format must be
22399 /// `projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}`.
22400 pub parent: std::string::String,
22401
22402 /// The maximum number of automationRuns to return. The service may return
22403 /// fewer than this value. If unspecified, at most 50 automationRuns will
22404 /// be returned. The maximum value is 1000; values above 1000 will be set
22405 /// to 1000.
22406 pub page_size: i32,
22407
22408 /// A page token, received from a previous `ListAutomationRuns` call.
22409 /// Provide this to retrieve the subsequent page.
22410 ///
22411 /// When paginating, all other provided parameters match
22412 /// the call that provided the page token.
22413 pub page_token: std::string::String,
22414
22415 /// Filter automationRuns to be returned. All fields can be used in the
22416 /// filter.
22417 pub filter: std::string::String,
22418
22419 /// Field to sort by.
22420 pub order_by: std::string::String,
22421
22422 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22423}
22424
22425impl ListAutomationRunsRequest {
22426 /// Creates a new default instance.
22427 pub fn new() -> Self {
22428 std::default::Default::default()
22429 }
22430
22431 /// Sets the value of [parent][crate::model::ListAutomationRunsRequest::parent].
22432 ///
22433 /// # Example
22434 /// ```ignore,no_run
22435 /// # use google_cloud_deploy_v1::model::ListAutomationRunsRequest;
22436 /// # let project_id = "project_id";
22437 /// # let location_id = "location_id";
22438 /// # let delivery_pipeline_id = "delivery_pipeline_id";
22439 /// let x = ListAutomationRunsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/deliveryPipelines/{delivery_pipeline_id}"));
22440 /// ```
22441 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22442 self.parent = v.into();
22443 self
22444 }
22445
22446 /// Sets the value of [page_size][crate::model::ListAutomationRunsRequest::page_size].
22447 ///
22448 /// # Example
22449 /// ```ignore,no_run
22450 /// # use google_cloud_deploy_v1::model::ListAutomationRunsRequest;
22451 /// let x = ListAutomationRunsRequest::new().set_page_size(42);
22452 /// ```
22453 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
22454 self.page_size = v.into();
22455 self
22456 }
22457
22458 /// Sets the value of [page_token][crate::model::ListAutomationRunsRequest::page_token].
22459 ///
22460 /// # Example
22461 /// ```ignore,no_run
22462 /// # use google_cloud_deploy_v1::model::ListAutomationRunsRequest;
22463 /// let x = ListAutomationRunsRequest::new().set_page_token("example");
22464 /// ```
22465 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22466 self.page_token = v.into();
22467 self
22468 }
22469
22470 /// Sets the value of [filter][crate::model::ListAutomationRunsRequest::filter].
22471 ///
22472 /// # Example
22473 /// ```ignore,no_run
22474 /// # use google_cloud_deploy_v1::model::ListAutomationRunsRequest;
22475 /// let x = ListAutomationRunsRequest::new().set_filter("example");
22476 /// ```
22477 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22478 self.filter = v.into();
22479 self
22480 }
22481
22482 /// Sets the value of [order_by][crate::model::ListAutomationRunsRequest::order_by].
22483 ///
22484 /// # Example
22485 /// ```ignore,no_run
22486 /// # use google_cloud_deploy_v1::model::ListAutomationRunsRequest;
22487 /// let x = ListAutomationRunsRequest::new().set_order_by("example");
22488 /// ```
22489 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22490 self.order_by = v.into();
22491 self
22492 }
22493}
22494
22495impl wkt::message::Message for ListAutomationRunsRequest {
22496 fn typename() -> &'static str {
22497 "type.googleapis.com/google.cloud.deploy.v1.ListAutomationRunsRequest"
22498 }
22499}
22500
22501/// The response object from `ListAutomationRuns`.
22502#[derive(Clone, Default, PartialEq)]
22503#[non_exhaustive]
22504pub struct ListAutomationRunsResponse {
22505 /// The `AutomationRuns` objects.
22506 pub automation_runs: std::vec::Vec<crate::model::AutomationRun>,
22507
22508 /// A token, which can be sent as `page_token` to retrieve the next page.
22509 /// If this field is omitted, there are no subsequent pages.
22510 pub next_page_token: std::string::String,
22511
22512 /// Locations that could not be reached.
22513 pub unreachable: std::vec::Vec<std::string::String>,
22514
22515 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22516}
22517
22518impl ListAutomationRunsResponse {
22519 /// Creates a new default instance.
22520 pub fn new() -> Self {
22521 std::default::Default::default()
22522 }
22523
22524 /// Sets the value of [automation_runs][crate::model::ListAutomationRunsResponse::automation_runs].
22525 ///
22526 /// # Example
22527 /// ```ignore,no_run
22528 /// # use google_cloud_deploy_v1::model::ListAutomationRunsResponse;
22529 /// use google_cloud_deploy_v1::model::AutomationRun;
22530 /// let x = ListAutomationRunsResponse::new()
22531 /// .set_automation_runs([
22532 /// AutomationRun::default()/* use setters */,
22533 /// AutomationRun::default()/* use (different) setters */,
22534 /// ]);
22535 /// ```
22536 pub fn set_automation_runs<T, V>(mut self, v: T) -> Self
22537 where
22538 T: std::iter::IntoIterator<Item = V>,
22539 V: std::convert::Into<crate::model::AutomationRun>,
22540 {
22541 use std::iter::Iterator;
22542 self.automation_runs = v.into_iter().map(|i| i.into()).collect();
22543 self
22544 }
22545
22546 /// Sets the value of [next_page_token][crate::model::ListAutomationRunsResponse::next_page_token].
22547 ///
22548 /// # Example
22549 /// ```ignore,no_run
22550 /// # use google_cloud_deploy_v1::model::ListAutomationRunsResponse;
22551 /// let x = ListAutomationRunsResponse::new().set_next_page_token("example");
22552 /// ```
22553 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22554 self.next_page_token = v.into();
22555 self
22556 }
22557
22558 /// Sets the value of [unreachable][crate::model::ListAutomationRunsResponse::unreachable].
22559 ///
22560 /// # Example
22561 /// ```ignore,no_run
22562 /// # use google_cloud_deploy_v1::model::ListAutomationRunsResponse;
22563 /// let x = ListAutomationRunsResponse::new().set_unreachable(["a", "b", "c"]);
22564 /// ```
22565 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
22566 where
22567 T: std::iter::IntoIterator<Item = V>,
22568 V: std::convert::Into<std::string::String>,
22569 {
22570 use std::iter::Iterator;
22571 self.unreachable = v.into_iter().map(|i| i.into()).collect();
22572 self
22573 }
22574}
22575
22576impl wkt::message::Message for ListAutomationRunsResponse {
22577 fn typename() -> &'static str {
22578 "type.googleapis.com/google.cloud.deploy.v1.ListAutomationRunsResponse"
22579 }
22580}
22581
22582#[doc(hidden)]
22583impl google_cloud_gax::paginator::internal::PageableResponse for ListAutomationRunsResponse {
22584 type PageItem = crate::model::AutomationRun;
22585
22586 fn items(self) -> std::vec::Vec<Self::PageItem> {
22587 self.automation_runs
22588 }
22589
22590 fn next_page_token(&self) -> std::string::String {
22591 use std::clone::Clone;
22592 self.next_page_token.clone()
22593 }
22594}
22595
22596/// The request object for `GetAutomationRun`
22597#[derive(Clone, Default, PartialEq)]
22598#[non_exhaustive]
22599pub struct GetAutomationRunRequest {
22600 /// Required. Name of the `AutomationRun`. Format must be
22601 /// `projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/automationRuns/{automation_run}`.
22602 pub name: std::string::String,
22603
22604 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22605}
22606
22607impl GetAutomationRunRequest {
22608 /// Creates a new default instance.
22609 pub fn new() -> Self {
22610 std::default::Default::default()
22611 }
22612
22613 /// Sets the value of [name][crate::model::GetAutomationRunRequest::name].
22614 ///
22615 /// # Example
22616 /// ```ignore,no_run
22617 /// # use google_cloud_deploy_v1::model::GetAutomationRunRequest;
22618 /// # let project_id = "project_id";
22619 /// # let location_id = "location_id";
22620 /// # let delivery_pipeline_id = "delivery_pipeline_id";
22621 /// # let automation_run_id = "automation_run_id";
22622 /// let x = GetAutomationRunRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/deliveryPipelines/{delivery_pipeline_id}/automationRuns/{automation_run_id}"));
22623 /// ```
22624 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22625 self.name = v.into();
22626 self
22627 }
22628}
22629
22630impl wkt::message::Message for GetAutomationRunRequest {
22631 fn typename() -> &'static str {
22632 "type.googleapis.com/google.cloud.deploy.v1.GetAutomationRunRequest"
22633 }
22634}
22635
22636/// The request object used by `CancelAutomationRun`.
22637#[derive(Clone, Default, PartialEq)]
22638#[non_exhaustive]
22639pub struct CancelAutomationRunRequest {
22640 /// Required. Name of the `AutomationRun`. Format is
22641 /// `projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/automationRuns/{automation_run}`.
22642 pub name: std::string::String,
22643
22644 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22645}
22646
22647impl CancelAutomationRunRequest {
22648 /// Creates a new default instance.
22649 pub fn new() -> Self {
22650 std::default::Default::default()
22651 }
22652
22653 /// Sets the value of [name][crate::model::CancelAutomationRunRequest::name].
22654 ///
22655 /// # Example
22656 /// ```ignore,no_run
22657 /// # use google_cloud_deploy_v1::model::CancelAutomationRunRequest;
22658 /// # let project_id = "project_id";
22659 /// # let location_id = "location_id";
22660 /// # let delivery_pipeline_id = "delivery_pipeline_id";
22661 /// # let automation_run_id = "automation_run_id";
22662 /// let x = CancelAutomationRunRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/deliveryPipelines/{delivery_pipeline_id}/automationRuns/{automation_run_id}"));
22663 /// ```
22664 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22665 self.name = v.into();
22666 self
22667 }
22668}
22669
22670impl wkt::message::Message for CancelAutomationRunRequest {
22671 fn typename() -> &'static str {
22672 "type.googleapis.com/google.cloud.deploy.v1.CancelAutomationRunRequest"
22673 }
22674}
22675
22676/// The response object from `CancelAutomationRun`.
22677#[derive(Clone, Default, PartialEq)]
22678#[non_exhaustive]
22679pub struct CancelAutomationRunResponse {
22680 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22681}
22682
22683impl CancelAutomationRunResponse {
22684 /// Creates a new default instance.
22685 pub fn new() -> Self {
22686 std::default::Default::default()
22687 }
22688}
22689
22690impl wkt::message::Message for CancelAutomationRunResponse {
22691 fn typename() -> &'static str {
22692 "type.googleapis.com/google.cloud.deploy.v1.CancelAutomationRunResponse"
22693 }
22694}
22695
22696/// Payload proto for "clouddeploy.googleapis.com/customtargettype_notification"
22697/// Platform Log event that describes the failure to send a custom target type
22698/// status change Pub/Sub notification.
22699#[derive(Clone, Default, PartialEq)]
22700#[non_exhaustive]
22701pub struct CustomTargetTypeNotificationEvent {
22702 /// Debug message for when a notification fails to send.
22703 pub message: std::string::String,
22704
22705 /// Unique identifier of the `CustomTargetType`.
22706 pub custom_target_type_uid: std::string::String,
22707
22708 /// The name of the `CustomTargetType`.
22709 pub custom_target_type: std::string::String,
22710
22711 /// Type of this notification, e.g. for a Pub/Sub failure.
22712 pub r#type: crate::model::Type,
22713
22714 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22715}
22716
22717impl CustomTargetTypeNotificationEvent {
22718 /// Creates a new default instance.
22719 pub fn new() -> Self {
22720 std::default::Default::default()
22721 }
22722
22723 /// Sets the value of [message][crate::model::CustomTargetTypeNotificationEvent::message].
22724 ///
22725 /// # Example
22726 /// ```ignore,no_run
22727 /// # use google_cloud_deploy_v1::model::CustomTargetTypeNotificationEvent;
22728 /// let x = CustomTargetTypeNotificationEvent::new().set_message("example");
22729 /// ```
22730 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22731 self.message = v.into();
22732 self
22733 }
22734
22735 /// Sets the value of [custom_target_type_uid][crate::model::CustomTargetTypeNotificationEvent::custom_target_type_uid].
22736 ///
22737 /// # Example
22738 /// ```ignore,no_run
22739 /// # use google_cloud_deploy_v1::model::CustomTargetTypeNotificationEvent;
22740 /// let x = CustomTargetTypeNotificationEvent::new().set_custom_target_type_uid("example");
22741 /// ```
22742 pub fn set_custom_target_type_uid<T: std::convert::Into<std::string::String>>(
22743 mut self,
22744 v: T,
22745 ) -> Self {
22746 self.custom_target_type_uid = v.into();
22747 self
22748 }
22749
22750 /// Sets the value of [custom_target_type][crate::model::CustomTargetTypeNotificationEvent::custom_target_type].
22751 ///
22752 /// # Example
22753 /// ```ignore,no_run
22754 /// # use google_cloud_deploy_v1::model::CustomTargetTypeNotificationEvent;
22755 /// let x = CustomTargetTypeNotificationEvent::new().set_custom_target_type("example");
22756 /// ```
22757 pub fn set_custom_target_type<T: std::convert::Into<std::string::String>>(
22758 mut self,
22759 v: T,
22760 ) -> Self {
22761 self.custom_target_type = v.into();
22762 self
22763 }
22764
22765 /// Sets the value of [r#type][crate::model::CustomTargetTypeNotificationEvent::type].
22766 ///
22767 /// # Example
22768 /// ```ignore,no_run
22769 /// # use google_cloud_deploy_v1::model::CustomTargetTypeNotificationEvent;
22770 /// use google_cloud_deploy_v1::model::Type;
22771 /// let x0 = CustomTargetTypeNotificationEvent::new().set_type(Type::PubsubNotificationFailure);
22772 /// let x1 = CustomTargetTypeNotificationEvent::new().set_type(Type::ResourceStateChange);
22773 /// let x2 = CustomTargetTypeNotificationEvent::new().set_type(Type::ProcessAborted);
22774 /// ```
22775 pub fn set_type<T: std::convert::Into<crate::model::Type>>(mut self, v: T) -> Self {
22776 self.r#type = v.into();
22777 self
22778 }
22779}
22780
22781impl wkt::message::Message for CustomTargetTypeNotificationEvent {
22782 fn typename() -> &'static str {
22783 "type.googleapis.com/google.cloud.deploy.v1.CustomTargetTypeNotificationEvent"
22784 }
22785}
22786
22787/// Payload proto for "clouddeploy.googleapis.com/deliverypipeline_notification"
22788/// Platform Log event that describes the failure to send delivery pipeline
22789/// status change Pub/Sub notification.
22790#[derive(Clone, Default, PartialEq)]
22791#[non_exhaustive]
22792pub struct DeliveryPipelineNotificationEvent {
22793 /// Debug message for when a notification fails to send.
22794 pub message: std::string::String,
22795
22796 /// Unique identifier of the `DeliveryPipeline`.
22797 pub pipeline_uid: std::string::String,
22798
22799 /// The name of the `Delivery Pipeline`.
22800 pub delivery_pipeline: std::string::String,
22801
22802 /// Type of this notification, e.g. for a Pub/Sub failure.
22803 pub r#type: crate::model::Type,
22804
22805 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22806}
22807
22808impl DeliveryPipelineNotificationEvent {
22809 /// Creates a new default instance.
22810 pub fn new() -> Self {
22811 std::default::Default::default()
22812 }
22813
22814 /// Sets the value of [message][crate::model::DeliveryPipelineNotificationEvent::message].
22815 ///
22816 /// # Example
22817 /// ```ignore,no_run
22818 /// # use google_cloud_deploy_v1::model::DeliveryPipelineNotificationEvent;
22819 /// let x = DeliveryPipelineNotificationEvent::new().set_message("example");
22820 /// ```
22821 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22822 self.message = v.into();
22823 self
22824 }
22825
22826 /// Sets the value of [pipeline_uid][crate::model::DeliveryPipelineNotificationEvent::pipeline_uid].
22827 ///
22828 /// # Example
22829 /// ```ignore,no_run
22830 /// # use google_cloud_deploy_v1::model::DeliveryPipelineNotificationEvent;
22831 /// let x = DeliveryPipelineNotificationEvent::new().set_pipeline_uid("example");
22832 /// ```
22833 pub fn set_pipeline_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22834 self.pipeline_uid = v.into();
22835 self
22836 }
22837
22838 /// Sets the value of [delivery_pipeline][crate::model::DeliveryPipelineNotificationEvent::delivery_pipeline].
22839 ///
22840 /// # Example
22841 /// ```ignore,no_run
22842 /// # use google_cloud_deploy_v1::model::DeliveryPipelineNotificationEvent;
22843 /// let x = DeliveryPipelineNotificationEvent::new().set_delivery_pipeline("example");
22844 /// ```
22845 pub fn set_delivery_pipeline<T: std::convert::Into<std::string::String>>(
22846 mut self,
22847 v: T,
22848 ) -> Self {
22849 self.delivery_pipeline = v.into();
22850 self
22851 }
22852
22853 /// Sets the value of [r#type][crate::model::DeliveryPipelineNotificationEvent::type].
22854 ///
22855 /// # Example
22856 /// ```ignore,no_run
22857 /// # use google_cloud_deploy_v1::model::DeliveryPipelineNotificationEvent;
22858 /// use google_cloud_deploy_v1::model::Type;
22859 /// let x0 = DeliveryPipelineNotificationEvent::new().set_type(Type::PubsubNotificationFailure);
22860 /// let x1 = DeliveryPipelineNotificationEvent::new().set_type(Type::ResourceStateChange);
22861 /// let x2 = DeliveryPipelineNotificationEvent::new().set_type(Type::ProcessAborted);
22862 /// ```
22863 pub fn set_type<T: std::convert::Into<crate::model::Type>>(mut self, v: T) -> Self {
22864 self.r#type = v.into();
22865 self
22866 }
22867}
22868
22869impl wkt::message::Message for DeliveryPipelineNotificationEvent {
22870 fn typename() -> &'static str {
22871 "type.googleapis.com/google.cloud.deploy.v1.DeliveryPipelineNotificationEvent"
22872 }
22873}
22874
22875/// Payload proto for "clouddeploy.googleapis.com/deploypolicy_evaluation"
22876/// Platform Log event that describes the deploy policy evaluation event.
22877#[derive(Clone, Default, PartialEq)]
22878#[non_exhaustive]
22879pub struct DeployPolicyEvaluationEvent {
22880 /// Debug message for when a deploy policy event occurs.
22881 pub message: std::string::String,
22882
22883 /// Rule type (e.g. Restrict Rollouts).
22884 pub rule_type: std::string::String,
22885
22886 /// Rule id.
22887 pub rule: std::string::String,
22888
22889 /// Unique identifier of the `Delivery Pipeline`.
22890 pub pipeline_uid: std::string::String,
22891
22892 /// The name of the `Delivery Pipeline`.
22893 pub delivery_pipeline: std::string::String,
22894
22895 /// Unique identifier of the `Target`. This is an optional field, as a `Target`
22896 /// may not always be applicable to a policy.
22897 pub target_uid: std::string::String,
22898
22899 /// The name of the `Target`. This is an optional field, as a `Target` may not
22900 /// always be applicable to a policy.
22901 pub target: std::string::String,
22902
22903 /// What invoked the action (e.g. a user or automation).
22904 pub invoker: crate::model::deploy_policy::Invoker,
22905
22906 /// The name of the `DeployPolicy`.
22907 pub deploy_policy: std::string::String,
22908
22909 /// Unique identifier of the `DeployPolicy`.
22910 pub deploy_policy_uid: std::string::String,
22911
22912 /// Whether the request is allowed. Allowed is set as true if:
22913 /// (1) the request complies with the policy; or
22914 /// (2) the request doesn't comply with the policy but the policy was
22915 /// overridden; or
22916 /// (3) the request doesn't comply with the policy but the policy was suspended
22917 pub allowed: bool,
22918
22919 /// The policy verdict of the request.
22920 pub verdict: crate::model::deploy_policy_evaluation_event::PolicyVerdict,
22921
22922 /// Things that could have overridden the policy verdict. Overrides together
22923 /// with verdict decide whether the request is allowed.
22924 pub overrides:
22925 std::vec::Vec<crate::model::deploy_policy_evaluation_event::PolicyVerdictOverride>,
22926
22927 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22928}
22929
22930impl DeployPolicyEvaluationEvent {
22931 /// Creates a new default instance.
22932 pub fn new() -> Self {
22933 std::default::Default::default()
22934 }
22935
22936 /// Sets the value of [message][crate::model::DeployPolicyEvaluationEvent::message].
22937 ///
22938 /// # Example
22939 /// ```ignore,no_run
22940 /// # use google_cloud_deploy_v1::model::DeployPolicyEvaluationEvent;
22941 /// let x = DeployPolicyEvaluationEvent::new().set_message("example");
22942 /// ```
22943 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22944 self.message = v.into();
22945 self
22946 }
22947
22948 /// Sets the value of [rule_type][crate::model::DeployPolicyEvaluationEvent::rule_type].
22949 ///
22950 /// # Example
22951 /// ```ignore,no_run
22952 /// # use google_cloud_deploy_v1::model::DeployPolicyEvaluationEvent;
22953 /// let x = DeployPolicyEvaluationEvent::new().set_rule_type("example");
22954 /// ```
22955 pub fn set_rule_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22956 self.rule_type = v.into();
22957 self
22958 }
22959
22960 /// Sets the value of [rule][crate::model::DeployPolicyEvaluationEvent::rule].
22961 ///
22962 /// # Example
22963 /// ```ignore,no_run
22964 /// # use google_cloud_deploy_v1::model::DeployPolicyEvaluationEvent;
22965 /// let x = DeployPolicyEvaluationEvent::new().set_rule("example");
22966 /// ```
22967 pub fn set_rule<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22968 self.rule = v.into();
22969 self
22970 }
22971
22972 /// Sets the value of [pipeline_uid][crate::model::DeployPolicyEvaluationEvent::pipeline_uid].
22973 ///
22974 /// # Example
22975 /// ```ignore,no_run
22976 /// # use google_cloud_deploy_v1::model::DeployPolicyEvaluationEvent;
22977 /// let x = DeployPolicyEvaluationEvent::new().set_pipeline_uid("example");
22978 /// ```
22979 pub fn set_pipeline_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22980 self.pipeline_uid = v.into();
22981 self
22982 }
22983
22984 /// Sets the value of [delivery_pipeline][crate::model::DeployPolicyEvaluationEvent::delivery_pipeline].
22985 ///
22986 /// # Example
22987 /// ```ignore,no_run
22988 /// # use google_cloud_deploy_v1::model::DeployPolicyEvaluationEvent;
22989 /// let x = DeployPolicyEvaluationEvent::new().set_delivery_pipeline("example");
22990 /// ```
22991 pub fn set_delivery_pipeline<T: std::convert::Into<std::string::String>>(
22992 mut self,
22993 v: T,
22994 ) -> Self {
22995 self.delivery_pipeline = v.into();
22996 self
22997 }
22998
22999 /// Sets the value of [target_uid][crate::model::DeployPolicyEvaluationEvent::target_uid].
23000 ///
23001 /// # Example
23002 /// ```ignore,no_run
23003 /// # use google_cloud_deploy_v1::model::DeployPolicyEvaluationEvent;
23004 /// let x = DeployPolicyEvaluationEvent::new().set_target_uid("example");
23005 /// ```
23006 pub fn set_target_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23007 self.target_uid = v.into();
23008 self
23009 }
23010
23011 /// Sets the value of [target][crate::model::DeployPolicyEvaluationEvent::target].
23012 ///
23013 /// # Example
23014 /// ```ignore,no_run
23015 /// # use google_cloud_deploy_v1::model::DeployPolicyEvaluationEvent;
23016 /// let x = DeployPolicyEvaluationEvent::new().set_target("example");
23017 /// ```
23018 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23019 self.target = v.into();
23020 self
23021 }
23022
23023 /// Sets the value of [invoker][crate::model::DeployPolicyEvaluationEvent::invoker].
23024 ///
23025 /// # Example
23026 /// ```ignore,no_run
23027 /// # use google_cloud_deploy_v1::model::DeployPolicyEvaluationEvent;
23028 /// use google_cloud_deploy_v1::model::deploy_policy::Invoker;
23029 /// let x0 = DeployPolicyEvaluationEvent::new().set_invoker(Invoker::User);
23030 /// let x1 = DeployPolicyEvaluationEvent::new().set_invoker(Invoker::DeployAutomation);
23031 /// ```
23032 pub fn set_invoker<T: std::convert::Into<crate::model::deploy_policy::Invoker>>(
23033 mut self,
23034 v: T,
23035 ) -> Self {
23036 self.invoker = v.into();
23037 self
23038 }
23039
23040 /// Sets the value of [deploy_policy][crate::model::DeployPolicyEvaluationEvent::deploy_policy].
23041 ///
23042 /// # Example
23043 /// ```ignore,no_run
23044 /// # use google_cloud_deploy_v1::model::DeployPolicyEvaluationEvent;
23045 /// let x = DeployPolicyEvaluationEvent::new().set_deploy_policy("example");
23046 /// ```
23047 pub fn set_deploy_policy<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23048 self.deploy_policy = v.into();
23049 self
23050 }
23051
23052 /// Sets the value of [deploy_policy_uid][crate::model::DeployPolicyEvaluationEvent::deploy_policy_uid].
23053 ///
23054 /// # Example
23055 /// ```ignore,no_run
23056 /// # use google_cloud_deploy_v1::model::DeployPolicyEvaluationEvent;
23057 /// let x = DeployPolicyEvaluationEvent::new().set_deploy_policy_uid("example");
23058 /// ```
23059 pub fn set_deploy_policy_uid<T: std::convert::Into<std::string::String>>(
23060 mut self,
23061 v: T,
23062 ) -> Self {
23063 self.deploy_policy_uid = v.into();
23064 self
23065 }
23066
23067 /// Sets the value of [allowed][crate::model::DeployPolicyEvaluationEvent::allowed].
23068 ///
23069 /// # Example
23070 /// ```ignore,no_run
23071 /// # use google_cloud_deploy_v1::model::DeployPolicyEvaluationEvent;
23072 /// let x = DeployPolicyEvaluationEvent::new().set_allowed(true);
23073 /// ```
23074 pub fn set_allowed<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
23075 self.allowed = v.into();
23076 self
23077 }
23078
23079 /// Sets the value of [verdict][crate::model::DeployPolicyEvaluationEvent::verdict].
23080 ///
23081 /// # Example
23082 /// ```ignore,no_run
23083 /// # use google_cloud_deploy_v1::model::DeployPolicyEvaluationEvent;
23084 /// use google_cloud_deploy_v1::model::deploy_policy_evaluation_event::PolicyVerdict;
23085 /// let x0 = DeployPolicyEvaluationEvent::new().set_verdict(PolicyVerdict::AllowedByPolicy);
23086 /// let x1 = DeployPolicyEvaluationEvent::new().set_verdict(PolicyVerdict::DeniedByPolicy);
23087 /// ```
23088 pub fn set_verdict<
23089 T: std::convert::Into<crate::model::deploy_policy_evaluation_event::PolicyVerdict>,
23090 >(
23091 mut self,
23092 v: T,
23093 ) -> Self {
23094 self.verdict = v.into();
23095 self
23096 }
23097
23098 /// Sets the value of [overrides][crate::model::DeployPolicyEvaluationEvent::overrides].
23099 ///
23100 /// # Example
23101 /// ```ignore,no_run
23102 /// # use google_cloud_deploy_v1::model::DeployPolicyEvaluationEvent;
23103 /// use google_cloud_deploy_v1::model::deploy_policy_evaluation_event::PolicyVerdictOverride;
23104 /// let x = DeployPolicyEvaluationEvent::new().set_overrides([
23105 /// PolicyVerdictOverride::PolicyOverridden,
23106 /// PolicyVerdictOverride::PolicySuspended,
23107 /// ]);
23108 /// ```
23109 pub fn set_overrides<T, V>(mut self, v: T) -> Self
23110 where
23111 T: std::iter::IntoIterator<Item = V>,
23112 V: std::convert::Into<crate::model::deploy_policy_evaluation_event::PolicyVerdictOverride>,
23113 {
23114 use std::iter::Iterator;
23115 self.overrides = v.into_iter().map(|i| i.into()).collect();
23116 self
23117 }
23118}
23119
23120impl wkt::message::Message for DeployPolicyEvaluationEvent {
23121 fn typename() -> &'static str {
23122 "type.googleapis.com/google.cloud.deploy.v1.DeployPolicyEvaluationEvent"
23123 }
23124}
23125
23126/// Defines additional types related to [DeployPolicyEvaluationEvent].
23127pub mod deploy_policy_evaluation_event {
23128 #[allow(unused_imports)]
23129 use super::*;
23130
23131 /// The policy verdict of the request.
23132 ///
23133 /// # Working with unknown values
23134 ///
23135 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
23136 /// additional enum variants at any time. Adding new variants is not considered
23137 /// a breaking change. Applications should write their code in anticipation of:
23138 ///
23139 /// - New values appearing in future releases of the client library, **and**
23140 /// - New values received dynamically, without application changes.
23141 ///
23142 /// Please consult the [Working with enums] section in the user guide for some
23143 /// guidelines.
23144 ///
23145 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
23146 #[derive(Clone, Debug, PartialEq)]
23147 #[non_exhaustive]
23148 pub enum PolicyVerdict {
23149 /// This should never happen.
23150 Unspecified,
23151 /// Allowed by policy. This enum value is not currently used but may be used
23152 /// in the future. Currently logs are only generated when a request is denied
23153 /// by policy.
23154 AllowedByPolicy,
23155 /// Denied by policy.
23156 DeniedByPolicy,
23157 /// If set, the enum was initialized with an unknown value.
23158 ///
23159 /// Applications can examine the value using [PolicyVerdict::value] or
23160 /// [PolicyVerdict::name].
23161 UnknownValue(policy_verdict::UnknownValue),
23162 }
23163
23164 #[doc(hidden)]
23165 pub mod policy_verdict {
23166 #[allow(unused_imports)]
23167 use super::*;
23168 #[derive(Clone, Debug, PartialEq)]
23169 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
23170 }
23171
23172 impl PolicyVerdict {
23173 /// Gets the enum value.
23174 ///
23175 /// Returns `None` if the enum contains an unknown value deserialized from
23176 /// the string representation of enums.
23177 pub fn value(&self) -> std::option::Option<i32> {
23178 match self {
23179 Self::Unspecified => std::option::Option::Some(0),
23180 Self::AllowedByPolicy => std::option::Option::Some(1),
23181 Self::DeniedByPolicy => std::option::Option::Some(2),
23182 Self::UnknownValue(u) => u.0.value(),
23183 }
23184 }
23185
23186 /// Gets the enum value as a string.
23187 ///
23188 /// Returns `None` if the enum contains an unknown value deserialized from
23189 /// the integer representation of enums.
23190 pub fn name(&self) -> std::option::Option<&str> {
23191 match self {
23192 Self::Unspecified => std::option::Option::Some("POLICY_VERDICT_UNSPECIFIED"),
23193 Self::AllowedByPolicy => std::option::Option::Some("ALLOWED_BY_POLICY"),
23194 Self::DeniedByPolicy => std::option::Option::Some("DENIED_BY_POLICY"),
23195 Self::UnknownValue(u) => u.0.name(),
23196 }
23197 }
23198 }
23199
23200 impl std::default::Default for PolicyVerdict {
23201 fn default() -> Self {
23202 use std::convert::From;
23203 Self::from(0)
23204 }
23205 }
23206
23207 impl std::fmt::Display for PolicyVerdict {
23208 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
23209 wkt::internal::display_enum(f, self.name(), self.value())
23210 }
23211 }
23212
23213 impl std::convert::From<i32> for PolicyVerdict {
23214 fn from(value: i32) -> Self {
23215 match value {
23216 0 => Self::Unspecified,
23217 1 => Self::AllowedByPolicy,
23218 2 => Self::DeniedByPolicy,
23219 _ => Self::UnknownValue(policy_verdict::UnknownValue(
23220 wkt::internal::UnknownEnumValue::Integer(value),
23221 )),
23222 }
23223 }
23224 }
23225
23226 impl std::convert::From<&str> for PolicyVerdict {
23227 fn from(value: &str) -> Self {
23228 use std::string::ToString;
23229 match value {
23230 "POLICY_VERDICT_UNSPECIFIED" => Self::Unspecified,
23231 "ALLOWED_BY_POLICY" => Self::AllowedByPolicy,
23232 "DENIED_BY_POLICY" => Self::DeniedByPolicy,
23233 _ => Self::UnknownValue(policy_verdict::UnknownValue(
23234 wkt::internal::UnknownEnumValue::String(value.to_string()),
23235 )),
23236 }
23237 }
23238 }
23239
23240 impl serde::ser::Serialize for PolicyVerdict {
23241 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
23242 where
23243 S: serde::Serializer,
23244 {
23245 match self {
23246 Self::Unspecified => serializer.serialize_i32(0),
23247 Self::AllowedByPolicy => serializer.serialize_i32(1),
23248 Self::DeniedByPolicy => serializer.serialize_i32(2),
23249 Self::UnknownValue(u) => u.0.serialize(serializer),
23250 }
23251 }
23252 }
23253
23254 impl<'de> serde::de::Deserialize<'de> for PolicyVerdict {
23255 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
23256 where
23257 D: serde::Deserializer<'de>,
23258 {
23259 deserializer.deserialize_any(wkt::internal::EnumVisitor::<PolicyVerdict>::new(
23260 ".google.cloud.deploy.v1.DeployPolicyEvaluationEvent.PolicyVerdict",
23261 ))
23262 }
23263 }
23264
23265 /// Things that could have overridden the policy verdict. When overrides are
23266 /// used, the request will be allowed even if it is DENIED_BY_POLICY.
23267 ///
23268 /// # Working with unknown values
23269 ///
23270 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
23271 /// additional enum variants at any time. Adding new variants is not considered
23272 /// a breaking change. Applications should write their code in anticipation of:
23273 ///
23274 /// - New values appearing in future releases of the client library, **and**
23275 /// - New values received dynamically, without application changes.
23276 ///
23277 /// Please consult the [Working with enums] section in the user guide for some
23278 /// guidelines.
23279 ///
23280 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
23281 #[derive(Clone, Debug, PartialEq)]
23282 #[non_exhaustive]
23283 pub enum PolicyVerdictOverride {
23284 /// This should never happen.
23285 Unspecified,
23286 /// The policy was overridden.
23287 PolicyOverridden,
23288 /// The policy was suspended.
23289 PolicySuspended,
23290 /// If set, the enum was initialized with an unknown value.
23291 ///
23292 /// Applications can examine the value using [PolicyVerdictOverride::value] or
23293 /// [PolicyVerdictOverride::name].
23294 UnknownValue(policy_verdict_override::UnknownValue),
23295 }
23296
23297 #[doc(hidden)]
23298 pub mod policy_verdict_override {
23299 #[allow(unused_imports)]
23300 use super::*;
23301 #[derive(Clone, Debug, PartialEq)]
23302 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
23303 }
23304
23305 impl PolicyVerdictOverride {
23306 /// Gets the enum value.
23307 ///
23308 /// Returns `None` if the enum contains an unknown value deserialized from
23309 /// the string representation of enums.
23310 pub fn value(&self) -> std::option::Option<i32> {
23311 match self {
23312 Self::Unspecified => std::option::Option::Some(0),
23313 Self::PolicyOverridden => std::option::Option::Some(1),
23314 Self::PolicySuspended => std::option::Option::Some(2),
23315 Self::UnknownValue(u) => u.0.value(),
23316 }
23317 }
23318
23319 /// Gets the enum value as a string.
23320 ///
23321 /// Returns `None` if the enum contains an unknown value deserialized from
23322 /// the integer representation of enums.
23323 pub fn name(&self) -> std::option::Option<&str> {
23324 match self {
23325 Self::Unspecified => {
23326 std::option::Option::Some("POLICY_VERDICT_OVERRIDE_UNSPECIFIED")
23327 }
23328 Self::PolicyOverridden => std::option::Option::Some("POLICY_OVERRIDDEN"),
23329 Self::PolicySuspended => std::option::Option::Some("POLICY_SUSPENDED"),
23330 Self::UnknownValue(u) => u.0.name(),
23331 }
23332 }
23333 }
23334
23335 impl std::default::Default for PolicyVerdictOverride {
23336 fn default() -> Self {
23337 use std::convert::From;
23338 Self::from(0)
23339 }
23340 }
23341
23342 impl std::fmt::Display for PolicyVerdictOverride {
23343 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
23344 wkt::internal::display_enum(f, self.name(), self.value())
23345 }
23346 }
23347
23348 impl std::convert::From<i32> for PolicyVerdictOverride {
23349 fn from(value: i32) -> Self {
23350 match value {
23351 0 => Self::Unspecified,
23352 1 => Self::PolicyOverridden,
23353 2 => Self::PolicySuspended,
23354 _ => Self::UnknownValue(policy_verdict_override::UnknownValue(
23355 wkt::internal::UnknownEnumValue::Integer(value),
23356 )),
23357 }
23358 }
23359 }
23360
23361 impl std::convert::From<&str> for PolicyVerdictOverride {
23362 fn from(value: &str) -> Self {
23363 use std::string::ToString;
23364 match value {
23365 "POLICY_VERDICT_OVERRIDE_UNSPECIFIED" => Self::Unspecified,
23366 "POLICY_OVERRIDDEN" => Self::PolicyOverridden,
23367 "POLICY_SUSPENDED" => Self::PolicySuspended,
23368 _ => Self::UnknownValue(policy_verdict_override::UnknownValue(
23369 wkt::internal::UnknownEnumValue::String(value.to_string()),
23370 )),
23371 }
23372 }
23373 }
23374
23375 impl serde::ser::Serialize for PolicyVerdictOverride {
23376 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
23377 where
23378 S: serde::Serializer,
23379 {
23380 match self {
23381 Self::Unspecified => serializer.serialize_i32(0),
23382 Self::PolicyOverridden => serializer.serialize_i32(1),
23383 Self::PolicySuspended => serializer.serialize_i32(2),
23384 Self::UnknownValue(u) => u.0.serialize(serializer),
23385 }
23386 }
23387 }
23388
23389 impl<'de> serde::de::Deserialize<'de> for PolicyVerdictOverride {
23390 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
23391 where
23392 D: serde::Deserializer<'de>,
23393 {
23394 deserializer.deserialize_any(wkt::internal::EnumVisitor::<PolicyVerdictOverride>::new(
23395 ".google.cloud.deploy.v1.DeployPolicyEvaluationEvent.PolicyVerdictOverride",
23396 ))
23397 }
23398 }
23399}
23400
23401/// Payload proto for "clouddeploy.googleapis.com/deploypolicy_notification".
23402/// Platform Log event that describes the failure to send a pub/sub notification
23403/// when there is a DeployPolicy status change.
23404#[derive(Clone, Default, PartialEq)]
23405#[non_exhaustive]
23406pub struct DeployPolicyNotificationEvent {
23407 /// Debug message for when a deploy policy fails to send a pub/sub
23408 /// notification.
23409 pub message: std::string::String,
23410
23411 /// The name of the `DeployPolicy`.
23412 pub deploy_policy: std::string::String,
23413
23414 /// Unique identifier of the deploy policy.
23415 pub deploy_policy_uid: std::string::String,
23416
23417 /// Type of this notification, e.g. for a Pub/Sub failure.
23418 pub r#type: crate::model::Type,
23419
23420 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23421}
23422
23423impl DeployPolicyNotificationEvent {
23424 /// Creates a new default instance.
23425 pub fn new() -> Self {
23426 std::default::Default::default()
23427 }
23428
23429 /// Sets the value of [message][crate::model::DeployPolicyNotificationEvent::message].
23430 ///
23431 /// # Example
23432 /// ```ignore,no_run
23433 /// # use google_cloud_deploy_v1::model::DeployPolicyNotificationEvent;
23434 /// let x = DeployPolicyNotificationEvent::new().set_message("example");
23435 /// ```
23436 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23437 self.message = v.into();
23438 self
23439 }
23440
23441 /// Sets the value of [deploy_policy][crate::model::DeployPolicyNotificationEvent::deploy_policy].
23442 ///
23443 /// # Example
23444 /// ```ignore,no_run
23445 /// # use google_cloud_deploy_v1::model::DeployPolicyNotificationEvent;
23446 /// let x = DeployPolicyNotificationEvent::new().set_deploy_policy("example");
23447 /// ```
23448 pub fn set_deploy_policy<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23449 self.deploy_policy = v.into();
23450 self
23451 }
23452
23453 /// Sets the value of [deploy_policy_uid][crate::model::DeployPolicyNotificationEvent::deploy_policy_uid].
23454 ///
23455 /// # Example
23456 /// ```ignore,no_run
23457 /// # use google_cloud_deploy_v1::model::DeployPolicyNotificationEvent;
23458 /// let x = DeployPolicyNotificationEvent::new().set_deploy_policy_uid("example");
23459 /// ```
23460 pub fn set_deploy_policy_uid<T: std::convert::Into<std::string::String>>(
23461 mut self,
23462 v: T,
23463 ) -> Self {
23464 self.deploy_policy_uid = v.into();
23465 self
23466 }
23467
23468 /// Sets the value of [r#type][crate::model::DeployPolicyNotificationEvent::type].
23469 ///
23470 /// # Example
23471 /// ```ignore,no_run
23472 /// # use google_cloud_deploy_v1::model::DeployPolicyNotificationEvent;
23473 /// use google_cloud_deploy_v1::model::Type;
23474 /// let x0 = DeployPolicyNotificationEvent::new().set_type(Type::PubsubNotificationFailure);
23475 /// let x1 = DeployPolicyNotificationEvent::new().set_type(Type::ResourceStateChange);
23476 /// let x2 = DeployPolicyNotificationEvent::new().set_type(Type::ProcessAborted);
23477 /// ```
23478 pub fn set_type<T: std::convert::Into<crate::model::Type>>(mut self, v: T) -> Self {
23479 self.r#type = v.into();
23480 self
23481 }
23482}
23483
23484impl wkt::message::Message for DeployPolicyNotificationEvent {
23485 fn typename() -> &'static str {
23486 "type.googleapis.com/google.cloud.deploy.v1.DeployPolicyNotificationEvent"
23487 }
23488}
23489
23490/// Payload proto for "clouddeploy.googleapis.com/jobrun_notification"
23491/// Platform Log event that describes the failure to send JobRun resource update
23492/// Pub/Sub notification.
23493#[derive(Clone, Default, PartialEq)]
23494#[non_exhaustive]
23495pub struct JobRunNotificationEvent {
23496 /// Debug message for when a notification fails to send.
23497 pub message: std::string::String,
23498
23499 /// The name of the `JobRun`.
23500 pub job_run: std::string::String,
23501
23502 /// Unique identifier of the `DeliveryPipeline`.
23503 pub pipeline_uid: std::string::String,
23504
23505 /// Unique identifier of the `Release`.
23506 pub release_uid: std::string::String,
23507
23508 /// The name of the `Release`.
23509 pub release: std::string::String,
23510
23511 /// Unique identifier of the `Rollout`.
23512 pub rollout_uid: std::string::String,
23513
23514 /// The name of the `Rollout`.
23515 pub rollout: std::string::String,
23516
23517 /// ID of the `Target`.
23518 pub target_id: std::string::String,
23519
23520 /// Type of this notification, e.g. for a Pub/Sub failure.
23521 pub r#type: crate::model::Type,
23522
23523 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23524}
23525
23526impl JobRunNotificationEvent {
23527 /// Creates a new default instance.
23528 pub fn new() -> Self {
23529 std::default::Default::default()
23530 }
23531
23532 /// Sets the value of [message][crate::model::JobRunNotificationEvent::message].
23533 ///
23534 /// # Example
23535 /// ```ignore,no_run
23536 /// # use google_cloud_deploy_v1::model::JobRunNotificationEvent;
23537 /// let x = JobRunNotificationEvent::new().set_message("example");
23538 /// ```
23539 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23540 self.message = v.into();
23541 self
23542 }
23543
23544 /// Sets the value of [job_run][crate::model::JobRunNotificationEvent::job_run].
23545 ///
23546 /// # Example
23547 /// ```ignore,no_run
23548 /// # use google_cloud_deploy_v1::model::JobRunNotificationEvent;
23549 /// let x = JobRunNotificationEvent::new().set_job_run("example");
23550 /// ```
23551 pub fn set_job_run<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23552 self.job_run = v.into();
23553 self
23554 }
23555
23556 /// Sets the value of [pipeline_uid][crate::model::JobRunNotificationEvent::pipeline_uid].
23557 ///
23558 /// # Example
23559 /// ```ignore,no_run
23560 /// # use google_cloud_deploy_v1::model::JobRunNotificationEvent;
23561 /// let x = JobRunNotificationEvent::new().set_pipeline_uid("example");
23562 /// ```
23563 pub fn set_pipeline_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23564 self.pipeline_uid = v.into();
23565 self
23566 }
23567
23568 /// Sets the value of [release_uid][crate::model::JobRunNotificationEvent::release_uid].
23569 ///
23570 /// # Example
23571 /// ```ignore,no_run
23572 /// # use google_cloud_deploy_v1::model::JobRunNotificationEvent;
23573 /// let x = JobRunNotificationEvent::new().set_release_uid("example");
23574 /// ```
23575 pub fn set_release_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23576 self.release_uid = v.into();
23577 self
23578 }
23579
23580 /// Sets the value of [release][crate::model::JobRunNotificationEvent::release].
23581 ///
23582 /// # Example
23583 /// ```ignore,no_run
23584 /// # use google_cloud_deploy_v1::model::JobRunNotificationEvent;
23585 /// let x = JobRunNotificationEvent::new().set_release("example");
23586 /// ```
23587 pub fn set_release<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23588 self.release = v.into();
23589 self
23590 }
23591
23592 /// Sets the value of [rollout_uid][crate::model::JobRunNotificationEvent::rollout_uid].
23593 ///
23594 /// # Example
23595 /// ```ignore,no_run
23596 /// # use google_cloud_deploy_v1::model::JobRunNotificationEvent;
23597 /// let x = JobRunNotificationEvent::new().set_rollout_uid("example");
23598 /// ```
23599 pub fn set_rollout_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23600 self.rollout_uid = v.into();
23601 self
23602 }
23603
23604 /// Sets the value of [rollout][crate::model::JobRunNotificationEvent::rollout].
23605 ///
23606 /// # Example
23607 /// ```ignore,no_run
23608 /// # use google_cloud_deploy_v1::model::JobRunNotificationEvent;
23609 /// let x = JobRunNotificationEvent::new().set_rollout("example");
23610 /// ```
23611 pub fn set_rollout<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23612 self.rollout = v.into();
23613 self
23614 }
23615
23616 /// Sets the value of [target_id][crate::model::JobRunNotificationEvent::target_id].
23617 ///
23618 /// # Example
23619 /// ```ignore,no_run
23620 /// # use google_cloud_deploy_v1::model::JobRunNotificationEvent;
23621 /// let x = JobRunNotificationEvent::new().set_target_id("example");
23622 /// ```
23623 pub fn set_target_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23624 self.target_id = v.into();
23625 self
23626 }
23627
23628 /// Sets the value of [r#type][crate::model::JobRunNotificationEvent::type].
23629 ///
23630 /// # Example
23631 /// ```ignore,no_run
23632 /// # use google_cloud_deploy_v1::model::JobRunNotificationEvent;
23633 /// use google_cloud_deploy_v1::model::Type;
23634 /// let x0 = JobRunNotificationEvent::new().set_type(Type::PubsubNotificationFailure);
23635 /// let x1 = JobRunNotificationEvent::new().set_type(Type::ResourceStateChange);
23636 /// let x2 = JobRunNotificationEvent::new().set_type(Type::ProcessAborted);
23637 /// ```
23638 pub fn set_type<T: std::convert::Into<crate::model::Type>>(mut self, v: T) -> Self {
23639 self.r#type = v.into();
23640 self
23641 }
23642}
23643
23644impl wkt::message::Message for JobRunNotificationEvent {
23645 fn typename() -> &'static str {
23646 "type.googleapis.com/google.cloud.deploy.v1.JobRunNotificationEvent"
23647 }
23648}
23649
23650/// Payload proto for "clouddeploy.googleapis.com/release_notification"
23651/// Platform Log event that describes the failure to send release status change
23652/// Pub/Sub notification.
23653#[derive(Clone, Default, PartialEq)]
23654#[non_exhaustive]
23655pub struct ReleaseNotificationEvent {
23656 /// Debug message for when a notification fails to send.
23657 pub message: std::string::String,
23658
23659 /// Unique identifier of the `DeliveryPipeline`.
23660 pub pipeline_uid: std::string::String,
23661
23662 /// Unique identifier of the `Release`.
23663 pub release_uid: std::string::String,
23664
23665 /// The name of the `Release`.
23666 pub release: std::string::String,
23667
23668 /// Type of this notification, e.g. for a Pub/Sub failure.
23669 pub r#type: crate::model::Type,
23670
23671 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23672}
23673
23674impl ReleaseNotificationEvent {
23675 /// Creates a new default instance.
23676 pub fn new() -> Self {
23677 std::default::Default::default()
23678 }
23679
23680 /// Sets the value of [message][crate::model::ReleaseNotificationEvent::message].
23681 ///
23682 /// # Example
23683 /// ```ignore,no_run
23684 /// # use google_cloud_deploy_v1::model::ReleaseNotificationEvent;
23685 /// let x = ReleaseNotificationEvent::new().set_message("example");
23686 /// ```
23687 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23688 self.message = v.into();
23689 self
23690 }
23691
23692 /// Sets the value of [pipeline_uid][crate::model::ReleaseNotificationEvent::pipeline_uid].
23693 ///
23694 /// # Example
23695 /// ```ignore,no_run
23696 /// # use google_cloud_deploy_v1::model::ReleaseNotificationEvent;
23697 /// let x = ReleaseNotificationEvent::new().set_pipeline_uid("example");
23698 /// ```
23699 pub fn set_pipeline_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23700 self.pipeline_uid = v.into();
23701 self
23702 }
23703
23704 /// Sets the value of [release_uid][crate::model::ReleaseNotificationEvent::release_uid].
23705 ///
23706 /// # Example
23707 /// ```ignore,no_run
23708 /// # use google_cloud_deploy_v1::model::ReleaseNotificationEvent;
23709 /// let x = ReleaseNotificationEvent::new().set_release_uid("example");
23710 /// ```
23711 pub fn set_release_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23712 self.release_uid = v.into();
23713 self
23714 }
23715
23716 /// Sets the value of [release][crate::model::ReleaseNotificationEvent::release].
23717 ///
23718 /// # Example
23719 /// ```ignore,no_run
23720 /// # use google_cloud_deploy_v1::model::ReleaseNotificationEvent;
23721 /// let x = ReleaseNotificationEvent::new().set_release("example");
23722 /// ```
23723 pub fn set_release<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23724 self.release = v.into();
23725 self
23726 }
23727
23728 /// Sets the value of [r#type][crate::model::ReleaseNotificationEvent::type].
23729 ///
23730 /// # Example
23731 /// ```ignore,no_run
23732 /// # use google_cloud_deploy_v1::model::ReleaseNotificationEvent;
23733 /// use google_cloud_deploy_v1::model::Type;
23734 /// let x0 = ReleaseNotificationEvent::new().set_type(Type::PubsubNotificationFailure);
23735 /// let x1 = ReleaseNotificationEvent::new().set_type(Type::ResourceStateChange);
23736 /// let x2 = ReleaseNotificationEvent::new().set_type(Type::ProcessAborted);
23737 /// ```
23738 pub fn set_type<T: std::convert::Into<crate::model::Type>>(mut self, v: T) -> Self {
23739 self.r#type = v.into();
23740 self
23741 }
23742}
23743
23744impl wkt::message::Message for ReleaseNotificationEvent {
23745 fn typename() -> &'static str {
23746 "type.googleapis.com/google.cloud.deploy.v1.ReleaseNotificationEvent"
23747 }
23748}
23749
23750/// Payload proto for "clouddeploy.googleapis.com/release_render"
23751/// Platform Log event that describes the render status change.
23752#[derive(Clone, Default, PartialEq)]
23753#[non_exhaustive]
23754pub struct ReleaseRenderEvent {
23755 /// Debug message for when a render transition occurs. Provides further
23756 /// details as rendering progresses through render states.
23757 pub message: std::string::String,
23758
23759 /// Unique identifier of the `DeliveryPipeline`.
23760 pub pipeline_uid: std::string::String,
23761
23762 /// The name of the release.
23763 /// release_uid is not in this log message because we write some of these log
23764 /// messages at release creation time, before we've generated the uid.
23765 pub release: std::string::String,
23766
23767 /// Type of this notification, e.g. for a release render state change event.
23768 pub r#type: crate::model::Type,
23769
23770 /// The state of the release render.
23771 pub release_render_state: crate::model::release::RenderState,
23772
23773 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23774}
23775
23776impl ReleaseRenderEvent {
23777 /// Creates a new default instance.
23778 pub fn new() -> Self {
23779 std::default::Default::default()
23780 }
23781
23782 /// Sets the value of [message][crate::model::ReleaseRenderEvent::message].
23783 ///
23784 /// # Example
23785 /// ```ignore,no_run
23786 /// # use google_cloud_deploy_v1::model::ReleaseRenderEvent;
23787 /// let x = ReleaseRenderEvent::new().set_message("example");
23788 /// ```
23789 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23790 self.message = v.into();
23791 self
23792 }
23793
23794 /// Sets the value of [pipeline_uid][crate::model::ReleaseRenderEvent::pipeline_uid].
23795 ///
23796 /// # Example
23797 /// ```ignore,no_run
23798 /// # use google_cloud_deploy_v1::model::ReleaseRenderEvent;
23799 /// let x = ReleaseRenderEvent::new().set_pipeline_uid("example");
23800 /// ```
23801 pub fn set_pipeline_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23802 self.pipeline_uid = v.into();
23803 self
23804 }
23805
23806 /// Sets the value of [release][crate::model::ReleaseRenderEvent::release].
23807 ///
23808 /// # Example
23809 /// ```ignore,no_run
23810 /// # use google_cloud_deploy_v1::model::ReleaseRenderEvent;
23811 /// let x = ReleaseRenderEvent::new().set_release("example");
23812 /// ```
23813 pub fn set_release<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23814 self.release = v.into();
23815 self
23816 }
23817
23818 /// Sets the value of [r#type][crate::model::ReleaseRenderEvent::type].
23819 ///
23820 /// # Example
23821 /// ```ignore,no_run
23822 /// # use google_cloud_deploy_v1::model::ReleaseRenderEvent;
23823 /// use google_cloud_deploy_v1::model::Type;
23824 /// let x0 = ReleaseRenderEvent::new().set_type(Type::PubsubNotificationFailure);
23825 /// let x1 = ReleaseRenderEvent::new().set_type(Type::ResourceStateChange);
23826 /// let x2 = ReleaseRenderEvent::new().set_type(Type::ProcessAborted);
23827 /// ```
23828 pub fn set_type<T: std::convert::Into<crate::model::Type>>(mut self, v: T) -> Self {
23829 self.r#type = v.into();
23830 self
23831 }
23832
23833 /// Sets the value of [release_render_state][crate::model::ReleaseRenderEvent::release_render_state].
23834 ///
23835 /// # Example
23836 /// ```ignore,no_run
23837 /// # use google_cloud_deploy_v1::model::ReleaseRenderEvent;
23838 /// use google_cloud_deploy_v1::model::release::RenderState;
23839 /// let x0 = ReleaseRenderEvent::new().set_release_render_state(RenderState::Succeeded);
23840 /// let x1 = ReleaseRenderEvent::new().set_release_render_state(RenderState::Failed);
23841 /// let x2 = ReleaseRenderEvent::new().set_release_render_state(RenderState::InProgress);
23842 /// ```
23843 pub fn set_release_render_state<T: std::convert::Into<crate::model::release::RenderState>>(
23844 mut self,
23845 v: T,
23846 ) -> Self {
23847 self.release_render_state = v.into();
23848 self
23849 }
23850}
23851
23852impl wkt::message::Message for ReleaseRenderEvent {
23853 fn typename() -> &'static str {
23854 "type.googleapis.com/google.cloud.deploy.v1.ReleaseRenderEvent"
23855 }
23856}
23857
23858/// Payload proto for "clouddeploy.googleapis.com/rollout_notification"
23859/// Platform Log event that describes the failure to send rollout status change
23860/// Pub/Sub notification.
23861#[derive(Clone, Default, PartialEq)]
23862#[non_exhaustive]
23863pub struct RolloutNotificationEvent {
23864 /// Debug message for when a notification fails to send.
23865 pub message: std::string::String,
23866
23867 /// Unique identifier of the `DeliveryPipeline`.
23868 pub pipeline_uid: std::string::String,
23869
23870 /// Unique identifier of the `Release`.
23871 pub release_uid: std::string::String,
23872
23873 /// The name of the `Release`.
23874 pub release: std::string::String,
23875
23876 /// Unique identifier of the `Rollout`.
23877 pub rollout_uid: std::string::String,
23878
23879 /// The name of the `Rollout`.
23880 pub rollout: std::string::String,
23881
23882 /// ID of the `Target` that the rollout is deployed to.
23883 pub target_id: std::string::String,
23884
23885 /// Type of this notification, e.g. for a Pub/Sub failure.
23886 pub r#type: crate::model::Type,
23887
23888 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23889}
23890
23891impl RolloutNotificationEvent {
23892 /// Creates a new default instance.
23893 pub fn new() -> Self {
23894 std::default::Default::default()
23895 }
23896
23897 /// Sets the value of [message][crate::model::RolloutNotificationEvent::message].
23898 ///
23899 /// # Example
23900 /// ```ignore,no_run
23901 /// # use google_cloud_deploy_v1::model::RolloutNotificationEvent;
23902 /// let x = RolloutNotificationEvent::new().set_message("example");
23903 /// ```
23904 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23905 self.message = v.into();
23906 self
23907 }
23908
23909 /// Sets the value of [pipeline_uid][crate::model::RolloutNotificationEvent::pipeline_uid].
23910 ///
23911 /// # Example
23912 /// ```ignore,no_run
23913 /// # use google_cloud_deploy_v1::model::RolloutNotificationEvent;
23914 /// let x = RolloutNotificationEvent::new().set_pipeline_uid("example");
23915 /// ```
23916 pub fn set_pipeline_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23917 self.pipeline_uid = v.into();
23918 self
23919 }
23920
23921 /// Sets the value of [release_uid][crate::model::RolloutNotificationEvent::release_uid].
23922 ///
23923 /// # Example
23924 /// ```ignore,no_run
23925 /// # use google_cloud_deploy_v1::model::RolloutNotificationEvent;
23926 /// let x = RolloutNotificationEvent::new().set_release_uid("example");
23927 /// ```
23928 pub fn set_release_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23929 self.release_uid = v.into();
23930 self
23931 }
23932
23933 /// Sets the value of [release][crate::model::RolloutNotificationEvent::release].
23934 ///
23935 /// # Example
23936 /// ```ignore,no_run
23937 /// # use google_cloud_deploy_v1::model::RolloutNotificationEvent;
23938 /// let x = RolloutNotificationEvent::new().set_release("example");
23939 /// ```
23940 pub fn set_release<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23941 self.release = v.into();
23942 self
23943 }
23944
23945 /// Sets the value of [rollout_uid][crate::model::RolloutNotificationEvent::rollout_uid].
23946 ///
23947 /// # Example
23948 /// ```ignore,no_run
23949 /// # use google_cloud_deploy_v1::model::RolloutNotificationEvent;
23950 /// let x = RolloutNotificationEvent::new().set_rollout_uid("example");
23951 /// ```
23952 pub fn set_rollout_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23953 self.rollout_uid = v.into();
23954 self
23955 }
23956
23957 /// Sets the value of [rollout][crate::model::RolloutNotificationEvent::rollout].
23958 ///
23959 /// # Example
23960 /// ```ignore,no_run
23961 /// # use google_cloud_deploy_v1::model::RolloutNotificationEvent;
23962 /// let x = RolloutNotificationEvent::new().set_rollout("example");
23963 /// ```
23964 pub fn set_rollout<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23965 self.rollout = v.into();
23966 self
23967 }
23968
23969 /// Sets the value of [target_id][crate::model::RolloutNotificationEvent::target_id].
23970 ///
23971 /// # Example
23972 /// ```ignore,no_run
23973 /// # use google_cloud_deploy_v1::model::RolloutNotificationEvent;
23974 /// let x = RolloutNotificationEvent::new().set_target_id("example");
23975 /// ```
23976 pub fn set_target_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23977 self.target_id = v.into();
23978 self
23979 }
23980
23981 /// Sets the value of [r#type][crate::model::RolloutNotificationEvent::type].
23982 ///
23983 /// # Example
23984 /// ```ignore,no_run
23985 /// # use google_cloud_deploy_v1::model::RolloutNotificationEvent;
23986 /// use google_cloud_deploy_v1::model::Type;
23987 /// let x0 = RolloutNotificationEvent::new().set_type(Type::PubsubNotificationFailure);
23988 /// let x1 = RolloutNotificationEvent::new().set_type(Type::ResourceStateChange);
23989 /// let x2 = RolloutNotificationEvent::new().set_type(Type::ProcessAborted);
23990 /// ```
23991 pub fn set_type<T: std::convert::Into<crate::model::Type>>(mut self, v: T) -> Self {
23992 self.r#type = v.into();
23993 self
23994 }
23995}
23996
23997impl wkt::message::Message for RolloutNotificationEvent {
23998 fn typename() -> &'static str {
23999 "type.googleapis.com/google.cloud.deploy.v1.RolloutNotificationEvent"
24000 }
24001}
24002
24003/// Payload proto for "clouddeploy.googleapis.com/rollout_update"
24004/// Platform Log event that describes the rollout update event.
24005#[derive(Clone, Default, PartialEq)]
24006#[non_exhaustive]
24007pub struct RolloutUpdateEvent {
24008 /// Debug message for when a rollout update event occurs.
24009 pub message: std::string::String,
24010
24011 /// Unique identifier of the pipeline.
24012 pub pipeline_uid: std::string::String,
24013
24014 /// Unique identifier of the release.
24015 pub release_uid: std::string::String,
24016
24017 /// The name of the `Release`.
24018 pub release: std::string::String,
24019
24020 /// The name of the rollout.
24021 /// rollout_uid is not in this log message because we write some of these log
24022 /// messages at rollout creation time, before we've generated the uid.
24023 pub rollout: std::string::String,
24024
24025 /// ID of the target.
24026 pub target_id: std::string::String,
24027
24028 /// Type of this notification, e.g. for a rollout update event.
24029 pub r#type: crate::model::Type,
24030
24031 /// The type of the rollout update.
24032 pub rollout_update_type: crate::model::rollout_update_event::RolloutUpdateType,
24033
24034 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24035}
24036
24037impl RolloutUpdateEvent {
24038 /// Creates a new default instance.
24039 pub fn new() -> Self {
24040 std::default::Default::default()
24041 }
24042
24043 /// Sets the value of [message][crate::model::RolloutUpdateEvent::message].
24044 ///
24045 /// # Example
24046 /// ```ignore,no_run
24047 /// # use google_cloud_deploy_v1::model::RolloutUpdateEvent;
24048 /// let x = RolloutUpdateEvent::new().set_message("example");
24049 /// ```
24050 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24051 self.message = v.into();
24052 self
24053 }
24054
24055 /// Sets the value of [pipeline_uid][crate::model::RolloutUpdateEvent::pipeline_uid].
24056 ///
24057 /// # Example
24058 /// ```ignore,no_run
24059 /// # use google_cloud_deploy_v1::model::RolloutUpdateEvent;
24060 /// let x = RolloutUpdateEvent::new().set_pipeline_uid("example");
24061 /// ```
24062 pub fn set_pipeline_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24063 self.pipeline_uid = v.into();
24064 self
24065 }
24066
24067 /// Sets the value of [release_uid][crate::model::RolloutUpdateEvent::release_uid].
24068 ///
24069 /// # Example
24070 /// ```ignore,no_run
24071 /// # use google_cloud_deploy_v1::model::RolloutUpdateEvent;
24072 /// let x = RolloutUpdateEvent::new().set_release_uid("example");
24073 /// ```
24074 pub fn set_release_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24075 self.release_uid = v.into();
24076 self
24077 }
24078
24079 /// Sets the value of [release][crate::model::RolloutUpdateEvent::release].
24080 ///
24081 /// # Example
24082 /// ```ignore,no_run
24083 /// # use google_cloud_deploy_v1::model::RolloutUpdateEvent;
24084 /// let x = RolloutUpdateEvent::new().set_release("example");
24085 /// ```
24086 pub fn set_release<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24087 self.release = v.into();
24088 self
24089 }
24090
24091 /// Sets the value of [rollout][crate::model::RolloutUpdateEvent::rollout].
24092 ///
24093 /// # Example
24094 /// ```ignore,no_run
24095 /// # use google_cloud_deploy_v1::model::RolloutUpdateEvent;
24096 /// let x = RolloutUpdateEvent::new().set_rollout("example");
24097 /// ```
24098 pub fn set_rollout<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24099 self.rollout = v.into();
24100 self
24101 }
24102
24103 /// Sets the value of [target_id][crate::model::RolloutUpdateEvent::target_id].
24104 ///
24105 /// # Example
24106 /// ```ignore,no_run
24107 /// # use google_cloud_deploy_v1::model::RolloutUpdateEvent;
24108 /// let x = RolloutUpdateEvent::new().set_target_id("example");
24109 /// ```
24110 pub fn set_target_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24111 self.target_id = v.into();
24112 self
24113 }
24114
24115 /// Sets the value of [r#type][crate::model::RolloutUpdateEvent::type].
24116 ///
24117 /// # Example
24118 /// ```ignore,no_run
24119 /// # use google_cloud_deploy_v1::model::RolloutUpdateEvent;
24120 /// use google_cloud_deploy_v1::model::Type;
24121 /// let x0 = RolloutUpdateEvent::new().set_type(Type::PubsubNotificationFailure);
24122 /// let x1 = RolloutUpdateEvent::new().set_type(Type::ResourceStateChange);
24123 /// let x2 = RolloutUpdateEvent::new().set_type(Type::ProcessAborted);
24124 /// ```
24125 pub fn set_type<T: std::convert::Into<crate::model::Type>>(mut self, v: T) -> Self {
24126 self.r#type = v.into();
24127 self
24128 }
24129
24130 /// Sets the value of [rollout_update_type][crate::model::RolloutUpdateEvent::rollout_update_type].
24131 ///
24132 /// # Example
24133 /// ```ignore,no_run
24134 /// # use google_cloud_deploy_v1::model::RolloutUpdateEvent;
24135 /// use google_cloud_deploy_v1::model::rollout_update_event::RolloutUpdateType;
24136 /// let x0 = RolloutUpdateEvent::new().set_rollout_update_type(RolloutUpdateType::Pending);
24137 /// let x1 = RolloutUpdateEvent::new().set_rollout_update_type(RolloutUpdateType::PendingRelease);
24138 /// let x2 = RolloutUpdateEvent::new().set_rollout_update_type(RolloutUpdateType::InProgress);
24139 /// ```
24140 pub fn set_rollout_update_type<
24141 T: std::convert::Into<crate::model::rollout_update_event::RolloutUpdateType>,
24142 >(
24143 mut self,
24144 v: T,
24145 ) -> Self {
24146 self.rollout_update_type = v.into();
24147 self
24148 }
24149}
24150
24151impl wkt::message::Message for RolloutUpdateEvent {
24152 fn typename() -> &'static str {
24153 "type.googleapis.com/google.cloud.deploy.v1.RolloutUpdateEvent"
24154 }
24155}
24156
24157/// Defines additional types related to [RolloutUpdateEvent].
24158pub mod rollout_update_event {
24159 #[allow(unused_imports)]
24160 use super::*;
24161
24162 /// RolloutUpdateType indicates the type of the rollout update.
24163 ///
24164 /// # Working with unknown values
24165 ///
24166 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
24167 /// additional enum variants at any time. Adding new variants is not considered
24168 /// a breaking change. Applications should write their code in anticipation of:
24169 ///
24170 /// - New values appearing in future releases of the client library, **and**
24171 /// - New values received dynamically, without application changes.
24172 ///
24173 /// Please consult the [Working with enums] section in the user guide for some
24174 /// guidelines.
24175 ///
24176 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
24177 #[derive(Clone, Debug, PartialEq)]
24178 #[non_exhaustive]
24179 pub enum RolloutUpdateType {
24180 /// Rollout update type unspecified.
24181 Unspecified,
24182 /// rollout state updated to pending.
24183 Pending,
24184 /// Rollout state updated to pending release.
24185 PendingRelease,
24186 /// Rollout state updated to in progress.
24187 InProgress,
24188 /// Rollout state updated to cancelling.
24189 Cancelling,
24190 /// Rollout state updated to cancelled.
24191 Cancelled,
24192 /// Rollout state updated to halted.
24193 Halted,
24194 /// Rollout state updated to succeeded.
24195 Succeeded,
24196 /// Rollout state updated to failed.
24197 Failed,
24198 /// Rollout requires approval.
24199 ApprovalRequired,
24200 /// Rollout has been approved.
24201 Approved,
24202 /// Rollout has been rejected.
24203 Rejected,
24204 /// Rollout requires advance to the next phase.
24205 AdvanceRequired,
24206 /// Rollout has been advanced.
24207 Advanced,
24208 /// If set, the enum was initialized with an unknown value.
24209 ///
24210 /// Applications can examine the value using [RolloutUpdateType::value] or
24211 /// [RolloutUpdateType::name].
24212 UnknownValue(rollout_update_type::UnknownValue),
24213 }
24214
24215 #[doc(hidden)]
24216 pub mod rollout_update_type {
24217 #[allow(unused_imports)]
24218 use super::*;
24219 #[derive(Clone, Debug, PartialEq)]
24220 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
24221 }
24222
24223 impl RolloutUpdateType {
24224 /// Gets the enum value.
24225 ///
24226 /// Returns `None` if the enum contains an unknown value deserialized from
24227 /// the string representation of enums.
24228 pub fn value(&self) -> std::option::Option<i32> {
24229 match self {
24230 Self::Unspecified => std::option::Option::Some(0),
24231 Self::Pending => std::option::Option::Some(1),
24232 Self::PendingRelease => std::option::Option::Some(2),
24233 Self::InProgress => std::option::Option::Some(3),
24234 Self::Cancelling => std::option::Option::Some(4),
24235 Self::Cancelled => std::option::Option::Some(5),
24236 Self::Halted => std::option::Option::Some(6),
24237 Self::Succeeded => std::option::Option::Some(7),
24238 Self::Failed => std::option::Option::Some(8),
24239 Self::ApprovalRequired => std::option::Option::Some(9),
24240 Self::Approved => std::option::Option::Some(10),
24241 Self::Rejected => std::option::Option::Some(11),
24242 Self::AdvanceRequired => std::option::Option::Some(12),
24243 Self::Advanced => std::option::Option::Some(13),
24244 Self::UnknownValue(u) => u.0.value(),
24245 }
24246 }
24247
24248 /// Gets the enum value as a string.
24249 ///
24250 /// Returns `None` if the enum contains an unknown value deserialized from
24251 /// the integer representation of enums.
24252 pub fn name(&self) -> std::option::Option<&str> {
24253 match self {
24254 Self::Unspecified => std::option::Option::Some("ROLLOUT_UPDATE_TYPE_UNSPECIFIED"),
24255 Self::Pending => std::option::Option::Some("PENDING"),
24256 Self::PendingRelease => std::option::Option::Some("PENDING_RELEASE"),
24257 Self::InProgress => std::option::Option::Some("IN_PROGRESS"),
24258 Self::Cancelling => std::option::Option::Some("CANCELLING"),
24259 Self::Cancelled => std::option::Option::Some("CANCELLED"),
24260 Self::Halted => std::option::Option::Some("HALTED"),
24261 Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
24262 Self::Failed => std::option::Option::Some("FAILED"),
24263 Self::ApprovalRequired => std::option::Option::Some("APPROVAL_REQUIRED"),
24264 Self::Approved => std::option::Option::Some("APPROVED"),
24265 Self::Rejected => std::option::Option::Some("REJECTED"),
24266 Self::AdvanceRequired => std::option::Option::Some("ADVANCE_REQUIRED"),
24267 Self::Advanced => std::option::Option::Some("ADVANCED"),
24268 Self::UnknownValue(u) => u.0.name(),
24269 }
24270 }
24271 }
24272
24273 impl std::default::Default for RolloutUpdateType {
24274 fn default() -> Self {
24275 use std::convert::From;
24276 Self::from(0)
24277 }
24278 }
24279
24280 impl std::fmt::Display for RolloutUpdateType {
24281 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
24282 wkt::internal::display_enum(f, self.name(), self.value())
24283 }
24284 }
24285
24286 impl std::convert::From<i32> for RolloutUpdateType {
24287 fn from(value: i32) -> Self {
24288 match value {
24289 0 => Self::Unspecified,
24290 1 => Self::Pending,
24291 2 => Self::PendingRelease,
24292 3 => Self::InProgress,
24293 4 => Self::Cancelling,
24294 5 => Self::Cancelled,
24295 6 => Self::Halted,
24296 7 => Self::Succeeded,
24297 8 => Self::Failed,
24298 9 => Self::ApprovalRequired,
24299 10 => Self::Approved,
24300 11 => Self::Rejected,
24301 12 => Self::AdvanceRequired,
24302 13 => Self::Advanced,
24303 _ => Self::UnknownValue(rollout_update_type::UnknownValue(
24304 wkt::internal::UnknownEnumValue::Integer(value),
24305 )),
24306 }
24307 }
24308 }
24309
24310 impl std::convert::From<&str> for RolloutUpdateType {
24311 fn from(value: &str) -> Self {
24312 use std::string::ToString;
24313 match value {
24314 "ROLLOUT_UPDATE_TYPE_UNSPECIFIED" => Self::Unspecified,
24315 "PENDING" => Self::Pending,
24316 "PENDING_RELEASE" => Self::PendingRelease,
24317 "IN_PROGRESS" => Self::InProgress,
24318 "CANCELLING" => Self::Cancelling,
24319 "CANCELLED" => Self::Cancelled,
24320 "HALTED" => Self::Halted,
24321 "SUCCEEDED" => Self::Succeeded,
24322 "FAILED" => Self::Failed,
24323 "APPROVAL_REQUIRED" => Self::ApprovalRequired,
24324 "APPROVED" => Self::Approved,
24325 "REJECTED" => Self::Rejected,
24326 "ADVANCE_REQUIRED" => Self::AdvanceRequired,
24327 "ADVANCED" => Self::Advanced,
24328 _ => Self::UnknownValue(rollout_update_type::UnknownValue(
24329 wkt::internal::UnknownEnumValue::String(value.to_string()),
24330 )),
24331 }
24332 }
24333 }
24334
24335 impl serde::ser::Serialize for RolloutUpdateType {
24336 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
24337 where
24338 S: serde::Serializer,
24339 {
24340 match self {
24341 Self::Unspecified => serializer.serialize_i32(0),
24342 Self::Pending => serializer.serialize_i32(1),
24343 Self::PendingRelease => serializer.serialize_i32(2),
24344 Self::InProgress => serializer.serialize_i32(3),
24345 Self::Cancelling => serializer.serialize_i32(4),
24346 Self::Cancelled => serializer.serialize_i32(5),
24347 Self::Halted => serializer.serialize_i32(6),
24348 Self::Succeeded => serializer.serialize_i32(7),
24349 Self::Failed => serializer.serialize_i32(8),
24350 Self::ApprovalRequired => serializer.serialize_i32(9),
24351 Self::Approved => serializer.serialize_i32(10),
24352 Self::Rejected => serializer.serialize_i32(11),
24353 Self::AdvanceRequired => serializer.serialize_i32(12),
24354 Self::Advanced => serializer.serialize_i32(13),
24355 Self::UnknownValue(u) => u.0.serialize(serializer),
24356 }
24357 }
24358 }
24359
24360 impl<'de> serde::de::Deserialize<'de> for RolloutUpdateType {
24361 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
24362 where
24363 D: serde::Deserializer<'de>,
24364 {
24365 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RolloutUpdateType>::new(
24366 ".google.cloud.deploy.v1.RolloutUpdateEvent.RolloutUpdateType",
24367 ))
24368 }
24369 }
24370}
24371
24372/// Payload proto for "clouddeploy.googleapis.com/target_notification"
24373/// Platform Log event that describes the failure to send target status change
24374/// Pub/Sub notification.
24375#[derive(Clone, Default, PartialEq)]
24376#[non_exhaustive]
24377pub struct TargetNotificationEvent {
24378 /// Debug message for when a notification fails to send.
24379 pub message: std::string::String,
24380
24381 /// The name of the `Target`.
24382 pub target: std::string::String,
24383
24384 /// Type of this notification, e.g. for a Pub/Sub failure.
24385 pub r#type: crate::model::Type,
24386
24387 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24388}
24389
24390impl TargetNotificationEvent {
24391 /// Creates a new default instance.
24392 pub fn new() -> Self {
24393 std::default::Default::default()
24394 }
24395
24396 /// Sets the value of [message][crate::model::TargetNotificationEvent::message].
24397 ///
24398 /// # Example
24399 /// ```ignore,no_run
24400 /// # use google_cloud_deploy_v1::model::TargetNotificationEvent;
24401 /// let x = TargetNotificationEvent::new().set_message("example");
24402 /// ```
24403 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24404 self.message = v.into();
24405 self
24406 }
24407
24408 /// Sets the value of [target][crate::model::TargetNotificationEvent::target].
24409 ///
24410 /// # Example
24411 /// ```ignore,no_run
24412 /// # use google_cloud_deploy_v1::model::TargetNotificationEvent;
24413 /// let x = TargetNotificationEvent::new().set_target("example");
24414 /// ```
24415 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24416 self.target = v.into();
24417 self
24418 }
24419
24420 /// Sets the value of [r#type][crate::model::TargetNotificationEvent::type].
24421 ///
24422 /// # Example
24423 /// ```ignore,no_run
24424 /// # use google_cloud_deploy_v1::model::TargetNotificationEvent;
24425 /// use google_cloud_deploy_v1::model::Type;
24426 /// let x0 = TargetNotificationEvent::new().set_type(Type::PubsubNotificationFailure);
24427 /// let x1 = TargetNotificationEvent::new().set_type(Type::ResourceStateChange);
24428 /// let x2 = TargetNotificationEvent::new().set_type(Type::ProcessAborted);
24429 /// ```
24430 pub fn set_type<T: std::convert::Into<crate::model::Type>>(mut self, v: T) -> Self {
24431 self.r#type = v.into();
24432 self
24433 }
24434}
24435
24436impl wkt::message::Message for TargetNotificationEvent {
24437 fn typename() -> &'static str {
24438 "type.googleapis.com/google.cloud.deploy.v1.TargetNotificationEvent"
24439 }
24440}
24441
24442/// The support state of a specific Skaffold version.
24443///
24444/// # Working with unknown values
24445///
24446/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
24447/// additional enum variants at any time. Adding new variants is not considered
24448/// a breaking change. Applications should write their code in anticipation of:
24449///
24450/// - New values appearing in future releases of the client library, **and**
24451/// - New values received dynamically, without application changes.
24452///
24453/// Please consult the [Working with enums] section in the user guide for some
24454/// guidelines.
24455///
24456/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
24457#[derive(Clone, Debug, PartialEq)]
24458#[non_exhaustive]
24459pub enum SkaffoldSupportState {
24460 /// Default value. This value is unused.
24461 Unspecified,
24462 /// This Skaffold version is currently supported.
24463 Supported,
24464 /// This Skaffold version is in maintenance mode.
24465 MaintenanceMode,
24466 /// This Skaffold version is no longer supported.
24467 Unsupported,
24468 /// If set, the enum was initialized with an unknown value.
24469 ///
24470 /// Applications can examine the value using [SkaffoldSupportState::value] or
24471 /// [SkaffoldSupportState::name].
24472 UnknownValue(skaffold_support_state::UnknownValue),
24473}
24474
24475#[doc(hidden)]
24476pub mod skaffold_support_state {
24477 #[allow(unused_imports)]
24478 use super::*;
24479 #[derive(Clone, Debug, PartialEq)]
24480 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
24481}
24482
24483impl SkaffoldSupportState {
24484 /// Gets the enum value.
24485 ///
24486 /// Returns `None` if the enum contains an unknown value deserialized from
24487 /// the string representation of enums.
24488 pub fn value(&self) -> std::option::Option<i32> {
24489 match self {
24490 Self::Unspecified => std::option::Option::Some(0),
24491 Self::Supported => std::option::Option::Some(1),
24492 Self::MaintenanceMode => std::option::Option::Some(2),
24493 Self::Unsupported => std::option::Option::Some(3),
24494 Self::UnknownValue(u) => u.0.value(),
24495 }
24496 }
24497
24498 /// Gets the enum value as a string.
24499 ///
24500 /// Returns `None` if the enum contains an unknown value deserialized from
24501 /// the integer representation of enums.
24502 pub fn name(&self) -> std::option::Option<&str> {
24503 match self {
24504 Self::Unspecified => std::option::Option::Some("SKAFFOLD_SUPPORT_STATE_UNSPECIFIED"),
24505 Self::Supported => std::option::Option::Some("SKAFFOLD_SUPPORT_STATE_SUPPORTED"),
24506 Self::MaintenanceMode => {
24507 std::option::Option::Some("SKAFFOLD_SUPPORT_STATE_MAINTENANCE_MODE")
24508 }
24509 Self::Unsupported => std::option::Option::Some("SKAFFOLD_SUPPORT_STATE_UNSUPPORTED"),
24510 Self::UnknownValue(u) => u.0.name(),
24511 }
24512 }
24513}
24514
24515impl std::default::Default for SkaffoldSupportState {
24516 fn default() -> Self {
24517 use std::convert::From;
24518 Self::from(0)
24519 }
24520}
24521
24522impl std::fmt::Display for SkaffoldSupportState {
24523 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
24524 wkt::internal::display_enum(f, self.name(), self.value())
24525 }
24526}
24527
24528impl std::convert::From<i32> for SkaffoldSupportState {
24529 fn from(value: i32) -> Self {
24530 match value {
24531 0 => Self::Unspecified,
24532 1 => Self::Supported,
24533 2 => Self::MaintenanceMode,
24534 3 => Self::Unsupported,
24535 _ => Self::UnknownValue(skaffold_support_state::UnknownValue(
24536 wkt::internal::UnknownEnumValue::Integer(value),
24537 )),
24538 }
24539 }
24540}
24541
24542impl std::convert::From<&str> for SkaffoldSupportState {
24543 fn from(value: &str) -> Self {
24544 use std::string::ToString;
24545 match value {
24546 "SKAFFOLD_SUPPORT_STATE_UNSPECIFIED" => Self::Unspecified,
24547 "SKAFFOLD_SUPPORT_STATE_SUPPORTED" => Self::Supported,
24548 "SKAFFOLD_SUPPORT_STATE_MAINTENANCE_MODE" => Self::MaintenanceMode,
24549 "SKAFFOLD_SUPPORT_STATE_UNSUPPORTED" => Self::Unsupported,
24550 _ => Self::UnknownValue(skaffold_support_state::UnknownValue(
24551 wkt::internal::UnknownEnumValue::String(value.to_string()),
24552 )),
24553 }
24554 }
24555}
24556
24557impl serde::ser::Serialize for SkaffoldSupportState {
24558 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
24559 where
24560 S: serde::Serializer,
24561 {
24562 match self {
24563 Self::Unspecified => serializer.serialize_i32(0),
24564 Self::Supported => serializer.serialize_i32(1),
24565 Self::MaintenanceMode => serializer.serialize_i32(2),
24566 Self::Unsupported => serializer.serialize_i32(3),
24567 Self::UnknownValue(u) => u.0.serialize(serializer),
24568 }
24569 }
24570}
24571
24572impl<'de> serde::de::Deserialize<'de> for SkaffoldSupportState {
24573 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
24574 where
24575 D: serde::Deserializer<'de>,
24576 {
24577 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SkaffoldSupportState>::new(
24578 ".google.cloud.deploy.v1.SkaffoldSupportState",
24579 ))
24580 }
24581}
24582
24583/// The pattern of how wait time is increased.
24584///
24585/// # Working with unknown values
24586///
24587/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
24588/// additional enum variants at any time. Adding new variants is not considered
24589/// a breaking change. Applications should write their code in anticipation of:
24590///
24591/// - New values appearing in future releases of the client library, **and**
24592/// - New values received dynamically, without application changes.
24593///
24594/// Please consult the [Working with enums] section in the user guide for some
24595/// guidelines.
24596///
24597/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
24598#[derive(Clone, Debug, PartialEq)]
24599#[non_exhaustive]
24600pub enum BackoffMode {
24601 /// No WaitMode is specified.
24602 Unspecified,
24603 /// Increases the wait time linearly.
24604 Linear,
24605 /// Increases the wait time exponentially.
24606 Exponential,
24607 /// If set, the enum was initialized with an unknown value.
24608 ///
24609 /// Applications can examine the value using [BackoffMode::value] or
24610 /// [BackoffMode::name].
24611 UnknownValue(backoff_mode::UnknownValue),
24612}
24613
24614#[doc(hidden)]
24615pub mod backoff_mode {
24616 #[allow(unused_imports)]
24617 use super::*;
24618 #[derive(Clone, Debug, PartialEq)]
24619 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
24620}
24621
24622impl BackoffMode {
24623 /// Gets the enum value.
24624 ///
24625 /// Returns `None` if the enum contains an unknown value deserialized from
24626 /// the string representation of enums.
24627 pub fn value(&self) -> std::option::Option<i32> {
24628 match self {
24629 Self::Unspecified => std::option::Option::Some(0),
24630 Self::Linear => std::option::Option::Some(1),
24631 Self::Exponential => std::option::Option::Some(2),
24632 Self::UnknownValue(u) => u.0.value(),
24633 }
24634 }
24635
24636 /// Gets the enum value as a string.
24637 ///
24638 /// Returns `None` if the enum contains an unknown value deserialized from
24639 /// the integer representation of enums.
24640 pub fn name(&self) -> std::option::Option<&str> {
24641 match self {
24642 Self::Unspecified => std::option::Option::Some("BACKOFF_MODE_UNSPECIFIED"),
24643 Self::Linear => std::option::Option::Some("BACKOFF_MODE_LINEAR"),
24644 Self::Exponential => std::option::Option::Some("BACKOFF_MODE_EXPONENTIAL"),
24645 Self::UnknownValue(u) => u.0.name(),
24646 }
24647 }
24648}
24649
24650impl std::default::Default for BackoffMode {
24651 fn default() -> Self {
24652 use std::convert::From;
24653 Self::from(0)
24654 }
24655}
24656
24657impl std::fmt::Display for BackoffMode {
24658 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
24659 wkt::internal::display_enum(f, self.name(), self.value())
24660 }
24661}
24662
24663impl std::convert::From<i32> for BackoffMode {
24664 fn from(value: i32) -> Self {
24665 match value {
24666 0 => Self::Unspecified,
24667 1 => Self::Linear,
24668 2 => Self::Exponential,
24669 _ => Self::UnknownValue(backoff_mode::UnknownValue(
24670 wkt::internal::UnknownEnumValue::Integer(value),
24671 )),
24672 }
24673 }
24674}
24675
24676impl std::convert::From<&str> for BackoffMode {
24677 fn from(value: &str) -> Self {
24678 use std::string::ToString;
24679 match value {
24680 "BACKOFF_MODE_UNSPECIFIED" => Self::Unspecified,
24681 "BACKOFF_MODE_LINEAR" => Self::Linear,
24682 "BACKOFF_MODE_EXPONENTIAL" => Self::Exponential,
24683 _ => Self::UnknownValue(backoff_mode::UnknownValue(
24684 wkt::internal::UnknownEnumValue::String(value.to_string()),
24685 )),
24686 }
24687 }
24688}
24689
24690impl serde::ser::Serialize for BackoffMode {
24691 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
24692 where
24693 S: serde::Serializer,
24694 {
24695 match self {
24696 Self::Unspecified => serializer.serialize_i32(0),
24697 Self::Linear => serializer.serialize_i32(1),
24698 Self::Exponential => serializer.serialize_i32(2),
24699 Self::UnknownValue(u) => u.0.serialize(serializer),
24700 }
24701 }
24702}
24703
24704impl<'de> serde::de::Deserialize<'de> for BackoffMode {
24705 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
24706 where
24707 D: serde::Deserializer<'de>,
24708 {
24709 deserializer.deserialize_any(wkt::internal::EnumVisitor::<BackoffMode>::new(
24710 ".google.cloud.deploy.v1.BackoffMode",
24711 ))
24712 }
24713}
24714
24715/// Valid state of a repair attempt.
24716///
24717/// # Working with unknown values
24718///
24719/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
24720/// additional enum variants at any time. Adding new variants is not considered
24721/// a breaking change. Applications should write their code in anticipation of:
24722///
24723/// - New values appearing in future releases of the client library, **and**
24724/// - New values received dynamically, without application changes.
24725///
24726/// Please consult the [Working with enums] section in the user guide for some
24727/// guidelines.
24728///
24729/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
24730#[derive(Clone, Debug, PartialEq)]
24731#[non_exhaustive]
24732pub enum RepairState {
24733 /// The `repair` has an unspecified state.
24734 Unspecified,
24735 /// The `repair` action has succeeded.
24736 Succeeded,
24737 /// The `repair` action was cancelled.
24738 Cancelled,
24739 /// The `repair` action has failed.
24740 Failed,
24741 /// The `repair` action is in progress.
24742 InProgress,
24743 /// The `repair` action is pending.
24744 Pending,
24745 /// The `repair` action was aborted.
24746 Aborted,
24747 /// If set, the enum was initialized with an unknown value.
24748 ///
24749 /// Applications can examine the value using [RepairState::value] or
24750 /// [RepairState::name].
24751 UnknownValue(repair_state::UnknownValue),
24752}
24753
24754#[doc(hidden)]
24755pub mod repair_state {
24756 #[allow(unused_imports)]
24757 use super::*;
24758 #[derive(Clone, Debug, PartialEq)]
24759 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
24760}
24761
24762impl RepairState {
24763 /// Gets the enum value.
24764 ///
24765 /// Returns `None` if the enum contains an unknown value deserialized from
24766 /// the string representation of enums.
24767 pub fn value(&self) -> std::option::Option<i32> {
24768 match self {
24769 Self::Unspecified => std::option::Option::Some(0),
24770 Self::Succeeded => std::option::Option::Some(1),
24771 Self::Cancelled => std::option::Option::Some(2),
24772 Self::Failed => std::option::Option::Some(3),
24773 Self::InProgress => std::option::Option::Some(4),
24774 Self::Pending => std::option::Option::Some(5),
24775 Self::Aborted => std::option::Option::Some(7),
24776 Self::UnknownValue(u) => u.0.value(),
24777 }
24778 }
24779
24780 /// Gets the enum value as a string.
24781 ///
24782 /// Returns `None` if the enum contains an unknown value deserialized from
24783 /// the integer representation of enums.
24784 pub fn name(&self) -> std::option::Option<&str> {
24785 match self {
24786 Self::Unspecified => std::option::Option::Some("REPAIR_STATE_UNSPECIFIED"),
24787 Self::Succeeded => std::option::Option::Some("REPAIR_STATE_SUCCEEDED"),
24788 Self::Cancelled => std::option::Option::Some("REPAIR_STATE_CANCELLED"),
24789 Self::Failed => std::option::Option::Some("REPAIR_STATE_FAILED"),
24790 Self::InProgress => std::option::Option::Some("REPAIR_STATE_IN_PROGRESS"),
24791 Self::Pending => std::option::Option::Some("REPAIR_STATE_PENDING"),
24792 Self::Aborted => std::option::Option::Some("REPAIR_STATE_ABORTED"),
24793 Self::UnknownValue(u) => u.0.name(),
24794 }
24795 }
24796}
24797
24798impl std::default::Default for RepairState {
24799 fn default() -> Self {
24800 use std::convert::From;
24801 Self::from(0)
24802 }
24803}
24804
24805impl std::fmt::Display for RepairState {
24806 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
24807 wkt::internal::display_enum(f, self.name(), self.value())
24808 }
24809}
24810
24811impl std::convert::From<i32> for RepairState {
24812 fn from(value: i32) -> Self {
24813 match value {
24814 0 => Self::Unspecified,
24815 1 => Self::Succeeded,
24816 2 => Self::Cancelled,
24817 3 => Self::Failed,
24818 4 => Self::InProgress,
24819 5 => Self::Pending,
24820 7 => Self::Aborted,
24821 _ => Self::UnknownValue(repair_state::UnknownValue(
24822 wkt::internal::UnknownEnumValue::Integer(value),
24823 )),
24824 }
24825 }
24826}
24827
24828impl std::convert::From<&str> for RepairState {
24829 fn from(value: &str) -> Self {
24830 use std::string::ToString;
24831 match value {
24832 "REPAIR_STATE_UNSPECIFIED" => Self::Unspecified,
24833 "REPAIR_STATE_SUCCEEDED" => Self::Succeeded,
24834 "REPAIR_STATE_CANCELLED" => Self::Cancelled,
24835 "REPAIR_STATE_FAILED" => Self::Failed,
24836 "REPAIR_STATE_IN_PROGRESS" => Self::InProgress,
24837 "REPAIR_STATE_PENDING" => Self::Pending,
24838 "REPAIR_STATE_ABORTED" => Self::Aborted,
24839 _ => Self::UnknownValue(repair_state::UnknownValue(
24840 wkt::internal::UnknownEnumValue::String(value.to_string()),
24841 )),
24842 }
24843 }
24844}
24845
24846impl serde::ser::Serialize for RepairState {
24847 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
24848 where
24849 S: serde::Serializer,
24850 {
24851 match self {
24852 Self::Unspecified => serializer.serialize_i32(0),
24853 Self::Succeeded => serializer.serialize_i32(1),
24854 Self::Cancelled => serializer.serialize_i32(2),
24855 Self::Failed => serializer.serialize_i32(3),
24856 Self::InProgress => serializer.serialize_i32(4),
24857 Self::Pending => serializer.serialize_i32(5),
24858 Self::Aborted => serializer.serialize_i32(7),
24859 Self::UnknownValue(u) => u.0.serialize(serializer),
24860 }
24861 }
24862}
24863
24864impl<'de> serde::de::Deserialize<'de> for RepairState {
24865 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
24866 where
24867 D: serde::Deserializer<'de>,
24868 {
24869 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RepairState>::new(
24870 ".google.cloud.deploy.v1.RepairState",
24871 ))
24872 }
24873}
24874
24875/// Type indicates the type of the log entry and can be used as a filter.
24876///
24877/// # Working with unknown values
24878///
24879/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
24880/// additional enum variants at any time. Adding new variants is not considered
24881/// a breaking change. Applications should write their code in anticipation of:
24882///
24883/// - New values appearing in future releases of the client library, **and**
24884/// - New values received dynamically, without application changes.
24885///
24886/// Please consult the [Working with enums] section in the user guide for some
24887/// guidelines.
24888///
24889/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
24890#[derive(Clone, Debug, PartialEq)]
24891#[non_exhaustive]
24892pub enum Type {
24893 /// Type is unspecified.
24894 Unspecified,
24895 /// A Pub/Sub notification failed to be sent.
24896 PubsubNotificationFailure,
24897 /// Resource state changed.
24898 ResourceStateChange,
24899 /// A process aborted.
24900 ProcessAborted,
24901 /// Restriction check failed.
24902 RestrictionViolated,
24903 /// Resource deleted.
24904 ResourceDeleted,
24905 /// Rollout updated.
24906 RolloutUpdate,
24907 /// Deploy Policy evaluation.
24908 DeployPolicyEvaluation,
24909 /// Deprecated: This field is never used. Use release_render log type instead.
24910 #[deprecated]
24911 RenderStatuesChange,
24912 /// If set, the enum was initialized with an unknown value.
24913 ///
24914 /// Applications can examine the value using [Type::value] or
24915 /// [Type::name].
24916 UnknownValue(r#type::UnknownValue),
24917}
24918
24919#[doc(hidden)]
24920pub mod r#type {
24921 #[allow(unused_imports)]
24922 use super::*;
24923 #[derive(Clone, Debug, PartialEq)]
24924 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
24925}
24926
24927impl Type {
24928 /// Gets the enum value.
24929 ///
24930 /// Returns `None` if the enum contains an unknown value deserialized from
24931 /// the string representation of enums.
24932 pub fn value(&self) -> std::option::Option<i32> {
24933 match self {
24934 Self::Unspecified => std::option::Option::Some(0),
24935 Self::PubsubNotificationFailure => std::option::Option::Some(1),
24936 Self::ResourceStateChange => std::option::Option::Some(3),
24937 Self::ProcessAborted => std::option::Option::Some(4),
24938 Self::RestrictionViolated => std::option::Option::Some(5),
24939 Self::ResourceDeleted => std::option::Option::Some(6),
24940 Self::RolloutUpdate => std::option::Option::Some(7),
24941 Self::DeployPolicyEvaluation => std::option::Option::Some(8),
24942 Self::RenderStatuesChange => std::option::Option::Some(2),
24943 Self::UnknownValue(u) => u.0.value(),
24944 }
24945 }
24946
24947 /// Gets the enum value as a string.
24948 ///
24949 /// Returns `None` if the enum contains an unknown value deserialized from
24950 /// the integer representation of enums.
24951 pub fn name(&self) -> std::option::Option<&str> {
24952 match self {
24953 Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
24954 Self::PubsubNotificationFailure => {
24955 std::option::Option::Some("TYPE_PUBSUB_NOTIFICATION_FAILURE")
24956 }
24957 Self::ResourceStateChange => std::option::Option::Some("TYPE_RESOURCE_STATE_CHANGE"),
24958 Self::ProcessAborted => std::option::Option::Some("TYPE_PROCESS_ABORTED"),
24959 Self::RestrictionViolated => std::option::Option::Some("TYPE_RESTRICTION_VIOLATED"),
24960 Self::ResourceDeleted => std::option::Option::Some("TYPE_RESOURCE_DELETED"),
24961 Self::RolloutUpdate => std::option::Option::Some("TYPE_ROLLOUT_UPDATE"),
24962 Self::DeployPolicyEvaluation => {
24963 std::option::Option::Some("TYPE_DEPLOY_POLICY_EVALUATION")
24964 }
24965 Self::RenderStatuesChange => std::option::Option::Some("TYPE_RENDER_STATUES_CHANGE"),
24966 Self::UnknownValue(u) => u.0.name(),
24967 }
24968 }
24969}
24970
24971impl std::default::Default for Type {
24972 fn default() -> Self {
24973 use std::convert::From;
24974 Self::from(0)
24975 }
24976}
24977
24978impl std::fmt::Display for Type {
24979 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
24980 wkt::internal::display_enum(f, self.name(), self.value())
24981 }
24982}
24983
24984impl std::convert::From<i32> for Type {
24985 fn from(value: i32) -> Self {
24986 match value {
24987 0 => Self::Unspecified,
24988 1 => Self::PubsubNotificationFailure,
24989 2 => Self::RenderStatuesChange,
24990 3 => Self::ResourceStateChange,
24991 4 => Self::ProcessAborted,
24992 5 => Self::RestrictionViolated,
24993 6 => Self::ResourceDeleted,
24994 7 => Self::RolloutUpdate,
24995 8 => Self::DeployPolicyEvaluation,
24996 _ => Self::UnknownValue(r#type::UnknownValue(
24997 wkt::internal::UnknownEnumValue::Integer(value),
24998 )),
24999 }
25000 }
25001}
25002
25003impl std::convert::From<&str> for Type {
25004 fn from(value: &str) -> Self {
25005 use std::string::ToString;
25006 match value {
25007 "TYPE_UNSPECIFIED" => Self::Unspecified,
25008 "TYPE_PUBSUB_NOTIFICATION_FAILURE" => Self::PubsubNotificationFailure,
25009 "TYPE_RESOURCE_STATE_CHANGE" => Self::ResourceStateChange,
25010 "TYPE_PROCESS_ABORTED" => Self::ProcessAborted,
25011 "TYPE_RESTRICTION_VIOLATED" => Self::RestrictionViolated,
25012 "TYPE_RESOURCE_DELETED" => Self::ResourceDeleted,
25013 "TYPE_ROLLOUT_UPDATE" => Self::RolloutUpdate,
25014 "TYPE_DEPLOY_POLICY_EVALUATION" => Self::DeployPolicyEvaluation,
25015 "TYPE_RENDER_STATUES_CHANGE" => Self::RenderStatuesChange,
25016 _ => Self::UnknownValue(r#type::UnknownValue(
25017 wkt::internal::UnknownEnumValue::String(value.to_string()),
25018 )),
25019 }
25020 }
25021}
25022
25023impl serde::ser::Serialize for Type {
25024 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
25025 where
25026 S: serde::Serializer,
25027 {
25028 match self {
25029 Self::Unspecified => serializer.serialize_i32(0),
25030 Self::PubsubNotificationFailure => serializer.serialize_i32(1),
25031 Self::ResourceStateChange => serializer.serialize_i32(3),
25032 Self::ProcessAborted => serializer.serialize_i32(4),
25033 Self::RestrictionViolated => serializer.serialize_i32(5),
25034 Self::ResourceDeleted => serializer.serialize_i32(6),
25035 Self::RolloutUpdate => serializer.serialize_i32(7),
25036 Self::DeployPolicyEvaluation => serializer.serialize_i32(8),
25037 Self::RenderStatuesChange => serializer.serialize_i32(2),
25038 Self::UnknownValue(u) => u.0.serialize(serializer),
25039 }
25040 }
25041}
25042
25043impl<'de> serde::de::Deserialize<'de> for Type {
25044 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
25045 where
25046 D: serde::Deserializer<'de>,
25047 {
25048 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
25049 ".google.cloud.deploy.v1.Type",
25050 ))
25051 }
25052}