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 gax;
23extern crate gaxi;
24extern crate iam_v1;
25extern crate lazy_static;
26extern crate location;
27extern crate longrunning;
28extern crate lro;
29extern crate reqwest;
30extern crate rpc;
31extern crate serde;
32extern crate serde_json;
33extern crate serde_with;
34extern crate std;
35extern crate tracing;
36extern crate wkt;
37
38mod debug;
39mod deserialize;
40mod serialize;
41
42/// A Deployment is a group of resources and configs managed and provisioned by
43/// Infra Manager.
44#[derive(Clone, Default, PartialEq)]
45#[non_exhaustive]
46pub struct Deployment {
47    /// Identifier. Resource name of the deployment.
48    /// Format: `projects/{project}/locations/{location}/deployments/{deployment}`
49    pub name: std::string::String,
50
51    /// Output only. Time when the deployment was created.
52    pub create_time: std::option::Option<wkt::Timestamp>,
53
54    /// Output only. Time when the deployment was last modified.
55    pub update_time: std::option::Option<wkt::Timestamp>,
56
57    /// Optional. User-defined metadata for the deployment.
58    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
59
60    /// Output only. Current state of the deployment.
61    pub state: crate::model::deployment::State,
62
63    /// Output only. Revision name that was most recently applied.
64    /// Format: `projects/{project}/locations/{location}/deployments/{deployment}/
65    /// revisions/{revision}`
66    pub latest_revision: std::string::String,
67
68    /// Output only. Additional information regarding the current state.
69    pub state_detail: std::string::String,
70
71    /// Output only. Error code describing errors that may have occurred.
72    pub error_code: crate::model::deployment::ErrorCode,
73
74    /// Output only. Location of artifacts from a DeleteDeployment operation.
75    pub delete_results: std::option::Option<crate::model::ApplyResults>,
76
77    /// Output only. Cloud Build instance UUID associated with deleting this
78    /// deployment.
79    pub delete_build: std::string::String,
80
81    /// Output only. Location of Cloud Build logs in Google Cloud Storage,
82    /// populated when deleting this deployment. Format: `gs://{bucket}/{object}`.
83    pub delete_logs: std::string::String,
84
85    /// Output only. Errors encountered when deleting this deployment.
86    /// Errors are truncated to 10 entries, see `delete_results` and `error_logs`
87    /// for full details.
88    pub tf_errors: std::vec::Vec<crate::model::TerraformError>,
89
90    /// Output only. Location of Terraform error logs in Google Cloud Storage.
91    /// Format: `gs://{bucket}/{object}`.
92    pub error_logs: std::string::String,
93
94    /// Optional. User-defined location of Cloud Build logs and artifacts in Google
95    /// Cloud Storage. Format: `gs://{bucket}/{folder}`
96    ///
97    /// A default bucket will be bootstrapped if the field is not set or empty.
98    /// Default bucket format: `gs://<project number>-<region>-blueprint-config`
99    /// Constraints:
100    ///
101    /// - The bucket needs to be in the same project as the deployment
102    /// - The path cannot be within the path of `gcs_source`
103    /// - The field cannot be updated, including changing its presence
104    pub artifacts_gcs_bucket: std::option::Option<std::string::String>,
105
106    /// Required. User-specified Service Account (SA) credentials to be used when
107    /// actuating resources.
108    /// Format: `projects/{projectID}/serviceAccounts/{serviceAccount}`
109    pub service_account: std::option::Option<std::string::String>,
110
111    /// By default, Infra Manager will return a failure when
112    /// Terraform encounters a 409 code (resource conflict error) during actuation.
113    /// If this flag is set to true, Infra Manager will instead
114    /// attempt to automatically import the resource into the Terraform state (for
115    /// supported resource types) and continue actuation.
116    ///
117    /// Not all resource types are supported, refer to documentation.
118    pub import_existing_resources: std::option::Option<bool>,
119
120    /// Optional. The user-specified Cloud Build worker pool resource in which the
121    /// Cloud Build job will execute. Format:
122    /// `projects/{project}/locations/{location}/workerPools/{workerPoolId}`.
123    /// If this field is unspecified, the default Cloud Build worker pool will be
124    /// used.
125    pub worker_pool: std::option::Option<std::string::String>,
126
127    /// Output only. Current lock state of the deployment.
128    pub lock_state: crate::model::deployment::LockState,
129
130    /// Optional. The user-specified Terraform version constraint.
131    /// Example: "=1.3.10".
132    pub tf_version_constraint: std::option::Option<std::string::String>,
133
134    /// Output only. The current Terraform version set on the deployment.
135    /// It is in the format of "Major.Minor.Patch", for example, "1.3.10".
136    pub tf_version: std::string::String,
137
138    /// Optional. Input to control quota checks for resources in terraform
139    /// configuration files. There are limited resources on which quota validation
140    /// applies.
141    pub quota_validation: crate::model::QuotaValidation,
142
143    /// Optional. Arbitrary key-value metadata storage e.g. to help client tools
144    /// identify deployments during automation. See
145    /// <https://google.aip.dev/148#annotations> for details on format and size
146    /// limitations.
147    pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
148
149    /// Optional. This field specifies the provider configurations.
150    pub provider_config: std::option::Option<crate::model::ProviderConfig>,
151
152    /// Blueprint to deploy.
153    pub blueprint: std::option::Option<crate::model::deployment::Blueprint>,
154
155    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
156}
157
158impl Deployment {
159    pub fn new() -> Self {
160        std::default::Default::default()
161    }
162
163    /// Sets the value of [name][crate::model::Deployment::name].
164    ///
165    /// # Example
166    /// ```ignore,no_run
167    /// # use google_cloud_config_v1::model::Deployment;
168    /// let x = Deployment::new().set_name("example");
169    /// ```
170    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
171        self.name = v.into();
172        self
173    }
174
175    /// Sets the value of [create_time][crate::model::Deployment::create_time].
176    ///
177    /// # Example
178    /// ```ignore,no_run
179    /// # use google_cloud_config_v1::model::Deployment;
180    /// use wkt::Timestamp;
181    /// let x = Deployment::new().set_create_time(Timestamp::default()/* use setters */);
182    /// ```
183    pub fn set_create_time<T>(mut self, v: T) -> Self
184    where
185        T: std::convert::Into<wkt::Timestamp>,
186    {
187        self.create_time = std::option::Option::Some(v.into());
188        self
189    }
190
191    /// Sets or clears the value of [create_time][crate::model::Deployment::create_time].
192    ///
193    /// # Example
194    /// ```ignore,no_run
195    /// # use google_cloud_config_v1::model::Deployment;
196    /// use wkt::Timestamp;
197    /// let x = Deployment::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
198    /// let x = Deployment::new().set_or_clear_create_time(None::<Timestamp>);
199    /// ```
200    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
201    where
202        T: std::convert::Into<wkt::Timestamp>,
203    {
204        self.create_time = v.map(|x| x.into());
205        self
206    }
207
208    /// Sets the value of [update_time][crate::model::Deployment::update_time].
209    ///
210    /// # Example
211    /// ```ignore,no_run
212    /// # use google_cloud_config_v1::model::Deployment;
213    /// use wkt::Timestamp;
214    /// let x = Deployment::new().set_update_time(Timestamp::default()/* use setters */);
215    /// ```
216    pub fn set_update_time<T>(mut self, v: T) -> Self
217    where
218        T: std::convert::Into<wkt::Timestamp>,
219    {
220        self.update_time = std::option::Option::Some(v.into());
221        self
222    }
223
224    /// Sets or clears the value of [update_time][crate::model::Deployment::update_time].
225    ///
226    /// # Example
227    /// ```ignore,no_run
228    /// # use google_cloud_config_v1::model::Deployment;
229    /// use wkt::Timestamp;
230    /// let x = Deployment::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
231    /// let x = Deployment::new().set_or_clear_update_time(None::<Timestamp>);
232    /// ```
233    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
234    where
235        T: std::convert::Into<wkt::Timestamp>,
236    {
237        self.update_time = v.map(|x| x.into());
238        self
239    }
240
241    /// Sets the value of [labels][crate::model::Deployment::labels].
242    ///
243    /// # Example
244    /// ```ignore,no_run
245    /// # use google_cloud_config_v1::model::Deployment;
246    /// let x = Deployment::new().set_labels([
247    ///     ("key0", "abc"),
248    ///     ("key1", "xyz"),
249    /// ]);
250    /// ```
251    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
252    where
253        T: std::iter::IntoIterator<Item = (K, V)>,
254        K: std::convert::Into<std::string::String>,
255        V: std::convert::Into<std::string::String>,
256    {
257        use std::iter::Iterator;
258        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
259        self
260    }
261
262    /// Sets the value of [state][crate::model::Deployment::state].
263    ///
264    /// # Example
265    /// ```ignore,no_run
266    /// # use google_cloud_config_v1::model::Deployment;
267    /// use google_cloud_config_v1::model::deployment::State;
268    /// let x0 = Deployment::new().set_state(State::Creating);
269    /// let x1 = Deployment::new().set_state(State::Active);
270    /// let x2 = Deployment::new().set_state(State::Updating);
271    /// ```
272    pub fn set_state<T: std::convert::Into<crate::model::deployment::State>>(
273        mut self,
274        v: T,
275    ) -> Self {
276        self.state = v.into();
277        self
278    }
279
280    /// Sets the value of [latest_revision][crate::model::Deployment::latest_revision].
281    ///
282    /// # Example
283    /// ```ignore,no_run
284    /// # use google_cloud_config_v1::model::Deployment;
285    /// let x = Deployment::new().set_latest_revision("example");
286    /// ```
287    pub fn set_latest_revision<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
288        self.latest_revision = v.into();
289        self
290    }
291
292    /// Sets the value of [state_detail][crate::model::Deployment::state_detail].
293    ///
294    /// # Example
295    /// ```ignore,no_run
296    /// # use google_cloud_config_v1::model::Deployment;
297    /// let x = Deployment::new().set_state_detail("example");
298    /// ```
299    pub fn set_state_detail<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
300        self.state_detail = v.into();
301        self
302    }
303
304    /// Sets the value of [error_code][crate::model::Deployment::error_code].
305    ///
306    /// # Example
307    /// ```ignore,no_run
308    /// # use google_cloud_config_v1::model::Deployment;
309    /// use google_cloud_config_v1::model::deployment::ErrorCode;
310    /// let x0 = Deployment::new().set_error_code(ErrorCode::RevisionFailed);
311    /// let x1 = Deployment::new().set_error_code(ErrorCode::CloudBuildPermissionDenied);
312    /// let x2 = Deployment::new().set_error_code(ErrorCode::DeleteBuildApiFailed);
313    /// ```
314    pub fn set_error_code<T: std::convert::Into<crate::model::deployment::ErrorCode>>(
315        mut self,
316        v: T,
317    ) -> Self {
318        self.error_code = v.into();
319        self
320    }
321
322    /// Sets the value of [delete_results][crate::model::Deployment::delete_results].
323    ///
324    /// # Example
325    /// ```ignore,no_run
326    /// # use google_cloud_config_v1::model::Deployment;
327    /// use google_cloud_config_v1::model::ApplyResults;
328    /// let x = Deployment::new().set_delete_results(ApplyResults::default()/* use setters */);
329    /// ```
330    pub fn set_delete_results<T>(mut self, v: T) -> Self
331    where
332        T: std::convert::Into<crate::model::ApplyResults>,
333    {
334        self.delete_results = std::option::Option::Some(v.into());
335        self
336    }
337
338    /// Sets or clears the value of [delete_results][crate::model::Deployment::delete_results].
339    ///
340    /// # Example
341    /// ```ignore,no_run
342    /// # use google_cloud_config_v1::model::Deployment;
343    /// use google_cloud_config_v1::model::ApplyResults;
344    /// let x = Deployment::new().set_or_clear_delete_results(Some(ApplyResults::default()/* use setters */));
345    /// let x = Deployment::new().set_or_clear_delete_results(None::<ApplyResults>);
346    /// ```
347    pub fn set_or_clear_delete_results<T>(mut self, v: std::option::Option<T>) -> Self
348    where
349        T: std::convert::Into<crate::model::ApplyResults>,
350    {
351        self.delete_results = v.map(|x| x.into());
352        self
353    }
354
355    /// Sets the value of [delete_build][crate::model::Deployment::delete_build].
356    ///
357    /// # Example
358    /// ```ignore,no_run
359    /// # use google_cloud_config_v1::model::Deployment;
360    /// let x = Deployment::new().set_delete_build("example");
361    /// ```
362    pub fn set_delete_build<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
363        self.delete_build = v.into();
364        self
365    }
366
367    /// Sets the value of [delete_logs][crate::model::Deployment::delete_logs].
368    ///
369    /// # Example
370    /// ```ignore,no_run
371    /// # use google_cloud_config_v1::model::Deployment;
372    /// let x = Deployment::new().set_delete_logs("example");
373    /// ```
374    pub fn set_delete_logs<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
375        self.delete_logs = v.into();
376        self
377    }
378
379    /// Sets the value of [tf_errors][crate::model::Deployment::tf_errors].
380    ///
381    /// # Example
382    /// ```ignore,no_run
383    /// # use google_cloud_config_v1::model::Deployment;
384    /// use google_cloud_config_v1::model::TerraformError;
385    /// let x = Deployment::new()
386    ///     .set_tf_errors([
387    ///         TerraformError::default()/* use setters */,
388    ///         TerraformError::default()/* use (different) setters */,
389    ///     ]);
390    /// ```
391    pub fn set_tf_errors<T, V>(mut self, v: T) -> Self
392    where
393        T: std::iter::IntoIterator<Item = V>,
394        V: std::convert::Into<crate::model::TerraformError>,
395    {
396        use std::iter::Iterator;
397        self.tf_errors = v.into_iter().map(|i| i.into()).collect();
398        self
399    }
400
401    /// Sets the value of [error_logs][crate::model::Deployment::error_logs].
402    ///
403    /// # Example
404    /// ```ignore,no_run
405    /// # use google_cloud_config_v1::model::Deployment;
406    /// let x = Deployment::new().set_error_logs("example");
407    /// ```
408    pub fn set_error_logs<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
409        self.error_logs = v.into();
410        self
411    }
412
413    /// Sets the value of [artifacts_gcs_bucket][crate::model::Deployment::artifacts_gcs_bucket].
414    ///
415    /// # Example
416    /// ```ignore,no_run
417    /// # use google_cloud_config_v1::model::Deployment;
418    /// let x = Deployment::new().set_artifacts_gcs_bucket("example");
419    /// ```
420    pub fn set_artifacts_gcs_bucket<T>(mut self, v: T) -> Self
421    where
422        T: std::convert::Into<std::string::String>,
423    {
424        self.artifacts_gcs_bucket = std::option::Option::Some(v.into());
425        self
426    }
427
428    /// Sets or clears the value of [artifacts_gcs_bucket][crate::model::Deployment::artifacts_gcs_bucket].
429    ///
430    /// # Example
431    /// ```ignore,no_run
432    /// # use google_cloud_config_v1::model::Deployment;
433    /// let x = Deployment::new().set_or_clear_artifacts_gcs_bucket(Some("example"));
434    /// let x = Deployment::new().set_or_clear_artifacts_gcs_bucket(None::<String>);
435    /// ```
436    pub fn set_or_clear_artifacts_gcs_bucket<T>(mut self, v: std::option::Option<T>) -> Self
437    where
438        T: std::convert::Into<std::string::String>,
439    {
440        self.artifacts_gcs_bucket = v.map(|x| x.into());
441        self
442    }
443
444    /// Sets the value of [service_account][crate::model::Deployment::service_account].
445    ///
446    /// # Example
447    /// ```ignore,no_run
448    /// # use google_cloud_config_v1::model::Deployment;
449    /// let x = Deployment::new().set_service_account("example");
450    /// ```
451    pub fn set_service_account<T>(mut self, v: T) -> Self
452    where
453        T: std::convert::Into<std::string::String>,
454    {
455        self.service_account = std::option::Option::Some(v.into());
456        self
457    }
458
459    /// Sets or clears the value of [service_account][crate::model::Deployment::service_account].
460    ///
461    /// # Example
462    /// ```ignore,no_run
463    /// # use google_cloud_config_v1::model::Deployment;
464    /// let x = Deployment::new().set_or_clear_service_account(Some("example"));
465    /// let x = Deployment::new().set_or_clear_service_account(None::<String>);
466    /// ```
467    pub fn set_or_clear_service_account<T>(mut self, v: std::option::Option<T>) -> Self
468    where
469        T: std::convert::Into<std::string::String>,
470    {
471        self.service_account = v.map(|x| x.into());
472        self
473    }
474
475    /// Sets the value of [import_existing_resources][crate::model::Deployment::import_existing_resources].
476    ///
477    /// # Example
478    /// ```ignore,no_run
479    /// # use google_cloud_config_v1::model::Deployment;
480    /// let x = Deployment::new().set_import_existing_resources(true);
481    /// ```
482    pub fn set_import_existing_resources<T>(mut self, v: T) -> Self
483    where
484        T: std::convert::Into<bool>,
485    {
486        self.import_existing_resources = std::option::Option::Some(v.into());
487        self
488    }
489
490    /// Sets or clears the value of [import_existing_resources][crate::model::Deployment::import_existing_resources].
491    ///
492    /// # Example
493    /// ```ignore,no_run
494    /// # use google_cloud_config_v1::model::Deployment;
495    /// let x = Deployment::new().set_or_clear_import_existing_resources(Some(false));
496    /// let x = Deployment::new().set_or_clear_import_existing_resources(None::<bool>);
497    /// ```
498    pub fn set_or_clear_import_existing_resources<T>(mut self, v: std::option::Option<T>) -> Self
499    where
500        T: std::convert::Into<bool>,
501    {
502        self.import_existing_resources = v.map(|x| x.into());
503        self
504    }
505
506    /// Sets the value of [worker_pool][crate::model::Deployment::worker_pool].
507    ///
508    /// # Example
509    /// ```ignore,no_run
510    /// # use google_cloud_config_v1::model::Deployment;
511    /// let x = Deployment::new().set_worker_pool("example");
512    /// ```
513    pub fn set_worker_pool<T>(mut self, v: T) -> Self
514    where
515        T: std::convert::Into<std::string::String>,
516    {
517        self.worker_pool = std::option::Option::Some(v.into());
518        self
519    }
520
521    /// Sets or clears the value of [worker_pool][crate::model::Deployment::worker_pool].
522    ///
523    /// # Example
524    /// ```ignore,no_run
525    /// # use google_cloud_config_v1::model::Deployment;
526    /// let x = Deployment::new().set_or_clear_worker_pool(Some("example"));
527    /// let x = Deployment::new().set_or_clear_worker_pool(None::<String>);
528    /// ```
529    pub fn set_or_clear_worker_pool<T>(mut self, v: std::option::Option<T>) -> Self
530    where
531        T: std::convert::Into<std::string::String>,
532    {
533        self.worker_pool = v.map(|x| x.into());
534        self
535    }
536
537    /// Sets the value of [lock_state][crate::model::Deployment::lock_state].
538    ///
539    /// # Example
540    /// ```ignore,no_run
541    /// # use google_cloud_config_v1::model::Deployment;
542    /// use google_cloud_config_v1::model::deployment::LockState;
543    /// let x0 = Deployment::new().set_lock_state(LockState::Locked);
544    /// let x1 = Deployment::new().set_lock_state(LockState::Unlocked);
545    /// let x2 = Deployment::new().set_lock_state(LockState::Locking);
546    /// ```
547    pub fn set_lock_state<T: std::convert::Into<crate::model::deployment::LockState>>(
548        mut self,
549        v: T,
550    ) -> Self {
551        self.lock_state = v.into();
552        self
553    }
554
555    /// Sets the value of [tf_version_constraint][crate::model::Deployment::tf_version_constraint].
556    ///
557    /// # Example
558    /// ```ignore,no_run
559    /// # use google_cloud_config_v1::model::Deployment;
560    /// let x = Deployment::new().set_tf_version_constraint("example");
561    /// ```
562    pub fn set_tf_version_constraint<T>(mut self, v: T) -> Self
563    where
564        T: std::convert::Into<std::string::String>,
565    {
566        self.tf_version_constraint = std::option::Option::Some(v.into());
567        self
568    }
569
570    /// Sets or clears the value of [tf_version_constraint][crate::model::Deployment::tf_version_constraint].
571    ///
572    /// # Example
573    /// ```ignore,no_run
574    /// # use google_cloud_config_v1::model::Deployment;
575    /// let x = Deployment::new().set_or_clear_tf_version_constraint(Some("example"));
576    /// let x = Deployment::new().set_or_clear_tf_version_constraint(None::<String>);
577    /// ```
578    pub fn set_or_clear_tf_version_constraint<T>(mut self, v: std::option::Option<T>) -> Self
579    where
580        T: std::convert::Into<std::string::String>,
581    {
582        self.tf_version_constraint = v.map(|x| x.into());
583        self
584    }
585
586    /// Sets the value of [tf_version][crate::model::Deployment::tf_version].
587    ///
588    /// # Example
589    /// ```ignore,no_run
590    /// # use google_cloud_config_v1::model::Deployment;
591    /// let x = Deployment::new().set_tf_version("example");
592    /// ```
593    pub fn set_tf_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
594        self.tf_version = v.into();
595        self
596    }
597
598    /// Sets the value of [quota_validation][crate::model::Deployment::quota_validation].
599    ///
600    /// # Example
601    /// ```ignore,no_run
602    /// # use google_cloud_config_v1::model::Deployment;
603    /// use google_cloud_config_v1::model::QuotaValidation;
604    /// let x0 = Deployment::new().set_quota_validation(QuotaValidation::Enabled);
605    /// let x1 = Deployment::new().set_quota_validation(QuotaValidation::Enforced);
606    /// ```
607    pub fn set_quota_validation<T: std::convert::Into<crate::model::QuotaValidation>>(
608        mut self,
609        v: T,
610    ) -> Self {
611        self.quota_validation = v.into();
612        self
613    }
614
615    /// Sets the value of [annotations][crate::model::Deployment::annotations].
616    ///
617    /// # Example
618    /// ```ignore,no_run
619    /// # use google_cloud_config_v1::model::Deployment;
620    /// let x = Deployment::new().set_annotations([
621    ///     ("key0", "abc"),
622    ///     ("key1", "xyz"),
623    /// ]);
624    /// ```
625    pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
626    where
627        T: std::iter::IntoIterator<Item = (K, V)>,
628        K: std::convert::Into<std::string::String>,
629        V: std::convert::Into<std::string::String>,
630    {
631        use std::iter::Iterator;
632        self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
633        self
634    }
635
636    /// Sets the value of [provider_config][crate::model::Deployment::provider_config].
637    ///
638    /// # Example
639    /// ```ignore,no_run
640    /// # use google_cloud_config_v1::model::Deployment;
641    /// use google_cloud_config_v1::model::ProviderConfig;
642    /// let x = Deployment::new().set_provider_config(ProviderConfig::default()/* use setters */);
643    /// ```
644    pub fn set_provider_config<T>(mut self, v: T) -> Self
645    where
646        T: std::convert::Into<crate::model::ProviderConfig>,
647    {
648        self.provider_config = std::option::Option::Some(v.into());
649        self
650    }
651
652    /// Sets or clears the value of [provider_config][crate::model::Deployment::provider_config].
653    ///
654    /// # Example
655    /// ```ignore,no_run
656    /// # use google_cloud_config_v1::model::Deployment;
657    /// use google_cloud_config_v1::model::ProviderConfig;
658    /// let x = Deployment::new().set_or_clear_provider_config(Some(ProviderConfig::default()/* use setters */));
659    /// let x = Deployment::new().set_or_clear_provider_config(None::<ProviderConfig>);
660    /// ```
661    pub fn set_or_clear_provider_config<T>(mut self, v: std::option::Option<T>) -> Self
662    where
663        T: std::convert::Into<crate::model::ProviderConfig>,
664    {
665        self.provider_config = v.map(|x| x.into());
666        self
667    }
668
669    /// Sets the value of [blueprint][crate::model::Deployment::blueprint].
670    ///
671    /// Note that all the setters affecting `blueprint` are mutually
672    /// exclusive.
673    ///
674    /// # Example
675    /// ```ignore,no_run
676    /// # use google_cloud_config_v1::model::Deployment;
677    /// use google_cloud_config_v1::model::TerraformBlueprint;
678    /// let x = Deployment::new().set_blueprint(Some(
679    ///     google_cloud_config_v1::model::deployment::Blueprint::TerraformBlueprint(TerraformBlueprint::default().into())));
680    /// ```
681    pub fn set_blueprint<
682        T: std::convert::Into<std::option::Option<crate::model::deployment::Blueprint>>,
683    >(
684        mut self,
685        v: T,
686    ) -> Self {
687        self.blueprint = v.into();
688        self
689    }
690
691    /// The value of [blueprint][crate::model::Deployment::blueprint]
692    /// if it holds a `TerraformBlueprint`, `None` if the field is not set or
693    /// holds a different branch.
694    pub fn terraform_blueprint(
695        &self,
696    ) -> std::option::Option<&std::boxed::Box<crate::model::TerraformBlueprint>> {
697        #[allow(unreachable_patterns)]
698        self.blueprint.as_ref().and_then(|v| match v {
699            crate::model::deployment::Blueprint::TerraformBlueprint(v) => {
700                std::option::Option::Some(v)
701            }
702            _ => std::option::Option::None,
703        })
704    }
705
706    /// Sets the value of [blueprint][crate::model::Deployment::blueprint]
707    /// to hold a `TerraformBlueprint`.
708    ///
709    /// Note that all the setters affecting `blueprint` are
710    /// mutually exclusive.
711    ///
712    /// # Example
713    /// ```ignore,no_run
714    /// # use google_cloud_config_v1::model::Deployment;
715    /// use google_cloud_config_v1::model::TerraformBlueprint;
716    /// let x = Deployment::new().set_terraform_blueprint(TerraformBlueprint::default()/* use setters */);
717    /// assert!(x.terraform_blueprint().is_some());
718    /// ```
719    pub fn set_terraform_blueprint<
720        T: std::convert::Into<std::boxed::Box<crate::model::TerraformBlueprint>>,
721    >(
722        mut self,
723        v: T,
724    ) -> Self {
725        self.blueprint = std::option::Option::Some(
726            crate::model::deployment::Blueprint::TerraformBlueprint(v.into()),
727        );
728        self
729    }
730}
731
732impl wkt::message::Message for Deployment {
733    fn typename() -> &'static str {
734        "type.googleapis.com/google.cloud.config.v1.Deployment"
735    }
736}
737
738/// Defines additional types related to [Deployment].
739pub mod deployment {
740    #[allow(unused_imports)]
741    use super::*;
742
743    /// Possible states of a deployment.
744    ///
745    /// # Working with unknown values
746    ///
747    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
748    /// additional enum variants at any time. Adding new variants is not considered
749    /// a breaking change. Applications should write their code in anticipation of:
750    ///
751    /// - New values appearing in future releases of the client library, **and**
752    /// - New values received dynamically, without application changes.
753    ///
754    /// Please consult the [Working with enums] section in the user guide for some
755    /// guidelines.
756    ///
757    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
758    #[derive(Clone, Debug, PartialEq)]
759    #[non_exhaustive]
760    pub enum State {
761        /// The default value. This value is used if the state is omitted.
762        Unspecified,
763        /// The deployment is being created.
764        Creating,
765        /// The deployment is healthy.
766        Active,
767        /// The deployment is being updated.
768        Updating,
769        /// The deployment is being deleted.
770        Deleting,
771        /// The deployment has encountered an unexpected error.
772        Failed,
773        /// The deployment is no longer being actively reconciled.
774        /// This may be the result of recovering the project after deletion.
775        Suspended,
776        /// The deployment has been deleted.
777        Deleted,
778        /// If set, the enum was initialized with an unknown value.
779        ///
780        /// Applications can examine the value using [State::value] or
781        /// [State::name].
782        UnknownValue(state::UnknownValue),
783    }
784
785    #[doc(hidden)]
786    pub mod state {
787        #[allow(unused_imports)]
788        use super::*;
789        #[derive(Clone, Debug, PartialEq)]
790        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
791    }
792
793    impl State {
794        /// Gets the enum value.
795        ///
796        /// Returns `None` if the enum contains an unknown value deserialized from
797        /// the string representation of enums.
798        pub fn value(&self) -> std::option::Option<i32> {
799            match self {
800                Self::Unspecified => std::option::Option::Some(0),
801                Self::Creating => std::option::Option::Some(1),
802                Self::Active => std::option::Option::Some(2),
803                Self::Updating => std::option::Option::Some(3),
804                Self::Deleting => std::option::Option::Some(4),
805                Self::Failed => std::option::Option::Some(5),
806                Self::Suspended => std::option::Option::Some(6),
807                Self::Deleted => std::option::Option::Some(7),
808                Self::UnknownValue(u) => u.0.value(),
809            }
810        }
811
812        /// Gets the enum value as a string.
813        ///
814        /// Returns `None` if the enum contains an unknown value deserialized from
815        /// the integer representation of enums.
816        pub fn name(&self) -> std::option::Option<&str> {
817            match self {
818                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
819                Self::Creating => std::option::Option::Some("CREATING"),
820                Self::Active => std::option::Option::Some("ACTIVE"),
821                Self::Updating => std::option::Option::Some("UPDATING"),
822                Self::Deleting => std::option::Option::Some("DELETING"),
823                Self::Failed => std::option::Option::Some("FAILED"),
824                Self::Suspended => std::option::Option::Some("SUSPENDED"),
825                Self::Deleted => std::option::Option::Some("DELETED"),
826                Self::UnknownValue(u) => u.0.name(),
827            }
828        }
829    }
830
831    impl std::default::Default for State {
832        fn default() -> Self {
833            use std::convert::From;
834            Self::from(0)
835        }
836    }
837
838    impl std::fmt::Display for State {
839        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
840            wkt::internal::display_enum(f, self.name(), self.value())
841        }
842    }
843
844    impl std::convert::From<i32> for State {
845        fn from(value: i32) -> Self {
846            match value {
847                0 => Self::Unspecified,
848                1 => Self::Creating,
849                2 => Self::Active,
850                3 => Self::Updating,
851                4 => Self::Deleting,
852                5 => Self::Failed,
853                6 => Self::Suspended,
854                7 => Self::Deleted,
855                _ => Self::UnknownValue(state::UnknownValue(
856                    wkt::internal::UnknownEnumValue::Integer(value),
857                )),
858            }
859        }
860    }
861
862    impl std::convert::From<&str> for State {
863        fn from(value: &str) -> Self {
864            use std::string::ToString;
865            match value {
866                "STATE_UNSPECIFIED" => Self::Unspecified,
867                "CREATING" => Self::Creating,
868                "ACTIVE" => Self::Active,
869                "UPDATING" => Self::Updating,
870                "DELETING" => Self::Deleting,
871                "FAILED" => Self::Failed,
872                "SUSPENDED" => Self::Suspended,
873                "DELETED" => Self::Deleted,
874                _ => Self::UnknownValue(state::UnknownValue(
875                    wkt::internal::UnknownEnumValue::String(value.to_string()),
876                )),
877            }
878        }
879    }
880
881    impl serde::ser::Serialize for State {
882        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
883        where
884            S: serde::Serializer,
885        {
886            match self {
887                Self::Unspecified => serializer.serialize_i32(0),
888                Self::Creating => serializer.serialize_i32(1),
889                Self::Active => serializer.serialize_i32(2),
890                Self::Updating => serializer.serialize_i32(3),
891                Self::Deleting => serializer.serialize_i32(4),
892                Self::Failed => serializer.serialize_i32(5),
893                Self::Suspended => serializer.serialize_i32(6),
894                Self::Deleted => serializer.serialize_i32(7),
895                Self::UnknownValue(u) => u.0.serialize(serializer),
896            }
897        }
898    }
899
900    impl<'de> serde::de::Deserialize<'de> for State {
901        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
902        where
903            D: serde::Deserializer<'de>,
904        {
905            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
906                ".google.cloud.config.v1.Deployment.State",
907            ))
908        }
909    }
910
911    /// Possible errors that can occur with deployments.
912    ///
913    /// # Working with unknown values
914    ///
915    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
916    /// additional enum variants at any time. Adding new variants is not considered
917    /// a breaking change. Applications should write their code in anticipation of:
918    ///
919    /// - New values appearing in future releases of the client library, **and**
920    /// - New values received dynamically, without application changes.
921    ///
922    /// Please consult the [Working with enums] section in the user guide for some
923    /// guidelines.
924    ///
925    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
926    #[derive(Clone, Debug, PartialEq)]
927    #[non_exhaustive]
928    pub enum ErrorCode {
929        /// No error code was specified.
930        Unspecified,
931        /// The revision failed. See Revision for more details.
932        RevisionFailed,
933        /// Cloud Build failed due to a permission issue.
934        CloudBuildPermissionDenied,
935        /// Cloud Build job associated with a deployment deletion could not be
936        /// started.
937        DeleteBuildApiFailed,
938        /// Cloud Build job associated with a deployment deletion was started but
939        /// failed.
940        DeleteBuildRunFailed,
941        /// Cloud Storage bucket creation failed due to a permission issue.
942        BucketCreationPermissionDenied,
943        /// Cloud Storage bucket creation failed due to an issue unrelated to
944        /// permissions.
945        BucketCreationFailed,
946        /// If set, the enum was initialized with an unknown value.
947        ///
948        /// Applications can examine the value using [ErrorCode::value] or
949        /// [ErrorCode::name].
950        UnknownValue(error_code::UnknownValue),
951    }
952
953    #[doc(hidden)]
954    pub mod error_code {
955        #[allow(unused_imports)]
956        use super::*;
957        #[derive(Clone, Debug, PartialEq)]
958        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
959    }
960
961    impl ErrorCode {
962        /// Gets the enum value.
963        ///
964        /// Returns `None` if the enum contains an unknown value deserialized from
965        /// the string representation of enums.
966        pub fn value(&self) -> std::option::Option<i32> {
967            match self {
968                Self::Unspecified => std::option::Option::Some(0),
969                Self::RevisionFailed => std::option::Option::Some(1),
970                Self::CloudBuildPermissionDenied => std::option::Option::Some(3),
971                Self::DeleteBuildApiFailed => std::option::Option::Some(5),
972                Self::DeleteBuildRunFailed => std::option::Option::Some(6),
973                Self::BucketCreationPermissionDenied => std::option::Option::Some(7),
974                Self::BucketCreationFailed => std::option::Option::Some(8),
975                Self::UnknownValue(u) => u.0.value(),
976            }
977        }
978
979        /// Gets the enum value as a string.
980        ///
981        /// Returns `None` if the enum contains an unknown value deserialized from
982        /// the integer representation of enums.
983        pub fn name(&self) -> std::option::Option<&str> {
984            match self {
985                Self::Unspecified => std::option::Option::Some("ERROR_CODE_UNSPECIFIED"),
986                Self::RevisionFailed => std::option::Option::Some("REVISION_FAILED"),
987                Self::CloudBuildPermissionDenied => {
988                    std::option::Option::Some("CLOUD_BUILD_PERMISSION_DENIED")
989                }
990                Self::DeleteBuildApiFailed => std::option::Option::Some("DELETE_BUILD_API_FAILED"),
991                Self::DeleteBuildRunFailed => std::option::Option::Some("DELETE_BUILD_RUN_FAILED"),
992                Self::BucketCreationPermissionDenied => {
993                    std::option::Option::Some("BUCKET_CREATION_PERMISSION_DENIED")
994                }
995                Self::BucketCreationFailed => std::option::Option::Some("BUCKET_CREATION_FAILED"),
996                Self::UnknownValue(u) => u.0.name(),
997            }
998        }
999    }
1000
1001    impl std::default::Default for ErrorCode {
1002        fn default() -> Self {
1003            use std::convert::From;
1004            Self::from(0)
1005        }
1006    }
1007
1008    impl std::fmt::Display for ErrorCode {
1009        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1010            wkt::internal::display_enum(f, self.name(), self.value())
1011        }
1012    }
1013
1014    impl std::convert::From<i32> for ErrorCode {
1015        fn from(value: i32) -> Self {
1016            match value {
1017                0 => Self::Unspecified,
1018                1 => Self::RevisionFailed,
1019                3 => Self::CloudBuildPermissionDenied,
1020                5 => Self::DeleteBuildApiFailed,
1021                6 => Self::DeleteBuildRunFailed,
1022                7 => Self::BucketCreationPermissionDenied,
1023                8 => Self::BucketCreationFailed,
1024                _ => Self::UnknownValue(error_code::UnknownValue(
1025                    wkt::internal::UnknownEnumValue::Integer(value),
1026                )),
1027            }
1028        }
1029    }
1030
1031    impl std::convert::From<&str> for ErrorCode {
1032        fn from(value: &str) -> Self {
1033            use std::string::ToString;
1034            match value {
1035                "ERROR_CODE_UNSPECIFIED" => Self::Unspecified,
1036                "REVISION_FAILED" => Self::RevisionFailed,
1037                "CLOUD_BUILD_PERMISSION_DENIED" => Self::CloudBuildPermissionDenied,
1038                "DELETE_BUILD_API_FAILED" => Self::DeleteBuildApiFailed,
1039                "DELETE_BUILD_RUN_FAILED" => Self::DeleteBuildRunFailed,
1040                "BUCKET_CREATION_PERMISSION_DENIED" => Self::BucketCreationPermissionDenied,
1041                "BUCKET_CREATION_FAILED" => Self::BucketCreationFailed,
1042                _ => Self::UnknownValue(error_code::UnknownValue(
1043                    wkt::internal::UnknownEnumValue::String(value.to_string()),
1044                )),
1045            }
1046        }
1047    }
1048
1049    impl serde::ser::Serialize for ErrorCode {
1050        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1051        where
1052            S: serde::Serializer,
1053        {
1054            match self {
1055                Self::Unspecified => serializer.serialize_i32(0),
1056                Self::RevisionFailed => serializer.serialize_i32(1),
1057                Self::CloudBuildPermissionDenied => serializer.serialize_i32(3),
1058                Self::DeleteBuildApiFailed => serializer.serialize_i32(5),
1059                Self::DeleteBuildRunFailed => serializer.serialize_i32(6),
1060                Self::BucketCreationPermissionDenied => serializer.serialize_i32(7),
1061                Self::BucketCreationFailed => serializer.serialize_i32(8),
1062                Self::UnknownValue(u) => u.0.serialize(serializer),
1063            }
1064        }
1065    }
1066
1067    impl<'de> serde::de::Deserialize<'de> for ErrorCode {
1068        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1069        where
1070            D: serde::Deserializer<'de>,
1071        {
1072            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ErrorCode>::new(
1073                ".google.cloud.config.v1.Deployment.ErrorCode",
1074            ))
1075        }
1076    }
1077
1078    /// Possible lock states of a deployment.
1079    ///
1080    /// # Working with unknown values
1081    ///
1082    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1083    /// additional enum variants at any time. Adding new variants is not considered
1084    /// a breaking change. Applications should write their code in anticipation of:
1085    ///
1086    /// - New values appearing in future releases of the client library, **and**
1087    /// - New values received dynamically, without application changes.
1088    ///
1089    /// Please consult the [Working with enums] section in the user guide for some
1090    /// guidelines.
1091    ///
1092    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
1093    #[derive(Clone, Debug, PartialEq)]
1094    #[non_exhaustive]
1095    pub enum LockState {
1096        /// The default value. This value is used if the lock state is omitted.
1097        Unspecified,
1098        /// The deployment is locked.
1099        Locked,
1100        /// The deployment is unlocked.
1101        Unlocked,
1102        /// The deployment is being locked.
1103        Locking,
1104        /// The deployment is being unlocked.
1105        Unlocking,
1106        /// The deployment has failed to lock.
1107        LockFailed,
1108        /// The deployment has failed to unlock.
1109        UnlockFailed,
1110        /// If set, the enum was initialized with an unknown value.
1111        ///
1112        /// Applications can examine the value using [LockState::value] or
1113        /// [LockState::name].
1114        UnknownValue(lock_state::UnknownValue),
1115    }
1116
1117    #[doc(hidden)]
1118    pub mod lock_state {
1119        #[allow(unused_imports)]
1120        use super::*;
1121        #[derive(Clone, Debug, PartialEq)]
1122        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1123    }
1124
1125    impl LockState {
1126        /// Gets the enum value.
1127        ///
1128        /// Returns `None` if the enum contains an unknown value deserialized from
1129        /// the string representation of enums.
1130        pub fn value(&self) -> std::option::Option<i32> {
1131            match self {
1132                Self::Unspecified => std::option::Option::Some(0),
1133                Self::Locked => std::option::Option::Some(1),
1134                Self::Unlocked => std::option::Option::Some(2),
1135                Self::Locking => std::option::Option::Some(3),
1136                Self::Unlocking => std::option::Option::Some(4),
1137                Self::LockFailed => std::option::Option::Some(5),
1138                Self::UnlockFailed => std::option::Option::Some(6),
1139                Self::UnknownValue(u) => u.0.value(),
1140            }
1141        }
1142
1143        /// Gets the enum value as a string.
1144        ///
1145        /// Returns `None` if the enum contains an unknown value deserialized from
1146        /// the integer representation of enums.
1147        pub fn name(&self) -> std::option::Option<&str> {
1148            match self {
1149                Self::Unspecified => std::option::Option::Some("LOCK_STATE_UNSPECIFIED"),
1150                Self::Locked => std::option::Option::Some("LOCKED"),
1151                Self::Unlocked => std::option::Option::Some("UNLOCKED"),
1152                Self::Locking => std::option::Option::Some("LOCKING"),
1153                Self::Unlocking => std::option::Option::Some("UNLOCKING"),
1154                Self::LockFailed => std::option::Option::Some("LOCK_FAILED"),
1155                Self::UnlockFailed => std::option::Option::Some("UNLOCK_FAILED"),
1156                Self::UnknownValue(u) => u.0.name(),
1157            }
1158        }
1159    }
1160
1161    impl std::default::Default for LockState {
1162        fn default() -> Self {
1163            use std::convert::From;
1164            Self::from(0)
1165        }
1166    }
1167
1168    impl std::fmt::Display for LockState {
1169        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1170            wkt::internal::display_enum(f, self.name(), self.value())
1171        }
1172    }
1173
1174    impl std::convert::From<i32> for LockState {
1175        fn from(value: i32) -> Self {
1176            match value {
1177                0 => Self::Unspecified,
1178                1 => Self::Locked,
1179                2 => Self::Unlocked,
1180                3 => Self::Locking,
1181                4 => Self::Unlocking,
1182                5 => Self::LockFailed,
1183                6 => Self::UnlockFailed,
1184                _ => Self::UnknownValue(lock_state::UnknownValue(
1185                    wkt::internal::UnknownEnumValue::Integer(value),
1186                )),
1187            }
1188        }
1189    }
1190
1191    impl std::convert::From<&str> for LockState {
1192        fn from(value: &str) -> Self {
1193            use std::string::ToString;
1194            match value {
1195                "LOCK_STATE_UNSPECIFIED" => Self::Unspecified,
1196                "LOCKED" => Self::Locked,
1197                "UNLOCKED" => Self::Unlocked,
1198                "LOCKING" => Self::Locking,
1199                "UNLOCKING" => Self::Unlocking,
1200                "LOCK_FAILED" => Self::LockFailed,
1201                "UNLOCK_FAILED" => Self::UnlockFailed,
1202                _ => Self::UnknownValue(lock_state::UnknownValue(
1203                    wkt::internal::UnknownEnumValue::String(value.to_string()),
1204                )),
1205            }
1206        }
1207    }
1208
1209    impl serde::ser::Serialize for LockState {
1210        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1211        where
1212            S: serde::Serializer,
1213        {
1214            match self {
1215                Self::Unspecified => serializer.serialize_i32(0),
1216                Self::Locked => serializer.serialize_i32(1),
1217                Self::Unlocked => serializer.serialize_i32(2),
1218                Self::Locking => serializer.serialize_i32(3),
1219                Self::Unlocking => serializer.serialize_i32(4),
1220                Self::LockFailed => serializer.serialize_i32(5),
1221                Self::UnlockFailed => serializer.serialize_i32(6),
1222                Self::UnknownValue(u) => u.0.serialize(serializer),
1223            }
1224        }
1225    }
1226
1227    impl<'de> serde::de::Deserialize<'de> for LockState {
1228        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1229        where
1230            D: serde::Deserializer<'de>,
1231        {
1232            deserializer.deserialize_any(wkt::internal::EnumVisitor::<LockState>::new(
1233                ".google.cloud.config.v1.Deployment.LockState",
1234            ))
1235        }
1236    }
1237
1238    /// Blueprint to deploy.
1239    #[derive(Clone, Debug, PartialEq)]
1240    #[non_exhaustive]
1241    pub enum Blueprint {
1242        /// A blueprint described using Terraform's HashiCorp Configuration Language
1243        /// as a root module.
1244        TerraformBlueprint(std::boxed::Box<crate::model::TerraformBlueprint>),
1245    }
1246}
1247
1248/// TerraformBlueprint describes the source of a Terraform root module which
1249/// describes the resources and configs to be deployed.
1250#[derive(Clone, Default, PartialEq)]
1251#[non_exhaustive]
1252pub struct TerraformBlueprint {
1253    /// Optional. Input variable values for the Terraform blueprint.
1254    pub input_values:
1255        std::collections::HashMap<std::string::String, crate::model::TerraformVariable>,
1256
1257    /// Location of the source configs.
1258    /// Required.
1259    pub source: std::option::Option<crate::model::terraform_blueprint::Source>,
1260
1261    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1262}
1263
1264impl TerraformBlueprint {
1265    pub fn new() -> Self {
1266        std::default::Default::default()
1267    }
1268
1269    /// Sets the value of [input_values][crate::model::TerraformBlueprint::input_values].
1270    ///
1271    /// # Example
1272    /// ```ignore,no_run
1273    /// # use google_cloud_config_v1::model::TerraformBlueprint;
1274    /// use google_cloud_config_v1::model::TerraformVariable;
1275    /// let x = TerraformBlueprint::new().set_input_values([
1276    ///     ("key0", TerraformVariable::default()/* use setters */),
1277    ///     ("key1", TerraformVariable::default()/* use (different) setters */),
1278    /// ]);
1279    /// ```
1280    pub fn set_input_values<T, K, V>(mut self, v: T) -> Self
1281    where
1282        T: std::iter::IntoIterator<Item = (K, V)>,
1283        K: std::convert::Into<std::string::String>,
1284        V: std::convert::Into<crate::model::TerraformVariable>,
1285    {
1286        use std::iter::Iterator;
1287        self.input_values = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1288        self
1289    }
1290
1291    /// Sets the value of [source][crate::model::TerraformBlueprint::source].
1292    ///
1293    /// Note that all the setters affecting `source` are mutually
1294    /// exclusive.
1295    ///
1296    /// # Example
1297    /// ```ignore,no_run
1298    /// # use google_cloud_config_v1::model::TerraformBlueprint;
1299    /// use google_cloud_config_v1::model::terraform_blueprint::Source;
1300    /// let x = TerraformBlueprint::new().set_source(Some(Source::GcsSource("example".to_string())));
1301    /// ```
1302    pub fn set_source<
1303        T: std::convert::Into<std::option::Option<crate::model::terraform_blueprint::Source>>,
1304    >(
1305        mut self,
1306        v: T,
1307    ) -> Self {
1308        self.source = v.into();
1309        self
1310    }
1311
1312    /// The value of [source][crate::model::TerraformBlueprint::source]
1313    /// if it holds a `GcsSource`, `None` if the field is not set or
1314    /// holds a different branch.
1315    pub fn gcs_source(&self) -> std::option::Option<&std::string::String> {
1316        #[allow(unreachable_patterns)]
1317        self.source.as_ref().and_then(|v| match v {
1318            crate::model::terraform_blueprint::Source::GcsSource(v) => std::option::Option::Some(v),
1319            _ => std::option::Option::None,
1320        })
1321    }
1322
1323    /// Sets the value of [source][crate::model::TerraformBlueprint::source]
1324    /// to hold a `GcsSource`.
1325    ///
1326    /// Note that all the setters affecting `source` are
1327    /// mutually exclusive.
1328    ///
1329    /// # Example
1330    /// ```ignore,no_run
1331    /// # use google_cloud_config_v1::model::TerraformBlueprint;
1332    /// let x = TerraformBlueprint::new().set_gcs_source("example");
1333    /// assert!(x.gcs_source().is_some());
1334    /// assert!(x.git_source().is_none());
1335    /// ```
1336    pub fn set_gcs_source<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1337        self.source = std::option::Option::Some(
1338            crate::model::terraform_blueprint::Source::GcsSource(v.into()),
1339        );
1340        self
1341    }
1342
1343    /// The value of [source][crate::model::TerraformBlueprint::source]
1344    /// if it holds a `GitSource`, `None` if the field is not set or
1345    /// holds a different branch.
1346    pub fn git_source(&self) -> std::option::Option<&std::boxed::Box<crate::model::GitSource>> {
1347        #[allow(unreachable_patterns)]
1348        self.source.as_ref().and_then(|v| match v {
1349            crate::model::terraform_blueprint::Source::GitSource(v) => std::option::Option::Some(v),
1350            _ => std::option::Option::None,
1351        })
1352    }
1353
1354    /// Sets the value of [source][crate::model::TerraformBlueprint::source]
1355    /// to hold a `GitSource`.
1356    ///
1357    /// Note that all the setters affecting `source` are
1358    /// mutually exclusive.
1359    ///
1360    /// # Example
1361    /// ```ignore,no_run
1362    /// # use google_cloud_config_v1::model::TerraformBlueprint;
1363    /// use google_cloud_config_v1::model::GitSource;
1364    /// let x = TerraformBlueprint::new().set_git_source(GitSource::default()/* use setters */);
1365    /// assert!(x.git_source().is_some());
1366    /// assert!(x.gcs_source().is_none());
1367    /// ```
1368    pub fn set_git_source<T: std::convert::Into<std::boxed::Box<crate::model::GitSource>>>(
1369        mut self,
1370        v: T,
1371    ) -> Self {
1372        self.source = std::option::Option::Some(
1373            crate::model::terraform_blueprint::Source::GitSource(v.into()),
1374        );
1375        self
1376    }
1377}
1378
1379impl wkt::message::Message for TerraformBlueprint {
1380    fn typename() -> &'static str {
1381        "type.googleapis.com/google.cloud.config.v1.TerraformBlueprint"
1382    }
1383}
1384
1385/// Defines additional types related to [TerraformBlueprint].
1386pub mod terraform_blueprint {
1387    #[allow(unused_imports)]
1388    use super::*;
1389
1390    /// Location of the source configs.
1391    /// Required.
1392    #[derive(Clone, Debug, PartialEq)]
1393    #[non_exhaustive]
1394    pub enum Source {
1395        /// URI of an object in Google Cloud Storage.
1396        /// Format: `gs://{bucket}/{object}`
1397        ///
1398        /// URI may also specify an object version for zipped objects.
1399        /// Format: `gs://{bucket}/{object}#{version}`
1400        GcsSource(std::string::String),
1401        /// URI of a public Git repo.
1402        GitSource(std::boxed::Box<crate::model::GitSource>),
1403    }
1404}
1405
1406/// A Terraform input variable.
1407#[derive(Clone, Default, PartialEq)]
1408#[non_exhaustive]
1409pub struct TerraformVariable {
1410    /// Optional. Input variable value.
1411    pub input_value: std::option::Option<wkt::Value>,
1412
1413    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1414}
1415
1416impl TerraformVariable {
1417    pub fn new() -> Self {
1418        std::default::Default::default()
1419    }
1420
1421    /// Sets the value of [input_value][crate::model::TerraformVariable::input_value].
1422    ///
1423    /// # Example
1424    /// ```ignore,no_run
1425    /// # use google_cloud_config_v1::model::TerraformVariable;
1426    /// use wkt::Value;
1427    /// let x = TerraformVariable::new().set_input_value(Value::default()/* use setters */);
1428    /// ```
1429    pub fn set_input_value<T>(mut self, v: T) -> Self
1430    where
1431        T: std::convert::Into<wkt::Value>,
1432    {
1433        self.input_value = std::option::Option::Some(v.into());
1434        self
1435    }
1436
1437    /// Sets or clears the value of [input_value][crate::model::TerraformVariable::input_value].
1438    ///
1439    /// # Example
1440    /// ```ignore,no_run
1441    /// # use google_cloud_config_v1::model::TerraformVariable;
1442    /// use wkt::Value;
1443    /// let x = TerraformVariable::new().set_or_clear_input_value(Some(Value::default()/* use setters */));
1444    /// let x = TerraformVariable::new().set_or_clear_input_value(None::<Value>);
1445    /// ```
1446    pub fn set_or_clear_input_value<T>(mut self, v: std::option::Option<T>) -> Self
1447    where
1448        T: std::convert::Into<wkt::Value>,
1449    {
1450        self.input_value = v.map(|x| x.into());
1451        self
1452    }
1453}
1454
1455impl wkt::message::Message for TerraformVariable {
1456    fn typename() -> &'static str {
1457        "type.googleapis.com/google.cloud.config.v1.TerraformVariable"
1458    }
1459}
1460
1461/// Outputs and artifacts from applying a deployment.
1462#[derive(Clone, Default, PartialEq)]
1463#[non_exhaustive]
1464pub struct ApplyResults {
1465    /// Location of a blueprint copy and other manifests in Google Cloud Storage.
1466    /// Format: `gs://{bucket}/{object}`
1467    pub content: std::string::String,
1468
1469    /// Location of artifacts (e.g. logs) in Google Cloud Storage.
1470    /// Format: `gs://{bucket}/{object}`
1471    pub artifacts: std::string::String,
1472
1473    /// Map of output name to output info.
1474    pub outputs: std::collections::HashMap<std::string::String, crate::model::TerraformOutput>,
1475
1476    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1477}
1478
1479impl ApplyResults {
1480    pub fn new() -> Self {
1481        std::default::Default::default()
1482    }
1483
1484    /// Sets the value of [content][crate::model::ApplyResults::content].
1485    ///
1486    /// # Example
1487    /// ```ignore,no_run
1488    /// # use google_cloud_config_v1::model::ApplyResults;
1489    /// let x = ApplyResults::new().set_content("example");
1490    /// ```
1491    pub fn set_content<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1492        self.content = v.into();
1493        self
1494    }
1495
1496    /// Sets the value of [artifacts][crate::model::ApplyResults::artifacts].
1497    ///
1498    /// # Example
1499    /// ```ignore,no_run
1500    /// # use google_cloud_config_v1::model::ApplyResults;
1501    /// let x = ApplyResults::new().set_artifacts("example");
1502    /// ```
1503    pub fn set_artifacts<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1504        self.artifacts = v.into();
1505        self
1506    }
1507
1508    /// Sets the value of [outputs][crate::model::ApplyResults::outputs].
1509    ///
1510    /// # Example
1511    /// ```ignore,no_run
1512    /// # use google_cloud_config_v1::model::ApplyResults;
1513    /// use google_cloud_config_v1::model::TerraformOutput;
1514    /// let x = ApplyResults::new().set_outputs([
1515    ///     ("key0", TerraformOutput::default()/* use setters */),
1516    ///     ("key1", TerraformOutput::default()/* use (different) setters */),
1517    /// ]);
1518    /// ```
1519    pub fn set_outputs<T, K, V>(mut self, v: T) -> Self
1520    where
1521        T: std::iter::IntoIterator<Item = (K, V)>,
1522        K: std::convert::Into<std::string::String>,
1523        V: std::convert::Into<crate::model::TerraformOutput>,
1524    {
1525        use std::iter::Iterator;
1526        self.outputs = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1527        self
1528    }
1529}
1530
1531impl wkt::message::Message for ApplyResults {
1532    fn typename() -> &'static str {
1533        "type.googleapis.com/google.cloud.config.v1.ApplyResults"
1534    }
1535}
1536
1537/// Describes a Terraform output.
1538#[derive(Clone, Default, PartialEq)]
1539#[non_exhaustive]
1540pub struct TerraformOutput {
1541    /// Identifies whether Terraform has set this output as a potential
1542    /// sensitive value.
1543    pub sensitive: bool,
1544
1545    /// Value of output.
1546    pub value: std::option::Option<wkt::Value>,
1547
1548    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1549}
1550
1551impl TerraformOutput {
1552    pub fn new() -> Self {
1553        std::default::Default::default()
1554    }
1555
1556    /// Sets the value of [sensitive][crate::model::TerraformOutput::sensitive].
1557    ///
1558    /// # Example
1559    /// ```ignore,no_run
1560    /// # use google_cloud_config_v1::model::TerraformOutput;
1561    /// let x = TerraformOutput::new().set_sensitive(true);
1562    /// ```
1563    pub fn set_sensitive<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1564        self.sensitive = v.into();
1565        self
1566    }
1567
1568    /// Sets the value of [value][crate::model::TerraformOutput::value].
1569    ///
1570    /// # Example
1571    /// ```ignore,no_run
1572    /// # use google_cloud_config_v1::model::TerraformOutput;
1573    /// use wkt::Value;
1574    /// let x = TerraformOutput::new().set_value(Value::default()/* use setters */);
1575    /// ```
1576    pub fn set_value<T>(mut self, v: T) -> Self
1577    where
1578        T: std::convert::Into<wkt::Value>,
1579    {
1580        self.value = std::option::Option::Some(v.into());
1581        self
1582    }
1583
1584    /// Sets or clears the value of [value][crate::model::TerraformOutput::value].
1585    ///
1586    /// # Example
1587    /// ```ignore,no_run
1588    /// # use google_cloud_config_v1::model::TerraformOutput;
1589    /// use wkt::Value;
1590    /// let x = TerraformOutput::new().set_or_clear_value(Some(Value::default()/* use setters */));
1591    /// let x = TerraformOutput::new().set_or_clear_value(None::<Value>);
1592    /// ```
1593    pub fn set_or_clear_value<T>(mut self, v: std::option::Option<T>) -> Self
1594    where
1595        T: std::convert::Into<wkt::Value>,
1596    {
1597        self.value = v.map(|x| x.into());
1598        self
1599    }
1600}
1601
1602impl wkt::message::Message for TerraformOutput {
1603    fn typename() -> &'static str {
1604        "type.googleapis.com/google.cloud.config.v1.TerraformOutput"
1605    }
1606}
1607
1608#[derive(Clone, Default, PartialEq)]
1609#[non_exhaustive]
1610pub struct ListDeploymentsRequest {
1611    /// Required. The parent in whose context the Deployments are listed. The
1612    /// parent value is in the format:
1613    /// 'projects/{project_id}/locations/{location}'.
1614    pub parent: std::string::String,
1615
1616    /// When requesting a page of resources, 'page_size' specifies number of
1617    /// resources to return. If unspecified, at most 500 will be returned. The
1618    /// maximum value is 1000.
1619    pub page_size: i32,
1620
1621    /// Token returned by previous call to 'ListDeployments' which specifies the
1622    /// position in the list from where to continue listing the resources.
1623    pub page_token: std::string::String,
1624
1625    /// Lists the Deployments that match the filter expression. A filter
1626    /// expression filters the resources listed in the response. The expression
1627    /// must be of the form '{field} {operator} {value}' where operators: '<', '>',
1628    /// '<=', '>=', '!=', '=', ':' are supported (colon ':' represents a HAS
1629    /// operator which is roughly synonymous with equality). {field} can refer to a
1630    /// proto or JSON field, or a synthetic field. Field names can be camelCase or
1631    /// snake_case.
1632    ///
1633    /// Examples:
1634    ///
1635    /// - Filter by name:
1636    ///   name = "projects/foo/locations/us-central1/deployments/bar
1637    ///
1638    /// - Filter by labels:
1639    ///
1640    ///   - Resources that have a key called 'foo'
1641    ///     labels.foo:*
1642    ///   - Resources that have a key called 'foo' whose value is 'bar'
1643    ///     labels.foo = bar
1644    /// - Filter by state:
1645    ///
1646    ///   - Deployments in CREATING state.
1647    ///     state=CREATING
1648    pub filter: std::string::String,
1649
1650    /// Field to use to sort the list.
1651    pub order_by: std::string::String,
1652
1653    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1654}
1655
1656impl ListDeploymentsRequest {
1657    pub fn new() -> Self {
1658        std::default::Default::default()
1659    }
1660
1661    /// Sets the value of [parent][crate::model::ListDeploymentsRequest::parent].
1662    ///
1663    /// # Example
1664    /// ```ignore,no_run
1665    /// # use google_cloud_config_v1::model::ListDeploymentsRequest;
1666    /// let x = ListDeploymentsRequest::new().set_parent("example");
1667    /// ```
1668    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1669        self.parent = v.into();
1670        self
1671    }
1672
1673    /// Sets the value of [page_size][crate::model::ListDeploymentsRequest::page_size].
1674    ///
1675    /// # Example
1676    /// ```ignore,no_run
1677    /// # use google_cloud_config_v1::model::ListDeploymentsRequest;
1678    /// let x = ListDeploymentsRequest::new().set_page_size(42);
1679    /// ```
1680    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1681        self.page_size = v.into();
1682        self
1683    }
1684
1685    /// Sets the value of [page_token][crate::model::ListDeploymentsRequest::page_token].
1686    ///
1687    /// # Example
1688    /// ```ignore,no_run
1689    /// # use google_cloud_config_v1::model::ListDeploymentsRequest;
1690    /// let x = ListDeploymentsRequest::new().set_page_token("example");
1691    /// ```
1692    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1693        self.page_token = v.into();
1694        self
1695    }
1696
1697    /// Sets the value of [filter][crate::model::ListDeploymentsRequest::filter].
1698    ///
1699    /// # Example
1700    /// ```ignore,no_run
1701    /// # use google_cloud_config_v1::model::ListDeploymentsRequest;
1702    /// let x = ListDeploymentsRequest::new().set_filter("example");
1703    /// ```
1704    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1705        self.filter = v.into();
1706        self
1707    }
1708
1709    /// Sets the value of [order_by][crate::model::ListDeploymentsRequest::order_by].
1710    ///
1711    /// # Example
1712    /// ```ignore,no_run
1713    /// # use google_cloud_config_v1::model::ListDeploymentsRequest;
1714    /// let x = ListDeploymentsRequest::new().set_order_by("example");
1715    /// ```
1716    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1717        self.order_by = v.into();
1718        self
1719    }
1720}
1721
1722impl wkt::message::Message for ListDeploymentsRequest {
1723    fn typename() -> &'static str {
1724        "type.googleapis.com/google.cloud.config.v1.ListDeploymentsRequest"
1725    }
1726}
1727
1728#[derive(Clone, Default, PartialEq)]
1729#[non_exhaustive]
1730pub struct ListDeploymentsResponse {
1731    /// List of [Deployment][google.cloud.config.v1.Deployment]s.
1732    ///
1733    /// [google.cloud.config.v1.Deployment]: crate::model::Deployment
1734    pub deployments: std::vec::Vec<crate::model::Deployment>,
1735
1736    /// Token to be supplied to the next ListDeployments request via `page_token`
1737    /// to obtain the next set of results.
1738    pub next_page_token: std::string::String,
1739
1740    /// Locations that could not be reached.
1741    pub unreachable: std::vec::Vec<std::string::String>,
1742
1743    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1744}
1745
1746impl ListDeploymentsResponse {
1747    pub fn new() -> Self {
1748        std::default::Default::default()
1749    }
1750
1751    /// Sets the value of [deployments][crate::model::ListDeploymentsResponse::deployments].
1752    ///
1753    /// # Example
1754    /// ```ignore,no_run
1755    /// # use google_cloud_config_v1::model::ListDeploymentsResponse;
1756    /// use google_cloud_config_v1::model::Deployment;
1757    /// let x = ListDeploymentsResponse::new()
1758    ///     .set_deployments([
1759    ///         Deployment::default()/* use setters */,
1760    ///         Deployment::default()/* use (different) setters */,
1761    ///     ]);
1762    /// ```
1763    pub fn set_deployments<T, V>(mut self, v: T) -> Self
1764    where
1765        T: std::iter::IntoIterator<Item = V>,
1766        V: std::convert::Into<crate::model::Deployment>,
1767    {
1768        use std::iter::Iterator;
1769        self.deployments = v.into_iter().map(|i| i.into()).collect();
1770        self
1771    }
1772
1773    /// Sets the value of [next_page_token][crate::model::ListDeploymentsResponse::next_page_token].
1774    ///
1775    /// # Example
1776    /// ```ignore,no_run
1777    /// # use google_cloud_config_v1::model::ListDeploymentsResponse;
1778    /// let x = ListDeploymentsResponse::new().set_next_page_token("example");
1779    /// ```
1780    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1781        self.next_page_token = v.into();
1782        self
1783    }
1784
1785    /// Sets the value of [unreachable][crate::model::ListDeploymentsResponse::unreachable].
1786    ///
1787    /// # Example
1788    /// ```ignore,no_run
1789    /// # use google_cloud_config_v1::model::ListDeploymentsResponse;
1790    /// let x = ListDeploymentsResponse::new().set_unreachable(["a", "b", "c"]);
1791    /// ```
1792    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
1793    where
1794        T: std::iter::IntoIterator<Item = V>,
1795        V: std::convert::Into<std::string::String>,
1796    {
1797        use std::iter::Iterator;
1798        self.unreachable = v.into_iter().map(|i| i.into()).collect();
1799        self
1800    }
1801}
1802
1803impl wkt::message::Message for ListDeploymentsResponse {
1804    fn typename() -> &'static str {
1805        "type.googleapis.com/google.cloud.config.v1.ListDeploymentsResponse"
1806    }
1807}
1808
1809#[doc(hidden)]
1810impl gax::paginator::internal::PageableResponse for ListDeploymentsResponse {
1811    type PageItem = crate::model::Deployment;
1812
1813    fn items(self) -> std::vec::Vec<Self::PageItem> {
1814        self.deployments
1815    }
1816
1817    fn next_page_token(&self) -> std::string::String {
1818        use std::clone::Clone;
1819        self.next_page_token.clone()
1820    }
1821}
1822
1823#[derive(Clone, Default, PartialEq)]
1824#[non_exhaustive]
1825pub struct GetDeploymentRequest {
1826    /// Required. The name of the deployment. Format:
1827    /// 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
1828    pub name: std::string::String,
1829
1830    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1831}
1832
1833impl GetDeploymentRequest {
1834    pub fn new() -> Self {
1835        std::default::Default::default()
1836    }
1837
1838    /// Sets the value of [name][crate::model::GetDeploymentRequest::name].
1839    ///
1840    /// # Example
1841    /// ```ignore,no_run
1842    /// # use google_cloud_config_v1::model::GetDeploymentRequest;
1843    /// let x = GetDeploymentRequest::new().set_name("example");
1844    /// ```
1845    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1846        self.name = v.into();
1847        self
1848    }
1849}
1850
1851impl wkt::message::Message for GetDeploymentRequest {
1852    fn typename() -> &'static str {
1853        "type.googleapis.com/google.cloud.config.v1.GetDeploymentRequest"
1854    }
1855}
1856
1857/// A request to list Revisions passed to a 'ListRevisions' call.
1858#[derive(Clone, Default, PartialEq)]
1859#[non_exhaustive]
1860pub struct ListRevisionsRequest {
1861    /// Required. The parent in whose context the Revisions are listed. The parent
1862    /// value is in the format:
1863    /// 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
1864    pub parent: std::string::String,
1865
1866    /// When requesting a page of resources, `page_size` specifies number of
1867    /// resources to return. If unspecified, at most 500 will be returned. The
1868    /// maximum value is 1000.
1869    pub page_size: i32,
1870
1871    /// Token returned by previous call to 'ListRevisions' which specifies the
1872    /// position in the list from where to continue listing the resources.
1873    pub page_token: std::string::String,
1874
1875    /// Lists the Revisions that match the filter expression. A filter
1876    /// expression filters the resources listed in the response. The expression
1877    /// must be of the form '{field} {operator} {value}' where operators: '<', '>',
1878    /// '<=', '>=', '!=', '=', ':' are supported (colon ':' represents a HAS
1879    /// operator which is roughly synonymous with equality). {field} can refer to a
1880    /// proto or JSON field, or a synthetic field. Field names can be camelCase or
1881    /// snake_case.
1882    ///
1883    /// Examples:
1884    ///
1885    /// - Filter by name:
1886    ///   name = "projects/foo/locations/us-central1/deployments/dep/revisions/bar
1887    ///
1888    /// - Filter by labels:
1889    ///
1890    ///   - Resources that have a key called 'foo'
1891    ///     labels.foo:*
1892    ///   - Resources that have a key called 'foo' whose value is 'bar'
1893    ///     labels.foo = bar
1894    /// - Filter by state:
1895    ///
1896    ///   - Revisions in CREATING state.
1897    ///     state=CREATING
1898    pub filter: std::string::String,
1899
1900    /// Field to use to sort the list.
1901    pub order_by: std::string::String,
1902
1903    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1904}
1905
1906impl ListRevisionsRequest {
1907    pub fn new() -> Self {
1908        std::default::Default::default()
1909    }
1910
1911    /// Sets the value of [parent][crate::model::ListRevisionsRequest::parent].
1912    ///
1913    /// # Example
1914    /// ```ignore,no_run
1915    /// # use google_cloud_config_v1::model::ListRevisionsRequest;
1916    /// let x = ListRevisionsRequest::new().set_parent("example");
1917    /// ```
1918    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1919        self.parent = v.into();
1920        self
1921    }
1922
1923    /// Sets the value of [page_size][crate::model::ListRevisionsRequest::page_size].
1924    ///
1925    /// # Example
1926    /// ```ignore,no_run
1927    /// # use google_cloud_config_v1::model::ListRevisionsRequest;
1928    /// let x = ListRevisionsRequest::new().set_page_size(42);
1929    /// ```
1930    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1931        self.page_size = v.into();
1932        self
1933    }
1934
1935    /// Sets the value of [page_token][crate::model::ListRevisionsRequest::page_token].
1936    ///
1937    /// # Example
1938    /// ```ignore,no_run
1939    /// # use google_cloud_config_v1::model::ListRevisionsRequest;
1940    /// let x = ListRevisionsRequest::new().set_page_token("example");
1941    /// ```
1942    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1943        self.page_token = v.into();
1944        self
1945    }
1946
1947    /// Sets the value of [filter][crate::model::ListRevisionsRequest::filter].
1948    ///
1949    /// # Example
1950    /// ```ignore,no_run
1951    /// # use google_cloud_config_v1::model::ListRevisionsRequest;
1952    /// let x = ListRevisionsRequest::new().set_filter("example");
1953    /// ```
1954    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1955        self.filter = v.into();
1956        self
1957    }
1958
1959    /// Sets the value of [order_by][crate::model::ListRevisionsRequest::order_by].
1960    ///
1961    /// # Example
1962    /// ```ignore,no_run
1963    /// # use google_cloud_config_v1::model::ListRevisionsRequest;
1964    /// let x = ListRevisionsRequest::new().set_order_by("example");
1965    /// ```
1966    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1967        self.order_by = v.into();
1968        self
1969    }
1970}
1971
1972impl wkt::message::Message for ListRevisionsRequest {
1973    fn typename() -> &'static str {
1974        "type.googleapis.com/google.cloud.config.v1.ListRevisionsRequest"
1975    }
1976}
1977
1978/// A response to a 'ListRevisions' call. Contains a list of Revisions.
1979#[derive(Clone, Default, PartialEq)]
1980#[non_exhaustive]
1981pub struct ListRevisionsResponse {
1982    /// List of [Revision][google.cloud.config.v1.Revision]s.
1983    ///
1984    /// [google.cloud.config.v1.Revision]: crate::model::Revision
1985    pub revisions: std::vec::Vec<crate::model::Revision>,
1986
1987    /// A token to request the next page of resources from the 'ListRevisions'
1988    /// method. The value of an empty string means that there are no more resources
1989    /// to return.
1990    pub next_page_token: std::string::String,
1991
1992    /// Locations that could not be reached.
1993    pub unreachable: std::vec::Vec<std::string::String>,
1994
1995    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1996}
1997
1998impl ListRevisionsResponse {
1999    pub fn new() -> Self {
2000        std::default::Default::default()
2001    }
2002
2003    /// Sets the value of [revisions][crate::model::ListRevisionsResponse::revisions].
2004    ///
2005    /// # Example
2006    /// ```ignore,no_run
2007    /// # use google_cloud_config_v1::model::ListRevisionsResponse;
2008    /// use google_cloud_config_v1::model::Revision;
2009    /// let x = ListRevisionsResponse::new()
2010    ///     .set_revisions([
2011    ///         Revision::default()/* use setters */,
2012    ///         Revision::default()/* use (different) setters */,
2013    ///     ]);
2014    /// ```
2015    pub fn set_revisions<T, V>(mut self, v: T) -> Self
2016    where
2017        T: std::iter::IntoIterator<Item = V>,
2018        V: std::convert::Into<crate::model::Revision>,
2019    {
2020        use std::iter::Iterator;
2021        self.revisions = v.into_iter().map(|i| i.into()).collect();
2022        self
2023    }
2024
2025    /// Sets the value of [next_page_token][crate::model::ListRevisionsResponse::next_page_token].
2026    ///
2027    /// # Example
2028    /// ```ignore,no_run
2029    /// # use google_cloud_config_v1::model::ListRevisionsResponse;
2030    /// let x = ListRevisionsResponse::new().set_next_page_token("example");
2031    /// ```
2032    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2033        self.next_page_token = v.into();
2034        self
2035    }
2036
2037    /// Sets the value of [unreachable][crate::model::ListRevisionsResponse::unreachable].
2038    ///
2039    /// # Example
2040    /// ```ignore,no_run
2041    /// # use google_cloud_config_v1::model::ListRevisionsResponse;
2042    /// let x = ListRevisionsResponse::new().set_unreachable(["a", "b", "c"]);
2043    /// ```
2044    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
2045    where
2046        T: std::iter::IntoIterator<Item = V>,
2047        V: std::convert::Into<std::string::String>,
2048    {
2049        use std::iter::Iterator;
2050        self.unreachable = v.into_iter().map(|i| i.into()).collect();
2051        self
2052    }
2053}
2054
2055impl wkt::message::Message for ListRevisionsResponse {
2056    fn typename() -> &'static str {
2057        "type.googleapis.com/google.cloud.config.v1.ListRevisionsResponse"
2058    }
2059}
2060
2061#[doc(hidden)]
2062impl gax::paginator::internal::PageableResponse for ListRevisionsResponse {
2063    type PageItem = crate::model::Revision;
2064
2065    fn items(self) -> std::vec::Vec<Self::PageItem> {
2066        self.revisions
2067    }
2068
2069    fn next_page_token(&self) -> std::string::String {
2070        use std::clone::Clone;
2071        self.next_page_token.clone()
2072    }
2073}
2074
2075/// A request to get a Revision from a 'GetRevision' call.
2076#[derive(Clone, Default, PartialEq)]
2077#[non_exhaustive]
2078pub struct GetRevisionRequest {
2079    /// Required. The name of the Revision in the format:
2080    /// 'projects/{project_id}/locations/{location}/deployments/{deployment}/revisions/{revision}'.
2081    pub name: std::string::String,
2082
2083    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2084}
2085
2086impl GetRevisionRequest {
2087    pub fn new() -> Self {
2088        std::default::Default::default()
2089    }
2090
2091    /// Sets the value of [name][crate::model::GetRevisionRequest::name].
2092    ///
2093    /// # Example
2094    /// ```ignore,no_run
2095    /// # use google_cloud_config_v1::model::GetRevisionRequest;
2096    /// let x = GetRevisionRequest::new().set_name("example");
2097    /// ```
2098    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2099        self.name = v.into();
2100        self
2101    }
2102}
2103
2104impl wkt::message::Message for GetRevisionRequest {
2105    fn typename() -> &'static str {
2106        "type.googleapis.com/google.cloud.config.v1.GetRevisionRequest"
2107    }
2108}
2109
2110#[derive(Clone, Default, PartialEq)]
2111#[non_exhaustive]
2112pub struct CreateDeploymentRequest {
2113    /// Required. The parent in whose context the Deployment is created. The parent
2114    /// value is in the format: 'projects/{project_id}/locations/{location}'.
2115    pub parent: std::string::String,
2116
2117    /// Required. The Deployment ID.
2118    pub deployment_id: std::string::String,
2119
2120    /// Required. [Deployment][google.cloud.config.v1.Deployment] resource to be
2121    /// created.
2122    ///
2123    /// [google.cloud.config.v1.Deployment]: crate::model::Deployment
2124    pub deployment: std::option::Option<crate::model::Deployment>,
2125
2126    /// Optional. An optional request ID to identify requests. Specify a unique
2127    /// request ID so that if you must retry your request, the server will know to
2128    /// ignore the request if it has already been completed. The server will
2129    /// guarantee that for at least 60 minutes since the first request.
2130    ///
2131    /// For example, consider a situation where you make an initial request and the
2132    /// request times out. If you make the request again with the same request ID,
2133    /// the server can check if original operation with the same request ID was
2134    /// received, and if so, will ignore the second request. This prevents clients
2135    /// from accidentally creating duplicate commitments.
2136    ///
2137    /// The request ID must be a valid UUID with the exception that zero UUID is
2138    /// not supported (00000000-0000-0000-0000-000000000000).
2139    pub request_id: std::string::String,
2140
2141    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2142}
2143
2144impl CreateDeploymentRequest {
2145    pub fn new() -> Self {
2146        std::default::Default::default()
2147    }
2148
2149    /// Sets the value of [parent][crate::model::CreateDeploymentRequest::parent].
2150    ///
2151    /// # Example
2152    /// ```ignore,no_run
2153    /// # use google_cloud_config_v1::model::CreateDeploymentRequest;
2154    /// let x = CreateDeploymentRequest::new().set_parent("example");
2155    /// ```
2156    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2157        self.parent = v.into();
2158        self
2159    }
2160
2161    /// Sets the value of [deployment_id][crate::model::CreateDeploymentRequest::deployment_id].
2162    ///
2163    /// # Example
2164    /// ```ignore,no_run
2165    /// # use google_cloud_config_v1::model::CreateDeploymentRequest;
2166    /// let x = CreateDeploymentRequest::new().set_deployment_id("example");
2167    /// ```
2168    pub fn set_deployment_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2169        self.deployment_id = v.into();
2170        self
2171    }
2172
2173    /// Sets the value of [deployment][crate::model::CreateDeploymentRequest::deployment].
2174    ///
2175    /// # Example
2176    /// ```ignore,no_run
2177    /// # use google_cloud_config_v1::model::CreateDeploymentRequest;
2178    /// use google_cloud_config_v1::model::Deployment;
2179    /// let x = CreateDeploymentRequest::new().set_deployment(Deployment::default()/* use setters */);
2180    /// ```
2181    pub fn set_deployment<T>(mut self, v: T) -> Self
2182    where
2183        T: std::convert::Into<crate::model::Deployment>,
2184    {
2185        self.deployment = std::option::Option::Some(v.into());
2186        self
2187    }
2188
2189    /// Sets or clears the value of [deployment][crate::model::CreateDeploymentRequest::deployment].
2190    ///
2191    /// # Example
2192    /// ```ignore,no_run
2193    /// # use google_cloud_config_v1::model::CreateDeploymentRequest;
2194    /// use google_cloud_config_v1::model::Deployment;
2195    /// let x = CreateDeploymentRequest::new().set_or_clear_deployment(Some(Deployment::default()/* use setters */));
2196    /// let x = CreateDeploymentRequest::new().set_or_clear_deployment(None::<Deployment>);
2197    /// ```
2198    pub fn set_or_clear_deployment<T>(mut self, v: std::option::Option<T>) -> Self
2199    where
2200        T: std::convert::Into<crate::model::Deployment>,
2201    {
2202        self.deployment = v.map(|x| x.into());
2203        self
2204    }
2205
2206    /// Sets the value of [request_id][crate::model::CreateDeploymentRequest::request_id].
2207    ///
2208    /// # Example
2209    /// ```ignore,no_run
2210    /// # use google_cloud_config_v1::model::CreateDeploymentRequest;
2211    /// let x = CreateDeploymentRequest::new().set_request_id("example");
2212    /// ```
2213    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2214        self.request_id = v.into();
2215        self
2216    }
2217}
2218
2219impl wkt::message::Message for CreateDeploymentRequest {
2220    fn typename() -> &'static str {
2221        "type.googleapis.com/google.cloud.config.v1.CreateDeploymentRequest"
2222    }
2223}
2224
2225#[derive(Clone, Default, PartialEq)]
2226#[non_exhaustive]
2227pub struct UpdateDeploymentRequest {
2228    /// Optional. Field mask used to specify the fields to be overwritten in the
2229    /// Deployment resource by the update.
2230    ///
2231    /// The fields specified in the update_mask are relative to the resource, not
2232    /// the full request. A field will be overwritten if it is in the mask. If the
2233    /// user does not provide a mask then all fields will be overwritten.
2234    pub update_mask: std::option::Option<wkt::FieldMask>,
2235
2236    /// Required. [Deployment][google.cloud.config.v1.Deployment] to update.
2237    ///
2238    /// The deployment's `name` field is used to identify the resource to be
2239    /// updated. Format:
2240    /// `projects/{project}/locations/{location}/deployments/{deployment}`
2241    ///
2242    /// [google.cloud.config.v1.Deployment]: crate::model::Deployment
2243    pub deployment: std::option::Option<crate::model::Deployment>,
2244
2245    /// Optional. An optional request ID to identify requests. Specify a unique
2246    /// request ID so that if you must retry your request, the server will know to
2247    /// ignore the request if it has already been completed. The server will
2248    /// guarantee that for at least 60 minutes since the first request.
2249    ///
2250    /// For example, consider a situation where you make an initial request and the
2251    /// request times out. If you make the request again with the same request ID,
2252    /// the server can check if original operation with the same request ID was
2253    /// received, and if so, will ignore the second request. This prevents clients
2254    /// from accidentally creating duplicate commitments.
2255    ///
2256    /// The request ID must be a valid UUID with the exception that zero UUID is
2257    /// not supported (00000000-0000-0000-0000-000000000000).
2258    pub request_id: std::string::String,
2259
2260    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2261}
2262
2263impl UpdateDeploymentRequest {
2264    pub fn new() -> Self {
2265        std::default::Default::default()
2266    }
2267
2268    /// Sets the value of [update_mask][crate::model::UpdateDeploymentRequest::update_mask].
2269    ///
2270    /// # Example
2271    /// ```ignore,no_run
2272    /// # use google_cloud_config_v1::model::UpdateDeploymentRequest;
2273    /// use wkt::FieldMask;
2274    /// let x = UpdateDeploymentRequest::new().set_update_mask(FieldMask::default()/* use setters */);
2275    /// ```
2276    pub fn set_update_mask<T>(mut self, v: T) -> Self
2277    where
2278        T: std::convert::Into<wkt::FieldMask>,
2279    {
2280        self.update_mask = std::option::Option::Some(v.into());
2281        self
2282    }
2283
2284    /// Sets or clears the value of [update_mask][crate::model::UpdateDeploymentRequest::update_mask].
2285    ///
2286    /// # Example
2287    /// ```ignore,no_run
2288    /// # use google_cloud_config_v1::model::UpdateDeploymentRequest;
2289    /// use wkt::FieldMask;
2290    /// let x = UpdateDeploymentRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
2291    /// let x = UpdateDeploymentRequest::new().set_or_clear_update_mask(None::<FieldMask>);
2292    /// ```
2293    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2294    where
2295        T: std::convert::Into<wkt::FieldMask>,
2296    {
2297        self.update_mask = v.map(|x| x.into());
2298        self
2299    }
2300
2301    /// Sets the value of [deployment][crate::model::UpdateDeploymentRequest::deployment].
2302    ///
2303    /// # Example
2304    /// ```ignore,no_run
2305    /// # use google_cloud_config_v1::model::UpdateDeploymentRequest;
2306    /// use google_cloud_config_v1::model::Deployment;
2307    /// let x = UpdateDeploymentRequest::new().set_deployment(Deployment::default()/* use setters */);
2308    /// ```
2309    pub fn set_deployment<T>(mut self, v: T) -> Self
2310    where
2311        T: std::convert::Into<crate::model::Deployment>,
2312    {
2313        self.deployment = std::option::Option::Some(v.into());
2314        self
2315    }
2316
2317    /// Sets or clears the value of [deployment][crate::model::UpdateDeploymentRequest::deployment].
2318    ///
2319    /// # Example
2320    /// ```ignore,no_run
2321    /// # use google_cloud_config_v1::model::UpdateDeploymentRequest;
2322    /// use google_cloud_config_v1::model::Deployment;
2323    /// let x = UpdateDeploymentRequest::new().set_or_clear_deployment(Some(Deployment::default()/* use setters */));
2324    /// let x = UpdateDeploymentRequest::new().set_or_clear_deployment(None::<Deployment>);
2325    /// ```
2326    pub fn set_or_clear_deployment<T>(mut self, v: std::option::Option<T>) -> Self
2327    where
2328        T: std::convert::Into<crate::model::Deployment>,
2329    {
2330        self.deployment = v.map(|x| x.into());
2331        self
2332    }
2333
2334    /// Sets the value of [request_id][crate::model::UpdateDeploymentRequest::request_id].
2335    ///
2336    /// # Example
2337    /// ```ignore,no_run
2338    /// # use google_cloud_config_v1::model::UpdateDeploymentRequest;
2339    /// let x = UpdateDeploymentRequest::new().set_request_id("example");
2340    /// ```
2341    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2342        self.request_id = v.into();
2343        self
2344    }
2345}
2346
2347impl wkt::message::Message for UpdateDeploymentRequest {
2348    fn typename() -> &'static str {
2349        "type.googleapis.com/google.cloud.config.v1.UpdateDeploymentRequest"
2350    }
2351}
2352
2353#[derive(Clone, Default, PartialEq)]
2354#[non_exhaustive]
2355pub struct DeleteDeploymentRequest {
2356    /// Required. The name of the Deployment in the format:
2357    /// 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
2358    pub name: std::string::String,
2359
2360    /// Optional. An optional request ID to identify requests. Specify a unique
2361    /// request ID so that if you must retry your request, the server will know to
2362    /// ignore the request if it has already been completed. The server will
2363    /// guarantee that for at least 60 minutes after the first request.
2364    ///
2365    /// For example, consider a situation where you make an initial request and the
2366    /// request times out. If you make the request again with the same request ID,
2367    /// the server can check if original operation with the same request ID was
2368    /// received, and if so, will ignore the second request. This prevents clients
2369    /// from accidentally creating duplicate commitments.
2370    ///
2371    /// The request ID must be a valid UUID with the exception that zero UUID is
2372    /// not supported (00000000-0000-0000-0000-000000000000).
2373    pub request_id: std::string::String,
2374
2375    /// Optional. If set to true, any revisions for this deployment will also be
2376    /// deleted. (Otherwise, the request will only work if the deployment has no
2377    /// revisions.)
2378    pub force: bool,
2379
2380    /// Optional. Policy on how resources actuated by the deployment should be
2381    /// deleted. If unspecified, the default behavior is to delete the underlying
2382    /// resources.
2383    pub delete_policy: crate::model::delete_deployment_request::DeletePolicy,
2384
2385    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2386}
2387
2388impl DeleteDeploymentRequest {
2389    pub fn new() -> Self {
2390        std::default::Default::default()
2391    }
2392
2393    /// Sets the value of [name][crate::model::DeleteDeploymentRequest::name].
2394    ///
2395    /// # Example
2396    /// ```ignore,no_run
2397    /// # use google_cloud_config_v1::model::DeleteDeploymentRequest;
2398    /// let x = DeleteDeploymentRequest::new().set_name("example");
2399    /// ```
2400    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2401        self.name = v.into();
2402        self
2403    }
2404
2405    /// Sets the value of [request_id][crate::model::DeleteDeploymentRequest::request_id].
2406    ///
2407    /// # Example
2408    /// ```ignore,no_run
2409    /// # use google_cloud_config_v1::model::DeleteDeploymentRequest;
2410    /// let x = DeleteDeploymentRequest::new().set_request_id("example");
2411    /// ```
2412    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2413        self.request_id = v.into();
2414        self
2415    }
2416
2417    /// Sets the value of [force][crate::model::DeleteDeploymentRequest::force].
2418    ///
2419    /// # Example
2420    /// ```ignore,no_run
2421    /// # use google_cloud_config_v1::model::DeleteDeploymentRequest;
2422    /// let x = DeleteDeploymentRequest::new().set_force(true);
2423    /// ```
2424    pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2425        self.force = v.into();
2426        self
2427    }
2428
2429    /// Sets the value of [delete_policy][crate::model::DeleteDeploymentRequest::delete_policy].
2430    ///
2431    /// # Example
2432    /// ```ignore,no_run
2433    /// # use google_cloud_config_v1::model::DeleteDeploymentRequest;
2434    /// use google_cloud_config_v1::model::delete_deployment_request::DeletePolicy;
2435    /// let x0 = DeleteDeploymentRequest::new().set_delete_policy(DeletePolicy::Delete);
2436    /// let x1 = DeleteDeploymentRequest::new().set_delete_policy(DeletePolicy::Abandon);
2437    /// ```
2438    pub fn set_delete_policy<
2439        T: std::convert::Into<crate::model::delete_deployment_request::DeletePolicy>,
2440    >(
2441        mut self,
2442        v: T,
2443    ) -> Self {
2444        self.delete_policy = v.into();
2445        self
2446    }
2447}
2448
2449impl wkt::message::Message for DeleteDeploymentRequest {
2450    fn typename() -> &'static str {
2451        "type.googleapis.com/google.cloud.config.v1.DeleteDeploymentRequest"
2452    }
2453}
2454
2455/// Defines additional types related to [DeleteDeploymentRequest].
2456pub mod delete_deployment_request {
2457    #[allow(unused_imports)]
2458    use super::*;
2459
2460    /// Policy on how resources actuated by the deployment should be deleted.
2461    ///
2462    /// # Working with unknown values
2463    ///
2464    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2465    /// additional enum variants at any time. Adding new variants is not considered
2466    /// a breaking change. Applications should write their code in anticipation of:
2467    ///
2468    /// - New values appearing in future releases of the client library, **and**
2469    /// - New values received dynamically, without application changes.
2470    ///
2471    /// Please consult the [Working with enums] section in the user guide for some
2472    /// guidelines.
2473    ///
2474    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
2475    #[derive(Clone, Debug, PartialEq)]
2476    #[non_exhaustive]
2477    pub enum DeletePolicy {
2478        /// Unspecified policy, resources will be deleted.
2479        Unspecified,
2480        /// Deletes resources actuated by the deployment.
2481        Delete,
2482        /// Abandons resources and only deletes the deployment and its metadata.
2483        Abandon,
2484        /// If set, the enum was initialized with an unknown value.
2485        ///
2486        /// Applications can examine the value using [DeletePolicy::value] or
2487        /// [DeletePolicy::name].
2488        UnknownValue(delete_policy::UnknownValue),
2489    }
2490
2491    #[doc(hidden)]
2492    pub mod delete_policy {
2493        #[allow(unused_imports)]
2494        use super::*;
2495        #[derive(Clone, Debug, PartialEq)]
2496        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2497    }
2498
2499    impl DeletePolicy {
2500        /// Gets the enum value.
2501        ///
2502        /// Returns `None` if the enum contains an unknown value deserialized from
2503        /// the string representation of enums.
2504        pub fn value(&self) -> std::option::Option<i32> {
2505            match self {
2506                Self::Unspecified => std::option::Option::Some(0),
2507                Self::Delete => std::option::Option::Some(1),
2508                Self::Abandon => std::option::Option::Some(2),
2509                Self::UnknownValue(u) => u.0.value(),
2510            }
2511        }
2512
2513        /// Gets the enum value as a string.
2514        ///
2515        /// Returns `None` if the enum contains an unknown value deserialized from
2516        /// the integer representation of enums.
2517        pub fn name(&self) -> std::option::Option<&str> {
2518            match self {
2519                Self::Unspecified => std::option::Option::Some("DELETE_POLICY_UNSPECIFIED"),
2520                Self::Delete => std::option::Option::Some("DELETE"),
2521                Self::Abandon => std::option::Option::Some("ABANDON"),
2522                Self::UnknownValue(u) => u.0.name(),
2523            }
2524        }
2525    }
2526
2527    impl std::default::Default for DeletePolicy {
2528        fn default() -> Self {
2529            use std::convert::From;
2530            Self::from(0)
2531        }
2532    }
2533
2534    impl std::fmt::Display for DeletePolicy {
2535        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2536            wkt::internal::display_enum(f, self.name(), self.value())
2537        }
2538    }
2539
2540    impl std::convert::From<i32> for DeletePolicy {
2541        fn from(value: i32) -> Self {
2542            match value {
2543                0 => Self::Unspecified,
2544                1 => Self::Delete,
2545                2 => Self::Abandon,
2546                _ => Self::UnknownValue(delete_policy::UnknownValue(
2547                    wkt::internal::UnknownEnumValue::Integer(value),
2548                )),
2549            }
2550        }
2551    }
2552
2553    impl std::convert::From<&str> for DeletePolicy {
2554        fn from(value: &str) -> Self {
2555            use std::string::ToString;
2556            match value {
2557                "DELETE_POLICY_UNSPECIFIED" => Self::Unspecified,
2558                "DELETE" => Self::Delete,
2559                "ABANDON" => Self::Abandon,
2560                _ => Self::UnknownValue(delete_policy::UnknownValue(
2561                    wkt::internal::UnknownEnumValue::String(value.to_string()),
2562                )),
2563            }
2564        }
2565    }
2566
2567    impl serde::ser::Serialize for DeletePolicy {
2568        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2569        where
2570            S: serde::Serializer,
2571        {
2572            match self {
2573                Self::Unspecified => serializer.serialize_i32(0),
2574                Self::Delete => serializer.serialize_i32(1),
2575                Self::Abandon => serializer.serialize_i32(2),
2576                Self::UnknownValue(u) => u.0.serialize(serializer),
2577            }
2578        }
2579    }
2580
2581    impl<'de> serde::de::Deserialize<'de> for DeletePolicy {
2582        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2583        where
2584            D: serde::Deserializer<'de>,
2585        {
2586            deserializer.deserialize_any(wkt::internal::EnumVisitor::<DeletePolicy>::new(
2587                ".google.cloud.config.v1.DeleteDeploymentRequest.DeletePolicy",
2588            ))
2589        }
2590    }
2591}
2592
2593/// Represents the metadata of the long-running operation.
2594#[derive(Clone, Default, PartialEq)]
2595#[non_exhaustive]
2596pub struct OperationMetadata {
2597    /// Output only. Time when the operation was created.
2598    pub create_time: std::option::Option<wkt::Timestamp>,
2599
2600    /// Output only. Time when the operation finished running.
2601    pub end_time: std::option::Option<wkt::Timestamp>,
2602
2603    /// Output only. Server-defined resource path for the target of the operation.
2604    pub target: std::string::String,
2605
2606    /// Output only. Name of the verb executed by the operation.
2607    pub verb: std::string::String,
2608
2609    /// Output only. Human-readable status of the operation, if any.
2610    pub status_message: std::string::String,
2611
2612    /// Output only. Identifies whether the user has requested cancellation of the
2613    /// operation. Operations that have successfully been cancelled have
2614    /// [google.longrunning.Operation.error][google.longrunning.Operation.error]
2615    /// value with a [google.rpc.Status.code][google.rpc.Status.code] of `1`,
2616    /// corresponding to `Code.CANCELLED`.
2617    ///
2618    /// [google.longrunning.Operation.error]: longrunning::model::Operation::result
2619    /// [google.rpc.Status.code]: rpc::model::Status::code
2620    pub requested_cancellation: bool,
2621
2622    /// Output only. API version used to start the operation.
2623    pub api_version: std::string::String,
2624
2625    /// Ephemeral metadata about the state of an operation for a particular
2626    /// resource.
2627    pub resource_metadata: std::option::Option<crate::model::operation_metadata::ResourceMetadata>,
2628
2629    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2630}
2631
2632impl OperationMetadata {
2633    pub fn new() -> Self {
2634        std::default::Default::default()
2635    }
2636
2637    /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
2638    ///
2639    /// # Example
2640    /// ```ignore,no_run
2641    /// # use google_cloud_config_v1::model::OperationMetadata;
2642    /// use wkt::Timestamp;
2643    /// let x = OperationMetadata::new().set_create_time(Timestamp::default()/* use setters */);
2644    /// ```
2645    pub fn set_create_time<T>(mut self, v: T) -> Self
2646    where
2647        T: std::convert::Into<wkt::Timestamp>,
2648    {
2649        self.create_time = std::option::Option::Some(v.into());
2650        self
2651    }
2652
2653    /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
2654    ///
2655    /// # Example
2656    /// ```ignore,no_run
2657    /// # use google_cloud_config_v1::model::OperationMetadata;
2658    /// use wkt::Timestamp;
2659    /// let x = OperationMetadata::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
2660    /// let x = OperationMetadata::new().set_or_clear_create_time(None::<Timestamp>);
2661    /// ```
2662    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
2663    where
2664        T: std::convert::Into<wkt::Timestamp>,
2665    {
2666        self.create_time = v.map(|x| x.into());
2667        self
2668    }
2669
2670    /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
2671    ///
2672    /// # Example
2673    /// ```ignore,no_run
2674    /// # use google_cloud_config_v1::model::OperationMetadata;
2675    /// use wkt::Timestamp;
2676    /// let x = OperationMetadata::new().set_end_time(Timestamp::default()/* use setters */);
2677    /// ```
2678    pub fn set_end_time<T>(mut self, v: T) -> Self
2679    where
2680        T: std::convert::Into<wkt::Timestamp>,
2681    {
2682        self.end_time = std::option::Option::Some(v.into());
2683        self
2684    }
2685
2686    /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
2687    ///
2688    /// # Example
2689    /// ```ignore,no_run
2690    /// # use google_cloud_config_v1::model::OperationMetadata;
2691    /// use wkt::Timestamp;
2692    /// let x = OperationMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
2693    /// let x = OperationMetadata::new().set_or_clear_end_time(None::<Timestamp>);
2694    /// ```
2695    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
2696    where
2697        T: std::convert::Into<wkt::Timestamp>,
2698    {
2699        self.end_time = v.map(|x| x.into());
2700        self
2701    }
2702
2703    /// Sets the value of [target][crate::model::OperationMetadata::target].
2704    ///
2705    /// # Example
2706    /// ```ignore,no_run
2707    /// # use google_cloud_config_v1::model::OperationMetadata;
2708    /// let x = OperationMetadata::new().set_target("example");
2709    /// ```
2710    pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2711        self.target = v.into();
2712        self
2713    }
2714
2715    /// Sets the value of [verb][crate::model::OperationMetadata::verb].
2716    ///
2717    /// # Example
2718    /// ```ignore,no_run
2719    /// # use google_cloud_config_v1::model::OperationMetadata;
2720    /// let x = OperationMetadata::new().set_verb("example");
2721    /// ```
2722    pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2723        self.verb = v.into();
2724        self
2725    }
2726
2727    /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
2728    ///
2729    /// # Example
2730    /// ```ignore,no_run
2731    /// # use google_cloud_config_v1::model::OperationMetadata;
2732    /// let x = OperationMetadata::new().set_status_message("example");
2733    /// ```
2734    pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2735        self.status_message = v.into();
2736        self
2737    }
2738
2739    /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
2740    ///
2741    /// # Example
2742    /// ```ignore,no_run
2743    /// # use google_cloud_config_v1::model::OperationMetadata;
2744    /// let x = OperationMetadata::new().set_requested_cancellation(true);
2745    /// ```
2746    pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2747        self.requested_cancellation = v.into();
2748        self
2749    }
2750
2751    /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
2752    ///
2753    /// # Example
2754    /// ```ignore,no_run
2755    /// # use google_cloud_config_v1::model::OperationMetadata;
2756    /// let x = OperationMetadata::new().set_api_version("example");
2757    /// ```
2758    pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2759        self.api_version = v.into();
2760        self
2761    }
2762
2763    /// Sets the value of [resource_metadata][crate::model::OperationMetadata::resource_metadata].
2764    ///
2765    /// Note that all the setters affecting `resource_metadata` are mutually
2766    /// exclusive.
2767    ///
2768    /// # Example
2769    /// ```ignore,no_run
2770    /// # use google_cloud_config_v1::model::OperationMetadata;
2771    /// use google_cloud_config_v1::model::DeploymentOperationMetadata;
2772    /// let x = OperationMetadata::new().set_resource_metadata(Some(
2773    ///     google_cloud_config_v1::model::operation_metadata::ResourceMetadata::DeploymentMetadata(DeploymentOperationMetadata::default().into())));
2774    /// ```
2775    pub fn set_resource_metadata<
2776        T: std::convert::Into<std::option::Option<crate::model::operation_metadata::ResourceMetadata>>,
2777    >(
2778        mut self,
2779        v: T,
2780    ) -> Self {
2781        self.resource_metadata = v.into();
2782        self
2783    }
2784
2785    /// The value of [resource_metadata][crate::model::OperationMetadata::resource_metadata]
2786    /// if it holds a `DeploymentMetadata`, `None` if the field is not set or
2787    /// holds a different branch.
2788    pub fn deployment_metadata(
2789        &self,
2790    ) -> std::option::Option<&std::boxed::Box<crate::model::DeploymentOperationMetadata>> {
2791        #[allow(unreachable_patterns)]
2792        self.resource_metadata.as_ref().and_then(|v| match v {
2793            crate::model::operation_metadata::ResourceMetadata::DeploymentMetadata(v) => {
2794                std::option::Option::Some(v)
2795            }
2796            _ => std::option::Option::None,
2797        })
2798    }
2799
2800    /// Sets the value of [resource_metadata][crate::model::OperationMetadata::resource_metadata]
2801    /// to hold a `DeploymentMetadata`.
2802    ///
2803    /// Note that all the setters affecting `resource_metadata` are
2804    /// mutually exclusive.
2805    ///
2806    /// # Example
2807    /// ```ignore,no_run
2808    /// # use google_cloud_config_v1::model::OperationMetadata;
2809    /// use google_cloud_config_v1::model::DeploymentOperationMetadata;
2810    /// let x = OperationMetadata::new().set_deployment_metadata(DeploymentOperationMetadata::default()/* use setters */);
2811    /// assert!(x.deployment_metadata().is_some());
2812    /// assert!(x.preview_metadata().is_none());
2813    /// ```
2814    pub fn set_deployment_metadata<
2815        T: std::convert::Into<std::boxed::Box<crate::model::DeploymentOperationMetadata>>,
2816    >(
2817        mut self,
2818        v: T,
2819    ) -> Self {
2820        self.resource_metadata = std::option::Option::Some(
2821            crate::model::operation_metadata::ResourceMetadata::DeploymentMetadata(v.into()),
2822        );
2823        self
2824    }
2825
2826    /// The value of [resource_metadata][crate::model::OperationMetadata::resource_metadata]
2827    /// if it holds a `PreviewMetadata`, `None` if the field is not set or
2828    /// holds a different branch.
2829    pub fn preview_metadata(
2830        &self,
2831    ) -> std::option::Option<&std::boxed::Box<crate::model::PreviewOperationMetadata>> {
2832        #[allow(unreachable_patterns)]
2833        self.resource_metadata.as_ref().and_then(|v| match v {
2834            crate::model::operation_metadata::ResourceMetadata::PreviewMetadata(v) => {
2835                std::option::Option::Some(v)
2836            }
2837            _ => std::option::Option::None,
2838        })
2839    }
2840
2841    /// Sets the value of [resource_metadata][crate::model::OperationMetadata::resource_metadata]
2842    /// to hold a `PreviewMetadata`.
2843    ///
2844    /// Note that all the setters affecting `resource_metadata` are
2845    /// mutually exclusive.
2846    ///
2847    /// # Example
2848    /// ```ignore,no_run
2849    /// # use google_cloud_config_v1::model::OperationMetadata;
2850    /// use google_cloud_config_v1::model::PreviewOperationMetadata;
2851    /// let x = OperationMetadata::new().set_preview_metadata(PreviewOperationMetadata::default()/* use setters */);
2852    /// assert!(x.preview_metadata().is_some());
2853    /// assert!(x.deployment_metadata().is_none());
2854    /// ```
2855    pub fn set_preview_metadata<
2856        T: std::convert::Into<std::boxed::Box<crate::model::PreviewOperationMetadata>>,
2857    >(
2858        mut self,
2859        v: T,
2860    ) -> Self {
2861        self.resource_metadata = std::option::Option::Some(
2862            crate::model::operation_metadata::ResourceMetadata::PreviewMetadata(v.into()),
2863        );
2864        self
2865    }
2866}
2867
2868impl wkt::message::Message for OperationMetadata {
2869    fn typename() -> &'static str {
2870        "type.googleapis.com/google.cloud.config.v1.OperationMetadata"
2871    }
2872}
2873
2874/// Defines additional types related to [OperationMetadata].
2875pub mod operation_metadata {
2876    #[allow(unused_imports)]
2877    use super::*;
2878
2879    /// Ephemeral metadata about the state of an operation for a particular
2880    /// resource.
2881    #[derive(Clone, Debug, PartialEq)]
2882    #[non_exhaustive]
2883    pub enum ResourceMetadata {
2884        /// Output only. Metadata about the deployment operation state.
2885        DeploymentMetadata(std::boxed::Box<crate::model::DeploymentOperationMetadata>),
2886        /// Output only. Metadata about the preview operation state.
2887        PreviewMetadata(std::boxed::Box<crate::model::PreviewOperationMetadata>),
2888    }
2889}
2890
2891/// A child resource of a Deployment generated by a 'CreateDeployment' or
2892/// 'UpdateDeployment' call. Each Revision contains metadata pertaining to a
2893/// snapshot of a particular Deployment.
2894#[derive(Clone, Default, PartialEq)]
2895#[non_exhaustive]
2896pub struct Revision {
2897    /// Revision name. Format:
2898    /// `projects/{project}/locations/{location}/deployments/{deployment}/
2899    /// revisions/{revision}`
2900    pub name: std::string::String,
2901
2902    /// Output only. Time when the revision was created.
2903    pub create_time: std::option::Option<wkt::Timestamp>,
2904
2905    /// Output only. Time when the revision was last modified.
2906    pub update_time: std::option::Option<wkt::Timestamp>,
2907
2908    /// Output only. The action which created this revision
2909    pub action: crate::model::revision::Action,
2910
2911    /// Output only. Current state of the revision.
2912    pub state: crate::model::revision::State,
2913
2914    /// Output only. Outputs and artifacts from applying a deployment.
2915    pub apply_results: std::option::Option<crate::model::ApplyResults>,
2916
2917    /// Output only. Additional info regarding the current state.
2918    pub state_detail: std::string::String,
2919
2920    /// Output only. Code describing any errors that may have occurred.
2921    pub error_code: crate::model::revision::ErrorCode,
2922
2923    /// Output only. Cloud Build instance UUID associated with this revision.
2924    pub build: std::string::String,
2925
2926    /// Output only. Location of Revision operation logs in
2927    /// `gs://{bucket}/{object}` format.
2928    pub logs: std::string::String,
2929
2930    /// Output only. Errors encountered when creating or updating this deployment.
2931    /// Errors are truncated to 10 entries, see `delete_results` and `error_logs`
2932    /// for full details.
2933    pub tf_errors: std::vec::Vec<crate::model::TerraformError>,
2934
2935    /// Output only. Location of Terraform error logs in Google Cloud Storage.
2936    /// Format: `gs://{bucket}/{object}`.
2937    pub error_logs: std::string::String,
2938
2939    /// Output only. User-specified Service Account (SA) to be used as credential
2940    /// to manage resources. Format:
2941    /// `projects/{projectID}/serviceAccounts/{serviceAccount}`
2942    pub service_account: std::string::String,
2943
2944    /// Output only. By default, Infra Manager will return a failure when
2945    /// Terraform encounters a 409 code (resource conflict error) during actuation.
2946    /// If this flag is set to true, Infra Manager will instead
2947    /// attempt to automatically import the resource into the Terraform state (for
2948    /// supported resource types) and continue actuation.
2949    ///
2950    /// Not all resource types are supported, refer to documentation.
2951    pub import_existing_resources: bool,
2952
2953    /// Output only. The user-specified Cloud Build worker pool resource in which
2954    /// the Cloud Build job will execute. Format:
2955    /// `projects/{project}/locations/{location}/workerPools/{workerPoolId}`.
2956    /// If this field is unspecified, the default Cloud Build worker pool will be
2957    /// used.
2958    pub worker_pool: std::string::String,
2959
2960    /// Output only. The user-specified Terraform version constraint.
2961    /// Example: "=1.3.10".
2962    pub tf_version_constraint: std::string::String,
2963
2964    /// Output only. The version of Terraform used to create the Revision.
2965    /// It is in the format of "Major.Minor.Patch", for example, "1.3.10".
2966    pub tf_version: std::string::String,
2967
2968    /// Output only. Cloud Storage path containing quota validation results. This
2969    /// field is set when a user sets Deployment.quota_validation field to ENABLED
2970    /// or ENFORCED. Format: `gs://{bucket}/{object}`.
2971    pub quota_validation_results: std::string::String,
2972
2973    /// Optional. Input to control quota checks for resources in terraform
2974    /// configuration files. There are limited resources on which quota validation
2975    /// applies.
2976    pub quota_validation: crate::model::QuotaValidation,
2977
2978    /// Output only. This field specifies the provider configurations.
2979    pub provider_config: std::option::Option<crate::model::ProviderConfig>,
2980
2981    /// Blueprint that was deployed.
2982    pub blueprint: std::option::Option<crate::model::revision::Blueprint>,
2983
2984    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2985}
2986
2987impl Revision {
2988    pub fn new() -> Self {
2989        std::default::Default::default()
2990    }
2991
2992    /// Sets the value of [name][crate::model::Revision::name].
2993    ///
2994    /// # Example
2995    /// ```ignore,no_run
2996    /// # use google_cloud_config_v1::model::Revision;
2997    /// let x = Revision::new().set_name("example");
2998    /// ```
2999    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3000        self.name = v.into();
3001        self
3002    }
3003
3004    /// Sets the value of [create_time][crate::model::Revision::create_time].
3005    ///
3006    /// # Example
3007    /// ```ignore,no_run
3008    /// # use google_cloud_config_v1::model::Revision;
3009    /// use wkt::Timestamp;
3010    /// let x = Revision::new().set_create_time(Timestamp::default()/* use setters */);
3011    /// ```
3012    pub fn set_create_time<T>(mut self, v: T) -> Self
3013    where
3014        T: std::convert::Into<wkt::Timestamp>,
3015    {
3016        self.create_time = std::option::Option::Some(v.into());
3017        self
3018    }
3019
3020    /// Sets or clears the value of [create_time][crate::model::Revision::create_time].
3021    ///
3022    /// # Example
3023    /// ```ignore,no_run
3024    /// # use google_cloud_config_v1::model::Revision;
3025    /// use wkt::Timestamp;
3026    /// let x = Revision::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
3027    /// let x = Revision::new().set_or_clear_create_time(None::<Timestamp>);
3028    /// ```
3029    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
3030    where
3031        T: std::convert::Into<wkt::Timestamp>,
3032    {
3033        self.create_time = v.map(|x| x.into());
3034        self
3035    }
3036
3037    /// Sets the value of [update_time][crate::model::Revision::update_time].
3038    ///
3039    /// # Example
3040    /// ```ignore,no_run
3041    /// # use google_cloud_config_v1::model::Revision;
3042    /// use wkt::Timestamp;
3043    /// let x = Revision::new().set_update_time(Timestamp::default()/* use setters */);
3044    /// ```
3045    pub fn set_update_time<T>(mut self, v: T) -> Self
3046    where
3047        T: std::convert::Into<wkt::Timestamp>,
3048    {
3049        self.update_time = std::option::Option::Some(v.into());
3050        self
3051    }
3052
3053    /// Sets or clears the value of [update_time][crate::model::Revision::update_time].
3054    ///
3055    /// # Example
3056    /// ```ignore,no_run
3057    /// # use google_cloud_config_v1::model::Revision;
3058    /// use wkt::Timestamp;
3059    /// let x = Revision::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
3060    /// let x = Revision::new().set_or_clear_update_time(None::<Timestamp>);
3061    /// ```
3062    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
3063    where
3064        T: std::convert::Into<wkt::Timestamp>,
3065    {
3066        self.update_time = v.map(|x| x.into());
3067        self
3068    }
3069
3070    /// Sets the value of [action][crate::model::Revision::action].
3071    ///
3072    /// # Example
3073    /// ```ignore,no_run
3074    /// # use google_cloud_config_v1::model::Revision;
3075    /// use google_cloud_config_v1::model::revision::Action;
3076    /// let x0 = Revision::new().set_action(Action::Create);
3077    /// let x1 = Revision::new().set_action(Action::Update);
3078    /// let x2 = Revision::new().set_action(Action::Delete);
3079    /// ```
3080    pub fn set_action<T: std::convert::Into<crate::model::revision::Action>>(
3081        mut self,
3082        v: T,
3083    ) -> Self {
3084        self.action = v.into();
3085        self
3086    }
3087
3088    /// Sets the value of [state][crate::model::Revision::state].
3089    ///
3090    /// # Example
3091    /// ```ignore,no_run
3092    /// # use google_cloud_config_v1::model::Revision;
3093    /// use google_cloud_config_v1::model::revision::State;
3094    /// let x0 = Revision::new().set_state(State::Applying);
3095    /// let x1 = Revision::new().set_state(State::Applied);
3096    /// let x2 = Revision::new().set_state(State::Failed);
3097    /// ```
3098    pub fn set_state<T: std::convert::Into<crate::model::revision::State>>(mut self, v: T) -> Self {
3099        self.state = v.into();
3100        self
3101    }
3102
3103    /// Sets the value of [apply_results][crate::model::Revision::apply_results].
3104    ///
3105    /// # Example
3106    /// ```ignore,no_run
3107    /// # use google_cloud_config_v1::model::Revision;
3108    /// use google_cloud_config_v1::model::ApplyResults;
3109    /// let x = Revision::new().set_apply_results(ApplyResults::default()/* use setters */);
3110    /// ```
3111    pub fn set_apply_results<T>(mut self, v: T) -> Self
3112    where
3113        T: std::convert::Into<crate::model::ApplyResults>,
3114    {
3115        self.apply_results = std::option::Option::Some(v.into());
3116        self
3117    }
3118
3119    /// Sets or clears the value of [apply_results][crate::model::Revision::apply_results].
3120    ///
3121    /// # Example
3122    /// ```ignore,no_run
3123    /// # use google_cloud_config_v1::model::Revision;
3124    /// use google_cloud_config_v1::model::ApplyResults;
3125    /// let x = Revision::new().set_or_clear_apply_results(Some(ApplyResults::default()/* use setters */));
3126    /// let x = Revision::new().set_or_clear_apply_results(None::<ApplyResults>);
3127    /// ```
3128    pub fn set_or_clear_apply_results<T>(mut self, v: std::option::Option<T>) -> Self
3129    where
3130        T: std::convert::Into<crate::model::ApplyResults>,
3131    {
3132        self.apply_results = v.map(|x| x.into());
3133        self
3134    }
3135
3136    /// Sets the value of [state_detail][crate::model::Revision::state_detail].
3137    ///
3138    /// # Example
3139    /// ```ignore,no_run
3140    /// # use google_cloud_config_v1::model::Revision;
3141    /// let x = Revision::new().set_state_detail("example");
3142    /// ```
3143    pub fn set_state_detail<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3144        self.state_detail = v.into();
3145        self
3146    }
3147
3148    /// Sets the value of [error_code][crate::model::Revision::error_code].
3149    ///
3150    /// # Example
3151    /// ```ignore,no_run
3152    /// # use google_cloud_config_v1::model::Revision;
3153    /// use google_cloud_config_v1::model::revision::ErrorCode;
3154    /// let x0 = Revision::new().set_error_code(ErrorCode::CloudBuildPermissionDenied);
3155    /// let x1 = Revision::new().set_error_code(ErrorCode::ApplyBuildApiFailed);
3156    /// let x2 = Revision::new().set_error_code(ErrorCode::ApplyBuildRunFailed);
3157    /// ```
3158    pub fn set_error_code<T: std::convert::Into<crate::model::revision::ErrorCode>>(
3159        mut self,
3160        v: T,
3161    ) -> Self {
3162        self.error_code = v.into();
3163        self
3164    }
3165
3166    /// Sets the value of [build][crate::model::Revision::build].
3167    ///
3168    /// # Example
3169    /// ```ignore,no_run
3170    /// # use google_cloud_config_v1::model::Revision;
3171    /// let x = Revision::new().set_build("example");
3172    /// ```
3173    pub fn set_build<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3174        self.build = v.into();
3175        self
3176    }
3177
3178    /// Sets the value of [logs][crate::model::Revision::logs].
3179    ///
3180    /// # Example
3181    /// ```ignore,no_run
3182    /// # use google_cloud_config_v1::model::Revision;
3183    /// let x = Revision::new().set_logs("example");
3184    /// ```
3185    pub fn set_logs<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3186        self.logs = v.into();
3187        self
3188    }
3189
3190    /// Sets the value of [tf_errors][crate::model::Revision::tf_errors].
3191    ///
3192    /// # Example
3193    /// ```ignore,no_run
3194    /// # use google_cloud_config_v1::model::Revision;
3195    /// use google_cloud_config_v1::model::TerraformError;
3196    /// let x = Revision::new()
3197    ///     .set_tf_errors([
3198    ///         TerraformError::default()/* use setters */,
3199    ///         TerraformError::default()/* use (different) setters */,
3200    ///     ]);
3201    /// ```
3202    pub fn set_tf_errors<T, V>(mut self, v: T) -> Self
3203    where
3204        T: std::iter::IntoIterator<Item = V>,
3205        V: std::convert::Into<crate::model::TerraformError>,
3206    {
3207        use std::iter::Iterator;
3208        self.tf_errors = v.into_iter().map(|i| i.into()).collect();
3209        self
3210    }
3211
3212    /// Sets the value of [error_logs][crate::model::Revision::error_logs].
3213    ///
3214    /// # Example
3215    /// ```ignore,no_run
3216    /// # use google_cloud_config_v1::model::Revision;
3217    /// let x = Revision::new().set_error_logs("example");
3218    /// ```
3219    pub fn set_error_logs<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3220        self.error_logs = v.into();
3221        self
3222    }
3223
3224    /// Sets the value of [service_account][crate::model::Revision::service_account].
3225    ///
3226    /// # Example
3227    /// ```ignore,no_run
3228    /// # use google_cloud_config_v1::model::Revision;
3229    /// let x = Revision::new().set_service_account("example");
3230    /// ```
3231    pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3232        self.service_account = v.into();
3233        self
3234    }
3235
3236    /// Sets the value of [import_existing_resources][crate::model::Revision::import_existing_resources].
3237    ///
3238    /// # Example
3239    /// ```ignore,no_run
3240    /// # use google_cloud_config_v1::model::Revision;
3241    /// let x = Revision::new().set_import_existing_resources(true);
3242    /// ```
3243    pub fn set_import_existing_resources<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3244        self.import_existing_resources = v.into();
3245        self
3246    }
3247
3248    /// Sets the value of [worker_pool][crate::model::Revision::worker_pool].
3249    ///
3250    /// # Example
3251    /// ```ignore,no_run
3252    /// # use google_cloud_config_v1::model::Revision;
3253    /// let x = Revision::new().set_worker_pool("example");
3254    /// ```
3255    pub fn set_worker_pool<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3256        self.worker_pool = v.into();
3257        self
3258    }
3259
3260    /// Sets the value of [tf_version_constraint][crate::model::Revision::tf_version_constraint].
3261    ///
3262    /// # Example
3263    /// ```ignore,no_run
3264    /// # use google_cloud_config_v1::model::Revision;
3265    /// let x = Revision::new().set_tf_version_constraint("example");
3266    /// ```
3267    pub fn set_tf_version_constraint<T: std::convert::Into<std::string::String>>(
3268        mut self,
3269        v: T,
3270    ) -> Self {
3271        self.tf_version_constraint = v.into();
3272        self
3273    }
3274
3275    /// Sets the value of [tf_version][crate::model::Revision::tf_version].
3276    ///
3277    /// # Example
3278    /// ```ignore,no_run
3279    /// # use google_cloud_config_v1::model::Revision;
3280    /// let x = Revision::new().set_tf_version("example");
3281    /// ```
3282    pub fn set_tf_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3283        self.tf_version = v.into();
3284        self
3285    }
3286
3287    /// Sets the value of [quota_validation_results][crate::model::Revision::quota_validation_results].
3288    ///
3289    /// # Example
3290    /// ```ignore,no_run
3291    /// # use google_cloud_config_v1::model::Revision;
3292    /// let x = Revision::new().set_quota_validation_results("example");
3293    /// ```
3294    pub fn set_quota_validation_results<T: std::convert::Into<std::string::String>>(
3295        mut self,
3296        v: T,
3297    ) -> Self {
3298        self.quota_validation_results = v.into();
3299        self
3300    }
3301
3302    /// Sets the value of [quota_validation][crate::model::Revision::quota_validation].
3303    ///
3304    /// # Example
3305    /// ```ignore,no_run
3306    /// # use google_cloud_config_v1::model::Revision;
3307    /// use google_cloud_config_v1::model::QuotaValidation;
3308    /// let x0 = Revision::new().set_quota_validation(QuotaValidation::Enabled);
3309    /// let x1 = Revision::new().set_quota_validation(QuotaValidation::Enforced);
3310    /// ```
3311    pub fn set_quota_validation<T: std::convert::Into<crate::model::QuotaValidation>>(
3312        mut self,
3313        v: T,
3314    ) -> Self {
3315        self.quota_validation = v.into();
3316        self
3317    }
3318
3319    /// Sets the value of [provider_config][crate::model::Revision::provider_config].
3320    ///
3321    /// # Example
3322    /// ```ignore,no_run
3323    /// # use google_cloud_config_v1::model::Revision;
3324    /// use google_cloud_config_v1::model::ProviderConfig;
3325    /// let x = Revision::new().set_provider_config(ProviderConfig::default()/* use setters */);
3326    /// ```
3327    pub fn set_provider_config<T>(mut self, v: T) -> Self
3328    where
3329        T: std::convert::Into<crate::model::ProviderConfig>,
3330    {
3331        self.provider_config = std::option::Option::Some(v.into());
3332        self
3333    }
3334
3335    /// Sets or clears the value of [provider_config][crate::model::Revision::provider_config].
3336    ///
3337    /// # Example
3338    /// ```ignore,no_run
3339    /// # use google_cloud_config_v1::model::Revision;
3340    /// use google_cloud_config_v1::model::ProviderConfig;
3341    /// let x = Revision::new().set_or_clear_provider_config(Some(ProviderConfig::default()/* use setters */));
3342    /// let x = Revision::new().set_or_clear_provider_config(None::<ProviderConfig>);
3343    /// ```
3344    pub fn set_or_clear_provider_config<T>(mut self, v: std::option::Option<T>) -> Self
3345    where
3346        T: std::convert::Into<crate::model::ProviderConfig>,
3347    {
3348        self.provider_config = v.map(|x| x.into());
3349        self
3350    }
3351
3352    /// Sets the value of [blueprint][crate::model::Revision::blueprint].
3353    ///
3354    /// Note that all the setters affecting `blueprint` are mutually
3355    /// exclusive.
3356    ///
3357    /// # Example
3358    /// ```ignore,no_run
3359    /// # use google_cloud_config_v1::model::Revision;
3360    /// use google_cloud_config_v1::model::TerraformBlueprint;
3361    /// let x = Revision::new().set_blueprint(Some(
3362    ///     google_cloud_config_v1::model::revision::Blueprint::TerraformBlueprint(TerraformBlueprint::default().into())));
3363    /// ```
3364    pub fn set_blueprint<
3365        T: std::convert::Into<std::option::Option<crate::model::revision::Blueprint>>,
3366    >(
3367        mut self,
3368        v: T,
3369    ) -> Self {
3370        self.blueprint = v.into();
3371        self
3372    }
3373
3374    /// The value of [blueprint][crate::model::Revision::blueprint]
3375    /// if it holds a `TerraformBlueprint`, `None` if the field is not set or
3376    /// holds a different branch.
3377    pub fn terraform_blueprint(
3378        &self,
3379    ) -> std::option::Option<&std::boxed::Box<crate::model::TerraformBlueprint>> {
3380        #[allow(unreachable_patterns)]
3381        self.blueprint.as_ref().and_then(|v| match v {
3382            crate::model::revision::Blueprint::TerraformBlueprint(v) => {
3383                std::option::Option::Some(v)
3384            }
3385            _ => std::option::Option::None,
3386        })
3387    }
3388
3389    /// Sets the value of [blueprint][crate::model::Revision::blueprint]
3390    /// to hold a `TerraformBlueprint`.
3391    ///
3392    /// Note that all the setters affecting `blueprint` are
3393    /// mutually exclusive.
3394    ///
3395    /// # Example
3396    /// ```ignore,no_run
3397    /// # use google_cloud_config_v1::model::Revision;
3398    /// use google_cloud_config_v1::model::TerraformBlueprint;
3399    /// let x = Revision::new().set_terraform_blueprint(TerraformBlueprint::default()/* use setters */);
3400    /// assert!(x.terraform_blueprint().is_some());
3401    /// ```
3402    pub fn set_terraform_blueprint<
3403        T: std::convert::Into<std::boxed::Box<crate::model::TerraformBlueprint>>,
3404    >(
3405        mut self,
3406        v: T,
3407    ) -> Self {
3408        self.blueprint = std::option::Option::Some(
3409            crate::model::revision::Blueprint::TerraformBlueprint(v.into()),
3410        );
3411        self
3412    }
3413}
3414
3415impl wkt::message::Message for Revision {
3416    fn typename() -> &'static str {
3417        "type.googleapis.com/google.cloud.config.v1.Revision"
3418    }
3419}
3420
3421/// Defines additional types related to [Revision].
3422pub mod revision {
3423    #[allow(unused_imports)]
3424    use super::*;
3425
3426    /// Actions that generate a revision.
3427    ///
3428    /// # Working with unknown values
3429    ///
3430    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3431    /// additional enum variants at any time. Adding new variants is not considered
3432    /// a breaking change. Applications should write their code in anticipation of:
3433    ///
3434    /// - New values appearing in future releases of the client library, **and**
3435    /// - New values received dynamically, without application changes.
3436    ///
3437    /// Please consult the [Working with enums] section in the user guide for some
3438    /// guidelines.
3439    ///
3440    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
3441    #[derive(Clone, Debug, PartialEq)]
3442    #[non_exhaustive]
3443    pub enum Action {
3444        /// The default value. This value is used if the action is omitted.
3445        Unspecified,
3446        /// The revision was generated by creating a deployment.
3447        Create,
3448        /// The revision was generated by updating a deployment.
3449        Update,
3450        /// The revision was deleted.
3451        Delete,
3452        /// If set, the enum was initialized with an unknown value.
3453        ///
3454        /// Applications can examine the value using [Action::value] or
3455        /// [Action::name].
3456        UnknownValue(action::UnknownValue),
3457    }
3458
3459    #[doc(hidden)]
3460    pub mod action {
3461        #[allow(unused_imports)]
3462        use super::*;
3463        #[derive(Clone, Debug, PartialEq)]
3464        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3465    }
3466
3467    impl Action {
3468        /// Gets the enum value.
3469        ///
3470        /// Returns `None` if the enum contains an unknown value deserialized from
3471        /// the string representation of enums.
3472        pub fn value(&self) -> std::option::Option<i32> {
3473            match self {
3474                Self::Unspecified => std::option::Option::Some(0),
3475                Self::Create => std::option::Option::Some(1),
3476                Self::Update => std::option::Option::Some(2),
3477                Self::Delete => std::option::Option::Some(3),
3478                Self::UnknownValue(u) => u.0.value(),
3479            }
3480        }
3481
3482        /// Gets the enum value as a string.
3483        ///
3484        /// Returns `None` if the enum contains an unknown value deserialized from
3485        /// the integer representation of enums.
3486        pub fn name(&self) -> std::option::Option<&str> {
3487            match self {
3488                Self::Unspecified => std::option::Option::Some("ACTION_UNSPECIFIED"),
3489                Self::Create => std::option::Option::Some("CREATE"),
3490                Self::Update => std::option::Option::Some("UPDATE"),
3491                Self::Delete => std::option::Option::Some("DELETE"),
3492                Self::UnknownValue(u) => u.0.name(),
3493            }
3494        }
3495    }
3496
3497    impl std::default::Default for Action {
3498        fn default() -> Self {
3499            use std::convert::From;
3500            Self::from(0)
3501        }
3502    }
3503
3504    impl std::fmt::Display for Action {
3505        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3506            wkt::internal::display_enum(f, self.name(), self.value())
3507        }
3508    }
3509
3510    impl std::convert::From<i32> for Action {
3511        fn from(value: i32) -> Self {
3512            match value {
3513                0 => Self::Unspecified,
3514                1 => Self::Create,
3515                2 => Self::Update,
3516                3 => Self::Delete,
3517                _ => Self::UnknownValue(action::UnknownValue(
3518                    wkt::internal::UnknownEnumValue::Integer(value),
3519                )),
3520            }
3521        }
3522    }
3523
3524    impl std::convert::From<&str> for Action {
3525        fn from(value: &str) -> Self {
3526            use std::string::ToString;
3527            match value {
3528                "ACTION_UNSPECIFIED" => Self::Unspecified,
3529                "CREATE" => Self::Create,
3530                "UPDATE" => Self::Update,
3531                "DELETE" => Self::Delete,
3532                _ => Self::UnknownValue(action::UnknownValue(
3533                    wkt::internal::UnknownEnumValue::String(value.to_string()),
3534                )),
3535            }
3536        }
3537    }
3538
3539    impl serde::ser::Serialize for Action {
3540        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3541        where
3542            S: serde::Serializer,
3543        {
3544            match self {
3545                Self::Unspecified => serializer.serialize_i32(0),
3546                Self::Create => serializer.serialize_i32(1),
3547                Self::Update => serializer.serialize_i32(2),
3548                Self::Delete => serializer.serialize_i32(3),
3549                Self::UnknownValue(u) => u.0.serialize(serializer),
3550            }
3551        }
3552    }
3553
3554    impl<'de> serde::de::Deserialize<'de> for Action {
3555        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3556        where
3557            D: serde::Deserializer<'de>,
3558        {
3559            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Action>::new(
3560                ".google.cloud.config.v1.Revision.Action",
3561            ))
3562        }
3563    }
3564
3565    /// Possible states of a revision.
3566    ///
3567    /// # Working with unknown values
3568    ///
3569    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3570    /// additional enum variants at any time. Adding new variants is not considered
3571    /// a breaking change. Applications should write their code in anticipation of:
3572    ///
3573    /// - New values appearing in future releases of the client library, **and**
3574    /// - New values received dynamically, without application changes.
3575    ///
3576    /// Please consult the [Working with enums] section in the user guide for some
3577    /// guidelines.
3578    ///
3579    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
3580    #[derive(Clone, Debug, PartialEq)]
3581    #[non_exhaustive]
3582    pub enum State {
3583        /// The default value. This value is used if the state is omitted.
3584        Unspecified,
3585        /// The revision is being applied.
3586        Applying,
3587        /// The revision was applied successfully.
3588        Applied,
3589        /// The revision could not be applied successfully.
3590        Failed,
3591        /// If set, the enum was initialized with an unknown value.
3592        ///
3593        /// Applications can examine the value using [State::value] or
3594        /// [State::name].
3595        UnknownValue(state::UnknownValue),
3596    }
3597
3598    #[doc(hidden)]
3599    pub mod state {
3600        #[allow(unused_imports)]
3601        use super::*;
3602        #[derive(Clone, Debug, PartialEq)]
3603        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3604    }
3605
3606    impl State {
3607        /// Gets the enum value.
3608        ///
3609        /// Returns `None` if the enum contains an unknown value deserialized from
3610        /// the string representation of enums.
3611        pub fn value(&self) -> std::option::Option<i32> {
3612            match self {
3613                Self::Unspecified => std::option::Option::Some(0),
3614                Self::Applying => std::option::Option::Some(1),
3615                Self::Applied => std::option::Option::Some(2),
3616                Self::Failed => std::option::Option::Some(3),
3617                Self::UnknownValue(u) => u.0.value(),
3618            }
3619        }
3620
3621        /// Gets the enum value as a string.
3622        ///
3623        /// Returns `None` if the enum contains an unknown value deserialized from
3624        /// the integer representation of enums.
3625        pub fn name(&self) -> std::option::Option<&str> {
3626            match self {
3627                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
3628                Self::Applying => std::option::Option::Some("APPLYING"),
3629                Self::Applied => std::option::Option::Some("APPLIED"),
3630                Self::Failed => std::option::Option::Some("FAILED"),
3631                Self::UnknownValue(u) => u.0.name(),
3632            }
3633        }
3634    }
3635
3636    impl std::default::Default for State {
3637        fn default() -> Self {
3638            use std::convert::From;
3639            Self::from(0)
3640        }
3641    }
3642
3643    impl std::fmt::Display for State {
3644        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3645            wkt::internal::display_enum(f, self.name(), self.value())
3646        }
3647    }
3648
3649    impl std::convert::From<i32> for State {
3650        fn from(value: i32) -> Self {
3651            match value {
3652                0 => Self::Unspecified,
3653                1 => Self::Applying,
3654                2 => Self::Applied,
3655                3 => Self::Failed,
3656                _ => Self::UnknownValue(state::UnknownValue(
3657                    wkt::internal::UnknownEnumValue::Integer(value),
3658                )),
3659            }
3660        }
3661    }
3662
3663    impl std::convert::From<&str> for State {
3664        fn from(value: &str) -> Self {
3665            use std::string::ToString;
3666            match value {
3667                "STATE_UNSPECIFIED" => Self::Unspecified,
3668                "APPLYING" => Self::Applying,
3669                "APPLIED" => Self::Applied,
3670                "FAILED" => Self::Failed,
3671                _ => Self::UnknownValue(state::UnknownValue(
3672                    wkt::internal::UnknownEnumValue::String(value.to_string()),
3673                )),
3674            }
3675        }
3676    }
3677
3678    impl serde::ser::Serialize for State {
3679        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3680        where
3681            S: serde::Serializer,
3682        {
3683            match self {
3684                Self::Unspecified => serializer.serialize_i32(0),
3685                Self::Applying => serializer.serialize_i32(1),
3686                Self::Applied => serializer.serialize_i32(2),
3687                Self::Failed => serializer.serialize_i32(3),
3688                Self::UnknownValue(u) => u.0.serialize(serializer),
3689            }
3690        }
3691    }
3692
3693    impl<'de> serde::de::Deserialize<'de> for State {
3694        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3695        where
3696            D: serde::Deserializer<'de>,
3697        {
3698            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
3699                ".google.cloud.config.v1.Revision.State",
3700            ))
3701        }
3702    }
3703
3704    /// Possible errors if Revision could not be created or updated successfully.
3705    ///
3706    /// # Working with unknown values
3707    ///
3708    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3709    /// additional enum variants at any time. Adding new variants is not considered
3710    /// a breaking change. Applications should write their code in anticipation of:
3711    ///
3712    /// - New values appearing in future releases of the client library, **and**
3713    /// - New values received dynamically, without application changes.
3714    ///
3715    /// Please consult the [Working with enums] section in the user guide for some
3716    /// guidelines.
3717    ///
3718    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
3719    #[derive(Clone, Debug, PartialEq)]
3720    #[non_exhaustive]
3721    pub enum ErrorCode {
3722        /// No error code was specified.
3723        Unspecified,
3724        /// Cloud Build failed due to a permission issue.
3725        CloudBuildPermissionDenied,
3726        /// Cloud Build job associated with creating or updating a deployment could
3727        /// not be started.
3728        ApplyBuildApiFailed,
3729        /// Cloud Build job associated with creating or updating a deployment was
3730        /// started but failed.
3731        ApplyBuildRunFailed,
3732        /// quota validation failed for one or more resources in terraform
3733        /// configuration files.
3734        QuotaValidationFailed,
3735        /// If set, the enum was initialized with an unknown value.
3736        ///
3737        /// Applications can examine the value using [ErrorCode::value] or
3738        /// [ErrorCode::name].
3739        UnknownValue(error_code::UnknownValue),
3740    }
3741
3742    #[doc(hidden)]
3743    pub mod error_code {
3744        #[allow(unused_imports)]
3745        use super::*;
3746        #[derive(Clone, Debug, PartialEq)]
3747        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3748    }
3749
3750    impl ErrorCode {
3751        /// Gets the enum value.
3752        ///
3753        /// Returns `None` if the enum contains an unknown value deserialized from
3754        /// the string representation of enums.
3755        pub fn value(&self) -> std::option::Option<i32> {
3756            match self {
3757                Self::Unspecified => std::option::Option::Some(0),
3758                Self::CloudBuildPermissionDenied => std::option::Option::Some(1),
3759                Self::ApplyBuildApiFailed => std::option::Option::Some(4),
3760                Self::ApplyBuildRunFailed => std::option::Option::Some(5),
3761                Self::QuotaValidationFailed => std::option::Option::Some(7),
3762                Self::UnknownValue(u) => u.0.value(),
3763            }
3764        }
3765
3766        /// Gets the enum value as a string.
3767        ///
3768        /// Returns `None` if the enum contains an unknown value deserialized from
3769        /// the integer representation of enums.
3770        pub fn name(&self) -> std::option::Option<&str> {
3771            match self {
3772                Self::Unspecified => std::option::Option::Some("ERROR_CODE_UNSPECIFIED"),
3773                Self::CloudBuildPermissionDenied => {
3774                    std::option::Option::Some("CLOUD_BUILD_PERMISSION_DENIED")
3775                }
3776                Self::ApplyBuildApiFailed => std::option::Option::Some("APPLY_BUILD_API_FAILED"),
3777                Self::ApplyBuildRunFailed => std::option::Option::Some("APPLY_BUILD_RUN_FAILED"),
3778                Self::QuotaValidationFailed => std::option::Option::Some("QUOTA_VALIDATION_FAILED"),
3779                Self::UnknownValue(u) => u.0.name(),
3780            }
3781        }
3782    }
3783
3784    impl std::default::Default for ErrorCode {
3785        fn default() -> Self {
3786            use std::convert::From;
3787            Self::from(0)
3788        }
3789    }
3790
3791    impl std::fmt::Display for ErrorCode {
3792        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3793            wkt::internal::display_enum(f, self.name(), self.value())
3794        }
3795    }
3796
3797    impl std::convert::From<i32> for ErrorCode {
3798        fn from(value: i32) -> Self {
3799            match value {
3800                0 => Self::Unspecified,
3801                1 => Self::CloudBuildPermissionDenied,
3802                4 => Self::ApplyBuildApiFailed,
3803                5 => Self::ApplyBuildRunFailed,
3804                7 => Self::QuotaValidationFailed,
3805                _ => Self::UnknownValue(error_code::UnknownValue(
3806                    wkt::internal::UnknownEnumValue::Integer(value),
3807                )),
3808            }
3809        }
3810    }
3811
3812    impl std::convert::From<&str> for ErrorCode {
3813        fn from(value: &str) -> Self {
3814            use std::string::ToString;
3815            match value {
3816                "ERROR_CODE_UNSPECIFIED" => Self::Unspecified,
3817                "CLOUD_BUILD_PERMISSION_DENIED" => Self::CloudBuildPermissionDenied,
3818                "APPLY_BUILD_API_FAILED" => Self::ApplyBuildApiFailed,
3819                "APPLY_BUILD_RUN_FAILED" => Self::ApplyBuildRunFailed,
3820                "QUOTA_VALIDATION_FAILED" => Self::QuotaValidationFailed,
3821                _ => Self::UnknownValue(error_code::UnknownValue(
3822                    wkt::internal::UnknownEnumValue::String(value.to_string()),
3823                )),
3824            }
3825        }
3826    }
3827
3828    impl serde::ser::Serialize for ErrorCode {
3829        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3830        where
3831            S: serde::Serializer,
3832        {
3833            match self {
3834                Self::Unspecified => serializer.serialize_i32(0),
3835                Self::CloudBuildPermissionDenied => serializer.serialize_i32(1),
3836                Self::ApplyBuildApiFailed => serializer.serialize_i32(4),
3837                Self::ApplyBuildRunFailed => serializer.serialize_i32(5),
3838                Self::QuotaValidationFailed => serializer.serialize_i32(7),
3839                Self::UnknownValue(u) => u.0.serialize(serializer),
3840            }
3841        }
3842    }
3843
3844    impl<'de> serde::de::Deserialize<'de> for ErrorCode {
3845        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3846        where
3847            D: serde::Deserializer<'de>,
3848        {
3849            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ErrorCode>::new(
3850                ".google.cloud.config.v1.Revision.ErrorCode",
3851            ))
3852        }
3853    }
3854
3855    /// Blueprint that was deployed.
3856    #[derive(Clone, Debug, PartialEq)]
3857    #[non_exhaustive]
3858    pub enum Blueprint {
3859        /// Output only. A blueprint described using Terraform's HashiCorp
3860        /// Configuration Language as a root module.
3861        TerraformBlueprint(std::boxed::Box<crate::model::TerraformBlueprint>),
3862    }
3863}
3864
3865/// Errors encountered during actuation using Terraform
3866#[derive(Clone, Default, PartialEq)]
3867#[non_exhaustive]
3868pub struct TerraformError {
3869    /// Address of the resource associated with the error,
3870    /// e.g. `google_compute_network.vpc_network`.
3871    pub resource_address: std::string::String,
3872
3873    /// HTTP response code returned from Google Cloud Platform APIs when Terraform
3874    /// fails to provision the resource. If unset or 0, no HTTP response code was
3875    /// returned by Terraform.
3876    pub http_response_code: i32,
3877
3878    /// A human-readable error description.
3879    pub error_description: std::string::String,
3880
3881    /// Output only. Original error response from underlying Google API, if
3882    /// available.
3883    pub error: std::option::Option<rpc::model::Status>,
3884
3885    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3886}
3887
3888impl TerraformError {
3889    pub fn new() -> Self {
3890        std::default::Default::default()
3891    }
3892
3893    /// Sets the value of [resource_address][crate::model::TerraformError::resource_address].
3894    ///
3895    /// # Example
3896    /// ```ignore,no_run
3897    /// # use google_cloud_config_v1::model::TerraformError;
3898    /// let x = TerraformError::new().set_resource_address("example");
3899    /// ```
3900    pub fn set_resource_address<T: std::convert::Into<std::string::String>>(
3901        mut self,
3902        v: T,
3903    ) -> Self {
3904        self.resource_address = v.into();
3905        self
3906    }
3907
3908    /// Sets the value of [http_response_code][crate::model::TerraformError::http_response_code].
3909    ///
3910    /// # Example
3911    /// ```ignore,no_run
3912    /// # use google_cloud_config_v1::model::TerraformError;
3913    /// let x = TerraformError::new().set_http_response_code(42);
3914    /// ```
3915    pub fn set_http_response_code<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3916        self.http_response_code = v.into();
3917        self
3918    }
3919
3920    /// Sets the value of [error_description][crate::model::TerraformError::error_description].
3921    ///
3922    /// # Example
3923    /// ```ignore,no_run
3924    /// # use google_cloud_config_v1::model::TerraformError;
3925    /// let x = TerraformError::new().set_error_description("example");
3926    /// ```
3927    pub fn set_error_description<T: std::convert::Into<std::string::String>>(
3928        mut self,
3929        v: T,
3930    ) -> Self {
3931        self.error_description = v.into();
3932        self
3933    }
3934
3935    /// Sets the value of [error][crate::model::TerraformError::error].
3936    ///
3937    /// # Example
3938    /// ```ignore,no_run
3939    /// # use google_cloud_config_v1::model::TerraformError;
3940    /// use rpc::model::Status;
3941    /// let x = TerraformError::new().set_error(Status::default()/* use setters */);
3942    /// ```
3943    pub fn set_error<T>(mut self, v: T) -> Self
3944    where
3945        T: std::convert::Into<rpc::model::Status>,
3946    {
3947        self.error = std::option::Option::Some(v.into());
3948        self
3949    }
3950
3951    /// Sets or clears the value of [error][crate::model::TerraformError::error].
3952    ///
3953    /// # Example
3954    /// ```ignore,no_run
3955    /// # use google_cloud_config_v1::model::TerraformError;
3956    /// use rpc::model::Status;
3957    /// let x = TerraformError::new().set_or_clear_error(Some(Status::default()/* use setters */));
3958    /// let x = TerraformError::new().set_or_clear_error(None::<Status>);
3959    /// ```
3960    pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
3961    where
3962        T: std::convert::Into<rpc::model::Status>,
3963    {
3964        self.error = v.map(|x| x.into());
3965        self
3966    }
3967}
3968
3969impl wkt::message::Message for TerraformError {
3970    fn typename() -> &'static str {
3971        "type.googleapis.com/google.cloud.config.v1.TerraformError"
3972    }
3973}
3974
3975/// A set of files in a Git repository.
3976#[derive(Clone, Default, PartialEq)]
3977#[non_exhaustive]
3978pub struct GitSource {
3979    /// Optional. Repository URL.
3980    /// Example: '<https://github.com/kubernetes/examples.git>'
3981    pub repo: std::option::Option<std::string::String>,
3982
3983    /// Optional. Subdirectory inside the repository.
3984    /// Example: 'staging/my-package'
3985    pub directory: std::option::Option<std::string::String>,
3986
3987    /// Optional. Git reference (e.g. branch or tag).
3988    pub r#ref: std::option::Option<std::string::String>,
3989
3990    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3991}
3992
3993impl GitSource {
3994    pub fn new() -> Self {
3995        std::default::Default::default()
3996    }
3997
3998    /// Sets the value of [repo][crate::model::GitSource::repo].
3999    ///
4000    /// # Example
4001    /// ```ignore,no_run
4002    /// # use google_cloud_config_v1::model::GitSource;
4003    /// let x = GitSource::new().set_repo("example");
4004    /// ```
4005    pub fn set_repo<T>(mut self, v: T) -> Self
4006    where
4007        T: std::convert::Into<std::string::String>,
4008    {
4009        self.repo = std::option::Option::Some(v.into());
4010        self
4011    }
4012
4013    /// Sets or clears the value of [repo][crate::model::GitSource::repo].
4014    ///
4015    /// # Example
4016    /// ```ignore,no_run
4017    /// # use google_cloud_config_v1::model::GitSource;
4018    /// let x = GitSource::new().set_or_clear_repo(Some("example"));
4019    /// let x = GitSource::new().set_or_clear_repo(None::<String>);
4020    /// ```
4021    pub fn set_or_clear_repo<T>(mut self, v: std::option::Option<T>) -> Self
4022    where
4023        T: std::convert::Into<std::string::String>,
4024    {
4025        self.repo = v.map(|x| x.into());
4026        self
4027    }
4028
4029    /// Sets the value of [directory][crate::model::GitSource::directory].
4030    ///
4031    /// # Example
4032    /// ```ignore,no_run
4033    /// # use google_cloud_config_v1::model::GitSource;
4034    /// let x = GitSource::new().set_directory("example");
4035    /// ```
4036    pub fn set_directory<T>(mut self, v: T) -> Self
4037    where
4038        T: std::convert::Into<std::string::String>,
4039    {
4040        self.directory = std::option::Option::Some(v.into());
4041        self
4042    }
4043
4044    /// Sets or clears the value of [directory][crate::model::GitSource::directory].
4045    ///
4046    /// # Example
4047    /// ```ignore,no_run
4048    /// # use google_cloud_config_v1::model::GitSource;
4049    /// let x = GitSource::new().set_or_clear_directory(Some("example"));
4050    /// let x = GitSource::new().set_or_clear_directory(None::<String>);
4051    /// ```
4052    pub fn set_or_clear_directory<T>(mut self, v: std::option::Option<T>) -> Self
4053    where
4054        T: std::convert::Into<std::string::String>,
4055    {
4056        self.directory = v.map(|x| x.into());
4057        self
4058    }
4059
4060    /// Sets the value of [r#ref][crate::model::GitSource::ref].
4061    ///
4062    /// # Example
4063    /// ```ignore,no_run
4064    /// # use google_cloud_config_v1::model::GitSource;
4065    /// let x = GitSource::new().set_ref("example");
4066    /// ```
4067    pub fn set_ref<T>(mut self, v: T) -> Self
4068    where
4069        T: std::convert::Into<std::string::String>,
4070    {
4071        self.r#ref = std::option::Option::Some(v.into());
4072        self
4073    }
4074
4075    /// Sets or clears the value of [r#ref][crate::model::GitSource::ref].
4076    ///
4077    /// # Example
4078    /// ```ignore,no_run
4079    /// # use google_cloud_config_v1::model::GitSource;
4080    /// let x = GitSource::new().set_or_clear_ref(Some("example"));
4081    /// let x = GitSource::new().set_or_clear_ref(None::<String>);
4082    /// ```
4083    pub fn set_or_clear_ref<T>(mut self, v: std::option::Option<T>) -> Self
4084    where
4085        T: std::convert::Into<std::string::String>,
4086    {
4087        self.r#ref = v.map(|x| x.into());
4088        self
4089    }
4090}
4091
4092impl wkt::message::Message for GitSource {
4093    fn typename() -> &'static str {
4094        "type.googleapis.com/google.cloud.config.v1.GitSource"
4095    }
4096}
4097
4098/// Ephemeral metadata content describing the state of a deployment operation.
4099#[derive(Clone, Default, PartialEq)]
4100#[non_exhaustive]
4101pub struct DeploymentOperationMetadata {
4102    /// The current step the deployment operation is running.
4103    pub step: crate::model::deployment_operation_metadata::DeploymentStep,
4104
4105    /// Outputs and artifacts from applying a deployment.
4106    pub apply_results: std::option::Option<crate::model::ApplyResults>,
4107
4108    /// Output only. Cloud Build instance UUID associated with this operation.
4109    pub build: std::string::String,
4110
4111    /// Output only. Location of Deployment operations logs in
4112    /// `gs://{bucket}/{object}` format.
4113    pub logs: std::string::String,
4114
4115    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4116}
4117
4118impl DeploymentOperationMetadata {
4119    pub fn new() -> Self {
4120        std::default::Default::default()
4121    }
4122
4123    /// Sets the value of [step][crate::model::DeploymentOperationMetadata::step].
4124    ///
4125    /// # Example
4126    /// ```ignore,no_run
4127    /// # use google_cloud_config_v1::model::DeploymentOperationMetadata;
4128    /// use google_cloud_config_v1::model::deployment_operation_metadata::DeploymentStep;
4129    /// let x0 = DeploymentOperationMetadata::new().set_step(DeploymentStep::PreparingStorageBucket);
4130    /// let x1 = DeploymentOperationMetadata::new().set_step(DeploymentStep::DownloadingBlueprint);
4131    /// let x2 = DeploymentOperationMetadata::new().set_step(DeploymentStep::RunningTfInit);
4132    /// ```
4133    pub fn set_step<
4134        T: std::convert::Into<crate::model::deployment_operation_metadata::DeploymentStep>,
4135    >(
4136        mut self,
4137        v: T,
4138    ) -> Self {
4139        self.step = v.into();
4140        self
4141    }
4142
4143    /// Sets the value of [apply_results][crate::model::DeploymentOperationMetadata::apply_results].
4144    ///
4145    /// # Example
4146    /// ```ignore,no_run
4147    /// # use google_cloud_config_v1::model::DeploymentOperationMetadata;
4148    /// use google_cloud_config_v1::model::ApplyResults;
4149    /// let x = DeploymentOperationMetadata::new().set_apply_results(ApplyResults::default()/* use setters */);
4150    /// ```
4151    pub fn set_apply_results<T>(mut self, v: T) -> Self
4152    where
4153        T: std::convert::Into<crate::model::ApplyResults>,
4154    {
4155        self.apply_results = std::option::Option::Some(v.into());
4156        self
4157    }
4158
4159    /// Sets or clears the value of [apply_results][crate::model::DeploymentOperationMetadata::apply_results].
4160    ///
4161    /// # Example
4162    /// ```ignore,no_run
4163    /// # use google_cloud_config_v1::model::DeploymentOperationMetadata;
4164    /// use google_cloud_config_v1::model::ApplyResults;
4165    /// let x = DeploymentOperationMetadata::new().set_or_clear_apply_results(Some(ApplyResults::default()/* use setters */));
4166    /// let x = DeploymentOperationMetadata::new().set_or_clear_apply_results(None::<ApplyResults>);
4167    /// ```
4168    pub fn set_or_clear_apply_results<T>(mut self, v: std::option::Option<T>) -> Self
4169    where
4170        T: std::convert::Into<crate::model::ApplyResults>,
4171    {
4172        self.apply_results = v.map(|x| x.into());
4173        self
4174    }
4175
4176    /// Sets the value of [build][crate::model::DeploymentOperationMetadata::build].
4177    ///
4178    /// # Example
4179    /// ```ignore,no_run
4180    /// # use google_cloud_config_v1::model::DeploymentOperationMetadata;
4181    /// let x = DeploymentOperationMetadata::new().set_build("example");
4182    /// ```
4183    pub fn set_build<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4184        self.build = v.into();
4185        self
4186    }
4187
4188    /// Sets the value of [logs][crate::model::DeploymentOperationMetadata::logs].
4189    ///
4190    /// # Example
4191    /// ```ignore,no_run
4192    /// # use google_cloud_config_v1::model::DeploymentOperationMetadata;
4193    /// let x = DeploymentOperationMetadata::new().set_logs("example");
4194    /// ```
4195    pub fn set_logs<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4196        self.logs = v.into();
4197        self
4198    }
4199}
4200
4201impl wkt::message::Message for DeploymentOperationMetadata {
4202    fn typename() -> &'static str {
4203        "type.googleapis.com/google.cloud.config.v1.DeploymentOperationMetadata"
4204    }
4205}
4206
4207/// Defines additional types related to [DeploymentOperationMetadata].
4208pub mod deployment_operation_metadata {
4209    #[allow(unused_imports)]
4210    use super::*;
4211
4212    /// The possible steps a deployment may be running.
4213    ///
4214    /// # Working with unknown values
4215    ///
4216    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4217    /// additional enum variants at any time. Adding new variants is not considered
4218    /// a breaking change. Applications should write their code in anticipation of:
4219    ///
4220    /// - New values appearing in future releases of the client library, **and**
4221    /// - New values received dynamically, without application changes.
4222    ///
4223    /// Please consult the [Working with enums] section in the user guide for some
4224    /// guidelines.
4225    ///
4226    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
4227    #[derive(Clone, Debug, PartialEq)]
4228    #[non_exhaustive]
4229    pub enum DeploymentStep {
4230        /// Unspecified deployment step
4231        Unspecified,
4232        /// Infra Manager is creating a Google Cloud Storage bucket to store
4233        /// artifacts and metadata about the deployment and revision
4234        PreparingStorageBucket,
4235        /// Downloading the blueprint onto the Google Cloud Storage bucket
4236        DownloadingBlueprint,
4237        /// Initializing Terraform using `terraform init`
4238        RunningTfInit,
4239        /// Running `terraform plan`
4240        RunningTfPlan,
4241        /// Actuating resources using Terraform using `terraform apply`
4242        RunningTfApply,
4243        /// Destroying resources using Terraform using `terraform destroy`
4244        RunningTfDestroy,
4245        /// Validating the uploaded TF state file when unlocking a deployment
4246        RunningTfValidate,
4247        /// Unlocking a deployment
4248        UnlockingDeployment,
4249        /// Operation was successful
4250        Succeeded,
4251        /// Operation failed
4252        Failed,
4253        /// Validating the provided repository.
4254        ValidatingRepository,
4255        /// Running quota validation
4256        RunningQuotaValidation,
4257        /// If set, the enum was initialized with an unknown value.
4258        ///
4259        /// Applications can examine the value using [DeploymentStep::value] or
4260        /// [DeploymentStep::name].
4261        UnknownValue(deployment_step::UnknownValue),
4262    }
4263
4264    #[doc(hidden)]
4265    pub mod deployment_step {
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 DeploymentStep {
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::PreparingStorageBucket => std::option::Option::Some(1),
4281                Self::DownloadingBlueprint => std::option::Option::Some(2),
4282                Self::RunningTfInit => std::option::Option::Some(3),
4283                Self::RunningTfPlan => std::option::Option::Some(4),
4284                Self::RunningTfApply => std::option::Option::Some(5),
4285                Self::RunningTfDestroy => std::option::Option::Some(6),
4286                Self::RunningTfValidate => std::option::Option::Some(7),
4287                Self::UnlockingDeployment => std::option::Option::Some(8),
4288                Self::Succeeded => std::option::Option::Some(9),
4289                Self::Failed => std::option::Option::Some(10),
4290                Self::ValidatingRepository => std::option::Option::Some(11),
4291                Self::RunningQuotaValidation => std::option::Option::Some(12),
4292                Self::UnknownValue(u) => u.0.value(),
4293            }
4294        }
4295
4296        /// Gets the enum value as a string.
4297        ///
4298        /// Returns `None` if the enum contains an unknown value deserialized from
4299        /// the integer representation of enums.
4300        pub fn name(&self) -> std::option::Option<&str> {
4301            match self {
4302                Self::Unspecified => std::option::Option::Some("DEPLOYMENT_STEP_UNSPECIFIED"),
4303                Self::PreparingStorageBucket => {
4304                    std::option::Option::Some("PREPARING_STORAGE_BUCKET")
4305                }
4306                Self::DownloadingBlueprint => std::option::Option::Some("DOWNLOADING_BLUEPRINT"),
4307                Self::RunningTfInit => std::option::Option::Some("RUNNING_TF_INIT"),
4308                Self::RunningTfPlan => std::option::Option::Some("RUNNING_TF_PLAN"),
4309                Self::RunningTfApply => std::option::Option::Some("RUNNING_TF_APPLY"),
4310                Self::RunningTfDestroy => std::option::Option::Some("RUNNING_TF_DESTROY"),
4311                Self::RunningTfValidate => std::option::Option::Some("RUNNING_TF_VALIDATE"),
4312                Self::UnlockingDeployment => std::option::Option::Some("UNLOCKING_DEPLOYMENT"),
4313                Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
4314                Self::Failed => std::option::Option::Some("FAILED"),
4315                Self::ValidatingRepository => std::option::Option::Some("VALIDATING_REPOSITORY"),
4316                Self::RunningQuotaValidation => {
4317                    std::option::Option::Some("RUNNING_QUOTA_VALIDATION")
4318                }
4319                Self::UnknownValue(u) => u.0.name(),
4320            }
4321        }
4322    }
4323
4324    impl std::default::Default for DeploymentStep {
4325        fn default() -> Self {
4326            use std::convert::From;
4327            Self::from(0)
4328        }
4329    }
4330
4331    impl std::fmt::Display for DeploymentStep {
4332        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4333            wkt::internal::display_enum(f, self.name(), self.value())
4334        }
4335    }
4336
4337    impl std::convert::From<i32> for DeploymentStep {
4338        fn from(value: i32) -> Self {
4339            match value {
4340                0 => Self::Unspecified,
4341                1 => Self::PreparingStorageBucket,
4342                2 => Self::DownloadingBlueprint,
4343                3 => Self::RunningTfInit,
4344                4 => Self::RunningTfPlan,
4345                5 => Self::RunningTfApply,
4346                6 => Self::RunningTfDestroy,
4347                7 => Self::RunningTfValidate,
4348                8 => Self::UnlockingDeployment,
4349                9 => Self::Succeeded,
4350                10 => Self::Failed,
4351                11 => Self::ValidatingRepository,
4352                12 => Self::RunningQuotaValidation,
4353                _ => Self::UnknownValue(deployment_step::UnknownValue(
4354                    wkt::internal::UnknownEnumValue::Integer(value),
4355                )),
4356            }
4357        }
4358    }
4359
4360    impl std::convert::From<&str> for DeploymentStep {
4361        fn from(value: &str) -> Self {
4362            use std::string::ToString;
4363            match value {
4364                "DEPLOYMENT_STEP_UNSPECIFIED" => Self::Unspecified,
4365                "PREPARING_STORAGE_BUCKET" => Self::PreparingStorageBucket,
4366                "DOWNLOADING_BLUEPRINT" => Self::DownloadingBlueprint,
4367                "RUNNING_TF_INIT" => Self::RunningTfInit,
4368                "RUNNING_TF_PLAN" => Self::RunningTfPlan,
4369                "RUNNING_TF_APPLY" => Self::RunningTfApply,
4370                "RUNNING_TF_DESTROY" => Self::RunningTfDestroy,
4371                "RUNNING_TF_VALIDATE" => Self::RunningTfValidate,
4372                "UNLOCKING_DEPLOYMENT" => Self::UnlockingDeployment,
4373                "SUCCEEDED" => Self::Succeeded,
4374                "FAILED" => Self::Failed,
4375                "VALIDATING_REPOSITORY" => Self::ValidatingRepository,
4376                "RUNNING_QUOTA_VALIDATION" => Self::RunningQuotaValidation,
4377                _ => Self::UnknownValue(deployment_step::UnknownValue(
4378                    wkt::internal::UnknownEnumValue::String(value.to_string()),
4379                )),
4380            }
4381        }
4382    }
4383
4384    impl serde::ser::Serialize for DeploymentStep {
4385        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4386        where
4387            S: serde::Serializer,
4388        {
4389            match self {
4390                Self::Unspecified => serializer.serialize_i32(0),
4391                Self::PreparingStorageBucket => serializer.serialize_i32(1),
4392                Self::DownloadingBlueprint => serializer.serialize_i32(2),
4393                Self::RunningTfInit => serializer.serialize_i32(3),
4394                Self::RunningTfPlan => serializer.serialize_i32(4),
4395                Self::RunningTfApply => serializer.serialize_i32(5),
4396                Self::RunningTfDestroy => serializer.serialize_i32(6),
4397                Self::RunningTfValidate => serializer.serialize_i32(7),
4398                Self::UnlockingDeployment => serializer.serialize_i32(8),
4399                Self::Succeeded => serializer.serialize_i32(9),
4400                Self::Failed => serializer.serialize_i32(10),
4401                Self::ValidatingRepository => serializer.serialize_i32(11),
4402                Self::RunningQuotaValidation => serializer.serialize_i32(12),
4403                Self::UnknownValue(u) => u.0.serialize(serializer),
4404            }
4405        }
4406    }
4407
4408    impl<'de> serde::de::Deserialize<'de> for DeploymentStep {
4409        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4410        where
4411            D: serde::Deserializer<'de>,
4412        {
4413            deserializer.deserialize_any(wkt::internal::EnumVisitor::<DeploymentStep>::new(
4414                ".google.cloud.config.v1.DeploymentOperationMetadata.DeploymentStep",
4415            ))
4416        }
4417    }
4418}
4419
4420/// Resource represents a Google Cloud Platform resource actuated by IM.
4421/// Resources are child resources of Revisions.
4422#[derive(Clone, Default, PartialEq)]
4423#[non_exhaustive]
4424pub struct Resource {
4425    /// Output only. Resource name.
4426    /// Format:
4427    /// `projects/{project}/locations/{location}/deployments/{deployment}/revisions/{revision}/resources/{resource}`
4428    pub name: std::string::String,
4429
4430    /// Output only. Terraform-specific info if this resource was created using
4431    /// Terraform.
4432    pub terraform_info: std::option::Option<crate::model::ResourceTerraformInfo>,
4433
4434    /// Output only. Map of Cloud Asset Inventory (CAI) type to CAI info (e.g. CAI
4435    /// ID). CAI type format follows
4436    /// <https://cloud.google.com/asset-inventory/docs/supported-asset-types>
4437    pub cai_assets: std::collections::HashMap<std::string::String, crate::model::ResourceCAIInfo>,
4438
4439    /// Output only. Intent of the resource.
4440    pub intent: crate::model::resource::Intent,
4441
4442    /// Output only. Current state of the resource.
4443    pub state: crate::model::resource::State,
4444
4445    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4446}
4447
4448impl Resource {
4449    pub fn new() -> Self {
4450        std::default::Default::default()
4451    }
4452
4453    /// Sets the value of [name][crate::model::Resource::name].
4454    ///
4455    /// # Example
4456    /// ```ignore,no_run
4457    /// # use google_cloud_config_v1::model::Resource;
4458    /// let x = Resource::new().set_name("example");
4459    /// ```
4460    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4461        self.name = v.into();
4462        self
4463    }
4464
4465    /// Sets the value of [terraform_info][crate::model::Resource::terraform_info].
4466    ///
4467    /// # Example
4468    /// ```ignore,no_run
4469    /// # use google_cloud_config_v1::model::Resource;
4470    /// use google_cloud_config_v1::model::ResourceTerraformInfo;
4471    /// let x = Resource::new().set_terraform_info(ResourceTerraformInfo::default()/* use setters */);
4472    /// ```
4473    pub fn set_terraform_info<T>(mut self, v: T) -> Self
4474    where
4475        T: std::convert::Into<crate::model::ResourceTerraformInfo>,
4476    {
4477        self.terraform_info = std::option::Option::Some(v.into());
4478        self
4479    }
4480
4481    /// Sets or clears the value of [terraform_info][crate::model::Resource::terraform_info].
4482    ///
4483    /// # Example
4484    /// ```ignore,no_run
4485    /// # use google_cloud_config_v1::model::Resource;
4486    /// use google_cloud_config_v1::model::ResourceTerraformInfo;
4487    /// let x = Resource::new().set_or_clear_terraform_info(Some(ResourceTerraformInfo::default()/* use setters */));
4488    /// let x = Resource::new().set_or_clear_terraform_info(None::<ResourceTerraformInfo>);
4489    /// ```
4490    pub fn set_or_clear_terraform_info<T>(mut self, v: std::option::Option<T>) -> Self
4491    where
4492        T: std::convert::Into<crate::model::ResourceTerraformInfo>,
4493    {
4494        self.terraform_info = v.map(|x| x.into());
4495        self
4496    }
4497
4498    /// Sets the value of [cai_assets][crate::model::Resource::cai_assets].
4499    ///
4500    /// # Example
4501    /// ```ignore,no_run
4502    /// # use google_cloud_config_v1::model::Resource;
4503    /// use google_cloud_config_v1::model::ResourceCAIInfo;
4504    /// let x = Resource::new().set_cai_assets([
4505    ///     ("key0", ResourceCAIInfo::default()/* use setters */),
4506    ///     ("key1", ResourceCAIInfo::default()/* use (different) setters */),
4507    /// ]);
4508    /// ```
4509    pub fn set_cai_assets<T, K, V>(mut self, v: T) -> Self
4510    where
4511        T: std::iter::IntoIterator<Item = (K, V)>,
4512        K: std::convert::Into<std::string::String>,
4513        V: std::convert::Into<crate::model::ResourceCAIInfo>,
4514    {
4515        use std::iter::Iterator;
4516        self.cai_assets = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
4517        self
4518    }
4519
4520    /// Sets the value of [intent][crate::model::Resource::intent].
4521    ///
4522    /// # Example
4523    /// ```ignore,no_run
4524    /// # use google_cloud_config_v1::model::Resource;
4525    /// use google_cloud_config_v1::model::resource::Intent;
4526    /// let x0 = Resource::new().set_intent(Intent::Create);
4527    /// let x1 = Resource::new().set_intent(Intent::Update);
4528    /// let x2 = Resource::new().set_intent(Intent::Delete);
4529    /// ```
4530    pub fn set_intent<T: std::convert::Into<crate::model::resource::Intent>>(
4531        mut self,
4532        v: T,
4533    ) -> Self {
4534        self.intent = v.into();
4535        self
4536    }
4537
4538    /// Sets the value of [state][crate::model::Resource::state].
4539    ///
4540    /// # Example
4541    /// ```ignore,no_run
4542    /// # use google_cloud_config_v1::model::Resource;
4543    /// use google_cloud_config_v1::model::resource::State;
4544    /// let x0 = Resource::new().set_state(State::Planned);
4545    /// let x1 = Resource::new().set_state(State::InProgress);
4546    /// let x2 = Resource::new().set_state(State::Reconciled);
4547    /// ```
4548    pub fn set_state<T: std::convert::Into<crate::model::resource::State>>(mut self, v: T) -> Self {
4549        self.state = v.into();
4550        self
4551    }
4552}
4553
4554impl wkt::message::Message for Resource {
4555    fn typename() -> &'static str {
4556        "type.googleapis.com/google.cloud.config.v1.Resource"
4557    }
4558}
4559
4560/// Defines additional types related to [Resource].
4561pub mod resource {
4562    #[allow(unused_imports)]
4563    use super::*;
4564
4565    /// Possible intent of the resource.
4566    ///
4567    /// # Working with unknown values
4568    ///
4569    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4570    /// additional enum variants at any time. Adding new variants is not considered
4571    /// a breaking change. Applications should write their code in anticipation of:
4572    ///
4573    /// - New values appearing in future releases of the client library, **and**
4574    /// - New values received dynamically, without application changes.
4575    ///
4576    /// Please consult the [Working with enums] section in the user guide for some
4577    /// guidelines.
4578    ///
4579    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
4580    #[derive(Clone, Debug, PartialEq)]
4581    #[non_exhaustive]
4582    pub enum Intent {
4583        /// The default value. This value is used if the intent is omitted.
4584        Unspecified,
4585        /// Infra Manager will create this Resource.
4586        Create,
4587        /// Infra Manager will update this Resource.
4588        Update,
4589        /// Infra Manager will delete this Resource.
4590        Delete,
4591        /// Infra Manager will destroy and recreate this Resource.
4592        Recreate,
4593        /// Infra Manager will leave this Resource untouched.
4594        Unchanged,
4595        /// If set, the enum was initialized with an unknown value.
4596        ///
4597        /// Applications can examine the value using [Intent::value] or
4598        /// [Intent::name].
4599        UnknownValue(intent::UnknownValue),
4600    }
4601
4602    #[doc(hidden)]
4603    pub mod intent {
4604        #[allow(unused_imports)]
4605        use super::*;
4606        #[derive(Clone, Debug, PartialEq)]
4607        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4608    }
4609
4610    impl Intent {
4611        /// Gets the enum value.
4612        ///
4613        /// Returns `None` if the enum contains an unknown value deserialized from
4614        /// the string representation of enums.
4615        pub fn value(&self) -> std::option::Option<i32> {
4616            match self {
4617                Self::Unspecified => std::option::Option::Some(0),
4618                Self::Create => std::option::Option::Some(1),
4619                Self::Update => std::option::Option::Some(2),
4620                Self::Delete => std::option::Option::Some(3),
4621                Self::Recreate => std::option::Option::Some(4),
4622                Self::Unchanged => std::option::Option::Some(5),
4623                Self::UnknownValue(u) => u.0.value(),
4624            }
4625        }
4626
4627        /// Gets the enum value as a string.
4628        ///
4629        /// Returns `None` if the enum contains an unknown value deserialized from
4630        /// the integer representation of enums.
4631        pub fn name(&self) -> std::option::Option<&str> {
4632            match self {
4633                Self::Unspecified => std::option::Option::Some("INTENT_UNSPECIFIED"),
4634                Self::Create => std::option::Option::Some("CREATE"),
4635                Self::Update => std::option::Option::Some("UPDATE"),
4636                Self::Delete => std::option::Option::Some("DELETE"),
4637                Self::Recreate => std::option::Option::Some("RECREATE"),
4638                Self::Unchanged => std::option::Option::Some("UNCHANGED"),
4639                Self::UnknownValue(u) => u.0.name(),
4640            }
4641        }
4642    }
4643
4644    impl std::default::Default for Intent {
4645        fn default() -> Self {
4646            use std::convert::From;
4647            Self::from(0)
4648        }
4649    }
4650
4651    impl std::fmt::Display for Intent {
4652        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4653            wkt::internal::display_enum(f, self.name(), self.value())
4654        }
4655    }
4656
4657    impl std::convert::From<i32> for Intent {
4658        fn from(value: i32) -> Self {
4659            match value {
4660                0 => Self::Unspecified,
4661                1 => Self::Create,
4662                2 => Self::Update,
4663                3 => Self::Delete,
4664                4 => Self::Recreate,
4665                5 => Self::Unchanged,
4666                _ => Self::UnknownValue(intent::UnknownValue(
4667                    wkt::internal::UnknownEnumValue::Integer(value),
4668                )),
4669            }
4670        }
4671    }
4672
4673    impl std::convert::From<&str> for Intent {
4674        fn from(value: &str) -> Self {
4675            use std::string::ToString;
4676            match value {
4677                "INTENT_UNSPECIFIED" => Self::Unspecified,
4678                "CREATE" => Self::Create,
4679                "UPDATE" => Self::Update,
4680                "DELETE" => Self::Delete,
4681                "RECREATE" => Self::Recreate,
4682                "UNCHANGED" => Self::Unchanged,
4683                _ => Self::UnknownValue(intent::UnknownValue(
4684                    wkt::internal::UnknownEnumValue::String(value.to_string()),
4685                )),
4686            }
4687        }
4688    }
4689
4690    impl serde::ser::Serialize for Intent {
4691        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4692        where
4693            S: serde::Serializer,
4694        {
4695            match self {
4696                Self::Unspecified => serializer.serialize_i32(0),
4697                Self::Create => serializer.serialize_i32(1),
4698                Self::Update => serializer.serialize_i32(2),
4699                Self::Delete => serializer.serialize_i32(3),
4700                Self::Recreate => serializer.serialize_i32(4),
4701                Self::Unchanged => serializer.serialize_i32(5),
4702                Self::UnknownValue(u) => u.0.serialize(serializer),
4703            }
4704        }
4705    }
4706
4707    impl<'de> serde::de::Deserialize<'de> for Intent {
4708        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4709        where
4710            D: serde::Deserializer<'de>,
4711        {
4712            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Intent>::new(
4713                ".google.cloud.config.v1.Resource.Intent",
4714            ))
4715        }
4716    }
4717
4718    /// Possible states of a resource.
4719    ///
4720    /// # Working with unknown values
4721    ///
4722    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4723    /// additional enum variants at any time. Adding new variants is not considered
4724    /// a breaking change. Applications should write their code in anticipation of:
4725    ///
4726    /// - New values appearing in future releases of the client library, **and**
4727    /// - New values received dynamically, without application changes.
4728    ///
4729    /// Please consult the [Working with enums] section in the user guide for some
4730    /// guidelines.
4731    ///
4732    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
4733    #[derive(Clone, Debug, PartialEq)]
4734    #[non_exhaustive]
4735    pub enum State {
4736        /// The default value. This value is used if the state is omitted.
4737        Unspecified,
4738        /// Resource has been planned for reconcile.
4739        Planned,
4740        /// Resource is actively reconciling into the intended state.
4741        InProgress,
4742        /// Resource has reconciled to intended state.
4743        Reconciled,
4744        /// Resource failed to reconcile.
4745        Failed,
4746        /// If set, the enum was initialized with an unknown value.
4747        ///
4748        /// Applications can examine the value using [State::value] or
4749        /// [State::name].
4750        UnknownValue(state::UnknownValue),
4751    }
4752
4753    #[doc(hidden)]
4754    pub mod state {
4755        #[allow(unused_imports)]
4756        use super::*;
4757        #[derive(Clone, Debug, PartialEq)]
4758        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4759    }
4760
4761    impl State {
4762        /// Gets the enum value.
4763        ///
4764        /// Returns `None` if the enum contains an unknown value deserialized from
4765        /// the string representation of enums.
4766        pub fn value(&self) -> std::option::Option<i32> {
4767            match self {
4768                Self::Unspecified => std::option::Option::Some(0),
4769                Self::Planned => std::option::Option::Some(1),
4770                Self::InProgress => std::option::Option::Some(2),
4771                Self::Reconciled => std::option::Option::Some(3),
4772                Self::Failed => std::option::Option::Some(4),
4773                Self::UnknownValue(u) => u.0.value(),
4774            }
4775        }
4776
4777        /// Gets the enum value as a string.
4778        ///
4779        /// Returns `None` if the enum contains an unknown value deserialized from
4780        /// the integer representation of enums.
4781        pub fn name(&self) -> std::option::Option<&str> {
4782            match self {
4783                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
4784                Self::Planned => std::option::Option::Some("PLANNED"),
4785                Self::InProgress => std::option::Option::Some("IN_PROGRESS"),
4786                Self::Reconciled => std::option::Option::Some("RECONCILED"),
4787                Self::Failed => std::option::Option::Some("FAILED"),
4788                Self::UnknownValue(u) => u.0.name(),
4789            }
4790        }
4791    }
4792
4793    impl std::default::Default for State {
4794        fn default() -> Self {
4795            use std::convert::From;
4796            Self::from(0)
4797        }
4798    }
4799
4800    impl std::fmt::Display for State {
4801        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4802            wkt::internal::display_enum(f, self.name(), self.value())
4803        }
4804    }
4805
4806    impl std::convert::From<i32> for State {
4807        fn from(value: i32) -> Self {
4808            match value {
4809                0 => Self::Unspecified,
4810                1 => Self::Planned,
4811                2 => Self::InProgress,
4812                3 => Self::Reconciled,
4813                4 => Self::Failed,
4814                _ => Self::UnknownValue(state::UnknownValue(
4815                    wkt::internal::UnknownEnumValue::Integer(value),
4816                )),
4817            }
4818        }
4819    }
4820
4821    impl std::convert::From<&str> for State {
4822        fn from(value: &str) -> Self {
4823            use std::string::ToString;
4824            match value {
4825                "STATE_UNSPECIFIED" => Self::Unspecified,
4826                "PLANNED" => Self::Planned,
4827                "IN_PROGRESS" => Self::InProgress,
4828                "RECONCILED" => Self::Reconciled,
4829                "FAILED" => Self::Failed,
4830                _ => Self::UnknownValue(state::UnknownValue(
4831                    wkt::internal::UnknownEnumValue::String(value.to_string()),
4832                )),
4833            }
4834        }
4835    }
4836
4837    impl serde::ser::Serialize for State {
4838        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4839        where
4840            S: serde::Serializer,
4841        {
4842            match self {
4843                Self::Unspecified => serializer.serialize_i32(0),
4844                Self::Planned => serializer.serialize_i32(1),
4845                Self::InProgress => serializer.serialize_i32(2),
4846                Self::Reconciled => serializer.serialize_i32(3),
4847                Self::Failed => serializer.serialize_i32(4),
4848                Self::UnknownValue(u) => u.0.serialize(serializer),
4849            }
4850        }
4851    }
4852
4853    impl<'de> serde::de::Deserialize<'de> for State {
4854        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4855        where
4856            D: serde::Deserializer<'de>,
4857        {
4858            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
4859                ".google.cloud.config.v1.Resource.State",
4860            ))
4861        }
4862    }
4863}
4864
4865/// Terraform info of a Resource.
4866#[derive(Clone, Default, PartialEq)]
4867#[non_exhaustive]
4868pub struct ResourceTerraformInfo {
4869    /// TF resource address that uniquely identifies this resource within this
4870    /// deployment.
4871    pub address: std::string::String,
4872
4873    /// TF resource type
4874    pub r#type: std::string::String,
4875
4876    /// ID attribute of the TF resource
4877    pub id: std::string::String,
4878
4879    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4880}
4881
4882impl ResourceTerraformInfo {
4883    pub fn new() -> Self {
4884        std::default::Default::default()
4885    }
4886
4887    /// Sets the value of [address][crate::model::ResourceTerraformInfo::address].
4888    ///
4889    /// # Example
4890    /// ```ignore,no_run
4891    /// # use google_cloud_config_v1::model::ResourceTerraformInfo;
4892    /// let x = ResourceTerraformInfo::new().set_address("example");
4893    /// ```
4894    pub fn set_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4895        self.address = v.into();
4896        self
4897    }
4898
4899    /// Sets the value of [r#type][crate::model::ResourceTerraformInfo::type].
4900    ///
4901    /// # Example
4902    /// ```ignore,no_run
4903    /// # use google_cloud_config_v1::model::ResourceTerraformInfo;
4904    /// let x = ResourceTerraformInfo::new().set_type("example");
4905    /// ```
4906    pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4907        self.r#type = v.into();
4908        self
4909    }
4910
4911    /// Sets the value of [id][crate::model::ResourceTerraformInfo::id].
4912    ///
4913    /// # Example
4914    /// ```ignore,no_run
4915    /// # use google_cloud_config_v1::model::ResourceTerraformInfo;
4916    /// let x = ResourceTerraformInfo::new().set_id("example");
4917    /// ```
4918    pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4919        self.id = v.into();
4920        self
4921    }
4922}
4923
4924impl wkt::message::Message for ResourceTerraformInfo {
4925    fn typename() -> &'static str {
4926        "type.googleapis.com/google.cloud.config.v1.ResourceTerraformInfo"
4927    }
4928}
4929
4930/// CAI info of a Resource.
4931#[derive(Clone, Default, PartialEq)]
4932#[non_exhaustive]
4933pub struct ResourceCAIInfo {
4934    /// CAI resource name in the format following
4935    /// <https://cloud.google.com/apis/design/resource_names#full_resource_name>
4936    pub full_resource_name: std::string::String,
4937
4938    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4939}
4940
4941impl ResourceCAIInfo {
4942    pub fn new() -> Self {
4943        std::default::Default::default()
4944    }
4945
4946    /// Sets the value of [full_resource_name][crate::model::ResourceCAIInfo::full_resource_name].
4947    ///
4948    /// # Example
4949    /// ```ignore,no_run
4950    /// # use google_cloud_config_v1::model::ResourceCAIInfo;
4951    /// let x = ResourceCAIInfo::new().set_full_resource_name("example");
4952    /// ```
4953    pub fn set_full_resource_name<T: std::convert::Into<std::string::String>>(
4954        mut self,
4955        v: T,
4956    ) -> Self {
4957        self.full_resource_name = v.into();
4958        self
4959    }
4960}
4961
4962impl wkt::message::Message for ResourceCAIInfo {
4963    fn typename() -> &'static str {
4964        "type.googleapis.com/google.cloud.config.v1.ResourceCAIInfo"
4965    }
4966}
4967
4968/// A request to get a Resource from a 'GetResource' call.
4969#[derive(Clone, Default, PartialEq)]
4970#[non_exhaustive]
4971pub struct GetResourceRequest {
4972    /// Required. The name of the Resource in the format:
4973    /// 'projects/{project_id}/locations/{location}/deployments/{deployment}/revisions/{revision}/resource/{resource}'.
4974    pub name: std::string::String,
4975
4976    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4977}
4978
4979impl GetResourceRequest {
4980    pub fn new() -> Self {
4981        std::default::Default::default()
4982    }
4983
4984    /// Sets the value of [name][crate::model::GetResourceRequest::name].
4985    ///
4986    /// # Example
4987    /// ```ignore,no_run
4988    /// # use google_cloud_config_v1::model::GetResourceRequest;
4989    /// let x = GetResourceRequest::new().set_name("example");
4990    /// ```
4991    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4992        self.name = v.into();
4993        self
4994    }
4995}
4996
4997impl wkt::message::Message for GetResourceRequest {
4998    fn typename() -> &'static str {
4999        "type.googleapis.com/google.cloud.config.v1.GetResourceRequest"
5000    }
5001}
5002
5003/// A request to list Resources passed to a 'ListResources' call.
5004#[derive(Clone, Default, PartialEq)]
5005#[non_exhaustive]
5006pub struct ListResourcesRequest {
5007    /// Required. The parent in whose context the Resources are listed. The parent
5008    /// value is in the format:
5009    /// 'projects/{project_id}/locations/{location}/deployments/{deployment}/revisions/{revision}'.
5010    pub parent: std::string::String,
5011
5012    /// When requesting a page of resources, 'page_size' specifies number of
5013    /// resources to return. If unspecified, at most 500 will be returned. The
5014    /// maximum value is 1000.
5015    pub page_size: i32,
5016
5017    /// Token returned by previous call to 'ListResources' which specifies the
5018    /// position in the list from where to continue listing the resources.
5019    pub page_token: std::string::String,
5020
5021    /// Lists the Resources that match the filter expression. A filter
5022    /// expression filters the resources listed in the response. The expression
5023    /// must be of the form '{field} {operator} {value}' where operators: '<', '>',
5024    /// '<=',
5025    /// '>=',
5026    /// '!=', '=', ':' are supported (colon ':' represents a HAS operator which is
5027    /// roughly synonymous with equality). {field} can refer to a proto or JSON
5028    /// field, or a synthetic field. Field names can be camelCase or snake_case.
5029    ///
5030    /// Examples:
5031    ///
5032    /// - Filter by name:
5033    ///   name =
5034    ///   "projects/foo/locations/us-central1/deployments/dep/revisions/bar/resources/baz
5035    pub filter: std::string::String,
5036
5037    /// Field to use to sort the list.
5038    pub order_by: std::string::String,
5039
5040    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5041}
5042
5043impl ListResourcesRequest {
5044    pub fn new() -> Self {
5045        std::default::Default::default()
5046    }
5047
5048    /// Sets the value of [parent][crate::model::ListResourcesRequest::parent].
5049    ///
5050    /// # Example
5051    /// ```ignore,no_run
5052    /// # use google_cloud_config_v1::model::ListResourcesRequest;
5053    /// let x = ListResourcesRequest::new().set_parent("example");
5054    /// ```
5055    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5056        self.parent = v.into();
5057        self
5058    }
5059
5060    /// Sets the value of [page_size][crate::model::ListResourcesRequest::page_size].
5061    ///
5062    /// # Example
5063    /// ```ignore,no_run
5064    /// # use google_cloud_config_v1::model::ListResourcesRequest;
5065    /// let x = ListResourcesRequest::new().set_page_size(42);
5066    /// ```
5067    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5068        self.page_size = v.into();
5069        self
5070    }
5071
5072    /// Sets the value of [page_token][crate::model::ListResourcesRequest::page_token].
5073    ///
5074    /// # Example
5075    /// ```ignore,no_run
5076    /// # use google_cloud_config_v1::model::ListResourcesRequest;
5077    /// let x = ListResourcesRequest::new().set_page_token("example");
5078    /// ```
5079    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5080        self.page_token = v.into();
5081        self
5082    }
5083
5084    /// Sets the value of [filter][crate::model::ListResourcesRequest::filter].
5085    ///
5086    /// # Example
5087    /// ```ignore,no_run
5088    /// # use google_cloud_config_v1::model::ListResourcesRequest;
5089    /// let x = ListResourcesRequest::new().set_filter("example");
5090    /// ```
5091    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5092        self.filter = v.into();
5093        self
5094    }
5095
5096    /// Sets the value of [order_by][crate::model::ListResourcesRequest::order_by].
5097    ///
5098    /// # Example
5099    /// ```ignore,no_run
5100    /// # use google_cloud_config_v1::model::ListResourcesRequest;
5101    /// let x = ListResourcesRequest::new().set_order_by("example");
5102    /// ```
5103    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5104        self.order_by = v.into();
5105        self
5106    }
5107}
5108
5109impl wkt::message::Message for ListResourcesRequest {
5110    fn typename() -> &'static str {
5111        "type.googleapis.com/google.cloud.config.v1.ListResourcesRequest"
5112    }
5113}
5114
5115/// A response to a 'ListResources' call. Contains a list of Resources.
5116#[derive(Clone, Default, PartialEq)]
5117#[non_exhaustive]
5118pub struct ListResourcesResponse {
5119    /// List of [Resources][google.cloud.config.v1.Resource].
5120    ///
5121    /// [google.cloud.config.v1.Resource]: crate::model::Resource
5122    pub resources: std::vec::Vec<crate::model::Resource>,
5123
5124    /// A token to request the next page of resources from the 'ListResources'
5125    /// method. The value of an empty string means that there are no more resources
5126    /// to return.
5127    pub next_page_token: std::string::String,
5128
5129    /// Locations that could not be reached.
5130    pub unreachable: std::vec::Vec<std::string::String>,
5131
5132    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5133}
5134
5135impl ListResourcesResponse {
5136    pub fn new() -> Self {
5137        std::default::Default::default()
5138    }
5139
5140    /// Sets the value of [resources][crate::model::ListResourcesResponse::resources].
5141    ///
5142    /// # Example
5143    /// ```ignore,no_run
5144    /// # use google_cloud_config_v1::model::ListResourcesResponse;
5145    /// use google_cloud_config_v1::model::Resource;
5146    /// let x = ListResourcesResponse::new()
5147    ///     .set_resources([
5148    ///         Resource::default()/* use setters */,
5149    ///         Resource::default()/* use (different) setters */,
5150    ///     ]);
5151    /// ```
5152    pub fn set_resources<T, V>(mut self, v: T) -> Self
5153    where
5154        T: std::iter::IntoIterator<Item = V>,
5155        V: std::convert::Into<crate::model::Resource>,
5156    {
5157        use std::iter::Iterator;
5158        self.resources = v.into_iter().map(|i| i.into()).collect();
5159        self
5160    }
5161
5162    /// Sets the value of [next_page_token][crate::model::ListResourcesResponse::next_page_token].
5163    ///
5164    /// # Example
5165    /// ```ignore,no_run
5166    /// # use google_cloud_config_v1::model::ListResourcesResponse;
5167    /// let x = ListResourcesResponse::new().set_next_page_token("example");
5168    /// ```
5169    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5170        self.next_page_token = v.into();
5171        self
5172    }
5173
5174    /// Sets the value of [unreachable][crate::model::ListResourcesResponse::unreachable].
5175    ///
5176    /// # Example
5177    /// ```ignore,no_run
5178    /// # use google_cloud_config_v1::model::ListResourcesResponse;
5179    /// let x = ListResourcesResponse::new().set_unreachable(["a", "b", "c"]);
5180    /// ```
5181    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
5182    where
5183        T: std::iter::IntoIterator<Item = V>,
5184        V: std::convert::Into<std::string::String>,
5185    {
5186        use std::iter::Iterator;
5187        self.unreachable = v.into_iter().map(|i| i.into()).collect();
5188        self
5189    }
5190}
5191
5192impl wkt::message::Message for ListResourcesResponse {
5193    fn typename() -> &'static str {
5194        "type.googleapis.com/google.cloud.config.v1.ListResourcesResponse"
5195    }
5196}
5197
5198#[doc(hidden)]
5199impl gax::paginator::internal::PageableResponse for ListResourcesResponse {
5200    type PageItem = crate::model::Resource;
5201
5202    fn items(self) -> std::vec::Vec<Self::PageItem> {
5203        self.resources
5204    }
5205
5206    fn next_page_token(&self) -> std::string::String {
5207        use std::clone::Clone;
5208        self.next_page_token.clone()
5209    }
5210}
5211
5212/// Contains info about a Terraform state file
5213#[derive(Clone, Default, PartialEq)]
5214#[non_exhaustive]
5215pub struct Statefile {
5216    /// Output only. Cloud Storage signed URI used for downloading or uploading the
5217    /// state file.
5218    pub signed_uri: std::string::String,
5219
5220    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5221}
5222
5223impl Statefile {
5224    pub fn new() -> Self {
5225        std::default::Default::default()
5226    }
5227
5228    /// Sets the value of [signed_uri][crate::model::Statefile::signed_uri].
5229    ///
5230    /// # Example
5231    /// ```ignore,no_run
5232    /// # use google_cloud_config_v1::model::Statefile;
5233    /// let x = Statefile::new().set_signed_uri("example");
5234    /// ```
5235    pub fn set_signed_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5236        self.signed_uri = v.into();
5237        self
5238    }
5239}
5240
5241impl wkt::message::Message for Statefile {
5242    fn typename() -> &'static str {
5243        "type.googleapis.com/google.cloud.config.v1.Statefile"
5244    }
5245}
5246
5247/// A request to export a state file passed to a 'ExportDeploymentStatefile'
5248/// call.
5249#[derive(Clone, Default, PartialEq)]
5250#[non_exhaustive]
5251pub struct ExportDeploymentStatefileRequest {
5252    /// Required. The parent in whose context the statefile is listed. The parent
5253    /// value is in the format:
5254    /// 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
5255    pub parent: std::string::String,
5256
5257    /// Optional. If this flag is set to true, the exported deployment state file
5258    /// will be the draft state. This will enable the draft file to be validated
5259    /// before copying it over to the working state on unlock.
5260    pub draft: bool,
5261
5262    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5263}
5264
5265impl ExportDeploymentStatefileRequest {
5266    pub fn new() -> Self {
5267        std::default::Default::default()
5268    }
5269
5270    /// Sets the value of [parent][crate::model::ExportDeploymentStatefileRequest::parent].
5271    ///
5272    /// # Example
5273    /// ```ignore,no_run
5274    /// # use google_cloud_config_v1::model::ExportDeploymentStatefileRequest;
5275    /// let x = ExportDeploymentStatefileRequest::new().set_parent("example");
5276    /// ```
5277    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5278        self.parent = v.into();
5279        self
5280    }
5281
5282    /// Sets the value of [draft][crate::model::ExportDeploymentStatefileRequest::draft].
5283    ///
5284    /// # Example
5285    /// ```ignore,no_run
5286    /// # use google_cloud_config_v1::model::ExportDeploymentStatefileRequest;
5287    /// let x = ExportDeploymentStatefileRequest::new().set_draft(true);
5288    /// ```
5289    pub fn set_draft<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5290        self.draft = v.into();
5291        self
5292    }
5293}
5294
5295impl wkt::message::Message for ExportDeploymentStatefileRequest {
5296    fn typename() -> &'static str {
5297        "type.googleapis.com/google.cloud.config.v1.ExportDeploymentStatefileRequest"
5298    }
5299}
5300
5301/// A request to export a state file passed to a 'ExportRevisionStatefile'
5302/// call.
5303#[derive(Clone, Default, PartialEq)]
5304#[non_exhaustive]
5305pub struct ExportRevisionStatefileRequest {
5306    /// Required. The parent in whose context the statefile is listed. The parent
5307    /// value is in the format:
5308    /// 'projects/{project_id}/locations/{location}/deployments/{deployment}/revisions/{revision}'.
5309    pub parent: std::string::String,
5310
5311    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5312}
5313
5314impl ExportRevisionStatefileRequest {
5315    pub fn new() -> Self {
5316        std::default::Default::default()
5317    }
5318
5319    /// Sets the value of [parent][crate::model::ExportRevisionStatefileRequest::parent].
5320    ///
5321    /// # Example
5322    /// ```ignore,no_run
5323    /// # use google_cloud_config_v1::model::ExportRevisionStatefileRequest;
5324    /// let x = ExportRevisionStatefileRequest::new().set_parent("example");
5325    /// ```
5326    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5327        self.parent = v.into();
5328        self
5329    }
5330}
5331
5332impl wkt::message::Message for ExportRevisionStatefileRequest {
5333    fn typename() -> &'static str {
5334        "type.googleapis.com/google.cloud.config.v1.ExportRevisionStatefileRequest"
5335    }
5336}
5337
5338/// A request to import a state file passed to a 'ImportStatefile' call.
5339#[derive(Clone, Default, PartialEq)]
5340#[non_exhaustive]
5341pub struct ImportStatefileRequest {
5342    /// Required. The parent in whose context the statefile is listed. The parent
5343    /// value is in the format:
5344    /// 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
5345    pub parent: std::string::String,
5346
5347    /// Required. Lock ID of the lock file to verify that the user who is importing
5348    /// the state file previously locked the Deployment.
5349    pub lock_id: i64,
5350
5351    /// Optional.
5352    pub skip_draft: bool,
5353
5354    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5355}
5356
5357impl ImportStatefileRequest {
5358    pub fn new() -> Self {
5359        std::default::Default::default()
5360    }
5361
5362    /// Sets the value of [parent][crate::model::ImportStatefileRequest::parent].
5363    ///
5364    /// # Example
5365    /// ```ignore,no_run
5366    /// # use google_cloud_config_v1::model::ImportStatefileRequest;
5367    /// let x = ImportStatefileRequest::new().set_parent("example");
5368    /// ```
5369    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5370        self.parent = v.into();
5371        self
5372    }
5373
5374    /// Sets the value of [lock_id][crate::model::ImportStatefileRequest::lock_id].
5375    ///
5376    /// # Example
5377    /// ```ignore,no_run
5378    /// # use google_cloud_config_v1::model::ImportStatefileRequest;
5379    /// let x = ImportStatefileRequest::new().set_lock_id(42);
5380    /// ```
5381    pub fn set_lock_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
5382        self.lock_id = v.into();
5383        self
5384    }
5385
5386    /// Sets the value of [skip_draft][crate::model::ImportStatefileRequest::skip_draft].
5387    ///
5388    /// # Example
5389    /// ```ignore,no_run
5390    /// # use google_cloud_config_v1::model::ImportStatefileRequest;
5391    /// let x = ImportStatefileRequest::new().set_skip_draft(true);
5392    /// ```
5393    pub fn set_skip_draft<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5394        self.skip_draft = v.into();
5395        self
5396    }
5397}
5398
5399impl wkt::message::Message for ImportStatefileRequest {
5400    fn typename() -> &'static str {
5401        "type.googleapis.com/google.cloud.config.v1.ImportStatefileRequest"
5402    }
5403}
5404
5405/// A request to delete a state file passed to a 'DeleteStatefile' call.
5406#[derive(Clone, Default, PartialEq)]
5407#[non_exhaustive]
5408pub struct DeleteStatefileRequest {
5409    /// Required. The name of the deployment in the format:
5410    /// 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
5411    pub name: std::string::String,
5412
5413    /// Required. Lock ID of the lock file to verify that the user who is deleting
5414    /// the state file previously locked the Deployment.
5415    pub lock_id: i64,
5416
5417    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5418}
5419
5420impl DeleteStatefileRequest {
5421    pub fn new() -> Self {
5422        std::default::Default::default()
5423    }
5424
5425    /// Sets the value of [name][crate::model::DeleteStatefileRequest::name].
5426    ///
5427    /// # Example
5428    /// ```ignore,no_run
5429    /// # use google_cloud_config_v1::model::DeleteStatefileRequest;
5430    /// let x = DeleteStatefileRequest::new().set_name("example");
5431    /// ```
5432    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5433        self.name = v.into();
5434        self
5435    }
5436
5437    /// Sets the value of [lock_id][crate::model::DeleteStatefileRequest::lock_id].
5438    ///
5439    /// # Example
5440    /// ```ignore,no_run
5441    /// # use google_cloud_config_v1::model::DeleteStatefileRequest;
5442    /// let x = DeleteStatefileRequest::new().set_lock_id(42);
5443    /// ```
5444    pub fn set_lock_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
5445        self.lock_id = v.into();
5446        self
5447    }
5448}
5449
5450impl wkt::message::Message for DeleteStatefileRequest {
5451    fn typename() -> &'static str {
5452        "type.googleapis.com/google.cloud.config.v1.DeleteStatefileRequest"
5453    }
5454}
5455
5456/// A request to lock a deployment passed to a 'LockDeployment' call.
5457#[derive(Clone, Default, PartialEq)]
5458#[non_exhaustive]
5459pub struct LockDeploymentRequest {
5460    /// Required. The name of the deployment in the format:
5461    /// 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
5462    pub name: std::string::String,
5463
5464    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5465}
5466
5467impl LockDeploymentRequest {
5468    pub fn new() -> Self {
5469        std::default::Default::default()
5470    }
5471
5472    /// Sets the value of [name][crate::model::LockDeploymentRequest::name].
5473    ///
5474    /// # Example
5475    /// ```ignore,no_run
5476    /// # use google_cloud_config_v1::model::LockDeploymentRequest;
5477    /// let x = LockDeploymentRequest::new().set_name("example");
5478    /// ```
5479    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5480        self.name = v.into();
5481        self
5482    }
5483}
5484
5485impl wkt::message::Message for LockDeploymentRequest {
5486    fn typename() -> &'static str {
5487        "type.googleapis.com/google.cloud.config.v1.LockDeploymentRequest"
5488    }
5489}
5490
5491/// A request to unlock a state file passed to a 'UnlockDeployment' call.
5492#[derive(Clone, Default, PartialEq)]
5493#[non_exhaustive]
5494pub struct UnlockDeploymentRequest {
5495    /// Required. The name of the deployment in the format:
5496    /// 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
5497    pub name: std::string::String,
5498
5499    /// Required. Lock ID of the lock file to be unlocked.
5500    pub lock_id: i64,
5501
5502    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5503}
5504
5505impl UnlockDeploymentRequest {
5506    pub fn new() -> Self {
5507        std::default::Default::default()
5508    }
5509
5510    /// Sets the value of [name][crate::model::UnlockDeploymentRequest::name].
5511    ///
5512    /// # Example
5513    /// ```ignore,no_run
5514    /// # use google_cloud_config_v1::model::UnlockDeploymentRequest;
5515    /// let x = UnlockDeploymentRequest::new().set_name("example");
5516    /// ```
5517    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5518        self.name = v.into();
5519        self
5520    }
5521
5522    /// Sets the value of [lock_id][crate::model::UnlockDeploymentRequest::lock_id].
5523    ///
5524    /// # Example
5525    /// ```ignore,no_run
5526    /// # use google_cloud_config_v1::model::UnlockDeploymentRequest;
5527    /// let x = UnlockDeploymentRequest::new().set_lock_id(42);
5528    /// ```
5529    pub fn set_lock_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
5530        self.lock_id = v.into();
5531        self
5532    }
5533}
5534
5535impl wkt::message::Message for UnlockDeploymentRequest {
5536    fn typename() -> &'static str {
5537        "type.googleapis.com/google.cloud.config.v1.UnlockDeploymentRequest"
5538    }
5539}
5540
5541/// A request to get a state file lock info passed to a 'ExportLockInfo' call.
5542#[derive(Clone, Default, PartialEq)]
5543#[non_exhaustive]
5544pub struct ExportLockInfoRequest {
5545    /// Required. The name of the deployment in the format:
5546    /// 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
5547    pub name: std::string::String,
5548
5549    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5550}
5551
5552impl ExportLockInfoRequest {
5553    pub fn new() -> Self {
5554        std::default::Default::default()
5555    }
5556
5557    /// Sets the value of [name][crate::model::ExportLockInfoRequest::name].
5558    ///
5559    /// # Example
5560    /// ```ignore,no_run
5561    /// # use google_cloud_config_v1::model::ExportLockInfoRequest;
5562    /// let x = ExportLockInfoRequest::new().set_name("example");
5563    /// ```
5564    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5565        self.name = v.into();
5566        self
5567    }
5568}
5569
5570impl wkt::message::Message for ExportLockInfoRequest {
5571    fn typename() -> &'static str {
5572        "type.googleapis.com/google.cloud.config.v1.ExportLockInfoRequest"
5573    }
5574}
5575
5576/// Details about the lock which locked the deployment.
5577#[derive(Clone, Default, PartialEq)]
5578#[non_exhaustive]
5579pub struct LockInfo {
5580    /// Unique ID for the lock to be overridden with generation ID in the backend.
5581    pub lock_id: i64,
5582
5583    /// Terraform operation, provided by the caller.
5584    pub operation: std::string::String,
5585
5586    /// Extra information to store with the lock, provided by the caller.
5587    pub info: std::string::String,
5588
5589    /// user@hostname when available
5590    pub who: std::string::String,
5591
5592    /// Terraform version
5593    pub version: std::string::String,
5594
5595    /// Time that the lock was taken.
5596    pub create_time: std::option::Option<wkt::Timestamp>,
5597
5598    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5599}
5600
5601impl LockInfo {
5602    pub fn new() -> Self {
5603        std::default::Default::default()
5604    }
5605
5606    /// Sets the value of [lock_id][crate::model::LockInfo::lock_id].
5607    ///
5608    /// # Example
5609    /// ```ignore,no_run
5610    /// # use google_cloud_config_v1::model::LockInfo;
5611    /// let x = LockInfo::new().set_lock_id(42);
5612    /// ```
5613    pub fn set_lock_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
5614        self.lock_id = v.into();
5615        self
5616    }
5617
5618    /// Sets the value of [operation][crate::model::LockInfo::operation].
5619    ///
5620    /// # Example
5621    /// ```ignore,no_run
5622    /// # use google_cloud_config_v1::model::LockInfo;
5623    /// let x = LockInfo::new().set_operation("example");
5624    /// ```
5625    pub fn set_operation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5626        self.operation = v.into();
5627        self
5628    }
5629
5630    /// Sets the value of [info][crate::model::LockInfo::info].
5631    ///
5632    /// # Example
5633    /// ```ignore,no_run
5634    /// # use google_cloud_config_v1::model::LockInfo;
5635    /// let x = LockInfo::new().set_info("example");
5636    /// ```
5637    pub fn set_info<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5638        self.info = v.into();
5639        self
5640    }
5641
5642    /// Sets the value of [who][crate::model::LockInfo::who].
5643    ///
5644    /// # Example
5645    /// ```ignore,no_run
5646    /// # use google_cloud_config_v1::model::LockInfo;
5647    /// let x = LockInfo::new().set_who("example");
5648    /// ```
5649    pub fn set_who<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5650        self.who = v.into();
5651        self
5652    }
5653
5654    /// Sets the value of [version][crate::model::LockInfo::version].
5655    ///
5656    /// # Example
5657    /// ```ignore,no_run
5658    /// # use google_cloud_config_v1::model::LockInfo;
5659    /// let x = LockInfo::new().set_version("example");
5660    /// ```
5661    pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5662        self.version = v.into();
5663        self
5664    }
5665
5666    /// Sets the value of [create_time][crate::model::LockInfo::create_time].
5667    ///
5668    /// # Example
5669    /// ```ignore,no_run
5670    /// # use google_cloud_config_v1::model::LockInfo;
5671    /// use wkt::Timestamp;
5672    /// let x = LockInfo::new().set_create_time(Timestamp::default()/* use setters */);
5673    /// ```
5674    pub fn set_create_time<T>(mut self, v: T) -> Self
5675    where
5676        T: std::convert::Into<wkt::Timestamp>,
5677    {
5678        self.create_time = std::option::Option::Some(v.into());
5679        self
5680    }
5681
5682    /// Sets or clears the value of [create_time][crate::model::LockInfo::create_time].
5683    ///
5684    /// # Example
5685    /// ```ignore,no_run
5686    /// # use google_cloud_config_v1::model::LockInfo;
5687    /// use wkt::Timestamp;
5688    /// let x = LockInfo::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
5689    /// let x = LockInfo::new().set_or_clear_create_time(None::<Timestamp>);
5690    /// ```
5691    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
5692    where
5693        T: std::convert::Into<wkt::Timestamp>,
5694    {
5695        self.create_time = v.map(|x| x.into());
5696        self
5697    }
5698}
5699
5700impl wkt::message::Message for LockInfo {
5701    fn typename() -> &'static str {
5702        "type.googleapis.com/google.cloud.config.v1.LockInfo"
5703    }
5704}
5705
5706/// A preview represents a set of actions Infra Manager would perform
5707/// to move the resources towards the desired state as specified in the
5708/// configuration.
5709#[derive(Clone, Default, PartialEq)]
5710#[non_exhaustive]
5711pub struct Preview {
5712    /// Identifier. Resource name of the preview. Resource name can be user
5713    /// provided or server generated ID if unspecified. Format:
5714    /// `projects/{project}/locations/{location}/previews/{preview}`
5715    pub name: std::string::String,
5716
5717    /// Output only. Time the preview was created.
5718    pub create_time: std::option::Option<wkt::Timestamp>,
5719
5720    /// Optional. User-defined labels for the preview.
5721    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
5722
5723    /// Output only. Current state of the preview.
5724    pub state: crate::model::preview::State,
5725
5726    /// Optional. Optional deployment reference. If specified, the preview will be
5727    /// performed using the provided deployment's current state and use any
5728    /// relevant fields from the deployment unless explicitly specified in the
5729    /// preview create request.
5730    pub deployment: std::string::String,
5731
5732    /// Optional. Current mode of preview.
5733    pub preview_mode: crate::model::preview::PreviewMode,
5734
5735    /// Required. User-specified Service Account (SA) credentials to be used when
5736    /// previewing resources.
5737    /// Format: `projects/{projectID}/serviceAccounts/{serviceAccount}`
5738    pub service_account: std::string::String,
5739
5740    /// Optional. User-defined location of Cloud Build logs, artifacts, and
5741    /// in Google Cloud Storage.
5742    /// Format: `gs://{bucket}/{folder}`
5743    /// A default bucket will be bootstrapped if the field is not set or empty
5744    /// Default Bucket Format: `gs://<project number>-<region>-blueprint-config`
5745    /// Constraints:
5746    ///
5747    /// - The bucket needs to be in the same project as the deployment
5748    /// - The path cannot be within the path of `gcs_source`
5749    ///   If omitted and deployment resource ref provided has artifacts_gcs_bucket
5750    ///   defined, that artifact bucket is used.
5751    pub artifacts_gcs_bucket: std::option::Option<std::string::String>,
5752
5753    /// Optional. The user-specified Worker Pool resource in which the Cloud Build
5754    /// job will execute. Format
5755    /// projects/{project}/locations/{location}/workerPools/{workerPoolId} If this
5756    /// field is unspecified, the default Cloud Build worker pool will be used. If
5757    /// omitted and deployment resource ref provided has worker_pool defined, that
5758    /// worker pool is used.
5759    pub worker_pool: std::option::Option<std::string::String>,
5760
5761    /// Output only. Code describing any errors that may have occurred.
5762    pub error_code: crate::model::preview::ErrorCode,
5763
5764    /// Output only. Additional information regarding the current state.
5765    pub error_status: std::option::Option<rpc::model::Status>,
5766
5767    /// Output only. Cloud Build instance UUID associated with this preview.
5768    pub build: std::string::String,
5769
5770    /// Output only. Summary of errors encountered during Terraform preview.
5771    /// It has a size limit of 10, i.e. only top 10 errors will be summarized here.
5772    pub tf_errors: std::vec::Vec<crate::model::TerraformError>,
5773
5774    /// Output only. Link to tf-error.ndjson file, which contains the full list of
5775    /// the errors encountered during a Terraform preview.
5776    /// Format: `gs://{bucket}/{object}`.
5777    pub error_logs: std::string::String,
5778
5779    /// Output only. Artifacts from preview.
5780    pub preview_artifacts: std::option::Option<crate::model::PreviewArtifacts>,
5781
5782    /// Output only. Location of preview logs in `gs://{bucket}/{object}` format.
5783    pub logs: std::string::String,
5784
5785    /// Output only. The current Terraform version set on the preview.
5786    /// It is in the format of "Major.Minor.Patch", for example, "1.3.10".
5787    pub tf_version: std::string::String,
5788
5789    /// Optional. The user-specified Terraform version constraint.
5790    /// Example: "=1.3.10".
5791    pub tf_version_constraint: std::option::Option<std::string::String>,
5792
5793    /// Optional. Arbitrary key-value metadata storage e.g. to help client tools
5794    /// identify preview during automation. See
5795    /// <https://google.aip.dev/148#annotations> for details on format and size
5796    /// limitations.
5797    pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
5798
5799    /// Optional. This field specifies the provider configurations.
5800    pub provider_config: std::option::Option<crate::model::ProviderConfig>,
5801
5802    /// Blueprint to preview.
5803    pub blueprint: std::option::Option<crate::model::preview::Blueprint>,
5804
5805    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5806}
5807
5808impl Preview {
5809    pub fn new() -> Self {
5810        std::default::Default::default()
5811    }
5812
5813    /// Sets the value of [name][crate::model::Preview::name].
5814    ///
5815    /// # Example
5816    /// ```ignore,no_run
5817    /// # use google_cloud_config_v1::model::Preview;
5818    /// let x = Preview::new().set_name("example");
5819    /// ```
5820    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5821        self.name = v.into();
5822        self
5823    }
5824
5825    /// Sets the value of [create_time][crate::model::Preview::create_time].
5826    ///
5827    /// # Example
5828    /// ```ignore,no_run
5829    /// # use google_cloud_config_v1::model::Preview;
5830    /// use wkt::Timestamp;
5831    /// let x = Preview::new().set_create_time(Timestamp::default()/* use setters */);
5832    /// ```
5833    pub fn set_create_time<T>(mut self, v: T) -> Self
5834    where
5835        T: std::convert::Into<wkt::Timestamp>,
5836    {
5837        self.create_time = std::option::Option::Some(v.into());
5838        self
5839    }
5840
5841    /// Sets or clears the value of [create_time][crate::model::Preview::create_time].
5842    ///
5843    /// # Example
5844    /// ```ignore,no_run
5845    /// # use google_cloud_config_v1::model::Preview;
5846    /// use wkt::Timestamp;
5847    /// let x = Preview::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
5848    /// let x = Preview::new().set_or_clear_create_time(None::<Timestamp>);
5849    /// ```
5850    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
5851    where
5852        T: std::convert::Into<wkt::Timestamp>,
5853    {
5854        self.create_time = v.map(|x| x.into());
5855        self
5856    }
5857
5858    /// Sets the value of [labels][crate::model::Preview::labels].
5859    ///
5860    /// # Example
5861    /// ```ignore,no_run
5862    /// # use google_cloud_config_v1::model::Preview;
5863    /// let x = Preview::new().set_labels([
5864    ///     ("key0", "abc"),
5865    ///     ("key1", "xyz"),
5866    /// ]);
5867    /// ```
5868    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
5869    where
5870        T: std::iter::IntoIterator<Item = (K, V)>,
5871        K: std::convert::Into<std::string::String>,
5872        V: std::convert::Into<std::string::String>,
5873    {
5874        use std::iter::Iterator;
5875        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5876        self
5877    }
5878
5879    /// Sets the value of [state][crate::model::Preview::state].
5880    ///
5881    /// # Example
5882    /// ```ignore,no_run
5883    /// # use google_cloud_config_v1::model::Preview;
5884    /// use google_cloud_config_v1::model::preview::State;
5885    /// let x0 = Preview::new().set_state(State::Creating);
5886    /// let x1 = Preview::new().set_state(State::Succeeded);
5887    /// let x2 = Preview::new().set_state(State::Applying);
5888    /// ```
5889    pub fn set_state<T: std::convert::Into<crate::model::preview::State>>(mut self, v: T) -> Self {
5890        self.state = v.into();
5891        self
5892    }
5893
5894    /// Sets the value of [deployment][crate::model::Preview::deployment].
5895    ///
5896    /// # Example
5897    /// ```ignore,no_run
5898    /// # use google_cloud_config_v1::model::Preview;
5899    /// let x = Preview::new().set_deployment("example");
5900    /// ```
5901    pub fn set_deployment<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5902        self.deployment = v.into();
5903        self
5904    }
5905
5906    /// Sets the value of [preview_mode][crate::model::Preview::preview_mode].
5907    ///
5908    /// # Example
5909    /// ```ignore,no_run
5910    /// # use google_cloud_config_v1::model::Preview;
5911    /// use google_cloud_config_v1::model::preview::PreviewMode;
5912    /// let x0 = Preview::new().set_preview_mode(PreviewMode::Default);
5913    /// let x1 = Preview::new().set_preview_mode(PreviewMode::Delete);
5914    /// ```
5915    pub fn set_preview_mode<T: std::convert::Into<crate::model::preview::PreviewMode>>(
5916        mut self,
5917        v: T,
5918    ) -> Self {
5919        self.preview_mode = v.into();
5920        self
5921    }
5922
5923    /// Sets the value of [service_account][crate::model::Preview::service_account].
5924    ///
5925    /// # Example
5926    /// ```ignore,no_run
5927    /// # use google_cloud_config_v1::model::Preview;
5928    /// let x = Preview::new().set_service_account("example");
5929    /// ```
5930    pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5931        self.service_account = v.into();
5932        self
5933    }
5934
5935    /// Sets the value of [artifacts_gcs_bucket][crate::model::Preview::artifacts_gcs_bucket].
5936    ///
5937    /// # Example
5938    /// ```ignore,no_run
5939    /// # use google_cloud_config_v1::model::Preview;
5940    /// let x = Preview::new().set_artifacts_gcs_bucket("example");
5941    /// ```
5942    pub fn set_artifacts_gcs_bucket<T>(mut self, v: T) -> Self
5943    where
5944        T: std::convert::Into<std::string::String>,
5945    {
5946        self.artifacts_gcs_bucket = std::option::Option::Some(v.into());
5947        self
5948    }
5949
5950    /// Sets or clears the value of [artifacts_gcs_bucket][crate::model::Preview::artifacts_gcs_bucket].
5951    ///
5952    /// # Example
5953    /// ```ignore,no_run
5954    /// # use google_cloud_config_v1::model::Preview;
5955    /// let x = Preview::new().set_or_clear_artifacts_gcs_bucket(Some("example"));
5956    /// let x = Preview::new().set_or_clear_artifacts_gcs_bucket(None::<String>);
5957    /// ```
5958    pub fn set_or_clear_artifacts_gcs_bucket<T>(mut self, v: std::option::Option<T>) -> Self
5959    where
5960        T: std::convert::Into<std::string::String>,
5961    {
5962        self.artifacts_gcs_bucket = v.map(|x| x.into());
5963        self
5964    }
5965
5966    /// Sets the value of [worker_pool][crate::model::Preview::worker_pool].
5967    ///
5968    /// # Example
5969    /// ```ignore,no_run
5970    /// # use google_cloud_config_v1::model::Preview;
5971    /// let x = Preview::new().set_worker_pool("example");
5972    /// ```
5973    pub fn set_worker_pool<T>(mut self, v: T) -> Self
5974    where
5975        T: std::convert::Into<std::string::String>,
5976    {
5977        self.worker_pool = std::option::Option::Some(v.into());
5978        self
5979    }
5980
5981    /// Sets or clears the value of [worker_pool][crate::model::Preview::worker_pool].
5982    ///
5983    /// # Example
5984    /// ```ignore,no_run
5985    /// # use google_cloud_config_v1::model::Preview;
5986    /// let x = Preview::new().set_or_clear_worker_pool(Some("example"));
5987    /// let x = Preview::new().set_or_clear_worker_pool(None::<String>);
5988    /// ```
5989    pub fn set_or_clear_worker_pool<T>(mut self, v: std::option::Option<T>) -> Self
5990    where
5991        T: std::convert::Into<std::string::String>,
5992    {
5993        self.worker_pool = v.map(|x| x.into());
5994        self
5995    }
5996
5997    /// Sets the value of [error_code][crate::model::Preview::error_code].
5998    ///
5999    /// # Example
6000    /// ```ignore,no_run
6001    /// # use google_cloud_config_v1::model::Preview;
6002    /// use google_cloud_config_v1::model::preview::ErrorCode;
6003    /// let x0 = Preview::new().set_error_code(ErrorCode::CloudBuildPermissionDenied);
6004    /// let x1 = Preview::new().set_error_code(ErrorCode::BucketCreationPermissionDenied);
6005    /// let x2 = Preview::new().set_error_code(ErrorCode::BucketCreationFailed);
6006    /// ```
6007    pub fn set_error_code<T: std::convert::Into<crate::model::preview::ErrorCode>>(
6008        mut self,
6009        v: T,
6010    ) -> Self {
6011        self.error_code = v.into();
6012        self
6013    }
6014
6015    /// Sets the value of [error_status][crate::model::Preview::error_status].
6016    ///
6017    /// # Example
6018    /// ```ignore,no_run
6019    /// # use google_cloud_config_v1::model::Preview;
6020    /// use rpc::model::Status;
6021    /// let x = Preview::new().set_error_status(Status::default()/* use setters */);
6022    /// ```
6023    pub fn set_error_status<T>(mut self, v: T) -> Self
6024    where
6025        T: std::convert::Into<rpc::model::Status>,
6026    {
6027        self.error_status = std::option::Option::Some(v.into());
6028        self
6029    }
6030
6031    /// Sets or clears the value of [error_status][crate::model::Preview::error_status].
6032    ///
6033    /// # Example
6034    /// ```ignore,no_run
6035    /// # use google_cloud_config_v1::model::Preview;
6036    /// use rpc::model::Status;
6037    /// let x = Preview::new().set_or_clear_error_status(Some(Status::default()/* use setters */));
6038    /// let x = Preview::new().set_or_clear_error_status(None::<Status>);
6039    /// ```
6040    pub fn set_or_clear_error_status<T>(mut self, v: std::option::Option<T>) -> Self
6041    where
6042        T: std::convert::Into<rpc::model::Status>,
6043    {
6044        self.error_status = v.map(|x| x.into());
6045        self
6046    }
6047
6048    /// Sets the value of [build][crate::model::Preview::build].
6049    ///
6050    /// # Example
6051    /// ```ignore,no_run
6052    /// # use google_cloud_config_v1::model::Preview;
6053    /// let x = Preview::new().set_build("example");
6054    /// ```
6055    pub fn set_build<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6056        self.build = v.into();
6057        self
6058    }
6059
6060    /// Sets the value of [tf_errors][crate::model::Preview::tf_errors].
6061    ///
6062    /// # Example
6063    /// ```ignore,no_run
6064    /// # use google_cloud_config_v1::model::Preview;
6065    /// use google_cloud_config_v1::model::TerraformError;
6066    /// let x = Preview::new()
6067    ///     .set_tf_errors([
6068    ///         TerraformError::default()/* use setters */,
6069    ///         TerraformError::default()/* use (different) setters */,
6070    ///     ]);
6071    /// ```
6072    pub fn set_tf_errors<T, V>(mut self, v: T) -> Self
6073    where
6074        T: std::iter::IntoIterator<Item = V>,
6075        V: std::convert::Into<crate::model::TerraformError>,
6076    {
6077        use std::iter::Iterator;
6078        self.tf_errors = v.into_iter().map(|i| i.into()).collect();
6079        self
6080    }
6081
6082    /// Sets the value of [error_logs][crate::model::Preview::error_logs].
6083    ///
6084    /// # Example
6085    /// ```ignore,no_run
6086    /// # use google_cloud_config_v1::model::Preview;
6087    /// let x = Preview::new().set_error_logs("example");
6088    /// ```
6089    pub fn set_error_logs<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6090        self.error_logs = v.into();
6091        self
6092    }
6093
6094    /// Sets the value of [preview_artifacts][crate::model::Preview::preview_artifacts].
6095    ///
6096    /// # Example
6097    /// ```ignore,no_run
6098    /// # use google_cloud_config_v1::model::Preview;
6099    /// use google_cloud_config_v1::model::PreviewArtifacts;
6100    /// let x = Preview::new().set_preview_artifacts(PreviewArtifacts::default()/* use setters */);
6101    /// ```
6102    pub fn set_preview_artifacts<T>(mut self, v: T) -> Self
6103    where
6104        T: std::convert::Into<crate::model::PreviewArtifacts>,
6105    {
6106        self.preview_artifacts = std::option::Option::Some(v.into());
6107        self
6108    }
6109
6110    /// Sets or clears the value of [preview_artifacts][crate::model::Preview::preview_artifacts].
6111    ///
6112    /// # Example
6113    /// ```ignore,no_run
6114    /// # use google_cloud_config_v1::model::Preview;
6115    /// use google_cloud_config_v1::model::PreviewArtifacts;
6116    /// let x = Preview::new().set_or_clear_preview_artifacts(Some(PreviewArtifacts::default()/* use setters */));
6117    /// let x = Preview::new().set_or_clear_preview_artifacts(None::<PreviewArtifacts>);
6118    /// ```
6119    pub fn set_or_clear_preview_artifacts<T>(mut self, v: std::option::Option<T>) -> Self
6120    where
6121        T: std::convert::Into<crate::model::PreviewArtifacts>,
6122    {
6123        self.preview_artifacts = v.map(|x| x.into());
6124        self
6125    }
6126
6127    /// Sets the value of [logs][crate::model::Preview::logs].
6128    ///
6129    /// # Example
6130    /// ```ignore,no_run
6131    /// # use google_cloud_config_v1::model::Preview;
6132    /// let x = Preview::new().set_logs("example");
6133    /// ```
6134    pub fn set_logs<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6135        self.logs = v.into();
6136        self
6137    }
6138
6139    /// Sets the value of [tf_version][crate::model::Preview::tf_version].
6140    ///
6141    /// # Example
6142    /// ```ignore,no_run
6143    /// # use google_cloud_config_v1::model::Preview;
6144    /// let x = Preview::new().set_tf_version("example");
6145    /// ```
6146    pub fn set_tf_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6147        self.tf_version = v.into();
6148        self
6149    }
6150
6151    /// Sets the value of [tf_version_constraint][crate::model::Preview::tf_version_constraint].
6152    ///
6153    /// # Example
6154    /// ```ignore,no_run
6155    /// # use google_cloud_config_v1::model::Preview;
6156    /// let x = Preview::new().set_tf_version_constraint("example");
6157    /// ```
6158    pub fn set_tf_version_constraint<T>(mut self, v: T) -> Self
6159    where
6160        T: std::convert::Into<std::string::String>,
6161    {
6162        self.tf_version_constraint = std::option::Option::Some(v.into());
6163        self
6164    }
6165
6166    /// Sets or clears the value of [tf_version_constraint][crate::model::Preview::tf_version_constraint].
6167    ///
6168    /// # Example
6169    /// ```ignore,no_run
6170    /// # use google_cloud_config_v1::model::Preview;
6171    /// let x = Preview::new().set_or_clear_tf_version_constraint(Some("example"));
6172    /// let x = Preview::new().set_or_clear_tf_version_constraint(None::<String>);
6173    /// ```
6174    pub fn set_or_clear_tf_version_constraint<T>(mut self, v: std::option::Option<T>) -> Self
6175    where
6176        T: std::convert::Into<std::string::String>,
6177    {
6178        self.tf_version_constraint = v.map(|x| x.into());
6179        self
6180    }
6181
6182    /// Sets the value of [annotations][crate::model::Preview::annotations].
6183    ///
6184    /// # Example
6185    /// ```ignore,no_run
6186    /// # use google_cloud_config_v1::model::Preview;
6187    /// let x = Preview::new().set_annotations([
6188    ///     ("key0", "abc"),
6189    ///     ("key1", "xyz"),
6190    /// ]);
6191    /// ```
6192    pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
6193    where
6194        T: std::iter::IntoIterator<Item = (K, V)>,
6195        K: std::convert::Into<std::string::String>,
6196        V: std::convert::Into<std::string::String>,
6197    {
6198        use std::iter::Iterator;
6199        self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
6200        self
6201    }
6202
6203    /// Sets the value of [provider_config][crate::model::Preview::provider_config].
6204    ///
6205    /// # Example
6206    /// ```ignore,no_run
6207    /// # use google_cloud_config_v1::model::Preview;
6208    /// use google_cloud_config_v1::model::ProviderConfig;
6209    /// let x = Preview::new().set_provider_config(ProviderConfig::default()/* use setters */);
6210    /// ```
6211    pub fn set_provider_config<T>(mut self, v: T) -> Self
6212    where
6213        T: std::convert::Into<crate::model::ProviderConfig>,
6214    {
6215        self.provider_config = std::option::Option::Some(v.into());
6216        self
6217    }
6218
6219    /// Sets or clears the value of [provider_config][crate::model::Preview::provider_config].
6220    ///
6221    /// # Example
6222    /// ```ignore,no_run
6223    /// # use google_cloud_config_v1::model::Preview;
6224    /// use google_cloud_config_v1::model::ProviderConfig;
6225    /// let x = Preview::new().set_or_clear_provider_config(Some(ProviderConfig::default()/* use setters */));
6226    /// let x = Preview::new().set_or_clear_provider_config(None::<ProviderConfig>);
6227    /// ```
6228    pub fn set_or_clear_provider_config<T>(mut self, v: std::option::Option<T>) -> Self
6229    where
6230        T: std::convert::Into<crate::model::ProviderConfig>,
6231    {
6232        self.provider_config = v.map(|x| x.into());
6233        self
6234    }
6235
6236    /// Sets the value of [blueprint][crate::model::Preview::blueprint].
6237    ///
6238    /// Note that all the setters affecting `blueprint` are mutually
6239    /// exclusive.
6240    ///
6241    /// # Example
6242    /// ```ignore,no_run
6243    /// # use google_cloud_config_v1::model::Preview;
6244    /// use google_cloud_config_v1::model::TerraformBlueprint;
6245    /// let x = Preview::new().set_blueprint(Some(
6246    ///     google_cloud_config_v1::model::preview::Blueprint::TerraformBlueprint(TerraformBlueprint::default().into())));
6247    /// ```
6248    pub fn set_blueprint<
6249        T: std::convert::Into<std::option::Option<crate::model::preview::Blueprint>>,
6250    >(
6251        mut self,
6252        v: T,
6253    ) -> Self {
6254        self.blueprint = v.into();
6255        self
6256    }
6257
6258    /// The value of [blueprint][crate::model::Preview::blueprint]
6259    /// if it holds a `TerraformBlueprint`, `None` if the field is not set or
6260    /// holds a different branch.
6261    pub fn terraform_blueprint(
6262        &self,
6263    ) -> std::option::Option<&std::boxed::Box<crate::model::TerraformBlueprint>> {
6264        #[allow(unreachable_patterns)]
6265        self.blueprint.as_ref().and_then(|v| match v {
6266            crate::model::preview::Blueprint::TerraformBlueprint(v) => std::option::Option::Some(v),
6267            _ => std::option::Option::None,
6268        })
6269    }
6270
6271    /// Sets the value of [blueprint][crate::model::Preview::blueprint]
6272    /// to hold a `TerraformBlueprint`.
6273    ///
6274    /// Note that all the setters affecting `blueprint` are
6275    /// mutually exclusive.
6276    ///
6277    /// # Example
6278    /// ```ignore,no_run
6279    /// # use google_cloud_config_v1::model::Preview;
6280    /// use google_cloud_config_v1::model::TerraformBlueprint;
6281    /// let x = Preview::new().set_terraform_blueprint(TerraformBlueprint::default()/* use setters */);
6282    /// assert!(x.terraform_blueprint().is_some());
6283    /// ```
6284    pub fn set_terraform_blueprint<
6285        T: std::convert::Into<std::boxed::Box<crate::model::TerraformBlueprint>>,
6286    >(
6287        mut self,
6288        v: T,
6289    ) -> Self {
6290        self.blueprint = std::option::Option::Some(
6291            crate::model::preview::Blueprint::TerraformBlueprint(v.into()),
6292        );
6293        self
6294    }
6295}
6296
6297impl wkt::message::Message for Preview {
6298    fn typename() -> &'static str {
6299        "type.googleapis.com/google.cloud.config.v1.Preview"
6300    }
6301}
6302
6303/// Defines additional types related to [Preview].
6304pub mod preview {
6305    #[allow(unused_imports)]
6306    use super::*;
6307
6308    /// Possible states of a preview.
6309    ///
6310    /// # Working with unknown values
6311    ///
6312    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6313    /// additional enum variants at any time. Adding new variants is not considered
6314    /// a breaking change. Applications should write their code in anticipation of:
6315    ///
6316    /// - New values appearing in future releases of the client library, **and**
6317    /// - New values received dynamically, without application changes.
6318    ///
6319    /// Please consult the [Working with enums] section in the user guide for some
6320    /// guidelines.
6321    ///
6322    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
6323    #[derive(Clone, Debug, PartialEq)]
6324    #[non_exhaustive]
6325    pub enum State {
6326        /// The default value. This value is used if the state is unknown.
6327        Unspecified,
6328        /// The preview is being created.
6329        Creating,
6330        /// The preview has succeeded.
6331        Succeeded,
6332        /// The preview is being applied.
6333        Applying,
6334        /// The preview is stale. A preview can become stale if a revision has been
6335        /// applied after this preview was created.
6336        Stale,
6337        /// The preview is being deleted.
6338        Deleting,
6339        /// The preview has encountered an unexpected error.
6340        Failed,
6341        /// The preview has been deleted.
6342        Deleted,
6343        /// If set, the enum was initialized with an unknown value.
6344        ///
6345        /// Applications can examine the value using [State::value] or
6346        /// [State::name].
6347        UnknownValue(state::UnknownValue),
6348    }
6349
6350    #[doc(hidden)]
6351    pub mod state {
6352        #[allow(unused_imports)]
6353        use super::*;
6354        #[derive(Clone, Debug, PartialEq)]
6355        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6356    }
6357
6358    impl State {
6359        /// Gets the enum value.
6360        ///
6361        /// Returns `None` if the enum contains an unknown value deserialized from
6362        /// the string representation of enums.
6363        pub fn value(&self) -> std::option::Option<i32> {
6364            match self {
6365                Self::Unspecified => std::option::Option::Some(0),
6366                Self::Creating => std::option::Option::Some(1),
6367                Self::Succeeded => std::option::Option::Some(2),
6368                Self::Applying => std::option::Option::Some(3),
6369                Self::Stale => std::option::Option::Some(4),
6370                Self::Deleting => std::option::Option::Some(5),
6371                Self::Failed => std::option::Option::Some(6),
6372                Self::Deleted => std::option::Option::Some(7),
6373                Self::UnknownValue(u) => u.0.value(),
6374            }
6375        }
6376
6377        /// Gets the enum value as a string.
6378        ///
6379        /// Returns `None` if the enum contains an unknown value deserialized from
6380        /// the integer representation of enums.
6381        pub fn name(&self) -> std::option::Option<&str> {
6382            match self {
6383                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
6384                Self::Creating => std::option::Option::Some("CREATING"),
6385                Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
6386                Self::Applying => std::option::Option::Some("APPLYING"),
6387                Self::Stale => std::option::Option::Some("STALE"),
6388                Self::Deleting => std::option::Option::Some("DELETING"),
6389                Self::Failed => std::option::Option::Some("FAILED"),
6390                Self::Deleted => std::option::Option::Some("DELETED"),
6391                Self::UnknownValue(u) => u.0.name(),
6392            }
6393        }
6394    }
6395
6396    impl std::default::Default for State {
6397        fn default() -> Self {
6398            use std::convert::From;
6399            Self::from(0)
6400        }
6401    }
6402
6403    impl std::fmt::Display for State {
6404        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6405            wkt::internal::display_enum(f, self.name(), self.value())
6406        }
6407    }
6408
6409    impl std::convert::From<i32> for State {
6410        fn from(value: i32) -> Self {
6411            match value {
6412                0 => Self::Unspecified,
6413                1 => Self::Creating,
6414                2 => Self::Succeeded,
6415                3 => Self::Applying,
6416                4 => Self::Stale,
6417                5 => Self::Deleting,
6418                6 => Self::Failed,
6419                7 => Self::Deleted,
6420                _ => Self::UnknownValue(state::UnknownValue(
6421                    wkt::internal::UnknownEnumValue::Integer(value),
6422                )),
6423            }
6424        }
6425    }
6426
6427    impl std::convert::From<&str> for State {
6428        fn from(value: &str) -> Self {
6429            use std::string::ToString;
6430            match value {
6431                "STATE_UNSPECIFIED" => Self::Unspecified,
6432                "CREATING" => Self::Creating,
6433                "SUCCEEDED" => Self::Succeeded,
6434                "APPLYING" => Self::Applying,
6435                "STALE" => Self::Stale,
6436                "DELETING" => Self::Deleting,
6437                "FAILED" => Self::Failed,
6438                "DELETED" => Self::Deleted,
6439                _ => Self::UnknownValue(state::UnknownValue(
6440                    wkt::internal::UnknownEnumValue::String(value.to_string()),
6441                )),
6442            }
6443        }
6444    }
6445
6446    impl serde::ser::Serialize for State {
6447        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6448        where
6449            S: serde::Serializer,
6450        {
6451            match self {
6452                Self::Unspecified => serializer.serialize_i32(0),
6453                Self::Creating => serializer.serialize_i32(1),
6454                Self::Succeeded => serializer.serialize_i32(2),
6455                Self::Applying => serializer.serialize_i32(3),
6456                Self::Stale => serializer.serialize_i32(4),
6457                Self::Deleting => serializer.serialize_i32(5),
6458                Self::Failed => serializer.serialize_i32(6),
6459                Self::Deleted => serializer.serialize_i32(7),
6460                Self::UnknownValue(u) => u.0.serialize(serializer),
6461            }
6462        }
6463    }
6464
6465    impl<'de> serde::de::Deserialize<'de> for State {
6466        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6467        where
6468            D: serde::Deserializer<'de>,
6469        {
6470            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
6471                ".google.cloud.config.v1.Preview.State",
6472            ))
6473        }
6474    }
6475
6476    /// Preview mode provides options for customizing preview operations.
6477    ///
6478    /// # Working with unknown values
6479    ///
6480    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6481    /// additional enum variants at any time. Adding new variants is not considered
6482    /// a breaking change. Applications should write their code in anticipation of:
6483    ///
6484    /// - New values appearing in future releases of the client library, **and**
6485    /// - New values received dynamically, without application changes.
6486    ///
6487    /// Please consult the [Working with enums] section in the user guide for some
6488    /// guidelines.
6489    ///
6490    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
6491    #[derive(Clone, Debug, PartialEq)]
6492    #[non_exhaustive]
6493    pub enum PreviewMode {
6494        /// Unspecified policy, default mode will be used.
6495        Unspecified,
6496        /// DEFAULT mode generates an execution plan for reconciling current resource
6497        /// state into expected resource state.
6498        Default,
6499        /// DELETE mode generates as execution plan for destroying current resources.
6500        Delete,
6501        /// If set, the enum was initialized with an unknown value.
6502        ///
6503        /// Applications can examine the value using [PreviewMode::value] or
6504        /// [PreviewMode::name].
6505        UnknownValue(preview_mode::UnknownValue),
6506    }
6507
6508    #[doc(hidden)]
6509    pub mod preview_mode {
6510        #[allow(unused_imports)]
6511        use super::*;
6512        #[derive(Clone, Debug, PartialEq)]
6513        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6514    }
6515
6516    impl PreviewMode {
6517        /// Gets the enum value.
6518        ///
6519        /// Returns `None` if the enum contains an unknown value deserialized from
6520        /// the string representation of enums.
6521        pub fn value(&self) -> std::option::Option<i32> {
6522            match self {
6523                Self::Unspecified => std::option::Option::Some(0),
6524                Self::Default => std::option::Option::Some(1),
6525                Self::Delete => std::option::Option::Some(2),
6526                Self::UnknownValue(u) => u.0.value(),
6527            }
6528        }
6529
6530        /// Gets the enum value as a string.
6531        ///
6532        /// Returns `None` if the enum contains an unknown value deserialized from
6533        /// the integer representation of enums.
6534        pub fn name(&self) -> std::option::Option<&str> {
6535            match self {
6536                Self::Unspecified => std::option::Option::Some("PREVIEW_MODE_UNSPECIFIED"),
6537                Self::Default => std::option::Option::Some("DEFAULT"),
6538                Self::Delete => std::option::Option::Some("DELETE"),
6539                Self::UnknownValue(u) => u.0.name(),
6540            }
6541        }
6542    }
6543
6544    impl std::default::Default for PreviewMode {
6545        fn default() -> Self {
6546            use std::convert::From;
6547            Self::from(0)
6548        }
6549    }
6550
6551    impl std::fmt::Display for PreviewMode {
6552        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6553            wkt::internal::display_enum(f, self.name(), self.value())
6554        }
6555    }
6556
6557    impl std::convert::From<i32> for PreviewMode {
6558        fn from(value: i32) -> Self {
6559            match value {
6560                0 => Self::Unspecified,
6561                1 => Self::Default,
6562                2 => Self::Delete,
6563                _ => Self::UnknownValue(preview_mode::UnknownValue(
6564                    wkt::internal::UnknownEnumValue::Integer(value),
6565                )),
6566            }
6567        }
6568    }
6569
6570    impl std::convert::From<&str> for PreviewMode {
6571        fn from(value: &str) -> Self {
6572            use std::string::ToString;
6573            match value {
6574                "PREVIEW_MODE_UNSPECIFIED" => Self::Unspecified,
6575                "DEFAULT" => Self::Default,
6576                "DELETE" => Self::Delete,
6577                _ => Self::UnknownValue(preview_mode::UnknownValue(
6578                    wkt::internal::UnknownEnumValue::String(value.to_string()),
6579                )),
6580            }
6581        }
6582    }
6583
6584    impl serde::ser::Serialize for PreviewMode {
6585        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6586        where
6587            S: serde::Serializer,
6588        {
6589            match self {
6590                Self::Unspecified => serializer.serialize_i32(0),
6591                Self::Default => serializer.serialize_i32(1),
6592                Self::Delete => serializer.serialize_i32(2),
6593                Self::UnknownValue(u) => u.0.serialize(serializer),
6594            }
6595        }
6596    }
6597
6598    impl<'de> serde::de::Deserialize<'de> for PreviewMode {
6599        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6600        where
6601            D: serde::Deserializer<'de>,
6602        {
6603            deserializer.deserialize_any(wkt::internal::EnumVisitor::<PreviewMode>::new(
6604                ".google.cloud.config.v1.Preview.PreviewMode",
6605            ))
6606        }
6607    }
6608
6609    /// Possible errors that can occur with previews.
6610    ///
6611    /// # Working with unknown values
6612    ///
6613    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6614    /// additional enum variants at any time. Adding new variants is not considered
6615    /// a breaking change. Applications should write their code in anticipation of:
6616    ///
6617    /// - New values appearing in future releases of the client library, **and**
6618    /// - New values received dynamically, without application changes.
6619    ///
6620    /// Please consult the [Working with enums] section in the user guide for some
6621    /// guidelines.
6622    ///
6623    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
6624    #[derive(Clone, Debug, PartialEq)]
6625    #[non_exhaustive]
6626    pub enum ErrorCode {
6627        /// No error code was specified.
6628        Unspecified,
6629        /// Cloud Build failed due to a permissions issue.
6630        CloudBuildPermissionDenied,
6631        /// Cloud Storage bucket failed to create due to a permissions issue.
6632        BucketCreationPermissionDenied,
6633        /// Cloud Storage bucket failed for a non-permissions-related issue.
6634        BucketCreationFailed,
6635        /// Acquiring lock on provided deployment reference failed.
6636        DeploymentLockAcquireFailed,
6637        /// Preview encountered an error when trying to access Cloud Build API.
6638        PreviewBuildApiFailed,
6639        /// Preview created a build but build failed and logs were generated.
6640        PreviewBuildRunFailed,
6641        /// If set, the enum was initialized with an unknown value.
6642        ///
6643        /// Applications can examine the value using [ErrorCode::value] or
6644        /// [ErrorCode::name].
6645        UnknownValue(error_code::UnknownValue),
6646    }
6647
6648    #[doc(hidden)]
6649    pub mod error_code {
6650        #[allow(unused_imports)]
6651        use super::*;
6652        #[derive(Clone, Debug, PartialEq)]
6653        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6654    }
6655
6656    impl ErrorCode {
6657        /// Gets the enum value.
6658        ///
6659        /// Returns `None` if the enum contains an unknown value deserialized from
6660        /// the string representation of enums.
6661        pub fn value(&self) -> std::option::Option<i32> {
6662            match self {
6663                Self::Unspecified => std::option::Option::Some(0),
6664                Self::CloudBuildPermissionDenied => std::option::Option::Some(1),
6665                Self::BucketCreationPermissionDenied => std::option::Option::Some(2),
6666                Self::BucketCreationFailed => std::option::Option::Some(3),
6667                Self::DeploymentLockAcquireFailed => std::option::Option::Some(4),
6668                Self::PreviewBuildApiFailed => std::option::Option::Some(5),
6669                Self::PreviewBuildRunFailed => std::option::Option::Some(6),
6670                Self::UnknownValue(u) => u.0.value(),
6671            }
6672        }
6673
6674        /// Gets the enum value as a string.
6675        ///
6676        /// Returns `None` if the enum contains an unknown value deserialized from
6677        /// the integer representation of enums.
6678        pub fn name(&self) -> std::option::Option<&str> {
6679            match self {
6680                Self::Unspecified => std::option::Option::Some("ERROR_CODE_UNSPECIFIED"),
6681                Self::CloudBuildPermissionDenied => {
6682                    std::option::Option::Some("CLOUD_BUILD_PERMISSION_DENIED")
6683                }
6684                Self::BucketCreationPermissionDenied => {
6685                    std::option::Option::Some("BUCKET_CREATION_PERMISSION_DENIED")
6686                }
6687                Self::BucketCreationFailed => std::option::Option::Some("BUCKET_CREATION_FAILED"),
6688                Self::DeploymentLockAcquireFailed => {
6689                    std::option::Option::Some("DEPLOYMENT_LOCK_ACQUIRE_FAILED")
6690                }
6691                Self::PreviewBuildApiFailed => {
6692                    std::option::Option::Some("PREVIEW_BUILD_API_FAILED")
6693                }
6694                Self::PreviewBuildRunFailed => {
6695                    std::option::Option::Some("PREVIEW_BUILD_RUN_FAILED")
6696                }
6697                Self::UnknownValue(u) => u.0.name(),
6698            }
6699        }
6700    }
6701
6702    impl std::default::Default for ErrorCode {
6703        fn default() -> Self {
6704            use std::convert::From;
6705            Self::from(0)
6706        }
6707    }
6708
6709    impl std::fmt::Display for ErrorCode {
6710        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6711            wkt::internal::display_enum(f, self.name(), self.value())
6712        }
6713    }
6714
6715    impl std::convert::From<i32> for ErrorCode {
6716        fn from(value: i32) -> Self {
6717            match value {
6718                0 => Self::Unspecified,
6719                1 => Self::CloudBuildPermissionDenied,
6720                2 => Self::BucketCreationPermissionDenied,
6721                3 => Self::BucketCreationFailed,
6722                4 => Self::DeploymentLockAcquireFailed,
6723                5 => Self::PreviewBuildApiFailed,
6724                6 => Self::PreviewBuildRunFailed,
6725                _ => Self::UnknownValue(error_code::UnknownValue(
6726                    wkt::internal::UnknownEnumValue::Integer(value),
6727                )),
6728            }
6729        }
6730    }
6731
6732    impl std::convert::From<&str> for ErrorCode {
6733        fn from(value: &str) -> Self {
6734            use std::string::ToString;
6735            match value {
6736                "ERROR_CODE_UNSPECIFIED" => Self::Unspecified,
6737                "CLOUD_BUILD_PERMISSION_DENIED" => Self::CloudBuildPermissionDenied,
6738                "BUCKET_CREATION_PERMISSION_DENIED" => Self::BucketCreationPermissionDenied,
6739                "BUCKET_CREATION_FAILED" => Self::BucketCreationFailed,
6740                "DEPLOYMENT_LOCK_ACQUIRE_FAILED" => Self::DeploymentLockAcquireFailed,
6741                "PREVIEW_BUILD_API_FAILED" => Self::PreviewBuildApiFailed,
6742                "PREVIEW_BUILD_RUN_FAILED" => Self::PreviewBuildRunFailed,
6743                _ => Self::UnknownValue(error_code::UnknownValue(
6744                    wkt::internal::UnknownEnumValue::String(value.to_string()),
6745                )),
6746            }
6747        }
6748    }
6749
6750    impl serde::ser::Serialize for ErrorCode {
6751        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6752        where
6753            S: serde::Serializer,
6754        {
6755            match self {
6756                Self::Unspecified => serializer.serialize_i32(0),
6757                Self::CloudBuildPermissionDenied => serializer.serialize_i32(1),
6758                Self::BucketCreationPermissionDenied => serializer.serialize_i32(2),
6759                Self::BucketCreationFailed => serializer.serialize_i32(3),
6760                Self::DeploymentLockAcquireFailed => serializer.serialize_i32(4),
6761                Self::PreviewBuildApiFailed => serializer.serialize_i32(5),
6762                Self::PreviewBuildRunFailed => serializer.serialize_i32(6),
6763                Self::UnknownValue(u) => u.0.serialize(serializer),
6764            }
6765        }
6766    }
6767
6768    impl<'de> serde::de::Deserialize<'de> for ErrorCode {
6769        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6770        where
6771            D: serde::Deserializer<'de>,
6772        {
6773            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ErrorCode>::new(
6774                ".google.cloud.config.v1.Preview.ErrorCode",
6775            ))
6776        }
6777    }
6778
6779    /// Blueprint to preview.
6780    #[derive(Clone, Debug, PartialEq)]
6781    #[non_exhaustive]
6782    pub enum Blueprint {
6783        /// The terraform blueprint to preview.
6784        TerraformBlueprint(std::boxed::Box<crate::model::TerraformBlueprint>),
6785    }
6786}
6787
6788/// Ephemeral metadata content describing the state of a preview operation.
6789#[derive(Clone, Default, PartialEq)]
6790#[non_exhaustive]
6791pub struct PreviewOperationMetadata {
6792    /// The current step the preview operation is running.
6793    pub step: crate::model::preview_operation_metadata::PreviewStep,
6794
6795    /// Artifacts from preview.
6796    pub preview_artifacts: std::option::Option<crate::model::PreviewArtifacts>,
6797
6798    /// Output only. Location of preview logs in `gs://{bucket}/{object}` format.
6799    pub logs: std::string::String,
6800
6801    /// Output only. Cloud Build instance UUID associated with this preview.
6802    pub build: std::string::String,
6803
6804    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6805}
6806
6807impl PreviewOperationMetadata {
6808    pub fn new() -> Self {
6809        std::default::Default::default()
6810    }
6811
6812    /// Sets the value of [step][crate::model::PreviewOperationMetadata::step].
6813    ///
6814    /// # Example
6815    /// ```ignore,no_run
6816    /// # use google_cloud_config_v1::model::PreviewOperationMetadata;
6817    /// use google_cloud_config_v1::model::preview_operation_metadata::PreviewStep;
6818    /// let x0 = PreviewOperationMetadata::new().set_step(PreviewStep::PreparingStorageBucket);
6819    /// let x1 = PreviewOperationMetadata::new().set_step(PreviewStep::DownloadingBlueprint);
6820    /// let x2 = PreviewOperationMetadata::new().set_step(PreviewStep::RunningTfInit);
6821    /// ```
6822    pub fn set_step<
6823        T: std::convert::Into<crate::model::preview_operation_metadata::PreviewStep>,
6824    >(
6825        mut self,
6826        v: T,
6827    ) -> Self {
6828        self.step = v.into();
6829        self
6830    }
6831
6832    /// Sets the value of [preview_artifacts][crate::model::PreviewOperationMetadata::preview_artifacts].
6833    ///
6834    /// # Example
6835    /// ```ignore,no_run
6836    /// # use google_cloud_config_v1::model::PreviewOperationMetadata;
6837    /// use google_cloud_config_v1::model::PreviewArtifacts;
6838    /// let x = PreviewOperationMetadata::new().set_preview_artifacts(PreviewArtifacts::default()/* use setters */);
6839    /// ```
6840    pub fn set_preview_artifacts<T>(mut self, v: T) -> Self
6841    where
6842        T: std::convert::Into<crate::model::PreviewArtifacts>,
6843    {
6844        self.preview_artifacts = std::option::Option::Some(v.into());
6845        self
6846    }
6847
6848    /// Sets or clears the value of [preview_artifacts][crate::model::PreviewOperationMetadata::preview_artifacts].
6849    ///
6850    /// # Example
6851    /// ```ignore,no_run
6852    /// # use google_cloud_config_v1::model::PreviewOperationMetadata;
6853    /// use google_cloud_config_v1::model::PreviewArtifacts;
6854    /// let x = PreviewOperationMetadata::new().set_or_clear_preview_artifacts(Some(PreviewArtifacts::default()/* use setters */));
6855    /// let x = PreviewOperationMetadata::new().set_or_clear_preview_artifacts(None::<PreviewArtifacts>);
6856    /// ```
6857    pub fn set_or_clear_preview_artifacts<T>(mut self, v: std::option::Option<T>) -> Self
6858    where
6859        T: std::convert::Into<crate::model::PreviewArtifacts>,
6860    {
6861        self.preview_artifacts = v.map(|x| x.into());
6862        self
6863    }
6864
6865    /// Sets the value of [logs][crate::model::PreviewOperationMetadata::logs].
6866    ///
6867    /// # Example
6868    /// ```ignore,no_run
6869    /// # use google_cloud_config_v1::model::PreviewOperationMetadata;
6870    /// let x = PreviewOperationMetadata::new().set_logs("example");
6871    /// ```
6872    pub fn set_logs<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6873        self.logs = v.into();
6874        self
6875    }
6876
6877    /// Sets the value of [build][crate::model::PreviewOperationMetadata::build].
6878    ///
6879    /// # Example
6880    /// ```ignore,no_run
6881    /// # use google_cloud_config_v1::model::PreviewOperationMetadata;
6882    /// let x = PreviewOperationMetadata::new().set_build("example");
6883    /// ```
6884    pub fn set_build<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6885        self.build = v.into();
6886        self
6887    }
6888}
6889
6890impl wkt::message::Message for PreviewOperationMetadata {
6891    fn typename() -> &'static str {
6892        "type.googleapis.com/google.cloud.config.v1.PreviewOperationMetadata"
6893    }
6894}
6895
6896/// Defines additional types related to [PreviewOperationMetadata].
6897pub mod preview_operation_metadata {
6898    #[allow(unused_imports)]
6899    use super::*;
6900
6901    /// The possible steps a preview may be running.
6902    ///
6903    /// # Working with unknown values
6904    ///
6905    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6906    /// additional enum variants at any time. Adding new variants is not considered
6907    /// a breaking change. Applications should write their code in anticipation of:
6908    ///
6909    /// - New values appearing in future releases of the client library, **and**
6910    /// - New values received dynamically, without application changes.
6911    ///
6912    /// Please consult the [Working with enums] section in the user guide for some
6913    /// guidelines.
6914    ///
6915    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
6916    #[derive(Clone, Debug, PartialEq)]
6917    #[non_exhaustive]
6918    pub enum PreviewStep {
6919        /// Unspecified preview step.
6920        Unspecified,
6921        /// Infra Manager is creating a Google Cloud Storage bucket to store
6922        /// artifacts and metadata about the preview.
6923        PreparingStorageBucket,
6924        /// Downloading the blueprint onto the Google Cloud Storage bucket.
6925        DownloadingBlueprint,
6926        /// Initializing Terraform using `terraform init`.
6927        RunningTfInit,
6928        /// Running `terraform plan`.
6929        RunningTfPlan,
6930        /// Fetching a deployment.
6931        FetchingDeployment,
6932        /// Locking a deployment.
6933        LockingDeployment,
6934        /// Unlocking a deployment.
6935        UnlockingDeployment,
6936        /// Operation was successful.
6937        Succeeded,
6938        /// Operation failed.
6939        Failed,
6940        /// Validating the provided repository.
6941        ValidatingRepository,
6942        /// If set, the enum was initialized with an unknown value.
6943        ///
6944        /// Applications can examine the value using [PreviewStep::value] or
6945        /// [PreviewStep::name].
6946        UnknownValue(preview_step::UnknownValue),
6947    }
6948
6949    #[doc(hidden)]
6950    pub mod preview_step {
6951        #[allow(unused_imports)]
6952        use super::*;
6953        #[derive(Clone, Debug, PartialEq)]
6954        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6955    }
6956
6957    impl PreviewStep {
6958        /// Gets the enum value.
6959        ///
6960        /// Returns `None` if the enum contains an unknown value deserialized from
6961        /// the string representation of enums.
6962        pub fn value(&self) -> std::option::Option<i32> {
6963            match self {
6964                Self::Unspecified => std::option::Option::Some(0),
6965                Self::PreparingStorageBucket => std::option::Option::Some(1),
6966                Self::DownloadingBlueprint => std::option::Option::Some(2),
6967                Self::RunningTfInit => std::option::Option::Some(3),
6968                Self::RunningTfPlan => std::option::Option::Some(4),
6969                Self::FetchingDeployment => std::option::Option::Some(5),
6970                Self::LockingDeployment => std::option::Option::Some(6),
6971                Self::UnlockingDeployment => std::option::Option::Some(7),
6972                Self::Succeeded => std::option::Option::Some(8),
6973                Self::Failed => std::option::Option::Some(9),
6974                Self::ValidatingRepository => std::option::Option::Some(10),
6975                Self::UnknownValue(u) => u.0.value(),
6976            }
6977        }
6978
6979        /// Gets the enum value as a string.
6980        ///
6981        /// Returns `None` if the enum contains an unknown value deserialized from
6982        /// the integer representation of enums.
6983        pub fn name(&self) -> std::option::Option<&str> {
6984            match self {
6985                Self::Unspecified => std::option::Option::Some("PREVIEW_STEP_UNSPECIFIED"),
6986                Self::PreparingStorageBucket => {
6987                    std::option::Option::Some("PREPARING_STORAGE_BUCKET")
6988                }
6989                Self::DownloadingBlueprint => std::option::Option::Some("DOWNLOADING_BLUEPRINT"),
6990                Self::RunningTfInit => std::option::Option::Some("RUNNING_TF_INIT"),
6991                Self::RunningTfPlan => std::option::Option::Some("RUNNING_TF_PLAN"),
6992                Self::FetchingDeployment => std::option::Option::Some("FETCHING_DEPLOYMENT"),
6993                Self::LockingDeployment => std::option::Option::Some("LOCKING_DEPLOYMENT"),
6994                Self::UnlockingDeployment => std::option::Option::Some("UNLOCKING_DEPLOYMENT"),
6995                Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
6996                Self::Failed => std::option::Option::Some("FAILED"),
6997                Self::ValidatingRepository => std::option::Option::Some("VALIDATING_REPOSITORY"),
6998                Self::UnknownValue(u) => u.0.name(),
6999            }
7000        }
7001    }
7002
7003    impl std::default::Default for PreviewStep {
7004        fn default() -> Self {
7005            use std::convert::From;
7006            Self::from(0)
7007        }
7008    }
7009
7010    impl std::fmt::Display for PreviewStep {
7011        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7012            wkt::internal::display_enum(f, self.name(), self.value())
7013        }
7014    }
7015
7016    impl std::convert::From<i32> for PreviewStep {
7017        fn from(value: i32) -> Self {
7018            match value {
7019                0 => Self::Unspecified,
7020                1 => Self::PreparingStorageBucket,
7021                2 => Self::DownloadingBlueprint,
7022                3 => Self::RunningTfInit,
7023                4 => Self::RunningTfPlan,
7024                5 => Self::FetchingDeployment,
7025                6 => Self::LockingDeployment,
7026                7 => Self::UnlockingDeployment,
7027                8 => Self::Succeeded,
7028                9 => Self::Failed,
7029                10 => Self::ValidatingRepository,
7030                _ => Self::UnknownValue(preview_step::UnknownValue(
7031                    wkt::internal::UnknownEnumValue::Integer(value),
7032                )),
7033            }
7034        }
7035    }
7036
7037    impl std::convert::From<&str> for PreviewStep {
7038        fn from(value: &str) -> Self {
7039            use std::string::ToString;
7040            match value {
7041                "PREVIEW_STEP_UNSPECIFIED" => Self::Unspecified,
7042                "PREPARING_STORAGE_BUCKET" => Self::PreparingStorageBucket,
7043                "DOWNLOADING_BLUEPRINT" => Self::DownloadingBlueprint,
7044                "RUNNING_TF_INIT" => Self::RunningTfInit,
7045                "RUNNING_TF_PLAN" => Self::RunningTfPlan,
7046                "FETCHING_DEPLOYMENT" => Self::FetchingDeployment,
7047                "LOCKING_DEPLOYMENT" => Self::LockingDeployment,
7048                "UNLOCKING_DEPLOYMENT" => Self::UnlockingDeployment,
7049                "SUCCEEDED" => Self::Succeeded,
7050                "FAILED" => Self::Failed,
7051                "VALIDATING_REPOSITORY" => Self::ValidatingRepository,
7052                _ => Self::UnknownValue(preview_step::UnknownValue(
7053                    wkt::internal::UnknownEnumValue::String(value.to_string()),
7054                )),
7055            }
7056        }
7057    }
7058
7059    impl serde::ser::Serialize for PreviewStep {
7060        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7061        where
7062            S: serde::Serializer,
7063        {
7064            match self {
7065                Self::Unspecified => serializer.serialize_i32(0),
7066                Self::PreparingStorageBucket => serializer.serialize_i32(1),
7067                Self::DownloadingBlueprint => serializer.serialize_i32(2),
7068                Self::RunningTfInit => serializer.serialize_i32(3),
7069                Self::RunningTfPlan => serializer.serialize_i32(4),
7070                Self::FetchingDeployment => serializer.serialize_i32(5),
7071                Self::LockingDeployment => serializer.serialize_i32(6),
7072                Self::UnlockingDeployment => serializer.serialize_i32(7),
7073                Self::Succeeded => serializer.serialize_i32(8),
7074                Self::Failed => serializer.serialize_i32(9),
7075                Self::ValidatingRepository => serializer.serialize_i32(10),
7076                Self::UnknownValue(u) => u.0.serialize(serializer),
7077            }
7078        }
7079    }
7080
7081    impl<'de> serde::de::Deserialize<'de> for PreviewStep {
7082        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7083        where
7084            D: serde::Deserializer<'de>,
7085        {
7086            deserializer.deserialize_any(wkt::internal::EnumVisitor::<PreviewStep>::new(
7087                ".google.cloud.config.v1.PreviewOperationMetadata.PreviewStep",
7088            ))
7089        }
7090    }
7091}
7092
7093/// Artifacts created by preview.
7094#[derive(Clone, Default, PartialEq)]
7095#[non_exhaustive]
7096pub struct PreviewArtifacts {
7097    /// Output only. Location of a blueprint copy and other content in Google Cloud
7098    /// Storage. Format: `gs://{bucket}/{object}`
7099    pub content: std::string::String,
7100
7101    /// Output only. Location of artifacts in Google Cloud Storage.
7102    /// Format: `gs://{bucket}/{object}`
7103    pub artifacts: std::string::String,
7104
7105    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7106}
7107
7108impl PreviewArtifacts {
7109    pub fn new() -> Self {
7110        std::default::Default::default()
7111    }
7112
7113    /// Sets the value of [content][crate::model::PreviewArtifacts::content].
7114    ///
7115    /// # Example
7116    /// ```ignore,no_run
7117    /// # use google_cloud_config_v1::model::PreviewArtifacts;
7118    /// let x = PreviewArtifacts::new().set_content("example");
7119    /// ```
7120    pub fn set_content<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7121        self.content = v.into();
7122        self
7123    }
7124
7125    /// Sets the value of [artifacts][crate::model::PreviewArtifacts::artifacts].
7126    ///
7127    /// # Example
7128    /// ```ignore,no_run
7129    /// # use google_cloud_config_v1::model::PreviewArtifacts;
7130    /// let x = PreviewArtifacts::new().set_artifacts("example");
7131    /// ```
7132    pub fn set_artifacts<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7133        self.artifacts = v.into();
7134        self
7135    }
7136}
7137
7138impl wkt::message::Message for PreviewArtifacts {
7139    fn typename() -> &'static str {
7140        "type.googleapis.com/google.cloud.config.v1.PreviewArtifacts"
7141    }
7142}
7143
7144/// A request to create a preview.
7145#[derive(Clone, Default, PartialEq)]
7146#[non_exhaustive]
7147pub struct CreatePreviewRequest {
7148    /// Required. The parent in whose context the Preview is created. The parent
7149    /// value is in the format: 'projects/{project_id}/locations/{location}'.
7150    pub parent: std::string::String,
7151
7152    /// Optional. The preview ID.
7153    pub preview_id: std::string::String,
7154
7155    /// Required. [Preview][google.cloud.config.v1.Preview] resource to be created.
7156    ///
7157    /// [google.cloud.config.v1.Preview]: crate::model::Preview
7158    pub preview: std::option::Option<crate::model::Preview>,
7159
7160    /// Optional. An optional request ID to identify requests. Specify a unique
7161    /// request ID so that if you must retry your request, the server will know to
7162    /// ignore the request if it has already been completed. The server will
7163    /// guarantee that for at least 60 minutes since the first request.
7164    ///
7165    /// For example, consider a situation where you make an initial request and the
7166    /// request times out. If you make the request again with the same request ID,
7167    /// the server can check if original operation with the same request ID was
7168    /// received, and if so, will ignore the second request. This prevents clients
7169    /// from accidentally creating duplicate commitments.
7170    ///
7171    /// The request ID must be a valid UUID with the exception that zero UUID is
7172    /// not supported (00000000-0000-0000-0000-000000000000).
7173    pub request_id: std::string::String,
7174
7175    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7176}
7177
7178impl CreatePreviewRequest {
7179    pub fn new() -> Self {
7180        std::default::Default::default()
7181    }
7182
7183    /// Sets the value of [parent][crate::model::CreatePreviewRequest::parent].
7184    ///
7185    /// # Example
7186    /// ```ignore,no_run
7187    /// # use google_cloud_config_v1::model::CreatePreviewRequest;
7188    /// let x = CreatePreviewRequest::new().set_parent("example");
7189    /// ```
7190    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7191        self.parent = v.into();
7192        self
7193    }
7194
7195    /// Sets the value of [preview_id][crate::model::CreatePreviewRequest::preview_id].
7196    ///
7197    /// # Example
7198    /// ```ignore,no_run
7199    /// # use google_cloud_config_v1::model::CreatePreviewRequest;
7200    /// let x = CreatePreviewRequest::new().set_preview_id("example");
7201    /// ```
7202    pub fn set_preview_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7203        self.preview_id = v.into();
7204        self
7205    }
7206
7207    /// Sets the value of [preview][crate::model::CreatePreviewRequest::preview].
7208    ///
7209    /// # Example
7210    /// ```ignore,no_run
7211    /// # use google_cloud_config_v1::model::CreatePreviewRequest;
7212    /// use google_cloud_config_v1::model::Preview;
7213    /// let x = CreatePreviewRequest::new().set_preview(Preview::default()/* use setters */);
7214    /// ```
7215    pub fn set_preview<T>(mut self, v: T) -> Self
7216    where
7217        T: std::convert::Into<crate::model::Preview>,
7218    {
7219        self.preview = std::option::Option::Some(v.into());
7220        self
7221    }
7222
7223    /// Sets or clears the value of [preview][crate::model::CreatePreviewRequest::preview].
7224    ///
7225    /// # Example
7226    /// ```ignore,no_run
7227    /// # use google_cloud_config_v1::model::CreatePreviewRequest;
7228    /// use google_cloud_config_v1::model::Preview;
7229    /// let x = CreatePreviewRequest::new().set_or_clear_preview(Some(Preview::default()/* use setters */));
7230    /// let x = CreatePreviewRequest::new().set_or_clear_preview(None::<Preview>);
7231    /// ```
7232    pub fn set_or_clear_preview<T>(mut self, v: std::option::Option<T>) -> Self
7233    where
7234        T: std::convert::Into<crate::model::Preview>,
7235    {
7236        self.preview = v.map(|x| x.into());
7237        self
7238    }
7239
7240    /// Sets the value of [request_id][crate::model::CreatePreviewRequest::request_id].
7241    ///
7242    /// # Example
7243    /// ```ignore,no_run
7244    /// # use google_cloud_config_v1::model::CreatePreviewRequest;
7245    /// let x = CreatePreviewRequest::new().set_request_id("example");
7246    /// ```
7247    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7248        self.request_id = v.into();
7249        self
7250    }
7251}
7252
7253impl wkt::message::Message for CreatePreviewRequest {
7254    fn typename() -> &'static str {
7255        "type.googleapis.com/google.cloud.config.v1.CreatePreviewRequest"
7256    }
7257}
7258
7259/// A request to get details about a preview.
7260#[derive(Clone, Default, PartialEq)]
7261#[non_exhaustive]
7262pub struct GetPreviewRequest {
7263    /// Required. The name of the preview. Format:
7264    /// 'projects/{project_id}/locations/{location}/previews/{preview}'.
7265    pub name: std::string::String,
7266
7267    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7268}
7269
7270impl GetPreviewRequest {
7271    pub fn new() -> Self {
7272        std::default::Default::default()
7273    }
7274
7275    /// Sets the value of [name][crate::model::GetPreviewRequest::name].
7276    ///
7277    /// # Example
7278    /// ```ignore,no_run
7279    /// # use google_cloud_config_v1::model::GetPreviewRequest;
7280    /// let x = GetPreviewRequest::new().set_name("example");
7281    /// ```
7282    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7283        self.name = v.into();
7284        self
7285    }
7286}
7287
7288impl wkt::message::Message for GetPreviewRequest {
7289    fn typename() -> &'static str {
7290        "type.googleapis.com/google.cloud.config.v1.GetPreviewRequest"
7291    }
7292}
7293
7294/// A request to list all previews for a given project and location.
7295#[derive(Clone, Default, PartialEq)]
7296#[non_exhaustive]
7297pub struct ListPreviewsRequest {
7298    /// Required. The parent in whose context the Previews are listed. The parent
7299    /// value is in the format: 'projects/{project_id}/locations/{location}'.
7300    pub parent: std::string::String,
7301
7302    /// Optional. When requesting a page of resources, 'page_size' specifies number
7303    /// of resources to return. If unspecified, at most 500 will be returned. The
7304    /// maximum value is 1000.
7305    pub page_size: i32,
7306
7307    /// Optional. Token returned by previous call to 'ListDeployments' which
7308    /// specifies the position in the list from where to continue listing the
7309    /// resources.
7310    pub page_token: std::string::String,
7311
7312    /// Optional. Lists the Deployments that match the filter expression. A filter
7313    /// expression filters the resources listed in the response. The expression
7314    /// must be of the form '{field} {operator} {value}' where operators: '<', '>',
7315    /// '<=', '>=', '!=', '=', ':' are supported (colon ':' represents a HAS
7316    /// operator which is roughly synonymous with equality). {field} can refer to a
7317    /// proto or JSON field, or a synthetic field. Field names can be camelCase or
7318    /// snake_case.
7319    ///
7320    /// Examples:
7321    ///
7322    /// - Filter by name:
7323    ///   name = "projects/foo/locations/us-central1/deployments/bar
7324    ///
7325    /// - Filter by labels:
7326    ///
7327    ///   - Resources that have a key called 'foo'
7328    ///     labels.foo:*
7329    ///   - Resources that have a key called 'foo' whose value is 'bar'
7330    ///     labels.foo = bar
7331    /// - Filter by state:
7332    ///
7333    ///   - Deployments in CREATING state.
7334    ///     state=CREATING
7335    pub filter: std::string::String,
7336
7337    /// Optional. Field to use to sort the list.
7338    pub order_by: std::string::String,
7339
7340    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7341}
7342
7343impl ListPreviewsRequest {
7344    pub fn new() -> Self {
7345        std::default::Default::default()
7346    }
7347
7348    /// Sets the value of [parent][crate::model::ListPreviewsRequest::parent].
7349    ///
7350    /// # Example
7351    /// ```ignore,no_run
7352    /// # use google_cloud_config_v1::model::ListPreviewsRequest;
7353    /// let x = ListPreviewsRequest::new().set_parent("example");
7354    /// ```
7355    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7356        self.parent = v.into();
7357        self
7358    }
7359
7360    /// Sets the value of [page_size][crate::model::ListPreviewsRequest::page_size].
7361    ///
7362    /// # Example
7363    /// ```ignore,no_run
7364    /// # use google_cloud_config_v1::model::ListPreviewsRequest;
7365    /// let x = ListPreviewsRequest::new().set_page_size(42);
7366    /// ```
7367    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7368        self.page_size = v.into();
7369        self
7370    }
7371
7372    /// Sets the value of [page_token][crate::model::ListPreviewsRequest::page_token].
7373    ///
7374    /// # Example
7375    /// ```ignore,no_run
7376    /// # use google_cloud_config_v1::model::ListPreviewsRequest;
7377    /// let x = ListPreviewsRequest::new().set_page_token("example");
7378    /// ```
7379    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7380        self.page_token = v.into();
7381        self
7382    }
7383
7384    /// Sets the value of [filter][crate::model::ListPreviewsRequest::filter].
7385    ///
7386    /// # Example
7387    /// ```ignore,no_run
7388    /// # use google_cloud_config_v1::model::ListPreviewsRequest;
7389    /// let x = ListPreviewsRequest::new().set_filter("example");
7390    /// ```
7391    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7392        self.filter = v.into();
7393        self
7394    }
7395
7396    /// Sets the value of [order_by][crate::model::ListPreviewsRequest::order_by].
7397    ///
7398    /// # Example
7399    /// ```ignore,no_run
7400    /// # use google_cloud_config_v1::model::ListPreviewsRequest;
7401    /// let x = ListPreviewsRequest::new().set_order_by("example");
7402    /// ```
7403    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7404        self.order_by = v.into();
7405        self
7406    }
7407}
7408
7409impl wkt::message::Message for ListPreviewsRequest {
7410    fn typename() -> &'static str {
7411        "type.googleapis.com/google.cloud.config.v1.ListPreviewsRequest"
7412    }
7413}
7414
7415/// A response to a `ListPreviews` call. Contains a list of Previews.
7416#[derive(Clone, Default, PartialEq)]
7417#[non_exhaustive]
7418pub struct ListPreviewsResponse {
7419    /// List of [Previews][google.cloud.config.v1.Preview].
7420    ///
7421    /// [google.cloud.config.v1.Preview]: crate::model::Preview
7422    pub previews: std::vec::Vec<crate::model::Preview>,
7423
7424    /// Token to be supplied to the next ListPreviews request via `page_token`
7425    /// to obtain the next set of results.
7426    pub next_page_token: std::string::String,
7427
7428    /// Locations that could not be reached.
7429    pub unreachable: std::vec::Vec<std::string::String>,
7430
7431    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7432}
7433
7434impl ListPreviewsResponse {
7435    pub fn new() -> Self {
7436        std::default::Default::default()
7437    }
7438
7439    /// Sets the value of [previews][crate::model::ListPreviewsResponse::previews].
7440    ///
7441    /// # Example
7442    /// ```ignore,no_run
7443    /// # use google_cloud_config_v1::model::ListPreviewsResponse;
7444    /// use google_cloud_config_v1::model::Preview;
7445    /// let x = ListPreviewsResponse::new()
7446    ///     .set_previews([
7447    ///         Preview::default()/* use setters */,
7448    ///         Preview::default()/* use (different) setters */,
7449    ///     ]);
7450    /// ```
7451    pub fn set_previews<T, V>(mut self, v: T) -> Self
7452    where
7453        T: std::iter::IntoIterator<Item = V>,
7454        V: std::convert::Into<crate::model::Preview>,
7455    {
7456        use std::iter::Iterator;
7457        self.previews = v.into_iter().map(|i| i.into()).collect();
7458        self
7459    }
7460
7461    /// Sets the value of [next_page_token][crate::model::ListPreviewsResponse::next_page_token].
7462    ///
7463    /// # Example
7464    /// ```ignore,no_run
7465    /// # use google_cloud_config_v1::model::ListPreviewsResponse;
7466    /// let x = ListPreviewsResponse::new().set_next_page_token("example");
7467    /// ```
7468    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7469        self.next_page_token = v.into();
7470        self
7471    }
7472
7473    /// Sets the value of [unreachable][crate::model::ListPreviewsResponse::unreachable].
7474    ///
7475    /// # Example
7476    /// ```ignore,no_run
7477    /// # use google_cloud_config_v1::model::ListPreviewsResponse;
7478    /// let x = ListPreviewsResponse::new().set_unreachable(["a", "b", "c"]);
7479    /// ```
7480    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
7481    where
7482        T: std::iter::IntoIterator<Item = V>,
7483        V: std::convert::Into<std::string::String>,
7484    {
7485        use std::iter::Iterator;
7486        self.unreachable = v.into_iter().map(|i| i.into()).collect();
7487        self
7488    }
7489}
7490
7491impl wkt::message::Message for ListPreviewsResponse {
7492    fn typename() -> &'static str {
7493        "type.googleapis.com/google.cloud.config.v1.ListPreviewsResponse"
7494    }
7495}
7496
7497#[doc(hidden)]
7498impl gax::paginator::internal::PageableResponse for ListPreviewsResponse {
7499    type PageItem = crate::model::Preview;
7500
7501    fn items(self) -> std::vec::Vec<Self::PageItem> {
7502        self.previews
7503    }
7504
7505    fn next_page_token(&self) -> std::string::String {
7506        use std::clone::Clone;
7507        self.next_page_token.clone()
7508    }
7509}
7510
7511/// A request to delete a preview.
7512#[derive(Clone, Default, PartialEq)]
7513#[non_exhaustive]
7514pub struct DeletePreviewRequest {
7515    /// Required. The name of the Preview in the format:
7516    /// 'projects/{project_id}/locations/{location}/previews/{preview}'.
7517    pub name: std::string::String,
7518
7519    /// Optional. An optional request ID to identify requests. Specify a unique
7520    /// request ID so that if you must retry your request, the server will know to
7521    /// ignore the request if it has already been completed. The server will
7522    /// guarantee that for at least 60 minutes after the first request.
7523    ///
7524    /// For example, consider a situation where you make an initial request and the
7525    /// request times out. If you make the request again with the same request ID,
7526    /// the server can check if original operation with the same request ID was
7527    /// received, and if so, will ignore the second request. This prevents clients
7528    /// from accidentally creating duplicate commitments.
7529    ///
7530    /// The request ID must be a valid UUID with the exception that zero UUID is
7531    /// not supported (00000000-0000-0000-0000-000000000000).
7532    pub request_id: std::string::String,
7533
7534    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7535}
7536
7537impl DeletePreviewRequest {
7538    pub fn new() -> Self {
7539        std::default::Default::default()
7540    }
7541
7542    /// Sets the value of [name][crate::model::DeletePreviewRequest::name].
7543    ///
7544    /// # Example
7545    /// ```ignore,no_run
7546    /// # use google_cloud_config_v1::model::DeletePreviewRequest;
7547    /// let x = DeletePreviewRequest::new().set_name("example");
7548    /// ```
7549    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7550        self.name = v.into();
7551        self
7552    }
7553
7554    /// Sets the value of [request_id][crate::model::DeletePreviewRequest::request_id].
7555    ///
7556    /// # Example
7557    /// ```ignore,no_run
7558    /// # use google_cloud_config_v1::model::DeletePreviewRequest;
7559    /// let x = DeletePreviewRequest::new().set_request_id("example");
7560    /// ```
7561    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7562        self.request_id = v.into();
7563        self
7564    }
7565}
7566
7567impl wkt::message::Message for DeletePreviewRequest {
7568    fn typename() -> &'static str {
7569        "type.googleapis.com/google.cloud.config.v1.DeletePreviewRequest"
7570    }
7571}
7572
7573/// A request to export preview results.
7574#[derive(Clone, Default, PartialEq)]
7575#[non_exhaustive]
7576pub struct ExportPreviewResultRequest {
7577    /// Required. The preview whose results should be exported. The preview value
7578    /// is in the format:
7579    /// 'projects/{project_id}/locations/{location}/previews/{preview}'.
7580    pub parent: std::string::String,
7581
7582    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7583}
7584
7585impl ExportPreviewResultRequest {
7586    pub fn new() -> Self {
7587        std::default::Default::default()
7588    }
7589
7590    /// Sets the value of [parent][crate::model::ExportPreviewResultRequest::parent].
7591    ///
7592    /// # Example
7593    /// ```ignore,no_run
7594    /// # use google_cloud_config_v1::model::ExportPreviewResultRequest;
7595    /// let x = ExportPreviewResultRequest::new().set_parent("example");
7596    /// ```
7597    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7598        self.parent = v.into();
7599        self
7600    }
7601}
7602
7603impl wkt::message::Message for ExportPreviewResultRequest {
7604    fn typename() -> &'static str {
7605        "type.googleapis.com/google.cloud.config.v1.ExportPreviewResultRequest"
7606    }
7607}
7608
7609/// A response to `ExportPreviewResult` call. Contains preview results.
7610#[derive(Clone, Default, PartialEq)]
7611#[non_exhaustive]
7612pub struct ExportPreviewResultResponse {
7613    /// Output only. Signed URLs for accessing the plan files.
7614    pub result: std::option::Option<crate::model::PreviewResult>,
7615
7616    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7617}
7618
7619impl ExportPreviewResultResponse {
7620    pub fn new() -> Self {
7621        std::default::Default::default()
7622    }
7623
7624    /// Sets the value of [result][crate::model::ExportPreviewResultResponse::result].
7625    ///
7626    /// # Example
7627    /// ```ignore,no_run
7628    /// # use google_cloud_config_v1::model::ExportPreviewResultResponse;
7629    /// use google_cloud_config_v1::model::PreviewResult;
7630    /// let x = ExportPreviewResultResponse::new().set_result(PreviewResult::default()/* use setters */);
7631    /// ```
7632    pub fn set_result<T>(mut self, v: T) -> Self
7633    where
7634        T: std::convert::Into<crate::model::PreviewResult>,
7635    {
7636        self.result = std::option::Option::Some(v.into());
7637        self
7638    }
7639
7640    /// Sets or clears the value of [result][crate::model::ExportPreviewResultResponse::result].
7641    ///
7642    /// # Example
7643    /// ```ignore,no_run
7644    /// # use google_cloud_config_v1::model::ExportPreviewResultResponse;
7645    /// use google_cloud_config_v1::model::PreviewResult;
7646    /// let x = ExportPreviewResultResponse::new().set_or_clear_result(Some(PreviewResult::default()/* use setters */));
7647    /// let x = ExportPreviewResultResponse::new().set_or_clear_result(None::<PreviewResult>);
7648    /// ```
7649    pub fn set_or_clear_result<T>(mut self, v: std::option::Option<T>) -> Self
7650    where
7651        T: std::convert::Into<crate::model::PreviewResult>,
7652    {
7653        self.result = v.map(|x| x.into());
7654        self
7655    }
7656}
7657
7658impl wkt::message::Message for ExportPreviewResultResponse {
7659    fn typename() -> &'static str {
7660        "type.googleapis.com/google.cloud.config.v1.ExportPreviewResultResponse"
7661    }
7662}
7663
7664/// Contains a signed Cloud Storage URLs.
7665#[derive(Clone, Default, PartialEq)]
7666#[non_exhaustive]
7667pub struct PreviewResult {
7668    /// Output only. Plan binary signed URL
7669    pub binary_signed_uri: std::string::String,
7670
7671    /// Output only. Plan JSON signed URL
7672    pub json_signed_uri: std::string::String,
7673
7674    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7675}
7676
7677impl PreviewResult {
7678    pub fn new() -> Self {
7679        std::default::Default::default()
7680    }
7681
7682    /// Sets the value of [binary_signed_uri][crate::model::PreviewResult::binary_signed_uri].
7683    ///
7684    /// # Example
7685    /// ```ignore,no_run
7686    /// # use google_cloud_config_v1::model::PreviewResult;
7687    /// let x = PreviewResult::new().set_binary_signed_uri("example");
7688    /// ```
7689    pub fn set_binary_signed_uri<T: std::convert::Into<std::string::String>>(
7690        mut self,
7691        v: T,
7692    ) -> Self {
7693        self.binary_signed_uri = v.into();
7694        self
7695    }
7696
7697    /// Sets the value of [json_signed_uri][crate::model::PreviewResult::json_signed_uri].
7698    ///
7699    /// # Example
7700    /// ```ignore,no_run
7701    /// # use google_cloud_config_v1::model::PreviewResult;
7702    /// let x = PreviewResult::new().set_json_signed_uri("example");
7703    /// ```
7704    pub fn set_json_signed_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7705        self.json_signed_uri = v.into();
7706        self
7707    }
7708}
7709
7710impl wkt::message::Message for PreviewResult {
7711    fn typename() -> &'static str {
7712        "type.googleapis.com/google.cloud.config.v1.PreviewResult"
7713    }
7714}
7715
7716/// The request message for the GetTerraformVersion method.
7717#[derive(Clone, Default, PartialEq)]
7718#[non_exhaustive]
7719pub struct GetTerraformVersionRequest {
7720    /// Required. The name of the TerraformVersion. Format:
7721    /// 'projects/{project_id}/locations/{location}/terraformVersions/{terraform_version}'
7722    pub name: std::string::String,
7723
7724    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7725}
7726
7727impl GetTerraformVersionRequest {
7728    pub fn new() -> Self {
7729        std::default::Default::default()
7730    }
7731
7732    /// Sets the value of [name][crate::model::GetTerraformVersionRequest::name].
7733    ///
7734    /// # Example
7735    /// ```ignore,no_run
7736    /// # use google_cloud_config_v1::model::GetTerraformVersionRequest;
7737    /// let x = GetTerraformVersionRequest::new().set_name("example");
7738    /// ```
7739    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7740        self.name = v.into();
7741        self
7742    }
7743}
7744
7745impl wkt::message::Message for GetTerraformVersionRequest {
7746    fn typename() -> &'static str {
7747        "type.googleapis.com/google.cloud.config.v1.GetTerraformVersionRequest"
7748    }
7749}
7750
7751/// The request message for the ListTerraformVersions method.
7752#[derive(Clone, Default, PartialEq)]
7753#[non_exhaustive]
7754pub struct ListTerraformVersionsRequest {
7755    /// Required. The parent in whose context the TerraformVersions are listed. The
7756    /// parent value is in the format:
7757    /// 'projects/{project_id}/locations/{location}'.
7758    pub parent: std::string::String,
7759
7760    /// Optional. When requesting a page of terraform versions, 'page_size'
7761    /// specifies number of terraform versions to return. If unspecified, at most
7762    /// 500 will be returned. The maximum value is 1000.
7763    pub page_size: i32,
7764
7765    /// Optional. Token returned by previous call to 'ListTerraformVersions' which
7766    /// specifies the position in the list from where to continue listing the
7767    /// terraform versions.
7768    pub page_token: std::string::String,
7769
7770    /// Optional. Lists the TerraformVersions that match the filter expression. A
7771    /// filter expression filters the resources listed in the response. The
7772    /// expression must be of the form '{field} {operator} {value}' where
7773    /// operators: '<', '>',
7774    /// '<=', '>=', '!=', '=', ':' are supported (colon ':' represents a HAS
7775    /// operator which is roughly synonymous with equality). {field} can refer to a
7776    /// proto or JSON field, or a synthetic field. Field names can be camelCase or
7777    /// snake_case.
7778    pub filter: std::string::String,
7779
7780    /// Optional. Field to use to sort the list.
7781    pub order_by: std::string::String,
7782
7783    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7784}
7785
7786impl ListTerraformVersionsRequest {
7787    pub fn new() -> Self {
7788        std::default::Default::default()
7789    }
7790
7791    /// Sets the value of [parent][crate::model::ListTerraformVersionsRequest::parent].
7792    ///
7793    /// # Example
7794    /// ```ignore,no_run
7795    /// # use google_cloud_config_v1::model::ListTerraformVersionsRequest;
7796    /// let x = ListTerraformVersionsRequest::new().set_parent("example");
7797    /// ```
7798    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7799        self.parent = v.into();
7800        self
7801    }
7802
7803    /// Sets the value of [page_size][crate::model::ListTerraformVersionsRequest::page_size].
7804    ///
7805    /// # Example
7806    /// ```ignore,no_run
7807    /// # use google_cloud_config_v1::model::ListTerraformVersionsRequest;
7808    /// let x = ListTerraformVersionsRequest::new().set_page_size(42);
7809    /// ```
7810    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7811        self.page_size = v.into();
7812        self
7813    }
7814
7815    /// Sets the value of [page_token][crate::model::ListTerraformVersionsRequest::page_token].
7816    ///
7817    /// # Example
7818    /// ```ignore,no_run
7819    /// # use google_cloud_config_v1::model::ListTerraformVersionsRequest;
7820    /// let x = ListTerraformVersionsRequest::new().set_page_token("example");
7821    /// ```
7822    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7823        self.page_token = v.into();
7824        self
7825    }
7826
7827    /// Sets the value of [filter][crate::model::ListTerraformVersionsRequest::filter].
7828    ///
7829    /// # Example
7830    /// ```ignore,no_run
7831    /// # use google_cloud_config_v1::model::ListTerraformVersionsRequest;
7832    /// let x = ListTerraformVersionsRequest::new().set_filter("example");
7833    /// ```
7834    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7835        self.filter = v.into();
7836        self
7837    }
7838
7839    /// Sets the value of [order_by][crate::model::ListTerraformVersionsRequest::order_by].
7840    ///
7841    /// # Example
7842    /// ```ignore,no_run
7843    /// # use google_cloud_config_v1::model::ListTerraformVersionsRequest;
7844    /// let x = ListTerraformVersionsRequest::new().set_order_by("example");
7845    /// ```
7846    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7847        self.order_by = v.into();
7848        self
7849    }
7850}
7851
7852impl wkt::message::Message for ListTerraformVersionsRequest {
7853    fn typename() -> &'static str {
7854        "type.googleapis.com/google.cloud.config.v1.ListTerraformVersionsRequest"
7855    }
7856}
7857
7858/// The response message for the `ListTerraformVersions` method.
7859#[derive(Clone, Default, PartialEq)]
7860#[non_exhaustive]
7861pub struct ListTerraformVersionsResponse {
7862    /// List of [TerraformVersion][google.cloud.config.v1.TerraformVersion]s.
7863    ///
7864    /// [google.cloud.config.v1.TerraformVersion]: crate::model::TerraformVersion
7865    pub terraform_versions: std::vec::Vec<crate::model::TerraformVersion>,
7866
7867    /// Token to be supplied to the next ListTerraformVersions request via
7868    /// `page_token` to obtain the next set of results.
7869    pub next_page_token: std::string::String,
7870
7871    /// Unreachable resources, if any.
7872    pub unreachable: std::vec::Vec<std::string::String>,
7873
7874    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7875}
7876
7877impl ListTerraformVersionsResponse {
7878    pub fn new() -> Self {
7879        std::default::Default::default()
7880    }
7881
7882    /// Sets the value of [terraform_versions][crate::model::ListTerraformVersionsResponse::terraform_versions].
7883    ///
7884    /// # Example
7885    /// ```ignore,no_run
7886    /// # use google_cloud_config_v1::model::ListTerraformVersionsResponse;
7887    /// use google_cloud_config_v1::model::TerraformVersion;
7888    /// let x = ListTerraformVersionsResponse::new()
7889    ///     .set_terraform_versions([
7890    ///         TerraformVersion::default()/* use setters */,
7891    ///         TerraformVersion::default()/* use (different) setters */,
7892    ///     ]);
7893    /// ```
7894    pub fn set_terraform_versions<T, V>(mut self, v: T) -> Self
7895    where
7896        T: std::iter::IntoIterator<Item = V>,
7897        V: std::convert::Into<crate::model::TerraformVersion>,
7898    {
7899        use std::iter::Iterator;
7900        self.terraform_versions = v.into_iter().map(|i| i.into()).collect();
7901        self
7902    }
7903
7904    /// Sets the value of [next_page_token][crate::model::ListTerraformVersionsResponse::next_page_token].
7905    ///
7906    /// # Example
7907    /// ```ignore,no_run
7908    /// # use google_cloud_config_v1::model::ListTerraformVersionsResponse;
7909    /// let x = ListTerraformVersionsResponse::new().set_next_page_token("example");
7910    /// ```
7911    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7912        self.next_page_token = v.into();
7913        self
7914    }
7915
7916    /// Sets the value of [unreachable][crate::model::ListTerraformVersionsResponse::unreachable].
7917    ///
7918    /// # Example
7919    /// ```ignore,no_run
7920    /// # use google_cloud_config_v1::model::ListTerraformVersionsResponse;
7921    /// let x = ListTerraformVersionsResponse::new().set_unreachable(["a", "b", "c"]);
7922    /// ```
7923    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
7924    where
7925        T: std::iter::IntoIterator<Item = V>,
7926        V: std::convert::Into<std::string::String>,
7927    {
7928        use std::iter::Iterator;
7929        self.unreachable = v.into_iter().map(|i| i.into()).collect();
7930        self
7931    }
7932}
7933
7934impl wkt::message::Message for ListTerraformVersionsResponse {
7935    fn typename() -> &'static str {
7936        "type.googleapis.com/google.cloud.config.v1.ListTerraformVersionsResponse"
7937    }
7938}
7939
7940#[doc(hidden)]
7941impl gax::paginator::internal::PageableResponse for ListTerraformVersionsResponse {
7942    type PageItem = crate::model::TerraformVersion;
7943
7944    fn items(self) -> std::vec::Vec<Self::PageItem> {
7945        self.terraform_versions
7946    }
7947
7948    fn next_page_token(&self) -> std::string::String {
7949        use std::clone::Clone;
7950        self.next_page_token.clone()
7951    }
7952}
7953
7954/// A TerraformVersion represents the support state the corresponding
7955/// Terraform version.
7956#[derive(Clone, Default, PartialEq)]
7957#[non_exhaustive]
7958pub struct TerraformVersion {
7959    /// Identifier. The version name is in the format:
7960    /// 'projects/{project_id}/locations/{location}/terraformVersions/{terraform_version}'.
7961    pub name: std::string::String,
7962
7963    /// Output only. The state of the version, ACTIVE, DEPRECATED or OBSOLETE.
7964    pub state: crate::model::terraform_version::State,
7965
7966    /// Output only. When the version is supported.
7967    pub support_time: std::option::Option<wkt::Timestamp>,
7968
7969    /// Output only. When the version is deprecated.
7970    pub deprecate_time: std::option::Option<wkt::Timestamp>,
7971
7972    /// Output only. When the version is obsolete.
7973    pub obsolete_time: std::option::Option<wkt::Timestamp>,
7974
7975    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7976}
7977
7978impl TerraformVersion {
7979    pub fn new() -> Self {
7980        std::default::Default::default()
7981    }
7982
7983    /// Sets the value of [name][crate::model::TerraformVersion::name].
7984    ///
7985    /// # Example
7986    /// ```ignore,no_run
7987    /// # use google_cloud_config_v1::model::TerraformVersion;
7988    /// let x = TerraformVersion::new().set_name("example");
7989    /// ```
7990    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7991        self.name = v.into();
7992        self
7993    }
7994
7995    /// Sets the value of [state][crate::model::TerraformVersion::state].
7996    ///
7997    /// # Example
7998    /// ```ignore,no_run
7999    /// # use google_cloud_config_v1::model::TerraformVersion;
8000    /// use google_cloud_config_v1::model::terraform_version::State;
8001    /// let x0 = TerraformVersion::new().set_state(State::Active);
8002    /// let x1 = TerraformVersion::new().set_state(State::Deprecated);
8003    /// let x2 = TerraformVersion::new().set_state(State::Obsolete);
8004    /// ```
8005    pub fn set_state<T: std::convert::Into<crate::model::terraform_version::State>>(
8006        mut self,
8007        v: T,
8008    ) -> Self {
8009        self.state = v.into();
8010        self
8011    }
8012
8013    /// Sets the value of [support_time][crate::model::TerraformVersion::support_time].
8014    ///
8015    /// # Example
8016    /// ```ignore,no_run
8017    /// # use google_cloud_config_v1::model::TerraformVersion;
8018    /// use wkt::Timestamp;
8019    /// let x = TerraformVersion::new().set_support_time(Timestamp::default()/* use setters */);
8020    /// ```
8021    pub fn set_support_time<T>(mut self, v: T) -> Self
8022    where
8023        T: std::convert::Into<wkt::Timestamp>,
8024    {
8025        self.support_time = std::option::Option::Some(v.into());
8026        self
8027    }
8028
8029    /// Sets or clears the value of [support_time][crate::model::TerraformVersion::support_time].
8030    ///
8031    /// # Example
8032    /// ```ignore,no_run
8033    /// # use google_cloud_config_v1::model::TerraformVersion;
8034    /// use wkt::Timestamp;
8035    /// let x = TerraformVersion::new().set_or_clear_support_time(Some(Timestamp::default()/* use setters */));
8036    /// let x = TerraformVersion::new().set_or_clear_support_time(None::<Timestamp>);
8037    /// ```
8038    pub fn set_or_clear_support_time<T>(mut self, v: std::option::Option<T>) -> Self
8039    where
8040        T: std::convert::Into<wkt::Timestamp>,
8041    {
8042        self.support_time = v.map(|x| x.into());
8043        self
8044    }
8045
8046    /// Sets the value of [deprecate_time][crate::model::TerraformVersion::deprecate_time].
8047    ///
8048    /// # Example
8049    /// ```ignore,no_run
8050    /// # use google_cloud_config_v1::model::TerraformVersion;
8051    /// use wkt::Timestamp;
8052    /// let x = TerraformVersion::new().set_deprecate_time(Timestamp::default()/* use setters */);
8053    /// ```
8054    pub fn set_deprecate_time<T>(mut self, v: T) -> Self
8055    where
8056        T: std::convert::Into<wkt::Timestamp>,
8057    {
8058        self.deprecate_time = std::option::Option::Some(v.into());
8059        self
8060    }
8061
8062    /// Sets or clears the value of [deprecate_time][crate::model::TerraformVersion::deprecate_time].
8063    ///
8064    /// # Example
8065    /// ```ignore,no_run
8066    /// # use google_cloud_config_v1::model::TerraformVersion;
8067    /// use wkt::Timestamp;
8068    /// let x = TerraformVersion::new().set_or_clear_deprecate_time(Some(Timestamp::default()/* use setters */));
8069    /// let x = TerraformVersion::new().set_or_clear_deprecate_time(None::<Timestamp>);
8070    /// ```
8071    pub fn set_or_clear_deprecate_time<T>(mut self, v: std::option::Option<T>) -> Self
8072    where
8073        T: std::convert::Into<wkt::Timestamp>,
8074    {
8075        self.deprecate_time = v.map(|x| x.into());
8076        self
8077    }
8078
8079    /// Sets the value of [obsolete_time][crate::model::TerraformVersion::obsolete_time].
8080    ///
8081    /// # Example
8082    /// ```ignore,no_run
8083    /// # use google_cloud_config_v1::model::TerraformVersion;
8084    /// use wkt::Timestamp;
8085    /// let x = TerraformVersion::new().set_obsolete_time(Timestamp::default()/* use setters */);
8086    /// ```
8087    pub fn set_obsolete_time<T>(mut self, v: T) -> Self
8088    where
8089        T: std::convert::Into<wkt::Timestamp>,
8090    {
8091        self.obsolete_time = std::option::Option::Some(v.into());
8092        self
8093    }
8094
8095    /// Sets or clears the value of [obsolete_time][crate::model::TerraformVersion::obsolete_time].
8096    ///
8097    /// # Example
8098    /// ```ignore,no_run
8099    /// # use google_cloud_config_v1::model::TerraformVersion;
8100    /// use wkt::Timestamp;
8101    /// let x = TerraformVersion::new().set_or_clear_obsolete_time(Some(Timestamp::default()/* use setters */));
8102    /// let x = TerraformVersion::new().set_or_clear_obsolete_time(None::<Timestamp>);
8103    /// ```
8104    pub fn set_or_clear_obsolete_time<T>(mut self, v: std::option::Option<T>) -> Self
8105    where
8106        T: std::convert::Into<wkt::Timestamp>,
8107    {
8108        self.obsolete_time = v.map(|x| x.into());
8109        self
8110    }
8111}
8112
8113impl wkt::message::Message for TerraformVersion {
8114    fn typename() -> &'static str {
8115        "type.googleapis.com/google.cloud.config.v1.TerraformVersion"
8116    }
8117}
8118
8119/// Defines additional types related to [TerraformVersion].
8120pub mod terraform_version {
8121    #[allow(unused_imports)]
8122    use super::*;
8123
8124    /// Possible states of a TerraformVersion.
8125    ///
8126    /// # Working with unknown values
8127    ///
8128    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8129    /// additional enum variants at any time. Adding new variants is not considered
8130    /// a breaking change. Applications should write their code in anticipation of:
8131    ///
8132    /// - New values appearing in future releases of the client library, **and**
8133    /// - New values received dynamically, without application changes.
8134    ///
8135    /// Please consult the [Working with enums] section in the user guide for some
8136    /// guidelines.
8137    ///
8138    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
8139    #[derive(Clone, Debug, PartialEq)]
8140    #[non_exhaustive]
8141    pub enum State {
8142        /// The default value. This value is used if the state is omitted.
8143        Unspecified,
8144        /// The version is actively supported.
8145        Active,
8146        /// The version is deprecated.
8147        Deprecated,
8148        /// The version is obsolete.
8149        Obsolete,
8150        /// If set, the enum was initialized with an unknown value.
8151        ///
8152        /// Applications can examine the value using [State::value] or
8153        /// [State::name].
8154        UnknownValue(state::UnknownValue),
8155    }
8156
8157    #[doc(hidden)]
8158    pub mod state {
8159        #[allow(unused_imports)]
8160        use super::*;
8161        #[derive(Clone, Debug, PartialEq)]
8162        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8163    }
8164
8165    impl State {
8166        /// Gets the enum value.
8167        ///
8168        /// Returns `None` if the enum contains an unknown value deserialized from
8169        /// the string representation of enums.
8170        pub fn value(&self) -> std::option::Option<i32> {
8171            match self {
8172                Self::Unspecified => std::option::Option::Some(0),
8173                Self::Active => std::option::Option::Some(1),
8174                Self::Deprecated => std::option::Option::Some(2),
8175                Self::Obsolete => std::option::Option::Some(3),
8176                Self::UnknownValue(u) => u.0.value(),
8177            }
8178        }
8179
8180        /// Gets the enum value as a string.
8181        ///
8182        /// Returns `None` if the enum contains an unknown value deserialized from
8183        /// the integer representation of enums.
8184        pub fn name(&self) -> std::option::Option<&str> {
8185            match self {
8186                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
8187                Self::Active => std::option::Option::Some("ACTIVE"),
8188                Self::Deprecated => std::option::Option::Some("DEPRECATED"),
8189                Self::Obsolete => std::option::Option::Some("OBSOLETE"),
8190                Self::UnknownValue(u) => u.0.name(),
8191            }
8192        }
8193    }
8194
8195    impl std::default::Default for State {
8196        fn default() -> Self {
8197            use std::convert::From;
8198            Self::from(0)
8199        }
8200    }
8201
8202    impl std::fmt::Display for State {
8203        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8204            wkt::internal::display_enum(f, self.name(), self.value())
8205        }
8206    }
8207
8208    impl std::convert::From<i32> for State {
8209        fn from(value: i32) -> Self {
8210            match value {
8211                0 => Self::Unspecified,
8212                1 => Self::Active,
8213                2 => Self::Deprecated,
8214                3 => Self::Obsolete,
8215                _ => Self::UnknownValue(state::UnknownValue(
8216                    wkt::internal::UnknownEnumValue::Integer(value),
8217                )),
8218            }
8219        }
8220    }
8221
8222    impl std::convert::From<&str> for State {
8223        fn from(value: &str) -> Self {
8224            use std::string::ToString;
8225            match value {
8226                "STATE_UNSPECIFIED" => Self::Unspecified,
8227                "ACTIVE" => Self::Active,
8228                "DEPRECATED" => Self::Deprecated,
8229                "OBSOLETE" => Self::Obsolete,
8230                _ => Self::UnknownValue(state::UnknownValue(
8231                    wkt::internal::UnknownEnumValue::String(value.to_string()),
8232                )),
8233            }
8234        }
8235    }
8236
8237    impl serde::ser::Serialize for State {
8238        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8239        where
8240            S: serde::Serializer,
8241        {
8242            match self {
8243                Self::Unspecified => serializer.serialize_i32(0),
8244                Self::Active => serializer.serialize_i32(1),
8245                Self::Deprecated => serializer.serialize_i32(2),
8246                Self::Obsolete => serializer.serialize_i32(3),
8247                Self::UnknownValue(u) => u.0.serialize(serializer),
8248            }
8249        }
8250    }
8251
8252    impl<'de> serde::de::Deserialize<'de> for State {
8253        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8254        where
8255            D: serde::Deserializer<'de>,
8256        {
8257            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
8258                ".google.cloud.config.v1.TerraformVersion.State",
8259            ))
8260        }
8261    }
8262}
8263
8264/// Terraform info of a ResourceChange.
8265#[derive(Clone, Default, PartialEq)]
8266#[non_exhaustive]
8267pub struct ResourceChangeTerraformInfo {
8268    /// Output only. TF resource address that uniquely identifies the resource.
8269    pub address: std::string::String,
8270
8271    /// Output only. TF resource type.
8272    pub r#type: std::string::String,
8273
8274    /// Output only. TF resource name.
8275    pub resource_name: std::string::String,
8276
8277    /// Output only. TF resource provider.
8278    pub provider: std::string::String,
8279
8280    /// Output only. TF resource actions.
8281    pub actions: std::vec::Vec<std::string::String>,
8282
8283    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8284}
8285
8286impl ResourceChangeTerraformInfo {
8287    pub fn new() -> Self {
8288        std::default::Default::default()
8289    }
8290
8291    /// Sets the value of [address][crate::model::ResourceChangeTerraformInfo::address].
8292    ///
8293    /// # Example
8294    /// ```ignore,no_run
8295    /// # use google_cloud_config_v1::model::ResourceChangeTerraformInfo;
8296    /// let x = ResourceChangeTerraformInfo::new().set_address("example");
8297    /// ```
8298    pub fn set_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8299        self.address = v.into();
8300        self
8301    }
8302
8303    /// Sets the value of [r#type][crate::model::ResourceChangeTerraformInfo::type].
8304    ///
8305    /// # Example
8306    /// ```ignore,no_run
8307    /// # use google_cloud_config_v1::model::ResourceChangeTerraformInfo;
8308    /// let x = ResourceChangeTerraformInfo::new().set_type("example");
8309    /// ```
8310    pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8311        self.r#type = v.into();
8312        self
8313    }
8314
8315    /// Sets the value of [resource_name][crate::model::ResourceChangeTerraformInfo::resource_name].
8316    ///
8317    /// # Example
8318    /// ```ignore,no_run
8319    /// # use google_cloud_config_v1::model::ResourceChangeTerraformInfo;
8320    /// let x = ResourceChangeTerraformInfo::new().set_resource_name("example");
8321    /// ```
8322    pub fn set_resource_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8323        self.resource_name = v.into();
8324        self
8325    }
8326
8327    /// Sets the value of [provider][crate::model::ResourceChangeTerraformInfo::provider].
8328    ///
8329    /// # Example
8330    /// ```ignore,no_run
8331    /// # use google_cloud_config_v1::model::ResourceChangeTerraformInfo;
8332    /// let x = ResourceChangeTerraformInfo::new().set_provider("example");
8333    /// ```
8334    pub fn set_provider<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8335        self.provider = v.into();
8336        self
8337    }
8338
8339    /// Sets the value of [actions][crate::model::ResourceChangeTerraformInfo::actions].
8340    ///
8341    /// # Example
8342    /// ```ignore,no_run
8343    /// # use google_cloud_config_v1::model::ResourceChangeTerraformInfo;
8344    /// let x = ResourceChangeTerraformInfo::new().set_actions(["a", "b", "c"]);
8345    /// ```
8346    pub fn set_actions<T, V>(mut self, v: T) -> Self
8347    where
8348        T: std::iter::IntoIterator<Item = V>,
8349        V: std::convert::Into<std::string::String>,
8350    {
8351        use std::iter::Iterator;
8352        self.actions = v.into_iter().map(|i| i.into()).collect();
8353        self
8354    }
8355}
8356
8357impl wkt::message::Message for ResourceChangeTerraformInfo {
8358    fn typename() -> &'static str {
8359        "type.googleapis.com/google.cloud.config.v1.ResourceChangeTerraformInfo"
8360    }
8361}
8362
8363/// A resource change represents a change to a resource in the state file.
8364#[derive(Clone, Default, PartialEq)]
8365#[non_exhaustive]
8366pub struct ResourceChange {
8367    /// Identifier. The name of the resource change.
8368    /// Format:
8369    /// 'projects/{project_id}/locations/{location}/previews/{preview}/resourceChanges/{resource_change}'.
8370    pub name: std::string::String,
8371
8372    /// Output only. Terraform info of the resource change.
8373    pub terraform_info: std::option::Option<crate::model::ResourceChangeTerraformInfo>,
8374
8375    /// Output only. The intent of the resource change.
8376    pub intent: crate::model::resource_change::Intent,
8377
8378    /// Output only. The property changes of the resource change.
8379    pub property_changes: std::vec::Vec<crate::model::PropertyChange>,
8380
8381    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8382}
8383
8384impl ResourceChange {
8385    pub fn new() -> Self {
8386        std::default::Default::default()
8387    }
8388
8389    /// Sets the value of [name][crate::model::ResourceChange::name].
8390    ///
8391    /// # Example
8392    /// ```ignore,no_run
8393    /// # use google_cloud_config_v1::model::ResourceChange;
8394    /// let x = ResourceChange::new().set_name("example");
8395    /// ```
8396    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8397        self.name = v.into();
8398        self
8399    }
8400
8401    /// Sets the value of [terraform_info][crate::model::ResourceChange::terraform_info].
8402    ///
8403    /// # Example
8404    /// ```ignore,no_run
8405    /// # use google_cloud_config_v1::model::ResourceChange;
8406    /// use google_cloud_config_v1::model::ResourceChangeTerraformInfo;
8407    /// let x = ResourceChange::new().set_terraform_info(ResourceChangeTerraformInfo::default()/* use setters */);
8408    /// ```
8409    pub fn set_terraform_info<T>(mut self, v: T) -> Self
8410    where
8411        T: std::convert::Into<crate::model::ResourceChangeTerraformInfo>,
8412    {
8413        self.terraform_info = std::option::Option::Some(v.into());
8414        self
8415    }
8416
8417    /// Sets or clears the value of [terraform_info][crate::model::ResourceChange::terraform_info].
8418    ///
8419    /// # Example
8420    /// ```ignore,no_run
8421    /// # use google_cloud_config_v1::model::ResourceChange;
8422    /// use google_cloud_config_v1::model::ResourceChangeTerraformInfo;
8423    /// let x = ResourceChange::new().set_or_clear_terraform_info(Some(ResourceChangeTerraformInfo::default()/* use setters */));
8424    /// let x = ResourceChange::new().set_or_clear_terraform_info(None::<ResourceChangeTerraformInfo>);
8425    /// ```
8426    pub fn set_or_clear_terraform_info<T>(mut self, v: std::option::Option<T>) -> Self
8427    where
8428        T: std::convert::Into<crate::model::ResourceChangeTerraformInfo>,
8429    {
8430        self.terraform_info = v.map(|x| x.into());
8431        self
8432    }
8433
8434    /// Sets the value of [intent][crate::model::ResourceChange::intent].
8435    ///
8436    /// # Example
8437    /// ```ignore,no_run
8438    /// # use google_cloud_config_v1::model::ResourceChange;
8439    /// use google_cloud_config_v1::model::resource_change::Intent;
8440    /// let x0 = ResourceChange::new().set_intent(Intent::Create);
8441    /// let x1 = ResourceChange::new().set_intent(Intent::Update);
8442    /// let x2 = ResourceChange::new().set_intent(Intent::Delete);
8443    /// ```
8444    pub fn set_intent<T: std::convert::Into<crate::model::resource_change::Intent>>(
8445        mut self,
8446        v: T,
8447    ) -> Self {
8448        self.intent = v.into();
8449        self
8450    }
8451
8452    /// Sets the value of [property_changes][crate::model::ResourceChange::property_changes].
8453    ///
8454    /// # Example
8455    /// ```ignore,no_run
8456    /// # use google_cloud_config_v1::model::ResourceChange;
8457    /// use google_cloud_config_v1::model::PropertyChange;
8458    /// let x = ResourceChange::new()
8459    ///     .set_property_changes([
8460    ///         PropertyChange::default()/* use setters */,
8461    ///         PropertyChange::default()/* use (different) setters */,
8462    ///     ]);
8463    /// ```
8464    pub fn set_property_changes<T, V>(mut self, v: T) -> Self
8465    where
8466        T: std::iter::IntoIterator<Item = V>,
8467        V: std::convert::Into<crate::model::PropertyChange>,
8468    {
8469        use std::iter::Iterator;
8470        self.property_changes = v.into_iter().map(|i| i.into()).collect();
8471        self
8472    }
8473}
8474
8475impl wkt::message::Message for ResourceChange {
8476    fn typename() -> &'static str {
8477        "type.googleapis.com/google.cloud.config.v1.ResourceChange"
8478    }
8479}
8480
8481/// Defines additional types related to [ResourceChange].
8482pub mod resource_change {
8483    #[allow(unused_imports)]
8484    use super::*;
8485
8486    /// Possible intent of the resource change.
8487    ///
8488    /// # Working with unknown values
8489    ///
8490    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8491    /// additional enum variants at any time. Adding new variants is not considered
8492    /// a breaking change. Applications should write their code in anticipation of:
8493    ///
8494    /// - New values appearing in future releases of the client library, **and**
8495    /// - New values received dynamically, without application changes.
8496    ///
8497    /// Please consult the [Working with enums] section in the user guide for some
8498    /// guidelines.
8499    ///
8500    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
8501    #[derive(Clone, Debug, PartialEq)]
8502    #[non_exhaustive]
8503    pub enum Intent {
8504        /// The default value.
8505        Unspecified,
8506        /// The resource will be created.
8507        Create,
8508        /// The resource will be updated.
8509        Update,
8510        /// The resource will be deleted.
8511        Delete,
8512        /// The resource will be recreated.
8513        Recreate,
8514        /// The resource will be untouched.
8515        Unchanged,
8516        /// If set, the enum was initialized with an unknown value.
8517        ///
8518        /// Applications can examine the value using [Intent::value] or
8519        /// [Intent::name].
8520        UnknownValue(intent::UnknownValue),
8521    }
8522
8523    #[doc(hidden)]
8524    pub mod intent {
8525        #[allow(unused_imports)]
8526        use super::*;
8527        #[derive(Clone, Debug, PartialEq)]
8528        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8529    }
8530
8531    impl Intent {
8532        /// Gets the enum value.
8533        ///
8534        /// Returns `None` if the enum contains an unknown value deserialized from
8535        /// the string representation of enums.
8536        pub fn value(&self) -> std::option::Option<i32> {
8537            match self {
8538                Self::Unspecified => std::option::Option::Some(0),
8539                Self::Create => std::option::Option::Some(1),
8540                Self::Update => std::option::Option::Some(2),
8541                Self::Delete => std::option::Option::Some(3),
8542                Self::Recreate => std::option::Option::Some(4),
8543                Self::Unchanged => std::option::Option::Some(5),
8544                Self::UnknownValue(u) => u.0.value(),
8545            }
8546        }
8547
8548        /// Gets the enum value as a string.
8549        ///
8550        /// Returns `None` if the enum contains an unknown value deserialized from
8551        /// the integer representation of enums.
8552        pub fn name(&self) -> std::option::Option<&str> {
8553            match self {
8554                Self::Unspecified => std::option::Option::Some("INTENT_UNSPECIFIED"),
8555                Self::Create => std::option::Option::Some("CREATE"),
8556                Self::Update => std::option::Option::Some("UPDATE"),
8557                Self::Delete => std::option::Option::Some("DELETE"),
8558                Self::Recreate => std::option::Option::Some("RECREATE"),
8559                Self::Unchanged => std::option::Option::Some("UNCHANGED"),
8560                Self::UnknownValue(u) => u.0.name(),
8561            }
8562        }
8563    }
8564
8565    impl std::default::Default for Intent {
8566        fn default() -> Self {
8567            use std::convert::From;
8568            Self::from(0)
8569        }
8570    }
8571
8572    impl std::fmt::Display for Intent {
8573        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8574            wkt::internal::display_enum(f, self.name(), self.value())
8575        }
8576    }
8577
8578    impl std::convert::From<i32> for Intent {
8579        fn from(value: i32) -> Self {
8580            match value {
8581                0 => Self::Unspecified,
8582                1 => Self::Create,
8583                2 => Self::Update,
8584                3 => Self::Delete,
8585                4 => Self::Recreate,
8586                5 => Self::Unchanged,
8587                _ => Self::UnknownValue(intent::UnknownValue(
8588                    wkt::internal::UnknownEnumValue::Integer(value),
8589                )),
8590            }
8591        }
8592    }
8593
8594    impl std::convert::From<&str> for Intent {
8595        fn from(value: &str) -> Self {
8596            use std::string::ToString;
8597            match value {
8598                "INTENT_UNSPECIFIED" => Self::Unspecified,
8599                "CREATE" => Self::Create,
8600                "UPDATE" => Self::Update,
8601                "DELETE" => Self::Delete,
8602                "RECREATE" => Self::Recreate,
8603                "UNCHANGED" => Self::Unchanged,
8604                _ => Self::UnknownValue(intent::UnknownValue(
8605                    wkt::internal::UnknownEnumValue::String(value.to_string()),
8606                )),
8607            }
8608        }
8609    }
8610
8611    impl serde::ser::Serialize for Intent {
8612        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8613        where
8614            S: serde::Serializer,
8615        {
8616            match self {
8617                Self::Unspecified => serializer.serialize_i32(0),
8618                Self::Create => serializer.serialize_i32(1),
8619                Self::Update => serializer.serialize_i32(2),
8620                Self::Delete => serializer.serialize_i32(3),
8621                Self::Recreate => serializer.serialize_i32(4),
8622                Self::Unchanged => serializer.serialize_i32(5),
8623                Self::UnknownValue(u) => u.0.serialize(serializer),
8624            }
8625        }
8626    }
8627
8628    impl<'de> serde::de::Deserialize<'de> for Intent {
8629        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8630        where
8631            D: serde::Deserializer<'de>,
8632        {
8633            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Intent>::new(
8634                ".google.cloud.config.v1.ResourceChange.Intent",
8635            ))
8636        }
8637    }
8638}
8639
8640/// A property change represents a change to a property in the state file.
8641#[derive(Clone, Default, PartialEq)]
8642#[non_exhaustive]
8643pub struct PropertyChange {
8644    /// Output only. The path of the property change.
8645    pub path: std::string::String,
8646
8647    /// Output only. The paths of sensitive fields in `before`. Paths are relative
8648    /// to `path`.
8649    pub before_sensitive_paths: std::vec::Vec<std::string::String>,
8650
8651    /// Output only. Representations of the object value before the actions.
8652    pub before: std::option::Option<wkt::Value>,
8653
8654    /// Output only. The paths of sensitive fields in `after`. Paths are relative
8655    /// to `path`.
8656    pub after_sensitive_paths: std::vec::Vec<std::string::String>,
8657
8658    /// Output only. Representations of the object value after the actions.
8659    pub after: std::option::Option<wkt::Value>,
8660
8661    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8662}
8663
8664impl PropertyChange {
8665    pub fn new() -> Self {
8666        std::default::Default::default()
8667    }
8668
8669    /// Sets the value of [path][crate::model::PropertyChange::path].
8670    ///
8671    /// # Example
8672    /// ```ignore,no_run
8673    /// # use google_cloud_config_v1::model::PropertyChange;
8674    /// let x = PropertyChange::new().set_path("example");
8675    /// ```
8676    pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8677        self.path = v.into();
8678        self
8679    }
8680
8681    /// Sets the value of [before_sensitive_paths][crate::model::PropertyChange::before_sensitive_paths].
8682    ///
8683    /// # Example
8684    /// ```ignore,no_run
8685    /// # use google_cloud_config_v1::model::PropertyChange;
8686    /// let x = PropertyChange::new().set_before_sensitive_paths(["a", "b", "c"]);
8687    /// ```
8688    pub fn set_before_sensitive_paths<T, V>(mut self, v: T) -> Self
8689    where
8690        T: std::iter::IntoIterator<Item = V>,
8691        V: std::convert::Into<std::string::String>,
8692    {
8693        use std::iter::Iterator;
8694        self.before_sensitive_paths = v.into_iter().map(|i| i.into()).collect();
8695        self
8696    }
8697
8698    /// Sets the value of [before][crate::model::PropertyChange::before].
8699    ///
8700    /// # Example
8701    /// ```ignore,no_run
8702    /// # use google_cloud_config_v1::model::PropertyChange;
8703    /// use wkt::Value;
8704    /// let x = PropertyChange::new().set_before(Value::default()/* use setters */);
8705    /// ```
8706    pub fn set_before<T>(mut self, v: T) -> Self
8707    where
8708        T: std::convert::Into<wkt::Value>,
8709    {
8710        self.before = std::option::Option::Some(v.into());
8711        self
8712    }
8713
8714    /// Sets or clears the value of [before][crate::model::PropertyChange::before].
8715    ///
8716    /// # Example
8717    /// ```ignore,no_run
8718    /// # use google_cloud_config_v1::model::PropertyChange;
8719    /// use wkt::Value;
8720    /// let x = PropertyChange::new().set_or_clear_before(Some(Value::default()/* use setters */));
8721    /// let x = PropertyChange::new().set_or_clear_before(None::<Value>);
8722    /// ```
8723    pub fn set_or_clear_before<T>(mut self, v: std::option::Option<T>) -> Self
8724    where
8725        T: std::convert::Into<wkt::Value>,
8726    {
8727        self.before = v.map(|x| x.into());
8728        self
8729    }
8730
8731    /// Sets the value of [after_sensitive_paths][crate::model::PropertyChange::after_sensitive_paths].
8732    ///
8733    /// # Example
8734    /// ```ignore,no_run
8735    /// # use google_cloud_config_v1::model::PropertyChange;
8736    /// let x = PropertyChange::new().set_after_sensitive_paths(["a", "b", "c"]);
8737    /// ```
8738    pub fn set_after_sensitive_paths<T, V>(mut self, v: T) -> Self
8739    where
8740        T: std::iter::IntoIterator<Item = V>,
8741        V: std::convert::Into<std::string::String>,
8742    {
8743        use std::iter::Iterator;
8744        self.after_sensitive_paths = v.into_iter().map(|i| i.into()).collect();
8745        self
8746    }
8747
8748    /// Sets the value of [after][crate::model::PropertyChange::after].
8749    ///
8750    /// # Example
8751    /// ```ignore,no_run
8752    /// # use google_cloud_config_v1::model::PropertyChange;
8753    /// use wkt::Value;
8754    /// let x = PropertyChange::new().set_after(Value::default()/* use setters */);
8755    /// ```
8756    pub fn set_after<T>(mut self, v: T) -> Self
8757    where
8758        T: std::convert::Into<wkt::Value>,
8759    {
8760        self.after = std::option::Option::Some(v.into());
8761        self
8762    }
8763
8764    /// Sets or clears the value of [after][crate::model::PropertyChange::after].
8765    ///
8766    /// # Example
8767    /// ```ignore,no_run
8768    /// # use google_cloud_config_v1::model::PropertyChange;
8769    /// use wkt::Value;
8770    /// let x = PropertyChange::new().set_or_clear_after(Some(Value::default()/* use setters */));
8771    /// let x = PropertyChange::new().set_or_clear_after(None::<Value>);
8772    /// ```
8773    pub fn set_or_clear_after<T>(mut self, v: std::option::Option<T>) -> Self
8774    where
8775        T: std::convert::Into<wkt::Value>,
8776    {
8777        self.after = v.map(|x| x.into());
8778        self
8779    }
8780}
8781
8782impl wkt::message::Message for PropertyChange {
8783    fn typename() -> &'static str {
8784        "type.googleapis.com/google.cloud.config.v1.PropertyChange"
8785    }
8786}
8787
8788/// The request message for the ListResourceChanges method.
8789#[derive(Clone, Default, PartialEq)]
8790#[non_exhaustive]
8791pub struct ListResourceChangesRequest {
8792    /// Required. The parent in whose context the ResourceChanges are listed. The
8793    /// parent value is in the format:
8794    /// 'projects/{project_id}/locations/{location}/previews/{preview}'.
8795    pub parent: std::string::String,
8796
8797    /// Optional. When requesting a page of resource changes, 'page_size' specifies
8798    /// number of resource changes to return. If unspecified, at most 500 will be
8799    /// returned. The maximum value is 1000.
8800    pub page_size: i32,
8801
8802    /// Optional. Token returned by previous call to 'ListResourceChanges' which
8803    /// specifies the position in the list from where to continue listing the
8804    /// resource changes.
8805    pub page_token: std::string::String,
8806
8807    /// Optional. Lists the resource changes that match the filter expression. A
8808    /// filter expression filters the resource changes listed in the response. The
8809    /// expression must be of the form '{field} {operator} {value}' where
8810    /// operators: '<', '>',
8811    /// '<=',
8812    /// '>=',
8813    /// '!=', '=', ':' are supported (colon ':' represents a HAS operator which is
8814    /// roughly synonymous with equality). {field} can refer to a proto or JSON
8815    /// field, or a synthetic field. Field names can be camelCase or snake_case.
8816    ///
8817    /// Examples:
8818    ///
8819    /// - Filter by name:
8820    ///   name =
8821    ///   "projects/foo/locations/us-central1/previews/dep/resourceChanges/baz
8822    pub filter: std::string::String,
8823
8824    /// Optional. Field to use to sort the list.
8825    pub order_by: std::string::String,
8826
8827    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8828}
8829
8830impl ListResourceChangesRequest {
8831    pub fn new() -> Self {
8832        std::default::Default::default()
8833    }
8834
8835    /// Sets the value of [parent][crate::model::ListResourceChangesRequest::parent].
8836    ///
8837    /// # Example
8838    /// ```ignore,no_run
8839    /// # use google_cloud_config_v1::model::ListResourceChangesRequest;
8840    /// let x = ListResourceChangesRequest::new().set_parent("example");
8841    /// ```
8842    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8843        self.parent = v.into();
8844        self
8845    }
8846
8847    /// Sets the value of [page_size][crate::model::ListResourceChangesRequest::page_size].
8848    ///
8849    /// # Example
8850    /// ```ignore,no_run
8851    /// # use google_cloud_config_v1::model::ListResourceChangesRequest;
8852    /// let x = ListResourceChangesRequest::new().set_page_size(42);
8853    /// ```
8854    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8855        self.page_size = v.into();
8856        self
8857    }
8858
8859    /// Sets the value of [page_token][crate::model::ListResourceChangesRequest::page_token].
8860    ///
8861    /// # Example
8862    /// ```ignore,no_run
8863    /// # use google_cloud_config_v1::model::ListResourceChangesRequest;
8864    /// let x = ListResourceChangesRequest::new().set_page_token("example");
8865    /// ```
8866    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8867        self.page_token = v.into();
8868        self
8869    }
8870
8871    /// Sets the value of [filter][crate::model::ListResourceChangesRequest::filter].
8872    ///
8873    /// # Example
8874    /// ```ignore,no_run
8875    /// # use google_cloud_config_v1::model::ListResourceChangesRequest;
8876    /// let x = ListResourceChangesRequest::new().set_filter("example");
8877    /// ```
8878    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8879        self.filter = v.into();
8880        self
8881    }
8882
8883    /// Sets the value of [order_by][crate::model::ListResourceChangesRequest::order_by].
8884    ///
8885    /// # Example
8886    /// ```ignore,no_run
8887    /// # use google_cloud_config_v1::model::ListResourceChangesRequest;
8888    /// let x = ListResourceChangesRequest::new().set_order_by("example");
8889    /// ```
8890    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8891        self.order_by = v.into();
8892        self
8893    }
8894}
8895
8896impl wkt::message::Message for ListResourceChangesRequest {
8897    fn typename() -> &'static str {
8898        "type.googleapis.com/google.cloud.config.v1.ListResourceChangesRequest"
8899    }
8900}
8901
8902/// A response to a 'ListResourceChanges' call. Contains a list of
8903/// ResourceChanges.
8904#[derive(Clone, Default, PartialEq)]
8905#[non_exhaustive]
8906pub struct ListResourceChangesResponse {
8907    /// List of ResourceChanges.
8908    pub resource_changes: std::vec::Vec<crate::model::ResourceChange>,
8909
8910    /// A token to request the next page of resources from the
8911    /// 'ListResourceChanges' method. The value of an empty string means that
8912    /// there are no more resources to return.
8913    pub next_page_token: std::string::String,
8914
8915    /// Unreachable resources, if any.
8916    pub unreachable: std::vec::Vec<std::string::String>,
8917
8918    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8919}
8920
8921impl ListResourceChangesResponse {
8922    pub fn new() -> Self {
8923        std::default::Default::default()
8924    }
8925
8926    /// Sets the value of [resource_changes][crate::model::ListResourceChangesResponse::resource_changes].
8927    ///
8928    /// # Example
8929    /// ```ignore,no_run
8930    /// # use google_cloud_config_v1::model::ListResourceChangesResponse;
8931    /// use google_cloud_config_v1::model::ResourceChange;
8932    /// let x = ListResourceChangesResponse::new()
8933    ///     .set_resource_changes([
8934    ///         ResourceChange::default()/* use setters */,
8935    ///         ResourceChange::default()/* use (different) setters */,
8936    ///     ]);
8937    /// ```
8938    pub fn set_resource_changes<T, V>(mut self, v: T) -> Self
8939    where
8940        T: std::iter::IntoIterator<Item = V>,
8941        V: std::convert::Into<crate::model::ResourceChange>,
8942    {
8943        use std::iter::Iterator;
8944        self.resource_changes = v.into_iter().map(|i| i.into()).collect();
8945        self
8946    }
8947
8948    /// Sets the value of [next_page_token][crate::model::ListResourceChangesResponse::next_page_token].
8949    ///
8950    /// # Example
8951    /// ```ignore,no_run
8952    /// # use google_cloud_config_v1::model::ListResourceChangesResponse;
8953    /// let x = ListResourceChangesResponse::new().set_next_page_token("example");
8954    /// ```
8955    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8956        self.next_page_token = v.into();
8957        self
8958    }
8959
8960    /// Sets the value of [unreachable][crate::model::ListResourceChangesResponse::unreachable].
8961    ///
8962    /// # Example
8963    /// ```ignore,no_run
8964    /// # use google_cloud_config_v1::model::ListResourceChangesResponse;
8965    /// let x = ListResourceChangesResponse::new().set_unreachable(["a", "b", "c"]);
8966    /// ```
8967    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
8968    where
8969        T: std::iter::IntoIterator<Item = V>,
8970        V: std::convert::Into<std::string::String>,
8971    {
8972        use std::iter::Iterator;
8973        self.unreachable = v.into_iter().map(|i| i.into()).collect();
8974        self
8975    }
8976}
8977
8978impl wkt::message::Message for ListResourceChangesResponse {
8979    fn typename() -> &'static str {
8980        "type.googleapis.com/google.cloud.config.v1.ListResourceChangesResponse"
8981    }
8982}
8983
8984#[doc(hidden)]
8985impl gax::paginator::internal::PageableResponse for ListResourceChangesResponse {
8986    type PageItem = crate::model::ResourceChange;
8987
8988    fn items(self) -> std::vec::Vec<Self::PageItem> {
8989        self.resource_changes
8990    }
8991
8992    fn next_page_token(&self) -> std::string::String {
8993        use std::clone::Clone;
8994        self.next_page_token.clone()
8995    }
8996}
8997
8998/// The request message for the GetResourceChange method.
8999#[derive(Clone, Default, PartialEq)]
9000#[non_exhaustive]
9001pub struct GetResourceChangeRequest {
9002    /// Required. The name of the resource change to retrieve.
9003    /// Format:
9004    /// 'projects/{project_id}/locations/{location}/previews/{preview}/resourceChanges/{resource_change}'.
9005    pub name: std::string::String,
9006
9007    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9008}
9009
9010impl GetResourceChangeRequest {
9011    pub fn new() -> Self {
9012        std::default::Default::default()
9013    }
9014
9015    /// Sets the value of [name][crate::model::GetResourceChangeRequest::name].
9016    ///
9017    /// # Example
9018    /// ```ignore,no_run
9019    /// # use google_cloud_config_v1::model::GetResourceChangeRequest;
9020    /// let x = GetResourceChangeRequest::new().set_name("example");
9021    /// ```
9022    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9023        self.name = v.into();
9024        self
9025    }
9026}
9027
9028impl wkt::message::Message for GetResourceChangeRequest {
9029    fn typename() -> &'static str {
9030        "type.googleapis.com/google.cloud.config.v1.GetResourceChangeRequest"
9031    }
9032}
9033
9034/// Terraform info of a ResourceChange.
9035#[derive(Clone, Default, PartialEq)]
9036#[non_exhaustive]
9037pub struct ResourceDriftTerraformInfo {
9038    /// Output only. The address of the drifted resource.
9039    pub address: std::string::String,
9040
9041    /// Output only. The type of the drifted resource.
9042    pub r#type: std::string::String,
9043
9044    /// Output only. TF resource name.
9045    pub resource_name: std::string::String,
9046
9047    /// Output only. The provider of the drifted resource.
9048    pub provider: std::string::String,
9049
9050    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9051}
9052
9053impl ResourceDriftTerraformInfo {
9054    pub fn new() -> Self {
9055        std::default::Default::default()
9056    }
9057
9058    /// Sets the value of [address][crate::model::ResourceDriftTerraformInfo::address].
9059    ///
9060    /// # Example
9061    /// ```ignore,no_run
9062    /// # use google_cloud_config_v1::model::ResourceDriftTerraformInfo;
9063    /// let x = ResourceDriftTerraformInfo::new().set_address("example");
9064    /// ```
9065    pub fn set_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9066        self.address = v.into();
9067        self
9068    }
9069
9070    /// Sets the value of [r#type][crate::model::ResourceDriftTerraformInfo::type].
9071    ///
9072    /// # Example
9073    /// ```ignore,no_run
9074    /// # use google_cloud_config_v1::model::ResourceDriftTerraformInfo;
9075    /// let x = ResourceDriftTerraformInfo::new().set_type("example");
9076    /// ```
9077    pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9078        self.r#type = v.into();
9079        self
9080    }
9081
9082    /// Sets the value of [resource_name][crate::model::ResourceDriftTerraformInfo::resource_name].
9083    ///
9084    /// # Example
9085    /// ```ignore,no_run
9086    /// # use google_cloud_config_v1::model::ResourceDriftTerraformInfo;
9087    /// let x = ResourceDriftTerraformInfo::new().set_resource_name("example");
9088    /// ```
9089    pub fn set_resource_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9090        self.resource_name = v.into();
9091        self
9092    }
9093
9094    /// Sets the value of [provider][crate::model::ResourceDriftTerraformInfo::provider].
9095    ///
9096    /// # Example
9097    /// ```ignore,no_run
9098    /// # use google_cloud_config_v1::model::ResourceDriftTerraformInfo;
9099    /// let x = ResourceDriftTerraformInfo::new().set_provider("example");
9100    /// ```
9101    pub fn set_provider<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9102        self.provider = v.into();
9103        self
9104    }
9105}
9106
9107impl wkt::message::Message for ResourceDriftTerraformInfo {
9108    fn typename() -> &'static str {
9109        "type.googleapis.com/google.cloud.config.v1.ResourceDriftTerraformInfo"
9110    }
9111}
9112
9113/// A resource drift represents a drift to a resource in the state file.
9114#[derive(Clone, Default, PartialEq)]
9115#[non_exhaustive]
9116pub struct ResourceDrift {
9117    /// Identifier. The name of the resource drift.
9118    /// Format:
9119    /// 'projects/{project_id}/locations/{location}/previews/{preview}/resourceDrifts/{resource_drift}'.
9120    pub name: std::string::String,
9121
9122    /// Output only. Terraform info of the resource drift.
9123    pub terraform_info: std::option::Option<crate::model::ResourceDriftTerraformInfo>,
9124
9125    /// Output only. The property drifts of the resource drift.
9126    pub property_drifts: std::vec::Vec<crate::model::PropertyDrift>,
9127
9128    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9129}
9130
9131impl ResourceDrift {
9132    pub fn new() -> Self {
9133        std::default::Default::default()
9134    }
9135
9136    /// Sets the value of [name][crate::model::ResourceDrift::name].
9137    ///
9138    /// # Example
9139    /// ```ignore,no_run
9140    /// # use google_cloud_config_v1::model::ResourceDrift;
9141    /// let x = ResourceDrift::new().set_name("example");
9142    /// ```
9143    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9144        self.name = v.into();
9145        self
9146    }
9147
9148    /// Sets the value of [terraform_info][crate::model::ResourceDrift::terraform_info].
9149    ///
9150    /// # Example
9151    /// ```ignore,no_run
9152    /// # use google_cloud_config_v1::model::ResourceDrift;
9153    /// use google_cloud_config_v1::model::ResourceDriftTerraformInfo;
9154    /// let x = ResourceDrift::new().set_terraform_info(ResourceDriftTerraformInfo::default()/* use setters */);
9155    /// ```
9156    pub fn set_terraform_info<T>(mut self, v: T) -> Self
9157    where
9158        T: std::convert::Into<crate::model::ResourceDriftTerraformInfo>,
9159    {
9160        self.terraform_info = std::option::Option::Some(v.into());
9161        self
9162    }
9163
9164    /// Sets or clears the value of [terraform_info][crate::model::ResourceDrift::terraform_info].
9165    ///
9166    /// # Example
9167    /// ```ignore,no_run
9168    /// # use google_cloud_config_v1::model::ResourceDrift;
9169    /// use google_cloud_config_v1::model::ResourceDriftTerraformInfo;
9170    /// let x = ResourceDrift::new().set_or_clear_terraform_info(Some(ResourceDriftTerraformInfo::default()/* use setters */));
9171    /// let x = ResourceDrift::new().set_or_clear_terraform_info(None::<ResourceDriftTerraformInfo>);
9172    /// ```
9173    pub fn set_or_clear_terraform_info<T>(mut self, v: std::option::Option<T>) -> Self
9174    where
9175        T: std::convert::Into<crate::model::ResourceDriftTerraformInfo>,
9176    {
9177        self.terraform_info = v.map(|x| x.into());
9178        self
9179    }
9180
9181    /// Sets the value of [property_drifts][crate::model::ResourceDrift::property_drifts].
9182    ///
9183    /// # Example
9184    /// ```ignore,no_run
9185    /// # use google_cloud_config_v1::model::ResourceDrift;
9186    /// use google_cloud_config_v1::model::PropertyDrift;
9187    /// let x = ResourceDrift::new()
9188    ///     .set_property_drifts([
9189    ///         PropertyDrift::default()/* use setters */,
9190    ///         PropertyDrift::default()/* use (different) setters */,
9191    ///     ]);
9192    /// ```
9193    pub fn set_property_drifts<T, V>(mut self, v: T) -> Self
9194    where
9195        T: std::iter::IntoIterator<Item = V>,
9196        V: std::convert::Into<crate::model::PropertyDrift>,
9197    {
9198        use std::iter::Iterator;
9199        self.property_drifts = v.into_iter().map(|i| i.into()).collect();
9200        self
9201    }
9202}
9203
9204impl wkt::message::Message for ResourceDrift {
9205    fn typename() -> &'static str {
9206        "type.googleapis.com/google.cloud.config.v1.ResourceDrift"
9207    }
9208}
9209
9210/// A property drift represents a drift to a property in the state file.
9211#[derive(Clone, Default, PartialEq)]
9212#[non_exhaustive]
9213pub struct PropertyDrift {
9214    /// Output only. The path of the property drift.
9215    pub path: std::string::String,
9216
9217    /// Output only. The paths of sensitive fields in `before`. Paths are relative
9218    /// to `path`.
9219    pub before_sensitive_paths: std::vec::Vec<std::string::String>,
9220
9221    /// Output only. Representations of the object value before the actions.
9222    pub before: std::option::Option<wkt::Value>,
9223
9224    /// Output only. The paths of sensitive fields in `after`. Paths are relative
9225    /// to `path`.
9226    pub after_sensitive_paths: std::vec::Vec<std::string::String>,
9227
9228    /// Output only. Representations of the object value after the actions.
9229    pub after: std::option::Option<wkt::Value>,
9230
9231    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9232}
9233
9234impl PropertyDrift {
9235    pub fn new() -> Self {
9236        std::default::Default::default()
9237    }
9238
9239    /// Sets the value of [path][crate::model::PropertyDrift::path].
9240    ///
9241    /// # Example
9242    /// ```ignore,no_run
9243    /// # use google_cloud_config_v1::model::PropertyDrift;
9244    /// let x = PropertyDrift::new().set_path("example");
9245    /// ```
9246    pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9247        self.path = v.into();
9248        self
9249    }
9250
9251    /// Sets the value of [before_sensitive_paths][crate::model::PropertyDrift::before_sensitive_paths].
9252    ///
9253    /// # Example
9254    /// ```ignore,no_run
9255    /// # use google_cloud_config_v1::model::PropertyDrift;
9256    /// let x = PropertyDrift::new().set_before_sensitive_paths(["a", "b", "c"]);
9257    /// ```
9258    pub fn set_before_sensitive_paths<T, V>(mut self, v: T) -> Self
9259    where
9260        T: std::iter::IntoIterator<Item = V>,
9261        V: std::convert::Into<std::string::String>,
9262    {
9263        use std::iter::Iterator;
9264        self.before_sensitive_paths = v.into_iter().map(|i| i.into()).collect();
9265        self
9266    }
9267
9268    /// Sets the value of [before][crate::model::PropertyDrift::before].
9269    ///
9270    /// # Example
9271    /// ```ignore,no_run
9272    /// # use google_cloud_config_v1::model::PropertyDrift;
9273    /// use wkt::Value;
9274    /// let x = PropertyDrift::new().set_before(Value::default()/* use setters */);
9275    /// ```
9276    pub fn set_before<T>(mut self, v: T) -> Self
9277    where
9278        T: std::convert::Into<wkt::Value>,
9279    {
9280        self.before = std::option::Option::Some(v.into());
9281        self
9282    }
9283
9284    /// Sets or clears the value of [before][crate::model::PropertyDrift::before].
9285    ///
9286    /// # Example
9287    /// ```ignore,no_run
9288    /// # use google_cloud_config_v1::model::PropertyDrift;
9289    /// use wkt::Value;
9290    /// let x = PropertyDrift::new().set_or_clear_before(Some(Value::default()/* use setters */));
9291    /// let x = PropertyDrift::new().set_or_clear_before(None::<Value>);
9292    /// ```
9293    pub fn set_or_clear_before<T>(mut self, v: std::option::Option<T>) -> Self
9294    where
9295        T: std::convert::Into<wkt::Value>,
9296    {
9297        self.before = v.map(|x| x.into());
9298        self
9299    }
9300
9301    /// Sets the value of [after_sensitive_paths][crate::model::PropertyDrift::after_sensitive_paths].
9302    ///
9303    /// # Example
9304    /// ```ignore,no_run
9305    /// # use google_cloud_config_v1::model::PropertyDrift;
9306    /// let x = PropertyDrift::new().set_after_sensitive_paths(["a", "b", "c"]);
9307    /// ```
9308    pub fn set_after_sensitive_paths<T, V>(mut self, v: T) -> Self
9309    where
9310        T: std::iter::IntoIterator<Item = V>,
9311        V: std::convert::Into<std::string::String>,
9312    {
9313        use std::iter::Iterator;
9314        self.after_sensitive_paths = v.into_iter().map(|i| i.into()).collect();
9315        self
9316    }
9317
9318    /// Sets the value of [after][crate::model::PropertyDrift::after].
9319    ///
9320    /// # Example
9321    /// ```ignore,no_run
9322    /// # use google_cloud_config_v1::model::PropertyDrift;
9323    /// use wkt::Value;
9324    /// let x = PropertyDrift::new().set_after(Value::default()/* use setters */);
9325    /// ```
9326    pub fn set_after<T>(mut self, v: T) -> Self
9327    where
9328        T: std::convert::Into<wkt::Value>,
9329    {
9330        self.after = std::option::Option::Some(v.into());
9331        self
9332    }
9333
9334    /// Sets or clears the value of [after][crate::model::PropertyDrift::after].
9335    ///
9336    /// # Example
9337    /// ```ignore,no_run
9338    /// # use google_cloud_config_v1::model::PropertyDrift;
9339    /// use wkt::Value;
9340    /// let x = PropertyDrift::new().set_or_clear_after(Some(Value::default()/* use setters */));
9341    /// let x = PropertyDrift::new().set_or_clear_after(None::<Value>);
9342    /// ```
9343    pub fn set_or_clear_after<T>(mut self, v: std::option::Option<T>) -> Self
9344    where
9345        T: std::convert::Into<wkt::Value>,
9346    {
9347        self.after = v.map(|x| x.into());
9348        self
9349    }
9350}
9351
9352impl wkt::message::Message for PropertyDrift {
9353    fn typename() -> &'static str {
9354        "type.googleapis.com/google.cloud.config.v1.PropertyDrift"
9355    }
9356}
9357
9358/// The request message for the ListResourceDrifts method.
9359#[derive(Clone, Default, PartialEq)]
9360#[non_exhaustive]
9361pub struct ListResourceDriftsRequest {
9362    /// Required. The parent in whose context the ResourceDrifts are listed. The
9363    /// parent value is in the format:
9364    /// 'projects/{project_id}/locations/{location}/previews/{preview}'.
9365    pub parent: std::string::String,
9366
9367    /// Optional. When requesting a page of resource drifts, 'page_size' specifies
9368    /// number of resource drifts to return. If unspecified, at most 500 will be
9369    /// returned. The maximum value is 1000.
9370    pub page_size: i32,
9371
9372    /// Optional. Token returned by previous call to 'ListResourceDrifts' which
9373    /// specifies the position in the list from where to continue listing the
9374    /// resource drifts.
9375    pub page_token: std::string::String,
9376
9377    /// Optional. Lists the resource drifts that match the filter expression. A
9378    /// filter expression filters the resource drifts listed in the response. The
9379    /// expression must be of the form '{field} {operator} {value}' where
9380    /// operators: '<', '>',
9381    /// '<=',
9382    /// '>=',
9383    /// '!=', '=', ':' are supported (colon ':' represents a HAS operator which is
9384    /// roughly synonymous with equality). {field} can refer to a proto or JSON
9385    /// field, or a synthetic field. Field names can be camelCase or snake_case.
9386    ///
9387    /// Examples:
9388    ///
9389    /// - Filter by name:
9390    ///   name =
9391    ///   "projects/foo/locations/us-central1/previews/dep/resourceDrifts/baz
9392    pub filter: std::string::String,
9393
9394    /// Optional. Field to use to sort the list.
9395    pub order_by: std::string::String,
9396
9397    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9398}
9399
9400impl ListResourceDriftsRequest {
9401    pub fn new() -> Self {
9402        std::default::Default::default()
9403    }
9404
9405    /// Sets the value of [parent][crate::model::ListResourceDriftsRequest::parent].
9406    ///
9407    /// # Example
9408    /// ```ignore,no_run
9409    /// # use google_cloud_config_v1::model::ListResourceDriftsRequest;
9410    /// let x = ListResourceDriftsRequest::new().set_parent("example");
9411    /// ```
9412    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9413        self.parent = v.into();
9414        self
9415    }
9416
9417    /// Sets the value of [page_size][crate::model::ListResourceDriftsRequest::page_size].
9418    ///
9419    /// # Example
9420    /// ```ignore,no_run
9421    /// # use google_cloud_config_v1::model::ListResourceDriftsRequest;
9422    /// let x = ListResourceDriftsRequest::new().set_page_size(42);
9423    /// ```
9424    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9425        self.page_size = v.into();
9426        self
9427    }
9428
9429    /// Sets the value of [page_token][crate::model::ListResourceDriftsRequest::page_token].
9430    ///
9431    /// # Example
9432    /// ```ignore,no_run
9433    /// # use google_cloud_config_v1::model::ListResourceDriftsRequest;
9434    /// let x = ListResourceDriftsRequest::new().set_page_token("example");
9435    /// ```
9436    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9437        self.page_token = v.into();
9438        self
9439    }
9440
9441    /// Sets the value of [filter][crate::model::ListResourceDriftsRequest::filter].
9442    ///
9443    /// # Example
9444    /// ```ignore,no_run
9445    /// # use google_cloud_config_v1::model::ListResourceDriftsRequest;
9446    /// let x = ListResourceDriftsRequest::new().set_filter("example");
9447    /// ```
9448    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9449        self.filter = v.into();
9450        self
9451    }
9452
9453    /// Sets the value of [order_by][crate::model::ListResourceDriftsRequest::order_by].
9454    ///
9455    /// # Example
9456    /// ```ignore,no_run
9457    /// # use google_cloud_config_v1::model::ListResourceDriftsRequest;
9458    /// let x = ListResourceDriftsRequest::new().set_order_by("example");
9459    /// ```
9460    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9461        self.order_by = v.into();
9462        self
9463    }
9464}
9465
9466impl wkt::message::Message for ListResourceDriftsRequest {
9467    fn typename() -> &'static str {
9468        "type.googleapis.com/google.cloud.config.v1.ListResourceDriftsRequest"
9469    }
9470}
9471
9472/// A response to a 'ListResourceDrifts' call. Contains a list of ResourceDrifts.
9473#[derive(Clone, Default, PartialEq)]
9474#[non_exhaustive]
9475pub struct ListResourceDriftsResponse {
9476    /// List of ResourceDrifts.
9477    pub resource_drifts: std::vec::Vec<crate::model::ResourceDrift>,
9478
9479    /// A token to request the next page of resources from the
9480    /// 'ListResourceDrifts' method. The value of an empty string means that
9481    /// there are no more resources to return.
9482    pub next_page_token: std::string::String,
9483
9484    /// Unreachable resources, if any.
9485    pub unreachable: std::vec::Vec<std::string::String>,
9486
9487    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9488}
9489
9490impl ListResourceDriftsResponse {
9491    pub fn new() -> Self {
9492        std::default::Default::default()
9493    }
9494
9495    /// Sets the value of [resource_drifts][crate::model::ListResourceDriftsResponse::resource_drifts].
9496    ///
9497    /// # Example
9498    /// ```ignore,no_run
9499    /// # use google_cloud_config_v1::model::ListResourceDriftsResponse;
9500    /// use google_cloud_config_v1::model::ResourceDrift;
9501    /// let x = ListResourceDriftsResponse::new()
9502    ///     .set_resource_drifts([
9503    ///         ResourceDrift::default()/* use setters */,
9504    ///         ResourceDrift::default()/* use (different) setters */,
9505    ///     ]);
9506    /// ```
9507    pub fn set_resource_drifts<T, V>(mut self, v: T) -> Self
9508    where
9509        T: std::iter::IntoIterator<Item = V>,
9510        V: std::convert::Into<crate::model::ResourceDrift>,
9511    {
9512        use std::iter::Iterator;
9513        self.resource_drifts = v.into_iter().map(|i| i.into()).collect();
9514        self
9515    }
9516
9517    /// Sets the value of [next_page_token][crate::model::ListResourceDriftsResponse::next_page_token].
9518    ///
9519    /// # Example
9520    /// ```ignore,no_run
9521    /// # use google_cloud_config_v1::model::ListResourceDriftsResponse;
9522    /// let x = ListResourceDriftsResponse::new().set_next_page_token("example");
9523    /// ```
9524    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9525        self.next_page_token = v.into();
9526        self
9527    }
9528
9529    /// Sets the value of [unreachable][crate::model::ListResourceDriftsResponse::unreachable].
9530    ///
9531    /// # Example
9532    /// ```ignore,no_run
9533    /// # use google_cloud_config_v1::model::ListResourceDriftsResponse;
9534    /// let x = ListResourceDriftsResponse::new().set_unreachable(["a", "b", "c"]);
9535    /// ```
9536    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
9537    where
9538        T: std::iter::IntoIterator<Item = V>,
9539        V: std::convert::Into<std::string::String>,
9540    {
9541        use std::iter::Iterator;
9542        self.unreachable = v.into_iter().map(|i| i.into()).collect();
9543        self
9544    }
9545}
9546
9547impl wkt::message::Message for ListResourceDriftsResponse {
9548    fn typename() -> &'static str {
9549        "type.googleapis.com/google.cloud.config.v1.ListResourceDriftsResponse"
9550    }
9551}
9552
9553#[doc(hidden)]
9554impl gax::paginator::internal::PageableResponse for ListResourceDriftsResponse {
9555    type PageItem = crate::model::ResourceDrift;
9556
9557    fn items(self) -> std::vec::Vec<Self::PageItem> {
9558        self.resource_drifts
9559    }
9560
9561    fn next_page_token(&self) -> std::string::String {
9562        use std::clone::Clone;
9563        self.next_page_token.clone()
9564    }
9565}
9566
9567/// The request message for the GetResourceDrift method.
9568#[derive(Clone, Default, PartialEq)]
9569#[non_exhaustive]
9570pub struct GetResourceDriftRequest {
9571    /// Required. The name of the resource drift to retrieve.
9572    /// Format:
9573    /// 'projects/{project_id}/locations/{location}/previews/{preview}/resourceDrifts/{resource_drift}'.
9574    pub name: std::string::String,
9575
9576    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9577}
9578
9579impl GetResourceDriftRequest {
9580    pub fn new() -> Self {
9581        std::default::Default::default()
9582    }
9583
9584    /// Sets the value of [name][crate::model::GetResourceDriftRequest::name].
9585    ///
9586    /// # Example
9587    /// ```ignore,no_run
9588    /// # use google_cloud_config_v1::model::GetResourceDriftRequest;
9589    /// let x = GetResourceDriftRequest::new().set_name("example");
9590    /// ```
9591    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9592        self.name = v.into();
9593        self
9594    }
9595}
9596
9597impl wkt::message::Message for GetResourceDriftRequest {
9598    fn typename() -> &'static str {
9599        "type.googleapis.com/google.cloud.config.v1.GetResourceDriftRequest"
9600    }
9601}
9602
9603/// ProviderConfig contains the provider configurations.
9604#[derive(Clone, Default, PartialEq)]
9605#[non_exhaustive]
9606pub struct ProviderConfig {
9607    /// Optional. ProviderSource specifies the source type of the provider.
9608    pub source_type: std::option::Option<crate::model::provider_config::ProviderSource>,
9609
9610    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9611}
9612
9613impl ProviderConfig {
9614    pub fn new() -> Self {
9615        std::default::Default::default()
9616    }
9617
9618    /// Sets the value of [source_type][crate::model::ProviderConfig::source_type].
9619    ///
9620    /// # Example
9621    /// ```ignore,no_run
9622    /// # use google_cloud_config_v1::model::ProviderConfig;
9623    /// use google_cloud_config_v1::model::provider_config::ProviderSource;
9624    /// let x0 = ProviderConfig::new().set_source_type(ProviderSource::ServiceMaintained);
9625    /// ```
9626    pub fn set_source_type<T>(mut self, v: T) -> Self
9627    where
9628        T: std::convert::Into<crate::model::provider_config::ProviderSource>,
9629    {
9630        self.source_type = std::option::Option::Some(v.into());
9631        self
9632    }
9633
9634    /// Sets or clears the value of [source_type][crate::model::ProviderConfig::source_type].
9635    ///
9636    /// # Example
9637    /// ```ignore,no_run
9638    /// # use google_cloud_config_v1::model::ProviderConfig;
9639    /// use google_cloud_config_v1::model::provider_config::ProviderSource;
9640    /// let x0 = ProviderConfig::new().set_or_clear_source_type(Some(ProviderSource::ServiceMaintained));
9641    /// let x_none = ProviderConfig::new().set_or_clear_source_type(None::<ProviderSource>);
9642    /// ```
9643    pub fn set_or_clear_source_type<T>(mut self, v: std::option::Option<T>) -> Self
9644    where
9645        T: std::convert::Into<crate::model::provider_config::ProviderSource>,
9646    {
9647        self.source_type = v.map(|x| x.into());
9648        self
9649    }
9650}
9651
9652impl wkt::message::Message for ProviderConfig {
9653    fn typename() -> &'static str {
9654        "type.googleapis.com/google.cloud.config.v1.ProviderConfig"
9655    }
9656}
9657
9658/// Defines additional types related to [ProviderConfig].
9659pub mod provider_config {
9660    #[allow(unused_imports)]
9661    use super::*;
9662
9663    /// ProviderSource represents the source type of the provider.
9664    ///
9665    /// # Working with unknown values
9666    ///
9667    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9668    /// additional enum variants at any time. Adding new variants is not considered
9669    /// a breaking change. Applications should write their code in anticipation of:
9670    ///
9671    /// - New values appearing in future releases of the client library, **and**
9672    /// - New values received dynamically, without application changes.
9673    ///
9674    /// Please consult the [Working with enums] section in the user guide for some
9675    /// guidelines.
9676    ///
9677    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
9678    #[derive(Clone, Debug, PartialEq)]
9679    #[non_exhaustive]
9680    pub enum ProviderSource {
9681        /// Unspecified source type, default to public sources.
9682        Unspecified,
9683        /// Service maintained provider source type.
9684        ServiceMaintained,
9685        /// If set, the enum was initialized with an unknown value.
9686        ///
9687        /// Applications can examine the value using [ProviderSource::value] or
9688        /// [ProviderSource::name].
9689        UnknownValue(provider_source::UnknownValue),
9690    }
9691
9692    #[doc(hidden)]
9693    pub mod provider_source {
9694        #[allow(unused_imports)]
9695        use super::*;
9696        #[derive(Clone, Debug, PartialEq)]
9697        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9698    }
9699
9700    impl ProviderSource {
9701        /// Gets the enum value.
9702        ///
9703        /// Returns `None` if the enum contains an unknown value deserialized from
9704        /// the string representation of enums.
9705        pub fn value(&self) -> std::option::Option<i32> {
9706            match self {
9707                Self::Unspecified => std::option::Option::Some(0),
9708                Self::ServiceMaintained => std::option::Option::Some(1),
9709                Self::UnknownValue(u) => u.0.value(),
9710            }
9711        }
9712
9713        /// Gets the enum value as a string.
9714        ///
9715        /// Returns `None` if the enum contains an unknown value deserialized from
9716        /// the integer representation of enums.
9717        pub fn name(&self) -> std::option::Option<&str> {
9718            match self {
9719                Self::Unspecified => std::option::Option::Some("PROVIDER_SOURCE_UNSPECIFIED"),
9720                Self::ServiceMaintained => std::option::Option::Some("SERVICE_MAINTAINED"),
9721                Self::UnknownValue(u) => u.0.name(),
9722            }
9723        }
9724    }
9725
9726    impl std::default::Default for ProviderSource {
9727        fn default() -> Self {
9728            use std::convert::From;
9729            Self::from(0)
9730        }
9731    }
9732
9733    impl std::fmt::Display for ProviderSource {
9734        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9735            wkt::internal::display_enum(f, self.name(), self.value())
9736        }
9737    }
9738
9739    impl std::convert::From<i32> for ProviderSource {
9740        fn from(value: i32) -> Self {
9741            match value {
9742                0 => Self::Unspecified,
9743                1 => Self::ServiceMaintained,
9744                _ => Self::UnknownValue(provider_source::UnknownValue(
9745                    wkt::internal::UnknownEnumValue::Integer(value),
9746                )),
9747            }
9748        }
9749    }
9750
9751    impl std::convert::From<&str> for ProviderSource {
9752        fn from(value: &str) -> Self {
9753            use std::string::ToString;
9754            match value {
9755                "PROVIDER_SOURCE_UNSPECIFIED" => Self::Unspecified,
9756                "SERVICE_MAINTAINED" => Self::ServiceMaintained,
9757                _ => Self::UnknownValue(provider_source::UnknownValue(
9758                    wkt::internal::UnknownEnumValue::String(value.to_string()),
9759                )),
9760            }
9761        }
9762    }
9763
9764    impl serde::ser::Serialize for ProviderSource {
9765        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9766        where
9767            S: serde::Serializer,
9768        {
9769            match self {
9770                Self::Unspecified => serializer.serialize_i32(0),
9771                Self::ServiceMaintained => serializer.serialize_i32(1),
9772                Self::UnknownValue(u) => u.0.serialize(serializer),
9773            }
9774        }
9775    }
9776
9777    impl<'de> serde::de::Deserialize<'de> for ProviderSource {
9778        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9779        where
9780            D: serde::Deserializer<'de>,
9781        {
9782            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ProviderSource>::new(
9783                ".google.cloud.config.v1.ProviderConfig.ProviderSource",
9784            ))
9785        }
9786    }
9787}
9788
9789/// Enum values to control quota checks for resources in terraform
9790/// configuration files.
9791///
9792/// # Working with unknown values
9793///
9794/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9795/// additional enum variants at any time. Adding new variants is not considered
9796/// a breaking change. Applications should write their code in anticipation of:
9797///
9798/// - New values appearing in future releases of the client library, **and**
9799/// - New values received dynamically, without application changes.
9800///
9801/// Please consult the [Working with enums] section in the user guide for some
9802/// guidelines.
9803///
9804/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
9805#[derive(Clone, Debug, PartialEq)]
9806#[non_exhaustive]
9807pub enum QuotaValidation {
9808    /// The default value.
9809    /// QuotaValidation on terraform configuration files will be disabled in
9810    /// this case.
9811    Unspecified,
9812    /// Enable computing quotas for resources in terraform configuration files to
9813    /// get visibility on resources with insufficient quotas.
9814    Enabled,
9815    /// Enforce quota checks so deployment fails if there isn't sufficient quotas
9816    /// available to deploy resources in terraform configuration files.
9817    Enforced,
9818    /// If set, the enum was initialized with an unknown value.
9819    ///
9820    /// Applications can examine the value using [QuotaValidation::value] or
9821    /// [QuotaValidation::name].
9822    UnknownValue(quota_validation::UnknownValue),
9823}
9824
9825#[doc(hidden)]
9826pub mod quota_validation {
9827    #[allow(unused_imports)]
9828    use super::*;
9829    #[derive(Clone, Debug, PartialEq)]
9830    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9831}
9832
9833impl QuotaValidation {
9834    /// Gets the enum value.
9835    ///
9836    /// Returns `None` if the enum contains an unknown value deserialized from
9837    /// the string representation of enums.
9838    pub fn value(&self) -> std::option::Option<i32> {
9839        match self {
9840            Self::Unspecified => std::option::Option::Some(0),
9841            Self::Enabled => std::option::Option::Some(1),
9842            Self::Enforced => std::option::Option::Some(2),
9843            Self::UnknownValue(u) => u.0.value(),
9844        }
9845    }
9846
9847    /// Gets the enum value as a string.
9848    ///
9849    /// Returns `None` if the enum contains an unknown value deserialized from
9850    /// the integer representation of enums.
9851    pub fn name(&self) -> std::option::Option<&str> {
9852        match self {
9853            Self::Unspecified => std::option::Option::Some("QUOTA_VALIDATION_UNSPECIFIED"),
9854            Self::Enabled => std::option::Option::Some("ENABLED"),
9855            Self::Enforced => std::option::Option::Some("ENFORCED"),
9856            Self::UnknownValue(u) => u.0.name(),
9857        }
9858    }
9859}
9860
9861impl std::default::Default for QuotaValidation {
9862    fn default() -> Self {
9863        use std::convert::From;
9864        Self::from(0)
9865    }
9866}
9867
9868impl std::fmt::Display for QuotaValidation {
9869    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9870        wkt::internal::display_enum(f, self.name(), self.value())
9871    }
9872}
9873
9874impl std::convert::From<i32> for QuotaValidation {
9875    fn from(value: i32) -> Self {
9876        match value {
9877            0 => Self::Unspecified,
9878            1 => Self::Enabled,
9879            2 => Self::Enforced,
9880            _ => Self::UnknownValue(quota_validation::UnknownValue(
9881                wkt::internal::UnknownEnumValue::Integer(value),
9882            )),
9883        }
9884    }
9885}
9886
9887impl std::convert::From<&str> for QuotaValidation {
9888    fn from(value: &str) -> Self {
9889        use std::string::ToString;
9890        match value {
9891            "QUOTA_VALIDATION_UNSPECIFIED" => Self::Unspecified,
9892            "ENABLED" => Self::Enabled,
9893            "ENFORCED" => Self::Enforced,
9894            _ => Self::UnknownValue(quota_validation::UnknownValue(
9895                wkt::internal::UnknownEnumValue::String(value.to_string()),
9896            )),
9897        }
9898    }
9899}
9900
9901impl serde::ser::Serialize for QuotaValidation {
9902    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9903    where
9904        S: serde::Serializer,
9905    {
9906        match self {
9907            Self::Unspecified => serializer.serialize_i32(0),
9908            Self::Enabled => serializer.serialize_i32(1),
9909            Self::Enforced => serializer.serialize_i32(2),
9910            Self::UnknownValue(u) => u.0.serialize(serializer),
9911        }
9912    }
9913}
9914
9915impl<'de> serde::de::Deserialize<'de> for QuotaValidation {
9916    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9917    where
9918        D: serde::Deserializer<'de>,
9919    {
9920        deserializer.deserialize_any(wkt::internal::EnumVisitor::<QuotaValidation>::new(
9921            ".google.cloud.config.v1.QuotaValidation",
9922        ))
9923    }
9924}