Skip to main content

google_cloud_config_v1/
model.rs

1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17#![allow(rustdoc::redundant_explicit_links)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![no_implicit_prelude]
20extern crate async_trait;
21extern crate bytes;
22extern crate gaxi;
23extern crate google_cloud_gax;
24extern crate google_cloud_iam_v1;
25extern crate google_cloud_location;
26extern crate google_cloud_longrunning;
27extern crate google_cloud_lro;
28extern crate google_cloud_rpc;
29extern crate serde;
30extern crate serde_json;
31extern crate serde_with;
32extern crate std;
33extern crate tracing;
34extern crate wkt;
35
36mod debug;
37mod deserialize;
38mod serialize;
39
40/// A Deployment is a group of resources and configs managed and provisioned by
41/// Infra Manager.
42#[derive(Clone, Default, PartialEq)]
43#[non_exhaustive]
44pub struct Deployment {
45    /// Identifier. Resource name of the deployment.
46    /// Format: `projects/{project}/locations/{location}/deployments/{deployment}`
47    pub name: std::string::String,
48
49    /// Output only. Time when the deployment was created.
50    pub create_time: std::option::Option<wkt::Timestamp>,
51
52    /// Output only. Time when the deployment was last modified.
53    pub update_time: std::option::Option<wkt::Timestamp>,
54
55    /// Optional. User-defined metadata for the deployment.
56    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
57
58    /// Output only. Current state of the deployment.
59    pub state: crate::model::deployment::State,
60
61    /// Output only. Revision name that was most recently applied.
62    /// Format: `projects/{project}/locations/{location}/deployments/{deployment}/
63    /// revisions/{revision}`
64    pub latest_revision: std::string::String,
65
66    /// Output only. Additional information regarding the current state.
67    pub state_detail: std::string::String,
68
69    /// Output only. Error code describing errors that may have occurred.
70    pub error_code: crate::model::deployment::ErrorCode,
71
72    /// Output only. Location of artifacts from a DeleteDeployment operation.
73    pub delete_results: std::option::Option<crate::model::ApplyResults>,
74
75    /// Output only. Cloud Build instance UUID associated with deleting this
76    /// deployment.
77    pub delete_build: std::string::String,
78
79    /// Output only. Location of Cloud Build logs in Google Cloud Storage,
80    /// populated when deleting this deployment. Format: `gs://{bucket}/{object}`.
81    pub delete_logs: std::string::String,
82
83    /// Output only. Errors encountered when deleting this deployment.
84    /// Errors are truncated to 10 entries, see `delete_results` and `error_logs`
85    /// for full details.
86    pub tf_errors: std::vec::Vec<crate::model::TerraformError>,
87
88    /// Output only. Location of Terraform error logs in Google Cloud Storage.
89    /// Format: `gs://{bucket}/{object}`.
90    pub error_logs: std::string::String,
91
92    /// Optional. User-defined location of Cloud Build logs and artifacts in Google
93    /// Cloud Storage. Format: `gs://{bucket}/{folder}`
94    ///
95    /// A default bucket will be bootstrapped if the field is not set or empty.
96    /// Default bucket format: `gs://<project number>-<region>-blueprint-config`
97    /// Constraints:
98    ///
99    /// - The bucket needs to be in the same project as the deployment
100    /// - The path cannot be within the path of `gcs_source`
101    /// - The field cannot be updated, including changing its presence
102    pub artifacts_gcs_bucket: std::option::Option<std::string::String>,
103
104    /// Required. User-specified Service Account (SA) credentials to be used when
105    /// actuating resources.
106    /// Format: `projects/{projectID}/serviceAccounts/{serviceAccount}`
107    pub service_account: std::option::Option<std::string::String>,
108
109    /// By default, Infra Manager will return a failure when
110    /// Terraform encounters a 409 code (resource conflict error) during actuation.
111    /// If this flag is set to true, Infra Manager will instead
112    /// attempt to automatically import the resource into the Terraform state (for
113    /// supported resource types) and continue actuation.
114    ///
115    /// Not all resource types are supported, refer to documentation.
116    pub import_existing_resources: std::option::Option<bool>,
117
118    /// Optional. The user-specified Cloud Build worker pool resource in which the
119    /// Cloud Build job will execute. Format:
120    /// `projects/{project}/locations/{location}/workerPools/{workerPoolId}`.
121    /// If this field is unspecified, the default Cloud Build worker pool will be
122    /// used.
123    pub worker_pool: std::option::Option<std::string::String>,
124
125    /// Output only. Current lock state of the deployment.
126    pub lock_state: crate::model::deployment::LockState,
127
128    /// Optional. The user-specified Terraform version constraint.
129    /// Example: "=1.3.10".
130    pub tf_version_constraint: std::option::Option<std::string::String>,
131
132    /// Output only. The current Terraform version set on the deployment.
133    /// It is in the format of "Major.Minor.Patch", for example, "1.3.10".
134    pub tf_version: std::string::String,
135
136    /// Optional. Input to control quota checks for resources in terraform
137    /// configuration files. There are limited resources on which quota validation
138    /// applies.
139    pub quota_validation: crate::model::QuotaValidation,
140
141    /// Optional. Arbitrary key-value metadata storage e.g. to help client tools
142    /// identify deployments during automation. See
143    /// <https://google.aip.dev/148#annotations> for details on format and size
144    /// limitations.
145    pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
146
147    /// Optional. This field specifies the provider configurations.
148    pub provider_config: std::option::Option<crate::model::ProviderConfig>,
149
150    /// Blueprint to deploy.
151    pub blueprint: std::option::Option<crate::model::deployment::Blueprint>,
152
153    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
154}
155
156impl Deployment {
157    /// Creates a new default instance.
158    pub fn new() -> Self {
159        std::default::Default::default()
160    }
161
162    /// Sets the value of [name][crate::model::Deployment::name].
163    ///
164    /// # Example
165    /// ```ignore,no_run
166    /// # use google_cloud_config_v1::model::Deployment;
167    /// let x = Deployment::new().set_name("example");
168    /// ```
169    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
170        self.name = v.into();
171        self
172    }
173
174    /// Sets the value of [create_time][crate::model::Deployment::create_time].
175    ///
176    /// # Example
177    /// ```ignore,no_run
178    /// # use google_cloud_config_v1::model::Deployment;
179    /// use wkt::Timestamp;
180    /// let x = Deployment::new().set_create_time(Timestamp::default()/* use setters */);
181    /// ```
182    pub fn set_create_time<T>(mut self, v: T) -> Self
183    where
184        T: std::convert::Into<wkt::Timestamp>,
185    {
186        self.create_time = std::option::Option::Some(v.into());
187        self
188    }
189
190    /// Sets or clears the value of [create_time][crate::model::Deployment::create_time].
191    ///
192    /// # Example
193    /// ```ignore,no_run
194    /// # use google_cloud_config_v1::model::Deployment;
195    /// use wkt::Timestamp;
196    /// let x = Deployment::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
197    /// let x = Deployment::new().set_or_clear_create_time(None::<Timestamp>);
198    /// ```
199    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
200    where
201        T: std::convert::Into<wkt::Timestamp>,
202    {
203        self.create_time = v.map(|x| x.into());
204        self
205    }
206
207    /// Sets the value of [update_time][crate::model::Deployment::update_time].
208    ///
209    /// # Example
210    /// ```ignore,no_run
211    /// # use google_cloud_config_v1::model::Deployment;
212    /// use wkt::Timestamp;
213    /// let x = Deployment::new().set_update_time(Timestamp::default()/* use setters */);
214    /// ```
215    pub fn set_update_time<T>(mut self, v: T) -> Self
216    where
217        T: std::convert::Into<wkt::Timestamp>,
218    {
219        self.update_time = std::option::Option::Some(v.into());
220        self
221    }
222
223    /// Sets or clears the value of [update_time][crate::model::Deployment::update_time].
224    ///
225    /// # Example
226    /// ```ignore,no_run
227    /// # use google_cloud_config_v1::model::Deployment;
228    /// use wkt::Timestamp;
229    /// let x = Deployment::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
230    /// let x = Deployment::new().set_or_clear_update_time(None::<Timestamp>);
231    /// ```
232    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
233    where
234        T: std::convert::Into<wkt::Timestamp>,
235    {
236        self.update_time = v.map(|x| x.into());
237        self
238    }
239
240    /// Sets the value of [labels][crate::model::Deployment::labels].
241    ///
242    /// # Example
243    /// ```ignore,no_run
244    /// # use google_cloud_config_v1::model::Deployment;
245    /// let x = Deployment::new().set_labels([
246    ///     ("key0", "abc"),
247    ///     ("key1", "xyz"),
248    /// ]);
249    /// ```
250    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
251    where
252        T: std::iter::IntoIterator<Item = (K, V)>,
253        K: std::convert::Into<std::string::String>,
254        V: std::convert::Into<std::string::String>,
255    {
256        use std::iter::Iterator;
257        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
258        self
259    }
260
261    /// Sets the value of [state][crate::model::Deployment::state].
262    ///
263    /// # Example
264    /// ```ignore,no_run
265    /// # use google_cloud_config_v1::model::Deployment;
266    /// use google_cloud_config_v1::model::deployment::State;
267    /// let x0 = Deployment::new().set_state(State::Creating);
268    /// let x1 = Deployment::new().set_state(State::Active);
269    /// let x2 = Deployment::new().set_state(State::Updating);
270    /// ```
271    pub fn set_state<T: std::convert::Into<crate::model::deployment::State>>(
272        mut self,
273        v: T,
274    ) -> Self {
275        self.state = v.into();
276        self
277    }
278
279    /// Sets the value of [latest_revision][crate::model::Deployment::latest_revision].
280    ///
281    /// # Example
282    /// ```ignore,no_run
283    /// # use google_cloud_config_v1::model::Deployment;
284    /// let x = Deployment::new().set_latest_revision("example");
285    /// ```
286    pub fn set_latest_revision<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
287        self.latest_revision = v.into();
288        self
289    }
290
291    /// Sets the value of [state_detail][crate::model::Deployment::state_detail].
292    ///
293    /// # Example
294    /// ```ignore,no_run
295    /// # use google_cloud_config_v1::model::Deployment;
296    /// let x = Deployment::new().set_state_detail("example");
297    /// ```
298    pub fn set_state_detail<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
299        self.state_detail = v.into();
300        self
301    }
302
303    /// Sets the value of [error_code][crate::model::Deployment::error_code].
304    ///
305    /// # Example
306    /// ```ignore,no_run
307    /// # use google_cloud_config_v1::model::Deployment;
308    /// use google_cloud_config_v1::model::deployment::ErrorCode;
309    /// let x0 = Deployment::new().set_error_code(ErrorCode::RevisionFailed);
310    /// let x1 = Deployment::new().set_error_code(ErrorCode::CloudBuildPermissionDenied);
311    /// let x2 = Deployment::new().set_error_code(ErrorCode::DeleteBuildApiFailed);
312    /// ```
313    pub fn set_error_code<T: std::convert::Into<crate::model::deployment::ErrorCode>>(
314        mut self,
315        v: T,
316    ) -> Self {
317        self.error_code = v.into();
318        self
319    }
320
321    /// Sets the value of [delete_results][crate::model::Deployment::delete_results].
322    ///
323    /// # Example
324    /// ```ignore,no_run
325    /// # use google_cloud_config_v1::model::Deployment;
326    /// use google_cloud_config_v1::model::ApplyResults;
327    /// let x = Deployment::new().set_delete_results(ApplyResults::default()/* use setters */);
328    /// ```
329    pub fn set_delete_results<T>(mut self, v: T) -> Self
330    where
331        T: std::convert::Into<crate::model::ApplyResults>,
332    {
333        self.delete_results = std::option::Option::Some(v.into());
334        self
335    }
336
337    /// Sets or clears the value of [delete_results][crate::model::Deployment::delete_results].
338    ///
339    /// # Example
340    /// ```ignore,no_run
341    /// # use google_cloud_config_v1::model::Deployment;
342    /// use google_cloud_config_v1::model::ApplyResults;
343    /// let x = Deployment::new().set_or_clear_delete_results(Some(ApplyResults::default()/* use setters */));
344    /// let x = Deployment::new().set_or_clear_delete_results(None::<ApplyResults>);
345    /// ```
346    pub fn set_or_clear_delete_results<T>(mut self, v: std::option::Option<T>) -> Self
347    where
348        T: std::convert::Into<crate::model::ApplyResults>,
349    {
350        self.delete_results = v.map(|x| x.into());
351        self
352    }
353
354    /// Sets the value of [delete_build][crate::model::Deployment::delete_build].
355    ///
356    /// # Example
357    /// ```ignore,no_run
358    /// # use google_cloud_config_v1::model::Deployment;
359    /// let x = Deployment::new().set_delete_build("example");
360    /// ```
361    pub fn set_delete_build<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
362        self.delete_build = v.into();
363        self
364    }
365
366    /// Sets the value of [delete_logs][crate::model::Deployment::delete_logs].
367    ///
368    /// # Example
369    /// ```ignore,no_run
370    /// # use google_cloud_config_v1::model::Deployment;
371    /// let x = Deployment::new().set_delete_logs("example");
372    /// ```
373    pub fn set_delete_logs<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
374        self.delete_logs = v.into();
375        self
376    }
377
378    /// Sets the value of [tf_errors][crate::model::Deployment::tf_errors].
379    ///
380    /// # Example
381    /// ```ignore,no_run
382    /// # use google_cloud_config_v1::model::Deployment;
383    /// use google_cloud_config_v1::model::TerraformError;
384    /// let x = Deployment::new()
385    ///     .set_tf_errors([
386    ///         TerraformError::default()/* use setters */,
387    ///         TerraformError::default()/* use (different) setters */,
388    ///     ]);
389    /// ```
390    pub fn set_tf_errors<T, V>(mut self, v: T) -> Self
391    where
392        T: std::iter::IntoIterator<Item = V>,
393        V: std::convert::Into<crate::model::TerraformError>,
394    {
395        use std::iter::Iterator;
396        self.tf_errors = v.into_iter().map(|i| i.into()).collect();
397        self
398    }
399
400    /// Sets the value of [error_logs][crate::model::Deployment::error_logs].
401    ///
402    /// # Example
403    /// ```ignore,no_run
404    /// # use google_cloud_config_v1::model::Deployment;
405    /// let x = Deployment::new().set_error_logs("example");
406    /// ```
407    pub fn set_error_logs<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
408        self.error_logs = v.into();
409        self
410    }
411
412    /// Sets the value of [artifacts_gcs_bucket][crate::model::Deployment::artifacts_gcs_bucket].
413    ///
414    /// # Example
415    /// ```ignore,no_run
416    /// # use google_cloud_config_v1::model::Deployment;
417    /// let x = Deployment::new().set_artifacts_gcs_bucket("example");
418    /// ```
419    pub fn set_artifacts_gcs_bucket<T>(mut self, v: T) -> Self
420    where
421        T: std::convert::Into<std::string::String>,
422    {
423        self.artifacts_gcs_bucket = std::option::Option::Some(v.into());
424        self
425    }
426
427    /// Sets or clears the value of [artifacts_gcs_bucket][crate::model::Deployment::artifacts_gcs_bucket].
428    ///
429    /// # Example
430    /// ```ignore,no_run
431    /// # use google_cloud_config_v1::model::Deployment;
432    /// let x = Deployment::new().set_or_clear_artifacts_gcs_bucket(Some("example"));
433    /// let x = Deployment::new().set_or_clear_artifacts_gcs_bucket(None::<String>);
434    /// ```
435    pub fn set_or_clear_artifacts_gcs_bucket<T>(mut self, v: std::option::Option<T>) -> Self
436    where
437        T: std::convert::Into<std::string::String>,
438    {
439        self.artifacts_gcs_bucket = v.map(|x| x.into());
440        self
441    }
442
443    /// Sets the value of [service_account][crate::model::Deployment::service_account].
444    ///
445    /// # Example
446    /// ```ignore,no_run
447    /// # use google_cloud_config_v1::model::Deployment;
448    /// let x = Deployment::new().set_service_account("example");
449    /// ```
450    pub fn set_service_account<T>(mut self, v: T) -> Self
451    where
452        T: std::convert::Into<std::string::String>,
453    {
454        self.service_account = std::option::Option::Some(v.into());
455        self
456    }
457
458    /// Sets or clears the value of [service_account][crate::model::Deployment::service_account].
459    ///
460    /// # Example
461    /// ```ignore,no_run
462    /// # use google_cloud_config_v1::model::Deployment;
463    /// let x = Deployment::new().set_or_clear_service_account(Some("example"));
464    /// let x = Deployment::new().set_or_clear_service_account(None::<String>);
465    /// ```
466    pub fn set_or_clear_service_account<T>(mut self, v: std::option::Option<T>) -> Self
467    where
468        T: std::convert::Into<std::string::String>,
469    {
470        self.service_account = v.map(|x| x.into());
471        self
472    }
473
474    /// Sets the value of [import_existing_resources][crate::model::Deployment::import_existing_resources].
475    ///
476    /// # Example
477    /// ```ignore,no_run
478    /// # use google_cloud_config_v1::model::Deployment;
479    /// let x = Deployment::new().set_import_existing_resources(true);
480    /// ```
481    pub fn set_import_existing_resources<T>(mut self, v: T) -> Self
482    where
483        T: std::convert::Into<bool>,
484    {
485        self.import_existing_resources = std::option::Option::Some(v.into());
486        self
487    }
488
489    /// Sets or clears the value of [import_existing_resources][crate::model::Deployment::import_existing_resources].
490    ///
491    /// # Example
492    /// ```ignore,no_run
493    /// # use google_cloud_config_v1::model::Deployment;
494    /// let x = Deployment::new().set_or_clear_import_existing_resources(Some(false));
495    /// let x = Deployment::new().set_or_clear_import_existing_resources(None::<bool>);
496    /// ```
497    pub fn set_or_clear_import_existing_resources<T>(mut self, v: std::option::Option<T>) -> Self
498    where
499        T: std::convert::Into<bool>,
500    {
501        self.import_existing_resources = v.map(|x| x.into());
502        self
503    }
504
505    /// Sets the value of [worker_pool][crate::model::Deployment::worker_pool].
506    ///
507    /// # Example
508    /// ```ignore,no_run
509    /// # use google_cloud_config_v1::model::Deployment;
510    /// let x = Deployment::new().set_worker_pool("example");
511    /// ```
512    pub fn set_worker_pool<T>(mut self, v: T) -> Self
513    where
514        T: std::convert::Into<std::string::String>,
515    {
516        self.worker_pool = std::option::Option::Some(v.into());
517        self
518    }
519
520    /// Sets or clears the value of [worker_pool][crate::model::Deployment::worker_pool].
521    ///
522    /// # Example
523    /// ```ignore,no_run
524    /// # use google_cloud_config_v1::model::Deployment;
525    /// let x = Deployment::new().set_or_clear_worker_pool(Some("example"));
526    /// let x = Deployment::new().set_or_clear_worker_pool(None::<String>);
527    /// ```
528    pub fn set_or_clear_worker_pool<T>(mut self, v: std::option::Option<T>) -> Self
529    where
530        T: std::convert::Into<std::string::String>,
531    {
532        self.worker_pool = v.map(|x| x.into());
533        self
534    }
535
536    /// Sets the value of [lock_state][crate::model::Deployment::lock_state].
537    ///
538    /// # Example
539    /// ```ignore,no_run
540    /// # use google_cloud_config_v1::model::Deployment;
541    /// use google_cloud_config_v1::model::deployment::LockState;
542    /// let x0 = Deployment::new().set_lock_state(LockState::Locked);
543    /// let x1 = Deployment::new().set_lock_state(LockState::Unlocked);
544    /// let x2 = Deployment::new().set_lock_state(LockState::Locking);
545    /// ```
546    pub fn set_lock_state<T: std::convert::Into<crate::model::deployment::LockState>>(
547        mut self,
548        v: T,
549    ) -> Self {
550        self.lock_state = v.into();
551        self
552    }
553
554    /// Sets the value of [tf_version_constraint][crate::model::Deployment::tf_version_constraint].
555    ///
556    /// # Example
557    /// ```ignore,no_run
558    /// # use google_cloud_config_v1::model::Deployment;
559    /// let x = Deployment::new().set_tf_version_constraint("example");
560    /// ```
561    pub fn set_tf_version_constraint<T>(mut self, v: T) -> Self
562    where
563        T: std::convert::Into<std::string::String>,
564    {
565        self.tf_version_constraint = std::option::Option::Some(v.into());
566        self
567    }
568
569    /// Sets or clears the value of [tf_version_constraint][crate::model::Deployment::tf_version_constraint].
570    ///
571    /// # Example
572    /// ```ignore,no_run
573    /// # use google_cloud_config_v1::model::Deployment;
574    /// let x = Deployment::new().set_or_clear_tf_version_constraint(Some("example"));
575    /// let x = Deployment::new().set_or_clear_tf_version_constraint(None::<String>);
576    /// ```
577    pub fn set_or_clear_tf_version_constraint<T>(mut self, v: std::option::Option<T>) -> Self
578    where
579        T: std::convert::Into<std::string::String>,
580    {
581        self.tf_version_constraint = v.map(|x| x.into());
582        self
583    }
584
585    /// Sets the value of [tf_version][crate::model::Deployment::tf_version].
586    ///
587    /// # Example
588    /// ```ignore,no_run
589    /// # use google_cloud_config_v1::model::Deployment;
590    /// let x = Deployment::new().set_tf_version("example");
591    /// ```
592    pub fn set_tf_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
593        self.tf_version = v.into();
594        self
595    }
596
597    /// Sets the value of [quota_validation][crate::model::Deployment::quota_validation].
598    ///
599    /// # Example
600    /// ```ignore,no_run
601    /// # use google_cloud_config_v1::model::Deployment;
602    /// use google_cloud_config_v1::model::QuotaValidation;
603    /// let x0 = Deployment::new().set_quota_validation(QuotaValidation::Enabled);
604    /// let x1 = Deployment::new().set_quota_validation(QuotaValidation::Enforced);
605    /// ```
606    pub fn set_quota_validation<T: std::convert::Into<crate::model::QuotaValidation>>(
607        mut self,
608        v: T,
609    ) -> Self {
610        self.quota_validation = v.into();
611        self
612    }
613
614    /// Sets the value of [annotations][crate::model::Deployment::annotations].
615    ///
616    /// # Example
617    /// ```ignore,no_run
618    /// # use google_cloud_config_v1::model::Deployment;
619    /// let x = Deployment::new().set_annotations([
620    ///     ("key0", "abc"),
621    ///     ("key1", "xyz"),
622    /// ]);
623    /// ```
624    pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
625    where
626        T: std::iter::IntoIterator<Item = (K, V)>,
627        K: std::convert::Into<std::string::String>,
628        V: std::convert::Into<std::string::String>,
629    {
630        use std::iter::Iterator;
631        self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
632        self
633    }
634
635    /// Sets the value of [provider_config][crate::model::Deployment::provider_config].
636    ///
637    /// # Example
638    /// ```ignore,no_run
639    /// # use google_cloud_config_v1::model::Deployment;
640    /// use google_cloud_config_v1::model::ProviderConfig;
641    /// let x = Deployment::new().set_provider_config(ProviderConfig::default()/* use setters */);
642    /// ```
643    pub fn set_provider_config<T>(mut self, v: T) -> Self
644    where
645        T: std::convert::Into<crate::model::ProviderConfig>,
646    {
647        self.provider_config = std::option::Option::Some(v.into());
648        self
649    }
650
651    /// Sets or clears the value of [provider_config][crate::model::Deployment::provider_config].
652    ///
653    /// # Example
654    /// ```ignore,no_run
655    /// # use google_cloud_config_v1::model::Deployment;
656    /// use google_cloud_config_v1::model::ProviderConfig;
657    /// let x = Deployment::new().set_or_clear_provider_config(Some(ProviderConfig::default()/* use setters */));
658    /// let x = Deployment::new().set_or_clear_provider_config(None::<ProviderConfig>);
659    /// ```
660    pub fn set_or_clear_provider_config<T>(mut self, v: std::option::Option<T>) -> Self
661    where
662        T: std::convert::Into<crate::model::ProviderConfig>,
663    {
664        self.provider_config = v.map(|x| x.into());
665        self
666    }
667
668    /// Sets the value of [blueprint][crate::model::Deployment::blueprint].
669    ///
670    /// Note that all the setters affecting `blueprint` are mutually
671    /// exclusive.
672    ///
673    /// # Example
674    /// ```ignore,no_run
675    /// # use google_cloud_config_v1::model::Deployment;
676    /// use google_cloud_config_v1::model::TerraformBlueprint;
677    /// let x = Deployment::new().set_blueprint(Some(
678    ///     google_cloud_config_v1::model::deployment::Blueprint::TerraformBlueprint(TerraformBlueprint::default().into())));
679    /// ```
680    pub fn set_blueprint<
681        T: std::convert::Into<std::option::Option<crate::model::deployment::Blueprint>>,
682    >(
683        mut self,
684        v: T,
685    ) -> Self {
686        self.blueprint = v.into();
687        self
688    }
689
690    /// The value of [blueprint][crate::model::Deployment::blueprint]
691    /// if it holds a `TerraformBlueprint`, `None` if the field is not set or
692    /// holds a different branch.
693    pub fn terraform_blueprint(
694        &self,
695    ) -> std::option::Option<&std::boxed::Box<crate::model::TerraformBlueprint>> {
696        #[allow(unreachable_patterns)]
697        self.blueprint.as_ref().and_then(|v| match v {
698            crate::model::deployment::Blueprint::TerraformBlueprint(v) => {
699                std::option::Option::Some(v)
700            }
701            _ => std::option::Option::None,
702        })
703    }
704
705    /// Sets the value of [blueprint][crate::model::Deployment::blueprint]
706    /// to hold a `TerraformBlueprint`.
707    ///
708    /// Note that all the setters affecting `blueprint` are
709    /// mutually exclusive.
710    ///
711    /// # Example
712    /// ```ignore,no_run
713    /// # use google_cloud_config_v1::model::Deployment;
714    /// use google_cloud_config_v1::model::TerraformBlueprint;
715    /// let x = Deployment::new().set_terraform_blueprint(TerraformBlueprint::default()/* use setters */);
716    /// assert!(x.terraform_blueprint().is_some());
717    /// ```
718    pub fn set_terraform_blueprint<
719        T: std::convert::Into<std::boxed::Box<crate::model::TerraformBlueprint>>,
720    >(
721        mut self,
722        v: T,
723    ) -> Self {
724        self.blueprint = std::option::Option::Some(
725            crate::model::deployment::Blueprint::TerraformBlueprint(v.into()),
726        );
727        self
728    }
729}
730
731impl wkt::message::Message for Deployment {
732    fn typename() -> &'static str {
733        "type.googleapis.com/google.cloud.config.v1.Deployment"
734    }
735}
736
737/// Defines additional types related to [Deployment].
738pub mod deployment {
739    #[allow(unused_imports)]
740    use super::*;
741
742    /// Possible states of a deployment.
743    ///
744    /// # Working with unknown values
745    ///
746    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
747    /// additional enum variants at any time. Adding new variants is not considered
748    /// a breaking change. Applications should write their code in anticipation of:
749    ///
750    /// - New values appearing in future releases of the client library, **and**
751    /// - New values received dynamically, without application changes.
752    ///
753    /// Please consult the [Working with enums] section in the user guide for some
754    /// guidelines.
755    ///
756    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
757    #[derive(Clone, Debug, PartialEq)]
758    #[non_exhaustive]
759    pub enum State {
760        /// The default value. This value is used if the state is omitted.
761        Unspecified,
762        /// The deployment is being created.
763        Creating,
764        /// The deployment is healthy.
765        Active,
766        /// The deployment is being updated.
767        Updating,
768        /// The deployment is being deleted.
769        Deleting,
770        /// The deployment has encountered an unexpected error.
771        Failed,
772        /// The deployment is no longer being actively reconciled.
773        /// This may be the result of recovering the project after deletion.
774        Suspended,
775        /// The deployment has been deleted.
776        Deleted,
777        /// If set, the enum was initialized with an unknown value.
778        ///
779        /// Applications can examine the value using [State::value] or
780        /// [State::name].
781        UnknownValue(state::UnknownValue),
782    }
783
784    #[doc(hidden)]
785    pub mod state {
786        #[allow(unused_imports)]
787        use super::*;
788        #[derive(Clone, Debug, PartialEq)]
789        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
790    }
791
792    impl State {
793        /// Gets the enum value.
794        ///
795        /// Returns `None` if the enum contains an unknown value deserialized from
796        /// the string representation of enums.
797        pub fn value(&self) -> std::option::Option<i32> {
798            match self {
799                Self::Unspecified => std::option::Option::Some(0),
800                Self::Creating => std::option::Option::Some(1),
801                Self::Active => std::option::Option::Some(2),
802                Self::Updating => std::option::Option::Some(3),
803                Self::Deleting => std::option::Option::Some(4),
804                Self::Failed => std::option::Option::Some(5),
805                Self::Suspended => std::option::Option::Some(6),
806                Self::Deleted => std::option::Option::Some(7),
807                Self::UnknownValue(u) => u.0.value(),
808            }
809        }
810
811        /// Gets the enum value as a string.
812        ///
813        /// Returns `None` if the enum contains an unknown value deserialized from
814        /// the integer representation of enums.
815        pub fn name(&self) -> std::option::Option<&str> {
816            match self {
817                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
818                Self::Creating => std::option::Option::Some("CREATING"),
819                Self::Active => std::option::Option::Some("ACTIVE"),
820                Self::Updating => std::option::Option::Some("UPDATING"),
821                Self::Deleting => std::option::Option::Some("DELETING"),
822                Self::Failed => std::option::Option::Some("FAILED"),
823                Self::Suspended => std::option::Option::Some("SUSPENDED"),
824                Self::Deleted => std::option::Option::Some("DELETED"),
825                Self::UnknownValue(u) => u.0.name(),
826            }
827        }
828    }
829
830    impl std::default::Default for State {
831        fn default() -> Self {
832            use std::convert::From;
833            Self::from(0)
834        }
835    }
836
837    impl std::fmt::Display for State {
838        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
839            wkt::internal::display_enum(f, self.name(), self.value())
840        }
841    }
842
843    impl std::convert::From<i32> for State {
844        fn from(value: i32) -> Self {
845            match value {
846                0 => Self::Unspecified,
847                1 => Self::Creating,
848                2 => Self::Active,
849                3 => Self::Updating,
850                4 => Self::Deleting,
851                5 => Self::Failed,
852                6 => Self::Suspended,
853                7 => Self::Deleted,
854                _ => Self::UnknownValue(state::UnknownValue(
855                    wkt::internal::UnknownEnumValue::Integer(value),
856                )),
857            }
858        }
859    }
860
861    impl std::convert::From<&str> for State {
862        fn from(value: &str) -> Self {
863            use std::string::ToString;
864            match value {
865                "STATE_UNSPECIFIED" => Self::Unspecified,
866                "CREATING" => Self::Creating,
867                "ACTIVE" => Self::Active,
868                "UPDATING" => Self::Updating,
869                "DELETING" => Self::Deleting,
870                "FAILED" => Self::Failed,
871                "SUSPENDED" => Self::Suspended,
872                "DELETED" => Self::Deleted,
873                _ => Self::UnknownValue(state::UnknownValue(
874                    wkt::internal::UnknownEnumValue::String(value.to_string()),
875                )),
876            }
877        }
878    }
879
880    impl serde::ser::Serialize for State {
881        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
882        where
883            S: serde::Serializer,
884        {
885            match self {
886                Self::Unspecified => serializer.serialize_i32(0),
887                Self::Creating => serializer.serialize_i32(1),
888                Self::Active => serializer.serialize_i32(2),
889                Self::Updating => serializer.serialize_i32(3),
890                Self::Deleting => serializer.serialize_i32(4),
891                Self::Failed => serializer.serialize_i32(5),
892                Self::Suspended => serializer.serialize_i32(6),
893                Self::Deleted => serializer.serialize_i32(7),
894                Self::UnknownValue(u) => u.0.serialize(serializer),
895            }
896        }
897    }
898
899    impl<'de> serde::de::Deserialize<'de> for State {
900        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
901        where
902            D: serde::Deserializer<'de>,
903        {
904            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
905                ".google.cloud.config.v1.Deployment.State",
906            ))
907        }
908    }
909
910    /// Possible errors that can occur with deployments.
911    ///
912    /// # Working with unknown values
913    ///
914    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
915    /// additional enum variants at any time. Adding new variants is not considered
916    /// a breaking change. Applications should write their code in anticipation of:
917    ///
918    /// - New values appearing in future releases of the client library, **and**
919    /// - New values received dynamically, without application changes.
920    ///
921    /// Please consult the [Working with enums] section in the user guide for some
922    /// guidelines.
923    ///
924    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
925    #[derive(Clone, Debug, PartialEq)]
926    #[non_exhaustive]
927    pub enum ErrorCode {
928        /// No error code was specified.
929        Unspecified,
930        /// The revision failed. See Revision for more details.
931        RevisionFailed,
932        /// Cloud Build failed due to a permission issue.
933        CloudBuildPermissionDenied,
934        /// Cloud Build job associated with a deployment deletion could not be
935        /// started.
936        DeleteBuildApiFailed,
937        /// Cloud Build job associated with a deployment deletion was started but
938        /// failed.
939        DeleteBuildRunFailed,
940        /// Cloud Storage bucket creation failed due to a permission issue.
941        BucketCreationPermissionDenied,
942        /// Cloud Storage bucket creation failed due to an issue unrelated to
943        /// permissions.
944        BucketCreationFailed,
945        /// Failed to import values from an external source.
946        ExternalValueSourceImportFailed,
947        /// If set, the enum was initialized with an unknown value.
948        ///
949        /// Applications can examine the value using [ErrorCode::value] or
950        /// [ErrorCode::name].
951        UnknownValue(error_code::UnknownValue),
952    }
953
954    #[doc(hidden)]
955    pub mod error_code {
956        #[allow(unused_imports)]
957        use super::*;
958        #[derive(Clone, Debug, PartialEq)]
959        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
960    }
961
962    impl ErrorCode {
963        /// Gets the enum value.
964        ///
965        /// Returns `None` if the enum contains an unknown value deserialized from
966        /// the string representation of enums.
967        pub fn value(&self) -> std::option::Option<i32> {
968            match self {
969                Self::Unspecified => std::option::Option::Some(0),
970                Self::RevisionFailed => std::option::Option::Some(1),
971                Self::CloudBuildPermissionDenied => std::option::Option::Some(3),
972                Self::DeleteBuildApiFailed => std::option::Option::Some(5),
973                Self::DeleteBuildRunFailed => std::option::Option::Some(6),
974                Self::BucketCreationPermissionDenied => std::option::Option::Some(7),
975                Self::BucketCreationFailed => std::option::Option::Some(8),
976                Self::ExternalValueSourceImportFailed => std::option::Option::Some(10),
977                Self::UnknownValue(u) => u.0.value(),
978            }
979        }
980
981        /// Gets the enum value as a string.
982        ///
983        /// Returns `None` if the enum contains an unknown value deserialized from
984        /// the integer representation of enums.
985        pub fn name(&self) -> std::option::Option<&str> {
986            match self {
987                Self::Unspecified => std::option::Option::Some("ERROR_CODE_UNSPECIFIED"),
988                Self::RevisionFailed => std::option::Option::Some("REVISION_FAILED"),
989                Self::CloudBuildPermissionDenied => {
990                    std::option::Option::Some("CLOUD_BUILD_PERMISSION_DENIED")
991                }
992                Self::DeleteBuildApiFailed => std::option::Option::Some("DELETE_BUILD_API_FAILED"),
993                Self::DeleteBuildRunFailed => std::option::Option::Some("DELETE_BUILD_RUN_FAILED"),
994                Self::BucketCreationPermissionDenied => {
995                    std::option::Option::Some("BUCKET_CREATION_PERMISSION_DENIED")
996                }
997                Self::BucketCreationFailed => std::option::Option::Some("BUCKET_CREATION_FAILED"),
998                Self::ExternalValueSourceImportFailed => {
999                    std::option::Option::Some("EXTERNAL_VALUE_SOURCE_IMPORT_FAILED")
1000                }
1001                Self::UnknownValue(u) => u.0.name(),
1002            }
1003        }
1004    }
1005
1006    impl std::default::Default for ErrorCode {
1007        fn default() -> Self {
1008            use std::convert::From;
1009            Self::from(0)
1010        }
1011    }
1012
1013    impl std::fmt::Display for ErrorCode {
1014        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1015            wkt::internal::display_enum(f, self.name(), self.value())
1016        }
1017    }
1018
1019    impl std::convert::From<i32> for ErrorCode {
1020        fn from(value: i32) -> Self {
1021            match value {
1022                0 => Self::Unspecified,
1023                1 => Self::RevisionFailed,
1024                3 => Self::CloudBuildPermissionDenied,
1025                5 => Self::DeleteBuildApiFailed,
1026                6 => Self::DeleteBuildRunFailed,
1027                7 => Self::BucketCreationPermissionDenied,
1028                8 => Self::BucketCreationFailed,
1029                10 => Self::ExternalValueSourceImportFailed,
1030                _ => Self::UnknownValue(error_code::UnknownValue(
1031                    wkt::internal::UnknownEnumValue::Integer(value),
1032                )),
1033            }
1034        }
1035    }
1036
1037    impl std::convert::From<&str> for ErrorCode {
1038        fn from(value: &str) -> Self {
1039            use std::string::ToString;
1040            match value {
1041                "ERROR_CODE_UNSPECIFIED" => Self::Unspecified,
1042                "REVISION_FAILED" => Self::RevisionFailed,
1043                "CLOUD_BUILD_PERMISSION_DENIED" => Self::CloudBuildPermissionDenied,
1044                "DELETE_BUILD_API_FAILED" => Self::DeleteBuildApiFailed,
1045                "DELETE_BUILD_RUN_FAILED" => Self::DeleteBuildRunFailed,
1046                "BUCKET_CREATION_PERMISSION_DENIED" => Self::BucketCreationPermissionDenied,
1047                "BUCKET_CREATION_FAILED" => Self::BucketCreationFailed,
1048                "EXTERNAL_VALUE_SOURCE_IMPORT_FAILED" => Self::ExternalValueSourceImportFailed,
1049                _ => Self::UnknownValue(error_code::UnknownValue(
1050                    wkt::internal::UnknownEnumValue::String(value.to_string()),
1051                )),
1052            }
1053        }
1054    }
1055
1056    impl serde::ser::Serialize for ErrorCode {
1057        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1058        where
1059            S: serde::Serializer,
1060        {
1061            match self {
1062                Self::Unspecified => serializer.serialize_i32(0),
1063                Self::RevisionFailed => serializer.serialize_i32(1),
1064                Self::CloudBuildPermissionDenied => serializer.serialize_i32(3),
1065                Self::DeleteBuildApiFailed => serializer.serialize_i32(5),
1066                Self::DeleteBuildRunFailed => serializer.serialize_i32(6),
1067                Self::BucketCreationPermissionDenied => serializer.serialize_i32(7),
1068                Self::BucketCreationFailed => serializer.serialize_i32(8),
1069                Self::ExternalValueSourceImportFailed => serializer.serialize_i32(10),
1070                Self::UnknownValue(u) => u.0.serialize(serializer),
1071            }
1072        }
1073    }
1074
1075    impl<'de> serde::de::Deserialize<'de> for ErrorCode {
1076        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1077        where
1078            D: serde::Deserializer<'de>,
1079        {
1080            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ErrorCode>::new(
1081                ".google.cloud.config.v1.Deployment.ErrorCode",
1082            ))
1083        }
1084    }
1085
1086    /// Possible lock states of a deployment.
1087    ///
1088    /// # Working with unknown values
1089    ///
1090    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1091    /// additional enum variants at any time. Adding new variants is not considered
1092    /// a breaking change. Applications should write their code in anticipation of:
1093    ///
1094    /// - New values appearing in future releases of the client library, **and**
1095    /// - New values received dynamically, without application changes.
1096    ///
1097    /// Please consult the [Working with enums] section in the user guide for some
1098    /// guidelines.
1099    ///
1100    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
1101    #[derive(Clone, Debug, PartialEq)]
1102    #[non_exhaustive]
1103    pub enum LockState {
1104        /// The default value. This value is used if the lock state is omitted.
1105        Unspecified,
1106        /// The deployment is locked.
1107        Locked,
1108        /// The deployment is unlocked.
1109        Unlocked,
1110        /// The deployment is being locked.
1111        Locking,
1112        /// The deployment is being unlocked.
1113        Unlocking,
1114        /// The deployment has failed to lock.
1115        LockFailed,
1116        /// The deployment has failed to unlock.
1117        UnlockFailed,
1118        /// If set, the enum was initialized with an unknown value.
1119        ///
1120        /// Applications can examine the value using [LockState::value] or
1121        /// [LockState::name].
1122        UnknownValue(lock_state::UnknownValue),
1123    }
1124
1125    #[doc(hidden)]
1126    pub mod lock_state {
1127        #[allow(unused_imports)]
1128        use super::*;
1129        #[derive(Clone, Debug, PartialEq)]
1130        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1131    }
1132
1133    impl LockState {
1134        /// Gets the enum value.
1135        ///
1136        /// Returns `None` if the enum contains an unknown value deserialized from
1137        /// the string representation of enums.
1138        pub fn value(&self) -> std::option::Option<i32> {
1139            match self {
1140                Self::Unspecified => std::option::Option::Some(0),
1141                Self::Locked => std::option::Option::Some(1),
1142                Self::Unlocked => std::option::Option::Some(2),
1143                Self::Locking => std::option::Option::Some(3),
1144                Self::Unlocking => std::option::Option::Some(4),
1145                Self::LockFailed => std::option::Option::Some(5),
1146                Self::UnlockFailed => std::option::Option::Some(6),
1147                Self::UnknownValue(u) => u.0.value(),
1148            }
1149        }
1150
1151        /// Gets the enum value as a string.
1152        ///
1153        /// Returns `None` if the enum contains an unknown value deserialized from
1154        /// the integer representation of enums.
1155        pub fn name(&self) -> std::option::Option<&str> {
1156            match self {
1157                Self::Unspecified => std::option::Option::Some("LOCK_STATE_UNSPECIFIED"),
1158                Self::Locked => std::option::Option::Some("LOCKED"),
1159                Self::Unlocked => std::option::Option::Some("UNLOCKED"),
1160                Self::Locking => std::option::Option::Some("LOCKING"),
1161                Self::Unlocking => std::option::Option::Some("UNLOCKING"),
1162                Self::LockFailed => std::option::Option::Some("LOCK_FAILED"),
1163                Self::UnlockFailed => std::option::Option::Some("UNLOCK_FAILED"),
1164                Self::UnknownValue(u) => u.0.name(),
1165            }
1166        }
1167    }
1168
1169    impl std::default::Default for LockState {
1170        fn default() -> Self {
1171            use std::convert::From;
1172            Self::from(0)
1173        }
1174    }
1175
1176    impl std::fmt::Display for LockState {
1177        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1178            wkt::internal::display_enum(f, self.name(), self.value())
1179        }
1180    }
1181
1182    impl std::convert::From<i32> for LockState {
1183        fn from(value: i32) -> Self {
1184            match value {
1185                0 => Self::Unspecified,
1186                1 => Self::Locked,
1187                2 => Self::Unlocked,
1188                3 => Self::Locking,
1189                4 => Self::Unlocking,
1190                5 => Self::LockFailed,
1191                6 => Self::UnlockFailed,
1192                _ => Self::UnknownValue(lock_state::UnknownValue(
1193                    wkt::internal::UnknownEnumValue::Integer(value),
1194                )),
1195            }
1196        }
1197    }
1198
1199    impl std::convert::From<&str> for LockState {
1200        fn from(value: &str) -> Self {
1201            use std::string::ToString;
1202            match value {
1203                "LOCK_STATE_UNSPECIFIED" => Self::Unspecified,
1204                "LOCKED" => Self::Locked,
1205                "UNLOCKED" => Self::Unlocked,
1206                "LOCKING" => Self::Locking,
1207                "UNLOCKING" => Self::Unlocking,
1208                "LOCK_FAILED" => Self::LockFailed,
1209                "UNLOCK_FAILED" => Self::UnlockFailed,
1210                _ => Self::UnknownValue(lock_state::UnknownValue(
1211                    wkt::internal::UnknownEnumValue::String(value.to_string()),
1212                )),
1213            }
1214        }
1215    }
1216
1217    impl serde::ser::Serialize for LockState {
1218        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1219        where
1220            S: serde::Serializer,
1221        {
1222            match self {
1223                Self::Unspecified => serializer.serialize_i32(0),
1224                Self::Locked => serializer.serialize_i32(1),
1225                Self::Unlocked => serializer.serialize_i32(2),
1226                Self::Locking => serializer.serialize_i32(3),
1227                Self::Unlocking => serializer.serialize_i32(4),
1228                Self::LockFailed => serializer.serialize_i32(5),
1229                Self::UnlockFailed => serializer.serialize_i32(6),
1230                Self::UnknownValue(u) => u.0.serialize(serializer),
1231            }
1232        }
1233    }
1234
1235    impl<'de> serde::de::Deserialize<'de> for LockState {
1236        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1237        where
1238            D: serde::Deserializer<'de>,
1239        {
1240            deserializer.deserialize_any(wkt::internal::EnumVisitor::<LockState>::new(
1241                ".google.cloud.config.v1.Deployment.LockState",
1242            ))
1243        }
1244    }
1245
1246    /// Blueprint to deploy.
1247    #[derive(Clone, Debug, PartialEq)]
1248    #[non_exhaustive]
1249    pub enum Blueprint {
1250        /// A blueprint described using Terraform's HashiCorp Configuration Language
1251        /// as a root module.
1252        TerraformBlueprint(std::boxed::Box<crate::model::TerraformBlueprint>),
1253    }
1254}
1255
1256/// TerraformBlueprint describes the source of a Terraform root module which
1257/// describes the resources and configs to be deployed.
1258#[derive(Clone, Default, PartialEq)]
1259#[non_exhaustive]
1260pub struct TerraformBlueprint {
1261    /// Optional. Input variable values for the Terraform blueprint.
1262    pub input_values:
1263        std::collections::HashMap<std::string::String, crate::model::TerraformVariable>,
1264
1265    /// Optional. Map of input variable names in this blueprint to configurations
1266    /// for importing values from external sources.
1267    pub external_values:
1268        std::collections::HashMap<std::string::String, crate::model::ExternalValueSource>,
1269
1270    /// Location of the source configs.
1271    /// Required.
1272    pub source: std::option::Option<crate::model::terraform_blueprint::Source>,
1273
1274    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1275}
1276
1277impl TerraformBlueprint {
1278    /// Creates a new default instance.
1279    pub fn new() -> Self {
1280        std::default::Default::default()
1281    }
1282
1283    /// Sets the value of [input_values][crate::model::TerraformBlueprint::input_values].
1284    ///
1285    /// # Example
1286    /// ```ignore,no_run
1287    /// # use google_cloud_config_v1::model::TerraformBlueprint;
1288    /// use google_cloud_config_v1::model::TerraformVariable;
1289    /// let x = TerraformBlueprint::new().set_input_values([
1290    ///     ("key0", TerraformVariable::default()/* use setters */),
1291    ///     ("key1", TerraformVariable::default()/* use (different) setters */),
1292    /// ]);
1293    /// ```
1294    pub fn set_input_values<T, K, V>(mut self, v: T) -> Self
1295    where
1296        T: std::iter::IntoIterator<Item = (K, V)>,
1297        K: std::convert::Into<std::string::String>,
1298        V: std::convert::Into<crate::model::TerraformVariable>,
1299    {
1300        use std::iter::Iterator;
1301        self.input_values = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1302        self
1303    }
1304
1305    /// Sets the value of [external_values][crate::model::TerraformBlueprint::external_values].
1306    ///
1307    /// # Example
1308    /// ```ignore,no_run
1309    /// # use google_cloud_config_v1::model::TerraformBlueprint;
1310    /// use google_cloud_config_v1::model::ExternalValueSource;
1311    /// let x = TerraformBlueprint::new().set_external_values([
1312    ///     ("key0", ExternalValueSource::default()/* use setters */),
1313    ///     ("key1", ExternalValueSource::default()/* use (different) setters */),
1314    /// ]);
1315    /// ```
1316    pub fn set_external_values<T, K, V>(mut self, v: T) -> Self
1317    where
1318        T: std::iter::IntoIterator<Item = (K, V)>,
1319        K: std::convert::Into<std::string::String>,
1320        V: std::convert::Into<crate::model::ExternalValueSource>,
1321    {
1322        use std::iter::Iterator;
1323        self.external_values = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1324        self
1325    }
1326
1327    /// Sets the value of [source][crate::model::TerraformBlueprint::source].
1328    ///
1329    /// Note that all the setters affecting `source` are mutually
1330    /// exclusive.
1331    ///
1332    /// # Example
1333    /// ```ignore,no_run
1334    /// # use google_cloud_config_v1::model::TerraformBlueprint;
1335    /// use google_cloud_config_v1::model::terraform_blueprint::Source;
1336    /// let x = TerraformBlueprint::new().set_source(Some(Source::GcsSource("example".to_string())));
1337    /// ```
1338    pub fn set_source<
1339        T: std::convert::Into<std::option::Option<crate::model::terraform_blueprint::Source>>,
1340    >(
1341        mut self,
1342        v: T,
1343    ) -> Self {
1344        self.source = v.into();
1345        self
1346    }
1347
1348    /// The value of [source][crate::model::TerraformBlueprint::source]
1349    /// if it holds a `GcsSource`, `None` if the field is not set or
1350    /// holds a different branch.
1351    pub fn gcs_source(&self) -> std::option::Option<&std::string::String> {
1352        #[allow(unreachable_patterns)]
1353        self.source.as_ref().and_then(|v| match v {
1354            crate::model::terraform_blueprint::Source::GcsSource(v) => std::option::Option::Some(v),
1355            _ => std::option::Option::None,
1356        })
1357    }
1358
1359    /// Sets the value of [source][crate::model::TerraformBlueprint::source]
1360    /// to hold a `GcsSource`.
1361    ///
1362    /// Note that all the setters affecting `source` are
1363    /// mutually exclusive.
1364    ///
1365    /// # Example
1366    /// ```ignore,no_run
1367    /// # use google_cloud_config_v1::model::TerraformBlueprint;
1368    /// let x = TerraformBlueprint::new().set_gcs_source("example");
1369    /// assert!(x.gcs_source().is_some());
1370    /// assert!(x.git_source().is_none());
1371    /// ```
1372    pub fn set_gcs_source<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1373        self.source = std::option::Option::Some(
1374            crate::model::terraform_blueprint::Source::GcsSource(v.into()),
1375        );
1376        self
1377    }
1378
1379    /// The value of [source][crate::model::TerraformBlueprint::source]
1380    /// if it holds a `GitSource`, `None` if the field is not set or
1381    /// holds a different branch.
1382    pub fn git_source(&self) -> std::option::Option<&std::boxed::Box<crate::model::GitSource>> {
1383        #[allow(unreachable_patterns)]
1384        self.source.as_ref().and_then(|v| match v {
1385            crate::model::terraform_blueprint::Source::GitSource(v) => std::option::Option::Some(v),
1386            _ => std::option::Option::None,
1387        })
1388    }
1389
1390    /// Sets the value of [source][crate::model::TerraformBlueprint::source]
1391    /// to hold a `GitSource`.
1392    ///
1393    /// Note that all the setters affecting `source` are
1394    /// mutually exclusive.
1395    ///
1396    /// # Example
1397    /// ```ignore,no_run
1398    /// # use google_cloud_config_v1::model::TerraformBlueprint;
1399    /// use google_cloud_config_v1::model::GitSource;
1400    /// let x = TerraformBlueprint::new().set_git_source(GitSource::default()/* use setters */);
1401    /// assert!(x.git_source().is_some());
1402    /// assert!(x.gcs_source().is_none());
1403    /// ```
1404    pub fn set_git_source<T: std::convert::Into<std::boxed::Box<crate::model::GitSource>>>(
1405        mut self,
1406        v: T,
1407    ) -> Self {
1408        self.source = std::option::Option::Some(
1409            crate::model::terraform_blueprint::Source::GitSource(v.into()),
1410        );
1411        self
1412    }
1413}
1414
1415impl wkt::message::Message for TerraformBlueprint {
1416    fn typename() -> &'static str {
1417        "type.googleapis.com/google.cloud.config.v1.TerraformBlueprint"
1418    }
1419}
1420
1421/// Defines additional types related to [TerraformBlueprint].
1422pub mod terraform_blueprint {
1423    #[allow(unused_imports)]
1424    use super::*;
1425
1426    /// Location of the source configs.
1427    /// Required.
1428    #[derive(Clone, Debug, PartialEq)]
1429    #[non_exhaustive]
1430    pub enum Source {
1431        /// URI of an object in Google Cloud Storage.
1432        /// Format: `gs://{bucket}/{object}`
1433        ///
1434        /// URI may also specify an object version for zipped objects.
1435        /// Format: `gs://{bucket}/{object}#{version}`
1436        GcsSource(std::string::String),
1437        /// URI of a public Git repo.
1438        GitSource(std::boxed::Box<crate::model::GitSource>),
1439    }
1440}
1441
1442/// A Terraform input variable.
1443#[derive(Clone, Default, PartialEq)]
1444#[non_exhaustive]
1445pub struct TerraformVariable {
1446    /// Optional. Input variable value.
1447    pub input_value: std::option::Option<wkt::Value>,
1448
1449    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1450}
1451
1452impl TerraformVariable {
1453    /// Creates a new default instance.
1454    pub fn new() -> Self {
1455        std::default::Default::default()
1456    }
1457
1458    /// Sets the value of [input_value][crate::model::TerraformVariable::input_value].
1459    ///
1460    /// # Example
1461    /// ```ignore,no_run
1462    /// # use google_cloud_config_v1::model::TerraformVariable;
1463    /// use wkt::Value;
1464    /// let x = TerraformVariable::new().set_input_value(Value::default()/* use setters */);
1465    /// ```
1466    pub fn set_input_value<T>(mut self, v: T) -> Self
1467    where
1468        T: std::convert::Into<wkt::Value>,
1469    {
1470        self.input_value = std::option::Option::Some(v.into());
1471        self
1472    }
1473
1474    /// Sets or clears the value of [input_value][crate::model::TerraformVariable::input_value].
1475    ///
1476    /// # Example
1477    /// ```ignore,no_run
1478    /// # use google_cloud_config_v1::model::TerraformVariable;
1479    /// use wkt::Value;
1480    /// let x = TerraformVariable::new().set_or_clear_input_value(Some(Value::default()/* use setters */));
1481    /// let x = TerraformVariable::new().set_or_clear_input_value(None::<Value>);
1482    /// ```
1483    pub fn set_or_clear_input_value<T>(mut self, v: std::option::Option<T>) -> Self
1484    where
1485        T: std::convert::Into<wkt::Value>,
1486    {
1487        self.input_value = v.map(|x| x.into());
1488        self
1489    }
1490}
1491
1492impl wkt::message::Message for TerraformVariable {
1493    fn typename() -> &'static str {
1494        "type.googleapis.com/google.cloud.config.v1.TerraformVariable"
1495    }
1496}
1497
1498/// Configuration for a source of an external value.
1499#[derive(Clone, Default, PartialEq)]
1500#[non_exhaustive]
1501pub struct ExternalValueSource {
1502    /// The source of the external value.
1503    pub source: std::option::Option<crate::model::external_value_source::Source>,
1504
1505    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1506}
1507
1508impl ExternalValueSource {
1509    /// Creates a new default instance.
1510    pub fn new() -> Self {
1511        std::default::Default::default()
1512    }
1513
1514    /// Sets the value of [source][crate::model::ExternalValueSource::source].
1515    ///
1516    /// Note that all the setters affecting `source` are mutually
1517    /// exclusive.
1518    ///
1519    /// # Example
1520    /// ```ignore,no_run
1521    /// # use google_cloud_config_v1::model::ExternalValueSource;
1522    /// use google_cloud_config_v1::model::DeploymentSource;
1523    /// let x = ExternalValueSource::new().set_source(Some(
1524    ///     google_cloud_config_v1::model::external_value_source::Source::DeploymentSource(DeploymentSource::default().into())));
1525    /// ```
1526    pub fn set_source<
1527        T: std::convert::Into<std::option::Option<crate::model::external_value_source::Source>>,
1528    >(
1529        mut self,
1530        v: T,
1531    ) -> Self {
1532        self.source = v.into();
1533        self
1534    }
1535
1536    /// The value of [source][crate::model::ExternalValueSource::source]
1537    /// if it holds a `DeploymentSource`, `None` if the field is not set or
1538    /// holds a different branch.
1539    pub fn deployment_source(
1540        &self,
1541    ) -> std::option::Option<&std::boxed::Box<crate::model::DeploymentSource>> {
1542        #[allow(unreachable_patterns)]
1543        self.source.as_ref().and_then(|v| match v {
1544            crate::model::external_value_source::Source::DeploymentSource(v) => {
1545                std::option::Option::Some(v)
1546            }
1547            _ => std::option::Option::None,
1548        })
1549    }
1550
1551    /// Sets the value of [source][crate::model::ExternalValueSource::source]
1552    /// to hold a `DeploymentSource`.
1553    ///
1554    /// Note that all the setters affecting `source` are
1555    /// mutually exclusive.
1556    ///
1557    /// # Example
1558    /// ```ignore,no_run
1559    /// # use google_cloud_config_v1::model::ExternalValueSource;
1560    /// use google_cloud_config_v1::model::DeploymentSource;
1561    /// let x = ExternalValueSource::new().set_deployment_source(DeploymentSource::default()/* use setters */);
1562    /// assert!(x.deployment_source().is_some());
1563    /// ```
1564    pub fn set_deployment_source<
1565        T: std::convert::Into<std::boxed::Box<crate::model::DeploymentSource>>,
1566    >(
1567        mut self,
1568        v: T,
1569    ) -> Self {
1570        self.source = std::option::Option::Some(
1571            crate::model::external_value_source::Source::DeploymentSource(v.into()),
1572        );
1573        self
1574    }
1575}
1576
1577impl wkt::message::Message for ExternalValueSource {
1578    fn typename() -> &'static str {
1579        "type.googleapis.com/google.cloud.config.v1.ExternalValueSource"
1580    }
1581}
1582
1583/// Defines additional types related to [ExternalValueSource].
1584pub mod external_value_source {
1585    #[allow(unused_imports)]
1586    use super::*;
1587
1588    /// The source of the external value.
1589    #[derive(Clone, Debug, PartialEq)]
1590    #[non_exhaustive]
1591    pub enum Source {
1592        /// A source from a Deployment.
1593        DeploymentSource(std::boxed::Box<crate::model::DeploymentSource>),
1594    }
1595}
1596
1597/// Configuration for a value sourced from a Deployment.
1598#[derive(Clone, Default, PartialEq)]
1599#[non_exhaustive]
1600pub struct DeploymentSource {
1601    /// Required. The resource name of the source Deployment to import the output
1602    /// from. Format:
1603    /// projects/{project}/locations/{location}/deployments/{deployment} The source
1604    /// deployment must be in the same project and location.
1605    pub deployment: std::string::String,
1606
1607    /// Required. The name of the output variable in the source deployment's latest
1608    /// successfully applied revision.
1609    pub output_name: std::string::String,
1610
1611    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1612}
1613
1614impl DeploymentSource {
1615    /// Creates a new default instance.
1616    pub fn new() -> Self {
1617        std::default::Default::default()
1618    }
1619
1620    /// Sets the value of [deployment][crate::model::DeploymentSource::deployment].
1621    ///
1622    /// # Example
1623    /// ```ignore,no_run
1624    /// # use google_cloud_config_v1::model::DeploymentSource;
1625    /// let x = DeploymentSource::new().set_deployment("example");
1626    /// ```
1627    pub fn set_deployment<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1628        self.deployment = v.into();
1629        self
1630    }
1631
1632    /// Sets the value of [output_name][crate::model::DeploymentSource::output_name].
1633    ///
1634    /// # Example
1635    /// ```ignore,no_run
1636    /// # use google_cloud_config_v1::model::DeploymentSource;
1637    /// let x = DeploymentSource::new().set_output_name("example");
1638    /// ```
1639    pub fn set_output_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1640        self.output_name = v.into();
1641        self
1642    }
1643}
1644
1645impl wkt::message::Message for DeploymentSource {
1646    fn typename() -> &'static str {
1647        "type.googleapis.com/google.cloud.config.v1.DeploymentSource"
1648    }
1649}
1650
1651/// Outputs and artifacts from applying a deployment.
1652#[derive(Clone, Default, PartialEq)]
1653#[non_exhaustive]
1654pub struct ApplyResults {
1655    /// Location of a blueprint copy and other manifests in Google Cloud Storage.
1656    /// Format: `gs://{bucket}/{object}`
1657    pub content: std::string::String,
1658
1659    /// Location of artifacts (e.g. logs) in Google Cloud Storage.
1660    /// Format: `gs://{bucket}/{object}`
1661    pub artifacts: std::string::String,
1662
1663    /// Map of output name to output info.
1664    pub outputs: std::collections::HashMap<std::string::String, crate::model::TerraformOutput>,
1665
1666    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1667}
1668
1669impl ApplyResults {
1670    /// Creates a new default instance.
1671    pub fn new() -> Self {
1672        std::default::Default::default()
1673    }
1674
1675    /// Sets the value of [content][crate::model::ApplyResults::content].
1676    ///
1677    /// # Example
1678    /// ```ignore,no_run
1679    /// # use google_cloud_config_v1::model::ApplyResults;
1680    /// let x = ApplyResults::new().set_content("example");
1681    /// ```
1682    pub fn set_content<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1683        self.content = v.into();
1684        self
1685    }
1686
1687    /// Sets the value of [artifacts][crate::model::ApplyResults::artifacts].
1688    ///
1689    /// # Example
1690    /// ```ignore,no_run
1691    /// # use google_cloud_config_v1::model::ApplyResults;
1692    /// let x = ApplyResults::new().set_artifacts("example");
1693    /// ```
1694    pub fn set_artifacts<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1695        self.artifacts = v.into();
1696        self
1697    }
1698
1699    /// Sets the value of [outputs][crate::model::ApplyResults::outputs].
1700    ///
1701    /// # Example
1702    /// ```ignore,no_run
1703    /// # use google_cloud_config_v1::model::ApplyResults;
1704    /// use google_cloud_config_v1::model::TerraformOutput;
1705    /// let x = ApplyResults::new().set_outputs([
1706    ///     ("key0", TerraformOutput::default()/* use setters */),
1707    ///     ("key1", TerraformOutput::default()/* use (different) setters */),
1708    /// ]);
1709    /// ```
1710    pub fn set_outputs<T, K, V>(mut self, v: T) -> Self
1711    where
1712        T: std::iter::IntoIterator<Item = (K, V)>,
1713        K: std::convert::Into<std::string::String>,
1714        V: std::convert::Into<crate::model::TerraformOutput>,
1715    {
1716        use std::iter::Iterator;
1717        self.outputs = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1718        self
1719    }
1720}
1721
1722impl wkt::message::Message for ApplyResults {
1723    fn typename() -> &'static str {
1724        "type.googleapis.com/google.cloud.config.v1.ApplyResults"
1725    }
1726}
1727
1728/// Describes a Terraform output.
1729#[derive(Clone, Default, PartialEq)]
1730#[non_exhaustive]
1731pub struct TerraformOutput {
1732    /// Identifies whether Terraform has set this output as a potential
1733    /// sensitive value.
1734    pub sensitive: bool,
1735
1736    /// Value of output.
1737    pub value: std::option::Option<wkt::Value>,
1738
1739    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1740}
1741
1742impl TerraformOutput {
1743    /// Creates a new default instance.
1744    pub fn new() -> Self {
1745        std::default::Default::default()
1746    }
1747
1748    /// Sets the value of [sensitive][crate::model::TerraformOutput::sensitive].
1749    ///
1750    /// # Example
1751    /// ```ignore,no_run
1752    /// # use google_cloud_config_v1::model::TerraformOutput;
1753    /// let x = TerraformOutput::new().set_sensitive(true);
1754    /// ```
1755    pub fn set_sensitive<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1756        self.sensitive = v.into();
1757        self
1758    }
1759
1760    /// Sets the value of [value][crate::model::TerraformOutput::value].
1761    ///
1762    /// # Example
1763    /// ```ignore,no_run
1764    /// # use google_cloud_config_v1::model::TerraformOutput;
1765    /// use wkt::Value;
1766    /// let x = TerraformOutput::new().set_value(Value::default()/* use setters */);
1767    /// ```
1768    pub fn set_value<T>(mut self, v: T) -> Self
1769    where
1770        T: std::convert::Into<wkt::Value>,
1771    {
1772        self.value = std::option::Option::Some(v.into());
1773        self
1774    }
1775
1776    /// Sets or clears the value of [value][crate::model::TerraformOutput::value].
1777    ///
1778    /// # Example
1779    /// ```ignore,no_run
1780    /// # use google_cloud_config_v1::model::TerraformOutput;
1781    /// use wkt::Value;
1782    /// let x = TerraformOutput::new().set_or_clear_value(Some(Value::default()/* use setters */));
1783    /// let x = TerraformOutput::new().set_or_clear_value(None::<Value>);
1784    /// ```
1785    pub fn set_or_clear_value<T>(mut self, v: std::option::Option<T>) -> Self
1786    where
1787        T: std::convert::Into<wkt::Value>,
1788    {
1789        self.value = v.map(|x| x.into());
1790        self
1791    }
1792}
1793
1794impl wkt::message::Message for TerraformOutput {
1795    fn typename() -> &'static str {
1796        "type.googleapis.com/google.cloud.config.v1.TerraformOutput"
1797    }
1798}
1799
1800#[allow(missing_docs)]
1801#[derive(Clone, Default, PartialEq)]
1802#[non_exhaustive]
1803pub struct ListDeploymentsRequest {
1804    /// Required. The parent in whose context the Deployments are listed. The
1805    /// parent value is in the format:
1806    /// 'projects/{project_id}/locations/{location}'.
1807    pub parent: std::string::String,
1808
1809    /// When requesting a page of resources, 'page_size' specifies number of
1810    /// resources to return. If unspecified, at most 500 will be returned. The
1811    /// maximum value is 1000.
1812    pub page_size: i32,
1813
1814    /// Token returned by previous call to 'ListDeployments' which specifies the
1815    /// position in the list from where to continue listing the resources.
1816    pub page_token: std::string::String,
1817
1818    /// Lists the Deployments that match the filter expression. A filter
1819    /// expression filters the resources listed in the response. The expression
1820    /// must be of the form '{field} {operator} {value}' where operators: '<', '>',
1821    /// '<=', '>=', '!=', '=', ':' are supported (colon ':' represents a HAS
1822    /// operator which is roughly synonymous with equality). {field} can refer to a
1823    /// proto or JSON field, or a synthetic field. Field names can be camelCase or
1824    /// snake_case.
1825    ///
1826    /// Examples:
1827    ///
1828    /// - Filter by name:
1829    ///   name = "projects/foo/locations/us-central1/deployments/bar
1830    ///
1831    /// - Filter by labels:
1832    ///
1833    ///   - Resources that have a key called 'foo'
1834    ///     labels.foo:*
1835    ///   - Resources that have a key called 'foo' whose value is 'bar'
1836    ///     labels.foo = bar
1837    /// - Filter by state:
1838    ///
1839    ///   - Deployments in CREATING state.
1840    ///     state=CREATING
1841    pub filter: std::string::String,
1842
1843    /// Field to use to sort the list.
1844    pub order_by: std::string::String,
1845
1846    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1847}
1848
1849impl ListDeploymentsRequest {
1850    /// Creates a new default instance.
1851    pub fn new() -> Self {
1852        std::default::Default::default()
1853    }
1854
1855    /// Sets the value of [parent][crate::model::ListDeploymentsRequest::parent].
1856    ///
1857    /// # Example
1858    /// ```ignore,no_run
1859    /// # use google_cloud_config_v1::model::ListDeploymentsRequest;
1860    /// let x = ListDeploymentsRequest::new().set_parent("example");
1861    /// ```
1862    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1863        self.parent = v.into();
1864        self
1865    }
1866
1867    /// Sets the value of [page_size][crate::model::ListDeploymentsRequest::page_size].
1868    ///
1869    /// # Example
1870    /// ```ignore,no_run
1871    /// # use google_cloud_config_v1::model::ListDeploymentsRequest;
1872    /// let x = ListDeploymentsRequest::new().set_page_size(42);
1873    /// ```
1874    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1875        self.page_size = v.into();
1876        self
1877    }
1878
1879    /// Sets the value of [page_token][crate::model::ListDeploymentsRequest::page_token].
1880    ///
1881    /// # Example
1882    /// ```ignore,no_run
1883    /// # use google_cloud_config_v1::model::ListDeploymentsRequest;
1884    /// let x = ListDeploymentsRequest::new().set_page_token("example");
1885    /// ```
1886    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1887        self.page_token = v.into();
1888        self
1889    }
1890
1891    /// Sets the value of [filter][crate::model::ListDeploymentsRequest::filter].
1892    ///
1893    /// # Example
1894    /// ```ignore,no_run
1895    /// # use google_cloud_config_v1::model::ListDeploymentsRequest;
1896    /// let x = ListDeploymentsRequest::new().set_filter("example");
1897    /// ```
1898    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1899        self.filter = v.into();
1900        self
1901    }
1902
1903    /// Sets the value of [order_by][crate::model::ListDeploymentsRequest::order_by].
1904    ///
1905    /// # Example
1906    /// ```ignore,no_run
1907    /// # use google_cloud_config_v1::model::ListDeploymentsRequest;
1908    /// let x = ListDeploymentsRequest::new().set_order_by("example");
1909    /// ```
1910    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1911        self.order_by = v.into();
1912        self
1913    }
1914}
1915
1916impl wkt::message::Message for ListDeploymentsRequest {
1917    fn typename() -> &'static str {
1918        "type.googleapis.com/google.cloud.config.v1.ListDeploymentsRequest"
1919    }
1920}
1921
1922#[allow(missing_docs)]
1923#[derive(Clone, Default, PartialEq)]
1924#[non_exhaustive]
1925pub struct ListDeploymentsResponse {
1926    /// List of [Deployment][google.cloud.config.v1.Deployment]s.
1927    ///
1928    /// [google.cloud.config.v1.Deployment]: crate::model::Deployment
1929    pub deployments: std::vec::Vec<crate::model::Deployment>,
1930
1931    /// Token to be supplied to the next ListDeployments request via `page_token`
1932    /// to obtain the next set of results.
1933    pub next_page_token: std::string::String,
1934
1935    /// Locations that could not be reached.
1936    pub unreachable: std::vec::Vec<std::string::String>,
1937
1938    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1939}
1940
1941impl ListDeploymentsResponse {
1942    /// Creates a new default instance.
1943    pub fn new() -> Self {
1944        std::default::Default::default()
1945    }
1946
1947    /// Sets the value of [deployments][crate::model::ListDeploymentsResponse::deployments].
1948    ///
1949    /// # Example
1950    /// ```ignore,no_run
1951    /// # use google_cloud_config_v1::model::ListDeploymentsResponse;
1952    /// use google_cloud_config_v1::model::Deployment;
1953    /// let x = ListDeploymentsResponse::new()
1954    ///     .set_deployments([
1955    ///         Deployment::default()/* use setters */,
1956    ///         Deployment::default()/* use (different) setters */,
1957    ///     ]);
1958    /// ```
1959    pub fn set_deployments<T, V>(mut self, v: T) -> Self
1960    where
1961        T: std::iter::IntoIterator<Item = V>,
1962        V: std::convert::Into<crate::model::Deployment>,
1963    {
1964        use std::iter::Iterator;
1965        self.deployments = v.into_iter().map(|i| i.into()).collect();
1966        self
1967    }
1968
1969    /// Sets the value of [next_page_token][crate::model::ListDeploymentsResponse::next_page_token].
1970    ///
1971    /// # Example
1972    /// ```ignore,no_run
1973    /// # use google_cloud_config_v1::model::ListDeploymentsResponse;
1974    /// let x = ListDeploymentsResponse::new().set_next_page_token("example");
1975    /// ```
1976    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1977        self.next_page_token = v.into();
1978        self
1979    }
1980
1981    /// Sets the value of [unreachable][crate::model::ListDeploymentsResponse::unreachable].
1982    ///
1983    /// # Example
1984    /// ```ignore,no_run
1985    /// # use google_cloud_config_v1::model::ListDeploymentsResponse;
1986    /// let x = ListDeploymentsResponse::new().set_unreachable(["a", "b", "c"]);
1987    /// ```
1988    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
1989    where
1990        T: std::iter::IntoIterator<Item = V>,
1991        V: std::convert::Into<std::string::String>,
1992    {
1993        use std::iter::Iterator;
1994        self.unreachable = v.into_iter().map(|i| i.into()).collect();
1995        self
1996    }
1997}
1998
1999impl wkt::message::Message for ListDeploymentsResponse {
2000    fn typename() -> &'static str {
2001        "type.googleapis.com/google.cloud.config.v1.ListDeploymentsResponse"
2002    }
2003}
2004
2005#[doc(hidden)]
2006impl google_cloud_gax::paginator::internal::PageableResponse for ListDeploymentsResponse {
2007    type PageItem = crate::model::Deployment;
2008
2009    fn items(self) -> std::vec::Vec<Self::PageItem> {
2010        self.deployments
2011    }
2012
2013    fn next_page_token(&self) -> std::string::String {
2014        use std::clone::Clone;
2015        self.next_page_token.clone()
2016    }
2017}
2018
2019#[allow(missing_docs)]
2020#[derive(Clone, Default, PartialEq)]
2021#[non_exhaustive]
2022pub struct GetDeploymentRequest {
2023    /// Required. The name of the deployment. Format:
2024    /// 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
2025    pub name: std::string::String,
2026
2027    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2028}
2029
2030impl GetDeploymentRequest {
2031    /// Creates a new default instance.
2032    pub fn new() -> Self {
2033        std::default::Default::default()
2034    }
2035
2036    /// Sets the value of [name][crate::model::GetDeploymentRequest::name].
2037    ///
2038    /// # Example
2039    /// ```ignore,no_run
2040    /// # use google_cloud_config_v1::model::GetDeploymentRequest;
2041    /// let x = GetDeploymentRequest::new().set_name("example");
2042    /// ```
2043    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2044        self.name = v.into();
2045        self
2046    }
2047}
2048
2049impl wkt::message::Message for GetDeploymentRequest {
2050    fn typename() -> &'static str {
2051        "type.googleapis.com/google.cloud.config.v1.GetDeploymentRequest"
2052    }
2053}
2054
2055/// A request to list Revisions passed to a 'ListRevisions' call.
2056#[derive(Clone, Default, PartialEq)]
2057#[non_exhaustive]
2058pub struct ListRevisionsRequest {
2059    /// Required. The parent in whose context the Revisions are listed. The parent
2060    /// value is in the format:
2061    /// 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
2062    pub parent: std::string::String,
2063
2064    /// When requesting a page of resources, `page_size` specifies number of
2065    /// resources to return. If unspecified, at most 500 will be returned. The
2066    /// maximum value is 1000.
2067    pub page_size: i32,
2068
2069    /// Token returned by previous call to 'ListRevisions' which specifies the
2070    /// position in the list from where to continue listing the resources.
2071    pub page_token: std::string::String,
2072
2073    /// Lists the Revisions that match the filter expression. A filter
2074    /// expression filters the resources listed in the response. The expression
2075    /// must be of the form '{field} {operator} {value}' where operators: '<', '>',
2076    /// '<=', '>=', '!=', '=', ':' are supported (colon ':' represents a HAS
2077    /// operator which is roughly synonymous with equality). {field} can refer to a
2078    /// proto or JSON field, or a synthetic field. Field names can be camelCase or
2079    /// snake_case.
2080    ///
2081    /// Examples:
2082    ///
2083    /// - Filter by name:
2084    ///   name = "projects/foo/locations/us-central1/deployments/dep/revisions/bar
2085    ///
2086    /// - Filter by labels:
2087    ///
2088    ///   - Resources that have a key called 'foo'
2089    ///     labels.foo:*
2090    ///   - Resources that have a key called 'foo' whose value is 'bar'
2091    ///     labels.foo = bar
2092    /// - Filter by state:
2093    ///
2094    ///   - Revisions in CREATING state.
2095    ///     state=CREATING
2096    pub filter: std::string::String,
2097
2098    /// Field to use to sort the list.
2099    pub order_by: std::string::String,
2100
2101    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2102}
2103
2104impl ListRevisionsRequest {
2105    /// Creates a new default instance.
2106    pub fn new() -> Self {
2107        std::default::Default::default()
2108    }
2109
2110    /// Sets the value of [parent][crate::model::ListRevisionsRequest::parent].
2111    ///
2112    /// # Example
2113    /// ```ignore,no_run
2114    /// # use google_cloud_config_v1::model::ListRevisionsRequest;
2115    /// let x = ListRevisionsRequest::new().set_parent("example");
2116    /// ```
2117    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2118        self.parent = v.into();
2119        self
2120    }
2121
2122    /// Sets the value of [page_size][crate::model::ListRevisionsRequest::page_size].
2123    ///
2124    /// # Example
2125    /// ```ignore,no_run
2126    /// # use google_cloud_config_v1::model::ListRevisionsRequest;
2127    /// let x = ListRevisionsRequest::new().set_page_size(42);
2128    /// ```
2129    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2130        self.page_size = v.into();
2131        self
2132    }
2133
2134    /// Sets the value of [page_token][crate::model::ListRevisionsRequest::page_token].
2135    ///
2136    /// # Example
2137    /// ```ignore,no_run
2138    /// # use google_cloud_config_v1::model::ListRevisionsRequest;
2139    /// let x = ListRevisionsRequest::new().set_page_token("example");
2140    /// ```
2141    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2142        self.page_token = v.into();
2143        self
2144    }
2145
2146    /// Sets the value of [filter][crate::model::ListRevisionsRequest::filter].
2147    ///
2148    /// # Example
2149    /// ```ignore,no_run
2150    /// # use google_cloud_config_v1::model::ListRevisionsRequest;
2151    /// let x = ListRevisionsRequest::new().set_filter("example");
2152    /// ```
2153    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2154        self.filter = v.into();
2155        self
2156    }
2157
2158    /// Sets the value of [order_by][crate::model::ListRevisionsRequest::order_by].
2159    ///
2160    /// # Example
2161    /// ```ignore,no_run
2162    /// # use google_cloud_config_v1::model::ListRevisionsRequest;
2163    /// let x = ListRevisionsRequest::new().set_order_by("example");
2164    /// ```
2165    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2166        self.order_by = v.into();
2167        self
2168    }
2169}
2170
2171impl wkt::message::Message for ListRevisionsRequest {
2172    fn typename() -> &'static str {
2173        "type.googleapis.com/google.cloud.config.v1.ListRevisionsRequest"
2174    }
2175}
2176
2177/// A response to a 'ListRevisions' call. Contains a list of Revisions.
2178#[derive(Clone, Default, PartialEq)]
2179#[non_exhaustive]
2180pub struct ListRevisionsResponse {
2181    /// List of [Revision][google.cloud.config.v1.Revision]s.
2182    ///
2183    /// [google.cloud.config.v1.Revision]: crate::model::Revision
2184    pub revisions: std::vec::Vec<crate::model::Revision>,
2185
2186    /// A token to request the next page of resources from the 'ListRevisions'
2187    /// method. The value of an empty string means that there are no more resources
2188    /// to return.
2189    pub next_page_token: std::string::String,
2190
2191    /// Locations that could not be reached.
2192    pub unreachable: std::vec::Vec<std::string::String>,
2193
2194    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2195}
2196
2197impl ListRevisionsResponse {
2198    /// Creates a new default instance.
2199    pub fn new() -> Self {
2200        std::default::Default::default()
2201    }
2202
2203    /// Sets the value of [revisions][crate::model::ListRevisionsResponse::revisions].
2204    ///
2205    /// # Example
2206    /// ```ignore,no_run
2207    /// # use google_cloud_config_v1::model::ListRevisionsResponse;
2208    /// use google_cloud_config_v1::model::Revision;
2209    /// let x = ListRevisionsResponse::new()
2210    ///     .set_revisions([
2211    ///         Revision::default()/* use setters */,
2212    ///         Revision::default()/* use (different) setters */,
2213    ///     ]);
2214    /// ```
2215    pub fn set_revisions<T, V>(mut self, v: T) -> Self
2216    where
2217        T: std::iter::IntoIterator<Item = V>,
2218        V: std::convert::Into<crate::model::Revision>,
2219    {
2220        use std::iter::Iterator;
2221        self.revisions = v.into_iter().map(|i| i.into()).collect();
2222        self
2223    }
2224
2225    /// Sets the value of [next_page_token][crate::model::ListRevisionsResponse::next_page_token].
2226    ///
2227    /// # Example
2228    /// ```ignore,no_run
2229    /// # use google_cloud_config_v1::model::ListRevisionsResponse;
2230    /// let x = ListRevisionsResponse::new().set_next_page_token("example");
2231    /// ```
2232    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2233        self.next_page_token = v.into();
2234        self
2235    }
2236
2237    /// Sets the value of [unreachable][crate::model::ListRevisionsResponse::unreachable].
2238    ///
2239    /// # Example
2240    /// ```ignore,no_run
2241    /// # use google_cloud_config_v1::model::ListRevisionsResponse;
2242    /// let x = ListRevisionsResponse::new().set_unreachable(["a", "b", "c"]);
2243    /// ```
2244    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
2245    where
2246        T: std::iter::IntoIterator<Item = V>,
2247        V: std::convert::Into<std::string::String>,
2248    {
2249        use std::iter::Iterator;
2250        self.unreachable = v.into_iter().map(|i| i.into()).collect();
2251        self
2252    }
2253}
2254
2255impl wkt::message::Message for ListRevisionsResponse {
2256    fn typename() -> &'static str {
2257        "type.googleapis.com/google.cloud.config.v1.ListRevisionsResponse"
2258    }
2259}
2260
2261#[doc(hidden)]
2262impl google_cloud_gax::paginator::internal::PageableResponse for ListRevisionsResponse {
2263    type PageItem = crate::model::Revision;
2264
2265    fn items(self) -> std::vec::Vec<Self::PageItem> {
2266        self.revisions
2267    }
2268
2269    fn next_page_token(&self) -> std::string::String {
2270        use std::clone::Clone;
2271        self.next_page_token.clone()
2272    }
2273}
2274
2275/// A request to get a Revision from a 'GetRevision' call.
2276#[derive(Clone, Default, PartialEq)]
2277#[non_exhaustive]
2278pub struct GetRevisionRequest {
2279    /// Required. The name of the Revision in the format:
2280    /// 'projects/{project_id}/locations/{location}/deployments/{deployment}/revisions/{revision}'.
2281    pub name: std::string::String,
2282
2283    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2284}
2285
2286impl GetRevisionRequest {
2287    /// Creates a new default instance.
2288    pub fn new() -> Self {
2289        std::default::Default::default()
2290    }
2291
2292    /// Sets the value of [name][crate::model::GetRevisionRequest::name].
2293    ///
2294    /// # Example
2295    /// ```ignore,no_run
2296    /// # use google_cloud_config_v1::model::GetRevisionRequest;
2297    /// let x = GetRevisionRequest::new().set_name("example");
2298    /// ```
2299    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2300        self.name = v.into();
2301        self
2302    }
2303}
2304
2305impl wkt::message::Message for GetRevisionRequest {
2306    fn typename() -> &'static str {
2307        "type.googleapis.com/google.cloud.config.v1.GetRevisionRequest"
2308    }
2309}
2310
2311#[allow(missing_docs)]
2312#[derive(Clone, Default, PartialEq)]
2313#[non_exhaustive]
2314pub struct CreateDeploymentRequest {
2315    /// Required. The parent in whose context the Deployment is created. The parent
2316    /// value is in the format: 'projects/{project_id}/locations/{location}'.
2317    pub parent: std::string::String,
2318
2319    /// Required. The Deployment ID.
2320    pub deployment_id: std::string::String,
2321
2322    /// Required. [Deployment][google.cloud.config.v1.Deployment] resource to be
2323    /// created.
2324    ///
2325    /// [google.cloud.config.v1.Deployment]: crate::model::Deployment
2326    pub deployment: std::option::Option<crate::model::Deployment>,
2327
2328    /// Optional. An optional request ID to identify requests. Specify a unique
2329    /// request ID so that if you must retry your request, the server will know to
2330    /// ignore the request if it has already been completed. The server will
2331    /// guarantee that for at least 60 minutes since the first request.
2332    ///
2333    /// For example, consider a situation where you make an initial request and the
2334    /// request times out. If you make the request again with the same request ID,
2335    /// the server can check if original operation with the same request ID was
2336    /// received, and if so, will ignore the second request. This prevents clients
2337    /// from accidentally creating duplicate commitments.
2338    ///
2339    /// The request ID must be a valid UUID with the exception that zero UUID is
2340    /// not supported (00000000-0000-0000-0000-000000000000).
2341    pub request_id: std::string::String,
2342
2343    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2344}
2345
2346impl CreateDeploymentRequest {
2347    /// Creates a new default instance.
2348    pub fn new() -> Self {
2349        std::default::Default::default()
2350    }
2351
2352    /// Sets the value of [parent][crate::model::CreateDeploymentRequest::parent].
2353    ///
2354    /// # Example
2355    /// ```ignore,no_run
2356    /// # use google_cloud_config_v1::model::CreateDeploymentRequest;
2357    /// let x = CreateDeploymentRequest::new().set_parent("example");
2358    /// ```
2359    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2360        self.parent = v.into();
2361        self
2362    }
2363
2364    /// Sets the value of [deployment_id][crate::model::CreateDeploymentRequest::deployment_id].
2365    ///
2366    /// # Example
2367    /// ```ignore,no_run
2368    /// # use google_cloud_config_v1::model::CreateDeploymentRequest;
2369    /// let x = CreateDeploymentRequest::new().set_deployment_id("example");
2370    /// ```
2371    pub fn set_deployment_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2372        self.deployment_id = v.into();
2373        self
2374    }
2375
2376    /// Sets the value of [deployment][crate::model::CreateDeploymentRequest::deployment].
2377    ///
2378    /// # Example
2379    /// ```ignore,no_run
2380    /// # use google_cloud_config_v1::model::CreateDeploymentRequest;
2381    /// use google_cloud_config_v1::model::Deployment;
2382    /// let x = CreateDeploymentRequest::new().set_deployment(Deployment::default()/* use setters */);
2383    /// ```
2384    pub fn set_deployment<T>(mut self, v: T) -> Self
2385    where
2386        T: std::convert::Into<crate::model::Deployment>,
2387    {
2388        self.deployment = std::option::Option::Some(v.into());
2389        self
2390    }
2391
2392    /// Sets or clears the value of [deployment][crate::model::CreateDeploymentRequest::deployment].
2393    ///
2394    /// # Example
2395    /// ```ignore,no_run
2396    /// # use google_cloud_config_v1::model::CreateDeploymentRequest;
2397    /// use google_cloud_config_v1::model::Deployment;
2398    /// let x = CreateDeploymentRequest::new().set_or_clear_deployment(Some(Deployment::default()/* use setters */));
2399    /// let x = CreateDeploymentRequest::new().set_or_clear_deployment(None::<Deployment>);
2400    /// ```
2401    pub fn set_or_clear_deployment<T>(mut self, v: std::option::Option<T>) -> Self
2402    where
2403        T: std::convert::Into<crate::model::Deployment>,
2404    {
2405        self.deployment = v.map(|x| x.into());
2406        self
2407    }
2408
2409    /// Sets the value of [request_id][crate::model::CreateDeploymentRequest::request_id].
2410    ///
2411    /// # Example
2412    /// ```ignore,no_run
2413    /// # use google_cloud_config_v1::model::CreateDeploymentRequest;
2414    /// let x = CreateDeploymentRequest::new().set_request_id("example");
2415    /// ```
2416    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2417        self.request_id = v.into();
2418        self
2419    }
2420}
2421
2422impl wkt::message::Message for CreateDeploymentRequest {
2423    fn typename() -> &'static str {
2424        "type.googleapis.com/google.cloud.config.v1.CreateDeploymentRequest"
2425    }
2426}
2427
2428/// A request to create a deployment group
2429#[derive(Clone, Default, PartialEq)]
2430#[non_exhaustive]
2431pub struct CreateDeploymentGroupRequest {
2432    /// Required. The parent in whose context the Deployment Group is created. The
2433    /// parent value is in the format: 'projects/{project_id}/locations/{location}'
2434    pub parent: std::string::String,
2435
2436    /// Required. The deployment group ID.
2437    pub deployment_group_id: std::string::String,
2438
2439    /// Required. [Deployment Group][] resource to create
2440    pub deployment_group: std::option::Option<crate::model::DeploymentGroup>,
2441
2442    /// Optional. An optional request ID to identify requests. Specify a unique
2443    /// request ID so that if you must retry your request, the server will know to
2444    /// ignore the request if it has already been completed. The server will
2445    /// guarantee that for at least 60 minutes since the first request.
2446    ///
2447    /// For example, consider a situation where you make an initial request and the
2448    /// request times out. If you make the request again with the same request ID,
2449    /// the server can check if original operation with the same request ID was
2450    /// received, and if so, will ignore the second request. This prevents clients
2451    /// from accidentally creating duplicate commitments.
2452    ///
2453    /// The request ID must be a valid UUID with the exception that zero UUID is
2454    /// not supported (00000000-0000-0000-0000-000000000000).
2455    pub request_id: std::string::String,
2456
2457    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2458}
2459
2460impl CreateDeploymentGroupRequest {
2461    /// Creates a new default instance.
2462    pub fn new() -> Self {
2463        std::default::Default::default()
2464    }
2465
2466    /// Sets the value of [parent][crate::model::CreateDeploymentGroupRequest::parent].
2467    ///
2468    /// # Example
2469    /// ```ignore,no_run
2470    /// # use google_cloud_config_v1::model::CreateDeploymentGroupRequest;
2471    /// let x = CreateDeploymentGroupRequest::new().set_parent("example");
2472    /// ```
2473    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2474        self.parent = v.into();
2475        self
2476    }
2477
2478    /// Sets the value of [deployment_group_id][crate::model::CreateDeploymentGroupRequest::deployment_group_id].
2479    ///
2480    /// # Example
2481    /// ```ignore,no_run
2482    /// # use google_cloud_config_v1::model::CreateDeploymentGroupRequest;
2483    /// let x = CreateDeploymentGroupRequest::new().set_deployment_group_id("example");
2484    /// ```
2485    pub fn set_deployment_group_id<T: std::convert::Into<std::string::String>>(
2486        mut self,
2487        v: T,
2488    ) -> Self {
2489        self.deployment_group_id = v.into();
2490        self
2491    }
2492
2493    /// Sets the value of [deployment_group][crate::model::CreateDeploymentGroupRequest::deployment_group].
2494    ///
2495    /// # Example
2496    /// ```ignore,no_run
2497    /// # use google_cloud_config_v1::model::CreateDeploymentGroupRequest;
2498    /// use google_cloud_config_v1::model::DeploymentGroup;
2499    /// let x = CreateDeploymentGroupRequest::new().set_deployment_group(DeploymentGroup::default()/* use setters */);
2500    /// ```
2501    pub fn set_deployment_group<T>(mut self, v: T) -> Self
2502    where
2503        T: std::convert::Into<crate::model::DeploymentGroup>,
2504    {
2505        self.deployment_group = std::option::Option::Some(v.into());
2506        self
2507    }
2508
2509    /// Sets or clears the value of [deployment_group][crate::model::CreateDeploymentGroupRequest::deployment_group].
2510    ///
2511    /// # Example
2512    /// ```ignore,no_run
2513    /// # use google_cloud_config_v1::model::CreateDeploymentGroupRequest;
2514    /// use google_cloud_config_v1::model::DeploymentGroup;
2515    /// let x = CreateDeploymentGroupRequest::new().set_or_clear_deployment_group(Some(DeploymentGroup::default()/* use setters */));
2516    /// let x = CreateDeploymentGroupRequest::new().set_or_clear_deployment_group(None::<DeploymentGroup>);
2517    /// ```
2518    pub fn set_or_clear_deployment_group<T>(mut self, v: std::option::Option<T>) -> Self
2519    where
2520        T: std::convert::Into<crate::model::DeploymentGroup>,
2521    {
2522        self.deployment_group = v.map(|x| x.into());
2523        self
2524    }
2525
2526    /// Sets the value of [request_id][crate::model::CreateDeploymentGroupRequest::request_id].
2527    ///
2528    /// # Example
2529    /// ```ignore,no_run
2530    /// # use google_cloud_config_v1::model::CreateDeploymentGroupRequest;
2531    /// let x = CreateDeploymentGroupRequest::new().set_request_id("example");
2532    /// ```
2533    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2534        self.request_id = v.into();
2535        self
2536    }
2537}
2538
2539impl wkt::message::Message for CreateDeploymentGroupRequest {
2540    fn typename() -> &'static str {
2541        "type.googleapis.com/google.cloud.config.v1.CreateDeploymentGroupRequest"
2542    }
2543}
2544
2545/// A request message for updating a deployment group
2546#[derive(Clone, Default, PartialEq)]
2547#[non_exhaustive]
2548pub struct UpdateDeploymentGroupRequest {
2549    /// Optional. Field mask used to specify the fields to be overwritten in the
2550    /// Deployment Group resource by the update.
2551    ///
2552    /// The fields specified in the update_mask are relative to the resource, not
2553    /// the full request. A field will be overwritten if it is in the mask. If the
2554    /// user does not provide a mask then all fields will be overwritten.
2555    pub update_mask: std::option::Option<wkt::FieldMask>,
2556
2557    /// Required. [DeploymentGroup][google.cloud.config.v1.DeploymentGroup] to
2558    /// update.
2559    ///
2560    /// The deployment group's `name` field is used to identify the resource to be
2561    /// updated. Format:
2562    /// `projects/{project}/locations/{location}/deploymentGroups/{deployment_group_id}`
2563    ///
2564    /// [google.cloud.config.v1.DeploymentGroup]: crate::model::DeploymentGroup
2565    pub deployment_group: std::option::Option<crate::model::DeploymentGroup>,
2566
2567    /// Optional. An optional request ID to identify requests. Specify a unique
2568    /// request ID so that if you must retry your request, the server will know to
2569    /// ignore the request if it has already been completed. The server will
2570    /// guarantee that for at least 60 minutes since the first request.
2571    ///
2572    /// For example, consider a situation where you make an initial request and the
2573    /// request times out. If you make the request again with the same request ID,
2574    /// the server can check if original operation with the same request ID was
2575    /// received, and if so, will ignore the second request. This prevents clients
2576    /// from accidentally creating duplicate commitments.
2577    ///
2578    /// The request ID must be a valid UUID with the exception that zero UUID is
2579    /// not supported (00000000-0000-0000-0000-000000000000).
2580    pub request_id: std::string::String,
2581
2582    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2583}
2584
2585impl UpdateDeploymentGroupRequest {
2586    /// Creates a new default instance.
2587    pub fn new() -> Self {
2588        std::default::Default::default()
2589    }
2590
2591    /// Sets the value of [update_mask][crate::model::UpdateDeploymentGroupRequest::update_mask].
2592    ///
2593    /// # Example
2594    /// ```ignore,no_run
2595    /// # use google_cloud_config_v1::model::UpdateDeploymentGroupRequest;
2596    /// use wkt::FieldMask;
2597    /// let x = UpdateDeploymentGroupRequest::new().set_update_mask(FieldMask::default()/* use setters */);
2598    /// ```
2599    pub fn set_update_mask<T>(mut self, v: T) -> Self
2600    where
2601        T: std::convert::Into<wkt::FieldMask>,
2602    {
2603        self.update_mask = std::option::Option::Some(v.into());
2604        self
2605    }
2606
2607    /// Sets or clears the value of [update_mask][crate::model::UpdateDeploymentGroupRequest::update_mask].
2608    ///
2609    /// # Example
2610    /// ```ignore,no_run
2611    /// # use google_cloud_config_v1::model::UpdateDeploymentGroupRequest;
2612    /// use wkt::FieldMask;
2613    /// let x = UpdateDeploymentGroupRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
2614    /// let x = UpdateDeploymentGroupRequest::new().set_or_clear_update_mask(None::<FieldMask>);
2615    /// ```
2616    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2617    where
2618        T: std::convert::Into<wkt::FieldMask>,
2619    {
2620        self.update_mask = v.map(|x| x.into());
2621        self
2622    }
2623
2624    /// Sets the value of [deployment_group][crate::model::UpdateDeploymentGroupRequest::deployment_group].
2625    ///
2626    /// # Example
2627    /// ```ignore,no_run
2628    /// # use google_cloud_config_v1::model::UpdateDeploymentGroupRequest;
2629    /// use google_cloud_config_v1::model::DeploymentGroup;
2630    /// let x = UpdateDeploymentGroupRequest::new().set_deployment_group(DeploymentGroup::default()/* use setters */);
2631    /// ```
2632    pub fn set_deployment_group<T>(mut self, v: T) -> Self
2633    where
2634        T: std::convert::Into<crate::model::DeploymentGroup>,
2635    {
2636        self.deployment_group = std::option::Option::Some(v.into());
2637        self
2638    }
2639
2640    /// Sets or clears the value of [deployment_group][crate::model::UpdateDeploymentGroupRequest::deployment_group].
2641    ///
2642    /// # Example
2643    /// ```ignore,no_run
2644    /// # use google_cloud_config_v1::model::UpdateDeploymentGroupRequest;
2645    /// use google_cloud_config_v1::model::DeploymentGroup;
2646    /// let x = UpdateDeploymentGroupRequest::new().set_or_clear_deployment_group(Some(DeploymentGroup::default()/* use setters */));
2647    /// let x = UpdateDeploymentGroupRequest::new().set_or_clear_deployment_group(None::<DeploymentGroup>);
2648    /// ```
2649    pub fn set_or_clear_deployment_group<T>(mut self, v: std::option::Option<T>) -> Self
2650    where
2651        T: std::convert::Into<crate::model::DeploymentGroup>,
2652    {
2653        self.deployment_group = v.map(|x| x.into());
2654        self
2655    }
2656
2657    /// Sets the value of [request_id][crate::model::UpdateDeploymentGroupRequest::request_id].
2658    ///
2659    /// # Example
2660    /// ```ignore,no_run
2661    /// # use google_cloud_config_v1::model::UpdateDeploymentGroupRequest;
2662    /// let x = UpdateDeploymentGroupRequest::new().set_request_id("example");
2663    /// ```
2664    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2665        self.request_id = v.into();
2666        self
2667    }
2668}
2669
2670impl wkt::message::Message for UpdateDeploymentGroupRequest {
2671    fn typename() -> &'static str {
2672        "type.googleapis.com/google.cloud.config.v1.UpdateDeploymentGroupRequest"
2673    }
2674}
2675
2676/// Request message for Delete DeploymentGroup
2677#[derive(Clone, Default, PartialEq)]
2678#[non_exhaustive]
2679pub struct DeleteDeploymentGroupRequest {
2680    /// Required. The name of DeploymentGroup in the format
2681    /// projects/{project_id}/locations/{location_id}/deploymentGroups/{deploymentGroup}
2682    pub name: std::string::String,
2683
2684    /// Optional. An optional request ID to identify requests. Specify a unique
2685    /// request ID so that if you must retry your request, the server will know to
2686    /// ignore the request if it has already been completed. The server will
2687    /// guarantee that for at least 60 minutes after the first request.
2688    ///
2689    /// For example, consider a situation where you make an initial request and the
2690    /// request times out. If you make the request again with the same request ID,
2691    /// the server can check if original operation with the same request ID was
2692    /// received, and if so, will ignore the second request. This prevents clients
2693    /// from accidentally creating duplicate commitments.
2694    ///
2695    /// The request ID must be a valid UUID with the exception that zero UUID is
2696    /// not supported (00000000-0000-0000-0000-000000000000).
2697    pub request_id: std::string::String,
2698
2699    /// Optional. If set to true, any revisions for this deployment group will also
2700    /// be deleted. (Otherwise, the request will only work if the deployment group
2701    /// has no revisions.)
2702    pub force: bool,
2703
2704    /// Optional. Policy on how to handle referenced deployments when deleting the
2705    /// DeploymentGroup.
2706    /// If unspecified, the default behavior is to fail the deletion if any
2707    /// deployments currently referenced in the `deployment_units` of the
2708    /// DeploymentGroup or in the latest revision are not deleted.
2709    pub deployment_reference_policy:
2710        crate::model::delete_deployment_group_request::DeploymentReferencePolicy,
2711
2712    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2713}
2714
2715impl DeleteDeploymentGroupRequest {
2716    /// Creates a new default instance.
2717    pub fn new() -> Self {
2718        std::default::Default::default()
2719    }
2720
2721    /// Sets the value of [name][crate::model::DeleteDeploymentGroupRequest::name].
2722    ///
2723    /// # Example
2724    /// ```ignore,no_run
2725    /// # use google_cloud_config_v1::model::DeleteDeploymentGroupRequest;
2726    /// let x = DeleteDeploymentGroupRequest::new().set_name("example");
2727    /// ```
2728    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2729        self.name = v.into();
2730        self
2731    }
2732
2733    /// Sets the value of [request_id][crate::model::DeleteDeploymentGroupRequest::request_id].
2734    ///
2735    /// # Example
2736    /// ```ignore,no_run
2737    /// # use google_cloud_config_v1::model::DeleteDeploymentGroupRequest;
2738    /// let x = DeleteDeploymentGroupRequest::new().set_request_id("example");
2739    /// ```
2740    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2741        self.request_id = v.into();
2742        self
2743    }
2744
2745    /// Sets the value of [force][crate::model::DeleteDeploymentGroupRequest::force].
2746    ///
2747    /// # Example
2748    /// ```ignore,no_run
2749    /// # use google_cloud_config_v1::model::DeleteDeploymentGroupRequest;
2750    /// let x = DeleteDeploymentGroupRequest::new().set_force(true);
2751    /// ```
2752    pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2753        self.force = v.into();
2754        self
2755    }
2756
2757    /// Sets the value of [deployment_reference_policy][crate::model::DeleteDeploymentGroupRequest::deployment_reference_policy].
2758    ///
2759    /// # Example
2760    /// ```ignore,no_run
2761    /// # use google_cloud_config_v1::model::DeleteDeploymentGroupRequest;
2762    /// use google_cloud_config_v1::model::delete_deployment_group_request::DeploymentReferencePolicy;
2763    /// let x0 = DeleteDeploymentGroupRequest::new().set_deployment_reference_policy(DeploymentReferencePolicy::FailIfAnyReferencesExist);
2764    /// let x1 = DeleteDeploymentGroupRequest::new().set_deployment_reference_policy(DeploymentReferencePolicy::FailIfMetadataReferencesExist);
2765    /// let x2 = DeleteDeploymentGroupRequest::new().set_deployment_reference_policy(DeploymentReferencePolicy::IgnoreDeploymentReferences);
2766    /// ```
2767    pub fn set_deployment_reference_policy<
2768        T: std::convert::Into<
2769                crate::model::delete_deployment_group_request::DeploymentReferencePolicy,
2770            >,
2771    >(
2772        mut self,
2773        v: T,
2774    ) -> Self {
2775        self.deployment_reference_policy = v.into();
2776        self
2777    }
2778}
2779
2780impl wkt::message::Message for DeleteDeploymentGroupRequest {
2781    fn typename() -> &'static str {
2782        "type.googleapis.com/google.cloud.config.v1.DeleteDeploymentGroupRequest"
2783    }
2784}
2785
2786/// Defines additional types related to [DeleteDeploymentGroupRequest].
2787pub mod delete_deployment_group_request {
2788    #[allow(unused_imports)]
2789    use super::*;
2790
2791    /// Policy on how to handle referenced deployments when deleting the
2792    /// DeploymentGroup.
2793    ///
2794    /// # Working with unknown values
2795    ///
2796    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2797    /// additional enum variants at any time. Adding new variants is not considered
2798    /// a breaking change. Applications should write their code in anticipation of:
2799    ///
2800    /// - New values appearing in future releases of the client library, **and**
2801    /// - New values received dynamically, without application changes.
2802    ///
2803    /// Please consult the [Working with enums] section in the user guide for some
2804    /// guidelines.
2805    ///
2806    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
2807    #[derive(Clone, Debug, PartialEq)]
2808    #[non_exhaustive]
2809    pub enum DeploymentReferencePolicy {
2810        /// The default behavior. If unspecified, the system will act as if
2811        /// `FAIL_IF_ANY_REFERENCES_EXIST` is specified.
2812        Unspecified,
2813        /// Fail the deletion if any deployments currently referenced in the
2814        /// `deployment_units` of the DeploymentGroup or in the latest revision
2815        /// are not deleted.
2816        FailIfAnyReferencesExist,
2817        /// Fail the deletion only if any deployments currently referenced in the
2818        /// `deployment_units` of the DeploymentGroup are not deleted.
2819        /// The deletion will proceed even if the deployments in the latest revision
2820        /// of the DeploymentGroup are not deleted.
2821        FailIfMetadataReferencesExist,
2822        /// Ignore any deployments currently referenced in the
2823        /// `deployment_units` of the DeploymentGroup or in the latest revision.
2824        IgnoreDeploymentReferences,
2825        /// If set, the enum was initialized with an unknown value.
2826        ///
2827        /// Applications can examine the value using [DeploymentReferencePolicy::value] or
2828        /// [DeploymentReferencePolicy::name].
2829        UnknownValue(deployment_reference_policy::UnknownValue),
2830    }
2831
2832    #[doc(hidden)]
2833    pub mod deployment_reference_policy {
2834        #[allow(unused_imports)]
2835        use super::*;
2836        #[derive(Clone, Debug, PartialEq)]
2837        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2838    }
2839
2840    impl DeploymentReferencePolicy {
2841        /// Gets the enum value.
2842        ///
2843        /// Returns `None` if the enum contains an unknown value deserialized from
2844        /// the string representation of enums.
2845        pub fn value(&self) -> std::option::Option<i32> {
2846            match self {
2847                Self::Unspecified => std::option::Option::Some(0),
2848                Self::FailIfAnyReferencesExist => std::option::Option::Some(1),
2849                Self::FailIfMetadataReferencesExist => std::option::Option::Some(2),
2850                Self::IgnoreDeploymentReferences => std::option::Option::Some(3),
2851                Self::UnknownValue(u) => u.0.value(),
2852            }
2853        }
2854
2855        /// Gets the enum value as a string.
2856        ///
2857        /// Returns `None` if the enum contains an unknown value deserialized from
2858        /// the integer representation of enums.
2859        pub fn name(&self) -> std::option::Option<&str> {
2860            match self {
2861                Self::Unspecified => {
2862                    std::option::Option::Some("DEPLOYMENT_REFERENCE_POLICY_UNSPECIFIED")
2863                }
2864                Self::FailIfAnyReferencesExist => {
2865                    std::option::Option::Some("FAIL_IF_ANY_REFERENCES_EXIST")
2866                }
2867                Self::FailIfMetadataReferencesExist => {
2868                    std::option::Option::Some("FAIL_IF_METADATA_REFERENCES_EXIST")
2869                }
2870                Self::IgnoreDeploymentReferences => {
2871                    std::option::Option::Some("IGNORE_DEPLOYMENT_REFERENCES")
2872                }
2873                Self::UnknownValue(u) => u.0.name(),
2874            }
2875        }
2876    }
2877
2878    impl std::default::Default for DeploymentReferencePolicy {
2879        fn default() -> Self {
2880            use std::convert::From;
2881            Self::from(0)
2882        }
2883    }
2884
2885    impl std::fmt::Display for DeploymentReferencePolicy {
2886        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2887            wkt::internal::display_enum(f, self.name(), self.value())
2888        }
2889    }
2890
2891    impl std::convert::From<i32> for DeploymentReferencePolicy {
2892        fn from(value: i32) -> Self {
2893            match value {
2894                0 => Self::Unspecified,
2895                1 => Self::FailIfAnyReferencesExist,
2896                2 => Self::FailIfMetadataReferencesExist,
2897                3 => Self::IgnoreDeploymentReferences,
2898                _ => Self::UnknownValue(deployment_reference_policy::UnknownValue(
2899                    wkt::internal::UnknownEnumValue::Integer(value),
2900                )),
2901            }
2902        }
2903    }
2904
2905    impl std::convert::From<&str> for DeploymentReferencePolicy {
2906        fn from(value: &str) -> Self {
2907            use std::string::ToString;
2908            match value {
2909                "DEPLOYMENT_REFERENCE_POLICY_UNSPECIFIED" => Self::Unspecified,
2910                "FAIL_IF_ANY_REFERENCES_EXIST" => Self::FailIfAnyReferencesExist,
2911                "FAIL_IF_METADATA_REFERENCES_EXIST" => Self::FailIfMetadataReferencesExist,
2912                "IGNORE_DEPLOYMENT_REFERENCES" => Self::IgnoreDeploymentReferences,
2913                _ => Self::UnknownValue(deployment_reference_policy::UnknownValue(
2914                    wkt::internal::UnknownEnumValue::String(value.to_string()),
2915                )),
2916            }
2917        }
2918    }
2919
2920    impl serde::ser::Serialize for DeploymentReferencePolicy {
2921        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2922        where
2923            S: serde::Serializer,
2924        {
2925            match self {
2926                Self::Unspecified => serializer.serialize_i32(0),
2927                Self::FailIfAnyReferencesExist => serializer.serialize_i32(1),
2928                Self::FailIfMetadataReferencesExist => serializer.serialize_i32(2),
2929                Self::IgnoreDeploymentReferences => serializer.serialize_i32(3),
2930                Self::UnknownValue(u) => u.0.serialize(serializer),
2931            }
2932        }
2933    }
2934
2935    impl<'de> serde::de::Deserialize<'de> for DeploymentReferencePolicy {
2936        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2937        where
2938            D: serde::Deserializer<'de>,
2939        {
2940            deserializer.deserialize_any(wkt::internal::EnumVisitor::<DeploymentReferencePolicy>::new(
2941                ".google.cloud.config.v1.DeleteDeploymentGroupRequest.DeploymentReferencePolicy"))
2942        }
2943    }
2944}
2945
2946#[allow(missing_docs)]
2947#[derive(Clone, Default, PartialEq)]
2948#[non_exhaustive]
2949pub struct UpdateDeploymentRequest {
2950    /// Optional. Field mask used to specify the fields to be overwritten in the
2951    /// Deployment resource by the update.
2952    ///
2953    /// The fields specified in the update_mask are relative to the resource, not
2954    /// the full request. A field will be overwritten if it is in the mask. If the
2955    /// user does not provide a mask then all fields will be overwritten.
2956    pub update_mask: std::option::Option<wkt::FieldMask>,
2957
2958    /// Required. [Deployment][google.cloud.config.v1.Deployment] to update.
2959    ///
2960    /// The deployment's `name` field is used to identify the resource to be
2961    /// updated. Format:
2962    /// `projects/{project}/locations/{location}/deployments/{deployment}`
2963    ///
2964    /// [google.cloud.config.v1.Deployment]: crate::model::Deployment
2965    pub deployment: std::option::Option<crate::model::Deployment>,
2966
2967    /// Optional. An optional request ID to identify requests. Specify a unique
2968    /// request ID so that if you must retry your request, the server will know to
2969    /// ignore the request if it has already been completed. The server will
2970    /// guarantee that for at least 60 minutes since the first request.
2971    ///
2972    /// For example, consider a situation where you make an initial request and the
2973    /// request times out. If you make the request again with the same request ID,
2974    /// the server can check if original operation with the same request ID was
2975    /// received, and if so, will ignore the second request. This prevents clients
2976    /// from accidentally creating duplicate commitments.
2977    ///
2978    /// The request ID must be a valid UUID with the exception that zero UUID is
2979    /// not supported (00000000-0000-0000-0000-000000000000).
2980    pub request_id: std::string::String,
2981
2982    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2983}
2984
2985impl UpdateDeploymentRequest {
2986    /// Creates a new default instance.
2987    pub fn new() -> Self {
2988        std::default::Default::default()
2989    }
2990
2991    /// Sets the value of [update_mask][crate::model::UpdateDeploymentRequest::update_mask].
2992    ///
2993    /// # Example
2994    /// ```ignore,no_run
2995    /// # use google_cloud_config_v1::model::UpdateDeploymentRequest;
2996    /// use wkt::FieldMask;
2997    /// let x = UpdateDeploymentRequest::new().set_update_mask(FieldMask::default()/* use setters */);
2998    /// ```
2999    pub fn set_update_mask<T>(mut self, v: T) -> Self
3000    where
3001        T: std::convert::Into<wkt::FieldMask>,
3002    {
3003        self.update_mask = std::option::Option::Some(v.into());
3004        self
3005    }
3006
3007    /// Sets or clears the value of [update_mask][crate::model::UpdateDeploymentRequest::update_mask].
3008    ///
3009    /// # Example
3010    /// ```ignore,no_run
3011    /// # use google_cloud_config_v1::model::UpdateDeploymentRequest;
3012    /// use wkt::FieldMask;
3013    /// let x = UpdateDeploymentRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
3014    /// let x = UpdateDeploymentRequest::new().set_or_clear_update_mask(None::<FieldMask>);
3015    /// ```
3016    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3017    where
3018        T: std::convert::Into<wkt::FieldMask>,
3019    {
3020        self.update_mask = v.map(|x| x.into());
3021        self
3022    }
3023
3024    /// Sets the value of [deployment][crate::model::UpdateDeploymentRequest::deployment].
3025    ///
3026    /// # Example
3027    /// ```ignore,no_run
3028    /// # use google_cloud_config_v1::model::UpdateDeploymentRequest;
3029    /// use google_cloud_config_v1::model::Deployment;
3030    /// let x = UpdateDeploymentRequest::new().set_deployment(Deployment::default()/* use setters */);
3031    /// ```
3032    pub fn set_deployment<T>(mut self, v: T) -> Self
3033    where
3034        T: std::convert::Into<crate::model::Deployment>,
3035    {
3036        self.deployment = std::option::Option::Some(v.into());
3037        self
3038    }
3039
3040    /// Sets or clears the value of [deployment][crate::model::UpdateDeploymentRequest::deployment].
3041    ///
3042    /// # Example
3043    /// ```ignore,no_run
3044    /// # use google_cloud_config_v1::model::UpdateDeploymentRequest;
3045    /// use google_cloud_config_v1::model::Deployment;
3046    /// let x = UpdateDeploymentRequest::new().set_or_clear_deployment(Some(Deployment::default()/* use setters */));
3047    /// let x = UpdateDeploymentRequest::new().set_or_clear_deployment(None::<Deployment>);
3048    /// ```
3049    pub fn set_or_clear_deployment<T>(mut self, v: std::option::Option<T>) -> Self
3050    where
3051        T: std::convert::Into<crate::model::Deployment>,
3052    {
3053        self.deployment = v.map(|x| x.into());
3054        self
3055    }
3056
3057    /// Sets the value of [request_id][crate::model::UpdateDeploymentRequest::request_id].
3058    ///
3059    /// # Example
3060    /// ```ignore,no_run
3061    /// # use google_cloud_config_v1::model::UpdateDeploymentRequest;
3062    /// let x = UpdateDeploymentRequest::new().set_request_id("example");
3063    /// ```
3064    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3065        self.request_id = v.into();
3066        self
3067    }
3068}
3069
3070impl wkt::message::Message for UpdateDeploymentRequest {
3071    fn typename() -> &'static str {
3072        "type.googleapis.com/google.cloud.config.v1.UpdateDeploymentRequest"
3073    }
3074}
3075
3076#[allow(missing_docs)]
3077#[derive(Clone, Default, PartialEq)]
3078#[non_exhaustive]
3079pub struct DeleteDeploymentRequest {
3080    /// Required. The name of the Deployment in the format:
3081    /// 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
3082    pub name: std::string::String,
3083
3084    /// Optional. An optional request ID to identify requests. Specify a unique
3085    /// request ID so that if you must retry your request, the server will know to
3086    /// ignore the request if it has already been completed. The server will
3087    /// guarantee that for at least 60 minutes after the first request.
3088    ///
3089    /// For example, consider a situation where you make an initial request and the
3090    /// request times out. If you make the request again with the same request ID,
3091    /// the server can check if original operation with the same request ID was
3092    /// received, and if so, will ignore the second request. This prevents clients
3093    /// from accidentally creating duplicate commitments.
3094    ///
3095    /// The request ID must be a valid UUID with the exception that zero UUID is
3096    /// not supported (00000000-0000-0000-0000-000000000000).
3097    pub request_id: std::string::String,
3098
3099    /// Optional. If set to true, any revisions for this deployment will also be
3100    /// deleted. (Otherwise, the request will only work if the deployment has no
3101    /// revisions.)
3102    pub force: bool,
3103
3104    /// Optional. Policy on how resources actuated by the deployment should be
3105    /// deleted. If unspecified, the default behavior is to delete the underlying
3106    /// resources.
3107    pub delete_policy: crate::model::delete_deployment_request::DeletePolicy,
3108
3109    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3110}
3111
3112impl DeleteDeploymentRequest {
3113    /// Creates a new default instance.
3114    pub fn new() -> Self {
3115        std::default::Default::default()
3116    }
3117
3118    /// Sets the value of [name][crate::model::DeleteDeploymentRequest::name].
3119    ///
3120    /// # Example
3121    /// ```ignore,no_run
3122    /// # use google_cloud_config_v1::model::DeleteDeploymentRequest;
3123    /// let x = DeleteDeploymentRequest::new().set_name("example");
3124    /// ```
3125    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3126        self.name = v.into();
3127        self
3128    }
3129
3130    /// Sets the value of [request_id][crate::model::DeleteDeploymentRequest::request_id].
3131    ///
3132    /// # Example
3133    /// ```ignore,no_run
3134    /// # use google_cloud_config_v1::model::DeleteDeploymentRequest;
3135    /// let x = DeleteDeploymentRequest::new().set_request_id("example");
3136    /// ```
3137    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3138        self.request_id = v.into();
3139        self
3140    }
3141
3142    /// Sets the value of [force][crate::model::DeleteDeploymentRequest::force].
3143    ///
3144    /// # Example
3145    /// ```ignore,no_run
3146    /// # use google_cloud_config_v1::model::DeleteDeploymentRequest;
3147    /// let x = DeleteDeploymentRequest::new().set_force(true);
3148    /// ```
3149    pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3150        self.force = v.into();
3151        self
3152    }
3153
3154    /// Sets the value of [delete_policy][crate::model::DeleteDeploymentRequest::delete_policy].
3155    ///
3156    /// # Example
3157    /// ```ignore,no_run
3158    /// # use google_cloud_config_v1::model::DeleteDeploymentRequest;
3159    /// use google_cloud_config_v1::model::delete_deployment_request::DeletePolicy;
3160    /// let x0 = DeleteDeploymentRequest::new().set_delete_policy(DeletePolicy::Delete);
3161    /// let x1 = DeleteDeploymentRequest::new().set_delete_policy(DeletePolicy::Abandon);
3162    /// ```
3163    pub fn set_delete_policy<
3164        T: std::convert::Into<crate::model::delete_deployment_request::DeletePolicy>,
3165    >(
3166        mut self,
3167        v: T,
3168    ) -> Self {
3169        self.delete_policy = v.into();
3170        self
3171    }
3172}
3173
3174impl wkt::message::Message for DeleteDeploymentRequest {
3175    fn typename() -> &'static str {
3176        "type.googleapis.com/google.cloud.config.v1.DeleteDeploymentRequest"
3177    }
3178}
3179
3180/// Defines additional types related to [DeleteDeploymentRequest].
3181pub mod delete_deployment_request {
3182    #[allow(unused_imports)]
3183    use super::*;
3184
3185    /// Policy on how resources actuated by the deployment should be deleted.
3186    ///
3187    /// # Working with unknown values
3188    ///
3189    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3190    /// additional enum variants at any time. Adding new variants is not considered
3191    /// a breaking change. Applications should write their code in anticipation of:
3192    ///
3193    /// - New values appearing in future releases of the client library, **and**
3194    /// - New values received dynamically, without application changes.
3195    ///
3196    /// Please consult the [Working with enums] section in the user guide for some
3197    /// guidelines.
3198    ///
3199    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
3200    #[derive(Clone, Debug, PartialEq)]
3201    #[non_exhaustive]
3202    pub enum DeletePolicy {
3203        /// Unspecified policy, resources will be deleted.
3204        Unspecified,
3205        /// Deletes resources actuated by the deployment.
3206        Delete,
3207        /// Abandons resources and only deletes the deployment and its metadata.
3208        Abandon,
3209        /// If set, the enum was initialized with an unknown value.
3210        ///
3211        /// Applications can examine the value using [DeletePolicy::value] or
3212        /// [DeletePolicy::name].
3213        UnknownValue(delete_policy::UnknownValue),
3214    }
3215
3216    #[doc(hidden)]
3217    pub mod delete_policy {
3218        #[allow(unused_imports)]
3219        use super::*;
3220        #[derive(Clone, Debug, PartialEq)]
3221        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3222    }
3223
3224    impl DeletePolicy {
3225        /// Gets the enum value.
3226        ///
3227        /// Returns `None` if the enum contains an unknown value deserialized from
3228        /// the string representation of enums.
3229        pub fn value(&self) -> std::option::Option<i32> {
3230            match self {
3231                Self::Unspecified => std::option::Option::Some(0),
3232                Self::Delete => std::option::Option::Some(1),
3233                Self::Abandon => std::option::Option::Some(2),
3234                Self::UnknownValue(u) => u.0.value(),
3235            }
3236        }
3237
3238        /// Gets the enum value as a string.
3239        ///
3240        /// Returns `None` if the enum contains an unknown value deserialized from
3241        /// the integer representation of enums.
3242        pub fn name(&self) -> std::option::Option<&str> {
3243            match self {
3244                Self::Unspecified => std::option::Option::Some("DELETE_POLICY_UNSPECIFIED"),
3245                Self::Delete => std::option::Option::Some("DELETE"),
3246                Self::Abandon => std::option::Option::Some("ABANDON"),
3247                Self::UnknownValue(u) => u.0.name(),
3248            }
3249        }
3250    }
3251
3252    impl std::default::Default for DeletePolicy {
3253        fn default() -> Self {
3254            use std::convert::From;
3255            Self::from(0)
3256        }
3257    }
3258
3259    impl std::fmt::Display for DeletePolicy {
3260        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3261            wkt::internal::display_enum(f, self.name(), self.value())
3262        }
3263    }
3264
3265    impl std::convert::From<i32> for DeletePolicy {
3266        fn from(value: i32) -> Self {
3267            match value {
3268                0 => Self::Unspecified,
3269                1 => Self::Delete,
3270                2 => Self::Abandon,
3271                _ => Self::UnknownValue(delete_policy::UnknownValue(
3272                    wkt::internal::UnknownEnumValue::Integer(value),
3273                )),
3274            }
3275        }
3276    }
3277
3278    impl std::convert::From<&str> for DeletePolicy {
3279        fn from(value: &str) -> Self {
3280            use std::string::ToString;
3281            match value {
3282                "DELETE_POLICY_UNSPECIFIED" => Self::Unspecified,
3283                "DELETE" => Self::Delete,
3284                "ABANDON" => Self::Abandon,
3285                _ => Self::UnknownValue(delete_policy::UnknownValue(
3286                    wkt::internal::UnknownEnumValue::String(value.to_string()),
3287                )),
3288            }
3289        }
3290    }
3291
3292    impl serde::ser::Serialize for DeletePolicy {
3293        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3294        where
3295            S: serde::Serializer,
3296        {
3297            match self {
3298                Self::Unspecified => serializer.serialize_i32(0),
3299                Self::Delete => serializer.serialize_i32(1),
3300                Self::Abandon => serializer.serialize_i32(2),
3301                Self::UnknownValue(u) => u.0.serialize(serializer),
3302            }
3303        }
3304    }
3305
3306    impl<'de> serde::de::Deserialize<'de> for DeletePolicy {
3307        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3308        where
3309            D: serde::Deserializer<'de>,
3310        {
3311            deserializer.deserialize_any(wkt::internal::EnumVisitor::<DeletePolicy>::new(
3312                ".google.cloud.config.v1.DeleteDeploymentRequest.DeletePolicy",
3313            ))
3314        }
3315    }
3316}
3317
3318/// Represents the metadata of the long-running operation.
3319#[derive(Clone, Default, PartialEq)]
3320#[non_exhaustive]
3321pub struct OperationMetadata {
3322    /// Output only. Time when the operation was created.
3323    pub create_time: std::option::Option<wkt::Timestamp>,
3324
3325    /// Output only. Time when the operation finished running.
3326    pub end_time: std::option::Option<wkt::Timestamp>,
3327
3328    /// Output only. Server-defined resource path for the target of the operation.
3329    pub target: std::string::String,
3330
3331    /// Output only. Name of the verb executed by the operation.
3332    pub verb: std::string::String,
3333
3334    /// Output only. Human-readable status of the operation, if any.
3335    pub status_message: std::string::String,
3336
3337    /// Output only. Identifies whether the user has requested cancellation of the
3338    /// operation. Operations that have successfully been cancelled have
3339    /// [google.longrunning.Operation.error][google.longrunning.Operation.error]
3340    /// value with a [google.rpc.Status.code][google.rpc.Status.code] of `1`,
3341    /// corresponding to `Code.CANCELLED`.
3342    ///
3343    /// [google.longrunning.Operation.error]: google_cloud_longrunning::model::Operation::result
3344    /// [google.rpc.Status.code]: google_cloud_rpc::model::Status::code
3345    pub requested_cancellation: bool,
3346
3347    /// Output only. API version used to start the operation.
3348    pub api_version: std::string::String,
3349
3350    /// Ephemeral metadata about the state of an operation for a particular
3351    /// resource.
3352    pub resource_metadata: std::option::Option<crate::model::operation_metadata::ResourceMetadata>,
3353
3354    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3355}
3356
3357impl OperationMetadata {
3358    /// Creates a new default instance.
3359    pub fn new() -> Self {
3360        std::default::Default::default()
3361    }
3362
3363    /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
3364    ///
3365    /// # Example
3366    /// ```ignore,no_run
3367    /// # use google_cloud_config_v1::model::OperationMetadata;
3368    /// use wkt::Timestamp;
3369    /// let x = OperationMetadata::new().set_create_time(Timestamp::default()/* use setters */);
3370    /// ```
3371    pub fn set_create_time<T>(mut self, v: T) -> Self
3372    where
3373        T: std::convert::Into<wkt::Timestamp>,
3374    {
3375        self.create_time = std::option::Option::Some(v.into());
3376        self
3377    }
3378
3379    /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
3380    ///
3381    /// # Example
3382    /// ```ignore,no_run
3383    /// # use google_cloud_config_v1::model::OperationMetadata;
3384    /// use wkt::Timestamp;
3385    /// let x = OperationMetadata::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
3386    /// let x = OperationMetadata::new().set_or_clear_create_time(None::<Timestamp>);
3387    /// ```
3388    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
3389    where
3390        T: std::convert::Into<wkt::Timestamp>,
3391    {
3392        self.create_time = v.map(|x| x.into());
3393        self
3394    }
3395
3396    /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
3397    ///
3398    /// # Example
3399    /// ```ignore,no_run
3400    /// # use google_cloud_config_v1::model::OperationMetadata;
3401    /// use wkt::Timestamp;
3402    /// let x = OperationMetadata::new().set_end_time(Timestamp::default()/* use setters */);
3403    /// ```
3404    pub fn set_end_time<T>(mut self, v: T) -> Self
3405    where
3406        T: std::convert::Into<wkt::Timestamp>,
3407    {
3408        self.end_time = std::option::Option::Some(v.into());
3409        self
3410    }
3411
3412    /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
3413    ///
3414    /// # Example
3415    /// ```ignore,no_run
3416    /// # use google_cloud_config_v1::model::OperationMetadata;
3417    /// use wkt::Timestamp;
3418    /// let x = OperationMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
3419    /// let x = OperationMetadata::new().set_or_clear_end_time(None::<Timestamp>);
3420    /// ```
3421    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
3422    where
3423        T: std::convert::Into<wkt::Timestamp>,
3424    {
3425        self.end_time = v.map(|x| x.into());
3426        self
3427    }
3428
3429    /// Sets the value of [target][crate::model::OperationMetadata::target].
3430    ///
3431    /// # Example
3432    /// ```ignore,no_run
3433    /// # use google_cloud_config_v1::model::OperationMetadata;
3434    /// let x = OperationMetadata::new().set_target("example");
3435    /// ```
3436    pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3437        self.target = v.into();
3438        self
3439    }
3440
3441    /// Sets the value of [verb][crate::model::OperationMetadata::verb].
3442    ///
3443    /// # Example
3444    /// ```ignore,no_run
3445    /// # use google_cloud_config_v1::model::OperationMetadata;
3446    /// let x = OperationMetadata::new().set_verb("example");
3447    /// ```
3448    pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3449        self.verb = v.into();
3450        self
3451    }
3452
3453    /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
3454    ///
3455    /// # Example
3456    /// ```ignore,no_run
3457    /// # use google_cloud_config_v1::model::OperationMetadata;
3458    /// let x = OperationMetadata::new().set_status_message("example");
3459    /// ```
3460    pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3461        self.status_message = v.into();
3462        self
3463    }
3464
3465    /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
3466    ///
3467    /// # Example
3468    /// ```ignore,no_run
3469    /// # use google_cloud_config_v1::model::OperationMetadata;
3470    /// let x = OperationMetadata::new().set_requested_cancellation(true);
3471    /// ```
3472    pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3473        self.requested_cancellation = v.into();
3474        self
3475    }
3476
3477    /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
3478    ///
3479    /// # Example
3480    /// ```ignore,no_run
3481    /// # use google_cloud_config_v1::model::OperationMetadata;
3482    /// let x = OperationMetadata::new().set_api_version("example");
3483    /// ```
3484    pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3485        self.api_version = v.into();
3486        self
3487    }
3488
3489    /// Sets the value of [resource_metadata][crate::model::OperationMetadata::resource_metadata].
3490    ///
3491    /// Note that all the setters affecting `resource_metadata` are mutually
3492    /// exclusive.
3493    ///
3494    /// # Example
3495    /// ```ignore,no_run
3496    /// # use google_cloud_config_v1::model::OperationMetadata;
3497    /// use google_cloud_config_v1::model::DeploymentOperationMetadata;
3498    /// let x = OperationMetadata::new().set_resource_metadata(Some(
3499    ///     google_cloud_config_v1::model::operation_metadata::ResourceMetadata::DeploymentMetadata(DeploymentOperationMetadata::default().into())));
3500    /// ```
3501    pub fn set_resource_metadata<
3502        T: std::convert::Into<std::option::Option<crate::model::operation_metadata::ResourceMetadata>>,
3503    >(
3504        mut self,
3505        v: T,
3506    ) -> Self {
3507        self.resource_metadata = v.into();
3508        self
3509    }
3510
3511    /// The value of [resource_metadata][crate::model::OperationMetadata::resource_metadata]
3512    /// if it holds a `DeploymentMetadata`, `None` if the field is not set or
3513    /// holds a different branch.
3514    pub fn deployment_metadata(
3515        &self,
3516    ) -> std::option::Option<&std::boxed::Box<crate::model::DeploymentOperationMetadata>> {
3517        #[allow(unreachable_patterns)]
3518        self.resource_metadata.as_ref().and_then(|v| match v {
3519            crate::model::operation_metadata::ResourceMetadata::DeploymentMetadata(v) => {
3520                std::option::Option::Some(v)
3521            }
3522            _ => std::option::Option::None,
3523        })
3524    }
3525
3526    /// Sets the value of [resource_metadata][crate::model::OperationMetadata::resource_metadata]
3527    /// to hold a `DeploymentMetadata`.
3528    ///
3529    /// Note that all the setters affecting `resource_metadata` are
3530    /// mutually exclusive.
3531    ///
3532    /// # Example
3533    /// ```ignore,no_run
3534    /// # use google_cloud_config_v1::model::OperationMetadata;
3535    /// use google_cloud_config_v1::model::DeploymentOperationMetadata;
3536    /// let x = OperationMetadata::new().set_deployment_metadata(DeploymentOperationMetadata::default()/* use setters */);
3537    /// assert!(x.deployment_metadata().is_some());
3538    /// assert!(x.preview_metadata().is_none());
3539    /// assert!(x.provision_deployment_group_metadata().is_none());
3540    /// ```
3541    pub fn set_deployment_metadata<
3542        T: std::convert::Into<std::boxed::Box<crate::model::DeploymentOperationMetadata>>,
3543    >(
3544        mut self,
3545        v: T,
3546    ) -> Self {
3547        self.resource_metadata = std::option::Option::Some(
3548            crate::model::operation_metadata::ResourceMetadata::DeploymentMetadata(v.into()),
3549        );
3550        self
3551    }
3552
3553    /// The value of [resource_metadata][crate::model::OperationMetadata::resource_metadata]
3554    /// if it holds a `PreviewMetadata`, `None` if the field is not set or
3555    /// holds a different branch.
3556    pub fn preview_metadata(
3557        &self,
3558    ) -> std::option::Option<&std::boxed::Box<crate::model::PreviewOperationMetadata>> {
3559        #[allow(unreachable_patterns)]
3560        self.resource_metadata.as_ref().and_then(|v| match v {
3561            crate::model::operation_metadata::ResourceMetadata::PreviewMetadata(v) => {
3562                std::option::Option::Some(v)
3563            }
3564            _ => std::option::Option::None,
3565        })
3566    }
3567
3568    /// Sets the value of [resource_metadata][crate::model::OperationMetadata::resource_metadata]
3569    /// to hold a `PreviewMetadata`.
3570    ///
3571    /// Note that all the setters affecting `resource_metadata` are
3572    /// mutually exclusive.
3573    ///
3574    /// # Example
3575    /// ```ignore,no_run
3576    /// # use google_cloud_config_v1::model::OperationMetadata;
3577    /// use google_cloud_config_v1::model::PreviewOperationMetadata;
3578    /// let x = OperationMetadata::new().set_preview_metadata(PreviewOperationMetadata::default()/* use setters */);
3579    /// assert!(x.preview_metadata().is_some());
3580    /// assert!(x.deployment_metadata().is_none());
3581    /// assert!(x.provision_deployment_group_metadata().is_none());
3582    /// ```
3583    pub fn set_preview_metadata<
3584        T: std::convert::Into<std::boxed::Box<crate::model::PreviewOperationMetadata>>,
3585    >(
3586        mut self,
3587        v: T,
3588    ) -> Self {
3589        self.resource_metadata = std::option::Option::Some(
3590            crate::model::operation_metadata::ResourceMetadata::PreviewMetadata(v.into()),
3591        );
3592        self
3593    }
3594
3595    /// The value of [resource_metadata][crate::model::OperationMetadata::resource_metadata]
3596    /// if it holds a `ProvisionDeploymentGroupMetadata`, `None` if the field is not set or
3597    /// holds a different branch.
3598    pub fn provision_deployment_group_metadata(
3599        &self,
3600    ) -> std::option::Option<
3601        &std::boxed::Box<crate::model::ProvisionDeploymentGroupOperationMetadata>,
3602    > {
3603        #[allow(unreachable_patterns)]
3604        self.resource_metadata.as_ref().and_then(|v| match v {
3605            crate::model::operation_metadata::ResourceMetadata::ProvisionDeploymentGroupMetadata(v) => std::option::Option::Some(v),
3606            _ => std::option::Option::None,
3607        })
3608    }
3609
3610    /// Sets the value of [resource_metadata][crate::model::OperationMetadata::resource_metadata]
3611    /// to hold a `ProvisionDeploymentGroupMetadata`.
3612    ///
3613    /// Note that all the setters affecting `resource_metadata` are
3614    /// mutually exclusive.
3615    ///
3616    /// # Example
3617    /// ```ignore,no_run
3618    /// # use google_cloud_config_v1::model::OperationMetadata;
3619    /// use google_cloud_config_v1::model::ProvisionDeploymentGroupOperationMetadata;
3620    /// let x = OperationMetadata::new().set_provision_deployment_group_metadata(ProvisionDeploymentGroupOperationMetadata::default()/* use setters */);
3621    /// assert!(x.provision_deployment_group_metadata().is_some());
3622    /// assert!(x.deployment_metadata().is_none());
3623    /// assert!(x.preview_metadata().is_none());
3624    /// ```
3625    pub fn set_provision_deployment_group_metadata<
3626        T: std::convert::Into<
3627                std::boxed::Box<crate::model::ProvisionDeploymentGroupOperationMetadata>,
3628            >,
3629    >(
3630        mut self,
3631        v: T,
3632    ) -> Self {
3633        self.resource_metadata = std::option::Option::Some(
3634            crate::model::operation_metadata::ResourceMetadata::ProvisionDeploymentGroupMetadata(
3635                v.into(),
3636            ),
3637        );
3638        self
3639    }
3640}
3641
3642impl wkt::message::Message for OperationMetadata {
3643    fn typename() -> &'static str {
3644        "type.googleapis.com/google.cloud.config.v1.OperationMetadata"
3645    }
3646}
3647
3648/// Defines additional types related to [OperationMetadata].
3649pub mod operation_metadata {
3650    #[allow(unused_imports)]
3651    use super::*;
3652
3653    /// Ephemeral metadata about the state of an operation for a particular
3654    /// resource.
3655    #[derive(Clone, Debug, PartialEq)]
3656    #[non_exhaustive]
3657    pub enum ResourceMetadata {
3658        /// Output only. Metadata about the deployment operation state.
3659        DeploymentMetadata(std::boxed::Box<crate::model::DeploymentOperationMetadata>),
3660        /// Output only. Metadata about the preview operation state.
3661        PreviewMetadata(std::boxed::Box<crate::model::PreviewOperationMetadata>),
3662        /// Output only. Metadata about ProvisionDeploymentGroup operation state.
3663        ProvisionDeploymentGroupMetadata(
3664            std::boxed::Box<crate::model::ProvisionDeploymentGroupOperationMetadata>,
3665        ),
3666    }
3667}
3668
3669/// A child resource of a Deployment generated by a 'CreateDeployment' or
3670/// 'UpdateDeployment' call. Each Revision contains metadata pertaining to a
3671/// snapshot of a particular Deployment.
3672#[derive(Clone, Default, PartialEq)]
3673#[non_exhaustive]
3674pub struct Revision {
3675    /// Revision name. Format:
3676    /// `projects/{project}/locations/{location}/deployments/{deployment}/
3677    /// revisions/{revision}`
3678    pub name: std::string::String,
3679
3680    /// Output only. Time when the revision was created.
3681    pub create_time: std::option::Option<wkt::Timestamp>,
3682
3683    /// Output only. Time when the revision was last modified.
3684    pub update_time: std::option::Option<wkt::Timestamp>,
3685
3686    /// Output only. The action which created this revision
3687    pub action: crate::model::revision::Action,
3688
3689    /// Output only. Current state of the revision.
3690    pub state: crate::model::revision::State,
3691
3692    /// Output only. Outputs and artifacts from applying a deployment.
3693    pub apply_results: std::option::Option<crate::model::ApplyResults>,
3694
3695    /// Output only. Additional info regarding the current state.
3696    pub state_detail: std::string::String,
3697
3698    /// Output only. Code describing any errors that may have occurred.
3699    pub error_code: crate::model::revision::ErrorCode,
3700
3701    /// Output only. Cloud Build instance UUID associated with this revision.
3702    pub build: std::string::String,
3703
3704    /// Output only. Location of Revision operation logs in
3705    /// `gs://{bucket}/{object}` format.
3706    pub logs: std::string::String,
3707
3708    /// Output only. Errors encountered when creating or updating this deployment.
3709    /// Errors are truncated to 10 entries, see `delete_results` and `error_logs`
3710    /// for full details.
3711    pub tf_errors: std::vec::Vec<crate::model::TerraformError>,
3712
3713    /// Output only. Location of Terraform error logs in Google Cloud Storage.
3714    /// Format: `gs://{bucket}/{object}`.
3715    pub error_logs: std::string::String,
3716
3717    /// Output only. User-specified Service Account (SA) to be used as credential
3718    /// to manage resources. Format:
3719    /// `projects/{projectID}/serviceAccounts/{serviceAccount}`
3720    pub service_account: std::string::String,
3721
3722    /// Output only. By default, Infra Manager will return a failure when
3723    /// Terraform encounters a 409 code (resource conflict error) during actuation.
3724    /// If this flag is set to true, Infra Manager will instead
3725    /// attempt to automatically import the resource into the Terraform state (for
3726    /// supported resource types) and continue actuation.
3727    ///
3728    /// Not all resource types are supported, refer to documentation.
3729    pub import_existing_resources: bool,
3730
3731    /// Output only. The user-specified Cloud Build worker pool resource in which
3732    /// the Cloud Build job will execute. Format:
3733    /// `projects/{project}/locations/{location}/workerPools/{workerPoolId}`.
3734    /// If this field is unspecified, the default Cloud Build worker pool will be
3735    /// used.
3736    pub worker_pool: std::string::String,
3737
3738    /// Output only. The user-specified Terraform version constraint.
3739    /// Example: "=1.3.10".
3740    pub tf_version_constraint: std::string::String,
3741
3742    /// Output only. The version of Terraform used to create the Revision.
3743    /// It is in the format of "Major.Minor.Patch", for example, "1.3.10".
3744    pub tf_version: std::string::String,
3745
3746    /// Output only. Cloud Storage path containing quota validation results. This
3747    /// field is set when a user sets Deployment.quota_validation field to ENABLED
3748    /// or ENFORCED. Format: `gs://{bucket}/{object}`.
3749    pub quota_validation_results: std::string::String,
3750
3751    /// Optional. Input to control quota checks for resources in terraform
3752    /// configuration files. There are limited resources on which quota validation
3753    /// applies.
3754    pub quota_validation: crate::model::QuotaValidation,
3755
3756    /// Output only. This field specifies the provider configurations.
3757    pub provider_config: std::option::Option<crate::model::ProviderConfig>,
3758
3759    /// Blueprint that was deployed.
3760    pub blueprint: std::option::Option<crate::model::revision::Blueprint>,
3761
3762    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3763}
3764
3765impl Revision {
3766    /// Creates a new default instance.
3767    pub fn new() -> Self {
3768        std::default::Default::default()
3769    }
3770
3771    /// Sets the value of [name][crate::model::Revision::name].
3772    ///
3773    /// # Example
3774    /// ```ignore,no_run
3775    /// # use google_cloud_config_v1::model::Revision;
3776    /// let x = Revision::new().set_name("example");
3777    /// ```
3778    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3779        self.name = v.into();
3780        self
3781    }
3782
3783    /// Sets the value of [create_time][crate::model::Revision::create_time].
3784    ///
3785    /// # Example
3786    /// ```ignore,no_run
3787    /// # use google_cloud_config_v1::model::Revision;
3788    /// use wkt::Timestamp;
3789    /// let x = Revision::new().set_create_time(Timestamp::default()/* use setters */);
3790    /// ```
3791    pub fn set_create_time<T>(mut self, v: T) -> Self
3792    where
3793        T: std::convert::Into<wkt::Timestamp>,
3794    {
3795        self.create_time = std::option::Option::Some(v.into());
3796        self
3797    }
3798
3799    /// Sets or clears the value of [create_time][crate::model::Revision::create_time].
3800    ///
3801    /// # Example
3802    /// ```ignore,no_run
3803    /// # use google_cloud_config_v1::model::Revision;
3804    /// use wkt::Timestamp;
3805    /// let x = Revision::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
3806    /// let x = Revision::new().set_or_clear_create_time(None::<Timestamp>);
3807    /// ```
3808    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
3809    where
3810        T: std::convert::Into<wkt::Timestamp>,
3811    {
3812        self.create_time = v.map(|x| x.into());
3813        self
3814    }
3815
3816    /// Sets the value of [update_time][crate::model::Revision::update_time].
3817    ///
3818    /// # Example
3819    /// ```ignore,no_run
3820    /// # use google_cloud_config_v1::model::Revision;
3821    /// use wkt::Timestamp;
3822    /// let x = Revision::new().set_update_time(Timestamp::default()/* use setters */);
3823    /// ```
3824    pub fn set_update_time<T>(mut self, v: T) -> Self
3825    where
3826        T: std::convert::Into<wkt::Timestamp>,
3827    {
3828        self.update_time = std::option::Option::Some(v.into());
3829        self
3830    }
3831
3832    /// Sets or clears the value of [update_time][crate::model::Revision::update_time].
3833    ///
3834    /// # Example
3835    /// ```ignore,no_run
3836    /// # use google_cloud_config_v1::model::Revision;
3837    /// use wkt::Timestamp;
3838    /// let x = Revision::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
3839    /// let x = Revision::new().set_or_clear_update_time(None::<Timestamp>);
3840    /// ```
3841    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
3842    where
3843        T: std::convert::Into<wkt::Timestamp>,
3844    {
3845        self.update_time = v.map(|x| x.into());
3846        self
3847    }
3848
3849    /// Sets the value of [action][crate::model::Revision::action].
3850    ///
3851    /// # Example
3852    /// ```ignore,no_run
3853    /// # use google_cloud_config_v1::model::Revision;
3854    /// use google_cloud_config_v1::model::revision::Action;
3855    /// let x0 = Revision::new().set_action(Action::Create);
3856    /// let x1 = Revision::new().set_action(Action::Update);
3857    /// let x2 = Revision::new().set_action(Action::Delete);
3858    /// ```
3859    pub fn set_action<T: std::convert::Into<crate::model::revision::Action>>(
3860        mut self,
3861        v: T,
3862    ) -> Self {
3863        self.action = v.into();
3864        self
3865    }
3866
3867    /// Sets the value of [state][crate::model::Revision::state].
3868    ///
3869    /// # Example
3870    /// ```ignore,no_run
3871    /// # use google_cloud_config_v1::model::Revision;
3872    /// use google_cloud_config_v1::model::revision::State;
3873    /// let x0 = Revision::new().set_state(State::Applying);
3874    /// let x1 = Revision::new().set_state(State::Applied);
3875    /// let x2 = Revision::new().set_state(State::Failed);
3876    /// ```
3877    pub fn set_state<T: std::convert::Into<crate::model::revision::State>>(mut self, v: T) -> Self {
3878        self.state = v.into();
3879        self
3880    }
3881
3882    /// Sets the value of [apply_results][crate::model::Revision::apply_results].
3883    ///
3884    /// # Example
3885    /// ```ignore,no_run
3886    /// # use google_cloud_config_v1::model::Revision;
3887    /// use google_cloud_config_v1::model::ApplyResults;
3888    /// let x = Revision::new().set_apply_results(ApplyResults::default()/* use setters */);
3889    /// ```
3890    pub fn set_apply_results<T>(mut self, v: T) -> Self
3891    where
3892        T: std::convert::Into<crate::model::ApplyResults>,
3893    {
3894        self.apply_results = std::option::Option::Some(v.into());
3895        self
3896    }
3897
3898    /// Sets or clears the value of [apply_results][crate::model::Revision::apply_results].
3899    ///
3900    /// # Example
3901    /// ```ignore,no_run
3902    /// # use google_cloud_config_v1::model::Revision;
3903    /// use google_cloud_config_v1::model::ApplyResults;
3904    /// let x = Revision::new().set_or_clear_apply_results(Some(ApplyResults::default()/* use setters */));
3905    /// let x = Revision::new().set_or_clear_apply_results(None::<ApplyResults>);
3906    /// ```
3907    pub fn set_or_clear_apply_results<T>(mut self, v: std::option::Option<T>) -> Self
3908    where
3909        T: std::convert::Into<crate::model::ApplyResults>,
3910    {
3911        self.apply_results = v.map(|x| x.into());
3912        self
3913    }
3914
3915    /// Sets the value of [state_detail][crate::model::Revision::state_detail].
3916    ///
3917    /// # Example
3918    /// ```ignore,no_run
3919    /// # use google_cloud_config_v1::model::Revision;
3920    /// let x = Revision::new().set_state_detail("example");
3921    /// ```
3922    pub fn set_state_detail<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3923        self.state_detail = v.into();
3924        self
3925    }
3926
3927    /// Sets the value of [error_code][crate::model::Revision::error_code].
3928    ///
3929    /// # Example
3930    /// ```ignore,no_run
3931    /// # use google_cloud_config_v1::model::Revision;
3932    /// use google_cloud_config_v1::model::revision::ErrorCode;
3933    /// let x0 = Revision::new().set_error_code(ErrorCode::CloudBuildPermissionDenied);
3934    /// let x1 = Revision::new().set_error_code(ErrorCode::ApplyBuildApiFailed);
3935    /// let x2 = Revision::new().set_error_code(ErrorCode::ApplyBuildRunFailed);
3936    /// ```
3937    pub fn set_error_code<T: std::convert::Into<crate::model::revision::ErrorCode>>(
3938        mut self,
3939        v: T,
3940    ) -> Self {
3941        self.error_code = v.into();
3942        self
3943    }
3944
3945    /// Sets the value of [build][crate::model::Revision::build].
3946    ///
3947    /// # Example
3948    /// ```ignore,no_run
3949    /// # use google_cloud_config_v1::model::Revision;
3950    /// let x = Revision::new().set_build("example");
3951    /// ```
3952    pub fn set_build<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3953        self.build = v.into();
3954        self
3955    }
3956
3957    /// Sets the value of [logs][crate::model::Revision::logs].
3958    ///
3959    /// # Example
3960    /// ```ignore,no_run
3961    /// # use google_cloud_config_v1::model::Revision;
3962    /// let x = Revision::new().set_logs("example");
3963    /// ```
3964    pub fn set_logs<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3965        self.logs = v.into();
3966        self
3967    }
3968
3969    /// Sets the value of [tf_errors][crate::model::Revision::tf_errors].
3970    ///
3971    /// # Example
3972    /// ```ignore,no_run
3973    /// # use google_cloud_config_v1::model::Revision;
3974    /// use google_cloud_config_v1::model::TerraformError;
3975    /// let x = Revision::new()
3976    ///     .set_tf_errors([
3977    ///         TerraformError::default()/* use setters */,
3978    ///         TerraformError::default()/* use (different) setters */,
3979    ///     ]);
3980    /// ```
3981    pub fn set_tf_errors<T, V>(mut self, v: T) -> Self
3982    where
3983        T: std::iter::IntoIterator<Item = V>,
3984        V: std::convert::Into<crate::model::TerraformError>,
3985    {
3986        use std::iter::Iterator;
3987        self.tf_errors = v.into_iter().map(|i| i.into()).collect();
3988        self
3989    }
3990
3991    /// Sets the value of [error_logs][crate::model::Revision::error_logs].
3992    ///
3993    /// # Example
3994    /// ```ignore,no_run
3995    /// # use google_cloud_config_v1::model::Revision;
3996    /// let x = Revision::new().set_error_logs("example");
3997    /// ```
3998    pub fn set_error_logs<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3999        self.error_logs = v.into();
4000        self
4001    }
4002
4003    /// Sets the value of [service_account][crate::model::Revision::service_account].
4004    ///
4005    /// # Example
4006    /// ```ignore,no_run
4007    /// # use google_cloud_config_v1::model::Revision;
4008    /// let x = Revision::new().set_service_account("example");
4009    /// ```
4010    pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4011        self.service_account = v.into();
4012        self
4013    }
4014
4015    /// Sets the value of [import_existing_resources][crate::model::Revision::import_existing_resources].
4016    ///
4017    /// # Example
4018    /// ```ignore,no_run
4019    /// # use google_cloud_config_v1::model::Revision;
4020    /// let x = Revision::new().set_import_existing_resources(true);
4021    /// ```
4022    pub fn set_import_existing_resources<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4023        self.import_existing_resources = v.into();
4024        self
4025    }
4026
4027    /// Sets the value of [worker_pool][crate::model::Revision::worker_pool].
4028    ///
4029    /// # Example
4030    /// ```ignore,no_run
4031    /// # use google_cloud_config_v1::model::Revision;
4032    /// let x = Revision::new().set_worker_pool("example");
4033    /// ```
4034    pub fn set_worker_pool<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4035        self.worker_pool = v.into();
4036        self
4037    }
4038
4039    /// Sets the value of [tf_version_constraint][crate::model::Revision::tf_version_constraint].
4040    ///
4041    /// # Example
4042    /// ```ignore,no_run
4043    /// # use google_cloud_config_v1::model::Revision;
4044    /// let x = Revision::new().set_tf_version_constraint("example");
4045    /// ```
4046    pub fn set_tf_version_constraint<T: std::convert::Into<std::string::String>>(
4047        mut self,
4048        v: T,
4049    ) -> Self {
4050        self.tf_version_constraint = v.into();
4051        self
4052    }
4053
4054    /// Sets the value of [tf_version][crate::model::Revision::tf_version].
4055    ///
4056    /// # Example
4057    /// ```ignore,no_run
4058    /// # use google_cloud_config_v1::model::Revision;
4059    /// let x = Revision::new().set_tf_version("example");
4060    /// ```
4061    pub fn set_tf_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4062        self.tf_version = v.into();
4063        self
4064    }
4065
4066    /// Sets the value of [quota_validation_results][crate::model::Revision::quota_validation_results].
4067    ///
4068    /// # Example
4069    /// ```ignore,no_run
4070    /// # use google_cloud_config_v1::model::Revision;
4071    /// let x = Revision::new().set_quota_validation_results("example");
4072    /// ```
4073    pub fn set_quota_validation_results<T: std::convert::Into<std::string::String>>(
4074        mut self,
4075        v: T,
4076    ) -> Self {
4077        self.quota_validation_results = v.into();
4078        self
4079    }
4080
4081    /// Sets the value of [quota_validation][crate::model::Revision::quota_validation].
4082    ///
4083    /// # Example
4084    /// ```ignore,no_run
4085    /// # use google_cloud_config_v1::model::Revision;
4086    /// use google_cloud_config_v1::model::QuotaValidation;
4087    /// let x0 = Revision::new().set_quota_validation(QuotaValidation::Enabled);
4088    /// let x1 = Revision::new().set_quota_validation(QuotaValidation::Enforced);
4089    /// ```
4090    pub fn set_quota_validation<T: std::convert::Into<crate::model::QuotaValidation>>(
4091        mut self,
4092        v: T,
4093    ) -> Self {
4094        self.quota_validation = v.into();
4095        self
4096    }
4097
4098    /// Sets the value of [provider_config][crate::model::Revision::provider_config].
4099    ///
4100    /// # Example
4101    /// ```ignore,no_run
4102    /// # use google_cloud_config_v1::model::Revision;
4103    /// use google_cloud_config_v1::model::ProviderConfig;
4104    /// let x = Revision::new().set_provider_config(ProviderConfig::default()/* use setters */);
4105    /// ```
4106    pub fn set_provider_config<T>(mut self, v: T) -> Self
4107    where
4108        T: std::convert::Into<crate::model::ProviderConfig>,
4109    {
4110        self.provider_config = std::option::Option::Some(v.into());
4111        self
4112    }
4113
4114    /// Sets or clears the value of [provider_config][crate::model::Revision::provider_config].
4115    ///
4116    /// # Example
4117    /// ```ignore,no_run
4118    /// # use google_cloud_config_v1::model::Revision;
4119    /// use google_cloud_config_v1::model::ProviderConfig;
4120    /// let x = Revision::new().set_or_clear_provider_config(Some(ProviderConfig::default()/* use setters */));
4121    /// let x = Revision::new().set_or_clear_provider_config(None::<ProviderConfig>);
4122    /// ```
4123    pub fn set_or_clear_provider_config<T>(mut self, v: std::option::Option<T>) -> Self
4124    where
4125        T: std::convert::Into<crate::model::ProviderConfig>,
4126    {
4127        self.provider_config = v.map(|x| x.into());
4128        self
4129    }
4130
4131    /// Sets the value of [blueprint][crate::model::Revision::blueprint].
4132    ///
4133    /// Note that all the setters affecting `blueprint` are mutually
4134    /// exclusive.
4135    ///
4136    /// # Example
4137    /// ```ignore,no_run
4138    /// # use google_cloud_config_v1::model::Revision;
4139    /// use google_cloud_config_v1::model::TerraformBlueprint;
4140    /// let x = Revision::new().set_blueprint(Some(
4141    ///     google_cloud_config_v1::model::revision::Blueprint::TerraformBlueprint(TerraformBlueprint::default().into())));
4142    /// ```
4143    pub fn set_blueprint<
4144        T: std::convert::Into<std::option::Option<crate::model::revision::Blueprint>>,
4145    >(
4146        mut self,
4147        v: T,
4148    ) -> Self {
4149        self.blueprint = v.into();
4150        self
4151    }
4152
4153    /// The value of [blueprint][crate::model::Revision::blueprint]
4154    /// if it holds a `TerraformBlueprint`, `None` if the field is not set or
4155    /// holds a different branch.
4156    pub fn terraform_blueprint(
4157        &self,
4158    ) -> std::option::Option<&std::boxed::Box<crate::model::TerraformBlueprint>> {
4159        #[allow(unreachable_patterns)]
4160        self.blueprint.as_ref().and_then(|v| match v {
4161            crate::model::revision::Blueprint::TerraformBlueprint(v) => {
4162                std::option::Option::Some(v)
4163            }
4164            _ => std::option::Option::None,
4165        })
4166    }
4167
4168    /// Sets the value of [blueprint][crate::model::Revision::blueprint]
4169    /// to hold a `TerraformBlueprint`.
4170    ///
4171    /// Note that all the setters affecting `blueprint` are
4172    /// mutually exclusive.
4173    ///
4174    /// # Example
4175    /// ```ignore,no_run
4176    /// # use google_cloud_config_v1::model::Revision;
4177    /// use google_cloud_config_v1::model::TerraformBlueprint;
4178    /// let x = Revision::new().set_terraform_blueprint(TerraformBlueprint::default()/* use setters */);
4179    /// assert!(x.terraform_blueprint().is_some());
4180    /// ```
4181    pub fn set_terraform_blueprint<
4182        T: std::convert::Into<std::boxed::Box<crate::model::TerraformBlueprint>>,
4183    >(
4184        mut self,
4185        v: T,
4186    ) -> Self {
4187        self.blueprint = std::option::Option::Some(
4188            crate::model::revision::Blueprint::TerraformBlueprint(v.into()),
4189        );
4190        self
4191    }
4192}
4193
4194impl wkt::message::Message for Revision {
4195    fn typename() -> &'static str {
4196        "type.googleapis.com/google.cloud.config.v1.Revision"
4197    }
4198}
4199
4200/// Defines additional types related to [Revision].
4201pub mod revision {
4202    #[allow(unused_imports)]
4203    use super::*;
4204
4205    /// Actions that generate a revision.
4206    ///
4207    /// # Working with unknown values
4208    ///
4209    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4210    /// additional enum variants at any time. Adding new variants is not considered
4211    /// a breaking change. Applications should write their code in anticipation of:
4212    ///
4213    /// - New values appearing in future releases of the client library, **and**
4214    /// - New values received dynamically, without application changes.
4215    ///
4216    /// Please consult the [Working with enums] section in the user guide for some
4217    /// guidelines.
4218    ///
4219    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
4220    #[derive(Clone, Debug, PartialEq)]
4221    #[non_exhaustive]
4222    pub enum Action {
4223        /// The default value. This value is used if the action is omitted.
4224        Unspecified,
4225        /// The revision was generated by creating a deployment.
4226        Create,
4227        /// The revision was generated by updating a deployment.
4228        Update,
4229        /// The revision was deleted.
4230        Delete,
4231        /// If set, the enum was initialized with an unknown value.
4232        ///
4233        /// Applications can examine the value using [Action::value] or
4234        /// [Action::name].
4235        UnknownValue(action::UnknownValue),
4236    }
4237
4238    #[doc(hidden)]
4239    pub mod action {
4240        #[allow(unused_imports)]
4241        use super::*;
4242        #[derive(Clone, Debug, PartialEq)]
4243        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4244    }
4245
4246    impl Action {
4247        /// Gets the enum value.
4248        ///
4249        /// Returns `None` if the enum contains an unknown value deserialized from
4250        /// the string representation of enums.
4251        pub fn value(&self) -> std::option::Option<i32> {
4252            match self {
4253                Self::Unspecified => std::option::Option::Some(0),
4254                Self::Create => std::option::Option::Some(1),
4255                Self::Update => std::option::Option::Some(2),
4256                Self::Delete => std::option::Option::Some(3),
4257                Self::UnknownValue(u) => u.0.value(),
4258            }
4259        }
4260
4261        /// Gets the enum value as a string.
4262        ///
4263        /// Returns `None` if the enum contains an unknown value deserialized from
4264        /// the integer representation of enums.
4265        pub fn name(&self) -> std::option::Option<&str> {
4266            match self {
4267                Self::Unspecified => std::option::Option::Some("ACTION_UNSPECIFIED"),
4268                Self::Create => std::option::Option::Some("CREATE"),
4269                Self::Update => std::option::Option::Some("UPDATE"),
4270                Self::Delete => std::option::Option::Some("DELETE"),
4271                Self::UnknownValue(u) => u.0.name(),
4272            }
4273        }
4274    }
4275
4276    impl std::default::Default for Action {
4277        fn default() -> Self {
4278            use std::convert::From;
4279            Self::from(0)
4280        }
4281    }
4282
4283    impl std::fmt::Display for Action {
4284        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4285            wkt::internal::display_enum(f, self.name(), self.value())
4286        }
4287    }
4288
4289    impl std::convert::From<i32> for Action {
4290        fn from(value: i32) -> Self {
4291            match value {
4292                0 => Self::Unspecified,
4293                1 => Self::Create,
4294                2 => Self::Update,
4295                3 => Self::Delete,
4296                _ => Self::UnknownValue(action::UnknownValue(
4297                    wkt::internal::UnknownEnumValue::Integer(value),
4298                )),
4299            }
4300        }
4301    }
4302
4303    impl std::convert::From<&str> for Action {
4304        fn from(value: &str) -> Self {
4305            use std::string::ToString;
4306            match value {
4307                "ACTION_UNSPECIFIED" => Self::Unspecified,
4308                "CREATE" => Self::Create,
4309                "UPDATE" => Self::Update,
4310                "DELETE" => Self::Delete,
4311                _ => Self::UnknownValue(action::UnknownValue(
4312                    wkt::internal::UnknownEnumValue::String(value.to_string()),
4313                )),
4314            }
4315        }
4316    }
4317
4318    impl serde::ser::Serialize for Action {
4319        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4320        where
4321            S: serde::Serializer,
4322        {
4323            match self {
4324                Self::Unspecified => serializer.serialize_i32(0),
4325                Self::Create => serializer.serialize_i32(1),
4326                Self::Update => serializer.serialize_i32(2),
4327                Self::Delete => serializer.serialize_i32(3),
4328                Self::UnknownValue(u) => u.0.serialize(serializer),
4329            }
4330        }
4331    }
4332
4333    impl<'de> serde::de::Deserialize<'de> for Action {
4334        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4335        where
4336            D: serde::Deserializer<'de>,
4337        {
4338            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Action>::new(
4339                ".google.cloud.config.v1.Revision.Action",
4340            ))
4341        }
4342    }
4343
4344    /// Possible states of a revision.
4345    ///
4346    /// # Working with unknown values
4347    ///
4348    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4349    /// additional enum variants at any time. Adding new variants is not considered
4350    /// a breaking change. Applications should write their code in anticipation of:
4351    ///
4352    /// - New values appearing in future releases of the client library, **and**
4353    /// - New values received dynamically, without application changes.
4354    ///
4355    /// Please consult the [Working with enums] section in the user guide for some
4356    /// guidelines.
4357    ///
4358    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
4359    #[derive(Clone, Debug, PartialEq)]
4360    #[non_exhaustive]
4361    pub enum State {
4362        /// The default value. This value is used if the state is omitted.
4363        Unspecified,
4364        /// The revision is being applied.
4365        Applying,
4366        /// The revision was applied successfully.
4367        Applied,
4368        /// The revision could not be applied successfully.
4369        Failed,
4370        /// If set, the enum was initialized with an unknown value.
4371        ///
4372        /// Applications can examine the value using [State::value] or
4373        /// [State::name].
4374        UnknownValue(state::UnknownValue),
4375    }
4376
4377    #[doc(hidden)]
4378    pub mod state {
4379        #[allow(unused_imports)]
4380        use super::*;
4381        #[derive(Clone, Debug, PartialEq)]
4382        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4383    }
4384
4385    impl State {
4386        /// Gets the enum value.
4387        ///
4388        /// Returns `None` if the enum contains an unknown value deserialized from
4389        /// the string representation of enums.
4390        pub fn value(&self) -> std::option::Option<i32> {
4391            match self {
4392                Self::Unspecified => std::option::Option::Some(0),
4393                Self::Applying => std::option::Option::Some(1),
4394                Self::Applied => std::option::Option::Some(2),
4395                Self::Failed => std::option::Option::Some(3),
4396                Self::UnknownValue(u) => u.0.value(),
4397            }
4398        }
4399
4400        /// Gets the enum value as a string.
4401        ///
4402        /// Returns `None` if the enum contains an unknown value deserialized from
4403        /// the integer representation of enums.
4404        pub fn name(&self) -> std::option::Option<&str> {
4405            match self {
4406                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
4407                Self::Applying => std::option::Option::Some("APPLYING"),
4408                Self::Applied => std::option::Option::Some("APPLIED"),
4409                Self::Failed => std::option::Option::Some("FAILED"),
4410                Self::UnknownValue(u) => u.0.name(),
4411            }
4412        }
4413    }
4414
4415    impl std::default::Default for State {
4416        fn default() -> Self {
4417            use std::convert::From;
4418            Self::from(0)
4419        }
4420    }
4421
4422    impl std::fmt::Display for State {
4423        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4424            wkt::internal::display_enum(f, self.name(), self.value())
4425        }
4426    }
4427
4428    impl std::convert::From<i32> for State {
4429        fn from(value: i32) -> Self {
4430            match value {
4431                0 => Self::Unspecified,
4432                1 => Self::Applying,
4433                2 => Self::Applied,
4434                3 => Self::Failed,
4435                _ => Self::UnknownValue(state::UnknownValue(
4436                    wkt::internal::UnknownEnumValue::Integer(value),
4437                )),
4438            }
4439        }
4440    }
4441
4442    impl std::convert::From<&str> for State {
4443        fn from(value: &str) -> Self {
4444            use std::string::ToString;
4445            match value {
4446                "STATE_UNSPECIFIED" => Self::Unspecified,
4447                "APPLYING" => Self::Applying,
4448                "APPLIED" => Self::Applied,
4449                "FAILED" => Self::Failed,
4450                _ => Self::UnknownValue(state::UnknownValue(
4451                    wkt::internal::UnknownEnumValue::String(value.to_string()),
4452                )),
4453            }
4454        }
4455    }
4456
4457    impl serde::ser::Serialize for State {
4458        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4459        where
4460            S: serde::Serializer,
4461        {
4462            match self {
4463                Self::Unspecified => serializer.serialize_i32(0),
4464                Self::Applying => serializer.serialize_i32(1),
4465                Self::Applied => serializer.serialize_i32(2),
4466                Self::Failed => serializer.serialize_i32(3),
4467                Self::UnknownValue(u) => u.0.serialize(serializer),
4468            }
4469        }
4470    }
4471
4472    impl<'de> serde::de::Deserialize<'de> for State {
4473        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4474        where
4475            D: serde::Deserializer<'de>,
4476        {
4477            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
4478                ".google.cloud.config.v1.Revision.State",
4479            ))
4480        }
4481    }
4482
4483    /// Possible errors if Revision could not be created or updated successfully.
4484    ///
4485    /// # Working with unknown values
4486    ///
4487    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4488    /// additional enum variants at any time. Adding new variants is not considered
4489    /// a breaking change. Applications should write their code in anticipation of:
4490    ///
4491    /// - New values appearing in future releases of the client library, **and**
4492    /// - New values received dynamically, without application changes.
4493    ///
4494    /// Please consult the [Working with enums] section in the user guide for some
4495    /// guidelines.
4496    ///
4497    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
4498    #[derive(Clone, Debug, PartialEq)]
4499    #[non_exhaustive]
4500    pub enum ErrorCode {
4501        /// No error code was specified.
4502        Unspecified,
4503        /// Cloud Build failed due to a permission issue.
4504        CloudBuildPermissionDenied,
4505        /// Cloud Build job associated with creating or updating a deployment could
4506        /// not be started.
4507        ApplyBuildApiFailed,
4508        /// Cloud Build job associated with creating or updating a deployment was
4509        /// started but failed.
4510        ApplyBuildRunFailed,
4511        /// quota validation failed for one or more resources in terraform
4512        /// configuration files.
4513        QuotaValidationFailed,
4514        /// Failed to import values from an external source.
4515        ExternalValueSourceImportFailed,
4516        /// If set, the enum was initialized with an unknown value.
4517        ///
4518        /// Applications can examine the value using [ErrorCode::value] or
4519        /// [ErrorCode::name].
4520        UnknownValue(error_code::UnknownValue),
4521    }
4522
4523    #[doc(hidden)]
4524    pub mod error_code {
4525        #[allow(unused_imports)]
4526        use super::*;
4527        #[derive(Clone, Debug, PartialEq)]
4528        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4529    }
4530
4531    impl ErrorCode {
4532        /// Gets the enum value.
4533        ///
4534        /// Returns `None` if the enum contains an unknown value deserialized from
4535        /// the string representation of enums.
4536        pub fn value(&self) -> std::option::Option<i32> {
4537            match self {
4538                Self::Unspecified => std::option::Option::Some(0),
4539                Self::CloudBuildPermissionDenied => std::option::Option::Some(1),
4540                Self::ApplyBuildApiFailed => std::option::Option::Some(4),
4541                Self::ApplyBuildRunFailed => std::option::Option::Some(5),
4542                Self::QuotaValidationFailed => std::option::Option::Some(7),
4543                Self::ExternalValueSourceImportFailed => std::option::Option::Some(8),
4544                Self::UnknownValue(u) => u.0.value(),
4545            }
4546        }
4547
4548        /// Gets the enum value as a string.
4549        ///
4550        /// Returns `None` if the enum contains an unknown value deserialized from
4551        /// the integer representation of enums.
4552        pub fn name(&self) -> std::option::Option<&str> {
4553            match self {
4554                Self::Unspecified => std::option::Option::Some("ERROR_CODE_UNSPECIFIED"),
4555                Self::CloudBuildPermissionDenied => {
4556                    std::option::Option::Some("CLOUD_BUILD_PERMISSION_DENIED")
4557                }
4558                Self::ApplyBuildApiFailed => std::option::Option::Some("APPLY_BUILD_API_FAILED"),
4559                Self::ApplyBuildRunFailed => std::option::Option::Some("APPLY_BUILD_RUN_FAILED"),
4560                Self::QuotaValidationFailed => std::option::Option::Some("QUOTA_VALIDATION_FAILED"),
4561                Self::ExternalValueSourceImportFailed => {
4562                    std::option::Option::Some("EXTERNAL_VALUE_SOURCE_IMPORT_FAILED")
4563                }
4564                Self::UnknownValue(u) => u.0.name(),
4565            }
4566        }
4567    }
4568
4569    impl std::default::Default for ErrorCode {
4570        fn default() -> Self {
4571            use std::convert::From;
4572            Self::from(0)
4573        }
4574    }
4575
4576    impl std::fmt::Display for ErrorCode {
4577        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4578            wkt::internal::display_enum(f, self.name(), self.value())
4579        }
4580    }
4581
4582    impl std::convert::From<i32> for ErrorCode {
4583        fn from(value: i32) -> Self {
4584            match value {
4585                0 => Self::Unspecified,
4586                1 => Self::CloudBuildPermissionDenied,
4587                4 => Self::ApplyBuildApiFailed,
4588                5 => Self::ApplyBuildRunFailed,
4589                7 => Self::QuotaValidationFailed,
4590                8 => Self::ExternalValueSourceImportFailed,
4591                _ => Self::UnknownValue(error_code::UnknownValue(
4592                    wkt::internal::UnknownEnumValue::Integer(value),
4593                )),
4594            }
4595        }
4596    }
4597
4598    impl std::convert::From<&str> for ErrorCode {
4599        fn from(value: &str) -> Self {
4600            use std::string::ToString;
4601            match value {
4602                "ERROR_CODE_UNSPECIFIED" => Self::Unspecified,
4603                "CLOUD_BUILD_PERMISSION_DENIED" => Self::CloudBuildPermissionDenied,
4604                "APPLY_BUILD_API_FAILED" => Self::ApplyBuildApiFailed,
4605                "APPLY_BUILD_RUN_FAILED" => Self::ApplyBuildRunFailed,
4606                "QUOTA_VALIDATION_FAILED" => Self::QuotaValidationFailed,
4607                "EXTERNAL_VALUE_SOURCE_IMPORT_FAILED" => Self::ExternalValueSourceImportFailed,
4608                _ => Self::UnknownValue(error_code::UnknownValue(
4609                    wkt::internal::UnknownEnumValue::String(value.to_string()),
4610                )),
4611            }
4612        }
4613    }
4614
4615    impl serde::ser::Serialize for ErrorCode {
4616        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4617        where
4618            S: serde::Serializer,
4619        {
4620            match self {
4621                Self::Unspecified => serializer.serialize_i32(0),
4622                Self::CloudBuildPermissionDenied => serializer.serialize_i32(1),
4623                Self::ApplyBuildApiFailed => serializer.serialize_i32(4),
4624                Self::ApplyBuildRunFailed => serializer.serialize_i32(5),
4625                Self::QuotaValidationFailed => serializer.serialize_i32(7),
4626                Self::ExternalValueSourceImportFailed => serializer.serialize_i32(8),
4627                Self::UnknownValue(u) => u.0.serialize(serializer),
4628            }
4629        }
4630    }
4631
4632    impl<'de> serde::de::Deserialize<'de> for ErrorCode {
4633        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4634        where
4635            D: serde::Deserializer<'de>,
4636        {
4637            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ErrorCode>::new(
4638                ".google.cloud.config.v1.Revision.ErrorCode",
4639            ))
4640        }
4641    }
4642
4643    /// Blueprint that was deployed.
4644    #[derive(Clone, Debug, PartialEq)]
4645    #[non_exhaustive]
4646    pub enum Blueprint {
4647        /// Output only. A blueprint described using Terraform's HashiCorp
4648        /// Configuration Language as a root module.
4649        TerraformBlueprint(std::boxed::Box<crate::model::TerraformBlueprint>),
4650    }
4651}
4652
4653/// Errors encountered during actuation using Terraform
4654#[derive(Clone, Default, PartialEq)]
4655#[non_exhaustive]
4656pub struct TerraformError {
4657    /// Address of the resource associated with the error,
4658    /// e.g. `google_compute_network.vpc_network`.
4659    pub resource_address: std::string::String,
4660
4661    /// HTTP response code returned from Google Cloud Platform APIs when Terraform
4662    /// fails to provision the resource. If unset or 0, no HTTP response code was
4663    /// returned by Terraform.
4664    pub http_response_code: i32,
4665
4666    /// A human-readable error description.
4667    pub error_description: std::string::String,
4668
4669    /// Output only. Original error response from underlying Google API, if
4670    /// available.
4671    pub error: std::option::Option<google_cloud_rpc::model::Status>,
4672
4673    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4674}
4675
4676impl TerraformError {
4677    /// Creates a new default instance.
4678    pub fn new() -> Self {
4679        std::default::Default::default()
4680    }
4681
4682    /// Sets the value of [resource_address][crate::model::TerraformError::resource_address].
4683    ///
4684    /// # Example
4685    /// ```ignore,no_run
4686    /// # use google_cloud_config_v1::model::TerraformError;
4687    /// let x = TerraformError::new().set_resource_address("example");
4688    /// ```
4689    pub fn set_resource_address<T: std::convert::Into<std::string::String>>(
4690        mut self,
4691        v: T,
4692    ) -> Self {
4693        self.resource_address = v.into();
4694        self
4695    }
4696
4697    /// Sets the value of [http_response_code][crate::model::TerraformError::http_response_code].
4698    ///
4699    /// # Example
4700    /// ```ignore,no_run
4701    /// # use google_cloud_config_v1::model::TerraformError;
4702    /// let x = TerraformError::new().set_http_response_code(42);
4703    /// ```
4704    pub fn set_http_response_code<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4705        self.http_response_code = v.into();
4706        self
4707    }
4708
4709    /// Sets the value of [error_description][crate::model::TerraformError::error_description].
4710    ///
4711    /// # Example
4712    /// ```ignore,no_run
4713    /// # use google_cloud_config_v1::model::TerraformError;
4714    /// let x = TerraformError::new().set_error_description("example");
4715    /// ```
4716    pub fn set_error_description<T: std::convert::Into<std::string::String>>(
4717        mut self,
4718        v: T,
4719    ) -> Self {
4720        self.error_description = v.into();
4721        self
4722    }
4723
4724    /// Sets the value of [error][crate::model::TerraformError::error].
4725    ///
4726    /// # Example
4727    /// ```ignore,no_run
4728    /// # use google_cloud_config_v1::model::TerraformError;
4729    /// use google_cloud_rpc::model::Status;
4730    /// let x = TerraformError::new().set_error(Status::default()/* use setters */);
4731    /// ```
4732    pub fn set_error<T>(mut self, v: T) -> Self
4733    where
4734        T: std::convert::Into<google_cloud_rpc::model::Status>,
4735    {
4736        self.error = std::option::Option::Some(v.into());
4737        self
4738    }
4739
4740    /// Sets or clears the value of [error][crate::model::TerraformError::error].
4741    ///
4742    /// # Example
4743    /// ```ignore,no_run
4744    /// # use google_cloud_config_v1::model::TerraformError;
4745    /// use google_cloud_rpc::model::Status;
4746    /// let x = TerraformError::new().set_or_clear_error(Some(Status::default()/* use setters */));
4747    /// let x = TerraformError::new().set_or_clear_error(None::<Status>);
4748    /// ```
4749    pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
4750    where
4751        T: std::convert::Into<google_cloud_rpc::model::Status>,
4752    {
4753        self.error = v.map(|x| x.into());
4754        self
4755    }
4756}
4757
4758impl wkt::message::Message for TerraformError {
4759    fn typename() -> &'static str {
4760        "type.googleapis.com/google.cloud.config.v1.TerraformError"
4761    }
4762}
4763
4764/// A set of files in a Git repository.
4765#[derive(Clone, Default, PartialEq)]
4766#[non_exhaustive]
4767pub struct GitSource {
4768    /// Optional. Repository URL.
4769    /// Example: '<https://github.com/kubernetes/examples.git>'
4770    pub repo: std::option::Option<std::string::String>,
4771
4772    /// Optional. Subdirectory inside the repository.
4773    /// Example: 'staging/my-package'
4774    pub directory: std::option::Option<std::string::String>,
4775
4776    /// Optional. Git reference (e.g. branch or tag).
4777    pub r#ref: std::option::Option<std::string::String>,
4778
4779    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4780}
4781
4782impl GitSource {
4783    /// Creates a new default instance.
4784    pub fn new() -> Self {
4785        std::default::Default::default()
4786    }
4787
4788    /// Sets the value of [repo][crate::model::GitSource::repo].
4789    ///
4790    /// # Example
4791    /// ```ignore,no_run
4792    /// # use google_cloud_config_v1::model::GitSource;
4793    /// let x = GitSource::new().set_repo("example");
4794    /// ```
4795    pub fn set_repo<T>(mut self, v: T) -> Self
4796    where
4797        T: std::convert::Into<std::string::String>,
4798    {
4799        self.repo = std::option::Option::Some(v.into());
4800        self
4801    }
4802
4803    /// Sets or clears the value of [repo][crate::model::GitSource::repo].
4804    ///
4805    /// # Example
4806    /// ```ignore,no_run
4807    /// # use google_cloud_config_v1::model::GitSource;
4808    /// let x = GitSource::new().set_or_clear_repo(Some("example"));
4809    /// let x = GitSource::new().set_or_clear_repo(None::<String>);
4810    /// ```
4811    pub fn set_or_clear_repo<T>(mut self, v: std::option::Option<T>) -> Self
4812    where
4813        T: std::convert::Into<std::string::String>,
4814    {
4815        self.repo = v.map(|x| x.into());
4816        self
4817    }
4818
4819    /// Sets the value of [directory][crate::model::GitSource::directory].
4820    ///
4821    /// # Example
4822    /// ```ignore,no_run
4823    /// # use google_cloud_config_v1::model::GitSource;
4824    /// let x = GitSource::new().set_directory("example");
4825    /// ```
4826    pub fn set_directory<T>(mut self, v: T) -> Self
4827    where
4828        T: std::convert::Into<std::string::String>,
4829    {
4830        self.directory = std::option::Option::Some(v.into());
4831        self
4832    }
4833
4834    /// Sets or clears the value of [directory][crate::model::GitSource::directory].
4835    ///
4836    /// # Example
4837    /// ```ignore,no_run
4838    /// # use google_cloud_config_v1::model::GitSource;
4839    /// let x = GitSource::new().set_or_clear_directory(Some("example"));
4840    /// let x = GitSource::new().set_or_clear_directory(None::<String>);
4841    /// ```
4842    pub fn set_or_clear_directory<T>(mut self, v: std::option::Option<T>) -> Self
4843    where
4844        T: std::convert::Into<std::string::String>,
4845    {
4846        self.directory = v.map(|x| x.into());
4847        self
4848    }
4849
4850    /// Sets the value of [r#ref][crate::model::GitSource::ref].
4851    ///
4852    /// # Example
4853    /// ```ignore,no_run
4854    /// # use google_cloud_config_v1::model::GitSource;
4855    /// let x = GitSource::new().set_ref("example");
4856    /// ```
4857    pub fn set_ref<T>(mut self, v: T) -> Self
4858    where
4859        T: std::convert::Into<std::string::String>,
4860    {
4861        self.r#ref = std::option::Option::Some(v.into());
4862        self
4863    }
4864
4865    /// Sets or clears the value of [r#ref][crate::model::GitSource::ref].
4866    ///
4867    /// # Example
4868    /// ```ignore,no_run
4869    /// # use google_cloud_config_v1::model::GitSource;
4870    /// let x = GitSource::new().set_or_clear_ref(Some("example"));
4871    /// let x = GitSource::new().set_or_clear_ref(None::<String>);
4872    /// ```
4873    pub fn set_or_clear_ref<T>(mut self, v: std::option::Option<T>) -> Self
4874    where
4875        T: std::convert::Into<std::string::String>,
4876    {
4877        self.r#ref = v.map(|x| x.into());
4878        self
4879    }
4880}
4881
4882impl wkt::message::Message for GitSource {
4883    fn typename() -> &'static str {
4884        "type.googleapis.com/google.cloud.config.v1.GitSource"
4885    }
4886}
4887
4888/// Ephemeral metadata content describing the state of a deployment operation.
4889#[derive(Clone, Default, PartialEq)]
4890#[non_exhaustive]
4891pub struct DeploymentOperationMetadata {
4892    /// The current step the deployment operation is running.
4893    pub step: crate::model::deployment_operation_metadata::DeploymentStep,
4894
4895    /// Outputs and artifacts from applying a deployment.
4896    pub apply_results: std::option::Option<crate::model::ApplyResults>,
4897
4898    /// Output only. Cloud Build instance UUID associated with this operation.
4899    pub build: std::string::String,
4900
4901    /// Output only. Location of Deployment operations logs in
4902    /// `gs://{bucket}/{object}` format.
4903    pub logs: std::string::String,
4904
4905    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4906}
4907
4908impl DeploymentOperationMetadata {
4909    /// Creates a new default instance.
4910    pub fn new() -> Self {
4911        std::default::Default::default()
4912    }
4913
4914    /// Sets the value of [step][crate::model::DeploymentOperationMetadata::step].
4915    ///
4916    /// # Example
4917    /// ```ignore,no_run
4918    /// # use google_cloud_config_v1::model::DeploymentOperationMetadata;
4919    /// use google_cloud_config_v1::model::deployment_operation_metadata::DeploymentStep;
4920    /// let x0 = DeploymentOperationMetadata::new().set_step(DeploymentStep::PreparingStorageBucket);
4921    /// let x1 = DeploymentOperationMetadata::new().set_step(DeploymentStep::DownloadingBlueprint);
4922    /// let x2 = DeploymentOperationMetadata::new().set_step(DeploymentStep::RunningTfInit);
4923    /// ```
4924    pub fn set_step<
4925        T: std::convert::Into<crate::model::deployment_operation_metadata::DeploymentStep>,
4926    >(
4927        mut self,
4928        v: T,
4929    ) -> Self {
4930        self.step = v.into();
4931        self
4932    }
4933
4934    /// Sets the value of [apply_results][crate::model::DeploymentOperationMetadata::apply_results].
4935    ///
4936    /// # Example
4937    /// ```ignore,no_run
4938    /// # use google_cloud_config_v1::model::DeploymentOperationMetadata;
4939    /// use google_cloud_config_v1::model::ApplyResults;
4940    /// let x = DeploymentOperationMetadata::new().set_apply_results(ApplyResults::default()/* use setters */);
4941    /// ```
4942    pub fn set_apply_results<T>(mut self, v: T) -> Self
4943    where
4944        T: std::convert::Into<crate::model::ApplyResults>,
4945    {
4946        self.apply_results = std::option::Option::Some(v.into());
4947        self
4948    }
4949
4950    /// Sets or clears the value of [apply_results][crate::model::DeploymentOperationMetadata::apply_results].
4951    ///
4952    /// # Example
4953    /// ```ignore,no_run
4954    /// # use google_cloud_config_v1::model::DeploymentOperationMetadata;
4955    /// use google_cloud_config_v1::model::ApplyResults;
4956    /// let x = DeploymentOperationMetadata::new().set_or_clear_apply_results(Some(ApplyResults::default()/* use setters */));
4957    /// let x = DeploymentOperationMetadata::new().set_or_clear_apply_results(None::<ApplyResults>);
4958    /// ```
4959    pub fn set_or_clear_apply_results<T>(mut self, v: std::option::Option<T>) -> Self
4960    where
4961        T: std::convert::Into<crate::model::ApplyResults>,
4962    {
4963        self.apply_results = v.map(|x| x.into());
4964        self
4965    }
4966
4967    /// Sets the value of [build][crate::model::DeploymentOperationMetadata::build].
4968    ///
4969    /// # Example
4970    /// ```ignore,no_run
4971    /// # use google_cloud_config_v1::model::DeploymentOperationMetadata;
4972    /// let x = DeploymentOperationMetadata::new().set_build("example");
4973    /// ```
4974    pub fn set_build<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4975        self.build = v.into();
4976        self
4977    }
4978
4979    /// Sets the value of [logs][crate::model::DeploymentOperationMetadata::logs].
4980    ///
4981    /// # Example
4982    /// ```ignore,no_run
4983    /// # use google_cloud_config_v1::model::DeploymentOperationMetadata;
4984    /// let x = DeploymentOperationMetadata::new().set_logs("example");
4985    /// ```
4986    pub fn set_logs<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4987        self.logs = v.into();
4988        self
4989    }
4990}
4991
4992impl wkt::message::Message for DeploymentOperationMetadata {
4993    fn typename() -> &'static str {
4994        "type.googleapis.com/google.cloud.config.v1.DeploymentOperationMetadata"
4995    }
4996}
4997
4998/// Defines additional types related to [DeploymentOperationMetadata].
4999pub mod deployment_operation_metadata {
5000    #[allow(unused_imports)]
5001    use super::*;
5002
5003    /// The possible steps a deployment may be running.
5004    ///
5005    /// # Working with unknown values
5006    ///
5007    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5008    /// additional enum variants at any time. Adding new variants is not considered
5009    /// a breaking change. Applications should write their code in anticipation of:
5010    ///
5011    /// - New values appearing in future releases of the client library, **and**
5012    /// - New values received dynamically, without application changes.
5013    ///
5014    /// Please consult the [Working with enums] section in the user guide for some
5015    /// guidelines.
5016    ///
5017    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
5018    #[derive(Clone, Debug, PartialEq)]
5019    #[non_exhaustive]
5020    pub enum DeploymentStep {
5021        /// Unspecified deployment step
5022        Unspecified,
5023        /// Infra Manager is creating a Google Cloud Storage bucket to store
5024        /// artifacts and metadata about the deployment and revision
5025        PreparingStorageBucket,
5026        /// Downloading the blueprint onto the Google Cloud Storage bucket
5027        DownloadingBlueprint,
5028        /// Initializing Terraform using `terraform init`
5029        RunningTfInit,
5030        /// Running `terraform plan`
5031        RunningTfPlan,
5032        /// Actuating resources using Terraform using `terraform apply`
5033        RunningTfApply,
5034        /// Destroying resources using Terraform using `terraform destroy`
5035        RunningTfDestroy,
5036        /// Validating the uploaded TF state file when unlocking a deployment
5037        RunningTfValidate,
5038        /// Unlocking a deployment
5039        UnlockingDeployment,
5040        /// Operation was successful
5041        Succeeded,
5042        /// Operation failed
5043        Failed,
5044        /// Validating the provided repository.
5045        ValidatingRepository,
5046        /// Running quota validation
5047        RunningQuotaValidation,
5048        /// If set, the enum was initialized with an unknown value.
5049        ///
5050        /// Applications can examine the value using [DeploymentStep::value] or
5051        /// [DeploymentStep::name].
5052        UnknownValue(deployment_step::UnknownValue),
5053    }
5054
5055    #[doc(hidden)]
5056    pub mod deployment_step {
5057        #[allow(unused_imports)]
5058        use super::*;
5059        #[derive(Clone, Debug, PartialEq)]
5060        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5061    }
5062
5063    impl DeploymentStep {
5064        /// Gets the enum value.
5065        ///
5066        /// Returns `None` if the enum contains an unknown value deserialized from
5067        /// the string representation of enums.
5068        pub fn value(&self) -> std::option::Option<i32> {
5069            match self {
5070                Self::Unspecified => std::option::Option::Some(0),
5071                Self::PreparingStorageBucket => std::option::Option::Some(1),
5072                Self::DownloadingBlueprint => std::option::Option::Some(2),
5073                Self::RunningTfInit => std::option::Option::Some(3),
5074                Self::RunningTfPlan => std::option::Option::Some(4),
5075                Self::RunningTfApply => std::option::Option::Some(5),
5076                Self::RunningTfDestroy => std::option::Option::Some(6),
5077                Self::RunningTfValidate => std::option::Option::Some(7),
5078                Self::UnlockingDeployment => std::option::Option::Some(8),
5079                Self::Succeeded => std::option::Option::Some(9),
5080                Self::Failed => std::option::Option::Some(10),
5081                Self::ValidatingRepository => std::option::Option::Some(11),
5082                Self::RunningQuotaValidation => std::option::Option::Some(12),
5083                Self::UnknownValue(u) => u.0.value(),
5084            }
5085        }
5086
5087        /// Gets the enum value as a string.
5088        ///
5089        /// Returns `None` if the enum contains an unknown value deserialized from
5090        /// the integer representation of enums.
5091        pub fn name(&self) -> std::option::Option<&str> {
5092            match self {
5093                Self::Unspecified => std::option::Option::Some("DEPLOYMENT_STEP_UNSPECIFIED"),
5094                Self::PreparingStorageBucket => {
5095                    std::option::Option::Some("PREPARING_STORAGE_BUCKET")
5096                }
5097                Self::DownloadingBlueprint => std::option::Option::Some("DOWNLOADING_BLUEPRINT"),
5098                Self::RunningTfInit => std::option::Option::Some("RUNNING_TF_INIT"),
5099                Self::RunningTfPlan => std::option::Option::Some("RUNNING_TF_PLAN"),
5100                Self::RunningTfApply => std::option::Option::Some("RUNNING_TF_APPLY"),
5101                Self::RunningTfDestroy => std::option::Option::Some("RUNNING_TF_DESTROY"),
5102                Self::RunningTfValidate => std::option::Option::Some("RUNNING_TF_VALIDATE"),
5103                Self::UnlockingDeployment => std::option::Option::Some("UNLOCKING_DEPLOYMENT"),
5104                Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
5105                Self::Failed => std::option::Option::Some("FAILED"),
5106                Self::ValidatingRepository => std::option::Option::Some("VALIDATING_REPOSITORY"),
5107                Self::RunningQuotaValidation => {
5108                    std::option::Option::Some("RUNNING_QUOTA_VALIDATION")
5109                }
5110                Self::UnknownValue(u) => u.0.name(),
5111            }
5112        }
5113    }
5114
5115    impl std::default::Default for DeploymentStep {
5116        fn default() -> Self {
5117            use std::convert::From;
5118            Self::from(0)
5119        }
5120    }
5121
5122    impl std::fmt::Display for DeploymentStep {
5123        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5124            wkt::internal::display_enum(f, self.name(), self.value())
5125        }
5126    }
5127
5128    impl std::convert::From<i32> for DeploymentStep {
5129        fn from(value: i32) -> Self {
5130            match value {
5131                0 => Self::Unspecified,
5132                1 => Self::PreparingStorageBucket,
5133                2 => Self::DownloadingBlueprint,
5134                3 => Self::RunningTfInit,
5135                4 => Self::RunningTfPlan,
5136                5 => Self::RunningTfApply,
5137                6 => Self::RunningTfDestroy,
5138                7 => Self::RunningTfValidate,
5139                8 => Self::UnlockingDeployment,
5140                9 => Self::Succeeded,
5141                10 => Self::Failed,
5142                11 => Self::ValidatingRepository,
5143                12 => Self::RunningQuotaValidation,
5144                _ => Self::UnknownValue(deployment_step::UnknownValue(
5145                    wkt::internal::UnknownEnumValue::Integer(value),
5146                )),
5147            }
5148        }
5149    }
5150
5151    impl std::convert::From<&str> for DeploymentStep {
5152        fn from(value: &str) -> Self {
5153            use std::string::ToString;
5154            match value {
5155                "DEPLOYMENT_STEP_UNSPECIFIED" => Self::Unspecified,
5156                "PREPARING_STORAGE_BUCKET" => Self::PreparingStorageBucket,
5157                "DOWNLOADING_BLUEPRINT" => Self::DownloadingBlueprint,
5158                "RUNNING_TF_INIT" => Self::RunningTfInit,
5159                "RUNNING_TF_PLAN" => Self::RunningTfPlan,
5160                "RUNNING_TF_APPLY" => Self::RunningTfApply,
5161                "RUNNING_TF_DESTROY" => Self::RunningTfDestroy,
5162                "RUNNING_TF_VALIDATE" => Self::RunningTfValidate,
5163                "UNLOCKING_DEPLOYMENT" => Self::UnlockingDeployment,
5164                "SUCCEEDED" => Self::Succeeded,
5165                "FAILED" => Self::Failed,
5166                "VALIDATING_REPOSITORY" => Self::ValidatingRepository,
5167                "RUNNING_QUOTA_VALIDATION" => Self::RunningQuotaValidation,
5168                _ => Self::UnknownValue(deployment_step::UnknownValue(
5169                    wkt::internal::UnknownEnumValue::String(value.to_string()),
5170                )),
5171            }
5172        }
5173    }
5174
5175    impl serde::ser::Serialize for DeploymentStep {
5176        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5177        where
5178            S: serde::Serializer,
5179        {
5180            match self {
5181                Self::Unspecified => serializer.serialize_i32(0),
5182                Self::PreparingStorageBucket => serializer.serialize_i32(1),
5183                Self::DownloadingBlueprint => serializer.serialize_i32(2),
5184                Self::RunningTfInit => serializer.serialize_i32(3),
5185                Self::RunningTfPlan => serializer.serialize_i32(4),
5186                Self::RunningTfApply => serializer.serialize_i32(5),
5187                Self::RunningTfDestroy => serializer.serialize_i32(6),
5188                Self::RunningTfValidate => serializer.serialize_i32(7),
5189                Self::UnlockingDeployment => serializer.serialize_i32(8),
5190                Self::Succeeded => serializer.serialize_i32(9),
5191                Self::Failed => serializer.serialize_i32(10),
5192                Self::ValidatingRepository => serializer.serialize_i32(11),
5193                Self::RunningQuotaValidation => serializer.serialize_i32(12),
5194                Self::UnknownValue(u) => u.0.serialize(serializer),
5195            }
5196        }
5197    }
5198
5199    impl<'de> serde::de::Deserialize<'de> for DeploymentStep {
5200        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5201        where
5202            D: serde::Deserializer<'de>,
5203        {
5204            deserializer.deserialize_any(wkt::internal::EnumVisitor::<DeploymentStep>::new(
5205                ".google.cloud.config.v1.DeploymentOperationMetadata.DeploymentStep",
5206            ))
5207        }
5208    }
5209}
5210
5211/// Resource represents a Google Cloud Platform resource actuated by IM.
5212/// Resources are child resources of Revisions.
5213#[derive(Clone, Default, PartialEq)]
5214#[non_exhaustive]
5215pub struct Resource {
5216    /// Output only. Resource name.
5217    /// Format:
5218    /// `projects/{project}/locations/{location}/deployments/{deployment}/revisions/{revision}/resources/{resource}`
5219    pub name: std::string::String,
5220
5221    /// Output only. Terraform-specific info if this resource was created using
5222    /// Terraform.
5223    pub terraform_info: std::option::Option<crate::model::ResourceTerraformInfo>,
5224
5225    /// Output only. Map of Cloud Asset Inventory (CAI) type to CAI info (e.g. CAI
5226    /// ID). CAI type format follows
5227    /// <https://cloud.google.com/asset-inventory/docs/supported-asset-types>
5228    pub cai_assets: std::collections::HashMap<std::string::String, crate::model::ResourceCAIInfo>,
5229
5230    /// Output only. Intent of the resource.
5231    pub intent: crate::model::resource::Intent,
5232
5233    /// Output only. Current state of the resource.
5234    pub state: crate::model::resource::State,
5235
5236    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5237}
5238
5239impl Resource {
5240    /// Creates a new default instance.
5241    pub fn new() -> Self {
5242        std::default::Default::default()
5243    }
5244
5245    /// Sets the value of [name][crate::model::Resource::name].
5246    ///
5247    /// # Example
5248    /// ```ignore,no_run
5249    /// # use google_cloud_config_v1::model::Resource;
5250    /// let x = Resource::new().set_name("example");
5251    /// ```
5252    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5253        self.name = v.into();
5254        self
5255    }
5256
5257    /// Sets the value of [terraform_info][crate::model::Resource::terraform_info].
5258    ///
5259    /// # Example
5260    /// ```ignore,no_run
5261    /// # use google_cloud_config_v1::model::Resource;
5262    /// use google_cloud_config_v1::model::ResourceTerraformInfo;
5263    /// let x = Resource::new().set_terraform_info(ResourceTerraformInfo::default()/* use setters */);
5264    /// ```
5265    pub fn set_terraform_info<T>(mut self, v: T) -> Self
5266    where
5267        T: std::convert::Into<crate::model::ResourceTerraformInfo>,
5268    {
5269        self.terraform_info = std::option::Option::Some(v.into());
5270        self
5271    }
5272
5273    /// Sets or clears the value of [terraform_info][crate::model::Resource::terraform_info].
5274    ///
5275    /// # Example
5276    /// ```ignore,no_run
5277    /// # use google_cloud_config_v1::model::Resource;
5278    /// use google_cloud_config_v1::model::ResourceTerraformInfo;
5279    /// let x = Resource::new().set_or_clear_terraform_info(Some(ResourceTerraformInfo::default()/* use setters */));
5280    /// let x = Resource::new().set_or_clear_terraform_info(None::<ResourceTerraformInfo>);
5281    /// ```
5282    pub fn set_or_clear_terraform_info<T>(mut self, v: std::option::Option<T>) -> Self
5283    where
5284        T: std::convert::Into<crate::model::ResourceTerraformInfo>,
5285    {
5286        self.terraform_info = v.map(|x| x.into());
5287        self
5288    }
5289
5290    /// Sets the value of [cai_assets][crate::model::Resource::cai_assets].
5291    ///
5292    /// # Example
5293    /// ```ignore,no_run
5294    /// # use google_cloud_config_v1::model::Resource;
5295    /// use google_cloud_config_v1::model::ResourceCAIInfo;
5296    /// let x = Resource::new().set_cai_assets([
5297    ///     ("key0", ResourceCAIInfo::default()/* use setters */),
5298    ///     ("key1", ResourceCAIInfo::default()/* use (different) setters */),
5299    /// ]);
5300    /// ```
5301    pub fn set_cai_assets<T, K, V>(mut self, v: T) -> Self
5302    where
5303        T: std::iter::IntoIterator<Item = (K, V)>,
5304        K: std::convert::Into<std::string::String>,
5305        V: std::convert::Into<crate::model::ResourceCAIInfo>,
5306    {
5307        use std::iter::Iterator;
5308        self.cai_assets = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5309        self
5310    }
5311
5312    /// Sets the value of [intent][crate::model::Resource::intent].
5313    ///
5314    /// # Example
5315    /// ```ignore,no_run
5316    /// # use google_cloud_config_v1::model::Resource;
5317    /// use google_cloud_config_v1::model::resource::Intent;
5318    /// let x0 = Resource::new().set_intent(Intent::Create);
5319    /// let x1 = Resource::new().set_intent(Intent::Update);
5320    /// let x2 = Resource::new().set_intent(Intent::Delete);
5321    /// ```
5322    pub fn set_intent<T: std::convert::Into<crate::model::resource::Intent>>(
5323        mut self,
5324        v: T,
5325    ) -> Self {
5326        self.intent = v.into();
5327        self
5328    }
5329
5330    /// Sets the value of [state][crate::model::Resource::state].
5331    ///
5332    /// # Example
5333    /// ```ignore,no_run
5334    /// # use google_cloud_config_v1::model::Resource;
5335    /// use google_cloud_config_v1::model::resource::State;
5336    /// let x0 = Resource::new().set_state(State::Planned);
5337    /// let x1 = Resource::new().set_state(State::InProgress);
5338    /// let x2 = Resource::new().set_state(State::Reconciled);
5339    /// ```
5340    pub fn set_state<T: std::convert::Into<crate::model::resource::State>>(mut self, v: T) -> Self {
5341        self.state = v.into();
5342        self
5343    }
5344}
5345
5346impl wkt::message::Message for Resource {
5347    fn typename() -> &'static str {
5348        "type.googleapis.com/google.cloud.config.v1.Resource"
5349    }
5350}
5351
5352/// Defines additional types related to [Resource].
5353pub mod resource {
5354    #[allow(unused_imports)]
5355    use super::*;
5356
5357    /// Possible intent of the resource.
5358    ///
5359    /// # Working with unknown values
5360    ///
5361    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5362    /// additional enum variants at any time. Adding new variants is not considered
5363    /// a breaking change. Applications should write their code in anticipation of:
5364    ///
5365    /// - New values appearing in future releases of the client library, **and**
5366    /// - New values received dynamically, without application changes.
5367    ///
5368    /// Please consult the [Working with enums] section in the user guide for some
5369    /// guidelines.
5370    ///
5371    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
5372    #[derive(Clone, Debug, PartialEq)]
5373    #[non_exhaustive]
5374    pub enum Intent {
5375        /// The default value. This value is used if the intent is omitted.
5376        Unspecified,
5377        /// Infra Manager will create this Resource.
5378        Create,
5379        /// Infra Manager will update this Resource.
5380        Update,
5381        /// Infra Manager will delete this Resource.
5382        Delete,
5383        /// Infra Manager will destroy and recreate this Resource.
5384        Recreate,
5385        /// Infra Manager will leave this Resource untouched.
5386        Unchanged,
5387        /// If set, the enum was initialized with an unknown value.
5388        ///
5389        /// Applications can examine the value using [Intent::value] or
5390        /// [Intent::name].
5391        UnknownValue(intent::UnknownValue),
5392    }
5393
5394    #[doc(hidden)]
5395    pub mod intent {
5396        #[allow(unused_imports)]
5397        use super::*;
5398        #[derive(Clone, Debug, PartialEq)]
5399        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5400    }
5401
5402    impl Intent {
5403        /// Gets the enum value.
5404        ///
5405        /// Returns `None` if the enum contains an unknown value deserialized from
5406        /// the string representation of enums.
5407        pub fn value(&self) -> std::option::Option<i32> {
5408            match self {
5409                Self::Unspecified => std::option::Option::Some(0),
5410                Self::Create => std::option::Option::Some(1),
5411                Self::Update => std::option::Option::Some(2),
5412                Self::Delete => std::option::Option::Some(3),
5413                Self::Recreate => std::option::Option::Some(4),
5414                Self::Unchanged => std::option::Option::Some(5),
5415                Self::UnknownValue(u) => u.0.value(),
5416            }
5417        }
5418
5419        /// Gets the enum value as a string.
5420        ///
5421        /// Returns `None` if the enum contains an unknown value deserialized from
5422        /// the integer representation of enums.
5423        pub fn name(&self) -> std::option::Option<&str> {
5424            match self {
5425                Self::Unspecified => std::option::Option::Some("INTENT_UNSPECIFIED"),
5426                Self::Create => std::option::Option::Some("CREATE"),
5427                Self::Update => std::option::Option::Some("UPDATE"),
5428                Self::Delete => std::option::Option::Some("DELETE"),
5429                Self::Recreate => std::option::Option::Some("RECREATE"),
5430                Self::Unchanged => std::option::Option::Some("UNCHANGED"),
5431                Self::UnknownValue(u) => u.0.name(),
5432            }
5433        }
5434    }
5435
5436    impl std::default::Default for Intent {
5437        fn default() -> Self {
5438            use std::convert::From;
5439            Self::from(0)
5440        }
5441    }
5442
5443    impl std::fmt::Display for Intent {
5444        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5445            wkt::internal::display_enum(f, self.name(), self.value())
5446        }
5447    }
5448
5449    impl std::convert::From<i32> for Intent {
5450        fn from(value: i32) -> Self {
5451            match value {
5452                0 => Self::Unspecified,
5453                1 => Self::Create,
5454                2 => Self::Update,
5455                3 => Self::Delete,
5456                4 => Self::Recreate,
5457                5 => Self::Unchanged,
5458                _ => Self::UnknownValue(intent::UnknownValue(
5459                    wkt::internal::UnknownEnumValue::Integer(value),
5460                )),
5461            }
5462        }
5463    }
5464
5465    impl std::convert::From<&str> for Intent {
5466        fn from(value: &str) -> Self {
5467            use std::string::ToString;
5468            match value {
5469                "INTENT_UNSPECIFIED" => Self::Unspecified,
5470                "CREATE" => Self::Create,
5471                "UPDATE" => Self::Update,
5472                "DELETE" => Self::Delete,
5473                "RECREATE" => Self::Recreate,
5474                "UNCHANGED" => Self::Unchanged,
5475                _ => Self::UnknownValue(intent::UnknownValue(
5476                    wkt::internal::UnknownEnumValue::String(value.to_string()),
5477                )),
5478            }
5479        }
5480    }
5481
5482    impl serde::ser::Serialize for Intent {
5483        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5484        where
5485            S: serde::Serializer,
5486        {
5487            match self {
5488                Self::Unspecified => serializer.serialize_i32(0),
5489                Self::Create => serializer.serialize_i32(1),
5490                Self::Update => serializer.serialize_i32(2),
5491                Self::Delete => serializer.serialize_i32(3),
5492                Self::Recreate => serializer.serialize_i32(4),
5493                Self::Unchanged => serializer.serialize_i32(5),
5494                Self::UnknownValue(u) => u.0.serialize(serializer),
5495            }
5496        }
5497    }
5498
5499    impl<'de> serde::de::Deserialize<'de> for Intent {
5500        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5501        where
5502            D: serde::Deserializer<'de>,
5503        {
5504            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Intent>::new(
5505                ".google.cloud.config.v1.Resource.Intent",
5506            ))
5507        }
5508    }
5509
5510    /// Possible states of a resource.
5511    ///
5512    /// # Working with unknown values
5513    ///
5514    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5515    /// additional enum variants at any time. Adding new variants is not considered
5516    /// a breaking change. Applications should write their code in anticipation of:
5517    ///
5518    /// - New values appearing in future releases of the client library, **and**
5519    /// - New values received dynamically, without application changes.
5520    ///
5521    /// Please consult the [Working with enums] section in the user guide for some
5522    /// guidelines.
5523    ///
5524    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
5525    #[derive(Clone, Debug, PartialEq)]
5526    #[non_exhaustive]
5527    pub enum State {
5528        /// The default value. This value is used if the state is omitted.
5529        Unspecified,
5530        /// Resource has been planned for reconcile.
5531        Planned,
5532        /// Resource is actively reconciling into the intended state.
5533        InProgress,
5534        /// Resource has reconciled to intended state.
5535        Reconciled,
5536        /// Resource failed to reconcile.
5537        Failed,
5538        /// If set, the enum was initialized with an unknown value.
5539        ///
5540        /// Applications can examine the value using [State::value] or
5541        /// [State::name].
5542        UnknownValue(state::UnknownValue),
5543    }
5544
5545    #[doc(hidden)]
5546    pub mod state {
5547        #[allow(unused_imports)]
5548        use super::*;
5549        #[derive(Clone, Debug, PartialEq)]
5550        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5551    }
5552
5553    impl State {
5554        /// Gets the enum value.
5555        ///
5556        /// Returns `None` if the enum contains an unknown value deserialized from
5557        /// the string representation of enums.
5558        pub fn value(&self) -> std::option::Option<i32> {
5559            match self {
5560                Self::Unspecified => std::option::Option::Some(0),
5561                Self::Planned => std::option::Option::Some(1),
5562                Self::InProgress => std::option::Option::Some(2),
5563                Self::Reconciled => std::option::Option::Some(3),
5564                Self::Failed => std::option::Option::Some(4),
5565                Self::UnknownValue(u) => u.0.value(),
5566            }
5567        }
5568
5569        /// Gets the enum value as a string.
5570        ///
5571        /// Returns `None` if the enum contains an unknown value deserialized from
5572        /// the integer representation of enums.
5573        pub fn name(&self) -> std::option::Option<&str> {
5574            match self {
5575                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
5576                Self::Planned => std::option::Option::Some("PLANNED"),
5577                Self::InProgress => std::option::Option::Some("IN_PROGRESS"),
5578                Self::Reconciled => std::option::Option::Some("RECONCILED"),
5579                Self::Failed => std::option::Option::Some("FAILED"),
5580                Self::UnknownValue(u) => u.0.name(),
5581            }
5582        }
5583    }
5584
5585    impl std::default::Default for State {
5586        fn default() -> Self {
5587            use std::convert::From;
5588            Self::from(0)
5589        }
5590    }
5591
5592    impl std::fmt::Display for State {
5593        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5594            wkt::internal::display_enum(f, self.name(), self.value())
5595        }
5596    }
5597
5598    impl std::convert::From<i32> for State {
5599        fn from(value: i32) -> Self {
5600            match value {
5601                0 => Self::Unspecified,
5602                1 => Self::Planned,
5603                2 => Self::InProgress,
5604                3 => Self::Reconciled,
5605                4 => Self::Failed,
5606                _ => Self::UnknownValue(state::UnknownValue(
5607                    wkt::internal::UnknownEnumValue::Integer(value),
5608                )),
5609            }
5610        }
5611    }
5612
5613    impl std::convert::From<&str> for State {
5614        fn from(value: &str) -> Self {
5615            use std::string::ToString;
5616            match value {
5617                "STATE_UNSPECIFIED" => Self::Unspecified,
5618                "PLANNED" => Self::Planned,
5619                "IN_PROGRESS" => Self::InProgress,
5620                "RECONCILED" => Self::Reconciled,
5621                "FAILED" => Self::Failed,
5622                _ => Self::UnknownValue(state::UnknownValue(
5623                    wkt::internal::UnknownEnumValue::String(value.to_string()),
5624                )),
5625            }
5626        }
5627    }
5628
5629    impl serde::ser::Serialize for State {
5630        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5631        where
5632            S: serde::Serializer,
5633        {
5634            match self {
5635                Self::Unspecified => serializer.serialize_i32(0),
5636                Self::Planned => serializer.serialize_i32(1),
5637                Self::InProgress => serializer.serialize_i32(2),
5638                Self::Reconciled => serializer.serialize_i32(3),
5639                Self::Failed => serializer.serialize_i32(4),
5640                Self::UnknownValue(u) => u.0.serialize(serializer),
5641            }
5642        }
5643    }
5644
5645    impl<'de> serde::de::Deserialize<'de> for State {
5646        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5647        where
5648            D: serde::Deserializer<'de>,
5649        {
5650            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
5651                ".google.cloud.config.v1.Resource.State",
5652            ))
5653        }
5654    }
5655}
5656
5657/// Terraform info of a Resource.
5658#[derive(Clone, Default, PartialEq)]
5659#[non_exhaustive]
5660pub struct ResourceTerraformInfo {
5661    /// TF resource address that uniquely identifies this resource within this
5662    /// deployment.
5663    pub address: std::string::String,
5664
5665    /// TF resource type
5666    pub r#type: std::string::String,
5667
5668    /// ID attribute of the TF resource
5669    pub id: std::string::String,
5670
5671    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5672}
5673
5674impl ResourceTerraformInfo {
5675    /// Creates a new default instance.
5676    pub fn new() -> Self {
5677        std::default::Default::default()
5678    }
5679
5680    /// Sets the value of [address][crate::model::ResourceTerraformInfo::address].
5681    ///
5682    /// # Example
5683    /// ```ignore,no_run
5684    /// # use google_cloud_config_v1::model::ResourceTerraformInfo;
5685    /// let x = ResourceTerraformInfo::new().set_address("example");
5686    /// ```
5687    pub fn set_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5688        self.address = v.into();
5689        self
5690    }
5691
5692    /// Sets the value of [r#type][crate::model::ResourceTerraformInfo::type].
5693    ///
5694    /// # Example
5695    /// ```ignore,no_run
5696    /// # use google_cloud_config_v1::model::ResourceTerraformInfo;
5697    /// let x = ResourceTerraformInfo::new().set_type("example");
5698    /// ```
5699    pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5700        self.r#type = v.into();
5701        self
5702    }
5703
5704    /// Sets the value of [id][crate::model::ResourceTerraformInfo::id].
5705    ///
5706    /// # Example
5707    /// ```ignore,no_run
5708    /// # use google_cloud_config_v1::model::ResourceTerraformInfo;
5709    /// let x = ResourceTerraformInfo::new().set_id("example");
5710    /// ```
5711    pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5712        self.id = v.into();
5713        self
5714    }
5715}
5716
5717impl wkt::message::Message for ResourceTerraformInfo {
5718    fn typename() -> &'static str {
5719        "type.googleapis.com/google.cloud.config.v1.ResourceTerraformInfo"
5720    }
5721}
5722
5723/// CAI info of a Resource.
5724#[derive(Clone, Default, PartialEq)]
5725#[non_exhaustive]
5726pub struct ResourceCAIInfo {
5727    /// CAI resource name in the format following
5728    /// <https://cloud.google.com/apis/design/resource_names#full_resource_name>
5729    pub full_resource_name: std::string::String,
5730
5731    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5732}
5733
5734impl ResourceCAIInfo {
5735    /// Creates a new default instance.
5736    pub fn new() -> Self {
5737        std::default::Default::default()
5738    }
5739
5740    /// Sets the value of [full_resource_name][crate::model::ResourceCAIInfo::full_resource_name].
5741    ///
5742    /// # Example
5743    /// ```ignore,no_run
5744    /// # use google_cloud_config_v1::model::ResourceCAIInfo;
5745    /// let x = ResourceCAIInfo::new().set_full_resource_name("example");
5746    /// ```
5747    pub fn set_full_resource_name<T: std::convert::Into<std::string::String>>(
5748        mut self,
5749        v: T,
5750    ) -> Self {
5751        self.full_resource_name = v.into();
5752        self
5753    }
5754}
5755
5756impl wkt::message::Message for ResourceCAIInfo {
5757    fn typename() -> &'static str {
5758        "type.googleapis.com/google.cloud.config.v1.ResourceCAIInfo"
5759    }
5760}
5761
5762/// A request to get a Resource from a 'GetResource' call.
5763#[derive(Clone, Default, PartialEq)]
5764#[non_exhaustive]
5765pub struct GetResourceRequest {
5766    /// Required. The name of the Resource in the format:
5767    /// 'projects/{project_id}/locations/{location}/deployments/{deployment}/revisions/{revision}/resource/{resource}'.
5768    pub name: std::string::String,
5769
5770    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5771}
5772
5773impl GetResourceRequest {
5774    /// Creates a new default instance.
5775    pub fn new() -> Self {
5776        std::default::Default::default()
5777    }
5778
5779    /// Sets the value of [name][crate::model::GetResourceRequest::name].
5780    ///
5781    /// # Example
5782    /// ```ignore,no_run
5783    /// # use google_cloud_config_v1::model::GetResourceRequest;
5784    /// let x = GetResourceRequest::new().set_name("example");
5785    /// ```
5786    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5787        self.name = v.into();
5788        self
5789    }
5790}
5791
5792impl wkt::message::Message for GetResourceRequest {
5793    fn typename() -> &'static str {
5794        "type.googleapis.com/google.cloud.config.v1.GetResourceRequest"
5795    }
5796}
5797
5798/// A request to list Resources passed to a 'ListResources' call.
5799#[derive(Clone, Default, PartialEq)]
5800#[non_exhaustive]
5801pub struct ListResourcesRequest {
5802    /// Required. The parent in whose context the Resources are listed. The parent
5803    /// value is in the format:
5804    /// 'projects/{project_id}/locations/{location}/deployments/{deployment}/revisions/{revision}'.
5805    pub parent: std::string::String,
5806
5807    /// When requesting a page of resources, 'page_size' specifies number of
5808    /// resources to return. If unspecified, at most 500 will be returned. The
5809    /// maximum value is 1000.
5810    pub page_size: i32,
5811
5812    /// Token returned by previous call to 'ListResources' which specifies the
5813    /// position in the list from where to continue listing the resources.
5814    pub page_token: std::string::String,
5815
5816    /// Lists the Resources that match the filter expression. A filter
5817    /// expression filters the resources listed in the response. The expression
5818    /// must be of the form '{field} {operator} {value}' where operators: '<', '>',
5819    /// '<=',
5820    /// '>=',
5821    /// '!=', '=', ':' are supported (colon ':' represents a HAS operator which is
5822    /// roughly synonymous with equality). {field} can refer to a proto or JSON
5823    /// field, or a synthetic field. Field names can be camelCase or snake_case.
5824    ///
5825    /// Examples:
5826    ///
5827    /// - Filter by name:
5828    ///   name =
5829    ///   "projects/foo/locations/us-central1/deployments/dep/revisions/bar/resources/baz
5830    pub filter: std::string::String,
5831
5832    /// Field to use to sort the list.
5833    pub order_by: std::string::String,
5834
5835    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5836}
5837
5838impl ListResourcesRequest {
5839    /// Creates a new default instance.
5840    pub fn new() -> Self {
5841        std::default::Default::default()
5842    }
5843
5844    /// Sets the value of [parent][crate::model::ListResourcesRequest::parent].
5845    ///
5846    /// # Example
5847    /// ```ignore,no_run
5848    /// # use google_cloud_config_v1::model::ListResourcesRequest;
5849    /// let x = ListResourcesRequest::new().set_parent("example");
5850    /// ```
5851    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5852        self.parent = v.into();
5853        self
5854    }
5855
5856    /// Sets the value of [page_size][crate::model::ListResourcesRequest::page_size].
5857    ///
5858    /// # Example
5859    /// ```ignore,no_run
5860    /// # use google_cloud_config_v1::model::ListResourcesRequest;
5861    /// let x = ListResourcesRequest::new().set_page_size(42);
5862    /// ```
5863    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5864        self.page_size = v.into();
5865        self
5866    }
5867
5868    /// Sets the value of [page_token][crate::model::ListResourcesRequest::page_token].
5869    ///
5870    /// # Example
5871    /// ```ignore,no_run
5872    /// # use google_cloud_config_v1::model::ListResourcesRequest;
5873    /// let x = ListResourcesRequest::new().set_page_token("example");
5874    /// ```
5875    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5876        self.page_token = v.into();
5877        self
5878    }
5879
5880    /// Sets the value of [filter][crate::model::ListResourcesRequest::filter].
5881    ///
5882    /// # Example
5883    /// ```ignore,no_run
5884    /// # use google_cloud_config_v1::model::ListResourcesRequest;
5885    /// let x = ListResourcesRequest::new().set_filter("example");
5886    /// ```
5887    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5888        self.filter = v.into();
5889        self
5890    }
5891
5892    /// Sets the value of [order_by][crate::model::ListResourcesRequest::order_by].
5893    ///
5894    /// # Example
5895    /// ```ignore,no_run
5896    /// # use google_cloud_config_v1::model::ListResourcesRequest;
5897    /// let x = ListResourcesRequest::new().set_order_by("example");
5898    /// ```
5899    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5900        self.order_by = v.into();
5901        self
5902    }
5903}
5904
5905impl wkt::message::Message for ListResourcesRequest {
5906    fn typename() -> &'static str {
5907        "type.googleapis.com/google.cloud.config.v1.ListResourcesRequest"
5908    }
5909}
5910
5911/// A response to a 'ListResources' call. Contains a list of Resources.
5912#[derive(Clone, Default, PartialEq)]
5913#[non_exhaustive]
5914pub struct ListResourcesResponse {
5915    /// List of [Resources][google.cloud.config.v1.Resource].
5916    ///
5917    /// [google.cloud.config.v1.Resource]: crate::model::Resource
5918    pub resources: std::vec::Vec<crate::model::Resource>,
5919
5920    /// A token to request the next page of resources from the 'ListResources'
5921    /// method. The value of an empty string means that there are no more resources
5922    /// to return.
5923    pub next_page_token: std::string::String,
5924
5925    /// Locations that could not be reached.
5926    pub unreachable: std::vec::Vec<std::string::String>,
5927
5928    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5929}
5930
5931impl ListResourcesResponse {
5932    /// Creates a new default instance.
5933    pub fn new() -> Self {
5934        std::default::Default::default()
5935    }
5936
5937    /// Sets the value of [resources][crate::model::ListResourcesResponse::resources].
5938    ///
5939    /// # Example
5940    /// ```ignore,no_run
5941    /// # use google_cloud_config_v1::model::ListResourcesResponse;
5942    /// use google_cloud_config_v1::model::Resource;
5943    /// let x = ListResourcesResponse::new()
5944    ///     .set_resources([
5945    ///         Resource::default()/* use setters */,
5946    ///         Resource::default()/* use (different) setters */,
5947    ///     ]);
5948    /// ```
5949    pub fn set_resources<T, V>(mut self, v: T) -> Self
5950    where
5951        T: std::iter::IntoIterator<Item = V>,
5952        V: std::convert::Into<crate::model::Resource>,
5953    {
5954        use std::iter::Iterator;
5955        self.resources = v.into_iter().map(|i| i.into()).collect();
5956        self
5957    }
5958
5959    /// Sets the value of [next_page_token][crate::model::ListResourcesResponse::next_page_token].
5960    ///
5961    /// # Example
5962    /// ```ignore,no_run
5963    /// # use google_cloud_config_v1::model::ListResourcesResponse;
5964    /// let x = ListResourcesResponse::new().set_next_page_token("example");
5965    /// ```
5966    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5967        self.next_page_token = v.into();
5968        self
5969    }
5970
5971    /// Sets the value of [unreachable][crate::model::ListResourcesResponse::unreachable].
5972    ///
5973    /// # Example
5974    /// ```ignore,no_run
5975    /// # use google_cloud_config_v1::model::ListResourcesResponse;
5976    /// let x = ListResourcesResponse::new().set_unreachable(["a", "b", "c"]);
5977    /// ```
5978    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
5979    where
5980        T: std::iter::IntoIterator<Item = V>,
5981        V: std::convert::Into<std::string::String>,
5982    {
5983        use std::iter::Iterator;
5984        self.unreachable = v.into_iter().map(|i| i.into()).collect();
5985        self
5986    }
5987}
5988
5989impl wkt::message::Message for ListResourcesResponse {
5990    fn typename() -> &'static str {
5991        "type.googleapis.com/google.cloud.config.v1.ListResourcesResponse"
5992    }
5993}
5994
5995#[doc(hidden)]
5996impl google_cloud_gax::paginator::internal::PageableResponse for ListResourcesResponse {
5997    type PageItem = crate::model::Resource;
5998
5999    fn items(self) -> std::vec::Vec<Self::PageItem> {
6000        self.resources
6001    }
6002
6003    fn next_page_token(&self) -> std::string::String {
6004        use std::clone::Clone;
6005        self.next_page_token.clone()
6006    }
6007}
6008
6009/// Contains info about a Terraform state file
6010#[derive(Clone, Default, PartialEq)]
6011#[non_exhaustive]
6012pub struct Statefile {
6013    /// Output only. Cloud Storage signed URI used for downloading or uploading the
6014    /// state file.
6015    pub signed_uri: std::string::String,
6016
6017    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6018}
6019
6020impl Statefile {
6021    /// Creates a new default instance.
6022    pub fn new() -> Self {
6023        std::default::Default::default()
6024    }
6025
6026    /// Sets the value of [signed_uri][crate::model::Statefile::signed_uri].
6027    ///
6028    /// # Example
6029    /// ```ignore,no_run
6030    /// # use google_cloud_config_v1::model::Statefile;
6031    /// let x = Statefile::new().set_signed_uri("example");
6032    /// ```
6033    pub fn set_signed_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6034        self.signed_uri = v.into();
6035        self
6036    }
6037}
6038
6039impl wkt::message::Message for Statefile {
6040    fn typename() -> &'static str {
6041        "type.googleapis.com/google.cloud.config.v1.Statefile"
6042    }
6043}
6044
6045/// A request to export a state file passed to a 'ExportDeploymentStatefile'
6046/// call.
6047#[derive(Clone, Default, PartialEq)]
6048#[non_exhaustive]
6049pub struct ExportDeploymentStatefileRequest {
6050    /// Required. The parent in whose context the statefile is listed. The parent
6051    /// value is in the format:
6052    /// 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
6053    pub parent: std::string::String,
6054
6055    /// Optional. If this flag is set to true, the exported deployment state file
6056    /// will be the draft state. This will enable the draft file to be validated
6057    /// before copying it over to the working state on unlock.
6058    pub draft: bool,
6059
6060    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6061}
6062
6063impl ExportDeploymentStatefileRequest {
6064    /// Creates a new default instance.
6065    pub fn new() -> Self {
6066        std::default::Default::default()
6067    }
6068
6069    /// Sets the value of [parent][crate::model::ExportDeploymentStatefileRequest::parent].
6070    ///
6071    /// # Example
6072    /// ```ignore,no_run
6073    /// # use google_cloud_config_v1::model::ExportDeploymentStatefileRequest;
6074    /// let x = ExportDeploymentStatefileRequest::new().set_parent("example");
6075    /// ```
6076    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6077        self.parent = v.into();
6078        self
6079    }
6080
6081    /// Sets the value of [draft][crate::model::ExportDeploymentStatefileRequest::draft].
6082    ///
6083    /// # Example
6084    /// ```ignore,no_run
6085    /// # use google_cloud_config_v1::model::ExportDeploymentStatefileRequest;
6086    /// let x = ExportDeploymentStatefileRequest::new().set_draft(true);
6087    /// ```
6088    pub fn set_draft<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6089        self.draft = v.into();
6090        self
6091    }
6092}
6093
6094impl wkt::message::Message for ExportDeploymentStatefileRequest {
6095    fn typename() -> &'static str {
6096        "type.googleapis.com/google.cloud.config.v1.ExportDeploymentStatefileRequest"
6097    }
6098}
6099
6100/// A request to export a state file passed to a 'ExportRevisionStatefile'
6101/// call.
6102#[derive(Clone, Default, PartialEq)]
6103#[non_exhaustive]
6104pub struct ExportRevisionStatefileRequest {
6105    /// Required. The parent in whose context the statefile is listed. The parent
6106    /// value is in the format:
6107    /// 'projects/{project_id}/locations/{location}/deployments/{deployment}/revisions/{revision}'.
6108    pub parent: std::string::String,
6109
6110    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6111}
6112
6113impl ExportRevisionStatefileRequest {
6114    /// Creates a new default instance.
6115    pub fn new() -> Self {
6116        std::default::Default::default()
6117    }
6118
6119    /// Sets the value of [parent][crate::model::ExportRevisionStatefileRequest::parent].
6120    ///
6121    /// # Example
6122    /// ```ignore,no_run
6123    /// # use google_cloud_config_v1::model::ExportRevisionStatefileRequest;
6124    /// let x = ExportRevisionStatefileRequest::new().set_parent("example");
6125    /// ```
6126    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6127        self.parent = v.into();
6128        self
6129    }
6130}
6131
6132impl wkt::message::Message for ExportRevisionStatefileRequest {
6133    fn typename() -> &'static str {
6134        "type.googleapis.com/google.cloud.config.v1.ExportRevisionStatefileRequest"
6135    }
6136}
6137
6138/// A request to import a state file passed to a 'ImportStatefile' call.
6139#[derive(Clone, Default, PartialEq)]
6140#[non_exhaustive]
6141pub struct ImportStatefileRequest {
6142    /// Required. The parent in whose context the statefile is listed. The parent
6143    /// value is in the format:
6144    /// 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
6145    pub parent: std::string::String,
6146
6147    /// Required. Lock ID of the lock file to verify that the user who is importing
6148    /// the state file previously locked the Deployment.
6149    pub lock_id: i64,
6150
6151    /// Optional.
6152    pub skip_draft: bool,
6153
6154    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6155}
6156
6157impl ImportStatefileRequest {
6158    /// Creates a new default instance.
6159    pub fn new() -> Self {
6160        std::default::Default::default()
6161    }
6162
6163    /// Sets the value of [parent][crate::model::ImportStatefileRequest::parent].
6164    ///
6165    /// # Example
6166    /// ```ignore,no_run
6167    /// # use google_cloud_config_v1::model::ImportStatefileRequest;
6168    /// let x = ImportStatefileRequest::new().set_parent("example");
6169    /// ```
6170    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6171        self.parent = v.into();
6172        self
6173    }
6174
6175    /// Sets the value of [lock_id][crate::model::ImportStatefileRequest::lock_id].
6176    ///
6177    /// # Example
6178    /// ```ignore,no_run
6179    /// # use google_cloud_config_v1::model::ImportStatefileRequest;
6180    /// let x = ImportStatefileRequest::new().set_lock_id(42);
6181    /// ```
6182    pub fn set_lock_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
6183        self.lock_id = v.into();
6184        self
6185    }
6186
6187    /// Sets the value of [skip_draft][crate::model::ImportStatefileRequest::skip_draft].
6188    ///
6189    /// # Example
6190    /// ```ignore,no_run
6191    /// # use google_cloud_config_v1::model::ImportStatefileRequest;
6192    /// let x = ImportStatefileRequest::new().set_skip_draft(true);
6193    /// ```
6194    pub fn set_skip_draft<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6195        self.skip_draft = v.into();
6196        self
6197    }
6198}
6199
6200impl wkt::message::Message for ImportStatefileRequest {
6201    fn typename() -> &'static str {
6202        "type.googleapis.com/google.cloud.config.v1.ImportStatefileRequest"
6203    }
6204}
6205
6206/// A request to delete a state file passed to a 'DeleteStatefile' call.
6207#[derive(Clone, Default, PartialEq)]
6208#[non_exhaustive]
6209pub struct DeleteStatefileRequest {
6210    /// Required. The name of the deployment in the format:
6211    /// 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
6212    pub name: std::string::String,
6213
6214    /// Required. Lock ID of the lock file to verify that the user who is deleting
6215    /// the state file previously locked the Deployment.
6216    pub lock_id: i64,
6217
6218    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6219}
6220
6221impl DeleteStatefileRequest {
6222    /// Creates a new default instance.
6223    pub fn new() -> Self {
6224        std::default::Default::default()
6225    }
6226
6227    /// Sets the value of [name][crate::model::DeleteStatefileRequest::name].
6228    ///
6229    /// # Example
6230    /// ```ignore,no_run
6231    /// # use google_cloud_config_v1::model::DeleteStatefileRequest;
6232    /// let x = DeleteStatefileRequest::new().set_name("example");
6233    /// ```
6234    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6235        self.name = v.into();
6236        self
6237    }
6238
6239    /// Sets the value of [lock_id][crate::model::DeleteStatefileRequest::lock_id].
6240    ///
6241    /// # Example
6242    /// ```ignore,no_run
6243    /// # use google_cloud_config_v1::model::DeleteStatefileRequest;
6244    /// let x = DeleteStatefileRequest::new().set_lock_id(42);
6245    /// ```
6246    pub fn set_lock_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
6247        self.lock_id = v.into();
6248        self
6249    }
6250}
6251
6252impl wkt::message::Message for DeleteStatefileRequest {
6253    fn typename() -> &'static str {
6254        "type.googleapis.com/google.cloud.config.v1.DeleteStatefileRequest"
6255    }
6256}
6257
6258/// A request to lock a deployment passed to a 'LockDeployment' call.
6259#[derive(Clone, Default, PartialEq)]
6260#[non_exhaustive]
6261pub struct LockDeploymentRequest {
6262    /// Required. The name of the deployment in the format:
6263    /// 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
6264    pub name: std::string::String,
6265
6266    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6267}
6268
6269impl LockDeploymentRequest {
6270    /// Creates a new default instance.
6271    pub fn new() -> Self {
6272        std::default::Default::default()
6273    }
6274
6275    /// Sets the value of [name][crate::model::LockDeploymentRequest::name].
6276    ///
6277    /// # Example
6278    /// ```ignore,no_run
6279    /// # use google_cloud_config_v1::model::LockDeploymentRequest;
6280    /// let x = LockDeploymentRequest::new().set_name("example");
6281    /// ```
6282    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6283        self.name = v.into();
6284        self
6285    }
6286}
6287
6288impl wkt::message::Message for LockDeploymentRequest {
6289    fn typename() -> &'static str {
6290        "type.googleapis.com/google.cloud.config.v1.LockDeploymentRequest"
6291    }
6292}
6293
6294/// A request to unlock a state file passed to a 'UnlockDeployment' call.
6295#[derive(Clone, Default, PartialEq)]
6296#[non_exhaustive]
6297pub struct UnlockDeploymentRequest {
6298    /// Required. The name of the deployment in the format:
6299    /// 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
6300    pub name: std::string::String,
6301
6302    /// Required. Lock ID of the lock file to be unlocked.
6303    pub lock_id: i64,
6304
6305    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6306}
6307
6308impl UnlockDeploymentRequest {
6309    /// Creates a new default instance.
6310    pub fn new() -> Self {
6311        std::default::Default::default()
6312    }
6313
6314    /// Sets the value of [name][crate::model::UnlockDeploymentRequest::name].
6315    ///
6316    /// # Example
6317    /// ```ignore,no_run
6318    /// # use google_cloud_config_v1::model::UnlockDeploymentRequest;
6319    /// let x = UnlockDeploymentRequest::new().set_name("example");
6320    /// ```
6321    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6322        self.name = v.into();
6323        self
6324    }
6325
6326    /// Sets the value of [lock_id][crate::model::UnlockDeploymentRequest::lock_id].
6327    ///
6328    /// # Example
6329    /// ```ignore,no_run
6330    /// # use google_cloud_config_v1::model::UnlockDeploymentRequest;
6331    /// let x = UnlockDeploymentRequest::new().set_lock_id(42);
6332    /// ```
6333    pub fn set_lock_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
6334        self.lock_id = v.into();
6335        self
6336    }
6337}
6338
6339impl wkt::message::Message for UnlockDeploymentRequest {
6340    fn typename() -> &'static str {
6341        "type.googleapis.com/google.cloud.config.v1.UnlockDeploymentRequest"
6342    }
6343}
6344
6345/// A request to get a state file lock info passed to a 'ExportLockInfo' call.
6346#[derive(Clone, Default, PartialEq)]
6347#[non_exhaustive]
6348pub struct ExportLockInfoRequest {
6349    /// Required. The name of the deployment in the format:
6350    /// 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
6351    pub name: std::string::String,
6352
6353    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6354}
6355
6356impl ExportLockInfoRequest {
6357    /// Creates a new default instance.
6358    pub fn new() -> Self {
6359        std::default::Default::default()
6360    }
6361
6362    /// Sets the value of [name][crate::model::ExportLockInfoRequest::name].
6363    ///
6364    /// # Example
6365    /// ```ignore,no_run
6366    /// # use google_cloud_config_v1::model::ExportLockInfoRequest;
6367    /// let x = ExportLockInfoRequest::new().set_name("example");
6368    /// ```
6369    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6370        self.name = v.into();
6371        self
6372    }
6373}
6374
6375impl wkt::message::Message for ExportLockInfoRequest {
6376    fn typename() -> &'static str {
6377        "type.googleapis.com/google.cloud.config.v1.ExportLockInfoRequest"
6378    }
6379}
6380
6381/// Details about the lock which locked the deployment.
6382#[derive(Clone, Default, PartialEq)]
6383#[non_exhaustive]
6384pub struct LockInfo {
6385    /// Unique ID for the lock to be overridden with generation ID in the backend.
6386    pub lock_id: i64,
6387
6388    /// Terraform operation, provided by the caller.
6389    pub operation: std::string::String,
6390
6391    /// Extra information to store with the lock, provided by the caller.
6392    pub info: std::string::String,
6393
6394    /// user@hostname when available
6395    pub who: std::string::String,
6396
6397    /// Terraform version
6398    pub version: std::string::String,
6399
6400    /// Time that the lock was taken.
6401    pub create_time: std::option::Option<wkt::Timestamp>,
6402
6403    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6404}
6405
6406impl LockInfo {
6407    /// Creates a new default instance.
6408    pub fn new() -> Self {
6409        std::default::Default::default()
6410    }
6411
6412    /// Sets the value of [lock_id][crate::model::LockInfo::lock_id].
6413    ///
6414    /// # Example
6415    /// ```ignore,no_run
6416    /// # use google_cloud_config_v1::model::LockInfo;
6417    /// let x = LockInfo::new().set_lock_id(42);
6418    /// ```
6419    pub fn set_lock_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
6420        self.lock_id = v.into();
6421        self
6422    }
6423
6424    /// Sets the value of [operation][crate::model::LockInfo::operation].
6425    ///
6426    /// # Example
6427    /// ```ignore,no_run
6428    /// # use google_cloud_config_v1::model::LockInfo;
6429    /// let x = LockInfo::new().set_operation("example");
6430    /// ```
6431    pub fn set_operation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6432        self.operation = v.into();
6433        self
6434    }
6435
6436    /// Sets the value of [info][crate::model::LockInfo::info].
6437    ///
6438    /// # Example
6439    /// ```ignore,no_run
6440    /// # use google_cloud_config_v1::model::LockInfo;
6441    /// let x = LockInfo::new().set_info("example");
6442    /// ```
6443    pub fn set_info<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6444        self.info = v.into();
6445        self
6446    }
6447
6448    /// Sets the value of [who][crate::model::LockInfo::who].
6449    ///
6450    /// # Example
6451    /// ```ignore,no_run
6452    /// # use google_cloud_config_v1::model::LockInfo;
6453    /// let x = LockInfo::new().set_who("example");
6454    /// ```
6455    pub fn set_who<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6456        self.who = v.into();
6457        self
6458    }
6459
6460    /// Sets the value of [version][crate::model::LockInfo::version].
6461    ///
6462    /// # Example
6463    /// ```ignore,no_run
6464    /// # use google_cloud_config_v1::model::LockInfo;
6465    /// let x = LockInfo::new().set_version("example");
6466    /// ```
6467    pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6468        self.version = v.into();
6469        self
6470    }
6471
6472    /// Sets the value of [create_time][crate::model::LockInfo::create_time].
6473    ///
6474    /// # Example
6475    /// ```ignore,no_run
6476    /// # use google_cloud_config_v1::model::LockInfo;
6477    /// use wkt::Timestamp;
6478    /// let x = LockInfo::new().set_create_time(Timestamp::default()/* use setters */);
6479    /// ```
6480    pub fn set_create_time<T>(mut self, v: T) -> Self
6481    where
6482        T: std::convert::Into<wkt::Timestamp>,
6483    {
6484        self.create_time = std::option::Option::Some(v.into());
6485        self
6486    }
6487
6488    /// Sets or clears the value of [create_time][crate::model::LockInfo::create_time].
6489    ///
6490    /// # Example
6491    /// ```ignore,no_run
6492    /// # use google_cloud_config_v1::model::LockInfo;
6493    /// use wkt::Timestamp;
6494    /// let x = LockInfo::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
6495    /// let x = LockInfo::new().set_or_clear_create_time(None::<Timestamp>);
6496    /// ```
6497    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
6498    where
6499        T: std::convert::Into<wkt::Timestamp>,
6500    {
6501        self.create_time = v.map(|x| x.into());
6502        self
6503    }
6504}
6505
6506impl wkt::message::Message for LockInfo {
6507    fn typename() -> &'static str {
6508        "type.googleapis.com/google.cloud.config.v1.LockInfo"
6509    }
6510}
6511
6512/// A preview represents a set of actions Infra Manager would perform
6513/// to move the resources towards the desired state as specified in the
6514/// configuration.
6515#[derive(Clone, Default, PartialEq)]
6516#[non_exhaustive]
6517pub struct Preview {
6518    /// Identifier. Resource name of the preview. Resource name can be user
6519    /// provided or server generated ID if unspecified. Format:
6520    /// `projects/{project}/locations/{location}/previews/{preview}`
6521    pub name: std::string::String,
6522
6523    /// Output only. Time the preview was created.
6524    pub create_time: std::option::Option<wkt::Timestamp>,
6525
6526    /// Optional. User-defined labels for the preview.
6527    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
6528
6529    /// Output only. Current state of the preview.
6530    pub state: crate::model::preview::State,
6531
6532    /// Optional. Optional deployment reference. If specified, the preview will be
6533    /// performed using the provided deployment's current state and use any
6534    /// relevant fields from the deployment unless explicitly specified in the
6535    /// preview create request.
6536    pub deployment: std::string::String,
6537
6538    /// Optional. Current mode of preview.
6539    pub preview_mode: crate::model::preview::PreviewMode,
6540
6541    /// Required. User-specified Service Account (SA) credentials to be used when
6542    /// previewing resources.
6543    /// Format: `projects/{projectID}/serviceAccounts/{serviceAccount}`
6544    pub service_account: std::string::String,
6545
6546    /// Optional. User-defined location of Cloud Build logs, artifacts, and
6547    /// in Google Cloud Storage.
6548    /// Format: `gs://{bucket}/{folder}`
6549    /// A default bucket will be bootstrapped if the field is not set or empty
6550    /// Default Bucket Format: `gs://<project number>-<region>-blueprint-config`
6551    /// Constraints:
6552    ///
6553    /// - The bucket needs to be in the same project as the deployment
6554    /// - The path cannot be within the path of `gcs_source`
6555    ///   If omitted and deployment resource ref provided has artifacts_gcs_bucket
6556    ///   defined, that artifact bucket is used.
6557    pub artifacts_gcs_bucket: std::option::Option<std::string::String>,
6558
6559    /// Optional. The user-specified Worker Pool resource in which the Cloud Build
6560    /// job will execute. Format
6561    /// projects/{project}/locations/{location}/workerPools/{workerPoolId} If this
6562    /// field is unspecified, the default Cloud Build worker pool will be used. If
6563    /// omitted and deployment resource ref provided has worker_pool defined, that
6564    /// worker pool is used.
6565    pub worker_pool: std::option::Option<std::string::String>,
6566
6567    /// Output only. Code describing any errors that may have occurred.
6568    pub error_code: crate::model::preview::ErrorCode,
6569
6570    /// Output only. Additional information regarding the current state.
6571    pub error_status: std::option::Option<google_cloud_rpc::model::Status>,
6572
6573    /// Output only. Cloud Build instance UUID associated with this preview.
6574    pub build: std::string::String,
6575
6576    /// Output only. Summary of errors encountered during Terraform preview.
6577    /// It has a size limit of 10, i.e. only top 10 errors will be summarized here.
6578    pub tf_errors: std::vec::Vec<crate::model::TerraformError>,
6579
6580    /// Output only. Link to tf-error.ndjson file, which contains the full list of
6581    /// the errors encountered during a Terraform preview.
6582    /// Format: `gs://{bucket}/{object}`.
6583    pub error_logs: std::string::String,
6584
6585    /// Output only. Artifacts from preview.
6586    pub preview_artifacts: std::option::Option<crate::model::PreviewArtifacts>,
6587
6588    /// Output only. Location of preview logs in `gs://{bucket}/{object}` format.
6589    pub logs: std::string::String,
6590
6591    /// Output only. The current Terraform version set on the preview.
6592    /// It is in the format of "Major.Minor.Patch", for example, "1.3.10".
6593    pub tf_version: std::string::String,
6594
6595    /// Optional. The user-specified Terraform version constraint.
6596    /// Example: "=1.3.10".
6597    pub tf_version_constraint: std::option::Option<std::string::String>,
6598
6599    /// Optional. Arbitrary key-value metadata storage e.g. to help client tools
6600    /// identify preview during automation. See
6601    /// <https://google.aip.dev/148#annotations> for details on format and size
6602    /// limitations.
6603    pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
6604
6605    /// Optional. This field specifies the provider configurations.
6606    pub provider_config: std::option::Option<crate::model::ProviderConfig>,
6607
6608    /// Blueprint to preview.
6609    pub blueprint: std::option::Option<crate::model::preview::Blueprint>,
6610
6611    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6612}
6613
6614impl Preview {
6615    /// Creates a new default instance.
6616    pub fn new() -> Self {
6617        std::default::Default::default()
6618    }
6619
6620    /// Sets the value of [name][crate::model::Preview::name].
6621    ///
6622    /// # Example
6623    /// ```ignore,no_run
6624    /// # use google_cloud_config_v1::model::Preview;
6625    /// let x = Preview::new().set_name("example");
6626    /// ```
6627    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6628        self.name = v.into();
6629        self
6630    }
6631
6632    /// Sets the value of [create_time][crate::model::Preview::create_time].
6633    ///
6634    /// # Example
6635    /// ```ignore,no_run
6636    /// # use google_cloud_config_v1::model::Preview;
6637    /// use wkt::Timestamp;
6638    /// let x = Preview::new().set_create_time(Timestamp::default()/* use setters */);
6639    /// ```
6640    pub fn set_create_time<T>(mut self, v: T) -> Self
6641    where
6642        T: std::convert::Into<wkt::Timestamp>,
6643    {
6644        self.create_time = std::option::Option::Some(v.into());
6645        self
6646    }
6647
6648    /// Sets or clears the value of [create_time][crate::model::Preview::create_time].
6649    ///
6650    /// # Example
6651    /// ```ignore,no_run
6652    /// # use google_cloud_config_v1::model::Preview;
6653    /// use wkt::Timestamp;
6654    /// let x = Preview::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
6655    /// let x = Preview::new().set_or_clear_create_time(None::<Timestamp>);
6656    /// ```
6657    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
6658    where
6659        T: std::convert::Into<wkt::Timestamp>,
6660    {
6661        self.create_time = v.map(|x| x.into());
6662        self
6663    }
6664
6665    /// Sets the value of [labels][crate::model::Preview::labels].
6666    ///
6667    /// # Example
6668    /// ```ignore,no_run
6669    /// # use google_cloud_config_v1::model::Preview;
6670    /// let x = Preview::new().set_labels([
6671    ///     ("key0", "abc"),
6672    ///     ("key1", "xyz"),
6673    /// ]);
6674    /// ```
6675    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
6676    where
6677        T: std::iter::IntoIterator<Item = (K, V)>,
6678        K: std::convert::Into<std::string::String>,
6679        V: std::convert::Into<std::string::String>,
6680    {
6681        use std::iter::Iterator;
6682        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
6683        self
6684    }
6685
6686    /// Sets the value of [state][crate::model::Preview::state].
6687    ///
6688    /// # Example
6689    /// ```ignore,no_run
6690    /// # use google_cloud_config_v1::model::Preview;
6691    /// use google_cloud_config_v1::model::preview::State;
6692    /// let x0 = Preview::new().set_state(State::Creating);
6693    /// let x1 = Preview::new().set_state(State::Succeeded);
6694    /// let x2 = Preview::new().set_state(State::Applying);
6695    /// ```
6696    pub fn set_state<T: std::convert::Into<crate::model::preview::State>>(mut self, v: T) -> Self {
6697        self.state = v.into();
6698        self
6699    }
6700
6701    /// Sets the value of [deployment][crate::model::Preview::deployment].
6702    ///
6703    /// # Example
6704    /// ```ignore,no_run
6705    /// # use google_cloud_config_v1::model::Preview;
6706    /// let x = Preview::new().set_deployment("example");
6707    /// ```
6708    pub fn set_deployment<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6709        self.deployment = v.into();
6710        self
6711    }
6712
6713    /// Sets the value of [preview_mode][crate::model::Preview::preview_mode].
6714    ///
6715    /// # Example
6716    /// ```ignore,no_run
6717    /// # use google_cloud_config_v1::model::Preview;
6718    /// use google_cloud_config_v1::model::preview::PreviewMode;
6719    /// let x0 = Preview::new().set_preview_mode(PreviewMode::Default);
6720    /// let x1 = Preview::new().set_preview_mode(PreviewMode::Delete);
6721    /// ```
6722    pub fn set_preview_mode<T: std::convert::Into<crate::model::preview::PreviewMode>>(
6723        mut self,
6724        v: T,
6725    ) -> Self {
6726        self.preview_mode = v.into();
6727        self
6728    }
6729
6730    /// Sets the value of [service_account][crate::model::Preview::service_account].
6731    ///
6732    /// # Example
6733    /// ```ignore,no_run
6734    /// # use google_cloud_config_v1::model::Preview;
6735    /// let x = Preview::new().set_service_account("example");
6736    /// ```
6737    pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6738        self.service_account = v.into();
6739        self
6740    }
6741
6742    /// Sets the value of [artifacts_gcs_bucket][crate::model::Preview::artifacts_gcs_bucket].
6743    ///
6744    /// # Example
6745    /// ```ignore,no_run
6746    /// # use google_cloud_config_v1::model::Preview;
6747    /// let x = Preview::new().set_artifacts_gcs_bucket("example");
6748    /// ```
6749    pub fn set_artifacts_gcs_bucket<T>(mut self, v: T) -> Self
6750    where
6751        T: std::convert::Into<std::string::String>,
6752    {
6753        self.artifacts_gcs_bucket = std::option::Option::Some(v.into());
6754        self
6755    }
6756
6757    /// Sets or clears the value of [artifacts_gcs_bucket][crate::model::Preview::artifacts_gcs_bucket].
6758    ///
6759    /// # Example
6760    /// ```ignore,no_run
6761    /// # use google_cloud_config_v1::model::Preview;
6762    /// let x = Preview::new().set_or_clear_artifacts_gcs_bucket(Some("example"));
6763    /// let x = Preview::new().set_or_clear_artifacts_gcs_bucket(None::<String>);
6764    /// ```
6765    pub fn set_or_clear_artifacts_gcs_bucket<T>(mut self, v: std::option::Option<T>) -> Self
6766    where
6767        T: std::convert::Into<std::string::String>,
6768    {
6769        self.artifacts_gcs_bucket = v.map(|x| x.into());
6770        self
6771    }
6772
6773    /// Sets the value of [worker_pool][crate::model::Preview::worker_pool].
6774    ///
6775    /// # Example
6776    /// ```ignore,no_run
6777    /// # use google_cloud_config_v1::model::Preview;
6778    /// let x = Preview::new().set_worker_pool("example");
6779    /// ```
6780    pub fn set_worker_pool<T>(mut self, v: T) -> Self
6781    where
6782        T: std::convert::Into<std::string::String>,
6783    {
6784        self.worker_pool = std::option::Option::Some(v.into());
6785        self
6786    }
6787
6788    /// Sets or clears the value of [worker_pool][crate::model::Preview::worker_pool].
6789    ///
6790    /// # Example
6791    /// ```ignore,no_run
6792    /// # use google_cloud_config_v1::model::Preview;
6793    /// let x = Preview::new().set_or_clear_worker_pool(Some("example"));
6794    /// let x = Preview::new().set_or_clear_worker_pool(None::<String>);
6795    /// ```
6796    pub fn set_or_clear_worker_pool<T>(mut self, v: std::option::Option<T>) -> Self
6797    where
6798        T: std::convert::Into<std::string::String>,
6799    {
6800        self.worker_pool = v.map(|x| x.into());
6801        self
6802    }
6803
6804    /// Sets the value of [error_code][crate::model::Preview::error_code].
6805    ///
6806    /// # Example
6807    /// ```ignore,no_run
6808    /// # use google_cloud_config_v1::model::Preview;
6809    /// use google_cloud_config_v1::model::preview::ErrorCode;
6810    /// let x0 = Preview::new().set_error_code(ErrorCode::CloudBuildPermissionDenied);
6811    /// let x1 = Preview::new().set_error_code(ErrorCode::BucketCreationPermissionDenied);
6812    /// let x2 = Preview::new().set_error_code(ErrorCode::BucketCreationFailed);
6813    /// ```
6814    pub fn set_error_code<T: std::convert::Into<crate::model::preview::ErrorCode>>(
6815        mut self,
6816        v: T,
6817    ) -> Self {
6818        self.error_code = v.into();
6819        self
6820    }
6821
6822    /// Sets the value of [error_status][crate::model::Preview::error_status].
6823    ///
6824    /// # Example
6825    /// ```ignore,no_run
6826    /// # use google_cloud_config_v1::model::Preview;
6827    /// use google_cloud_rpc::model::Status;
6828    /// let x = Preview::new().set_error_status(Status::default()/* use setters */);
6829    /// ```
6830    pub fn set_error_status<T>(mut self, v: T) -> Self
6831    where
6832        T: std::convert::Into<google_cloud_rpc::model::Status>,
6833    {
6834        self.error_status = std::option::Option::Some(v.into());
6835        self
6836    }
6837
6838    /// Sets or clears the value of [error_status][crate::model::Preview::error_status].
6839    ///
6840    /// # Example
6841    /// ```ignore,no_run
6842    /// # use google_cloud_config_v1::model::Preview;
6843    /// use google_cloud_rpc::model::Status;
6844    /// let x = Preview::new().set_or_clear_error_status(Some(Status::default()/* use setters */));
6845    /// let x = Preview::new().set_or_clear_error_status(None::<Status>);
6846    /// ```
6847    pub fn set_or_clear_error_status<T>(mut self, v: std::option::Option<T>) -> Self
6848    where
6849        T: std::convert::Into<google_cloud_rpc::model::Status>,
6850    {
6851        self.error_status = v.map(|x| x.into());
6852        self
6853    }
6854
6855    /// Sets the value of [build][crate::model::Preview::build].
6856    ///
6857    /// # Example
6858    /// ```ignore,no_run
6859    /// # use google_cloud_config_v1::model::Preview;
6860    /// let x = Preview::new().set_build("example");
6861    /// ```
6862    pub fn set_build<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6863        self.build = v.into();
6864        self
6865    }
6866
6867    /// Sets the value of [tf_errors][crate::model::Preview::tf_errors].
6868    ///
6869    /// # Example
6870    /// ```ignore,no_run
6871    /// # use google_cloud_config_v1::model::Preview;
6872    /// use google_cloud_config_v1::model::TerraformError;
6873    /// let x = Preview::new()
6874    ///     .set_tf_errors([
6875    ///         TerraformError::default()/* use setters */,
6876    ///         TerraformError::default()/* use (different) setters */,
6877    ///     ]);
6878    /// ```
6879    pub fn set_tf_errors<T, V>(mut self, v: T) -> Self
6880    where
6881        T: std::iter::IntoIterator<Item = V>,
6882        V: std::convert::Into<crate::model::TerraformError>,
6883    {
6884        use std::iter::Iterator;
6885        self.tf_errors = v.into_iter().map(|i| i.into()).collect();
6886        self
6887    }
6888
6889    /// Sets the value of [error_logs][crate::model::Preview::error_logs].
6890    ///
6891    /// # Example
6892    /// ```ignore,no_run
6893    /// # use google_cloud_config_v1::model::Preview;
6894    /// let x = Preview::new().set_error_logs("example");
6895    /// ```
6896    pub fn set_error_logs<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6897        self.error_logs = v.into();
6898        self
6899    }
6900
6901    /// Sets the value of [preview_artifacts][crate::model::Preview::preview_artifacts].
6902    ///
6903    /// # Example
6904    /// ```ignore,no_run
6905    /// # use google_cloud_config_v1::model::Preview;
6906    /// use google_cloud_config_v1::model::PreviewArtifacts;
6907    /// let x = Preview::new().set_preview_artifacts(PreviewArtifacts::default()/* use setters */);
6908    /// ```
6909    pub fn set_preview_artifacts<T>(mut self, v: T) -> Self
6910    where
6911        T: std::convert::Into<crate::model::PreviewArtifacts>,
6912    {
6913        self.preview_artifacts = std::option::Option::Some(v.into());
6914        self
6915    }
6916
6917    /// Sets or clears the value of [preview_artifacts][crate::model::Preview::preview_artifacts].
6918    ///
6919    /// # Example
6920    /// ```ignore,no_run
6921    /// # use google_cloud_config_v1::model::Preview;
6922    /// use google_cloud_config_v1::model::PreviewArtifacts;
6923    /// let x = Preview::new().set_or_clear_preview_artifacts(Some(PreviewArtifacts::default()/* use setters */));
6924    /// let x = Preview::new().set_or_clear_preview_artifacts(None::<PreviewArtifacts>);
6925    /// ```
6926    pub fn set_or_clear_preview_artifacts<T>(mut self, v: std::option::Option<T>) -> Self
6927    where
6928        T: std::convert::Into<crate::model::PreviewArtifacts>,
6929    {
6930        self.preview_artifacts = v.map(|x| x.into());
6931        self
6932    }
6933
6934    /// Sets the value of [logs][crate::model::Preview::logs].
6935    ///
6936    /// # Example
6937    /// ```ignore,no_run
6938    /// # use google_cloud_config_v1::model::Preview;
6939    /// let x = Preview::new().set_logs("example");
6940    /// ```
6941    pub fn set_logs<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6942        self.logs = v.into();
6943        self
6944    }
6945
6946    /// Sets the value of [tf_version][crate::model::Preview::tf_version].
6947    ///
6948    /// # Example
6949    /// ```ignore,no_run
6950    /// # use google_cloud_config_v1::model::Preview;
6951    /// let x = Preview::new().set_tf_version("example");
6952    /// ```
6953    pub fn set_tf_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6954        self.tf_version = v.into();
6955        self
6956    }
6957
6958    /// Sets the value of [tf_version_constraint][crate::model::Preview::tf_version_constraint].
6959    ///
6960    /// # Example
6961    /// ```ignore,no_run
6962    /// # use google_cloud_config_v1::model::Preview;
6963    /// let x = Preview::new().set_tf_version_constraint("example");
6964    /// ```
6965    pub fn set_tf_version_constraint<T>(mut self, v: T) -> Self
6966    where
6967        T: std::convert::Into<std::string::String>,
6968    {
6969        self.tf_version_constraint = std::option::Option::Some(v.into());
6970        self
6971    }
6972
6973    /// Sets or clears the value of [tf_version_constraint][crate::model::Preview::tf_version_constraint].
6974    ///
6975    /// # Example
6976    /// ```ignore,no_run
6977    /// # use google_cloud_config_v1::model::Preview;
6978    /// let x = Preview::new().set_or_clear_tf_version_constraint(Some("example"));
6979    /// let x = Preview::new().set_or_clear_tf_version_constraint(None::<String>);
6980    /// ```
6981    pub fn set_or_clear_tf_version_constraint<T>(mut self, v: std::option::Option<T>) -> Self
6982    where
6983        T: std::convert::Into<std::string::String>,
6984    {
6985        self.tf_version_constraint = v.map(|x| x.into());
6986        self
6987    }
6988
6989    /// Sets the value of [annotations][crate::model::Preview::annotations].
6990    ///
6991    /// # Example
6992    /// ```ignore,no_run
6993    /// # use google_cloud_config_v1::model::Preview;
6994    /// let x = Preview::new().set_annotations([
6995    ///     ("key0", "abc"),
6996    ///     ("key1", "xyz"),
6997    /// ]);
6998    /// ```
6999    pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
7000    where
7001        T: std::iter::IntoIterator<Item = (K, V)>,
7002        K: std::convert::Into<std::string::String>,
7003        V: std::convert::Into<std::string::String>,
7004    {
7005        use std::iter::Iterator;
7006        self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7007        self
7008    }
7009
7010    /// Sets the value of [provider_config][crate::model::Preview::provider_config].
7011    ///
7012    /// # Example
7013    /// ```ignore,no_run
7014    /// # use google_cloud_config_v1::model::Preview;
7015    /// use google_cloud_config_v1::model::ProviderConfig;
7016    /// let x = Preview::new().set_provider_config(ProviderConfig::default()/* use setters */);
7017    /// ```
7018    pub fn set_provider_config<T>(mut self, v: T) -> Self
7019    where
7020        T: std::convert::Into<crate::model::ProviderConfig>,
7021    {
7022        self.provider_config = std::option::Option::Some(v.into());
7023        self
7024    }
7025
7026    /// Sets or clears the value of [provider_config][crate::model::Preview::provider_config].
7027    ///
7028    /// # Example
7029    /// ```ignore,no_run
7030    /// # use google_cloud_config_v1::model::Preview;
7031    /// use google_cloud_config_v1::model::ProviderConfig;
7032    /// let x = Preview::new().set_or_clear_provider_config(Some(ProviderConfig::default()/* use setters */));
7033    /// let x = Preview::new().set_or_clear_provider_config(None::<ProviderConfig>);
7034    /// ```
7035    pub fn set_or_clear_provider_config<T>(mut self, v: std::option::Option<T>) -> Self
7036    where
7037        T: std::convert::Into<crate::model::ProviderConfig>,
7038    {
7039        self.provider_config = v.map(|x| x.into());
7040        self
7041    }
7042
7043    /// Sets the value of [blueprint][crate::model::Preview::blueprint].
7044    ///
7045    /// Note that all the setters affecting `blueprint` are mutually
7046    /// exclusive.
7047    ///
7048    /// # Example
7049    /// ```ignore,no_run
7050    /// # use google_cloud_config_v1::model::Preview;
7051    /// use google_cloud_config_v1::model::TerraformBlueprint;
7052    /// let x = Preview::new().set_blueprint(Some(
7053    ///     google_cloud_config_v1::model::preview::Blueprint::TerraformBlueprint(TerraformBlueprint::default().into())));
7054    /// ```
7055    pub fn set_blueprint<
7056        T: std::convert::Into<std::option::Option<crate::model::preview::Blueprint>>,
7057    >(
7058        mut self,
7059        v: T,
7060    ) -> Self {
7061        self.blueprint = v.into();
7062        self
7063    }
7064
7065    /// The value of [blueprint][crate::model::Preview::blueprint]
7066    /// if it holds a `TerraformBlueprint`, `None` if the field is not set or
7067    /// holds a different branch.
7068    pub fn terraform_blueprint(
7069        &self,
7070    ) -> std::option::Option<&std::boxed::Box<crate::model::TerraformBlueprint>> {
7071        #[allow(unreachable_patterns)]
7072        self.blueprint.as_ref().and_then(|v| match v {
7073            crate::model::preview::Blueprint::TerraformBlueprint(v) => std::option::Option::Some(v),
7074            _ => std::option::Option::None,
7075        })
7076    }
7077
7078    /// Sets the value of [blueprint][crate::model::Preview::blueprint]
7079    /// to hold a `TerraformBlueprint`.
7080    ///
7081    /// Note that all the setters affecting `blueprint` are
7082    /// mutually exclusive.
7083    ///
7084    /// # Example
7085    /// ```ignore,no_run
7086    /// # use google_cloud_config_v1::model::Preview;
7087    /// use google_cloud_config_v1::model::TerraformBlueprint;
7088    /// let x = Preview::new().set_terraform_blueprint(TerraformBlueprint::default()/* use setters */);
7089    /// assert!(x.terraform_blueprint().is_some());
7090    /// ```
7091    pub fn set_terraform_blueprint<
7092        T: std::convert::Into<std::boxed::Box<crate::model::TerraformBlueprint>>,
7093    >(
7094        mut self,
7095        v: T,
7096    ) -> Self {
7097        self.blueprint = std::option::Option::Some(
7098            crate::model::preview::Blueprint::TerraformBlueprint(v.into()),
7099        );
7100        self
7101    }
7102}
7103
7104impl wkt::message::Message for Preview {
7105    fn typename() -> &'static str {
7106        "type.googleapis.com/google.cloud.config.v1.Preview"
7107    }
7108}
7109
7110/// Defines additional types related to [Preview].
7111pub mod preview {
7112    #[allow(unused_imports)]
7113    use super::*;
7114
7115    /// Possible states of a preview.
7116    ///
7117    /// # Working with unknown values
7118    ///
7119    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7120    /// additional enum variants at any time. Adding new variants is not considered
7121    /// a breaking change. Applications should write their code in anticipation of:
7122    ///
7123    /// - New values appearing in future releases of the client library, **and**
7124    /// - New values received dynamically, without application changes.
7125    ///
7126    /// Please consult the [Working with enums] section in the user guide for some
7127    /// guidelines.
7128    ///
7129    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
7130    #[derive(Clone, Debug, PartialEq)]
7131    #[non_exhaustive]
7132    pub enum State {
7133        /// The default value. This value is used if the state is unknown.
7134        Unspecified,
7135        /// The preview is being created.
7136        Creating,
7137        /// The preview has succeeded.
7138        Succeeded,
7139        /// The preview is being applied.
7140        Applying,
7141        /// The preview is stale. A preview can become stale if a revision has been
7142        /// applied after this preview was created.
7143        Stale,
7144        /// The preview is being deleted.
7145        Deleting,
7146        /// The preview has encountered an unexpected error.
7147        Failed,
7148        /// The preview has been deleted.
7149        Deleted,
7150        /// If set, the enum was initialized with an unknown value.
7151        ///
7152        /// Applications can examine the value using [State::value] or
7153        /// [State::name].
7154        UnknownValue(state::UnknownValue),
7155    }
7156
7157    #[doc(hidden)]
7158    pub mod state {
7159        #[allow(unused_imports)]
7160        use super::*;
7161        #[derive(Clone, Debug, PartialEq)]
7162        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7163    }
7164
7165    impl State {
7166        /// Gets the enum value.
7167        ///
7168        /// Returns `None` if the enum contains an unknown value deserialized from
7169        /// the string representation of enums.
7170        pub fn value(&self) -> std::option::Option<i32> {
7171            match self {
7172                Self::Unspecified => std::option::Option::Some(0),
7173                Self::Creating => std::option::Option::Some(1),
7174                Self::Succeeded => std::option::Option::Some(2),
7175                Self::Applying => std::option::Option::Some(3),
7176                Self::Stale => std::option::Option::Some(4),
7177                Self::Deleting => std::option::Option::Some(5),
7178                Self::Failed => std::option::Option::Some(6),
7179                Self::Deleted => std::option::Option::Some(7),
7180                Self::UnknownValue(u) => u.0.value(),
7181            }
7182        }
7183
7184        /// Gets the enum value as a string.
7185        ///
7186        /// Returns `None` if the enum contains an unknown value deserialized from
7187        /// the integer representation of enums.
7188        pub fn name(&self) -> std::option::Option<&str> {
7189            match self {
7190                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
7191                Self::Creating => std::option::Option::Some("CREATING"),
7192                Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
7193                Self::Applying => std::option::Option::Some("APPLYING"),
7194                Self::Stale => std::option::Option::Some("STALE"),
7195                Self::Deleting => std::option::Option::Some("DELETING"),
7196                Self::Failed => std::option::Option::Some("FAILED"),
7197                Self::Deleted => std::option::Option::Some("DELETED"),
7198                Self::UnknownValue(u) => u.0.name(),
7199            }
7200        }
7201    }
7202
7203    impl std::default::Default for State {
7204        fn default() -> Self {
7205            use std::convert::From;
7206            Self::from(0)
7207        }
7208    }
7209
7210    impl std::fmt::Display for State {
7211        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7212            wkt::internal::display_enum(f, self.name(), self.value())
7213        }
7214    }
7215
7216    impl std::convert::From<i32> for State {
7217        fn from(value: i32) -> Self {
7218            match value {
7219                0 => Self::Unspecified,
7220                1 => Self::Creating,
7221                2 => Self::Succeeded,
7222                3 => Self::Applying,
7223                4 => Self::Stale,
7224                5 => Self::Deleting,
7225                6 => Self::Failed,
7226                7 => Self::Deleted,
7227                _ => Self::UnknownValue(state::UnknownValue(
7228                    wkt::internal::UnknownEnumValue::Integer(value),
7229                )),
7230            }
7231        }
7232    }
7233
7234    impl std::convert::From<&str> for State {
7235        fn from(value: &str) -> Self {
7236            use std::string::ToString;
7237            match value {
7238                "STATE_UNSPECIFIED" => Self::Unspecified,
7239                "CREATING" => Self::Creating,
7240                "SUCCEEDED" => Self::Succeeded,
7241                "APPLYING" => Self::Applying,
7242                "STALE" => Self::Stale,
7243                "DELETING" => Self::Deleting,
7244                "FAILED" => Self::Failed,
7245                "DELETED" => Self::Deleted,
7246                _ => Self::UnknownValue(state::UnknownValue(
7247                    wkt::internal::UnknownEnumValue::String(value.to_string()),
7248                )),
7249            }
7250        }
7251    }
7252
7253    impl serde::ser::Serialize for State {
7254        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7255        where
7256            S: serde::Serializer,
7257        {
7258            match self {
7259                Self::Unspecified => serializer.serialize_i32(0),
7260                Self::Creating => serializer.serialize_i32(1),
7261                Self::Succeeded => serializer.serialize_i32(2),
7262                Self::Applying => serializer.serialize_i32(3),
7263                Self::Stale => serializer.serialize_i32(4),
7264                Self::Deleting => serializer.serialize_i32(5),
7265                Self::Failed => serializer.serialize_i32(6),
7266                Self::Deleted => serializer.serialize_i32(7),
7267                Self::UnknownValue(u) => u.0.serialize(serializer),
7268            }
7269        }
7270    }
7271
7272    impl<'de> serde::de::Deserialize<'de> for State {
7273        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7274        where
7275            D: serde::Deserializer<'de>,
7276        {
7277            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
7278                ".google.cloud.config.v1.Preview.State",
7279            ))
7280        }
7281    }
7282
7283    /// Preview mode provides options for customizing preview operations.
7284    ///
7285    /// # Working with unknown values
7286    ///
7287    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7288    /// additional enum variants at any time. Adding new variants is not considered
7289    /// a breaking change. Applications should write their code in anticipation of:
7290    ///
7291    /// - New values appearing in future releases of the client library, **and**
7292    /// - New values received dynamically, without application changes.
7293    ///
7294    /// Please consult the [Working with enums] section in the user guide for some
7295    /// guidelines.
7296    ///
7297    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
7298    #[derive(Clone, Debug, PartialEq)]
7299    #[non_exhaustive]
7300    pub enum PreviewMode {
7301        /// Unspecified policy, default mode will be used.
7302        Unspecified,
7303        /// DEFAULT mode generates an execution plan for reconciling current resource
7304        /// state into expected resource state.
7305        Default,
7306        /// DELETE mode generates as execution plan for destroying current resources.
7307        Delete,
7308        /// If set, the enum was initialized with an unknown value.
7309        ///
7310        /// Applications can examine the value using [PreviewMode::value] or
7311        /// [PreviewMode::name].
7312        UnknownValue(preview_mode::UnknownValue),
7313    }
7314
7315    #[doc(hidden)]
7316    pub mod preview_mode {
7317        #[allow(unused_imports)]
7318        use super::*;
7319        #[derive(Clone, Debug, PartialEq)]
7320        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7321    }
7322
7323    impl PreviewMode {
7324        /// Gets the enum value.
7325        ///
7326        /// Returns `None` if the enum contains an unknown value deserialized from
7327        /// the string representation of enums.
7328        pub fn value(&self) -> std::option::Option<i32> {
7329            match self {
7330                Self::Unspecified => std::option::Option::Some(0),
7331                Self::Default => std::option::Option::Some(1),
7332                Self::Delete => std::option::Option::Some(2),
7333                Self::UnknownValue(u) => u.0.value(),
7334            }
7335        }
7336
7337        /// Gets the enum value as a string.
7338        ///
7339        /// Returns `None` if the enum contains an unknown value deserialized from
7340        /// the integer representation of enums.
7341        pub fn name(&self) -> std::option::Option<&str> {
7342            match self {
7343                Self::Unspecified => std::option::Option::Some("PREVIEW_MODE_UNSPECIFIED"),
7344                Self::Default => std::option::Option::Some("DEFAULT"),
7345                Self::Delete => std::option::Option::Some("DELETE"),
7346                Self::UnknownValue(u) => u.0.name(),
7347            }
7348        }
7349    }
7350
7351    impl std::default::Default for PreviewMode {
7352        fn default() -> Self {
7353            use std::convert::From;
7354            Self::from(0)
7355        }
7356    }
7357
7358    impl std::fmt::Display for PreviewMode {
7359        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7360            wkt::internal::display_enum(f, self.name(), self.value())
7361        }
7362    }
7363
7364    impl std::convert::From<i32> for PreviewMode {
7365        fn from(value: i32) -> Self {
7366            match value {
7367                0 => Self::Unspecified,
7368                1 => Self::Default,
7369                2 => Self::Delete,
7370                _ => Self::UnknownValue(preview_mode::UnknownValue(
7371                    wkt::internal::UnknownEnumValue::Integer(value),
7372                )),
7373            }
7374        }
7375    }
7376
7377    impl std::convert::From<&str> for PreviewMode {
7378        fn from(value: &str) -> Self {
7379            use std::string::ToString;
7380            match value {
7381                "PREVIEW_MODE_UNSPECIFIED" => Self::Unspecified,
7382                "DEFAULT" => Self::Default,
7383                "DELETE" => Self::Delete,
7384                _ => Self::UnknownValue(preview_mode::UnknownValue(
7385                    wkt::internal::UnknownEnumValue::String(value.to_string()),
7386                )),
7387            }
7388        }
7389    }
7390
7391    impl serde::ser::Serialize for PreviewMode {
7392        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7393        where
7394            S: serde::Serializer,
7395        {
7396            match self {
7397                Self::Unspecified => serializer.serialize_i32(0),
7398                Self::Default => serializer.serialize_i32(1),
7399                Self::Delete => serializer.serialize_i32(2),
7400                Self::UnknownValue(u) => u.0.serialize(serializer),
7401            }
7402        }
7403    }
7404
7405    impl<'de> serde::de::Deserialize<'de> for PreviewMode {
7406        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7407        where
7408            D: serde::Deserializer<'de>,
7409        {
7410            deserializer.deserialize_any(wkt::internal::EnumVisitor::<PreviewMode>::new(
7411                ".google.cloud.config.v1.Preview.PreviewMode",
7412            ))
7413        }
7414    }
7415
7416    /// Possible errors that can occur with previews.
7417    ///
7418    /// # Working with unknown values
7419    ///
7420    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7421    /// additional enum variants at any time. Adding new variants is not considered
7422    /// a breaking change. Applications should write their code in anticipation of:
7423    ///
7424    /// - New values appearing in future releases of the client library, **and**
7425    /// - New values received dynamically, without application changes.
7426    ///
7427    /// Please consult the [Working with enums] section in the user guide for some
7428    /// guidelines.
7429    ///
7430    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
7431    #[derive(Clone, Debug, PartialEq)]
7432    #[non_exhaustive]
7433    pub enum ErrorCode {
7434        /// No error code was specified.
7435        Unspecified,
7436        /// Cloud Build failed due to a permissions issue.
7437        CloudBuildPermissionDenied,
7438        /// Cloud Storage bucket failed to create due to a permissions issue.
7439        BucketCreationPermissionDenied,
7440        /// Cloud Storage bucket failed for a non-permissions-related issue.
7441        BucketCreationFailed,
7442        /// Acquiring lock on provided deployment reference failed.
7443        DeploymentLockAcquireFailed,
7444        /// Preview encountered an error when trying to access Cloud Build API.
7445        PreviewBuildApiFailed,
7446        /// Preview created a build but build failed and logs were generated.
7447        PreviewBuildRunFailed,
7448        /// Failed to import values from an external source.
7449        ExternalValueSourceImportFailed,
7450        /// If set, the enum was initialized with an unknown value.
7451        ///
7452        /// Applications can examine the value using [ErrorCode::value] or
7453        /// [ErrorCode::name].
7454        UnknownValue(error_code::UnknownValue),
7455    }
7456
7457    #[doc(hidden)]
7458    pub mod error_code {
7459        #[allow(unused_imports)]
7460        use super::*;
7461        #[derive(Clone, Debug, PartialEq)]
7462        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7463    }
7464
7465    impl ErrorCode {
7466        /// Gets the enum value.
7467        ///
7468        /// Returns `None` if the enum contains an unknown value deserialized from
7469        /// the string representation of enums.
7470        pub fn value(&self) -> std::option::Option<i32> {
7471            match self {
7472                Self::Unspecified => std::option::Option::Some(0),
7473                Self::CloudBuildPermissionDenied => std::option::Option::Some(1),
7474                Self::BucketCreationPermissionDenied => std::option::Option::Some(2),
7475                Self::BucketCreationFailed => std::option::Option::Some(3),
7476                Self::DeploymentLockAcquireFailed => std::option::Option::Some(4),
7477                Self::PreviewBuildApiFailed => std::option::Option::Some(5),
7478                Self::PreviewBuildRunFailed => std::option::Option::Some(6),
7479                Self::ExternalValueSourceImportFailed => std::option::Option::Some(7),
7480                Self::UnknownValue(u) => u.0.value(),
7481            }
7482        }
7483
7484        /// Gets the enum value as a string.
7485        ///
7486        /// Returns `None` if the enum contains an unknown value deserialized from
7487        /// the integer representation of enums.
7488        pub fn name(&self) -> std::option::Option<&str> {
7489            match self {
7490                Self::Unspecified => std::option::Option::Some("ERROR_CODE_UNSPECIFIED"),
7491                Self::CloudBuildPermissionDenied => {
7492                    std::option::Option::Some("CLOUD_BUILD_PERMISSION_DENIED")
7493                }
7494                Self::BucketCreationPermissionDenied => {
7495                    std::option::Option::Some("BUCKET_CREATION_PERMISSION_DENIED")
7496                }
7497                Self::BucketCreationFailed => std::option::Option::Some("BUCKET_CREATION_FAILED"),
7498                Self::DeploymentLockAcquireFailed => {
7499                    std::option::Option::Some("DEPLOYMENT_LOCK_ACQUIRE_FAILED")
7500                }
7501                Self::PreviewBuildApiFailed => {
7502                    std::option::Option::Some("PREVIEW_BUILD_API_FAILED")
7503                }
7504                Self::PreviewBuildRunFailed => {
7505                    std::option::Option::Some("PREVIEW_BUILD_RUN_FAILED")
7506                }
7507                Self::ExternalValueSourceImportFailed => {
7508                    std::option::Option::Some("EXTERNAL_VALUE_SOURCE_IMPORT_FAILED")
7509                }
7510                Self::UnknownValue(u) => u.0.name(),
7511            }
7512        }
7513    }
7514
7515    impl std::default::Default for ErrorCode {
7516        fn default() -> Self {
7517            use std::convert::From;
7518            Self::from(0)
7519        }
7520    }
7521
7522    impl std::fmt::Display for ErrorCode {
7523        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7524            wkt::internal::display_enum(f, self.name(), self.value())
7525        }
7526    }
7527
7528    impl std::convert::From<i32> for ErrorCode {
7529        fn from(value: i32) -> Self {
7530            match value {
7531                0 => Self::Unspecified,
7532                1 => Self::CloudBuildPermissionDenied,
7533                2 => Self::BucketCreationPermissionDenied,
7534                3 => Self::BucketCreationFailed,
7535                4 => Self::DeploymentLockAcquireFailed,
7536                5 => Self::PreviewBuildApiFailed,
7537                6 => Self::PreviewBuildRunFailed,
7538                7 => Self::ExternalValueSourceImportFailed,
7539                _ => Self::UnknownValue(error_code::UnknownValue(
7540                    wkt::internal::UnknownEnumValue::Integer(value),
7541                )),
7542            }
7543        }
7544    }
7545
7546    impl std::convert::From<&str> for ErrorCode {
7547        fn from(value: &str) -> Self {
7548            use std::string::ToString;
7549            match value {
7550                "ERROR_CODE_UNSPECIFIED" => Self::Unspecified,
7551                "CLOUD_BUILD_PERMISSION_DENIED" => Self::CloudBuildPermissionDenied,
7552                "BUCKET_CREATION_PERMISSION_DENIED" => Self::BucketCreationPermissionDenied,
7553                "BUCKET_CREATION_FAILED" => Self::BucketCreationFailed,
7554                "DEPLOYMENT_LOCK_ACQUIRE_FAILED" => Self::DeploymentLockAcquireFailed,
7555                "PREVIEW_BUILD_API_FAILED" => Self::PreviewBuildApiFailed,
7556                "PREVIEW_BUILD_RUN_FAILED" => Self::PreviewBuildRunFailed,
7557                "EXTERNAL_VALUE_SOURCE_IMPORT_FAILED" => Self::ExternalValueSourceImportFailed,
7558                _ => Self::UnknownValue(error_code::UnknownValue(
7559                    wkt::internal::UnknownEnumValue::String(value.to_string()),
7560                )),
7561            }
7562        }
7563    }
7564
7565    impl serde::ser::Serialize for ErrorCode {
7566        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7567        where
7568            S: serde::Serializer,
7569        {
7570            match self {
7571                Self::Unspecified => serializer.serialize_i32(0),
7572                Self::CloudBuildPermissionDenied => serializer.serialize_i32(1),
7573                Self::BucketCreationPermissionDenied => serializer.serialize_i32(2),
7574                Self::BucketCreationFailed => serializer.serialize_i32(3),
7575                Self::DeploymentLockAcquireFailed => serializer.serialize_i32(4),
7576                Self::PreviewBuildApiFailed => serializer.serialize_i32(5),
7577                Self::PreviewBuildRunFailed => serializer.serialize_i32(6),
7578                Self::ExternalValueSourceImportFailed => serializer.serialize_i32(7),
7579                Self::UnknownValue(u) => u.0.serialize(serializer),
7580            }
7581        }
7582    }
7583
7584    impl<'de> serde::de::Deserialize<'de> for ErrorCode {
7585        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7586        where
7587            D: serde::Deserializer<'de>,
7588        {
7589            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ErrorCode>::new(
7590                ".google.cloud.config.v1.Preview.ErrorCode",
7591            ))
7592        }
7593    }
7594
7595    /// Blueprint to preview.
7596    #[derive(Clone, Debug, PartialEq)]
7597    #[non_exhaustive]
7598    pub enum Blueprint {
7599        /// The terraform blueprint to preview.
7600        TerraformBlueprint(std::boxed::Box<crate::model::TerraformBlueprint>),
7601    }
7602}
7603
7604/// Ephemeral metadata content describing the state of a preview operation.
7605#[derive(Clone, Default, PartialEq)]
7606#[non_exhaustive]
7607pub struct PreviewOperationMetadata {
7608    /// The current step the preview operation is running.
7609    pub step: crate::model::preview_operation_metadata::PreviewStep,
7610
7611    /// Artifacts from preview.
7612    pub preview_artifacts: std::option::Option<crate::model::PreviewArtifacts>,
7613
7614    /// Output only. Location of preview logs in `gs://{bucket}/{object}` format.
7615    pub logs: std::string::String,
7616
7617    /// Output only. Cloud Build instance UUID associated with this preview.
7618    pub build: std::string::String,
7619
7620    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7621}
7622
7623impl PreviewOperationMetadata {
7624    /// Creates a new default instance.
7625    pub fn new() -> Self {
7626        std::default::Default::default()
7627    }
7628
7629    /// Sets the value of [step][crate::model::PreviewOperationMetadata::step].
7630    ///
7631    /// # Example
7632    /// ```ignore,no_run
7633    /// # use google_cloud_config_v1::model::PreviewOperationMetadata;
7634    /// use google_cloud_config_v1::model::preview_operation_metadata::PreviewStep;
7635    /// let x0 = PreviewOperationMetadata::new().set_step(PreviewStep::PreparingStorageBucket);
7636    /// let x1 = PreviewOperationMetadata::new().set_step(PreviewStep::DownloadingBlueprint);
7637    /// let x2 = PreviewOperationMetadata::new().set_step(PreviewStep::RunningTfInit);
7638    /// ```
7639    pub fn set_step<
7640        T: std::convert::Into<crate::model::preview_operation_metadata::PreviewStep>,
7641    >(
7642        mut self,
7643        v: T,
7644    ) -> Self {
7645        self.step = v.into();
7646        self
7647    }
7648
7649    /// Sets the value of [preview_artifacts][crate::model::PreviewOperationMetadata::preview_artifacts].
7650    ///
7651    /// # Example
7652    /// ```ignore,no_run
7653    /// # use google_cloud_config_v1::model::PreviewOperationMetadata;
7654    /// use google_cloud_config_v1::model::PreviewArtifacts;
7655    /// let x = PreviewOperationMetadata::new().set_preview_artifacts(PreviewArtifacts::default()/* use setters */);
7656    /// ```
7657    pub fn set_preview_artifacts<T>(mut self, v: T) -> Self
7658    where
7659        T: std::convert::Into<crate::model::PreviewArtifacts>,
7660    {
7661        self.preview_artifacts = std::option::Option::Some(v.into());
7662        self
7663    }
7664
7665    /// Sets or clears the value of [preview_artifacts][crate::model::PreviewOperationMetadata::preview_artifacts].
7666    ///
7667    /// # Example
7668    /// ```ignore,no_run
7669    /// # use google_cloud_config_v1::model::PreviewOperationMetadata;
7670    /// use google_cloud_config_v1::model::PreviewArtifacts;
7671    /// let x = PreviewOperationMetadata::new().set_or_clear_preview_artifacts(Some(PreviewArtifacts::default()/* use setters */));
7672    /// let x = PreviewOperationMetadata::new().set_or_clear_preview_artifacts(None::<PreviewArtifacts>);
7673    /// ```
7674    pub fn set_or_clear_preview_artifacts<T>(mut self, v: std::option::Option<T>) -> Self
7675    where
7676        T: std::convert::Into<crate::model::PreviewArtifacts>,
7677    {
7678        self.preview_artifacts = v.map(|x| x.into());
7679        self
7680    }
7681
7682    /// Sets the value of [logs][crate::model::PreviewOperationMetadata::logs].
7683    ///
7684    /// # Example
7685    /// ```ignore,no_run
7686    /// # use google_cloud_config_v1::model::PreviewOperationMetadata;
7687    /// let x = PreviewOperationMetadata::new().set_logs("example");
7688    /// ```
7689    pub fn set_logs<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7690        self.logs = v.into();
7691        self
7692    }
7693
7694    /// Sets the value of [build][crate::model::PreviewOperationMetadata::build].
7695    ///
7696    /// # Example
7697    /// ```ignore,no_run
7698    /// # use google_cloud_config_v1::model::PreviewOperationMetadata;
7699    /// let x = PreviewOperationMetadata::new().set_build("example");
7700    /// ```
7701    pub fn set_build<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7702        self.build = v.into();
7703        self
7704    }
7705}
7706
7707impl wkt::message::Message for PreviewOperationMetadata {
7708    fn typename() -> &'static str {
7709        "type.googleapis.com/google.cloud.config.v1.PreviewOperationMetadata"
7710    }
7711}
7712
7713/// Defines additional types related to [PreviewOperationMetadata].
7714pub mod preview_operation_metadata {
7715    #[allow(unused_imports)]
7716    use super::*;
7717
7718    /// The possible steps a preview may be running.
7719    ///
7720    /// # Working with unknown values
7721    ///
7722    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7723    /// additional enum variants at any time. Adding new variants is not considered
7724    /// a breaking change. Applications should write their code in anticipation of:
7725    ///
7726    /// - New values appearing in future releases of the client library, **and**
7727    /// - New values received dynamically, without application changes.
7728    ///
7729    /// Please consult the [Working with enums] section in the user guide for some
7730    /// guidelines.
7731    ///
7732    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
7733    #[derive(Clone, Debug, PartialEq)]
7734    #[non_exhaustive]
7735    pub enum PreviewStep {
7736        /// Unspecified preview step.
7737        Unspecified,
7738        /// Infra Manager is creating a Google Cloud Storage bucket to store
7739        /// artifacts and metadata about the preview.
7740        PreparingStorageBucket,
7741        /// Downloading the blueprint onto the Google Cloud Storage bucket.
7742        DownloadingBlueprint,
7743        /// Initializing Terraform using `terraform init`.
7744        RunningTfInit,
7745        /// Running `terraform plan`.
7746        RunningTfPlan,
7747        /// Fetching a deployment.
7748        FetchingDeployment,
7749        /// Locking a deployment.
7750        LockingDeployment,
7751        /// Unlocking a deployment.
7752        UnlockingDeployment,
7753        /// Operation was successful.
7754        Succeeded,
7755        /// Operation failed.
7756        Failed,
7757        /// Validating the provided repository.
7758        ValidatingRepository,
7759        /// If set, the enum was initialized with an unknown value.
7760        ///
7761        /// Applications can examine the value using [PreviewStep::value] or
7762        /// [PreviewStep::name].
7763        UnknownValue(preview_step::UnknownValue),
7764    }
7765
7766    #[doc(hidden)]
7767    pub mod preview_step {
7768        #[allow(unused_imports)]
7769        use super::*;
7770        #[derive(Clone, Debug, PartialEq)]
7771        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7772    }
7773
7774    impl PreviewStep {
7775        /// Gets the enum value.
7776        ///
7777        /// Returns `None` if the enum contains an unknown value deserialized from
7778        /// the string representation of enums.
7779        pub fn value(&self) -> std::option::Option<i32> {
7780            match self {
7781                Self::Unspecified => std::option::Option::Some(0),
7782                Self::PreparingStorageBucket => std::option::Option::Some(1),
7783                Self::DownloadingBlueprint => std::option::Option::Some(2),
7784                Self::RunningTfInit => std::option::Option::Some(3),
7785                Self::RunningTfPlan => std::option::Option::Some(4),
7786                Self::FetchingDeployment => std::option::Option::Some(5),
7787                Self::LockingDeployment => std::option::Option::Some(6),
7788                Self::UnlockingDeployment => std::option::Option::Some(7),
7789                Self::Succeeded => std::option::Option::Some(8),
7790                Self::Failed => std::option::Option::Some(9),
7791                Self::ValidatingRepository => std::option::Option::Some(10),
7792                Self::UnknownValue(u) => u.0.value(),
7793            }
7794        }
7795
7796        /// Gets the enum value as a string.
7797        ///
7798        /// Returns `None` if the enum contains an unknown value deserialized from
7799        /// the integer representation of enums.
7800        pub fn name(&self) -> std::option::Option<&str> {
7801            match self {
7802                Self::Unspecified => std::option::Option::Some("PREVIEW_STEP_UNSPECIFIED"),
7803                Self::PreparingStorageBucket => {
7804                    std::option::Option::Some("PREPARING_STORAGE_BUCKET")
7805                }
7806                Self::DownloadingBlueprint => std::option::Option::Some("DOWNLOADING_BLUEPRINT"),
7807                Self::RunningTfInit => std::option::Option::Some("RUNNING_TF_INIT"),
7808                Self::RunningTfPlan => std::option::Option::Some("RUNNING_TF_PLAN"),
7809                Self::FetchingDeployment => std::option::Option::Some("FETCHING_DEPLOYMENT"),
7810                Self::LockingDeployment => std::option::Option::Some("LOCKING_DEPLOYMENT"),
7811                Self::UnlockingDeployment => std::option::Option::Some("UNLOCKING_DEPLOYMENT"),
7812                Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
7813                Self::Failed => std::option::Option::Some("FAILED"),
7814                Self::ValidatingRepository => std::option::Option::Some("VALIDATING_REPOSITORY"),
7815                Self::UnknownValue(u) => u.0.name(),
7816            }
7817        }
7818    }
7819
7820    impl std::default::Default for PreviewStep {
7821        fn default() -> Self {
7822            use std::convert::From;
7823            Self::from(0)
7824        }
7825    }
7826
7827    impl std::fmt::Display for PreviewStep {
7828        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7829            wkt::internal::display_enum(f, self.name(), self.value())
7830        }
7831    }
7832
7833    impl std::convert::From<i32> for PreviewStep {
7834        fn from(value: i32) -> Self {
7835            match value {
7836                0 => Self::Unspecified,
7837                1 => Self::PreparingStorageBucket,
7838                2 => Self::DownloadingBlueprint,
7839                3 => Self::RunningTfInit,
7840                4 => Self::RunningTfPlan,
7841                5 => Self::FetchingDeployment,
7842                6 => Self::LockingDeployment,
7843                7 => Self::UnlockingDeployment,
7844                8 => Self::Succeeded,
7845                9 => Self::Failed,
7846                10 => Self::ValidatingRepository,
7847                _ => Self::UnknownValue(preview_step::UnknownValue(
7848                    wkt::internal::UnknownEnumValue::Integer(value),
7849                )),
7850            }
7851        }
7852    }
7853
7854    impl std::convert::From<&str> for PreviewStep {
7855        fn from(value: &str) -> Self {
7856            use std::string::ToString;
7857            match value {
7858                "PREVIEW_STEP_UNSPECIFIED" => Self::Unspecified,
7859                "PREPARING_STORAGE_BUCKET" => Self::PreparingStorageBucket,
7860                "DOWNLOADING_BLUEPRINT" => Self::DownloadingBlueprint,
7861                "RUNNING_TF_INIT" => Self::RunningTfInit,
7862                "RUNNING_TF_PLAN" => Self::RunningTfPlan,
7863                "FETCHING_DEPLOYMENT" => Self::FetchingDeployment,
7864                "LOCKING_DEPLOYMENT" => Self::LockingDeployment,
7865                "UNLOCKING_DEPLOYMENT" => Self::UnlockingDeployment,
7866                "SUCCEEDED" => Self::Succeeded,
7867                "FAILED" => Self::Failed,
7868                "VALIDATING_REPOSITORY" => Self::ValidatingRepository,
7869                _ => Self::UnknownValue(preview_step::UnknownValue(
7870                    wkt::internal::UnknownEnumValue::String(value.to_string()),
7871                )),
7872            }
7873        }
7874    }
7875
7876    impl serde::ser::Serialize for PreviewStep {
7877        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7878        where
7879            S: serde::Serializer,
7880        {
7881            match self {
7882                Self::Unspecified => serializer.serialize_i32(0),
7883                Self::PreparingStorageBucket => serializer.serialize_i32(1),
7884                Self::DownloadingBlueprint => serializer.serialize_i32(2),
7885                Self::RunningTfInit => serializer.serialize_i32(3),
7886                Self::RunningTfPlan => serializer.serialize_i32(4),
7887                Self::FetchingDeployment => serializer.serialize_i32(5),
7888                Self::LockingDeployment => serializer.serialize_i32(6),
7889                Self::UnlockingDeployment => serializer.serialize_i32(7),
7890                Self::Succeeded => serializer.serialize_i32(8),
7891                Self::Failed => serializer.serialize_i32(9),
7892                Self::ValidatingRepository => serializer.serialize_i32(10),
7893                Self::UnknownValue(u) => u.0.serialize(serializer),
7894            }
7895        }
7896    }
7897
7898    impl<'de> serde::de::Deserialize<'de> for PreviewStep {
7899        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7900        where
7901            D: serde::Deserializer<'de>,
7902        {
7903            deserializer.deserialize_any(wkt::internal::EnumVisitor::<PreviewStep>::new(
7904                ".google.cloud.config.v1.PreviewOperationMetadata.PreviewStep",
7905            ))
7906        }
7907    }
7908}
7909
7910/// Artifacts created by preview.
7911#[derive(Clone, Default, PartialEq)]
7912#[non_exhaustive]
7913pub struct PreviewArtifacts {
7914    /// Output only. Location of a blueprint copy and other content in Google Cloud
7915    /// Storage. Format: `gs://{bucket}/{object}`
7916    pub content: std::string::String,
7917
7918    /// Output only. Location of artifacts in Google Cloud Storage.
7919    /// Format: `gs://{bucket}/{object}`
7920    pub artifacts: std::string::String,
7921
7922    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7923}
7924
7925impl PreviewArtifacts {
7926    /// Creates a new default instance.
7927    pub fn new() -> Self {
7928        std::default::Default::default()
7929    }
7930
7931    /// Sets the value of [content][crate::model::PreviewArtifacts::content].
7932    ///
7933    /// # Example
7934    /// ```ignore,no_run
7935    /// # use google_cloud_config_v1::model::PreviewArtifacts;
7936    /// let x = PreviewArtifacts::new().set_content("example");
7937    /// ```
7938    pub fn set_content<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7939        self.content = v.into();
7940        self
7941    }
7942
7943    /// Sets the value of [artifacts][crate::model::PreviewArtifacts::artifacts].
7944    ///
7945    /// # Example
7946    /// ```ignore,no_run
7947    /// # use google_cloud_config_v1::model::PreviewArtifacts;
7948    /// let x = PreviewArtifacts::new().set_artifacts("example");
7949    /// ```
7950    pub fn set_artifacts<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7951        self.artifacts = v.into();
7952        self
7953    }
7954}
7955
7956impl wkt::message::Message for PreviewArtifacts {
7957    fn typename() -> &'static str {
7958        "type.googleapis.com/google.cloud.config.v1.PreviewArtifacts"
7959    }
7960}
7961
7962/// A request to create a preview.
7963#[derive(Clone, Default, PartialEq)]
7964#[non_exhaustive]
7965pub struct CreatePreviewRequest {
7966    /// Required. The parent in whose context the Preview is created. The parent
7967    /// value is in the format: 'projects/{project_id}/locations/{location}'.
7968    pub parent: std::string::String,
7969
7970    /// Optional. The preview ID.
7971    pub preview_id: std::string::String,
7972
7973    /// Required. [Preview][google.cloud.config.v1.Preview] resource to be created.
7974    ///
7975    /// [google.cloud.config.v1.Preview]: crate::model::Preview
7976    pub preview: std::option::Option<crate::model::Preview>,
7977
7978    /// Optional. An optional request ID to identify requests. Specify a unique
7979    /// request ID so that if you must retry your request, the server will know to
7980    /// ignore the request if it has already been completed. The server will
7981    /// guarantee that for at least 60 minutes since the first request.
7982    ///
7983    /// For example, consider a situation where you make an initial request and the
7984    /// request times out. If you make the request again with the same request ID,
7985    /// the server can check if original operation with the same request ID was
7986    /// received, and if so, will ignore the second request. This prevents clients
7987    /// from accidentally creating duplicate commitments.
7988    ///
7989    /// The request ID must be a valid UUID with the exception that zero UUID is
7990    /// not supported (00000000-0000-0000-0000-000000000000).
7991    pub request_id: std::string::String,
7992
7993    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7994}
7995
7996impl CreatePreviewRequest {
7997    /// Creates a new default instance.
7998    pub fn new() -> Self {
7999        std::default::Default::default()
8000    }
8001
8002    /// Sets the value of [parent][crate::model::CreatePreviewRequest::parent].
8003    ///
8004    /// # Example
8005    /// ```ignore,no_run
8006    /// # use google_cloud_config_v1::model::CreatePreviewRequest;
8007    /// let x = CreatePreviewRequest::new().set_parent("example");
8008    /// ```
8009    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8010        self.parent = v.into();
8011        self
8012    }
8013
8014    /// Sets the value of [preview_id][crate::model::CreatePreviewRequest::preview_id].
8015    ///
8016    /// # Example
8017    /// ```ignore,no_run
8018    /// # use google_cloud_config_v1::model::CreatePreviewRequest;
8019    /// let x = CreatePreviewRequest::new().set_preview_id("example");
8020    /// ```
8021    pub fn set_preview_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8022        self.preview_id = v.into();
8023        self
8024    }
8025
8026    /// Sets the value of [preview][crate::model::CreatePreviewRequest::preview].
8027    ///
8028    /// # Example
8029    /// ```ignore,no_run
8030    /// # use google_cloud_config_v1::model::CreatePreviewRequest;
8031    /// use google_cloud_config_v1::model::Preview;
8032    /// let x = CreatePreviewRequest::new().set_preview(Preview::default()/* use setters */);
8033    /// ```
8034    pub fn set_preview<T>(mut self, v: T) -> Self
8035    where
8036        T: std::convert::Into<crate::model::Preview>,
8037    {
8038        self.preview = std::option::Option::Some(v.into());
8039        self
8040    }
8041
8042    /// Sets or clears the value of [preview][crate::model::CreatePreviewRequest::preview].
8043    ///
8044    /// # Example
8045    /// ```ignore,no_run
8046    /// # use google_cloud_config_v1::model::CreatePreviewRequest;
8047    /// use google_cloud_config_v1::model::Preview;
8048    /// let x = CreatePreviewRequest::new().set_or_clear_preview(Some(Preview::default()/* use setters */));
8049    /// let x = CreatePreviewRequest::new().set_or_clear_preview(None::<Preview>);
8050    /// ```
8051    pub fn set_or_clear_preview<T>(mut self, v: std::option::Option<T>) -> Self
8052    where
8053        T: std::convert::Into<crate::model::Preview>,
8054    {
8055        self.preview = v.map(|x| x.into());
8056        self
8057    }
8058
8059    /// Sets the value of [request_id][crate::model::CreatePreviewRequest::request_id].
8060    ///
8061    /// # Example
8062    /// ```ignore,no_run
8063    /// # use google_cloud_config_v1::model::CreatePreviewRequest;
8064    /// let x = CreatePreviewRequest::new().set_request_id("example");
8065    /// ```
8066    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8067        self.request_id = v.into();
8068        self
8069    }
8070}
8071
8072impl wkt::message::Message for CreatePreviewRequest {
8073    fn typename() -> &'static str {
8074        "type.googleapis.com/google.cloud.config.v1.CreatePreviewRequest"
8075    }
8076}
8077
8078/// A request to get details about a preview.
8079#[derive(Clone, Default, PartialEq)]
8080#[non_exhaustive]
8081pub struct GetPreviewRequest {
8082    /// Required. The name of the preview. Format:
8083    /// 'projects/{project_id}/locations/{location}/previews/{preview}'.
8084    pub name: std::string::String,
8085
8086    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8087}
8088
8089impl GetPreviewRequest {
8090    /// Creates a new default instance.
8091    pub fn new() -> Self {
8092        std::default::Default::default()
8093    }
8094
8095    /// Sets the value of [name][crate::model::GetPreviewRequest::name].
8096    ///
8097    /// # Example
8098    /// ```ignore,no_run
8099    /// # use google_cloud_config_v1::model::GetPreviewRequest;
8100    /// let x = GetPreviewRequest::new().set_name("example");
8101    /// ```
8102    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8103        self.name = v.into();
8104        self
8105    }
8106}
8107
8108impl wkt::message::Message for GetPreviewRequest {
8109    fn typename() -> &'static str {
8110        "type.googleapis.com/google.cloud.config.v1.GetPreviewRequest"
8111    }
8112}
8113
8114/// A request to list all previews for a given project and location.
8115#[derive(Clone, Default, PartialEq)]
8116#[non_exhaustive]
8117pub struct ListPreviewsRequest {
8118    /// Required. The parent in whose context the Previews are listed. The parent
8119    /// value is in the format: 'projects/{project_id}/locations/{location}'.
8120    pub parent: std::string::String,
8121
8122    /// Optional. When requesting a page of resources, 'page_size' specifies number
8123    /// of resources to return. If unspecified, at most 500 will be returned. The
8124    /// maximum value is 1000.
8125    pub page_size: i32,
8126
8127    /// Optional. Token returned by previous call to 'ListDeployments' which
8128    /// specifies the position in the list from where to continue listing the
8129    /// resources.
8130    pub page_token: std::string::String,
8131
8132    /// Optional. Lists the Deployments that match the filter expression. A filter
8133    /// expression filters the resources listed in the response. The expression
8134    /// must be of the form '{field} {operator} {value}' where operators: '<', '>',
8135    /// '<=', '>=', '!=', '=', ':' are supported (colon ':' represents a HAS
8136    /// operator which is roughly synonymous with equality). {field} can refer to a
8137    /// proto or JSON field, or a synthetic field. Field names can be camelCase or
8138    /// snake_case.
8139    ///
8140    /// Examples:
8141    ///
8142    /// - Filter by name:
8143    ///   name = "projects/foo/locations/us-central1/deployments/bar
8144    ///
8145    /// - Filter by labels:
8146    ///
8147    ///   - Resources that have a key called 'foo'
8148    ///     labels.foo:*
8149    ///   - Resources that have a key called 'foo' whose value is 'bar'
8150    ///     labels.foo = bar
8151    /// - Filter by state:
8152    ///
8153    ///   - Deployments in CREATING state.
8154    ///     state=CREATING
8155    pub filter: std::string::String,
8156
8157    /// Optional. Field to use to sort the list.
8158    pub order_by: std::string::String,
8159
8160    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8161}
8162
8163impl ListPreviewsRequest {
8164    /// Creates a new default instance.
8165    pub fn new() -> Self {
8166        std::default::Default::default()
8167    }
8168
8169    /// Sets the value of [parent][crate::model::ListPreviewsRequest::parent].
8170    ///
8171    /// # Example
8172    /// ```ignore,no_run
8173    /// # use google_cloud_config_v1::model::ListPreviewsRequest;
8174    /// let x = ListPreviewsRequest::new().set_parent("example");
8175    /// ```
8176    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8177        self.parent = v.into();
8178        self
8179    }
8180
8181    /// Sets the value of [page_size][crate::model::ListPreviewsRequest::page_size].
8182    ///
8183    /// # Example
8184    /// ```ignore,no_run
8185    /// # use google_cloud_config_v1::model::ListPreviewsRequest;
8186    /// let x = ListPreviewsRequest::new().set_page_size(42);
8187    /// ```
8188    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8189        self.page_size = v.into();
8190        self
8191    }
8192
8193    /// Sets the value of [page_token][crate::model::ListPreviewsRequest::page_token].
8194    ///
8195    /// # Example
8196    /// ```ignore,no_run
8197    /// # use google_cloud_config_v1::model::ListPreviewsRequest;
8198    /// let x = ListPreviewsRequest::new().set_page_token("example");
8199    /// ```
8200    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8201        self.page_token = v.into();
8202        self
8203    }
8204
8205    /// Sets the value of [filter][crate::model::ListPreviewsRequest::filter].
8206    ///
8207    /// # Example
8208    /// ```ignore,no_run
8209    /// # use google_cloud_config_v1::model::ListPreviewsRequest;
8210    /// let x = ListPreviewsRequest::new().set_filter("example");
8211    /// ```
8212    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8213        self.filter = v.into();
8214        self
8215    }
8216
8217    /// Sets the value of [order_by][crate::model::ListPreviewsRequest::order_by].
8218    ///
8219    /// # Example
8220    /// ```ignore,no_run
8221    /// # use google_cloud_config_v1::model::ListPreviewsRequest;
8222    /// let x = ListPreviewsRequest::new().set_order_by("example");
8223    /// ```
8224    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8225        self.order_by = v.into();
8226        self
8227    }
8228}
8229
8230impl wkt::message::Message for ListPreviewsRequest {
8231    fn typename() -> &'static str {
8232        "type.googleapis.com/google.cloud.config.v1.ListPreviewsRequest"
8233    }
8234}
8235
8236/// A response to a `ListPreviews` call. Contains a list of Previews.
8237#[derive(Clone, Default, PartialEq)]
8238#[non_exhaustive]
8239pub struct ListPreviewsResponse {
8240    /// List of [Previews][google.cloud.config.v1.Preview].
8241    ///
8242    /// [google.cloud.config.v1.Preview]: crate::model::Preview
8243    pub previews: std::vec::Vec<crate::model::Preview>,
8244
8245    /// Token to be supplied to the next ListPreviews request via `page_token`
8246    /// to obtain the next set of results.
8247    pub next_page_token: std::string::String,
8248
8249    /// Locations that could not be reached.
8250    pub unreachable: std::vec::Vec<std::string::String>,
8251
8252    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8253}
8254
8255impl ListPreviewsResponse {
8256    /// Creates a new default instance.
8257    pub fn new() -> Self {
8258        std::default::Default::default()
8259    }
8260
8261    /// Sets the value of [previews][crate::model::ListPreviewsResponse::previews].
8262    ///
8263    /// # Example
8264    /// ```ignore,no_run
8265    /// # use google_cloud_config_v1::model::ListPreviewsResponse;
8266    /// use google_cloud_config_v1::model::Preview;
8267    /// let x = ListPreviewsResponse::new()
8268    ///     .set_previews([
8269    ///         Preview::default()/* use setters */,
8270    ///         Preview::default()/* use (different) setters */,
8271    ///     ]);
8272    /// ```
8273    pub fn set_previews<T, V>(mut self, v: T) -> Self
8274    where
8275        T: std::iter::IntoIterator<Item = V>,
8276        V: std::convert::Into<crate::model::Preview>,
8277    {
8278        use std::iter::Iterator;
8279        self.previews = v.into_iter().map(|i| i.into()).collect();
8280        self
8281    }
8282
8283    /// Sets the value of [next_page_token][crate::model::ListPreviewsResponse::next_page_token].
8284    ///
8285    /// # Example
8286    /// ```ignore,no_run
8287    /// # use google_cloud_config_v1::model::ListPreviewsResponse;
8288    /// let x = ListPreviewsResponse::new().set_next_page_token("example");
8289    /// ```
8290    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8291        self.next_page_token = v.into();
8292        self
8293    }
8294
8295    /// Sets the value of [unreachable][crate::model::ListPreviewsResponse::unreachable].
8296    ///
8297    /// # Example
8298    /// ```ignore,no_run
8299    /// # use google_cloud_config_v1::model::ListPreviewsResponse;
8300    /// let x = ListPreviewsResponse::new().set_unreachable(["a", "b", "c"]);
8301    /// ```
8302    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
8303    where
8304        T: std::iter::IntoIterator<Item = V>,
8305        V: std::convert::Into<std::string::String>,
8306    {
8307        use std::iter::Iterator;
8308        self.unreachable = v.into_iter().map(|i| i.into()).collect();
8309        self
8310    }
8311}
8312
8313impl wkt::message::Message for ListPreviewsResponse {
8314    fn typename() -> &'static str {
8315        "type.googleapis.com/google.cloud.config.v1.ListPreviewsResponse"
8316    }
8317}
8318
8319#[doc(hidden)]
8320impl google_cloud_gax::paginator::internal::PageableResponse for ListPreviewsResponse {
8321    type PageItem = crate::model::Preview;
8322
8323    fn items(self) -> std::vec::Vec<Self::PageItem> {
8324        self.previews
8325    }
8326
8327    fn next_page_token(&self) -> std::string::String {
8328        use std::clone::Clone;
8329        self.next_page_token.clone()
8330    }
8331}
8332
8333/// A request to delete a preview.
8334#[derive(Clone, Default, PartialEq)]
8335#[non_exhaustive]
8336pub struct DeletePreviewRequest {
8337    /// Required. The name of the Preview in the format:
8338    /// 'projects/{project_id}/locations/{location}/previews/{preview}'.
8339    pub name: std::string::String,
8340
8341    /// Optional. An optional request ID to identify requests. Specify a unique
8342    /// request ID so that if you must retry your request, the server will know to
8343    /// ignore the request if it has already been completed. The server will
8344    /// guarantee that for at least 60 minutes after the first request.
8345    ///
8346    /// For example, consider a situation where you make an initial request and the
8347    /// request times out. If you make the request again with the same request ID,
8348    /// the server can check if original operation with the same request ID was
8349    /// received, and if so, will ignore the second request. This prevents clients
8350    /// from accidentally creating duplicate commitments.
8351    ///
8352    /// The request ID must be a valid UUID with the exception that zero UUID is
8353    /// not supported (00000000-0000-0000-0000-000000000000).
8354    pub request_id: std::string::String,
8355
8356    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8357}
8358
8359impl DeletePreviewRequest {
8360    /// Creates a new default instance.
8361    pub fn new() -> Self {
8362        std::default::Default::default()
8363    }
8364
8365    /// Sets the value of [name][crate::model::DeletePreviewRequest::name].
8366    ///
8367    /// # Example
8368    /// ```ignore,no_run
8369    /// # use google_cloud_config_v1::model::DeletePreviewRequest;
8370    /// let x = DeletePreviewRequest::new().set_name("example");
8371    /// ```
8372    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8373        self.name = v.into();
8374        self
8375    }
8376
8377    /// Sets the value of [request_id][crate::model::DeletePreviewRequest::request_id].
8378    ///
8379    /// # Example
8380    /// ```ignore,no_run
8381    /// # use google_cloud_config_v1::model::DeletePreviewRequest;
8382    /// let x = DeletePreviewRequest::new().set_request_id("example");
8383    /// ```
8384    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8385        self.request_id = v.into();
8386        self
8387    }
8388}
8389
8390impl wkt::message::Message for DeletePreviewRequest {
8391    fn typename() -> &'static str {
8392        "type.googleapis.com/google.cloud.config.v1.DeletePreviewRequest"
8393    }
8394}
8395
8396/// A request to export preview results.
8397#[derive(Clone, Default, PartialEq)]
8398#[non_exhaustive]
8399pub struct ExportPreviewResultRequest {
8400    /// Required. The preview whose results should be exported. The preview value
8401    /// is in the format:
8402    /// 'projects/{project_id}/locations/{location}/previews/{preview}'.
8403    pub parent: std::string::String,
8404
8405    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8406}
8407
8408impl ExportPreviewResultRequest {
8409    /// Creates a new default instance.
8410    pub fn new() -> Self {
8411        std::default::Default::default()
8412    }
8413
8414    /// Sets the value of [parent][crate::model::ExportPreviewResultRequest::parent].
8415    ///
8416    /// # Example
8417    /// ```ignore,no_run
8418    /// # use google_cloud_config_v1::model::ExportPreviewResultRequest;
8419    /// let x = ExportPreviewResultRequest::new().set_parent("example");
8420    /// ```
8421    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8422        self.parent = v.into();
8423        self
8424    }
8425}
8426
8427impl wkt::message::Message for ExportPreviewResultRequest {
8428    fn typename() -> &'static str {
8429        "type.googleapis.com/google.cloud.config.v1.ExportPreviewResultRequest"
8430    }
8431}
8432
8433/// A response to `ExportPreviewResult` call. Contains preview results.
8434#[derive(Clone, Default, PartialEq)]
8435#[non_exhaustive]
8436pub struct ExportPreviewResultResponse {
8437    /// Output only. Signed URLs for accessing the plan files.
8438    pub result: std::option::Option<crate::model::PreviewResult>,
8439
8440    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8441}
8442
8443impl ExportPreviewResultResponse {
8444    /// Creates a new default instance.
8445    pub fn new() -> Self {
8446        std::default::Default::default()
8447    }
8448
8449    /// Sets the value of [result][crate::model::ExportPreviewResultResponse::result].
8450    ///
8451    /// # Example
8452    /// ```ignore,no_run
8453    /// # use google_cloud_config_v1::model::ExportPreviewResultResponse;
8454    /// use google_cloud_config_v1::model::PreviewResult;
8455    /// let x = ExportPreviewResultResponse::new().set_result(PreviewResult::default()/* use setters */);
8456    /// ```
8457    pub fn set_result<T>(mut self, v: T) -> Self
8458    where
8459        T: std::convert::Into<crate::model::PreviewResult>,
8460    {
8461        self.result = std::option::Option::Some(v.into());
8462        self
8463    }
8464
8465    /// Sets or clears the value of [result][crate::model::ExportPreviewResultResponse::result].
8466    ///
8467    /// # Example
8468    /// ```ignore,no_run
8469    /// # use google_cloud_config_v1::model::ExportPreviewResultResponse;
8470    /// use google_cloud_config_v1::model::PreviewResult;
8471    /// let x = ExportPreviewResultResponse::new().set_or_clear_result(Some(PreviewResult::default()/* use setters */));
8472    /// let x = ExportPreviewResultResponse::new().set_or_clear_result(None::<PreviewResult>);
8473    /// ```
8474    pub fn set_or_clear_result<T>(mut self, v: std::option::Option<T>) -> Self
8475    where
8476        T: std::convert::Into<crate::model::PreviewResult>,
8477    {
8478        self.result = v.map(|x| x.into());
8479        self
8480    }
8481}
8482
8483impl wkt::message::Message for ExportPreviewResultResponse {
8484    fn typename() -> &'static str {
8485        "type.googleapis.com/google.cloud.config.v1.ExportPreviewResultResponse"
8486    }
8487}
8488
8489/// Contains a signed Cloud Storage URLs.
8490#[derive(Clone, Default, PartialEq)]
8491#[non_exhaustive]
8492pub struct PreviewResult {
8493    /// Output only. Plan binary signed URL
8494    pub binary_signed_uri: std::string::String,
8495
8496    /// Output only. Plan JSON signed URL
8497    pub json_signed_uri: std::string::String,
8498
8499    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8500}
8501
8502impl PreviewResult {
8503    /// Creates a new default instance.
8504    pub fn new() -> Self {
8505        std::default::Default::default()
8506    }
8507
8508    /// Sets the value of [binary_signed_uri][crate::model::PreviewResult::binary_signed_uri].
8509    ///
8510    /// # Example
8511    /// ```ignore,no_run
8512    /// # use google_cloud_config_v1::model::PreviewResult;
8513    /// let x = PreviewResult::new().set_binary_signed_uri("example");
8514    /// ```
8515    pub fn set_binary_signed_uri<T: std::convert::Into<std::string::String>>(
8516        mut self,
8517        v: T,
8518    ) -> Self {
8519        self.binary_signed_uri = v.into();
8520        self
8521    }
8522
8523    /// Sets the value of [json_signed_uri][crate::model::PreviewResult::json_signed_uri].
8524    ///
8525    /// # Example
8526    /// ```ignore,no_run
8527    /// # use google_cloud_config_v1::model::PreviewResult;
8528    /// let x = PreviewResult::new().set_json_signed_uri("example");
8529    /// ```
8530    pub fn set_json_signed_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8531        self.json_signed_uri = v.into();
8532        self
8533    }
8534}
8535
8536impl wkt::message::Message for PreviewResult {
8537    fn typename() -> &'static str {
8538        "type.googleapis.com/google.cloud.config.v1.PreviewResult"
8539    }
8540}
8541
8542/// The request message for the GetTerraformVersion method.
8543#[derive(Clone, Default, PartialEq)]
8544#[non_exhaustive]
8545pub struct GetTerraformVersionRequest {
8546    /// Required. The name of the TerraformVersion. Format:
8547    /// 'projects/{project_id}/locations/{location}/terraformVersions/{terraform_version}'
8548    pub name: std::string::String,
8549
8550    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8551}
8552
8553impl GetTerraformVersionRequest {
8554    /// Creates a new default instance.
8555    pub fn new() -> Self {
8556        std::default::Default::default()
8557    }
8558
8559    /// Sets the value of [name][crate::model::GetTerraformVersionRequest::name].
8560    ///
8561    /// # Example
8562    /// ```ignore,no_run
8563    /// # use google_cloud_config_v1::model::GetTerraformVersionRequest;
8564    /// let x = GetTerraformVersionRequest::new().set_name("example");
8565    /// ```
8566    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8567        self.name = v.into();
8568        self
8569    }
8570}
8571
8572impl wkt::message::Message for GetTerraformVersionRequest {
8573    fn typename() -> &'static str {
8574        "type.googleapis.com/google.cloud.config.v1.GetTerraformVersionRequest"
8575    }
8576}
8577
8578/// The request message for the ListTerraformVersions method.
8579#[derive(Clone, Default, PartialEq)]
8580#[non_exhaustive]
8581pub struct ListTerraformVersionsRequest {
8582    /// Required. The parent in whose context the TerraformVersions are listed. The
8583    /// parent value is in the format:
8584    /// 'projects/{project_id}/locations/{location}'.
8585    pub parent: std::string::String,
8586
8587    /// Optional. When requesting a page of terraform versions, 'page_size'
8588    /// specifies number of terraform versions to return. If unspecified, at most
8589    /// 500 will be returned. The maximum value is 1000.
8590    pub page_size: i32,
8591
8592    /// Optional. Token returned by previous call to 'ListTerraformVersions' which
8593    /// specifies the position in the list from where to continue listing the
8594    /// terraform versions.
8595    pub page_token: std::string::String,
8596
8597    /// Optional. Lists the TerraformVersions that match the filter expression. A
8598    /// filter expression filters the resources listed in the response. The
8599    /// expression must be of the form '{field} {operator} {value}' where
8600    /// operators: '<', '>',
8601    /// '<=', '>=', '!=', '=', ':' are supported (colon ':' represents a HAS
8602    /// operator which is roughly synonymous with equality). {field} can refer to a
8603    /// proto or JSON field, or a synthetic field. Field names can be camelCase or
8604    /// snake_case.
8605    pub filter: std::string::String,
8606
8607    /// Optional. Field to use to sort the list.
8608    pub order_by: std::string::String,
8609
8610    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8611}
8612
8613impl ListTerraformVersionsRequest {
8614    /// Creates a new default instance.
8615    pub fn new() -> Self {
8616        std::default::Default::default()
8617    }
8618
8619    /// Sets the value of [parent][crate::model::ListTerraformVersionsRequest::parent].
8620    ///
8621    /// # Example
8622    /// ```ignore,no_run
8623    /// # use google_cloud_config_v1::model::ListTerraformVersionsRequest;
8624    /// let x = ListTerraformVersionsRequest::new().set_parent("example");
8625    /// ```
8626    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8627        self.parent = v.into();
8628        self
8629    }
8630
8631    /// Sets the value of [page_size][crate::model::ListTerraformVersionsRequest::page_size].
8632    ///
8633    /// # Example
8634    /// ```ignore,no_run
8635    /// # use google_cloud_config_v1::model::ListTerraformVersionsRequest;
8636    /// let x = ListTerraformVersionsRequest::new().set_page_size(42);
8637    /// ```
8638    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8639        self.page_size = v.into();
8640        self
8641    }
8642
8643    /// Sets the value of [page_token][crate::model::ListTerraformVersionsRequest::page_token].
8644    ///
8645    /// # Example
8646    /// ```ignore,no_run
8647    /// # use google_cloud_config_v1::model::ListTerraformVersionsRequest;
8648    /// let x = ListTerraformVersionsRequest::new().set_page_token("example");
8649    /// ```
8650    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8651        self.page_token = v.into();
8652        self
8653    }
8654
8655    /// Sets the value of [filter][crate::model::ListTerraformVersionsRequest::filter].
8656    ///
8657    /// # Example
8658    /// ```ignore,no_run
8659    /// # use google_cloud_config_v1::model::ListTerraformVersionsRequest;
8660    /// let x = ListTerraformVersionsRequest::new().set_filter("example");
8661    /// ```
8662    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8663        self.filter = v.into();
8664        self
8665    }
8666
8667    /// Sets the value of [order_by][crate::model::ListTerraformVersionsRequest::order_by].
8668    ///
8669    /// # Example
8670    /// ```ignore,no_run
8671    /// # use google_cloud_config_v1::model::ListTerraformVersionsRequest;
8672    /// let x = ListTerraformVersionsRequest::new().set_order_by("example");
8673    /// ```
8674    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8675        self.order_by = v.into();
8676        self
8677    }
8678}
8679
8680impl wkt::message::Message for ListTerraformVersionsRequest {
8681    fn typename() -> &'static str {
8682        "type.googleapis.com/google.cloud.config.v1.ListTerraformVersionsRequest"
8683    }
8684}
8685
8686/// The response message for the `ListTerraformVersions` method.
8687#[derive(Clone, Default, PartialEq)]
8688#[non_exhaustive]
8689pub struct ListTerraformVersionsResponse {
8690    /// List of [TerraformVersion][google.cloud.config.v1.TerraformVersion]s.
8691    ///
8692    /// [google.cloud.config.v1.TerraformVersion]: crate::model::TerraformVersion
8693    pub terraform_versions: std::vec::Vec<crate::model::TerraformVersion>,
8694
8695    /// Token to be supplied to the next ListTerraformVersions request via
8696    /// `page_token` to obtain the next set of results.
8697    pub next_page_token: std::string::String,
8698
8699    /// Unreachable resources, if any.
8700    pub unreachable: std::vec::Vec<std::string::String>,
8701
8702    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8703}
8704
8705impl ListTerraformVersionsResponse {
8706    /// Creates a new default instance.
8707    pub fn new() -> Self {
8708        std::default::Default::default()
8709    }
8710
8711    /// Sets the value of [terraform_versions][crate::model::ListTerraformVersionsResponse::terraform_versions].
8712    ///
8713    /// # Example
8714    /// ```ignore,no_run
8715    /// # use google_cloud_config_v1::model::ListTerraformVersionsResponse;
8716    /// use google_cloud_config_v1::model::TerraformVersion;
8717    /// let x = ListTerraformVersionsResponse::new()
8718    ///     .set_terraform_versions([
8719    ///         TerraformVersion::default()/* use setters */,
8720    ///         TerraformVersion::default()/* use (different) setters */,
8721    ///     ]);
8722    /// ```
8723    pub fn set_terraform_versions<T, V>(mut self, v: T) -> Self
8724    where
8725        T: std::iter::IntoIterator<Item = V>,
8726        V: std::convert::Into<crate::model::TerraformVersion>,
8727    {
8728        use std::iter::Iterator;
8729        self.terraform_versions = v.into_iter().map(|i| i.into()).collect();
8730        self
8731    }
8732
8733    /// Sets the value of [next_page_token][crate::model::ListTerraformVersionsResponse::next_page_token].
8734    ///
8735    /// # Example
8736    /// ```ignore,no_run
8737    /// # use google_cloud_config_v1::model::ListTerraformVersionsResponse;
8738    /// let x = ListTerraformVersionsResponse::new().set_next_page_token("example");
8739    /// ```
8740    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8741        self.next_page_token = v.into();
8742        self
8743    }
8744
8745    /// Sets the value of [unreachable][crate::model::ListTerraformVersionsResponse::unreachable].
8746    ///
8747    /// # Example
8748    /// ```ignore,no_run
8749    /// # use google_cloud_config_v1::model::ListTerraformVersionsResponse;
8750    /// let x = ListTerraformVersionsResponse::new().set_unreachable(["a", "b", "c"]);
8751    /// ```
8752    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
8753    where
8754        T: std::iter::IntoIterator<Item = V>,
8755        V: std::convert::Into<std::string::String>,
8756    {
8757        use std::iter::Iterator;
8758        self.unreachable = v.into_iter().map(|i| i.into()).collect();
8759        self
8760    }
8761}
8762
8763impl wkt::message::Message for ListTerraformVersionsResponse {
8764    fn typename() -> &'static str {
8765        "type.googleapis.com/google.cloud.config.v1.ListTerraformVersionsResponse"
8766    }
8767}
8768
8769#[doc(hidden)]
8770impl google_cloud_gax::paginator::internal::PageableResponse for ListTerraformVersionsResponse {
8771    type PageItem = crate::model::TerraformVersion;
8772
8773    fn items(self) -> std::vec::Vec<Self::PageItem> {
8774        self.terraform_versions
8775    }
8776
8777    fn next_page_token(&self) -> std::string::String {
8778        use std::clone::Clone;
8779        self.next_page_token.clone()
8780    }
8781}
8782
8783/// A TerraformVersion represents the support state the corresponding
8784/// Terraform version.
8785#[derive(Clone, Default, PartialEq)]
8786#[non_exhaustive]
8787pub struct TerraformVersion {
8788    /// Identifier. The version name is in the format:
8789    /// 'projects/{project_id}/locations/{location}/terraformVersions/{terraform_version}'.
8790    pub name: std::string::String,
8791
8792    /// Output only. The state of the version, ACTIVE, DEPRECATED or OBSOLETE.
8793    pub state: crate::model::terraform_version::State,
8794
8795    /// Output only. When the version is supported.
8796    pub support_time: std::option::Option<wkt::Timestamp>,
8797
8798    /// Output only. When the version is deprecated.
8799    pub deprecate_time: std::option::Option<wkt::Timestamp>,
8800
8801    /// Output only. When the version is obsolete.
8802    pub obsolete_time: std::option::Option<wkt::Timestamp>,
8803
8804    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8805}
8806
8807impl TerraformVersion {
8808    /// Creates a new default instance.
8809    pub fn new() -> Self {
8810        std::default::Default::default()
8811    }
8812
8813    /// Sets the value of [name][crate::model::TerraformVersion::name].
8814    ///
8815    /// # Example
8816    /// ```ignore,no_run
8817    /// # use google_cloud_config_v1::model::TerraformVersion;
8818    /// let x = TerraformVersion::new().set_name("example");
8819    /// ```
8820    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8821        self.name = v.into();
8822        self
8823    }
8824
8825    /// Sets the value of [state][crate::model::TerraformVersion::state].
8826    ///
8827    /// # Example
8828    /// ```ignore,no_run
8829    /// # use google_cloud_config_v1::model::TerraformVersion;
8830    /// use google_cloud_config_v1::model::terraform_version::State;
8831    /// let x0 = TerraformVersion::new().set_state(State::Active);
8832    /// let x1 = TerraformVersion::new().set_state(State::Deprecated);
8833    /// let x2 = TerraformVersion::new().set_state(State::Obsolete);
8834    /// ```
8835    pub fn set_state<T: std::convert::Into<crate::model::terraform_version::State>>(
8836        mut self,
8837        v: T,
8838    ) -> Self {
8839        self.state = v.into();
8840        self
8841    }
8842
8843    /// Sets the value of [support_time][crate::model::TerraformVersion::support_time].
8844    ///
8845    /// # Example
8846    /// ```ignore,no_run
8847    /// # use google_cloud_config_v1::model::TerraformVersion;
8848    /// use wkt::Timestamp;
8849    /// let x = TerraformVersion::new().set_support_time(Timestamp::default()/* use setters */);
8850    /// ```
8851    pub fn set_support_time<T>(mut self, v: T) -> Self
8852    where
8853        T: std::convert::Into<wkt::Timestamp>,
8854    {
8855        self.support_time = std::option::Option::Some(v.into());
8856        self
8857    }
8858
8859    /// Sets or clears the value of [support_time][crate::model::TerraformVersion::support_time].
8860    ///
8861    /// # Example
8862    /// ```ignore,no_run
8863    /// # use google_cloud_config_v1::model::TerraformVersion;
8864    /// use wkt::Timestamp;
8865    /// let x = TerraformVersion::new().set_or_clear_support_time(Some(Timestamp::default()/* use setters */));
8866    /// let x = TerraformVersion::new().set_or_clear_support_time(None::<Timestamp>);
8867    /// ```
8868    pub fn set_or_clear_support_time<T>(mut self, v: std::option::Option<T>) -> Self
8869    where
8870        T: std::convert::Into<wkt::Timestamp>,
8871    {
8872        self.support_time = v.map(|x| x.into());
8873        self
8874    }
8875
8876    /// Sets the value of [deprecate_time][crate::model::TerraformVersion::deprecate_time].
8877    ///
8878    /// # Example
8879    /// ```ignore,no_run
8880    /// # use google_cloud_config_v1::model::TerraformVersion;
8881    /// use wkt::Timestamp;
8882    /// let x = TerraformVersion::new().set_deprecate_time(Timestamp::default()/* use setters */);
8883    /// ```
8884    pub fn set_deprecate_time<T>(mut self, v: T) -> Self
8885    where
8886        T: std::convert::Into<wkt::Timestamp>,
8887    {
8888        self.deprecate_time = std::option::Option::Some(v.into());
8889        self
8890    }
8891
8892    /// Sets or clears the value of [deprecate_time][crate::model::TerraformVersion::deprecate_time].
8893    ///
8894    /// # Example
8895    /// ```ignore,no_run
8896    /// # use google_cloud_config_v1::model::TerraformVersion;
8897    /// use wkt::Timestamp;
8898    /// let x = TerraformVersion::new().set_or_clear_deprecate_time(Some(Timestamp::default()/* use setters */));
8899    /// let x = TerraformVersion::new().set_or_clear_deprecate_time(None::<Timestamp>);
8900    /// ```
8901    pub fn set_or_clear_deprecate_time<T>(mut self, v: std::option::Option<T>) -> Self
8902    where
8903        T: std::convert::Into<wkt::Timestamp>,
8904    {
8905        self.deprecate_time = v.map(|x| x.into());
8906        self
8907    }
8908
8909    /// Sets the value of [obsolete_time][crate::model::TerraformVersion::obsolete_time].
8910    ///
8911    /// # Example
8912    /// ```ignore,no_run
8913    /// # use google_cloud_config_v1::model::TerraformVersion;
8914    /// use wkt::Timestamp;
8915    /// let x = TerraformVersion::new().set_obsolete_time(Timestamp::default()/* use setters */);
8916    /// ```
8917    pub fn set_obsolete_time<T>(mut self, v: T) -> Self
8918    where
8919        T: std::convert::Into<wkt::Timestamp>,
8920    {
8921        self.obsolete_time = std::option::Option::Some(v.into());
8922        self
8923    }
8924
8925    /// Sets or clears the value of [obsolete_time][crate::model::TerraformVersion::obsolete_time].
8926    ///
8927    /// # Example
8928    /// ```ignore,no_run
8929    /// # use google_cloud_config_v1::model::TerraformVersion;
8930    /// use wkt::Timestamp;
8931    /// let x = TerraformVersion::new().set_or_clear_obsolete_time(Some(Timestamp::default()/* use setters */));
8932    /// let x = TerraformVersion::new().set_or_clear_obsolete_time(None::<Timestamp>);
8933    /// ```
8934    pub fn set_or_clear_obsolete_time<T>(mut self, v: std::option::Option<T>) -> Self
8935    where
8936        T: std::convert::Into<wkt::Timestamp>,
8937    {
8938        self.obsolete_time = v.map(|x| x.into());
8939        self
8940    }
8941}
8942
8943impl wkt::message::Message for TerraformVersion {
8944    fn typename() -> &'static str {
8945        "type.googleapis.com/google.cloud.config.v1.TerraformVersion"
8946    }
8947}
8948
8949/// Defines additional types related to [TerraformVersion].
8950pub mod terraform_version {
8951    #[allow(unused_imports)]
8952    use super::*;
8953
8954    /// Possible states of a TerraformVersion.
8955    ///
8956    /// # Working with unknown values
8957    ///
8958    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8959    /// additional enum variants at any time. Adding new variants is not considered
8960    /// a breaking change. Applications should write their code in anticipation of:
8961    ///
8962    /// - New values appearing in future releases of the client library, **and**
8963    /// - New values received dynamically, without application changes.
8964    ///
8965    /// Please consult the [Working with enums] section in the user guide for some
8966    /// guidelines.
8967    ///
8968    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
8969    #[derive(Clone, Debug, PartialEq)]
8970    #[non_exhaustive]
8971    pub enum State {
8972        /// The default value. This value is used if the state is omitted.
8973        Unspecified,
8974        /// The version is actively supported.
8975        Active,
8976        /// The version is deprecated.
8977        Deprecated,
8978        /// The version is obsolete.
8979        Obsolete,
8980        /// If set, the enum was initialized with an unknown value.
8981        ///
8982        /// Applications can examine the value using [State::value] or
8983        /// [State::name].
8984        UnknownValue(state::UnknownValue),
8985    }
8986
8987    #[doc(hidden)]
8988    pub mod state {
8989        #[allow(unused_imports)]
8990        use super::*;
8991        #[derive(Clone, Debug, PartialEq)]
8992        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8993    }
8994
8995    impl State {
8996        /// Gets the enum value.
8997        ///
8998        /// Returns `None` if the enum contains an unknown value deserialized from
8999        /// the string representation of enums.
9000        pub fn value(&self) -> std::option::Option<i32> {
9001            match self {
9002                Self::Unspecified => std::option::Option::Some(0),
9003                Self::Active => std::option::Option::Some(1),
9004                Self::Deprecated => std::option::Option::Some(2),
9005                Self::Obsolete => std::option::Option::Some(3),
9006                Self::UnknownValue(u) => u.0.value(),
9007            }
9008        }
9009
9010        /// Gets the enum value as a string.
9011        ///
9012        /// Returns `None` if the enum contains an unknown value deserialized from
9013        /// the integer representation of enums.
9014        pub fn name(&self) -> std::option::Option<&str> {
9015            match self {
9016                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
9017                Self::Active => std::option::Option::Some("ACTIVE"),
9018                Self::Deprecated => std::option::Option::Some("DEPRECATED"),
9019                Self::Obsolete => std::option::Option::Some("OBSOLETE"),
9020                Self::UnknownValue(u) => u.0.name(),
9021            }
9022        }
9023    }
9024
9025    impl std::default::Default for State {
9026        fn default() -> Self {
9027            use std::convert::From;
9028            Self::from(0)
9029        }
9030    }
9031
9032    impl std::fmt::Display for State {
9033        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9034            wkt::internal::display_enum(f, self.name(), self.value())
9035        }
9036    }
9037
9038    impl std::convert::From<i32> for State {
9039        fn from(value: i32) -> Self {
9040            match value {
9041                0 => Self::Unspecified,
9042                1 => Self::Active,
9043                2 => Self::Deprecated,
9044                3 => Self::Obsolete,
9045                _ => Self::UnknownValue(state::UnknownValue(
9046                    wkt::internal::UnknownEnumValue::Integer(value),
9047                )),
9048            }
9049        }
9050    }
9051
9052    impl std::convert::From<&str> for State {
9053        fn from(value: &str) -> Self {
9054            use std::string::ToString;
9055            match value {
9056                "STATE_UNSPECIFIED" => Self::Unspecified,
9057                "ACTIVE" => Self::Active,
9058                "DEPRECATED" => Self::Deprecated,
9059                "OBSOLETE" => Self::Obsolete,
9060                _ => Self::UnknownValue(state::UnknownValue(
9061                    wkt::internal::UnknownEnumValue::String(value.to_string()),
9062                )),
9063            }
9064        }
9065    }
9066
9067    impl serde::ser::Serialize for State {
9068        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9069        where
9070            S: serde::Serializer,
9071        {
9072            match self {
9073                Self::Unspecified => serializer.serialize_i32(0),
9074                Self::Active => serializer.serialize_i32(1),
9075                Self::Deprecated => serializer.serialize_i32(2),
9076                Self::Obsolete => serializer.serialize_i32(3),
9077                Self::UnknownValue(u) => u.0.serialize(serializer),
9078            }
9079        }
9080    }
9081
9082    impl<'de> serde::de::Deserialize<'de> for State {
9083        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9084        where
9085            D: serde::Deserializer<'de>,
9086        {
9087            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
9088                ".google.cloud.config.v1.TerraformVersion.State",
9089            ))
9090        }
9091    }
9092}
9093
9094/// Terraform info of a ResourceChange.
9095#[derive(Clone, Default, PartialEq)]
9096#[non_exhaustive]
9097pub struct ResourceChangeTerraformInfo {
9098    /// Output only. TF resource address that uniquely identifies the resource.
9099    pub address: std::string::String,
9100
9101    /// Output only. TF resource type.
9102    pub r#type: std::string::String,
9103
9104    /// Output only. TF resource name.
9105    pub resource_name: std::string::String,
9106
9107    /// Output only. TF resource provider.
9108    pub provider: std::string::String,
9109
9110    /// Output only. TF resource actions.
9111    pub actions: std::vec::Vec<std::string::String>,
9112
9113    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9114}
9115
9116impl ResourceChangeTerraformInfo {
9117    /// Creates a new default instance.
9118    pub fn new() -> Self {
9119        std::default::Default::default()
9120    }
9121
9122    /// Sets the value of [address][crate::model::ResourceChangeTerraformInfo::address].
9123    ///
9124    /// # Example
9125    /// ```ignore,no_run
9126    /// # use google_cloud_config_v1::model::ResourceChangeTerraformInfo;
9127    /// let x = ResourceChangeTerraformInfo::new().set_address("example");
9128    /// ```
9129    pub fn set_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9130        self.address = v.into();
9131        self
9132    }
9133
9134    /// Sets the value of [r#type][crate::model::ResourceChangeTerraformInfo::type].
9135    ///
9136    /// # Example
9137    /// ```ignore,no_run
9138    /// # use google_cloud_config_v1::model::ResourceChangeTerraformInfo;
9139    /// let x = ResourceChangeTerraformInfo::new().set_type("example");
9140    /// ```
9141    pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9142        self.r#type = v.into();
9143        self
9144    }
9145
9146    /// Sets the value of [resource_name][crate::model::ResourceChangeTerraformInfo::resource_name].
9147    ///
9148    /// # Example
9149    /// ```ignore,no_run
9150    /// # use google_cloud_config_v1::model::ResourceChangeTerraformInfo;
9151    /// let x = ResourceChangeTerraformInfo::new().set_resource_name("example");
9152    /// ```
9153    pub fn set_resource_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9154        self.resource_name = v.into();
9155        self
9156    }
9157
9158    /// Sets the value of [provider][crate::model::ResourceChangeTerraformInfo::provider].
9159    ///
9160    /// # Example
9161    /// ```ignore,no_run
9162    /// # use google_cloud_config_v1::model::ResourceChangeTerraformInfo;
9163    /// let x = ResourceChangeTerraformInfo::new().set_provider("example");
9164    /// ```
9165    pub fn set_provider<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9166        self.provider = v.into();
9167        self
9168    }
9169
9170    /// Sets the value of [actions][crate::model::ResourceChangeTerraformInfo::actions].
9171    ///
9172    /// # Example
9173    /// ```ignore,no_run
9174    /// # use google_cloud_config_v1::model::ResourceChangeTerraformInfo;
9175    /// let x = ResourceChangeTerraformInfo::new().set_actions(["a", "b", "c"]);
9176    /// ```
9177    pub fn set_actions<T, V>(mut self, v: T) -> Self
9178    where
9179        T: std::iter::IntoIterator<Item = V>,
9180        V: std::convert::Into<std::string::String>,
9181    {
9182        use std::iter::Iterator;
9183        self.actions = v.into_iter().map(|i| i.into()).collect();
9184        self
9185    }
9186}
9187
9188impl wkt::message::Message for ResourceChangeTerraformInfo {
9189    fn typename() -> &'static str {
9190        "type.googleapis.com/google.cloud.config.v1.ResourceChangeTerraformInfo"
9191    }
9192}
9193
9194/// A resource change represents a change to a resource in the state file.
9195#[derive(Clone, Default, PartialEq)]
9196#[non_exhaustive]
9197pub struct ResourceChange {
9198    /// Identifier. The name of the resource change.
9199    /// Format:
9200    /// 'projects/{project_id}/locations/{location}/previews/{preview}/resourceChanges/{resource_change}'.
9201    pub name: std::string::String,
9202
9203    /// Output only. Terraform info of the resource change.
9204    pub terraform_info: std::option::Option<crate::model::ResourceChangeTerraformInfo>,
9205
9206    /// Output only. The intent of the resource change.
9207    pub intent: crate::model::resource_change::Intent,
9208
9209    /// Output only. The property changes of the resource change.
9210    pub property_changes: std::vec::Vec<crate::model::PropertyChange>,
9211
9212    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9213}
9214
9215impl ResourceChange {
9216    /// Creates a new default instance.
9217    pub fn new() -> Self {
9218        std::default::Default::default()
9219    }
9220
9221    /// Sets the value of [name][crate::model::ResourceChange::name].
9222    ///
9223    /// # Example
9224    /// ```ignore,no_run
9225    /// # use google_cloud_config_v1::model::ResourceChange;
9226    /// let x = ResourceChange::new().set_name("example");
9227    /// ```
9228    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9229        self.name = v.into();
9230        self
9231    }
9232
9233    /// Sets the value of [terraform_info][crate::model::ResourceChange::terraform_info].
9234    ///
9235    /// # Example
9236    /// ```ignore,no_run
9237    /// # use google_cloud_config_v1::model::ResourceChange;
9238    /// use google_cloud_config_v1::model::ResourceChangeTerraformInfo;
9239    /// let x = ResourceChange::new().set_terraform_info(ResourceChangeTerraformInfo::default()/* use setters */);
9240    /// ```
9241    pub fn set_terraform_info<T>(mut self, v: T) -> Self
9242    where
9243        T: std::convert::Into<crate::model::ResourceChangeTerraformInfo>,
9244    {
9245        self.terraform_info = std::option::Option::Some(v.into());
9246        self
9247    }
9248
9249    /// Sets or clears the value of [terraform_info][crate::model::ResourceChange::terraform_info].
9250    ///
9251    /// # Example
9252    /// ```ignore,no_run
9253    /// # use google_cloud_config_v1::model::ResourceChange;
9254    /// use google_cloud_config_v1::model::ResourceChangeTerraformInfo;
9255    /// let x = ResourceChange::new().set_or_clear_terraform_info(Some(ResourceChangeTerraformInfo::default()/* use setters */));
9256    /// let x = ResourceChange::new().set_or_clear_terraform_info(None::<ResourceChangeTerraformInfo>);
9257    /// ```
9258    pub fn set_or_clear_terraform_info<T>(mut self, v: std::option::Option<T>) -> Self
9259    where
9260        T: std::convert::Into<crate::model::ResourceChangeTerraformInfo>,
9261    {
9262        self.terraform_info = v.map(|x| x.into());
9263        self
9264    }
9265
9266    /// Sets the value of [intent][crate::model::ResourceChange::intent].
9267    ///
9268    /// # Example
9269    /// ```ignore,no_run
9270    /// # use google_cloud_config_v1::model::ResourceChange;
9271    /// use google_cloud_config_v1::model::resource_change::Intent;
9272    /// let x0 = ResourceChange::new().set_intent(Intent::Create);
9273    /// let x1 = ResourceChange::new().set_intent(Intent::Update);
9274    /// let x2 = ResourceChange::new().set_intent(Intent::Delete);
9275    /// ```
9276    pub fn set_intent<T: std::convert::Into<crate::model::resource_change::Intent>>(
9277        mut self,
9278        v: T,
9279    ) -> Self {
9280        self.intent = v.into();
9281        self
9282    }
9283
9284    /// Sets the value of [property_changes][crate::model::ResourceChange::property_changes].
9285    ///
9286    /// # Example
9287    /// ```ignore,no_run
9288    /// # use google_cloud_config_v1::model::ResourceChange;
9289    /// use google_cloud_config_v1::model::PropertyChange;
9290    /// let x = ResourceChange::new()
9291    ///     .set_property_changes([
9292    ///         PropertyChange::default()/* use setters */,
9293    ///         PropertyChange::default()/* use (different) setters */,
9294    ///     ]);
9295    /// ```
9296    pub fn set_property_changes<T, V>(mut self, v: T) -> Self
9297    where
9298        T: std::iter::IntoIterator<Item = V>,
9299        V: std::convert::Into<crate::model::PropertyChange>,
9300    {
9301        use std::iter::Iterator;
9302        self.property_changes = v.into_iter().map(|i| i.into()).collect();
9303        self
9304    }
9305}
9306
9307impl wkt::message::Message for ResourceChange {
9308    fn typename() -> &'static str {
9309        "type.googleapis.com/google.cloud.config.v1.ResourceChange"
9310    }
9311}
9312
9313/// Defines additional types related to [ResourceChange].
9314pub mod resource_change {
9315    #[allow(unused_imports)]
9316    use super::*;
9317
9318    /// Possible intent of the resource change.
9319    ///
9320    /// # Working with unknown values
9321    ///
9322    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9323    /// additional enum variants at any time. Adding new variants is not considered
9324    /// a breaking change. Applications should write their code in anticipation of:
9325    ///
9326    /// - New values appearing in future releases of the client library, **and**
9327    /// - New values received dynamically, without application changes.
9328    ///
9329    /// Please consult the [Working with enums] section in the user guide for some
9330    /// guidelines.
9331    ///
9332    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
9333    #[derive(Clone, Debug, PartialEq)]
9334    #[non_exhaustive]
9335    pub enum Intent {
9336        /// The default value.
9337        Unspecified,
9338        /// The resource will be created.
9339        Create,
9340        /// The resource will be updated.
9341        Update,
9342        /// The resource will be deleted.
9343        Delete,
9344        /// The resource will be recreated.
9345        Recreate,
9346        /// The resource will be untouched.
9347        Unchanged,
9348        /// If set, the enum was initialized with an unknown value.
9349        ///
9350        /// Applications can examine the value using [Intent::value] or
9351        /// [Intent::name].
9352        UnknownValue(intent::UnknownValue),
9353    }
9354
9355    #[doc(hidden)]
9356    pub mod intent {
9357        #[allow(unused_imports)]
9358        use super::*;
9359        #[derive(Clone, Debug, PartialEq)]
9360        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9361    }
9362
9363    impl Intent {
9364        /// Gets the enum value.
9365        ///
9366        /// Returns `None` if the enum contains an unknown value deserialized from
9367        /// the string representation of enums.
9368        pub fn value(&self) -> std::option::Option<i32> {
9369            match self {
9370                Self::Unspecified => std::option::Option::Some(0),
9371                Self::Create => std::option::Option::Some(1),
9372                Self::Update => std::option::Option::Some(2),
9373                Self::Delete => std::option::Option::Some(3),
9374                Self::Recreate => std::option::Option::Some(4),
9375                Self::Unchanged => std::option::Option::Some(5),
9376                Self::UnknownValue(u) => u.0.value(),
9377            }
9378        }
9379
9380        /// Gets the enum value as a string.
9381        ///
9382        /// Returns `None` if the enum contains an unknown value deserialized from
9383        /// the integer representation of enums.
9384        pub fn name(&self) -> std::option::Option<&str> {
9385            match self {
9386                Self::Unspecified => std::option::Option::Some("INTENT_UNSPECIFIED"),
9387                Self::Create => std::option::Option::Some("CREATE"),
9388                Self::Update => std::option::Option::Some("UPDATE"),
9389                Self::Delete => std::option::Option::Some("DELETE"),
9390                Self::Recreate => std::option::Option::Some("RECREATE"),
9391                Self::Unchanged => std::option::Option::Some("UNCHANGED"),
9392                Self::UnknownValue(u) => u.0.name(),
9393            }
9394        }
9395    }
9396
9397    impl std::default::Default for Intent {
9398        fn default() -> Self {
9399            use std::convert::From;
9400            Self::from(0)
9401        }
9402    }
9403
9404    impl std::fmt::Display for Intent {
9405        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9406            wkt::internal::display_enum(f, self.name(), self.value())
9407        }
9408    }
9409
9410    impl std::convert::From<i32> for Intent {
9411        fn from(value: i32) -> Self {
9412            match value {
9413                0 => Self::Unspecified,
9414                1 => Self::Create,
9415                2 => Self::Update,
9416                3 => Self::Delete,
9417                4 => Self::Recreate,
9418                5 => Self::Unchanged,
9419                _ => Self::UnknownValue(intent::UnknownValue(
9420                    wkt::internal::UnknownEnumValue::Integer(value),
9421                )),
9422            }
9423        }
9424    }
9425
9426    impl std::convert::From<&str> for Intent {
9427        fn from(value: &str) -> Self {
9428            use std::string::ToString;
9429            match value {
9430                "INTENT_UNSPECIFIED" => Self::Unspecified,
9431                "CREATE" => Self::Create,
9432                "UPDATE" => Self::Update,
9433                "DELETE" => Self::Delete,
9434                "RECREATE" => Self::Recreate,
9435                "UNCHANGED" => Self::Unchanged,
9436                _ => Self::UnknownValue(intent::UnknownValue(
9437                    wkt::internal::UnknownEnumValue::String(value.to_string()),
9438                )),
9439            }
9440        }
9441    }
9442
9443    impl serde::ser::Serialize for Intent {
9444        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9445        where
9446            S: serde::Serializer,
9447        {
9448            match self {
9449                Self::Unspecified => serializer.serialize_i32(0),
9450                Self::Create => serializer.serialize_i32(1),
9451                Self::Update => serializer.serialize_i32(2),
9452                Self::Delete => serializer.serialize_i32(3),
9453                Self::Recreate => serializer.serialize_i32(4),
9454                Self::Unchanged => serializer.serialize_i32(5),
9455                Self::UnknownValue(u) => u.0.serialize(serializer),
9456            }
9457        }
9458    }
9459
9460    impl<'de> serde::de::Deserialize<'de> for Intent {
9461        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9462        where
9463            D: serde::Deserializer<'de>,
9464        {
9465            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Intent>::new(
9466                ".google.cloud.config.v1.ResourceChange.Intent",
9467            ))
9468        }
9469    }
9470}
9471
9472/// A property change represents a change to a property in the state file.
9473#[derive(Clone, Default, PartialEq)]
9474#[non_exhaustive]
9475pub struct PropertyChange {
9476    /// Output only. The path of the property change.
9477    pub path: std::string::String,
9478
9479    /// Output only. The paths of sensitive fields in `before`. Paths are relative
9480    /// to `path`.
9481    pub before_sensitive_paths: std::vec::Vec<std::string::String>,
9482
9483    /// Output only. Representations of the object value before the actions.
9484    pub before: std::option::Option<wkt::Value>,
9485
9486    /// Output only. The paths of sensitive fields in `after`. Paths are relative
9487    /// to `path`.
9488    pub after_sensitive_paths: std::vec::Vec<std::string::String>,
9489
9490    /// Output only. Representations of the object value after the actions.
9491    pub after: std::option::Option<wkt::Value>,
9492
9493    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9494}
9495
9496impl PropertyChange {
9497    /// Creates a new default instance.
9498    pub fn new() -> Self {
9499        std::default::Default::default()
9500    }
9501
9502    /// Sets the value of [path][crate::model::PropertyChange::path].
9503    ///
9504    /// # Example
9505    /// ```ignore,no_run
9506    /// # use google_cloud_config_v1::model::PropertyChange;
9507    /// let x = PropertyChange::new().set_path("example");
9508    /// ```
9509    pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9510        self.path = v.into();
9511        self
9512    }
9513
9514    /// Sets the value of [before_sensitive_paths][crate::model::PropertyChange::before_sensitive_paths].
9515    ///
9516    /// # Example
9517    /// ```ignore,no_run
9518    /// # use google_cloud_config_v1::model::PropertyChange;
9519    /// let x = PropertyChange::new().set_before_sensitive_paths(["a", "b", "c"]);
9520    /// ```
9521    pub fn set_before_sensitive_paths<T, V>(mut self, v: T) -> Self
9522    where
9523        T: std::iter::IntoIterator<Item = V>,
9524        V: std::convert::Into<std::string::String>,
9525    {
9526        use std::iter::Iterator;
9527        self.before_sensitive_paths = v.into_iter().map(|i| i.into()).collect();
9528        self
9529    }
9530
9531    /// Sets the value of [before][crate::model::PropertyChange::before].
9532    ///
9533    /// # Example
9534    /// ```ignore,no_run
9535    /// # use google_cloud_config_v1::model::PropertyChange;
9536    /// use wkt::Value;
9537    /// let x = PropertyChange::new().set_before(Value::default()/* use setters */);
9538    /// ```
9539    pub fn set_before<T>(mut self, v: T) -> Self
9540    where
9541        T: std::convert::Into<wkt::Value>,
9542    {
9543        self.before = std::option::Option::Some(v.into());
9544        self
9545    }
9546
9547    /// Sets or clears the value of [before][crate::model::PropertyChange::before].
9548    ///
9549    /// # Example
9550    /// ```ignore,no_run
9551    /// # use google_cloud_config_v1::model::PropertyChange;
9552    /// use wkt::Value;
9553    /// let x = PropertyChange::new().set_or_clear_before(Some(Value::default()/* use setters */));
9554    /// let x = PropertyChange::new().set_or_clear_before(None::<Value>);
9555    /// ```
9556    pub fn set_or_clear_before<T>(mut self, v: std::option::Option<T>) -> Self
9557    where
9558        T: std::convert::Into<wkt::Value>,
9559    {
9560        self.before = v.map(|x| x.into());
9561        self
9562    }
9563
9564    /// Sets the value of [after_sensitive_paths][crate::model::PropertyChange::after_sensitive_paths].
9565    ///
9566    /// # Example
9567    /// ```ignore,no_run
9568    /// # use google_cloud_config_v1::model::PropertyChange;
9569    /// let x = PropertyChange::new().set_after_sensitive_paths(["a", "b", "c"]);
9570    /// ```
9571    pub fn set_after_sensitive_paths<T, V>(mut self, v: T) -> Self
9572    where
9573        T: std::iter::IntoIterator<Item = V>,
9574        V: std::convert::Into<std::string::String>,
9575    {
9576        use std::iter::Iterator;
9577        self.after_sensitive_paths = v.into_iter().map(|i| i.into()).collect();
9578        self
9579    }
9580
9581    /// Sets the value of [after][crate::model::PropertyChange::after].
9582    ///
9583    /// # Example
9584    /// ```ignore,no_run
9585    /// # use google_cloud_config_v1::model::PropertyChange;
9586    /// use wkt::Value;
9587    /// let x = PropertyChange::new().set_after(Value::default()/* use setters */);
9588    /// ```
9589    pub fn set_after<T>(mut self, v: T) -> Self
9590    where
9591        T: std::convert::Into<wkt::Value>,
9592    {
9593        self.after = std::option::Option::Some(v.into());
9594        self
9595    }
9596
9597    /// Sets or clears the value of [after][crate::model::PropertyChange::after].
9598    ///
9599    /// # Example
9600    /// ```ignore,no_run
9601    /// # use google_cloud_config_v1::model::PropertyChange;
9602    /// use wkt::Value;
9603    /// let x = PropertyChange::new().set_or_clear_after(Some(Value::default()/* use setters */));
9604    /// let x = PropertyChange::new().set_or_clear_after(None::<Value>);
9605    /// ```
9606    pub fn set_or_clear_after<T>(mut self, v: std::option::Option<T>) -> Self
9607    where
9608        T: std::convert::Into<wkt::Value>,
9609    {
9610        self.after = v.map(|x| x.into());
9611        self
9612    }
9613}
9614
9615impl wkt::message::Message for PropertyChange {
9616    fn typename() -> &'static str {
9617        "type.googleapis.com/google.cloud.config.v1.PropertyChange"
9618    }
9619}
9620
9621/// The request message for the ListResourceChanges method.
9622#[derive(Clone, Default, PartialEq)]
9623#[non_exhaustive]
9624pub struct ListResourceChangesRequest {
9625    /// Required. The parent in whose context the ResourceChanges are listed. The
9626    /// parent value is in the format:
9627    /// 'projects/{project_id}/locations/{location}/previews/{preview}'.
9628    pub parent: std::string::String,
9629
9630    /// Optional. When requesting a page of resource changes, 'page_size' specifies
9631    /// number of resource changes to return. If unspecified, at most 500 will be
9632    /// returned. The maximum value is 1000.
9633    pub page_size: i32,
9634
9635    /// Optional. Token returned by previous call to 'ListResourceChanges' which
9636    /// specifies the position in the list from where to continue listing the
9637    /// resource changes.
9638    pub page_token: std::string::String,
9639
9640    /// Optional. Lists the resource changes that match the filter expression. A
9641    /// filter expression filters the resource changes listed in the response. The
9642    /// expression must be of the form '{field} {operator} {value}' where
9643    /// operators: '<', '>',
9644    /// '<=',
9645    /// '>=',
9646    /// '!=', '=', ':' are supported (colon ':' represents a HAS operator which is
9647    /// roughly synonymous with equality). {field} can refer to a proto or JSON
9648    /// field, or a synthetic field. Field names can be camelCase or snake_case.
9649    ///
9650    /// Examples:
9651    ///
9652    /// - Filter by name:
9653    ///   name =
9654    ///   "projects/foo/locations/us-central1/previews/dep/resourceChanges/baz
9655    pub filter: std::string::String,
9656
9657    /// Optional. Field to use to sort the list.
9658    pub order_by: std::string::String,
9659
9660    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9661}
9662
9663impl ListResourceChangesRequest {
9664    /// Creates a new default instance.
9665    pub fn new() -> Self {
9666        std::default::Default::default()
9667    }
9668
9669    /// Sets the value of [parent][crate::model::ListResourceChangesRequest::parent].
9670    ///
9671    /// # Example
9672    /// ```ignore,no_run
9673    /// # use google_cloud_config_v1::model::ListResourceChangesRequest;
9674    /// let x = ListResourceChangesRequest::new().set_parent("example");
9675    /// ```
9676    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9677        self.parent = v.into();
9678        self
9679    }
9680
9681    /// Sets the value of [page_size][crate::model::ListResourceChangesRequest::page_size].
9682    ///
9683    /// # Example
9684    /// ```ignore,no_run
9685    /// # use google_cloud_config_v1::model::ListResourceChangesRequest;
9686    /// let x = ListResourceChangesRequest::new().set_page_size(42);
9687    /// ```
9688    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9689        self.page_size = v.into();
9690        self
9691    }
9692
9693    /// Sets the value of [page_token][crate::model::ListResourceChangesRequest::page_token].
9694    ///
9695    /// # Example
9696    /// ```ignore,no_run
9697    /// # use google_cloud_config_v1::model::ListResourceChangesRequest;
9698    /// let x = ListResourceChangesRequest::new().set_page_token("example");
9699    /// ```
9700    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9701        self.page_token = v.into();
9702        self
9703    }
9704
9705    /// Sets the value of [filter][crate::model::ListResourceChangesRequest::filter].
9706    ///
9707    /// # Example
9708    /// ```ignore,no_run
9709    /// # use google_cloud_config_v1::model::ListResourceChangesRequest;
9710    /// let x = ListResourceChangesRequest::new().set_filter("example");
9711    /// ```
9712    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9713        self.filter = v.into();
9714        self
9715    }
9716
9717    /// Sets the value of [order_by][crate::model::ListResourceChangesRequest::order_by].
9718    ///
9719    /// # Example
9720    /// ```ignore,no_run
9721    /// # use google_cloud_config_v1::model::ListResourceChangesRequest;
9722    /// let x = ListResourceChangesRequest::new().set_order_by("example");
9723    /// ```
9724    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9725        self.order_by = v.into();
9726        self
9727    }
9728}
9729
9730impl wkt::message::Message for ListResourceChangesRequest {
9731    fn typename() -> &'static str {
9732        "type.googleapis.com/google.cloud.config.v1.ListResourceChangesRequest"
9733    }
9734}
9735
9736/// A response to a 'ListResourceChanges' call. Contains a list of
9737/// ResourceChanges.
9738#[derive(Clone, Default, PartialEq)]
9739#[non_exhaustive]
9740pub struct ListResourceChangesResponse {
9741    /// List of ResourceChanges.
9742    pub resource_changes: std::vec::Vec<crate::model::ResourceChange>,
9743
9744    /// A token to request the next page of resources from the
9745    /// 'ListResourceChanges' method. The value of an empty string means that
9746    /// there are no more resources to return.
9747    pub next_page_token: std::string::String,
9748
9749    /// Unreachable resources, if any.
9750    pub unreachable: std::vec::Vec<std::string::String>,
9751
9752    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9753}
9754
9755impl ListResourceChangesResponse {
9756    /// Creates a new default instance.
9757    pub fn new() -> Self {
9758        std::default::Default::default()
9759    }
9760
9761    /// Sets the value of [resource_changes][crate::model::ListResourceChangesResponse::resource_changes].
9762    ///
9763    /// # Example
9764    /// ```ignore,no_run
9765    /// # use google_cloud_config_v1::model::ListResourceChangesResponse;
9766    /// use google_cloud_config_v1::model::ResourceChange;
9767    /// let x = ListResourceChangesResponse::new()
9768    ///     .set_resource_changes([
9769    ///         ResourceChange::default()/* use setters */,
9770    ///         ResourceChange::default()/* use (different) setters */,
9771    ///     ]);
9772    /// ```
9773    pub fn set_resource_changes<T, V>(mut self, v: T) -> Self
9774    where
9775        T: std::iter::IntoIterator<Item = V>,
9776        V: std::convert::Into<crate::model::ResourceChange>,
9777    {
9778        use std::iter::Iterator;
9779        self.resource_changes = v.into_iter().map(|i| i.into()).collect();
9780        self
9781    }
9782
9783    /// Sets the value of [next_page_token][crate::model::ListResourceChangesResponse::next_page_token].
9784    ///
9785    /// # Example
9786    /// ```ignore,no_run
9787    /// # use google_cloud_config_v1::model::ListResourceChangesResponse;
9788    /// let x = ListResourceChangesResponse::new().set_next_page_token("example");
9789    /// ```
9790    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9791        self.next_page_token = v.into();
9792        self
9793    }
9794
9795    /// Sets the value of [unreachable][crate::model::ListResourceChangesResponse::unreachable].
9796    ///
9797    /// # Example
9798    /// ```ignore,no_run
9799    /// # use google_cloud_config_v1::model::ListResourceChangesResponse;
9800    /// let x = ListResourceChangesResponse::new().set_unreachable(["a", "b", "c"]);
9801    /// ```
9802    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
9803    where
9804        T: std::iter::IntoIterator<Item = V>,
9805        V: std::convert::Into<std::string::String>,
9806    {
9807        use std::iter::Iterator;
9808        self.unreachable = v.into_iter().map(|i| i.into()).collect();
9809        self
9810    }
9811}
9812
9813impl wkt::message::Message for ListResourceChangesResponse {
9814    fn typename() -> &'static str {
9815        "type.googleapis.com/google.cloud.config.v1.ListResourceChangesResponse"
9816    }
9817}
9818
9819#[doc(hidden)]
9820impl google_cloud_gax::paginator::internal::PageableResponse for ListResourceChangesResponse {
9821    type PageItem = crate::model::ResourceChange;
9822
9823    fn items(self) -> std::vec::Vec<Self::PageItem> {
9824        self.resource_changes
9825    }
9826
9827    fn next_page_token(&self) -> std::string::String {
9828        use std::clone::Clone;
9829        self.next_page_token.clone()
9830    }
9831}
9832
9833/// The request message for the GetResourceChange method.
9834#[derive(Clone, Default, PartialEq)]
9835#[non_exhaustive]
9836pub struct GetResourceChangeRequest {
9837    /// Required. The name of the resource change to retrieve.
9838    /// Format:
9839    /// 'projects/{project_id}/locations/{location}/previews/{preview}/resourceChanges/{resource_change}'.
9840    pub name: std::string::String,
9841
9842    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9843}
9844
9845impl GetResourceChangeRequest {
9846    /// Creates a new default instance.
9847    pub fn new() -> Self {
9848        std::default::Default::default()
9849    }
9850
9851    /// Sets the value of [name][crate::model::GetResourceChangeRequest::name].
9852    ///
9853    /// # Example
9854    /// ```ignore,no_run
9855    /// # use google_cloud_config_v1::model::GetResourceChangeRequest;
9856    /// let x = GetResourceChangeRequest::new().set_name("example");
9857    /// ```
9858    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9859        self.name = v.into();
9860        self
9861    }
9862}
9863
9864impl wkt::message::Message for GetResourceChangeRequest {
9865    fn typename() -> &'static str {
9866        "type.googleapis.com/google.cloud.config.v1.GetResourceChangeRequest"
9867    }
9868}
9869
9870/// Terraform info of a ResourceChange.
9871#[derive(Clone, Default, PartialEq)]
9872#[non_exhaustive]
9873pub struct ResourceDriftTerraformInfo {
9874    /// Output only. The address of the drifted resource.
9875    pub address: std::string::String,
9876
9877    /// Output only. The type of the drifted resource.
9878    pub r#type: std::string::String,
9879
9880    /// Output only. TF resource name.
9881    pub resource_name: std::string::String,
9882
9883    /// Output only. The provider of the drifted resource.
9884    pub provider: std::string::String,
9885
9886    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9887}
9888
9889impl ResourceDriftTerraformInfo {
9890    /// Creates a new default instance.
9891    pub fn new() -> Self {
9892        std::default::Default::default()
9893    }
9894
9895    /// Sets the value of [address][crate::model::ResourceDriftTerraformInfo::address].
9896    ///
9897    /// # Example
9898    /// ```ignore,no_run
9899    /// # use google_cloud_config_v1::model::ResourceDriftTerraformInfo;
9900    /// let x = ResourceDriftTerraformInfo::new().set_address("example");
9901    /// ```
9902    pub fn set_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9903        self.address = v.into();
9904        self
9905    }
9906
9907    /// Sets the value of [r#type][crate::model::ResourceDriftTerraformInfo::type].
9908    ///
9909    /// # Example
9910    /// ```ignore,no_run
9911    /// # use google_cloud_config_v1::model::ResourceDriftTerraformInfo;
9912    /// let x = ResourceDriftTerraformInfo::new().set_type("example");
9913    /// ```
9914    pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9915        self.r#type = v.into();
9916        self
9917    }
9918
9919    /// Sets the value of [resource_name][crate::model::ResourceDriftTerraformInfo::resource_name].
9920    ///
9921    /// # Example
9922    /// ```ignore,no_run
9923    /// # use google_cloud_config_v1::model::ResourceDriftTerraformInfo;
9924    /// let x = ResourceDriftTerraformInfo::new().set_resource_name("example");
9925    /// ```
9926    pub fn set_resource_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9927        self.resource_name = v.into();
9928        self
9929    }
9930
9931    /// Sets the value of [provider][crate::model::ResourceDriftTerraformInfo::provider].
9932    ///
9933    /// # Example
9934    /// ```ignore,no_run
9935    /// # use google_cloud_config_v1::model::ResourceDriftTerraformInfo;
9936    /// let x = ResourceDriftTerraformInfo::new().set_provider("example");
9937    /// ```
9938    pub fn set_provider<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9939        self.provider = v.into();
9940        self
9941    }
9942}
9943
9944impl wkt::message::Message for ResourceDriftTerraformInfo {
9945    fn typename() -> &'static str {
9946        "type.googleapis.com/google.cloud.config.v1.ResourceDriftTerraformInfo"
9947    }
9948}
9949
9950/// A resource drift represents a drift to a resource in the state file.
9951#[derive(Clone, Default, PartialEq)]
9952#[non_exhaustive]
9953pub struct ResourceDrift {
9954    /// Identifier. The name of the resource drift.
9955    /// Format:
9956    /// 'projects/{project_id}/locations/{location}/previews/{preview}/resourceDrifts/{resource_drift}'.
9957    pub name: std::string::String,
9958
9959    /// Output only. Terraform info of the resource drift.
9960    pub terraform_info: std::option::Option<crate::model::ResourceDriftTerraformInfo>,
9961
9962    /// Output only. The property drifts of the resource drift.
9963    pub property_drifts: std::vec::Vec<crate::model::PropertyDrift>,
9964
9965    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9966}
9967
9968impl ResourceDrift {
9969    /// Creates a new default instance.
9970    pub fn new() -> Self {
9971        std::default::Default::default()
9972    }
9973
9974    /// Sets the value of [name][crate::model::ResourceDrift::name].
9975    ///
9976    /// # Example
9977    /// ```ignore,no_run
9978    /// # use google_cloud_config_v1::model::ResourceDrift;
9979    /// let x = ResourceDrift::new().set_name("example");
9980    /// ```
9981    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9982        self.name = v.into();
9983        self
9984    }
9985
9986    /// Sets the value of [terraform_info][crate::model::ResourceDrift::terraform_info].
9987    ///
9988    /// # Example
9989    /// ```ignore,no_run
9990    /// # use google_cloud_config_v1::model::ResourceDrift;
9991    /// use google_cloud_config_v1::model::ResourceDriftTerraformInfo;
9992    /// let x = ResourceDrift::new().set_terraform_info(ResourceDriftTerraformInfo::default()/* use setters */);
9993    /// ```
9994    pub fn set_terraform_info<T>(mut self, v: T) -> Self
9995    where
9996        T: std::convert::Into<crate::model::ResourceDriftTerraformInfo>,
9997    {
9998        self.terraform_info = std::option::Option::Some(v.into());
9999        self
10000    }
10001
10002    /// Sets or clears the value of [terraform_info][crate::model::ResourceDrift::terraform_info].
10003    ///
10004    /// # Example
10005    /// ```ignore,no_run
10006    /// # use google_cloud_config_v1::model::ResourceDrift;
10007    /// use google_cloud_config_v1::model::ResourceDriftTerraformInfo;
10008    /// let x = ResourceDrift::new().set_or_clear_terraform_info(Some(ResourceDriftTerraformInfo::default()/* use setters */));
10009    /// let x = ResourceDrift::new().set_or_clear_terraform_info(None::<ResourceDriftTerraformInfo>);
10010    /// ```
10011    pub fn set_or_clear_terraform_info<T>(mut self, v: std::option::Option<T>) -> Self
10012    where
10013        T: std::convert::Into<crate::model::ResourceDriftTerraformInfo>,
10014    {
10015        self.terraform_info = v.map(|x| x.into());
10016        self
10017    }
10018
10019    /// Sets the value of [property_drifts][crate::model::ResourceDrift::property_drifts].
10020    ///
10021    /// # Example
10022    /// ```ignore,no_run
10023    /// # use google_cloud_config_v1::model::ResourceDrift;
10024    /// use google_cloud_config_v1::model::PropertyDrift;
10025    /// let x = ResourceDrift::new()
10026    ///     .set_property_drifts([
10027    ///         PropertyDrift::default()/* use setters */,
10028    ///         PropertyDrift::default()/* use (different) setters */,
10029    ///     ]);
10030    /// ```
10031    pub fn set_property_drifts<T, V>(mut self, v: T) -> Self
10032    where
10033        T: std::iter::IntoIterator<Item = V>,
10034        V: std::convert::Into<crate::model::PropertyDrift>,
10035    {
10036        use std::iter::Iterator;
10037        self.property_drifts = v.into_iter().map(|i| i.into()).collect();
10038        self
10039    }
10040}
10041
10042impl wkt::message::Message for ResourceDrift {
10043    fn typename() -> &'static str {
10044        "type.googleapis.com/google.cloud.config.v1.ResourceDrift"
10045    }
10046}
10047
10048/// A property drift represents a drift to a property in the state file.
10049#[derive(Clone, Default, PartialEq)]
10050#[non_exhaustive]
10051pub struct PropertyDrift {
10052    /// Output only. The path of the property drift.
10053    pub path: std::string::String,
10054
10055    /// Output only. The paths of sensitive fields in `before`. Paths are relative
10056    /// to `path`.
10057    pub before_sensitive_paths: std::vec::Vec<std::string::String>,
10058
10059    /// Output only. Representations of the object value before the actions.
10060    pub before: std::option::Option<wkt::Value>,
10061
10062    /// Output only. The paths of sensitive fields in `after`. Paths are relative
10063    /// to `path`.
10064    pub after_sensitive_paths: std::vec::Vec<std::string::String>,
10065
10066    /// Output only. Representations of the object value after the actions.
10067    pub after: std::option::Option<wkt::Value>,
10068
10069    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10070}
10071
10072impl PropertyDrift {
10073    /// Creates a new default instance.
10074    pub fn new() -> Self {
10075        std::default::Default::default()
10076    }
10077
10078    /// Sets the value of [path][crate::model::PropertyDrift::path].
10079    ///
10080    /// # Example
10081    /// ```ignore,no_run
10082    /// # use google_cloud_config_v1::model::PropertyDrift;
10083    /// let x = PropertyDrift::new().set_path("example");
10084    /// ```
10085    pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10086        self.path = v.into();
10087        self
10088    }
10089
10090    /// Sets the value of [before_sensitive_paths][crate::model::PropertyDrift::before_sensitive_paths].
10091    ///
10092    /// # Example
10093    /// ```ignore,no_run
10094    /// # use google_cloud_config_v1::model::PropertyDrift;
10095    /// let x = PropertyDrift::new().set_before_sensitive_paths(["a", "b", "c"]);
10096    /// ```
10097    pub fn set_before_sensitive_paths<T, V>(mut self, v: T) -> Self
10098    where
10099        T: std::iter::IntoIterator<Item = V>,
10100        V: std::convert::Into<std::string::String>,
10101    {
10102        use std::iter::Iterator;
10103        self.before_sensitive_paths = v.into_iter().map(|i| i.into()).collect();
10104        self
10105    }
10106
10107    /// Sets the value of [before][crate::model::PropertyDrift::before].
10108    ///
10109    /// # Example
10110    /// ```ignore,no_run
10111    /// # use google_cloud_config_v1::model::PropertyDrift;
10112    /// use wkt::Value;
10113    /// let x = PropertyDrift::new().set_before(Value::default()/* use setters */);
10114    /// ```
10115    pub fn set_before<T>(mut self, v: T) -> Self
10116    where
10117        T: std::convert::Into<wkt::Value>,
10118    {
10119        self.before = std::option::Option::Some(v.into());
10120        self
10121    }
10122
10123    /// Sets or clears the value of [before][crate::model::PropertyDrift::before].
10124    ///
10125    /// # Example
10126    /// ```ignore,no_run
10127    /// # use google_cloud_config_v1::model::PropertyDrift;
10128    /// use wkt::Value;
10129    /// let x = PropertyDrift::new().set_or_clear_before(Some(Value::default()/* use setters */));
10130    /// let x = PropertyDrift::new().set_or_clear_before(None::<Value>);
10131    /// ```
10132    pub fn set_or_clear_before<T>(mut self, v: std::option::Option<T>) -> Self
10133    where
10134        T: std::convert::Into<wkt::Value>,
10135    {
10136        self.before = v.map(|x| x.into());
10137        self
10138    }
10139
10140    /// Sets the value of [after_sensitive_paths][crate::model::PropertyDrift::after_sensitive_paths].
10141    ///
10142    /// # Example
10143    /// ```ignore,no_run
10144    /// # use google_cloud_config_v1::model::PropertyDrift;
10145    /// let x = PropertyDrift::new().set_after_sensitive_paths(["a", "b", "c"]);
10146    /// ```
10147    pub fn set_after_sensitive_paths<T, V>(mut self, v: T) -> Self
10148    where
10149        T: std::iter::IntoIterator<Item = V>,
10150        V: std::convert::Into<std::string::String>,
10151    {
10152        use std::iter::Iterator;
10153        self.after_sensitive_paths = v.into_iter().map(|i| i.into()).collect();
10154        self
10155    }
10156
10157    /// Sets the value of [after][crate::model::PropertyDrift::after].
10158    ///
10159    /// # Example
10160    /// ```ignore,no_run
10161    /// # use google_cloud_config_v1::model::PropertyDrift;
10162    /// use wkt::Value;
10163    /// let x = PropertyDrift::new().set_after(Value::default()/* use setters */);
10164    /// ```
10165    pub fn set_after<T>(mut self, v: T) -> Self
10166    where
10167        T: std::convert::Into<wkt::Value>,
10168    {
10169        self.after = std::option::Option::Some(v.into());
10170        self
10171    }
10172
10173    /// Sets or clears the value of [after][crate::model::PropertyDrift::after].
10174    ///
10175    /// # Example
10176    /// ```ignore,no_run
10177    /// # use google_cloud_config_v1::model::PropertyDrift;
10178    /// use wkt::Value;
10179    /// let x = PropertyDrift::new().set_or_clear_after(Some(Value::default()/* use setters */));
10180    /// let x = PropertyDrift::new().set_or_clear_after(None::<Value>);
10181    /// ```
10182    pub fn set_or_clear_after<T>(mut self, v: std::option::Option<T>) -> Self
10183    where
10184        T: std::convert::Into<wkt::Value>,
10185    {
10186        self.after = v.map(|x| x.into());
10187        self
10188    }
10189}
10190
10191impl wkt::message::Message for PropertyDrift {
10192    fn typename() -> &'static str {
10193        "type.googleapis.com/google.cloud.config.v1.PropertyDrift"
10194    }
10195}
10196
10197/// The request message for the ListResourceDrifts method.
10198#[derive(Clone, Default, PartialEq)]
10199#[non_exhaustive]
10200pub struct ListResourceDriftsRequest {
10201    /// Required. The parent in whose context the ResourceDrifts are listed. The
10202    /// parent value is in the format:
10203    /// 'projects/{project_id}/locations/{location}/previews/{preview}'.
10204    pub parent: std::string::String,
10205
10206    /// Optional. When requesting a page of resource drifts, 'page_size' specifies
10207    /// number of resource drifts to return. If unspecified, at most 500 will be
10208    /// returned. The maximum value is 1000.
10209    pub page_size: i32,
10210
10211    /// Optional. Token returned by previous call to 'ListResourceDrifts' which
10212    /// specifies the position in the list from where to continue listing the
10213    /// resource drifts.
10214    pub page_token: std::string::String,
10215
10216    /// Optional. Lists the resource drifts that match the filter expression. A
10217    /// filter expression filters the resource drifts listed in the response. The
10218    /// expression must be of the form '{field} {operator} {value}' where
10219    /// operators: '<', '>',
10220    /// '<=',
10221    /// '>=',
10222    /// '!=', '=', ':' are supported (colon ':' represents a HAS operator which is
10223    /// roughly synonymous with equality). {field} can refer to a proto or JSON
10224    /// field, or a synthetic field. Field names can be camelCase or snake_case.
10225    ///
10226    /// Examples:
10227    ///
10228    /// - Filter by name:
10229    ///   name =
10230    ///   "projects/foo/locations/us-central1/previews/dep/resourceDrifts/baz
10231    pub filter: std::string::String,
10232
10233    /// Optional. Field to use to sort the list.
10234    pub order_by: std::string::String,
10235
10236    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10237}
10238
10239impl ListResourceDriftsRequest {
10240    /// Creates a new default instance.
10241    pub fn new() -> Self {
10242        std::default::Default::default()
10243    }
10244
10245    /// Sets the value of [parent][crate::model::ListResourceDriftsRequest::parent].
10246    ///
10247    /// # Example
10248    /// ```ignore,no_run
10249    /// # use google_cloud_config_v1::model::ListResourceDriftsRequest;
10250    /// let x = ListResourceDriftsRequest::new().set_parent("example");
10251    /// ```
10252    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10253        self.parent = v.into();
10254        self
10255    }
10256
10257    /// Sets the value of [page_size][crate::model::ListResourceDriftsRequest::page_size].
10258    ///
10259    /// # Example
10260    /// ```ignore,no_run
10261    /// # use google_cloud_config_v1::model::ListResourceDriftsRequest;
10262    /// let x = ListResourceDriftsRequest::new().set_page_size(42);
10263    /// ```
10264    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10265        self.page_size = v.into();
10266        self
10267    }
10268
10269    /// Sets the value of [page_token][crate::model::ListResourceDriftsRequest::page_token].
10270    ///
10271    /// # Example
10272    /// ```ignore,no_run
10273    /// # use google_cloud_config_v1::model::ListResourceDriftsRequest;
10274    /// let x = ListResourceDriftsRequest::new().set_page_token("example");
10275    /// ```
10276    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10277        self.page_token = v.into();
10278        self
10279    }
10280
10281    /// Sets the value of [filter][crate::model::ListResourceDriftsRequest::filter].
10282    ///
10283    /// # Example
10284    /// ```ignore,no_run
10285    /// # use google_cloud_config_v1::model::ListResourceDriftsRequest;
10286    /// let x = ListResourceDriftsRequest::new().set_filter("example");
10287    /// ```
10288    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10289        self.filter = v.into();
10290        self
10291    }
10292
10293    /// Sets the value of [order_by][crate::model::ListResourceDriftsRequest::order_by].
10294    ///
10295    /// # Example
10296    /// ```ignore,no_run
10297    /// # use google_cloud_config_v1::model::ListResourceDriftsRequest;
10298    /// let x = ListResourceDriftsRequest::new().set_order_by("example");
10299    /// ```
10300    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10301        self.order_by = v.into();
10302        self
10303    }
10304}
10305
10306impl wkt::message::Message for ListResourceDriftsRequest {
10307    fn typename() -> &'static str {
10308        "type.googleapis.com/google.cloud.config.v1.ListResourceDriftsRequest"
10309    }
10310}
10311
10312/// A response to a 'ListResourceDrifts' call. Contains a list of ResourceDrifts.
10313#[derive(Clone, Default, PartialEq)]
10314#[non_exhaustive]
10315pub struct ListResourceDriftsResponse {
10316    /// List of ResourceDrifts.
10317    pub resource_drifts: std::vec::Vec<crate::model::ResourceDrift>,
10318
10319    /// A token to request the next page of resources from the
10320    /// 'ListResourceDrifts' method. The value of an empty string means that
10321    /// there are no more resources to return.
10322    pub next_page_token: std::string::String,
10323
10324    /// Unreachable resources, if any.
10325    pub unreachable: std::vec::Vec<std::string::String>,
10326
10327    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10328}
10329
10330impl ListResourceDriftsResponse {
10331    /// Creates a new default instance.
10332    pub fn new() -> Self {
10333        std::default::Default::default()
10334    }
10335
10336    /// Sets the value of [resource_drifts][crate::model::ListResourceDriftsResponse::resource_drifts].
10337    ///
10338    /// # Example
10339    /// ```ignore,no_run
10340    /// # use google_cloud_config_v1::model::ListResourceDriftsResponse;
10341    /// use google_cloud_config_v1::model::ResourceDrift;
10342    /// let x = ListResourceDriftsResponse::new()
10343    ///     .set_resource_drifts([
10344    ///         ResourceDrift::default()/* use setters */,
10345    ///         ResourceDrift::default()/* use (different) setters */,
10346    ///     ]);
10347    /// ```
10348    pub fn set_resource_drifts<T, V>(mut self, v: T) -> Self
10349    where
10350        T: std::iter::IntoIterator<Item = V>,
10351        V: std::convert::Into<crate::model::ResourceDrift>,
10352    {
10353        use std::iter::Iterator;
10354        self.resource_drifts = v.into_iter().map(|i| i.into()).collect();
10355        self
10356    }
10357
10358    /// Sets the value of [next_page_token][crate::model::ListResourceDriftsResponse::next_page_token].
10359    ///
10360    /// # Example
10361    /// ```ignore,no_run
10362    /// # use google_cloud_config_v1::model::ListResourceDriftsResponse;
10363    /// let x = ListResourceDriftsResponse::new().set_next_page_token("example");
10364    /// ```
10365    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10366        self.next_page_token = v.into();
10367        self
10368    }
10369
10370    /// Sets the value of [unreachable][crate::model::ListResourceDriftsResponse::unreachable].
10371    ///
10372    /// # Example
10373    /// ```ignore,no_run
10374    /// # use google_cloud_config_v1::model::ListResourceDriftsResponse;
10375    /// let x = ListResourceDriftsResponse::new().set_unreachable(["a", "b", "c"]);
10376    /// ```
10377    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
10378    where
10379        T: std::iter::IntoIterator<Item = V>,
10380        V: std::convert::Into<std::string::String>,
10381    {
10382        use std::iter::Iterator;
10383        self.unreachable = v.into_iter().map(|i| i.into()).collect();
10384        self
10385    }
10386}
10387
10388impl wkt::message::Message for ListResourceDriftsResponse {
10389    fn typename() -> &'static str {
10390        "type.googleapis.com/google.cloud.config.v1.ListResourceDriftsResponse"
10391    }
10392}
10393
10394#[doc(hidden)]
10395impl google_cloud_gax::paginator::internal::PageableResponse for ListResourceDriftsResponse {
10396    type PageItem = crate::model::ResourceDrift;
10397
10398    fn items(self) -> std::vec::Vec<Self::PageItem> {
10399        self.resource_drifts
10400    }
10401
10402    fn next_page_token(&self) -> std::string::String {
10403        use std::clone::Clone;
10404        self.next_page_token.clone()
10405    }
10406}
10407
10408/// The request message for the GetResourceDrift method.
10409#[derive(Clone, Default, PartialEq)]
10410#[non_exhaustive]
10411pub struct GetResourceDriftRequest {
10412    /// Required. The name of the resource drift to retrieve.
10413    /// Format:
10414    /// 'projects/{project_id}/locations/{location}/previews/{preview}/resourceDrifts/{resource_drift}'.
10415    pub name: std::string::String,
10416
10417    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10418}
10419
10420impl GetResourceDriftRequest {
10421    /// Creates a new default instance.
10422    pub fn new() -> Self {
10423        std::default::Default::default()
10424    }
10425
10426    /// Sets the value of [name][crate::model::GetResourceDriftRequest::name].
10427    ///
10428    /// # Example
10429    /// ```ignore,no_run
10430    /// # use google_cloud_config_v1::model::GetResourceDriftRequest;
10431    /// let x = GetResourceDriftRequest::new().set_name("example");
10432    /// ```
10433    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10434        self.name = v.into();
10435        self
10436    }
10437}
10438
10439impl wkt::message::Message for GetResourceDriftRequest {
10440    fn typename() -> &'static str {
10441        "type.googleapis.com/google.cloud.config.v1.GetResourceDriftRequest"
10442    }
10443}
10444
10445/// ProviderConfig contains the provider configurations.
10446#[derive(Clone, Default, PartialEq)]
10447#[non_exhaustive]
10448pub struct ProviderConfig {
10449    /// Optional. ProviderSource specifies the source type of the provider.
10450    pub source_type: std::option::Option<crate::model::provider_config::ProviderSource>,
10451
10452    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10453}
10454
10455impl ProviderConfig {
10456    /// Creates a new default instance.
10457    pub fn new() -> Self {
10458        std::default::Default::default()
10459    }
10460
10461    /// Sets the value of [source_type][crate::model::ProviderConfig::source_type].
10462    ///
10463    /// # Example
10464    /// ```ignore,no_run
10465    /// # use google_cloud_config_v1::model::ProviderConfig;
10466    /// use google_cloud_config_v1::model::provider_config::ProviderSource;
10467    /// let x0 = ProviderConfig::new().set_source_type(ProviderSource::ServiceMaintained);
10468    /// ```
10469    pub fn set_source_type<T>(mut self, v: T) -> Self
10470    where
10471        T: std::convert::Into<crate::model::provider_config::ProviderSource>,
10472    {
10473        self.source_type = std::option::Option::Some(v.into());
10474        self
10475    }
10476
10477    /// Sets or clears the value of [source_type][crate::model::ProviderConfig::source_type].
10478    ///
10479    /// # Example
10480    /// ```ignore,no_run
10481    /// # use google_cloud_config_v1::model::ProviderConfig;
10482    /// use google_cloud_config_v1::model::provider_config::ProviderSource;
10483    /// let x0 = ProviderConfig::new().set_or_clear_source_type(Some(ProviderSource::ServiceMaintained));
10484    /// let x_none = ProviderConfig::new().set_or_clear_source_type(None::<ProviderSource>);
10485    /// ```
10486    pub fn set_or_clear_source_type<T>(mut self, v: std::option::Option<T>) -> Self
10487    where
10488        T: std::convert::Into<crate::model::provider_config::ProviderSource>,
10489    {
10490        self.source_type = v.map(|x| x.into());
10491        self
10492    }
10493}
10494
10495impl wkt::message::Message for ProviderConfig {
10496    fn typename() -> &'static str {
10497        "type.googleapis.com/google.cloud.config.v1.ProviderConfig"
10498    }
10499}
10500
10501/// Defines additional types related to [ProviderConfig].
10502pub mod provider_config {
10503    #[allow(unused_imports)]
10504    use super::*;
10505
10506    /// ProviderSource represents the source type of the provider.
10507    ///
10508    /// # Working with unknown values
10509    ///
10510    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10511    /// additional enum variants at any time. Adding new variants is not considered
10512    /// a breaking change. Applications should write their code in anticipation of:
10513    ///
10514    /// - New values appearing in future releases of the client library, **and**
10515    /// - New values received dynamically, without application changes.
10516    ///
10517    /// Please consult the [Working with enums] section in the user guide for some
10518    /// guidelines.
10519    ///
10520    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
10521    #[derive(Clone, Debug, PartialEq)]
10522    #[non_exhaustive]
10523    pub enum ProviderSource {
10524        /// Unspecified source type, default to public sources.
10525        Unspecified,
10526        /// Service maintained provider source type.
10527        ServiceMaintained,
10528        /// If set, the enum was initialized with an unknown value.
10529        ///
10530        /// Applications can examine the value using [ProviderSource::value] or
10531        /// [ProviderSource::name].
10532        UnknownValue(provider_source::UnknownValue),
10533    }
10534
10535    #[doc(hidden)]
10536    pub mod provider_source {
10537        #[allow(unused_imports)]
10538        use super::*;
10539        #[derive(Clone, Debug, PartialEq)]
10540        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10541    }
10542
10543    impl ProviderSource {
10544        /// Gets the enum value.
10545        ///
10546        /// Returns `None` if the enum contains an unknown value deserialized from
10547        /// the string representation of enums.
10548        pub fn value(&self) -> std::option::Option<i32> {
10549            match self {
10550                Self::Unspecified => std::option::Option::Some(0),
10551                Self::ServiceMaintained => std::option::Option::Some(1),
10552                Self::UnknownValue(u) => u.0.value(),
10553            }
10554        }
10555
10556        /// Gets the enum value as a string.
10557        ///
10558        /// Returns `None` if the enum contains an unknown value deserialized from
10559        /// the integer representation of enums.
10560        pub fn name(&self) -> std::option::Option<&str> {
10561            match self {
10562                Self::Unspecified => std::option::Option::Some("PROVIDER_SOURCE_UNSPECIFIED"),
10563                Self::ServiceMaintained => std::option::Option::Some("SERVICE_MAINTAINED"),
10564                Self::UnknownValue(u) => u.0.name(),
10565            }
10566        }
10567    }
10568
10569    impl std::default::Default for ProviderSource {
10570        fn default() -> Self {
10571            use std::convert::From;
10572            Self::from(0)
10573        }
10574    }
10575
10576    impl std::fmt::Display for ProviderSource {
10577        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10578            wkt::internal::display_enum(f, self.name(), self.value())
10579        }
10580    }
10581
10582    impl std::convert::From<i32> for ProviderSource {
10583        fn from(value: i32) -> Self {
10584            match value {
10585                0 => Self::Unspecified,
10586                1 => Self::ServiceMaintained,
10587                _ => Self::UnknownValue(provider_source::UnknownValue(
10588                    wkt::internal::UnknownEnumValue::Integer(value),
10589                )),
10590            }
10591        }
10592    }
10593
10594    impl std::convert::From<&str> for ProviderSource {
10595        fn from(value: &str) -> Self {
10596            use std::string::ToString;
10597            match value {
10598                "PROVIDER_SOURCE_UNSPECIFIED" => Self::Unspecified,
10599                "SERVICE_MAINTAINED" => Self::ServiceMaintained,
10600                _ => Self::UnknownValue(provider_source::UnknownValue(
10601                    wkt::internal::UnknownEnumValue::String(value.to_string()),
10602                )),
10603            }
10604        }
10605    }
10606
10607    impl serde::ser::Serialize for ProviderSource {
10608        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10609        where
10610            S: serde::Serializer,
10611        {
10612            match self {
10613                Self::Unspecified => serializer.serialize_i32(0),
10614                Self::ServiceMaintained => serializer.serialize_i32(1),
10615                Self::UnknownValue(u) => u.0.serialize(serializer),
10616            }
10617        }
10618    }
10619
10620    impl<'de> serde::de::Deserialize<'de> for ProviderSource {
10621        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10622        where
10623            D: serde::Deserializer<'de>,
10624        {
10625            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ProviderSource>::new(
10626                ".google.cloud.config.v1.ProviderConfig.ProviderSource",
10627            ))
10628        }
10629    }
10630}
10631
10632/// The request message for the GetAutoMigrationConfig method.
10633#[derive(Clone, Default, PartialEq)]
10634#[non_exhaustive]
10635pub struct GetAutoMigrationConfigRequest {
10636    /// Required. The name of the AutoMigrationConfig.
10637    /// Format:
10638    /// 'projects/{project_id}/locations/{location}/AutoMigrationConfig'.
10639    pub name: std::string::String,
10640
10641    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10642}
10643
10644impl GetAutoMigrationConfigRequest {
10645    /// Creates a new default instance.
10646    pub fn new() -> Self {
10647        std::default::Default::default()
10648    }
10649
10650    /// Sets the value of [name][crate::model::GetAutoMigrationConfigRequest::name].
10651    ///
10652    /// # Example
10653    /// ```ignore,no_run
10654    /// # use google_cloud_config_v1::model::GetAutoMigrationConfigRequest;
10655    /// let x = GetAutoMigrationConfigRequest::new().set_name("example");
10656    /// ```
10657    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10658        self.name = v.into();
10659        self
10660    }
10661}
10662
10663impl wkt::message::Message for GetAutoMigrationConfigRequest {
10664    fn typename() -> &'static str {
10665        "type.googleapis.com/google.cloud.config.v1.GetAutoMigrationConfigRequest"
10666    }
10667}
10668
10669/// AutoMigrationConfig contains the automigration configuration for a project.
10670#[derive(Clone, Default, PartialEq)]
10671#[non_exhaustive]
10672pub struct AutoMigrationConfig {
10673    /// Identifier. The name of the AutoMigrationConfig.
10674    /// Format:
10675    /// 'projects/{project_id}/locations/{location}/AutoMigrationConfig'.
10676    pub name: std::string::String,
10677
10678    /// Output only. Time the AutoMigrationConfig was last updated.
10679    pub update_time: std::option::Option<wkt::Timestamp>,
10680
10681    /// Optional. Whether the auto migration is enabled for the project.
10682    pub auto_migration_enabled: bool,
10683
10684    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10685}
10686
10687impl AutoMigrationConfig {
10688    /// Creates a new default instance.
10689    pub fn new() -> Self {
10690        std::default::Default::default()
10691    }
10692
10693    /// Sets the value of [name][crate::model::AutoMigrationConfig::name].
10694    ///
10695    /// # Example
10696    /// ```ignore,no_run
10697    /// # use google_cloud_config_v1::model::AutoMigrationConfig;
10698    /// let x = AutoMigrationConfig::new().set_name("example");
10699    /// ```
10700    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10701        self.name = v.into();
10702        self
10703    }
10704
10705    /// Sets the value of [update_time][crate::model::AutoMigrationConfig::update_time].
10706    ///
10707    /// # Example
10708    /// ```ignore,no_run
10709    /// # use google_cloud_config_v1::model::AutoMigrationConfig;
10710    /// use wkt::Timestamp;
10711    /// let x = AutoMigrationConfig::new().set_update_time(Timestamp::default()/* use setters */);
10712    /// ```
10713    pub fn set_update_time<T>(mut self, v: T) -> Self
10714    where
10715        T: std::convert::Into<wkt::Timestamp>,
10716    {
10717        self.update_time = std::option::Option::Some(v.into());
10718        self
10719    }
10720
10721    /// Sets or clears the value of [update_time][crate::model::AutoMigrationConfig::update_time].
10722    ///
10723    /// # Example
10724    /// ```ignore,no_run
10725    /// # use google_cloud_config_v1::model::AutoMigrationConfig;
10726    /// use wkt::Timestamp;
10727    /// let x = AutoMigrationConfig::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
10728    /// let x = AutoMigrationConfig::new().set_or_clear_update_time(None::<Timestamp>);
10729    /// ```
10730    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
10731    where
10732        T: std::convert::Into<wkt::Timestamp>,
10733    {
10734        self.update_time = v.map(|x| x.into());
10735        self
10736    }
10737
10738    /// Sets the value of [auto_migration_enabled][crate::model::AutoMigrationConfig::auto_migration_enabled].
10739    ///
10740    /// # Example
10741    /// ```ignore,no_run
10742    /// # use google_cloud_config_v1::model::AutoMigrationConfig;
10743    /// let x = AutoMigrationConfig::new().set_auto_migration_enabled(true);
10744    /// ```
10745    pub fn set_auto_migration_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10746        self.auto_migration_enabled = v.into();
10747        self
10748    }
10749}
10750
10751impl wkt::message::Message for AutoMigrationConfig {
10752    fn typename() -> &'static str {
10753        "type.googleapis.com/google.cloud.config.v1.AutoMigrationConfig"
10754    }
10755}
10756
10757/// The request message for the UpdateAutoMigrationConfig method.
10758#[derive(Clone, Default, PartialEq)]
10759#[non_exhaustive]
10760pub struct UpdateAutoMigrationConfigRequest {
10761    /// Optional. The update mask applies to the resource. See
10762    /// [google.protobuf.FieldMask][google.protobuf.FieldMask].
10763    ///
10764    /// [google.protobuf.FieldMask]: wkt::FieldMask
10765    pub update_mask: std::option::Option<wkt::FieldMask>,
10766
10767    /// Required. The AutoMigrationConfig to update.
10768    pub auto_migration_config: std::option::Option<crate::model::AutoMigrationConfig>,
10769
10770    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10771}
10772
10773impl UpdateAutoMigrationConfigRequest {
10774    /// Creates a new default instance.
10775    pub fn new() -> Self {
10776        std::default::Default::default()
10777    }
10778
10779    /// Sets the value of [update_mask][crate::model::UpdateAutoMigrationConfigRequest::update_mask].
10780    ///
10781    /// # Example
10782    /// ```ignore,no_run
10783    /// # use google_cloud_config_v1::model::UpdateAutoMigrationConfigRequest;
10784    /// use wkt::FieldMask;
10785    /// let x = UpdateAutoMigrationConfigRequest::new().set_update_mask(FieldMask::default()/* use setters */);
10786    /// ```
10787    pub fn set_update_mask<T>(mut self, v: T) -> Self
10788    where
10789        T: std::convert::Into<wkt::FieldMask>,
10790    {
10791        self.update_mask = std::option::Option::Some(v.into());
10792        self
10793    }
10794
10795    /// Sets or clears the value of [update_mask][crate::model::UpdateAutoMigrationConfigRequest::update_mask].
10796    ///
10797    /// # Example
10798    /// ```ignore,no_run
10799    /// # use google_cloud_config_v1::model::UpdateAutoMigrationConfigRequest;
10800    /// use wkt::FieldMask;
10801    /// let x = UpdateAutoMigrationConfigRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
10802    /// let x = UpdateAutoMigrationConfigRequest::new().set_or_clear_update_mask(None::<FieldMask>);
10803    /// ```
10804    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
10805    where
10806        T: std::convert::Into<wkt::FieldMask>,
10807    {
10808        self.update_mask = v.map(|x| x.into());
10809        self
10810    }
10811
10812    /// Sets the value of [auto_migration_config][crate::model::UpdateAutoMigrationConfigRequest::auto_migration_config].
10813    ///
10814    /// # Example
10815    /// ```ignore,no_run
10816    /// # use google_cloud_config_v1::model::UpdateAutoMigrationConfigRequest;
10817    /// use google_cloud_config_v1::model::AutoMigrationConfig;
10818    /// let x = UpdateAutoMigrationConfigRequest::new().set_auto_migration_config(AutoMigrationConfig::default()/* use setters */);
10819    /// ```
10820    pub fn set_auto_migration_config<T>(mut self, v: T) -> Self
10821    where
10822        T: std::convert::Into<crate::model::AutoMigrationConfig>,
10823    {
10824        self.auto_migration_config = std::option::Option::Some(v.into());
10825        self
10826    }
10827
10828    /// Sets or clears the value of [auto_migration_config][crate::model::UpdateAutoMigrationConfigRequest::auto_migration_config].
10829    ///
10830    /// # Example
10831    /// ```ignore,no_run
10832    /// # use google_cloud_config_v1::model::UpdateAutoMigrationConfigRequest;
10833    /// use google_cloud_config_v1::model::AutoMigrationConfig;
10834    /// let x = UpdateAutoMigrationConfigRequest::new().set_or_clear_auto_migration_config(Some(AutoMigrationConfig::default()/* use setters */));
10835    /// let x = UpdateAutoMigrationConfigRequest::new().set_or_clear_auto_migration_config(None::<AutoMigrationConfig>);
10836    /// ```
10837    pub fn set_or_clear_auto_migration_config<T>(mut self, v: std::option::Option<T>) -> Self
10838    where
10839        T: std::convert::Into<crate::model::AutoMigrationConfig>,
10840    {
10841        self.auto_migration_config = v.map(|x| x.into());
10842        self
10843    }
10844}
10845
10846impl wkt::message::Message for UpdateAutoMigrationConfigRequest {
10847    fn typename() -> &'static str {
10848        "type.googleapis.com/google.cloud.config.v1.UpdateAutoMigrationConfigRequest"
10849    }
10850}
10851
10852/// A DeploymentGroup is a collection of DeploymentUnits that in a DAG-like
10853/// structure.
10854#[derive(Clone, Default, PartialEq)]
10855#[non_exhaustive]
10856pub struct DeploymentGroup {
10857    /// Identifier. The name of the deployment group.
10858    /// Format:
10859    /// 'projects/{project_id}/locations/{location}/deploymentGroups/{deployment_group}'.
10860    pub name: std::string::String,
10861
10862    /// Output only. Time when the deployment group was created.
10863    pub create_time: std::option::Option<wkt::Timestamp>,
10864
10865    /// Output only. Time when the deployment group was last updated.
10866    pub update_time: std::option::Option<wkt::Timestamp>,
10867
10868    /// Optional. User-defined metadata for the deployment group.
10869    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
10870
10871    /// Optional. Arbitrary key-value metadata storage e.g. to help client tools
10872    /// identify deployment group during automation. See
10873    /// <https://google.aip.dev/148#annotations> for details on format and size
10874    /// limitations.
10875    pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
10876
10877    /// Output only. Current state of the deployment group.
10878    pub state: crate::model::deployment_group::State,
10879
10880    /// Output only. Additional information regarding the current state.
10881    pub state_description: std::string::String,
10882
10883    /// The deployment units of the deployment group in a DAG like structure.
10884    /// When a deployment group is being provisioned, the deployment units are
10885    /// deployed in a DAG order.
10886    /// The provided units must be in a DAG order, otherwise an error will be
10887    /// returned.
10888    pub deployment_units: std::vec::Vec<crate::model::DeploymentUnit>,
10889
10890    /// Output only. The provisioning state of the deployment group.
10891    pub provisioning_state: crate::model::deployment_group::ProvisioningState,
10892
10893    /// Output only. Additional information regarding the current provisioning
10894    /// state.
10895    pub provisioning_state_description: std::string::String,
10896
10897    /// Output only. The error status of the deployment group provisioning or
10898    /// deprovisioning.
10899    pub provisioning_error: std::option::Option<google_cloud_rpc::model::Status>,
10900
10901    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10902}
10903
10904impl DeploymentGroup {
10905    /// Creates a new default instance.
10906    pub fn new() -> Self {
10907        std::default::Default::default()
10908    }
10909
10910    /// Sets the value of [name][crate::model::DeploymentGroup::name].
10911    ///
10912    /// # Example
10913    /// ```ignore,no_run
10914    /// # use google_cloud_config_v1::model::DeploymentGroup;
10915    /// let x = DeploymentGroup::new().set_name("example");
10916    /// ```
10917    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10918        self.name = v.into();
10919        self
10920    }
10921
10922    /// Sets the value of [create_time][crate::model::DeploymentGroup::create_time].
10923    ///
10924    /// # Example
10925    /// ```ignore,no_run
10926    /// # use google_cloud_config_v1::model::DeploymentGroup;
10927    /// use wkt::Timestamp;
10928    /// let x = DeploymentGroup::new().set_create_time(Timestamp::default()/* use setters */);
10929    /// ```
10930    pub fn set_create_time<T>(mut self, v: T) -> Self
10931    where
10932        T: std::convert::Into<wkt::Timestamp>,
10933    {
10934        self.create_time = std::option::Option::Some(v.into());
10935        self
10936    }
10937
10938    /// Sets or clears the value of [create_time][crate::model::DeploymentGroup::create_time].
10939    ///
10940    /// # Example
10941    /// ```ignore,no_run
10942    /// # use google_cloud_config_v1::model::DeploymentGroup;
10943    /// use wkt::Timestamp;
10944    /// let x = DeploymentGroup::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
10945    /// let x = DeploymentGroup::new().set_or_clear_create_time(None::<Timestamp>);
10946    /// ```
10947    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
10948    where
10949        T: std::convert::Into<wkt::Timestamp>,
10950    {
10951        self.create_time = v.map(|x| x.into());
10952        self
10953    }
10954
10955    /// Sets the value of [update_time][crate::model::DeploymentGroup::update_time].
10956    ///
10957    /// # Example
10958    /// ```ignore,no_run
10959    /// # use google_cloud_config_v1::model::DeploymentGroup;
10960    /// use wkt::Timestamp;
10961    /// let x = DeploymentGroup::new().set_update_time(Timestamp::default()/* use setters */);
10962    /// ```
10963    pub fn set_update_time<T>(mut self, v: T) -> Self
10964    where
10965        T: std::convert::Into<wkt::Timestamp>,
10966    {
10967        self.update_time = std::option::Option::Some(v.into());
10968        self
10969    }
10970
10971    /// Sets or clears the value of [update_time][crate::model::DeploymentGroup::update_time].
10972    ///
10973    /// # Example
10974    /// ```ignore,no_run
10975    /// # use google_cloud_config_v1::model::DeploymentGroup;
10976    /// use wkt::Timestamp;
10977    /// let x = DeploymentGroup::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
10978    /// let x = DeploymentGroup::new().set_or_clear_update_time(None::<Timestamp>);
10979    /// ```
10980    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
10981    where
10982        T: std::convert::Into<wkt::Timestamp>,
10983    {
10984        self.update_time = v.map(|x| x.into());
10985        self
10986    }
10987
10988    /// Sets the value of [labels][crate::model::DeploymentGroup::labels].
10989    ///
10990    /// # Example
10991    /// ```ignore,no_run
10992    /// # use google_cloud_config_v1::model::DeploymentGroup;
10993    /// let x = DeploymentGroup::new().set_labels([
10994    ///     ("key0", "abc"),
10995    ///     ("key1", "xyz"),
10996    /// ]);
10997    /// ```
10998    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
10999    where
11000        T: std::iter::IntoIterator<Item = (K, V)>,
11001        K: std::convert::Into<std::string::String>,
11002        V: std::convert::Into<std::string::String>,
11003    {
11004        use std::iter::Iterator;
11005        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
11006        self
11007    }
11008
11009    /// Sets the value of [annotations][crate::model::DeploymentGroup::annotations].
11010    ///
11011    /// # Example
11012    /// ```ignore,no_run
11013    /// # use google_cloud_config_v1::model::DeploymentGroup;
11014    /// let x = DeploymentGroup::new().set_annotations([
11015    ///     ("key0", "abc"),
11016    ///     ("key1", "xyz"),
11017    /// ]);
11018    /// ```
11019    pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
11020    where
11021        T: std::iter::IntoIterator<Item = (K, V)>,
11022        K: std::convert::Into<std::string::String>,
11023        V: std::convert::Into<std::string::String>,
11024    {
11025        use std::iter::Iterator;
11026        self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
11027        self
11028    }
11029
11030    /// Sets the value of [state][crate::model::DeploymentGroup::state].
11031    ///
11032    /// # Example
11033    /// ```ignore,no_run
11034    /// # use google_cloud_config_v1::model::DeploymentGroup;
11035    /// use google_cloud_config_v1::model::deployment_group::State;
11036    /// let x0 = DeploymentGroup::new().set_state(State::Creating);
11037    /// let x1 = DeploymentGroup::new().set_state(State::Active);
11038    /// let x2 = DeploymentGroup::new().set_state(State::Updating);
11039    /// ```
11040    pub fn set_state<T: std::convert::Into<crate::model::deployment_group::State>>(
11041        mut self,
11042        v: T,
11043    ) -> Self {
11044        self.state = v.into();
11045        self
11046    }
11047
11048    /// Sets the value of [state_description][crate::model::DeploymentGroup::state_description].
11049    ///
11050    /// # Example
11051    /// ```ignore,no_run
11052    /// # use google_cloud_config_v1::model::DeploymentGroup;
11053    /// let x = DeploymentGroup::new().set_state_description("example");
11054    /// ```
11055    pub fn set_state_description<T: std::convert::Into<std::string::String>>(
11056        mut self,
11057        v: T,
11058    ) -> Self {
11059        self.state_description = v.into();
11060        self
11061    }
11062
11063    /// Sets the value of [deployment_units][crate::model::DeploymentGroup::deployment_units].
11064    ///
11065    /// # Example
11066    /// ```ignore,no_run
11067    /// # use google_cloud_config_v1::model::DeploymentGroup;
11068    /// use google_cloud_config_v1::model::DeploymentUnit;
11069    /// let x = DeploymentGroup::new()
11070    ///     .set_deployment_units([
11071    ///         DeploymentUnit::default()/* use setters */,
11072    ///         DeploymentUnit::default()/* use (different) setters */,
11073    ///     ]);
11074    /// ```
11075    pub fn set_deployment_units<T, V>(mut self, v: T) -> Self
11076    where
11077        T: std::iter::IntoIterator<Item = V>,
11078        V: std::convert::Into<crate::model::DeploymentUnit>,
11079    {
11080        use std::iter::Iterator;
11081        self.deployment_units = v.into_iter().map(|i| i.into()).collect();
11082        self
11083    }
11084
11085    /// Sets the value of [provisioning_state][crate::model::DeploymentGroup::provisioning_state].
11086    ///
11087    /// # Example
11088    /// ```ignore,no_run
11089    /// # use google_cloud_config_v1::model::DeploymentGroup;
11090    /// use google_cloud_config_v1::model::deployment_group::ProvisioningState;
11091    /// let x0 = DeploymentGroup::new().set_provisioning_state(ProvisioningState::Provisioning);
11092    /// let x1 = DeploymentGroup::new().set_provisioning_state(ProvisioningState::Provisioned);
11093    /// let x2 = DeploymentGroup::new().set_provisioning_state(ProvisioningState::FailedToProvision);
11094    /// ```
11095    pub fn set_provisioning_state<
11096        T: std::convert::Into<crate::model::deployment_group::ProvisioningState>,
11097    >(
11098        mut self,
11099        v: T,
11100    ) -> Self {
11101        self.provisioning_state = v.into();
11102        self
11103    }
11104
11105    /// Sets the value of [provisioning_state_description][crate::model::DeploymentGroup::provisioning_state_description].
11106    ///
11107    /// # Example
11108    /// ```ignore,no_run
11109    /// # use google_cloud_config_v1::model::DeploymentGroup;
11110    /// let x = DeploymentGroup::new().set_provisioning_state_description("example");
11111    /// ```
11112    pub fn set_provisioning_state_description<T: std::convert::Into<std::string::String>>(
11113        mut self,
11114        v: T,
11115    ) -> Self {
11116        self.provisioning_state_description = v.into();
11117        self
11118    }
11119
11120    /// Sets the value of [provisioning_error][crate::model::DeploymentGroup::provisioning_error].
11121    ///
11122    /// # Example
11123    /// ```ignore,no_run
11124    /// # use google_cloud_config_v1::model::DeploymentGroup;
11125    /// use google_cloud_rpc::model::Status;
11126    /// let x = DeploymentGroup::new().set_provisioning_error(Status::default()/* use setters */);
11127    /// ```
11128    pub fn set_provisioning_error<T>(mut self, v: T) -> Self
11129    where
11130        T: std::convert::Into<google_cloud_rpc::model::Status>,
11131    {
11132        self.provisioning_error = std::option::Option::Some(v.into());
11133        self
11134    }
11135
11136    /// Sets or clears the value of [provisioning_error][crate::model::DeploymentGroup::provisioning_error].
11137    ///
11138    /// # Example
11139    /// ```ignore,no_run
11140    /// # use google_cloud_config_v1::model::DeploymentGroup;
11141    /// use google_cloud_rpc::model::Status;
11142    /// let x = DeploymentGroup::new().set_or_clear_provisioning_error(Some(Status::default()/* use setters */));
11143    /// let x = DeploymentGroup::new().set_or_clear_provisioning_error(None::<Status>);
11144    /// ```
11145    pub fn set_or_clear_provisioning_error<T>(mut self, v: std::option::Option<T>) -> Self
11146    where
11147        T: std::convert::Into<google_cloud_rpc::model::Status>,
11148    {
11149        self.provisioning_error = v.map(|x| x.into());
11150        self
11151    }
11152}
11153
11154impl wkt::message::Message for DeploymentGroup {
11155    fn typename() -> &'static str {
11156        "type.googleapis.com/google.cloud.config.v1.DeploymentGroup"
11157    }
11158}
11159
11160/// Defines additional types related to [DeploymentGroup].
11161pub mod deployment_group {
11162    #[allow(unused_imports)]
11163    use super::*;
11164
11165    /// Possible states of a deployment group.
11166    ///
11167    /// # Working with unknown values
11168    ///
11169    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11170    /// additional enum variants at any time. Adding new variants is not considered
11171    /// a breaking change. Applications should write their code in anticipation of:
11172    ///
11173    /// - New values appearing in future releases of the client library, **and**
11174    /// - New values received dynamically, without application changes.
11175    ///
11176    /// Please consult the [Working with enums] section in the user guide for some
11177    /// guidelines.
11178    ///
11179    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
11180    #[derive(Clone, Debug, PartialEq)]
11181    #[non_exhaustive]
11182    pub enum State {
11183        /// The default value. This value is used if the state is omitted.
11184        Unspecified,
11185        /// The deployment group is being created.
11186        Creating,
11187        /// The deployment group is healthy.
11188        Active,
11189        /// The deployment group is being updated.
11190        Updating,
11191        /// The deployment group is being deleted.
11192        Deleting,
11193        /// The deployment group has encountered an unexpected error.
11194        Failed,
11195        /// The deployment group is no longer being actively reconciled.
11196        /// This may be the result of recovering the project after deletion.
11197        Suspended,
11198        /// The deployment group has been deleted.
11199        Deleted,
11200        /// If set, the enum was initialized with an unknown value.
11201        ///
11202        /// Applications can examine the value using [State::value] or
11203        /// [State::name].
11204        UnknownValue(state::UnknownValue),
11205    }
11206
11207    #[doc(hidden)]
11208    pub mod state {
11209        #[allow(unused_imports)]
11210        use super::*;
11211        #[derive(Clone, Debug, PartialEq)]
11212        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11213    }
11214
11215    impl State {
11216        /// Gets the enum value.
11217        ///
11218        /// Returns `None` if the enum contains an unknown value deserialized from
11219        /// the string representation of enums.
11220        pub fn value(&self) -> std::option::Option<i32> {
11221            match self {
11222                Self::Unspecified => std::option::Option::Some(0),
11223                Self::Creating => std::option::Option::Some(1),
11224                Self::Active => std::option::Option::Some(2),
11225                Self::Updating => std::option::Option::Some(3),
11226                Self::Deleting => std::option::Option::Some(4),
11227                Self::Failed => std::option::Option::Some(5),
11228                Self::Suspended => std::option::Option::Some(6),
11229                Self::Deleted => std::option::Option::Some(7),
11230                Self::UnknownValue(u) => u.0.value(),
11231            }
11232        }
11233
11234        /// Gets the enum value as a string.
11235        ///
11236        /// Returns `None` if the enum contains an unknown value deserialized from
11237        /// the integer representation of enums.
11238        pub fn name(&self) -> std::option::Option<&str> {
11239            match self {
11240                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
11241                Self::Creating => std::option::Option::Some("CREATING"),
11242                Self::Active => std::option::Option::Some("ACTIVE"),
11243                Self::Updating => std::option::Option::Some("UPDATING"),
11244                Self::Deleting => std::option::Option::Some("DELETING"),
11245                Self::Failed => std::option::Option::Some("FAILED"),
11246                Self::Suspended => std::option::Option::Some("SUSPENDED"),
11247                Self::Deleted => std::option::Option::Some("DELETED"),
11248                Self::UnknownValue(u) => u.0.name(),
11249            }
11250        }
11251    }
11252
11253    impl std::default::Default for State {
11254        fn default() -> Self {
11255            use std::convert::From;
11256            Self::from(0)
11257        }
11258    }
11259
11260    impl std::fmt::Display for State {
11261        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11262            wkt::internal::display_enum(f, self.name(), self.value())
11263        }
11264    }
11265
11266    impl std::convert::From<i32> for State {
11267        fn from(value: i32) -> Self {
11268            match value {
11269                0 => Self::Unspecified,
11270                1 => Self::Creating,
11271                2 => Self::Active,
11272                3 => Self::Updating,
11273                4 => Self::Deleting,
11274                5 => Self::Failed,
11275                6 => Self::Suspended,
11276                7 => Self::Deleted,
11277                _ => Self::UnknownValue(state::UnknownValue(
11278                    wkt::internal::UnknownEnumValue::Integer(value),
11279                )),
11280            }
11281        }
11282    }
11283
11284    impl std::convert::From<&str> for State {
11285        fn from(value: &str) -> Self {
11286            use std::string::ToString;
11287            match value {
11288                "STATE_UNSPECIFIED" => Self::Unspecified,
11289                "CREATING" => Self::Creating,
11290                "ACTIVE" => Self::Active,
11291                "UPDATING" => Self::Updating,
11292                "DELETING" => Self::Deleting,
11293                "FAILED" => Self::Failed,
11294                "SUSPENDED" => Self::Suspended,
11295                "DELETED" => Self::Deleted,
11296                _ => Self::UnknownValue(state::UnknownValue(
11297                    wkt::internal::UnknownEnumValue::String(value.to_string()),
11298                )),
11299            }
11300        }
11301    }
11302
11303    impl serde::ser::Serialize for State {
11304        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11305        where
11306            S: serde::Serializer,
11307        {
11308            match self {
11309                Self::Unspecified => serializer.serialize_i32(0),
11310                Self::Creating => serializer.serialize_i32(1),
11311                Self::Active => serializer.serialize_i32(2),
11312                Self::Updating => serializer.serialize_i32(3),
11313                Self::Deleting => serializer.serialize_i32(4),
11314                Self::Failed => serializer.serialize_i32(5),
11315                Self::Suspended => serializer.serialize_i32(6),
11316                Self::Deleted => serializer.serialize_i32(7),
11317                Self::UnknownValue(u) => u.0.serialize(serializer),
11318            }
11319        }
11320    }
11321
11322    impl<'de> serde::de::Deserialize<'de> for State {
11323        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11324        where
11325            D: serde::Deserializer<'de>,
11326        {
11327            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
11328                ".google.cloud.config.v1.DeploymentGroup.State",
11329            ))
11330        }
11331    }
11332
11333    /// Possible provisioning states of a deployment group.
11334    ///
11335    /// # Working with unknown values
11336    ///
11337    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11338    /// additional enum variants at any time. Adding new variants is not considered
11339    /// a breaking change. Applications should write their code in anticipation of:
11340    ///
11341    /// - New values appearing in future releases of the client library, **and**
11342    /// - New values received dynamically, without application changes.
11343    ///
11344    /// Please consult the [Working with enums] section in the user guide for some
11345    /// guidelines.
11346    ///
11347    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
11348    #[derive(Clone, Debug, PartialEq)]
11349    #[non_exhaustive]
11350    pub enum ProvisioningState {
11351        /// Unspecified provisioning state.
11352        Unspecified,
11353        /// The deployment group is being provisioned.
11354        Provisioning,
11355        /// The deployment group is provisioned.
11356        Provisioned,
11357        /// The deployment group failed to be provisioned.
11358        FailedToProvision,
11359        /// The deployment group is being deprovisioned.
11360        Deprovisioning,
11361        /// The deployment group is deprovisioned.
11362        Deprovisioned,
11363        /// The deployment group failed to be deprovisioned.
11364        FailedToDeprovision,
11365        /// If set, the enum was initialized with an unknown value.
11366        ///
11367        /// Applications can examine the value using [ProvisioningState::value] or
11368        /// [ProvisioningState::name].
11369        UnknownValue(provisioning_state::UnknownValue),
11370    }
11371
11372    #[doc(hidden)]
11373    pub mod provisioning_state {
11374        #[allow(unused_imports)]
11375        use super::*;
11376        #[derive(Clone, Debug, PartialEq)]
11377        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11378    }
11379
11380    impl ProvisioningState {
11381        /// Gets the enum value.
11382        ///
11383        /// Returns `None` if the enum contains an unknown value deserialized from
11384        /// the string representation of enums.
11385        pub fn value(&self) -> std::option::Option<i32> {
11386            match self {
11387                Self::Unspecified => std::option::Option::Some(0),
11388                Self::Provisioning => std::option::Option::Some(1),
11389                Self::Provisioned => std::option::Option::Some(2),
11390                Self::FailedToProvision => std::option::Option::Some(3),
11391                Self::Deprovisioning => std::option::Option::Some(4),
11392                Self::Deprovisioned => std::option::Option::Some(5),
11393                Self::FailedToDeprovision => std::option::Option::Some(6),
11394                Self::UnknownValue(u) => u.0.value(),
11395            }
11396        }
11397
11398        /// Gets the enum value as a string.
11399        ///
11400        /// Returns `None` if the enum contains an unknown value deserialized from
11401        /// the integer representation of enums.
11402        pub fn name(&self) -> std::option::Option<&str> {
11403            match self {
11404                Self::Unspecified => std::option::Option::Some("PROVISIONING_STATE_UNSPECIFIED"),
11405                Self::Provisioning => std::option::Option::Some("PROVISIONING"),
11406                Self::Provisioned => std::option::Option::Some("PROVISIONED"),
11407                Self::FailedToProvision => std::option::Option::Some("FAILED_TO_PROVISION"),
11408                Self::Deprovisioning => std::option::Option::Some("DEPROVISIONING"),
11409                Self::Deprovisioned => std::option::Option::Some("DEPROVISIONED"),
11410                Self::FailedToDeprovision => std::option::Option::Some("FAILED_TO_DEPROVISION"),
11411                Self::UnknownValue(u) => u.0.name(),
11412            }
11413        }
11414    }
11415
11416    impl std::default::Default for ProvisioningState {
11417        fn default() -> Self {
11418            use std::convert::From;
11419            Self::from(0)
11420        }
11421    }
11422
11423    impl std::fmt::Display for ProvisioningState {
11424        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11425            wkt::internal::display_enum(f, self.name(), self.value())
11426        }
11427    }
11428
11429    impl std::convert::From<i32> for ProvisioningState {
11430        fn from(value: i32) -> Self {
11431            match value {
11432                0 => Self::Unspecified,
11433                1 => Self::Provisioning,
11434                2 => Self::Provisioned,
11435                3 => Self::FailedToProvision,
11436                4 => Self::Deprovisioning,
11437                5 => Self::Deprovisioned,
11438                6 => Self::FailedToDeprovision,
11439                _ => Self::UnknownValue(provisioning_state::UnknownValue(
11440                    wkt::internal::UnknownEnumValue::Integer(value),
11441                )),
11442            }
11443        }
11444    }
11445
11446    impl std::convert::From<&str> for ProvisioningState {
11447        fn from(value: &str) -> Self {
11448            use std::string::ToString;
11449            match value {
11450                "PROVISIONING_STATE_UNSPECIFIED" => Self::Unspecified,
11451                "PROVISIONING" => Self::Provisioning,
11452                "PROVISIONED" => Self::Provisioned,
11453                "FAILED_TO_PROVISION" => Self::FailedToProvision,
11454                "DEPROVISIONING" => Self::Deprovisioning,
11455                "DEPROVISIONED" => Self::Deprovisioned,
11456                "FAILED_TO_DEPROVISION" => Self::FailedToDeprovision,
11457                _ => Self::UnknownValue(provisioning_state::UnknownValue(
11458                    wkt::internal::UnknownEnumValue::String(value.to_string()),
11459                )),
11460            }
11461        }
11462    }
11463
11464    impl serde::ser::Serialize for ProvisioningState {
11465        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11466        where
11467            S: serde::Serializer,
11468        {
11469            match self {
11470                Self::Unspecified => serializer.serialize_i32(0),
11471                Self::Provisioning => serializer.serialize_i32(1),
11472                Self::Provisioned => serializer.serialize_i32(2),
11473                Self::FailedToProvision => serializer.serialize_i32(3),
11474                Self::Deprovisioning => serializer.serialize_i32(4),
11475                Self::Deprovisioned => serializer.serialize_i32(5),
11476                Self::FailedToDeprovision => serializer.serialize_i32(6),
11477                Self::UnknownValue(u) => u.0.serialize(serializer),
11478            }
11479        }
11480    }
11481
11482    impl<'de> serde::de::Deserialize<'de> for ProvisioningState {
11483        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11484        where
11485            D: serde::Deserializer<'de>,
11486        {
11487            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ProvisioningState>::new(
11488                ".google.cloud.config.v1.DeploymentGroup.ProvisioningState",
11489            ))
11490        }
11491    }
11492}
11493
11494/// A DeploymentUnit is a container for a deployment and its dependencies.
11495/// An existing deployment can be provided directly in the unit, or the unit
11496/// can act as a placeholder to define the DAG, with the deployment specs
11497/// supplied in a `provisionDeploymentRequest`.
11498#[derive(Clone, Default, PartialEq)]
11499#[non_exhaustive]
11500pub struct DeploymentUnit {
11501    /// The id of the deployment unit. Must be unique within the deployment group.
11502    pub id: std::string::String,
11503
11504    /// Optional. The name of the deployment to be provisioned.
11505    /// Format:
11506    /// 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
11507    pub deployment: std::option::Option<std::string::String>,
11508
11509    /// Required. The IDs of the deployment units within the deployment group that
11510    /// this unit depends on.
11511    pub dependencies: std::vec::Vec<std::string::String>,
11512
11513    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11514}
11515
11516impl DeploymentUnit {
11517    /// Creates a new default instance.
11518    pub fn new() -> Self {
11519        std::default::Default::default()
11520    }
11521
11522    /// Sets the value of [id][crate::model::DeploymentUnit::id].
11523    ///
11524    /// # Example
11525    /// ```ignore,no_run
11526    /// # use google_cloud_config_v1::model::DeploymentUnit;
11527    /// let x = DeploymentUnit::new().set_id("example");
11528    /// ```
11529    pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11530        self.id = v.into();
11531        self
11532    }
11533
11534    /// Sets the value of [deployment][crate::model::DeploymentUnit::deployment].
11535    ///
11536    /// # Example
11537    /// ```ignore,no_run
11538    /// # use google_cloud_config_v1::model::DeploymentUnit;
11539    /// let x = DeploymentUnit::new().set_deployment("example");
11540    /// ```
11541    pub fn set_deployment<T>(mut self, v: T) -> Self
11542    where
11543        T: std::convert::Into<std::string::String>,
11544    {
11545        self.deployment = std::option::Option::Some(v.into());
11546        self
11547    }
11548
11549    /// Sets or clears the value of [deployment][crate::model::DeploymentUnit::deployment].
11550    ///
11551    /// # Example
11552    /// ```ignore,no_run
11553    /// # use google_cloud_config_v1::model::DeploymentUnit;
11554    /// let x = DeploymentUnit::new().set_or_clear_deployment(Some("example"));
11555    /// let x = DeploymentUnit::new().set_or_clear_deployment(None::<String>);
11556    /// ```
11557    pub fn set_or_clear_deployment<T>(mut self, v: std::option::Option<T>) -> Self
11558    where
11559        T: std::convert::Into<std::string::String>,
11560    {
11561        self.deployment = v.map(|x| x.into());
11562        self
11563    }
11564
11565    /// Sets the value of [dependencies][crate::model::DeploymentUnit::dependencies].
11566    ///
11567    /// # Example
11568    /// ```ignore,no_run
11569    /// # use google_cloud_config_v1::model::DeploymentUnit;
11570    /// let x = DeploymentUnit::new().set_dependencies(["a", "b", "c"]);
11571    /// ```
11572    pub fn set_dependencies<T, V>(mut self, v: T) -> Self
11573    where
11574        T: std::iter::IntoIterator<Item = V>,
11575        V: std::convert::Into<std::string::String>,
11576    {
11577        use std::iter::Iterator;
11578        self.dependencies = v.into_iter().map(|i| i.into()).collect();
11579        self
11580    }
11581}
11582
11583impl wkt::message::Message for DeploymentUnit {
11584    fn typename() -> &'static str {
11585        "type.googleapis.com/google.cloud.config.v1.DeploymentUnit"
11586    }
11587}
11588
11589/// Spec for a deployment to be created.
11590#[derive(Clone, Default, PartialEq)]
11591#[non_exhaustive]
11592pub struct DeploymentSpec {
11593    /// Required. The id of the deployment to be created which doesn't include the
11594    /// project id and location.
11595    pub deployment_id: std::string::String,
11596
11597    /// Required. The deployment to be created.
11598    pub deployment: std::option::Option<crate::model::Deployment>,
11599
11600    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11601}
11602
11603impl DeploymentSpec {
11604    /// Creates a new default instance.
11605    pub fn new() -> Self {
11606        std::default::Default::default()
11607    }
11608
11609    /// Sets the value of [deployment_id][crate::model::DeploymentSpec::deployment_id].
11610    ///
11611    /// # Example
11612    /// ```ignore,no_run
11613    /// # use google_cloud_config_v1::model::DeploymentSpec;
11614    /// let x = DeploymentSpec::new().set_deployment_id("example");
11615    /// ```
11616    pub fn set_deployment_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11617        self.deployment_id = v.into();
11618        self
11619    }
11620
11621    /// Sets the value of [deployment][crate::model::DeploymentSpec::deployment].
11622    ///
11623    /// # Example
11624    /// ```ignore,no_run
11625    /// # use google_cloud_config_v1::model::DeploymentSpec;
11626    /// use google_cloud_config_v1::model::Deployment;
11627    /// let x = DeploymentSpec::new().set_deployment(Deployment::default()/* use setters */);
11628    /// ```
11629    pub fn set_deployment<T>(mut self, v: T) -> Self
11630    where
11631        T: std::convert::Into<crate::model::Deployment>,
11632    {
11633        self.deployment = std::option::Option::Some(v.into());
11634        self
11635    }
11636
11637    /// Sets or clears the value of [deployment][crate::model::DeploymentSpec::deployment].
11638    ///
11639    /// # Example
11640    /// ```ignore,no_run
11641    /// # use google_cloud_config_v1::model::DeploymentSpec;
11642    /// use google_cloud_config_v1::model::Deployment;
11643    /// let x = DeploymentSpec::new().set_or_clear_deployment(Some(Deployment::default()/* use setters */));
11644    /// let x = DeploymentSpec::new().set_or_clear_deployment(None::<Deployment>);
11645    /// ```
11646    pub fn set_or_clear_deployment<T>(mut self, v: std::option::Option<T>) -> Self
11647    where
11648        T: std::convert::Into<crate::model::Deployment>,
11649    {
11650        self.deployment = v.map(|x| x.into());
11651        self
11652    }
11653}
11654
11655impl wkt::message::Message for DeploymentSpec {
11656    fn typename() -> &'static str {
11657        "type.googleapis.com/google.cloud.config.v1.DeploymentSpec"
11658    }
11659}
11660
11661/// The request message for the GetDeploymentGroup method.
11662#[derive(Clone, Default, PartialEq)]
11663#[non_exhaustive]
11664pub struct GetDeploymentGroupRequest {
11665    /// Required. The name of the deployment group to retrieve.
11666    /// Format:
11667    /// 'projects/{project_id}/locations/{location}/deploymentGroups/{deployment_group}'.
11668    pub name: std::string::String,
11669
11670    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11671}
11672
11673impl GetDeploymentGroupRequest {
11674    /// Creates a new default instance.
11675    pub fn new() -> Self {
11676        std::default::Default::default()
11677    }
11678
11679    /// Sets the value of [name][crate::model::GetDeploymentGroupRequest::name].
11680    ///
11681    /// # Example
11682    /// ```ignore,no_run
11683    /// # use google_cloud_config_v1::model::GetDeploymentGroupRequest;
11684    /// let x = GetDeploymentGroupRequest::new().set_name("example");
11685    /// ```
11686    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11687        self.name = v.into();
11688        self
11689    }
11690}
11691
11692impl wkt::message::Message for GetDeploymentGroupRequest {
11693    fn typename() -> &'static str {
11694        "type.googleapis.com/google.cloud.config.v1.GetDeploymentGroupRequest"
11695    }
11696}
11697
11698/// The request message for the ListDeploymentGroups method.
11699#[derive(Clone, Default, PartialEq)]
11700#[non_exhaustive]
11701pub struct ListDeploymentGroupsRequest {
11702    /// Required. The parent, which owns this collection of deployment groups.
11703    /// Format: 'projects/{project_id}/locations/{location}'.
11704    pub parent: std::string::String,
11705
11706    /// Optional. When requesting a page of resources, 'page_size' specifies number
11707    /// of resources to return. If unspecified, at most 500 will be returned. The
11708    /// maximum value is 1000.
11709    pub page_size: i32,
11710
11711    /// Optional. Token returned by previous call to 'ListDeploymentGroups' which
11712    /// specifies the position in the list from where to continue listing the
11713    /// deployment groups.
11714    pub page_token: std::string::String,
11715
11716    /// Optional. Lists the DeploymentGroups that match the filter expression. A
11717    /// filter expression filters the deployment groups listed in the response. The
11718    /// expression must be of the form '{field} {operator} {value}' where
11719    /// operators: '<', '>',
11720    /// '<=', '>=', '!=', '=', ':' are supported (colon ':' represents a HAS
11721    /// operator which is roughly synonymous with equality). {field} can refer to a
11722    /// proto or JSON field, or a synthetic field. Field names can be camelCase or
11723    /// snake_case.
11724    ///
11725    /// Examples:
11726    ///
11727    /// - Filter by name:
11728    ///   name = "projects/foo/locations/us-central1/deploymentGroups/bar"
11729    ///
11730    /// - Filter by labels:
11731    ///
11732    ///   - Resources that have a key called 'foo'
11733    ///     labels.foo:*
11734    ///   - Resources that have a key called 'foo' whose value is 'bar'
11735    ///     labels.foo = bar
11736    /// - Filter by state:
11737    ///
11738    ///   - DeploymentGroups in CREATING state.
11739    ///     state=CREATING
11740    pub filter: std::string::String,
11741
11742    /// Optional. Field to use to sort the list.
11743    pub order_by: std::string::String,
11744
11745    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11746}
11747
11748impl ListDeploymentGroupsRequest {
11749    /// Creates a new default instance.
11750    pub fn new() -> Self {
11751        std::default::Default::default()
11752    }
11753
11754    /// Sets the value of [parent][crate::model::ListDeploymentGroupsRequest::parent].
11755    ///
11756    /// # Example
11757    /// ```ignore,no_run
11758    /// # use google_cloud_config_v1::model::ListDeploymentGroupsRequest;
11759    /// let x = ListDeploymentGroupsRequest::new().set_parent("example");
11760    /// ```
11761    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11762        self.parent = v.into();
11763        self
11764    }
11765
11766    /// Sets the value of [page_size][crate::model::ListDeploymentGroupsRequest::page_size].
11767    ///
11768    /// # Example
11769    /// ```ignore,no_run
11770    /// # use google_cloud_config_v1::model::ListDeploymentGroupsRequest;
11771    /// let x = ListDeploymentGroupsRequest::new().set_page_size(42);
11772    /// ```
11773    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11774        self.page_size = v.into();
11775        self
11776    }
11777
11778    /// Sets the value of [page_token][crate::model::ListDeploymentGroupsRequest::page_token].
11779    ///
11780    /// # Example
11781    /// ```ignore,no_run
11782    /// # use google_cloud_config_v1::model::ListDeploymentGroupsRequest;
11783    /// let x = ListDeploymentGroupsRequest::new().set_page_token("example");
11784    /// ```
11785    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11786        self.page_token = v.into();
11787        self
11788    }
11789
11790    /// Sets the value of [filter][crate::model::ListDeploymentGroupsRequest::filter].
11791    ///
11792    /// # Example
11793    /// ```ignore,no_run
11794    /// # use google_cloud_config_v1::model::ListDeploymentGroupsRequest;
11795    /// let x = ListDeploymentGroupsRequest::new().set_filter("example");
11796    /// ```
11797    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11798        self.filter = v.into();
11799        self
11800    }
11801
11802    /// Sets the value of [order_by][crate::model::ListDeploymentGroupsRequest::order_by].
11803    ///
11804    /// # Example
11805    /// ```ignore,no_run
11806    /// # use google_cloud_config_v1::model::ListDeploymentGroupsRequest;
11807    /// let x = ListDeploymentGroupsRequest::new().set_order_by("example");
11808    /// ```
11809    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11810        self.order_by = v.into();
11811        self
11812    }
11813}
11814
11815impl wkt::message::Message for ListDeploymentGroupsRequest {
11816    fn typename() -> &'static str {
11817        "type.googleapis.com/google.cloud.config.v1.ListDeploymentGroupsRequest"
11818    }
11819}
11820
11821/// The response message for the ListDeploymentGroups method.
11822#[derive(Clone, Default, PartialEq)]
11823#[non_exhaustive]
11824pub struct ListDeploymentGroupsResponse {
11825    /// The deployment groups from the specified collection.
11826    pub deployment_groups: std::vec::Vec<crate::model::DeploymentGroup>,
11827
11828    /// Token to be supplied to the next ListDeploymentGroups request via
11829    /// `page_token` to obtain the next set of results.
11830    pub next_page_token: std::string::String,
11831
11832    /// Locations that could not be reached.
11833    pub unreachable: std::vec::Vec<std::string::String>,
11834
11835    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11836}
11837
11838impl ListDeploymentGroupsResponse {
11839    /// Creates a new default instance.
11840    pub fn new() -> Self {
11841        std::default::Default::default()
11842    }
11843
11844    /// Sets the value of [deployment_groups][crate::model::ListDeploymentGroupsResponse::deployment_groups].
11845    ///
11846    /// # Example
11847    /// ```ignore,no_run
11848    /// # use google_cloud_config_v1::model::ListDeploymentGroupsResponse;
11849    /// use google_cloud_config_v1::model::DeploymentGroup;
11850    /// let x = ListDeploymentGroupsResponse::new()
11851    ///     .set_deployment_groups([
11852    ///         DeploymentGroup::default()/* use setters */,
11853    ///         DeploymentGroup::default()/* use (different) setters */,
11854    ///     ]);
11855    /// ```
11856    pub fn set_deployment_groups<T, V>(mut self, v: T) -> Self
11857    where
11858        T: std::iter::IntoIterator<Item = V>,
11859        V: std::convert::Into<crate::model::DeploymentGroup>,
11860    {
11861        use std::iter::Iterator;
11862        self.deployment_groups = v.into_iter().map(|i| i.into()).collect();
11863        self
11864    }
11865
11866    /// Sets the value of [next_page_token][crate::model::ListDeploymentGroupsResponse::next_page_token].
11867    ///
11868    /// # Example
11869    /// ```ignore,no_run
11870    /// # use google_cloud_config_v1::model::ListDeploymentGroupsResponse;
11871    /// let x = ListDeploymentGroupsResponse::new().set_next_page_token("example");
11872    /// ```
11873    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11874        self.next_page_token = v.into();
11875        self
11876    }
11877
11878    /// Sets the value of [unreachable][crate::model::ListDeploymentGroupsResponse::unreachable].
11879    ///
11880    /// # Example
11881    /// ```ignore,no_run
11882    /// # use google_cloud_config_v1::model::ListDeploymentGroupsResponse;
11883    /// let x = ListDeploymentGroupsResponse::new().set_unreachable(["a", "b", "c"]);
11884    /// ```
11885    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
11886    where
11887        T: std::iter::IntoIterator<Item = V>,
11888        V: std::convert::Into<std::string::String>,
11889    {
11890        use std::iter::Iterator;
11891        self.unreachable = v.into_iter().map(|i| i.into()).collect();
11892        self
11893    }
11894}
11895
11896impl wkt::message::Message for ListDeploymentGroupsResponse {
11897    fn typename() -> &'static str {
11898        "type.googleapis.com/google.cloud.config.v1.ListDeploymentGroupsResponse"
11899    }
11900}
11901
11902#[doc(hidden)]
11903impl google_cloud_gax::paginator::internal::PageableResponse for ListDeploymentGroupsResponse {
11904    type PageItem = crate::model::DeploymentGroup;
11905
11906    fn items(self) -> std::vec::Vec<Self::PageItem> {
11907        self.deployment_groups
11908    }
11909
11910    fn next_page_token(&self) -> std::string::String {
11911        use std::clone::Clone;
11912        self.next_page_token.clone()
11913    }
11914}
11915
11916/// The request message for the ProvisionDeploymentGroup method.
11917#[derive(Clone, Default, PartialEq)]
11918#[non_exhaustive]
11919pub struct ProvisionDeploymentGroupRequest {
11920    /// Required. The name of the deployment group to provision.
11921    /// Format:
11922    /// 'projects/{project_id}/locations/{location}/deploymentGroups/{deployment_group}'.
11923    pub name: std::string::String,
11924
11925    /// Optional. The deployment specs of the deployment units to be created within
11926    /// the same project and location of the deployment group. The key is the unit
11927    /// ID, and the value is the `DeploymentSpec`. Provisioning will fail if a
11928    /// `deployment_spec` has a `deployment_id` that matches an existing deployment
11929    /// in the same project and location. If an existing deployment was part of the
11930    /// last successful revision but is no longer in the current DeploymentGroup's
11931    /// `deployment_units`, it will be recreated if included in `deployment_specs`.
11932    pub deployment_specs:
11933        std::collections::HashMap<std::string::String, crate::model::DeploymentSpec>,
11934
11935    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11936}
11937
11938impl ProvisionDeploymentGroupRequest {
11939    /// Creates a new default instance.
11940    pub fn new() -> Self {
11941        std::default::Default::default()
11942    }
11943
11944    /// Sets the value of [name][crate::model::ProvisionDeploymentGroupRequest::name].
11945    ///
11946    /// # Example
11947    /// ```ignore,no_run
11948    /// # use google_cloud_config_v1::model::ProvisionDeploymentGroupRequest;
11949    /// let x = ProvisionDeploymentGroupRequest::new().set_name("example");
11950    /// ```
11951    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11952        self.name = v.into();
11953        self
11954    }
11955
11956    /// Sets the value of [deployment_specs][crate::model::ProvisionDeploymentGroupRequest::deployment_specs].
11957    ///
11958    /// # Example
11959    /// ```ignore,no_run
11960    /// # use google_cloud_config_v1::model::ProvisionDeploymentGroupRequest;
11961    /// use google_cloud_config_v1::model::DeploymentSpec;
11962    /// let x = ProvisionDeploymentGroupRequest::new().set_deployment_specs([
11963    ///     ("key0", DeploymentSpec::default()/* use setters */),
11964    ///     ("key1", DeploymentSpec::default()/* use (different) setters */),
11965    /// ]);
11966    /// ```
11967    pub fn set_deployment_specs<T, K, V>(mut self, v: T) -> Self
11968    where
11969        T: std::iter::IntoIterator<Item = (K, V)>,
11970        K: std::convert::Into<std::string::String>,
11971        V: std::convert::Into<crate::model::DeploymentSpec>,
11972    {
11973        use std::iter::Iterator;
11974        self.deployment_specs = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
11975        self
11976    }
11977}
11978
11979impl wkt::message::Message for ProvisionDeploymentGroupRequest {
11980    fn typename() -> &'static str {
11981        "type.googleapis.com/google.cloud.config.v1.ProvisionDeploymentGroupRequest"
11982    }
11983}
11984
11985/// The request message for the DeprovisionDeploymentGroup method.
11986#[derive(Clone, Default, PartialEq)]
11987#[non_exhaustive]
11988pub struct DeprovisionDeploymentGroupRequest {
11989    /// Required. The name of the deployment group to deprovision.
11990    /// Format:
11991    /// 'projects/{project_id}/locations/{location}/deploymentGroups/{deployment_group}'.
11992    pub name: std::string::String,
11993
11994    /// Optional. If set to true, this option is propagated to the deletion of each
11995    /// deployment in the group. This corresponds to the 'force' field
11996    /// in DeleteDeploymentRequest.
11997    pub force: bool,
11998
11999    /// Optional. Policy on how resources within each deployment should be handled
12000    /// during deletion. This policy is applied globally to the deletion of all
12001    /// deployments in this group. This corresponds to the 'delete_policy' field
12002    /// in DeleteDeploymentRequest.
12003    pub delete_policy: crate::model::delete_deployment_request::DeletePolicy,
12004
12005    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12006}
12007
12008impl DeprovisionDeploymentGroupRequest {
12009    /// Creates a new default instance.
12010    pub fn new() -> Self {
12011        std::default::Default::default()
12012    }
12013
12014    /// Sets the value of [name][crate::model::DeprovisionDeploymentGroupRequest::name].
12015    ///
12016    /// # Example
12017    /// ```ignore,no_run
12018    /// # use google_cloud_config_v1::model::DeprovisionDeploymentGroupRequest;
12019    /// let x = DeprovisionDeploymentGroupRequest::new().set_name("example");
12020    /// ```
12021    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12022        self.name = v.into();
12023        self
12024    }
12025
12026    /// Sets the value of [force][crate::model::DeprovisionDeploymentGroupRequest::force].
12027    ///
12028    /// # Example
12029    /// ```ignore,no_run
12030    /// # use google_cloud_config_v1::model::DeprovisionDeploymentGroupRequest;
12031    /// let x = DeprovisionDeploymentGroupRequest::new().set_force(true);
12032    /// ```
12033    pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
12034        self.force = v.into();
12035        self
12036    }
12037
12038    /// Sets the value of [delete_policy][crate::model::DeprovisionDeploymentGroupRequest::delete_policy].
12039    ///
12040    /// # Example
12041    /// ```ignore,no_run
12042    /// # use google_cloud_config_v1::model::DeprovisionDeploymentGroupRequest;
12043    /// use google_cloud_config_v1::model::delete_deployment_request::DeletePolicy;
12044    /// let x0 = DeprovisionDeploymentGroupRequest::new().set_delete_policy(DeletePolicy::Delete);
12045    /// let x1 = DeprovisionDeploymentGroupRequest::new().set_delete_policy(DeletePolicy::Abandon);
12046    /// ```
12047    pub fn set_delete_policy<
12048        T: std::convert::Into<crate::model::delete_deployment_request::DeletePolicy>,
12049    >(
12050        mut self,
12051        v: T,
12052    ) -> Self {
12053        self.delete_policy = v.into();
12054        self
12055    }
12056}
12057
12058impl wkt::message::Message for DeprovisionDeploymentGroupRequest {
12059    fn typename() -> &'static str {
12060        "type.googleapis.com/google.cloud.config.v1.DeprovisionDeploymentGroupRequest"
12061    }
12062}
12063
12064/// The summary of the deployment operation.
12065#[derive(Clone, Default, PartialEq)]
12066#[non_exhaustive]
12067pub struct DeploymentOperationSummary {
12068    /// Output only. The current step the deployment operation is running.
12069    pub deployment_step: crate::model::deployment_operation_metadata::DeploymentStep,
12070
12071    /// Output only. Cloud Build instance UUID associated with this operation.
12072    pub build: std::string::String,
12073
12074    /// Output only. Location of Deployment operations logs in
12075    /// `gs://{bucket}/{object}` format.
12076    pub logs: std::string::String,
12077
12078    /// Output only. Location of Deployment operations content in
12079    /// `gs://{bucket}/{object}` format.
12080    pub content: std::string::String,
12081
12082    /// Output only. Location of Deployment operations artifacts in
12083    /// `gs://{bucket}/{object}` format.
12084    pub artifacts: std::string::String,
12085
12086    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12087}
12088
12089impl DeploymentOperationSummary {
12090    /// Creates a new default instance.
12091    pub fn new() -> Self {
12092        std::default::Default::default()
12093    }
12094
12095    /// Sets the value of [deployment_step][crate::model::DeploymentOperationSummary::deployment_step].
12096    ///
12097    /// # Example
12098    /// ```ignore,no_run
12099    /// # use google_cloud_config_v1::model::DeploymentOperationSummary;
12100    /// use google_cloud_config_v1::model::deployment_operation_metadata::DeploymentStep;
12101    /// let x0 = DeploymentOperationSummary::new().set_deployment_step(DeploymentStep::PreparingStorageBucket);
12102    /// let x1 = DeploymentOperationSummary::new().set_deployment_step(DeploymentStep::DownloadingBlueprint);
12103    /// let x2 = DeploymentOperationSummary::new().set_deployment_step(DeploymentStep::RunningTfInit);
12104    /// ```
12105    pub fn set_deployment_step<
12106        T: std::convert::Into<crate::model::deployment_operation_metadata::DeploymentStep>,
12107    >(
12108        mut self,
12109        v: T,
12110    ) -> Self {
12111        self.deployment_step = v.into();
12112        self
12113    }
12114
12115    /// Sets the value of [build][crate::model::DeploymentOperationSummary::build].
12116    ///
12117    /// # Example
12118    /// ```ignore,no_run
12119    /// # use google_cloud_config_v1::model::DeploymentOperationSummary;
12120    /// let x = DeploymentOperationSummary::new().set_build("example");
12121    /// ```
12122    pub fn set_build<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12123        self.build = v.into();
12124        self
12125    }
12126
12127    /// Sets the value of [logs][crate::model::DeploymentOperationSummary::logs].
12128    ///
12129    /// # Example
12130    /// ```ignore,no_run
12131    /// # use google_cloud_config_v1::model::DeploymentOperationSummary;
12132    /// let x = DeploymentOperationSummary::new().set_logs("example");
12133    /// ```
12134    pub fn set_logs<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12135        self.logs = v.into();
12136        self
12137    }
12138
12139    /// Sets the value of [content][crate::model::DeploymentOperationSummary::content].
12140    ///
12141    /// # Example
12142    /// ```ignore,no_run
12143    /// # use google_cloud_config_v1::model::DeploymentOperationSummary;
12144    /// let x = DeploymentOperationSummary::new().set_content("example");
12145    /// ```
12146    pub fn set_content<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12147        self.content = v.into();
12148        self
12149    }
12150
12151    /// Sets the value of [artifacts][crate::model::DeploymentOperationSummary::artifacts].
12152    ///
12153    /// # Example
12154    /// ```ignore,no_run
12155    /// # use google_cloud_config_v1::model::DeploymentOperationSummary;
12156    /// let x = DeploymentOperationSummary::new().set_artifacts("example");
12157    /// ```
12158    pub fn set_artifacts<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12159        self.artifacts = v.into();
12160        self
12161    }
12162}
12163
12164impl wkt::message::Message for DeploymentOperationSummary {
12165    fn typename() -> &'static str {
12166        "type.googleapis.com/google.cloud.config.v1.DeploymentOperationSummary"
12167    }
12168}
12169
12170/// The progress of a deployment unit provisioning or deprovisioning.
12171#[derive(Clone, Default, PartialEq)]
12172#[non_exhaustive]
12173pub struct DeploymentUnitProgress {
12174    /// Output only. The unit id of the deployment unit to be provisioned.
12175    pub unit_id: std::string::String,
12176
12177    /// Output only. The name of the deployment to be provisioned.
12178    /// Format:
12179    /// 'projects/{project}/locations/{location}/deployments/{deployment}'.
12180    pub deployment: std::string::String,
12181
12182    /// Output only. The current step of the deployment unit provisioning.
12183    pub state: crate::model::deployment_unit_progress::State,
12184
12185    /// Output only. Additional information regarding the current state.
12186    pub state_description: std::string::String,
12187
12188    /// Output only. The summary of the deployment operation.
12189    pub deployment_operation_summary: std::option::Option<crate::model::DeploymentOperationSummary>,
12190
12191    /// Output only. Holds the error status of the deployment unit provisioning.
12192    pub error: std::option::Option<google_cloud_rpc::model::Status>,
12193
12194    /// Output only. The intent of the deployment unit.
12195    pub intent: crate::model::deployment_unit_progress::Intent,
12196
12197    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12198}
12199
12200impl DeploymentUnitProgress {
12201    /// Creates a new default instance.
12202    pub fn new() -> Self {
12203        std::default::Default::default()
12204    }
12205
12206    /// Sets the value of [unit_id][crate::model::DeploymentUnitProgress::unit_id].
12207    ///
12208    /// # Example
12209    /// ```ignore,no_run
12210    /// # use google_cloud_config_v1::model::DeploymentUnitProgress;
12211    /// let x = DeploymentUnitProgress::new().set_unit_id("example");
12212    /// ```
12213    pub fn set_unit_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12214        self.unit_id = v.into();
12215        self
12216    }
12217
12218    /// Sets the value of [deployment][crate::model::DeploymentUnitProgress::deployment].
12219    ///
12220    /// # Example
12221    /// ```ignore,no_run
12222    /// # use google_cloud_config_v1::model::DeploymentUnitProgress;
12223    /// let x = DeploymentUnitProgress::new().set_deployment("example");
12224    /// ```
12225    pub fn set_deployment<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12226        self.deployment = v.into();
12227        self
12228    }
12229
12230    /// Sets the value of [state][crate::model::DeploymentUnitProgress::state].
12231    ///
12232    /// # Example
12233    /// ```ignore,no_run
12234    /// # use google_cloud_config_v1::model::DeploymentUnitProgress;
12235    /// use google_cloud_config_v1::model::deployment_unit_progress::State;
12236    /// let x0 = DeploymentUnitProgress::new().set_state(State::Queued);
12237    /// let x1 = DeploymentUnitProgress::new().set_state(State::ApplyingDeployment);
12238    /// let x2 = DeploymentUnitProgress::new().set_state(State::Succeeded);
12239    /// ```
12240    pub fn set_state<T: std::convert::Into<crate::model::deployment_unit_progress::State>>(
12241        mut self,
12242        v: T,
12243    ) -> Self {
12244        self.state = v.into();
12245        self
12246    }
12247
12248    /// Sets the value of [state_description][crate::model::DeploymentUnitProgress::state_description].
12249    ///
12250    /// # Example
12251    /// ```ignore,no_run
12252    /// # use google_cloud_config_v1::model::DeploymentUnitProgress;
12253    /// let x = DeploymentUnitProgress::new().set_state_description("example");
12254    /// ```
12255    pub fn set_state_description<T: std::convert::Into<std::string::String>>(
12256        mut self,
12257        v: T,
12258    ) -> Self {
12259        self.state_description = v.into();
12260        self
12261    }
12262
12263    /// Sets the value of [deployment_operation_summary][crate::model::DeploymentUnitProgress::deployment_operation_summary].
12264    ///
12265    /// # Example
12266    /// ```ignore,no_run
12267    /// # use google_cloud_config_v1::model::DeploymentUnitProgress;
12268    /// use google_cloud_config_v1::model::DeploymentOperationSummary;
12269    /// let x = DeploymentUnitProgress::new().set_deployment_operation_summary(DeploymentOperationSummary::default()/* use setters */);
12270    /// ```
12271    pub fn set_deployment_operation_summary<T>(mut self, v: T) -> Self
12272    where
12273        T: std::convert::Into<crate::model::DeploymentOperationSummary>,
12274    {
12275        self.deployment_operation_summary = std::option::Option::Some(v.into());
12276        self
12277    }
12278
12279    /// Sets or clears the value of [deployment_operation_summary][crate::model::DeploymentUnitProgress::deployment_operation_summary].
12280    ///
12281    /// # Example
12282    /// ```ignore,no_run
12283    /// # use google_cloud_config_v1::model::DeploymentUnitProgress;
12284    /// use google_cloud_config_v1::model::DeploymentOperationSummary;
12285    /// let x = DeploymentUnitProgress::new().set_or_clear_deployment_operation_summary(Some(DeploymentOperationSummary::default()/* use setters */));
12286    /// let x = DeploymentUnitProgress::new().set_or_clear_deployment_operation_summary(None::<DeploymentOperationSummary>);
12287    /// ```
12288    pub fn set_or_clear_deployment_operation_summary<T>(mut self, v: std::option::Option<T>) -> Self
12289    where
12290        T: std::convert::Into<crate::model::DeploymentOperationSummary>,
12291    {
12292        self.deployment_operation_summary = v.map(|x| x.into());
12293        self
12294    }
12295
12296    /// Sets the value of [error][crate::model::DeploymentUnitProgress::error].
12297    ///
12298    /// # Example
12299    /// ```ignore,no_run
12300    /// # use google_cloud_config_v1::model::DeploymentUnitProgress;
12301    /// use google_cloud_rpc::model::Status;
12302    /// let x = DeploymentUnitProgress::new().set_error(Status::default()/* use setters */);
12303    /// ```
12304    pub fn set_error<T>(mut self, v: T) -> Self
12305    where
12306        T: std::convert::Into<google_cloud_rpc::model::Status>,
12307    {
12308        self.error = std::option::Option::Some(v.into());
12309        self
12310    }
12311
12312    /// Sets or clears the value of [error][crate::model::DeploymentUnitProgress::error].
12313    ///
12314    /// # Example
12315    /// ```ignore,no_run
12316    /// # use google_cloud_config_v1::model::DeploymentUnitProgress;
12317    /// use google_cloud_rpc::model::Status;
12318    /// let x = DeploymentUnitProgress::new().set_or_clear_error(Some(Status::default()/* use setters */));
12319    /// let x = DeploymentUnitProgress::new().set_or_clear_error(None::<Status>);
12320    /// ```
12321    pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
12322    where
12323        T: std::convert::Into<google_cloud_rpc::model::Status>,
12324    {
12325        self.error = v.map(|x| x.into());
12326        self
12327    }
12328
12329    /// Sets the value of [intent][crate::model::DeploymentUnitProgress::intent].
12330    ///
12331    /// # Example
12332    /// ```ignore,no_run
12333    /// # use google_cloud_config_v1::model::DeploymentUnitProgress;
12334    /// use google_cloud_config_v1::model::deployment_unit_progress::Intent;
12335    /// let x0 = DeploymentUnitProgress::new().set_intent(Intent::CreateDeployment);
12336    /// let x1 = DeploymentUnitProgress::new().set_intent(Intent::UpdateDeployment);
12337    /// let x2 = DeploymentUnitProgress::new().set_intent(Intent::DeleteDeployment);
12338    /// ```
12339    pub fn set_intent<T: std::convert::Into<crate::model::deployment_unit_progress::Intent>>(
12340        mut self,
12341        v: T,
12342    ) -> Self {
12343        self.intent = v.into();
12344        self
12345    }
12346}
12347
12348impl wkt::message::Message for DeploymentUnitProgress {
12349    fn typename() -> &'static str {
12350        "type.googleapis.com/google.cloud.config.v1.DeploymentUnitProgress"
12351    }
12352}
12353
12354/// Defines additional types related to [DeploymentUnitProgress].
12355pub mod deployment_unit_progress {
12356    #[allow(unused_imports)]
12357    use super::*;
12358
12359    /// The possible steps a deployment unit provisioning may be running.
12360    ///
12361    /// # Working with unknown values
12362    ///
12363    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12364    /// additional enum variants at any time. Adding new variants is not considered
12365    /// a breaking change. Applications should write their code in anticipation of:
12366    ///
12367    /// - New values appearing in future releases of the client library, **and**
12368    /// - New values received dynamically, without application changes.
12369    ///
12370    /// Please consult the [Working with enums] section in the user guide for some
12371    /// guidelines.
12372    ///
12373    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
12374    #[derive(Clone, Debug, PartialEq)]
12375    #[non_exhaustive]
12376    pub enum State {
12377        /// The default value. This value is unused.
12378        Unspecified,
12379        /// The deployment unit is queued for deployment creation or update.
12380        Queued,
12381        /// The underlying deployment of the unit is being created or updated.
12382        ApplyingDeployment,
12383        /// The underlying deployment operation of the unit has succeeded.
12384        Succeeded,
12385        /// The underlying deployment operation of the unit has failed.
12386        Failed,
12387        /// The deployment unit was aborted, likely due to failures in other
12388        /// dependent deployment units.
12389        Aborted,
12390        /// The deployment unit was skipped because there were no changes to apply.
12391        Skipped,
12392        /// The deployment is being deleted.
12393        DeletingDeployment,
12394        /// The deployment is being previewed.
12395        PreviewingDeployment,
12396        /// If set, the enum was initialized with an unknown value.
12397        ///
12398        /// Applications can examine the value using [State::value] or
12399        /// [State::name].
12400        UnknownValue(state::UnknownValue),
12401    }
12402
12403    #[doc(hidden)]
12404    pub mod state {
12405        #[allow(unused_imports)]
12406        use super::*;
12407        #[derive(Clone, Debug, PartialEq)]
12408        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12409    }
12410
12411    impl State {
12412        /// Gets the enum value.
12413        ///
12414        /// Returns `None` if the enum contains an unknown value deserialized from
12415        /// the string representation of enums.
12416        pub fn value(&self) -> std::option::Option<i32> {
12417            match self {
12418                Self::Unspecified => std::option::Option::Some(0),
12419                Self::Queued => std::option::Option::Some(1),
12420                Self::ApplyingDeployment => std::option::Option::Some(2),
12421                Self::Succeeded => std::option::Option::Some(4),
12422                Self::Failed => std::option::Option::Some(5),
12423                Self::Aborted => std::option::Option::Some(6),
12424                Self::Skipped => std::option::Option::Some(7),
12425                Self::DeletingDeployment => std::option::Option::Some(8),
12426                Self::PreviewingDeployment => std::option::Option::Some(9),
12427                Self::UnknownValue(u) => u.0.value(),
12428            }
12429        }
12430
12431        /// Gets the enum value as a string.
12432        ///
12433        /// Returns `None` if the enum contains an unknown value deserialized from
12434        /// the integer representation of enums.
12435        pub fn name(&self) -> std::option::Option<&str> {
12436            match self {
12437                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
12438                Self::Queued => std::option::Option::Some("QUEUED"),
12439                Self::ApplyingDeployment => std::option::Option::Some("APPLYING_DEPLOYMENT"),
12440                Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
12441                Self::Failed => std::option::Option::Some("FAILED"),
12442                Self::Aborted => std::option::Option::Some("ABORTED"),
12443                Self::Skipped => std::option::Option::Some("SKIPPED"),
12444                Self::DeletingDeployment => std::option::Option::Some("DELETING_DEPLOYMENT"),
12445                Self::PreviewingDeployment => std::option::Option::Some("PREVIEWING_DEPLOYMENT"),
12446                Self::UnknownValue(u) => u.0.name(),
12447            }
12448        }
12449    }
12450
12451    impl std::default::Default for State {
12452        fn default() -> Self {
12453            use std::convert::From;
12454            Self::from(0)
12455        }
12456    }
12457
12458    impl std::fmt::Display for State {
12459        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12460            wkt::internal::display_enum(f, self.name(), self.value())
12461        }
12462    }
12463
12464    impl std::convert::From<i32> for State {
12465        fn from(value: i32) -> Self {
12466            match value {
12467                0 => Self::Unspecified,
12468                1 => Self::Queued,
12469                2 => Self::ApplyingDeployment,
12470                4 => Self::Succeeded,
12471                5 => Self::Failed,
12472                6 => Self::Aborted,
12473                7 => Self::Skipped,
12474                8 => Self::DeletingDeployment,
12475                9 => Self::PreviewingDeployment,
12476                _ => Self::UnknownValue(state::UnknownValue(
12477                    wkt::internal::UnknownEnumValue::Integer(value),
12478                )),
12479            }
12480        }
12481    }
12482
12483    impl std::convert::From<&str> for State {
12484        fn from(value: &str) -> Self {
12485            use std::string::ToString;
12486            match value {
12487                "STATE_UNSPECIFIED" => Self::Unspecified,
12488                "QUEUED" => Self::Queued,
12489                "APPLYING_DEPLOYMENT" => Self::ApplyingDeployment,
12490                "SUCCEEDED" => Self::Succeeded,
12491                "FAILED" => Self::Failed,
12492                "ABORTED" => Self::Aborted,
12493                "SKIPPED" => Self::Skipped,
12494                "DELETING_DEPLOYMENT" => Self::DeletingDeployment,
12495                "PREVIEWING_DEPLOYMENT" => Self::PreviewingDeployment,
12496                _ => Self::UnknownValue(state::UnknownValue(
12497                    wkt::internal::UnknownEnumValue::String(value.to_string()),
12498                )),
12499            }
12500        }
12501    }
12502
12503    impl serde::ser::Serialize for State {
12504        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12505        where
12506            S: serde::Serializer,
12507        {
12508            match self {
12509                Self::Unspecified => serializer.serialize_i32(0),
12510                Self::Queued => serializer.serialize_i32(1),
12511                Self::ApplyingDeployment => serializer.serialize_i32(2),
12512                Self::Succeeded => serializer.serialize_i32(4),
12513                Self::Failed => serializer.serialize_i32(5),
12514                Self::Aborted => serializer.serialize_i32(6),
12515                Self::Skipped => serializer.serialize_i32(7),
12516                Self::DeletingDeployment => serializer.serialize_i32(8),
12517                Self::PreviewingDeployment => serializer.serialize_i32(9),
12518                Self::UnknownValue(u) => u.0.serialize(serializer),
12519            }
12520        }
12521    }
12522
12523    impl<'de> serde::de::Deserialize<'de> for State {
12524        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12525        where
12526            D: serde::Deserializer<'de>,
12527        {
12528            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
12529                ".google.cloud.config.v1.DeploymentUnitProgress.State",
12530            ))
12531        }
12532    }
12533
12534    /// The possible intents of a deployment unit.
12535    ///
12536    /// # Working with unknown values
12537    ///
12538    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12539    /// additional enum variants at any time. Adding new variants is not considered
12540    /// a breaking change. Applications should write their code in anticipation of:
12541    ///
12542    /// - New values appearing in future releases of the client library, **and**
12543    /// - New values received dynamically, without application changes.
12544    ///
12545    /// Please consult the [Working with enums] section in the user guide for some
12546    /// guidelines.
12547    ///
12548    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
12549    #[derive(Clone, Debug, PartialEq)]
12550    #[non_exhaustive]
12551    pub enum Intent {
12552        /// Unspecified intent.
12553        Unspecified,
12554        /// Create deployment in the unit from the deployment spec.
12555        CreateDeployment,
12556        /// Update deployment in the unit.
12557        UpdateDeployment,
12558        /// Delete deployment in the unit.
12559        DeleteDeployment,
12560        /// Recreate deployment in the unit.
12561        RecreateDeployment,
12562        /// Delete deployment in latest successful revision while no longer
12563        /// referenced in any deployment unit in the current deployment group.
12564        CleanUp,
12565        /// Expected to be unchanged.
12566        Unchanged,
12567        /// If set, the enum was initialized with an unknown value.
12568        ///
12569        /// Applications can examine the value using [Intent::value] or
12570        /// [Intent::name].
12571        UnknownValue(intent::UnknownValue),
12572    }
12573
12574    #[doc(hidden)]
12575    pub mod intent {
12576        #[allow(unused_imports)]
12577        use super::*;
12578        #[derive(Clone, Debug, PartialEq)]
12579        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12580    }
12581
12582    impl Intent {
12583        /// Gets the enum value.
12584        ///
12585        /// Returns `None` if the enum contains an unknown value deserialized from
12586        /// the string representation of enums.
12587        pub fn value(&self) -> std::option::Option<i32> {
12588            match self {
12589                Self::Unspecified => std::option::Option::Some(0),
12590                Self::CreateDeployment => std::option::Option::Some(1),
12591                Self::UpdateDeployment => std::option::Option::Some(2),
12592                Self::DeleteDeployment => std::option::Option::Some(3),
12593                Self::RecreateDeployment => std::option::Option::Some(4),
12594                Self::CleanUp => std::option::Option::Some(5),
12595                Self::Unchanged => std::option::Option::Some(6),
12596                Self::UnknownValue(u) => u.0.value(),
12597            }
12598        }
12599
12600        /// Gets the enum value as a string.
12601        ///
12602        /// Returns `None` if the enum contains an unknown value deserialized from
12603        /// the integer representation of enums.
12604        pub fn name(&self) -> std::option::Option<&str> {
12605            match self {
12606                Self::Unspecified => std::option::Option::Some("INTENT_UNSPECIFIED"),
12607                Self::CreateDeployment => std::option::Option::Some("CREATE_DEPLOYMENT"),
12608                Self::UpdateDeployment => std::option::Option::Some("UPDATE_DEPLOYMENT"),
12609                Self::DeleteDeployment => std::option::Option::Some("DELETE_DEPLOYMENT"),
12610                Self::RecreateDeployment => std::option::Option::Some("RECREATE_DEPLOYMENT"),
12611                Self::CleanUp => std::option::Option::Some("CLEAN_UP"),
12612                Self::Unchanged => std::option::Option::Some("UNCHANGED"),
12613                Self::UnknownValue(u) => u.0.name(),
12614            }
12615        }
12616    }
12617
12618    impl std::default::Default for Intent {
12619        fn default() -> Self {
12620            use std::convert::From;
12621            Self::from(0)
12622        }
12623    }
12624
12625    impl std::fmt::Display for Intent {
12626        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12627            wkt::internal::display_enum(f, self.name(), self.value())
12628        }
12629    }
12630
12631    impl std::convert::From<i32> for Intent {
12632        fn from(value: i32) -> Self {
12633            match value {
12634                0 => Self::Unspecified,
12635                1 => Self::CreateDeployment,
12636                2 => Self::UpdateDeployment,
12637                3 => Self::DeleteDeployment,
12638                4 => Self::RecreateDeployment,
12639                5 => Self::CleanUp,
12640                6 => Self::Unchanged,
12641                _ => Self::UnknownValue(intent::UnknownValue(
12642                    wkt::internal::UnknownEnumValue::Integer(value),
12643                )),
12644            }
12645        }
12646    }
12647
12648    impl std::convert::From<&str> for Intent {
12649        fn from(value: &str) -> Self {
12650            use std::string::ToString;
12651            match value {
12652                "INTENT_UNSPECIFIED" => Self::Unspecified,
12653                "CREATE_DEPLOYMENT" => Self::CreateDeployment,
12654                "UPDATE_DEPLOYMENT" => Self::UpdateDeployment,
12655                "DELETE_DEPLOYMENT" => Self::DeleteDeployment,
12656                "RECREATE_DEPLOYMENT" => Self::RecreateDeployment,
12657                "CLEAN_UP" => Self::CleanUp,
12658                "UNCHANGED" => Self::Unchanged,
12659                _ => Self::UnknownValue(intent::UnknownValue(
12660                    wkt::internal::UnknownEnumValue::String(value.to_string()),
12661                )),
12662            }
12663        }
12664    }
12665
12666    impl serde::ser::Serialize for Intent {
12667        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12668        where
12669            S: serde::Serializer,
12670        {
12671            match self {
12672                Self::Unspecified => serializer.serialize_i32(0),
12673                Self::CreateDeployment => serializer.serialize_i32(1),
12674                Self::UpdateDeployment => serializer.serialize_i32(2),
12675                Self::DeleteDeployment => serializer.serialize_i32(3),
12676                Self::RecreateDeployment => serializer.serialize_i32(4),
12677                Self::CleanUp => serializer.serialize_i32(5),
12678                Self::Unchanged => serializer.serialize_i32(6),
12679                Self::UnknownValue(u) => u.0.serialize(serializer),
12680            }
12681        }
12682    }
12683
12684    impl<'de> serde::de::Deserialize<'de> for Intent {
12685        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12686        where
12687            D: serde::Deserializer<'de>,
12688        {
12689            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Intent>::new(
12690                ".google.cloud.config.v1.DeploymentUnitProgress.Intent",
12691            ))
12692        }
12693    }
12694}
12695
12696/// Operation metadata for `ProvisionDeploymentGroup` and
12697/// `DeprovisionDeploymentGroup` long-running operations.
12698#[derive(Clone, Default, PartialEq)]
12699#[non_exhaustive]
12700pub struct ProvisionDeploymentGroupOperationMetadata {
12701    /// Output only. The current step of the deployment group operation.
12702    pub step:
12703        crate::model::provision_deployment_group_operation_metadata::ProvisionDeploymentGroupStep,
12704
12705    /// Output only. Progress information for each deployment unit within the
12706    /// operation.
12707    pub deployment_unit_progresses: std::vec::Vec<crate::model::DeploymentUnitProgress>,
12708
12709    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12710}
12711
12712impl ProvisionDeploymentGroupOperationMetadata {
12713    /// Creates a new default instance.
12714    pub fn new() -> Self {
12715        std::default::Default::default()
12716    }
12717
12718    /// Sets the value of [step][crate::model::ProvisionDeploymentGroupOperationMetadata::step].
12719    ///
12720    /// # Example
12721    /// ```ignore,no_run
12722    /// # use google_cloud_config_v1::model::ProvisionDeploymentGroupOperationMetadata;
12723    /// use google_cloud_config_v1::model::provision_deployment_group_operation_metadata::ProvisionDeploymentGroupStep;
12724    /// let x0 = ProvisionDeploymentGroupOperationMetadata::new().set_step(ProvisionDeploymentGroupStep::ValidatingDeploymentGroup);
12725    /// let x1 = ProvisionDeploymentGroupOperationMetadata::new().set_step(ProvisionDeploymentGroupStep::AssociatingDeploymentsToDeploymentGroup);
12726    /// let x2 = ProvisionDeploymentGroupOperationMetadata::new().set_step(ProvisionDeploymentGroupStep::ProvisioningDeploymentUnits);
12727    /// ```
12728    pub fn set_step<T: std::convert::Into<crate::model::provision_deployment_group_operation_metadata::ProvisionDeploymentGroupStep>>(mut self, v: T) -> Self{
12729        self.step = v.into();
12730        self
12731    }
12732
12733    /// Sets the value of [deployment_unit_progresses][crate::model::ProvisionDeploymentGroupOperationMetadata::deployment_unit_progresses].
12734    ///
12735    /// # Example
12736    /// ```ignore,no_run
12737    /// # use google_cloud_config_v1::model::ProvisionDeploymentGroupOperationMetadata;
12738    /// use google_cloud_config_v1::model::DeploymentUnitProgress;
12739    /// let x = ProvisionDeploymentGroupOperationMetadata::new()
12740    ///     .set_deployment_unit_progresses([
12741    ///         DeploymentUnitProgress::default()/* use setters */,
12742    ///         DeploymentUnitProgress::default()/* use (different) setters */,
12743    ///     ]);
12744    /// ```
12745    pub fn set_deployment_unit_progresses<T, V>(mut self, v: T) -> Self
12746    where
12747        T: std::iter::IntoIterator<Item = V>,
12748        V: std::convert::Into<crate::model::DeploymentUnitProgress>,
12749    {
12750        use std::iter::Iterator;
12751        self.deployment_unit_progresses = v.into_iter().map(|i| i.into()).collect();
12752        self
12753    }
12754}
12755
12756impl wkt::message::Message for ProvisionDeploymentGroupOperationMetadata {
12757    fn typename() -> &'static str {
12758        "type.googleapis.com/google.cloud.config.v1.ProvisionDeploymentGroupOperationMetadata"
12759    }
12760}
12761
12762/// Defines additional types related to [ProvisionDeploymentGroupOperationMetadata].
12763pub mod provision_deployment_group_operation_metadata {
12764    #[allow(unused_imports)]
12765    use super::*;
12766
12767    /// Possible steps during a deployment group provisioning or deprovisioning
12768    /// operation.
12769    ///
12770    /// # Working with unknown values
12771    ///
12772    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12773    /// additional enum variants at any time. Adding new variants is not considered
12774    /// a breaking change. Applications should write their code in anticipation of:
12775    ///
12776    /// - New values appearing in future releases of the client library, **and**
12777    /// - New values received dynamically, without application changes.
12778    ///
12779    /// Please consult the [Working with enums] section in the user guide for some
12780    /// guidelines.
12781    ///
12782    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
12783    #[derive(Clone, Debug, PartialEq)]
12784    #[non_exhaustive]
12785    pub enum ProvisionDeploymentGroupStep {
12786        /// Unspecified step.
12787        Unspecified,
12788        /// Validating the deployment group.
12789        ValidatingDeploymentGroup,
12790        /// Locking the deployments to the deployment group for atomic actuation.
12791        AssociatingDeploymentsToDeploymentGroup,
12792        /// Provisioning the deployment units.
12793        ProvisioningDeploymentUnits,
12794        /// Unlocking the deployments from the deployment group after actuation.
12795        DisassociatingDeploymentsFromDeploymentGroup,
12796        /// The operation has succeeded.
12797        Succeeded,
12798        /// The operation has failed.
12799        Failed,
12800        /// Deprovisioning the deployment units.
12801        DeprovisioningDeploymentUnits,
12802        /// If set, the enum was initialized with an unknown value.
12803        ///
12804        /// Applications can examine the value using [ProvisionDeploymentGroupStep::value] or
12805        /// [ProvisionDeploymentGroupStep::name].
12806        UnknownValue(provision_deployment_group_step::UnknownValue),
12807    }
12808
12809    #[doc(hidden)]
12810    pub mod provision_deployment_group_step {
12811        #[allow(unused_imports)]
12812        use super::*;
12813        #[derive(Clone, Debug, PartialEq)]
12814        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12815    }
12816
12817    impl ProvisionDeploymentGroupStep {
12818        /// Gets the enum value.
12819        ///
12820        /// Returns `None` if the enum contains an unknown value deserialized from
12821        /// the string representation of enums.
12822        pub fn value(&self) -> std::option::Option<i32> {
12823            match self {
12824                Self::Unspecified => std::option::Option::Some(0),
12825                Self::ValidatingDeploymentGroup => std::option::Option::Some(1),
12826                Self::AssociatingDeploymentsToDeploymentGroup => std::option::Option::Some(2),
12827                Self::ProvisioningDeploymentUnits => std::option::Option::Some(3),
12828                Self::DisassociatingDeploymentsFromDeploymentGroup => std::option::Option::Some(4),
12829                Self::Succeeded => std::option::Option::Some(5),
12830                Self::Failed => std::option::Option::Some(6),
12831                Self::DeprovisioningDeploymentUnits => std::option::Option::Some(7),
12832                Self::UnknownValue(u) => u.0.value(),
12833            }
12834        }
12835
12836        /// Gets the enum value as a string.
12837        ///
12838        /// Returns `None` if the enum contains an unknown value deserialized from
12839        /// the integer representation of enums.
12840        pub fn name(&self) -> std::option::Option<&str> {
12841            match self {
12842                Self::Unspecified => {
12843                    std::option::Option::Some("PROVISION_DEPLOYMENT_GROUP_STEP_UNSPECIFIED")
12844                }
12845                Self::ValidatingDeploymentGroup => {
12846                    std::option::Option::Some("VALIDATING_DEPLOYMENT_GROUP")
12847                }
12848                Self::AssociatingDeploymentsToDeploymentGroup => {
12849                    std::option::Option::Some("ASSOCIATING_DEPLOYMENTS_TO_DEPLOYMENT_GROUP")
12850                }
12851                Self::ProvisioningDeploymentUnits => {
12852                    std::option::Option::Some("PROVISIONING_DEPLOYMENT_UNITS")
12853                }
12854                Self::DisassociatingDeploymentsFromDeploymentGroup => {
12855                    std::option::Option::Some("DISASSOCIATING_DEPLOYMENTS_FROM_DEPLOYMENT_GROUP")
12856                }
12857                Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
12858                Self::Failed => std::option::Option::Some("FAILED"),
12859                Self::DeprovisioningDeploymentUnits => {
12860                    std::option::Option::Some("DEPROVISIONING_DEPLOYMENT_UNITS")
12861                }
12862                Self::UnknownValue(u) => u.0.name(),
12863            }
12864        }
12865    }
12866
12867    impl std::default::Default for ProvisionDeploymentGroupStep {
12868        fn default() -> Self {
12869            use std::convert::From;
12870            Self::from(0)
12871        }
12872    }
12873
12874    impl std::fmt::Display for ProvisionDeploymentGroupStep {
12875        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12876            wkt::internal::display_enum(f, self.name(), self.value())
12877        }
12878    }
12879
12880    impl std::convert::From<i32> for ProvisionDeploymentGroupStep {
12881        fn from(value: i32) -> Self {
12882            match value {
12883                0 => Self::Unspecified,
12884                1 => Self::ValidatingDeploymentGroup,
12885                2 => Self::AssociatingDeploymentsToDeploymentGroup,
12886                3 => Self::ProvisioningDeploymentUnits,
12887                4 => Self::DisassociatingDeploymentsFromDeploymentGroup,
12888                5 => Self::Succeeded,
12889                6 => Self::Failed,
12890                7 => Self::DeprovisioningDeploymentUnits,
12891                _ => Self::UnknownValue(provision_deployment_group_step::UnknownValue(
12892                    wkt::internal::UnknownEnumValue::Integer(value),
12893                )),
12894            }
12895        }
12896    }
12897
12898    impl std::convert::From<&str> for ProvisionDeploymentGroupStep {
12899        fn from(value: &str) -> Self {
12900            use std::string::ToString;
12901            match value {
12902                "PROVISION_DEPLOYMENT_GROUP_STEP_UNSPECIFIED" => Self::Unspecified,
12903                "VALIDATING_DEPLOYMENT_GROUP" => Self::ValidatingDeploymentGroup,
12904                "ASSOCIATING_DEPLOYMENTS_TO_DEPLOYMENT_GROUP" => {
12905                    Self::AssociatingDeploymentsToDeploymentGroup
12906                }
12907                "PROVISIONING_DEPLOYMENT_UNITS" => Self::ProvisioningDeploymentUnits,
12908                "DISASSOCIATING_DEPLOYMENTS_FROM_DEPLOYMENT_GROUP" => {
12909                    Self::DisassociatingDeploymentsFromDeploymentGroup
12910                }
12911                "SUCCEEDED" => Self::Succeeded,
12912                "FAILED" => Self::Failed,
12913                "DEPROVISIONING_DEPLOYMENT_UNITS" => Self::DeprovisioningDeploymentUnits,
12914                _ => Self::UnknownValue(provision_deployment_group_step::UnknownValue(
12915                    wkt::internal::UnknownEnumValue::String(value.to_string()),
12916                )),
12917            }
12918        }
12919    }
12920
12921    impl serde::ser::Serialize for ProvisionDeploymentGroupStep {
12922        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12923        where
12924            S: serde::Serializer,
12925        {
12926            match self {
12927                Self::Unspecified => serializer.serialize_i32(0),
12928                Self::ValidatingDeploymentGroup => serializer.serialize_i32(1),
12929                Self::AssociatingDeploymentsToDeploymentGroup => serializer.serialize_i32(2),
12930                Self::ProvisioningDeploymentUnits => serializer.serialize_i32(3),
12931                Self::DisassociatingDeploymentsFromDeploymentGroup => serializer.serialize_i32(4),
12932                Self::Succeeded => serializer.serialize_i32(5),
12933                Self::Failed => serializer.serialize_i32(6),
12934                Self::DeprovisioningDeploymentUnits => serializer.serialize_i32(7),
12935                Self::UnknownValue(u) => u.0.serialize(serializer),
12936            }
12937        }
12938    }
12939
12940    impl<'de> serde::de::Deserialize<'de> for ProvisionDeploymentGroupStep {
12941        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12942        where
12943            D: serde::Deserializer<'de>,
12944        {
12945            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ProvisionDeploymentGroupStep>::new(
12946                ".google.cloud.config.v1.ProvisionDeploymentGroupOperationMetadata.ProvisionDeploymentGroupStep"))
12947        }
12948    }
12949}
12950
12951/// A DeploymentGroupRevision represents a snapshot of a
12952/// [DeploymentGroup][google.cloud.config.v1.DeploymentGroup] at a given point in
12953/// time, created when a DeploymentGroup is provisioned or deprovisioned.
12954///
12955/// [google.cloud.config.v1.DeploymentGroup]: crate::model::DeploymentGroup
12956#[derive(Clone, Default, PartialEq)]
12957#[non_exhaustive]
12958pub struct DeploymentGroupRevision {
12959    /// Identifier. The name of the deployment group revision.
12960    /// Format:
12961    /// 'projects/{project_id}/locations/{location}/deploymentGroups/{deployment_group}/revisions/{revision}'.
12962    pub name: std::string::String,
12963
12964    /// Output only. The snapshot of the deployment group at this revision.
12965    pub snapshot: std::option::Option<crate::model::DeploymentGroup>,
12966
12967    /// Output only. Time when the deployment group revision was created.
12968    pub create_time: std::option::Option<wkt::Timestamp>,
12969
12970    /// Output only. The alternative IDs of the deployment group revision.
12971    pub alternative_ids: std::vec::Vec<std::string::String>,
12972
12973    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12974}
12975
12976impl DeploymentGroupRevision {
12977    /// Creates a new default instance.
12978    pub fn new() -> Self {
12979        std::default::Default::default()
12980    }
12981
12982    /// Sets the value of [name][crate::model::DeploymentGroupRevision::name].
12983    ///
12984    /// # Example
12985    /// ```ignore,no_run
12986    /// # use google_cloud_config_v1::model::DeploymentGroupRevision;
12987    /// let x = DeploymentGroupRevision::new().set_name("example");
12988    /// ```
12989    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12990        self.name = v.into();
12991        self
12992    }
12993
12994    /// Sets the value of [snapshot][crate::model::DeploymentGroupRevision::snapshot].
12995    ///
12996    /// # Example
12997    /// ```ignore,no_run
12998    /// # use google_cloud_config_v1::model::DeploymentGroupRevision;
12999    /// use google_cloud_config_v1::model::DeploymentGroup;
13000    /// let x = DeploymentGroupRevision::new().set_snapshot(DeploymentGroup::default()/* use setters */);
13001    /// ```
13002    pub fn set_snapshot<T>(mut self, v: T) -> Self
13003    where
13004        T: std::convert::Into<crate::model::DeploymentGroup>,
13005    {
13006        self.snapshot = std::option::Option::Some(v.into());
13007        self
13008    }
13009
13010    /// Sets or clears the value of [snapshot][crate::model::DeploymentGroupRevision::snapshot].
13011    ///
13012    /// # Example
13013    /// ```ignore,no_run
13014    /// # use google_cloud_config_v1::model::DeploymentGroupRevision;
13015    /// use google_cloud_config_v1::model::DeploymentGroup;
13016    /// let x = DeploymentGroupRevision::new().set_or_clear_snapshot(Some(DeploymentGroup::default()/* use setters */));
13017    /// let x = DeploymentGroupRevision::new().set_or_clear_snapshot(None::<DeploymentGroup>);
13018    /// ```
13019    pub fn set_or_clear_snapshot<T>(mut self, v: std::option::Option<T>) -> Self
13020    where
13021        T: std::convert::Into<crate::model::DeploymentGroup>,
13022    {
13023        self.snapshot = v.map(|x| x.into());
13024        self
13025    }
13026
13027    /// Sets the value of [create_time][crate::model::DeploymentGroupRevision::create_time].
13028    ///
13029    /// # Example
13030    /// ```ignore,no_run
13031    /// # use google_cloud_config_v1::model::DeploymentGroupRevision;
13032    /// use wkt::Timestamp;
13033    /// let x = DeploymentGroupRevision::new().set_create_time(Timestamp::default()/* use setters */);
13034    /// ```
13035    pub fn set_create_time<T>(mut self, v: T) -> Self
13036    where
13037        T: std::convert::Into<wkt::Timestamp>,
13038    {
13039        self.create_time = std::option::Option::Some(v.into());
13040        self
13041    }
13042
13043    /// Sets or clears the value of [create_time][crate::model::DeploymentGroupRevision::create_time].
13044    ///
13045    /// # Example
13046    /// ```ignore,no_run
13047    /// # use google_cloud_config_v1::model::DeploymentGroupRevision;
13048    /// use wkt::Timestamp;
13049    /// let x = DeploymentGroupRevision::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
13050    /// let x = DeploymentGroupRevision::new().set_or_clear_create_time(None::<Timestamp>);
13051    /// ```
13052    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
13053    where
13054        T: std::convert::Into<wkt::Timestamp>,
13055    {
13056        self.create_time = v.map(|x| x.into());
13057        self
13058    }
13059
13060    /// Sets the value of [alternative_ids][crate::model::DeploymentGroupRevision::alternative_ids].
13061    ///
13062    /// # Example
13063    /// ```ignore,no_run
13064    /// # use google_cloud_config_v1::model::DeploymentGroupRevision;
13065    /// let x = DeploymentGroupRevision::new().set_alternative_ids(["a", "b", "c"]);
13066    /// ```
13067    pub fn set_alternative_ids<T, V>(mut self, v: T) -> Self
13068    where
13069        T: std::iter::IntoIterator<Item = V>,
13070        V: std::convert::Into<std::string::String>,
13071    {
13072        use std::iter::Iterator;
13073        self.alternative_ids = v.into_iter().map(|i| i.into()).collect();
13074        self
13075    }
13076}
13077
13078impl wkt::message::Message for DeploymentGroupRevision {
13079    fn typename() -> &'static str {
13080        "type.googleapis.com/google.cloud.config.v1.DeploymentGroupRevision"
13081    }
13082}
13083
13084/// The request message for the GetDeploymentGroupRevision method.
13085#[derive(Clone, Default, PartialEq)]
13086#[non_exhaustive]
13087pub struct GetDeploymentGroupRevisionRequest {
13088    /// Required. The name of the deployment group revision to retrieve.
13089    /// Format:
13090    /// 'projects/{project_id}/locations/{location}/deploymentGroups/{deployment_group}/revisions/{revision}'.
13091    pub name: std::string::String,
13092
13093    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13094}
13095
13096impl GetDeploymentGroupRevisionRequest {
13097    /// Creates a new default instance.
13098    pub fn new() -> Self {
13099        std::default::Default::default()
13100    }
13101
13102    /// Sets the value of [name][crate::model::GetDeploymentGroupRevisionRequest::name].
13103    ///
13104    /// # Example
13105    /// ```ignore,no_run
13106    /// # use google_cloud_config_v1::model::GetDeploymentGroupRevisionRequest;
13107    /// let x = GetDeploymentGroupRevisionRequest::new().set_name("example");
13108    /// ```
13109    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13110        self.name = v.into();
13111        self
13112    }
13113}
13114
13115impl wkt::message::Message for GetDeploymentGroupRevisionRequest {
13116    fn typename() -> &'static str {
13117        "type.googleapis.com/google.cloud.config.v1.GetDeploymentGroupRevisionRequest"
13118    }
13119}
13120
13121/// The request message for the ListDeploymentGroupRevisions method.
13122#[derive(Clone, Default, PartialEq)]
13123#[non_exhaustive]
13124pub struct ListDeploymentGroupRevisionsRequest {
13125    /// Required. The parent, which owns this collection of deployment group
13126    /// revisions. Format:
13127    /// 'projects/{project_id}/locations/{location}/deploymentGroups/{deployment_group}'.
13128    pub parent: std::string::String,
13129
13130    /// Optional. When requesting a page of resources, 'page_size' specifies number
13131    /// of resources to return. If unspecified, a sensible default will be used by
13132    /// the server. The maximum value is 1000; values above 1000 will be coerced to
13133    /// 1000.
13134    pub page_size: i32,
13135
13136    /// Optional. Token returned by previous call to 'ListDeploymentGroupRevisions'
13137    /// which specifies the position in the list from where to continue listing the
13138    /// deployment group revisions. All other parameters provided to
13139    /// `ListDeploymentGroupRevisions` must match the call that provided the page
13140    /// token.
13141    pub page_token: std::string::String,
13142
13143    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13144}
13145
13146impl ListDeploymentGroupRevisionsRequest {
13147    /// Creates a new default instance.
13148    pub fn new() -> Self {
13149        std::default::Default::default()
13150    }
13151
13152    /// Sets the value of [parent][crate::model::ListDeploymentGroupRevisionsRequest::parent].
13153    ///
13154    /// # Example
13155    /// ```ignore,no_run
13156    /// # use google_cloud_config_v1::model::ListDeploymentGroupRevisionsRequest;
13157    /// let x = ListDeploymentGroupRevisionsRequest::new().set_parent("example");
13158    /// ```
13159    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13160        self.parent = v.into();
13161        self
13162    }
13163
13164    /// Sets the value of [page_size][crate::model::ListDeploymentGroupRevisionsRequest::page_size].
13165    ///
13166    /// # Example
13167    /// ```ignore,no_run
13168    /// # use google_cloud_config_v1::model::ListDeploymentGroupRevisionsRequest;
13169    /// let x = ListDeploymentGroupRevisionsRequest::new().set_page_size(42);
13170    /// ```
13171    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
13172        self.page_size = v.into();
13173        self
13174    }
13175
13176    /// Sets the value of [page_token][crate::model::ListDeploymentGroupRevisionsRequest::page_token].
13177    ///
13178    /// # Example
13179    /// ```ignore,no_run
13180    /// # use google_cloud_config_v1::model::ListDeploymentGroupRevisionsRequest;
13181    /// let x = ListDeploymentGroupRevisionsRequest::new().set_page_token("example");
13182    /// ```
13183    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13184        self.page_token = v.into();
13185        self
13186    }
13187}
13188
13189impl wkt::message::Message for ListDeploymentGroupRevisionsRequest {
13190    fn typename() -> &'static str {
13191        "type.googleapis.com/google.cloud.config.v1.ListDeploymentGroupRevisionsRequest"
13192    }
13193}
13194
13195/// The response message for the ListDeploymentGroupRevisions method.
13196#[derive(Clone, Default, PartialEq)]
13197#[non_exhaustive]
13198pub struct ListDeploymentGroupRevisionsResponse {
13199    /// The deployment group revisions from the specified collection.
13200    pub deployment_group_revisions: std::vec::Vec<crate::model::DeploymentGroupRevision>,
13201
13202    /// Token to be supplied to the next ListDeploymentGroupRevisions request via
13203    /// `page_token` to obtain the next set of results.
13204    pub next_page_token: std::string::String,
13205
13206    /// Unordered list. Locations that could not be reached.
13207    pub unreachable: std::vec::Vec<std::string::String>,
13208
13209    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13210}
13211
13212impl ListDeploymentGroupRevisionsResponse {
13213    /// Creates a new default instance.
13214    pub fn new() -> Self {
13215        std::default::Default::default()
13216    }
13217
13218    /// Sets the value of [deployment_group_revisions][crate::model::ListDeploymentGroupRevisionsResponse::deployment_group_revisions].
13219    ///
13220    /// # Example
13221    /// ```ignore,no_run
13222    /// # use google_cloud_config_v1::model::ListDeploymentGroupRevisionsResponse;
13223    /// use google_cloud_config_v1::model::DeploymentGroupRevision;
13224    /// let x = ListDeploymentGroupRevisionsResponse::new()
13225    ///     .set_deployment_group_revisions([
13226    ///         DeploymentGroupRevision::default()/* use setters */,
13227    ///         DeploymentGroupRevision::default()/* use (different) setters */,
13228    ///     ]);
13229    /// ```
13230    pub fn set_deployment_group_revisions<T, V>(mut self, v: T) -> Self
13231    where
13232        T: std::iter::IntoIterator<Item = V>,
13233        V: std::convert::Into<crate::model::DeploymentGroupRevision>,
13234    {
13235        use std::iter::Iterator;
13236        self.deployment_group_revisions = v.into_iter().map(|i| i.into()).collect();
13237        self
13238    }
13239
13240    /// Sets the value of [next_page_token][crate::model::ListDeploymentGroupRevisionsResponse::next_page_token].
13241    ///
13242    /// # Example
13243    /// ```ignore,no_run
13244    /// # use google_cloud_config_v1::model::ListDeploymentGroupRevisionsResponse;
13245    /// let x = ListDeploymentGroupRevisionsResponse::new().set_next_page_token("example");
13246    /// ```
13247    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13248        self.next_page_token = v.into();
13249        self
13250    }
13251
13252    /// Sets the value of [unreachable][crate::model::ListDeploymentGroupRevisionsResponse::unreachable].
13253    ///
13254    /// # Example
13255    /// ```ignore,no_run
13256    /// # use google_cloud_config_v1::model::ListDeploymentGroupRevisionsResponse;
13257    /// let x = ListDeploymentGroupRevisionsResponse::new().set_unreachable(["a", "b", "c"]);
13258    /// ```
13259    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
13260    where
13261        T: std::iter::IntoIterator<Item = V>,
13262        V: std::convert::Into<std::string::String>,
13263    {
13264        use std::iter::Iterator;
13265        self.unreachable = v.into_iter().map(|i| i.into()).collect();
13266        self
13267    }
13268}
13269
13270impl wkt::message::Message for ListDeploymentGroupRevisionsResponse {
13271    fn typename() -> &'static str {
13272        "type.googleapis.com/google.cloud.config.v1.ListDeploymentGroupRevisionsResponse"
13273    }
13274}
13275
13276#[doc(hidden)]
13277impl google_cloud_gax::paginator::internal::PageableResponse
13278    for ListDeploymentGroupRevisionsResponse
13279{
13280    type PageItem = crate::model::DeploymentGroupRevision;
13281
13282    fn items(self) -> std::vec::Vec<Self::PageItem> {
13283        self.deployment_group_revisions
13284    }
13285
13286    fn next_page_token(&self) -> std::string::String {
13287        use std::clone::Clone;
13288        self.next_page_token.clone()
13289    }
13290}
13291
13292/// Enum values to control quota checks for resources in terraform
13293/// configuration files.
13294///
13295/// # Working with unknown values
13296///
13297/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13298/// additional enum variants at any time. Adding new variants is not considered
13299/// a breaking change. Applications should write their code in anticipation of:
13300///
13301/// - New values appearing in future releases of the client library, **and**
13302/// - New values received dynamically, without application changes.
13303///
13304/// Please consult the [Working with enums] section in the user guide for some
13305/// guidelines.
13306///
13307/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
13308#[derive(Clone, Debug, PartialEq)]
13309#[non_exhaustive]
13310pub enum QuotaValidation {
13311    /// The default value.
13312    /// QuotaValidation on terraform configuration files will be disabled in
13313    /// this case.
13314    Unspecified,
13315    /// Enable computing quotas for resources in terraform configuration files to
13316    /// get visibility on resources with insufficient quotas.
13317    Enabled,
13318    /// Enforce quota checks so deployment fails if there isn't sufficient quotas
13319    /// available to deploy resources in terraform configuration files.
13320    Enforced,
13321    /// If set, the enum was initialized with an unknown value.
13322    ///
13323    /// Applications can examine the value using [QuotaValidation::value] or
13324    /// [QuotaValidation::name].
13325    UnknownValue(quota_validation::UnknownValue),
13326}
13327
13328#[doc(hidden)]
13329pub mod quota_validation {
13330    #[allow(unused_imports)]
13331    use super::*;
13332    #[derive(Clone, Debug, PartialEq)]
13333    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13334}
13335
13336impl QuotaValidation {
13337    /// Gets the enum value.
13338    ///
13339    /// Returns `None` if the enum contains an unknown value deserialized from
13340    /// the string representation of enums.
13341    pub fn value(&self) -> std::option::Option<i32> {
13342        match self {
13343            Self::Unspecified => std::option::Option::Some(0),
13344            Self::Enabled => std::option::Option::Some(1),
13345            Self::Enforced => std::option::Option::Some(2),
13346            Self::UnknownValue(u) => u.0.value(),
13347        }
13348    }
13349
13350    /// Gets the enum value as a string.
13351    ///
13352    /// Returns `None` if the enum contains an unknown value deserialized from
13353    /// the integer representation of enums.
13354    pub fn name(&self) -> std::option::Option<&str> {
13355        match self {
13356            Self::Unspecified => std::option::Option::Some("QUOTA_VALIDATION_UNSPECIFIED"),
13357            Self::Enabled => std::option::Option::Some("ENABLED"),
13358            Self::Enforced => std::option::Option::Some("ENFORCED"),
13359            Self::UnknownValue(u) => u.0.name(),
13360        }
13361    }
13362}
13363
13364impl std::default::Default for QuotaValidation {
13365    fn default() -> Self {
13366        use std::convert::From;
13367        Self::from(0)
13368    }
13369}
13370
13371impl std::fmt::Display for QuotaValidation {
13372    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13373        wkt::internal::display_enum(f, self.name(), self.value())
13374    }
13375}
13376
13377impl std::convert::From<i32> for QuotaValidation {
13378    fn from(value: i32) -> Self {
13379        match value {
13380            0 => Self::Unspecified,
13381            1 => Self::Enabled,
13382            2 => Self::Enforced,
13383            _ => Self::UnknownValue(quota_validation::UnknownValue(
13384                wkt::internal::UnknownEnumValue::Integer(value),
13385            )),
13386        }
13387    }
13388}
13389
13390impl std::convert::From<&str> for QuotaValidation {
13391    fn from(value: &str) -> Self {
13392        use std::string::ToString;
13393        match value {
13394            "QUOTA_VALIDATION_UNSPECIFIED" => Self::Unspecified,
13395            "ENABLED" => Self::Enabled,
13396            "ENFORCED" => Self::Enforced,
13397            _ => Self::UnknownValue(quota_validation::UnknownValue(
13398                wkt::internal::UnknownEnumValue::String(value.to_string()),
13399            )),
13400        }
13401    }
13402}
13403
13404impl serde::ser::Serialize for QuotaValidation {
13405    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13406    where
13407        S: serde::Serializer,
13408    {
13409        match self {
13410            Self::Unspecified => serializer.serialize_i32(0),
13411            Self::Enabled => serializer.serialize_i32(1),
13412            Self::Enforced => serializer.serialize_i32(2),
13413            Self::UnknownValue(u) => u.0.serialize(serializer),
13414        }
13415    }
13416}
13417
13418impl<'de> serde::de::Deserialize<'de> for QuotaValidation {
13419    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13420    where
13421        D: serde::Deserializer<'de>,
13422    {
13423        deserializer.deserialize_any(wkt::internal::EnumVisitor::<QuotaValidation>::new(
13424            ".google.cloud.config.v1.QuotaValidation",
13425        ))
13426    }
13427}