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 project_id = "project_id";
168    /// # let location_id = "location_id";
169    /// # let deployment_id = "deployment_id";
170    /// let x = Deployment::new().set_name(format!("projects/{project_id}/locations/{location_id}/deployments/{deployment_id}"));
171    /// ```
172    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
173        self.name = v.into();
174        self
175    }
176
177    /// Sets the value of [create_time][crate::model::Deployment::create_time].
178    ///
179    /// # Example
180    /// ```ignore,no_run
181    /// # use google_cloud_config_v1::model::Deployment;
182    /// use wkt::Timestamp;
183    /// let x = Deployment::new().set_create_time(Timestamp::default()/* use setters */);
184    /// ```
185    pub fn set_create_time<T>(mut self, v: T) -> Self
186    where
187        T: std::convert::Into<wkt::Timestamp>,
188    {
189        self.create_time = std::option::Option::Some(v.into());
190        self
191    }
192
193    /// Sets or clears the value of [create_time][crate::model::Deployment::create_time].
194    ///
195    /// # Example
196    /// ```ignore,no_run
197    /// # use google_cloud_config_v1::model::Deployment;
198    /// use wkt::Timestamp;
199    /// let x = Deployment::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
200    /// let x = Deployment::new().set_or_clear_create_time(None::<Timestamp>);
201    /// ```
202    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
203    where
204        T: std::convert::Into<wkt::Timestamp>,
205    {
206        self.create_time = v.map(|x| x.into());
207        self
208    }
209
210    /// Sets the value of [update_time][crate::model::Deployment::update_time].
211    ///
212    /// # Example
213    /// ```ignore,no_run
214    /// # use google_cloud_config_v1::model::Deployment;
215    /// use wkt::Timestamp;
216    /// let x = Deployment::new().set_update_time(Timestamp::default()/* use setters */);
217    /// ```
218    pub fn set_update_time<T>(mut self, v: T) -> Self
219    where
220        T: std::convert::Into<wkt::Timestamp>,
221    {
222        self.update_time = std::option::Option::Some(v.into());
223        self
224    }
225
226    /// Sets or clears the value of [update_time][crate::model::Deployment::update_time].
227    ///
228    /// # Example
229    /// ```ignore,no_run
230    /// # use google_cloud_config_v1::model::Deployment;
231    /// use wkt::Timestamp;
232    /// let x = Deployment::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
233    /// let x = Deployment::new().set_or_clear_update_time(None::<Timestamp>);
234    /// ```
235    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
236    where
237        T: std::convert::Into<wkt::Timestamp>,
238    {
239        self.update_time = v.map(|x| x.into());
240        self
241    }
242
243    /// Sets the value of [labels][crate::model::Deployment::labels].
244    ///
245    /// # Example
246    /// ```ignore,no_run
247    /// # use google_cloud_config_v1::model::Deployment;
248    /// let x = Deployment::new().set_labels([
249    ///     ("key0", "abc"),
250    ///     ("key1", "xyz"),
251    /// ]);
252    /// ```
253    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
254    where
255        T: std::iter::IntoIterator<Item = (K, V)>,
256        K: std::convert::Into<std::string::String>,
257        V: std::convert::Into<std::string::String>,
258    {
259        use std::iter::Iterator;
260        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
261        self
262    }
263
264    /// Sets the value of [state][crate::model::Deployment::state].
265    ///
266    /// # Example
267    /// ```ignore,no_run
268    /// # use google_cloud_config_v1::model::Deployment;
269    /// use google_cloud_config_v1::model::deployment::State;
270    /// let x0 = Deployment::new().set_state(State::Creating);
271    /// let x1 = Deployment::new().set_state(State::Active);
272    /// let x2 = Deployment::new().set_state(State::Updating);
273    /// ```
274    pub fn set_state<T: std::convert::Into<crate::model::deployment::State>>(
275        mut self,
276        v: T,
277    ) -> Self {
278        self.state = v.into();
279        self
280    }
281
282    /// Sets the value of [latest_revision][crate::model::Deployment::latest_revision].
283    ///
284    /// # Example
285    /// ```ignore,no_run
286    /// # use google_cloud_config_v1::model::Deployment;
287    /// let x = Deployment::new().set_latest_revision("example");
288    /// ```
289    pub fn set_latest_revision<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
290        self.latest_revision = v.into();
291        self
292    }
293
294    /// Sets the value of [state_detail][crate::model::Deployment::state_detail].
295    ///
296    /// # Example
297    /// ```ignore,no_run
298    /// # use google_cloud_config_v1::model::Deployment;
299    /// let x = Deployment::new().set_state_detail("example");
300    /// ```
301    pub fn set_state_detail<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
302        self.state_detail = v.into();
303        self
304    }
305
306    /// Sets the value of [error_code][crate::model::Deployment::error_code].
307    ///
308    /// # Example
309    /// ```ignore,no_run
310    /// # use google_cloud_config_v1::model::Deployment;
311    /// use google_cloud_config_v1::model::deployment::ErrorCode;
312    /// let x0 = Deployment::new().set_error_code(ErrorCode::RevisionFailed);
313    /// let x1 = Deployment::new().set_error_code(ErrorCode::CloudBuildPermissionDenied);
314    /// let x2 = Deployment::new().set_error_code(ErrorCode::DeleteBuildApiFailed);
315    /// ```
316    pub fn set_error_code<T: std::convert::Into<crate::model::deployment::ErrorCode>>(
317        mut self,
318        v: T,
319    ) -> Self {
320        self.error_code = v.into();
321        self
322    }
323
324    /// Sets the value of [delete_results][crate::model::Deployment::delete_results].
325    ///
326    /// # Example
327    /// ```ignore,no_run
328    /// # use google_cloud_config_v1::model::Deployment;
329    /// use google_cloud_config_v1::model::ApplyResults;
330    /// let x = Deployment::new().set_delete_results(ApplyResults::default()/* use setters */);
331    /// ```
332    pub fn set_delete_results<T>(mut self, v: T) -> Self
333    where
334        T: std::convert::Into<crate::model::ApplyResults>,
335    {
336        self.delete_results = std::option::Option::Some(v.into());
337        self
338    }
339
340    /// Sets or clears the value of [delete_results][crate::model::Deployment::delete_results].
341    ///
342    /// # Example
343    /// ```ignore,no_run
344    /// # use google_cloud_config_v1::model::Deployment;
345    /// use google_cloud_config_v1::model::ApplyResults;
346    /// let x = Deployment::new().set_or_clear_delete_results(Some(ApplyResults::default()/* use setters */));
347    /// let x = Deployment::new().set_or_clear_delete_results(None::<ApplyResults>);
348    /// ```
349    pub fn set_or_clear_delete_results<T>(mut self, v: std::option::Option<T>) -> Self
350    where
351        T: std::convert::Into<crate::model::ApplyResults>,
352    {
353        self.delete_results = v.map(|x| x.into());
354        self
355    }
356
357    /// Sets the value of [delete_build][crate::model::Deployment::delete_build].
358    ///
359    /// # Example
360    /// ```ignore,no_run
361    /// # use google_cloud_config_v1::model::Deployment;
362    /// let x = Deployment::new().set_delete_build("example");
363    /// ```
364    pub fn set_delete_build<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
365        self.delete_build = v.into();
366        self
367    }
368
369    /// Sets the value of [delete_logs][crate::model::Deployment::delete_logs].
370    ///
371    /// # Example
372    /// ```ignore,no_run
373    /// # use google_cloud_config_v1::model::Deployment;
374    /// let x = Deployment::new().set_delete_logs("example");
375    /// ```
376    pub fn set_delete_logs<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
377        self.delete_logs = v.into();
378        self
379    }
380
381    /// Sets the value of [tf_errors][crate::model::Deployment::tf_errors].
382    ///
383    /// # Example
384    /// ```ignore,no_run
385    /// # use google_cloud_config_v1::model::Deployment;
386    /// use google_cloud_config_v1::model::TerraformError;
387    /// let x = Deployment::new()
388    ///     .set_tf_errors([
389    ///         TerraformError::default()/* use setters */,
390    ///         TerraformError::default()/* use (different) setters */,
391    ///     ]);
392    /// ```
393    pub fn set_tf_errors<T, V>(mut self, v: T) -> Self
394    where
395        T: std::iter::IntoIterator<Item = V>,
396        V: std::convert::Into<crate::model::TerraformError>,
397    {
398        use std::iter::Iterator;
399        self.tf_errors = v.into_iter().map(|i| i.into()).collect();
400        self
401    }
402
403    /// Sets the value of [error_logs][crate::model::Deployment::error_logs].
404    ///
405    /// # Example
406    /// ```ignore,no_run
407    /// # use google_cloud_config_v1::model::Deployment;
408    /// let x = Deployment::new().set_error_logs("example");
409    /// ```
410    pub fn set_error_logs<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
411        self.error_logs = v.into();
412        self
413    }
414
415    /// Sets the value of [artifacts_gcs_bucket][crate::model::Deployment::artifacts_gcs_bucket].
416    ///
417    /// # Example
418    /// ```ignore,no_run
419    /// # use google_cloud_config_v1::model::Deployment;
420    /// let x = Deployment::new().set_artifacts_gcs_bucket("example");
421    /// ```
422    pub fn set_artifacts_gcs_bucket<T>(mut self, v: T) -> Self
423    where
424        T: std::convert::Into<std::string::String>,
425    {
426        self.artifacts_gcs_bucket = std::option::Option::Some(v.into());
427        self
428    }
429
430    /// Sets or clears the value of [artifacts_gcs_bucket][crate::model::Deployment::artifacts_gcs_bucket].
431    ///
432    /// # Example
433    /// ```ignore,no_run
434    /// # use google_cloud_config_v1::model::Deployment;
435    /// let x = Deployment::new().set_or_clear_artifacts_gcs_bucket(Some("example"));
436    /// let x = Deployment::new().set_or_clear_artifacts_gcs_bucket(None::<String>);
437    /// ```
438    pub fn set_or_clear_artifacts_gcs_bucket<T>(mut self, v: std::option::Option<T>) -> Self
439    where
440        T: std::convert::Into<std::string::String>,
441    {
442        self.artifacts_gcs_bucket = v.map(|x| x.into());
443        self
444    }
445
446    /// Sets the value of [service_account][crate::model::Deployment::service_account].
447    ///
448    /// # Example
449    /// ```ignore,no_run
450    /// # use google_cloud_config_v1::model::Deployment;
451    /// let x = Deployment::new().set_service_account("example");
452    /// ```
453    pub fn set_service_account<T>(mut self, v: T) -> Self
454    where
455        T: std::convert::Into<std::string::String>,
456    {
457        self.service_account = std::option::Option::Some(v.into());
458        self
459    }
460
461    /// Sets or clears the value of [service_account][crate::model::Deployment::service_account].
462    ///
463    /// # Example
464    /// ```ignore,no_run
465    /// # use google_cloud_config_v1::model::Deployment;
466    /// let x = Deployment::new().set_or_clear_service_account(Some("example"));
467    /// let x = Deployment::new().set_or_clear_service_account(None::<String>);
468    /// ```
469    pub fn set_or_clear_service_account<T>(mut self, v: std::option::Option<T>) -> Self
470    where
471        T: std::convert::Into<std::string::String>,
472    {
473        self.service_account = v.map(|x| x.into());
474        self
475    }
476
477    /// Sets the value of [import_existing_resources][crate::model::Deployment::import_existing_resources].
478    ///
479    /// # Example
480    /// ```ignore,no_run
481    /// # use google_cloud_config_v1::model::Deployment;
482    /// let x = Deployment::new().set_import_existing_resources(true);
483    /// ```
484    pub fn set_import_existing_resources<T>(mut self, v: T) -> Self
485    where
486        T: std::convert::Into<bool>,
487    {
488        self.import_existing_resources = std::option::Option::Some(v.into());
489        self
490    }
491
492    /// Sets or clears the value of [import_existing_resources][crate::model::Deployment::import_existing_resources].
493    ///
494    /// # Example
495    /// ```ignore,no_run
496    /// # use google_cloud_config_v1::model::Deployment;
497    /// let x = Deployment::new().set_or_clear_import_existing_resources(Some(false));
498    /// let x = Deployment::new().set_or_clear_import_existing_resources(None::<bool>);
499    /// ```
500    pub fn set_or_clear_import_existing_resources<T>(mut self, v: std::option::Option<T>) -> Self
501    where
502        T: std::convert::Into<bool>,
503    {
504        self.import_existing_resources = v.map(|x| x.into());
505        self
506    }
507
508    /// Sets the value of [worker_pool][crate::model::Deployment::worker_pool].
509    ///
510    /// # Example
511    /// ```ignore,no_run
512    /// # use google_cloud_config_v1::model::Deployment;
513    /// let x = Deployment::new().set_worker_pool("example");
514    /// ```
515    pub fn set_worker_pool<T>(mut self, v: T) -> Self
516    where
517        T: std::convert::Into<std::string::String>,
518    {
519        self.worker_pool = std::option::Option::Some(v.into());
520        self
521    }
522
523    /// Sets or clears the value of [worker_pool][crate::model::Deployment::worker_pool].
524    ///
525    /// # Example
526    /// ```ignore,no_run
527    /// # use google_cloud_config_v1::model::Deployment;
528    /// let x = Deployment::new().set_or_clear_worker_pool(Some("example"));
529    /// let x = Deployment::new().set_or_clear_worker_pool(None::<String>);
530    /// ```
531    pub fn set_or_clear_worker_pool<T>(mut self, v: std::option::Option<T>) -> Self
532    where
533        T: std::convert::Into<std::string::String>,
534    {
535        self.worker_pool = v.map(|x| x.into());
536        self
537    }
538
539    /// Sets the value of [lock_state][crate::model::Deployment::lock_state].
540    ///
541    /// # Example
542    /// ```ignore,no_run
543    /// # use google_cloud_config_v1::model::Deployment;
544    /// use google_cloud_config_v1::model::deployment::LockState;
545    /// let x0 = Deployment::new().set_lock_state(LockState::Locked);
546    /// let x1 = Deployment::new().set_lock_state(LockState::Unlocked);
547    /// let x2 = Deployment::new().set_lock_state(LockState::Locking);
548    /// ```
549    pub fn set_lock_state<T: std::convert::Into<crate::model::deployment::LockState>>(
550        mut self,
551        v: T,
552    ) -> Self {
553        self.lock_state = v.into();
554        self
555    }
556
557    /// Sets the value of [tf_version_constraint][crate::model::Deployment::tf_version_constraint].
558    ///
559    /// # Example
560    /// ```ignore,no_run
561    /// # use google_cloud_config_v1::model::Deployment;
562    /// let x = Deployment::new().set_tf_version_constraint("example");
563    /// ```
564    pub fn set_tf_version_constraint<T>(mut self, v: T) -> Self
565    where
566        T: std::convert::Into<std::string::String>,
567    {
568        self.tf_version_constraint = std::option::Option::Some(v.into());
569        self
570    }
571
572    /// Sets or clears the value of [tf_version_constraint][crate::model::Deployment::tf_version_constraint].
573    ///
574    /// # Example
575    /// ```ignore,no_run
576    /// # use google_cloud_config_v1::model::Deployment;
577    /// let x = Deployment::new().set_or_clear_tf_version_constraint(Some("example"));
578    /// let x = Deployment::new().set_or_clear_tf_version_constraint(None::<String>);
579    /// ```
580    pub fn set_or_clear_tf_version_constraint<T>(mut self, v: std::option::Option<T>) -> Self
581    where
582        T: std::convert::Into<std::string::String>,
583    {
584        self.tf_version_constraint = v.map(|x| x.into());
585        self
586    }
587
588    /// Sets the value of [tf_version][crate::model::Deployment::tf_version].
589    ///
590    /// # Example
591    /// ```ignore,no_run
592    /// # use google_cloud_config_v1::model::Deployment;
593    /// let x = Deployment::new().set_tf_version("example");
594    /// ```
595    pub fn set_tf_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
596        self.tf_version = v.into();
597        self
598    }
599
600    /// Sets the value of [quota_validation][crate::model::Deployment::quota_validation].
601    ///
602    /// # Example
603    /// ```ignore,no_run
604    /// # use google_cloud_config_v1::model::Deployment;
605    /// use google_cloud_config_v1::model::QuotaValidation;
606    /// let x0 = Deployment::new().set_quota_validation(QuotaValidation::Enabled);
607    /// let x1 = Deployment::new().set_quota_validation(QuotaValidation::Enforced);
608    /// ```
609    pub fn set_quota_validation<T: std::convert::Into<crate::model::QuotaValidation>>(
610        mut self,
611        v: T,
612    ) -> Self {
613        self.quota_validation = v.into();
614        self
615    }
616
617    /// Sets the value of [annotations][crate::model::Deployment::annotations].
618    ///
619    /// # Example
620    /// ```ignore,no_run
621    /// # use google_cloud_config_v1::model::Deployment;
622    /// let x = Deployment::new().set_annotations([
623    ///     ("key0", "abc"),
624    ///     ("key1", "xyz"),
625    /// ]);
626    /// ```
627    pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
628    where
629        T: std::iter::IntoIterator<Item = (K, V)>,
630        K: std::convert::Into<std::string::String>,
631        V: std::convert::Into<std::string::String>,
632    {
633        use std::iter::Iterator;
634        self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
635        self
636    }
637
638    /// Sets the value of [provider_config][crate::model::Deployment::provider_config].
639    ///
640    /// # Example
641    /// ```ignore,no_run
642    /// # use google_cloud_config_v1::model::Deployment;
643    /// use google_cloud_config_v1::model::ProviderConfig;
644    /// let x = Deployment::new().set_provider_config(ProviderConfig::default()/* use setters */);
645    /// ```
646    pub fn set_provider_config<T>(mut self, v: T) -> Self
647    where
648        T: std::convert::Into<crate::model::ProviderConfig>,
649    {
650        self.provider_config = std::option::Option::Some(v.into());
651        self
652    }
653
654    /// Sets or clears the value of [provider_config][crate::model::Deployment::provider_config].
655    ///
656    /// # Example
657    /// ```ignore,no_run
658    /// # use google_cloud_config_v1::model::Deployment;
659    /// use google_cloud_config_v1::model::ProviderConfig;
660    /// let x = Deployment::new().set_or_clear_provider_config(Some(ProviderConfig::default()/* use setters */));
661    /// let x = Deployment::new().set_or_clear_provider_config(None::<ProviderConfig>);
662    /// ```
663    pub fn set_or_clear_provider_config<T>(mut self, v: std::option::Option<T>) -> Self
664    where
665        T: std::convert::Into<crate::model::ProviderConfig>,
666    {
667        self.provider_config = v.map(|x| x.into());
668        self
669    }
670
671    /// Sets the value of [blueprint][crate::model::Deployment::blueprint].
672    ///
673    /// Note that all the setters affecting `blueprint` are mutually
674    /// exclusive.
675    ///
676    /// # Example
677    /// ```ignore,no_run
678    /// # use google_cloud_config_v1::model::Deployment;
679    /// use google_cloud_config_v1::model::TerraformBlueprint;
680    /// let x = Deployment::new().set_blueprint(Some(
681    ///     google_cloud_config_v1::model::deployment::Blueprint::TerraformBlueprint(TerraformBlueprint::default().into())));
682    /// ```
683    pub fn set_blueprint<
684        T: std::convert::Into<std::option::Option<crate::model::deployment::Blueprint>>,
685    >(
686        mut self,
687        v: T,
688    ) -> Self {
689        self.blueprint = v.into();
690        self
691    }
692
693    /// The value of [blueprint][crate::model::Deployment::blueprint]
694    /// if it holds a `TerraformBlueprint`, `None` if the field is not set or
695    /// holds a different branch.
696    pub fn terraform_blueprint(
697        &self,
698    ) -> std::option::Option<&std::boxed::Box<crate::model::TerraformBlueprint>> {
699        #[allow(unreachable_patterns)]
700        self.blueprint.as_ref().and_then(|v| match v {
701            crate::model::deployment::Blueprint::TerraformBlueprint(v) => {
702                std::option::Option::Some(v)
703            }
704            _ => std::option::Option::None,
705        })
706    }
707
708    /// Sets the value of [blueprint][crate::model::Deployment::blueprint]
709    /// to hold a `TerraformBlueprint`.
710    ///
711    /// Note that all the setters affecting `blueprint` are
712    /// mutually exclusive.
713    ///
714    /// # Example
715    /// ```ignore,no_run
716    /// # use google_cloud_config_v1::model::Deployment;
717    /// use google_cloud_config_v1::model::TerraformBlueprint;
718    /// let x = Deployment::new().set_terraform_blueprint(TerraformBlueprint::default()/* use setters */);
719    /// assert!(x.terraform_blueprint().is_some());
720    /// ```
721    pub fn set_terraform_blueprint<
722        T: std::convert::Into<std::boxed::Box<crate::model::TerraformBlueprint>>,
723    >(
724        mut self,
725        v: T,
726    ) -> Self {
727        self.blueprint = std::option::Option::Some(
728            crate::model::deployment::Blueprint::TerraformBlueprint(v.into()),
729        );
730        self
731    }
732}
733
734impl wkt::message::Message for Deployment {
735    fn typename() -> &'static str {
736        "type.googleapis.com/google.cloud.config.v1.Deployment"
737    }
738}
739
740/// Defines additional types related to [Deployment].
741pub mod deployment {
742    #[allow(unused_imports)]
743    use super::*;
744
745    /// Possible states of a deployment.
746    ///
747    /// # Working with unknown values
748    ///
749    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
750    /// additional enum variants at any time. Adding new variants is not considered
751    /// a breaking change. Applications should write their code in anticipation of:
752    ///
753    /// - New values appearing in future releases of the client library, **and**
754    /// - New values received dynamically, without application changes.
755    ///
756    /// Please consult the [Working with enums] section in the user guide for some
757    /// guidelines.
758    ///
759    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
760    #[derive(Clone, Debug, PartialEq)]
761    #[non_exhaustive]
762    pub enum State {
763        /// The default value. This value is used if the state is omitted.
764        Unspecified,
765        /// The deployment is being created.
766        Creating,
767        /// The deployment is healthy.
768        Active,
769        /// The deployment is being updated.
770        Updating,
771        /// The deployment is being deleted.
772        Deleting,
773        /// The deployment has encountered an unexpected error.
774        Failed,
775        /// The deployment is no longer being actively reconciled.
776        /// This may be the result of recovering the project after deletion.
777        Suspended,
778        /// The deployment has been deleted.
779        Deleted,
780        /// If set, the enum was initialized with an unknown value.
781        ///
782        /// Applications can examine the value using [State::value] or
783        /// [State::name].
784        UnknownValue(state::UnknownValue),
785    }
786
787    #[doc(hidden)]
788    pub mod state {
789        #[allow(unused_imports)]
790        use super::*;
791        #[derive(Clone, Debug, PartialEq)]
792        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
793    }
794
795    impl State {
796        /// Gets the enum value.
797        ///
798        /// Returns `None` if the enum contains an unknown value deserialized from
799        /// the string representation of enums.
800        pub fn value(&self) -> std::option::Option<i32> {
801            match self {
802                Self::Unspecified => std::option::Option::Some(0),
803                Self::Creating => std::option::Option::Some(1),
804                Self::Active => std::option::Option::Some(2),
805                Self::Updating => std::option::Option::Some(3),
806                Self::Deleting => std::option::Option::Some(4),
807                Self::Failed => std::option::Option::Some(5),
808                Self::Suspended => std::option::Option::Some(6),
809                Self::Deleted => std::option::Option::Some(7),
810                Self::UnknownValue(u) => u.0.value(),
811            }
812        }
813
814        /// Gets the enum value as a string.
815        ///
816        /// Returns `None` if the enum contains an unknown value deserialized from
817        /// the integer representation of enums.
818        pub fn name(&self) -> std::option::Option<&str> {
819            match self {
820                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
821                Self::Creating => std::option::Option::Some("CREATING"),
822                Self::Active => std::option::Option::Some("ACTIVE"),
823                Self::Updating => std::option::Option::Some("UPDATING"),
824                Self::Deleting => std::option::Option::Some("DELETING"),
825                Self::Failed => std::option::Option::Some("FAILED"),
826                Self::Suspended => std::option::Option::Some("SUSPENDED"),
827                Self::Deleted => std::option::Option::Some("DELETED"),
828                Self::UnknownValue(u) => u.0.name(),
829            }
830        }
831    }
832
833    impl std::default::Default for State {
834        fn default() -> Self {
835            use std::convert::From;
836            Self::from(0)
837        }
838    }
839
840    impl std::fmt::Display for State {
841        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
842            wkt::internal::display_enum(f, self.name(), self.value())
843        }
844    }
845
846    impl std::convert::From<i32> for State {
847        fn from(value: i32) -> Self {
848            match value {
849                0 => Self::Unspecified,
850                1 => Self::Creating,
851                2 => Self::Active,
852                3 => Self::Updating,
853                4 => Self::Deleting,
854                5 => Self::Failed,
855                6 => Self::Suspended,
856                7 => Self::Deleted,
857                _ => Self::UnknownValue(state::UnknownValue(
858                    wkt::internal::UnknownEnumValue::Integer(value),
859                )),
860            }
861        }
862    }
863
864    impl std::convert::From<&str> for State {
865        fn from(value: &str) -> Self {
866            use std::string::ToString;
867            match value {
868                "STATE_UNSPECIFIED" => Self::Unspecified,
869                "CREATING" => Self::Creating,
870                "ACTIVE" => Self::Active,
871                "UPDATING" => Self::Updating,
872                "DELETING" => Self::Deleting,
873                "FAILED" => Self::Failed,
874                "SUSPENDED" => Self::Suspended,
875                "DELETED" => Self::Deleted,
876                _ => Self::UnknownValue(state::UnknownValue(
877                    wkt::internal::UnknownEnumValue::String(value.to_string()),
878                )),
879            }
880        }
881    }
882
883    impl serde::ser::Serialize for State {
884        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
885        where
886            S: serde::Serializer,
887        {
888            match self {
889                Self::Unspecified => serializer.serialize_i32(0),
890                Self::Creating => serializer.serialize_i32(1),
891                Self::Active => serializer.serialize_i32(2),
892                Self::Updating => serializer.serialize_i32(3),
893                Self::Deleting => serializer.serialize_i32(4),
894                Self::Failed => serializer.serialize_i32(5),
895                Self::Suspended => serializer.serialize_i32(6),
896                Self::Deleted => serializer.serialize_i32(7),
897                Self::UnknownValue(u) => u.0.serialize(serializer),
898            }
899        }
900    }
901
902    impl<'de> serde::de::Deserialize<'de> for State {
903        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
904        where
905            D: serde::Deserializer<'de>,
906        {
907            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
908                ".google.cloud.config.v1.Deployment.State",
909            ))
910        }
911    }
912
913    /// Possible errors that can occur with deployments.
914    ///
915    /// # Working with unknown values
916    ///
917    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
918    /// additional enum variants at any time. Adding new variants is not considered
919    /// a breaking change. Applications should write their code in anticipation of:
920    ///
921    /// - New values appearing in future releases of the client library, **and**
922    /// - New values received dynamically, without application changes.
923    ///
924    /// Please consult the [Working with enums] section in the user guide for some
925    /// guidelines.
926    ///
927    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
928    #[derive(Clone, Debug, PartialEq)]
929    #[non_exhaustive]
930    pub enum ErrorCode {
931        /// No error code was specified.
932        Unspecified,
933        /// The revision failed. See Revision for more details.
934        RevisionFailed,
935        /// Cloud Build failed due to a permission issue.
936        CloudBuildPermissionDenied,
937        /// Cloud Build job associated with a deployment deletion could not be
938        /// started.
939        DeleteBuildApiFailed,
940        /// Cloud Build job associated with a deployment deletion was started but
941        /// failed.
942        DeleteBuildRunFailed,
943        /// Cloud Storage bucket creation failed due to a permission issue.
944        BucketCreationPermissionDenied,
945        /// Cloud Storage bucket creation failed due to an issue unrelated to
946        /// permissions.
947        BucketCreationFailed,
948        /// Failed to import values from an external source.
949        ExternalValueSourceImportFailed,
950        /// If set, the enum was initialized with an unknown value.
951        ///
952        /// Applications can examine the value using [ErrorCode::value] or
953        /// [ErrorCode::name].
954        UnknownValue(error_code::UnknownValue),
955    }
956
957    #[doc(hidden)]
958    pub mod error_code {
959        #[allow(unused_imports)]
960        use super::*;
961        #[derive(Clone, Debug, PartialEq)]
962        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
963    }
964
965    impl ErrorCode {
966        /// Gets the enum value.
967        ///
968        /// Returns `None` if the enum contains an unknown value deserialized from
969        /// the string representation of enums.
970        pub fn value(&self) -> std::option::Option<i32> {
971            match self {
972                Self::Unspecified => std::option::Option::Some(0),
973                Self::RevisionFailed => std::option::Option::Some(1),
974                Self::CloudBuildPermissionDenied => std::option::Option::Some(3),
975                Self::DeleteBuildApiFailed => std::option::Option::Some(5),
976                Self::DeleteBuildRunFailed => std::option::Option::Some(6),
977                Self::BucketCreationPermissionDenied => std::option::Option::Some(7),
978                Self::BucketCreationFailed => std::option::Option::Some(8),
979                Self::ExternalValueSourceImportFailed => std::option::Option::Some(10),
980                Self::UnknownValue(u) => u.0.value(),
981            }
982        }
983
984        /// Gets the enum value as a string.
985        ///
986        /// Returns `None` if the enum contains an unknown value deserialized from
987        /// the integer representation of enums.
988        pub fn name(&self) -> std::option::Option<&str> {
989            match self {
990                Self::Unspecified => std::option::Option::Some("ERROR_CODE_UNSPECIFIED"),
991                Self::RevisionFailed => std::option::Option::Some("REVISION_FAILED"),
992                Self::CloudBuildPermissionDenied => {
993                    std::option::Option::Some("CLOUD_BUILD_PERMISSION_DENIED")
994                }
995                Self::DeleteBuildApiFailed => std::option::Option::Some("DELETE_BUILD_API_FAILED"),
996                Self::DeleteBuildRunFailed => std::option::Option::Some("DELETE_BUILD_RUN_FAILED"),
997                Self::BucketCreationPermissionDenied => {
998                    std::option::Option::Some("BUCKET_CREATION_PERMISSION_DENIED")
999                }
1000                Self::BucketCreationFailed => std::option::Option::Some("BUCKET_CREATION_FAILED"),
1001                Self::ExternalValueSourceImportFailed => {
1002                    std::option::Option::Some("EXTERNAL_VALUE_SOURCE_IMPORT_FAILED")
1003                }
1004                Self::UnknownValue(u) => u.0.name(),
1005            }
1006        }
1007    }
1008
1009    impl std::default::Default for ErrorCode {
1010        fn default() -> Self {
1011            use std::convert::From;
1012            Self::from(0)
1013        }
1014    }
1015
1016    impl std::fmt::Display for ErrorCode {
1017        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1018            wkt::internal::display_enum(f, self.name(), self.value())
1019        }
1020    }
1021
1022    impl std::convert::From<i32> for ErrorCode {
1023        fn from(value: i32) -> Self {
1024            match value {
1025                0 => Self::Unspecified,
1026                1 => Self::RevisionFailed,
1027                3 => Self::CloudBuildPermissionDenied,
1028                5 => Self::DeleteBuildApiFailed,
1029                6 => Self::DeleteBuildRunFailed,
1030                7 => Self::BucketCreationPermissionDenied,
1031                8 => Self::BucketCreationFailed,
1032                10 => Self::ExternalValueSourceImportFailed,
1033                _ => Self::UnknownValue(error_code::UnknownValue(
1034                    wkt::internal::UnknownEnumValue::Integer(value),
1035                )),
1036            }
1037        }
1038    }
1039
1040    impl std::convert::From<&str> for ErrorCode {
1041        fn from(value: &str) -> Self {
1042            use std::string::ToString;
1043            match value {
1044                "ERROR_CODE_UNSPECIFIED" => Self::Unspecified,
1045                "REVISION_FAILED" => Self::RevisionFailed,
1046                "CLOUD_BUILD_PERMISSION_DENIED" => Self::CloudBuildPermissionDenied,
1047                "DELETE_BUILD_API_FAILED" => Self::DeleteBuildApiFailed,
1048                "DELETE_BUILD_RUN_FAILED" => Self::DeleteBuildRunFailed,
1049                "BUCKET_CREATION_PERMISSION_DENIED" => Self::BucketCreationPermissionDenied,
1050                "BUCKET_CREATION_FAILED" => Self::BucketCreationFailed,
1051                "EXTERNAL_VALUE_SOURCE_IMPORT_FAILED" => Self::ExternalValueSourceImportFailed,
1052                _ => Self::UnknownValue(error_code::UnknownValue(
1053                    wkt::internal::UnknownEnumValue::String(value.to_string()),
1054                )),
1055            }
1056        }
1057    }
1058
1059    impl serde::ser::Serialize for ErrorCode {
1060        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1061        where
1062            S: serde::Serializer,
1063        {
1064            match self {
1065                Self::Unspecified => serializer.serialize_i32(0),
1066                Self::RevisionFailed => serializer.serialize_i32(1),
1067                Self::CloudBuildPermissionDenied => serializer.serialize_i32(3),
1068                Self::DeleteBuildApiFailed => serializer.serialize_i32(5),
1069                Self::DeleteBuildRunFailed => serializer.serialize_i32(6),
1070                Self::BucketCreationPermissionDenied => serializer.serialize_i32(7),
1071                Self::BucketCreationFailed => serializer.serialize_i32(8),
1072                Self::ExternalValueSourceImportFailed => serializer.serialize_i32(10),
1073                Self::UnknownValue(u) => u.0.serialize(serializer),
1074            }
1075        }
1076    }
1077
1078    impl<'de> serde::de::Deserialize<'de> for ErrorCode {
1079        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1080        where
1081            D: serde::Deserializer<'de>,
1082        {
1083            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ErrorCode>::new(
1084                ".google.cloud.config.v1.Deployment.ErrorCode",
1085            ))
1086        }
1087    }
1088
1089    /// Possible lock states of a deployment.
1090    ///
1091    /// # Working with unknown values
1092    ///
1093    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1094    /// additional enum variants at any time. Adding new variants is not considered
1095    /// a breaking change. Applications should write their code in anticipation of:
1096    ///
1097    /// - New values appearing in future releases of the client library, **and**
1098    /// - New values received dynamically, without application changes.
1099    ///
1100    /// Please consult the [Working with enums] section in the user guide for some
1101    /// guidelines.
1102    ///
1103    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
1104    #[derive(Clone, Debug, PartialEq)]
1105    #[non_exhaustive]
1106    pub enum LockState {
1107        /// The default value. This value is used if the lock state is omitted.
1108        Unspecified,
1109        /// The deployment is locked.
1110        Locked,
1111        /// The deployment is unlocked.
1112        Unlocked,
1113        /// The deployment is being locked.
1114        Locking,
1115        /// The deployment is being unlocked.
1116        Unlocking,
1117        /// The deployment has failed to lock.
1118        LockFailed,
1119        /// The deployment has failed to unlock.
1120        UnlockFailed,
1121        /// If set, the enum was initialized with an unknown value.
1122        ///
1123        /// Applications can examine the value using [LockState::value] or
1124        /// [LockState::name].
1125        UnknownValue(lock_state::UnknownValue),
1126    }
1127
1128    #[doc(hidden)]
1129    pub mod lock_state {
1130        #[allow(unused_imports)]
1131        use super::*;
1132        #[derive(Clone, Debug, PartialEq)]
1133        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1134    }
1135
1136    impl LockState {
1137        /// Gets the enum value.
1138        ///
1139        /// Returns `None` if the enum contains an unknown value deserialized from
1140        /// the string representation of enums.
1141        pub fn value(&self) -> std::option::Option<i32> {
1142            match self {
1143                Self::Unspecified => std::option::Option::Some(0),
1144                Self::Locked => std::option::Option::Some(1),
1145                Self::Unlocked => std::option::Option::Some(2),
1146                Self::Locking => std::option::Option::Some(3),
1147                Self::Unlocking => std::option::Option::Some(4),
1148                Self::LockFailed => std::option::Option::Some(5),
1149                Self::UnlockFailed => std::option::Option::Some(6),
1150                Self::UnknownValue(u) => u.0.value(),
1151            }
1152        }
1153
1154        /// Gets the enum value as a string.
1155        ///
1156        /// Returns `None` if the enum contains an unknown value deserialized from
1157        /// the integer representation of enums.
1158        pub fn name(&self) -> std::option::Option<&str> {
1159            match self {
1160                Self::Unspecified => std::option::Option::Some("LOCK_STATE_UNSPECIFIED"),
1161                Self::Locked => std::option::Option::Some("LOCKED"),
1162                Self::Unlocked => std::option::Option::Some("UNLOCKED"),
1163                Self::Locking => std::option::Option::Some("LOCKING"),
1164                Self::Unlocking => std::option::Option::Some("UNLOCKING"),
1165                Self::LockFailed => std::option::Option::Some("LOCK_FAILED"),
1166                Self::UnlockFailed => std::option::Option::Some("UNLOCK_FAILED"),
1167                Self::UnknownValue(u) => u.0.name(),
1168            }
1169        }
1170    }
1171
1172    impl std::default::Default for LockState {
1173        fn default() -> Self {
1174            use std::convert::From;
1175            Self::from(0)
1176        }
1177    }
1178
1179    impl std::fmt::Display for LockState {
1180        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1181            wkt::internal::display_enum(f, self.name(), self.value())
1182        }
1183    }
1184
1185    impl std::convert::From<i32> for LockState {
1186        fn from(value: i32) -> Self {
1187            match value {
1188                0 => Self::Unspecified,
1189                1 => Self::Locked,
1190                2 => Self::Unlocked,
1191                3 => Self::Locking,
1192                4 => Self::Unlocking,
1193                5 => Self::LockFailed,
1194                6 => Self::UnlockFailed,
1195                _ => Self::UnknownValue(lock_state::UnknownValue(
1196                    wkt::internal::UnknownEnumValue::Integer(value),
1197                )),
1198            }
1199        }
1200    }
1201
1202    impl std::convert::From<&str> for LockState {
1203        fn from(value: &str) -> Self {
1204            use std::string::ToString;
1205            match value {
1206                "LOCK_STATE_UNSPECIFIED" => Self::Unspecified,
1207                "LOCKED" => Self::Locked,
1208                "UNLOCKED" => Self::Unlocked,
1209                "LOCKING" => Self::Locking,
1210                "UNLOCKING" => Self::Unlocking,
1211                "LOCK_FAILED" => Self::LockFailed,
1212                "UNLOCK_FAILED" => Self::UnlockFailed,
1213                _ => Self::UnknownValue(lock_state::UnknownValue(
1214                    wkt::internal::UnknownEnumValue::String(value.to_string()),
1215                )),
1216            }
1217        }
1218    }
1219
1220    impl serde::ser::Serialize for LockState {
1221        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1222        where
1223            S: serde::Serializer,
1224        {
1225            match self {
1226                Self::Unspecified => serializer.serialize_i32(0),
1227                Self::Locked => serializer.serialize_i32(1),
1228                Self::Unlocked => serializer.serialize_i32(2),
1229                Self::Locking => serializer.serialize_i32(3),
1230                Self::Unlocking => serializer.serialize_i32(4),
1231                Self::LockFailed => serializer.serialize_i32(5),
1232                Self::UnlockFailed => serializer.serialize_i32(6),
1233                Self::UnknownValue(u) => u.0.serialize(serializer),
1234            }
1235        }
1236    }
1237
1238    impl<'de> serde::de::Deserialize<'de> for LockState {
1239        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1240        where
1241            D: serde::Deserializer<'de>,
1242        {
1243            deserializer.deserialize_any(wkt::internal::EnumVisitor::<LockState>::new(
1244                ".google.cloud.config.v1.Deployment.LockState",
1245            ))
1246        }
1247    }
1248
1249    /// Blueprint to deploy.
1250    #[derive(Clone, Debug, PartialEq)]
1251    #[non_exhaustive]
1252    pub enum Blueprint {
1253        /// A blueprint described using Terraform's HashiCorp Configuration Language
1254        /// as a root module.
1255        TerraformBlueprint(std::boxed::Box<crate::model::TerraformBlueprint>),
1256    }
1257}
1258
1259/// TerraformBlueprint describes the source of a Terraform root module which
1260/// describes the resources and configs to be deployed.
1261#[derive(Clone, Default, PartialEq)]
1262#[non_exhaustive]
1263pub struct TerraformBlueprint {
1264    /// Optional. Input variable values for the Terraform blueprint.
1265    pub input_values:
1266        std::collections::HashMap<std::string::String, crate::model::TerraformVariable>,
1267
1268    /// Optional. Map of input variable names in this blueprint to configurations
1269    /// for importing values from external sources.
1270    pub external_values:
1271        std::collections::HashMap<std::string::String, crate::model::ExternalValueSource>,
1272
1273    /// Location of the source configs.
1274    /// Required.
1275    pub source: std::option::Option<crate::model::terraform_blueprint::Source>,
1276
1277    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1278}
1279
1280impl TerraformBlueprint {
1281    /// Creates a new default instance.
1282    pub fn new() -> Self {
1283        std::default::Default::default()
1284    }
1285
1286    /// Sets the value of [input_values][crate::model::TerraformBlueprint::input_values].
1287    ///
1288    /// # Example
1289    /// ```ignore,no_run
1290    /// # use google_cloud_config_v1::model::TerraformBlueprint;
1291    /// use google_cloud_config_v1::model::TerraformVariable;
1292    /// let x = TerraformBlueprint::new().set_input_values([
1293    ///     ("key0", TerraformVariable::default()/* use setters */),
1294    ///     ("key1", TerraformVariable::default()/* use (different) setters */),
1295    /// ]);
1296    /// ```
1297    pub fn set_input_values<T, K, V>(mut self, v: T) -> Self
1298    where
1299        T: std::iter::IntoIterator<Item = (K, V)>,
1300        K: std::convert::Into<std::string::String>,
1301        V: std::convert::Into<crate::model::TerraformVariable>,
1302    {
1303        use std::iter::Iterator;
1304        self.input_values = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1305        self
1306    }
1307
1308    /// Sets the value of [external_values][crate::model::TerraformBlueprint::external_values].
1309    ///
1310    /// # Example
1311    /// ```ignore,no_run
1312    /// # use google_cloud_config_v1::model::TerraformBlueprint;
1313    /// use google_cloud_config_v1::model::ExternalValueSource;
1314    /// let x = TerraformBlueprint::new().set_external_values([
1315    ///     ("key0", ExternalValueSource::default()/* use setters */),
1316    ///     ("key1", ExternalValueSource::default()/* use (different) setters */),
1317    /// ]);
1318    /// ```
1319    pub fn set_external_values<T, K, V>(mut self, v: T) -> Self
1320    where
1321        T: std::iter::IntoIterator<Item = (K, V)>,
1322        K: std::convert::Into<std::string::String>,
1323        V: std::convert::Into<crate::model::ExternalValueSource>,
1324    {
1325        use std::iter::Iterator;
1326        self.external_values = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1327        self
1328    }
1329
1330    /// Sets the value of [source][crate::model::TerraformBlueprint::source].
1331    ///
1332    /// Note that all the setters affecting `source` are mutually
1333    /// exclusive.
1334    ///
1335    /// # Example
1336    /// ```ignore,no_run
1337    /// # use google_cloud_config_v1::model::TerraformBlueprint;
1338    /// use google_cloud_config_v1::model::terraform_blueprint::Source;
1339    /// let x = TerraformBlueprint::new().set_source(Some(Source::GcsSource("example".to_string())));
1340    /// ```
1341    pub fn set_source<
1342        T: std::convert::Into<std::option::Option<crate::model::terraform_blueprint::Source>>,
1343    >(
1344        mut self,
1345        v: T,
1346    ) -> Self {
1347        self.source = v.into();
1348        self
1349    }
1350
1351    /// The value of [source][crate::model::TerraformBlueprint::source]
1352    /// if it holds a `GcsSource`, `None` if the field is not set or
1353    /// holds a different branch.
1354    pub fn gcs_source(&self) -> std::option::Option<&std::string::String> {
1355        #[allow(unreachable_patterns)]
1356        self.source.as_ref().and_then(|v| match v {
1357            crate::model::terraform_blueprint::Source::GcsSource(v) => std::option::Option::Some(v),
1358            _ => std::option::Option::None,
1359        })
1360    }
1361
1362    /// Sets the value of [source][crate::model::TerraformBlueprint::source]
1363    /// to hold a `GcsSource`.
1364    ///
1365    /// Note that all the setters affecting `source` are
1366    /// mutually exclusive.
1367    ///
1368    /// # Example
1369    /// ```ignore,no_run
1370    /// # use google_cloud_config_v1::model::TerraformBlueprint;
1371    /// let x = TerraformBlueprint::new().set_gcs_source("example");
1372    /// assert!(x.gcs_source().is_some());
1373    /// assert!(x.git_source().is_none());
1374    /// ```
1375    pub fn set_gcs_source<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1376        self.source = std::option::Option::Some(
1377            crate::model::terraform_blueprint::Source::GcsSource(v.into()),
1378        );
1379        self
1380    }
1381
1382    /// The value of [source][crate::model::TerraformBlueprint::source]
1383    /// if it holds a `GitSource`, `None` if the field is not set or
1384    /// holds a different branch.
1385    pub fn git_source(&self) -> std::option::Option<&std::boxed::Box<crate::model::GitSource>> {
1386        #[allow(unreachable_patterns)]
1387        self.source.as_ref().and_then(|v| match v {
1388            crate::model::terraform_blueprint::Source::GitSource(v) => std::option::Option::Some(v),
1389            _ => std::option::Option::None,
1390        })
1391    }
1392
1393    /// Sets the value of [source][crate::model::TerraformBlueprint::source]
1394    /// to hold a `GitSource`.
1395    ///
1396    /// Note that all the setters affecting `source` are
1397    /// mutually exclusive.
1398    ///
1399    /// # Example
1400    /// ```ignore,no_run
1401    /// # use google_cloud_config_v1::model::TerraformBlueprint;
1402    /// use google_cloud_config_v1::model::GitSource;
1403    /// let x = TerraformBlueprint::new().set_git_source(GitSource::default()/* use setters */);
1404    /// assert!(x.git_source().is_some());
1405    /// assert!(x.gcs_source().is_none());
1406    /// ```
1407    pub fn set_git_source<T: std::convert::Into<std::boxed::Box<crate::model::GitSource>>>(
1408        mut self,
1409        v: T,
1410    ) -> Self {
1411        self.source = std::option::Option::Some(
1412            crate::model::terraform_blueprint::Source::GitSource(v.into()),
1413        );
1414        self
1415    }
1416}
1417
1418impl wkt::message::Message for TerraformBlueprint {
1419    fn typename() -> &'static str {
1420        "type.googleapis.com/google.cloud.config.v1.TerraformBlueprint"
1421    }
1422}
1423
1424/// Defines additional types related to [TerraformBlueprint].
1425pub mod terraform_blueprint {
1426    #[allow(unused_imports)]
1427    use super::*;
1428
1429    /// Location of the source configs.
1430    /// Required.
1431    #[derive(Clone, Debug, PartialEq)]
1432    #[non_exhaustive]
1433    pub enum Source {
1434        /// URI of an object in Google Cloud Storage.
1435        /// Format: `gs://{bucket}/{object}`
1436        ///
1437        /// URI may also specify an object version for zipped objects.
1438        /// Format: `gs://{bucket}/{object}#{version}`
1439        GcsSource(std::string::String),
1440        /// URI of a public Git repo.
1441        GitSource(std::boxed::Box<crate::model::GitSource>),
1442    }
1443}
1444
1445/// A Terraform input variable.
1446#[derive(Clone, Default, PartialEq)]
1447#[non_exhaustive]
1448pub struct TerraformVariable {
1449    /// Optional. Input variable value.
1450    pub input_value: std::option::Option<wkt::Value>,
1451
1452    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1453}
1454
1455impl TerraformVariable {
1456    /// Creates a new default instance.
1457    pub fn new() -> Self {
1458        std::default::Default::default()
1459    }
1460
1461    /// Sets the value of [input_value][crate::model::TerraformVariable::input_value].
1462    ///
1463    /// # Example
1464    /// ```ignore,no_run
1465    /// # use google_cloud_config_v1::model::TerraformVariable;
1466    /// use wkt::Value;
1467    /// let x = TerraformVariable::new().set_input_value(Value::default()/* use setters */);
1468    /// ```
1469    pub fn set_input_value<T>(mut self, v: T) -> Self
1470    where
1471        T: std::convert::Into<wkt::Value>,
1472    {
1473        self.input_value = std::option::Option::Some(v.into());
1474        self
1475    }
1476
1477    /// Sets or clears the value of [input_value][crate::model::TerraformVariable::input_value].
1478    ///
1479    /// # Example
1480    /// ```ignore,no_run
1481    /// # use google_cloud_config_v1::model::TerraformVariable;
1482    /// use wkt::Value;
1483    /// let x = TerraformVariable::new().set_or_clear_input_value(Some(Value::default()/* use setters */));
1484    /// let x = TerraformVariable::new().set_or_clear_input_value(None::<Value>);
1485    /// ```
1486    pub fn set_or_clear_input_value<T>(mut self, v: std::option::Option<T>) -> Self
1487    where
1488        T: std::convert::Into<wkt::Value>,
1489    {
1490        self.input_value = v.map(|x| x.into());
1491        self
1492    }
1493}
1494
1495impl wkt::message::Message for TerraformVariable {
1496    fn typename() -> &'static str {
1497        "type.googleapis.com/google.cloud.config.v1.TerraformVariable"
1498    }
1499}
1500
1501/// Configuration for a source of an external value.
1502#[derive(Clone, Default, PartialEq)]
1503#[non_exhaustive]
1504pub struct ExternalValueSource {
1505    /// The source of the external value.
1506    pub source: std::option::Option<crate::model::external_value_source::Source>,
1507
1508    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1509}
1510
1511impl ExternalValueSource {
1512    /// Creates a new default instance.
1513    pub fn new() -> Self {
1514        std::default::Default::default()
1515    }
1516
1517    /// Sets the value of [source][crate::model::ExternalValueSource::source].
1518    ///
1519    /// Note that all the setters affecting `source` are mutually
1520    /// exclusive.
1521    ///
1522    /// # Example
1523    /// ```ignore,no_run
1524    /// # use google_cloud_config_v1::model::ExternalValueSource;
1525    /// use google_cloud_config_v1::model::DeploymentSource;
1526    /// let x = ExternalValueSource::new().set_source(Some(
1527    ///     google_cloud_config_v1::model::external_value_source::Source::DeploymentSource(DeploymentSource::default().into())));
1528    /// ```
1529    pub fn set_source<
1530        T: std::convert::Into<std::option::Option<crate::model::external_value_source::Source>>,
1531    >(
1532        mut self,
1533        v: T,
1534    ) -> Self {
1535        self.source = v.into();
1536        self
1537    }
1538
1539    /// The value of [source][crate::model::ExternalValueSource::source]
1540    /// if it holds a `DeploymentSource`, `None` if the field is not set or
1541    /// holds a different branch.
1542    pub fn deployment_source(
1543        &self,
1544    ) -> std::option::Option<&std::boxed::Box<crate::model::DeploymentSource>> {
1545        #[allow(unreachable_patterns)]
1546        self.source.as_ref().and_then(|v| match v {
1547            crate::model::external_value_source::Source::DeploymentSource(v) => {
1548                std::option::Option::Some(v)
1549            }
1550            _ => std::option::Option::None,
1551        })
1552    }
1553
1554    /// Sets the value of [source][crate::model::ExternalValueSource::source]
1555    /// to hold a `DeploymentSource`.
1556    ///
1557    /// Note that all the setters affecting `source` are
1558    /// mutually exclusive.
1559    ///
1560    /// # Example
1561    /// ```ignore,no_run
1562    /// # use google_cloud_config_v1::model::ExternalValueSource;
1563    /// use google_cloud_config_v1::model::DeploymentSource;
1564    /// let x = ExternalValueSource::new().set_deployment_source(DeploymentSource::default()/* use setters */);
1565    /// assert!(x.deployment_source().is_some());
1566    /// ```
1567    pub fn set_deployment_source<
1568        T: std::convert::Into<std::boxed::Box<crate::model::DeploymentSource>>,
1569    >(
1570        mut self,
1571        v: T,
1572    ) -> Self {
1573        self.source = std::option::Option::Some(
1574            crate::model::external_value_source::Source::DeploymentSource(v.into()),
1575        );
1576        self
1577    }
1578}
1579
1580impl wkt::message::Message for ExternalValueSource {
1581    fn typename() -> &'static str {
1582        "type.googleapis.com/google.cloud.config.v1.ExternalValueSource"
1583    }
1584}
1585
1586/// Defines additional types related to [ExternalValueSource].
1587pub mod external_value_source {
1588    #[allow(unused_imports)]
1589    use super::*;
1590
1591    /// The source of the external value.
1592    #[derive(Clone, Debug, PartialEq)]
1593    #[non_exhaustive]
1594    pub enum Source {
1595        /// A source from a Deployment.
1596        DeploymentSource(std::boxed::Box<crate::model::DeploymentSource>),
1597    }
1598}
1599
1600/// Configuration for a value sourced from a Deployment.
1601#[derive(Clone, Default, PartialEq)]
1602#[non_exhaustive]
1603pub struct DeploymentSource {
1604    /// Required. The resource name of the source Deployment to import the output
1605    /// from. Format:
1606    /// projects/{project}/locations/{location}/deployments/{deployment} The source
1607    /// deployment must be in the same project and location.
1608    pub deployment: std::string::String,
1609
1610    /// Required. The name of the output variable in the source deployment's latest
1611    /// successfully applied revision.
1612    pub output_name: std::string::String,
1613
1614    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1615}
1616
1617impl DeploymentSource {
1618    /// Creates a new default instance.
1619    pub fn new() -> Self {
1620        std::default::Default::default()
1621    }
1622
1623    /// Sets the value of [deployment][crate::model::DeploymentSource::deployment].
1624    ///
1625    /// # Example
1626    /// ```ignore,no_run
1627    /// # use google_cloud_config_v1::model::DeploymentSource;
1628    /// # let project_id = "project_id";
1629    /// # let location_id = "location_id";
1630    /// # let deployment_id = "deployment_id";
1631    /// let x = DeploymentSource::new().set_deployment(format!("projects/{project_id}/locations/{location_id}/deployments/{deployment_id}"));
1632    /// ```
1633    pub fn set_deployment<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1634        self.deployment = v.into();
1635        self
1636    }
1637
1638    /// Sets the value of [output_name][crate::model::DeploymentSource::output_name].
1639    ///
1640    /// # Example
1641    /// ```ignore,no_run
1642    /// # use google_cloud_config_v1::model::DeploymentSource;
1643    /// let x = DeploymentSource::new().set_output_name("example");
1644    /// ```
1645    pub fn set_output_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1646        self.output_name = v.into();
1647        self
1648    }
1649}
1650
1651impl wkt::message::Message for DeploymentSource {
1652    fn typename() -> &'static str {
1653        "type.googleapis.com/google.cloud.config.v1.DeploymentSource"
1654    }
1655}
1656
1657/// Outputs and artifacts from applying a deployment.
1658#[derive(Clone, Default, PartialEq)]
1659#[non_exhaustive]
1660pub struct ApplyResults {
1661    /// Location of a blueprint copy and other manifests in Google Cloud Storage.
1662    /// Format: `gs://{bucket}/{object}`
1663    pub content: std::string::String,
1664
1665    /// Location of artifacts (e.g. logs) in Google Cloud Storage.
1666    /// Format: `gs://{bucket}/{object}`
1667    pub artifacts: std::string::String,
1668
1669    /// Map of output name to output info.
1670    pub outputs: std::collections::HashMap<std::string::String, crate::model::TerraformOutput>,
1671
1672    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1673}
1674
1675impl ApplyResults {
1676    /// Creates a new default instance.
1677    pub fn new() -> Self {
1678        std::default::Default::default()
1679    }
1680
1681    /// Sets the value of [content][crate::model::ApplyResults::content].
1682    ///
1683    /// # Example
1684    /// ```ignore,no_run
1685    /// # use google_cloud_config_v1::model::ApplyResults;
1686    /// let x = ApplyResults::new().set_content("example");
1687    /// ```
1688    pub fn set_content<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1689        self.content = v.into();
1690        self
1691    }
1692
1693    /// Sets the value of [artifacts][crate::model::ApplyResults::artifacts].
1694    ///
1695    /// # Example
1696    /// ```ignore,no_run
1697    /// # use google_cloud_config_v1::model::ApplyResults;
1698    /// let x = ApplyResults::new().set_artifacts("example");
1699    /// ```
1700    pub fn set_artifacts<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1701        self.artifacts = v.into();
1702        self
1703    }
1704
1705    /// Sets the value of [outputs][crate::model::ApplyResults::outputs].
1706    ///
1707    /// # Example
1708    /// ```ignore,no_run
1709    /// # use google_cloud_config_v1::model::ApplyResults;
1710    /// use google_cloud_config_v1::model::TerraformOutput;
1711    /// let x = ApplyResults::new().set_outputs([
1712    ///     ("key0", TerraformOutput::default()/* use setters */),
1713    ///     ("key1", TerraformOutput::default()/* use (different) setters */),
1714    /// ]);
1715    /// ```
1716    pub fn set_outputs<T, K, V>(mut self, v: T) -> Self
1717    where
1718        T: std::iter::IntoIterator<Item = (K, V)>,
1719        K: std::convert::Into<std::string::String>,
1720        V: std::convert::Into<crate::model::TerraformOutput>,
1721    {
1722        use std::iter::Iterator;
1723        self.outputs = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1724        self
1725    }
1726}
1727
1728impl wkt::message::Message for ApplyResults {
1729    fn typename() -> &'static str {
1730        "type.googleapis.com/google.cloud.config.v1.ApplyResults"
1731    }
1732}
1733
1734/// Describes a Terraform output.
1735#[derive(Clone, Default, PartialEq)]
1736#[non_exhaustive]
1737pub struct TerraformOutput {
1738    /// Identifies whether Terraform has set this output as a potential
1739    /// sensitive value.
1740    pub sensitive: bool,
1741
1742    /// Value of output.
1743    pub value: std::option::Option<wkt::Value>,
1744
1745    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1746}
1747
1748impl TerraformOutput {
1749    /// Creates a new default instance.
1750    pub fn new() -> Self {
1751        std::default::Default::default()
1752    }
1753
1754    /// Sets the value of [sensitive][crate::model::TerraformOutput::sensitive].
1755    ///
1756    /// # Example
1757    /// ```ignore,no_run
1758    /// # use google_cloud_config_v1::model::TerraformOutput;
1759    /// let x = TerraformOutput::new().set_sensitive(true);
1760    /// ```
1761    pub fn set_sensitive<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1762        self.sensitive = v.into();
1763        self
1764    }
1765
1766    /// Sets the value of [value][crate::model::TerraformOutput::value].
1767    ///
1768    /// # Example
1769    /// ```ignore,no_run
1770    /// # use google_cloud_config_v1::model::TerraformOutput;
1771    /// use wkt::Value;
1772    /// let x = TerraformOutput::new().set_value(Value::default()/* use setters */);
1773    /// ```
1774    pub fn set_value<T>(mut self, v: T) -> Self
1775    where
1776        T: std::convert::Into<wkt::Value>,
1777    {
1778        self.value = std::option::Option::Some(v.into());
1779        self
1780    }
1781
1782    /// Sets or clears the value of [value][crate::model::TerraformOutput::value].
1783    ///
1784    /// # Example
1785    /// ```ignore,no_run
1786    /// # use google_cloud_config_v1::model::TerraformOutput;
1787    /// use wkt::Value;
1788    /// let x = TerraformOutput::new().set_or_clear_value(Some(Value::default()/* use setters */));
1789    /// let x = TerraformOutput::new().set_or_clear_value(None::<Value>);
1790    /// ```
1791    pub fn set_or_clear_value<T>(mut self, v: std::option::Option<T>) -> Self
1792    where
1793        T: std::convert::Into<wkt::Value>,
1794    {
1795        self.value = v.map(|x| x.into());
1796        self
1797    }
1798}
1799
1800impl wkt::message::Message for TerraformOutput {
1801    fn typename() -> &'static str {
1802        "type.googleapis.com/google.cloud.config.v1.TerraformOutput"
1803    }
1804}
1805
1806#[allow(missing_docs)]
1807#[derive(Clone, Default, PartialEq)]
1808#[non_exhaustive]
1809pub struct ListDeploymentsRequest {
1810    /// Required. The parent in whose context the Deployments are listed. The
1811    /// parent value is in the format:
1812    /// 'projects/{project_id}/locations/{location}'.
1813    pub parent: std::string::String,
1814
1815    /// When requesting a page of resources, 'page_size' specifies number of
1816    /// resources to return. If unspecified, at most 500 will be returned. The
1817    /// maximum value is 1000.
1818    pub page_size: i32,
1819
1820    /// Token returned by previous call to 'ListDeployments' which specifies the
1821    /// position in the list from where to continue listing the resources.
1822    pub page_token: std::string::String,
1823
1824    /// Lists the Deployments that match the filter expression. A filter
1825    /// expression filters the resources listed in the response. The expression
1826    /// must be of the form '{field} {operator} {value}' where operators: '<', '>',
1827    /// '<=', '>=', '!=', '=', ':' are supported (colon ':' represents a HAS
1828    /// operator which is roughly synonymous with equality). {field} can refer to a
1829    /// proto or JSON field, or a synthetic field. Field names can be camelCase or
1830    /// snake_case.
1831    ///
1832    /// Examples:
1833    ///
1834    /// - Filter by name:
1835    ///   name = "projects/foo/locations/us-central1/deployments/bar
1836    ///
1837    /// - Filter by labels:
1838    ///
1839    ///   - Resources that have a key called 'foo'
1840    ///     labels.foo:*
1841    ///   - Resources that have a key called 'foo' whose value is 'bar'
1842    ///     labels.foo = bar
1843    /// - Filter by state:
1844    ///
1845    ///   - Deployments in CREATING state.
1846    ///     state=CREATING
1847    pub filter: std::string::String,
1848
1849    /// Field to use to sort the list.
1850    pub order_by: std::string::String,
1851
1852    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1853}
1854
1855impl ListDeploymentsRequest {
1856    /// Creates a new default instance.
1857    pub fn new() -> Self {
1858        std::default::Default::default()
1859    }
1860
1861    /// Sets the value of [parent][crate::model::ListDeploymentsRequest::parent].
1862    ///
1863    /// # Example
1864    /// ```ignore,no_run
1865    /// # use google_cloud_config_v1::model::ListDeploymentsRequest;
1866    /// let x = ListDeploymentsRequest::new().set_parent("example");
1867    /// ```
1868    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1869        self.parent = v.into();
1870        self
1871    }
1872
1873    /// Sets the value of [page_size][crate::model::ListDeploymentsRequest::page_size].
1874    ///
1875    /// # Example
1876    /// ```ignore,no_run
1877    /// # use google_cloud_config_v1::model::ListDeploymentsRequest;
1878    /// let x = ListDeploymentsRequest::new().set_page_size(42);
1879    /// ```
1880    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1881        self.page_size = v.into();
1882        self
1883    }
1884
1885    /// Sets the value of [page_token][crate::model::ListDeploymentsRequest::page_token].
1886    ///
1887    /// # Example
1888    /// ```ignore,no_run
1889    /// # use google_cloud_config_v1::model::ListDeploymentsRequest;
1890    /// let x = ListDeploymentsRequest::new().set_page_token("example");
1891    /// ```
1892    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1893        self.page_token = v.into();
1894        self
1895    }
1896
1897    /// Sets the value of [filter][crate::model::ListDeploymentsRequest::filter].
1898    ///
1899    /// # Example
1900    /// ```ignore,no_run
1901    /// # use google_cloud_config_v1::model::ListDeploymentsRequest;
1902    /// let x = ListDeploymentsRequest::new().set_filter("example");
1903    /// ```
1904    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1905        self.filter = v.into();
1906        self
1907    }
1908
1909    /// Sets the value of [order_by][crate::model::ListDeploymentsRequest::order_by].
1910    ///
1911    /// # Example
1912    /// ```ignore,no_run
1913    /// # use google_cloud_config_v1::model::ListDeploymentsRequest;
1914    /// let x = ListDeploymentsRequest::new().set_order_by("example");
1915    /// ```
1916    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1917        self.order_by = v.into();
1918        self
1919    }
1920}
1921
1922impl wkt::message::Message for ListDeploymentsRequest {
1923    fn typename() -> &'static str {
1924        "type.googleapis.com/google.cloud.config.v1.ListDeploymentsRequest"
1925    }
1926}
1927
1928#[allow(missing_docs)]
1929#[derive(Clone, Default, PartialEq)]
1930#[non_exhaustive]
1931pub struct ListDeploymentsResponse {
1932    /// List of [Deployment][google.cloud.config.v1.Deployment]s.
1933    ///
1934    /// [google.cloud.config.v1.Deployment]: crate::model::Deployment
1935    pub deployments: std::vec::Vec<crate::model::Deployment>,
1936
1937    /// Token to be supplied to the next ListDeployments request via `page_token`
1938    /// to obtain the next set of results.
1939    pub next_page_token: std::string::String,
1940
1941    /// Locations that could not be reached.
1942    pub unreachable: std::vec::Vec<std::string::String>,
1943
1944    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1945}
1946
1947impl ListDeploymentsResponse {
1948    /// Creates a new default instance.
1949    pub fn new() -> Self {
1950        std::default::Default::default()
1951    }
1952
1953    /// Sets the value of [deployments][crate::model::ListDeploymentsResponse::deployments].
1954    ///
1955    /// # Example
1956    /// ```ignore,no_run
1957    /// # use google_cloud_config_v1::model::ListDeploymentsResponse;
1958    /// use google_cloud_config_v1::model::Deployment;
1959    /// let x = ListDeploymentsResponse::new()
1960    ///     .set_deployments([
1961    ///         Deployment::default()/* use setters */,
1962    ///         Deployment::default()/* use (different) setters */,
1963    ///     ]);
1964    /// ```
1965    pub fn set_deployments<T, V>(mut self, v: T) -> Self
1966    where
1967        T: std::iter::IntoIterator<Item = V>,
1968        V: std::convert::Into<crate::model::Deployment>,
1969    {
1970        use std::iter::Iterator;
1971        self.deployments = v.into_iter().map(|i| i.into()).collect();
1972        self
1973    }
1974
1975    /// Sets the value of [next_page_token][crate::model::ListDeploymentsResponse::next_page_token].
1976    ///
1977    /// # Example
1978    /// ```ignore,no_run
1979    /// # use google_cloud_config_v1::model::ListDeploymentsResponse;
1980    /// let x = ListDeploymentsResponse::new().set_next_page_token("example");
1981    /// ```
1982    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1983        self.next_page_token = v.into();
1984        self
1985    }
1986
1987    /// Sets the value of [unreachable][crate::model::ListDeploymentsResponse::unreachable].
1988    ///
1989    /// # Example
1990    /// ```ignore,no_run
1991    /// # use google_cloud_config_v1::model::ListDeploymentsResponse;
1992    /// let x = ListDeploymentsResponse::new().set_unreachable(["a", "b", "c"]);
1993    /// ```
1994    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
1995    where
1996        T: std::iter::IntoIterator<Item = V>,
1997        V: std::convert::Into<std::string::String>,
1998    {
1999        use std::iter::Iterator;
2000        self.unreachable = v.into_iter().map(|i| i.into()).collect();
2001        self
2002    }
2003}
2004
2005impl wkt::message::Message for ListDeploymentsResponse {
2006    fn typename() -> &'static str {
2007        "type.googleapis.com/google.cloud.config.v1.ListDeploymentsResponse"
2008    }
2009}
2010
2011#[doc(hidden)]
2012impl google_cloud_gax::paginator::internal::PageableResponse for ListDeploymentsResponse {
2013    type PageItem = crate::model::Deployment;
2014
2015    fn items(self) -> std::vec::Vec<Self::PageItem> {
2016        self.deployments
2017    }
2018
2019    fn next_page_token(&self) -> std::string::String {
2020        use std::clone::Clone;
2021        self.next_page_token.clone()
2022    }
2023}
2024
2025#[allow(missing_docs)]
2026#[derive(Clone, Default, PartialEq)]
2027#[non_exhaustive]
2028pub struct GetDeploymentRequest {
2029    /// Required. The name of the deployment. Format:
2030    /// 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
2031    pub name: std::string::String,
2032
2033    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2034}
2035
2036impl GetDeploymentRequest {
2037    /// Creates a new default instance.
2038    pub fn new() -> Self {
2039        std::default::Default::default()
2040    }
2041
2042    /// Sets the value of [name][crate::model::GetDeploymentRequest::name].
2043    ///
2044    /// # Example
2045    /// ```ignore,no_run
2046    /// # use google_cloud_config_v1::model::GetDeploymentRequest;
2047    /// # let project_id = "project_id";
2048    /// # let location_id = "location_id";
2049    /// # let deployment_id = "deployment_id";
2050    /// let x = GetDeploymentRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/deployments/{deployment_id}"));
2051    /// ```
2052    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2053        self.name = v.into();
2054        self
2055    }
2056}
2057
2058impl wkt::message::Message for GetDeploymentRequest {
2059    fn typename() -> &'static str {
2060        "type.googleapis.com/google.cloud.config.v1.GetDeploymentRequest"
2061    }
2062}
2063
2064/// A request to list Revisions passed to a 'ListRevisions' call.
2065#[derive(Clone, Default, PartialEq)]
2066#[non_exhaustive]
2067pub struct ListRevisionsRequest {
2068    /// Required. The parent in whose context the Revisions are listed. The parent
2069    /// value is in the format:
2070    /// 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
2071    pub parent: std::string::String,
2072
2073    /// When requesting a page of resources, `page_size` specifies number of
2074    /// resources to return. If unspecified, at most 500 will be returned. The
2075    /// maximum value is 1000.
2076    pub page_size: i32,
2077
2078    /// Token returned by previous call to 'ListRevisions' which specifies the
2079    /// position in the list from where to continue listing the resources.
2080    pub page_token: std::string::String,
2081
2082    /// Lists the Revisions that match the filter expression. A filter
2083    /// expression filters the resources listed in the response. The expression
2084    /// must be of the form '{field} {operator} {value}' where operators: '<', '>',
2085    /// '<=', '>=', '!=', '=', ':' are supported (colon ':' represents a HAS
2086    /// operator which is roughly synonymous with equality). {field} can refer to a
2087    /// proto or JSON field, or a synthetic field. Field names can be camelCase or
2088    /// snake_case.
2089    ///
2090    /// Examples:
2091    ///
2092    /// - Filter by name:
2093    ///   name = "projects/foo/locations/us-central1/deployments/dep/revisions/bar
2094    ///
2095    /// - Filter by labels:
2096    ///
2097    ///   - Resources that have a key called 'foo'
2098    ///     labels.foo:*
2099    ///   - Resources that have a key called 'foo' whose value is 'bar'
2100    ///     labels.foo = bar
2101    /// - Filter by state:
2102    ///
2103    ///   - Revisions in CREATING state.
2104    ///     state=CREATING
2105    pub filter: std::string::String,
2106
2107    /// Field to use to sort the list.
2108    pub order_by: std::string::String,
2109
2110    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2111}
2112
2113impl ListRevisionsRequest {
2114    /// Creates a new default instance.
2115    pub fn new() -> Self {
2116        std::default::Default::default()
2117    }
2118
2119    /// Sets the value of [parent][crate::model::ListRevisionsRequest::parent].
2120    ///
2121    /// # Example
2122    /// ```ignore,no_run
2123    /// # use google_cloud_config_v1::model::ListRevisionsRequest;
2124    /// # let project_id = "project_id";
2125    /// # let location_id = "location_id";
2126    /// # let deployment_id = "deployment_id";
2127    /// let x = ListRevisionsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/deployments/{deployment_id}"));
2128    /// ```
2129    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2130        self.parent = v.into();
2131        self
2132    }
2133
2134    /// Sets the value of [page_size][crate::model::ListRevisionsRequest::page_size].
2135    ///
2136    /// # Example
2137    /// ```ignore,no_run
2138    /// # use google_cloud_config_v1::model::ListRevisionsRequest;
2139    /// let x = ListRevisionsRequest::new().set_page_size(42);
2140    /// ```
2141    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2142        self.page_size = v.into();
2143        self
2144    }
2145
2146    /// Sets the value of [page_token][crate::model::ListRevisionsRequest::page_token].
2147    ///
2148    /// # Example
2149    /// ```ignore,no_run
2150    /// # use google_cloud_config_v1::model::ListRevisionsRequest;
2151    /// let x = ListRevisionsRequest::new().set_page_token("example");
2152    /// ```
2153    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2154        self.page_token = v.into();
2155        self
2156    }
2157
2158    /// Sets the value of [filter][crate::model::ListRevisionsRequest::filter].
2159    ///
2160    /// # Example
2161    /// ```ignore,no_run
2162    /// # use google_cloud_config_v1::model::ListRevisionsRequest;
2163    /// let x = ListRevisionsRequest::new().set_filter("example");
2164    /// ```
2165    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2166        self.filter = v.into();
2167        self
2168    }
2169
2170    /// Sets the value of [order_by][crate::model::ListRevisionsRequest::order_by].
2171    ///
2172    /// # Example
2173    /// ```ignore,no_run
2174    /// # use google_cloud_config_v1::model::ListRevisionsRequest;
2175    /// let x = ListRevisionsRequest::new().set_order_by("example");
2176    /// ```
2177    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2178        self.order_by = v.into();
2179        self
2180    }
2181}
2182
2183impl wkt::message::Message for ListRevisionsRequest {
2184    fn typename() -> &'static str {
2185        "type.googleapis.com/google.cloud.config.v1.ListRevisionsRequest"
2186    }
2187}
2188
2189/// A response to a 'ListRevisions' call. Contains a list of Revisions.
2190#[derive(Clone, Default, PartialEq)]
2191#[non_exhaustive]
2192pub struct ListRevisionsResponse {
2193    /// List of [Revision][google.cloud.config.v1.Revision]s.
2194    ///
2195    /// [google.cloud.config.v1.Revision]: crate::model::Revision
2196    pub revisions: std::vec::Vec<crate::model::Revision>,
2197
2198    /// A token to request the next page of resources from the 'ListRevisions'
2199    /// method. The value of an empty string means that there are no more resources
2200    /// to return.
2201    pub next_page_token: std::string::String,
2202
2203    /// Locations that could not be reached.
2204    pub unreachable: std::vec::Vec<std::string::String>,
2205
2206    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2207}
2208
2209impl ListRevisionsResponse {
2210    /// Creates a new default instance.
2211    pub fn new() -> Self {
2212        std::default::Default::default()
2213    }
2214
2215    /// Sets the value of [revisions][crate::model::ListRevisionsResponse::revisions].
2216    ///
2217    /// # Example
2218    /// ```ignore,no_run
2219    /// # use google_cloud_config_v1::model::ListRevisionsResponse;
2220    /// use google_cloud_config_v1::model::Revision;
2221    /// let x = ListRevisionsResponse::new()
2222    ///     .set_revisions([
2223    ///         Revision::default()/* use setters */,
2224    ///         Revision::default()/* use (different) setters */,
2225    ///     ]);
2226    /// ```
2227    pub fn set_revisions<T, V>(mut self, v: T) -> Self
2228    where
2229        T: std::iter::IntoIterator<Item = V>,
2230        V: std::convert::Into<crate::model::Revision>,
2231    {
2232        use std::iter::Iterator;
2233        self.revisions = v.into_iter().map(|i| i.into()).collect();
2234        self
2235    }
2236
2237    /// Sets the value of [next_page_token][crate::model::ListRevisionsResponse::next_page_token].
2238    ///
2239    /// # Example
2240    /// ```ignore,no_run
2241    /// # use google_cloud_config_v1::model::ListRevisionsResponse;
2242    /// let x = ListRevisionsResponse::new().set_next_page_token("example");
2243    /// ```
2244    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2245        self.next_page_token = v.into();
2246        self
2247    }
2248
2249    /// Sets the value of [unreachable][crate::model::ListRevisionsResponse::unreachable].
2250    ///
2251    /// # Example
2252    /// ```ignore,no_run
2253    /// # use google_cloud_config_v1::model::ListRevisionsResponse;
2254    /// let x = ListRevisionsResponse::new().set_unreachable(["a", "b", "c"]);
2255    /// ```
2256    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
2257    where
2258        T: std::iter::IntoIterator<Item = V>,
2259        V: std::convert::Into<std::string::String>,
2260    {
2261        use std::iter::Iterator;
2262        self.unreachable = v.into_iter().map(|i| i.into()).collect();
2263        self
2264    }
2265}
2266
2267impl wkt::message::Message for ListRevisionsResponse {
2268    fn typename() -> &'static str {
2269        "type.googleapis.com/google.cloud.config.v1.ListRevisionsResponse"
2270    }
2271}
2272
2273#[doc(hidden)]
2274impl google_cloud_gax::paginator::internal::PageableResponse for ListRevisionsResponse {
2275    type PageItem = crate::model::Revision;
2276
2277    fn items(self) -> std::vec::Vec<Self::PageItem> {
2278        self.revisions
2279    }
2280
2281    fn next_page_token(&self) -> std::string::String {
2282        use std::clone::Clone;
2283        self.next_page_token.clone()
2284    }
2285}
2286
2287/// A request to get a Revision from a 'GetRevision' call.
2288#[derive(Clone, Default, PartialEq)]
2289#[non_exhaustive]
2290pub struct GetRevisionRequest {
2291    /// Required. The name of the Revision in the format:
2292    /// 'projects/{project_id}/locations/{location}/deployments/{deployment}/revisions/{revision}'.
2293    pub name: std::string::String,
2294
2295    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2296}
2297
2298impl GetRevisionRequest {
2299    /// Creates a new default instance.
2300    pub fn new() -> Self {
2301        std::default::Default::default()
2302    }
2303
2304    /// Sets the value of [name][crate::model::GetRevisionRequest::name].
2305    ///
2306    /// # Example
2307    /// ```ignore,no_run
2308    /// # use google_cloud_config_v1::model::GetRevisionRequest;
2309    /// # let project_id = "project_id";
2310    /// # let location_id = "location_id";
2311    /// # let deployment_id = "deployment_id";
2312    /// # let revision_id = "revision_id";
2313    /// let x = GetRevisionRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/deployments/{deployment_id}/revisions/{revision_id}"));
2314    /// ```
2315    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2316        self.name = v.into();
2317        self
2318    }
2319}
2320
2321impl wkt::message::Message for GetRevisionRequest {
2322    fn typename() -> &'static str {
2323        "type.googleapis.com/google.cloud.config.v1.GetRevisionRequest"
2324    }
2325}
2326
2327#[allow(missing_docs)]
2328#[derive(Clone, Default, PartialEq)]
2329#[non_exhaustive]
2330pub struct CreateDeploymentRequest {
2331    /// Required. The parent in whose context the Deployment is created. The parent
2332    /// value is in the format: 'projects/{project_id}/locations/{location}'.
2333    pub parent: std::string::String,
2334
2335    /// Required. The Deployment ID.
2336    pub deployment_id: std::string::String,
2337
2338    /// Required. [Deployment][google.cloud.config.v1.Deployment] resource to be
2339    /// created.
2340    ///
2341    /// [google.cloud.config.v1.Deployment]: crate::model::Deployment
2342    pub deployment: std::option::Option<crate::model::Deployment>,
2343
2344    /// Optional. An optional request ID to identify requests. Specify a unique
2345    /// request ID so that if you must retry your request, the server will know to
2346    /// ignore the request if it has already been completed. The server will
2347    /// guarantee that for at least 60 minutes since the first request.
2348    ///
2349    /// For example, consider a situation where you make an initial request and the
2350    /// request times out. If you make the request again with the same request ID,
2351    /// the server can check if original operation with the same request ID was
2352    /// received, and if so, will ignore the second request. This prevents clients
2353    /// from accidentally creating duplicate commitments.
2354    ///
2355    /// The request ID must be a valid UUID with the exception that zero UUID is
2356    /// not supported (00000000-0000-0000-0000-000000000000).
2357    pub request_id: std::string::String,
2358
2359    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2360}
2361
2362impl CreateDeploymentRequest {
2363    /// Creates a new default instance.
2364    pub fn new() -> Self {
2365        std::default::Default::default()
2366    }
2367
2368    /// Sets the value of [parent][crate::model::CreateDeploymentRequest::parent].
2369    ///
2370    /// # Example
2371    /// ```ignore,no_run
2372    /// # use google_cloud_config_v1::model::CreateDeploymentRequest;
2373    /// let x = CreateDeploymentRequest::new().set_parent("example");
2374    /// ```
2375    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2376        self.parent = v.into();
2377        self
2378    }
2379
2380    /// Sets the value of [deployment_id][crate::model::CreateDeploymentRequest::deployment_id].
2381    ///
2382    /// # Example
2383    /// ```ignore,no_run
2384    /// # use google_cloud_config_v1::model::CreateDeploymentRequest;
2385    /// let x = CreateDeploymentRequest::new().set_deployment_id("example");
2386    /// ```
2387    pub fn set_deployment_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2388        self.deployment_id = v.into();
2389        self
2390    }
2391
2392    /// Sets 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_deployment(Deployment::default()/* use setters */);
2399    /// ```
2400    pub fn set_deployment<T>(mut self, v: T) -> Self
2401    where
2402        T: std::convert::Into<crate::model::Deployment>,
2403    {
2404        self.deployment = std::option::Option::Some(v.into());
2405        self
2406    }
2407
2408    /// Sets or clears the value of [deployment][crate::model::CreateDeploymentRequest::deployment].
2409    ///
2410    /// # Example
2411    /// ```ignore,no_run
2412    /// # use google_cloud_config_v1::model::CreateDeploymentRequest;
2413    /// use google_cloud_config_v1::model::Deployment;
2414    /// let x = CreateDeploymentRequest::new().set_or_clear_deployment(Some(Deployment::default()/* use setters */));
2415    /// let x = CreateDeploymentRequest::new().set_or_clear_deployment(None::<Deployment>);
2416    /// ```
2417    pub fn set_or_clear_deployment<T>(mut self, v: std::option::Option<T>) -> Self
2418    where
2419        T: std::convert::Into<crate::model::Deployment>,
2420    {
2421        self.deployment = v.map(|x| x.into());
2422        self
2423    }
2424
2425    /// Sets the value of [request_id][crate::model::CreateDeploymentRequest::request_id].
2426    ///
2427    /// # Example
2428    /// ```ignore,no_run
2429    /// # use google_cloud_config_v1::model::CreateDeploymentRequest;
2430    /// let x = CreateDeploymentRequest::new().set_request_id("example");
2431    /// ```
2432    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2433        self.request_id = v.into();
2434        self
2435    }
2436}
2437
2438impl wkt::message::Message for CreateDeploymentRequest {
2439    fn typename() -> &'static str {
2440        "type.googleapis.com/google.cloud.config.v1.CreateDeploymentRequest"
2441    }
2442}
2443
2444/// A request to create a deployment group
2445#[derive(Clone, Default, PartialEq)]
2446#[non_exhaustive]
2447pub struct CreateDeploymentGroupRequest {
2448    /// Required. The parent in whose context the Deployment Group is created. The
2449    /// parent value is in the format: 'projects/{project_id}/locations/{location}'
2450    pub parent: std::string::String,
2451
2452    /// Required. The deployment group ID.
2453    pub deployment_group_id: std::string::String,
2454
2455    /// Required. [Deployment Group][] resource to create
2456    pub deployment_group: std::option::Option<crate::model::DeploymentGroup>,
2457
2458    /// Optional. An optional request ID to identify requests. Specify a unique
2459    /// request ID so that if you must retry your request, the server will know to
2460    /// ignore the request if it has already been completed. The server will
2461    /// guarantee that for at least 60 minutes since the first request.
2462    ///
2463    /// For example, consider a situation where you make an initial request and the
2464    /// request times out. If you make the request again with the same request ID,
2465    /// the server can check if original operation with the same request ID was
2466    /// received, and if so, will ignore the second request. This prevents clients
2467    /// from accidentally creating duplicate commitments.
2468    ///
2469    /// The request ID must be a valid UUID with the exception that zero UUID is
2470    /// not supported (00000000-0000-0000-0000-000000000000).
2471    pub request_id: std::string::String,
2472
2473    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2474}
2475
2476impl CreateDeploymentGroupRequest {
2477    /// Creates a new default instance.
2478    pub fn new() -> Self {
2479        std::default::Default::default()
2480    }
2481
2482    /// Sets the value of [parent][crate::model::CreateDeploymentGroupRequest::parent].
2483    ///
2484    /// # Example
2485    /// ```ignore,no_run
2486    /// # use google_cloud_config_v1::model::CreateDeploymentGroupRequest;
2487    /// let x = CreateDeploymentGroupRequest::new().set_parent("example");
2488    /// ```
2489    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2490        self.parent = v.into();
2491        self
2492    }
2493
2494    /// Sets the value of [deployment_group_id][crate::model::CreateDeploymentGroupRequest::deployment_group_id].
2495    ///
2496    /// # Example
2497    /// ```ignore,no_run
2498    /// # use google_cloud_config_v1::model::CreateDeploymentGroupRequest;
2499    /// let x = CreateDeploymentGroupRequest::new().set_deployment_group_id("example");
2500    /// ```
2501    pub fn set_deployment_group_id<T: std::convert::Into<std::string::String>>(
2502        mut self,
2503        v: T,
2504    ) -> Self {
2505        self.deployment_group_id = v.into();
2506        self
2507    }
2508
2509    /// Sets 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_deployment_group(DeploymentGroup::default()/* use setters */);
2516    /// ```
2517    pub fn set_deployment_group<T>(mut self, v: T) -> Self
2518    where
2519        T: std::convert::Into<crate::model::DeploymentGroup>,
2520    {
2521        self.deployment_group = std::option::Option::Some(v.into());
2522        self
2523    }
2524
2525    /// Sets or clears the value of [deployment_group][crate::model::CreateDeploymentGroupRequest::deployment_group].
2526    ///
2527    /// # Example
2528    /// ```ignore,no_run
2529    /// # use google_cloud_config_v1::model::CreateDeploymentGroupRequest;
2530    /// use google_cloud_config_v1::model::DeploymentGroup;
2531    /// let x = CreateDeploymentGroupRequest::new().set_or_clear_deployment_group(Some(DeploymentGroup::default()/* use setters */));
2532    /// let x = CreateDeploymentGroupRequest::new().set_or_clear_deployment_group(None::<DeploymentGroup>);
2533    /// ```
2534    pub fn set_or_clear_deployment_group<T>(mut self, v: std::option::Option<T>) -> Self
2535    where
2536        T: std::convert::Into<crate::model::DeploymentGroup>,
2537    {
2538        self.deployment_group = v.map(|x| x.into());
2539        self
2540    }
2541
2542    /// Sets the value of [request_id][crate::model::CreateDeploymentGroupRequest::request_id].
2543    ///
2544    /// # Example
2545    /// ```ignore,no_run
2546    /// # use google_cloud_config_v1::model::CreateDeploymentGroupRequest;
2547    /// let x = CreateDeploymentGroupRequest::new().set_request_id("example");
2548    /// ```
2549    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2550        self.request_id = v.into();
2551        self
2552    }
2553}
2554
2555impl wkt::message::Message for CreateDeploymentGroupRequest {
2556    fn typename() -> &'static str {
2557        "type.googleapis.com/google.cloud.config.v1.CreateDeploymentGroupRequest"
2558    }
2559}
2560
2561/// A request message for updating a deployment group
2562#[derive(Clone, Default, PartialEq)]
2563#[non_exhaustive]
2564pub struct UpdateDeploymentGroupRequest {
2565    /// Optional. Field mask used to specify the fields to be overwritten in the
2566    /// Deployment Group resource by the update.
2567    ///
2568    /// The fields specified in the update_mask are relative to the resource, not
2569    /// the full request. A field will be overwritten if it is in the mask. If the
2570    /// user does not provide a mask then all fields will be overwritten.
2571    pub update_mask: std::option::Option<wkt::FieldMask>,
2572
2573    /// Required. [DeploymentGroup][google.cloud.config.v1.DeploymentGroup] to
2574    /// update.
2575    ///
2576    /// The deployment group's `name` field is used to identify the resource to be
2577    /// updated. Format:
2578    /// `projects/{project}/locations/{location}/deploymentGroups/{deployment_group_id}`
2579    ///
2580    /// [google.cloud.config.v1.DeploymentGroup]: crate::model::DeploymentGroup
2581    pub deployment_group: std::option::Option<crate::model::DeploymentGroup>,
2582
2583    /// Optional. An optional request ID to identify requests. Specify a unique
2584    /// request ID so that if you must retry your request, the server will know to
2585    /// ignore the request if it has already been completed. The server will
2586    /// guarantee that for at least 60 minutes since the first request.
2587    ///
2588    /// For example, consider a situation where you make an initial request and the
2589    /// request times out. If you make the request again with the same request ID,
2590    /// the server can check if original operation with the same request ID was
2591    /// received, and if so, will ignore the second request. This prevents clients
2592    /// from accidentally creating duplicate commitments.
2593    ///
2594    /// The request ID must be a valid UUID with the exception that zero UUID is
2595    /// not supported (00000000-0000-0000-0000-000000000000).
2596    pub request_id: std::string::String,
2597
2598    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2599}
2600
2601impl UpdateDeploymentGroupRequest {
2602    /// Creates a new default instance.
2603    pub fn new() -> Self {
2604        std::default::Default::default()
2605    }
2606
2607    /// Sets 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_update_mask(FieldMask::default()/* use setters */);
2614    /// ```
2615    pub fn set_update_mask<T>(mut self, v: T) -> Self
2616    where
2617        T: std::convert::Into<wkt::FieldMask>,
2618    {
2619        self.update_mask = std::option::Option::Some(v.into());
2620        self
2621    }
2622
2623    /// Sets or clears the value of [update_mask][crate::model::UpdateDeploymentGroupRequest::update_mask].
2624    ///
2625    /// # Example
2626    /// ```ignore,no_run
2627    /// # use google_cloud_config_v1::model::UpdateDeploymentGroupRequest;
2628    /// use wkt::FieldMask;
2629    /// let x = UpdateDeploymentGroupRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
2630    /// let x = UpdateDeploymentGroupRequest::new().set_or_clear_update_mask(None::<FieldMask>);
2631    /// ```
2632    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2633    where
2634        T: std::convert::Into<wkt::FieldMask>,
2635    {
2636        self.update_mask = v.map(|x| x.into());
2637        self
2638    }
2639
2640    /// Sets 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_deployment_group(DeploymentGroup::default()/* use setters */);
2647    /// ```
2648    pub fn set_deployment_group<T>(mut self, v: T) -> Self
2649    where
2650        T: std::convert::Into<crate::model::DeploymentGroup>,
2651    {
2652        self.deployment_group = std::option::Option::Some(v.into());
2653        self
2654    }
2655
2656    /// Sets or clears the value of [deployment_group][crate::model::UpdateDeploymentGroupRequest::deployment_group].
2657    ///
2658    /// # Example
2659    /// ```ignore,no_run
2660    /// # use google_cloud_config_v1::model::UpdateDeploymentGroupRequest;
2661    /// use google_cloud_config_v1::model::DeploymentGroup;
2662    /// let x = UpdateDeploymentGroupRequest::new().set_or_clear_deployment_group(Some(DeploymentGroup::default()/* use setters */));
2663    /// let x = UpdateDeploymentGroupRequest::new().set_or_clear_deployment_group(None::<DeploymentGroup>);
2664    /// ```
2665    pub fn set_or_clear_deployment_group<T>(mut self, v: std::option::Option<T>) -> Self
2666    where
2667        T: std::convert::Into<crate::model::DeploymentGroup>,
2668    {
2669        self.deployment_group = v.map(|x| x.into());
2670        self
2671    }
2672
2673    /// Sets the value of [request_id][crate::model::UpdateDeploymentGroupRequest::request_id].
2674    ///
2675    /// # Example
2676    /// ```ignore,no_run
2677    /// # use google_cloud_config_v1::model::UpdateDeploymentGroupRequest;
2678    /// let x = UpdateDeploymentGroupRequest::new().set_request_id("example");
2679    /// ```
2680    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2681        self.request_id = v.into();
2682        self
2683    }
2684}
2685
2686impl wkt::message::Message for UpdateDeploymentGroupRequest {
2687    fn typename() -> &'static str {
2688        "type.googleapis.com/google.cloud.config.v1.UpdateDeploymentGroupRequest"
2689    }
2690}
2691
2692/// Request message for Delete DeploymentGroup
2693#[derive(Clone, Default, PartialEq)]
2694#[non_exhaustive]
2695pub struct DeleteDeploymentGroupRequest {
2696    /// Required. The name of DeploymentGroup in the format
2697    /// projects/{project_id}/locations/{location_id}/deploymentGroups/{deploymentGroup}
2698    pub name: std::string::String,
2699
2700    /// Optional. An optional request ID to identify requests. Specify a unique
2701    /// request ID so that if you must retry your request, the server will know to
2702    /// ignore the request if it has already been completed. The server will
2703    /// guarantee that for at least 60 minutes after the first request.
2704    ///
2705    /// For example, consider a situation where you make an initial request and the
2706    /// request times out. If you make the request again with the same request ID,
2707    /// the server can check if original operation with the same request ID was
2708    /// received, and if so, will ignore the second request. This prevents clients
2709    /// from accidentally creating duplicate commitments.
2710    ///
2711    /// The request ID must be a valid UUID with the exception that zero UUID is
2712    /// not supported (00000000-0000-0000-0000-000000000000).
2713    pub request_id: std::string::String,
2714
2715    /// Optional. If set to true, any revisions for this deployment group will also
2716    /// be deleted. (Otherwise, the request will only work if the deployment group
2717    /// has no revisions.)
2718    pub force: bool,
2719
2720    /// Optional. Policy on how to handle referenced deployments when deleting the
2721    /// DeploymentGroup.
2722    /// If unspecified, the default behavior is to fail the deletion if any
2723    /// deployments currently referenced in the `deployment_units` of the
2724    /// DeploymentGroup or in the latest revision are not deleted.
2725    pub deployment_reference_policy:
2726        crate::model::delete_deployment_group_request::DeploymentReferencePolicy,
2727
2728    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2729}
2730
2731impl DeleteDeploymentGroupRequest {
2732    /// Creates a new default instance.
2733    pub fn new() -> Self {
2734        std::default::Default::default()
2735    }
2736
2737    /// Sets the value of [name][crate::model::DeleteDeploymentGroupRequest::name].
2738    ///
2739    /// # Example
2740    /// ```ignore,no_run
2741    /// # use google_cloud_config_v1::model::DeleteDeploymentGroupRequest;
2742    /// # let project_id = "project_id";
2743    /// # let location_id = "location_id";
2744    /// # let deployment_group_id = "deployment_group_id";
2745    /// let x = DeleteDeploymentGroupRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/deploymentGroups/{deployment_group_id}"));
2746    /// ```
2747    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2748        self.name = v.into();
2749        self
2750    }
2751
2752    /// Sets the value of [request_id][crate::model::DeleteDeploymentGroupRequest::request_id].
2753    ///
2754    /// # Example
2755    /// ```ignore,no_run
2756    /// # use google_cloud_config_v1::model::DeleteDeploymentGroupRequest;
2757    /// let x = DeleteDeploymentGroupRequest::new().set_request_id("example");
2758    /// ```
2759    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2760        self.request_id = v.into();
2761        self
2762    }
2763
2764    /// Sets the value of [force][crate::model::DeleteDeploymentGroupRequest::force].
2765    ///
2766    /// # Example
2767    /// ```ignore,no_run
2768    /// # use google_cloud_config_v1::model::DeleteDeploymentGroupRequest;
2769    /// let x = DeleteDeploymentGroupRequest::new().set_force(true);
2770    /// ```
2771    pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2772        self.force = v.into();
2773        self
2774    }
2775
2776    /// Sets the value of [deployment_reference_policy][crate::model::DeleteDeploymentGroupRequest::deployment_reference_policy].
2777    ///
2778    /// # Example
2779    /// ```ignore,no_run
2780    /// # use google_cloud_config_v1::model::DeleteDeploymentGroupRequest;
2781    /// use google_cloud_config_v1::model::delete_deployment_group_request::DeploymentReferencePolicy;
2782    /// let x0 = DeleteDeploymentGroupRequest::new().set_deployment_reference_policy(DeploymentReferencePolicy::FailIfAnyReferencesExist);
2783    /// let x1 = DeleteDeploymentGroupRequest::new().set_deployment_reference_policy(DeploymentReferencePolicy::FailIfMetadataReferencesExist);
2784    /// let x2 = DeleteDeploymentGroupRequest::new().set_deployment_reference_policy(DeploymentReferencePolicy::IgnoreDeploymentReferences);
2785    /// ```
2786    pub fn set_deployment_reference_policy<
2787        T: std::convert::Into<
2788                crate::model::delete_deployment_group_request::DeploymentReferencePolicy,
2789            >,
2790    >(
2791        mut self,
2792        v: T,
2793    ) -> Self {
2794        self.deployment_reference_policy = v.into();
2795        self
2796    }
2797}
2798
2799impl wkt::message::Message for DeleteDeploymentGroupRequest {
2800    fn typename() -> &'static str {
2801        "type.googleapis.com/google.cloud.config.v1.DeleteDeploymentGroupRequest"
2802    }
2803}
2804
2805/// Defines additional types related to [DeleteDeploymentGroupRequest].
2806pub mod delete_deployment_group_request {
2807    #[allow(unused_imports)]
2808    use super::*;
2809
2810    /// Policy on how to handle referenced deployments when deleting the
2811    /// DeploymentGroup.
2812    ///
2813    /// # Working with unknown values
2814    ///
2815    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2816    /// additional enum variants at any time. Adding new variants is not considered
2817    /// a breaking change. Applications should write their code in anticipation of:
2818    ///
2819    /// - New values appearing in future releases of the client library, **and**
2820    /// - New values received dynamically, without application changes.
2821    ///
2822    /// Please consult the [Working with enums] section in the user guide for some
2823    /// guidelines.
2824    ///
2825    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
2826    #[derive(Clone, Debug, PartialEq)]
2827    #[non_exhaustive]
2828    pub enum DeploymentReferencePolicy {
2829        /// The default behavior. If unspecified, the system will act as if
2830        /// `FAIL_IF_ANY_REFERENCES_EXIST` is specified.
2831        Unspecified,
2832        /// Fail the deletion if any deployments currently referenced in the
2833        /// `deployment_units` of the DeploymentGroup or in the latest revision
2834        /// are not deleted.
2835        FailIfAnyReferencesExist,
2836        /// Fail the deletion only if any deployments currently referenced in the
2837        /// `deployment_units` of the DeploymentGroup are not deleted.
2838        /// The deletion will proceed even if the deployments in the latest revision
2839        /// of the DeploymentGroup are not deleted.
2840        FailIfMetadataReferencesExist,
2841        /// Ignore any deployments currently referenced in the
2842        /// `deployment_units` of the DeploymentGroup or in the latest revision.
2843        IgnoreDeploymentReferences,
2844        /// If set, the enum was initialized with an unknown value.
2845        ///
2846        /// Applications can examine the value using [DeploymentReferencePolicy::value] or
2847        /// [DeploymentReferencePolicy::name].
2848        UnknownValue(deployment_reference_policy::UnknownValue),
2849    }
2850
2851    #[doc(hidden)]
2852    pub mod deployment_reference_policy {
2853        #[allow(unused_imports)]
2854        use super::*;
2855        #[derive(Clone, Debug, PartialEq)]
2856        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2857    }
2858
2859    impl DeploymentReferencePolicy {
2860        /// Gets the enum value.
2861        ///
2862        /// Returns `None` if the enum contains an unknown value deserialized from
2863        /// the string representation of enums.
2864        pub fn value(&self) -> std::option::Option<i32> {
2865            match self {
2866                Self::Unspecified => std::option::Option::Some(0),
2867                Self::FailIfAnyReferencesExist => std::option::Option::Some(1),
2868                Self::FailIfMetadataReferencesExist => std::option::Option::Some(2),
2869                Self::IgnoreDeploymentReferences => std::option::Option::Some(3),
2870                Self::UnknownValue(u) => u.0.value(),
2871            }
2872        }
2873
2874        /// Gets the enum value as a string.
2875        ///
2876        /// Returns `None` if the enum contains an unknown value deserialized from
2877        /// the integer representation of enums.
2878        pub fn name(&self) -> std::option::Option<&str> {
2879            match self {
2880                Self::Unspecified => {
2881                    std::option::Option::Some("DEPLOYMENT_REFERENCE_POLICY_UNSPECIFIED")
2882                }
2883                Self::FailIfAnyReferencesExist => {
2884                    std::option::Option::Some("FAIL_IF_ANY_REFERENCES_EXIST")
2885                }
2886                Self::FailIfMetadataReferencesExist => {
2887                    std::option::Option::Some("FAIL_IF_METADATA_REFERENCES_EXIST")
2888                }
2889                Self::IgnoreDeploymentReferences => {
2890                    std::option::Option::Some("IGNORE_DEPLOYMENT_REFERENCES")
2891                }
2892                Self::UnknownValue(u) => u.0.name(),
2893            }
2894        }
2895    }
2896
2897    impl std::default::Default for DeploymentReferencePolicy {
2898        fn default() -> Self {
2899            use std::convert::From;
2900            Self::from(0)
2901        }
2902    }
2903
2904    impl std::fmt::Display for DeploymentReferencePolicy {
2905        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2906            wkt::internal::display_enum(f, self.name(), self.value())
2907        }
2908    }
2909
2910    impl std::convert::From<i32> for DeploymentReferencePolicy {
2911        fn from(value: i32) -> Self {
2912            match value {
2913                0 => Self::Unspecified,
2914                1 => Self::FailIfAnyReferencesExist,
2915                2 => Self::FailIfMetadataReferencesExist,
2916                3 => Self::IgnoreDeploymentReferences,
2917                _ => Self::UnknownValue(deployment_reference_policy::UnknownValue(
2918                    wkt::internal::UnknownEnumValue::Integer(value),
2919                )),
2920            }
2921        }
2922    }
2923
2924    impl std::convert::From<&str> for DeploymentReferencePolicy {
2925        fn from(value: &str) -> Self {
2926            use std::string::ToString;
2927            match value {
2928                "DEPLOYMENT_REFERENCE_POLICY_UNSPECIFIED" => Self::Unspecified,
2929                "FAIL_IF_ANY_REFERENCES_EXIST" => Self::FailIfAnyReferencesExist,
2930                "FAIL_IF_METADATA_REFERENCES_EXIST" => Self::FailIfMetadataReferencesExist,
2931                "IGNORE_DEPLOYMENT_REFERENCES" => Self::IgnoreDeploymentReferences,
2932                _ => Self::UnknownValue(deployment_reference_policy::UnknownValue(
2933                    wkt::internal::UnknownEnumValue::String(value.to_string()),
2934                )),
2935            }
2936        }
2937    }
2938
2939    impl serde::ser::Serialize for DeploymentReferencePolicy {
2940        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2941        where
2942            S: serde::Serializer,
2943        {
2944            match self {
2945                Self::Unspecified => serializer.serialize_i32(0),
2946                Self::FailIfAnyReferencesExist => serializer.serialize_i32(1),
2947                Self::FailIfMetadataReferencesExist => serializer.serialize_i32(2),
2948                Self::IgnoreDeploymentReferences => serializer.serialize_i32(3),
2949                Self::UnknownValue(u) => u.0.serialize(serializer),
2950            }
2951        }
2952    }
2953
2954    impl<'de> serde::de::Deserialize<'de> for DeploymentReferencePolicy {
2955        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2956        where
2957            D: serde::Deserializer<'de>,
2958        {
2959            deserializer.deserialize_any(wkt::internal::EnumVisitor::<DeploymentReferencePolicy>::new(
2960                ".google.cloud.config.v1.DeleteDeploymentGroupRequest.DeploymentReferencePolicy"))
2961        }
2962    }
2963}
2964
2965#[allow(missing_docs)]
2966#[derive(Clone, Default, PartialEq)]
2967#[non_exhaustive]
2968pub struct UpdateDeploymentRequest {
2969    /// Optional. Field mask used to specify the fields to be overwritten in the
2970    /// Deployment resource by the update.
2971    ///
2972    /// The fields specified in the update_mask are relative to the resource, not
2973    /// the full request. A field will be overwritten if it is in the mask. If the
2974    /// user does not provide a mask then all fields will be overwritten.
2975    pub update_mask: std::option::Option<wkt::FieldMask>,
2976
2977    /// Required. [Deployment][google.cloud.config.v1.Deployment] to update.
2978    ///
2979    /// The deployment's `name` field is used to identify the resource to be
2980    /// updated. Format:
2981    /// `projects/{project}/locations/{location}/deployments/{deployment}`
2982    ///
2983    /// [google.cloud.config.v1.Deployment]: crate::model::Deployment
2984    pub deployment: std::option::Option<crate::model::Deployment>,
2985
2986    /// Optional. An optional request ID to identify requests. Specify a unique
2987    /// request ID so that if you must retry your request, the server will know to
2988    /// ignore the request if it has already been completed. The server will
2989    /// guarantee that for at least 60 minutes since the first request.
2990    ///
2991    /// For example, consider a situation where you make an initial request and the
2992    /// request times out. If you make the request again with the same request ID,
2993    /// the server can check if original operation with the same request ID was
2994    /// received, and if so, will ignore the second request. This prevents clients
2995    /// from accidentally creating duplicate commitments.
2996    ///
2997    /// The request ID must be a valid UUID with the exception that zero UUID is
2998    /// not supported (00000000-0000-0000-0000-000000000000).
2999    pub request_id: std::string::String,
3000
3001    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3002}
3003
3004impl UpdateDeploymentRequest {
3005    /// Creates a new default instance.
3006    pub fn new() -> Self {
3007        std::default::Default::default()
3008    }
3009
3010    /// Sets the value of [update_mask][crate::model::UpdateDeploymentRequest::update_mask].
3011    ///
3012    /// # Example
3013    /// ```ignore,no_run
3014    /// # use google_cloud_config_v1::model::UpdateDeploymentRequest;
3015    /// use wkt::FieldMask;
3016    /// let x = UpdateDeploymentRequest::new().set_update_mask(FieldMask::default()/* use setters */);
3017    /// ```
3018    pub fn set_update_mask<T>(mut self, v: T) -> Self
3019    where
3020        T: std::convert::Into<wkt::FieldMask>,
3021    {
3022        self.update_mask = std::option::Option::Some(v.into());
3023        self
3024    }
3025
3026    /// Sets or clears the value of [update_mask][crate::model::UpdateDeploymentRequest::update_mask].
3027    ///
3028    /// # Example
3029    /// ```ignore,no_run
3030    /// # use google_cloud_config_v1::model::UpdateDeploymentRequest;
3031    /// use wkt::FieldMask;
3032    /// let x = UpdateDeploymentRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
3033    /// let x = UpdateDeploymentRequest::new().set_or_clear_update_mask(None::<FieldMask>);
3034    /// ```
3035    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3036    where
3037        T: std::convert::Into<wkt::FieldMask>,
3038    {
3039        self.update_mask = v.map(|x| x.into());
3040        self
3041    }
3042
3043    /// Sets the value of [deployment][crate::model::UpdateDeploymentRequest::deployment].
3044    ///
3045    /// # Example
3046    /// ```ignore,no_run
3047    /// # use google_cloud_config_v1::model::UpdateDeploymentRequest;
3048    /// use google_cloud_config_v1::model::Deployment;
3049    /// let x = UpdateDeploymentRequest::new().set_deployment(Deployment::default()/* use setters */);
3050    /// ```
3051    pub fn set_deployment<T>(mut self, v: T) -> Self
3052    where
3053        T: std::convert::Into<crate::model::Deployment>,
3054    {
3055        self.deployment = std::option::Option::Some(v.into());
3056        self
3057    }
3058
3059    /// Sets or clears the value of [deployment][crate::model::UpdateDeploymentRequest::deployment].
3060    ///
3061    /// # Example
3062    /// ```ignore,no_run
3063    /// # use google_cloud_config_v1::model::UpdateDeploymentRequest;
3064    /// use google_cloud_config_v1::model::Deployment;
3065    /// let x = UpdateDeploymentRequest::new().set_or_clear_deployment(Some(Deployment::default()/* use setters */));
3066    /// let x = UpdateDeploymentRequest::new().set_or_clear_deployment(None::<Deployment>);
3067    /// ```
3068    pub fn set_or_clear_deployment<T>(mut self, v: std::option::Option<T>) -> Self
3069    where
3070        T: std::convert::Into<crate::model::Deployment>,
3071    {
3072        self.deployment = v.map(|x| x.into());
3073        self
3074    }
3075
3076    /// Sets the value of [request_id][crate::model::UpdateDeploymentRequest::request_id].
3077    ///
3078    /// # Example
3079    /// ```ignore,no_run
3080    /// # use google_cloud_config_v1::model::UpdateDeploymentRequest;
3081    /// let x = UpdateDeploymentRequest::new().set_request_id("example");
3082    /// ```
3083    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3084        self.request_id = v.into();
3085        self
3086    }
3087}
3088
3089impl wkt::message::Message for UpdateDeploymentRequest {
3090    fn typename() -> &'static str {
3091        "type.googleapis.com/google.cloud.config.v1.UpdateDeploymentRequest"
3092    }
3093}
3094
3095#[allow(missing_docs)]
3096#[derive(Clone, Default, PartialEq)]
3097#[non_exhaustive]
3098pub struct DeleteDeploymentRequest {
3099    /// Required. The name of the Deployment in the format:
3100    /// 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
3101    pub name: std::string::String,
3102
3103    /// Optional. An optional request ID to identify requests. Specify a unique
3104    /// request ID so that if you must retry your request, the server will know to
3105    /// ignore the request if it has already been completed. The server will
3106    /// guarantee that for at least 60 minutes after the first request.
3107    ///
3108    /// For example, consider a situation where you make an initial request and the
3109    /// request times out. If you make the request again with the same request ID,
3110    /// the server can check if original operation with the same request ID was
3111    /// received, and if so, will ignore the second request. This prevents clients
3112    /// from accidentally creating duplicate commitments.
3113    ///
3114    /// The request ID must be a valid UUID with the exception that zero UUID is
3115    /// not supported (00000000-0000-0000-0000-000000000000).
3116    pub request_id: std::string::String,
3117
3118    /// Optional. If set to true, any revisions for this deployment will also be
3119    /// deleted. (Otherwise, the request will only work if the deployment has no
3120    /// revisions.)
3121    pub force: bool,
3122
3123    /// Optional. Policy on how resources actuated by the deployment should be
3124    /// deleted. If unspecified, the default behavior is to delete the underlying
3125    /// resources.
3126    pub delete_policy: crate::model::delete_deployment_request::DeletePolicy,
3127
3128    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3129}
3130
3131impl DeleteDeploymentRequest {
3132    /// Creates a new default instance.
3133    pub fn new() -> Self {
3134        std::default::Default::default()
3135    }
3136
3137    /// Sets the value of [name][crate::model::DeleteDeploymentRequest::name].
3138    ///
3139    /// # Example
3140    /// ```ignore,no_run
3141    /// # use google_cloud_config_v1::model::DeleteDeploymentRequest;
3142    /// # let project_id = "project_id";
3143    /// # let location_id = "location_id";
3144    /// # let deployment_id = "deployment_id";
3145    /// let x = DeleteDeploymentRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/deployments/{deployment_id}"));
3146    /// ```
3147    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3148        self.name = v.into();
3149        self
3150    }
3151
3152    /// Sets the value of [request_id][crate::model::DeleteDeploymentRequest::request_id].
3153    ///
3154    /// # Example
3155    /// ```ignore,no_run
3156    /// # use google_cloud_config_v1::model::DeleteDeploymentRequest;
3157    /// let x = DeleteDeploymentRequest::new().set_request_id("example");
3158    /// ```
3159    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3160        self.request_id = v.into();
3161        self
3162    }
3163
3164    /// Sets the value of [force][crate::model::DeleteDeploymentRequest::force].
3165    ///
3166    /// # Example
3167    /// ```ignore,no_run
3168    /// # use google_cloud_config_v1::model::DeleteDeploymentRequest;
3169    /// let x = DeleteDeploymentRequest::new().set_force(true);
3170    /// ```
3171    pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3172        self.force = v.into();
3173        self
3174    }
3175
3176    /// Sets the value of [delete_policy][crate::model::DeleteDeploymentRequest::delete_policy].
3177    ///
3178    /// # Example
3179    /// ```ignore,no_run
3180    /// # use google_cloud_config_v1::model::DeleteDeploymentRequest;
3181    /// use google_cloud_config_v1::model::delete_deployment_request::DeletePolicy;
3182    /// let x0 = DeleteDeploymentRequest::new().set_delete_policy(DeletePolicy::Delete);
3183    /// let x1 = DeleteDeploymentRequest::new().set_delete_policy(DeletePolicy::Abandon);
3184    /// ```
3185    pub fn set_delete_policy<
3186        T: std::convert::Into<crate::model::delete_deployment_request::DeletePolicy>,
3187    >(
3188        mut self,
3189        v: T,
3190    ) -> Self {
3191        self.delete_policy = v.into();
3192        self
3193    }
3194}
3195
3196impl wkt::message::Message for DeleteDeploymentRequest {
3197    fn typename() -> &'static str {
3198        "type.googleapis.com/google.cloud.config.v1.DeleteDeploymentRequest"
3199    }
3200}
3201
3202/// Defines additional types related to [DeleteDeploymentRequest].
3203pub mod delete_deployment_request {
3204    #[allow(unused_imports)]
3205    use super::*;
3206
3207    /// Policy on how resources actuated by the deployment should be deleted.
3208    ///
3209    /// # Working with unknown values
3210    ///
3211    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3212    /// additional enum variants at any time. Adding new variants is not considered
3213    /// a breaking change. Applications should write their code in anticipation of:
3214    ///
3215    /// - New values appearing in future releases of the client library, **and**
3216    /// - New values received dynamically, without application changes.
3217    ///
3218    /// Please consult the [Working with enums] section in the user guide for some
3219    /// guidelines.
3220    ///
3221    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
3222    #[derive(Clone, Debug, PartialEq)]
3223    #[non_exhaustive]
3224    pub enum DeletePolicy {
3225        /// Unspecified policy, resources will be deleted.
3226        Unspecified,
3227        /// Deletes resources actuated by the deployment.
3228        Delete,
3229        /// Abandons resources and only deletes the deployment and its metadata.
3230        Abandon,
3231        /// If set, the enum was initialized with an unknown value.
3232        ///
3233        /// Applications can examine the value using [DeletePolicy::value] or
3234        /// [DeletePolicy::name].
3235        UnknownValue(delete_policy::UnknownValue),
3236    }
3237
3238    #[doc(hidden)]
3239    pub mod delete_policy {
3240        #[allow(unused_imports)]
3241        use super::*;
3242        #[derive(Clone, Debug, PartialEq)]
3243        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3244    }
3245
3246    impl DeletePolicy {
3247        /// Gets the enum value.
3248        ///
3249        /// Returns `None` if the enum contains an unknown value deserialized from
3250        /// the string representation of enums.
3251        pub fn value(&self) -> std::option::Option<i32> {
3252            match self {
3253                Self::Unspecified => std::option::Option::Some(0),
3254                Self::Delete => std::option::Option::Some(1),
3255                Self::Abandon => std::option::Option::Some(2),
3256                Self::UnknownValue(u) => u.0.value(),
3257            }
3258        }
3259
3260        /// Gets the enum value as a string.
3261        ///
3262        /// Returns `None` if the enum contains an unknown value deserialized from
3263        /// the integer representation of enums.
3264        pub fn name(&self) -> std::option::Option<&str> {
3265            match self {
3266                Self::Unspecified => std::option::Option::Some("DELETE_POLICY_UNSPECIFIED"),
3267                Self::Delete => std::option::Option::Some("DELETE"),
3268                Self::Abandon => std::option::Option::Some("ABANDON"),
3269                Self::UnknownValue(u) => u.0.name(),
3270            }
3271        }
3272    }
3273
3274    impl std::default::Default for DeletePolicy {
3275        fn default() -> Self {
3276            use std::convert::From;
3277            Self::from(0)
3278        }
3279    }
3280
3281    impl std::fmt::Display for DeletePolicy {
3282        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3283            wkt::internal::display_enum(f, self.name(), self.value())
3284        }
3285    }
3286
3287    impl std::convert::From<i32> for DeletePolicy {
3288        fn from(value: i32) -> Self {
3289            match value {
3290                0 => Self::Unspecified,
3291                1 => Self::Delete,
3292                2 => Self::Abandon,
3293                _ => Self::UnknownValue(delete_policy::UnknownValue(
3294                    wkt::internal::UnknownEnumValue::Integer(value),
3295                )),
3296            }
3297        }
3298    }
3299
3300    impl std::convert::From<&str> for DeletePolicy {
3301        fn from(value: &str) -> Self {
3302            use std::string::ToString;
3303            match value {
3304                "DELETE_POLICY_UNSPECIFIED" => Self::Unspecified,
3305                "DELETE" => Self::Delete,
3306                "ABANDON" => Self::Abandon,
3307                _ => Self::UnknownValue(delete_policy::UnknownValue(
3308                    wkt::internal::UnknownEnumValue::String(value.to_string()),
3309                )),
3310            }
3311        }
3312    }
3313
3314    impl serde::ser::Serialize for DeletePolicy {
3315        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3316        where
3317            S: serde::Serializer,
3318        {
3319            match self {
3320                Self::Unspecified => serializer.serialize_i32(0),
3321                Self::Delete => serializer.serialize_i32(1),
3322                Self::Abandon => serializer.serialize_i32(2),
3323                Self::UnknownValue(u) => u.0.serialize(serializer),
3324            }
3325        }
3326    }
3327
3328    impl<'de> serde::de::Deserialize<'de> for DeletePolicy {
3329        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3330        where
3331            D: serde::Deserializer<'de>,
3332        {
3333            deserializer.deserialize_any(wkt::internal::EnumVisitor::<DeletePolicy>::new(
3334                ".google.cloud.config.v1.DeleteDeploymentRequest.DeletePolicy",
3335            ))
3336        }
3337    }
3338}
3339
3340/// Represents the metadata of the long-running operation.
3341#[derive(Clone, Default, PartialEq)]
3342#[non_exhaustive]
3343pub struct OperationMetadata {
3344    /// Output only. Time when the operation was created.
3345    pub create_time: std::option::Option<wkt::Timestamp>,
3346
3347    /// Output only. Time when the operation finished running.
3348    pub end_time: std::option::Option<wkt::Timestamp>,
3349
3350    /// Output only. Server-defined resource path for the target of the operation.
3351    pub target: std::string::String,
3352
3353    /// Output only. Name of the verb executed by the operation.
3354    pub verb: std::string::String,
3355
3356    /// Output only. Human-readable status of the operation, if any.
3357    pub status_message: std::string::String,
3358
3359    /// Output only. Identifies whether the user has requested cancellation of the
3360    /// operation. Operations that have successfully been cancelled have
3361    /// [google.longrunning.Operation.error][google.longrunning.Operation.error]
3362    /// value with a [google.rpc.Status.code][google.rpc.Status.code] of `1`,
3363    /// corresponding to `Code.CANCELLED`.
3364    ///
3365    /// [google.longrunning.Operation.error]: google_cloud_longrunning::model::Operation::result
3366    /// [google.rpc.Status.code]: google_cloud_rpc::model::Status::code
3367    pub requested_cancellation: bool,
3368
3369    /// Output only. API version used to start the operation.
3370    pub api_version: std::string::String,
3371
3372    /// Ephemeral metadata about the state of an operation for a particular
3373    /// resource.
3374    pub resource_metadata: std::option::Option<crate::model::operation_metadata::ResourceMetadata>,
3375
3376    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3377}
3378
3379impl OperationMetadata {
3380    /// Creates a new default instance.
3381    pub fn new() -> Self {
3382        std::default::Default::default()
3383    }
3384
3385    /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
3386    ///
3387    /// # Example
3388    /// ```ignore,no_run
3389    /// # use google_cloud_config_v1::model::OperationMetadata;
3390    /// use wkt::Timestamp;
3391    /// let x = OperationMetadata::new().set_create_time(Timestamp::default()/* use setters */);
3392    /// ```
3393    pub fn set_create_time<T>(mut self, v: T) -> Self
3394    where
3395        T: std::convert::Into<wkt::Timestamp>,
3396    {
3397        self.create_time = std::option::Option::Some(v.into());
3398        self
3399    }
3400
3401    /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
3402    ///
3403    /// # Example
3404    /// ```ignore,no_run
3405    /// # use google_cloud_config_v1::model::OperationMetadata;
3406    /// use wkt::Timestamp;
3407    /// let x = OperationMetadata::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
3408    /// let x = OperationMetadata::new().set_or_clear_create_time(None::<Timestamp>);
3409    /// ```
3410    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
3411    where
3412        T: std::convert::Into<wkt::Timestamp>,
3413    {
3414        self.create_time = v.map(|x| x.into());
3415        self
3416    }
3417
3418    /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
3419    ///
3420    /// # Example
3421    /// ```ignore,no_run
3422    /// # use google_cloud_config_v1::model::OperationMetadata;
3423    /// use wkt::Timestamp;
3424    /// let x = OperationMetadata::new().set_end_time(Timestamp::default()/* use setters */);
3425    /// ```
3426    pub fn set_end_time<T>(mut self, v: T) -> Self
3427    where
3428        T: std::convert::Into<wkt::Timestamp>,
3429    {
3430        self.end_time = std::option::Option::Some(v.into());
3431        self
3432    }
3433
3434    /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
3435    ///
3436    /// # Example
3437    /// ```ignore,no_run
3438    /// # use google_cloud_config_v1::model::OperationMetadata;
3439    /// use wkt::Timestamp;
3440    /// let x = OperationMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
3441    /// let x = OperationMetadata::new().set_or_clear_end_time(None::<Timestamp>);
3442    /// ```
3443    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
3444    where
3445        T: std::convert::Into<wkt::Timestamp>,
3446    {
3447        self.end_time = v.map(|x| x.into());
3448        self
3449    }
3450
3451    /// Sets the value of [target][crate::model::OperationMetadata::target].
3452    ///
3453    /// # Example
3454    /// ```ignore,no_run
3455    /// # use google_cloud_config_v1::model::OperationMetadata;
3456    /// let x = OperationMetadata::new().set_target("example");
3457    /// ```
3458    pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3459        self.target = v.into();
3460        self
3461    }
3462
3463    /// Sets the value of [verb][crate::model::OperationMetadata::verb].
3464    ///
3465    /// # Example
3466    /// ```ignore,no_run
3467    /// # use google_cloud_config_v1::model::OperationMetadata;
3468    /// let x = OperationMetadata::new().set_verb("example");
3469    /// ```
3470    pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3471        self.verb = v.into();
3472        self
3473    }
3474
3475    /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
3476    ///
3477    /// # Example
3478    /// ```ignore,no_run
3479    /// # use google_cloud_config_v1::model::OperationMetadata;
3480    /// let x = OperationMetadata::new().set_status_message("example");
3481    /// ```
3482    pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3483        self.status_message = v.into();
3484        self
3485    }
3486
3487    /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
3488    ///
3489    /// # Example
3490    /// ```ignore,no_run
3491    /// # use google_cloud_config_v1::model::OperationMetadata;
3492    /// let x = OperationMetadata::new().set_requested_cancellation(true);
3493    /// ```
3494    pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3495        self.requested_cancellation = v.into();
3496        self
3497    }
3498
3499    /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
3500    ///
3501    /// # Example
3502    /// ```ignore,no_run
3503    /// # use google_cloud_config_v1::model::OperationMetadata;
3504    /// let x = OperationMetadata::new().set_api_version("example");
3505    /// ```
3506    pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3507        self.api_version = v.into();
3508        self
3509    }
3510
3511    /// Sets the value of [resource_metadata][crate::model::OperationMetadata::resource_metadata].
3512    ///
3513    /// Note that all the setters affecting `resource_metadata` are mutually
3514    /// exclusive.
3515    ///
3516    /// # Example
3517    /// ```ignore,no_run
3518    /// # use google_cloud_config_v1::model::OperationMetadata;
3519    /// use google_cloud_config_v1::model::DeploymentOperationMetadata;
3520    /// let x = OperationMetadata::new().set_resource_metadata(Some(
3521    ///     google_cloud_config_v1::model::operation_metadata::ResourceMetadata::DeploymentMetadata(DeploymentOperationMetadata::default().into())));
3522    /// ```
3523    pub fn set_resource_metadata<
3524        T: std::convert::Into<std::option::Option<crate::model::operation_metadata::ResourceMetadata>>,
3525    >(
3526        mut self,
3527        v: T,
3528    ) -> Self {
3529        self.resource_metadata = v.into();
3530        self
3531    }
3532
3533    /// The value of [resource_metadata][crate::model::OperationMetadata::resource_metadata]
3534    /// if it holds a `DeploymentMetadata`, `None` if the field is not set or
3535    /// holds a different branch.
3536    pub fn deployment_metadata(
3537        &self,
3538    ) -> std::option::Option<&std::boxed::Box<crate::model::DeploymentOperationMetadata>> {
3539        #[allow(unreachable_patterns)]
3540        self.resource_metadata.as_ref().and_then(|v| match v {
3541            crate::model::operation_metadata::ResourceMetadata::DeploymentMetadata(v) => {
3542                std::option::Option::Some(v)
3543            }
3544            _ => std::option::Option::None,
3545        })
3546    }
3547
3548    /// Sets the value of [resource_metadata][crate::model::OperationMetadata::resource_metadata]
3549    /// to hold a `DeploymentMetadata`.
3550    ///
3551    /// Note that all the setters affecting `resource_metadata` are
3552    /// mutually exclusive.
3553    ///
3554    /// # Example
3555    /// ```ignore,no_run
3556    /// # use google_cloud_config_v1::model::OperationMetadata;
3557    /// use google_cloud_config_v1::model::DeploymentOperationMetadata;
3558    /// let x = OperationMetadata::new().set_deployment_metadata(DeploymentOperationMetadata::default()/* use setters */);
3559    /// assert!(x.deployment_metadata().is_some());
3560    /// assert!(x.preview_metadata().is_none());
3561    /// assert!(x.provision_deployment_group_metadata().is_none());
3562    /// ```
3563    pub fn set_deployment_metadata<
3564        T: std::convert::Into<std::boxed::Box<crate::model::DeploymentOperationMetadata>>,
3565    >(
3566        mut self,
3567        v: T,
3568    ) -> Self {
3569        self.resource_metadata = std::option::Option::Some(
3570            crate::model::operation_metadata::ResourceMetadata::DeploymentMetadata(v.into()),
3571        );
3572        self
3573    }
3574
3575    /// The value of [resource_metadata][crate::model::OperationMetadata::resource_metadata]
3576    /// if it holds a `PreviewMetadata`, `None` if the field is not set or
3577    /// holds a different branch.
3578    pub fn preview_metadata(
3579        &self,
3580    ) -> std::option::Option<&std::boxed::Box<crate::model::PreviewOperationMetadata>> {
3581        #[allow(unreachable_patterns)]
3582        self.resource_metadata.as_ref().and_then(|v| match v {
3583            crate::model::operation_metadata::ResourceMetadata::PreviewMetadata(v) => {
3584                std::option::Option::Some(v)
3585            }
3586            _ => std::option::Option::None,
3587        })
3588    }
3589
3590    /// Sets the value of [resource_metadata][crate::model::OperationMetadata::resource_metadata]
3591    /// to hold a `PreviewMetadata`.
3592    ///
3593    /// Note that all the setters affecting `resource_metadata` are
3594    /// mutually exclusive.
3595    ///
3596    /// # Example
3597    /// ```ignore,no_run
3598    /// # use google_cloud_config_v1::model::OperationMetadata;
3599    /// use google_cloud_config_v1::model::PreviewOperationMetadata;
3600    /// let x = OperationMetadata::new().set_preview_metadata(PreviewOperationMetadata::default()/* use setters */);
3601    /// assert!(x.preview_metadata().is_some());
3602    /// assert!(x.deployment_metadata().is_none());
3603    /// assert!(x.provision_deployment_group_metadata().is_none());
3604    /// ```
3605    pub fn set_preview_metadata<
3606        T: std::convert::Into<std::boxed::Box<crate::model::PreviewOperationMetadata>>,
3607    >(
3608        mut self,
3609        v: T,
3610    ) -> Self {
3611        self.resource_metadata = std::option::Option::Some(
3612            crate::model::operation_metadata::ResourceMetadata::PreviewMetadata(v.into()),
3613        );
3614        self
3615    }
3616
3617    /// The value of [resource_metadata][crate::model::OperationMetadata::resource_metadata]
3618    /// if it holds a `ProvisionDeploymentGroupMetadata`, `None` if the field is not set or
3619    /// holds a different branch.
3620    pub fn provision_deployment_group_metadata(
3621        &self,
3622    ) -> std::option::Option<
3623        &std::boxed::Box<crate::model::ProvisionDeploymentGroupOperationMetadata>,
3624    > {
3625        #[allow(unreachable_patterns)]
3626        self.resource_metadata.as_ref().and_then(|v| match v {
3627            crate::model::operation_metadata::ResourceMetadata::ProvisionDeploymentGroupMetadata(v) => std::option::Option::Some(v),
3628            _ => std::option::Option::None,
3629        })
3630    }
3631
3632    /// Sets the value of [resource_metadata][crate::model::OperationMetadata::resource_metadata]
3633    /// to hold a `ProvisionDeploymentGroupMetadata`.
3634    ///
3635    /// Note that all the setters affecting `resource_metadata` are
3636    /// mutually exclusive.
3637    ///
3638    /// # Example
3639    /// ```ignore,no_run
3640    /// # use google_cloud_config_v1::model::OperationMetadata;
3641    /// use google_cloud_config_v1::model::ProvisionDeploymentGroupOperationMetadata;
3642    /// let x = OperationMetadata::new().set_provision_deployment_group_metadata(ProvisionDeploymentGroupOperationMetadata::default()/* use setters */);
3643    /// assert!(x.provision_deployment_group_metadata().is_some());
3644    /// assert!(x.deployment_metadata().is_none());
3645    /// assert!(x.preview_metadata().is_none());
3646    /// ```
3647    pub fn set_provision_deployment_group_metadata<
3648        T: std::convert::Into<
3649                std::boxed::Box<crate::model::ProvisionDeploymentGroupOperationMetadata>,
3650            >,
3651    >(
3652        mut self,
3653        v: T,
3654    ) -> Self {
3655        self.resource_metadata = std::option::Option::Some(
3656            crate::model::operation_metadata::ResourceMetadata::ProvisionDeploymentGroupMetadata(
3657                v.into(),
3658            ),
3659        );
3660        self
3661    }
3662}
3663
3664impl wkt::message::Message for OperationMetadata {
3665    fn typename() -> &'static str {
3666        "type.googleapis.com/google.cloud.config.v1.OperationMetadata"
3667    }
3668}
3669
3670/// Defines additional types related to [OperationMetadata].
3671pub mod operation_metadata {
3672    #[allow(unused_imports)]
3673    use super::*;
3674
3675    /// Ephemeral metadata about the state of an operation for a particular
3676    /// resource.
3677    #[derive(Clone, Debug, PartialEq)]
3678    #[non_exhaustive]
3679    pub enum ResourceMetadata {
3680        /// Output only. Metadata about the deployment operation state.
3681        DeploymentMetadata(std::boxed::Box<crate::model::DeploymentOperationMetadata>),
3682        /// Output only. Metadata about the preview operation state.
3683        PreviewMetadata(std::boxed::Box<crate::model::PreviewOperationMetadata>),
3684        /// Output only. Metadata about ProvisionDeploymentGroup operation state.
3685        ProvisionDeploymentGroupMetadata(
3686            std::boxed::Box<crate::model::ProvisionDeploymentGroupOperationMetadata>,
3687        ),
3688    }
3689}
3690
3691/// A child resource of a Deployment generated by a 'CreateDeployment' or
3692/// 'UpdateDeployment' call. Each Revision contains metadata pertaining to a
3693/// snapshot of a particular Deployment.
3694#[derive(Clone, Default, PartialEq)]
3695#[non_exhaustive]
3696pub struct Revision {
3697    /// Revision name. Format:
3698    /// `projects/{project}/locations/{location}/deployments/{deployment}/
3699    /// revisions/{revision}`
3700    pub name: std::string::String,
3701
3702    /// Output only. Time when the revision was created.
3703    pub create_time: std::option::Option<wkt::Timestamp>,
3704
3705    /// Output only. Time when the revision was last modified.
3706    pub update_time: std::option::Option<wkt::Timestamp>,
3707
3708    /// Output only. The action which created this revision
3709    pub action: crate::model::revision::Action,
3710
3711    /// Output only. Current state of the revision.
3712    pub state: crate::model::revision::State,
3713
3714    /// Output only. Outputs and artifacts from applying a deployment.
3715    pub apply_results: std::option::Option<crate::model::ApplyResults>,
3716
3717    /// Output only. Additional info regarding the current state.
3718    pub state_detail: std::string::String,
3719
3720    /// Output only. Code describing any errors that may have occurred.
3721    pub error_code: crate::model::revision::ErrorCode,
3722
3723    /// Output only. Cloud Build instance UUID associated with this revision.
3724    pub build: std::string::String,
3725
3726    /// Output only. Location of Revision operation logs in
3727    /// `gs://{bucket}/{object}` format.
3728    pub logs: std::string::String,
3729
3730    /// Output only. Errors encountered when creating or updating this deployment.
3731    /// Errors are truncated to 10 entries, see `delete_results` and `error_logs`
3732    /// for full details.
3733    pub tf_errors: std::vec::Vec<crate::model::TerraformError>,
3734
3735    /// Output only. Location of Terraform error logs in Google Cloud Storage.
3736    /// Format: `gs://{bucket}/{object}`.
3737    pub error_logs: std::string::String,
3738
3739    /// Output only. User-specified Service Account (SA) to be used as credential
3740    /// to manage resources. Format:
3741    /// `projects/{projectID}/serviceAccounts/{serviceAccount}`
3742    pub service_account: std::string::String,
3743
3744    /// Output only. By default, Infra Manager will return a failure when
3745    /// Terraform encounters a 409 code (resource conflict error) during actuation.
3746    /// If this flag is set to true, Infra Manager will instead
3747    /// attempt to automatically import the resource into the Terraform state (for
3748    /// supported resource types) and continue actuation.
3749    ///
3750    /// Not all resource types are supported, refer to documentation.
3751    pub import_existing_resources: bool,
3752
3753    /// Output only. The user-specified Cloud Build worker pool resource in which
3754    /// the Cloud Build job will execute. Format:
3755    /// `projects/{project}/locations/{location}/workerPools/{workerPoolId}`.
3756    /// If this field is unspecified, the default Cloud Build worker pool will be
3757    /// used.
3758    pub worker_pool: std::string::String,
3759
3760    /// Output only. The user-specified Terraform version constraint.
3761    /// Example: "=1.3.10".
3762    pub tf_version_constraint: std::string::String,
3763
3764    /// Output only. The version of Terraform used to create the Revision.
3765    /// It is in the format of "Major.Minor.Patch", for example, "1.3.10".
3766    pub tf_version: std::string::String,
3767
3768    /// Output only. Cloud Storage path containing quota validation results. This
3769    /// field is set when a user sets Deployment.quota_validation field to ENABLED
3770    /// or ENFORCED. Format: `gs://{bucket}/{object}`.
3771    pub quota_validation_results: std::string::String,
3772
3773    /// Optional. Input to control quota checks for resources in terraform
3774    /// configuration files. There are limited resources on which quota validation
3775    /// applies.
3776    pub quota_validation: crate::model::QuotaValidation,
3777
3778    /// Output only. This field specifies the provider configurations.
3779    pub provider_config: std::option::Option<crate::model::ProviderConfig>,
3780
3781    /// Blueprint that was deployed.
3782    pub blueprint: std::option::Option<crate::model::revision::Blueprint>,
3783
3784    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3785}
3786
3787impl Revision {
3788    /// Creates a new default instance.
3789    pub fn new() -> Self {
3790        std::default::Default::default()
3791    }
3792
3793    /// Sets the value of [name][crate::model::Revision::name].
3794    ///
3795    /// # Example
3796    /// ```ignore,no_run
3797    /// # use google_cloud_config_v1::model::Revision;
3798    /// # let project_id = "project_id";
3799    /// # let location_id = "location_id";
3800    /// # let deployment_id = "deployment_id";
3801    /// # let revision_id = "revision_id";
3802    /// let x = Revision::new().set_name(format!("projects/{project_id}/locations/{location_id}/deployments/{deployment_id}/revisions/{revision_id}"));
3803    /// ```
3804    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3805        self.name = v.into();
3806        self
3807    }
3808
3809    /// Sets the value of [create_time][crate::model::Revision::create_time].
3810    ///
3811    /// # Example
3812    /// ```ignore,no_run
3813    /// # use google_cloud_config_v1::model::Revision;
3814    /// use wkt::Timestamp;
3815    /// let x = Revision::new().set_create_time(Timestamp::default()/* use setters */);
3816    /// ```
3817    pub fn set_create_time<T>(mut self, v: T) -> Self
3818    where
3819        T: std::convert::Into<wkt::Timestamp>,
3820    {
3821        self.create_time = std::option::Option::Some(v.into());
3822        self
3823    }
3824
3825    /// Sets or clears the value of [create_time][crate::model::Revision::create_time].
3826    ///
3827    /// # Example
3828    /// ```ignore,no_run
3829    /// # use google_cloud_config_v1::model::Revision;
3830    /// use wkt::Timestamp;
3831    /// let x = Revision::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
3832    /// let x = Revision::new().set_or_clear_create_time(None::<Timestamp>);
3833    /// ```
3834    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
3835    where
3836        T: std::convert::Into<wkt::Timestamp>,
3837    {
3838        self.create_time = v.map(|x| x.into());
3839        self
3840    }
3841
3842    /// Sets the value of [update_time][crate::model::Revision::update_time].
3843    ///
3844    /// # Example
3845    /// ```ignore,no_run
3846    /// # use google_cloud_config_v1::model::Revision;
3847    /// use wkt::Timestamp;
3848    /// let x = Revision::new().set_update_time(Timestamp::default()/* use setters */);
3849    /// ```
3850    pub fn set_update_time<T>(mut self, v: T) -> Self
3851    where
3852        T: std::convert::Into<wkt::Timestamp>,
3853    {
3854        self.update_time = std::option::Option::Some(v.into());
3855        self
3856    }
3857
3858    /// Sets or clears the value of [update_time][crate::model::Revision::update_time].
3859    ///
3860    /// # Example
3861    /// ```ignore,no_run
3862    /// # use google_cloud_config_v1::model::Revision;
3863    /// use wkt::Timestamp;
3864    /// let x = Revision::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
3865    /// let x = Revision::new().set_or_clear_update_time(None::<Timestamp>);
3866    /// ```
3867    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
3868    where
3869        T: std::convert::Into<wkt::Timestamp>,
3870    {
3871        self.update_time = v.map(|x| x.into());
3872        self
3873    }
3874
3875    /// Sets the value of [action][crate::model::Revision::action].
3876    ///
3877    /// # Example
3878    /// ```ignore,no_run
3879    /// # use google_cloud_config_v1::model::Revision;
3880    /// use google_cloud_config_v1::model::revision::Action;
3881    /// let x0 = Revision::new().set_action(Action::Create);
3882    /// let x1 = Revision::new().set_action(Action::Update);
3883    /// let x2 = Revision::new().set_action(Action::Delete);
3884    /// ```
3885    pub fn set_action<T: std::convert::Into<crate::model::revision::Action>>(
3886        mut self,
3887        v: T,
3888    ) -> Self {
3889        self.action = v.into();
3890        self
3891    }
3892
3893    /// Sets the value of [state][crate::model::Revision::state].
3894    ///
3895    /// # Example
3896    /// ```ignore,no_run
3897    /// # use google_cloud_config_v1::model::Revision;
3898    /// use google_cloud_config_v1::model::revision::State;
3899    /// let x0 = Revision::new().set_state(State::Applying);
3900    /// let x1 = Revision::new().set_state(State::Applied);
3901    /// let x2 = Revision::new().set_state(State::Failed);
3902    /// ```
3903    pub fn set_state<T: std::convert::Into<crate::model::revision::State>>(mut self, v: T) -> Self {
3904        self.state = v.into();
3905        self
3906    }
3907
3908    /// Sets the value of [apply_results][crate::model::Revision::apply_results].
3909    ///
3910    /// # Example
3911    /// ```ignore,no_run
3912    /// # use google_cloud_config_v1::model::Revision;
3913    /// use google_cloud_config_v1::model::ApplyResults;
3914    /// let x = Revision::new().set_apply_results(ApplyResults::default()/* use setters */);
3915    /// ```
3916    pub fn set_apply_results<T>(mut self, v: T) -> Self
3917    where
3918        T: std::convert::Into<crate::model::ApplyResults>,
3919    {
3920        self.apply_results = std::option::Option::Some(v.into());
3921        self
3922    }
3923
3924    /// Sets or clears the value of [apply_results][crate::model::Revision::apply_results].
3925    ///
3926    /// # Example
3927    /// ```ignore,no_run
3928    /// # use google_cloud_config_v1::model::Revision;
3929    /// use google_cloud_config_v1::model::ApplyResults;
3930    /// let x = Revision::new().set_or_clear_apply_results(Some(ApplyResults::default()/* use setters */));
3931    /// let x = Revision::new().set_or_clear_apply_results(None::<ApplyResults>);
3932    /// ```
3933    pub fn set_or_clear_apply_results<T>(mut self, v: std::option::Option<T>) -> Self
3934    where
3935        T: std::convert::Into<crate::model::ApplyResults>,
3936    {
3937        self.apply_results = v.map(|x| x.into());
3938        self
3939    }
3940
3941    /// Sets the value of [state_detail][crate::model::Revision::state_detail].
3942    ///
3943    /// # Example
3944    /// ```ignore,no_run
3945    /// # use google_cloud_config_v1::model::Revision;
3946    /// let x = Revision::new().set_state_detail("example");
3947    /// ```
3948    pub fn set_state_detail<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3949        self.state_detail = v.into();
3950        self
3951    }
3952
3953    /// Sets the value of [error_code][crate::model::Revision::error_code].
3954    ///
3955    /// # Example
3956    /// ```ignore,no_run
3957    /// # use google_cloud_config_v1::model::Revision;
3958    /// use google_cloud_config_v1::model::revision::ErrorCode;
3959    /// let x0 = Revision::new().set_error_code(ErrorCode::CloudBuildPermissionDenied);
3960    /// let x1 = Revision::new().set_error_code(ErrorCode::ApplyBuildApiFailed);
3961    /// let x2 = Revision::new().set_error_code(ErrorCode::ApplyBuildRunFailed);
3962    /// ```
3963    pub fn set_error_code<T: std::convert::Into<crate::model::revision::ErrorCode>>(
3964        mut self,
3965        v: T,
3966    ) -> Self {
3967        self.error_code = v.into();
3968        self
3969    }
3970
3971    /// Sets the value of [build][crate::model::Revision::build].
3972    ///
3973    /// # Example
3974    /// ```ignore,no_run
3975    /// # use google_cloud_config_v1::model::Revision;
3976    /// let x = Revision::new().set_build("example");
3977    /// ```
3978    pub fn set_build<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3979        self.build = v.into();
3980        self
3981    }
3982
3983    /// Sets the value of [logs][crate::model::Revision::logs].
3984    ///
3985    /// # Example
3986    /// ```ignore,no_run
3987    /// # use google_cloud_config_v1::model::Revision;
3988    /// let x = Revision::new().set_logs("example");
3989    /// ```
3990    pub fn set_logs<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3991        self.logs = v.into();
3992        self
3993    }
3994
3995    /// Sets the value of [tf_errors][crate::model::Revision::tf_errors].
3996    ///
3997    /// # Example
3998    /// ```ignore,no_run
3999    /// # use google_cloud_config_v1::model::Revision;
4000    /// use google_cloud_config_v1::model::TerraformError;
4001    /// let x = Revision::new()
4002    ///     .set_tf_errors([
4003    ///         TerraformError::default()/* use setters */,
4004    ///         TerraformError::default()/* use (different) setters */,
4005    ///     ]);
4006    /// ```
4007    pub fn set_tf_errors<T, V>(mut self, v: T) -> Self
4008    where
4009        T: std::iter::IntoIterator<Item = V>,
4010        V: std::convert::Into<crate::model::TerraformError>,
4011    {
4012        use std::iter::Iterator;
4013        self.tf_errors = v.into_iter().map(|i| i.into()).collect();
4014        self
4015    }
4016
4017    /// Sets the value of [error_logs][crate::model::Revision::error_logs].
4018    ///
4019    /// # Example
4020    /// ```ignore,no_run
4021    /// # use google_cloud_config_v1::model::Revision;
4022    /// let x = Revision::new().set_error_logs("example");
4023    /// ```
4024    pub fn set_error_logs<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4025        self.error_logs = v.into();
4026        self
4027    }
4028
4029    /// Sets the value of [service_account][crate::model::Revision::service_account].
4030    ///
4031    /// # Example
4032    /// ```ignore,no_run
4033    /// # use google_cloud_config_v1::model::Revision;
4034    /// let x = Revision::new().set_service_account("example");
4035    /// ```
4036    pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4037        self.service_account = v.into();
4038        self
4039    }
4040
4041    /// Sets the value of [import_existing_resources][crate::model::Revision::import_existing_resources].
4042    ///
4043    /// # Example
4044    /// ```ignore,no_run
4045    /// # use google_cloud_config_v1::model::Revision;
4046    /// let x = Revision::new().set_import_existing_resources(true);
4047    /// ```
4048    pub fn set_import_existing_resources<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4049        self.import_existing_resources = v.into();
4050        self
4051    }
4052
4053    /// Sets the value of [worker_pool][crate::model::Revision::worker_pool].
4054    ///
4055    /// # Example
4056    /// ```ignore,no_run
4057    /// # use google_cloud_config_v1::model::Revision;
4058    /// let x = Revision::new().set_worker_pool("example");
4059    /// ```
4060    pub fn set_worker_pool<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4061        self.worker_pool = v.into();
4062        self
4063    }
4064
4065    /// Sets the value of [tf_version_constraint][crate::model::Revision::tf_version_constraint].
4066    ///
4067    /// # Example
4068    /// ```ignore,no_run
4069    /// # use google_cloud_config_v1::model::Revision;
4070    /// let x = Revision::new().set_tf_version_constraint("example");
4071    /// ```
4072    pub fn set_tf_version_constraint<T: std::convert::Into<std::string::String>>(
4073        mut self,
4074        v: T,
4075    ) -> Self {
4076        self.tf_version_constraint = v.into();
4077        self
4078    }
4079
4080    /// Sets the value of [tf_version][crate::model::Revision::tf_version].
4081    ///
4082    /// # Example
4083    /// ```ignore,no_run
4084    /// # use google_cloud_config_v1::model::Revision;
4085    /// let x = Revision::new().set_tf_version("example");
4086    /// ```
4087    pub fn set_tf_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4088        self.tf_version = v.into();
4089        self
4090    }
4091
4092    /// Sets the value of [quota_validation_results][crate::model::Revision::quota_validation_results].
4093    ///
4094    /// # Example
4095    /// ```ignore,no_run
4096    /// # use google_cloud_config_v1::model::Revision;
4097    /// let x = Revision::new().set_quota_validation_results("example");
4098    /// ```
4099    pub fn set_quota_validation_results<T: std::convert::Into<std::string::String>>(
4100        mut self,
4101        v: T,
4102    ) -> Self {
4103        self.quota_validation_results = v.into();
4104        self
4105    }
4106
4107    /// Sets the value of [quota_validation][crate::model::Revision::quota_validation].
4108    ///
4109    /// # Example
4110    /// ```ignore,no_run
4111    /// # use google_cloud_config_v1::model::Revision;
4112    /// use google_cloud_config_v1::model::QuotaValidation;
4113    /// let x0 = Revision::new().set_quota_validation(QuotaValidation::Enabled);
4114    /// let x1 = Revision::new().set_quota_validation(QuotaValidation::Enforced);
4115    /// ```
4116    pub fn set_quota_validation<T: std::convert::Into<crate::model::QuotaValidation>>(
4117        mut self,
4118        v: T,
4119    ) -> Self {
4120        self.quota_validation = v.into();
4121        self
4122    }
4123
4124    /// Sets the value of [provider_config][crate::model::Revision::provider_config].
4125    ///
4126    /// # Example
4127    /// ```ignore,no_run
4128    /// # use google_cloud_config_v1::model::Revision;
4129    /// use google_cloud_config_v1::model::ProviderConfig;
4130    /// let x = Revision::new().set_provider_config(ProviderConfig::default()/* use setters */);
4131    /// ```
4132    pub fn set_provider_config<T>(mut self, v: T) -> Self
4133    where
4134        T: std::convert::Into<crate::model::ProviderConfig>,
4135    {
4136        self.provider_config = std::option::Option::Some(v.into());
4137        self
4138    }
4139
4140    /// Sets or clears the value of [provider_config][crate::model::Revision::provider_config].
4141    ///
4142    /// # Example
4143    /// ```ignore,no_run
4144    /// # use google_cloud_config_v1::model::Revision;
4145    /// use google_cloud_config_v1::model::ProviderConfig;
4146    /// let x = Revision::new().set_or_clear_provider_config(Some(ProviderConfig::default()/* use setters */));
4147    /// let x = Revision::new().set_or_clear_provider_config(None::<ProviderConfig>);
4148    /// ```
4149    pub fn set_or_clear_provider_config<T>(mut self, v: std::option::Option<T>) -> Self
4150    where
4151        T: std::convert::Into<crate::model::ProviderConfig>,
4152    {
4153        self.provider_config = v.map(|x| x.into());
4154        self
4155    }
4156
4157    /// Sets the value of [blueprint][crate::model::Revision::blueprint].
4158    ///
4159    /// Note that all the setters affecting `blueprint` are mutually
4160    /// exclusive.
4161    ///
4162    /// # Example
4163    /// ```ignore,no_run
4164    /// # use google_cloud_config_v1::model::Revision;
4165    /// use google_cloud_config_v1::model::TerraformBlueprint;
4166    /// let x = Revision::new().set_blueprint(Some(
4167    ///     google_cloud_config_v1::model::revision::Blueprint::TerraformBlueprint(TerraformBlueprint::default().into())));
4168    /// ```
4169    pub fn set_blueprint<
4170        T: std::convert::Into<std::option::Option<crate::model::revision::Blueprint>>,
4171    >(
4172        mut self,
4173        v: T,
4174    ) -> Self {
4175        self.blueprint = v.into();
4176        self
4177    }
4178
4179    /// The value of [blueprint][crate::model::Revision::blueprint]
4180    /// if it holds a `TerraformBlueprint`, `None` if the field is not set or
4181    /// holds a different branch.
4182    pub fn terraform_blueprint(
4183        &self,
4184    ) -> std::option::Option<&std::boxed::Box<crate::model::TerraformBlueprint>> {
4185        #[allow(unreachable_patterns)]
4186        self.blueprint.as_ref().and_then(|v| match v {
4187            crate::model::revision::Blueprint::TerraformBlueprint(v) => {
4188                std::option::Option::Some(v)
4189            }
4190            _ => std::option::Option::None,
4191        })
4192    }
4193
4194    /// Sets the value of [blueprint][crate::model::Revision::blueprint]
4195    /// to hold a `TerraformBlueprint`.
4196    ///
4197    /// Note that all the setters affecting `blueprint` are
4198    /// mutually exclusive.
4199    ///
4200    /// # Example
4201    /// ```ignore,no_run
4202    /// # use google_cloud_config_v1::model::Revision;
4203    /// use google_cloud_config_v1::model::TerraformBlueprint;
4204    /// let x = Revision::new().set_terraform_blueprint(TerraformBlueprint::default()/* use setters */);
4205    /// assert!(x.terraform_blueprint().is_some());
4206    /// ```
4207    pub fn set_terraform_blueprint<
4208        T: std::convert::Into<std::boxed::Box<crate::model::TerraformBlueprint>>,
4209    >(
4210        mut self,
4211        v: T,
4212    ) -> Self {
4213        self.blueprint = std::option::Option::Some(
4214            crate::model::revision::Blueprint::TerraformBlueprint(v.into()),
4215        );
4216        self
4217    }
4218}
4219
4220impl wkt::message::Message for Revision {
4221    fn typename() -> &'static str {
4222        "type.googleapis.com/google.cloud.config.v1.Revision"
4223    }
4224}
4225
4226/// Defines additional types related to [Revision].
4227pub mod revision {
4228    #[allow(unused_imports)]
4229    use super::*;
4230
4231    /// Actions that generate a revision.
4232    ///
4233    /// # Working with unknown values
4234    ///
4235    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4236    /// additional enum variants at any time. Adding new variants is not considered
4237    /// a breaking change. Applications should write their code in anticipation of:
4238    ///
4239    /// - New values appearing in future releases of the client library, **and**
4240    /// - New values received dynamically, without application changes.
4241    ///
4242    /// Please consult the [Working with enums] section in the user guide for some
4243    /// guidelines.
4244    ///
4245    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
4246    #[derive(Clone, Debug, PartialEq)]
4247    #[non_exhaustive]
4248    pub enum Action {
4249        /// The default value. This value is used if the action is omitted.
4250        Unspecified,
4251        /// The revision was generated by creating a deployment.
4252        Create,
4253        /// The revision was generated by updating a deployment.
4254        Update,
4255        /// The revision was deleted.
4256        Delete,
4257        /// If set, the enum was initialized with an unknown value.
4258        ///
4259        /// Applications can examine the value using [Action::value] or
4260        /// [Action::name].
4261        UnknownValue(action::UnknownValue),
4262    }
4263
4264    #[doc(hidden)]
4265    pub mod action {
4266        #[allow(unused_imports)]
4267        use super::*;
4268        #[derive(Clone, Debug, PartialEq)]
4269        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4270    }
4271
4272    impl Action {
4273        /// Gets the enum value.
4274        ///
4275        /// Returns `None` if the enum contains an unknown value deserialized from
4276        /// the string representation of enums.
4277        pub fn value(&self) -> std::option::Option<i32> {
4278            match self {
4279                Self::Unspecified => std::option::Option::Some(0),
4280                Self::Create => std::option::Option::Some(1),
4281                Self::Update => std::option::Option::Some(2),
4282                Self::Delete => std::option::Option::Some(3),
4283                Self::UnknownValue(u) => u.0.value(),
4284            }
4285        }
4286
4287        /// Gets the enum value as a string.
4288        ///
4289        /// Returns `None` if the enum contains an unknown value deserialized from
4290        /// the integer representation of enums.
4291        pub fn name(&self) -> std::option::Option<&str> {
4292            match self {
4293                Self::Unspecified => std::option::Option::Some("ACTION_UNSPECIFIED"),
4294                Self::Create => std::option::Option::Some("CREATE"),
4295                Self::Update => std::option::Option::Some("UPDATE"),
4296                Self::Delete => std::option::Option::Some("DELETE"),
4297                Self::UnknownValue(u) => u.0.name(),
4298            }
4299        }
4300    }
4301
4302    impl std::default::Default for Action {
4303        fn default() -> Self {
4304            use std::convert::From;
4305            Self::from(0)
4306        }
4307    }
4308
4309    impl std::fmt::Display for Action {
4310        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4311            wkt::internal::display_enum(f, self.name(), self.value())
4312        }
4313    }
4314
4315    impl std::convert::From<i32> for Action {
4316        fn from(value: i32) -> Self {
4317            match value {
4318                0 => Self::Unspecified,
4319                1 => Self::Create,
4320                2 => Self::Update,
4321                3 => Self::Delete,
4322                _ => Self::UnknownValue(action::UnknownValue(
4323                    wkt::internal::UnknownEnumValue::Integer(value),
4324                )),
4325            }
4326        }
4327    }
4328
4329    impl std::convert::From<&str> for Action {
4330        fn from(value: &str) -> Self {
4331            use std::string::ToString;
4332            match value {
4333                "ACTION_UNSPECIFIED" => Self::Unspecified,
4334                "CREATE" => Self::Create,
4335                "UPDATE" => Self::Update,
4336                "DELETE" => Self::Delete,
4337                _ => Self::UnknownValue(action::UnknownValue(
4338                    wkt::internal::UnknownEnumValue::String(value.to_string()),
4339                )),
4340            }
4341        }
4342    }
4343
4344    impl serde::ser::Serialize for Action {
4345        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4346        where
4347            S: serde::Serializer,
4348        {
4349            match self {
4350                Self::Unspecified => serializer.serialize_i32(0),
4351                Self::Create => serializer.serialize_i32(1),
4352                Self::Update => serializer.serialize_i32(2),
4353                Self::Delete => serializer.serialize_i32(3),
4354                Self::UnknownValue(u) => u.0.serialize(serializer),
4355            }
4356        }
4357    }
4358
4359    impl<'de> serde::de::Deserialize<'de> for Action {
4360        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4361        where
4362            D: serde::Deserializer<'de>,
4363        {
4364            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Action>::new(
4365                ".google.cloud.config.v1.Revision.Action",
4366            ))
4367        }
4368    }
4369
4370    /// Possible states of a revision.
4371    ///
4372    /// # Working with unknown values
4373    ///
4374    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4375    /// additional enum variants at any time. Adding new variants is not considered
4376    /// a breaking change. Applications should write their code in anticipation of:
4377    ///
4378    /// - New values appearing in future releases of the client library, **and**
4379    /// - New values received dynamically, without application changes.
4380    ///
4381    /// Please consult the [Working with enums] section in the user guide for some
4382    /// guidelines.
4383    ///
4384    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
4385    #[derive(Clone, Debug, PartialEq)]
4386    #[non_exhaustive]
4387    pub enum State {
4388        /// The default value. This value is used if the state is omitted.
4389        Unspecified,
4390        /// The revision is being applied.
4391        Applying,
4392        /// The revision was applied successfully.
4393        Applied,
4394        /// The revision could not be applied successfully.
4395        Failed,
4396        /// If set, the enum was initialized with an unknown value.
4397        ///
4398        /// Applications can examine the value using [State::value] or
4399        /// [State::name].
4400        UnknownValue(state::UnknownValue),
4401    }
4402
4403    #[doc(hidden)]
4404    pub mod state {
4405        #[allow(unused_imports)]
4406        use super::*;
4407        #[derive(Clone, Debug, PartialEq)]
4408        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4409    }
4410
4411    impl State {
4412        /// Gets the enum value.
4413        ///
4414        /// Returns `None` if the enum contains an unknown value deserialized from
4415        /// the string representation of enums.
4416        pub fn value(&self) -> std::option::Option<i32> {
4417            match self {
4418                Self::Unspecified => std::option::Option::Some(0),
4419                Self::Applying => std::option::Option::Some(1),
4420                Self::Applied => std::option::Option::Some(2),
4421                Self::Failed => std::option::Option::Some(3),
4422                Self::UnknownValue(u) => u.0.value(),
4423            }
4424        }
4425
4426        /// Gets the enum value as a string.
4427        ///
4428        /// Returns `None` if the enum contains an unknown value deserialized from
4429        /// the integer representation of enums.
4430        pub fn name(&self) -> std::option::Option<&str> {
4431            match self {
4432                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
4433                Self::Applying => std::option::Option::Some("APPLYING"),
4434                Self::Applied => std::option::Option::Some("APPLIED"),
4435                Self::Failed => std::option::Option::Some("FAILED"),
4436                Self::UnknownValue(u) => u.0.name(),
4437            }
4438        }
4439    }
4440
4441    impl std::default::Default for State {
4442        fn default() -> Self {
4443            use std::convert::From;
4444            Self::from(0)
4445        }
4446    }
4447
4448    impl std::fmt::Display for State {
4449        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4450            wkt::internal::display_enum(f, self.name(), self.value())
4451        }
4452    }
4453
4454    impl std::convert::From<i32> for State {
4455        fn from(value: i32) -> Self {
4456            match value {
4457                0 => Self::Unspecified,
4458                1 => Self::Applying,
4459                2 => Self::Applied,
4460                3 => Self::Failed,
4461                _ => Self::UnknownValue(state::UnknownValue(
4462                    wkt::internal::UnknownEnumValue::Integer(value),
4463                )),
4464            }
4465        }
4466    }
4467
4468    impl std::convert::From<&str> for State {
4469        fn from(value: &str) -> Self {
4470            use std::string::ToString;
4471            match value {
4472                "STATE_UNSPECIFIED" => Self::Unspecified,
4473                "APPLYING" => Self::Applying,
4474                "APPLIED" => Self::Applied,
4475                "FAILED" => Self::Failed,
4476                _ => Self::UnknownValue(state::UnknownValue(
4477                    wkt::internal::UnknownEnumValue::String(value.to_string()),
4478                )),
4479            }
4480        }
4481    }
4482
4483    impl serde::ser::Serialize for State {
4484        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4485        where
4486            S: serde::Serializer,
4487        {
4488            match self {
4489                Self::Unspecified => serializer.serialize_i32(0),
4490                Self::Applying => serializer.serialize_i32(1),
4491                Self::Applied => serializer.serialize_i32(2),
4492                Self::Failed => serializer.serialize_i32(3),
4493                Self::UnknownValue(u) => u.0.serialize(serializer),
4494            }
4495        }
4496    }
4497
4498    impl<'de> serde::de::Deserialize<'de> for State {
4499        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4500        where
4501            D: serde::Deserializer<'de>,
4502        {
4503            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
4504                ".google.cloud.config.v1.Revision.State",
4505            ))
4506        }
4507    }
4508
4509    /// Possible errors if Revision could not be created or updated successfully.
4510    ///
4511    /// # Working with unknown values
4512    ///
4513    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4514    /// additional enum variants at any time. Adding new variants is not considered
4515    /// a breaking change. Applications should write their code in anticipation of:
4516    ///
4517    /// - New values appearing in future releases of the client library, **and**
4518    /// - New values received dynamically, without application changes.
4519    ///
4520    /// Please consult the [Working with enums] section in the user guide for some
4521    /// guidelines.
4522    ///
4523    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
4524    #[derive(Clone, Debug, PartialEq)]
4525    #[non_exhaustive]
4526    pub enum ErrorCode {
4527        /// No error code was specified.
4528        Unspecified,
4529        /// Cloud Build failed due to a permission issue.
4530        CloudBuildPermissionDenied,
4531        /// Cloud Build job associated with creating or updating a deployment could
4532        /// not be started.
4533        ApplyBuildApiFailed,
4534        /// Cloud Build job associated with creating or updating a deployment was
4535        /// started but failed.
4536        ApplyBuildRunFailed,
4537        /// quota validation failed for one or more resources in terraform
4538        /// configuration files.
4539        QuotaValidationFailed,
4540        /// Failed to import values from an external source.
4541        ExternalValueSourceImportFailed,
4542        /// If set, the enum was initialized with an unknown value.
4543        ///
4544        /// Applications can examine the value using [ErrorCode::value] or
4545        /// [ErrorCode::name].
4546        UnknownValue(error_code::UnknownValue),
4547    }
4548
4549    #[doc(hidden)]
4550    pub mod error_code {
4551        #[allow(unused_imports)]
4552        use super::*;
4553        #[derive(Clone, Debug, PartialEq)]
4554        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4555    }
4556
4557    impl ErrorCode {
4558        /// Gets the enum value.
4559        ///
4560        /// Returns `None` if the enum contains an unknown value deserialized from
4561        /// the string representation of enums.
4562        pub fn value(&self) -> std::option::Option<i32> {
4563            match self {
4564                Self::Unspecified => std::option::Option::Some(0),
4565                Self::CloudBuildPermissionDenied => std::option::Option::Some(1),
4566                Self::ApplyBuildApiFailed => std::option::Option::Some(4),
4567                Self::ApplyBuildRunFailed => std::option::Option::Some(5),
4568                Self::QuotaValidationFailed => std::option::Option::Some(7),
4569                Self::ExternalValueSourceImportFailed => std::option::Option::Some(8),
4570                Self::UnknownValue(u) => u.0.value(),
4571            }
4572        }
4573
4574        /// Gets the enum value as a string.
4575        ///
4576        /// Returns `None` if the enum contains an unknown value deserialized from
4577        /// the integer representation of enums.
4578        pub fn name(&self) -> std::option::Option<&str> {
4579            match self {
4580                Self::Unspecified => std::option::Option::Some("ERROR_CODE_UNSPECIFIED"),
4581                Self::CloudBuildPermissionDenied => {
4582                    std::option::Option::Some("CLOUD_BUILD_PERMISSION_DENIED")
4583                }
4584                Self::ApplyBuildApiFailed => std::option::Option::Some("APPLY_BUILD_API_FAILED"),
4585                Self::ApplyBuildRunFailed => std::option::Option::Some("APPLY_BUILD_RUN_FAILED"),
4586                Self::QuotaValidationFailed => std::option::Option::Some("QUOTA_VALIDATION_FAILED"),
4587                Self::ExternalValueSourceImportFailed => {
4588                    std::option::Option::Some("EXTERNAL_VALUE_SOURCE_IMPORT_FAILED")
4589                }
4590                Self::UnknownValue(u) => u.0.name(),
4591            }
4592        }
4593    }
4594
4595    impl std::default::Default for ErrorCode {
4596        fn default() -> Self {
4597            use std::convert::From;
4598            Self::from(0)
4599        }
4600    }
4601
4602    impl std::fmt::Display for ErrorCode {
4603        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4604            wkt::internal::display_enum(f, self.name(), self.value())
4605        }
4606    }
4607
4608    impl std::convert::From<i32> for ErrorCode {
4609        fn from(value: i32) -> Self {
4610            match value {
4611                0 => Self::Unspecified,
4612                1 => Self::CloudBuildPermissionDenied,
4613                4 => Self::ApplyBuildApiFailed,
4614                5 => Self::ApplyBuildRunFailed,
4615                7 => Self::QuotaValidationFailed,
4616                8 => Self::ExternalValueSourceImportFailed,
4617                _ => Self::UnknownValue(error_code::UnknownValue(
4618                    wkt::internal::UnknownEnumValue::Integer(value),
4619                )),
4620            }
4621        }
4622    }
4623
4624    impl std::convert::From<&str> for ErrorCode {
4625        fn from(value: &str) -> Self {
4626            use std::string::ToString;
4627            match value {
4628                "ERROR_CODE_UNSPECIFIED" => Self::Unspecified,
4629                "CLOUD_BUILD_PERMISSION_DENIED" => Self::CloudBuildPermissionDenied,
4630                "APPLY_BUILD_API_FAILED" => Self::ApplyBuildApiFailed,
4631                "APPLY_BUILD_RUN_FAILED" => Self::ApplyBuildRunFailed,
4632                "QUOTA_VALIDATION_FAILED" => Self::QuotaValidationFailed,
4633                "EXTERNAL_VALUE_SOURCE_IMPORT_FAILED" => Self::ExternalValueSourceImportFailed,
4634                _ => Self::UnknownValue(error_code::UnknownValue(
4635                    wkt::internal::UnknownEnumValue::String(value.to_string()),
4636                )),
4637            }
4638        }
4639    }
4640
4641    impl serde::ser::Serialize for ErrorCode {
4642        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4643        where
4644            S: serde::Serializer,
4645        {
4646            match self {
4647                Self::Unspecified => serializer.serialize_i32(0),
4648                Self::CloudBuildPermissionDenied => serializer.serialize_i32(1),
4649                Self::ApplyBuildApiFailed => serializer.serialize_i32(4),
4650                Self::ApplyBuildRunFailed => serializer.serialize_i32(5),
4651                Self::QuotaValidationFailed => serializer.serialize_i32(7),
4652                Self::ExternalValueSourceImportFailed => serializer.serialize_i32(8),
4653                Self::UnknownValue(u) => u.0.serialize(serializer),
4654            }
4655        }
4656    }
4657
4658    impl<'de> serde::de::Deserialize<'de> for ErrorCode {
4659        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4660        where
4661            D: serde::Deserializer<'de>,
4662        {
4663            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ErrorCode>::new(
4664                ".google.cloud.config.v1.Revision.ErrorCode",
4665            ))
4666        }
4667    }
4668
4669    /// Blueprint that was deployed.
4670    #[derive(Clone, Debug, PartialEq)]
4671    #[non_exhaustive]
4672    pub enum Blueprint {
4673        /// Output only. A blueprint described using Terraform's HashiCorp
4674        /// Configuration Language as a root module.
4675        TerraformBlueprint(std::boxed::Box<crate::model::TerraformBlueprint>),
4676    }
4677}
4678
4679/// Errors encountered during actuation using Terraform
4680#[derive(Clone, Default, PartialEq)]
4681#[non_exhaustive]
4682pub struct TerraformError {
4683    /// Address of the resource associated with the error,
4684    /// e.g. `google_compute_network.vpc_network`.
4685    pub resource_address: std::string::String,
4686
4687    /// HTTP response code returned from Google Cloud Platform APIs when Terraform
4688    /// fails to provision the resource. If unset or 0, no HTTP response code was
4689    /// returned by Terraform.
4690    pub http_response_code: i32,
4691
4692    /// A human-readable error description.
4693    pub error_description: std::string::String,
4694
4695    /// Output only. Original error response from underlying Google API, if
4696    /// available.
4697    pub error: std::option::Option<google_cloud_rpc::model::Status>,
4698
4699    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4700}
4701
4702impl TerraformError {
4703    /// Creates a new default instance.
4704    pub fn new() -> Self {
4705        std::default::Default::default()
4706    }
4707
4708    /// Sets the value of [resource_address][crate::model::TerraformError::resource_address].
4709    ///
4710    /// # Example
4711    /// ```ignore,no_run
4712    /// # use google_cloud_config_v1::model::TerraformError;
4713    /// let x = TerraformError::new().set_resource_address("example");
4714    /// ```
4715    pub fn set_resource_address<T: std::convert::Into<std::string::String>>(
4716        mut self,
4717        v: T,
4718    ) -> Self {
4719        self.resource_address = v.into();
4720        self
4721    }
4722
4723    /// Sets the value of [http_response_code][crate::model::TerraformError::http_response_code].
4724    ///
4725    /// # Example
4726    /// ```ignore,no_run
4727    /// # use google_cloud_config_v1::model::TerraformError;
4728    /// let x = TerraformError::new().set_http_response_code(42);
4729    /// ```
4730    pub fn set_http_response_code<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4731        self.http_response_code = v.into();
4732        self
4733    }
4734
4735    /// Sets the value of [error_description][crate::model::TerraformError::error_description].
4736    ///
4737    /// # Example
4738    /// ```ignore,no_run
4739    /// # use google_cloud_config_v1::model::TerraformError;
4740    /// let x = TerraformError::new().set_error_description("example");
4741    /// ```
4742    pub fn set_error_description<T: std::convert::Into<std::string::String>>(
4743        mut self,
4744        v: T,
4745    ) -> Self {
4746        self.error_description = v.into();
4747        self
4748    }
4749
4750    /// Sets the value of [error][crate::model::TerraformError::error].
4751    ///
4752    /// # Example
4753    /// ```ignore,no_run
4754    /// # use google_cloud_config_v1::model::TerraformError;
4755    /// use google_cloud_rpc::model::Status;
4756    /// let x = TerraformError::new().set_error(Status::default()/* use setters */);
4757    /// ```
4758    pub fn set_error<T>(mut self, v: T) -> Self
4759    where
4760        T: std::convert::Into<google_cloud_rpc::model::Status>,
4761    {
4762        self.error = std::option::Option::Some(v.into());
4763        self
4764    }
4765
4766    /// Sets or clears the value of [error][crate::model::TerraformError::error].
4767    ///
4768    /// # Example
4769    /// ```ignore,no_run
4770    /// # use google_cloud_config_v1::model::TerraformError;
4771    /// use google_cloud_rpc::model::Status;
4772    /// let x = TerraformError::new().set_or_clear_error(Some(Status::default()/* use setters */));
4773    /// let x = TerraformError::new().set_or_clear_error(None::<Status>);
4774    /// ```
4775    pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
4776    where
4777        T: std::convert::Into<google_cloud_rpc::model::Status>,
4778    {
4779        self.error = v.map(|x| x.into());
4780        self
4781    }
4782}
4783
4784impl wkt::message::Message for TerraformError {
4785    fn typename() -> &'static str {
4786        "type.googleapis.com/google.cloud.config.v1.TerraformError"
4787    }
4788}
4789
4790/// A set of files in a Git repository.
4791#[derive(Clone, Default, PartialEq)]
4792#[non_exhaustive]
4793pub struct GitSource {
4794    /// Optional. Repository URL.
4795    /// Example: '<https://github.com/kubernetes/examples.git>'
4796    pub repo: std::option::Option<std::string::String>,
4797
4798    /// Optional. Subdirectory inside the repository.
4799    /// Example: 'staging/my-package'
4800    pub directory: std::option::Option<std::string::String>,
4801
4802    /// Optional. Git reference (e.g. branch or tag).
4803    pub r#ref: std::option::Option<std::string::String>,
4804
4805    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4806}
4807
4808impl GitSource {
4809    /// Creates a new default instance.
4810    pub fn new() -> Self {
4811        std::default::Default::default()
4812    }
4813
4814    /// Sets the value of [repo][crate::model::GitSource::repo].
4815    ///
4816    /// # Example
4817    /// ```ignore,no_run
4818    /// # use google_cloud_config_v1::model::GitSource;
4819    /// let x = GitSource::new().set_repo("example");
4820    /// ```
4821    pub fn set_repo<T>(mut self, v: T) -> Self
4822    where
4823        T: std::convert::Into<std::string::String>,
4824    {
4825        self.repo = std::option::Option::Some(v.into());
4826        self
4827    }
4828
4829    /// Sets or clears the value of [repo][crate::model::GitSource::repo].
4830    ///
4831    /// # Example
4832    /// ```ignore,no_run
4833    /// # use google_cloud_config_v1::model::GitSource;
4834    /// let x = GitSource::new().set_or_clear_repo(Some("example"));
4835    /// let x = GitSource::new().set_or_clear_repo(None::<String>);
4836    /// ```
4837    pub fn set_or_clear_repo<T>(mut self, v: std::option::Option<T>) -> Self
4838    where
4839        T: std::convert::Into<std::string::String>,
4840    {
4841        self.repo = v.map(|x| x.into());
4842        self
4843    }
4844
4845    /// Sets the value of [directory][crate::model::GitSource::directory].
4846    ///
4847    /// # Example
4848    /// ```ignore,no_run
4849    /// # use google_cloud_config_v1::model::GitSource;
4850    /// let x = GitSource::new().set_directory("example");
4851    /// ```
4852    pub fn set_directory<T>(mut self, v: T) -> Self
4853    where
4854        T: std::convert::Into<std::string::String>,
4855    {
4856        self.directory = std::option::Option::Some(v.into());
4857        self
4858    }
4859
4860    /// Sets or clears the value of [directory][crate::model::GitSource::directory].
4861    ///
4862    /// # Example
4863    /// ```ignore,no_run
4864    /// # use google_cloud_config_v1::model::GitSource;
4865    /// let x = GitSource::new().set_or_clear_directory(Some("example"));
4866    /// let x = GitSource::new().set_or_clear_directory(None::<String>);
4867    /// ```
4868    pub fn set_or_clear_directory<T>(mut self, v: std::option::Option<T>) -> Self
4869    where
4870        T: std::convert::Into<std::string::String>,
4871    {
4872        self.directory = v.map(|x| x.into());
4873        self
4874    }
4875
4876    /// Sets the value of [r#ref][crate::model::GitSource::ref].
4877    ///
4878    /// # Example
4879    /// ```ignore,no_run
4880    /// # use google_cloud_config_v1::model::GitSource;
4881    /// let x = GitSource::new().set_ref("example");
4882    /// ```
4883    pub fn set_ref<T>(mut self, v: T) -> Self
4884    where
4885        T: std::convert::Into<std::string::String>,
4886    {
4887        self.r#ref = std::option::Option::Some(v.into());
4888        self
4889    }
4890
4891    /// Sets or clears the value of [r#ref][crate::model::GitSource::ref].
4892    ///
4893    /// # Example
4894    /// ```ignore,no_run
4895    /// # use google_cloud_config_v1::model::GitSource;
4896    /// let x = GitSource::new().set_or_clear_ref(Some("example"));
4897    /// let x = GitSource::new().set_or_clear_ref(None::<String>);
4898    /// ```
4899    pub fn set_or_clear_ref<T>(mut self, v: std::option::Option<T>) -> Self
4900    where
4901        T: std::convert::Into<std::string::String>,
4902    {
4903        self.r#ref = v.map(|x| x.into());
4904        self
4905    }
4906}
4907
4908impl wkt::message::Message for GitSource {
4909    fn typename() -> &'static str {
4910        "type.googleapis.com/google.cloud.config.v1.GitSource"
4911    }
4912}
4913
4914/// Ephemeral metadata content describing the state of a deployment operation.
4915#[derive(Clone, Default, PartialEq)]
4916#[non_exhaustive]
4917pub struct DeploymentOperationMetadata {
4918    /// The current step the deployment operation is running.
4919    pub step: crate::model::deployment_operation_metadata::DeploymentStep,
4920
4921    /// Outputs and artifacts from applying a deployment.
4922    pub apply_results: std::option::Option<crate::model::ApplyResults>,
4923
4924    /// Output only. Cloud Build instance UUID associated with this operation.
4925    pub build: std::string::String,
4926
4927    /// Output only. Location of Deployment operations logs in
4928    /// `gs://{bucket}/{object}` format.
4929    pub logs: std::string::String,
4930
4931    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4932}
4933
4934impl DeploymentOperationMetadata {
4935    /// Creates a new default instance.
4936    pub fn new() -> Self {
4937        std::default::Default::default()
4938    }
4939
4940    /// Sets the value of [step][crate::model::DeploymentOperationMetadata::step].
4941    ///
4942    /// # Example
4943    /// ```ignore,no_run
4944    /// # use google_cloud_config_v1::model::DeploymentOperationMetadata;
4945    /// use google_cloud_config_v1::model::deployment_operation_metadata::DeploymentStep;
4946    /// let x0 = DeploymentOperationMetadata::new().set_step(DeploymentStep::PreparingStorageBucket);
4947    /// let x1 = DeploymentOperationMetadata::new().set_step(DeploymentStep::DownloadingBlueprint);
4948    /// let x2 = DeploymentOperationMetadata::new().set_step(DeploymentStep::RunningTfInit);
4949    /// ```
4950    pub fn set_step<
4951        T: std::convert::Into<crate::model::deployment_operation_metadata::DeploymentStep>,
4952    >(
4953        mut self,
4954        v: T,
4955    ) -> Self {
4956        self.step = v.into();
4957        self
4958    }
4959
4960    /// Sets the value of [apply_results][crate::model::DeploymentOperationMetadata::apply_results].
4961    ///
4962    /// # Example
4963    /// ```ignore,no_run
4964    /// # use google_cloud_config_v1::model::DeploymentOperationMetadata;
4965    /// use google_cloud_config_v1::model::ApplyResults;
4966    /// let x = DeploymentOperationMetadata::new().set_apply_results(ApplyResults::default()/* use setters */);
4967    /// ```
4968    pub fn set_apply_results<T>(mut self, v: T) -> Self
4969    where
4970        T: std::convert::Into<crate::model::ApplyResults>,
4971    {
4972        self.apply_results = std::option::Option::Some(v.into());
4973        self
4974    }
4975
4976    /// Sets or clears the value of [apply_results][crate::model::DeploymentOperationMetadata::apply_results].
4977    ///
4978    /// # Example
4979    /// ```ignore,no_run
4980    /// # use google_cloud_config_v1::model::DeploymentOperationMetadata;
4981    /// use google_cloud_config_v1::model::ApplyResults;
4982    /// let x = DeploymentOperationMetadata::new().set_or_clear_apply_results(Some(ApplyResults::default()/* use setters */));
4983    /// let x = DeploymentOperationMetadata::new().set_or_clear_apply_results(None::<ApplyResults>);
4984    /// ```
4985    pub fn set_or_clear_apply_results<T>(mut self, v: std::option::Option<T>) -> Self
4986    where
4987        T: std::convert::Into<crate::model::ApplyResults>,
4988    {
4989        self.apply_results = v.map(|x| x.into());
4990        self
4991    }
4992
4993    /// Sets the value of [build][crate::model::DeploymentOperationMetadata::build].
4994    ///
4995    /// # Example
4996    /// ```ignore,no_run
4997    /// # use google_cloud_config_v1::model::DeploymentOperationMetadata;
4998    /// let x = DeploymentOperationMetadata::new().set_build("example");
4999    /// ```
5000    pub fn set_build<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5001        self.build = v.into();
5002        self
5003    }
5004
5005    /// Sets the value of [logs][crate::model::DeploymentOperationMetadata::logs].
5006    ///
5007    /// # Example
5008    /// ```ignore,no_run
5009    /// # use google_cloud_config_v1::model::DeploymentOperationMetadata;
5010    /// let x = DeploymentOperationMetadata::new().set_logs("example");
5011    /// ```
5012    pub fn set_logs<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5013        self.logs = v.into();
5014        self
5015    }
5016}
5017
5018impl wkt::message::Message for DeploymentOperationMetadata {
5019    fn typename() -> &'static str {
5020        "type.googleapis.com/google.cloud.config.v1.DeploymentOperationMetadata"
5021    }
5022}
5023
5024/// Defines additional types related to [DeploymentOperationMetadata].
5025pub mod deployment_operation_metadata {
5026    #[allow(unused_imports)]
5027    use super::*;
5028
5029    /// The possible steps a deployment may be running.
5030    ///
5031    /// # Working with unknown values
5032    ///
5033    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5034    /// additional enum variants at any time. Adding new variants is not considered
5035    /// a breaking change. Applications should write their code in anticipation of:
5036    ///
5037    /// - New values appearing in future releases of the client library, **and**
5038    /// - New values received dynamically, without application changes.
5039    ///
5040    /// Please consult the [Working with enums] section in the user guide for some
5041    /// guidelines.
5042    ///
5043    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
5044    #[derive(Clone, Debug, PartialEq)]
5045    #[non_exhaustive]
5046    pub enum DeploymentStep {
5047        /// Unspecified deployment step
5048        Unspecified,
5049        /// Infra Manager is creating a Google Cloud Storage bucket to store
5050        /// artifacts and metadata about the deployment and revision
5051        PreparingStorageBucket,
5052        /// Downloading the blueprint onto the Google Cloud Storage bucket
5053        DownloadingBlueprint,
5054        /// Initializing Terraform using `terraform init`
5055        RunningTfInit,
5056        /// Running `terraform plan`
5057        RunningTfPlan,
5058        /// Actuating resources using Terraform using `terraform apply`
5059        RunningTfApply,
5060        /// Destroying resources using Terraform using `terraform destroy`
5061        RunningTfDestroy,
5062        /// Validating the uploaded TF state file when unlocking a deployment
5063        RunningTfValidate,
5064        /// Unlocking a deployment
5065        UnlockingDeployment,
5066        /// Operation was successful
5067        Succeeded,
5068        /// Operation failed
5069        Failed,
5070        /// Validating the provided repository.
5071        ValidatingRepository,
5072        /// Running quota validation
5073        RunningQuotaValidation,
5074        /// If set, the enum was initialized with an unknown value.
5075        ///
5076        /// Applications can examine the value using [DeploymentStep::value] or
5077        /// [DeploymentStep::name].
5078        UnknownValue(deployment_step::UnknownValue),
5079    }
5080
5081    #[doc(hidden)]
5082    pub mod deployment_step {
5083        #[allow(unused_imports)]
5084        use super::*;
5085        #[derive(Clone, Debug, PartialEq)]
5086        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5087    }
5088
5089    impl DeploymentStep {
5090        /// Gets the enum value.
5091        ///
5092        /// Returns `None` if the enum contains an unknown value deserialized from
5093        /// the string representation of enums.
5094        pub fn value(&self) -> std::option::Option<i32> {
5095            match self {
5096                Self::Unspecified => std::option::Option::Some(0),
5097                Self::PreparingStorageBucket => std::option::Option::Some(1),
5098                Self::DownloadingBlueprint => std::option::Option::Some(2),
5099                Self::RunningTfInit => std::option::Option::Some(3),
5100                Self::RunningTfPlan => std::option::Option::Some(4),
5101                Self::RunningTfApply => std::option::Option::Some(5),
5102                Self::RunningTfDestroy => std::option::Option::Some(6),
5103                Self::RunningTfValidate => std::option::Option::Some(7),
5104                Self::UnlockingDeployment => std::option::Option::Some(8),
5105                Self::Succeeded => std::option::Option::Some(9),
5106                Self::Failed => std::option::Option::Some(10),
5107                Self::ValidatingRepository => std::option::Option::Some(11),
5108                Self::RunningQuotaValidation => std::option::Option::Some(12),
5109                Self::UnknownValue(u) => u.0.value(),
5110            }
5111        }
5112
5113        /// Gets the enum value as a string.
5114        ///
5115        /// Returns `None` if the enum contains an unknown value deserialized from
5116        /// the integer representation of enums.
5117        pub fn name(&self) -> std::option::Option<&str> {
5118            match self {
5119                Self::Unspecified => std::option::Option::Some("DEPLOYMENT_STEP_UNSPECIFIED"),
5120                Self::PreparingStorageBucket => {
5121                    std::option::Option::Some("PREPARING_STORAGE_BUCKET")
5122                }
5123                Self::DownloadingBlueprint => std::option::Option::Some("DOWNLOADING_BLUEPRINT"),
5124                Self::RunningTfInit => std::option::Option::Some("RUNNING_TF_INIT"),
5125                Self::RunningTfPlan => std::option::Option::Some("RUNNING_TF_PLAN"),
5126                Self::RunningTfApply => std::option::Option::Some("RUNNING_TF_APPLY"),
5127                Self::RunningTfDestroy => std::option::Option::Some("RUNNING_TF_DESTROY"),
5128                Self::RunningTfValidate => std::option::Option::Some("RUNNING_TF_VALIDATE"),
5129                Self::UnlockingDeployment => std::option::Option::Some("UNLOCKING_DEPLOYMENT"),
5130                Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
5131                Self::Failed => std::option::Option::Some("FAILED"),
5132                Self::ValidatingRepository => std::option::Option::Some("VALIDATING_REPOSITORY"),
5133                Self::RunningQuotaValidation => {
5134                    std::option::Option::Some("RUNNING_QUOTA_VALIDATION")
5135                }
5136                Self::UnknownValue(u) => u.0.name(),
5137            }
5138        }
5139    }
5140
5141    impl std::default::Default for DeploymentStep {
5142        fn default() -> Self {
5143            use std::convert::From;
5144            Self::from(0)
5145        }
5146    }
5147
5148    impl std::fmt::Display for DeploymentStep {
5149        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5150            wkt::internal::display_enum(f, self.name(), self.value())
5151        }
5152    }
5153
5154    impl std::convert::From<i32> for DeploymentStep {
5155        fn from(value: i32) -> Self {
5156            match value {
5157                0 => Self::Unspecified,
5158                1 => Self::PreparingStorageBucket,
5159                2 => Self::DownloadingBlueprint,
5160                3 => Self::RunningTfInit,
5161                4 => Self::RunningTfPlan,
5162                5 => Self::RunningTfApply,
5163                6 => Self::RunningTfDestroy,
5164                7 => Self::RunningTfValidate,
5165                8 => Self::UnlockingDeployment,
5166                9 => Self::Succeeded,
5167                10 => Self::Failed,
5168                11 => Self::ValidatingRepository,
5169                12 => Self::RunningQuotaValidation,
5170                _ => Self::UnknownValue(deployment_step::UnknownValue(
5171                    wkt::internal::UnknownEnumValue::Integer(value),
5172                )),
5173            }
5174        }
5175    }
5176
5177    impl std::convert::From<&str> for DeploymentStep {
5178        fn from(value: &str) -> Self {
5179            use std::string::ToString;
5180            match value {
5181                "DEPLOYMENT_STEP_UNSPECIFIED" => Self::Unspecified,
5182                "PREPARING_STORAGE_BUCKET" => Self::PreparingStorageBucket,
5183                "DOWNLOADING_BLUEPRINT" => Self::DownloadingBlueprint,
5184                "RUNNING_TF_INIT" => Self::RunningTfInit,
5185                "RUNNING_TF_PLAN" => Self::RunningTfPlan,
5186                "RUNNING_TF_APPLY" => Self::RunningTfApply,
5187                "RUNNING_TF_DESTROY" => Self::RunningTfDestroy,
5188                "RUNNING_TF_VALIDATE" => Self::RunningTfValidate,
5189                "UNLOCKING_DEPLOYMENT" => Self::UnlockingDeployment,
5190                "SUCCEEDED" => Self::Succeeded,
5191                "FAILED" => Self::Failed,
5192                "VALIDATING_REPOSITORY" => Self::ValidatingRepository,
5193                "RUNNING_QUOTA_VALIDATION" => Self::RunningQuotaValidation,
5194                _ => Self::UnknownValue(deployment_step::UnknownValue(
5195                    wkt::internal::UnknownEnumValue::String(value.to_string()),
5196                )),
5197            }
5198        }
5199    }
5200
5201    impl serde::ser::Serialize for DeploymentStep {
5202        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5203        where
5204            S: serde::Serializer,
5205        {
5206            match self {
5207                Self::Unspecified => serializer.serialize_i32(0),
5208                Self::PreparingStorageBucket => serializer.serialize_i32(1),
5209                Self::DownloadingBlueprint => serializer.serialize_i32(2),
5210                Self::RunningTfInit => serializer.serialize_i32(3),
5211                Self::RunningTfPlan => serializer.serialize_i32(4),
5212                Self::RunningTfApply => serializer.serialize_i32(5),
5213                Self::RunningTfDestroy => serializer.serialize_i32(6),
5214                Self::RunningTfValidate => serializer.serialize_i32(7),
5215                Self::UnlockingDeployment => serializer.serialize_i32(8),
5216                Self::Succeeded => serializer.serialize_i32(9),
5217                Self::Failed => serializer.serialize_i32(10),
5218                Self::ValidatingRepository => serializer.serialize_i32(11),
5219                Self::RunningQuotaValidation => serializer.serialize_i32(12),
5220                Self::UnknownValue(u) => u.0.serialize(serializer),
5221            }
5222        }
5223    }
5224
5225    impl<'de> serde::de::Deserialize<'de> for DeploymentStep {
5226        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5227        where
5228            D: serde::Deserializer<'de>,
5229        {
5230            deserializer.deserialize_any(wkt::internal::EnumVisitor::<DeploymentStep>::new(
5231                ".google.cloud.config.v1.DeploymentOperationMetadata.DeploymentStep",
5232            ))
5233        }
5234    }
5235}
5236
5237/// Resource represents a Google Cloud Platform resource actuated by IM.
5238/// Resources are child resources of Revisions.
5239#[derive(Clone, Default, PartialEq)]
5240#[non_exhaustive]
5241pub struct Resource {
5242    /// Output only. Resource name.
5243    /// Format:
5244    /// `projects/{project}/locations/{location}/deployments/{deployment}/revisions/{revision}/resources/{resource}`
5245    pub name: std::string::String,
5246
5247    /// Output only. Terraform-specific info if this resource was created using
5248    /// Terraform.
5249    pub terraform_info: std::option::Option<crate::model::ResourceTerraformInfo>,
5250
5251    /// Output only. Map of Cloud Asset Inventory (CAI) type to CAI info (e.g. CAI
5252    /// ID). CAI type format follows
5253    /// <https://cloud.google.com/asset-inventory/docs/supported-asset-types>
5254    pub cai_assets: std::collections::HashMap<std::string::String, crate::model::ResourceCAIInfo>,
5255
5256    /// Output only. Intent of the resource.
5257    pub intent: crate::model::resource::Intent,
5258
5259    /// Output only. Current state of the resource.
5260    pub state: crate::model::resource::State,
5261
5262    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5263}
5264
5265impl Resource {
5266    /// Creates a new default instance.
5267    pub fn new() -> Self {
5268        std::default::Default::default()
5269    }
5270
5271    /// Sets the value of [name][crate::model::Resource::name].
5272    ///
5273    /// # Example
5274    /// ```ignore,no_run
5275    /// # use google_cloud_config_v1::model::Resource;
5276    /// # let project_id = "project_id";
5277    /// # let location_id = "location_id";
5278    /// # let deployment_id = "deployment_id";
5279    /// # let revision_id = "revision_id";
5280    /// # let resource_id = "resource_id";
5281    /// let x = Resource::new().set_name(format!("projects/{project_id}/locations/{location_id}/deployments/{deployment_id}/revisions/{revision_id}/resources/{resource_id}"));
5282    /// ```
5283    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5284        self.name = v.into();
5285        self
5286    }
5287
5288    /// Sets the value of [terraform_info][crate::model::Resource::terraform_info].
5289    ///
5290    /// # Example
5291    /// ```ignore,no_run
5292    /// # use google_cloud_config_v1::model::Resource;
5293    /// use google_cloud_config_v1::model::ResourceTerraformInfo;
5294    /// let x = Resource::new().set_terraform_info(ResourceTerraformInfo::default()/* use setters */);
5295    /// ```
5296    pub fn set_terraform_info<T>(mut self, v: T) -> Self
5297    where
5298        T: std::convert::Into<crate::model::ResourceTerraformInfo>,
5299    {
5300        self.terraform_info = std::option::Option::Some(v.into());
5301        self
5302    }
5303
5304    /// Sets or clears the value of [terraform_info][crate::model::Resource::terraform_info].
5305    ///
5306    /// # Example
5307    /// ```ignore,no_run
5308    /// # use google_cloud_config_v1::model::Resource;
5309    /// use google_cloud_config_v1::model::ResourceTerraformInfo;
5310    /// let x = Resource::new().set_or_clear_terraform_info(Some(ResourceTerraformInfo::default()/* use setters */));
5311    /// let x = Resource::new().set_or_clear_terraform_info(None::<ResourceTerraformInfo>);
5312    /// ```
5313    pub fn set_or_clear_terraform_info<T>(mut self, v: std::option::Option<T>) -> Self
5314    where
5315        T: std::convert::Into<crate::model::ResourceTerraformInfo>,
5316    {
5317        self.terraform_info = v.map(|x| x.into());
5318        self
5319    }
5320
5321    /// Sets the value of [cai_assets][crate::model::Resource::cai_assets].
5322    ///
5323    /// # Example
5324    /// ```ignore,no_run
5325    /// # use google_cloud_config_v1::model::Resource;
5326    /// use google_cloud_config_v1::model::ResourceCAIInfo;
5327    /// let x = Resource::new().set_cai_assets([
5328    ///     ("key0", ResourceCAIInfo::default()/* use setters */),
5329    ///     ("key1", ResourceCAIInfo::default()/* use (different) setters */),
5330    /// ]);
5331    /// ```
5332    pub fn set_cai_assets<T, K, V>(mut self, v: T) -> Self
5333    where
5334        T: std::iter::IntoIterator<Item = (K, V)>,
5335        K: std::convert::Into<std::string::String>,
5336        V: std::convert::Into<crate::model::ResourceCAIInfo>,
5337    {
5338        use std::iter::Iterator;
5339        self.cai_assets = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5340        self
5341    }
5342
5343    /// Sets the value of [intent][crate::model::Resource::intent].
5344    ///
5345    /// # Example
5346    /// ```ignore,no_run
5347    /// # use google_cloud_config_v1::model::Resource;
5348    /// use google_cloud_config_v1::model::resource::Intent;
5349    /// let x0 = Resource::new().set_intent(Intent::Create);
5350    /// let x1 = Resource::new().set_intent(Intent::Update);
5351    /// let x2 = Resource::new().set_intent(Intent::Delete);
5352    /// ```
5353    pub fn set_intent<T: std::convert::Into<crate::model::resource::Intent>>(
5354        mut self,
5355        v: T,
5356    ) -> Self {
5357        self.intent = v.into();
5358        self
5359    }
5360
5361    /// Sets the value of [state][crate::model::Resource::state].
5362    ///
5363    /// # Example
5364    /// ```ignore,no_run
5365    /// # use google_cloud_config_v1::model::Resource;
5366    /// use google_cloud_config_v1::model::resource::State;
5367    /// let x0 = Resource::new().set_state(State::Planned);
5368    /// let x1 = Resource::new().set_state(State::InProgress);
5369    /// let x2 = Resource::new().set_state(State::Reconciled);
5370    /// ```
5371    pub fn set_state<T: std::convert::Into<crate::model::resource::State>>(mut self, v: T) -> Self {
5372        self.state = v.into();
5373        self
5374    }
5375}
5376
5377impl wkt::message::Message for Resource {
5378    fn typename() -> &'static str {
5379        "type.googleapis.com/google.cloud.config.v1.Resource"
5380    }
5381}
5382
5383/// Defines additional types related to [Resource].
5384pub mod resource {
5385    #[allow(unused_imports)]
5386    use super::*;
5387
5388    /// Possible intent of the resource.
5389    ///
5390    /// # Working with unknown values
5391    ///
5392    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5393    /// additional enum variants at any time. Adding new variants is not considered
5394    /// a breaking change. Applications should write their code in anticipation of:
5395    ///
5396    /// - New values appearing in future releases of the client library, **and**
5397    /// - New values received dynamically, without application changes.
5398    ///
5399    /// Please consult the [Working with enums] section in the user guide for some
5400    /// guidelines.
5401    ///
5402    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
5403    #[derive(Clone, Debug, PartialEq)]
5404    #[non_exhaustive]
5405    pub enum Intent {
5406        /// The default value. This value is used if the intent is omitted.
5407        Unspecified,
5408        /// Infra Manager will create this Resource.
5409        Create,
5410        /// Infra Manager will update this Resource.
5411        Update,
5412        /// Infra Manager will delete this Resource.
5413        Delete,
5414        /// Infra Manager will destroy and recreate this Resource.
5415        Recreate,
5416        /// Infra Manager will leave this Resource untouched.
5417        Unchanged,
5418        /// If set, the enum was initialized with an unknown value.
5419        ///
5420        /// Applications can examine the value using [Intent::value] or
5421        /// [Intent::name].
5422        UnknownValue(intent::UnknownValue),
5423    }
5424
5425    #[doc(hidden)]
5426    pub mod intent {
5427        #[allow(unused_imports)]
5428        use super::*;
5429        #[derive(Clone, Debug, PartialEq)]
5430        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5431    }
5432
5433    impl Intent {
5434        /// Gets the enum value.
5435        ///
5436        /// Returns `None` if the enum contains an unknown value deserialized from
5437        /// the string representation of enums.
5438        pub fn value(&self) -> std::option::Option<i32> {
5439            match self {
5440                Self::Unspecified => std::option::Option::Some(0),
5441                Self::Create => std::option::Option::Some(1),
5442                Self::Update => std::option::Option::Some(2),
5443                Self::Delete => std::option::Option::Some(3),
5444                Self::Recreate => std::option::Option::Some(4),
5445                Self::Unchanged => std::option::Option::Some(5),
5446                Self::UnknownValue(u) => u.0.value(),
5447            }
5448        }
5449
5450        /// Gets the enum value as a string.
5451        ///
5452        /// Returns `None` if the enum contains an unknown value deserialized from
5453        /// the integer representation of enums.
5454        pub fn name(&self) -> std::option::Option<&str> {
5455            match self {
5456                Self::Unspecified => std::option::Option::Some("INTENT_UNSPECIFIED"),
5457                Self::Create => std::option::Option::Some("CREATE"),
5458                Self::Update => std::option::Option::Some("UPDATE"),
5459                Self::Delete => std::option::Option::Some("DELETE"),
5460                Self::Recreate => std::option::Option::Some("RECREATE"),
5461                Self::Unchanged => std::option::Option::Some("UNCHANGED"),
5462                Self::UnknownValue(u) => u.0.name(),
5463            }
5464        }
5465    }
5466
5467    impl std::default::Default for Intent {
5468        fn default() -> Self {
5469            use std::convert::From;
5470            Self::from(0)
5471        }
5472    }
5473
5474    impl std::fmt::Display for Intent {
5475        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5476            wkt::internal::display_enum(f, self.name(), self.value())
5477        }
5478    }
5479
5480    impl std::convert::From<i32> for Intent {
5481        fn from(value: i32) -> Self {
5482            match value {
5483                0 => Self::Unspecified,
5484                1 => Self::Create,
5485                2 => Self::Update,
5486                3 => Self::Delete,
5487                4 => Self::Recreate,
5488                5 => Self::Unchanged,
5489                _ => Self::UnknownValue(intent::UnknownValue(
5490                    wkt::internal::UnknownEnumValue::Integer(value),
5491                )),
5492            }
5493        }
5494    }
5495
5496    impl std::convert::From<&str> for Intent {
5497        fn from(value: &str) -> Self {
5498            use std::string::ToString;
5499            match value {
5500                "INTENT_UNSPECIFIED" => Self::Unspecified,
5501                "CREATE" => Self::Create,
5502                "UPDATE" => Self::Update,
5503                "DELETE" => Self::Delete,
5504                "RECREATE" => Self::Recreate,
5505                "UNCHANGED" => Self::Unchanged,
5506                _ => Self::UnknownValue(intent::UnknownValue(
5507                    wkt::internal::UnknownEnumValue::String(value.to_string()),
5508                )),
5509            }
5510        }
5511    }
5512
5513    impl serde::ser::Serialize for Intent {
5514        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5515        where
5516            S: serde::Serializer,
5517        {
5518            match self {
5519                Self::Unspecified => serializer.serialize_i32(0),
5520                Self::Create => serializer.serialize_i32(1),
5521                Self::Update => serializer.serialize_i32(2),
5522                Self::Delete => serializer.serialize_i32(3),
5523                Self::Recreate => serializer.serialize_i32(4),
5524                Self::Unchanged => serializer.serialize_i32(5),
5525                Self::UnknownValue(u) => u.0.serialize(serializer),
5526            }
5527        }
5528    }
5529
5530    impl<'de> serde::de::Deserialize<'de> for Intent {
5531        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5532        where
5533            D: serde::Deserializer<'de>,
5534        {
5535            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Intent>::new(
5536                ".google.cloud.config.v1.Resource.Intent",
5537            ))
5538        }
5539    }
5540
5541    /// Possible states of a resource.
5542    ///
5543    /// # Working with unknown values
5544    ///
5545    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5546    /// additional enum variants at any time. Adding new variants is not considered
5547    /// a breaking change. Applications should write their code in anticipation of:
5548    ///
5549    /// - New values appearing in future releases of the client library, **and**
5550    /// - New values received dynamically, without application changes.
5551    ///
5552    /// Please consult the [Working with enums] section in the user guide for some
5553    /// guidelines.
5554    ///
5555    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
5556    #[derive(Clone, Debug, PartialEq)]
5557    #[non_exhaustive]
5558    pub enum State {
5559        /// The default value. This value is used if the state is omitted.
5560        Unspecified,
5561        /// Resource has been planned for reconcile.
5562        Planned,
5563        /// Resource is actively reconciling into the intended state.
5564        InProgress,
5565        /// Resource has reconciled to intended state.
5566        Reconciled,
5567        /// Resource failed to reconcile.
5568        Failed,
5569        /// If set, the enum was initialized with an unknown value.
5570        ///
5571        /// Applications can examine the value using [State::value] or
5572        /// [State::name].
5573        UnknownValue(state::UnknownValue),
5574    }
5575
5576    #[doc(hidden)]
5577    pub mod state {
5578        #[allow(unused_imports)]
5579        use super::*;
5580        #[derive(Clone, Debug, PartialEq)]
5581        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5582    }
5583
5584    impl State {
5585        /// Gets the enum value.
5586        ///
5587        /// Returns `None` if the enum contains an unknown value deserialized from
5588        /// the string representation of enums.
5589        pub fn value(&self) -> std::option::Option<i32> {
5590            match self {
5591                Self::Unspecified => std::option::Option::Some(0),
5592                Self::Planned => std::option::Option::Some(1),
5593                Self::InProgress => std::option::Option::Some(2),
5594                Self::Reconciled => std::option::Option::Some(3),
5595                Self::Failed => std::option::Option::Some(4),
5596                Self::UnknownValue(u) => u.0.value(),
5597            }
5598        }
5599
5600        /// Gets the enum value as a string.
5601        ///
5602        /// Returns `None` if the enum contains an unknown value deserialized from
5603        /// the integer representation of enums.
5604        pub fn name(&self) -> std::option::Option<&str> {
5605            match self {
5606                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
5607                Self::Planned => std::option::Option::Some("PLANNED"),
5608                Self::InProgress => std::option::Option::Some("IN_PROGRESS"),
5609                Self::Reconciled => std::option::Option::Some("RECONCILED"),
5610                Self::Failed => std::option::Option::Some("FAILED"),
5611                Self::UnknownValue(u) => u.0.name(),
5612            }
5613        }
5614    }
5615
5616    impl std::default::Default for State {
5617        fn default() -> Self {
5618            use std::convert::From;
5619            Self::from(0)
5620        }
5621    }
5622
5623    impl std::fmt::Display for State {
5624        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5625            wkt::internal::display_enum(f, self.name(), self.value())
5626        }
5627    }
5628
5629    impl std::convert::From<i32> for State {
5630        fn from(value: i32) -> Self {
5631            match value {
5632                0 => Self::Unspecified,
5633                1 => Self::Planned,
5634                2 => Self::InProgress,
5635                3 => Self::Reconciled,
5636                4 => Self::Failed,
5637                _ => Self::UnknownValue(state::UnknownValue(
5638                    wkt::internal::UnknownEnumValue::Integer(value),
5639                )),
5640            }
5641        }
5642    }
5643
5644    impl std::convert::From<&str> for State {
5645        fn from(value: &str) -> Self {
5646            use std::string::ToString;
5647            match value {
5648                "STATE_UNSPECIFIED" => Self::Unspecified,
5649                "PLANNED" => Self::Planned,
5650                "IN_PROGRESS" => Self::InProgress,
5651                "RECONCILED" => Self::Reconciled,
5652                "FAILED" => Self::Failed,
5653                _ => Self::UnknownValue(state::UnknownValue(
5654                    wkt::internal::UnknownEnumValue::String(value.to_string()),
5655                )),
5656            }
5657        }
5658    }
5659
5660    impl serde::ser::Serialize for State {
5661        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5662        where
5663            S: serde::Serializer,
5664        {
5665            match self {
5666                Self::Unspecified => serializer.serialize_i32(0),
5667                Self::Planned => serializer.serialize_i32(1),
5668                Self::InProgress => serializer.serialize_i32(2),
5669                Self::Reconciled => serializer.serialize_i32(3),
5670                Self::Failed => serializer.serialize_i32(4),
5671                Self::UnknownValue(u) => u.0.serialize(serializer),
5672            }
5673        }
5674    }
5675
5676    impl<'de> serde::de::Deserialize<'de> for State {
5677        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5678        where
5679            D: serde::Deserializer<'de>,
5680        {
5681            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
5682                ".google.cloud.config.v1.Resource.State",
5683            ))
5684        }
5685    }
5686}
5687
5688/// Terraform info of a Resource.
5689#[derive(Clone, Default, PartialEq)]
5690#[non_exhaustive]
5691pub struct ResourceTerraformInfo {
5692    /// TF resource address that uniquely identifies this resource within this
5693    /// deployment.
5694    pub address: std::string::String,
5695
5696    /// TF resource type
5697    pub r#type: std::string::String,
5698
5699    /// ID attribute of the TF resource
5700    pub id: std::string::String,
5701
5702    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5703}
5704
5705impl ResourceTerraformInfo {
5706    /// Creates a new default instance.
5707    pub fn new() -> Self {
5708        std::default::Default::default()
5709    }
5710
5711    /// Sets the value of [address][crate::model::ResourceTerraformInfo::address].
5712    ///
5713    /// # Example
5714    /// ```ignore,no_run
5715    /// # use google_cloud_config_v1::model::ResourceTerraformInfo;
5716    /// let x = ResourceTerraformInfo::new().set_address("example");
5717    /// ```
5718    pub fn set_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5719        self.address = v.into();
5720        self
5721    }
5722
5723    /// Sets the value of [r#type][crate::model::ResourceTerraformInfo::type].
5724    ///
5725    /// # Example
5726    /// ```ignore,no_run
5727    /// # use google_cloud_config_v1::model::ResourceTerraformInfo;
5728    /// let x = ResourceTerraformInfo::new().set_type("example");
5729    /// ```
5730    pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5731        self.r#type = v.into();
5732        self
5733    }
5734
5735    /// Sets the value of [id][crate::model::ResourceTerraformInfo::id].
5736    ///
5737    /// # Example
5738    /// ```ignore,no_run
5739    /// # use google_cloud_config_v1::model::ResourceTerraformInfo;
5740    /// let x = ResourceTerraformInfo::new().set_id("example");
5741    /// ```
5742    pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5743        self.id = v.into();
5744        self
5745    }
5746}
5747
5748impl wkt::message::Message for ResourceTerraformInfo {
5749    fn typename() -> &'static str {
5750        "type.googleapis.com/google.cloud.config.v1.ResourceTerraformInfo"
5751    }
5752}
5753
5754/// CAI info of a Resource.
5755#[derive(Clone, Default, PartialEq)]
5756#[non_exhaustive]
5757pub struct ResourceCAIInfo {
5758    /// CAI resource name in the format following
5759    /// <https://cloud.google.com/apis/design/resource_names#full_resource_name>
5760    pub full_resource_name: std::string::String,
5761
5762    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5763}
5764
5765impl ResourceCAIInfo {
5766    /// Creates a new default instance.
5767    pub fn new() -> Self {
5768        std::default::Default::default()
5769    }
5770
5771    /// Sets the value of [full_resource_name][crate::model::ResourceCAIInfo::full_resource_name].
5772    ///
5773    /// # Example
5774    /// ```ignore,no_run
5775    /// # use google_cloud_config_v1::model::ResourceCAIInfo;
5776    /// let x = ResourceCAIInfo::new().set_full_resource_name("example");
5777    /// ```
5778    pub fn set_full_resource_name<T: std::convert::Into<std::string::String>>(
5779        mut self,
5780        v: T,
5781    ) -> Self {
5782        self.full_resource_name = v.into();
5783        self
5784    }
5785}
5786
5787impl wkt::message::Message for ResourceCAIInfo {
5788    fn typename() -> &'static str {
5789        "type.googleapis.com/google.cloud.config.v1.ResourceCAIInfo"
5790    }
5791}
5792
5793/// A request to get a Resource from a 'GetResource' call.
5794#[derive(Clone, Default, PartialEq)]
5795#[non_exhaustive]
5796pub struct GetResourceRequest {
5797    /// Required. The name of the Resource in the format:
5798    /// 'projects/{project_id}/locations/{location}/deployments/{deployment}/revisions/{revision}/resource/{resource}'.
5799    pub name: std::string::String,
5800
5801    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5802}
5803
5804impl GetResourceRequest {
5805    /// Creates a new default instance.
5806    pub fn new() -> Self {
5807        std::default::Default::default()
5808    }
5809
5810    /// Sets the value of [name][crate::model::GetResourceRequest::name].
5811    ///
5812    /// # Example
5813    /// ```ignore,no_run
5814    /// # use google_cloud_config_v1::model::GetResourceRequest;
5815    /// # let project_id = "project_id";
5816    /// # let location_id = "location_id";
5817    /// # let deployment_id = "deployment_id";
5818    /// # let revision_id = "revision_id";
5819    /// # let resource_id = "resource_id";
5820    /// let x = GetResourceRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/deployments/{deployment_id}/revisions/{revision_id}/resources/{resource_id}"));
5821    /// ```
5822    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5823        self.name = v.into();
5824        self
5825    }
5826}
5827
5828impl wkt::message::Message for GetResourceRequest {
5829    fn typename() -> &'static str {
5830        "type.googleapis.com/google.cloud.config.v1.GetResourceRequest"
5831    }
5832}
5833
5834/// A request to list Resources passed to a 'ListResources' call.
5835#[derive(Clone, Default, PartialEq)]
5836#[non_exhaustive]
5837pub struct ListResourcesRequest {
5838    /// Required. The parent in whose context the Resources are listed. The parent
5839    /// value is in the format:
5840    /// 'projects/{project_id}/locations/{location}/deployments/{deployment}/revisions/{revision}'.
5841    pub parent: std::string::String,
5842
5843    /// When requesting a page of resources, 'page_size' specifies number of
5844    /// resources to return. If unspecified, at most 500 will be returned. The
5845    /// maximum value is 1000.
5846    pub page_size: i32,
5847
5848    /// Token returned by previous call to 'ListResources' which specifies the
5849    /// position in the list from where to continue listing the resources.
5850    pub page_token: std::string::String,
5851
5852    /// Lists the Resources that match the filter expression. A filter
5853    /// expression filters the resources listed in the response. The expression
5854    /// must be of the form '{field} {operator} {value}' where operators: '<', '>',
5855    /// '<=',
5856    /// '>=',
5857    /// '!=', '=', ':' are supported (colon ':' represents a HAS operator which is
5858    /// roughly synonymous with equality). {field} can refer to a proto or JSON
5859    /// field, or a synthetic field. Field names can be camelCase or snake_case.
5860    ///
5861    /// Examples:
5862    ///
5863    /// - Filter by name:
5864    ///   name =
5865    ///   "projects/foo/locations/us-central1/deployments/dep/revisions/bar/resources/baz
5866    pub filter: std::string::String,
5867
5868    /// Field to use to sort the list.
5869    pub order_by: std::string::String,
5870
5871    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5872}
5873
5874impl ListResourcesRequest {
5875    /// Creates a new default instance.
5876    pub fn new() -> Self {
5877        std::default::Default::default()
5878    }
5879
5880    /// Sets the value of [parent][crate::model::ListResourcesRequest::parent].
5881    ///
5882    /// # Example
5883    /// ```ignore,no_run
5884    /// # use google_cloud_config_v1::model::ListResourcesRequest;
5885    /// # let project_id = "project_id";
5886    /// # let location_id = "location_id";
5887    /// # let deployment_id = "deployment_id";
5888    /// # let revision_id = "revision_id";
5889    /// let x = ListResourcesRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/deployments/{deployment_id}/revisions/{revision_id}"));
5890    /// ```
5891    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5892        self.parent = v.into();
5893        self
5894    }
5895
5896    /// Sets the value of [page_size][crate::model::ListResourcesRequest::page_size].
5897    ///
5898    /// # Example
5899    /// ```ignore,no_run
5900    /// # use google_cloud_config_v1::model::ListResourcesRequest;
5901    /// let x = ListResourcesRequest::new().set_page_size(42);
5902    /// ```
5903    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5904        self.page_size = v.into();
5905        self
5906    }
5907
5908    /// Sets the value of [page_token][crate::model::ListResourcesRequest::page_token].
5909    ///
5910    /// # Example
5911    /// ```ignore,no_run
5912    /// # use google_cloud_config_v1::model::ListResourcesRequest;
5913    /// let x = ListResourcesRequest::new().set_page_token("example");
5914    /// ```
5915    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5916        self.page_token = v.into();
5917        self
5918    }
5919
5920    /// Sets the value of [filter][crate::model::ListResourcesRequest::filter].
5921    ///
5922    /// # Example
5923    /// ```ignore,no_run
5924    /// # use google_cloud_config_v1::model::ListResourcesRequest;
5925    /// let x = ListResourcesRequest::new().set_filter("example");
5926    /// ```
5927    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5928        self.filter = v.into();
5929        self
5930    }
5931
5932    /// Sets the value of [order_by][crate::model::ListResourcesRequest::order_by].
5933    ///
5934    /// # Example
5935    /// ```ignore,no_run
5936    /// # use google_cloud_config_v1::model::ListResourcesRequest;
5937    /// let x = ListResourcesRequest::new().set_order_by("example");
5938    /// ```
5939    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5940        self.order_by = v.into();
5941        self
5942    }
5943}
5944
5945impl wkt::message::Message for ListResourcesRequest {
5946    fn typename() -> &'static str {
5947        "type.googleapis.com/google.cloud.config.v1.ListResourcesRequest"
5948    }
5949}
5950
5951/// A response to a 'ListResources' call. Contains a list of Resources.
5952#[derive(Clone, Default, PartialEq)]
5953#[non_exhaustive]
5954pub struct ListResourcesResponse {
5955    /// List of [Resources][google.cloud.config.v1.Resource].
5956    ///
5957    /// [google.cloud.config.v1.Resource]: crate::model::Resource
5958    pub resources: std::vec::Vec<crate::model::Resource>,
5959
5960    /// A token to request the next page of resources from the 'ListResources'
5961    /// method. The value of an empty string means that there are no more resources
5962    /// to return.
5963    pub next_page_token: std::string::String,
5964
5965    /// Locations that could not be reached.
5966    pub unreachable: std::vec::Vec<std::string::String>,
5967
5968    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5969}
5970
5971impl ListResourcesResponse {
5972    /// Creates a new default instance.
5973    pub fn new() -> Self {
5974        std::default::Default::default()
5975    }
5976
5977    /// Sets the value of [resources][crate::model::ListResourcesResponse::resources].
5978    ///
5979    /// # Example
5980    /// ```ignore,no_run
5981    /// # use google_cloud_config_v1::model::ListResourcesResponse;
5982    /// use google_cloud_config_v1::model::Resource;
5983    /// let x = ListResourcesResponse::new()
5984    ///     .set_resources([
5985    ///         Resource::default()/* use setters */,
5986    ///         Resource::default()/* use (different) setters */,
5987    ///     ]);
5988    /// ```
5989    pub fn set_resources<T, V>(mut self, v: T) -> Self
5990    where
5991        T: std::iter::IntoIterator<Item = V>,
5992        V: std::convert::Into<crate::model::Resource>,
5993    {
5994        use std::iter::Iterator;
5995        self.resources = v.into_iter().map(|i| i.into()).collect();
5996        self
5997    }
5998
5999    /// Sets the value of [next_page_token][crate::model::ListResourcesResponse::next_page_token].
6000    ///
6001    /// # Example
6002    /// ```ignore,no_run
6003    /// # use google_cloud_config_v1::model::ListResourcesResponse;
6004    /// let x = ListResourcesResponse::new().set_next_page_token("example");
6005    /// ```
6006    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6007        self.next_page_token = v.into();
6008        self
6009    }
6010
6011    /// Sets the value of [unreachable][crate::model::ListResourcesResponse::unreachable].
6012    ///
6013    /// # Example
6014    /// ```ignore,no_run
6015    /// # use google_cloud_config_v1::model::ListResourcesResponse;
6016    /// let x = ListResourcesResponse::new().set_unreachable(["a", "b", "c"]);
6017    /// ```
6018    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
6019    where
6020        T: std::iter::IntoIterator<Item = V>,
6021        V: std::convert::Into<std::string::String>,
6022    {
6023        use std::iter::Iterator;
6024        self.unreachable = v.into_iter().map(|i| i.into()).collect();
6025        self
6026    }
6027}
6028
6029impl wkt::message::Message for ListResourcesResponse {
6030    fn typename() -> &'static str {
6031        "type.googleapis.com/google.cloud.config.v1.ListResourcesResponse"
6032    }
6033}
6034
6035#[doc(hidden)]
6036impl google_cloud_gax::paginator::internal::PageableResponse for ListResourcesResponse {
6037    type PageItem = crate::model::Resource;
6038
6039    fn items(self) -> std::vec::Vec<Self::PageItem> {
6040        self.resources
6041    }
6042
6043    fn next_page_token(&self) -> std::string::String {
6044        use std::clone::Clone;
6045        self.next_page_token.clone()
6046    }
6047}
6048
6049/// Contains info about a Terraform state file
6050#[derive(Clone, Default, PartialEq)]
6051#[non_exhaustive]
6052pub struct Statefile {
6053    /// Output only. Cloud Storage signed URI used for downloading or uploading the
6054    /// state file.
6055    pub signed_uri: std::string::String,
6056
6057    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6058}
6059
6060impl Statefile {
6061    /// Creates a new default instance.
6062    pub fn new() -> Self {
6063        std::default::Default::default()
6064    }
6065
6066    /// Sets the value of [signed_uri][crate::model::Statefile::signed_uri].
6067    ///
6068    /// # Example
6069    /// ```ignore,no_run
6070    /// # use google_cloud_config_v1::model::Statefile;
6071    /// let x = Statefile::new().set_signed_uri("example");
6072    /// ```
6073    pub fn set_signed_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6074        self.signed_uri = v.into();
6075        self
6076    }
6077}
6078
6079impl wkt::message::Message for Statefile {
6080    fn typename() -> &'static str {
6081        "type.googleapis.com/google.cloud.config.v1.Statefile"
6082    }
6083}
6084
6085/// A request to export a state file passed to a 'ExportDeploymentStatefile'
6086/// call.
6087#[derive(Clone, Default, PartialEq)]
6088#[non_exhaustive]
6089pub struct ExportDeploymentStatefileRequest {
6090    /// Required. The parent in whose context the statefile is listed. The parent
6091    /// value is in the format:
6092    /// 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
6093    pub parent: std::string::String,
6094
6095    /// Optional. If this flag is set to true, the exported deployment state file
6096    /// will be the draft state. This will enable the draft file to be validated
6097    /// before copying it over to the working state on unlock.
6098    pub draft: bool,
6099
6100    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6101}
6102
6103impl ExportDeploymentStatefileRequest {
6104    /// Creates a new default instance.
6105    pub fn new() -> Self {
6106        std::default::Default::default()
6107    }
6108
6109    /// Sets the value of [parent][crate::model::ExportDeploymentStatefileRequest::parent].
6110    ///
6111    /// # Example
6112    /// ```ignore,no_run
6113    /// # use google_cloud_config_v1::model::ExportDeploymentStatefileRequest;
6114    /// # let project_id = "project_id";
6115    /// # let location_id = "location_id";
6116    /// # let deployment_id = "deployment_id";
6117    /// let x = ExportDeploymentStatefileRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/deployments/{deployment_id}"));
6118    /// ```
6119    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6120        self.parent = v.into();
6121        self
6122    }
6123
6124    /// Sets the value of [draft][crate::model::ExportDeploymentStatefileRequest::draft].
6125    ///
6126    /// # Example
6127    /// ```ignore,no_run
6128    /// # use google_cloud_config_v1::model::ExportDeploymentStatefileRequest;
6129    /// let x = ExportDeploymentStatefileRequest::new().set_draft(true);
6130    /// ```
6131    pub fn set_draft<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6132        self.draft = v.into();
6133        self
6134    }
6135}
6136
6137impl wkt::message::Message for ExportDeploymentStatefileRequest {
6138    fn typename() -> &'static str {
6139        "type.googleapis.com/google.cloud.config.v1.ExportDeploymentStatefileRequest"
6140    }
6141}
6142
6143/// A request to export a state file passed to a 'ExportRevisionStatefile'
6144/// call.
6145#[derive(Clone, Default, PartialEq)]
6146#[non_exhaustive]
6147pub struct ExportRevisionStatefileRequest {
6148    /// Required. The parent in whose context the statefile is listed. The parent
6149    /// value is in the format:
6150    /// 'projects/{project_id}/locations/{location}/deployments/{deployment}/revisions/{revision}'.
6151    pub parent: std::string::String,
6152
6153    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6154}
6155
6156impl ExportRevisionStatefileRequest {
6157    /// Creates a new default instance.
6158    pub fn new() -> Self {
6159        std::default::Default::default()
6160    }
6161
6162    /// Sets the value of [parent][crate::model::ExportRevisionStatefileRequest::parent].
6163    ///
6164    /// # Example
6165    /// ```ignore,no_run
6166    /// # use google_cloud_config_v1::model::ExportRevisionStatefileRequest;
6167    /// # let project_id = "project_id";
6168    /// # let location_id = "location_id";
6169    /// # let deployment_id = "deployment_id";
6170    /// # let revision_id = "revision_id";
6171    /// let x = ExportRevisionStatefileRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/deployments/{deployment_id}/revisions/{revision_id}"));
6172    /// ```
6173    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6174        self.parent = v.into();
6175        self
6176    }
6177}
6178
6179impl wkt::message::Message for ExportRevisionStatefileRequest {
6180    fn typename() -> &'static str {
6181        "type.googleapis.com/google.cloud.config.v1.ExportRevisionStatefileRequest"
6182    }
6183}
6184
6185/// A request to import a state file passed to a 'ImportStatefile' call.
6186#[derive(Clone, Default, PartialEq)]
6187#[non_exhaustive]
6188pub struct ImportStatefileRequest {
6189    /// Required. The parent in whose context the statefile is listed. The parent
6190    /// value is in the format:
6191    /// 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
6192    pub parent: std::string::String,
6193
6194    /// Required. Lock ID of the lock file to verify that the user who is importing
6195    /// the state file previously locked the Deployment.
6196    pub lock_id: i64,
6197
6198    /// Optional.
6199    pub skip_draft: bool,
6200
6201    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6202}
6203
6204impl ImportStatefileRequest {
6205    /// Creates a new default instance.
6206    pub fn new() -> Self {
6207        std::default::Default::default()
6208    }
6209
6210    /// Sets the value of [parent][crate::model::ImportStatefileRequest::parent].
6211    ///
6212    /// # Example
6213    /// ```ignore,no_run
6214    /// # use google_cloud_config_v1::model::ImportStatefileRequest;
6215    /// # let project_id = "project_id";
6216    /// # let location_id = "location_id";
6217    /// # let deployment_id = "deployment_id";
6218    /// let x = ImportStatefileRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/deployments/{deployment_id}"));
6219    /// ```
6220    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6221        self.parent = v.into();
6222        self
6223    }
6224
6225    /// Sets the value of [lock_id][crate::model::ImportStatefileRequest::lock_id].
6226    ///
6227    /// # Example
6228    /// ```ignore,no_run
6229    /// # use google_cloud_config_v1::model::ImportStatefileRequest;
6230    /// let x = ImportStatefileRequest::new().set_lock_id(42);
6231    /// ```
6232    pub fn set_lock_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
6233        self.lock_id = v.into();
6234        self
6235    }
6236
6237    /// Sets the value of [skip_draft][crate::model::ImportStatefileRequest::skip_draft].
6238    ///
6239    /// # Example
6240    /// ```ignore,no_run
6241    /// # use google_cloud_config_v1::model::ImportStatefileRequest;
6242    /// let x = ImportStatefileRequest::new().set_skip_draft(true);
6243    /// ```
6244    pub fn set_skip_draft<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6245        self.skip_draft = v.into();
6246        self
6247    }
6248}
6249
6250impl wkt::message::Message for ImportStatefileRequest {
6251    fn typename() -> &'static str {
6252        "type.googleapis.com/google.cloud.config.v1.ImportStatefileRequest"
6253    }
6254}
6255
6256/// A request to delete a state file passed to a 'DeleteStatefile' call.
6257#[derive(Clone, Default, PartialEq)]
6258#[non_exhaustive]
6259pub struct DeleteStatefileRequest {
6260    /// Required. The name of the deployment in the format:
6261    /// 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
6262    pub name: std::string::String,
6263
6264    /// Required. Lock ID of the lock file to verify that the user who is deleting
6265    /// the state file previously locked the Deployment.
6266    pub lock_id: i64,
6267
6268    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6269}
6270
6271impl DeleteStatefileRequest {
6272    /// Creates a new default instance.
6273    pub fn new() -> Self {
6274        std::default::Default::default()
6275    }
6276
6277    /// Sets the value of [name][crate::model::DeleteStatefileRequest::name].
6278    ///
6279    /// # Example
6280    /// ```ignore,no_run
6281    /// # use google_cloud_config_v1::model::DeleteStatefileRequest;
6282    /// # let project_id = "project_id";
6283    /// # let location_id = "location_id";
6284    /// # let deployment_id = "deployment_id";
6285    /// let x = DeleteStatefileRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/deployments/{deployment_id}"));
6286    /// ```
6287    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6288        self.name = v.into();
6289        self
6290    }
6291
6292    /// Sets the value of [lock_id][crate::model::DeleteStatefileRequest::lock_id].
6293    ///
6294    /// # Example
6295    /// ```ignore,no_run
6296    /// # use google_cloud_config_v1::model::DeleteStatefileRequest;
6297    /// let x = DeleteStatefileRequest::new().set_lock_id(42);
6298    /// ```
6299    pub fn set_lock_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
6300        self.lock_id = v.into();
6301        self
6302    }
6303}
6304
6305impl wkt::message::Message for DeleteStatefileRequest {
6306    fn typename() -> &'static str {
6307        "type.googleapis.com/google.cloud.config.v1.DeleteStatefileRequest"
6308    }
6309}
6310
6311/// A request to lock a deployment passed to a 'LockDeployment' call.
6312#[derive(Clone, Default, PartialEq)]
6313#[non_exhaustive]
6314pub struct LockDeploymentRequest {
6315    /// Required. The name of the deployment in the format:
6316    /// 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
6317    pub name: std::string::String,
6318
6319    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6320}
6321
6322impl LockDeploymentRequest {
6323    /// Creates a new default instance.
6324    pub fn new() -> Self {
6325        std::default::Default::default()
6326    }
6327
6328    /// Sets the value of [name][crate::model::LockDeploymentRequest::name].
6329    ///
6330    /// # Example
6331    /// ```ignore,no_run
6332    /// # use google_cloud_config_v1::model::LockDeploymentRequest;
6333    /// # let project_id = "project_id";
6334    /// # let location_id = "location_id";
6335    /// # let deployment_id = "deployment_id";
6336    /// let x = LockDeploymentRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/deployments/{deployment_id}"));
6337    /// ```
6338    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6339        self.name = v.into();
6340        self
6341    }
6342}
6343
6344impl wkt::message::Message for LockDeploymentRequest {
6345    fn typename() -> &'static str {
6346        "type.googleapis.com/google.cloud.config.v1.LockDeploymentRequest"
6347    }
6348}
6349
6350/// A request to unlock a state file passed to a 'UnlockDeployment' call.
6351#[derive(Clone, Default, PartialEq)]
6352#[non_exhaustive]
6353pub struct UnlockDeploymentRequest {
6354    /// Required. The name of the deployment in the format:
6355    /// 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
6356    pub name: std::string::String,
6357
6358    /// Required. Lock ID of the lock file to be unlocked.
6359    pub lock_id: i64,
6360
6361    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6362}
6363
6364impl UnlockDeploymentRequest {
6365    /// Creates a new default instance.
6366    pub fn new() -> Self {
6367        std::default::Default::default()
6368    }
6369
6370    /// Sets the value of [name][crate::model::UnlockDeploymentRequest::name].
6371    ///
6372    /// # Example
6373    /// ```ignore,no_run
6374    /// # use google_cloud_config_v1::model::UnlockDeploymentRequest;
6375    /// # let project_id = "project_id";
6376    /// # let location_id = "location_id";
6377    /// # let deployment_id = "deployment_id";
6378    /// let x = UnlockDeploymentRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/deployments/{deployment_id}"));
6379    /// ```
6380    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6381        self.name = v.into();
6382        self
6383    }
6384
6385    /// Sets the value of [lock_id][crate::model::UnlockDeploymentRequest::lock_id].
6386    ///
6387    /// # Example
6388    /// ```ignore,no_run
6389    /// # use google_cloud_config_v1::model::UnlockDeploymentRequest;
6390    /// let x = UnlockDeploymentRequest::new().set_lock_id(42);
6391    /// ```
6392    pub fn set_lock_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
6393        self.lock_id = v.into();
6394        self
6395    }
6396}
6397
6398impl wkt::message::Message for UnlockDeploymentRequest {
6399    fn typename() -> &'static str {
6400        "type.googleapis.com/google.cloud.config.v1.UnlockDeploymentRequest"
6401    }
6402}
6403
6404/// A request to get a state file lock info passed to a 'ExportLockInfo' call.
6405#[derive(Clone, Default, PartialEq)]
6406#[non_exhaustive]
6407pub struct ExportLockInfoRequest {
6408    /// Required. The name of the deployment in the format:
6409    /// 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
6410    pub name: std::string::String,
6411
6412    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6413}
6414
6415impl ExportLockInfoRequest {
6416    /// Creates a new default instance.
6417    pub fn new() -> Self {
6418        std::default::Default::default()
6419    }
6420
6421    /// Sets the value of [name][crate::model::ExportLockInfoRequest::name].
6422    ///
6423    /// # Example
6424    /// ```ignore,no_run
6425    /// # use google_cloud_config_v1::model::ExportLockInfoRequest;
6426    /// # let project_id = "project_id";
6427    /// # let location_id = "location_id";
6428    /// # let deployment_id = "deployment_id";
6429    /// let x = ExportLockInfoRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/deployments/{deployment_id}"));
6430    /// ```
6431    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6432        self.name = v.into();
6433        self
6434    }
6435}
6436
6437impl wkt::message::Message for ExportLockInfoRequest {
6438    fn typename() -> &'static str {
6439        "type.googleapis.com/google.cloud.config.v1.ExportLockInfoRequest"
6440    }
6441}
6442
6443/// Details about the lock which locked the deployment.
6444#[derive(Clone, Default, PartialEq)]
6445#[non_exhaustive]
6446pub struct LockInfo {
6447    /// Unique ID for the lock to be overridden with generation ID in the backend.
6448    pub lock_id: i64,
6449
6450    /// Terraform operation, provided by the caller.
6451    pub operation: std::string::String,
6452
6453    /// Extra information to store with the lock, provided by the caller.
6454    pub info: std::string::String,
6455
6456    /// user@hostname when available
6457    pub who: std::string::String,
6458
6459    /// Terraform version
6460    pub version: std::string::String,
6461
6462    /// Time that the lock was taken.
6463    pub create_time: std::option::Option<wkt::Timestamp>,
6464
6465    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6466}
6467
6468impl LockInfo {
6469    /// Creates a new default instance.
6470    pub fn new() -> Self {
6471        std::default::Default::default()
6472    }
6473
6474    /// Sets the value of [lock_id][crate::model::LockInfo::lock_id].
6475    ///
6476    /// # Example
6477    /// ```ignore,no_run
6478    /// # use google_cloud_config_v1::model::LockInfo;
6479    /// let x = LockInfo::new().set_lock_id(42);
6480    /// ```
6481    pub fn set_lock_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
6482        self.lock_id = v.into();
6483        self
6484    }
6485
6486    /// Sets the value of [operation][crate::model::LockInfo::operation].
6487    ///
6488    /// # Example
6489    /// ```ignore,no_run
6490    /// # use google_cloud_config_v1::model::LockInfo;
6491    /// let x = LockInfo::new().set_operation("example");
6492    /// ```
6493    pub fn set_operation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6494        self.operation = v.into();
6495        self
6496    }
6497
6498    /// Sets the value of [info][crate::model::LockInfo::info].
6499    ///
6500    /// # Example
6501    /// ```ignore,no_run
6502    /// # use google_cloud_config_v1::model::LockInfo;
6503    /// let x = LockInfo::new().set_info("example");
6504    /// ```
6505    pub fn set_info<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6506        self.info = v.into();
6507        self
6508    }
6509
6510    /// Sets the value of [who][crate::model::LockInfo::who].
6511    ///
6512    /// # Example
6513    /// ```ignore,no_run
6514    /// # use google_cloud_config_v1::model::LockInfo;
6515    /// let x = LockInfo::new().set_who("example");
6516    /// ```
6517    pub fn set_who<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6518        self.who = v.into();
6519        self
6520    }
6521
6522    /// Sets the value of [version][crate::model::LockInfo::version].
6523    ///
6524    /// # Example
6525    /// ```ignore,no_run
6526    /// # use google_cloud_config_v1::model::LockInfo;
6527    /// let x = LockInfo::new().set_version("example");
6528    /// ```
6529    pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6530        self.version = v.into();
6531        self
6532    }
6533
6534    /// Sets the value of [create_time][crate::model::LockInfo::create_time].
6535    ///
6536    /// # Example
6537    /// ```ignore,no_run
6538    /// # use google_cloud_config_v1::model::LockInfo;
6539    /// use wkt::Timestamp;
6540    /// let x = LockInfo::new().set_create_time(Timestamp::default()/* use setters */);
6541    /// ```
6542    pub fn set_create_time<T>(mut self, v: T) -> Self
6543    where
6544        T: std::convert::Into<wkt::Timestamp>,
6545    {
6546        self.create_time = std::option::Option::Some(v.into());
6547        self
6548    }
6549
6550    /// Sets or clears the value of [create_time][crate::model::LockInfo::create_time].
6551    ///
6552    /// # Example
6553    /// ```ignore,no_run
6554    /// # use google_cloud_config_v1::model::LockInfo;
6555    /// use wkt::Timestamp;
6556    /// let x = LockInfo::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
6557    /// let x = LockInfo::new().set_or_clear_create_time(None::<Timestamp>);
6558    /// ```
6559    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
6560    where
6561        T: std::convert::Into<wkt::Timestamp>,
6562    {
6563        self.create_time = v.map(|x| x.into());
6564        self
6565    }
6566}
6567
6568impl wkt::message::Message for LockInfo {
6569    fn typename() -> &'static str {
6570        "type.googleapis.com/google.cloud.config.v1.LockInfo"
6571    }
6572}
6573
6574/// A preview represents a set of actions Infra Manager would perform
6575/// to move the resources towards the desired state as specified in the
6576/// configuration.
6577#[derive(Clone, Default, PartialEq)]
6578#[non_exhaustive]
6579pub struct Preview {
6580    /// Identifier. Resource name of the preview. Resource name can be user
6581    /// provided or server generated ID if unspecified. Format:
6582    /// `projects/{project}/locations/{location}/previews/{preview}`
6583    pub name: std::string::String,
6584
6585    /// Output only. Time the preview was created.
6586    pub create_time: std::option::Option<wkt::Timestamp>,
6587
6588    /// Optional. User-defined labels for the preview.
6589    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
6590
6591    /// Output only. Current state of the preview.
6592    pub state: crate::model::preview::State,
6593
6594    /// Optional. Optional deployment reference. If specified, the preview will be
6595    /// performed using the provided deployment's current state and use any
6596    /// relevant fields from the deployment unless explicitly specified in the
6597    /// preview create request.
6598    pub deployment: std::string::String,
6599
6600    /// Optional. Current mode of preview.
6601    pub preview_mode: crate::model::preview::PreviewMode,
6602
6603    /// Required. User-specified Service Account (SA) credentials to be used when
6604    /// previewing resources.
6605    /// Format: `projects/{projectID}/serviceAccounts/{serviceAccount}`
6606    pub service_account: std::string::String,
6607
6608    /// Optional. User-defined location of Cloud Build logs, artifacts, and
6609    /// in Google Cloud Storage.
6610    /// Format: `gs://{bucket}/{folder}`
6611    /// A default bucket will be bootstrapped if the field is not set or empty
6612    /// Default Bucket Format: `gs://<project number>-<region>-blueprint-config`
6613    /// Constraints:
6614    ///
6615    /// - The bucket needs to be in the same project as the deployment
6616    /// - The path cannot be within the path of `gcs_source`
6617    ///   If omitted and deployment resource ref provided has artifacts_gcs_bucket
6618    ///   defined, that artifact bucket is used.
6619    pub artifacts_gcs_bucket: std::option::Option<std::string::String>,
6620
6621    /// Optional. The user-specified Worker Pool resource in which the Cloud Build
6622    /// job will execute. Format
6623    /// projects/{project}/locations/{location}/workerPools/{workerPoolId} If this
6624    /// field is unspecified, the default Cloud Build worker pool will be used. If
6625    /// omitted and deployment resource ref provided has worker_pool defined, that
6626    /// worker pool is used.
6627    pub worker_pool: std::option::Option<std::string::String>,
6628
6629    /// Output only. Code describing any errors that may have occurred.
6630    pub error_code: crate::model::preview::ErrorCode,
6631
6632    /// Output only. Additional information regarding the current state.
6633    pub error_status: std::option::Option<google_cloud_rpc::model::Status>,
6634
6635    /// Output only. Cloud Build instance UUID associated with this preview.
6636    pub build: std::string::String,
6637
6638    /// Output only. Summary of errors encountered during Terraform preview.
6639    /// It has a size limit of 10, i.e. only top 10 errors will be summarized here.
6640    pub tf_errors: std::vec::Vec<crate::model::TerraformError>,
6641
6642    /// Output only. Link to tf-error.ndjson file, which contains the full list of
6643    /// the errors encountered during a Terraform preview.
6644    /// Format: `gs://{bucket}/{object}`.
6645    pub error_logs: std::string::String,
6646
6647    /// Output only. Artifacts from preview.
6648    pub preview_artifacts: std::option::Option<crate::model::PreviewArtifacts>,
6649
6650    /// Output only. Location of preview logs in `gs://{bucket}/{object}` format.
6651    pub logs: std::string::String,
6652
6653    /// Output only. The current Terraform version set on the preview.
6654    /// It is in the format of "Major.Minor.Patch", for example, "1.3.10".
6655    pub tf_version: std::string::String,
6656
6657    /// Optional. The user-specified Terraform version constraint.
6658    /// Example: "=1.3.10".
6659    pub tf_version_constraint: std::option::Option<std::string::String>,
6660
6661    /// Optional. Arbitrary key-value metadata storage e.g. to help client tools
6662    /// identify preview during automation. See
6663    /// <https://google.aip.dev/148#annotations> for details on format and size
6664    /// limitations.
6665    pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
6666
6667    /// Optional. This field specifies the provider configurations.
6668    pub provider_config: std::option::Option<crate::model::ProviderConfig>,
6669
6670    /// Blueprint to preview.
6671    pub blueprint: std::option::Option<crate::model::preview::Blueprint>,
6672
6673    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6674}
6675
6676impl Preview {
6677    /// Creates a new default instance.
6678    pub fn new() -> Self {
6679        std::default::Default::default()
6680    }
6681
6682    /// Sets the value of [name][crate::model::Preview::name].
6683    ///
6684    /// # Example
6685    /// ```ignore,no_run
6686    /// # use google_cloud_config_v1::model::Preview;
6687    /// # let project_id = "project_id";
6688    /// # let location_id = "location_id";
6689    /// # let preview_id = "preview_id";
6690    /// let x = Preview::new().set_name(format!("projects/{project_id}/locations/{location_id}/previews/{preview_id}"));
6691    /// ```
6692    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6693        self.name = v.into();
6694        self
6695    }
6696
6697    /// Sets the value of [create_time][crate::model::Preview::create_time].
6698    ///
6699    /// # Example
6700    /// ```ignore,no_run
6701    /// # use google_cloud_config_v1::model::Preview;
6702    /// use wkt::Timestamp;
6703    /// let x = Preview::new().set_create_time(Timestamp::default()/* use setters */);
6704    /// ```
6705    pub fn set_create_time<T>(mut self, v: T) -> Self
6706    where
6707        T: std::convert::Into<wkt::Timestamp>,
6708    {
6709        self.create_time = std::option::Option::Some(v.into());
6710        self
6711    }
6712
6713    /// Sets or clears the value of [create_time][crate::model::Preview::create_time].
6714    ///
6715    /// # Example
6716    /// ```ignore,no_run
6717    /// # use google_cloud_config_v1::model::Preview;
6718    /// use wkt::Timestamp;
6719    /// let x = Preview::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
6720    /// let x = Preview::new().set_or_clear_create_time(None::<Timestamp>);
6721    /// ```
6722    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
6723    where
6724        T: std::convert::Into<wkt::Timestamp>,
6725    {
6726        self.create_time = v.map(|x| x.into());
6727        self
6728    }
6729
6730    /// Sets the value of [labels][crate::model::Preview::labels].
6731    ///
6732    /// # Example
6733    /// ```ignore,no_run
6734    /// # use google_cloud_config_v1::model::Preview;
6735    /// let x = Preview::new().set_labels([
6736    ///     ("key0", "abc"),
6737    ///     ("key1", "xyz"),
6738    /// ]);
6739    /// ```
6740    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
6741    where
6742        T: std::iter::IntoIterator<Item = (K, V)>,
6743        K: std::convert::Into<std::string::String>,
6744        V: std::convert::Into<std::string::String>,
6745    {
6746        use std::iter::Iterator;
6747        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
6748        self
6749    }
6750
6751    /// Sets the value of [state][crate::model::Preview::state].
6752    ///
6753    /// # Example
6754    /// ```ignore,no_run
6755    /// # use google_cloud_config_v1::model::Preview;
6756    /// use google_cloud_config_v1::model::preview::State;
6757    /// let x0 = Preview::new().set_state(State::Creating);
6758    /// let x1 = Preview::new().set_state(State::Succeeded);
6759    /// let x2 = Preview::new().set_state(State::Applying);
6760    /// ```
6761    pub fn set_state<T: std::convert::Into<crate::model::preview::State>>(mut self, v: T) -> Self {
6762        self.state = v.into();
6763        self
6764    }
6765
6766    /// Sets the value of [deployment][crate::model::Preview::deployment].
6767    ///
6768    /// # Example
6769    /// ```ignore,no_run
6770    /// # use google_cloud_config_v1::model::Preview;
6771    /// # let project_id = "project_id";
6772    /// # let location_id = "location_id";
6773    /// # let deployment_id = "deployment_id";
6774    /// let x = Preview::new().set_deployment(format!("projects/{project_id}/locations/{location_id}/deployments/{deployment_id}"));
6775    /// ```
6776    pub fn set_deployment<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6777        self.deployment = v.into();
6778        self
6779    }
6780
6781    /// Sets the value of [preview_mode][crate::model::Preview::preview_mode].
6782    ///
6783    /// # Example
6784    /// ```ignore,no_run
6785    /// # use google_cloud_config_v1::model::Preview;
6786    /// use google_cloud_config_v1::model::preview::PreviewMode;
6787    /// let x0 = Preview::new().set_preview_mode(PreviewMode::Default);
6788    /// let x1 = Preview::new().set_preview_mode(PreviewMode::Delete);
6789    /// ```
6790    pub fn set_preview_mode<T: std::convert::Into<crate::model::preview::PreviewMode>>(
6791        mut self,
6792        v: T,
6793    ) -> Self {
6794        self.preview_mode = v.into();
6795        self
6796    }
6797
6798    /// Sets the value of [service_account][crate::model::Preview::service_account].
6799    ///
6800    /// # Example
6801    /// ```ignore,no_run
6802    /// # use google_cloud_config_v1::model::Preview;
6803    /// let x = Preview::new().set_service_account("example");
6804    /// ```
6805    pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6806        self.service_account = v.into();
6807        self
6808    }
6809
6810    /// Sets the value of [artifacts_gcs_bucket][crate::model::Preview::artifacts_gcs_bucket].
6811    ///
6812    /// # Example
6813    /// ```ignore,no_run
6814    /// # use google_cloud_config_v1::model::Preview;
6815    /// let x = Preview::new().set_artifacts_gcs_bucket("example");
6816    /// ```
6817    pub fn set_artifacts_gcs_bucket<T>(mut self, v: T) -> Self
6818    where
6819        T: std::convert::Into<std::string::String>,
6820    {
6821        self.artifacts_gcs_bucket = std::option::Option::Some(v.into());
6822        self
6823    }
6824
6825    /// Sets or clears the value of [artifacts_gcs_bucket][crate::model::Preview::artifacts_gcs_bucket].
6826    ///
6827    /// # Example
6828    /// ```ignore,no_run
6829    /// # use google_cloud_config_v1::model::Preview;
6830    /// let x = Preview::new().set_or_clear_artifacts_gcs_bucket(Some("example"));
6831    /// let x = Preview::new().set_or_clear_artifacts_gcs_bucket(None::<String>);
6832    /// ```
6833    pub fn set_or_clear_artifacts_gcs_bucket<T>(mut self, v: std::option::Option<T>) -> Self
6834    where
6835        T: std::convert::Into<std::string::String>,
6836    {
6837        self.artifacts_gcs_bucket = v.map(|x| x.into());
6838        self
6839    }
6840
6841    /// Sets the value of [worker_pool][crate::model::Preview::worker_pool].
6842    ///
6843    /// # Example
6844    /// ```ignore,no_run
6845    /// # use google_cloud_config_v1::model::Preview;
6846    /// let x = Preview::new().set_worker_pool("example");
6847    /// ```
6848    pub fn set_worker_pool<T>(mut self, v: T) -> Self
6849    where
6850        T: std::convert::Into<std::string::String>,
6851    {
6852        self.worker_pool = std::option::Option::Some(v.into());
6853        self
6854    }
6855
6856    /// Sets or clears the value of [worker_pool][crate::model::Preview::worker_pool].
6857    ///
6858    /// # Example
6859    /// ```ignore,no_run
6860    /// # use google_cloud_config_v1::model::Preview;
6861    /// let x = Preview::new().set_or_clear_worker_pool(Some("example"));
6862    /// let x = Preview::new().set_or_clear_worker_pool(None::<String>);
6863    /// ```
6864    pub fn set_or_clear_worker_pool<T>(mut self, v: std::option::Option<T>) -> Self
6865    where
6866        T: std::convert::Into<std::string::String>,
6867    {
6868        self.worker_pool = v.map(|x| x.into());
6869        self
6870    }
6871
6872    /// Sets the value of [error_code][crate::model::Preview::error_code].
6873    ///
6874    /// # Example
6875    /// ```ignore,no_run
6876    /// # use google_cloud_config_v1::model::Preview;
6877    /// use google_cloud_config_v1::model::preview::ErrorCode;
6878    /// let x0 = Preview::new().set_error_code(ErrorCode::CloudBuildPermissionDenied);
6879    /// let x1 = Preview::new().set_error_code(ErrorCode::BucketCreationPermissionDenied);
6880    /// let x2 = Preview::new().set_error_code(ErrorCode::BucketCreationFailed);
6881    /// ```
6882    pub fn set_error_code<T: std::convert::Into<crate::model::preview::ErrorCode>>(
6883        mut self,
6884        v: T,
6885    ) -> Self {
6886        self.error_code = v.into();
6887        self
6888    }
6889
6890    /// Sets the value of [error_status][crate::model::Preview::error_status].
6891    ///
6892    /// # Example
6893    /// ```ignore,no_run
6894    /// # use google_cloud_config_v1::model::Preview;
6895    /// use google_cloud_rpc::model::Status;
6896    /// let x = Preview::new().set_error_status(Status::default()/* use setters */);
6897    /// ```
6898    pub fn set_error_status<T>(mut self, v: T) -> Self
6899    where
6900        T: std::convert::Into<google_cloud_rpc::model::Status>,
6901    {
6902        self.error_status = std::option::Option::Some(v.into());
6903        self
6904    }
6905
6906    /// Sets or clears the value of [error_status][crate::model::Preview::error_status].
6907    ///
6908    /// # Example
6909    /// ```ignore,no_run
6910    /// # use google_cloud_config_v1::model::Preview;
6911    /// use google_cloud_rpc::model::Status;
6912    /// let x = Preview::new().set_or_clear_error_status(Some(Status::default()/* use setters */));
6913    /// let x = Preview::new().set_or_clear_error_status(None::<Status>);
6914    /// ```
6915    pub fn set_or_clear_error_status<T>(mut self, v: std::option::Option<T>) -> Self
6916    where
6917        T: std::convert::Into<google_cloud_rpc::model::Status>,
6918    {
6919        self.error_status = v.map(|x| x.into());
6920        self
6921    }
6922
6923    /// Sets the value of [build][crate::model::Preview::build].
6924    ///
6925    /// # Example
6926    /// ```ignore,no_run
6927    /// # use google_cloud_config_v1::model::Preview;
6928    /// let x = Preview::new().set_build("example");
6929    /// ```
6930    pub fn set_build<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6931        self.build = v.into();
6932        self
6933    }
6934
6935    /// Sets the value of [tf_errors][crate::model::Preview::tf_errors].
6936    ///
6937    /// # Example
6938    /// ```ignore,no_run
6939    /// # use google_cloud_config_v1::model::Preview;
6940    /// use google_cloud_config_v1::model::TerraformError;
6941    /// let x = Preview::new()
6942    ///     .set_tf_errors([
6943    ///         TerraformError::default()/* use setters */,
6944    ///         TerraformError::default()/* use (different) setters */,
6945    ///     ]);
6946    /// ```
6947    pub fn set_tf_errors<T, V>(mut self, v: T) -> Self
6948    where
6949        T: std::iter::IntoIterator<Item = V>,
6950        V: std::convert::Into<crate::model::TerraformError>,
6951    {
6952        use std::iter::Iterator;
6953        self.tf_errors = v.into_iter().map(|i| i.into()).collect();
6954        self
6955    }
6956
6957    /// Sets the value of [error_logs][crate::model::Preview::error_logs].
6958    ///
6959    /// # Example
6960    /// ```ignore,no_run
6961    /// # use google_cloud_config_v1::model::Preview;
6962    /// let x = Preview::new().set_error_logs("example");
6963    /// ```
6964    pub fn set_error_logs<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6965        self.error_logs = v.into();
6966        self
6967    }
6968
6969    /// Sets the value of [preview_artifacts][crate::model::Preview::preview_artifacts].
6970    ///
6971    /// # Example
6972    /// ```ignore,no_run
6973    /// # use google_cloud_config_v1::model::Preview;
6974    /// use google_cloud_config_v1::model::PreviewArtifacts;
6975    /// let x = Preview::new().set_preview_artifacts(PreviewArtifacts::default()/* use setters */);
6976    /// ```
6977    pub fn set_preview_artifacts<T>(mut self, v: T) -> Self
6978    where
6979        T: std::convert::Into<crate::model::PreviewArtifacts>,
6980    {
6981        self.preview_artifacts = std::option::Option::Some(v.into());
6982        self
6983    }
6984
6985    /// Sets or clears the value of [preview_artifacts][crate::model::Preview::preview_artifacts].
6986    ///
6987    /// # Example
6988    /// ```ignore,no_run
6989    /// # use google_cloud_config_v1::model::Preview;
6990    /// use google_cloud_config_v1::model::PreviewArtifacts;
6991    /// let x = Preview::new().set_or_clear_preview_artifacts(Some(PreviewArtifacts::default()/* use setters */));
6992    /// let x = Preview::new().set_or_clear_preview_artifacts(None::<PreviewArtifacts>);
6993    /// ```
6994    pub fn set_or_clear_preview_artifacts<T>(mut self, v: std::option::Option<T>) -> Self
6995    where
6996        T: std::convert::Into<crate::model::PreviewArtifacts>,
6997    {
6998        self.preview_artifacts = v.map(|x| x.into());
6999        self
7000    }
7001
7002    /// Sets the value of [logs][crate::model::Preview::logs].
7003    ///
7004    /// # Example
7005    /// ```ignore,no_run
7006    /// # use google_cloud_config_v1::model::Preview;
7007    /// let x = Preview::new().set_logs("example");
7008    /// ```
7009    pub fn set_logs<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7010        self.logs = v.into();
7011        self
7012    }
7013
7014    /// Sets the value of [tf_version][crate::model::Preview::tf_version].
7015    ///
7016    /// # Example
7017    /// ```ignore,no_run
7018    /// # use google_cloud_config_v1::model::Preview;
7019    /// let x = Preview::new().set_tf_version("example");
7020    /// ```
7021    pub fn set_tf_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7022        self.tf_version = v.into();
7023        self
7024    }
7025
7026    /// Sets the value of [tf_version_constraint][crate::model::Preview::tf_version_constraint].
7027    ///
7028    /// # Example
7029    /// ```ignore,no_run
7030    /// # use google_cloud_config_v1::model::Preview;
7031    /// let x = Preview::new().set_tf_version_constraint("example");
7032    /// ```
7033    pub fn set_tf_version_constraint<T>(mut self, v: T) -> Self
7034    where
7035        T: std::convert::Into<std::string::String>,
7036    {
7037        self.tf_version_constraint = std::option::Option::Some(v.into());
7038        self
7039    }
7040
7041    /// Sets or clears the value of [tf_version_constraint][crate::model::Preview::tf_version_constraint].
7042    ///
7043    /// # Example
7044    /// ```ignore,no_run
7045    /// # use google_cloud_config_v1::model::Preview;
7046    /// let x = Preview::new().set_or_clear_tf_version_constraint(Some("example"));
7047    /// let x = Preview::new().set_or_clear_tf_version_constraint(None::<String>);
7048    /// ```
7049    pub fn set_or_clear_tf_version_constraint<T>(mut self, v: std::option::Option<T>) -> Self
7050    where
7051        T: std::convert::Into<std::string::String>,
7052    {
7053        self.tf_version_constraint = v.map(|x| x.into());
7054        self
7055    }
7056
7057    /// Sets the value of [annotations][crate::model::Preview::annotations].
7058    ///
7059    /// # Example
7060    /// ```ignore,no_run
7061    /// # use google_cloud_config_v1::model::Preview;
7062    /// let x = Preview::new().set_annotations([
7063    ///     ("key0", "abc"),
7064    ///     ("key1", "xyz"),
7065    /// ]);
7066    /// ```
7067    pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
7068    where
7069        T: std::iter::IntoIterator<Item = (K, V)>,
7070        K: std::convert::Into<std::string::String>,
7071        V: std::convert::Into<std::string::String>,
7072    {
7073        use std::iter::Iterator;
7074        self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7075        self
7076    }
7077
7078    /// Sets the value of [provider_config][crate::model::Preview::provider_config].
7079    ///
7080    /// # Example
7081    /// ```ignore,no_run
7082    /// # use google_cloud_config_v1::model::Preview;
7083    /// use google_cloud_config_v1::model::ProviderConfig;
7084    /// let x = Preview::new().set_provider_config(ProviderConfig::default()/* use setters */);
7085    /// ```
7086    pub fn set_provider_config<T>(mut self, v: T) -> Self
7087    where
7088        T: std::convert::Into<crate::model::ProviderConfig>,
7089    {
7090        self.provider_config = std::option::Option::Some(v.into());
7091        self
7092    }
7093
7094    /// Sets or clears the value of [provider_config][crate::model::Preview::provider_config].
7095    ///
7096    /// # Example
7097    /// ```ignore,no_run
7098    /// # use google_cloud_config_v1::model::Preview;
7099    /// use google_cloud_config_v1::model::ProviderConfig;
7100    /// let x = Preview::new().set_or_clear_provider_config(Some(ProviderConfig::default()/* use setters */));
7101    /// let x = Preview::new().set_or_clear_provider_config(None::<ProviderConfig>);
7102    /// ```
7103    pub fn set_or_clear_provider_config<T>(mut self, v: std::option::Option<T>) -> Self
7104    where
7105        T: std::convert::Into<crate::model::ProviderConfig>,
7106    {
7107        self.provider_config = v.map(|x| x.into());
7108        self
7109    }
7110
7111    /// Sets the value of [blueprint][crate::model::Preview::blueprint].
7112    ///
7113    /// Note that all the setters affecting `blueprint` are mutually
7114    /// exclusive.
7115    ///
7116    /// # Example
7117    /// ```ignore,no_run
7118    /// # use google_cloud_config_v1::model::Preview;
7119    /// use google_cloud_config_v1::model::TerraformBlueprint;
7120    /// let x = Preview::new().set_blueprint(Some(
7121    ///     google_cloud_config_v1::model::preview::Blueprint::TerraformBlueprint(TerraformBlueprint::default().into())));
7122    /// ```
7123    pub fn set_blueprint<
7124        T: std::convert::Into<std::option::Option<crate::model::preview::Blueprint>>,
7125    >(
7126        mut self,
7127        v: T,
7128    ) -> Self {
7129        self.blueprint = v.into();
7130        self
7131    }
7132
7133    /// The value of [blueprint][crate::model::Preview::blueprint]
7134    /// if it holds a `TerraformBlueprint`, `None` if the field is not set or
7135    /// holds a different branch.
7136    pub fn terraform_blueprint(
7137        &self,
7138    ) -> std::option::Option<&std::boxed::Box<crate::model::TerraformBlueprint>> {
7139        #[allow(unreachable_patterns)]
7140        self.blueprint.as_ref().and_then(|v| match v {
7141            crate::model::preview::Blueprint::TerraformBlueprint(v) => std::option::Option::Some(v),
7142            _ => std::option::Option::None,
7143        })
7144    }
7145
7146    /// Sets the value of [blueprint][crate::model::Preview::blueprint]
7147    /// to hold a `TerraformBlueprint`.
7148    ///
7149    /// Note that all the setters affecting `blueprint` are
7150    /// mutually exclusive.
7151    ///
7152    /// # Example
7153    /// ```ignore,no_run
7154    /// # use google_cloud_config_v1::model::Preview;
7155    /// use google_cloud_config_v1::model::TerraformBlueprint;
7156    /// let x = Preview::new().set_terraform_blueprint(TerraformBlueprint::default()/* use setters */);
7157    /// assert!(x.terraform_blueprint().is_some());
7158    /// ```
7159    pub fn set_terraform_blueprint<
7160        T: std::convert::Into<std::boxed::Box<crate::model::TerraformBlueprint>>,
7161    >(
7162        mut self,
7163        v: T,
7164    ) -> Self {
7165        self.blueprint = std::option::Option::Some(
7166            crate::model::preview::Blueprint::TerraformBlueprint(v.into()),
7167        );
7168        self
7169    }
7170}
7171
7172impl wkt::message::Message for Preview {
7173    fn typename() -> &'static str {
7174        "type.googleapis.com/google.cloud.config.v1.Preview"
7175    }
7176}
7177
7178/// Defines additional types related to [Preview].
7179pub mod preview {
7180    #[allow(unused_imports)]
7181    use super::*;
7182
7183    /// Possible states of a preview.
7184    ///
7185    /// # Working with unknown values
7186    ///
7187    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7188    /// additional enum variants at any time. Adding new variants is not considered
7189    /// a breaking change. Applications should write their code in anticipation of:
7190    ///
7191    /// - New values appearing in future releases of the client library, **and**
7192    /// - New values received dynamically, without application changes.
7193    ///
7194    /// Please consult the [Working with enums] section in the user guide for some
7195    /// guidelines.
7196    ///
7197    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
7198    #[derive(Clone, Debug, PartialEq)]
7199    #[non_exhaustive]
7200    pub enum State {
7201        /// The default value. This value is used if the state is unknown.
7202        Unspecified,
7203        /// The preview is being created.
7204        Creating,
7205        /// The preview has succeeded.
7206        Succeeded,
7207        /// The preview is being applied.
7208        Applying,
7209        /// The preview is stale. A preview can become stale if a revision has been
7210        /// applied after this preview was created.
7211        Stale,
7212        /// The preview is being deleted.
7213        Deleting,
7214        /// The preview has encountered an unexpected error.
7215        Failed,
7216        /// The preview has been deleted.
7217        Deleted,
7218        /// If set, the enum was initialized with an unknown value.
7219        ///
7220        /// Applications can examine the value using [State::value] or
7221        /// [State::name].
7222        UnknownValue(state::UnknownValue),
7223    }
7224
7225    #[doc(hidden)]
7226    pub mod state {
7227        #[allow(unused_imports)]
7228        use super::*;
7229        #[derive(Clone, Debug, PartialEq)]
7230        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7231    }
7232
7233    impl State {
7234        /// Gets the enum value.
7235        ///
7236        /// Returns `None` if the enum contains an unknown value deserialized from
7237        /// the string representation of enums.
7238        pub fn value(&self) -> std::option::Option<i32> {
7239            match self {
7240                Self::Unspecified => std::option::Option::Some(0),
7241                Self::Creating => std::option::Option::Some(1),
7242                Self::Succeeded => std::option::Option::Some(2),
7243                Self::Applying => std::option::Option::Some(3),
7244                Self::Stale => std::option::Option::Some(4),
7245                Self::Deleting => std::option::Option::Some(5),
7246                Self::Failed => std::option::Option::Some(6),
7247                Self::Deleted => std::option::Option::Some(7),
7248                Self::UnknownValue(u) => u.0.value(),
7249            }
7250        }
7251
7252        /// Gets the enum value as a string.
7253        ///
7254        /// Returns `None` if the enum contains an unknown value deserialized from
7255        /// the integer representation of enums.
7256        pub fn name(&self) -> std::option::Option<&str> {
7257            match self {
7258                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
7259                Self::Creating => std::option::Option::Some("CREATING"),
7260                Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
7261                Self::Applying => std::option::Option::Some("APPLYING"),
7262                Self::Stale => std::option::Option::Some("STALE"),
7263                Self::Deleting => std::option::Option::Some("DELETING"),
7264                Self::Failed => std::option::Option::Some("FAILED"),
7265                Self::Deleted => std::option::Option::Some("DELETED"),
7266                Self::UnknownValue(u) => u.0.name(),
7267            }
7268        }
7269    }
7270
7271    impl std::default::Default for State {
7272        fn default() -> Self {
7273            use std::convert::From;
7274            Self::from(0)
7275        }
7276    }
7277
7278    impl std::fmt::Display for State {
7279        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7280            wkt::internal::display_enum(f, self.name(), self.value())
7281        }
7282    }
7283
7284    impl std::convert::From<i32> for State {
7285        fn from(value: i32) -> Self {
7286            match value {
7287                0 => Self::Unspecified,
7288                1 => Self::Creating,
7289                2 => Self::Succeeded,
7290                3 => Self::Applying,
7291                4 => Self::Stale,
7292                5 => Self::Deleting,
7293                6 => Self::Failed,
7294                7 => Self::Deleted,
7295                _ => Self::UnknownValue(state::UnknownValue(
7296                    wkt::internal::UnknownEnumValue::Integer(value),
7297                )),
7298            }
7299        }
7300    }
7301
7302    impl std::convert::From<&str> for State {
7303        fn from(value: &str) -> Self {
7304            use std::string::ToString;
7305            match value {
7306                "STATE_UNSPECIFIED" => Self::Unspecified,
7307                "CREATING" => Self::Creating,
7308                "SUCCEEDED" => Self::Succeeded,
7309                "APPLYING" => Self::Applying,
7310                "STALE" => Self::Stale,
7311                "DELETING" => Self::Deleting,
7312                "FAILED" => Self::Failed,
7313                "DELETED" => Self::Deleted,
7314                _ => Self::UnknownValue(state::UnknownValue(
7315                    wkt::internal::UnknownEnumValue::String(value.to_string()),
7316                )),
7317            }
7318        }
7319    }
7320
7321    impl serde::ser::Serialize for State {
7322        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7323        where
7324            S: serde::Serializer,
7325        {
7326            match self {
7327                Self::Unspecified => serializer.serialize_i32(0),
7328                Self::Creating => serializer.serialize_i32(1),
7329                Self::Succeeded => serializer.serialize_i32(2),
7330                Self::Applying => serializer.serialize_i32(3),
7331                Self::Stale => serializer.serialize_i32(4),
7332                Self::Deleting => serializer.serialize_i32(5),
7333                Self::Failed => serializer.serialize_i32(6),
7334                Self::Deleted => serializer.serialize_i32(7),
7335                Self::UnknownValue(u) => u.0.serialize(serializer),
7336            }
7337        }
7338    }
7339
7340    impl<'de> serde::de::Deserialize<'de> for State {
7341        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7342        where
7343            D: serde::Deserializer<'de>,
7344        {
7345            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
7346                ".google.cloud.config.v1.Preview.State",
7347            ))
7348        }
7349    }
7350
7351    /// Preview mode provides options for customizing preview operations.
7352    ///
7353    /// # Working with unknown values
7354    ///
7355    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7356    /// additional enum variants at any time. Adding new variants is not considered
7357    /// a breaking change. Applications should write their code in anticipation of:
7358    ///
7359    /// - New values appearing in future releases of the client library, **and**
7360    /// - New values received dynamically, without application changes.
7361    ///
7362    /// Please consult the [Working with enums] section in the user guide for some
7363    /// guidelines.
7364    ///
7365    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
7366    #[derive(Clone, Debug, PartialEq)]
7367    #[non_exhaustive]
7368    pub enum PreviewMode {
7369        /// Unspecified policy, default mode will be used.
7370        Unspecified,
7371        /// DEFAULT mode generates an execution plan for reconciling current resource
7372        /// state into expected resource state.
7373        Default,
7374        /// DELETE mode generates as execution plan for destroying current resources.
7375        Delete,
7376        /// If set, the enum was initialized with an unknown value.
7377        ///
7378        /// Applications can examine the value using [PreviewMode::value] or
7379        /// [PreviewMode::name].
7380        UnknownValue(preview_mode::UnknownValue),
7381    }
7382
7383    #[doc(hidden)]
7384    pub mod preview_mode {
7385        #[allow(unused_imports)]
7386        use super::*;
7387        #[derive(Clone, Debug, PartialEq)]
7388        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7389    }
7390
7391    impl PreviewMode {
7392        /// Gets the enum value.
7393        ///
7394        /// Returns `None` if the enum contains an unknown value deserialized from
7395        /// the string representation of enums.
7396        pub fn value(&self) -> std::option::Option<i32> {
7397            match self {
7398                Self::Unspecified => std::option::Option::Some(0),
7399                Self::Default => std::option::Option::Some(1),
7400                Self::Delete => std::option::Option::Some(2),
7401                Self::UnknownValue(u) => u.0.value(),
7402            }
7403        }
7404
7405        /// Gets the enum value as a string.
7406        ///
7407        /// Returns `None` if the enum contains an unknown value deserialized from
7408        /// the integer representation of enums.
7409        pub fn name(&self) -> std::option::Option<&str> {
7410            match self {
7411                Self::Unspecified => std::option::Option::Some("PREVIEW_MODE_UNSPECIFIED"),
7412                Self::Default => std::option::Option::Some("DEFAULT"),
7413                Self::Delete => std::option::Option::Some("DELETE"),
7414                Self::UnknownValue(u) => u.0.name(),
7415            }
7416        }
7417    }
7418
7419    impl std::default::Default for PreviewMode {
7420        fn default() -> Self {
7421            use std::convert::From;
7422            Self::from(0)
7423        }
7424    }
7425
7426    impl std::fmt::Display for PreviewMode {
7427        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7428            wkt::internal::display_enum(f, self.name(), self.value())
7429        }
7430    }
7431
7432    impl std::convert::From<i32> for PreviewMode {
7433        fn from(value: i32) -> Self {
7434            match value {
7435                0 => Self::Unspecified,
7436                1 => Self::Default,
7437                2 => Self::Delete,
7438                _ => Self::UnknownValue(preview_mode::UnknownValue(
7439                    wkt::internal::UnknownEnumValue::Integer(value),
7440                )),
7441            }
7442        }
7443    }
7444
7445    impl std::convert::From<&str> for PreviewMode {
7446        fn from(value: &str) -> Self {
7447            use std::string::ToString;
7448            match value {
7449                "PREVIEW_MODE_UNSPECIFIED" => Self::Unspecified,
7450                "DEFAULT" => Self::Default,
7451                "DELETE" => Self::Delete,
7452                _ => Self::UnknownValue(preview_mode::UnknownValue(
7453                    wkt::internal::UnknownEnumValue::String(value.to_string()),
7454                )),
7455            }
7456        }
7457    }
7458
7459    impl serde::ser::Serialize for PreviewMode {
7460        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7461        where
7462            S: serde::Serializer,
7463        {
7464            match self {
7465                Self::Unspecified => serializer.serialize_i32(0),
7466                Self::Default => serializer.serialize_i32(1),
7467                Self::Delete => serializer.serialize_i32(2),
7468                Self::UnknownValue(u) => u.0.serialize(serializer),
7469            }
7470        }
7471    }
7472
7473    impl<'de> serde::de::Deserialize<'de> for PreviewMode {
7474        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7475        where
7476            D: serde::Deserializer<'de>,
7477        {
7478            deserializer.deserialize_any(wkt::internal::EnumVisitor::<PreviewMode>::new(
7479                ".google.cloud.config.v1.Preview.PreviewMode",
7480            ))
7481        }
7482    }
7483
7484    /// Possible errors that can occur with previews.
7485    ///
7486    /// # Working with unknown values
7487    ///
7488    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7489    /// additional enum variants at any time. Adding new variants is not considered
7490    /// a breaking change. Applications should write their code in anticipation of:
7491    ///
7492    /// - New values appearing in future releases of the client library, **and**
7493    /// - New values received dynamically, without application changes.
7494    ///
7495    /// Please consult the [Working with enums] section in the user guide for some
7496    /// guidelines.
7497    ///
7498    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
7499    #[derive(Clone, Debug, PartialEq)]
7500    #[non_exhaustive]
7501    pub enum ErrorCode {
7502        /// No error code was specified.
7503        Unspecified,
7504        /// Cloud Build failed due to a permissions issue.
7505        CloudBuildPermissionDenied,
7506        /// Cloud Storage bucket failed to create due to a permissions issue.
7507        BucketCreationPermissionDenied,
7508        /// Cloud Storage bucket failed for a non-permissions-related issue.
7509        BucketCreationFailed,
7510        /// Acquiring lock on provided deployment reference failed.
7511        DeploymentLockAcquireFailed,
7512        /// Preview encountered an error when trying to access Cloud Build API.
7513        PreviewBuildApiFailed,
7514        /// Preview created a build but build failed and logs were generated.
7515        PreviewBuildRunFailed,
7516        /// Failed to import values from an external source.
7517        ExternalValueSourceImportFailed,
7518        /// If set, the enum was initialized with an unknown value.
7519        ///
7520        /// Applications can examine the value using [ErrorCode::value] or
7521        /// [ErrorCode::name].
7522        UnknownValue(error_code::UnknownValue),
7523    }
7524
7525    #[doc(hidden)]
7526    pub mod error_code {
7527        #[allow(unused_imports)]
7528        use super::*;
7529        #[derive(Clone, Debug, PartialEq)]
7530        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7531    }
7532
7533    impl ErrorCode {
7534        /// Gets the enum value.
7535        ///
7536        /// Returns `None` if the enum contains an unknown value deserialized from
7537        /// the string representation of enums.
7538        pub fn value(&self) -> std::option::Option<i32> {
7539            match self {
7540                Self::Unspecified => std::option::Option::Some(0),
7541                Self::CloudBuildPermissionDenied => std::option::Option::Some(1),
7542                Self::BucketCreationPermissionDenied => std::option::Option::Some(2),
7543                Self::BucketCreationFailed => std::option::Option::Some(3),
7544                Self::DeploymentLockAcquireFailed => std::option::Option::Some(4),
7545                Self::PreviewBuildApiFailed => std::option::Option::Some(5),
7546                Self::PreviewBuildRunFailed => std::option::Option::Some(6),
7547                Self::ExternalValueSourceImportFailed => std::option::Option::Some(7),
7548                Self::UnknownValue(u) => u.0.value(),
7549            }
7550        }
7551
7552        /// Gets the enum value as a string.
7553        ///
7554        /// Returns `None` if the enum contains an unknown value deserialized from
7555        /// the integer representation of enums.
7556        pub fn name(&self) -> std::option::Option<&str> {
7557            match self {
7558                Self::Unspecified => std::option::Option::Some("ERROR_CODE_UNSPECIFIED"),
7559                Self::CloudBuildPermissionDenied => {
7560                    std::option::Option::Some("CLOUD_BUILD_PERMISSION_DENIED")
7561                }
7562                Self::BucketCreationPermissionDenied => {
7563                    std::option::Option::Some("BUCKET_CREATION_PERMISSION_DENIED")
7564                }
7565                Self::BucketCreationFailed => std::option::Option::Some("BUCKET_CREATION_FAILED"),
7566                Self::DeploymentLockAcquireFailed => {
7567                    std::option::Option::Some("DEPLOYMENT_LOCK_ACQUIRE_FAILED")
7568                }
7569                Self::PreviewBuildApiFailed => {
7570                    std::option::Option::Some("PREVIEW_BUILD_API_FAILED")
7571                }
7572                Self::PreviewBuildRunFailed => {
7573                    std::option::Option::Some("PREVIEW_BUILD_RUN_FAILED")
7574                }
7575                Self::ExternalValueSourceImportFailed => {
7576                    std::option::Option::Some("EXTERNAL_VALUE_SOURCE_IMPORT_FAILED")
7577                }
7578                Self::UnknownValue(u) => u.0.name(),
7579            }
7580        }
7581    }
7582
7583    impl std::default::Default for ErrorCode {
7584        fn default() -> Self {
7585            use std::convert::From;
7586            Self::from(0)
7587        }
7588    }
7589
7590    impl std::fmt::Display for ErrorCode {
7591        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7592            wkt::internal::display_enum(f, self.name(), self.value())
7593        }
7594    }
7595
7596    impl std::convert::From<i32> for ErrorCode {
7597        fn from(value: i32) -> Self {
7598            match value {
7599                0 => Self::Unspecified,
7600                1 => Self::CloudBuildPermissionDenied,
7601                2 => Self::BucketCreationPermissionDenied,
7602                3 => Self::BucketCreationFailed,
7603                4 => Self::DeploymentLockAcquireFailed,
7604                5 => Self::PreviewBuildApiFailed,
7605                6 => Self::PreviewBuildRunFailed,
7606                7 => Self::ExternalValueSourceImportFailed,
7607                _ => Self::UnknownValue(error_code::UnknownValue(
7608                    wkt::internal::UnknownEnumValue::Integer(value),
7609                )),
7610            }
7611        }
7612    }
7613
7614    impl std::convert::From<&str> for ErrorCode {
7615        fn from(value: &str) -> Self {
7616            use std::string::ToString;
7617            match value {
7618                "ERROR_CODE_UNSPECIFIED" => Self::Unspecified,
7619                "CLOUD_BUILD_PERMISSION_DENIED" => Self::CloudBuildPermissionDenied,
7620                "BUCKET_CREATION_PERMISSION_DENIED" => Self::BucketCreationPermissionDenied,
7621                "BUCKET_CREATION_FAILED" => Self::BucketCreationFailed,
7622                "DEPLOYMENT_LOCK_ACQUIRE_FAILED" => Self::DeploymentLockAcquireFailed,
7623                "PREVIEW_BUILD_API_FAILED" => Self::PreviewBuildApiFailed,
7624                "PREVIEW_BUILD_RUN_FAILED" => Self::PreviewBuildRunFailed,
7625                "EXTERNAL_VALUE_SOURCE_IMPORT_FAILED" => Self::ExternalValueSourceImportFailed,
7626                _ => Self::UnknownValue(error_code::UnknownValue(
7627                    wkt::internal::UnknownEnumValue::String(value.to_string()),
7628                )),
7629            }
7630        }
7631    }
7632
7633    impl serde::ser::Serialize for ErrorCode {
7634        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7635        where
7636            S: serde::Serializer,
7637        {
7638            match self {
7639                Self::Unspecified => serializer.serialize_i32(0),
7640                Self::CloudBuildPermissionDenied => serializer.serialize_i32(1),
7641                Self::BucketCreationPermissionDenied => serializer.serialize_i32(2),
7642                Self::BucketCreationFailed => serializer.serialize_i32(3),
7643                Self::DeploymentLockAcquireFailed => serializer.serialize_i32(4),
7644                Self::PreviewBuildApiFailed => serializer.serialize_i32(5),
7645                Self::PreviewBuildRunFailed => serializer.serialize_i32(6),
7646                Self::ExternalValueSourceImportFailed => serializer.serialize_i32(7),
7647                Self::UnknownValue(u) => u.0.serialize(serializer),
7648            }
7649        }
7650    }
7651
7652    impl<'de> serde::de::Deserialize<'de> for ErrorCode {
7653        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7654        where
7655            D: serde::Deserializer<'de>,
7656        {
7657            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ErrorCode>::new(
7658                ".google.cloud.config.v1.Preview.ErrorCode",
7659            ))
7660        }
7661    }
7662
7663    /// Blueprint to preview.
7664    #[derive(Clone, Debug, PartialEq)]
7665    #[non_exhaustive]
7666    pub enum Blueprint {
7667        /// The terraform blueprint to preview.
7668        TerraformBlueprint(std::boxed::Box<crate::model::TerraformBlueprint>),
7669    }
7670}
7671
7672/// Ephemeral metadata content describing the state of a preview operation.
7673#[derive(Clone, Default, PartialEq)]
7674#[non_exhaustive]
7675pub struct PreviewOperationMetadata {
7676    /// The current step the preview operation is running.
7677    pub step: crate::model::preview_operation_metadata::PreviewStep,
7678
7679    /// Artifacts from preview.
7680    pub preview_artifacts: std::option::Option<crate::model::PreviewArtifacts>,
7681
7682    /// Output only. Location of preview logs in `gs://{bucket}/{object}` format.
7683    pub logs: std::string::String,
7684
7685    /// Output only. Cloud Build instance UUID associated with this preview.
7686    pub build: std::string::String,
7687
7688    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7689}
7690
7691impl PreviewOperationMetadata {
7692    /// Creates a new default instance.
7693    pub fn new() -> Self {
7694        std::default::Default::default()
7695    }
7696
7697    /// Sets the value of [step][crate::model::PreviewOperationMetadata::step].
7698    ///
7699    /// # Example
7700    /// ```ignore,no_run
7701    /// # use google_cloud_config_v1::model::PreviewOperationMetadata;
7702    /// use google_cloud_config_v1::model::preview_operation_metadata::PreviewStep;
7703    /// let x0 = PreviewOperationMetadata::new().set_step(PreviewStep::PreparingStorageBucket);
7704    /// let x1 = PreviewOperationMetadata::new().set_step(PreviewStep::DownloadingBlueprint);
7705    /// let x2 = PreviewOperationMetadata::new().set_step(PreviewStep::RunningTfInit);
7706    /// ```
7707    pub fn set_step<
7708        T: std::convert::Into<crate::model::preview_operation_metadata::PreviewStep>,
7709    >(
7710        mut self,
7711        v: T,
7712    ) -> Self {
7713        self.step = v.into();
7714        self
7715    }
7716
7717    /// Sets the value of [preview_artifacts][crate::model::PreviewOperationMetadata::preview_artifacts].
7718    ///
7719    /// # Example
7720    /// ```ignore,no_run
7721    /// # use google_cloud_config_v1::model::PreviewOperationMetadata;
7722    /// use google_cloud_config_v1::model::PreviewArtifacts;
7723    /// let x = PreviewOperationMetadata::new().set_preview_artifacts(PreviewArtifacts::default()/* use setters */);
7724    /// ```
7725    pub fn set_preview_artifacts<T>(mut self, v: T) -> Self
7726    where
7727        T: std::convert::Into<crate::model::PreviewArtifacts>,
7728    {
7729        self.preview_artifacts = std::option::Option::Some(v.into());
7730        self
7731    }
7732
7733    /// Sets or clears the value of [preview_artifacts][crate::model::PreviewOperationMetadata::preview_artifacts].
7734    ///
7735    /// # Example
7736    /// ```ignore,no_run
7737    /// # use google_cloud_config_v1::model::PreviewOperationMetadata;
7738    /// use google_cloud_config_v1::model::PreviewArtifacts;
7739    /// let x = PreviewOperationMetadata::new().set_or_clear_preview_artifacts(Some(PreviewArtifacts::default()/* use setters */));
7740    /// let x = PreviewOperationMetadata::new().set_or_clear_preview_artifacts(None::<PreviewArtifacts>);
7741    /// ```
7742    pub fn set_or_clear_preview_artifacts<T>(mut self, v: std::option::Option<T>) -> Self
7743    where
7744        T: std::convert::Into<crate::model::PreviewArtifacts>,
7745    {
7746        self.preview_artifacts = v.map(|x| x.into());
7747        self
7748    }
7749
7750    /// Sets the value of [logs][crate::model::PreviewOperationMetadata::logs].
7751    ///
7752    /// # Example
7753    /// ```ignore,no_run
7754    /// # use google_cloud_config_v1::model::PreviewOperationMetadata;
7755    /// let x = PreviewOperationMetadata::new().set_logs("example");
7756    /// ```
7757    pub fn set_logs<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7758        self.logs = v.into();
7759        self
7760    }
7761
7762    /// Sets the value of [build][crate::model::PreviewOperationMetadata::build].
7763    ///
7764    /// # Example
7765    /// ```ignore,no_run
7766    /// # use google_cloud_config_v1::model::PreviewOperationMetadata;
7767    /// let x = PreviewOperationMetadata::new().set_build("example");
7768    /// ```
7769    pub fn set_build<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7770        self.build = v.into();
7771        self
7772    }
7773}
7774
7775impl wkt::message::Message for PreviewOperationMetadata {
7776    fn typename() -> &'static str {
7777        "type.googleapis.com/google.cloud.config.v1.PreviewOperationMetadata"
7778    }
7779}
7780
7781/// Defines additional types related to [PreviewOperationMetadata].
7782pub mod preview_operation_metadata {
7783    #[allow(unused_imports)]
7784    use super::*;
7785
7786    /// The possible steps a preview may be running.
7787    ///
7788    /// # Working with unknown values
7789    ///
7790    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7791    /// additional enum variants at any time. Adding new variants is not considered
7792    /// a breaking change. Applications should write their code in anticipation of:
7793    ///
7794    /// - New values appearing in future releases of the client library, **and**
7795    /// - New values received dynamically, without application changes.
7796    ///
7797    /// Please consult the [Working with enums] section in the user guide for some
7798    /// guidelines.
7799    ///
7800    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
7801    #[derive(Clone, Debug, PartialEq)]
7802    #[non_exhaustive]
7803    pub enum PreviewStep {
7804        /// Unspecified preview step.
7805        Unspecified,
7806        /// Infra Manager is creating a Google Cloud Storage bucket to store
7807        /// artifacts and metadata about the preview.
7808        PreparingStorageBucket,
7809        /// Downloading the blueprint onto the Google Cloud Storage bucket.
7810        DownloadingBlueprint,
7811        /// Initializing Terraform using `terraform init`.
7812        RunningTfInit,
7813        /// Running `terraform plan`.
7814        RunningTfPlan,
7815        /// Fetching a deployment.
7816        FetchingDeployment,
7817        /// Locking a deployment.
7818        LockingDeployment,
7819        /// Unlocking a deployment.
7820        UnlockingDeployment,
7821        /// Operation was successful.
7822        Succeeded,
7823        /// Operation failed.
7824        Failed,
7825        /// Validating the provided repository.
7826        ValidatingRepository,
7827        /// If set, the enum was initialized with an unknown value.
7828        ///
7829        /// Applications can examine the value using [PreviewStep::value] or
7830        /// [PreviewStep::name].
7831        UnknownValue(preview_step::UnknownValue),
7832    }
7833
7834    #[doc(hidden)]
7835    pub mod preview_step {
7836        #[allow(unused_imports)]
7837        use super::*;
7838        #[derive(Clone, Debug, PartialEq)]
7839        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7840    }
7841
7842    impl PreviewStep {
7843        /// Gets the enum value.
7844        ///
7845        /// Returns `None` if the enum contains an unknown value deserialized from
7846        /// the string representation of enums.
7847        pub fn value(&self) -> std::option::Option<i32> {
7848            match self {
7849                Self::Unspecified => std::option::Option::Some(0),
7850                Self::PreparingStorageBucket => std::option::Option::Some(1),
7851                Self::DownloadingBlueprint => std::option::Option::Some(2),
7852                Self::RunningTfInit => std::option::Option::Some(3),
7853                Self::RunningTfPlan => std::option::Option::Some(4),
7854                Self::FetchingDeployment => std::option::Option::Some(5),
7855                Self::LockingDeployment => std::option::Option::Some(6),
7856                Self::UnlockingDeployment => std::option::Option::Some(7),
7857                Self::Succeeded => std::option::Option::Some(8),
7858                Self::Failed => std::option::Option::Some(9),
7859                Self::ValidatingRepository => std::option::Option::Some(10),
7860                Self::UnknownValue(u) => u.0.value(),
7861            }
7862        }
7863
7864        /// Gets the enum value as a string.
7865        ///
7866        /// Returns `None` if the enum contains an unknown value deserialized from
7867        /// the integer representation of enums.
7868        pub fn name(&self) -> std::option::Option<&str> {
7869            match self {
7870                Self::Unspecified => std::option::Option::Some("PREVIEW_STEP_UNSPECIFIED"),
7871                Self::PreparingStorageBucket => {
7872                    std::option::Option::Some("PREPARING_STORAGE_BUCKET")
7873                }
7874                Self::DownloadingBlueprint => std::option::Option::Some("DOWNLOADING_BLUEPRINT"),
7875                Self::RunningTfInit => std::option::Option::Some("RUNNING_TF_INIT"),
7876                Self::RunningTfPlan => std::option::Option::Some("RUNNING_TF_PLAN"),
7877                Self::FetchingDeployment => std::option::Option::Some("FETCHING_DEPLOYMENT"),
7878                Self::LockingDeployment => std::option::Option::Some("LOCKING_DEPLOYMENT"),
7879                Self::UnlockingDeployment => std::option::Option::Some("UNLOCKING_DEPLOYMENT"),
7880                Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
7881                Self::Failed => std::option::Option::Some("FAILED"),
7882                Self::ValidatingRepository => std::option::Option::Some("VALIDATING_REPOSITORY"),
7883                Self::UnknownValue(u) => u.0.name(),
7884            }
7885        }
7886    }
7887
7888    impl std::default::Default for PreviewStep {
7889        fn default() -> Self {
7890            use std::convert::From;
7891            Self::from(0)
7892        }
7893    }
7894
7895    impl std::fmt::Display for PreviewStep {
7896        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7897            wkt::internal::display_enum(f, self.name(), self.value())
7898        }
7899    }
7900
7901    impl std::convert::From<i32> for PreviewStep {
7902        fn from(value: i32) -> Self {
7903            match value {
7904                0 => Self::Unspecified,
7905                1 => Self::PreparingStorageBucket,
7906                2 => Self::DownloadingBlueprint,
7907                3 => Self::RunningTfInit,
7908                4 => Self::RunningTfPlan,
7909                5 => Self::FetchingDeployment,
7910                6 => Self::LockingDeployment,
7911                7 => Self::UnlockingDeployment,
7912                8 => Self::Succeeded,
7913                9 => Self::Failed,
7914                10 => Self::ValidatingRepository,
7915                _ => Self::UnknownValue(preview_step::UnknownValue(
7916                    wkt::internal::UnknownEnumValue::Integer(value),
7917                )),
7918            }
7919        }
7920    }
7921
7922    impl std::convert::From<&str> for PreviewStep {
7923        fn from(value: &str) -> Self {
7924            use std::string::ToString;
7925            match value {
7926                "PREVIEW_STEP_UNSPECIFIED" => Self::Unspecified,
7927                "PREPARING_STORAGE_BUCKET" => Self::PreparingStorageBucket,
7928                "DOWNLOADING_BLUEPRINT" => Self::DownloadingBlueprint,
7929                "RUNNING_TF_INIT" => Self::RunningTfInit,
7930                "RUNNING_TF_PLAN" => Self::RunningTfPlan,
7931                "FETCHING_DEPLOYMENT" => Self::FetchingDeployment,
7932                "LOCKING_DEPLOYMENT" => Self::LockingDeployment,
7933                "UNLOCKING_DEPLOYMENT" => Self::UnlockingDeployment,
7934                "SUCCEEDED" => Self::Succeeded,
7935                "FAILED" => Self::Failed,
7936                "VALIDATING_REPOSITORY" => Self::ValidatingRepository,
7937                _ => Self::UnknownValue(preview_step::UnknownValue(
7938                    wkt::internal::UnknownEnumValue::String(value.to_string()),
7939                )),
7940            }
7941        }
7942    }
7943
7944    impl serde::ser::Serialize for PreviewStep {
7945        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7946        where
7947            S: serde::Serializer,
7948        {
7949            match self {
7950                Self::Unspecified => serializer.serialize_i32(0),
7951                Self::PreparingStorageBucket => serializer.serialize_i32(1),
7952                Self::DownloadingBlueprint => serializer.serialize_i32(2),
7953                Self::RunningTfInit => serializer.serialize_i32(3),
7954                Self::RunningTfPlan => serializer.serialize_i32(4),
7955                Self::FetchingDeployment => serializer.serialize_i32(5),
7956                Self::LockingDeployment => serializer.serialize_i32(6),
7957                Self::UnlockingDeployment => serializer.serialize_i32(7),
7958                Self::Succeeded => serializer.serialize_i32(8),
7959                Self::Failed => serializer.serialize_i32(9),
7960                Self::ValidatingRepository => serializer.serialize_i32(10),
7961                Self::UnknownValue(u) => u.0.serialize(serializer),
7962            }
7963        }
7964    }
7965
7966    impl<'de> serde::de::Deserialize<'de> for PreviewStep {
7967        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7968        where
7969            D: serde::Deserializer<'de>,
7970        {
7971            deserializer.deserialize_any(wkt::internal::EnumVisitor::<PreviewStep>::new(
7972                ".google.cloud.config.v1.PreviewOperationMetadata.PreviewStep",
7973            ))
7974        }
7975    }
7976}
7977
7978/// Artifacts created by preview.
7979#[derive(Clone, Default, PartialEq)]
7980#[non_exhaustive]
7981pub struct PreviewArtifacts {
7982    /// Output only. Location of a blueprint copy and other content in Google Cloud
7983    /// Storage. Format: `gs://{bucket}/{object}`
7984    pub content: std::string::String,
7985
7986    /// Output only. Location of artifacts in Google Cloud Storage.
7987    /// Format: `gs://{bucket}/{object}`
7988    pub artifacts: std::string::String,
7989
7990    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7991}
7992
7993impl PreviewArtifacts {
7994    /// Creates a new default instance.
7995    pub fn new() -> Self {
7996        std::default::Default::default()
7997    }
7998
7999    /// Sets the value of [content][crate::model::PreviewArtifacts::content].
8000    ///
8001    /// # Example
8002    /// ```ignore,no_run
8003    /// # use google_cloud_config_v1::model::PreviewArtifacts;
8004    /// let x = PreviewArtifacts::new().set_content("example");
8005    /// ```
8006    pub fn set_content<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8007        self.content = v.into();
8008        self
8009    }
8010
8011    /// Sets the value of [artifacts][crate::model::PreviewArtifacts::artifacts].
8012    ///
8013    /// # Example
8014    /// ```ignore,no_run
8015    /// # use google_cloud_config_v1::model::PreviewArtifacts;
8016    /// let x = PreviewArtifacts::new().set_artifacts("example");
8017    /// ```
8018    pub fn set_artifacts<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8019        self.artifacts = v.into();
8020        self
8021    }
8022}
8023
8024impl wkt::message::Message for PreviewArtifacts {
8025    fn typename() -> &'static str {
8026        "type.googleapis.com/google.cloud.config.v1.PreviewArtifacts"
8027    }
8028}
8029
8030/// A request to create a preview.
8031#[derive(Clone, Default, PartialEq)]
8032#[non_exhaustive]
8033pub struct CreatePreviewRequest {
8034    /// Required. The parent in whose context the Preview is created. The parent
8035    /// value is in the format: 'projects/{project_id}/locations/{location}'.
8036    pub parent: std::string::String,
8037
8038    /// Optional. The preview ID.
8039    pub preview_id: std::string::String,
8040
8041    /// Required. [Preview][google.cloud.config.v1.Preview] resource to be created.
8042    ///
8043    /// [google.cloud.config.v1.Preview]: crate::model::Preview
8044    pub preview: std::option::Option<crate::model::Preview>,
8045
8046    /// Optional. An optional request ID to identify requests. Specify a unique
8047    /// request ID so that if you must retry your request, the server will know to
8048    /// ignore the request if it has already been completed. The server will
8049    /// guarantee that for at least 60 minutes since the first request.
8050    ///
8051    /// For example, consider a situation where you make an initial request and the
8052    /// request times out. If you make the request again with the same request ID,
8053    /// the server can check if original operation with the same request ID was
8054    /// received, and if so, will ignore the second request. This prevents clients
8055    /// from accidentally creating duplicate commitments.
8056    ///
8057    /// The request ID must be a valid UUID with the exception that zero UUID is
8058    /// not supported (00000000-0000-0000-0000-000000000000).
8059    pub request_id: std::string::String,
8060
8061    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8062}
8063
8064impl CreatePreviewRequest {
8065    /// Creates a new default instance.
8066    pub fn new() -> Self {
8067        std::default::Default::default()
8068    }
8069
8070    /// Sets the value of [parent][crate::model::CreatePreviewRequest::parent].
8071    ///
8072    /// # Example
8073    /// ```ignore,no_run
8074    /// # use google_cloud_config_v1::model::CreatePreviewRequest;
8075    /// let x = CreatePreviewRequest::new().set_parent("example");
8076    /// ```
8077    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8078        self.parent = v.into();
8079        self
8080    }
8081
8082    /// Sets the value of [preview_id][crate::model::CreatePreviewRequest::preview_id].
8083    ///
8084    /// # Example
8085    /// ```ignore,no_run
8086    /// # use google_cloud_config_v1::model::CreatePreviewRequest;
8087    /// let x = CreatePreviewRequest::new().set_preview_id("example");
8088    /// ```
8089    pub fn set_preview_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8090        self.preview_id = v.into();
8091        self
8092    }
8093
8094    /// Sets the value of [preview][crate::model::CreatePreviewRequest::preview].
8095    ///
8096    /// # Example
8097    /// ```ignore,no_run
8098    /// # use google_cloud_config_v1::model::CreatePreviewRequest;
8099    /// use google_cloud_config_v1::model::Preview;
8100    /// let x = CreatePreviewRequest::new().set_preview(Preview::default()/* use setters */);
8101    /// ```
8102    pub fn set_preview<T>(mut self, v: T) -> Self
8103    where
8104        T: std::convert::Into<crate::model::Preview>,
8105    {
8106        self.preview = std::option::Option::Some(v.into());
8107        self
8108    }
8109
8110    /// Sets or clears the value of [preview][crate::model::CreatePreviewRequest::preview].
8111    ///
8112    /// # Example
8113    /// ```ignore,no_run
8114    /// # use google_cloud_config_v1::model::CreatePreviewRequest;
8115    /// use google_cloud_config_v1::model::Preview;
8116    /// let x = CreatePreviewRequest::new().set_or_clear_preview(Some(Preview::default()/* use setters */));
8117    /// let x = CreatePreviewRequest::new().set_or_clear_preview(None::<Preview>);
8118    /// ```
8119    pub fn set_or_clear_preview<T>(mut self, v: std::option::Option<T>) -> Self
8120    where
8121        T: std::convert::Into<crate::model::Preview>,
8122    {
8123        self.preview = v.map(|x| x.into());
8124        self
8125    }
8126
8127    /// Sets the value of [request_id][crate::model::CreatePreviewRequest::request_id].
8128    ///
8129    /// # Example
8130    /// ```ignore,no_run
8131    /// # use google_cloud_config_v1::model::CreatePreviewRequest;
8132    /// let x = CreatePreviewRequest::new().set_request_id("example");
8133    /// ```
8134    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8135        self.request_id = v.into();
8136        self
8137    }
8138}
8139
8140impl wkt::message::Message for CreatePreviewRequest {
8141    fn typename() -> &'static str {
8142        "type.googleapis.com/google.cloud.config.v1.CreatePreviewRequest"
8143    }
8144}
8145
8146/// A request to get details about a preview.
8147#[derive(Clone, Default, PartialEq)]
8148#[non_exhaustive]
8149pub struct GetPreviewRequest {
8150    /// Required. The name of the preview. Format:
8151    /// 'projects/{project_id}/locations/{location}/previews/{preview}'.
8152    pub name: std::string::String,
8153
8154    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8155}
8156
8157impl GetPreviewRequest {
8158    /// Creates a new default instance.
8159    pub fn new() -> Self {
8160        std::default::Default::default()
8161    }
8162
8163    /// Sets the value of [name][crate::model::GetPreviewRequest::name].
8164    ///
8165    /// # Example
8166    /// ```ignore,no_run
8167    /// # use google_cloud_config_v1::model::GetPreviewRequest;
8168    /// # let project_id = "project_id";
8169    /// # let location_id = "location_id";
8170    /// # let preview_id = "preview_id";
8171    /// let x = GetPreviewRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/previews/{preview_id}"));
8172    /// ```
8173    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8174        self.name = v.into();
8175        self
8176    }
8177}
8178
8179impl wkt::message::Message for GetPreviewRequest {
8180    fn typename() -> &'static str {
8181        "type.googleapis.com/google.cloud.config.v1.GetPreviewRequest"
8182    }
8183}
8184
8185/// A request to list all previews for a given project and location.
8186#[derive(Clone, Default, PartialEq)]
8187#[non_exhaustive]
8188pub struct ListPreviewsRequest {
8189    /// Required. The parent in whose context the Previews are listed. The parent
8190    /// value is in the format: 'projects/{project_id}/locations/{location}'.
8191    pub parent: std::string::String,
8192
8193    /// Optional. When requesting a page of resources, 'page_size' specifies number
8194    /// of resources to return. If unspecified, at most 500 will be returned. The
8195    /// maximum value is 1000.
8196    pub page_size: i32,
8197
8198    /// Optional. Token returned by previous call to 'ListDeployments' which
8199    /// specifies the position in the list from where to continue listing the
8200    /// resources.
8201    pub page_token: std::string::String,
8202
8203    /// Optional. Lists the Deployments that match the filter expression. A filter
8204    /// expression filters the resources listed in the response. The expression
8205    /// must be of the form '{field} {operator} {value}' where operators: '<', '>',
8206    /// '<=', '>=', '!=', '=', ':' are supported (colon ':' represents a HAS
8207    /// operator which is roughly synonymous with equality). {field} can refer to a
8208    /// proto or JSON field, or a synthetic field. Field names can be camelCase or
8209    /// snake_case.
8210    ///
8211    /// Examples:
8212    ///
8213    /// - Filter by name:
8214    ///   name = "projects/foo/locations/us-central1/deployments/bar
8215    ///
8216    /// - Filter by labels:
8217    ///
8218    ///   - Resources that have a key called 'foo'
8219    ///     labels.foo:*
8220    ///   - Resources that have a key called 'foo' whose value is 'bar'
8221    ///     labels.foo = bar
8222    /// - Filter by state:
8223    ///
8224    ///   - Deployments in CREATING state.
8225    ///     state=CREATING
8226    pub filter: std::string::String,
8227
8228    /// Optional. Field to use to sort the list.
8229    pub order_by: std::string::String,
8230
8231    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8232}
8233
8234impl ListPreviewsRequest {
8235    /// Creates a new default instance.
8236    pub fn new() -> Self {
8237        std::default::Default::default()
8238    }
8239
8240    /// Sets the value of [parent][crate::model::ListPreviewsRequest::parent].
8241    ///
8242    /// # Example
8243    /// ```ignore,no_run
8244    /// # use google_cloud_config_v1::model::ListPreviewsRequest;
8245    /// let x = ListPreviewsRequest::new().set_parent("example");
8246    /// ```
8247    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8248        self.parent = v.into();
8249        self
8250    }
8251
8252    /// Sets the value of [page_size][crate::model::ListPreviewsRequest::page_size].
8253    ///
8254    /// # Example
8255    /// ```ignore,no_run
8256    /// # use google_cloud_config_v1::model::ListPreviewsRequest;
8257    /// let x = ListPreviewsRequest::new().set_page_size(42);
8258    /// ```
8259    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8260        self.page_size = v.into();
8261        self
8262    }
8263
8264    /// Sets the value of [page_token][crate::model::ListPreviewsRequest::page_token].
8265    ///
8266    /// # Example
8267    /// ```ignore,no_run
8268    /// # use google_cloud_config_v1::model::ListPreviewsRequest;
8269    /// let x = ListPreviewsRequest::new().set_page_token("example");
8270    /// ```
8271    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8272        self.page_token = v.into();
8273        self
8274    }
8275
8276    /// Sets the value of [filter][crate::model::ListPreviewsRequest::filter].
8277    ///
8278    /// # Example
8279    /// ```ignore,no_run
8280    /// # use google_cloud_config_v1::model::ListPreviewsRequest;
8281    /// let x = ListPreviewsRequest::new().set_filter("example");
8282    /// ```
8283    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8284        self.filter = v.into();
8285        self
8286    }
8287
8288    /// Sets the value of [order_by][crate::model::ListPreviewsRequest::order_by].
8289    ///
8290    /// # Example
8291    /// ```ignore,no_run
8292    /// # use google_cloud_config_v1::model::ListPreviewsRequest;
8293    /// let x = ListPreviewsRequest::new().set_order_by("example");
8294    /// ```
8295    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8296        self.order_by = v.into();
8297        self
8298    }
8299}
8300
8301impl wkt::message::Message for ListPreviewsRequest {
8302    fn typename() -> &'static str {
8303        "type.googleapis.com/google.cloud.config.v1.ListPreviewsRequest"
8304    }
8305}
8306
8307/// A response to a `ListPreviews` call. Contains a list of Previews.
8308#[derive(Clone, Default, PartialEq)]
8309#[non_exhaustive]
8310pub struct ListPreviewsResponse {
8311    /// List of [Previews][google.cloud.config.v1.Preview].
8312    ///
8313    /// [google.cloud.config.v1.Preview]: crate::model::Preview
8314    pub previews: std::vec::Vec<crate::model::Preview>,
8315
8316    /// Token to be supplied to the next ListPreviews request via `page_token`
8317    /// to obtain the next set of results.
8318    pub next_page_token: std::string::String,
8319
8320    /// Locations that could not be reached.
8321    pub unreachable: std::vec::Vec<std::string::String>,
8322
8323    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8324}
8325
8326impl ListPreviewsResponse {
8327    /// Creates a new default instance.
8328    pub fn new() -> Self {
8329        std::default::Default::default()
8330    }
8331
8332    /// Sets the value of [previews][crate::model::ListPreviewsResponse::previews].
8333    ///
8334    /// # Example
8335    /// ```ignore,no_run
8336    /// # use google_cloud_config_v1::model::ListPreviewsResponse;
8337    /// use google_cloud_config_v1::model::Preview;
8338    /// let x = ListPreviewsResponse::new()
8339    ///     .set_previews([
8340    ///         Preview::default()/* use setters */,
8341    ///         Preview::default()/* use (different) setters */,
8342    ///     ]);
8343    /// ```
8344    pub fn set_previews<T, V>(mut self, v: T) -> Self
8345    where
8346        T: std::iter::IntoIterator<Item = V>,
8347        V: std::convert::Into<crate::model::Preview>,
8348    {
8349        use std::iter::Iterator;
8350        self.previews = v.into_iter().map(|i| i.into()).collect();
8351        self
8352    }
8353
8354    /// Sets the value of [next_page_token][crate::model::ListPreviewsResponse::next_page_token].
8355    ///
8356    /// # Example
8357    /// ```ignore,no_run
8358    /// # use google_cloud_config_v1::model::ListPreviewsResponse;
8359    /// let x = ListPreviewsResponse::new().set_next_page_token("example");
8360    /// ```
8361    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8362        self.next_page_token = v.into();
8363        self
8364    }
8365
8366    /// Sets the value of [unreachable][crate::model::ListPreviewsResponse::unreachable].
8367    ///
8368    /// # Example
8369    /// ```ignore,no_run
8370    /// # use google_cloud_config_v1::model::ListPreviewsResponse;
8371    /// let x = ListPreviewsResponse::new().set_unreachable(["a", "b", "c"]);
8372    /// ```
8373    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
8374    where
8375        T: std::iter::IntoIterator<Item = V>,
8376        V: std::convert::Into<std::string::String>,
8377    {
8378        use std::iter::Iterator;
8379        self.unreachable = v.into_iter().map(|i| i.into()).collect();
8380        self
8381    }
8382}
8383
8384impl wkt::message::Message for ListPreviewsResponse {
8385    fn typename() -> &'static str {
8386        "type.googleapis.com/google.cloud.config.v1.ListPreviewsResponse"
8387    }
8388}
8389
8390#[doc(hidden)]
8391impl google_cloud_gax::paginator::internal::PageableResponse for ListPreviewsResponse {
8392    type PageItem = crate::model::Preview;
8393
8394    fn items(self) -> std::vec::Vec<Self::PageItem> {
8395        self.previews
8396    }
8397
8398    fn next_page_token(&self) -> std::string::String {
8399        use std::clone::Clone;
8400        self.next_page_token.clone()
8401    }
8402}
8403
8404/// A request to delete a preview.
8405#[derive(Clone, Default, PartialEq)]
8406#[non_exhaustive]
8407pub struct DeletePreviewRequest {
8408    /// Required. The name of the Preview in the format:
8409    /// 'projects/{project_id}/locations/{location}/previews/{preview}'.
8410    pub name: std::string::String,
8411
8412    /// Optional. An optional request ID to identify requests. Specify a unique
8413    /// request ID so that if you must retry your request, the server will know to
8414    /// ignore the request if it has already been completed. The server will
8415    /// guarantee that for at least 60 minutes after the first request.
8416    ///
8417    /// For example, consider a situation where you make an initial request and the
8418    /// request times out. If you make the request again with the same request ID,
8419    /// the server can check if original operation with the same request ID was
8420    /// received, and if so, will ignore the second request. This prevents clients
8421    /// from accidentally creating duplicate commitments.
8422    ///
8423    /// The request ID must be a valid UUID with the exception that zero UUID is
8424    /// not supported (00000000-0000-0000-0000-000000000000).
8425    pub request_id: std::string::String,
8426
8427    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8428}
8429
8430impl DeletePreviewRequest {
8431    /// Creates a new default instance.
8432    pub fn new() -> Self {
8433        std::default::Default::default()
8434    }
8435
8436    /// Sets the value of [name][crate::model::DeletePreviewRequest::name].
8437    ///
8438    /// # Example
8439    /// ```ignore,no_run
8440    /// # use google_cloud_config_v1::model::DeletePreviewRequest;
8441    /// # let project_id = "project_id";
8442    /// # let location_id = "location_id";
8443    /// # let preview_id = "preview_id";
8444    /// let x = DeletePreviewRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/previews/{preview_id}"));
8445    /// ```
8446    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8447        self.name = v.into();
8448        self
8449    }
8450
8451    /// Sets the value of [request_id][crate::model::DeletePreviewRequest::request_id].
8452    ///
8453    /// # Example
8454    /// ```ignore,no_run
8455    /// # use google_cloud_config_v1::model::DeletePreviewRequest;
8456    /// let x = DeletePreviewRequest::new().set_request_id("example");
8457    /// ```
8458    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8459        self.request_id = v.into();
8460        self
8461    }
8462}
8463
8464impl wkt::message::Message for DeletePreviewRequest {
8465    fn typename() -> &'static str {
8466        "type.googleapis.com/google.cloud.config.v1.DeletePreviewRequest"
8467    }
8468}
8469
8470/// A request to export preview results.
8471#[derive(Clone, Default, PartialEq)]
8472#[non_exhaustive]
8473pub struct ExportPreviewResultRequest {
8474    /// Required. The preview whose results should be exported. The preview value
8475    /// is in the format:
8476    /// 'projects/{project_id}/locations/{location}/previews/{preview}'.
8477    pub parent: std::string::String,
8478
8479    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8480}
8481
8482impl ExportPreviewResultRequest {
8483    /// Creates a new default instance.
8484    pub fn new() -> Self {
8485        std::default::Default::default()
8486    }
8487
8488    /// Sets the value of [parent][crate::model::ExportPreviewResultRequest::parent].
8489    ///
8490    /// # Example
8491    /// ```ignore,no_run
8492    /// # use google_cloud_config_v1::model::ExportPreviewResultRequest;
8493    /// # let project_id = "project_id";
8494    /// # let location_id = "location_id";
8495    /// # let preview_id = "preview_id";
8496    /// let x = ExportPreviewResultRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/previews/{preview_id}"));
8497    /// ```
8498    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8499        self.parent = v.into();
8500        self
8501    }
8502}
8503
8504impl wkt::message::Message for ExportPreviewResultRequest {
8505    fn typename() -> &'static str {
8506        "type.googleapis.com/google.cloud.config.v1.ExportPreviewResultRequest"
8507    }
8508}
8509
8510/// A response to `ExportPreviewResult` call. Contains preview results.
8511#[derive(Clone, Default, PartialEq)]
8512#[non_exhaustive]
8513pub struct ExportPreviewResultResponse {
8514    /// Output only. Signed URLs for accessing the plan files.
8515    pub result: std::option::Option<crate::model::PreviewResult>,
8516
8517    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8518}
8519
8520impl ExportPreviewResultResponse {
8521    /// Creates a new default instance.
8522    pub fn new() -> Self {
8523        std::default::Default::default()
8524    }
8525
8526    /// Sets the value of [result][crate::model::ExportPreviewResultResponse::result].
8527    ///
8528    /// # Example
8529    /// ```ignore,no_run
8530    /// # use google_cloud_config_v1::model::ExportPreviewResultResponse;
8531    /// use google_cloud_config_v1::model::PreviewResult;
8532    /// let x = ExportPreviewResultResponse::new().set_result(PreviewResult::default()/* use setters */);
8533    /// ```
8534    pub fn set_result<T>(mut self, v: T) -> Self
8535    where
8536        T: std::convert::Into<crate::model::PreviewResult>,
8537    {
8538        self.result = std::option::Option::Some(v.into());
8539        self
8540    }
8541
8542    /// Sets or clears the value of [result][crate::model::ExportPreviewResultResponse::result].
8543    ///
8544    /// # Example
8545    /// ```ignore,no_run
8546    /// # use google_cloud_config_v1::model::ExportPreviewResultResponse;
8547    /// use google_cloud_config_v1::model::PreviewResult;
8548    /// let x = ExportPreviewResultResponse::new().set_or_clear_result(Some(PreviewResult::default()/* use setters */));
8549    /// let x = ExportPreviewResultResponse::new().set_or_clear_result(None::<PreviewResult>);
8550    /// ```
8551    pub fn set_or_clear_result<T>(mut self, v: std::option::Option<T>) -> Self
8552    where
8553        T: std::convert::Into<crate::model::PreviewResult>,
8554    {
8555        self.result = v.map(|x| x.into());
8556        self
8557    }
8558}
8559
8560impl wkt::message::Message for ExportPreviewResultResponse {
8561    fn typename() -> &'static str {
8562        "type.googleapis.com/google.cloud.config.v1.ExportPreviewResultResponse"
8563    }
8564}
8565
8566/// Contains a signed Cloud Storage URLs.
8567#[derive(Clone, Default, PartialEq)]
8568#[non_exhaustive]
8569pub struct PreviewResult {
8570    /// Output only. Plan binary signed URL
8571    pub binary_signed_uri: std::string::String,
8572
8573    /// Output only. Plan JSON signed URL
8574    pub json_signed_uri: std::string::String,
8575
8576    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8577}
8578
8579impl PreviewResult {
8580    /// Creates a new default instance.
8581    pub fn new() -> Self {
8582        std::default::Default::default()
8583    }
8584
8585    /// Sets the value of [binary_signed_uri][crate::model::PreviewResult::binary_signed_uri].
8586    ///
8587    /// # Example
8588    /// ```ignore,no_run
8589    /// # use google_cloud_config_v1::model::PreviewResult;
8590    /// let x = PreviewResult::new().set_binary_signed_uri("example");
8591    /// ```
8592    pub fn set_binary_signed_uri<T: std::convert::Into<std::string::String>>(
8593        mut self,
8594        v: T,
8595    ) -> Self {
8596        self.binary_signed_uri = v.into();
8597        self
8598    }
8599
8600    /// Sets the value of [json_signed_uri][crate::model::PreviewResult::json_signed_uri].
8601    ///
8602    /// # Example
8603    /// ```ignore,no_run
8604    /// # use google_cloud_config_v1::model::PreviewResult;
8605    /// let x = PreviewResult::new().set_json_signed_uri("example");
8606    /// ```
8607    pub fn set_json_signed_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8608        self.json_signed_uri = v.into();
8609        self
8610    }
8611}
8612
8613impl wkt::message::Message for PreviewResult {
8614    fn typename() -> &'static str {
8615        "type.googleapis.com/google.cloud.config.v1.PreviewResult"
8616    }
8617}
8618
8619/// The request message for the GetTerraformVersion method.
8620#[derive(Clone, Default, PartialEq)]
8621#[non_exhaustive]
8622pub struct GetTerraformVersionRequest {
8623    /// Required. The name of the TerraformVersion. Format:
8624    /// 'projects/{project_id}/locations/{location}/terraformVersions/{terraform_version}'
8625    pub name: std::string::String,
8626
8627    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8628}
8629
8630impl GetTerraformVersionRequest {
8631    /// Creates a new default instance.
8632    pub fn new() -> Self {
8633        std::default::Default::default()
8634    }
8635
8636    /// Sets the value of [name][crate::model::GetTerraformVersionRequest::name].
8637    ///
8638    /// # Example
8639    /// ```ignore,no_run
8640    /// # use google_cloud_config_v1::model::GetTerraformVersionRequest;
8641    /// # let project_id = "project_id";
8642    /// # let location_id = "location_id";
8643    /// # let terraform_version_id = "terraform_version_id";
8644    /// let x = GetTerraformVersionRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/terraformVersions/{terraform_version_id}"));
8645    /// ```
8646    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8647        self.name = v.into();
8648        self
8649    }
8650}
8651
8652impl wkt::message::Message for GetTerraformVersionRequest {
8653    fn typename() -> &'static str {
8654        "type.googleapis.com/google.cloud.config.v1.GetTerraformVersionRequest"
8655    }
8656}
8657
8658/// The request message for the ListTerraformVersions method.
8659#[derive(Clone, Default, PartialEq)]
8660#[non_exhaustive]
8661pub struct ListTerraformVersionsRequest {
8662    /// Required. The parent in whose context the TerraformVersions are listed. The
8663    /// parent value is in the format:
8664    /// 'projects/{project_id}/locations/{location}'.
8665    pub parent: std::string::String,
8666
8667    /// Optional. When requesting a page of terraform versions, 'page_size'
8668    /// specifies number of terraform versions to return. If unspecified, at most
8669    /// 500 will be returned. The maximum value is 1000.
8670    pub page_size: i32,
8671
8672    /// Optional. Token returned by previous call to 'ListTerraformVersions' which
8673    /// specifies the position in the list from where to continue listing the
8674    /// terraform versions.
8675    pub page_token: std::string::String,
8676
8677    /// Optional. Lists the TerraformVersions that match the filter expression. A
8678    /// filter expression filters the resources listed in the response. The
8679    /// expression must be of the form '{field} {operator} {value}' where
8680    /// operators: '<', '>',
8681    /// '<=', '>=', '!=', '=', ':' are supported (colon ':' represents a HAS
8682    /// operator which is roughly synonymous with equality). {field} can refer to a
8683    /// proto or JSON field, or a synthetic field. Field names can be camelCase or
8684    /// snake_case.
8685    pub filter: std::string::String,
8686
8687    /// Optional. Field to use to sort the list.
8688    pub order_by: std::string::String,
8689
8690    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8691}
8692
8693impl ListTerraformVersionsRequest {
8694    /// Creates a new default instance.
8695    pub fn new() -> Self {
8696        std::default::Default::default()
8697    }
8698
8699    /// Sets the value of [parent][crate::model::ListTerraformVersionsRequest::parent].
8700    ///
8701    /// # Example
8702    /// ```ignore,no_run
8703    /// # use google_cloud_config_v1::model::ListTerraformVersionsRequest;
8704    /// let x = ListTerraformVersionsRequest::new().set_parent("example");
8705    /// ```
8706    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8707        self.parent = v.into();
8708        self
8709    }
8710
8711    /// Sets the value of [page_size][crate::model::ListTerraformVersionsRequest::page_size].
8712    ///
8713    /// # Example
8714    /// ```ignore,no_run
8715    /// # use google_cloud_config_v1::model::ListTerraformVersionsRequest;
8716    /// let x = ListTerraformVersionsRequest::new().set_page_size(42);
8717    /// ```
8718    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8719        self.page_size = v.into();
8720        self
8721    }
8722
8723    /// Sets the value of [page_token][crate::model::ListTerraformVersionsRequest::page_token].
8724    ///
8725    /// # Example
8726    /// ```ignore,no_run
8727    /// # use google_cloud_config_v1::model::ListTerraformVersionsRequest;
8728    /// let x = ListTerraformVersionsRequest::new().set_page_token("example");
8729    /// ```
8730    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8731        self.page_token = v.into();
8732        self
8733    }
8734
8735    /// Sets the value of [filter][crate::model::ListTerraformVersionsRequest::filter].
8736    ///
8737    /// # Example
8738    /// ```ignore,no_run
8739    /// # use google_cloud_config_v1::model::ListTerraformVersionsRequest;
8740    /// let x = ListTerraformVersionsRequest::new().set_filter("example");
8741    /// ```
8742    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8743        self.filter = v.into();
8744        self
8745    }
8746
8747    /// Sets the value of [order_by][crate::model::ListTerraformVersionsRequest::order_by].
8748    ///
8749    /// # Example
8750    /// ```ignore,no_run
8751    /// # use google_cloud_config_v1::model::ListTerraformVersionsRequest;
8752    /// let x = ListTerraformVersionsRequest::new().set_order_by("example");
8753    /// ```
8754    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8755        self.order_by = v.into();
8756        self
8757    }
8758}
8759
8760impl wkt::message::Message for ListTerraformVersionsRequest {
8761    fn typename() -> &'static str {
8762        "type.googleapis.com/google.cloud.config.v1.ListTerraformVersionsRequest"
8763    }
8764}
8765
8766/// The response message for the `ListTerraformVersions` method.
8767#[derive(Clone, Default, PartialEq)]
8768#[non_exhaustive]
8769pub struct ListTerraformVersionsResponse {
8770    /// List of [TerraformVersion][google.cloud.config.v1.TerraformVersion]s.
8771    ///
8772    /// [google.cloud.config.v1.TerraformVersion]: crate::model::TerraformVersion
8773    pub terraform_versions: std::vec::Vec<crate::model::TerraformVersion>,
8774
8775    /// Token to be supplied to the next ListTerraformVersions request via
8776    /// `page_token` to obtain the next set of results.
8777    pub next_page_token: std::string::String,
8778
8779    /// Unreachable resources, if any.
8780    pub unreachable: std::vec::Vec<std::string::String>,
8781
8782    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8783}
8784
8785impl ListTerraformVersionsResponse {
8786    /// Creates a new default instance.
8787    pub fn new() -> Self {
8788        std::default::Default::default()
8789    }
8790
8791    /// Sets the value of [terraform_versions][crate::model::ListTerraformVersionsResponse::terraform_versions].
8792    ///
8793    /// # Example
8794    /// ```ignore,no_run
8795    /// # use google_cloud_config_v1::model::ListTerraformVersionsResponse;
8796    /// use google_cloud_config_v1::model::TerraformVersion;
8797    /// let x = ListTerraformVersionsResponse::new()
8798    ///     .set_terraform_versions([
8799    ///         TerraformVersion::default()/* use setters */,
8800    ///         TerraformVersion::default()/* use (different) setters */,
8801    ///     ]);
8802    /// ```
8803    pub fn set_terraform_versions<T, V>(mut self, v: T) -> Self
8804    where
8805        T: std::iter::IntoIterator<Item = V>,
8806        V: std::convert::Into<crate::model::TerraformVersion>,
8807    {
8808        use std::iter::Iterator;
8809        self.terraform_versions = v.into_iter().map(|i| i.into()).collect();
8810        self
8811    }
8812
8813    /// Sets the value of [next_page_token][crate::model::ListTerraformVersionsResponse::next_page_token].
8814    ///
8815    /// # Example
8816    /// ```ignore,no_run
8817    /// # use google_cloud_config_v1::model::ListTerraformVersionsResponse;
8818    /// let x = ListTerraformVersionsResponse::new().set_next_page_token("example");
8819    /// ```
8820    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8821        self.next_page_token = v.into();
8822        self
8823    }
8824
8825    /// Sets the value of [unreachable][crate::model::ListTerraformVersionsResponse::unreachable].
8826    ///
8827    /// # Example
8828    /// ```ignore,no_run
8829    /// # use google_cloud_config_v1::model::ListTerraformVersionsResponse;
8830    /// let x = ListTerraformVersionsResponse::new().set_unreachable(["a", "b", "c"]);
8831    /// ```
8832    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
8833    where
8834        T: std::iter::IntoIterator<Item = V>,
8835        V: std::convert::Into<std::string::String>,
8836    {
8837        use std::iter::Iterator;
8838        self.unreachable = v.into_iter().map(|i| i.into()).collect();
8839        self
8840    }
8841}
8842
8843impl wkt::message::Message for ListTerraformVersionsResponse {
8844    fn typename() -> &'static str {
8845        "type.googleapis.com/google.cloud.config.v1.ListTerraformVersionsResponse"
8846    }
8847}
8848
8849#[doc(hidden)]
8850impl google_cloud_gax::paginator::internal::PageableResponse for ListTerraformVersionsResponse {
8851    type PageItem = crate::model::TerraformVersion;
8852
8853    fn items(self) -> std::vec::Vec<Self::PageItem> {
8854        self.terraform_versions
8855    }
8856
8857    fn next_page_token(&self) -> std::string::String {
8858        use std::clone::Clone;
8859        self.next_page_token.clone()
8860    }
8861}
8862
8863/// A TerraformVersion represents the support state the corresponding
8864/// Terraform version.
8865#[derive(Clone, Default, PartialEq)]
8866#[non_exhaustive]
8867pub struct TerraformVersion {
8868    /// Identifier. The version name is in the format:
8869    /// 'projects/{project_id}/locations/{location}/terraformVersions/{terraform_version}'.
8870    pub name: std::string::String,
8871
8872    /// Output only. The state of the version, ACTIVE, DEPRECATED or OBSOLETE.
8873    pub state: crate::model::terraform_version::State,
8874
8875    /// Output only. When the version is supported.
8876    pub support_time: std::option::Option<wkt::Timestamp>,
8877
8878    /// Output only. When the version is deprecated.
8879    pub deprecate_time: std::option::Option<wkt::Timestamp>,
8880
8881    /// Output only. When the version is obsolete.
8882    pub obsolete_time: std::option::Option<wkt::Timestamp>,
8883
8884    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8885}
8886
8887impl TerraformVersion {
8888    /// Creates a new default instance.
8889    pub fn new() -> Self {
8890        std::default::Default::default()
8891    }
8892
8893    /// Sets the value of [name][crate::model::TerraformVersion::name].
8894    ///
8895    /// # Example
8896    /// ```ignore,no_run
8897    /// # use google_cloud_config_v1::model::TerraformVersion;
8898    /// # let project_id = "project_id";
8899    /// # let location_id = "location_id";
8900    /// # let terraform_version_id = "terraform_version_id";
8901    /// let x = TerraformVersion::new().set_name(format!("projects/{project_id}/locations/{location_id}/terraformVersions/{terraform_version_id}"));
8902    /// ```
8903    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8904        self.name = v.into();
8905        self
8906    }
8907
8908    /// Sets the value of [state][crate::model::TerraformVersion::state].
8909    ///
8910    /// # Example
8911    /// ```ignore,no_run
8912    /// # use google_cloud_config_v1::model::TerraformVersion;
8913    /// use google_cloud_config_v1::model::terraform_version::State;
8914    /// let x0 = TerraformVersion::new().set_state(State::Active);
8915    /// let x1 = TerraformVersion::new().set_state(State::Deprecated);
8916    /// let x2 = TerraformVersion::new().set_state(State::Obsolete);
8917    /// ```
8918    pub fn set_state<T: std::convert::Into<crate::model::terraform_version::State>>(
8919        mut self,
8920        v: T,
8921    ) -> Self {
8922        self.state = v.into();
8923        self
8924    }
8925
8926    /// Sets the value of [support_time][crate::model::TerraformVersion::support_time].
8927    ///
8928    /// # Example
8929    /// ```ignore,no_run
8930    /// # use google_cloud_config_v1::model::TerraformVersion;
8931    /// use wkt::Timestamp;
8932    /// let x = TerraformVersion::new().set_support_time(Timestamp::default()/* use setters */);
8933    /// ```
8934    pub fn set_support_time<T>(mut self, v: T) -> Self
8935    where
8936        T: std::convert::Into<wkt::Timestamp>,
8937    {
8938        self.support_time = std::option::Option::Some(v.into());
8939        self
8940    }
8941
8942    /// Sets or clears the value of [support_time][crate::model::TerraformVersion::support_time].
8943    ///
8944    /// # Example
8945    /// ```ignore,no_run
8946    /// # use google_cloud_config_v1::model::TerraformVersion;
8947    /// use wkt::Timestamp;
8948    /// let x = TerraformVersion::new().set_or_clear_support_time(Some(Timestamp::default()/* use setters */));
8949    /// let x = TerraformVersion::new().set_or_clear_support_time(None::<Timestamp>);
8950    /// ```
8951    pub fn set_or_clear_support_time<T>(mut self, v: std::option::Option<T>) -> Self
8952    where
8953        T: std::convert::Into<wkt::Timestamp>,
8954    {
8955        self.support_time = v.map(|x| x.into());
8956        self
8957    }
8958
8959    /// Sets the value of [deprecate_time][crate::model::TerraformVersion::deprecate_time].
8960    ///
8961    /// # Example
8962    /// ```ignore,no_run
8963    /// # use google_cloud_config_v1::model::TerraformVersion;
8964    /// use wkt::Timestamp;
8965    /// let x = TerraformVersion::new().set_deprecate_time(Timestamp::default()/* use setters */);
8966    /// ```
8967    pub fn set_deprecate_time<T>(mut self, v: T) -> Self
8968    where
8969        T: std::convert::Into<wkt::Timestamp>,
8970    {
8971        self.deprecate_time = std::option::Option::Some(v.into());
8972        self
8973    }
8974
8975    /// Sets or clears the value of [deprecate_time][crate::model::TerraformVersion::deprecate_time].
8976    ///
8977    /// # Example
8978    /// ```ignore,no_run
8979    /// # use google_cloud_config_v1::model::TerraformVersion;
8980    /// use wkt::Timestamp;
8981    /// let x = TerraformVersion::new().set_or_clear_deprecate_time(Some(Timestamp::default()/* use setters */));
8982    /// let x = TerraformVersion::new().set_or_clear_deprecate_time(None::<Timestamp>);
8983    /// ```
8984    pub fn set_or_clear_deprecate_time<T>(mut self, v: std::option::Option<T>) -> Self
8985    where
8986        T: std::convert::Into<wkt::Timestamp>,
8987    {
8988        self.deprecate_time = v.map(|x| x.into());
8989        self
8990    }
8991
8992    /// Sets the value of [obsolete_time][crate::model::TerraformVersion::obsolete_time].
8993    ///
8994    /// # Example
8995    /// ```ignore,no_run
8996    /// # use google_cloud_config_v1::model::TerraformVersion;
8997    /// use wkt::Timestamp;
8998    /// let x = TerraformVersion::new().set_obsolete_time(Timestamp::default()/* use setters */);
8999    /// ```
9000    pub fn set_obsolete_time<T>(mut self, v: T) -> Self
9001    where
9002        T: std::convert::Into<wkt::Timestamp>,
9003    {
9004        self.obsolete_time = std::option::Option::Some(v.into());
9005        self
9006    }
9007
9008    /// Sets or clears the value of [obsolete_time][crate::model::TerraformVersion::obsolete_time].
9009    ///
9010    /// # Example
9011    /// ```ignore,no_run
9012    /// # use google_cloud_config_v1::model::TerraformVersion;
9013    /// use wkt::Timestamp;
9014    /// let x = TerraformVersion::new().set_or_clear_obsolete_time(Some(Timestamp::default()/* use setters */));
9015    /// let x = TerraformVersion::new().set_or_clear_obsolete_time(None::<Timestamp>);
9016    /// ```
9017    pub fn set_or_clear_obsolete_time<T>(mut self, v: std::option::Option<T>) -> Self
9018    where
9019        T: std::convert::Into<wkt::Timestamp>,
9020    {
9021        self.obsolete_time = v.map(|x| x.into());
9022        self
9023    }
9024}
9025
9026impl wkt::message::Message for TerraformVersion {
9027    fn typename() -> &'static str {
9028        "type.googleapis.com/google.cloud.config.v1.TerraformVersion"
9029    }
9030}
9031
9032/// Defines additional types related to [TerraformVersion].
9033pub mod terraform_version {
9034    #[allow(unused_imports)]
9035    use super::*;
9036
9037    /// Possible states of a TerraformVersion.
9038    ///
9039    /// # Working with unknown values
9040    ///
9041    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9042    /// additional enum variants at any time. Adding new variants is not considered
9043    /// a breaking change. Applications should write their code in anticipation of:
9044    ///
9045    /// - New values appearing in future releases of the client library, **and**
9046    /// - New values received dynamically, without application changes.
9047    ///
9048    /// Please consult the [Working with enums] section in the user guide for some
9049    /// guidelines.
9050    ///
9051    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
9052    #[derive(Clone, Debug, PartialEq)]
9053    #[non_exhaustive]
9054    pub enum State {
9055        /// The default value. This value is used if the state is omitted.
9056        Unspecified,
9057        /// The version is actively supported.
9058        Active,
9059        /// The version is deprecated.
9060        Deprecated,
9061        /// The version is obsolete.
9062        Obsolete,
9063        /// If set, the enum was initialized with an unknown value.
9064        ///
9065        /// Applications can examine the value using [State::value] or
9066        /// [State::name].
9067        UnknownValue(state::UnknownValue),
9068    }
9069
9070    #[doc(hidden)]
9071    pub mod state {
9072        #[allow(unused_imports)]
9073        use super::*;
9074        #[derive(Clone, Debug, PartialEq)]
9075        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9076    }
9077
9078    impl State {
9079        /// Gets the enum value.
9080        ///
9081        /// Returns `None` if the enum contains an unknown value deserialized from
9082        /// the string representation of enums.
9083        pub fn value(&self) -> std::option::Option<i32> {
9084            match self {
9085                Self::Unspecified => std::option::Option::Some(0),
9086                Self::Active => std::option::Option::Some(1),
9087                Self::Deprecated => std::option::Option::Some(2),
9088                Self::Obsolete => std::option::Option::Some(3),
9089                Self::UnknownValue(u) => u.0.value(),
9090            }
9091        }
9092
9093        /// Gets the enum value as a string.
9094        ///
9095        /// Returns `None` if the enum contains an unknown value deserialized from
9096        /// the integer representation of enums.
9097        pub fn name(&self) -> std::option::Option<&str> {
9098            match self {
9099                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
9100                Self::Active => std::option::Option::Some("ACTIVE"),
9101                Self::Deprecated => std::option::Option::Some("DEPRECATED"),
9102                Self::Obsolete => std::option::Option::Some("OBSOLETE"),
9103                Self::UnknownValue(u) => u.0.name(),
9104            }
9105        }
9106    }
9107
9108    impl std::default::Default for State {
9109        fn default() -> Self {
9110            use std::convert::From;
9111            Self::from(0)
9112        }
9113    }
9114
9115    impl std::fmt::Display for State {
9116        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9117            wkt::internal::display_enum(f, self.name(), self.value())
9118        }
9119    }
9120
9121    impl std::convert::From<i32> for State {
9122        fn from(value: i32) -> Self {
9123            match value {
9124                0 => Self::Unspecified,
9125                1 => Self::Active,
9126                2 => Self::Deprecated,
9127                3 => Self::Obsolete,
9128                _ => Self::UnknownValue(state::UnknownValue(
9129                    wkt::internal::UnknownEnumValue::Integer(value),
9130                )),
9131            }
9132        }
9133    }
9134
9135    impl std::convert::From<&str> for State {
9136        fn from(value: &str) -> Self {
9137            use std::string::ToString;
9138            match value {
9139                "STATE_UNSPECIFIED" => Self::Unspecified,
9140                "ACTIVE" => Self::Active,
9141                "DEPRECATED" => Self::Deprecated,
9142                "OBSOLETE" => Self::Obsolete,
9143                _ => Self::UnknownValue(state::UnknownValue(
9144                    wkt::internal::UnknownEnumValue::String(value.to_string()),
9145                )),
9146            }
9147        }
9148    }
9149
9150    impl serde::ser::Serialize for State {
9151        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9152        where
9153            S: serde::Serializer,
9154        {
9155            match self {
9156                Self::Unspecified => serializer.serialize_i32(0),
9157                Self::Active => serializer.serialize_i32(1),
9158                Self::Deprecated => serializer.serialize_i32(2),
9159                Self::Obsolete => serializer.serialize_i32(3),
9160                Self::UnknownValue(u) => u.0.serialize(serializer),
9161            }
9162        }
9163    }
9164
9165    impl<'de> serde::de::Deserialize<'de> for State {
9166        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9167        where
9168            D: serde::Deserializer<'de>,
9169        {
9170            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
9171                ".google.cloud.config.v1.TerraformVersion.State",
9172            ))
9173        }
9174    }
9175}
9176
9177/// Terraform info of a ResourceChange.
9178#[derive(Clone, Default, PartialEq)]
9179#[non_exhaustive]
9180pub struct ResourceChangeTerraformInfo {
9181    /// Output only. TF resource address that uniquely identifies the resource.
9182    pub address: std::string::String,
9183
9184    /// Output only. TF resource type.
9185    pub r#type: std::string::String,
9186
9187    /// Output only. TF resource name.
9188    pub resource_name: std::string::String,
9189
9190    /// Output only. TF resource provider.
9191    pub provider: std::string::String,
9192
9193    /// Output only. TF resource actions.
9194    pub actions: std::vec::Vec<std::string::String>,
9195
9196    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9197}
9198
9199impl ResourceChangeTerraformInfo {
9200    /// Creates a new default instance.
9201    pub fn new() -> Self {
9202        std::default::Default::default()
9203    }
9204
9205    /// Sets the value of [address][crate::model::ResourceChangeTerraformInfo::address].
9206    ///
9207    /// # Example
9208    /// ```ignore,no_run
9209    /// # use google_cloud_config_v1::model::ResourceChangeTerraformInfo;
9210    /// let x = ResourceChangeTerraformInfo::new().set_address("example");
9211    /// ```
9212    pub fn set_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9213        self.address = v.into();
9214        self
9215    }
9216
9217    /// Sets the value of [r#type][crate::model::ResourceChangeTerraformInfo::type].
9218    ///
9219    /// # Example
9220    /// ```ignore,no_run
9221    /// # use google_cloud_config_v1::model::ResourceChangeTerraformInfo;
9222    /// let x = ResourceChangeTerraformInfo::new().set_type("example");
9223    /// ```
9224    pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9225        self.r#type = v.into();
9226        self
9227    }
9228
9229    /// Sets the value of [resource_name][crate::model::ResourceChangeTerraformInfo::resource_name].
9230    ///
9231    /// # Example
9232    /// ```ignore,no_run
9233    /// # use google_cloud_config_v1::model::ResourceChangeTerraformInfo;
9234    /// let x = ResourceChangeTerraformInfo::new().set_resource_name("example");
9235    /// ```
9236    pub fn set_resource_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9237        self.resource_name = v.into();
9238        self
9239    }
9240
9241    /// Sets the value of [provider][crate::model::ResourceChangeTerraformInfo::provider].
9242    ///
9243    /// # Example
9244    /// ```ignore,no_run
9245    /// # use google_cloud_config_v1::model::ResourceChangeTerraformInfo;
9246    /// let x = ResourceChangeTerraformInfo::new().set_provider("example");
9247    /// ```
9248    pub fn set_provider<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9249        self.provider = v.into();
9250        self
9251    }
9252
9253    /// Sets the value of [actions][crate::model::ResourceChangeTerraformInfo::actions].
9254    ///
9255    /// # Example
9256    /// ```ignore,no_run
9257    /// # use google_cloud_config_v1::model::ResourceChangeTerraformInfo;
9258    /// let x = ResourceChangeTerraformInfo::new().set_actions(["a", "b", "c"]);
9259    /// ```
9260    pub fn set_actions<T, V>(mut self, v: T) -> Self
9261    where
9262        T: std::iter::IntoIterator<Item = V>,
9263        V: std::convert::Into<std::string::String>,
9264    {
9265        use std::iter::Iterator;
9266        self.actions = v.into_iter().map(|i| i.into()).collect();
9267        self
9268    }
9269}
9270
9271impl wkt::message::Message for ResourceChangeTerraformInfo {
9272    fn typename() -> &'static str {
9273        "type.googleapis.com/google.cloud.config.v1.ResourceChangeTerraformInfo"
9274    }
9275}
9276
9277/// A resource change represents a change to a resource in the state file.
9278#[derive(Clone, Default, PartialEq)]
9279#[non_exhaustive]
9280pub struct ResourceChange {
9281    /// Identifier. The name of the resource change.
9282    /// Format:
9283    /// 'projects/{project_id}/locations/{location}/previews/{preview}/resourceChanges/{resource_change}'.
9284    pub name: std::string::String,
9285
9286    /// Output only. Terraform info of the resource change.
9287    pub terraform_info: std::option::Option<crate::model::ResourceChangeTerraformInfo>,
9288
9289    /// Output only. The intent of the resource change.
9290    pub intent: crate::model::resource_change::Intent,
9291
9292    /// Output only. The property changes of the resource change.
9293    pub property_changes: std::vec::Vec<crate::model::PropertyChange>,
9294
9295    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9296}
9297
9298impl ResourceChange {
9299    /// Creates a new default instance.
9300    pub fn new() -> Self {
9301        std::default::Default::default()
9302    }
9303
9304    /// Sets the value of [name][crate::model::ResourceChange::name].
9305    ///
9306    /// # Example
9307    /// ```ignore,no_run
9308    /// # use google_cloud_config_v1::model::ResourceChange;
9309    /// # let project_id = "project_id";
9310    /// # let location_id = "location_id";
9311    /// # let preview_id = "preview_id";
9312    /// # let resource_change_id = "resource_change_id";
9313    /// let x = ResourceChange::new().set_name(format!("projects/{project_id}/locations/{location_id}/previews/{preview_id}/resourceChanges/{resource_change_id}"));
9314    /// ```
9315    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9316        self.name = v.into();
9317        self
9318    }
9319
9320    /// Sets the value of [terraform_info][crate::model::ResourceChange::terraform_info].
9321    ///
9322    /// # Example
9323    /// ```ignore,no_run
9324    /// # use google_cloud_config_v1::model::ResourceChange;
9325    /// use google_cloud_config_v1::model::ResourceChangeTerraformInfo;
9326    /// let x = ResourceChange::new().set_terraform_info(ResourceChangeTerraformInfo::default()/* use setters */);
9327    /// ```
9328    pub fn set_terraform_info<T>(mut self, v: T) -> Self
9329    where
9330        T: std::convert::Into<crate::model::ResourceChangeTerraformInfo>,
9331    {
9332        self.terraform_info = std::option::Option::Some(v.into());
9333        self
9334    }
9335
9336    /// Sets or clears the value of [terraform_info][crate::model::ResourceChange::terraform_info].
9337    ///
9338    /// # Example
9339    /// ```ignore,no_run
9340    /// # use google_cloud_config_v1::model::ResourceChange;
9341    /// use google_cloud_config_v1::model::ResourceChangeTerraformInfo;
9342    /// let x = ResourceChange::new().set_or_clear_terraform_info(Some(ResourceChangeTerraformInfo::default()/* use setters */));
9343    /// let x = ResourceChange::new().set_or_clear_terraform_info(None::<ResourceChangeTerraformInfo>);
9344    /// ```
9345    pub fn set_or_clear_terraform_info<T>(mut self, v: std::option::Option<T>) -> Self
9346    where
9347        T: std::convert::Into<crate::model::ResourceChangeTerraformInfo>,
9348    {
9349        self.terraform_info = v.map(|x| x.into());
9350        self
9351    }
9352
9353    /// Sets the value of [intent][crate::model::ResourceChange::intent].
9354    ///
9355    /// # Example
9356    /// ```ignore,no_run
9357    /// # use google_cloud_config_v1::model::ResourceChange;
9358    /// use google_cloud_config_v1::model::resource_change::Intent;
9359    /// let x0 = ResourceChange::new().set_intent(Intent::Create);
9360    /// let x1 = ResourceChange::new().set_intent(Intent::Update);
9361    /// let x2 = ResourceChange::new().set_intent(Intent::Delete);
9362    /// ```
9363    pub fn set_intent<T: std::convert::Into<crate::model::resource_change::Intent>>(
9364        mut self,
9365        v: T,
9366    ) -> Self {
9367        self.intent = v.into();
9368        self
9369    }
9370
9371    /// Sets the value of [property_changes][crate::model::ResourceChange::property_changes].
9372    ///
9373    /// # Example
9374    /// ```ignore,no_run
9375    /// # use google_cloud_config_v1::model::ResourceChange;
9376    /// use google_cloud_config_v1::model::PropertyChange;
9377    /// let x = ResourceChange::new()
9378    ///     .set_property_changes([
9379    ///         PropertyChange::default()/* use setters */,
9380    ///         PropertyChange::default()/* use (different) setters */,
9381    ///     ]);
9382    /// ```
9383    pub fn set_property_changes<T, V>(mut self, v: T) -> Self
9384    where
9385        T: std::iter::IntoIterator<Item = V>,
9386        V: std::convert::Into<crate::model::PropertyChange>,
9387    {
9388        use std::iter::Iterator;
9389        self.property_changes = v.into_iter().map(|i| i.into()).collect();
9390        self
9391    }
9392}
9393
9394impl wkt::message::Message for ResourceChange {
9395    fn typename() -> &'static str {
9396        "type.googleapis.com/google.cloud.config.v1.ResourceChange"
9397    }
9398}
9399
9400/// Defines additional types related to [ResourceChange].
9401pub mod resource_change {
9402    #[allow(unused_imports)]
9403    use super::*;
9404
9405    /// Possible intent of the resource change.
9406    ///
9407    /// # Working with unknown values
9408    ///
9409    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9410    /// additional enum variants at any time. Adding new variants is not considered
9411    /// a breaking change. Applications should write their code in anticipation of:
9412    ///
9413    /// - New values appearing in future releases of the client library, **and**
9414    /// - New values received dynamically, without application changes.
9415    ///
9416    /// Please consult the [Working with enums] section in the user guide for some
9417    /// guidelines.
9418    ///
9419    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
9420    #[derive(Clone, Debug, PartialEq)]
9421    #[non_exhaustive]
9422    pub enum Intent {
9423        /// The default value.
9424        Unspecified,
9425        /// The resource will be created.
9426        Create,
9427        /// The resource will be updated.
9428        Update,
9429        /// The resource will be deleted.
9430        Delete,
9431        /// The resource will be recreated.
9432        Recreate,
9433        /// The resource will be untouched.
9434        Unchanged,
9435        /// If set, the enum was initialized with an unknown value.
9436        ///
9437        /// Applications can examine the value using [Intent::value] or
9438        /// [Intent::name].
9439        UnknownValue(intent::UnknownValue),
9440    }
9441
9442    #[doc(hidden)]
9443    pub mod intent {
9444        #[allow(unused_imports)]
9445        use super::*;
9446        #[derive(Clone, Debug, PartialEq)]
9447        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9448    }
9449
9450    impl Intent {
9451        /// Gets the enum value.
9452        ///
9453        /// Returns `None` if the enum contains an unknown value deserialized from
9454        /// the string representation of enums.
9455        pub fn value(&self) -> std::option::Option<i32> {
9456            match self {
9457                Self::Unspecified => std::option::Option::Some(0),
9458                Self::Create => std::option::Option::Some(1),
9459                Self::Update => std::option::Option::Some(2),
9460                Self::Delete => std::option::Option::Some(3),
9461                Self::Recreate => std::option::Option::Some(4),
9462                Self::Unchanged => std::option::Option::Some(5),
9463                Self::UnknownValue(u) => u.0.value(),
9464            }
9465        }
9466
9467        /// Gets the enum value as a string.
9468        ///
9469        /// Returns `None` if the enum contains an unknown value deserialized from
9470        /// the integer representation of enums.
9471        pub fn name(&self) -> std::option::Option<&str> {
9472            match self {
9473                Self::Unspecified => std::option::Option::Some("INTENT_UNSPECIFIED"),
9474                Self::Create => std::option::Option::Some("CREATE"),
9475                Self::Update => std::option::Option::Some("UPDATE"),
9476                Self::Delete => std::option::Option::Some("DELETE"),
9477                Self::Recreate => std::option::Option::Some("RECREATE"),
9478                Self::Unchanged => std::option::Option::Some("UNCHANGED"),
9479                Self::UnknownValue(u) => u.0.name(),
9480            }
9481        }
9482    }
9483
9484    impl std::default::Default for Intent {
9485        fn default() -> Self {
9486            use std::convert::From;
9487            Self::from(0)
9488        }
9489    }
9490
9491    impl std::fmt::Display for Intent {
9492        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9493            wkt::internal::display_enum(f, self.name(), self.value())
9494        }
9495    }
9496
9497    impl std::convert::From<i32> for Intent {
9498        fn from(value: i32) -> Self {
9499            match value {
9500                0 => Self::Unspecified,
9501                1 => Self::Create,
9502                2 => Self::Update,
9503                3 => Self::Delete,
9504                4 => Self::Recreate,
9505                5 => Self::Unchanged,
9506                _ => Self::UnknownValue(intent::UnknownValue(
9507                    wkt::internal::UnknownEnumValue::Integer(value),
9508                )),
9509            }
9510        }
9511    }
9512
9513    impl std::convert::From<&str> for Intent {
9514        fn from(value: &str) -> Self {
9515            use std::string::ToString;
9516            match value {
9517                "INTENT_UNSPECIFIED" => Self::Unspecified,
9518                "CREATE" => Self::Create,
9519                "UPDATE" => Self::Update,
9520                "DELETE" => Self::Delete,
9521                "RECREATE" => Self::Recreate,
9522                "UNCHANGED" => Self::Unchanged,
9523                _ => Self::UnknownValue(intent::UnknownValue(
9524                    wkt::internal::UnknownEnumValue::String(value.to_string()),
9525                )),
9526            }
9527        }
9528    }
9529
9530    impl serde::ser::Serialize for Intent {
9531        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9532        where
9533            S: serde::Serializer,
9534        {
9535            match self {
9536                Self::Unspecified => serializer.serialize_i32(0),
9537                Self::Create => serializer.serialize_i32(1),
9538                Self::Update => serializer.serialize_i32(2),
9539                Self::Delete => serializer.serialize_i32(3),
9540                Self::Recreate => serializer.serialize_i32(4),
9541                Self::Unchanged => serializer.serialize_i32(5),
9542                Self::UnknownValue(u) => u.0.serialize(serializer),
9543            }
9544        }
9545    }
9546
9547    impl<'de> serde::de::Deserialize<'de> for Intent {
9548        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9549        where
9550            D: serde::Deserializer<'de>,
9551        {
9552            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Intent>::new(
9553                ".google.cloud.config.v1.ResourceChange.Intent",
9554            ))
9555        }
9556    }
9557}
9558
9559/// A property change represents a change to a property in the state file.
9560#[derive(Clone, Default, PartialEq)]
9561#[non_exhaustive]
9562pub struct PropertyChange {
9563    /// Output only. The path of the property change.
9564    pub path: std::string::String,
9565
9566    /// Output only. The paths of sensitive fields in `before`. Paths are relative
9567    /// to `path`.
9568    pub before_sensitive_paths: std::vec::Vec<std::string::String>,
9569
9570    /// Output only. Representations of the object value before the actions.
9571    pub before: std::option::Option<wkt::Value>,
9572
9573    /// Output only. The paths of sensitive fields in `after`. Paths are relative
9574    /// to `path`.
9575    pub after_sensitive_paths: std::vec::Vec<std::string::String>,
9576
9577    /// Output only. Representations of the object value after the actions.
9578    pub after: std::option::Option<wkt::Value>,
9579
9580    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9581}
9582
9583impl PropertyChange {
9584    /// Creates a new default instance.
9585    pub fn new() -> Self {
9586        std::default::Default::default()
9587    }
9588
9589    /// Sets the value of [path][crate::model::PropertyChange::path].
9590    ///
9591    /// # Example
9592    /// ```ignore,no_run
9593    /// # use google_cloud_config_v1::model::PropertyChange;
9594    /// let x = PropertyChange::new().set_path("example");
9595    /// ```
9596    pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9597        self.path = v.into();
9598        self
9599    }
9600
9601    /// Sets the value of [before_sensitive_paths][crate::model::PropertyChange::before_sensitive_paths].
9602    ///
9603    /// # Example
9604    /// ```ignore,no_run
9605    /// # use google_cloud_config_v1::model::PropertyChange;
9606    /// let x = PropertyChange::new().set_before_sensitive_paths(["a", "b", "c"]);
9607    /// ```
9608    pub fn set_before_sensitive_paths<T, V>(mut self, v: T) -> Self
9609    where
9610        T: std::iter::IntoIterator<Item = V>,
9611        V: std::convert::Into<std::string::String>,
9612    {
9613        use std::iter::Iterator;
9614        self.before_sensitive_paths = v.into_iter().map(|i| i.into()).collect();
9615        self
9616    }
9617
9618    /// Sets the value of [before][crate::model::PropertyChange::before].
9619    ///
9620    /// # Example
9621    /// ```ignore,no_run
9622    /// # use google_cloud_config_v1::model::PropertyChange;
9623    /// use wkt::Value;
9624    /// let x = PropertyChange::new().set_before(Value::default()/* use setters */);
9625    /// ```
9626    pub fn set_before<T>(mut self, v: T) -> Self
9627    where
9628        T: std::convert::Into<wkt::Value>,
9629    {
9630        self.before = std::option::Option::Some(v.into());
9631        self
9632    }
9633
9634    /// Sets or clears the value of [before][crate::model::PropertyChange::before].
9635    ///
9636    /// # Example
9637    /// ```ignore,no_run
9638    /// # use google_cloud_config_v1::model::PropertyChange;
9639    /// use wkt::Value;
9640    /// let x = PropertyChange::new().set_or_clear_before(Some(Value::default()/* use setters */));
9641    /// let x = PropertyChange::new().set_or_clear_before(None::<Value>);
9642    /// ```
9643    pub fn set_or_clear_before<T>(mut self, v: std::option::Option<T>) -> Self
9644    where
9645        T: std::convert::Into<wkt::Value>,
9646    {
9647        self.before = v.map(|x| x.into());
9648        self
9649    }
9650
9651    /// Sets the value of [after_sensitive_paths][crate::model::PropertyChange::after_sensitive_paths].
9652    ///
9653    /// # Example
9654    /// ```ignore,no_run
9655    /// # use google_cloud_config_v1::model::PropertyChange;
9656    /// let x = PropertyChange::new().set_after_sensitive_paths(["a", "b", "c"]);
9657    /// ```
9658    pub fn set_after_sensitive_paths<T, V>(mut self, v: T) -> Self
9659    where
9660        T: std::iter::IntoIterator<Item = V>,
9661        V: std::convert::Into<std::string::String>,
9662    {
9663        use std::iter::Iterator;
9664        self.after_sensitive_paths = v.into_iter().map(|i| i.into()).collect();
9665        self
9666    }
9667
9668    /// Sets the value of [after][crate::model::PropertyChange::after].
9669    ///
9670    /// # Example
9671    /// ```ignore,no_run
9672    /// # use google_cloud_config_v1::model::PropertyChange;
9673    /// use wkt::Value;
9674    /// let x = PropertyChange::new().set_after(Value::default()/* use setters */);
9675    /// ```
9676    pub fn set_after<T>(mut self, v: T) -> Self
9677    where
9678        T: std::convert::Into<wkt::Value>,
9679    {
9680        self.after = std::option::Option::Some(v.into());
9681        self
9682    }
9683
9684    /// Sets or clears the value of [after][crate::model::PropertyChange::after].
9685    ///
9686    /// # Example
9687    /// ```ignore,no_run
9688    /// # use google_cloud_config_v1::model::PropertyChange;
9689    /// use wkt::Value;
9690    /// let x = PropertyChange::new().set_or_clear_after(Some(Value::default()/* use setters */));
9691    /// let x = PropertyChange::new().set_or_clear_after(None::<Value>);
9692    /// ```
9693    pub fn set_or_clear_after<T>(mut self, v: std::option::Option<T>) -> Self
9694    where
9695        T: std::convert::Into<wkt::Value>,
9696    {
9697        self.after = v.map(|x| x.into());
9698        self
9699    }
9700}
9701
9702impl wkt::message::Message for PropertyChange {
9703    fn typename() -> &'static str {
9704        "type.googleapis.com/google.cloud.config.v1.PropertyChange"
9705    }
9706}
9707
9708/// The request message for the ListResourceChanges method.
9709#[derive(Clone, Default, PartialEq)]
9710#[non_exhaustive]
9711pub struct ListResourceChangesRequest {
9712    /// Required. The parent in whose context the ResourceChanges are listed. The
9713    /// parent value is in the format:
9714    /// 'projects/{project_id}/locations/{location}/previews/{preview}'.
9715    pub parent: std::string::String,
9716
9717    /// Optional. When requesting a page of resource changes, 'page_size' specifies
9718    /// number of resource changes to return. If unspecified, at most 500 will be
9719    /// returned. The maximum value is 1000.
9720    pub page_size: i32,
9721
9722    /// Optional. Token returned by previous call to 'ListResourceChanges' which
9723    /// specifies the position in the list from where to continue listing the
9724    /// resource changes.
9725    pub page_token: std::string::String,
9726
9727    /// Optional. Lists the resource changes that match the filter expression. A
9728    /// filter expression filters the resource changes listed in the response. The
9729    /// expression must be of the form '{field} {operator} {value}' where
9730    /// operators: '<', '>',
9731    /// '<=',
9732    /// '>=',
9733    /// '!=', '=', ':' are supported (colon ':' represents a HAS operator which is
9734    /// roughly synonymous with equality). {field} can refer to a proto or JSON
9735    /// field, or a synthetic field. Field names can be camelCase or snake_case.
9736    ///
9737    /// Examples:
9738    ///
9739    /// - Filter by name:
9740    ///   name =
9741    ///   "projects/foo/locations/us-central1/previews/dep/resourceChanges/baz
9742    pub filter: std::string::String,
9743
9744    /// Optional. Field to use to sort the list.
9745    pub order_by: std::string::String,
9746
9747    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9748}
9749
9750impl ListResourceChangesRequest {
9751    /// Creates a new default instance.
9752    pub fn new() -> Self {
9753        std::default::Default::default()
9754    }
9755
9756    /// Sets the value of [parent][crate::model::ListResourceChangesRequest::parent].
9757    ///
9758    /// # Example
9759    /// ```ignore,no_run
9760    /// # use google_cloud_config_v1::model::ListResourceChangesRequest;
9761    /// # let project_id = "project_id";
9762    /// # let location_id = "location_id";
9763    /// # let preview_id = "preview_id";
9764    /// let x = ListResourceChangesRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/previews/{preview_id}"));
9765    /// ```
9766    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9767        self.parent = v.into();
9768        self
9769    }
9770
9771    /// Sets the value of [page_size][crate::model::ListResourceChangesRequest::page_size].
9772    ///
9773    /// # Example
9774    /// ```ignore,no_run
9775    /// # use google_cloud_config_v1::model::ListResourceChangesRequest;
9776    /// let x = ListResourceChangesRequest::new().set_page_size(42);
9777    /// ```
9778    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9779        self.page_size = v.into();
9780        self
9781    }
9782
9783    /// Sets the value of [page_token][crate::model::ListResourceChangesRequest::page_token].
9784    ///
9785    /// # Example
9786    /// ```ignore,no_run
9787    /// # use google_cloud_config_v1::model::ListResourceChangesRequest;
9788    /// let x = ListResourceChangesRequest::new().set_page_token("example");
9789    /// ```
9790    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9791        self.page_token = v.into();
9792        self
9793    }
9794
9795    /// Sets the value of [filter][crate::model::ListResourceChangesRequest::filter].
9796    ///
9797    /// # Example
9798    /// ```ignore,no_run
9799    /// # use google_cloud_config_v1::model::ListResourceChangesRequest;
9800    /// let x = ListResourceChangesRequest::new().set_filter("example");
9801    /// ```
9802    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9803        self.filter = v.into();
9804        self
9805    }
9806
9807    /// Sets the value of [order_by][crate::model::ListResourceChangesRequest::order_by].
9808    ///
9809    /// # Example
9810    /// ```ignore,no_run
9811    /// # use google_cloud_config_v1::model::ListResourceChangesRequest;
9812    /// let x = ListResourceChangesRequest::new().set_order_by("example");
9813    /// ```
9814    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9815        self.order_by = v.into();
9816        self
9817    }
9818}
9819
9820impl wkt::message::Message for ListResourceChangesRequest {
9821    fn typename() -> &'static str {
9822        "type.googleapis.com/google.cloud.config.v1.ListResourceChangesRequest"
9823    }
9824}
9825
9826/// A response to a 'ListResourceChanges' call. Contains a list of
9827/// ResourceChanges.
9828#[derive(Clone, Default, PartialEq)]
9829#[non_exhaustive]
9830pub struct ListResourceChangesResponse {
9831    /// List of ResourceChanges.
9832    pub resource_changes: std::vec::Vec<crate::model::ResourceChange>,
9833
9834    /// A token to request the next page of resources from the
9835    /// 'ListResourceChanges' method. The value of an empty string means that
9836    /// there are no more resources to return.
9837    pub next_page_token: std::string::String,
9838
9839    /// Unreachable resources, if any.
9840    pub unreachable: std::vec::Vec<std::string::String>,
9841
9842    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9843}
9844
9845impl ListResourceChangesResponse {
9846    /// Creates a new default instance.
9847    pub fn new() -> Self {
9848        std::default::Default::default()
9849    }
9850
9851    /// Sets the value of [resource_changes][crate::model::ListResourceChangesResponse::resource_changes].
9852    ///
9853    /// # Example
9854    /// ```ignore,no_run
9855    /// # use google_cloud_config_v1::model::ListResourceChangesResponse;
9856    /// use google_cloud_config_v1::model::ResourceChange;
9857    /// let x = ListResourceChangesResponse::new()
9858    ///     .set_resource_changes([
9859    ///         ResourceChange::default()/* use setters */,
9860    ///         ResourceChange::default()/* use (different) setters */,
9861    ///     ]);
9862    /// ```
9863    pub fn set_resource_changes<T, V>(mut self, v: T) -> Self
9864    where
9865        T: std::iter::IntoIterator<Item = V>,
9866        V: std::convert::Into<crate::model::ResourceChange>,
9867    {
9868        use std::iter::Iterator;
9869        self.resource_changes = v.into_iter().map(|i| i.into()).collect();
9870        self
9871    }
9872
9873    /// Sets the value of [next_page_token][crate::model::ListResourceChangesResponse::next_page_token].
9874    ///
9875    /// # Example
9876    /// ```ignore,no_run
9877    /// # use google_cloud_config_v1::model::ListResourceChangesResponse;
9878    /// let x = ListResourceChangesResponse::new().set_next_page_token("example");
9879    /// ```
9880    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9881        self.next_page_token = v.into();
9882        self
9883    }
9884
9885    /// Sets the value of [unreachable][crate::model::ListResourceChangesResponse::unreachable].
9886    ///
9887    /// # Example
9888    /// ```ignore,no_run
9889    /// # use google_cloud_config_v1::model::ListResourceChangesResponse;
9890    /// let x = ListResourceChangesResponse::new().set_unreachable(["a", "b", "c"]);
9891    /// ```
9892    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
9893    where
9894        T: std::iter::IntoIterator<Item = V>,
9895        V: std::convert::Into<std::string::String>,
9896    {
9897        use std::iter::Iterator;
9898        self.unreachable = v.into_iter().map(|i| i.into()).collect();
9899        self
9900    }
9901}
9902
9903impl wkt::message::Message for ListResourceChangesResponse {
9904    fn typename() -> &'static str {
9905        "type.googleapis.com/google.cloud.config.v1.ListResourceChangesResponse"
9906    }
9907}
9908
9909#[doc(hidden)]
9910impl google_cloud_gax::paginator::internal::PageableResponse for ListResourceChangesResponse {
9911    type PageItem = crate::model::ResourceChange;
9912
9913    fn items(self) -> std::vec::Vec<Self::PageItem> {
9914        self.resource_changes
9915    }
9916
9917    fn next_page_token(&self) -> std::string::String {
9918        use std::clone::Clone;
9919        self.next_page_token.clone()
9920    }
9921}
9922
9923/// The request message for the GetResourceChange method.
9924#[derive(Clone, Default, PartialEq)]
9925#[non_exhaustive]
9926pub struct GetResourceChangeRequest {
9927    /// Required. The name of the resource change to retrieve.
9928    /// Format:
9929    /// 'projects/{project_id}/locations/{location}/previews/{preview}/resourceChanges/{resource_change}'.
9930    pub name: std::string::String,
9931
9932    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9933}
9934
9935impl GetResourceChangeRequest {
9936    /// Creates a new default instance.
9937    pub fn new() -> Self {
9938        std::default::Default::default()
9939    }
9940
9941    /// Sets the value of [name][crate::model::GetResourceChangeRequest::name].
9942    ///
9943    /// # Example
9944    /// ```ignore,no_run
9945    /// # use google_cloud_config_v1::model::GetResourceChangeRequest;
9946    /// # let project_id = "project_id";
9947    /// # let location_id = "location_id";
9948    /// # let preview_id = "preview_id";
9949    /// # let resource_change_id = "resource_change_id";
9950    /// let x = GetResourceChangeRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/previews/{preview_id}/resourceChanges/{resource_change_id}"));
9951    /// ```
9952    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9953        self.name = v.into();
9954        self
9955    }
9956}
9957
9958impl wkt::message::Message for GetResourceChangeRequest {
9959    fn typename() -> &'static str {
9960        "type.googleapis.com/google.cloud.config.v1.GetResourceChangeRequest"
9961    }
9962}
9963
9964/// Terraform info of a ResourceChange.
9965#[derive(Clone, Default, PartialEq)]
9966#[non_exhaustive]
9967pub struct ResourceDriftTerraformInfo {
9968    /// Output only. The address of the drifted resource.
9969    pub address: std::string::String,
9970
9971    /// Output only. The type of the drifted resource.
9972    pub r#type: std::string::String,
9973
9974    /// Output only. TF resource name.
9975    pub resource_name: std::string::String,
9976
9977    /// Output only. The provider of the drifted resource.
9978    pub provider: std::string::String,
9979
9980    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9981}
9982
9983impl ResourceDriftTerraformInfo {
9984    /// Creates a new default instance.
9985    pub fn new() -> Self {
9986        std::default::Default::default()
9987    }
9988
9989    /// Sets the value of [address][crate::model::ResourceDriftTerraformInfo::address].
9990    ///
9991    /// # Example
9992    /// ```ignore,no_run
9993    /// # use google_cloud_config_v1::model::ResourceDriftTerraformInfo;
9994    /// let x = ResourceDriftTerraformInfo::new().set_address("example");
9995    /// ```
9996    pub fn set_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9997        self.address = v.into();
9998        self
9999    }
10000
10001    /// Sets the value of [r#type][crate::model::ResourceDriftTerraformInfo::type].
10002    ///
10003    /// # Example
10004    /// ```ignore,no_run
10005    /// # use google_cloud_config_v1::model::ResourceDriftTerraformInfo;
10006    /// let x = ResourceDriftTerraformInfo::new().set_type("example");
10007    /// ```
10008    pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10009        self.r#type = v.into();
10010        self
10011    }
10012
10013    /// Sets the value of [resource_name][crate::model::ResourceDriftTerraformInfo::resource_name].
10014    ///
10015    /// # Example
10016    /// ```ignore,no_run
10017    /// # use google_cloud_config_v1::model::ResourceDriftTerraformInfo;
10018    /// let x = ResourceDriftTerraformInfo::new().set_resource_name("example");
10019    /// ```
10020    pub fn set_resource_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10021        self.resource_name = v.into();
10022        self
10023    }
10024
10025    /// Sets the value of [provider][crate::model::ResourceDriftTerraformInfo::provider].
10026    ///
10027    /// # Example
10028    /// ```ignore,no_run
10029    /// # use google_cloud_config_v1::model::ResourceDriftTerraformInfo;
10030    /// let x = ResourceDriftTerraformInfo::new().set_provider("example");
10031    /// ```
10032    pub fn set_provider<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10033        self.provider = v.into();
10034        self
10035    }
10036}
10037
10038impl wkt::message::Message for ResourceDriftTerraformInfo {
10039    fn typename() -> &'static str {
10040        "type.googleapis.com/google.cloud.config.v1.ResourceDriftTerraformInfo"
10041    }
10042}
10043
10044/// A resource drift represents a drift to a resource in the state file.
10045#[derive(Clone, Default, PartialEq)]
10046#[non_exhaustive]
10047pub struct ResourceDrift {
10048    /// Identifier. The name of the resource drift.
10049    /// Format:
10050    /// 'projects/{project_id}/locations/{location}/previews/{preview}/resourceDrifts/{resource_drift}'.
10051    pub name: std::string::String,
10052
10053    /// Output only. Terraform info of the resource drift.
10054    pub terraform_info: std::option::Option<crate::model::ResourceDriftTerraformInfo>,
10055
10056    /// Output only. The property drifts of the resource drift.
10057    pub property_drifts: std::vec::Vec<crate::model::PropertyDrift>,
10058
10059    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10060}
10061
10062impl ResourceDrift {
10063    /// Creates a new default instance.
10064    pub fn new() -> Self {
10065        std::default::Default::default()
10066    }
10067
10068    /// Sets the value of [name][crate::model::ResourceDrift::name].
10069    ///
10070    /// # Example
10071    /// ```ignore,no_run
10072    /// # use google_cloud_config_v1::model::ResourceDrift;
10073    /// # let project_id = "project_id";
10074    /// # let location_id = "location_id";
10075    /// # let preview_id = "preview_id";
10076    /// # let resource_drift_id = "resource_drift_id";
10077    /// let x = ResourceDrift::new().set_name(format!("projects/{project_id}/locations/{location_id}/previews/{preview_id}/resourceDrifts/{resource_drift_id}"));
10078    /// ```
10079    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10080        self.name = v.into();
10081        self
10082    }
10083
10084    /// Sets the value of [terraform_info][crate::model::ResourceDrift::terraform_info].
10085    ///
10086    /// # Example
10087    /// ```ignore,no_run
10088    /// # use google_cloud_config_v1::model::ResourceDrift;
10089    /// use google_cloud_config_v1::model::ResourceDriftTerraformInfo;
10090    /// let x = ResourceDrift::new().set_terraform_info(ResourceDriftTerraformInfo::default()/* use setters */);
10091    /// ```
10092    pub fn set_terraform_info<T>(mut self, v: T) -> Self
10093    where
10094        T: std::convert::Into<crate::model::ResourceDriftTerraformInfo>,
10095    {
10096        self.terraform_info = std::option::Option::Some(v.into());
10097        self
10098    }
10099
10100    /// Sets or clears the value of [terraform_info][crate::model::ResourceDrift::terraform_info].
10101    ///
10102    /// # Example
10103    /// ```ignore,no_run
10104    /// # use google_cloud_config_v1::model::ResourceDrift;
10105    /// use google_cloud_config_v1::model::ResourceDriftTerraformInfo;
10106    /// let x = ResourceDrift::new().set_or_clear_terraform_info(Some(ResourceDriftTerraformInfo::default()/* use setters */));
10107    /// let x = ResourceDrift::new().set_or_clear_terraform_info(None::<ResourceDriftTerraformInfo>);
10108    /// ```
10109    pub fn set_or_clear_terraform_info<T>(mut self, v: std::option::Option<T>) -> Self
10110    where
10111        T: std::convert::Into<crate::model::ResourceDriftTerraformInfo>,
10112    {
10113        self.terraform_info = v.map(|x| x.into());
10114        self
10115    }
10116
10117    /// Sets the value of [property_drifts][crate::model::ResourceDrift::property_drifts].
10118    ///
10119    /// # Example
10120    /// ```ignore,no_run
10121    /// # use google_cloud_config_v1::model::ResourceDrift;
10122    /// use google_cloud_config_v1::model::PropertyDrift;
10123    /// let x = ResourceDrift::new()
10124    ///     .set_property_drifts([
10125    ///         PropertyDrift::default()/* use setters */,
10126    ///         PropertyDrift::default()/* use (different) setters */,
10127    ///     ]);
10128    /// ```
10129    pub fn set_property_drifts<T, V>(mut self, v: T) -> Self
10130    where
10131        T: std::iter::IntoIterator<Item = V>,
10132        V: std::convert::Into<crate::model::PropertyDrift>,
10133    {
10134        use std::iter::Iterator;
10135        self.property_drifts = v.into_iter().map(|i| i.into()).collect();
10136        self
10137    }
10138}
10139
10140impl wkt::message::Message for ResourceDrift {
10141    fn typename() -> &'static str {
10142        "type.googleapis.com/google.cloud.config.v1.ResourceDrift"
10143    }
10144}
10145
10146/// A property drift represents a drift to a property in the state file.
10147#[derive(Clone, Default, PartialEq)]
10148#[non_exhaustive]
10149pub struct PropertyDrift {
10150    /// Output only. The path of the property drift.
10151    pub path: std::string::String,
10152
10153    /// Output only. The paths of sensitive fields in `before`. Paths are relative
10154    /// to `path`.
10155    pub before_sensitive_paths: std::vec::Vec<std::string::String>,
10156
10157    /// Output only. Representations of the object value before the actions.
10158    pub before: std::option::Option<wkt::Value>,
10159
10160    /// Output only. The paths of sensitive fields in `after`. Paths are relative
10161    /// to `path`.
10162    pub after_sensitive_paths: std::vec::Vec<std::string::String>,
10163
10164    /// Output only. Representations of the object value after the actions.
10165    pub after: std::option::Option<wkt::Value>,
10166
10167    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10168}
10169
10170impl PropertyDrift {
10171    /// Creates a new default instance.
10172    pub fn new() -> Self {
10173        std::default::Default::default()
10174    }
10175
10176    /// Sets the value of [path][crate::model::PropertyDrift::path].
10177    ///
10178    /// # Example
10179    /// ```ignore,no_run
10180    /// # use google_cloud_config_v1::model::PropertyDrift;
10181    /// let x = PropertyDrift::new().set_path("example");
10182    /// ```
10183    pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10184        self.path = v.into();
10185        self
10186    }
10187
10188    /// Sets the value of [before_sensitive_paths][crate::model::PropertyDrift::before_sensitive_paths].
10189    ///
10190    /// # Example
10191    /// ```ignore,no_run
10192    /// # use google_cloud_config_v1::model::PropertyDrift;
10193    /// let x = PropertyDrift::new().set_before_sensitive_paths(["a", "b", "c"]);
10194    /// ```
10195    pub fn set_before_sensitive_paths<T, V>(mut self, v: T) -> Self
10196    where
10197        T: std::iter::IntoIterator<Item = V>,
10198        V: std::convert::Into<std::string::String>,
10199    {
10200        use std::iter::Iterator;
10201        self.before_sensitive_paths = v.into_iter().map(|i| i.into()).collect();
10202        self
10203    }
10204
10205    /// Sets the value of [before][crate::model::PropertyDrift::before].
10206    ///
10207    /// # Example
10208    /// ```ignore,no_run
10209    /// # use google_cloud_config_v1::model::PropertyDrift;
10210    /// use wkt::Value;
10211    /// let x = PropertyDrift::new().set_before(Value::default()/* use setters */);
10212    /// ```
10213    pub fn set_before<T>(mut self, v: T) -> Self
10214    where
10215        T: std::convert::Into<wkt::Value>,
10216    {
10217        self.before = std::option::Option::Some(v.into());
10218        self
10219    }
10220
10221    /// Sets or clears the value of [before][crate::model::PropertyDrift::before].
10222    ///
10223    /// # Example
10224    /// ```ignore,no_run
10225    /// # use google_cloud_config_v1::model::PropertyDrift;
10226    /// use wkt::Value;
10227    /// let x = PropertyDrift::new().set_or_clear_before(Some(Value::default()/* use setters */));
10228    /// let x = PropertyDrift::new().set_or_clear_before(None::<Value>);
10229    /// ```
10230    pub fn set_or_clear_before<T>(mut self, v: std::option::Option<T>) -> Self
10231    where
10232        T: std::convert::Into<wkt::Value>,
10233    {
10234        self.before = v.map(|x| x.into());
10235        self
10236    }
10237
10238    /// Sets the value of [after_sensitive_paths][crate::model::PropertyDrift::after_sensitive_paths].
10239    ///
10240    /// # Example
10241    /// ```ignore,no_run
10242    /// # use google_cloud_config_v1::model::PropertyDrift;
10243    /// let x = PropertyDrift::new().set_after_sensitive_paths(["a", "b", "c"]);
10244    /// ```
10245    pub fn set_after_sensitive_paths<T, V>(mut self, v: T) -> Self
10246    where
10247        T: std::iter::IntoIterator<Item = V>,
10248        V: std::convert::Into<std::string::String>,
10249    {
10250        use std::iter::Iterator;
10251        self.after_sensitive_paths = v.into_iter().map(|i| i.into()).collect();
10252        self
10253    }
10254
10255    /// Sets the value of [after][crate::model::PropertyDrift::after].
10256    ///
10257    /// # Example
10258    /// ```ignore,no_run
10259    /// # use google_cloud_config_v1::model::PropertyDrift;
10260    /// use wkt::Value;
10261    /// let x = PropertyDrift::new().set_after(Value::default()/* use setters */);
10262    /// ```
10263    pub fn set_after<T>(mut self, v: T) -> Self
10264    where
10265        T: std::convert::Into<wkt::Value>,
10266    {
10267        self.after = std::option::Option::Some(v.into());
10268        self
10269    }
10270
10271    /// Sets or clears the value of [after][crate::model::PropertyDrift::after].
10272    ///
10273    /// # Example
10274    /// ```ignore,no_run
10275    /// # use google_cloud_config_v1::model::PropertyDrift;
10276    /// use wkt::Value;
10277    /// let x = PropertyDrift::new().set_or_clear_after(Some(Value::default()/* use setters */));
10278    /// let x = PropertyDrift::new().set_or_clear_after(None::<Value>);
10279    /// ```
10280    pub fn set_or_clear_after<T>(mut self, v: std::option::Option<T>) -> Self
10281    where
10282        T: std::convert::Into<wkt::Value>,
10283    {
10284        self.after = v.map(|x| x.into());
10285        self
10286    }
10287}
10288
10289impl wkt::message::Message for PropertyDrift {
10290    fn typename() -> &'static str {
10291        "type.googleapis.com/google.cloud.config.v1.PropertyDrift"
10292    }
10293}
10294
10295/// The request message for the ListResourceDrifts method.
10296#[derive(Clone, Default, PartialEq)]
10297#[non_exhaustive]
10298pub struct ListResourceDriftsRequest {
10299    /// Required. The parent in whose context the ResourceDrifts are listed. The
10300    /// parent value is in the format:
10301    /// 'projects/{project_id}/locations/{location}/previews/{preview}'.
10302    pub parent: std::string::String,
10303
10304    /// Optional. When requesting a page of resource drifts, 'page_size' specifies
10305    /// number of resource drifts to return. If unspecified, at most 500 will be
10306    /// returned. The maximum value is 1000.
10307    pub page_size: i32,
10308
10309    /// Optional. Token returned by previous call to 'ListResourceDrifts' which
10310    /// specifies the position in the list from where to continue listing the
10311    /// resource drifts.
10312    pub page_token: std::string::String,
10313
10314    /// Optional. Lists the resource drifts that match the filter expression. A
10315    /// filter expression filters the resource drifts listed in the response. The
10316    /// expression must be of the form '{field} {operator} {value}' where
10317    /// operators: '<', '>',
10318    /// '<=',
10319    /// '>=',
10320    /// '!=', '=', ':' are supported (colon ':' represents a HAS operator which is
10321    /// roughly synonymous with equality). {field} can refer to a proto or JSON
10322    /// field, or a synthetic field. Field names can be camelCase or snake_case.
10323    ///
10324    /// Examples:
10325    ///
10326    /// - Filter by name:
10327    ///   name =
10328    ///   "projects/foo/locations/us-central1/previews/dep/resourceDrifts/baz
10329    pub filter: std::string::String,
10330
10331    /// Optional. Field to use to sort the list.
10332    pub order_by: std::string::String,
10333
10334    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10335}
10336
10337impl ListResourceDriftsRequest {
10338    /// Creates a new default instance.
10339    pub fn new() -> Self {
10340        std::default::Default::default()
10341    }
10342
10343    /// Sets the value of [parent][crate::model::ListResourceDriftsRequest::parent].
10344    ///
10345    /// # Example
10346    /// ```ignore,no_run
10347    /// # use google_cloud_config_v1::model::ListResourceDriftsRequest;
10348    /// # let project_id = "project_id";
10349    /// # let location_id = "location_id";
10350    /// # let preview_id = "preview_id";
10351    /// let x = ListResourceDriftsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/previews/{preview_id}"));
10352    /// ```
10353    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10354        self.parent = v.into();
10355        self
10356    }
10357
10358    /// Sets the value of [page_size][crate::model::ListResourceDriftsRequest::page_size].
10359    ///
10360    /// # Example
10361    /// ```ignore,no_run
10362    /// # use google_cloud_config_v1::model::ListResourceDriftsRequest;
10363    /// let x = ListResourceDriftsRequest::new().set_page_size(42);
10364    /// ```
10365    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10366        self.page_size = v.into();
10367        self
10368    }
10369
10370    /// Sets the value of [page_token][crate::model::ListResourceDriftsRequest::page_token].
10371    ///
10372    /// # Example
10373    /// ```ignore,no_run
10374    /// # use google_cloud_config_v1::model::ListResourceDriftsRequest;
10375    /// let x = ListResourceDriftsRequest::new().set_page_token("example");
10376    /// ```
10377    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10378        self.page_token = v.into();
10379        self
10380    }
10381
10382    /// Sets the value of [filter][crate::model::ListResourceDriftsRequest::filter].
10383    ///
10384    /// # Example
10385    /// ```ignore,no_run
10386    /// # use google_cloud_config_v1::model::ListResourceDriftsRequest;
10387    /// let x = ListResourceDriftsRequest::new().set_filter("example");
10388    /// ```
10389    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10390        self.filter = v.into();
10391        self
10392    }
10393
10394    /// Sets the value of [order_by][crate::model::ListResourceDriftsRequest::order_by].
10395    ///
10396    /// # Example
10397    /// ```ignore,no_run
10398    /// # use google_cloud_config_v1::model::ListResourceDriftsRequest;
10399    /// let x = ListResourceDriftsRequest::new().set_order_by("example");
10400    /// ```
10401    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10402        self.order_by = v.into();
10403        self
10404    }
10405}
10406
10407impl wkt::message::Message for ListResourceDriftsRequest {
10408    fn typename() -> &'static str {
10409        "type.googleapis.com/google.cloud.config.v1.ListResourceDriftsRequest"
10410    }
10411}
10412
10413/// A response to a 'ListResourceDrifts' call. Contains a list of ResourceDrifts.
10414#[derive(Clone, Default, PartialEq)]
10415#[non_exhaustive]
10416pub struct ListResourceDriftsResponse {
10417    /// List of ResourceDrifts.
10418    pub resource_drifts: std::vec::Vec<crate::model::ResourceDrift>,
10419
10420    /// A token to request the next page of resources from the
10421    /// 'ListResourceDrifts' method. The value of an empty string means that
10422    /// there are no more resources to return.
10423    pub next_page_token: std::string::String,
10424
10425    /// Unreachable resources, if any.
10426    pub unreachable: std::vec::Vec<std::string::String>,
10427
10428    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10429}
10430
10431impl ListResourceDriftsResponse {
10432    /// Creates a new default instance.
10433    pub fn new() -> Self {
10434        std::default::Default::default()
10435    }
10436
10437    /// Sets the value of [resource_drifts][crate::model::ListResourceDriftsResponse::resource_drifts].
10438    ///
10439    /// # Example
10440    /// ```ignore,no_run
10441    /// # use google_cloud_config_v1::model::ListResourceDriftsResponse;
10442    /// use google_cloud_config_v1::model::ResourceDrift;
10443    /// let x = ListResourceDriftsResponse::new()
10444    ///     .set_resource_drifts([
10445    ///         ResourceDrift::default()/* use setters */,
10446    ///         ResourceDrift::default()/* use (different) setters */,
10447    ///     ]);
10448    /// ```
10449    pub fn set_resource_drifts<T, V>(mut self, v: T) -> Self
10450    where
10451        T: std::iter::IntoIterator<Item = V>,
10452        V: std::convert::Into<crate::model::ResourceDrift>,
10453    {
10454        use std::iter::Iterator;
10455        self.resource_drifts = v.into_iter().map(|i| i.into()).collect();
10456        self
10457    }
10458
10459    /// Sets the value of [next_page_token][crate::model::ListResourceDriftsResponse::next_page_token].
10460    ///
10461    /// # Example
10462    /// ```ignore,no_run
10463    /// # use google_cloud_config_v1::model::ListResourceDriftsResponse;
10464    /// let x = ListResourceDriftsResponse::new().set_next_page_token("example");
10465    /// ```
10466    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10467        self.next_page_token = v.into();
10468        self
10469    }
10470
10471    /// Sets the value of [unreachable][crate::model::ListResourceDriftsResponse::unreachable].
10472    ///
10473    /// # Example
10474    /// ```ignore,no_run
10475    /// # use google_cloud_config_v1::model::ListResourceDriftsResponse;
10476    /// let x = ListResourceDriftsResponse::new().set_unreachable(["a", "b", "c"]);
10477    /// ```
10478    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
10479    where
10480        T: std::iter::IntoIterator<Item = V>,
10481        V: std::convert::Into<std::string::String>,
10482    {
10483        use std::iter::Iterator;
10484        self.unreachable = v.into_iter().map(|i| i.into()).collect();
10485        self
10486    }
10487}
10488
10489impl wkt::message::Message for ListResourceDriftsResponse {
10490    fn typename() -> &'static str {
10491        "type.googleapis.com/google.cloud.config.v1.ListResourceDriftsResponse"
10492    }
10493}
10494
10495#[doc(hidden)]
10496impl google_cloud_gax::paginator::internal::PageableResponse for ListResourceDriftsResponse {
10497    type PageItem = crate::model::ResourceDrift;
10498
10499    fn items(self) -> std::vec::Vec<Self::PageItem> {
10500        self.resource_drifts
10501    }
10502
10503    fn next_page_token(&self) -> std::string::String {
10504        use std::clone::Clone;
10505        self.next_page_token.clone()
10506    }
10507}
10508
10509/// The request message for the GetResourceDrift method.
10510#[derive(Clone, Default, PartialEq)]
10511#[non_exhaustive]
10512pub struct GetResourceDriftRequest {
10513    /// Required. The name of the resource drift to retrieve.
10514    /// Format:
10515    /// 'projects/{project_id}/locations/{location}/previews/{preview}/resourceDrifts/{resource_drift}'.
10516    pub name: std::string::String,
10517
10518    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10519}
10520
10521impl GetResourceDriftRequest {
10522    /// Creates a new default instance.
10523    pub fn new() -> Self {
10524        std::default::Default::default()
10525    }
10526
10527    /// Sets the value of [name][crate::model::GetResourceDriftRequest::name].
10528    ///
10529    /// # Example
10530    /// ```ignore,no_run
10531    /// # use google_cloud_config_v1::model::GetResourceDriftRequest;
10532    /// # let project_id = "project_id";
10533    /// # let location_id = "location_id";
10534    /// # let preview_id = "preview_id";
10535    /// # let resource_drift_id = "resource_drift_id";
10536    /// let x = GetResourceDriftRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/previews/{preview_id}/resourceDrifts/{resource_drift_id}"));
10537    /// ```
10538    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10539        self.name = v.into();
10540        self
10541    }
10542}
10543
10544impl wkt::message::Message for GetResourceDriftRequest {
10545    fn typename() -> &'static str {
10546        "type.googleapis.com/google.cloud.config.v1.GetResourceDriftRequest"
10547    }
10548}
10549
10550/// ProviderConfig contains the provider configurations.
10551#[derive(Clone, Default, PartialEq)]
10552#[non_exhaustive]
10553pub struct ProviderConfig {
10554    /// Optional. ProviderSource specifies the source type of the provider.
10555    pub source_type: std::option::Option<crate::model::provider_config::ProviderSource>,
10556
10557    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10558}
10559
10560impl ProviderConfig {
10561    /// Creates a new default instance.
10562    pub fn new() -> Self {
10563        std::default::Default::default()
10564    }
10565
10566    /// Sets the value of [source_type][crate::model::ProviderConfig::source_type].
10567    ///
10568    /// # Example
10569    /// ```ignore,no_run
10570    /// # use google_cloud_config_v1::model::ProviderConfig;
10571    /// use google_cloud_config_v1::model::provider_config::ProviderSource;
10572    /// let x0 = ProviderConfig::new().set_source_type(ProviderSource::ServiceMaintained);
10573    /// ```
10574    pub fn set_source_type<T>(mut self, v: T) -> Self
10575    where
10576        T: std::convert::Into<crate::model::provider_config::ProviderSource>,
10577    {
10578        self.source_type = std::option::Option::Some(v.into());
10579        self
10580    }
10581
10582    /// Sets or clears the value of [source_type][crate::model::ProviderConfig::source_type].
10583    ///
10584    /// # Example
10585    /// ```ignore,no_run
10586    /// # use google_cloud_config_v1::model::ProviderConfig;
10587    /// use google_cloud_config_v1::model::provider_config::ProviderSource;
10588    /// let x0 = ProviderConfig::new().set_or_clear_source_type(Some(ProviderSource::ServiceMaintained));
10589    /// let x_none = ProviderConfig::new().set_or_clear_source_type(None::<ProviderSource>);
10590    /// ```
10591    pub fn set_or_clear_source_type<T>(mut self, v: std::option::Option<T>) -> Self
10592    where
10593        T: std::convert::Into<crate::model::provider_config::ProviderSource>,
10594    {
10595        self.source_type = v.map(|x| x.into());
10596        self
10597    }
10598}
10599
10600impl wkt::message::Message for ProviderConfig {
10601    fn typename() -> &'static str {
10602        "type.googleapis.com/google.cloud.config.v1.ProviderConfig"
10603    }
10604}
10605
10606/// Defines additional types related to [ProviderConfig].
10607pub mod provider_config {
10608    #[allow(unused_imports)]
10609    use super::*;
10610
10611    /// ProviderSource represents the source type of the provider.
10612    ///
10613    /// # Working with unknown values
10614    ///
10615    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10616    /// additional enum variants at any time. Adding new variants is not considered
10617    /// a breaking change. Applications should write their code in anticipation of:
10618    ///
10619    /// - New values appearing in future releases of the client library, **and**
10620    /// - New values received dynamically, without application changes.
10621    ///
10622    /// Please consult the [Working with enums] section in the user guide for some
10623    /// guidelines.
10624    ///
10625    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
10626    #[derive(Clone, Debug, PartialEq)]
10627    #[non_exhaustive]
10628    pub enum ProviderSource {
10629        /// Unspecified source type, default to public sources.
10630        Unspecified,
10631        /// Service maintained provider source type.
10632        ServiceMaintained,
10633        /// If set, the enum was initialized with an unknown value.
10634        ///
10635        /// Applications can examine the value using [ProviderSource::value] or
10636        /// [ProviderSource::name].
10637        UnknownValue(provider_source::UnknownValue),
10638    }
10639
10640    #[doc(hidden)]
10641    pub mod provider_source {
10642        #[allow(unused_imports)]
10643        use super::*;
10644        #[derive(Clone, Debug, PartialEq)]
10645        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10646    }
10647
10648    impl ProviderSource {
10649        /// Gets the enum value.
10650        ///
10651        /// Returns `None` if the enum contains an unknown value deserialized from
10652        /// the string representation of enums.
10653        pub fn value(&self) -> std::option::Option<i32> {
10654            match self {
10655                Self::Unspecified => std::option::Option::Some(0),
10656                Self::ServiceMaintained => std::option::Option::Some(1),
10657                Self::UnknownValue(u) => u.0.value(),
10658            }
10659        }
10660
10661        /// Gets the enum value as a string.
10662        ///
10663        /// Returns `None` if the enum contains an unknown value deserialized from
10664        /// the integer representation of enums.
10665        pub fn name(&self) -> std::option::Option<&str> {
10666            match self {
10667                Self::Unspecified => std::option::Option::Some("PROVIDER_SOURCE_UNSPECIFIED"),
10668                Self::ServiceMaintained => std::option::Option::Some("SERVICE_MAINTAINED"),
10669                Self::UnknownValue(u) => u.0.name(),
10670            }
10671        }
10672    }
10673
10674    impl std::default::Default for ProviderSource {
10675        fn default() -> Self {
10676            use std::convert::From;
10677            Self::from(0)
10678        }
10679    }
10680
10681    impl std::fmt::Display for ProviderSource {
10682        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10683            wkt::internal::display_enum(f, self.name(), self.value())
10684        }
10685    }
10686
10687    impl std::convert::From<i32> for ProviderSource {
10688        fn from(value: i32) -> Self {
10689            match value {
10690                0 => Self::Unspecified,
10691                1 => Self::ServiceMaintained,
10692                _ => Self::UnknownValue(provider_source::UnknownValue(
10693                    wkt::internal::UnknownEnumValue::Integer(value),
10694                )),
10695            }
10696        }
10697    }
10698
10699    impl std::convert::From<&str> for ProviderSource {
10700        fn from(value: &str) -> Self {
10701            use std::string::ToString;
10702            match value {
10703                "PROVIDER_SOURCE_UNSPECIFIED" => Self::Unspecified,
10704                "SERVICE_MAINTAINED" => Self::ServiceMaintained,
10705                _ => Self::UnknownValue(provider_source::UnknownValue(
10706                    wkt::internal::UnknownEnumValue::String(value.to_string()),
10707                )),
10708            }
10709        }
10710    }
10711
10712    impl serde::ser::Serialize for ProviderSource {
10713        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10714        where
10715            S: serde::Serializer,
10716        {
10717            match self {
10718                Self::Unspecified => serializer.serialize_i32(0),
10719                Self::ServiceMaintained => serializer.serialize_i32(1),
10720                Self::UnknownValue(u) => u.0.serialize(serializer),
10721            }
10722        }
10723    }
10724
10725    impl<'de> serde::de::Deserialize<'de> for ProviderSource {
10726        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10727        where
10728            D: serde::Deserializer<'de>,
10729        {
10730            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ProviderSource>::new(
10731                ".google.cloud.config.v1.ProviderConfig.ProviderSource",
10732            ))
10733        }
10734    }
10735}
10736
10737/// The request message for the GetAutoMigrationConfig method.
10738#[derive(Clone, Default, PartialEq)]
10739#[non_exhaustive]
10740pub struct GetAutoMigrationConfigRequest {
10741    /// Required. The name of the AutoMigrationConfig.
10742    /// Format:
10743    /// 'projects/{project_id}/locations/{location}/AutoMigrationConfig'.
10744    pub name: std::string::String,
10745
10746    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10747}
10748
10749impl GetAutoMigrationConfigRequest {
10750    /// Creates a new default instance.
10751    pub fn new() -> Self {
10752        std::default::Default::default()
10753    }
10754
10755    /// Sets the value of [name][crate::model::GetAutoMigrationConfigRequest::name].
10756    ///
10757    /// # Example
10758    /// ```ignore,no_run
10759    /// # use google_cloud_config_v1::model::GetAutoMigrationConfigRequest;
10760    /// # let project_id = "project_id";
10761    /// # let location_id = "location_id";
10762    /// let x = GetAutoMigrationConfigRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/autoMigrationConfig"));
10763    /// ```
10764    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10765        self.name = v.into();
10766        self
10767    }
10768}
10769
10770impl wkt::message::Message for GetAutoMigrationConfigRequest {
10771    fn typename() -> &'static str {
10772        "type.googleapis.com/google.cloud.config.v1.GetAutoMigrationConfigRequest"
10773    }
10774}
10775
10776/// AutoMigrationConfig contains the automigration configuration for a project.
10777#[derive(Clone, Default, PartialEq)]
10778#[non_exhaustive]
10779pub struct AutoMigrationConfig {
10780    /// Identifier. The name of the AutoMigrationConfig.
10781    /// Format:
10782    /// 'projects/{project_id}/locations/{location}/AutoMigrationConfig'.
10783    pub name: std::string::String,
10784
10785    /// Output only. Time the AutoMigrationConfig was last updated.
10786    pub update_time: std::option::Option<wkt::Timestamp>,
10787
10788    /// Optional. Whether the auto migration is enabled for the project.
10789    pub auto_migration_enabled: bool,
10790
10791    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10792}
10793
10794impl AutoMigrationConfig {
10795    /// Creates a new default instance.
10796    pub fn new() -> Self {
10797        std::default::Default::default()
10798    }
10799
10800    /// Sets the value of [name][crate::model::AutoMigrationConfig::name].
10801    ///
10802    /// # Example
10803    /// ```ignore,no_run
10804    /// # use google_cloud_config_v1::model::AutoMigrationConfig;
10805    /// # let project_id = "project_id";
10806    /// # let location_id = "location_id";
10807    /// let x = AutoMigrationConfig::new().set_name(format!("projects/{project_id}/locations/{location_id}/autoMigrationConfig"));
10808    /// ```
10809    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10810        self.name = v.into();
10811        self
10812    }
10813
10814    /// Sets the value of [update_time][crate::model::AutoMigrationConfig::update_time].
10815    ///
10816    /// # Example
10817    /// ```ignore,no_run
10818    /// # use google_cloud_config_v1::model::AutoMigrationConfig;
10819    /// use wkt::Timestamp;
10820    /// let x = AutoMigrationConfig::new().set_update_time(Timestamp::default()/* use setters */);
10821    /// ```
10822    pub fn set_update_time<T>(mut self, v: T) -> Self
10823    where
10824        T: std::convert::Into<wkt::Timestamp>,
10825    {
10826        self.update_time = std::option::Option::Some(v.into());
10827        self
10828    }
10829
10830    /// Sets or clears the value of [update_time][crate::model::AutoMigrationConfig::update_time].
10831    ///
10832    /// # Example
10833    /// ```ignore,no_run
10834    /// # use google_cloud_config_v1::model::AutoMigrationConfig;
10835    /// use wkt::Timestamp;
10836    /// let x = AutoMigrationConfig::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
10837    /// let x = AutoMigrationConfig::new().set_or_clear_update_time(None::<Timestamp>);
10838    /// ```
10839    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
10840    where
10841        T: std::convert::Into<wkt::Timestamp>,
10842    {
10843        self.update_time = v.map(|x| x.into());
10844        self
10845    }
10846
10847    /// Sets the value of [auto_migration_enabled][crate::model::AutoMigrationConfig::auto_migration_enabled].
10848    ///
10849    /// # Example
10850    /// ```ignore,no_run
10851    /// # use google_cloud_config_v1::model::AutoMigrationConfig;
10852    /// let x = AutoMigrationConfig::new().set_auto_migration_enabled(true);
10853    /// ```
10854    pub fn set_auto_migration_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10855        self.auto_migration_enabled = v.into();
10856        self
10857    }
10858}
10859
10860impl wkt::message::Message for AutoMigrationConfig {
10861    fn typename() -> &'static str {
10862        "type.googleapis.com/google.cloud.config.v1.AutoMigrationConfig"
10863    }
10864}
10865
10866/// The request message for the UpdateAutoMigrationConfig method.
10867#[derive(Clone, Default, PartialEq)]
10868#[non_exhaustive]
10869pub struct UpdateAutoMigrationConfigRequest {
10870    /// Optional. The update mask applies to the resource. See
10871    /// [google.protobuf.FieldMask][google.protobuf.FieldMask].
10872    ///
10873    /// [google.protobuf.FieldMask]: wkt::FieldMask
10874    pub update_mask: std::option::Option<wkt::FieldMask>,
10875
10876    /// Required. The AutoMigrationConfig to update.
10877    pub auto_migration_config: std::option::Option<crate::model::AutoMigrationConfig>,
10878
10879    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10880}
10881
10882impl UpdateAutoMigrationConfigRequest {
10883    /// Creates a new default instance.
10884    pub fn new() -> Self {
10885        std::default::Default::default()
10886    }
10887
10888    /// Sets the value of [update_mask][crate::model::UpdateAutoMigrationConfigRequest::update_mask].
10889    ///
10890    /// # Example
10891    /// ```ignore,no_run
10892    /// # use google_cloud_config_v1::model::UpdateAutoMigrationConfigRequest;
10893    /// use wkt::FieldMask;
10894    /// let x = UpdateAutoMigrationConfigRequest::new().set_update_mask(FieldMask::default()/* use setters */);
10895    /// ```
10896    pub fn set_update_mask<T>(mut self, v: T) -> Self
10897    where
10898        T: std::convert::Into<wkt::FieldMask>,
10899    {
10900        self.update_mask = std::option::Option::Some(v.into());
10901        self
10902    }
10903
10904    /// Sets or clears the value of [update_mask][crate::model::UpdateAutoMigrationConfigRequest::update_mask].
10905    ///
10906    /// # Example
10907    /// ```ignore,no_run
10908    /// # use google_cloud_config_v1::model::UpdateAutoMigrationConfigRequest;
10909    /// use wkt::FieldMask;
10910    /// let x = UpdateAutoMigrationConfigRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
10911    /// let x = UpdateAutoMigrationConfigRequest::new().set_or_clear_update_mask(None::<FieldMask>);
10912    /// ```
10913    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
10914    where
10915        T: std::convert::Into<wkt::FieldMask>,
10916    {
10917        self.update_mask = v.map(|x| x.into());
10918        self
10919    }
10920
10921    /// Sets the value of [auto_migration_config][crate::model::UpdateAutoMigrationConfigRequest::auto_migration_config].
10922    ///
10923    /// # Example
10924    /// ```ignore,no_run
10925    /// # use google_cloud_config_v1::model::UpdateAutoMigrationConfigRequest;
10926    /// use google_cloud_config_v1::model::AutoMigrationConfig;
10927    /// let x = UpdateAutoMigrationConfigRequest::new().set_auto_migration_config(AutoMigrationConfig::default()/* use setters */);
10928    /// ```
10929    pub fn set_auto_migration_config<T>(mut self, v: T) -> Self
10930    where
10931        T: std::convert::Into<crate::model::AutoMigrationConfig>,
10932    {
10933        self.auto_migration_config = std::option::Option::Some(v.into());
10934        self
10935    }
10936
10937    /// Sets or clears the value of [auto_migration_config][crate::model::UpdateAutoMigrationConfigRequest::auto_migration_config].
10938    ///
10939    /// # Example
10940    /// ```ignore,no_run
10941    /// # use google_cloud_config_v1::model::UpdateAutoMigrationConfigRequest;
10942    /// use google_cloud_config_v1::model::AutoMigrationConfig;
10943    /// let x = UpdateAutoMigrationConfigRequest::new().set_or_clear_auto_migration_config(Some(AutoMigrationConfig::default()/* use setters */));
10944    /// let x = UpdateAutoMigrationConfigRequest::new().set_or_clear_auto_migration_config(None::<AutoMigrationConfig>);
10945    /// ```
10946    pub fn set_or_clear_auto_migration_config<T>(mut self, v: std::option::Option<T>) -> Self
10947    where
10948        T: std::convert::Into<crate::model::AutoMigrationConfig>,
10949    {
10950        self.auto_migration_config = v.map(|x| x.into());
10951        self
10952    }
10953}
10954
10955impl wkt::message::Message for UpdateAutoMigrationConfigRequest {
10956    fn typename() -> &'static str {
10957        "type.googleapis.com/google.cloud.config.v1.UpdateAutoMigrationConfigRequest"
10958    }
10959}
10960
10961/// A DeploymentGroup is a collection of DeploymentUnits that in a DAG-like
10962/// structure.
10963#[derive(Clone, Default, PartialEq)]
10964#[non_exhaustive]
10965pub struct DeploymentGroup {
10966    /// Identifier. The name of the deployment group.
10967    /// Format:
10968    /// 'projects/{project_id}/locations/{location}/deploymentGroups/{deployment_group}'.
10969    pub name: std::string::String,
10970
10971    /// Output only. Time when the deployment group was created.
10972    pub create_time: std::option::Option<wkt::Timestamp>,
10973
10974    /// Output only. Time when the deployment group was last updated.
10975    pub update_time: std::option::Option<wkt::Timestamp>,
10976
10977    /// Optional. User-defined metadata for the deployment group.
10978    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
10979
10980    /// Optional. Arbitrary key-value metadata storage e.g. to help client tools
10981    /// identify deployment group during automation. See
10982    /// <https://google.aip.dev/148#annotations> for details on format and size
10983    /// limitations.
10984    pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
10985
10986    /// Output only. Current state of the deployment group.
10987    pub state: crate::model::deployment_group::State,
10988
10989    /// Output only. Additional information regarding the current state.
10990    pub state_description: std::string::String,
10991
10992    /// The deployment units of the deployment group in a DAG like structure.
10993    /// When a deployment group is being provisioned, the deployment units are
10994    /// deployed in a DAG order.
10995    /// The provided units must be in a DAG order, otherwise an error will be
10996    /// returned.
10997    pub deployment_units: std::vec::Vec<crate::model::DeploymentUnit>,
10998
10999    /// Output only. The provisioning state of the deployment group.
11000    pub provisioning_state: crate::model::deployment_group::ProvisioningState,
11001
11002    /// Output only. Additional information regarding the current provisioning
11003    /// state.
11004    pub provisioning_state_description: std::string::String,
11005
11006    /// Output only. The error status of the deployment group provisioning or
11007    /// deprovisioning.
11008    pub provisioning_error: std::option::Option<google_cloud_rpc::model::Status>,
11009
11010    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11011}
11012
11013impl DeploymentGroup {
11014    /// Creates a new default instance.
11015    pub fn new() -> Self {
11016        std::default::Default::default()
11017    }
11018
11019    /// Sets the value of [name][crate::model::DeploymentGroup::name].
11020    ///
11021    /// # Example
11022    /// ```ignore,no_run
11023    /// # use google_cloud_config_v1::model::DeploymentGroup;
11024    /// # let project_id = "project_id";
11025    /// # let location_id = "location_id";
11026    /// # let deployment_group_id = "deployment_group_id";
11027    /// let x = DeploymentGroup::new().set_name(format!("projects/{project_id}/locations/{location_id}/deploymentGroups/{deployment_group_id}"));
11028    /// ```
11029    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11030        self.name = v.into();
11031        self
11032    }
11033
11034    /// Sets the value of [create_time][crate::model::DeploymentGroup::create_time].
11035    ///
11036    /// # Example
11037    /// ```ignore,no_run
11038    /// # use google_cloud_config_v1::model::DeploymentGroup;
11039    /// use wkt::Timestamp;
11040    /// let x = DeploymentGroup::new().set_create_time(Timestamp::default()/* use setters */);
11041    /// ```
11042    pub fn set_create_time<T>(mut self, v: T) -> Self
11043    where
11044        T: std::convert::Into<wkt::Timestamp>,
11045    {
11046        self.create_time = std::option::Option::Some(v.into());
11047        self
11048    }
11049
11050    /// Sets or clears the value of [create_time][crate::model::DeploymentGroup::create_time].
11051    ///
11052    /// # Example
11053    /// ```ignore,no_run
11054    /// # use google_cloud_config_v1::model::DeploymentGroup;
11055    /// use wkt::Timestamp;
11056    /// let x = DeploymentGroup::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
11057    /// let x = DeploymentGroup::new().set_or_clear_create_time(None::<Timestamp>);
11058    /// ```
11059    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
11060    where
11061        T: std::convert::Into<wkt::Timestamp>,
11062    {
11063        self.create_time = v.map(|x| x.into());
11064        self
11065    }
11066
11067    /// Sets the value of [update_time][crate::model::DeploymentGroup::update_time].
11068    ///
11069    /// # Example
11070    /// ```ignore,no_run
11071    /// # use google_cloud_config_v1::model::DeploymentGroup;
11072    /// use wkt::Timestamp;
11073    /// let x = DeploymentGroup::new().set_update_time(Timestamp::default()/* use setters */);
11074    /// ```
11075    pub fn set_update_time<T>(mut self, v: T) -> Self
11076    where
11077        T: std::convert::Into<wkt::Timestamp>,
11078    {
11079        self.update_time = std::option::Option::Some(v.into());
11080        self
11081    }
11082
11083    /// Sets or clears the value of [update_time][crate::model::DeploymentGroup::update_time].
11084    ///
11085    /// # Example
11086    /// ```ignore,no_run
11087    /// # use google_cloud_config_v1::model::DeploymentGroup;
11088    /// use wkt::Timestamp;
11089    /// let x = DeploymentGroup::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
11090    /// let x = DeploymentGroup::new().set_or_clear_update_time(None::<Timestamp>);
11091    /// ```
11092    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
11093    where
11094        T: std::convert::Into<wkt::Timestamp>,
11095    {
11096        self.update_time = v.map(|x| x.into());
11097        self
11098    }
11099
11100    /// Sets the value of [labels][crate::model::DeploymentGroup::labels].
11101    ///
11102    /// # Example
11103    /// ```ignore,no_run
11104    /// # use google_cloud_config_v1::model::DeploymentGroup;
11105    /// let x = DeploymentGroup::new().set_labels([
11106    ///     ("key0", "abc"),
11107    ///     ("key1", "xyz"),
11108    /// ]);
11109    /// ```
11110    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
11111    where
11112        T: std::iter::IntoIterator<Item = (K, V)>,
11113        K: std::convert::Into<std::string::String>,
11114        V: std::convert::Into<std::string::String>,
11115    {
11116        use std::iter::Iterator;
11117        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
11118        self
11119    }
11120
11121    /// Sets the value of [annotations][crate::model::DeploymentGroup::annotations].
11122    ///
11123    /// # Example
11124    /// ```ignore,no_run
11125    /// # use google_cloud_config_v1::model::DeploymentGroup;
11126    /// let x = DeploymentGroup::new().set_annotations([
11127    ///     ("key0", "abc"),
11128    ///     ("key1", "xyz"),
11129    /// ]);
11130    /// ```
11131    pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
11132    where
11133        T: std::iter::IntoIterator<Item = (K, V)>,
11134        K: std::convert::Into<std::string::String>,
11135        V: std::convert::Into<std::string::String>,
11136    {
11137        use std::iter::Iterator;
11138        self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
11139        self
11140    }
11141
11142    /// Sets the value of [state][crate::model::DeploymentGroup::state].
11143    ///
11144    /// # Example
11145    /// ```ignore,no_run
11146    /// # use google_cloud_config_v1::model::DeploymentGroup;
11147    /// use google_cloud_config_v1::model::deployment_group::State;
11148    /// let x0 = DeploymentGroup::new().set_state(State::Creating);
11149    /// let x1 = DeploymentGroup::new().set_state(State::Active);
11150    /// let x2 = DeploymentGroup::new().set_state(State::Updating);
11151    /// ```
11152    pub fn set_state<T: std::convert::Into<crate::model::deployment_group::State>>(
11153        mut self,
11154        v: T,
11155    ) -> Self {
11156        self.state = v.into();
11157        self
11158    }
11159
11160    /// Sets the value of [state_description][crate::model::DeploymentGroup::state_description].
11161    ///
11162    /// # Example
11163    /// ```ignore,no_run
11164    /// # use google_cloud_config_v1::model::DeploymentGroup;
11165    /// let x = DeploymentGroup::new().set_state_description("example");
11166    /// ```
11167    pub fn set_state_description<T: std::convert::Into<std::string::String>>(
11168        mut self,
11169        v: T,
11170    ) -> Self {
11171        self.state_description = v.into();
11172        self
11173    }
11174
11175    /// Sets the value of [deployment_units][crate::model::DeploymentGroup::deployment_units].
11176    ///
11177    /// # Example
11178    /// ```ignore,no_run
11179    /// # use google_cloud_config_v1::model::DeploymentGroup;
11180    /// use google_cloud_config_v1::model::DeploymentUnit;
11181    /// let x = DeploymentGroup::new()
11182    ///     .set_deployment_units([
11183    ///         DeploymentUnit::default()/* use setters */,
11184    ///         DeploymentUnit::default()/* use (different) setters */,
11185    ///     ]);
11186    /// ```
11187    pub fn set_deployment_units<T, V>(mut self, v: T) -> Self
11188    where
11189        T: std::iter::IntoIterator<Item = V>,
11190        V: std::convert::Into<crate::model::DeploymentUnit>,
11191    {
11192        use std::iter::Iterator;
11193        self.deployment_units = v.into_iter().map(|i| i.into()).collect();
11194        self
11195    }
11196
11197    /// Sets the value of [provisioning_state][crate::model::DeploymentGroup::provisioning_state].
11198    ///
11199    /// # Example
11200    /// ```ignore,no_run
11201    /// # use google_cloud_config_v1::model::DeploymentGroup;
11202    /// use google_cloud_config_v1::model::deployment_group::ProvisioningState;
11203    /// let x0 = DeploymentGroup::new().set_provisioning_state(ProvisioningState::Provisioning);
11204    /// let x1 = DeploymentGroup::new().set_provisioning_state(ProvisioningState::Provisioned);
11205    /// let x2 = DeploymentGroup::new().set_provisioning_state(ProvisioningState::FailedToProvision);
11206    /// ```
11207    pub fn set_provisioning_state<
11208        T: std::convert::Into<crate::model::deployment_group::ProvisioningState>,
11209    >(
11210        mut self,
11211        v: T,
11212    ) -> Self {
11213        self.provisioning_state = v.into();
11214        self
11215    }
11216
11217    /// Sets the value of [provisioning_state_description][crate::model::DeploymentGroup::provisioning_state_description].
11218    ///
11219    /// # Example
11220    /// ```ignore,no_run
11221    /// # use google_cloud_config_v1::model::DeploymentGroup;
11222    /// let x = DeploymentGroup::new().set_provisioning_state_description("example");
11223    /// ```
11224    pub fn set_provisioning_state_description<T: std::convert::Into<std::string::String>>(
11225        mut self,
11226        v: T,
11227    ) -> Self {
11228        self.provisioning_state_description = v.into();
11229        self
11230    }
11231
11232    /// Sets the value of [provisioning_error][crate::model::DeploymentGroup::provisioning_error].
11233    ///
11234    /// # Example
11235    /// ```ignore,no_run
11236    /// # use google_cloud_config_v1::model::DeploymentGroup;
11237    /// use google_cloud_rpc::model::Status;
11238    /// let x = DeploymentGroup::new().set_provisioning_error(Status::default()/* use setters */);
11239    /// ```
11240    pub fn set_provisioning_error<T>(mut self, v: T) -> Self
11241    where
11242        T: std::convert::Into<google_cloud_rpc::model::Status>,
11243    {
11244        self.provisioning_error = std::option::Option::Some(v.into());
11245        self
11246    }
11247
11248    /// Sets or clears the value of [provisioning_error][crate::model::DeploymentGroup::provisioning_error].
11249    ///
11250    /// # Example
11251    /// ```ignore,no_run
11252    /// # use google_cloud_config_v1::model::DeploymentGroup;
11253    /// use google_cloud_rpc::model::Status;
11254    /// let x = DeploymentGroup::new().set_or_clear_provisioning_error(Some(Status::default()/* use setters */));
11255    /// let x = DeploymentGroup::new().set_or_clear_provisioning_error(None::<Status>);
11256    /// ```
11257    pub fn set_or_clear_provisioning_error<T>(mut self, v: std::option::Option<T>) -> Self
11258    where
11259        T: std::convert::Into<google_cloud_rpc::model::Status>,
11260    {
11261        self.provisioning_error = v.map(|x| x.into());
11262        self
11263    }
11264}
11265
11266impl wkt::message::Message for DeploymentGroup {
11267    fn typename() -> &'static str {
11268        "type.googleapis.com/google.cloud.config.v1.DeploymentGroup"
11269    }
11270}
11271
11272/// Defines additional types related to [DeploymentGroup].
11273pub mod deployment_group {
11274    #[allow(unused_imports)]
11275    use super::*;
11276
11277    /// Possible states of a deployment group.
11278    ///
11279    /// # Working with unknown values
11280    ///
11281    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11282    /// additional enum variants at any time. Adding new variants is not considered
11283    /// a breaking change. Applications should write their code in anticipation of:
11284    ///
11285    /// - New values appearing in future releases of the client library, **and**
11286    /// - New values received dynamically, without application changes.
11287    ///
11288    /// Please consult the [Working with enums] section in the user guide for some
11289    /// guidelines.
11290    ///
11291    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
11292    #[derive(Clone, Debug, PartialEq)]
11293    #[non_exhaustive]
11294    pub enum State {
11295        /// The default value. This value is used if the state is omitted.
11296        Unspecified,
11297        /// The deployment group is being created.
11298        Creating,
11299        /// The deployment group is healthy.
11300        Active,
11301        /// The deployment group is being updated.
11302        Updating,
11303        /// The deployment group is being deleted.
11304        Deleting,
11305        /// The deployment group has encountered an unexpected error.
11306        Failed,
11307        /// The deployment group is no longer being actively reconciled.
11308        /// This may be the result of recovering the project after deletion.
11309        Suspended,
11310        /// The deployment group has been deleted.
11311        Deleted,
11312        /// If set, the enum was initialized with an unknown value.
11313        ///
11314        /// Applications can examine the value using [State::value] or
11315        /// [State::name].
11316        UnknownValue(state::UnknownValue),
11317    }
11318
11319    #[doc(hidden)]
11320    pub mod state {
11321        #[allow(unused_imports)]
11322        use super::*;
11323        #[derive(Clone, Debug, PartialEq)]
11324        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11325    }
11326
11327    impl State {
11328        /// Gets the enum value.
11329        ///
11330        /// Returns `None` if the enum contains an unknown value deserialized from
11331        /// the string representation of enums.
11332        pub fn value(&self) -> std::option::Option<i32> {
11333            match self {
11334                Self::Unspecified => std::option::Option::Some(0),
11335                Self::Creating => std::option::Option::Some(1),
11336                Self::Active => std::option::Option::Some(2),
11337                Self::Updating => std::option::Option::Some(3),
11338                Self::Deleting => std::option::Option::Some(4),
11339                Self::Failed => std::option::Option::Some(5),
11340                Self::Suspended => std::option::Option::Some(6),
11341                Self::Deleted => std::option::Option::Some(7),
11342                Self::UnknownValue(u) => u.0.value(),
11343            }
11344        }
11345
11346        /// Gets the enum value as a string.
11347        ///
11348        /// Returns `None` if the enum contains an unknown value deserialized from
11349        /// the integer representation of enums.
11350        pub fn name(&self) -> std::option::Option<&str> {
11351            match self {
11352                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
11353                Self::Creating => std::option::Option::Some("CREATING"),
11354                Self::Active => std::option::Option::Some("ACTIVE"),
11355                Self::Updating => std::option::Option::Some("UPDATING"),
11356                Self::Deleting => std::option::Option::Some("DELETING"),
11357                Self::Failed => std::option::Option::Some("FAILED"),
11358                Self::Suspended => std::option::Option::Some("SUSPENDED"),
11359                Self::Deleted => std::option::Option::Some("DELETED"),
11360                Self::UnknownValue(u) => u.0.name(),
11361            }
11362        }
11363    }
11364
11365    impl std::default::Default for State {
11366        fn default() -> Self {
11367            use std::convert::From;
11368            Self::from(0)
11369        }
11370    }
11371
11372    impl std::fmt::Display for State {
11373        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11374            wkt::internal::display_enum(f, self.name(), self.value())
11375        }
11376    }
11377
11378    impl std::convert::From<i32> for State {
11379        fn from(value: i32) -> Self {
11380            match value {
11381                0 => Self::Unspecified,
11382                1 => Self::Creating,
11383                2 => Self::Active,
11384                3 => Self::Updating,
11385                4 => Self::Deleting,
11386                5 => Self::Failed,
11387                6 => Self::Suspended,
11388                7 => Self::Deleted,
11389                _ => Self::UnknownValue(state::UnknownValue(
11390                    wkt::internal::UnknownEnumValue::Integer(value),
11391                )),
11392            }
11393        }
11394    }
11395
11396    impl std::convert::From<&str> for State {
11397        fn from(value: &str) -> Self {
11398            use std::string::ToString;
11399            match value {
11400                "STATE_UNSPECIFIED" => Self::Unspecified,
11401                "CREATING" => Self::Creating,
11402                "ACTIVE" => Self::Active,
11403                "UPDATING" => Self::Updating,
11404                "DELETING" => Self::Deleting,
11405                "FAILED" => Self::Failed,
11406                "SUSPENDED" => Self::Suspended,
11407                "DELETED" => Self::Deleted,
11408                _ => Self::UnknownValue(state::UnknownValue(
11409                    wkt::internal::UnknownEnumValue::String(value.to_string()),
11410                )),
11411            }
11412        }
11413    }
11414
11415    impl serde::ser::Serialize for State {
11416        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11417        where
11418            S: serde::Serializer,
11419        {
11420            match self {
11421                Self::Unspecified => serializer.serialize_i32(0),
11422                Self::Creating => serializer.serialize_i32(1),
11423                Self::Active => serializer.serialize_i32(2),
11424                Self::Updating => serializer.serialize_i32(3),
11425                Self::Deleting => serializer.serialize_i32(4),
11426                Self::Failed => serializer.serialize_i32(5),
11427                Self::Suspended => serializer.serialize_i32(6),
11428                Self::Deleted => serializer.serialize_i32(7),
11429                Self::UnknownValue(u) => u.0.serialize(serializer),
11430            }
11431        }
11432    }
11433
11434    impl<'de> serde::de::Deserialize<'de> for State {
11435        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11436        where
11437            D: serde::Deserializer<'de>,
11438        {
11439            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
11440                ".google.cloud.config.v1.DeploymentGroup.State",
11441            ))
11442        }
11443    }
11444
11445    /// Possible provisioning states of a deployment group.
11446    ///
11447    /// # Working with unknown values
11448    ///
11449    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11450    /// additional enum variants at any time. Adding new variants is not considered
11451    /// a breaking change. Applications should write their code in anticipation of:
11452    ///
11453    /// - New values appearing in future releases of the client library, **and**
11454    /// - New values received dynamically, without application changes.
11455    ///
11456    /// Please consult the [Working with enums] section in the user guide for some
11457    /// guidelines.
11458    ///
11459    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
11460    #[derive(Clone, Debug, PartialEq)]
11461    #[non_exhaustive]
11462    pub enum ProvisioningState {
11463        /// Unspecified provisioning state.
11464        Unspecified,
11465        /// The deployment group is being provisioned.
11466        Provisioning,
11467        /// The deployment group is provisioned.
11468        Provisioned,
11469        /// The deployment group failed to be provisioned.
11470        FailedToProvision,
11471        /// The deployment group is being deprovisioned.
11472        Deprovisioning,
11473        /// The deployment group is deprovisioned.
11474        Deprovisioned,
11475        /// The deployment group failed to be deprovisioned.
11476        FailedToDeprovision,
11477        /// If set, the enum was initialized with an unknown value.
11478        ///
11479        /// Applications can examine the value using [ProvisioningState::value] or
11480        /// [ProvisioningState::name].
11481        UnknownValue(provisioning_state::UnknownValue),
11482    }
11483
11484    #[doc(hidden)]
11485    pub mod provisioning_state {
11486        #[allow(unused_imports)]
11487        use super::*;
11488        #[derive(Clone, Debug, PartialEq)]
11489        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11490    }
11491
11492    impl ProvisioningState {
11493        /// Gets the enum value.
11494        ///
11495        /// Returns `None` if the enum contains an unknown value deserialized from
11496        /// the string representation of enums.
11497        pub fn value(&self) -> std::option::Option<i32> {
11498            match self {
11499                Self::Unspecified => std::option::Option::Some(0),
11500                Self::Provisioning => std::option::Option::Some(1),
11501                Self::Provisioned => std::option::Option::Some(2),
11502                Self::FailedToProvision => std::option::Option::Some(3),
11503                Self::Deprovisioning => std::option::Option::Some(4),
11504                Self::Deprovisioned => std::option::Option::Some(5),
11505                Self::FailedToDeprovision => std::option::Option::Some(6),
11506                Self::UnknownValue(u) => u.0.value(),
11507            }
11508        }
11509
11510        /// Gets the enum value as a string.
11511        ///
11512        /// Returns `None` if the enum contains an unknown value deserialized from
11513        /// the integer representation of enums.
11514        pub fn name(&self) -> std::option::Option<&str> {
11515            match self {
11516                Self::Unspecified => std::option::Option::Some("PROVISIONING_STATE_UNSPECIFIED"),
11517                Self::Provisioning => std::option::Option::Some("PROVISIONING"),
11518                Self::Provisioned => std::option::Option::Some("PROVISIONED"),
11519                Self::FailedToProvision => std::option::Option::Some("FAILED_TO_PROVISION"),
11520                Self::Deprovisioning => std::option::Option::Some("DEPROVISIONING"),
11521                Self::Deprovisioned => std::option::Option::Some("DEPROVISIONED"),
11522                Self::FailedToDeprovision => std::option::Option::Some("FAILED_TO_DEPROVISION"),
11523                Self::UnknownValue(u) => u.0.name(),
11524            }
11525        }
11526    }
11527
11528    impl std::default::Default for ProvisioningState {
11529        fn default() -> Self {
11530            use std::convert::From;
11531            Self::from(0)
11532        }
11533    }
11534
11535    impl std::fmt::Display for ProvisioningState {
11536        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11537            wkt::internal::display_enum(f, self.name(), self.value())
11538        }
11539    }
11540
11541    impl std::convert::From<i32> for ProvisioningState {
11542        fn from(value: i32) -> Self {
11543            match value {
11544                0 => Self::Unspecified,
11545                1 => Self::Provisioning,
11546                2 => Self::Provisioned,
11547                3 => Self::FailedToProvision,
11548                4 => Self::Deprovisioning,
11549                5 => Self::Deprovisioned,
11550                6 => Self::FailedToDeprovision,
11551                _ => Self::UnknownValue(provisioning_state::UnknownValue(
11552                    wkt::internal::UnknownEnumValue::Integer(value),
11553                )),
11554            }
11555        }
11556    }
11557
11558    impl std::convert::From<&str> for ProvisioningState {
11559        fn from(value: &str) -> Self {
11560            use std::string::ToString;
11561            match value {
11562                "PROVISIONING_STATE_UNSPECIFIED" => Self::Unspecified,
11563                "PROVISIONING" => Self::Provisioning,
11564                "PROVISIONED" => Self::Provisioned,
11565                "FAILED_TO_PROVISION" => Self::FailedToProvision,
11566                "DEPROVISIONING" => Self::Deprovisioning,
11567                "DEPROVISIONED" => Self::Deprovisioned,
11568                "FAILED_TO_DEPROVISION" => Self::FailedToDeprovision,
11569                _ => Self::UnknownValue(provisioning_state::UnknownValue(
11570                    wkt::internal::UnknownEnumValue::String(value.to_string()),
11571                )),
11572            }
11573        }
11574    }
11575
11576    impl serde::ser::Serialize for ProvisioningState {
11577        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11578        where
11579            S: serde::Serializer,
11580        {
11581            match self {
11582                Self::Unspecified => serializer.serialize_i32(0),
11583                Self::Provisioning => serializer.serialize_i32(1),
11584                Self::Provisioned => serializer.serialize_i32(2),
11585                Self::FailedToProvision => serializer.serialize_i32(3),
11586                Self::Deprovisioning => serializer.serialize_i32(4),
11587                Self::Deprovisioned => serializer.serialize_i32(5),
11588                Self::FailedToDeprovision => serializer.serialize_i32(6),
11589                Self::UnknownValue(u) => u.0.serialize(serializer),
11590            }
11591        }
11592    }
11593
11594    impl<'de> serde::de::Deserialize<'de> for ProvisioningState {
11595        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11596        where
11597            D: serde::Deserializer<'de>,
11598        {
11599            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ProvisioningState>::new(
11600                ".google.cloud.config.v1.DeploymentGroup.ProvisioningState",
11601            ))
11602        }
11603    }
11604}
11605
11606/// A DeploymentUnit is a container for a deployment and its dependencies.
11607/// An existing deployment can be provided directly in the unit, or the unit
11608/// can act as a placeholder to define the DAG, with the deployment specs
11609/// supplied in a `provisionDeploymentRequest`.
11610#[derive(Clone, Default, PartialEq)]
11611#[non_exhaustive]
11612pub struct DeploymentUnit {
11613    /// The id of the deployment unit. Must be unique within the deployment group.
11614    pub id: std::string::String,
11615
11616    /// Optional. The name of the deployment to be provisioned.
11617    /// Format:
11618    /// 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
11619    pub deployment: std::option::Option<std::string::String>,
11620
11621    /// Required. The IDs of the deployment units within the deployment group that
11622    /// this unit depends on.
11623    pub dependencies: std::vec::Vec<std::string::String>,
11624
11625    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11626}
11627
11628impl DeploymentUnit {
11629    /// Creates a new default instance.
11630    pub fn new() -> Self {
11631        std::default::Default::default()
11632    }
11633
11634    /// Sets the value of [id][crate::model::DeploymentUnit::id].
11635    ///
11636    /// # Example
11637    /// ```ignore,no_run
11638    /// # use google_cloud_config_v1::model::DeploymentUnit;
11639    /// let x = DeploymentUnit::new().set_id("example");
11640    /// ```
11641    pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11642        self.id = v.into();
11643        self
11644    }
11645
11646    /// Sets the value of [deployment][crate::model::DeploymentUnit::deployment].
11647    ///
11648    /// # Example
11649    /// ```ignore,no_run
11650    /// # use google_cloud_config_v1::model::DeploymentUnit;
11651    /// # let project_id = "project_id";
11652    /// # let location_id = "location_id";
11653    /// # let deployment_id = "deployment_id";
11654    /// let x = DeploymentUnit::new().set_deployment(format!("projects/{project_id}/locations/{location_id}/deployments/{deployment_id}"));
11655    /// ```
11656    pub fn set_deployment<T>(mut self, v: T) -> Self
11657    where
11658        T: std::convert::Into<std::string::String>,
11659    {
11660        self.deployment = std::option::Option::Some(v.into());
11661        self
11662    }
11663
11664    /// Sets or clears the value of [deployment][crate::model::DeploymentUnit::deployment].
11665    ///
11666    /// # Example
11667    /// ```ignore,no_run
11668    /// # use google_cloud_config_v1::model::DeploymentUnit;
11669    /// # let project_id = "project_id";
11670    /// # let location_id = "location_id";
11671    /// # let deployment_id = "deployment_id";
11672    /// let x = DeploymentUnit::new().set_or_clear_deployment(Some(format!("projects/{project_id}/locations/{location_id}/deployments/{deployment_id}")));
11673    /// let x = DeploymentUnit::new().set_or_clear_deployment(None::<String>);
11674    /// ```
11675    pub fn set_or_clear_deployment<T>(mut self, v: std::option::Option<T>) -> Self
11676    where
11677        T: std::convert::Into<std::string::String>,
11678    {
11679        self.deployment = v.map(|x| x.into());
11680        self
11681    }
11682
11683    /// Sets the value of [dependencies][crate::model::DeploymentUnit::dependencies].
11684    ///
11685    /// # Example
11686    /// ```ignore,no_run
11687    /// # use google_cloud_config_v1::model::DeploymentUnit;
11688    /// let x = DeploymentUnit::new().set_dependencies(["a", "b", "c"]);
11689    /// ```
11690    pub fn set_dependencies<T, V>(mut self, v: T) -> Self
11691    where
11692        T: std::iter::IntoIterator<Item = V>,
11693        V: std::convert::Into<std::string::String>,
11694    {
11695        use std::iter::Iterator;
11696        self.dependencies = v.into_iter().map(|i| i.into()).collect();
11697        self
11698    }
11699}
11700
11701impl wkt::message::Message for DeploymentUnit {
11702    fn typename() -> &'static str {
11703        "type.googleapis.com/google.cloud.config.v1.DeploymentUnit"
11704    }
11705}
11706
11707/// Spec for a deployment to be created.
11708#[derive(Clone, Default, PartialEq)]
11709#[non_exhaustive]
11710pub struct DeploymentSpec {
11711    /// Required. The id of the deployment to be created which doesn't include the
11712    /// project id and location.
11713    pub deployment_id: std::string::String,
11714
11715    /// Required. The deployment to be created.
11716    pub deployment: std::option::Option<crate::model::Deployment>,
11717
11718    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11719}
11720
11721impl DeploymentSpec {
11722    /// Creates a new default instance.
11723    pub fn new() -> Self {
11724        std::default::Default::default()
11725    }
11726
11727    /// Sets the value of [deployment_id][crate::model::DeploymentSpec::deployment_id].
11728    ///
11729    /// # Example
11730    /// ```ignore,no_run
11731    /// # use google_cloud_config_v1::model::DeploymentSpec;
11732    /// let x = DeploymentSpec::new().set_deployment_id("example");
11733    /// ```
11734    pub fn set_deployment_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11735        self.deployment_id = v.into();
11736        self
11737    }
11738
11739    /// Sets the value of [deployment][crate::model::DeploymentSpec::deployment].
11740    ///
11741    /// # Example
11742    /// ```ignore,no_run
11743    /// # use google_cloud_config_v1::model::DeploymentSpec;
11744    /// use google_cloud_config_v1::model::Deployment;
11745    /// let x = DeploymentSpec::new().set_deployment(Deployment::default()/* use setters */);
11746    /// ```
11747    pub fn set_deployment<T>(mut self, v: T) -> Self
11748    where
11749        T: std::convert::Into<crate::model::Deployment>,
11750    {
11751        self.deployment = std::option::Option::Some(v.into());
11752        self
11753    }
11754
11755    /// Sets or clears the value of [deployment][crate::model::DeploymentSpec::deployment].
11756    ///
11757    /// # Example
11758    /// ```ignore,no_run
11759    /// # use google_cloud_config_v1::model::DeploymentSpec;
11760    /// use google_cloud_config_v1::model::Deployment;
11761    /// let x = DeploymentSpec::new().set_or_clear_deployment(Some(Deployment::default()/* use setters */));
11762    /// let x = DeploymentSpec::new().set_or_clear_deployment(None::<Deployment>);
11763    /// ```
11764    pub fn set_or_clear_deployment<T>(mut self, v: std::option::Option<T>) -> Self
11765    where
11766        T: std::convert::Into<crate::model::Deployment>,
11767    {
11768        self.deployment = v.map(|x| x.into());
11769        self
11770    }
11771}
11772
11773impl wkt::message::Message for DeploymentSpec {
11774    fn typename() -> &'static str {
11775        "type.googleapis.com/google.cloud.config.v1.DeploymentSpec"
11776    }
11777}
11778
11779/// The request message for the GetDeploymentGroup method.
11780#[derive(Clone, Default, PartialEq)]
11781#[non_exhaustive]
11782pub struct GetDeploymentGroupRequest {
11783    /// Required. The name of the deployment group to retrieve.
11784    /// Format:
11785    /// 'projects/{project_id}/locations/{location}/deploymentGroups/{deployment_group}'.
11786    pub name: std::string::String,
11787
11788    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11789}
11790
11791impl GetDeploymentGroupRequest {
11792    /// Creates a new default instance.
11793    pub fn new() -> Self {
11794        std::default::Default::default()
11795    }
11796
11797    /// Sets the value of [name][crate::model::GetDeploymentGroupRequest::name].
11798    ///
11799    /// # Example
11800    /// ```ignore,no_run
11801    /// # use google_cloud_config_v1::model::GetDeploymentGroupRequest;
11802    /// # let project_id = "project_id";
11803    /// # let location_id = "location_id";
11804    /// # let deployment_group_id = "deployment_group_id";
11805    /// let x = GetDeploymentGroupRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/deploymentGroups/{deployment_group_id}"));
11806    /// ```
11807    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11808        self.name = v.into();
11809        self
11810    }
11811}
11812
11813impl wkt::message::Message for GetDeploymentGroupRequest {
11814    fn typename() -> &'static str {
11815        "type.googleapis.com/google.cloud.config.v1.GetDeploymentGroupRequest"
11816    }
11817}
11818
11819/// The request message for the ListDeploymentGroups method.
11820#[derive(Clone, Default, PartialEq)]
11821#[non_exhaustive]
11822pub struct ListDeploymentGroupsRequest {
11823    /// Required. The parent, which owns this collection of deployment groups.
11824    /// Format: 'projects/{project_id}/locations/{location}'.
11825    pub parent: std::string::String,
11826
11827    /// Optional. When requesting a page of resources, 'page_size' specifies number
11828    /// of resources to return. If unspecified, at most 500 will be returned. The
11829    /// maximum value is 1000.
11830    pub page_size: i32,
11831
11832    /// Optional. Token returned by previous call to 'ListDeploymentGroups' which
11833    /// specifies the position in the list from where to continue listing the
11834    /// deployment groups.
11835    pub page_token: std::string::String,
11836
11837    /// Optional. Lists the DeploymentGroups that match the filter expression. A
11838    /// filter expression filters the deployment groups listed in the response. The
11839    /// expression must be of the form '{field} {operator} {value}' where
11840    /// operators: '<', '>',
11841    /// '<=', '>=', '!=', '=', ':' are supported (colon ':' represents a HAS
11842    /// operator which is roughly synonymous with equality). {field} can refer to a
11843    /// proto or JSON field, or a synthetic field. Field names can be camelCase or
11844    /// snake_case.
11845    ///
11846    /// Examples:
11847    ///
11848    /// - Filter by name:
11849    ///   name = "projects/foo/locations/us-central1/deploymentGroups/bar"
11850    ///
11851    /// - Filter by labels:
11852    ///
11853    ///   - Resources that have a key called 'foo'
11854    ///     labels.foo:*
11855    ///   - Resources that have a key called 'foo' whose value is 'bar'
11856    ///     labels.foo = bar
11857    /// - Filter by state:
11858    ///
11859    ///   - DeploymentGroups in CREATING state.
11860    ///     state=CREATING
11861    pub filter: std::string::String,
11862
11863    /// Optional. Field to use to sort the list.
11864    pub order_by: std::string::String,
11865
11866    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11867}
11868
11869impl ListDeploymentGroupsRequest {
11870    /// Creates a new default instance.
11871    pub fn new() -> Self {
11872        std::default::Default::default()
11873    }
11874
11875    /// Sets the value of [parent][crate::model::ListDeploymentGroupsRequest::parent].
11876    ///
11877    /// # Example
11878    /// ```ignore,no_run
11879    /// # use google_cloud_config_v1::model::ListDeploymentGroupsRequest;
11880    /// let x = ListDeploymentGroupsRequest::new().set_parent("example");
11881    /// ```
11882    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11883        self.parent = v.into();
11884        self
11885    }
11886
11887    /// Sets the value of [page_size][crate::model::ListDeploymentGroupsRequest::page_size].
11888    ///
11889    /// # Example
11890    /// ```ignore,no_run
11891    /// # use google_cloud_config_v1::model::ListDeploymentGroupsRequest;
11892    /// let x = ListDeploymentGroupsRequest::new().set_page_size(42);
11893    /// ```
11894    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11895        self.page_size = v.into();
11896        self
11897    }
11898
11899    /// Sets the value of [page_token][crate::model::ListDeploymentGroupsRequest::page_token].
11900    ///
11901    /// # Example
11902    /// ```ignore,no_run
11903    /// # use google_cloud_config_v1::model::ListDeploymentGroupsRequest;
11904    /// let x = ListDeploymentGroupsRequest::new().set_page_token("example");
11905    /// ```
11906    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11907        self.page_token = v.into();
11908        self
11909    }
11910
11911    /// Sets the value of [filter][crate::model::ListDeploymentGroupsRequest::filter].
11912    ///
11913    /// # Example
11914    /// ```ignore,no_run
11915    /// # use google_cloud_config_v1::model::ListDeploymentGroupsRequest;
11916    /// let x = ListDeploymentGroupsRequest::new().set_filter("example");
11917    /// ```
11918    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11919        self.filter = v.into();
11920        self
11921    }
11922
11923    /// Sets the value of [order_by][crate::model::ListDeploymentGroupsRequest::order_by].
11924    ///
11925    /// # Example
11926    /// ```ignore,no_run
11927    /// # use google_cloud_config_v1::model::ListDeploymentGroupsRequest;
11928    /// let x = ListDeploymentGroupsRequest::new().set_order_by("example");
11929    /// ```
11930    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11931        self.order_by = v.into();
11932        self
11933    }
11934}
11935
11936impl wkt::message::Message for ListDeploymentGroupsRequest {
11937    fn typename() -> &'static str {
11938        "type.googleapis.com/google.cloud.config.v1.ListDeploymentGroupsRequest"
11939    }
11940}
11941
11942/// The response message for the ListDeploymentGroups method.
11943#[derive(Clone, Default, PartialEq)]
11944#[non_exhaustive]
11945pub struct ListDeploymentGroupsResponse {
11946    /// The deployment groups from the specified collection.
11947    pub deployment_groups: std::vec::Vec<crate::model::DeploymentGroup>,
11948
11949    /// Token to be supplied to the next ListDeploymentGroups request via
11950    /// `page_token` to obtain the next set of results.
11951    pub next_page_token: std::string::String,
11952
11953    /// Locations that could not be reached.
11954    pub unreachable: std::vec::Vec<std::string::String>,
11955
11956    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11957}
11958
11959impl ListDeploymentGroupsResponse {
11960    /// Creates a new default instance.
11961    pub fn new() -> Self {
11962        std::default::Default::default()
11963    }
11964
11965    /// Sets the value of [deployment_groups][crate::model::ListDeploymentGroupsResponse::deployment_groups].
11966    ///
11967    /// # Example
11968    /// ```ignore,no_run
11969    /// # use google_cloud_config_v1::model::ListDeploymentGroupsResponse;
11970    /// use google_cloud_config_v1::model::DeploymentGroup;
11971    /// let x = ListDeploymentGroupsResponse::new()
11972    ///     .set_deployment_groups([
11973    ///         DeploymentGroup::default()/* use setters */,
11974    ///         DeploymentGroup::default()/* use (different) setters */,
11975    ///     ]);
11976    /// ```
11977    pub fn set_deployment_groups<T, V>(mut self, v: T) -> Self
11978    where
11979        T: std::iter::IntoIterator<Item = V>,
11980        V: std::convert::Into<crate::model::DeploymentGroup>,
11981    {
11982        use std::iter::Iterator;
11983        self.deployment_groups = v.into_iter().map(|i| i.into()).collect();
11984        self
11985    }
11986
11987    /// Sets the value of [next_page_token][crate::model::ListDeploymentGroupsResponse::next_page_token].
11988    ///
11989    /// # Example
11990    /// ```ignore,no_run
11991    /// # use google_cloud_config_v1::model::ListDeploymentGroupsResponse;
11992    /// let x = ListDeploymentGroupsResponse::new().set_next_page_token("example");
11993    /// ```
11994    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11995        self.next_page_token = v.into();
11996        self
11997    }
11998
11999    /// Sets the value of [unreachable][crate::model::ListDeploymentGroupsResponse::unreachable].
12000    ///
12001    /// # Example
12002    /// ```ignore,no_run
12003    /// # use google_cloud_config_v1::model::ListDeploymentGroupsResponse;
12004    /// let x = ListDeploymentGroupsResponse::new().set_unreachable(["a", "b", "c"]);
12005    /// ```
12006    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
12007    where
12008        T: std::iter::IntoIterator<Item = V>,
12009        V: std::convert::Into<std::string::String>,
12010    {
12011        use std::iter::Iterator;
12012        self.unreachable = v.into_iter().map(|i| i.into()).collect();
12013        self
12014    }
12015}
12016
12017impl wkt::message::Message for ListDeploymentGroupsResponse {
12018    fn typename() -> &'static str {
12019        "type.googleapis.com/google.cloud.config.v1.ListDeploymentGroupsResponse"
12020    }
12021}
12022
12023#[doc(hidden)]
12024impl google_cloud_gax::paginator::internal::PageableResponse for ListDeploymentGroupsResponse {
12025    type PageItem = crate::model::DeploymentGroup;
12026
12027    fn items(self) -> std::vec::Vec<Self::PageItem> {
12028        self.deployment_groups
12029    }
12030
12031    fn next_page_token(&self) -> std::string::String {
12032        use std::clone::Clone;
12033        self.next_page_token.clone()
12034    }
12035}
12036
12037/// The request message for the ProvisionDeploymentGroup method.
12038#[derive(Clone, Default, PartialEq)]
12039#[non_exhaustive]
12040pub struct ProvisionDeploymentGroupRequest {
12041    /// Required. The name of the deployment group to provision.
12042    /// Format:
12043    /// 'projects/{project_id}/locations/{location}/deploymentGroups/{deployment_group}'.
12044    pub name: std::string::String,
12045
12046    /// Optional. The deployment specs of the deployment units to be created within
12047    /// the same project and location of the deployment group. The key is the unit
12048    /// ID, and the value is the `DeploymentSpec`. Provisioning will fail if a
12049    /// `deployment_spec` has a `deployment_id` that matches an existing deployment
12050    /// in the same project and location. If an existing deployment was part of the
12051    /// last successful revision but is no longer in the current DeploymentGroup's
12052    /// `deployment_units`, it will be recreated if included in `deployment_specs`.
12053    pub deployment_specs:
12054        std::collections::HashMap<std::string::String, crate::model::DeploymentSpec>,
12055
12056    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12057}
12058
12059impl ProvisionDeploymentGroupRequest {
12060    /// Creates a new default instance.
12061    pub fn new() -> Self {
12062        std::default::Default::default()
12063    }
12064
12065    /// Sets the value of [name][crate::model::ProvisionDeploymentGroupRequest::name].
12066    ///
12067    /// # Example
12068    /// ```ignore,no_run
12069    /// # use google_cloud_config_v1::model::ProvisionDeploymentGroupRequest;
12070    /// # let project_id = "project_id";
12071    /// # let location_id = "location_id";
12072    /// # let deployment_group_id = "deployment_group_id";
12073    /// let x = ProvisionDeploymentGroupRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/deploymentGroups/{deployment_group_id}"));
12074    /// ```
12075    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12076        self.name = v.into();
12077        self
12078    }
12079
12080    /// Sets the value of [deployment_specs][crate::model::ProvisionDeploymentGroupRequest::deployment_specs].
12081    ///
12082    /// # Example
12083    /// ```ignore,no_run
12084    /// # use google_cloud_config_v1::model::ProvisionDeploymentGroupRequest;
12085    /// use google_cloud_config_v1::model::DeploymentSpec;
12086    /// let x = ProvisionDeploymentGroupRequest::new().set_deployment_specs([
12087    ///     ("key0", DeploymentSpec::default()/* use setters */),
12088    ///     ("key1", DeploymentSpec::default()/* use (different) setters */),
12089    /// ]);
12090    /// ```
12091    pub fn set_deployment_specs<T, K, V>(mut self, v: T) -> Self
12092    where
12093        T: std::iter::IntoIterator<Item = (K, V)>,
12094        K: std::convert::Into<std::string::String>,
12095        V: std::convert::Into<crate::model::DeploymentSpec>,
12096    {
12097        use std::iter::Iterator;
12098        self.deployment_specs = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
12099        self
12100    }
12101}
12102
12103impl wkt::message::Message for ProvisionDeploymentGroupRequest {
12104    fn typename() -> &'static str {
12105        "type.googleapis.com/google.cloud.config.v1.ProvisionDeploymentGroupRequest"
12106    }
12107}
12108
12109/// The request message for the DeprovisionDeploymentGroup method.
12110#[derive(Clone, Default, PartialEq)]
12111#[non_exhaustive]
12112pub struct DeprovisionDeploymentGroupRequest {
12113    /// Required. The name of the deployment group to deprovision.
12114    /// Format:
12115    /// 'projects/{project_id}/locations/{location}/deploymentGroups/{deployment_group}'.
12116    pub name: std::string::String,
12117
12118    /// Optional. If set to true, this option is propagated to the deletion of each
12119    /// deployment in the group. This corresponds to the 'force' field
12120    /// in DeleteDeploymentRequest.
12121    pub force: bool,
12122
12123    /// Optional. Policy on how resources within each deployment should be handled
12124    /// during deletion. This policy is applied globally to the deletion of all
12125    /// deployments in this group. This corresponds to the 'delete_policy' field
12126    /// in DeleteDeploymentRequest.
12127    pub delete_policy: crate::model::delete_deployment_request::DeletePolicy,
12128
12129    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12130}
12131
12132impl DeprovisionDeploymentGroupRequest {
12133    /// Creates a new default instance.
12134    pub fn new() -> Self {
12135        std::default::Default::default()
12136    }
12137
12138    /// Sets the value of [name][crate::model::DeprovisionDeploymentGroupRequest::name].
12139    ///
12140    /// # Example
12141    /// ```ignore,no_run
12142    /// # use google_cloud_config_v1::model::DeprovisionDeploymentGroupRequest;
12143    /// # let project_id = "project_id";
12144    /// # let location_id = "location_id";
12145    /// # let deployment_group_id = "deployment_group_id";
12146    /// let x = DeprovisionDeploymentGroupRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/deploymentGroups/{deployment_group_id}"));
12147    /// ```
12148    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12149        self.name = v.into();
12150        self
12151    }
12152
12153    /// Sets the value of [force][crate::model::DeprovisionDeploymentGroupRequest::force].
12154    ///
12155    /// # Example
12156    /// ```ignore,no_run
12157    /// # use google_cloud_config_v1::model::DeprovisionDeploymentGroupRequest;
12158    /// let x = DeprovisionDeploymentGroupRequest::new().set_force(true);
12159    /// ```
12160    pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
12161        self.force = v.into();
12162        self
12163    }
12164
12165    /// Sets the value of [delete_policy][crate::model::DeprovisionDeploymentGroupRequest::delete_policy].
12166    ///
12167    /// # Example
12168    /// ```ignore,no_run
12169    /// # use google_cloud_config_v1::model::DeprovisionDeploymentGroupRequest;
12170    /// use google_cloud_config_v1::model::delete_deployment_request::DeletePolicy;
12171    /// let x0 = DeprovisionDeploymentGroupRequest::new().set_delete_policy(DeletePolicy::Delete);
12172    /// let x1 = DeprovisionDeploymentGroupRequest::new().set_delete_policy(DeletePolicy::Abandon);
12173    /// ```
12174    pub fn set_delete_policy<
12175        T: std::convert::Into<crate::model::delete_deployment_request::DeletePolicy>,
12176    >(
12177        mut self,
12178        v: T,
12179    ) -> Self {
12180        self.delete_policy = v.into();
12181        self
12182    }
12183}
12184
12185impl wkt::message::Message for DeprovisionDeploymentGroupRequest {
12186    fn typename() -> &'static str {
12187        "type.googleapis.com/google.cloud.config.v1.DeprovisionDeploymentGroupRequest"
12188    }
12189}
12190
12191/// The summary of the deployment operation.
12192#[derive(Clone, Default, PartialEq)]
12193#[non_exhaustive]
12194pub struct DeploymentOperationSummary {
12195    /// Output only. The current step the deployment operation is running.
12196    pub deployment_step: crate::model::deployment_operation_metadata::DeploymentStep,
12197
12198    /// Output only. Cloud Build instance UUID associated with this operation.
12199    pub build: std::string::String,
12200
12201    /// Output only. Location of Deployment operations logs in
12202    /// `gs://{bucket}/{object}` format.
12203    pub logs: std::string::String,
12204
12205    /// Output only. Location of Deployment operations content in
12206    /// `gs://{bucket}/{object}` format.
12207    pub content: std::string::String,
12208
12209    /// Output only. Location of Deployment operations artifacts in
12210    /// `gs://{bucket}/{object}` format.
12211    pub artifacts: std::string::String,
12212
12213    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12214}
12215
12216impl DeploymentOperationSummary {
12217    /// Creates a new default instance.
12218    pub fn new() -> Self {
12219        std::default::Default::default()
12220    }
12221
12222    /// Sets the value of [deployment_step][crate::model::DeploymentOperationSummary::deployment_step].
12223    ///
12224    /// # Example
12225    /// ```ignore,no_run
12226    /// # use google_cloud_config_v1::model::DeploymentOperationSummary;
12227    /// use google_cloud_config_v1::model::deployment_operation_metadata::DeploymentStep;
12228    /// let x0 = DeploymentOperationSummary::new().set_deployment_step(DeploymentStep::PreparingStorageBucket);
12229    /// let x1 = DeploymentOperationSummary::new().set_deployment_step(DeploymentStep::DownloadingBlueprint);
12230    /// let x2 = DeploymentOperationSummary::new().set_deployment_step(DeploymentStep::RunningTfInit);
12231    /// ```
12232    pub fn set_deployment_step<
12233        T: std::convert::Into<crate::model::deployment_operation_metadata::DeploymentStep>,
12234    >(
12235        mut self,
12236        v: T,
12237    ) -> Self {
12238        self.deployment_step = v.into();
12239        self
12240    }
12241
12242    /// Sets the value of [build][crate::model::DeploymentOperationSummary::build].
12243    ///
12244    /// # Example
12245    /// ```ignore,no_run
12246    /// # use google_cloud_config_v1::model::DeploymentOperationSummary;
12247    /// let x = DeploymentOperationSummary::new().set_build("example");
12248    /// ```
12249    pub fn set_build<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12250        self.build = v.into();
12251        self
12252    }
12253
12254    /// Sets the value of [logs][crate::model::DeploymentOperationSummary::logs].
12255    ///
12256    /// # Example
12257    /// ```ignore,no_run
12258    /// # use google_cloud_config_v1::model::DeploymentOperationSummary;
12259    /// let x = DeploymentOperationSummary::new().set_logs("example");
12260    /// ```
12261    pub fn set_logs<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12262        self.logs = v.into();
12263        self
12264    }
12265
12266    /// Sets the value of [content][crate::model::DeploymentOperationSummary::content].
12267    ///
12268    /// # Example
12269    /// ```ignore,no_run
12270    /// # use google_cloud_config_v1::model::DeploymentOperationSummary;
12271    /// let x = DeploymentOperationSummary::new().set_content("example");
12272    /// ```
12273    pub fn set_content<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12274        self.content = v.into();
12275        self
12276    }
12277
12278    /// Sets the value of [artifacts][crate::model::DeploymentOperationSummary::artifacts].
12279    ///
12280    /// # Example
12281    /// ```ignore,no_run
12282    /// # use google_cloud_config_v1::model::DeploymentOperationSummary;
12283    /// let x = DeploymentOperationSummary::new().set_artifacts("example");
12284    /// ```
12285    pub fn set_artifacts<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12286        self.artifacts = v.into();
12287        self
12288    }
12289}
12290
12291impl wkt::message::Message for DeploymentOperationSummary {
12292    fn typename() -> &'static str {
12293        "type.googleapis.com/google.cloud.config.v1.DeploymentOperationSummary"
12294    }
12295}
12296
12297/// The progress of a deployment unit provisioning or deprovisioning.
12298#[derive(Clone, Default, PartialEq)]
12299#[non_exhaustive]
12300pub struct DeploymentUnitProgress {
12301    /// Output only. The unit id of the deployment unit to be provisioned.
12302    pub unit_id: std::string::String,
12303
12304    /// Output only. The name of the deployment to be provisioned.
12305    /// Format:
12306    /// 'projects/{project}/locations/{location}/deployments/{deployment}'.
12307    pub deployment: std::string::String,
12308
12309    /// Output only. The current step of the deployment unit provisioning.
12310    pub state: crate::model::deployment_unit_progress::State,
12311
12312    /// Output only. Additional information regarding the current state.
12313    pub state_description: std::string::String,
12314
12315    /// Output only. The summary of the deployment operation.
12316    pub deployment_operation_summary: std::option::Option<crate::model::DeploymentOperationSummary>,
12317
12318    /// Output only. Holds the error status of the deployment unit provisioning.
12319    pub error: std::option::Option<google_cloud_rpc::model::Status>,
12320
12321    /// Output only. The intent of the deployment unit.
12322    pub intent: crate::model::deployment_unit_progress::Intent,
12323
12324    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12325}
12326
12327impl DeploymentUnitProgress {
12328    /// Creates a new default instance.
12329    pub fn new() -> Self {
12330        std::default::Default::default()
12331    }
12332
12333    /// Sets the value of [unit_id][crate::model::DeploymentUnitProgress::unit_id].
12334    ///
12335    /// # Example
12336    /// ```ignore,no_run
12337    /// # use google_cloud_config_v1::model::DeploymentUnitProgress;
12338    /// let x = DeploymentUnitProgress::new().set_unit_id("example");
12339    /// ```
12340    pub fn set_unit_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12341        self.unit_id = v.into();
12342        self
12343    }
12344
12345    /// Sets the value of [deployment][crate::model::DeploymentUnitProgress::deployment].
12346    ///
12347    /// # Example
12348    /// ```ignore,no_run
12349    /// # use google_cloud_config_v1::model::DeploymentUnitProgress;
12350    /// # let project_id = "project_id";
12351    /// # let location_id = "location_id";
12352    /// # let deployment_id = "deployment_id";
12353    /// let x = DeploymentUnitProgress::new().set_deployment(format!("projects/{project_id}/locations/{location_id}/deployments/{deployment_id}"));
12354    /// ```
12355    pub fn set_deployment<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12356        self.deployment = v.into();
12357        self
12358    }
12359
12360    /// Sets the value of [state][crate::model::DeploymentUnitProgress::state].
12361    ///
12362    /// # Example
12363    /// ```ignore,no_run
12364    /// # use google_cloud_config_v1::model::DeploymentUnitProgress;
12365    /// use google_cloud_config_v1::model::deployment_unit_progress::State;
12366    /// let x0 = DeploymentUnitProgress::new().set_state(State::Queued);
12367    /// let x1 = DeploymentUnitProgress::new().set_state(State::ApplyingDeployment);
12368    /// let x2 = DeploymentUnitProgress::new().set_state(State::Succeeded);
12369    /// ```
12370    pub fn set_state<T: std::convert::Into<crate::model::deployment_unit_progress::State>>(
12371        mut self,
12372        v: T,
12373    ) -> Self {
12374        self.state = v.into();
12375        self
12376    }
12377
12378    /// Sets the value of [state_description][crate::model::DeploymentUnitProgress::state_description].
12379    ///
12380    /// # Example
12381    /// ```ignore,no_run
12382    /// # use google_cloud_config_v1::model::DeploymentUnitProgress;
12383    /// let x = DeploymentUnitProgress::new().set_state_description("example");
12384    /// ```
12385    pub fn set_state_description<T: std::convert::Into<std::string::String>>(
12386        mut self,
12387        v: T,
12388    ) -> Self {
12389        self.state_description = v.into();
12390        self
12391    }
12392
12393    /// Sets the value of [deployment_operation_summary][crate::model::DeploymentUnitProgress::deployment_operation_summary].
12394    ///
12395    /// # Example
12396    /// ```ignore,no_run
12397    /// # use google_cloud_config_v1::model::DeploymentUnitProgress;
12398    /// use google_cloud_config_v1::model::DeploymentOperationSummary;
12399    /// let x = DeploymentUnitProgress::new().set_deployment_operation_summary(DeploymentOperationSummary::default()/* use setters */);
12400    /// ```
12401    pub fn set_deployment_operation_summary<T>(mut self, v: T) -> Self
12402    where
12403        T: std::convert::Into<crate::model::DeploymentOperationSummary>,
12404    {
12405        self.deployment_operation_summary = std::option::Option::Some(v.into());
12406        self
12407    }
12408
12409    /// Sets or clears the value of [deployment_operation_summary][crate::model::DeploymentUnitProgress::deployment_operation_summary].
12410    ///
12411    /// # Example
12412    /// ```ignore,no_run
12413    /// # use google_cloud_config_v1::model::DeploymentUnitProgress;
12414    /// use google_cloud_config_v1::model::DeploymentOperationSummary;
12415    /// let x = DeploymentUnitProgress::new().set_or_clear_deployment_operation_summary(Some(DeploymentOperationSummary::default()/* use setters */));
12416    /// let x = DeploymentUnitProgress::new().set_or_clear_deployment_operation_summary(None::<DeploymentOperationSummary>);
12417    /// ```
12418    pub fn set_or_clear_deployment_operation_summary<T>(mut self, v: std::option::Option<T>) -> Self
12419    where
12420        T: std::convert::Into<crate::model::DeploymentOperationSummary>,
12421    {
12422        self.deployment_operation_summary = v.map(|x| x.into());
12423        self
12424    }
12425
12426    /// Sets the value of [error][crate::model::DeploymentUnitProgress::error].
12427    ///
12428    /// # Example
12429    /// ```ignore,no_run
12430    /// # use google_cloud_config_v1::model::DeploymentUnitProgress;
12431    /// use google_cloud_rpc::model::Status;
12432    /// let x = DeploymentUnitProgress::new().set_error(Status::default()/* use setters */);
12433    /// ```
12434    pub fn set_error<T>(mut self, v: T) -> Self
12435    where
12436        T: std::convert::Into<google_cloud_rpc::model::Status>,
12437    {
12438        self.error = std::option::Option::Some(v.into());
12439        self
12440    }
12441
12442    /// Sets or clears the value of [error][crate::model::DeploymentUnitProgress::error].
12443    ///
12444    /// # Example
12445    /// ```ignore,no_run
12446    /// # use google_cloud_config_v1::model::DeploymentUnitProgress;
12447    /// use google_cloud_rpc::model::Status;
12448    /// let x = DeploymentUnitProgress::new().set_or_clear_error(Some(Status::default()/* use setters */));
12449    /// let x = DeploymentUnitProgress::new().set_or_clear_error(None::<Status>);
12450    /// ```
12451    pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
12452    where
12453        T: std::convert::Into<google_cloud_rpc::model::Status>,
12454    {
12455        self.error = v.map(|x| x.into());
12456        self
12457    }
12458
12459    /// Sets the value of [intent][crate::model::DeploymentUnitProgress::intent].
12460    ///
12461    /// # Example
12462    /// ```ignore,no_run
12463    /// # use google_cloud_config_v1::model::DeploymentUnitProgress;
12464    /// use google_cloud_config_v1::model::deployment_unit_progress::Intent;
12465    /// let x0 = DeploymentUnitProgress::new().set_intent(Intent::CreateDeployment);
12466    /// let x1 = DeploymentUnitProgress::new().set_intent(Intent::UpdateDeployment);
12467    /// let x2 = DeploymentUnitProgress::new().set_intent(Intent::DeleteDeployment);
12468    /// ```
12469    pub fn set_intent<T: std::convert::Into<crate::model::deployment_unit_progress::Intent>>(
12470        mut self,
12471        v: T,
12472    ) -> Self {
12473        self.intent = v.into();
12474        self
12475    }
12476}
12477
12478impl wkt::message::Message for DeploymentUnitProgress {
12479    fn typename() -> &'static str {
12480        "type.googleapis.com/google.cloud.config.v1.DeploymentUnitProgress"
12481    }
12482}
12483
12484/// Defines additional types related to [DeploymentUnitProgress].
12485pub mod deployment_unit_progress {
12486    #[allow(unused_imports)]
12487    use super::*;
12488
12489    /// The possible steps a deployment unit provisioning may be running.
12490    ///
12491    /// # Working with unknown values
12492    ///
12493    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12494    /// additional enum variants at any time. Adding new variants is not considered
12495    /// a breaking change. Applications should write their code in anticipation of:
12496    ///
12497    /// - New values appearing in future releases of the client library, **and**
12498    /// - New values received dynamically, without application changes.
12499    ///
12500    /// Please consult the [Working with enums] section in the user guide for some
12501    /// guidelines.
12502    ///
12503    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
12504    #[derive(Clone, Debug, PartialEq)]
12505    #[non_exhaustive]
12506    pub enum State {
12507        /// The default value. This value is unused.
12508        Unspecified,
12509        /// The deployment unit is queued for deployment creation or update.
12510        Queued,
12511        /// The underlying deployment of the unit is being created or updated.
12512        ApplyingDeployment,
12513        /// The underlying deployment operation of the unit has succeeded.
12514        Succeeded,
12515        /// The underlying deployment operation of the unit has failed.
12516        Failed,
12517        /// The deployment unit was aborted, likely due to failures in other
12518        /// dependent deployment units.
12519        Aborted,
12520        /// The deployment unit was skipped because there were no changes to apply.
12521        Skipped,
12522        /// The deployment is being deleted.
12523        DeletingDeployment,
12524        /// The deployment is being previewed.
12525        PreviewingDeployment,
12526        /// If set, the enum was initialized with an unknown value.
12527        ///
12528        /// Applications can examine the value using [State::value] or
12529        /// [State::name].
12530        UnknownValue(state::UnknownValue),
12531    }
12532
12533    #[doc(hidden)]
12534    pub mod state {
12535        #[allow(unused_imports)]
12536        use super::*;
12537        #[derive(Clone, Debug, PartialEq)]
12538        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12539    }
12540
12541    impl State {
12542        /// Gets the enum value.
12543        ///
12544        /// Returns `None` if the enum contains an unknown value deserialized from
12545        /// the string representation of enums.
12546        pub fn value(&self) -> std::option::Option<i32> {
12547            match self {
12548                Self::Unspecified => std::option::Option::Some(0),
12549                Self::Queued => std::option::Option::Some(1),
12550                Self::ApplyingDeployment => std::option::Option::Some(2),
12551                Self::Succeeded => std::option::Option::Some(4),
12552                Self::Failed => std::option::Option::Some(5),
12553                Self::Aborted => std::option::Option::Some(6),
12554                Self::Skipped => std::option::Option::Some(7),
12555                Self::DeletingDeployment => std::option::Option::Some(8),
12556                Self::PreviewingDeployment => std::option::Option::Some(9),
12557                Self::UnknownValue(u) => u.0.value(),
12558            }
12559        }
12560
12561        /// Gets the enum value as a string.
12562        ///
12563        /// Returns `None` if the enum contains an unknown value deserialized from
12564        /// the integer representation of enums.
12565        pub fn name(&self) -> std::option::Option<&str> {
12566            match self {
12567                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
12568                Self::Queued => std::option::Option::Some("QUEUED"),
12569                Self::ApplyingDeployment => std::option::Option::Some("APPLYING_DEPLOYMENT"),
12570                Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
12571                Self::Failed => std::option::Option::Some("FAILED"),
12572                Self::Aborted => std::option::Option::Some("ABORTED"),
12573                Self::Skipped => std::option::Option::Some("SKIPPED"),
12574                Self::DeletingDeployment => std::option::Option::Some("DELETING_DEPLOYMENT"),
12575                Self::PreviewingDeployment => std::option::Option::Some("PREVIEWING_DEPLOYMENT"),
12576                Self::UnknownValue(u) => u.0.name(),
12577            }
12578        }
12579    }
12580
12581    impl std::default::Default for State {
12582        fn default() -> Self {
12583            use std::convert::From;
12584            Self::from(0)
12585        }
12586    }
12587
12588    impl std::fmt::Display for State {
12589        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12590            wkt::internal::display_enum(f, self.name(), self.value())
12591        }
12592    }
12593
12594    impl std::convert::From<i32> for State {
12595        fn from(value: i32) -> Self {
12596            match value {
12597                0 => Self::Unspecified,
12598                1 => Self::Queued,
12599                2 => Self::ApplyingDeployment,
12600                4 => Self::Succeeded,
12601                5 => Self::Failed,
12602                6 => Self::Aborted,
12603                7 => Self::Skipped,
12604                8 => Self::DeletingDeployment,
12605                9 => Self::PreviewingDeployment,
12606                _ => Self::UnknownValue(state::UnknownValue(
12607                    wkt::internal::UnknownEnumValue::Integer(value),
12608                )),
12609            }
12610        }
12611    }
12612
12613    impl std::convert::From<&str> for State {
12614        fn from(value: &str) -> Self {
12615            use std::string::ToString;
12616            match value {
12617                "STATE_UNSPECIFIED" => Self::Unspecified,
12618                "QUEUED" => Self::Queued,
12619                "APPLYING_DEPLOYMENT" => Self::ApplyingDeployment,
12620                "SUCCEEDED" => Self::Succeeded,
12621                "FAILED" => Self::Failed,
12622                "ABORTED" => Self::Aborted,
12623                "SKIPPED" => Self::Skipped,
12624                "DELETING_DEPLOYMENT" => Self::DeletingDeployment,
12625                "PREVIEWING_DEPLOYMENT" => Self::PreviewingDeployment,
12626                _ => Self::UnknownValue(state::UnknownValue(
12627                    wkt::internal::UnknownEnumValue::String(value.to_string()),
12628                )),
12629            }
12630        }
12631    }
12632
12633    impl serde::ser::Serialize for State {
12634        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12635        where
12636            S: serde::Serializer,
12637        {
12638            match self {
12639                Self::Unspecified => serializer.serialize_i32(0),
12640                Self::Queued => serializer.serialize_i32(1),
12641                Self::ApplyingDeployment => serializer.serialize_i32(2),
12642                Self::Succeeded => serializer.serialize_i32(4),
12643                Self::Failed => serializer.serialize_i32(5),
12644                Self::Aborted => serializer.serialize_i32(6),
12645                Self::Skipped => serializer.serialize_i32(7),
12646                Self::DeletingDeployment => serializer.serialize_i32(8),
12647                Self::PreviewingDeployment => serializer.serialize_i32(9),
12648                Self::UnknownValue(u) => u.0.serialize(serializer),
12649            }
12650        }
12651    }
12652
12653    impl<'de> serde::de::Deserialize<'de> for State {
12654        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12655        where
12656            D: serde::Deserializer<'de>,
12657        {
12658            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
12659                ".google.cloud.config.v1.DeploymentUnitProgress.State",
12660            ))
12661        }
12662    }
12663
12664    /// The possible intents of a deployment unit.
12665    ///
12666    /// # Working with unknown values
12667    ///
12668    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12669    /// additional enum variants at any time. Adding new variants is not considered
12670    /// a breaking change. Applications should write their code in anticipation of:
12671    ///
12672    /// - New values appearing in future releases of the client library, **and**
12673    /// - New values received dynamically, without application changes.
12674    ///
12675    /// Please consult the [Working with enums] section in the user guide for some
12676    /// guidelines.
12677    ///
12678    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
12679    #[derive(Clone, Debug, PartialEq)]
12680    #[non_exhaustive]
12681    pub enum Intent {
12682        /// Unspecified intent.
12683        Unspecified,
12684        /// Create deployment in the unit from the deployment spec.
12685        CreateDeployment,
12686        /// Update deployment in the unit.
12687        UpdateDeployment,
12688        /// Delete deployment in the unit.
12689        DeleteDeployment,
12690        /// Recreate deployment in the unit.
12691        RecreateDeployment,
12692        /// Delete deployment in latest successful revision while no longer
12693        /// referenced in any deployment unit in the current deployment group.
12694        CleanUp,
12695        /// Expected to be unchanged.
12696        Unchanged,
12697        /// If set, the enum was initialized with an unknown value.
12698        ///
12699        /// Applications can examine the value using [Intent::value] or
12700        /// [Intent::name].
12701        UnknownValue(intent::UnknownValue),
12702    }
12703
12704    #[doc(hidden)]
12705    pub mod intent {
12706        #[allow(unused_imports)]
12707        use super::*;
12708        #[derive(Clone, Debug, PartialEq)]
12709        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12710    }
12711
12712    impl Intent {
12713        /// Gets the enum value.
12714        ///
12715        /// Returns `None` if the enum contains an unknown value deserialized from
12716        /// the string representation of enums.
12717        pub fn value(&self) -> std::option::Option<i32> {
12718            match self {
12719                Self::Unspecified => std::option::Option::Some(0),
12720                Self::CreateDeployment => std::option::Option::Some(1),
12721                Self::UpdateDeployment => std::option::Option::Some(2),
12722                Self::DeleteDeployment => std::option::Option::Some(3),
12723                Self::RecreateDeployment => std::option::Option::Some(4),
12724                Self::CleanUp => std::option::Option::Some(5),
12725                Self::Unchanged => std::option::Option::Some(6),
12726                Self::UnknownValue(u) => u.0.value(),
12727            }
12728        }
12729
12730        /// Gets the enum value as a string.
12731        ///
12732        /// Returns `None` if the enum contains an unknown value deserialized from
12733        /// the integer representation of enums.
12734        pub fn name(&self) -> std::option::Option<&str> {
12735            match self {
12736                Self::Unspecified => std::option::Option::Some("INTENT_UNSPECIFIED"),
12737                Self::CreateDeployment => std::option::Option::Some("CREATE_DEPLOYMENT"),
12738                Self::UpdateDeployment => std::option::Option::Some("UPDATE_DEPLOYMENT"),
12739                Self::DeleteDeployment => std::option::Option::Some("DELETE_DEPLOYMENT"),
12740                Self::RecreateDeployment => std::option::Option::Some("RECREATE_DEPLOYMENT"),
12741                Self::CleanUp => std::option::Option::Some("CLEAN_UP"),
12742                Self::Unchanged => std::option::Option::Some("UNCHANGED"),
12743                Self::UnknownValue(u) => u.0.name(),
12744            }
12745        }
12746    }
12747
12748    impl std::default::Default for Intent {
12749        fn default() -> Self {
12750            use std::convert::From;
12751            Self::from(0)
12752        }
12753    }
12754
12755    impl std::fmt::Display for Intent {
12756        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12757            wkt::internal::display_enum(f, self.name(), self.value())
12758        }
12759    }
12760
12761    impl std::convert::From<i32> for Intent {
12762        fn from(value: i32) -> Self {
12763            match value {
12764                0 => Self::Unspecified,
12765                1 => Self::CreateDeployment,
12766                2 => Self::UpdateDeployment,
12767                3 => Self::DeleteDeployment,
12768                4 => Self::RecreateDeployment,
12769                5 => Self::CleanUp,
12770                6 => Self::Unchanged,
12771                _ => Self::UnknownValue(intent::UnknownValue(
12772                    wkt::internal::UnknownEnumValue::Integer(value),
12773                )),
12774            }
12775        }
12776    }
12777
12778    impl std::convert::From<&str> for Intent {
12779        fn from(value: &str) -> Self {
12780            use std::string::ToString;
12781            match value {
12782                "INTENT_UNSPECIFIED" => Self::Unspecified,
12783                "CREATE_DEPLOYMENT" => Self::CreateDeployment,
12784                "UPDATE_DEPLOYMENT" => Self::UpdateDeployment,
12785                "DELETE_DEPLOYMENT" => Self::DeleteDeployment,
12786                "RECREATE_DEPLOYMENT" => Self::RecreateDeployment,
12787                "CLEAN_UP" => Self::CleanUp,
12788                "UNCHANGED" => Self::Unchanged,
12789                _ => Self::UnknownValue(intent::UnknownValue(
12790                    wkt::internal::UnknownEnumValue::String(value.to_string()),
12791                )),
12792            }
12793        }
12794    }
12795
12796    impl serde::ser::Serialize for Intent {
12797        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12798        where
12799            S: serde::Serializer,
12800        {
12801            match self {
12802                Self::Unspecified => serializer.serialize_i32(0),
12803                Self::CreateDeployment => serializer.serialize_i32(1),
12804                Self::UpdateDeployment => serializer.serialize_i32(2),
12805                Self::DeleteDeployment => serializer.serialize_i32(3),
12806                Self::RecreateDeployment => serializer.serialize_i32(4),
12807                Self::CleanUp => serializer.serialize_i32(5),
12808                Self::Unchanged => serializer.serialize_i32(6),
12809                Self::UnknownValue(u) => u.0.serialize(serializer),
12810            }
12811        }
12812    }
12813
12814    impl<'de> serde::de::Deserialize<'de> for Intent {
12815        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12816        where
12817            D: serde::Deserializer<'de>,
12818        {
12819            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Intent>::new(
12820                ".google.cloud.config.v1.DeploymentUnitProgress.Intent",
12821            ))
12822        }
12823    }
12824}
12825
12826/// Operation metadata for `ProvisionDeploymentGroup` and
12827/// `DeprovisionDeploymentGroup` long-running operations.
12828#[derive(Clone, Default, PartialEq)]
12829#[non_exhaustive]
12830pub struct ProvisionDeploymentGroupOperationMetadata {
12831    /// Output only. The current step of the deployment group operation.
12832    pub step:
12833        crate::model::provision_deployment_group_operation_metadata::ProvisionDeploymentGroupStep,
12834
12835    /// Output only. Progress information for each deployment unit within the
12836    /// operation.
12837    pub deployment_unit_progresses: std::vec::Vec<crate::model::DeploymentUnitProgress>,
12838
12839    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12840}
12841
12842impl ProvisionDeploymentGroupOperationMetadata {
12843    /// Creates a new default instance.
12844    pub fn new() -> Self {
12845        std::default::Default::default()
12846    }
12847
12848    /// Sets the value of [step][crate::model::ProvisionDeploymentGroupOperationMetadata::step].
12849    ///
12850    /// # Example
12851    /// ```ignore,no_run
12852    /// # use google_cloud_config_v1::model::ProvisionDeploymentGroupOperationMetadata;
12853    /// use google_cloud_config_v1::model::provision_deployment_group_operation_metadata::ProvisionDeploymentGroupStep;
12854    /// let x0 = ProvisionDeploymentGroupOperationMetadata::new().set_step(ProvisionDeploymentGroupStep::ValidatingDeploymentGroup);
12855    /// let x1 = ProvisionDeploymentGroupOperationMetadata::new().set_step(ProvisionDeploymentGroupStep::AssociatingDeploymentsToDeploymentGroup);
12856    /// let x2 = ProvisionDeploymentGroupOperationMetadata::new().set_step(ProvisionDeploymentGroupStep::ProvisioningDeploymentUnits);
12857    /// ```
12858    pub fn set_step<T: std::convert::Into<crate::model::provision_deployment_group_operation_metadata::ProvisionDeploymentGroupStep>>(mut self, v: T) -> Self{
12859        self.step = v.into();
12860        self
12861    }
12862
12863    /// Sets the value of [deployment_unit_progresses][crate::model::ProvisionDeploymentGroupOperationMetadata::deployment_unit_progresses].
12864    ///
12865    /// # Example
12866    /// ```ignore,no_run
12867    /// # use google_cloud_config_v1::model::ProvisionDeploymentGroupOperationMetadata;
12868    /// use google_cloud_config_v1::model::DeploymentUnitProgress;
12869    /// let x = ProvisionDeploymentGroupOperationMetadata::new()
12870    ///     .set_deployment_unit_progresses([
12871    ///         DeploymentUnitProgress::default()/* use setters */,
12872    ///         DeploymentUnitProgress::default()/* use (different) setters */,
12873    ///     ]);
12874    /// ```
12875    pub fn set_deployment_unit_progresses<T, V>(mut self, v: T) -> Self
12876    where
12877        T: std::iter::IntoIterator<Item = V>,
12878        V: std::convert::Into<crate::model::DeploymentUnitProgress>,
12879    {
12880        use std::iter::Iterator;
12881        self.deployment_unit_progresses = v.into_iter().map(|i| i.into()).collect();
12882        self
12883    }
12884}
12885
12886impl wkt::message::Message for ProvisionDeploymentGroupOperationMetadata {
12887    fn typename() -> &'static str {
12888        "type.googleapis.com/google.cloud.config.v1.ProvisionDeploymentGroupOperationMetadata"
12889    }
12890}
12891
12892/// Defines additional types related to [ProvisionDeploymentGroupOperationMetadata].
12893pub mod provision_deployment_group_operation_metadata {
12894    #[allow(unused_imports)]
12895    use super::*;
12896
12897    /// Possible steps during a deployment group provisioning or deprovisioning
12898    /// operation.
12899    ///
12900    /// # Working with unknown values
12901    ///
12902    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12903    /// additional enum variants at any time. Adding new variants is not considered
12904    /// a breaking change. Applications should write their code in anticipation of:
12905    ///
12906    /// - New values appearing in future releases of the client library, **and**
12907    /// - New values received dynamically, without application changes.
12908    ///
12909    /// Please consult the [Working with enums] section in the user guide for some
12910    /// guidelines.
12911    ///
12912    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
12913    #[derive(Clone, Debug, PartialEq)]
12914    #[non_exhaustive]
12915    pub enum ProvisionDeploymentGroupStep {
12916        /// Unspecified step.
12917        Unspecified,
12918        /// Validating the deployment group.
12919        ValidatingDeploymentGroup,
12920        /// Locking the deployments to the deployment group for atomic actuation.
12921        AssociatingDeploymentsToDeploymentGroup,
12922        /// Provisioning the deployment units.
12923        ProvisioningDeploymentUnits,
12924        /// Unlocking the deployments from the deployment group after actuation.
12925        DisassociatingDeploymentsFromDeploymentGroup,
12926        /// The operation has succeeded.
12927        Succeeded,
12928        /// The operation has failed.
12929        Failed,
12930        /// Deprovisioning the deployment units.
12931        DeprovisioningDeploymentUnits,
12932        /// If set, the enum was initialized with an unknown value.
12933        ///
12934        /// Applications can examine the value using [ProvisionDeploymentGroupStep::value] or
12935        /// [ProvisionDeploymentGroupStep::name].
12936        UnknownValue(provision_deployment_group_step::UnknownValue),
12937    }
12938
12939    #[doc(hidden)]
12940    pub mod provision_deployment_group_step {
12941        #[allow(unused_imports)]
12942        use super::*;
12943        #[derive(Clone, Debug, PartialEq)]
12944        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12945    }
12946
12947    impl ProvisionDeploymentGroupStep {
12948        /// Gets the enum value.
12949        ///
12950        /// Returns `None` if the enum contains an unknown value deserialized from
12951        /// the string representation of enums.
12952        pub fn value(&self) -> std::option::Option<i32> {
12953            match self {
12954                Self::Unspecified => std::option::Option::Some(0),
12955                Self::ValidatingDeploymentGroup => std::option::Option::Some(1),
12956                Self::AssociatingDeploymentsToDeploymentGroup => std::option::Option::Some(2),
12957                Self::ProvisioningDeploymentUnits => std::option::Option::Some(3),
12958                Self::DisassociatingDeploymentsFromDeploymentGroup => std::option::Option::Some(4),
12959                Self::Succeeded => std::option::Option::Some(5),
12960                Self::Failed => std::option::Option::Some(6),
12961                Self::DeprovisioningDeploymentUnits => std::option::Option::Some(7),
12962                Self::UnknownValue(u) => u.0.value(),
12963            }
12964        }
12965
12966        /// Gets the enum value as a string.
12967        ///
12968        /// Returns `None` if the enum contains an unknown value deserialized from
12969        /// the integer representation of enums.
12970        pub fn name(&self) -> std::option::Option<&str> {
12971            match self {
12972                Self::Unspecified => {
12973                    std::option::Option::Some("PROVISION_DEPLOYMENT_GROUP_STEP_UNSPECIFIED")
12974                }
12975                Self::ValidatingDeploymentGroup => {
12976                    std::option::Option::Some("VALIDATING_DEPLOYMENT_GROUP")
12977                }
12978                Self::AssociatingDeploymentsToDeploymentGroup => {
12979                    std::option::Option::Some("ASSOCIATING_DEPLOYMENTS_TO_DEPLOYMENT_GROUP")
12980                }
12981                Self::ProvisioningDeploymentUnits => {
12982                    std::option::Option::Some("PROVISIONING_DEPLOYMENT_UNITS")
12983                }
12984                Self::DisassociatingDeploymentsFromDeploymentGroup => {
12985                    std::option::Option::Some("DISASSOCIATING_DEPLOYMENTS_FROM_DEPLOYMENT_GROUP")
12986                }
12987                Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
12988                Self::Failed => std::option::Option::Some("FAILED"),
12989                Self::DeprovisioningDeploymentUnits => {
12990                    std::option::Option::Some("DEPROVISIONING_DEPLOYMENT_UNITS")
12991                }
12992                Self::UnknownValue(u) => u.0.name(),
12993            }
12994        }
12995    }
12996
12997    impl std::default::Default for ProvisionDeploymentGroupStep {
12998        fn default() -> Self {
12999            use std::convert::From;
13000            Self::from(0)
13001        }
13002    }
13003
13004    impl std::fmt::Display for ProvisionDeploymentGroupStep {
13005        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13006            wkt::internal::display_enum(f, self.name(), self.value())
13007        }
13008    }
13009
13010    impl std::convert::From<i32> for ProvisionDeploymentGroupStep {
13011        fn from(value: i32) -> Self {
13012            match value {
13013                0 => Self::Unspecified,
13014                1 => Self::ValidatingDeploymentGroup,
13015                2 => Self::AssociatingDeploymentsToDeploymentGroup,
13016                3 => Self::ProvisioningDeploymentUnits,
13017                4 => Self::DisassociatingDeploymentsFromDeploymentGroup,
13018                5 => Self::Succeeded,
13019                6 => Self::Failed,
13020                7 => Self::DeprovisioningDeploymentUnits,
13021                _ => Self::UnknownValue(provision_deployment_group_step::UnknownValue(
13022                    wkt::internal::UnknownEnumValue::Integer(value),
13023                )),
13024            }
13025        }
13026    }
13027
13028    impl std::convert::From<&str> for ProvisionDeploymentGroupStep {
13029        fn from(value: &str) -> Self {
13030            use std::string::ToString;
13031            match value {
13032                "PROVISION_DEPLOYMENT_GROUP_STEP_UNSPECIFIED" => Self::Unspecified,
13033                "VALIDATING_DEPLOYMENT_GROUP" => Self::ValidatingDeploymentGroup,
13034                "ASSOCIATING_DEPLOYMENTS_TO_DEPLOYMENT_GROUP" => {
13035                    Self::AssociatingDeploymentsToDeploymentGroup
13036                }
13037                "PROVISIONING_DEPLOYMENT_UNITS" => Self::ProvisioningDeploymentUnits,
13038                "DISASSOCIATING_DEPLOYMENTS_FROM_DEPLOYMENT_GROUP" => {
13039                    Self::DisassociatingDeploymentsFromDeploymentGroup
13040                }
13041                "SUCCEEDED" => Self::Succeeded,
13042                "FAILED" => Self::Failed,
13043                "DEPROVISIONING_DEPLOYMENT_UNITS" => Self::DeprovisioningDeploymentUnits,
13044                _ => Self::UnknownValue(provision_deployment_group_step::UnknownValue(
13045                    wkt::internal::UnknownEnumValue::String(value.to_string()),
13046                )),
13047            }
13048        }
13049    }
13050
13051    impl serde::ser::Serialize for ProvisionDeploymentGroupStep {
13052        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13053        where
13054            S: serde::Serializer,
13055        {
13056            match self {
13057                Self::Unspecified => serializer.serialize_i32(0),
13058                Self::ValidatingDeploymentGroup => serializer.serialize_i32(1),
13059                Self::AssociatingDeploymentsToDeploymentGroup => serializer.serialize_i32(2),
13060                Self::ProvisioningDeploymentUnits => serializer.serialize_i32(3),
13061                Self::DisassociatingDeploymentsFromDeploymentGroup => serializer.serialize_i32(4),
13062                Self::Succeeded => serializer.serialize_i32(5),
13063                Self::Failed => serializer.serialize_i32(6),
13064                Self::DeprovisioningDeploymentUnits => serializer.serialize_i32(7),
13065                Self::UnknownValue(u) => u.0.serialize(serializer),
13066            }
13067        }
13068    }
13069
13070    impl<'de> serde::de::Deserialize<'de> for ProvisionDeploymentGroupStep {
13071        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13072        where
13073            D: serde::Deserializer<'de>,
13074        {
13075            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ProvisionDeploymentGroupStep>::new(
13076                ".google.cloud.config.v1.ProvisionDeploymentGroupOperationMetadata.ProvisionDeploymentGroupStep"))
13077        }
13078    }
13079}
13080
13081/// A DeploymentGroupRevision represents a snapshot of a
13082/// [DeploymentGroup][google.cloud.config.v1.DeploymentGroup] at a given point in
13083/// time, created when a DeploymentGroup is provisioned or deprovisioned.
13084///
13085/// [google.cloud.config.v1.DeploymentGroup]: crate::model::DeploymentGroup
13086#[derive(Clone, Default, PartialEq)]
13087#[non_exhaustive]
13088pub struct DeploymentGroupRevision {
13089    /// Identifier. The name of the deployment group revision.
13090    /// Format:
13091    /// 'projects/{project_id}/locations/{location}/deploymentGroups/{deployment_group}/revisions/{revision}'.
13092    pub name: std::string::String,
13093
13094    /// Output only. The snapshot of the deployment group at this revision.
13095    pub snapshot: std::option::Option<crate::model::DeploymentGroup>,
13096
13097    /// Output only. Time when the deployment group revision was created.
13098    pub create_time: std::option::Option<wkt::Timestamp>,
13099
13100    /// Output only. The alternative IDs of the deployment group revision.
13101    pub alternative_ids: std::vec::Vec<std::string::String>,
13102
13103    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13104}
13105
13106impl DeploymentGroupRevision {
13107    /// Creates a new default instance.
13108    pub fn new() -> Self {
13109        std::default::Default::default()
13110    }
13111
13112    /// Sets the value of [name][crate::model::DeploymentGroupRevision::name].
13113    ///
13114    /// # Example
13115    /// ```ignore,no_run
13116    /// # use google_cloud_config_v1::model::DeploymentGroupRevision;
13117    /// # let project_id = "project_id";
13118    /// # let location_id = "location_id";
13119    /// # let deployment_group_id = "deployment_group_id";
13120    /// # let revision_id = "revision_id";
13121    /// let x = DeploymentGroupRevision::new().set_name(format!("projects/{project_id}/locations/{location_id}/deploymentGroups/{deployment_group_id}/revisions/{revision_id}"));
13122    /// ```
13123    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13124        self.name = v.into();
13125        self
13126    }
13127
13128    /// Sets the value of [snapshot][crate::model::DeploymentGroupRevision::snapshot].
13129    ///
13130    /// # Example
13131    /// ```ignore,no_run
13132    /// # use google_cloud_config_v1::model::DeploymentGroupRevision;
13133    /// use google_cloud_config_v1::model::DeploymentGroup;
13134    /// let x = DeploymentGroupRevision::new().set_snapshot(DeploymentGroup::default()/* use setters */);
13135    /// ```
13136    pub fn set_snapshot<T>(mut self, v: T) -> Self
13137    where
13138        T: std::convert::Into<crate::model::DeploymentGroup>,
13139    {
13140        self.snapshot = std::option::Option::Some(v.into());
13141        self
13142    }
13143
13144    /// Sets or clears the value of [snapshot][crate::model::DeploymentGroupRevision::snapshot].
13145    ///
13146    /// # Example
13147    /// ```ignore,no_run
13148    /// # use google_cloud_config_v1::model::DeploymentGroupRevision;
13149    /// use google_cloud_config_v1::model::DeploymentGroup;
13150    /// let x = DeploymentGroupRevision::new().set_or_clear_snapshot(Some(DeploymentGroup::default()/* use setters */));
13151    /// let x = DeploymentGroupRevision::new().set_or_clear_snapshot(None::<DeploymentGroup>);
13152    /// ```
13153    pub fn set_or_clear_snapshot<T>(mut self, v: std::option::Option<T>) -> Self
13154    where
13155        T: std::convert::Into<crate::model::DeploymentGroup>,
13156    {
13157        self.snapshot = v.map(|x| x.into());
13158        self
13159    }
13160
13161    /// Sets the value of [create_time][crate::model::DeploymentGroupRevision::create_time].
13162    ///
13163    /// # Example
13164    /// ```ignore,no_run
13165    /// # use google_cloud_config_v1::model::DeploymentGroupRevision;
13166    /// use wkt::Timestamp;
13167    /// let x = DeploymentGroupRevision::new().set_create_time(Timestamp::default()/* use setters */);
13168    /// ```
13169    pub fn set_create_time<T>(mut self, v: T) -> Self
13170    where
13171        T: std::convert::Into<wkt::Timestamp>,
13172    {
13173        self.create_time = std::option::Option::Some(v.into());
13174        self
13175    }
13176
13177    /// Sets or clears the value of [create_time][crate::model::DeploymentGroupRevision::create_time].
13178    ///
13179    /// # Example
13180    /// ```ignore,no_run
13181    /// # use google_cloud_config_v1::model::DeploymentGroupRevision;
13182    /// use wkt::Timestamp;
13183    /// let x = DeploymentGroupRevision::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
13184    /// let x = DeploymentGroupRevision::new().set_or_clear_create_time(None::<Timestamp>);
13185    /// ```
13186    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
13187    where
13188        T: std::convert::Into<wkt::Timestamp>,
13189    {
13190        self.create_time = v.map(|x| x.into());
13191        self
13192    }
13193
13194    /// Sets the value of [alternative_ids][crate::model::DeploymentGroupRevision::alternative_ids].
13195    ///
13196    /// # Example
13197    /// ```ignore,no_run
13198    /// # use google_cloud_config_v1::model::DeploymentGroupRevision;
13199    /// let x = DeploymentGroupRevision::new().set_alternative_ids(["a", "b", "c"]);
13200    /// ```
13201    pub fn set_alternative_ids<T, V>(mut self, v: T) -> Self
13202    where
13203        T: std::iter::IntoIterator<Item = V>,
13204        V: std::convert::Into<std::string::String>,
13205    {
13206        use std::iter::Iterator;
13207        self.alternative_ids = v.into_iter().map(|i| i.into()).collect();
13208        self
13209    }
13210}
13211
13212impl wkt::message::Message for DeploymentGroupRevision {
13213    fn typename() -> &'static str {
13214        "type.googleapis.com/google.cloud.config.v1.DeploymentGroupRevision"
13215    }
13216}
13217
13218/// The request message for the GetDeploymentGroupRevision method.
13219#[derive(Clone, Default, PartialEq)]
13220#[non_exhaustive]
13221pub struct GetDeploymentGroupRevisionRequest {
13222    /// Required. The name of the deployment group revision to retrieve.
13223    /// Format:
13224    /// 'projects/{project_id}/locations/{location}/deploymentGroups/{deployment_group}/revisions/{revision}'.
13225    pub name: std::string::String,
13226
13227    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13228}
13229
13230impl GetDeploymentGroupRevisionRequest {
13231    /// Creates a new default instance.
13232    pub fn new() -> Self {
13233        std::default::Default::default()
13234    }
13235
13236    /// Sets the value of [name][crate::model::GetDeploymentGroupRevisionRequest::name].
13237    ///
13238    /// # Example
13239    /// ```ignore,no_run
13240    /// # use google_cloud_config_v1::model::GetDeploymentGroupRevisionRequest;
13241    /// # let project_id = "project_id";
13242    /// # let location_id = "location_id";
13243    /// # let deployment_group_id = "deployment_group_id";
13244    /// # let revision_id = "revision_id";
13245    /// let x = GetDeploymentGroupRevisionRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/deploymentGroups/{deployment_group_id}/revisions/{revision_id}"));
13246    /// ```
13247    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13248        self.name = v.into();
13249        self
13250    }
13251}
13252
13253impl wkt::message::Message for GetDeploymentGroupRevisionRequest {
13254    fn typename() -> &'static str {
13255        "type.googleapis.com/google.cloud.config.v1.GetDeploymentGroupRevisionRequest"
13256    }
13257}
13258
13259/// The request message for the ListDeploymentGroupRevisions method.
13260#[derive(Clone, Default, PartialEq)]
13261#[non_exhaustive]
13262pub struct ListDeploymentGroupRevisionsRequest {
13263    /// Required. The parent, which owns this collection of deployment group
13264    /// revisions. Format:
13265    /// 'projects/{project_id}/locations/{location}/deploymentGroups/{deployment_group}'.
13266    pub parent: std::string::String,
13267
13268    /// Optional. When requesting a page of resources, 'page_size' specifies number
13269    /// of resources to return. If unspecified, a sensible default will be used by
13270    /// the server. The maximum value is 1000; values above 1000 will be coerced to
13271    /// 1000.
13272    pub page_size: i32,
13273
13274    /// Optional. Token returned by previous call to 'ListDeploymentGroupRevisions'
13275    /// which specifies the position in the list from where to continue listing the
13276    /// deployment group revisions. All other parameters provided to
13277    /// `ListDeploymentGroupRevisions` must match the call that provided the page
13278    /// token.
13279    pub page_token: std::string::String,
13280
13281    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13282}
13283
13284impl ListDeploymentGroupRevisionsRequest {
13285    /// Creates a new default instance.
13286    pub fn new() -> Self {
13287        std::default::Default::default()
13288    }
13289
13290    /// Sets the value of [parent][crate::model::ListDeploymentGroupRevisionsRequest::parent].
13291    ///
13292    /// # Example
13293    /// ```ignore,no_run
13294    /// # use google_cloud_config_v1::model::ListDeploymentGroupRevisionsRequest;
13295    /// # let project_id = "project_id";
13296    /// # let location_id = "location_id";
13297    /// # let deployment_group_id = "deployment_group_id";
13298    /// let x = ListDeploymentGroupRevisionsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/deploymentGroups/{deployment_group_id}"));
13299    /// ```
13300    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13301        self.parent = v.into();
13302        self
13303    }
13304
13305    /// Sets the value of [page_size][crate::model::ListDeploymentGroupRevisionsRequest::page_size].
13306    ///
13307    /// # Example
13308    /// ```ignore,no_run
13309    /// # use google_cloud_config_v1::model::ListDeploymentGroupRevisionsRequest;
13310    /// let x = ListDeploymentGroupRevisionsRequest::new().set_page_size(42);
13311    /// ```
13312    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
13313        self.page_size = v.into();
13314        self
13315    }
13316
13317    /// Sets the value of [page_token][crate::model::ListDeploymentGroupRevisionsRequest::page_token].
13318    ///
13319    /// # Example
13320    /// ```ignore,no_run
13321    /// # use google_cloud_config_v1::model::ListDeploymentGroupRevisionsRequest;
13322    /// let x = ListDeploymentGroupRevisionsRequest::new().set_page_token("example");
13323    /// ```
13324    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13325        self.page_token = v.into();
13326        self
13327    }
13328}
13329
13330impl wkt::message::Message for ListDeploymentGroupRevisionsRequest {
13331    fn typename() -> &'static str {
13332        "type.googleapis.com/google.cloud.config.v1.ListDeploymentGroupRevisionsRequest"
13333    }
13334}
13335
13336/// The response message for the ListDeploymentGroupRevisions method.
13337#[derive(Clone, Default, PartialEq)]
13338#[non_exhaustive]
13339pub struct ListDeploymentGroupRevisionsResponse {
13340    /// The deployment group revisions from the specified collection.
13341    pub deployment_group_revisions: std::vec::Vec<crate::model::DeploymentGroupRevision>,
13342
13343    /// Token to be supplied to the next ListDeploymentGroupRevisions request via
13344    /// `page_token` to obtain the next set of results.
13345    pub next_page_token: std::string::String,
13346
13347    /// Unordered list. Locations that could not be reached.
13348    pub unreachable: std::vec::Vec<std::string::String>,
13349
13350    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13351}
13352
13353impl ListDeploymentGroupRevisionsResponse {
13354    /// Creates a new default instance.
13355    pub fn new() -> Self {
13356        std::default::Default::default()
13357    }
13358
13359    /// Sets the value of [deployment_group_revisions][crate::model::ListDeploymentGroupRevisionsResponse::deployment_group_revisions].
13360    ///
13361    /// # Example
13362    /// ```ignore,no_run
13363    /// # use google_cloud_config_v1::model::ListDeploymentGroupRevisionsResponse;
13364    /// use google_cloud_config_v1::model::DeploymentGroupRevision;
13365    /// let x = ListDeploymentGroupRevisionsResponse::new()
13366    ///     .set_deployment_group_revisions([
13367    ///         DeploymentGroupRevision::default()/* use setters */,
13368    ///         DeploymentGroupRevision::default()/* use (different) setters */,
13369    ///     ]);
13370    /// ```
13371    pub fn set_deployment_group_revisions<T, V>(mut self, v: T) -> Self
13372    where
13373        T: std::iter::IntoIterator<Item = V>,
13374        V: std::convert::Into<crate::model::DeploymentGroupRevision>,
13375    {
13376        use std::iter::Iterator;
13377        self.deployment_group_revisions = v.into_iter().map(|i| i.into()).collect();
13378        self
13379    }
13380
13381    /// Sets the value of [next_page_token][crate::model::ListDeploymentGroupRevisionsResponse::next_page_token].
13382    ///
13383    /// # Example
13384    /// ```ignore,no_run
13385    /// # use google_cloud_config_v1::model::ListDeploymentGroupRevisionsResponse;
13386    /// let x = ListDeploymentGroupRevisionsResponse::new().set_next_page_token("example");
13387    /// ```
13388    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13389        self.next_page_token = v.into();
13390        self
13391    }
13392
13393    /// Sets the value of [unreachable][crate::model::ListDeploymentGroupRevisionsResponse::unreachable].
13394    ///
13395    /// # Example
13396    /// ```ignore,no_run
13397    /// # use google_cloud_config_v1::model::ListDeploymentGroupRevisionsResponse;
13398    /// let x = ListDeploymentGroupRevisionsResponse::new().set_unreachable(["a", "b", "c"]);
13399    /// ```
13400    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
13401    where
13402        T: std::iter::IntoIterator<Item = V>,
13403        V: std::convert::Into<std::string::String>,
13404    {
13405        use std::iter::Iterator;
13406        self.unreachable = v.into_iter().map(|i| i.into()).collect();
13407        self
13408    }
13409}
13410
13411impl wkt::message::Message for ListDeploymentGroupRevisionsResponse {
13412    fn typename() -> &'static str {
13413        "type.googleapis.com/google.cloud.config.v1.ListDeploymentGroupRevisionsResponse"
13414    }
13415}
13416
13417#[doc(hidden)]
13418impl google_cloud_gax::paginator::internal::PageableResponse
13419    for ListDeploymentGroupRevisionsResponse
13420{
13421    type PageItem = crate::model::DeploymentGroupRevision;
13422
13423    fn items(self) -> std::vec::Vec<Self::PageItem> {
13424        self.deployment_group_revisions
13425    }
13426
13427    fn next_page_token(&self) -> std::string::String {
13428        use std::clone::Clone;
13429        self.next_page_token.clone()
13430    }
13431}
13432
13433/// Enum values to control quota checks for resources in terraform
13434/// configuration files.
13435///
13436/// # Working with unknown values
13437///
13438/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13439/// additional enum variants at any time. Adding new variants is not considered
13440/// a breaking change. Applications should write their code in anticipation of:
13441///
13442/// - New values appearing in future releases of the client library, **and**
13443/// - New values received dynamically, without application changes.
13444///
13445/// Please consult the [Working with enums] section in the user guide for some
13446/// guidelines.
13447///
13448/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
13449#[derive(Clone, Debug, PartialEq)]
13450#[non_exhaustive]
13451pub enum QuotaValidation {
13452    /// The default value.
13453    /// QuotaValidation on terraform configuration files will be disabled in
13454    /// this case.
13455    Unspecified,
13456    /// Enable computing quotas for resources in terraform configuration files to
13457    /// get visibility on resources with insufficient quotas.
13458    Enabled,
13459    /// Enforce quota checks so deployment fails if there isn't sufficient quotas
13460    /// available to deploy resources in terraform configuration files.
13461    Enforced,
13462    /// If set, the enum was initialized with an unknown value.
13463    ///
13464    /// Applications can examine the value using [QuotaValidation::value] or
13465    /// [QuotaValidation::name].
13466    UnknownValue(quota_validation::UnknownValue),
13467}
13468
13469#[doc(hidden)]
13470pub mod quota_validation {
13471    #[allow(unused_imports)]
13472    use super::*;
13473    #[derive(Clone, Debug, PartialEq)]
13474    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13475}
13476
13477impl QuotaValidation {
13478    /// Gets the enum value.
13479    ///
13480    /// Returns `None` if the enum contains an unknown value deserialized from
13481    /// the string representation of enums.
13482    pub fn value(&self) -> std::option::Option<i32> {
13483        match self {
13484            Self::Unspecified => std::option::Option::Some(0),
13485            Self::Enabled => std::option::Option::Some(1),
13486            Self::Enforced => std::option::Option::Some(2),
13487            Self::UnknownValue(u) => u.0.value(),
13488        }
13489    }
13490
13491    /// Gets the enum value as a string.
13492    ///
13493    /// Returns `None` if the enum contains an unknown value deserialized from
13494    /// the integer representation of enums.
13495    pub fn name(&self) -> std::option::Option<&str> {
13496        match self {
13497            Self::Unspecified => std::option::Option::Some("QUOTA_VALIDATION_UNSPECIFIED"),
13498            Self::Enabled => std::option::Option::Some("ENABLED"),
13499            Self::Enforced => std::option::Option::Some("ENFORCED"),
13500            Self::UnknownValue(u) => u.0.name(),
13501        }
13502    }
13503}
13504
13505impl std::default::Default for QuotaValidation {
13506    fn default() -> Self {
13507        use std::convert::From;
13508        Self::from(0)
13509    }
13510}
13511
13512impl std::fmt::Display for QuotaValidation {
13513    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13514        wkt::internal::display_enum(f, self.name(), self.value())
13515    }
13516}
13517
13518impl std::convert::From<i32> for QuotaValidation {
13519    fn from(value: i32) -> Self {
13520        match value {
13521            0 => Self::Unspecified,
13522            1 => Self::Enabled,
13523            2 => Self::Enforced,
13524            _ => Self::UnknownValue(quota_validation::UnknownValue(
13525                wkt::internal::UnknownEnumValue::Integer(value),
13526            )),
13527        }
13528    }
13529}
13530
13531impl std::convert::From<&str> for QuotaValidation {
13532    fn from(value: &str) -> Self {
13533        use std::string::ToString;
13534        match value {
13535            "QUOTA_VALIDATION_UNSPECIFIED" => Self::Unspecified,
13536            "ENABLED" => Self::Enabled,
13537            "ENFORCED" => Self::Enforced,
13538            _ => Self::UnknownValue(quota_validation::UnknownValue(
13539                wkt::internal::UnknownEnumValue::String(value.to_string()),
13540            )),
13541        }
13542    }
13543}
13544
13545impl serde::ser::Serialize for QuotaValidation {
13546    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13547    where
13548        S: serde::Serializer,
13549    {
13550        match self {
13551            Self::Unspecified => serializer.serialize_i32(0),
13552            Self::Enabled => serializer.serialize_i32(1),
13553            Self::Enforced => serializer.serialize_i32(2),
13554            Self::UnknownValue(u) => u.0.serialize(serializer),
13555        }
13556    }
13557}
13558
13559impl<'de> serde::de::Deserialize<'de> for QuotaValidation {
13560    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13561    where
13562        D: serde::Deserializer<'de>,
13563    {
13564        deserializer.deserialize_any(wkt::internal::EnumVisitor::<QuotaValidation>::new(
13565            ".google.cloud.config.v1.QuotaValidation",
13566        ))
13567    }
13568}