Skip to main content

google_cloud_config_v1/
model.rs

1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17#![allow(rustdoc::redundant_explicit_links)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![no_implicit_prelude]
20extern crate async_trait;
21extern crate bytes;
22extern crate gaxi;
23extern crate google_cloud_gax;
24extern crate google_cloud_iam_v1;
25extern crate google_cloud_location;
26extern crate google_cloud_longrunning;
27extern crate google_cloud_lro;
28extern crate google_cloud_rpc;
29extern crate lazy_static;
30extern crate serde;
31extern crate serde_json;
32extern crate serde_with;
33extern crate std;
34extern crate tracing;
35extern crate wkt;
36
37mod debug;
38mod deserialize;
39mod serialize;
40
41/// A Deployment is a group of resources and configs managed and provisioned by
42/// Infra Manager.
43#[derive(Clone, Default, PartialEq)]
44#[non_exhaustive]
45pub struct Deployment {
46    /// Identifier. Resource name of the deployment.
47    /// Format: `projects/{project}/locations/{location}/deployments/{deployment}`
48    pub name: std::string::String,
49
50    /// Output only. Time when the deployment was created.
51    pub create_time: std::option::Option<wkt::Timestamp>,
52
53    /// Output only. Time when the deployment was last modified.
54    pub update_time: std::option::Option<wkt::Timestamp>,
55
56    /// Optional. User-defined metadata for the deployment.
57    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
58
59    /// Output only. Current state of the deployment.
60    pub state: crate::model::deployment::State,
61
62    /// Output only. Revision name that was most recently applied.
63    /// Format: `projects/{project}/locations/{location}/deployments/{deployment}/
64    /// revisions/{revision}`
65    pub latest_revision: std::string::String,
66
67    /// Output only. Additional information regarding the current state.
68    pub state_detail: std::string::String,
69
70    /// Output only. Error code describing errors that may have occurred.
71    pub error_code: crate::model::deployment::ErrorCode,
72
73    /// Output only. Location of artifacts from a DeleteDeployment operation.
74    pub delete_results: std::option::Option<crate::model::ApplyResults>,
75
76    /// Output only. Cloud Build instance UUID associated with deleting this
77    /// deployment.
78    pub delete_build: std::string::String,
79
80    /// Output only. Location of Cloud Build logs in Google Cloud Storage,
81    /// populated when deleting this deployment. Format: `gs://{bucket}/{object}`.
82    pub delete_logs: std::string::String,
83
84    /// Output only. Errors encountered when deleting this deployment.
85    /// Errors are truncated to 10 entries, see `delete_results` and `error_logs`
86    /// for full details.
87    pub tf_errors: std::vec::Vec<crate::model::TerraformError>,
88
89    /// Output only. Location of Terraform error logs in Google Cloud Storage.
90    /// Format: `gs://{bucket}/{object}`.
91    pub error_logs: std::string::String,
92
93    /// Optional. User-defined location of Cloud Build logs and artifacts in Google
94    /// Cloud Storage. Format: `gs://{bucket}/{folder}`
95    ///
96    /// A default bucket will be bootstrapped if the field is not set or empty.
97    /// Default bucket format: `gs://<project number>-<region>-blueprint-config`
98    /// Constraints:
99    ///
100    /// - The bucket needs to be in the same project as the deployment
101    /// - The path cannot be within the path of `gcs_source`
102    /// - The field cannot be updated, including changing its presence
103    pub artifacts_gcs_bucket: std::option::Option<std::string::String>,
104
105    /// Required. User-specified Service Account (SA) credentials to be used when
106    /// actuating resources.
107    /// Format: `projects/{projectID}/serviceAccounts/{serviceAccount}`
108    pub service_account: std::option::Option<std::string::String>,
109
110    /// By default, Infra Manager will return a failure when
111    /// Terraform encounters a 409 code (resource conflict error) during actuation.
112    /// If this flag is set to true, Infra Manager will instead
113    /// attempt to automatically import the resource into the Terraform state (for
114    /// supported resource types) and continue actuation.
115    ///
116    /// Not all resource types are supported, refer to documentation.
117    pub import_existing_resources: std::option::Option<bool>,
118
119    /// Optional. The user-specified Cloud Build worker pool resource in which the
120    /// Cloud Build job will execute. Format:
121    /// `projects/{project}/locations/{location}/workerPools/{workerPoolId}`.
122    /// If this field is unspecified, the default Cloud Build worker pool will be
123    /// used.
124    pub worker_pool: std::option::Option<std::string::String>,
125
126    /// Output only. Current lock state of the deployment.
127    pub lock_state: crate::model::deployment::LockState,
128
129    /// Optional. The user-specified Terraform version constraint.
130    /// Example: "=1.3.10".
131    pub tf_version_constraint: std::option::Option<std::string::String>,
132
133    /// Output only. The current Terraform version set on the deployment.
134    /// It is in the format of "Major.Minor.Patch", for example, "1.3.10".
135    pub tf_version: std::string::String,
136
137    /// Optional. Input to control quota checks for resources in terraform
138    /// configuration files. There are limited resources on which quota validation
139    /// applies.
140    pub quota_validation: crate::model::QuotaValidation,
141
142    /// Optional. Arbitrary key-value metadata storage e.g. to help client tools
143    /// identify deployments during automation. See
144    /// <https://google.aip.dev/148#annotations> for details on format and size
145    /// limitations.
146    pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
147
148    /// Optional. This field specifies the provider configurations.
149    pub provider_config: std::option::Option<crate::model::ProviderConfig>,
150
151    /// Blueprint to deploy.
152    pub blueprint: std::option::Option<crate::model::deployment::Blueprint>,
153
154    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
155}
156
157impl Deployment {
158    pub fn new() -> Self {
159        std::default::Default::default()
160    }
161
162    /// Sets the value of [name][crate::model::Deployment::name].
163    ///
164    /// # Example
165    /// ```ignore,no_run
166    /// # use google_cloud_config_v1::model::Deployment;
167    /// let x = Deployment::new().set_name("example");
168    /// ```
169    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
170        self.name = v.into();
171        self
172    }
173
174    /// Sets the value of [create_time][crate::model::Deployment::create_time].
175    ///
176    /// # Example
177    /// ```ignore,no_run
178    /// # use google_cloud_config_v1::model::Deployment;
179    /// use wkt::Timestamp;
180    /// let x = Deployment::new().set_create_time(Timestamp::default()/* use setters */);
181    /// ```
182    pub fn set_create_time<T>(mut self, v: T) -> Self
183    where
184        T: std::convert::Into<wkt::Timestamp>,
185    {
186        self.create_time = std::option::Option::Some(v.into());
187        self
188    }
189
190    /// Sets or clears the value of [create_time][crate::model::Deployment::create_time].
191    ///
192    /// # Example
193    /// ```ignore,no_run
194    /// # use google_cloud_config_v1::model::Deployment;
195    /// use wkt::Timestamp;
196    /// let x = Deployment::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
197    /// let x = Deployment::new().set_or_clear_create_time(None::<Timestamp>);
198    /// ```
199    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
200    where
201        T: std::convert::Into<wkt::Timestamp>,
202    {
203        self.create_time = v.map(|x| x.into());
204        self
205    }
206
207    /// Sets the value of [update_time][crate::model::Deployment::update_time].
208    ///
209    /// # Example
210    /// ```ignore,no_run
211    /// # use google_cloud_config_v1::model::Deployment;
212    /// use wkt::Timestamp;
213    /// let x = Deployment::new().set_update_time(Timestamp::default()/* use setters */);
214    /// ```
215    pub fn set_update_time<T>(mut self, v: T) -> Self
216    where
217        T: std::convert::Into<wkt::Timestamp>,
218    {
219        self.update_time = std::option::Option::Some(v.into());
220        self
221    }
222
223    /// Sets or clears the value of [update_time][crate::model::Deployment::update_time].
224    ///
225    /// # Example
226    /// ```ignore,no_run
227    /// # use google_cloud_config_v1::model::Deployment;
228    /// use wkt::Timestamp;
229    /// let x = Deployment::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
230    /// let x = Deployment::new().set_or_clear_update_time(None::<Timestamp>);
231    /// ```
232    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
233    where
234        T: std::convert::Into<wkt::Timestamp>,
235    {
236        self.update_time = v.map(|x| x.into());
237        self
238    }
239
240    /// Sets the value of [labels][crate::model::Deployment::labels].
241    ///
242    /// # Example
243    /// ```ignore,no_run
244    /// # use google_cloud_config_v1::model::Deployment;
245    /// let x = Deployment::new().set_labels([
246    ///     ("key0", "abc"),
247    ///     ("key1", "xyz"),
248    /// ]);
249    /// ```
250    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
251    where
252        T: std::iter::IntoIterator<Item = (K, V)>,
253        K: std::convert::Into<std::string::String>,
254        V: std::convert::Into<std::string::String>,
255    {
256        use std::iter::Iterator;
257        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
258        self
259    }
260
261    /// Sets the value of [state][crate::model::Deployment::state].
262    ///
263    /// # Example
264    /// ```ignore,no_run
265    /// # use google_cloud_config_v1::model::Deployment;
266    /// use google_cloud_config_v1::model::deployment::State;
267    /// let x0 = Deployment::new().set_state(State::Creating);
268    /// let x1 = Deployment::new().set_state(State::Active);
269    /// let x2 = Deployment::new().set_state(State::Updating);
270    /// ```
271    pub fn set_state<T: std::convert::Into<crate::model::deployment::State>>(
272        mut self,
273        v: T,
274    ) -> Self {
275        self.state = v.into();
276        self
277    }
278
279    /// Sets the value of [latest_revision][crate::model::Deployment::latest_revision].
280    ///
281    /// # Example
282    /// ```ignore,no_run
283    /// # use google_cloud_config_v1::model::Deployment;
284    /// let x = Deployment::new().set_latest_revision("example");
285    /// ```
286    pub fn set_latest_revision<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
287        self.latest_revision = v.into();
288        self
289    }
290
291    /// Sets the value of [state_detail][crate::model::Deployment::state_detail].
292    ///
293    /// # Example
294    /// ```ignore,no_run
295    /// # use google_cloud_config_v1::model::Deployment;
296    /// let x = Deployment::new().set_state_detail("example");
297    /// ```
298    pub fn set_state_detail<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
299        self.state_detail = v.into();
300        self
301    }
302
303    /// Sets the value of [error_code][crate::model::Deployment::error_code].
304    ///
305    /// # Example
306    /// ```ignore,no_run
307    /// # use google_cloud_config_v1::model::Deployment;
308    /// use google_cloud_config_v1::model::deployment::ErrorCode;
309    /// let x0 = Deployment::new().set_error_code(ErrorCode::RevisionFailed);
310    /// let x1 = Deployment::new().set_error_code(ErrorCode::CloudBuildPermissionDenied);
311    /// let x2 = Deployment::new().set_error_code(ErrorCode::DeleteBuildApiFailed);
312    /// ```
313    pub fn set_error_code<T: std::convert::Into<crate::model::deployment::ErrorCode>>(
314        mut self,
315        v: T,
316    ) -> Self {
317        self.error_code = v.into();
318        self
319    }
320
321    /// Sets the value of [delete_results][crate::model::Deployment::delete_results].
322    ///
323    /// # Example
324    /// ```ignore,no_run
325    /// # use google_cloud_config_v1::model::Deployment;
326    /// use google_cloud_config_v1::model::ApplyResults;
327    /// let x = Deployment::new().set_delete_results(ApplyResults::default()/* use setters */);
328    /// ```
329    pub fn set_delete_results<T>(mut self, v: T) -> Self
330    where
331        T: std::convert::Into<crate::model::ApplyResults>,
332    {
333        self.delete_results = std::option::Option::Some(v.into());
334        self
335    }
336
337    /// Sets or clears the value of [delete_results][crate::model::Deployment::delete_results].
338    ///
339    /// # Example
340    /// ```ignore,no_run
341    /// # use google_cloud_config_v1::model::Deployment;
342    /// use google_cloud_config_v1::model::ApplyResults;
343    /// let x = Deployment::new().set_or_clear_delete_results(Some(ApplyResults::default()/* use setters */));
344    /// let x = Deployment::new().set_or_clear_delete_results(None::<ApplyResults>);
345    /// ```
346    pub fn set_or_clear_delete_results<T>(mut self, v: std::option::Option<T>) -> Self
347    where
348        T: std::convert::Into<crate::model::ApplyResults>,
349    {
350        self.delete_results = v.map(|x| x.into());
351        self
352    }
353
354    /// Sets the value of [delete_build][crate::model::Deployment::delete_build].
355    ///
356    /// # Example
357    /// ```ignore,no_run
358    /// # use google_cloud_config_v1::model::Deployment;
359    /// let x = Deployment::new().set_delete_build("example");
360    /// ```
361    pub fn set_delete_build<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
362        self.delete_build = v.into();
363        self
364    }
365
366    /// Sets the value of [delete_logs][crate::model::Deployment::delete_logs].
367    ///
368    /// # Example
369    /// ```ignore,no_run
370    /// # use google_cloud_config_v1::model::Deployment;
371    /// let x = Deployment::new().set_delete_logs("example");
372    /// ```
373    pub fn set_delete_logs<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
374        self.delete_logs = v.into();
375        self
376    }
377
378    /// Sets the value of [tf_errors][crate::model::Deployment::tf_errors].
379    ///
380    /// # Example
381    /// ```ignore,no_run
382    /// # use google_cloud_config_v1::model::Deployment;
383    /// use google_cloud_config_v1::model::TerraformError;
384    /// let x = Deployment::new()
385    ///     .set_tf_errors([
386    ///         TerraformError::default()/* use setters */,
387    ///         TerraformError::default()/* use (different) setters */,
388    ///     ]);
389    /// ```
390    pub fn set_tf_errors<T, V>(mut self, v: T) -> Self
391    where
392        T: std::iter::IntoIterator<Item = V>,
393        V: std::convert::Into<crate::model::TerraformError>,
394    {
395        use std::iter::Iterator;
396        self.tf_errors = v.into_iter().map(|i| i.into()).collect();
397        self
398    }
399
400    /// Sets the value of [error_logs][crate::model::Deployment::error_logs].
401    ///
402    /// # Example
403    /// ```ignore,no_run
404    /// # use google_cloud_config_v1::model::Deployment;
405    /// let x = Deployment::new().set_error_logs("example");
406    /// ```
407    pub fn set_error_logs<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
408        self.error_logs = v.into();
409        self
410    }
411
412    /// Sets the value of [artifacts_gcs_bucket][crate::model::Deployment::artifacts_gcs_bucket].
413    ///
414    /// # Example
415    /// ```ignore,no_run
416    /// # use google_cloud_config_v1::model::Deployment;
417    /// let x = Deployment::new().set_artifacts_gcs_bucket("example");
418    /// ```
419    pub fn set_artifacts_gcs_bucket<T>(mut self, v: T) -> Self
420    where
421        T: std::convert::Into<std::string::String>,
422    {
423        self.artifacts_gcs_bucket = std::option::Option::Some(v.into());
424        self
425    }
426
427    /// Sets or clears the value of [artifacts_gcs_bucket][crate::model::Deployment::artifacts_gcs_bucket].
428    ///
429    /// # Example
430    /// ```ignore,no_run
431    /// # use google_cloud_config_v1::model::Deployment;
432    /// let x = Deployment::new().set_or_clear_artifacts_gcs_bucket(Some("example"));
433    /// let x = Deployment::new().set_or_clear_artifacts_gcs_bucket(None::<String>);
434    /// ```
435    pub fn set_or_clear_artifacts_gcs_bucket<T>(mut self, v: std::option::Option<T>) -> Self
436    where
437        T: std::convert::Into<std::string::String>,
438    {
439        self.artifacts_gcs_bucket = v.map(|x| x.into());
440        self
441    }
442
443    /// Sets the value of [service_account][crate::model::Deployment::service_account].
444    ///
445    /// # Example
446    /// ```ignore,no_run
447    /// # use google_cloud_config_v1::model::Deployment;
448    /// let x = Deployment::new().set_service_account("example");
449    /// ```
450    pub fn set_service_account<T>(mut self, v: T) -> Self
451    where
452        T: std::convert::Into<std::string::String>,
453    {
454        self.service_account = std::option::Option::Some(v.into());
455        self
456    }
457
458    /// Sets or clears the value of [service_account][crate::model::Deployment::service_account].
459    ///
460    /// # Example
461    /// ```ignore,no_run
462    /// # use google_cloud_config_v1::model::Deployment;
463    /// let x = Deployment::new().set_or_clear_service_account(Some("example"));
464    /// let x = Deployment::new().set_or_clear_service_account(None::<String>);
465    /// ```
466    pub fn set_or_clear_service_account<T>(mut self, v: std::option::Option<T>) -> Self
467    where
468        T: std::convert::Into<std::string::String>,
469    {
470        self.service_account = v.map(|x| x.into());
471        self
472    }
473
474    /// Sets the value of [import_existing_resources][crate::model::Deployment::import_existing_resources].
475    ///
476    /// # Example
477    /// ```ignore,no_run
478    /// # use google_cloud_config_v1::model::Deployment;
479    /// let x = Deployment::new().set_import_existing_resources(true);
480    /// ```
481    pub fn set_import_existing_resources<T>(mut self, v: T) -> Self
482    where
483        T: std::convert::Into<bool>,
484    {
485        self.import_existing_resources = std::option::Option::Some(v.into());
486        self
487    }
488
489    /// Sets or clears the value of [import_existing_resources][crate::model::Deployment::import_existing_resources].
490    ///
491    /// # Example
492    /// ```ignore,no_run
493    /// # use google_cloud_config_v1::model::Deployment;
494    /// let x = Deployment::new().set_or_clear_import_existing_resources(Some(false));
495    /// let x = Deployment::new().set_or_clear_import_existing_resources(None::<bool>);
496    /// ```
497    pub fn set_or_clear_import_existing_resources<T>(mut self, v: std::option::Option<T>) -> Self
498    where
499        T: std::convert::Into<bool>,
500    {
501        self.import_existing_resources = v.map(|x| x.into());
502        self
503    }
504
505    /// Sets the value of [worker_pool][crate::model::Deployment::worker_pool].
506    ///
507    /// # Example
508    /// ```ignore,no_run
509    /// # use google_cloud_config_v1::model::Deployment;
510    /// let x = Deployment::new().set_worker_pool("example");
511    /// ```
512    pub fn set_worker_pool<T>(mut self, v: T) -> Self
513    where
514        T: std::convert::Into<std::string::String>,
515    {
516        self.worker_pool = std::option::Option::Some(v.into());
517        self
518    }
519
520    /// Sets or clears the value of [worker_pool][crate::model::Deployment::worker_pool].
521    ///
522    /// # Example
523    /// ```ignore,no_run
524    /// # use google_cloud_config_v1::model::Deployment;
525    /// let x = Deployment::new().set_or_clear_worker_pool(Some("example"));
526    /// let x = Deployment::new().set_or_clear_worker_pool(None::<String>);
527    /// ```
528    pub fn set_or_clear_worker_pool<T>(mut self, v: std::option::Option<T>) -> Self
529    where
530        T: std::convert::Into<std::string::String>,
531    {
532        self.worker_pool = v.map(|x| x.into());
533        self
534    }
535
536    /// Sets the value of [lock_state][crate::model::Deployment::lock_state].
537    ///
538    /// # Example
539    /// ```ignore,no_run
540    /// # use google_cloud_config_v1::model::Deployment;
541    /// use google_cloud_config_v1::model::deployment::LockState;
542    /// let x0 = Deployment::new().set_lock_state(LockState::Locked);
543    /// let x1 = Deployment::new().set_lock_state(LockState::Unlocked);
544    /// let x2 = Deployment::new().set_lock_state(LockState::Locking);
545    /// ```
546    pub fn set_lock_state<T: std::convert::Into<crate::model::deployment::LockState>>(
547        mut self,
548        v: T,
549    ) -> Self {
550        self.lock_state = v.into();
551        self
552    }
553
554    /// Sets the value of [tf_version_constraint][crate::model::Deployment::tf_version_constraint].
555    ///
556    /// # Example
557    /// ```ignore,no_run
558    /// # use google_cloud_config_v1::model::Deployment;
559    /// let x = Deployment::new().set_tf_version_constraint("example");
560    /// ```
561    pub fn set_tf_version_constraint<T>(mut self, v: T) -> Self
562    where
563        T: std::convert::Into<std::string::String>,
564    {
565        self.tf_version_constraint = std::option::Option::Some(v.into());
566        self
567    }
568
569    /// Sets or clears the value of [tf_version_constraint][crate::model::Deployment::tf_version_constraint].
570    ///
571    /// # Example
572    /// ```ignore,no_run
573    /// # use google_cloud_config_v1::model::Deployment;
574    /// let x = Deployment::new().set_or_clear_tf_version_constraint(Some("example"));
575    /// let x = Deployment::new().set_or_clear_tf_version_constraint(None::<String>);
576    /// ```
577    pub fn set_or_clear_tf_version_constraint<T>(mut self, v: std::option::Option<T>) -> Self
578    where
579        T: std::convert::Into<std::string::String>,
580    {
581        self.tf_version_constraint = v.map(|x| x.into());
582        self
583    }
584
585    /// Sets the value of [tf_version][crate::model::Deployment::tf_version].
586    ///
587    /// # Example
588    /// ```ignore,no_run
589    /// # use google_cloud_config_v1::model::Deployment;
590    /// let x = Deployment::new().set_tf_version("example");
591    /// ```
592    pub fn set_tf_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
593        self.tf_version = v.into();
594        self
595    }
596
597    /// Sets the value of [quota_validation][crate::model::Deployment::quota_validation].
598    ///
599    /// # Example
600    /// ```ignore,no_run
601    /// # use google_cloud_config_v1::model::Deployment;
602    /// use google_cloud_config_v1::model::QuotaValidation;
603    /// let x0 = Deployment::new().set_quota_validation(QuotaValidation::Enabled);
604    /// let x1 = Deployment::new().set_quota_validation(QuotaValidation::Enforced);
605    /// ```
606    pub fn set_quota_validation<T: std::convert::Into<crate::model::QuotaValidation>>(
607        mut self,
608        v: T,
609    ) -> Self {
610        self.quota_validation = v.into();
611        self
612    }
613
614    /// Sets the value of [annotations][crate::model::Deployment::annotations].
615    ///
616    /// # Example
617    /// ```ignore,no_run
618    /// # use google_cloud_config_v1::model::Deployment;
619    /// let x = Deployment::new().set_annotations([
620    ///     ("key0", "abc"),
621    ///     ("key1", "xyz"),
622    /// ]);
623    /// ```
624    pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
625    where
626        T: std::iter::IntoIterator<Item = (K, V)>,
627        K: std::convert::Into<std::string::String>,
628        V: std::convert::Into<std::string::String>,
629    {
630        use std::iter::Iterator;
631        self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
632        self
633    }
634
635    /// Sets the value of [provider_config][crate::model::Deployment::provider_config].
636    ///
637    /// # Example
638    /// ```ignore,no_run
639    /// # use google_cloud_config_v1::model::Deployment;
640    /// use google_cloud_config_v1::model::ProviderConfig;
641    /// let x = Deployment::new().set_provider_config(ProviderConfig::default()/* use setters */);
642    /// ```
643    pub fn set_provider_config<T>(mut self, v: T) -> Self
644    where
645        T: std::convert::Into<crate::model::ProviderConfig>,
646    {
647        self.provider_config = std::option::Option::Some(v.into());
648        self
649    }
650
651    /// Sets or clears the value of [provider_config][crate::model::Deployment::provider_config].
652    ///
653    /// # Example
654    /// ```ignore,no_run
655    /// # use google_cloud_config_v1::model::Deployment;
656    /// use google_cloud_config_v1::model::ProviderConfig;
657    /// let x = Deployment::new().set_or_clear_provider_config(Some(ProviderConfig::default()/* use setters */));
658    /// let x = Deployment::new().set_or_clear_provider_config(None::<ProviderConfig>);
659    /// ```
660    pub fn set_or_clear_provider_config<T>(mut self, v: std::option::Option<T>) -> Self
661    where
662        T: std::convert::Into<crate::model::ProviderConfig>,
663    {
664        self.provider_config = v.map(|x| x.into());
665        self
666    }
667
668    /// Sets the value of [blueprint][crate::model::Deployment::blueprint].
669    ///
670    /// Note that all the setters affecting `blueprint` are mutually
671    /// exclusive.
672    ///
673    /// # Example
674    /// ```ignore,no_run
675    /// # use google_cloud_config_v1::model::Deployment;
676    /// use google_cloud_config_v1::model::TerraformBlueprint;
677    /// let x = Deployment::new().set_blueprint(Some(
678    ///     google_cloud_config_v1::model::deployment::Blueprint::TerraformBlueprint(TerraformBlueprint::default().into())));
679    /// ```
680    pub fn set_blueprint<
681        T: std::convert::Into<std::option::Option<crate::model::deployment::Blueprint>>,
682    >(
683        mut self,
684        v: T,
685    ) -> Self {
686        self.blueprint = v.into();
687        self
688    }
689
690    /// The value of [blueprint][crate::model::Deployment::blueprint]
691    /// if it holds a `TerraformBlueprint`, `None` if the field is not set or
692    /// holds a different branch.
693    pub fn terraform_blueprint(
694        &self,
695    ) -> std::option::Option<&std::boxed::Box<crate::model::TerraformBlueprint>> {
696        #[allow(unreachable_patterns)]
697        self.blueprint.as_ref().and_then(|v| match v {
698            crate::model::deployment::Blueprint::TerraformBlueprint(v) => {
699                std::option::Option::Some(v)
700            }
701            _ => std::option::Option::None,
702        })
703    }
704
705    /// Sets the value of [blueprint][crate::model::Deployment::blueprint]
706    /// to hold a `TerraformBlueprint`.
707    ///
708    /// Note that all the setters affecting `blueprint` are
709    /// mutually exclusive.
710    ///
711    /// # Example
712    /// ```ignore,no_run
713    /// # use google_cloud_config_v1::model::Deployment;
714    /// use google_cloud_config_v1::model::TerraformBlueprint;
715    /// let x = Deployment::new().set_terraform_blueprint(TerraformBlueprint::default()/* use setters */);
716    /// assert!(x.terraform_blueprint().is_some());
717    /// ```
718    pub fn set_terraform_blueprint<
719        T: std::convert::Into<std::boxed::Box<crate::model::TerraformBlueprint>>,
720    >(
721        mut self,
722        v: T,
723    ) -> Self {
724        self.blueprint = std::option::Option::Some(
725            crate::model::deployment::Blueprint::TerraformBlueprint(v.into()),
726        );
727        self
728    }
729}
730
731impl wkt::message::Message for Deployment {
732    fn typename() -> &'static str {
733        "type.googleapis.com/google.cloud.config.v1.Deployment"
734    }
735}
736
737/// Defines additional types related to [Deployment].
738pub mod deployment {
739    #[allow(unused_imports)]
740    use super::*;
741
742    /// Possible states of a deployment.
743    ///
744    /// # Working with unknown values
745    ///
746    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
747    /// additional enum variants at any time. Adding new variants is not considered
748    /// a breaking change. Applications should write their code in anticipation of:
749    ///
750    /// - New values appearing in future releases of the client library, **and**
751    /// - New values received dynamically, without application changes.
752    ///
753    /// Please consult the [Working with enums] section in the user guide for some
754    /// guidelines.
755    ///
756    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
757    #[derive(Clone, Debug, PartialEq)]
758    #[non_exhaustive]
759    pub enum State {
760        /// The default value. This value is used if the state is omitted.
761        Unspecified,
762        /// The deployment is being created.
763        Creating,
764        /// The deployment is healthy.
765        Active,
766        /// The deployment is being updated.
767        Updating,
768        /// The deployment is being deleted.
769        Deleting,
770        /// The deployment has encountered an unexpected error.
771        Failed,
772        /// The deployment is no longer being actively reconciled.
773        /// This may be the result of recovering the project after deletion.
774        Suspended,
775        /// The deployment has been deleted.
776        Deleted,
777        /// If set, the enum was initialized with an unknown value.
778        ///
779        /// Applications can examine the value using [State::value] or
780        /// [State::name].
781        UnknownValue(state::UnknownValue),
782    }
783
784    #[doc(hidden)]
785    pub mod state {
786        #[allow(unused_imports)]
787        use super::*;
788        #[derive(Clone, Debug, PartialEq)]
789        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
790    }
791
792    impl State {
793        /// Gets the enum value.
794        ///
795        /// Returns `None` if the enum contains an unknown value deserialized from
796        /// the string representation of enums.
797        pub fn value(&self) -> std::option::Option<i32> {
798            match self {
799                Self::Unspecified => std::option::Option::Some(0),
800                Self::Creating => std::option::Option::Some(1),
801                Self::Active => std::option::Option::Some(2),
802                Self::Updating => std::option::Option::Some(3),
803                Self::Deleting => std::option::Option::Some(4),
804                Self::Failed => std::option::Option::Some(5),
805                Self::Suspended => std::option::Option::Some(6),
806                Self::Deleted => std::option::Option::Some(7),
807                Self::UnknownValue(u) => u.0.value(),
808            }
809        }
810
811        /// Gets the enum value as a string.
812        ///
813        /// Returns `None` if the enum contains an unknown value deserialized from
814        /// the integer representation of enums.
815        pub fn name(&self) -> std::option::Option<&str> {
816            match self {
817                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
818                Self::Creating => std::option::Option::Some("CREATING"),
819                Self::Active => std::option::Option::Some("ACTIVE"),
820                Self::Updating => std::option::Option::Some("UPDATING"),
821                Self::Deleting => std::option::Option::Some("DELETING"),
822                Self::Failed => std::option::Option::Some("FAILED"),
823                Self::Suspended => std::option::Option::Some("SUSPENDED"),
824                Self::Deleted => std::option::Option::Some("DELETED"),
825                Self::UnknownValue(u) => u.0.name(),
826            }
827        }
828    }
829
830    impl std::default::Default for State {
831        fn default() -> Self {
832            use std::convert::From;
833            Self::from(0)
834        }
835    }
836
837    impl std::fmt::Display for State {
838        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
839            wkt::internal::display_enum(f, self.name(), self.value())
840        }
841    }
842
843    impl std::convert::From<i32> for State {
844        fn from(value: i32) -> Self {
845            match value {
846                0 => Self::Unspecified,
847                1 => Self::Creating,
848                2 => Self::Active,
849                3 => Self::Updating,
850                4 => Self::Deleting,
851                5 => Self::Failed,
852                6 => Self::Suspended,
853                7 => Self::Deleted,
854                _ => Self::UnknownValue(state::UnknownValue(
855                    wkt::internal::UnknownEnumValue::Integer(value),
856                )),
857            }
858        }
859    }
860
861    impl std::convert::From<&str> for State {
862        fn from(value: &str) -> Self {
863            use std::string::ToString;
864            match value {
865                "STATE_UNSPECIFIED" => Self::Unspecified,
866                "CREATING" => Self::Creating,
867                "ACTIVE" => Self::Active,
868                "UPDATING" => Self::Updating,
869                "DELETING" => Self::Deleting,
870                "FAILED" => Self::Failed,
871                "SUSPENDED" => Self::Suspended,
872                "DELETED" => Self::Deleted,
873                _ => Self::UnknownValue(state::UnknownValue(
874                    wkt::internal::UnknownEnumValue::String(value.to_string()),
875                )),
876            }
877        }
878    }
879
880    impl serde::ser::Serialize for State {
881        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
882        where
883            S: serde::Serializer,
884        {
885            match self {
886                Self::Unspecified => serializer.serialize_i32(0),
887                Self::Creating => serializer.serialize_i32(1),
888                Self::Active => serializer.serialize_i32(2),
889                Self::Updating => serializer.serialize_i32(3),
890                Self::Deleting => serializer.serialize_i32(4),
891                Self::Failed => serializer.serialize_i32(5),
892                Self::Suspended => serializer.serialize_i32(6),
893                Self::Deleted => serializer.serialize_i32(7),
894                Self::UnknownValue(u) => u.0.serialize(serializer),
895            }
896        }
897    }
898
899    impl<'de> serde::de::Deserialize<'de> for State {
900        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
901        where
902            D: serde::Deserializer<'de>,
903        {
904            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
905                ".google.cloud.config.v1.Deployment.State",
906            ))
907        }
908    }
909
910    /// Possible errors that can occur with deployments.
911    ///
912    /// # Working with unknown values
913    ///
914    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
915    /// additional enum variants at any time. Adding new variants is not considered
916    /// a breaking change. Applications should write their code in anticipation of:
917    ///
918    /// - New values appearing in future releases of the client library, **and**
919    /// - New values received dynamically, without application changes.
920    ///
921    /// Please consult the [Working with enums] section in the user guide for some
922    /// guidelines.
923    ///
924    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
925    #[derive(Clone, Debug, PartialEq)]
926    #[non_exhaustive]
927    pub enum ErrorCode {
928        /// No error code was specified.
929        Unspecified,
930        /// The revision failed. See Revision for more details.
931        RevisionFailed,
932        /// Cloud Build failed due to a permission issue.
933        CloudBuildPermissionDenied,
934        /// Cloud Build job associated with a deployment deletion could not be
935        /// started.
936        DeleteBuildApiFailed,
937        /// Cloud Build job associated with a deployment deletion was started but
938        /// failed.
939        DeleteBuildRunFailed,
940        /// Cloud Storage bucket creation failed due to a permission issue.
941        BucketCreationPermissionDenied,
942        /// Cloud Storage bucket creation failed due to an issue unrelated to
943        /// permissions.
944        BucketCreationFailed,
945        /// Failed to import values from an external source.
946        ExternalValueSourceImportFailed,
947        /// If set, the enum was initialized with an unknown value.
948        ///
949        /// Applications can examine the value using [ErrorCode::value] or
950        /// [ErrorCode::name].
951        UnknownValue(error_code::UnknownValue),
952    }
953
954    #[doc(hidden)]
955    pub mod error_code {
956        #[allow(unused_imports)]
957        use super::*;
958        #[derive(Clone, Debug, PartialEq)]
959        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
960    }
961
962    impl ErrorCode {
963        /// Gets the enum value.
964        ///
965        /// Returns `None` if the enum contains an unknown value deserialized from
966        /// the string representation of enums.
967        pub fn value(&self) -> std::option::Option<i32> {
968            match self {
969                Self::Unspecified => std::option::Option::Some(0),
970                Self::RevisionFailed => std::option::Option::Some(1),
971                Self::CloudBuildPermissionDenied => std::option::Option::Some(3),
972                Self::DeleteBuildApiFailed => std::option::Option::Some(5),
973                Self::DeleteBuildRunFailed => std::option::Option::Some(6),
974                Self::BucketCreationPermissionDenied => std::option::Option::Some(7),
975                Self::BucketCreationFailed => std::option::Option::Some(8),
976                Self::ExternalValueSourceImportFailed => std::option::Option::Some(10),
977                Self::UnknownValue(u) => u.0.value(),
978            }
979        }
980
981        /// Gets the enum value as a string.
982        ///
983        /// Returns `None` if the enum contains an unknown value deserialized from
984        /// the integer representation of enums.
985        pub fn name(&self) -> std::option::Option<&str> {
986            match self {
987                Self::Unspecified => std::option::Option::Some("ERROR_CODE_UNSPECIFIED"),
988                Self::RevisionFailed => std::option::Option::Some("REVISION_FAILED"),
989                Self::CloudBuildPermissionDenied => {
990                    std::option::Option::Some("CLOUD_BUILD_PERMISSION_DENIED")
991                }
992                Self::DeleteBuildApiFailed => std::option::Option::Some("DELETE_BUILD_API_FAILED"),
993                Self::DeleteBuildRunFailed => std::option::Option::Some("DELETE_BUILD_RUN_FAILED"),
994                Self::BucketCreationPermissionDenied => {
995                    std::option::Option::Some("BUCKET_CREATION_PERMISSION_DENIED")
996                }
997                Self::BucketCreationFailed => std::option::Option::Some("BUCKET_CREATION_FAILED"),
998                Self::ExternalValueSourceImportFailed => {
999                    std::option::Option::Some("EXTERNAL_VALUE_SOURCE_IMPORT_FAILED")
1000                }
1001                Self::UnknownValue(u) => u.0.name(),
1002            }
1003        }
1004    }
1005
1006    impl std::default::Default for ErrorCode {
1007        fn default() -> Self {
1008            use std::convert::From;
1009            Self::from(0)
1010        }
1011    }
1012
1013    impl std::fmt::Display for ErrorCode {
1014        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1015            wkt::internal::display_enum(f, self.name(), self.value())
1016        }
1017    }
1018
1019    impl std::convert::From<i32> for ErrorCode {
1020        fn from(value: i32) -> Self {
1021            match value {
1022                0 => Self::Unspecified,
1023                1 => Self::RevisionFailed,
1024                3 => Self::CloudBuildPermissionDenied,
1025                5 => Self::DeleteBuildApiFailed,
1026                6 => Self::DeleteBuildRunFailed,
1027                7 => Self::BucketCreationPermissionDenied,
1028                8 => Self::BucketCreationFailed,
1029                10 => Self::ExternalValueSourceImportFailed,
1030                _ => Self::UnknownValue(error_code::UnknownValue(
1031                    wkt::internal::UnknownEnumValue::Integer(value),
1032                )),
1033            }
1034        }
1035    }
1036
1037    impl std::convert::From<&str> for ErrorCode {
1038        fn from(value: &str) -> Self {
1039            use std::string::ToString;
1040            match value {
1041                "ERROR_CODE_UNSPECIFIED" => Self::Unspecified,
1042                "REVISION_FAILED" => Self::RevisionFailed,
1043                "CLOUD_BUILD_PERMISSION_DENIED" => Self::CloudBuildPermissionDenied,
1044                "DELETE_BUILD_API_FAILED" => Self::DeleteBuildApiFailed,
1045                "DELETE_BUILD_RUN_FAILED" => Self::DeleteBuildRunFailed,
1046                "BUCKET_CREATION_PERMISSION_DENIED" => Self::BucketCreationPermissionDenied,
1047                "BUCKET_CREATION_FAILED" => Self::BucketCreationFailed,
1048                "EXTERNAL_VALUE_SOURCE_IMPORT_FAILED" => Self::ExternalValueSourceImportFailed,
1049                _ => Self::UnknownValue(error_code::UnknownValue(
1050                    wkt::internal::UnknownEnumValue::String(value.to_string()),
1051                )),
1052            }
1053        }
1054    }
1055
1056    impl serde::ser::Serialize for ErrorCode {
1057        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1058        where
1059            S: serde::Serializer,
1060        {
1061            match self {
1062                Self::Unspecified => serializer.serialize_i32(0),
1063                Self::RevisionFailed => serializer.serialize_i32(1),
1064                Self::CloudBuildPermissionDenied => serializer.serialize_i32(3),
1065                Self::DeleteBuildApiFailed => serializer.serialize_i32(5),
1066                Self::DeleteBuildRunFailed => serializer.serialize_i32(6),
1067                Self::BucketCreationPermissionDenied => serializer.serialize_i32(7),
1068                Self::BucketCreationFailed => serializer.serialize_i32(8),
1069                Self::ExternalValueSourceImportFailed => serializer.serialize_i32(10),
1070                Self::UnknownValue(u) => u.0.serialize(serializer),
1071            }
1072        }
1073    }
1074
1075    impl<'de> serde::de::Deserialize<'de> for ErrorCode {
1076        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1077        where
1078            D: serde::Deserializer<'de>,
1079        {
1080            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ErrorCode>::new(
1081                ".google.cloud.config.v1.Deployment.ErrorCode",
1082            ))
1083        }
1084    }
1085
1086    /// Possible lock states of a deployment.
1087    ///
1088    /// # Working with unknown values
1089    ///
1090    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1091    /// additional enum variants at any time. Adding new variants is not considered
1092    /// a breaking change. Applications should write their code in anticipation of:
1093    ///
1094    /// - New values appearing in future releases of the client library, **and**
1095    /// - New values received dynamically, without application changes.
1096    ///
1097    /// Please consult the [Working with enums] section in the user guide for some
1098    /// guidelines.
1099    ///
1100    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
1101    #[derive(Clone, Debug, PartialEq)]
1102    #[non_exhaustive]
1103    pub enum LockState {
1104        /// The default value. This value is used if the lock state is omitted.
1105        Unspecified,
1106        /// The deployment is locked.
1107        Locked,
1108        /// The deployment is unlocked.
1109        Unlocked,
1110        /// The deployment is being locked.
1111        Locking,
1112        /// The deployment is being unlocked.
1113        Unlocking,
1114        /// The deployment has failed to lock.
1115        LockFailed,
1116        /// The deployment has failed to unlock.
1117        UnlockFailed,
1118        /// If set, the enum was initialized with an unknown value.
1119        ///
1120        /// Applications can examine the value using [LockState::value] or
1121        /// [LockState::name].
1122        UnknownValue(lock_state::UnknownValue),
1123    }
1124
1125    #[doc(hidden)]
1126    pub mod lock_state {
1127        #[allow(unused_imports)]
1128        use super::*;
1129        #[derive(Clone, Debug, PartialEq)]
1130        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1131    }
1132
1133    impl LockState {
1134        /// Gets the enum value.
1135        ///
1136        /// Returns `None` if the enum contains an unknown value deserialized from
1137        /// the string representation of enums.
1138        pub fn value(&self) -> std::option::Option<i32> {
1139            match self {
1140                Self::Unspecified => std::option::Option::Some(0),
1141                Self::Locked => std::option::Option::Some(1),
1142                Self::Unlocked => std::option::Option::Some(2),
1143                Self::Locking => std::option::Option::Some(3),
1144                Self::Unlocking => std::option::Option::Some(4),
1145                Self::LockFailed => std::option::Option::Some(5),
1146                Self::UnlockFailed => std::option::Option::Some(6),
1147                Self::UnknownValue(u) => u.0.value(),
1148            }
1149        }
1150
1151        /// Gets the enum value as a string.
1152        ///
1153        /// Returns `None` if the enum contains an unknown value deserialized from
1154        /// the integer representation of enums.
1155        pub fn name(&self) -> std::option::Option<&str> {
1156            match self {
1157                Self::Unspecified => std::option::Option::Some("LOCK_STATE_UNSPECIFIED"),
1158                Self::Locked => std::option::Option::Some("LOCKED"),
1159                Self::Unlocked => std::option::Option::Some("UNLOCKED"),
1160                Self::Locking => std::option::Option::Some("LOCKING"),
1161                Self::Unlocking => std::option::Option::Some("UNLOCKING"),
1162                Self::LockFailed => std::option::Option::Some("LOCK_FAILED"),
1163                Self::UnlockFailed => std::option::Option::Some("UNLOCK_FAILED"),
1164                Self::UnknownValue(u) => u.0.name(),
1165            }
1166        }
1167    }
1168
1169    impl std::default::Default for LockState {
1170        fn default() -> Self {
1171            use std::convert::From;
1172            Self::from(0)
1173        }
1174    }
1175
1176    impl std::fmt::Display for LockState {
1177        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1178            wkt::internal::display_enum(f, self.name(), self.value())
1179        }
1180    }
1181
1182    impl std::convert::From<i32> for LockState {
1183        fn from(value: i32) -> Self {
1184            match value {
1185                0 => Self::Unspecified,
1186                1 => Self::Locked,
1187                2 => Self::Unlocked,
1188                3 => Self::Locking,
1189                4 => Self::Unlocking,
1190                5 => Self::LockFailed,
1191                6 => Self::UnlockFailed,
1192                _ => Self::UnknownValue(lock_state::UnknownValue(
1193                    wkt::internal::UnknownEnumValue::Integer(value),
1194                )),
1195            }
1196        }
1197    }
1198
1199    impl std::convert::From<&str> for LockState {
1200        fn from(value: &str) -> Self {
1201            use std::string::ToString;
1202            match value {
1203                "LOCK_STATE_UNSPECIFIED" => Self::Unspecified,
1204                "LOCKED" => Self::Locked,
1205                "UNLOCKED" => Self::Unlocked,
1206                "LOCKING" => Self::Locking,
1207                "UNLOCKING" => Self::Unlocking,
1208                "LOCK_FAILED" => Self::LockFailed,
1209                "UNLOCK_FAILED" => Self::UnlockFailed,
1210                _ => Self::UnknownValue(lock_state::UnknownValue(
1211                    wkt::internal::UnknownEnumValue::String(value.to_string()),
1212                )),
1213            }
1214        }
1215    }
1216
1217    impl serde::ser::Serialize for LockState {
1218        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1219        where
1220            S: serde::Serializer,
1221        {
1222            match self {
1223                Self::Unspecified => serializer.serialize_i32(0),
1224                Self::Locked => serializer.serialize_i32(1),
1225                Self::Unlocked => serializer.serialize_i32(2),
1226                Self::Locking => serializer.serialize_i32(3),
1227                Self::Unlocking => serializer.serialize_i32(4),
1228                Self::LockFailed => serializer.serialize_i32(5),
1229                Self::UnlockFailed => serializer.serialize_i32(6),
1230                Self::UnknownValue(u) => u.0.serialize(serializer),
1231            }
1232        }
1233    }
1234
1235    impl<'de> serde::de::Deserialize<'de> for LockState {
1236        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1237        where
1238            D: serde::Deserializer<'de>,
1239        {
1240            deserializer.deserialize_any(wkt::internal::EnumVisitor::<LockState>::new(
1241                ".google.cloud.config.v1.Deployment.LockState",
1242            ))
1243        }
1244    }
1245
1246    /// Blueprint to deploy.
1247    #[derive(Clone, Debug, PartialEq)]
1248    #[non_exhaustive]
1249    pub enum Blueprint {
1250        /// A blueprint described using Terraform's HashiCorp Configuration Language
1251        /// as a root module.
1252        TerraformBlueprint(std::boxed::Box<crate::model::TerraformBlueprint>),
1253    }
1254}
1255
1256/// TerraformBlueprint describes the source of a Terraform root module which
1257/// describes the resources and configs to be deployed.
1258#[derive(Clone, Default, PartialEq)]
1259#[non_exhaustive]
1260pub struct TerraformBlueprint {
1261    /// Optional. Input variable values for the Terraform blueprint.
1262    pub input_values:
1263        std::collections::HashMap<std::string::String, crate::model::TerraformVariable>,
1264
1265    /// Location of the source configs.
1266    /// Required.
1267    pub source: std::option::Option<crate::model::terraform_blueprint::Source>,
1268
1269    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1270}
1271
1272impl TerraformBlueprint {
1273    pub fn new() -> Self {
1274        std::default::Default::default()
1275    }
1276
1277    /// Sets the value of [input_values][crate::model::TerraformBlueprint::input_values].
1278    ///
1279    /// # Example
1280    /// ```ignore,no_run
1281    /// # use google_cloud_config_v1::model::TerraformBlueprint;
1282    /// use google_cloud_config_v1::model::TerraformVariable;
1283    /// let x = TerraformBlueprint::new().set_input_values([
1284    ///     ("key0", TerraformVariable::default()/* use setters */),
1285    ///     ("key1", TerraformVariable::default()/* use (different) setters */),
1286    /// ]);
1287    /// ```
1288    pub fn set_input_values<T, K, V>(mut self, v: T) -> Self
1289    where
1290        T: std::iter::IntoIterator<Item = (K, V)>,
1291        K: std::convert::Into<std::string::String>,
1292        V: std::convert::Into<crate::model::TerraformVariable>,
1293    {
1294        use std::iter::Iterator;
1295        self.input_values = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1296        self
1297    }
1298
1299    /// Sets the value of [source][crate::model::TerraformBlueprint::source].
1300    ///
1301    /// Note that all the setters affecting `source` are mutually
1302    /// exclusive.
1303    ///
1304    /// # Example
1305    /// ```ignore,no_run
1306    /// # use google_cloud_config_v1::model::TerraformBlueprint;
1307    /// use google_cloud_config_v1::model::terraform_blueprint::Source;
1308    /// let x = TerraformBlueprint::new().set_source(Some(Source::GcsSource("example".to_string())));
1309    /// ```
1310    pub fn set_source<
1311        T: std::convert::Into<std::option::Option<crate::model::terraform_blueprint::Source>>,
1312    >(
1313        mut self,
1314        v: T,
1315    ) -> Self {
1316        self.source = v.into();
1317        self
1318    }
1319
1320    /// The value of [source][crate::model::TerraformBlueprint::source]
1321    /// if it holds a `GcsSource`, `None` if the field is not set or
1322    /// holds a different branch.
1323    pub fn gcs_source(&self) -> std::option::Option<&std::string::String> {
1324        #[allow(unreachable_patterns)]
1325        self.source.as_ref().and_then(|v| match v {
1326            crate::model::terraform_blueprint::Source::GcsSource(v) => std::option::Option::Some(v),
1327            _ => std::option::Option::None,
1328        })
1329    }
1330
1331    /// Sets the value of [source][crate::model::TerraformBlueprint::source]
1332    /// to hold a `GcsSource`.
1333    ///
1334    /// Note that all the setters affecting `source` are
1335    /// mutually exclusive.
1336    ///
1337    /// # Example
1338    /// ```ignore,no_run
1339    /// # use google_cloud_config_v1::model::TerraformBlueprint;
1340    /// let x = TerraformBlueprint::new().set_gcs_source("example");
1341    /// assert!(x.gcs_source().is_some());
1342    /// assert!(x.git_source().is_none());
1343    /// ```
1344    pub fn set_gcs_source<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1345        self.source = std::option::Option::Some(
1346            crate::model::terraform_blueprint::Source::GcsSource(v.into()),
1347        );
1348        self
1349    }
1350
1351    /// The value of [source][crate::model::TerraformBlueprint::source]
1352    /// if it holds a `GitSource`, `None` if the field is not set or
1353    /// holds a different branch.
1354    pub fn git_source(&self) -> std::option::Option<&std::boxed::Box<crate::model::GitSource>> {
1355        #[allow(unreachable_patterns)]
1356        self.source.as_ref().and_then(|v| match v {
1357            crate::model::terraform_blueprint::Source::GitSource(v) => std::option::Option::Some(v),
1358            _ => std::option::Option::None,
1359        })
1360    }
1361
1362    /// Sets the value of [source][crate::model::TerraformBlueprint::source]
1363    /// to hold a `GitSource`.
1364    ///
1365    /// Note that all the setters affecting `source` are
1366    /// mutually exclusive.
1367    ///
1368    /// # Example
1369    /// ```ignore,no_run
1370    /// # use google_cloud_config_v1::model::TerraformBlueprint;
1371    /// use google_cloud_config_v1::model::GitSource;
1372    /// let x = TerraformBlueprint::new().set_git_source(GitSource::default()/* use setters */);
1373    /// assert!(x.git_source().is_some());
1374    /// assert!(x.gcs_source().is_none());
1375    /// ```
1376    pub fn set_git_source<T: std::convert::Into<std::boxed::Box<crate::model::GitSource>>>(
1377        mut self,
1378        v: T,
1379    ) -> Self {
1380        self.source = std::option::Option::Some(
1381            crate::model::terraform_blueprint::Source::GitSource(v.into()),
1382        );
1383        self
1384    }
1385}
1386
1387impl wkt::message::Message for TerraformBlueprint {
1388    fn typename() -> &'static str {
1389        "type.googleapis.com/google.cloud.config.v1.TerraformBlueprint"
1390    }
1391}
1392
1393/// Defines additional types related to [TerraformBlueprint].
1394pub mod terraform_blueprint {
1395    #[allow(unused_imports)]
1396    use super::*;
1397
1398    /// Location of the source configs.
1399    /// Required.
1400    #[derive(Clone, Debug, PartialEq)]
1401    #[non_exhaustive]
1402    pub enum Source {
1403        /// URI of an object in Google Cloud Storage.
1404        /// Format: `gs://{bucket}/{object}`
1405        ///
1406        /// URI may also specify an object version for zipped objects.
1407        /// Format: `gs://{bucket}/{object}#{version}`
1408        GcsSource(std::string::String),
1409        /// URI of a public Git repo.
1410        GitSource(std::boxed::Box<crate::model::GitSource>),
1411    }
1412}
1413
1414/// A Terraform input variable.
1415#[derive(Clone, Default, PartialEq)]
1416#[non_exhaustive]
1417pub struct TerraformVariable {
1418    /// Optional. Input variable value.
1419    pub input_value: std::option::Option<wkt::Value>,
1420
1421    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1422}
1423
1424impl TerraformVariable {
1425    pub fn new() -> Self {
1426        std::default::Default::default()
1427    }
1428
1429    /// Sets the value of [input_value][crate::model::TerraformVariable::input_value].
1430    ///
1431    /// # Example
1432    /// ```ignore,no_run
1433    /// # use google_cloud_config_v1::model::TerraformVariable;
1434    /// use wkt::Value;
1435    /// let x = TerraformVariable::new().set_input_value(Value::default()/* use setters */);
1436    /// ```
1437    pub fn set_input_value<T>(mut self, v: T) -> Self
1438    where
1439        T: std::convert::Into<wkt::Value>,
1440    {
1441        self.input_value = std::option::Option::Some(v.into());
1442        self
1443    }
1444
1445    /// Sets or clears the value of [input_value][crate::model::TerraformVariable::input_value].
1446    ///
1447    /// # Example
1448    /// ```ignore,no_run
1449    /// # use google_cloud_config_v1::model::TerraformVariable;
1450    /// use wkt::Value;
1451    /// let x = TerraformVariable::new().set_or_clear_input_value(Some(Value::default()/* use setters */));
1452    /// let x = TerraformVariable::new().set_or_clear_input_value(None::<Value>);
1453    /// ```
1454    pub fn set_or_clear_input_value<T>(mut self, v: std::option::Option<T>) -> Self
1455    where
1456        T: std::convert::Into<wkt::Value>,
1457    {
1458        self.input_value = v.map(|x| x.into());
1459        self
1460    }
1461}
1462
1463impl wkt::message::Message for TerraformVariable {
1464    fn typename() -> &'static str {
1465        "type.googleapis.com/google.cloud.config.v1.TerraformVariable"
1466    }
1467}
1468
1469/// Outputs and artifacts from applying a deployment.
1470#[derive(Clone, Default, PartialEq)]
1471#[non_exhaustive]
1472pub struct ApplyResults {
1473    /// Location of a blueprint copy and other manifests in Google Cloud Storage.
1474    /// Format: `gs://{bucket}/{object}`
1475    pub content: std::string::String,
1476
1477    /// Location of artifacts (e.g. logs) in Google Cloud Storage.
1478    /// Format: `gs://{bucket}/{object}`
1479    pub artifacts: std::string::String,
1480
1481    /// Map of output name to output info.
1482    pub outputs: std::collections::HashMap<std::string::String, crate::model::TerraformOutput>,
1483
1484    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1485}
1486
1487impl ApplyResults {
1488    pub fn new() -> Self {
1489        std::default::Default::default()
1490    }
1491
1492    /// Sets the value of [content][crate::model::ApplyResults::content].
1493    ///
1494    /// # Example
1495    /// ```ignore,no_run
1496    /// # use google_cloud_config_v1::model::ApplyResults;
1497    /// let x = ApplyResults::new().set_content("example");
1498    /// ```
1499    pub fn set_content<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1500        self.content = v.into();
1501        self
1502    }
1503
1504    /// Sets the value of [artifacts][crate::model::ApplyResults::artifacts].
1505    ///
1506    /// # Example
1507    /// ```ignore,no_run
1508    /// # use google_cloud_config_v1::model::ApplyResults;
1509    /// let x = ApplyResults::new().set_artifacts("example");
1510    /// ```
1511    pub fn set_artifacts<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1512        self.artifacts = v.into();
1513        self
1514    }
1515
1516    /// Sets the value of [outputs][crate::model::ApplyResults::outputs].
1517    ///
1518    /// # Example
1519    /// ```ignore,no_run
1520    /// # use google_cloud_config_v1::model::ApplyResults;
1521    /// use google_cloud_config_v1::model::TerraformOutput;
1522    /// let x = ApplyResults::new().set_outputs([
1523    ///     ("key0", TerraformOutput::default()/* use setters */),
1524    ///     ("key1", TerraformOutput::default()/* use (different) setters */),
1525    /// ]);
1526    /// ```
1527    pub fn set_outputs<T, K, V>(mut self, v: T) -> Self
1528    where
1529        T: std::iter::IntoIterator<Item = (K, V)>,
1530        K: std::convert::Into<std::string::String>,
1531        V: std::convert::Into<crate::model::TerraformOutput>,
1532    {
1533        use std::iter::Iterator;
1534        self.outputs = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1535        self
1536    }
1537}
1538
1539impl wkt::message::Message for ApplyResults {
1540    fn typename() -> &'static str {
1541        "type.googleapis.com/google.cloud.config.v1.ApplyResults"
1542    }
1543}
1544
1545/// Describes a Terraform output.
1546#[derive(Clone, Default, PartialEq)]
1547#[non_exhaustive]
1548pub struct TerraformOutput {
1549    /// Identifies whether Terraform has set this output as a potential
1550    /// sensitive value.
1551    pub sensitive: bool,
1552
1553    /// Value of output.
1554    pub value: std::option::Option<wkt::Value>,
1555
1556    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1557}
1558
1559impl TerraformOutput {
1560    pub fn new() -> Self {
1561        std::default::Default::default()
1562    }
1563
1564    /// Sets the value of [sensitive][crate::model::TerraformOutput::sensitive].
1565    ///
1566    /// # Example
1567    /// ```ignore,no_run
1568    /// # use google_cloud_config_v1::model::TerraformOutput;
1569    /// let x = TerraformOutput::new().set_sensitive(true);
1570    /// ```
1571    pub fn set_sensitive<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1572        self.sensitive = v.into();
1573        self
1574    }
1575
1576    /// Sets the value of [value][crate::model::TerraformOutput::value].
1577    ///
1578    /// # Example
1579    /// ```ignore,no_run
1580    /// # use google_cloud_config_v1::model::TerraformOutput;
1581    /// use wkt::Value;
1582    /// let x = TerraformOutput::new().set_value(Value::default()/* use setters */);
1583    /// ```
1584    pub fn set_value<T>(mut self, v: T) -> Self
1585    where
1586        T: std::convert::Into<wkt::Value>,
1587    {
1588        self.value = std::option::Option::Some(v.into());
1589        self
1590    }
1591
1592    /// Sets or clears the value of [value][crate::model::TerraformOutput::value].
1593    ///
1594    /// # Example
1595    /// ```ignore,no_run
1596    /// # use google_cloud_config_v1::model::TerraformOutput;
1597    /// use wkt::Value;
1598    /// let x = TerraformOutput::new().set_or_clear_value(Some(Value::default()/* use setters */));
1599    /// let x = TerraformOutput::new().set_or_clear_value(None::<Value>);
1600    /// ```
1601    pub fn set_or_clear_value<T>(mut self, v: std::option::Option<T>) -> Self
1602    where
1603        T: std::convert::Into<wkt::Value>,
1604    {
1605        self.value = v.map(|x| x.into());
1606        self
1607    }
1608}
1609
1610impl wkt::message::Message for TerraformOutput {
1611    fn typename() -> &'static str {
1612        "type.googleapis.com/google.cloud.config.v1.TerraformOutput"
1613    }
1614}
1615
1616#[derive(Clone, Default, PartialEq)]
1617#[non_exhaustive]
1618pub struct ListDeploymentsRequest {
1619    /// Required. The parent in whose context the Deployments are listed. The
1620    /// parent value is in the format:
1621    /// 'projects/{project_id}/locations/{location}'.
1622    pub parent: std::string::String,
1623
1624    /// When requesting a page of resources, 'page_size' specifies number of
1625    /// resources to return. If unspecified, at most 500 will be returned. The
1626    /// maximum value is 1000.
1627    pub page_size: i32,
1628
1629    /// Token returned by previous call to 'ListDeployments' which specifies the
1630    /// position in the list from where to continue listing the resources.
1631    pub page_token: std::string::String,
1632
1633    /// Lists the Deployments that match the filter expression. A filter
1634    /// expression filters the resources listed in the response. The expression
1635    /// must be of the form '{field} {operator} {value}' where operators: '<', '>',
1636    /// '<=', '>=', '!=', '=', ':' are supported (colon ':' represents a HAS
1637    /// operator which is roughly synonymous with equality). {field} can refer to a
1638    /// proto or JSON field, or a synthetic field. Field names can be camelCase or
1639    /// snake_case.
1640    ///
1641    /// Examples:
1642    ///
1643    /// - Filter by name:
1644    ///   name = "projects/foo/locations/us-central1/deployments/bar
1645    ///
1646    /// - Filter by labels:
1647    ///
1648    ///   - Resources that have a key called 'foo'
1649    ///     labels.foo:*
1650    ///   - Resources that have a key called 'foo' whose value is 'bar'
1651    ///     labels.foo = bar
1652    /// - Filter by state:
1653    ///
1654    ///   - Deployments in CREATING state.
1655    ///     state=CREATING
1656    pub filter: std::string::String,
1657
1658    /// Field to use to sort the list.
1659    pub order_by: std::string::String,
1660
1661    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1662}
1663
1664impl ListDeploymentsRequest {
1665    pub fn new() -> Self {
1666        std::default::Default::default()
1667    }
1668
1669    /// Sets the value of [parent][crate::model::ListDeploymentsRequest::parent].
1670    ///
1671    /// # Example
1672    /// ```ignore,no_run
1673    /// # use google_cloud_config_v1::model::ListDeploymentsRequest;
1674    /// let x = ListDeploymentsRequest::new().set_parent("example");
1675    /// ```
1676    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1677        self.parent = v.into();
1678        self
1679    }
1680
1681    /// Sets the value of [page_size][crate::model::ListDeploymentsRequest::page_size].
1682    ///
1683    /// # Example
1684    /// ```ignore,no_run
1685    /// # use google_cloud_config_v1::model::ListDeploymentsRequest;
1686    /// let x = ListDeploymentsRequest::new().set_page_size(42);
1687    /// ```
1688    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1689        self.page_size = v.into();
1690        self
1691    }
1692
1693    /// Sets the value of [page_token][crate::model::ListDeploymentsRequest::page_token].
1694    ///
1695    /// # Example
1696    /// ```ignore,no_run
1697    /// # use google_cloud_config_v1::model::ListDeploymentsRequest;
1698    /// let x = ListDeploymentsRequest::new().set_page_token("example");
1699    /// ```
1700    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1701        self.page_token = v.into();
1702        self
1703    }
1704
1705    /// Sets the value of [filter][crate::model::ListDeploymentsRequest::filter].
1706    ///
1707    /// # Example
1708    /// ```ignore,no_run
1709    /// # use google_cloud_config_v1::model::ListDeploymentsRequest;
1710    /// let x = ListDeploymentsRequest::new().set_filter("example");
1711    /// ```
1712    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1713        self.filter = v.into();
1714        self
1715    }
1716
1717    /// Sets the value of [order_by][crate::model::ListDeploymentsRequest::order_by].
1718    ///
1719    /// # Example
1720    /// ```ignore,no_run
1721    /// # use google_cloud_config_v1::model::ListDeploymentsRequest;
1722    /// let x = ListDeploymentsRequest::new().set_order_by("example");
1723    /// ```
1724    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1725        self.order_by = v.into();
1726        self
1727    }
1728}
1729
1730impl wkt::message::Message for ListDeploymentsRequest {
1731    fn typename() -> &'static str {
1732        "type.googleapis.com/google.cloud.config.v1.ListDeploymentsRequest"
1733    }
1734}
1735
1736#[derive(Clone, Default, PartialEq)]
1737#[non_exhaustive]
1738pub struct ListDeploymentsResponse {
1739    /// List of [Deployment][google.cloud.config.v1.Deployment]s.
1740    ///
1741    /// [google.cloud.config.v1.Deployment]: crate::model::Deployment
1742    pub deployments: std::vec::Vec<crate::model::Deployment>,
1743
1744    /// Token to be supplied to the next ListDeployments request via `page_token`
1745    /// to obtain the next set of results.
1746    pub next_page_token: std::string::String,
1747
1748    /// Locations that could not be reached.
1749    pub unreachable: std::vec::Vec<std::string::String>,
1750
1751    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1752}
1753
1754impl ListDeploymentsResponse {
1755    pub fn new() -> Self {
1756        std::default::Default::default()
1757    }
1758
1759    /// Sets the value of [deployments][crate::model::ListDeploymentsResponse::deployments].
1760    ///
1761    /// # Example
1762    /// ```ignore,no_run
1763    /// # use google_cloud_config_v1::model::ListDeploymentsResponse;
1764    /// use google_cloud_config_v1::model::Deployment;
1765    /// let x = ListDeploymentsResponse::new()
1766    ///     .set_deployments([
1767    ///         Deployment::default()/* use setters */,
1768    ///         Deployment::default()/* use (different) setters */,
1769    ///     ]);
1770    /// ```
1771    pub fn set_deployments<T, V>(mut self, v: T) -> Self
1772    where
1773        T: std::iter::IntoIterator<Item = V>,
1774        V: std::convert::Into<crate::model::Deployment>,
1775    {
1776        use std::iter::Iterator;
1777        self.deployments = v.into_iter().map(|i| i.into()).collect();
1778        self
1779    }
1780
1781    /// Sets the value of [next_page_token][crate::model::ListDeploymentsResponse::next_page_token].
1782    ///
1783    /// # Example
1784    /// ```ignore,no_run
1785    /// # use google_cloud_config_v1::model::ListDeploymentsResponse;
1786    /// let x = ListDeploymentsResponse::new().set_next_page_token("example");
1787    /// ```
1788    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1789        self.next_page_token = v.into();
1790        self
1791    }
1792
1793    /// Sets the value of [unreachable][crate::model::ListDeploymentsResponse::unreachable].
1794    ///
1795    /// # Example
1796    /// ```ignore,no_run
1797    /// # use google_cloud_config_v1::model::ListDeploymentsResponse;
1798    /// let x = ListDeploymentsResponse::new().set_unreachable(["a", "b", "c"]);
1799    /// ```
1800    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
1801    where
1802        T: std::iter::IntoIterator<Item = V>,
1803        V: std::convert::Into<std::string::String>,
1804    {
1805        use std::iter::Iterator;
1806        self.unreachable = v.into_iter().map(|i| i.into()).collect();
1807        self
1808    }
1809}
1810
1811impl wkt::message::Message for ListDeploymentsResponse {
1812    fn typename() -> &'static str {
1813        "type.googleapis.com/google.cloud.config.v1.ListDeploymentsResponse"
1814    }
1815}
1816
1817#[doc(hidden)]
1818impl google_cloud_gax::paginator::internal::PageableResponse for ListDeploymentsResponse {
1819    type PageItem = crate::model::Deployment;
1820
1821    fn items(self) -> std::vec::Vec<Self::PageItem> {
1822        self.deployments
1823    }
1824
1825    fn next_page_token(&self) -> std::string::String {
1826        use std::clone::Clone;
1827        self.next_page_token.clone()
1828    }
1829}
1830
1831#[derive(Clone, Default, PartialEq)]
1832#[non_exhaustive]
1833pub struct GetDeploymentRequest {
1834    /// Required. The name of the deployment. Format:
1835    /// 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
1836    pub name: std::string::String,
1837
1838    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1839}
1840
1841impl GetDeploymentRequest {
1842    pub fn new() -> Self {
1843        std::default::Default::default()
1844    }
1845
1846    /// Sets the value of [name][crate::model::GetDeploymentRequest::name].
1847    ///
1848    /// # Example
1849    /// ```ignore,no_run
1850    /// # use google_cloud_config_v1::model::GetDeploymentRequest;
1851    /// let x = GetDeploymentRequest::new().set_name("example");
1852    /// ```
1853    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1854        self.name = v.into();
1855        self
1856    }
1857}
1858
1859impl wkt::message::Message for GetDeploymentRequest {
1860    fn typename() -> &'static str {
1861        "type.googleapis.com/google.cloud.config.v1.GetDeploymentRequest"
1862    }
1863}
1864
1865/// A request to list Revisions passed to a 'ListRevisions' call.
1866#[derive(Clone, Default, PartialEq)]
1867#[non_exhaustive]
1868pub struct ListRevisionsRequest {
1869    /// Required. The parent in whose context the Revisions are listed. The parent
1870    /// value is in the format:
1871    /// 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
1872    pub parent: std::string::String,
1873
1874    /// When requesting a page of resources, `page_size` specifies number of
1875    /// resources to return. If unspecified, at most 500 will be returned. The
1876    /// maximum value is 1000.
1877    pub page_size: i32,
1878
1879    /// Token returned by previous call to 'ListRevisions' which specifies the
1880    /// position in the list from where to continue listing the resources.
1881    pub page_token: std::string::String,
1882
1883    /// Lists the Revisions that match the filter expression. A filter
1884    /// expression filters the resources listed in the response. The expression
1885    /// must be of the form '{field} {operator} {value}' where operators: '<', '>',
1886    /// '<=', '>=', '!=', '=', ':' are supported (colon ':' represents a HAS
1887    /// operator which is roughly synonymous with equality). {field} can refer to a
1888    /// proto or JSON field, or a synthetic field. Field names can be camelCase or
1889    /// snake_case.
1890    ///
1891    /// Examples:
1892    ///
1893    /// - Filter by name:
1894    ///   name = "projects/foo/locations/us-central1/deployments/dep/revisions/bar
1895    ///
1896    /// - Filter by labels:
1897    ///
1898    ///   - Resources that have a key called 'foo'
1899    ///     labels.foo:*
1900    ///   - Resources that have a key called 'foo' whose value is 'bar'
1901    ///     labels.foo = bar
1902    /// - Filter by state:
1903    ///
1904    ///   - Revisions in CREATING state.
1905    ///     state=CREATING
1906    pub filter: std::string::String,
1907
1908    /// Field to use to sort the list.
1909    pub order_by: std::string::String,
1910
1911    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1912}
1913
1914impl ListRevisionsRequest {
1915    pub fn new() -> Self {
1916        std::default::Default::default()
1917    }
1918
1919    /// Sets the value of [parent][crate::model::ListRevisionsRequest::parent].
1920    ///
1921    /// # Example
1922    /// ```ignore,no_run
1923    /// # use google_cloud_config_v1::model::ListRevisionsRequest;
1924    /// let x = ListRevisionsRequest::new().set_parent("example");
1925    /// ```
1926    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1927        self.parent = v.into();
1928        self
1929    }
1930
1931    /// Sets the value of [page_size][crate::model::ListRevisionsRequest::page_size].
1932    ///
1933    /// # Example
1934    /// ```ignore,no_run
1935    /// # use google_cloud_config_v1::model::ListRevisionsRequest;
1936    /// let x = ListRevisionsRequest::new().set_page_size(42);
1937    /// ```
1938    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1939        self.page_size = v.into();
1940        self
1941    }
1942
1943    /// Sets the value of [page_token][crate::model::ListRevisionsRequest::page_token].
1944    ///
1945    /// # Example
1946    /// ```ignore,no_run
1947    /// # use google_cloud_config_v1::model::ListRevisionsRequest;
1948    /// let x = ListRevisionsRequest::new().set_page_token("example");
1949    /// ```
1950    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1951        self.page_token = v.into();
1952        self
1953    }
1954
1955    /// Sets the value of [filter][crate::model::ListRevisionsRequest::filter].
1956    ///
1957    /// # Example
1958    /// ```ignore,no_run
1959    /// # use google_cloud_config_v1::model::ListRevisionsRequest;
1960    /// let x = ListRevisionsRequest::new().set_filter("example");
1961    /// ```
1962    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1963        self.filter = v.into();
1964        self
1965    }
1966
1967    /// Sets the value of [order_by][crate::model::ListRevisionsRequest::order_by].
1968    ///
1969    /// # Example
1970    /// ```ignore,no_run
1971    /// # use google_cloud_config_v1::model::ListRevisionsRequest;
1972    /// let x = ListRevisionsRequest::new().set_order_by("example");
1973    /// ```
1974    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1975        self.order_by = v.into();
1976        self
1977    }
1978}
1979
1980impl wkt::message::Message for ListRevisionsRequest {
1981    fn typename() -> &'static str {
1982        "type.googleapis.com/google.cloud.config.v1.ListRevisionsRequest"
1983    }
1984}
1985
1986/// A response to a 'ListRevisions' call. Contains a list of Revisions.
1987#[derive(Clone, Default, PartialEq)]
1988#[non_exhaustive]
1989pub struct ListRevisionsResponse {
1990    /// List of [Revision][google.cloud.config.v1.Revision]s.
1991    ///
1992    /// [google.cloud.config.v1.Revision]: crate::model::Revision
1993    pub revisions: std::vec::Vec<crate::model::Revision>,
1994
1995    /// A token to request the next page of resources from the 'ListRevisions'
1996    /// method. The value of an empty string means that there are no more resources
1997    /// to return.
1998    pub next_page_token: std::string::String,
1999
2000    /// Locations that could not be reached.
2001    pub unreachable: std::vec::Vec<std::string::String>,
2002
2003    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2004}
2005
2006impl ListRevisionsResponse {
2007    pub fn new() -> Self {
2008        std::default::Default::default()
2009    }
2010
2011    /// Sets the value of [revisions][crate::model::ListRevisionsResponse::revisions].
2012    ///
2013    /// # Example
2014    /// ```ignore,no_run
2015    /// # use google_cloud_config_v1::model::ListRevisionsResponse;
2016    /// use google_cloud_config_v1::model::Revision;
2017    /// let x = ListRevisionsResponse::new()
2018    ///     .set_revisions([
2019    ///         Revision::default()/* use setters */,
2020    ///         Revision::default()/* use (different) setters */,
2021    ///     ]);
2022    /// ```
2023    pub fn set_revisions<T, V>(mut self, v: T) -> Self
2024    where
2025        T: std::iter::IntoIterator<Item = V>,
2026        V: std::convert::Into<crate::model::Revision>,
2027    {
2028        use std::iter::Iterator;
2029        self.revisions = v.into_iter().map(|i| i.into()).collect();
2030        self
2031    }
2032
2033    /// Sets the value of [next_page_token][crate::model::ListRevisionsResponse::next_page_token].
2034    ///
2035    /// # Example
2036    /// ```ignore,no_run
2037    /// # use google_cloud_config_v1::model::ListRevisionsResponse;
2038    /// let x = ListRevisionsResponse::new().set_next_page_token("example");
2039    /// ```
2040    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2041        self.next_page_token = v.into();
2042        self
2043    }
2044
2045    /// Sets the value of [unreachable][crate::model::ListRevisionsResponse::unreachable].
2046    ///
2047    /// # Example
2048    /// ```ignore,no_run
2049    /// # use google_cloud_config_v1::model::ListRevisionsResponse;
2050    /// let x = ListRevisionsResponse::new().set_unreachable(["a", "b", "c"]);
2051    /// ```
2052    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
2053    where
2054        T: std::iter::IntoIterator<Item = V>,
2055        V: std::convert::Into<std::string::String>,
2056    {
2057        use std::iter::Iterator;
2058        self.unreachable = v.into_iter().map(|i| i.into()).collect();
2059        self
2060    }
2061}
2062
2063impl wkt::message::Message for ListRevisionsResponse {
2064    fn typename() -> &'static str {
2065        "type.googleapis.com/google.cloud.config.v1.ListRevisionsResponse"
2066    }
2067}
2068
2069#[doc(hidden)]
2070impl google_cloud_gax::paginator::internal::PageableResponse for ListRevisionsResponse {
2071    type PageItem = crate::model::Revision;
2072
2073    fn items(self) -> std::vec::Vec<Self::PageItem> {
2074        self.revisions
2075    }
2076
2077    fn next_page_token(&self) -> std::string::String {
2078        use std::clone::Clone;
2079        self.next_page_token.clone()
2080    }
2081}
2082
2083/// A request to get a Revision from a 'GetRevision' call.
2084#[derive(Clone, Default, PartialEq)]
2085#[non_exhaustive]
2086pub struct GetRevisionRequest {
2087    /// Required. The name of the Revision in the format:
2088    /// 'projects/{project_id}/locations/{location}/deployments/{deployment}/revisions/{revision}'.
2089    pub name: std::string::String,
2090
2091    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2092}
2093
2094impl GetRevisionRequest {
2095    pub fn new() -> Self {
2096        std::default::Default::default()
2097    }
2098
2099    /// Sets the value of [name][crate::model::GetRevisionRequest::name].
2100    ///
2101    /// # Example
2102    /// ```ignore,no_run
2103    /// # use google_cloud_config_v1::model::GetRevisionRequest;
2104    /// let x = GetRevisionRequest::new().set_name("example");
2105    /// ```
2106    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2107        self.name = v.into();
2108        self
2109    }
2110}
2111
2112impl wkt::message::Message for GetRevisionRequest {
2113    fn typename() -> &'static str {
2114        "type.googleapis.com/google.cloud.config.v1.GetRevisionRequest"
2115    }
2116}
2117
2118#[derive(Clone, Default, PartialEq)]
2119#[non_exhaustive]
2120pub struct CreateDeploymentRequest {
2121    /// Required. The parent in whose context the Deployment is created. The parent
2122    /// value is in the format: 'projects/{project_id}/locations/{location}'.
2123    pub parent: std::string::String,
2124
2125    /// Required. The Deployment ID.
2126    pub deployment_id: std::string::String,
2127
2128    /// Required. [Deployment][google.cloud.config.v1.Deployment] resource to be
2129    /// created.
2130    ///
2131    /// [google.cloud.config.v1.Deployment]: crate::model::Deployment
2132    pub deployment: std::option::Option<crate::model::Deployment>,
2133
2134    /// Optional. An optional request ID to identify requests. Specify a unique
2135    /// request ID so that if you must retry your request, the server will know to
2136    /// ignore the request if it has already been completed. The server will
2137    /// guarantee that for at least 60 minutes since the first request.
2138    ///
2139    /// For example, consider a situation where you make an initial request and the
2140    /// request times out. If you make the request again with the same request ID,
2141    /// the server can check if original operation with the same request ID was
2142    /// received, and if so, will ignore the second request. This prevents clients
2143    /// from accidentally creating duplicate commitments.
2144    ///
2145    /// The request ID must be a valid UUID with the exception that zero UUID is
2146    /// not supported (00000000-0000-0000-0000-000000000000).
2147    pub request_id: std::string::String,
2148
2149    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2150}
2151
2152impl CreateDeploymentRequest {
2153    pub fn new() -> Self {
2154        std::default::Default::default()
2155    }
2156
2157    /// Sets the value of [parent][crate::model::CreateDeploymentRequest::parent].
2158    ///
2159    /// # Example
2160    /// ```ignore,no_run
2161    /// # use google_cloud_config_v1::model::CreateDeploymentRequest;
2162    /// let x = CreateDeploymentRequest::new().set_parent("example");
2163    /// ```
2164    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2165        self.parent = v.into();
2166        self
2167    }
2168
2169    /// Sets the value of [deployment_id][crate::model::CreateDeploymentRequest::deployment_id].
2170    ///
2171    /// # Example
2172    /// ```ignore,no_run
2173    /// # use google_cloud_config_v1::model::CreateDeploymentRequest;
2174    /// let x = CreateDeploymentRequest::new().set_deployment_id("example");
2175    /// ```
2176    pub fn set_deployment_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2177        self.deployment_id = v.into();
2178        self
2179    }
2180
2181    /// Sets the value of [deployment][crate::model::CreateDeploymentRequest::deployment].
2182    ///
2183    /// # Example
2184    /// ```ignore,no_run
2185    /// # use google_cloud_config_v1::model::CreateDeploymentRequest;
2186    /// use google_cloud_config_v1::model::Deployment;
2187    /// let x = CreateDeploymentRequest::new().set_deployment(Deployment::default()/* use setters */);
2188    /// ```
2189    pub fn set_deployment<T>(mut self, v: T) -> Self
2190    where
2191        T: std::convert::Into<crate::model::Deployment>,
2192    {
2193        self.deployment = std::option::Option::Some(v.into());
2194        self
2195    }
2196
2197    /// Sets or clears the value of [deployment][crate::model::CreateDeploymentRequest::deployment].
2198    ///
2199    /// # Example
2200    /// ```ignore,no_run
2201    /// # use google_cloud_config_v1::model::CreateDeploymentRequest;
2202    /// use google_cloud_config_v1::model::Deployment;
2203    /// let x = CreateDeploymentRequest::new().set_or_clear_deployment(Some(Deployment::default()/* use setters */));
2204    /// let x = CreateDeploymentRequest::new().set_or_clear_deployment(None::<Deployment>);
2205    /// ```
2206    pub fn set_or_clear_deployment<T>(mut self, v: std::option::Option<T>) -> Self
2207    where
2208        T: std::convert::Into<crate::model::Deployment>,
2209    {
2210        self.deployment = v.map(|x| x.into());
2211        self
2212    }
2213
2214    /// Sets the value of [request_id][crate::model::CreateDeploymentRequest::request_id].
2215    ///
2216    /// # Example
2217    /// ```ignore,no_run
2218    /// # use google_cloud_config_v1::model::CreateDeploymentRequest;
2219    /// let x = CreateDeploymentRequest::new().set_request_id("example");
2220    /// ```
2221    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2222        self.request_id = v.into();
2223        self
2224    }
2225}
2226
2227impl wkt::message::Message for CreateDeploymentRequest {
2228    fn typename() -> &'static str {
2229        "type.googleapis.com/google.cloud.config.v1.CreateDeploymentRequest"
2230    }
2231}
2232
2233#[derive(Clone, Default, PartialEq)]
2234#[non_exhaustive]
2235pub struct UpdateDeploymentRequest {
2236    /// Optional. Field mask used to specify the fields to be overwritten in the
2237    /// Deployment resource by the update.
2238    ///
2239    /// The fields specified in the update_mask are relative to the resource, not
2240    /// the full request. A field will be overwritten if it is in the mask. If the
2241    /// user does not provide a mask then all fields will be overwritten.
2242    pub update_mask: std::option::Option<wkt::FieldMask>,
2243
2244    /// Required. [Deployment][google.cloud.config.v1.Deployment] to update.
2245    ///
2246    /// The deployment's `name` field is used to identify the resource to be
2247    /// updated. Format:
2248    /// `projects/{project}/locations/{location}/deployments/{deployment}`
2249    ///
2250    /// [google.cloud.config.v1.Deployment]: crate::model::Deployment
2251    pub deployment: std::option::Option<crate::model::Deployment>,
2252
2253    /// Optional. An optional request ID to identify requests. Specify a unique
2254    /// request ID so that if you must retry your request, the server will know to
2255    /// ignore the request if it has already been completed. The server will
2256    /// guarantee that for at least 60 minutes since the first request.
2257    ///
2258    /// For example, consider a situation where you make an initial request and the
2259    /// request times out. If you make the request again with the same request ID,
2260    /// the server can check if original operation with the same request ID was
2261    /// received, and if so, will ignore the second request. This prevents clients
2262    /// from accidentally creating duplicate commitments.
2263    ///
2264    /// The request ID must be a valid UUID with the exception that zero UUID is
2265    /// not supported (00000000-0000-0000-0000-000000000000).
2266    pub request_id: std::string::String,
2267
2268    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2269}
2270
2271impl UpdateDeploymentRequest {
2272    pub fn new() -> Self {
2273        std::default::Default::default()
2274    }
2275
2276    /// Sets the value of [update_mask][crate::model::UpdateDeploymentRequest::update_mask].
2277    ///
2278    /// # Example
2279    /// ```ignore,no_run
2280    /// # use google_cloud_config_v1::model::UpdateDeploymentRequest;
2281    /// use wkt::FieldMask;
2282    /// let x = UpdateDeploymentRequest::new().set_update_mask(FieldMask::default()/* use setters */);
2283    /// ```
2284    pub fn set_update_mask<T>(mut self, v: T) -> Self
2285    where
2286        T: std::convert::Into<wkt::FieldMask>,
2287    {
2288        self.update_mask = std::option::Option::Some(v.into());
2289        self
2290    }
2291
2292    /// Sets or clears the value of [update_mask][crate::model::UpdateDeploymentRequest::update_mask].
2293    ///
2294    /// # Example
2295    /// ```ignore,no_run
2296    /// # use google_cloud_config_v1::model::UpdateDeploymentRequest;
2297    /// use wkt::FieldMask;
2298    /// let x = UpdateDeploymentRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
2299    /// let x = UpdateDeploymentRequest::new().set_or_clear_update_mask(None::<FieldMask>);
2300    /// ```
2301    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2302    where
2303        T: std::convert::Into<wkt::FieldMask>,
2304    {
2305        self.update_mask = v.map(|x| x.into());
2306        self
2307    }
2308
2309    /// Sets the value of [deployment][crate::model::UpdateDeploymentRequest::deployment].
2310    ///
2311    /// # Example
2312    /// ```ignore,no_run
2313    /// # use google_cloud_config_v1::model::UpdateDeploymentRequest;
2314    /// use google_cloud_config_v1::model::Deployment;
2315    /// let x = UpdateDeploymentRequest::new().set_deployment(Deployment::default()/* use setters */);
2316    /// ```
2317    pub fn set_deployment<T>(mut self, v: T) -> Self
2318    where
2319        T: std::convert::Into<crate::model::Deployment>,
2320    {
2321        self.deployment = std::option::Option::Some(v.into());
2322        self
2323    }
2324
2325    /// Sets or clears the value of [deployment][crate::model::UpdateDeploymentRequest::deployment].
2326    ///
2327    /// # Example
2328    /// ```ignore,no_run
2329    /// # use google_cloud_config_v1::model::UpdateDeploymentRequest;
2330    /// use google_cloud_config_v1::model::Deployment;
2331    /// let x = UpdateDeploymentRequest::new().set_or_clear_deployment(Some(Deployment::default()/* use setters */));
2332    /// let x = UpdateDeploymentRequest::new().set_or_clear_deployment(None::<Deployment>);
2333    /// ```
2334    pub fn set_or_clear_deployment<T>(mut self, v: std::option::Option<T>) -> Self
2335    where
2336        T: std::convert::Into<crate::model::Deployment>,
2337    {
2338        self.deployment = v.map(|x| x.into());
2339        self
2340    }
2341
2342    /// Sets the value of [request_id][crate::model::UpdateDeploymentRequest::request_id].
2343    ///
2344    /// # Example
2345    /// ```ignore,no_run
2346    /// # use google_cloud_config_v1::model::UpdateDeploymentRequest;
2347    /// let x = UpdateDeploymentRequest::new().set_request_id("example");
2348    /// ```
2349    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2350        self.request_id = v.into();
2351        self
2352    }
2353}
2354
2355impl wkt::message::Message for UpdateDeploymentRequest {
2356    fn typename() -> &'static str {
2357        "type.googleapis.com/google.cloud.config.v1.UpdateDeploymentRequest"
2358    }
2359}
2360
2361#[derive(Clone, Default, PartialEq)]
2362#[non_exhaustive]
2363pub struct DeleteDeploymentRequest {
2364    /// Required. The name of the Deployment in the format:
2365    /// 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
2366    pub name: std::string::String,
2367
2368    /// Optional. An optional request ID to identify requests. Specify a unique
2369    /// request ID so that if you must retry your request, the server will know to
2370    /// ignore the request if it has already been completed. The server will
2371    /// guarantee that for at least 60 minutes after the first request.
2372    ///
2373    /// For example, consider a situation where you make an initial request and the
2374    /// request times out. If you make the request again with the same request ID,
2375    /// the server can check if original operation with the same request ID was
2376    /// received, and if so, will ignore the second request. This prevents clients
2377    /// from accidentally creating duplicate commitments.
2378    ///
2379    /// The request ID must be a valid UUID with the exception that zero UUID is
2380    /// not supported (00000000-0000-0000-0000-000000000000).
2381    pub request_id: std::string::String,
2382
2383    /// Optional. If set to true, any revisions for this deployment will also be
2384    /// deleted. (Otherwise, the request will only work if the deployment has no
2385    /// revisions.)
2386    pub force: bool,
2387
2388    /// Optional. Policy on how resources actuated by the deployment should be
2389    /// deleted. If unspecified, the default behavior is to delete the underlying
2390    /// resources.
2391    pub delete_policy: crate::model::delete_deployment_request::DeletePolicy,
2392
2393    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2394}
2395
2396impl DeleteDeploymentRequest {
2397    pub fn new() -> Self {
2398        std::default::Default::default()
2399    }
2400
2401    /// Sets the value of [name][crate::model::DeleteDeploymentRequest::name].
2402    ///
2403    /// # Example
2404    /// ```ignore,no_run
2405    /// # use google_cloud_config_v1::model::DeleteDeploymentRequest;
2406    /// let x = DeleteDeploymentRequest::new().set_name("example");
2407    /// ```
2408    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2409        self.name = v.into();
2410        self
2411    }
2412
2413    /// Sets the value of [request_id][crate::model::DeleteDeploymentRequest::request_id].
2414    ///
2415    /// # Example
2416    /// ```ignore,no_run
2417    /// # use google_cloud_config_v1::model::DeleteDeploymentRequest;
2418    /// let x = DeleteDeploymentRequest::new().set_request_id("example");
2419    /// ```
2420    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2421        self.request_id = v.into();
2422        self
2423    }
2424
2425    /// Sets the value of [force][crate::model::DeleteDeploymentRequest::force].
2426    ///
2427    /// # Example
2428    /// ```ignore,no_run
2429    /// # use google_cloud_config_v1::model::DeleteDeploymentRequest;
2430    /// let x = DeleteDeploymentRequest::new().set_force(true);
2431    /// ```
2432    pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2433        self.force = v.into();
2434        self
2435    }
2436
2437    /// Sets the value of [delete_policy][crate::model::DeleteDeploymentRequest::delete_policy].
2438    ///
2439    /// # Example
2440    /// ```ignore,no_run
2441    /// # use google_cloud_config_v1::model::DeleteDeploymentRequest;
2442    /// use google_cloud_config_v1::model::delete_deployment_request::DeletePolicy;
2443    /// let x0 = DeleteDeploymentRequest::new().set_delete_policy(DeletePolicy::Delete);
2444    /// let x1 = DeleteDeploymentRequest::new().set_delete_policy(DeletePolicy::Abandon);
2445    /// ```
2446    pub fn set_delete_policy<
2447        T: std::convert::Into<crate::model::delete_deployment_request::DeletePolicy>,
2448    >(
2449        mut self,
2450        v: T,
2451    ) -> Self {
2452        self.delete_policy = v.into();
2453        self
2454    }
2455}
2456
2457impl wkt::message::Message for DeleteDeploymentRequest {
2458    fn typename() -> &'static str {
2459        "type.googleapis.com/google.cloud.config.v1.DeleteDeploymentRequest"
2460    }
2461}
2462
2463/// Defines additional types related to [DeleteDeploymentRequest].
2464pub mod delete_deployment_request {
2465    #[allow(unused_imports)]
2466    use super::*;
2467
2468    /// Policy on how resources actuated by the deployment should be deleted.
2469    ///
2470    /// # Working with unknown values
2471    ///
2472    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2473    /// additional enum variants at any time. Adding new variants is not considered
2474    /// a breaking change. Applications should write their code in anticipation of:
2475    ///
2476    /// - New values appearing in future releases of the client library, **and**
2477    /// - New values received dynamically, without application changes.
2478    ///
2479    /// Please consult the [Working with enums] section in the user guide for some
2480    /// guidelines.
2481    ///
2482    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
2483    #[derive(Clone, Debug, PartialEq)]
2484    #[non_exhaustive]
2485    pub enum DeletePolicy {
2486        /// Unspecified policy, resources will be deleted.
2487        Unspecified,
2488        /// Deletes resources actuated by the deployment.
2489        Delete,
2490        /// Abandons resources and only deletes the deployment and its metadata.
2491        Abandon,
2492        /// If set, the enum was initialized with an unknown value.
2493        ///
2494        /// Applications can examine the value using [DeletePolicy::value] or
2495        /// [DeletePolicy::name].
2496        UnknownValue(delete_policy::UnknownValue),
2497    }
2498
2499    #[doc(hidden)]
2500    pub mod delete_policy {
2501        #[allow(unused_imports)]
2502        use super::*;
2503        #[derive(Clone, Debug, PartialEq)]
2504        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2505    }
2506
2507    impl DeletePolicy {
2508        /// Gets the enum value.
2509        ///
2510        /// Returns `None` if the enum contains an unknown value deserialized from
2511        /// the string representation of enums.
2512        pub fn value(&self) -> std::option::Option<i32> {
2513            match self {
2514                Self::Unspecified => std::option::Option::Some(0),
2515                Self::Delete => std::option::Option::Some(1),
2516                Self::Abandon => std::option::Option::Some(2),
2517                Self::UnknownValue(u) => u.0.value(),
2518            }
2519        }
2520
2521        /// Gets the enum value as a string.
2522        ///
2523        /// Returns `None` if the enum contains an unknown value deserialized from
2524        /// the integer representation of enums.
2525        pub fn name(&self) -> std::option::Option<&str> {
2526            match self {
2527                Self::Unspecified => std::option::Option::Some("DELETE_POLICY_UNSPECIFIED"),
2528                Self::Delete => std::option::Option::Some("DELETE"),
2529                Self::Abandon => std::option::Option::Some("ABANDON"),
2530                Self::UnknownValue(u) => u.0.name(),
2531            }
2532        }
2533    }
2534
2535    impl std::default::Default for DeletePolicy {
2536        fn default() -> Self {
2537            use std::convert::From;
2538            Self::from(0)
2539        }
2540    }
2541
2542    impl std::fmt::Display for DeletePolicy {
2543        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2544            wkt::internal::display_enum(f, self.name(), self.value())
2545        }
2546    }
2547
2548    impl std::convert::From<i32> for DeletePolicy {
2549        fn from(value: i32) -> Self {
2550            match value {
2551                0 => Self::Unspecified,
2552                1 => Self::Delete,
2553                2 => Self::Abandon,
2554                _ => Self::UnknownValue(delete_policy::UnknownValue(
2555                    wkt::internal::UnknownEnumValue::Integer(value),
2556                )),
2557            }
2558        }
2559    }
2560
2561    impl std::convert::From<&str> for DeletePolicy {
2562        fn from(value: &str) -> Self {
2563            use std::string::ToString;
2564            match value {
2565                "DELETE_POLICY_UNSPECIFIED" => Self::Unspecified,
2566                "DELETE" => Self::Delete,
2567                "ABANDON" => Self::Abandon,
2568                _ => Self::UnknownValue(delete_policy::UnknownValue(
2569                    wkt::internal::UnknownEnumValue::String(value.to_string()),
2570                )),
2571            }
2572        }
2573    }
2574
2575    impl serde::ser::Serialize for DeletePolicy {
2576        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2577        where
2578            S: serde::Serializer,
2579        {
2580            match self {
2581                Self::Unspecified => serializer.serialize_i32(0),
2582                Self::Delete => serializer.serialize_i32(1),
2583                Self::Abandon => serializer.serialize_i32(2),
2584                Self::UnknownValue(u) => u.0.serialize(serializer),
2585            }
2586        }
2587    }
2588
2589    impl<'de> serde::de::Deserialize<'de> for DeletePolicy {
2590        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2591        where
2592            D: serde::Deserializer<'de>,
2593        {
2594            deserializer.deserialize_any(wkt::internal::EnumVisitor::<DeletePolicy>::new(
2595                ".google.cloud.config.v1.DeleteDeploymentRequest.DeletePolicy",
2596            ))
2597        }
2598    }
2599}
2600
2601/// Represents the metadata of the long-running operation.
2602#[derive(Clone, Default, PartialEq)]
2603#[non_exhaustive]
2604pub struct OperationMetadata {
2605    /// Output only. Time when the operation was created.
2606    pub create_time: std::option::Option<wkt::Timestamp>,
2607
2608    /// Output only. Time when the operation finished running.
2609    pub end_time: std::option::Option<wkt::Timestamp>,
2610
2611    /// Output only. Server-defined resource path for the target of the operation.
2612    pub target: std::string::String,
2613
2614    /// Output only. Name of the verb executed by the operation.
2615    pub verb: std::string::String,
2616
2617    /// Output only. Human-readable status of the operation, if any.
2618    pub status_message: std::string::String,
2619
2620    /// Output only. Identifies whether the user has requested cancellation of the
2621    /// operation. Operations that have successfully been cancelled have
2622    /// [google.longrunning.Operation.error][google.longrunning.Operation.error]
2623    /// value with a [google.rpc.Status.code][google.rpc.Status.code] of `1`,
2624    /// corresponding to `Code.CANCELLED`.
2625    ///
2626    /// [google.longrunning.Operation.error]: google_cloud_longrunning::model::Operation::result
2627    /// [google.rpc.Status.code]: google_cloud_rpc::model::Status::code
2628    pub requested_cancellation: bool,
2629
2630    /// Output only. API version used to start the operation.
2631    pub api_version: std::string::String,
2632
2633    /// Ephemeral metadata about the state of an operation for a particular
2634    /// resource.
2635    pub resource_metadata: std::option::Option<crate::model::operation_metadata::ResourceMetadata>,
2636
2637    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2638}
2639
2640impl OperationMetadata {
2641    pub fn new() -> Self {
2642        std::default::Default::default()
2643    }
2644
2645    /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
2646    ///
2647    /// # Example
2648    /// ```ignore,no_run
2649    /// # use google_cloud_config_v1::model::OperationMetadata;
2650    /// use wkt::Timestamp;
2651    /// let x = OperationMetadata::new().set_create_time(Timestamp::default()/* use setters */);
2652    /// ```
2653    pub fn set_create_time<T>(mut self, v: T) -> Self
2654    where
2655        T: std::convert::Into<wkt::Timestamp>,
2656    {
2657        self.create_time = std::option::Option::Some(v.into());
2658        self
2659    }
2660
2661    /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
2662    ///
2663    /// # Example
2664    /// ```ignore,no_run
2665    /// # use google_cloud_config_v1::model::OperationMetadata;
2666    /// use wkt::Timestamp;
2667    /// let x = OperationMetadata::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
2668    /// let x = OperationMetadata::new().set_or_clear_create_time(None::<Timestamp>);
2669    /// ```
2670    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
2671    where
2672        T: std::convert::Into<wkt::Timestamp>,
2673    {
2674        self.create_time = v.map(|x| x.into());
2675        self
2676    }
2677
2678    /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
2679    ///
2680    /// # Example
2681    /// ```ignore,no_run
2682    /// # use google_cloud_config_v1::model::OperationMetadata;
2683    /// use wkt::Timestamp;
2684    /// let x = OperationMetadata::new().set_end_time(Timestamp::default()/* use setters */);
2685    /// ```
2686    pub fn set_end_time<T>(mut self, v: T) -> Self
2687    where
2688        T: std::convert::Into<wkt::Timestamp>,
2689    {
2690        self.end_time = std::option::Option::Some(v.into());
2691        self
2692    }
2693
2694    /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
2695    ///
2696    /// # Example
2697    /// ```ignore,no_run
2698    /// # use google_cloud_config_v1::model::OperationMetadata;
2699    /// use wkt::Timestamp;
2700    /// let x = OperationMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
2701    /// let x = OperationMetadata::new().set_or_clear_end_time(None::<Timestamp>);
2702    /// ```
2703    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
2704    where
2705        T: std::convert::Into<wkt::Timestamp>,
2706    {
2707        self.end_time = v.map(|x| x.into());
2708        self
2709    }
2710
2711    /// Sets the value of [target][crate::model::OperationMetadata::target].
2712    ///
2713    /// # Example
2714    /// ```ignore,no_run
2715    /// # use google_cloud_config_v1::model::OperationMetadata;
2716    /// let x = OperationMetadata::new().set_target("example");
2717    /// ```
2718    pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2719        self.target = v.into();
2720        self
2721    }
2722
2723    /// Sets the value of [verb][crate::model::OperationMetadata::verb].
2724    ///
2725    /// # Example
2726    /// ```ignore,no_run
2727    /// # use google_cloud_config_v1::model::OperationMetadata;
2728    /// let x = OperationMetadata::new().set_verb("example");
2729    /// ```
2730    pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2731        self.verb = v.into();
2732        self
2733    }
2734
2735    /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
2736    ///
2737    /// # Example
2738    /// ```ignore,no_run
2739    /// # use google_cloud_config_v1::model::OperationMetadata;
2740    /// let x = OperationMetadata::new().set_status_message("example");
2741    /// ```
2742    pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2743        self.status_message = v.into();
2744        self
2745    }
2746
2747    /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
2748    ///
2749    /// # Example
2750    /// ```ignore,no_run
2751    /// # use google_cloud_config_v1::model::OperationMetadata;
2752    /// let x = OperationMetadata::new().set_requested_cancellation(true);
2753    /// ```
2754    pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2755        self.requested_cancellation = v.into();
2756        self
2757    }
2758
2759    /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
2760    ///
2761    /// # Example
2762    /// ```ignore,no_run
2763    /// # use google_cloud_config_v1::model::OperationMetadata;
2764    /// let x = OperationMetadata::new().set_api_version("example");
2765    /// ```
2766    pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2767        self.api_version = v.into();
2768        self
2769    }
2770
2771    /// Sets the value of [resource_metadata][crate::model::OperationMetadata::resource_metadata].
2772    ///
2773    /// Note that all the setters affecting `resource_metadata` are mutually
2774    /// exclusive.
2775    ///
2776    /// # Example
2777    /// ```ignore,no_run
2778    /// # use google_cloud_config_v1::model::OperationMetadata;
2779    /// use google_cloud_config_v1::model::DeploymentOperationMetadata;
2780    /// let x = OperationMetadata::new().set_resource_metadata(Some(
2781    ///     google_cloud_config_v1::model::operation_metadata::ResourceMetadata::DeploymentMetadata(DeploymentOperationMetadata::default().into())));
2782    /// ```
2783    pub fn set_resource_metadata<
2784        T: std::convert::Into<std::option::Option<crate::model::operation_metadata::ResourceMetadata>>,
2785    >(
2786        mut self,
2787        v: T,
2788    ) -> Self {
2789        self.resource_metadata = v.into();
2790        self
2791    }
2792
2793    /// The value of [resource_metadata][crate::model::OperationMetadata::resource_metadata]
2794    /// if it holds a `DeploymentMetadata`, `None` if the field is not set or
2795    /// holds a different branch.
2796    pub fn deployment_metadata(
2797        &self,
2798    ) -> std::option::Option<&std::boxed::Box<crate::model::DeploymentOperationMetadata>> {
2799        #[allow(unreachable_patterns)]
2800        self.resource_metadata.as_ref().and_then(|v| match v {
2801            crate::model::operation_metadata::ResourceMetadata::DeploymentMetadata(v) => {
2802                std::option::Option::Some(v)
2803            }
2804            _ => std::option::Option::None,
2805        })
2806    }
2807
2808    /// Sets the value of [resource_metadata][crate::model::OperationMetadata::resource_metadata]
2809    /// to hold a `DeploymentMetadata`.
2810    ///
2811    /// Note that all the setters affecting `resource_metadata` are
2812    /// mutually exclusive.
2813    ///
2814    /// # Example
2815    /// ```ignore,no_run
2816    /// # use google_cloud_config_v1::model::OperationMetadata;
2817    /// use google_cloud_config_v1::model::DeploymentOperationMetadata;
2818    /// let x = OperationMetadata::new().set_deployment_metadata(DeploymentOperationMetadata::default()/* use setters */);
2819    /// assert!(x.deployment_metadata().is_some());
2820    /// assert!(x.preview_metadata().is_none());
2821    /// ```
2822    pub fn set_deployment_metadata<
2823        T: std::convert::Into<std::boxed::Box<crate::model::DeploymentOperationMetadata>>,
2824    >(
2825        mut self,
2826        v: T,
2827    ) -> Self {
2828        self.resource_metadata = std::option::Option::Some(
2829            crate::model::operation_metadata::ResourceMetadata::DeploymentMetadata(v.into()),
2830        );
2831        self
2832    }
2833
2834    /// The value of [resource_metadata][crate::model::OperationMetadata::resource_metadata]
2835    /// if it holds a `PreviewMetadata`, `None` if the field is not set or
2836    /// holds a different branch.
2837    pub fn preview_metadata(
2838        &self,
2839    ) -> std::option::Option<&std::boxed::Box<crate::model::PreviewOperationMetadata>> {
2840        #[allow(unreachable_patterns)]
2841        self.resource_metadata.as_ref().and_then(|v| match v {
2842            crate::model::operation_metadata::ResourceMetadata::PreviewMetadata(v) => {
2843                std::option::Option::Some(v)
2844            }
2845            _ => std::option::Option::None,
2846        })
2847    }
2848
2849    /// Sets the value of [resource_metadata][crate::model::OperationMetadata::resource_metadata]
2850    /// to hold a `PreviewMetadata`.
2851    ///
2852    /// Note that all the setters affecting `resource_metadata` are
2853    /// mutually exclusive.
2854    ///
2855    /// # Example
2856    /// ```ignore,no_run
2857    /// # use google_cloud_config_v1::model::OperationMetadata;
2858    /// use google_cloud_config_v1::model::PreviewOperationMetadata;
2859    /// let x = OperationMetadata::new().set_preview_metadata(PreviewOperationMetadata::default()/* use setters */);
2860    /// assert!(x.preview_metadata().is_some());
2861    /// assert!(x.deployment_metadata().is_none());
2862    /// ```
2863    pub fn set_preview_metadata<
2864        T: std::convert::Into<std::boxed::Box<crate::model::PreviewOperationMetadata>>,
2865    >(
2866        mut self,
2867        v: T,
2868    ) -> Self {
2869        self.resource_metadata = std::option::Option::Some(
2870            crate::model::operation_metadata::ResourceMetadata::PreviewMetadata(v.into()),
2871        );
2872        self
2873    }
2874}
2875
2876impl wkt::message::Message for OperationMetadata {
2877    fn typename() -> &'static str {
2878        "type.googleapis.com/google.cloud.config.v1.OperationMetadata"
2879    }
2880}
2881
2882/// Defines additional types related to [OperationMetadata].
2883pub mod operation_metadata {
2884    #[allow(unused_imports)]
2885    use super::*;
2886
2887    /// Ephemeral metadata about the state of an operation for a particular
2888    /// resource.
2889    #[derive(Clone, Debug, PartialEq)]
2890    #[non_exhaustive]
2891    pub enum ResourceMetadata {
2892        /// Output only. Metadata about the deployment operation state.
2893        DeploymentMetadata(std::boxed::Box<crate::model::DeploymentOperationMetadata>),
2894        /// Output only. Metadata about the preview operation state.
2895        PreviewMetadata(std::boxed::Box<crate::model::PreviewOperationMetadata>),
2896    }
2897}
2898
2899/// A child resource of a Deployment generated by a 'CreateDeployment' or
2900/// 'UpdateDeployment' call. Each Revision contains metadata pertaining to a
2901/// snapshot of a particular Deployment.
2902#[derive(Clone, Default, PartialEq)]
2903#[non_exhaustive]
2904pub struct Revision {
2905    /// Revision name. Format:
2906    /// `projects/{project}/locations/{location}/deployments/{deployment}/
2907    /// revisions/{revision}`
2908    pub name: std::string::String,
2909
2910    /// Output only. Time when the revision was created.
2911    pub create_time: std::option::Option<wkt::Timestamp>,
2912
2913    /// Output only. Time when the revision was last modified.
2914    pub update_time: std::option::Option<wkt::Timestamp>,
2915
2916    /// Output only. The action which created this revision
2917    pub action: crate::model::revision::Action,
2918
2919    /// Output only. Current state of the revision.
2920    pub state: crate::model::revision::State,
2921
2922    /// Output only. Outputs and artifacts from applying a deployment.
2923    pub apply_results: std::option::Option<crate::model::ApplyResults>,
2924
2925    /// Output only. Additional info regarding the current state.
2926    pub state_detail: std::string::String,
2927
2928    /// Output only. Code describing any errors that may have occurred.
2929    pub error_code: crate::model::revision::ErrorCode,
2930
2931    /// Output only. Cloud Build instance UUID associated with this revision.
2932    pub build: std::string::String,
2933
2934    /// Output only. Location of Revision operation logs in
2935    /// `gs://{bucket}/{object}` format.
2936    pub logs: std::string::String,
2937
2938    /// Output only. Errors encountered when creating or updating this deployment.
2939    /// Errors are truncated to 10 entries, see `delete_results` and `error_logs`
2940    /// for full details.
2941    pub tf_errors: std::vec::Vec<crate::model::TerraformError>,
2942
2943    /// Output only. Location of Terraform error logs in Google Cloud Storage.
2944    /// Format: `gs://{bucket}/{object}`.
2945    pub error_logs: std::string::String,
2946
2947    /// Output only. User-specified Service Account (SA) to be used as credential
2948    /// to manage resources. Format:
2949    /// `projects/{projectID}/serviceAccounts/{serviceAccount}`
2950    pub service_account: std::string::String,
2951
2952    /// Output only. By default, Infra Manager will return a failure when
2953    /// Terraform encounters a 409 code (resource conflict error) during actuation.
2954    /// If this flag is set to true, Infra Manager will instead
2955    /// attempt to automatically import the resource into the Terraform state (for
2956    /// supported resource types) and continue actuation.
2957    ///
2958    /// Not all resource types are supported, refer to documentation.
2959    pub import_existing_resources: bool,
2960
2961    /// Output only. The user-specified Cloud Build worker pool resource in which
2962    /// the Cloud Build job will execute. Format:
2963    /// `projects/{project}/locations/{location}/workerPools/{workerPoolId}`.
2964    /// If this field is unspecified, the default Cloud Build worker pool will be
2965    /// used.
2966    pub worker_pool: std::string::String,
2967
2968    /// Output only. The user-specified Terraform version constraint.
2969    /// Example: "=1.3.10".
2970    pub tf_version_constraint: std::string::String,
2971
2972    /// Output only. The version of Terraform used to create the Revision.
2973    /// It is in the format of "Major.Minor.Patch", for example, "1.3.10".
2974    pub tf_version: std::string::String,
2975
2976    /// Output only. Cloud Storage path containing quota validation results. This
2977    /// field is set when a user sets Deployment.quota_validation field to ENABLED
2978    /// or ENFORCED. Format: `gs://{bucket}/{object}`.
2979    pub quota_validation_results: std::string::String,
2980
2981    /// Optional. Input to control quota checks for resources in terraform
2982    /// configuration files. There are limited resources on which quota validation
2983    /// applies.
2984    pub quota_validation: crate::model::QuotaValidation,
2985
2986    /// Output only. This field specifies the provider configurations.
2987    pub provider_config: std::option::Option<crate::model::ProviderConfig>,
2988
2989    /// Blueprint that was deployed.
2990    pub blueprint: std::option::Option<crate::model::revision::Blueprint>,
2991
2992    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2993}
2994
2995impl Revision {
2996    pub fn new() -> Self {
2997        std::default::Default::default()
2998    }
2999
3000    /// Sets the value of [name][crate::model::Revision::name].
3001    ///
3002    /// # Example
3003    /// ```ignore,no_run
3004    /// # use google_cloud_config_v1::model::Revision;
3005    /// let x = Revision::new().set_name("example");
3006    /// ```
3007    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3008        self.name = v.into();
3009        self
3010    }
3011
3012    /// Sets the value of [create_time][crate::model::Revision::create_time].
3013    ///
3014    /// # Example
3015    /// ```ignore,no_run
3016    /// # use google_cloud_config_v1::model::Revision;
3017    /// use wkt::Timestamp;
3018    /// let x = Revision::new().set_create_time(Timestamp::default()/* use setters */);
3019    /// ```
3020    pub fn set_create_time<T>(mut self, v: T) -> Self
3021    where
3022        T: std::convert::Into<wkt::Timestamp>,
3023    {
3024        self.create_time = std::option::Option::Some(v.into());
3025        self
3026    }
3027
3028    /// Sets or clears the value of [create_time][crate::model::Revision::create_time].
3029    ///
3030    /// # Example
3031    /// ```ignore,no_run
3032    /// # use google_cloud_config_v1::model::Revision;
3033    /// use wkt::Timestamp;
3034    /// let x = Revision::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
3035    /// let x = Revision::new().set_or_clear_create_time(None::<Timestamp>);
3036    /// ```
3037    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
3038    where
3039        T: std::convert::Into<wkt::Timestamp>,
3040    {
3041        self.create_time = v.map(|x| x.into());
3042        self
3043    }
3044
3045    /// Sets the value of [update_time][crate::model::Revision::update_time].
3046    ///
3047    /// # Example
3048    /// ```ignore,no_run
3049    /// # use google_cloud_config_v1::model::Revision;
3050    /// use wkt::Timestamp;
3051    /// let x = Revision::new().set_update_time(Timestamp::default()/* use setters */);
3052    /// ```
3053    pub fn set_update_time<T>(mut self, v: T) -> Self
3054    where
3055        T: std::convert::Into<wkt::Timestamp>,
3056    {
3057        self.update_time = std::option::Option::Some(v.into());
3058        self
3059    }
3060
3061    /// Sets or clears the value of [update_time][crate::model::Revision::update_time].
3062    ///
3063    /// # Example
3064    /// ```ignore,no_run
3065    /// # use google_cloud_config_v1::model::Revision;
3066    /// use wkt::Timestamp;
3067    /// let x = Revision::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
3068    /// let x = Revision::new().set_or_clear_update_time(None::<Timestamp>);
3069    /// ```
3070    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
3071    where
3072        T: std::convert::Into<wkt::Timestamp>,
3073    {
3074        self.update_time = v.map(|x| x.into());
3075        self
3076    }
3077
3078    /// Sets the value of [action][crate::model::Revision::action].
3079    ///
3080    /// # Example
3081    /// ```ignore,no_run
3082    /// # use google_cloud_config_v1::model::Revision;
3083    /// use google_cloud_config_v1::model::revision::Action;
3084    /// let x0 = Revision::new().set_action(Action::Create);
3085    /// let x1 = Revision::new().set_action(Action::Update);
3086    /// let x2 = Revision::new().set_action(Action::Delete);
3087    /// ```
3088    pub fn set_action<T: std::convert::Into<crate::model::revision::Action>>(
3089        mut self,
3090        v: T,
3091    ) -> Self {
3092        self.action = v.into();
3093        self
3094    }
3095
3096    /// Sets the value of [state][crate::model::Revision::state].
3097    ///
3098    /// # Example
3099    /// ```ignore,no_run
3100    /// # use google_cloud_config_v1::model::Revision;
3101    /// use google_cloud_config_v1::model::revision::State;
3102    /// let x0 = Revision::new().set_state(State::Applying);
3103    /// let x1 = Revision::new().set_state(State::Applied);
3104    /// let x2 = Revision::new().set_state(State::Failed);
3105    /// ```
3106    pub fn set_state<T: std::convert::Into<crate::model::revision::State>>(mut self, v: T) -> Self {
3107        self.state = v.into();
3108        self
3109    }
3110
3111    /// Sets the value of [apply_results][crate::model::Revision::apply_results].
3112    ///
3113    /// # Example
3114    /// ```ignore,no_run
3115    /// # use google_cloud_config_v1::model::Revision;
3116    /// use google_cloud_config_v1::model::ApplyResults;
3117    /// let x = Revision::new().set_apply_results(ApplyResults::default()/* use setters */);
3118    /// ```
3119    pub fn set_apply_results<T>(mut self, v: T) -> Self
3120    where
3121        T: std::convert::Into<crate::model::ApplyResults>,
3122    {
3123        self.apply_results = std::option::Option::Some(v.into());
3124        self
3125    }
3126
3127    /// Sets or clears the value of [apply_results][crate::model::Revision::apply_results].
3128    ///
3129    /// # Example
3130    /// ```ignore,no_run
3131    /// # use google_cloud_config_v1::model::Revision;
3132    /// use google_cloud_config_v1::model::ApplyResults;
3133    /// let x = Revision::new().set_or_clear_apply_results(Some(ApplyResults::default()/* use setters */));
3134    /// let x = Revision::new().set_or_clear_apply_results(None::<ApplyResults>);
3135    /// ```
3136    pub fn set_or_clear_apply_results<T>(mut self, v: std::option::Option<T>) -> Self
3137    where
3138        T: std::convert::Into<crate::model::ApplyResults>,
3139    {
3140        self.apply_results = v.map(|x| x.into());
3141        self
3142    }
3143
3144    /// Sets the value of [state_detail][crate::model::Revision::state_detail].
3145    ///
3146    /// # Example
3147    /// ```ignore,no_run
3148    /// # use google_cloud_config_v1::model::Revision;
3149    /// let x = Revision::new().set_state_detail("example");
3150    /// ```
3151    pub fn set_state_detail<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3152        self.state_detail = v.into();
3153        self
3154    }
3155
3156    /// Sets the value of [error_code][crate::model::Revision::error_code].
3157    ///
3158    /// # Example
3159    /// ```ignore,no_run
3160    /// # use google_cloud_config_v1::model::Revision;
3161    /// use google_cloud_config_v1::model::revision::ErrorCode;
3162    /// let x0 = Revision::new().set_error_code(ErrorCode::CloudBuildPermissionDenied);
3163    /// let x1 = Revision::new().set_error_code(ErrorCode::ApplyBuildApiFailed);
3164    /// let x2 = Revision::new().set_error_code(ErrorCode::ApplyBuildRunFailed);
3165    /// ```
3166    pub fn set_error_code<T: std::convert::Into<crate::model::revision::ErrorCode>>(
3167        mut self,
3168        v: T,
3169    ) -> Self {
3170        self.error_code = v.into();
3171        self
3172    }
3173
3174    /// Sets the value of [build][crate::model::Revision::build].
3175    ///
3176    /// # Example
3177    /// ```ignore,no_run
3178    /// # use google_cloud_config_v1::model::Revision;
3179    /// let x = Revision::new().set_build("example");
3180    /// ```
3181    pub fn set_build<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3182        self.build = v.into();
3183        self
3184    }
3185
3186    /// Sets the value of [logs][crate::model::Revision::logs].
3187    ///
3188    /// # Example
3189    /// ```ignore,no_run
3190    /// # use google_cloud_config_v1::model::Revision;
3191    /// let x = Revision::new().set_logs("example");
3192    /// ```
3193    pub fn set_logs<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3194        self.logs = v.into();
3195        self
3196    }
3197
3198    /// Sets the value of [tf_errors][crate::model::Revision::tf_errors].
3199    ///
3200    /// # Example
3201    /// ```ignore,no_run
3202    /// # use google_cloud_config_v1::model::Revision;
3203    /// use google_cloud_config_v1::model::TerraformError;
3204    /// let x = Revision::new()
3205    ///     .set_tf_errors([
3206    ///         TerraformError::default()/* use setters */,
3207    ///         TerraformError::default()/* use (different) setters */,
3208    ///     ]);
3209    /// ```
3210    pub fn set_tf_errors<T, V>(mut self, v: T) -> Self
3211    where
3212        T: std::iter::IntoIterator<Item = V>,
3213        V: std::convert::Into<crate::model::TerraformError>,
3214    {
3215        use std::iter::Iterator;
3216        self.tf_errors = v.into_iter().map(|i| i.into()).collect();
3217        self
3218    }
3219
3220    /// Sets the value of [error_logs][crate::model::Revision::error_logs].
3221    ///
3222    /// # Example
3223    /// ```ignore,no_run
3224    /// # use google_cloud_config_v1::model::Revision;
3225    /// let x = Revision::new().set_error_logs("example");
3226    /// ```
3227    pub fn set_error_logs<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3228        self.error_logs = v.into();
3229        self
3230    }
3231
3232    /// Sets the value of [service_account][crate::model::Revision::service_account].
3233    ///
3234    /// # Example
3235    /// ```ignore,no_run
3236    /// # use google_cloud_config_v1::model::Revision;
3237    /// let x = Revision::new().set_service_account("example");
3238    /// ```
3239    pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3240        self.service_account = v.into();
3241        self
3242    }
3243
3244    /// Sets the value of [import_existing_resources][crate::model::Revision::import_existing_resources].
3245    ///
3246    /// # Example
3247    /// ```ignore,no_run
3248    /// # use google_cloud_config_v1::model::Revision;
3249    /// let x = Revision::new().set_import_existing_resources(true);
3250    /// ```
3251    pub fn set_import_existing_resources<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3252        self.import_existing_resources = v.into();
3253        self
3254    }
3255
3256    /// Sets the value of [worker_pool][crate::model::Revision::worker_pool].
3257    ///
3258    /// # Example
3259    /// ```ignore,no_run
3260    /// # use google_cloud_config_v1::model::Revision;
3261    /// let x = Revision::new().set_worker_pool("example");
3262    /// ```
3263    pub fn set_worker_pool<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3264        self.worker_pool = v.into();
3265        self
3266    }
3267
3268    /// Sets the value of [tf_version_constraint][crate::model::Revision::tf_version_constraint].
3269    ///
3270    /// # Example
3271    /// ```ignore,no_run
3272    /// # use google_cloud_config_v1::model::Revision;
3273    /// let x = Revision::new().set_tf_version_constraint("example");
3274    /// ```
3275    pub fn set_tf_version_constraint<T: std::convert::Into<std::string::String>>(
3276        mut self,
3277        v: T,
3278    ) -> Self {
3279        self.tf_version_constraint = v.into();
3280        self
3281    }
3282
3283    /// Sets the value of [tf_version][crate::model::Revision::tf_version].
3284    ///
3285    /// # Example
3286    /// ```ignore,no_run
3287    /// # use google_cloud_config_v1::model::Revision;
3288    /// let x = Revision::new().set_tf_version("example");
3289    /// ```
3290    pub fn set_tf_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3291        self.tf_version = v.into();
3292        self
3293    }
3294
3295    /// Sets the value of [quota_validation_results][crate::model::Revision::quota_validation_results].
3296    ///
3297    /// # Example
3298    /// ```ignore,no_run
3299    /// # use google_cloud_config_v1::model::Revision;
3300    /// let x = Revision::new().set_quota_validation_results("example");
3301    /// ```
3302    pub fn set_quota_validation_results<T: std::convert::Into<std::string::String>>(
3303        mut self,
3304        v: T,
3305    ) -> Self {
3306        self.quota_validation_results = v.into();
3307        self
3308    }
3309
3310    /// Sets the value of [quota_validation][crate::model::Revision::quota_validation].
3311    ///
3312    /// # Example
3313    /// ```ignore,no_run
3314    /// # use google_cloud_config_v1::model::Revision;
3315    /// use google_cloud_config_v1::model::QuotaValidation;
3316    /// let x0 = Revision::new().set_quota_validation(QuotaValidation::Enabled);
3317    /// let x1 = Revision::new().set_quota_validation(QuotaValidation::Enforced);
3318    /// ```
3319    pub fn set_quota_validation<T: std::convert::Into<crate::model::QuotaValidation>>(
3320        mut self,
3321        v: T,
3322    ) -> Self {
3323        self.quota_validation = v.into();
3324        self
3325    }
3326
3327    /// Sets the value of [provider_config][crate::model::Revision::provider_config].
3328    ///
3329    /// # Example
3330    /// ```ignore,no_run
3331    /// # use google_cloud_config_v1::model::Revision;
3332    /// use google_cloud_config_v1::model::ProviderConfig;
3333    /// let x = Revision::new().set_provider_config(ProviderConfig::default()/* use setters */);
3334    /// ```
3335    pub fn set_provider_config<T>(mut self, v: T) -> Self
3336    where
3337        T: std::convert::Into<crate::model::ProviderConfig>,
3338    {
3339        self.provider_config = std::option::Option::Some(v.into());
3340        self
3341    }
3342
3343    /// Sets or clears the value of [provider_config][crate::model::Revision::provider_config].
3344    ///
3345    /// # Example
3346    /// ```ignore,no_run
3347    /// # use google_cloud_config_v1::model::Revision;
3348    /// use google_cloud_config_v1::model::ProviderConfig;
3349    /// let x = Revision::new().set_or_clear_provider_config(Some(ProviderConfig::default()/* use setters */));
3350    /// let x = Revision::new().set_or_clear_provider_config(None::<ProviderConfig>);
3351    /// ```
3352    pub fn set_or_clear_provider_config<T>(mut self, v: std::option::Option<T>) -> Self
3353    where
3354        T: std::convert::Into<crate::model::ProviderConfig>,
3355    {
3356        self.provider_config = v.map(|x| x.into());
3357        self
3358    }
3359
3360    /// Sets the value of [blueprint][crate::model::Revision::blueprint].
3361    ///
3362    /// Note that all the setters affecting `blueprint` are mutually
3363    /// exclusive.
3364    ///
3365    /// # Example
3366    /// ```ignore,no_run
3367    /// # use google_cloud_config_v1::model::Revision;
3368    /// use google_cloud_config_v1::model::TerraformBlueprint;
3369    /// let x = Revision::new().set_blueprint(Some(
3370    ///     google_cloud_config_v1::model::revision::Blueprint::TerraformBlueprint(TerraformBlueprint::default().into())));
3371    /// ```
3372    pub fn set_blueprint<
3373        T: std::convert::Into<std::option::Option<crate::model::revision::Blueprint>>,
3374    >(
3375        mut self,
3376        v: T,
3377    ) -> Self {
3378        self.blueprint = v.into();
3379        self
3380    }
3381
3382    /// The value of [blueprint][crate::model::Revision::blueprint]
3383    /// if it holds a `TerraformBlueprint`, `None` if the field is not set or
3384    /// holds a different branch.
3385    pub fn terraform_blueprint(
3386        &self,
3387    ) -> std::option::Option<&std::boxed::Box<crate::model::TerraformBlueprint>> {
3388        #[allow(unreachable_patterns)]
3389        self.blueprint.as_ref().and_then(|v| match v {
3390            crate::model::revision::Blueprint::TerraformBlueprint(v) => {
3391                std::option::Option::Some(v)
3392            }
3393            _ => std::option::Option::None,
3394        })
3395    }
3396
3397    /// Sets the value of [blueprint][crate::model::Revision::blueprint]
3398    /// to hold a `TerraformBlueprint`.
3399    ///
3400    /// Note that all the setters affecting `blueprint` are
3401    /// mutually exclusive.
3402    ///
3403    /// # Example
3404    /// ```ignore,no_run
3405    /// # use google_cloud_config_v1::model::Revision;
3406    /// use google_cloud_config_v1::model::TerraformBlueprint;
3407    /// let x = Revision::new().set_terraform_blueprint(TerraformBlueprint::default()/* use setters */);
3408    /// assert!(x.terraform_blueprint().is_some());
3409    /// ```
3410    pub fn set_terraform_blueprint<
3411        T: std::convert::Into<std::boxed::Box<crate::model::TerraformBlueprint>>,
3412    >(
3413        mut self,
3414        v: T,
3415    ) -> Self {
3416        self.blueprint = std::option::Option::Some(
3417            crate::model::revision::Blueprint::TerraformBlueprint(v.into()),
3418        );
3419        self
3420    }
3421}
3422
3423impl wkt::message::Message for Revision {
3424    fn typename() -> &'static str {
3425        "type.googleapis.com/google.cloud.config.v1.Revision"
3426    }
3427}
3428
3429/// Defines additional types related to [Revision].
3430pub mod revision {
3431    #[allow(unused_imports)]
3432    use super::*;
3433
3434    /// Actions that generate a revision.
3435    ///
3436    /// # Working with unknown values
3437    ///
3438    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3439    /// additional enum variants at any time. Adding new variants is not considered
3440    /// a breaking change. Applications should write their code in anticipation of:
3441    ///
3442    /// - New values appearing in future releases of the client library, **and**
3443    /// - New values received dynamically, without application changes.
3444    ///
3445    /// Please consult the [Working with enums] section in the user guide for some
3446    /// guidelines.
3447    ///
3448    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
3449    #[derive(Clone, Debug, PartialEq)]
3450    #[non_exhaustive]
3451    pub enum Action {
3452        /// The default value. This value is used if the action is omitted.
3453        Unspecified,
3454        /// The revision was generated by creating a deployment.
3455        Create,
3456        /// The revision was generated by updating a deployment.
3457        Update,
3458        /// The revision was deleted.
3459        Delete,
3460        /// If set, the enum was initialized with an unknown value.
3461        ///
3462        /// Applications can examine the value using [Action::value] or
3463        /// [Action::name].
3464        UnknownValue(action::UnknownValue),
3465    }
3466
3467    #[doc(hidden)]
3468    pub mod action {
3469        #[allow(unused_imports)]
3470        use super::*;
3471        #[derive(Clone, Debug, PartialEq)]
3472        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3473    }
3474
3475    impl Action {
3476        /// Gets the enum value.
3477        ///
3478        /// Returns `None` if the enum contains an unknown value deserialized from
3479        /// the string representation of enums.
3480        pub fn value(&self) -> std::option::Option<i32> {
3481            match self {
3482                Self::Unspecified => std::option::Option::Some(0),
3483                Self::Create => std::option::Option::Some(1),
3484                Self::Update => std::option::Option::Some(2),
3485                Self::Delete => std::option::Option::Some(3),
3486                Self::UnknownValue(u) => u.0.value(),
3487            }
3488        }
3489
3490        /// Gets the enum value as a string.
3491        ///
3492        /// Returns `None` if the enum contains an unknown value deserialized from
3493        /// the integer representation of enums.
3494        pub fn name(&self) -> std::option::Option<&str> {
3495            match self {
3496                Self::Unspecified => std::option::Option::Some("ACTION_UNSPECIFIED"),
3497                Self::Create => std::option::Option::Some("CREATE"),
3498                Self::Update => std::option::Option::Some("UPDATE"),
3499                Self::Delete => std::option::Option::Some("DELETE"),
3500                Self::UnknownValue(u) => u.0.name(),
3501            }
3502        }
3503    }
3504
3505    impl std::default::Default for Action {
3506        fn default() -> Self {
3507            use std::convert::From;
3508            Self::from(0)
3509        }
3510    }
3511
3512    impl std::fmt::Display for Action {
3513        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3514            wkt::internal::display_enum(f, self.name(), self.value())
3515        }
3516    }
3517
3518    impl std::convert::From<i32> for Action {
3519        fn from(value: i32) -> Self {
3520            match value {
3521                0 => Self::Unspecified,
3522                1 => Self::Create,
3523                2 => Self::Update,
3524                3 => Self::Delete,
3525                _ => Self::UnknownValue(action::UnknownValue(
3526                    wkt::internal::UnknownEnumValue::Integer(value),
3527                )),
3528            }
3529        }
3530    }
3531
3532    impl std::convert::From<&str> for Action {
3533        fn from(value: &str) -> Self {
3534            use std::string::ToString;
3535            match value {
3536                "ACTION_UNSPECIFIED" => Self::Unspecified,
3537                "CREATE" => Self::Create,
3538                "UPDATE" => Self::Update,
3539                "DELETE" => Self::Delete,
3540                _ => Self::UnknownValue(action::UnknownValue(
3541                    wkt::internal::UnknownEnumValue::String(value.to_string()),
3542                )),
3543            }
3544        }
3545    }
3546
3547    impl serde::ser::Serialize for Action {
3548        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3549        where
3550            S: serde::Serializer,
3551        {
3552            match self {
3553                Self::Unspecified => serializer.serialize_i32(0),
3554                Self::Create => serializer.serialize_i32(1),
3555                Self::Update => serializer.serialize_i32(2),
3556                Self::Delete => serializer.serialize_i32(3),
3557                Self::UnknownValue(u) => u.0.serialize(serializer),
3558            }
3559        }
3560    }
3561
3562    impl<'de> serde::de::Deserialize<'de> for Action {
3563        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3564        where
3565            D: serde::Deserializer<'de>,
3566        {
3567            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Action>::new(
3568                ".google.cloud.config.v1.Revision.Action",
3569            ))
3570        }
3571    }
3572
3573    /// Possible states of a revision.
3574    ///
3575    /// # Working with unknown values
3576    ///
3577    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3578    /// additional enum variants at any time. Adding new variants is not considered
3579    /// a breaking change. Applications should write their code in anticipation of:
3580    ///
3581    /// - New values appearing in future releases of the client library, **and**
3582    /// - New values received dynamically, without application changes.
3583    ///
3584    /// Please consult the [Working with enums] section in the user guide for some
3585    /// guidelines.
3586    ///
3587    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
3588    #[derive(Clone, Debug, PartialEq)]
3589    #[non_exhaustive]
3590    pub enum State {
3591        /// The default value. This value is used if the state is omitted.
3592        Unspecified,
3593        /// The revision is being applied.
3594        Applying,
3595        /// The revision was applied successfully.
3596        Applied,
3597        /// The revision could not be applied successfully.
3598        Failed,
3599        /// If set, the enum was initialized with an unknown value.
3600        ///
3601        /// Applications can examine the value using [State::value] or
3602        /// [State::name].
3603        UnknownValue(state::UnknownValue),
3604    }
3605
3606    #[doc(hidden)]
3607    pub mod state {
3608        #[allow(unused_imports)]
3609        use super::*;
3610        #[derive(Clone, Debug, PartialEq)]
3611        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3612    }
3613
3614    impl State {
3615        /// Gets the enum value.
3616        ///
3617        /// Returns `None` if the enum contains an unknown value deserialized from
3618        /// the string representation of enums.
3619        pub fn value(&self) -> std::option::Option<i32> {
3620            match self {
3621                Self::Unspecified => std::option::Option::Some(0),
3622                Self::Applying => std::option::Option::Some(1),
3623                Self::Applied => std::option::Option::Some(2),
3624                Self::Failed => std::option::Option::Some(3),
3625                Self::UnknownValue(u) => u.0.value(),
3626            }
3627        }
3628
3629        /// Gets the enum value as a string.
3630        ///
3631        /// Returns `None` if the enum contains an unknown value deserialized from
3632        /// the integer representation of enums.
3633        pub fn name(&self) -> std::option::Option<&str> {
3634            match self {
3635                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
3636                Self::Applying => std::option::Option::Some("APPLYING"),
3637                Self::Applied => std::option::Option::Some("APPLIED"),
3638                Self::Failed => std::option::Option::Some("FAILED"),
3639                Self::UnknownValue(u) => u.0.name(),
3640            }
3641        }
3642    }
3643
3644    impl std::default::Default for State {
3645        fn default() -> Self {
3646            use std::convert::From;
3647            Self::from(0)
3648        }
3649    }
3650
3651    impl std::fmt::Display for State {
3652        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3653            wkt::internal::display_enum(f, self.name(), self.value())
3654        }
3655    }
3656
3657    impl std::convert::From<i32> for State {
3658        fn from(value: i32) -> Self {
3659            match value {
3660                0 => Self::Unspecified,
3661                1 => Self::Applying,
3662                2 => Self::Applied,
3663                3 => Self::Failed,
3664                _ => Self::UnknownValue(state::UnknownValue(
3665                    wkt::internal::UnknownEnumValue::Integer(value),
3666                )),
3667            }
3668        }
3669    }
3670
3671    impl std::convert::From<&str> for State {
3672        fn from(value: &str) -> Self {
3673            use std::string::ToString;
3674            match value {
3675                "STATE_UNSPECIFIED" => Self::Unspecified,
3676                "APPLYING" => Self::Applying,
3677                "APPLIED" => Self::Applied,
3678                "FAILED" => Self::Failed,
3679                _ => Self::UnknownValue(state::UnknownValue(
3680                    wkt::internal::UnknownEnumValue::String(value.to_string()),
3681                )),
3682            }
3683        }
3684    }
3685
3686    impl serde::ser::Serialize for State {
3687        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3688        where
3689            S: serde::Serializer,
3690        {
3691            match self {
3692                Self::Unspecified => serializer.serialize_i32(0),
3693                Self::Applying => serializer.serialize_i32(1),
3694                Self::Applied => serializer.serialize_i32(2),
3695                Self::Failed => serializer.serialize_i32(3),
3696                Self::UnknownValue(u) => u.0.serialize(serializer),
3697            }
3698        }
3699    }
3700
3701    impl<'de> serde::de::Deserialize<'de> for State {
3702        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3703        where
3704            D: serde::Deserializer<'de>,
3705        {
3706            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
3707                ".google.cloud.config.v1.Revision.State",
3708            ))
3709        }
3710    }
3711
3712    /// Possible errors if Revision could not be created or updated successfully.
3713    ///
3714    /// # Working with unknown values
3715    ///
3716    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3717    /// additional enum variants at any time. Adding new variants is not considered
3718    /// a breaking change. Applications should write their code in anticipation of:
3719    ///
3720    /// - New values appearing in future releases of the client library, **and**
3721    /// - New values received dynamically, without application changes.
3722    ///
3723    /// Please consult the [Working with enums] section in the user guide for some
3724    /// guidelines.
3725    ///
3726    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
3727    #[derive(Clone, Debug, PartialEq)]
3728    #[non_exhaustive]
3729    pub enum ErrorCode {
3730        /// No error code was specified.
3731        Unspecified,
3732        /// Cloud Build failed due to a permission issue.
3733        CloudBuildPermissionDenied,
3734        /// Cloud Build job associated with creating or updating a deployment could
3735        /// not be started.
3736        ApplyBuildApiFailed,
3737        /// Cloud Build job associated with creating or updating a deployment was
3738        /// started but failed.
3739        ApplyBuildRunFailed,
3740        /// quota validation failed for one or more resources in terraform
3741        /// configuration files.
3742        QuotaValidationFailed,
3743        /// Failed to import values from an external source.
3744        ExternalValueSourceImportFailed,
3745        /// If set, the enum was initialized with an unknown value.
3746        ///
3747        /// Applications can examine the value using [ErrorCode::value] or
3748        /// [ErrorCode::name].
3749        UnknownValue(error_code::UnknownValue),
3750    }
3751
3752    #[doc(hidden)]
3753    pub mod error_code {
3754        #[allow(unused_imports)]
3755        use super::*;
3756        #[derive(Clone, Debug, PartialEq)]
3757        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3758    }
3759
3760    impl ErrorCode {
3761        /// Gets the enum value.
3762        ///
3763        /// Returns `None` if the enum contains an unknown value deserialized from
3764        /// the string representation of enums.
3765        pub fn value(&self) -> std::option::Option<i32> {
3766            match self {
3767                Self::Unspecified => std::option::Option::Some(0),
3768                Self::CloudBuildPermissionDenied => std::option::Option::Some(1),
3769                Self::ApplyBuildApiFailed => std::option::Option::Some(4),
3770                Self::ApplyBuildRunFailed => std::option::Option::Some(5),
3771                Self::QuotaValidationFailed => std::option::Option::Some(7),
3772                Self::ExternalValueSourceImportFailed => std::option::Option::Some(8),
3773                Self::UnknownValue(u) => u.0.value(),
3774            }
3775        }
3776
3777        /// Gets the enum value as a string.
3778        ///
3779        /// Returns `None` if the enum contains an unknown value deserialized from
3780        /// the integer representation of enums.
3781        pub fn name(&self) -> std::option::Option<&str> {
3782            match self {
3783                Self::Unspecified => std::option::Option::Some("ERROR_CODE_UNSPECIFIED"),
3784                Self::CloudBuildPermissionDenied => {
3785                    std::option::Option::Some("CLOUD_BUILD_PERMISSION_DENIED")
3786                }
3787                Self::ApplyBuildApiFailed => std::option::Option::Some("APPLY_BUILD_API_FAILED"),
3788                Self::ApplyBuildRunFailed => std::option::Option::Some("APPLY_BUILD_RUN_FAILED"),
3789                Self::QuotaValidationFailed => std::option::Option::Some("QUOTA_VALIDATION_FAILED"),
3790                Self::ExternalValueSourceImportFailed => {
3791                    std::option::Option::Some("EXTERNAL_VALUE_SOURCE_IMPORT_FAILED")
3792                }
3793                Self::UnknownValue(u) => u.0.name(),
3794            }
3795        }
3796    }
3797
3798    impl std::default::Default for ErrorCode {
3799        fn default() -> Self {
3800            use std::convert::From;
3801            Self::from(0)
3802        }
3803    }
3804
3805    impl std::fmt::Display for ErrorCode {
3806        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3807            wkt::internal::display_enum(f, self.name(), self.value())
3808        }
3809    }
3810
3811    impl std::convert::From<i32> for ErrorCode {
3812        fn from(value: i32) -> Self {
3813            match value {
3814                0 => Self::Unspecified,
3815                1 => Self::CloudBuildPermissionDenied,
3816                4 => Self::ApplyBuildApiFailed,
3817                5 => Self::ApplyBuildRunFailed,
3818                7 => Self::QuotaValidationFailed,
3819                8 => Self::ExternalValueSourceImportFailed,
3820                _ => Self::UnknownValue(error_code::UnknownValue(
3821                    wkt::internal::UnknownEnumValue::Integer(value),
3822                )),
3823            }
3824        }
3825    }
3826
3827    impl std::convert::From<&str> for ErrorCode {
3828        fn from(value: &str) -> Self {
3829            use std::string::ToString;
3830            match value {
3831                "ERROR_CODE_UNSPECIFIED" => Self::Unspecified,
3832                "CLOUD_BUILD_PERMISSION_DENIED" => Self::CloudBuildPermissionDenied,
3833                "APPLY_BUILD_API_FAILED" => Self::ApplyBuildApiFailed,
3834                "APPLY_BUILD_RUN_FAILED" => Self::ApplyBuildRunFailed,
3835                "QUOTA_VALIDATION_FAILED" => Self::QuotaValidationFailed,
3836                "EXTERNAL_VALUE_SOURCE_IMPORT_FAILED" => Self::ExternalValueSourceImportFailed,
3837                _ => Self::UnknownValue(error_code::UnknownValue(
3838                    wkt::internal::UnknownEnumValue::String(value.to_string()),
3839                )),
3840            }
3841        }
3842    }
3843
3844    impl serde::ser::Serialize for ErrorCode {
3845        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3846        where
3847            S: serde::Serializer,
3848        {
3849            match self {
3850                Self::Unspecified => serializer.serialize_i32(0),
3851                Self::CloudBuildPermissionDenied => serializer.serialize_i32(1),
3852                Self::ApplyBuildApiFailed => serializer.serialize_i32(4),
3853                Self::ApplyBuildRunFailed => serializer.serialize_i32(5),
3854                Self::QuotaValidationFailed => serializer.serialize_i32(7),
3855                Self::ExternalValueSourceImportFailed => serializer.serialize_i32(8),
3856                Self::UnknownValue(u) => u.0.serialize(serializer),
3857            }
3858        }
3859    }
3860
3861    impl<'de> serde::de::Deserialize<'de> for ErrorCode {
3862        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3863        where
3864            D: serde::Deserializer<'de>,
3865        {
3866            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ErrorCode>::new(
3867                ".google.cloud.config.v1.Revision.ErrorCode",
3868            ))
3869        }
3870    }
3871
3872    /// Blueprint that was deployed.
3873    #[derive(Clone, Debug, PartialEq)]
3874    #[non_exhaustive]
3875    pub enum Blueprint {
3876        /// Output only. A blueprint described using Terraform's HashiCorp
3877        /// Configuration Language as a root module.
3878        TerraformBlueprint(std::boxed::Box<crate::model::TerraformBlueprint>),
3879    }
3880}
3881
3882/// Errors encountered during actuation using Terraform
3883#[derive(Clone, Default, PartialEq)]
3884#[non_exhaustive]
3885pub struct TerraformError {
3886    /// Address of the resource associated with the error,
3887    /// e.g. `google_compute_network.vpc_network`.
3888    pub resource_address: std::string::String,
3889
3890    /// HTTP response code returned from Google Cloud Platform APIs when Terraform
3891    /// fails to provision the resource. If unset or 0, no HTTP response code was
3892    /// returned by Terraform.
3893    pub http_response_code: i32,
3894
3895    /// A human-readable error description.
3896    pub error_description: std::string::String,
3897
3898    /// Output only. Original error response from underlying Google API, if
3899    /// available.
3900    pub error: std::option::Option<google_cloud_rpc::model::Status>,
3901
3902    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3903}
3904
3905impl TerraformError {
3906    pub fn new() -> Self {
3907        std::default::Default::default()
3908    }
3909
3910    /// Sets the value of [resource_address][crate::model::TerraformError::resource_address].
3911    ///
3912    /// # Example
3913    /// ```ignore,no_run
3914    /// # use google_cloud_config_v1::model::TerraformError;
3915    /// let x = TerraformError::new().set_resource_address("example");
3916    /// ```
3917    pub fn set_resource_address<T: std::convert::Into<std::string::String>>(
3918        mut self,
3919        v: T,
3920    ) -> Self {
3921        self.resource_address = v.into();
3922        self
3923    }
3924
3925    /// Sets the value of [http_response_code][crate::model::TerraformError::http_response_code].
3926    ///
3927    /// # Example
3928    /// ```ignore,no_run
3929    /// # use google_cloud_config_v1::model::TerraformError;
3930    /// let x = TerraformError::new().set_http_response_code(42);
3931    /// ```
3932    pub fn set_http_response_code<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3933        self.http_response_code = v.into();
3934        self
3935    }
3936
3937    /// Sets the value of [error_description][crate::model::TerraformError::error_description].
3938    ///
3939    /// # Example
3940    /// ```ignore,no_run
3941    /// # use google_cloud_config_v1::model::TerraformError;
3942    /// let x = TerraformError::new().set_error_description("example");
3943    /// ```
3944    pub fn set_error_description<T: std::convert::Into<std::string::String>>(
3945        mut self,
3946        v: T,
3947    ) -> Self {
3948        self.error_description = v.into();
3949        self
3950    }
3951
3952    /// Sets the value of [error][crate::model::TerraformError::error].
3953    ///
3954    /// # Example
3955    /// ```ignore,no_run
3956    /// # use google_cloud_config_v1::model::TerraformError;
3957    /// use google_cloud_rpc::model::Status;
3958    /// let x = TerraformError::new().set_error(Status::default()/* use setters */);
3959    /// ```
3960    pub fn set_error<T>(mut self, v: T) -> Self
3961    where
3962        T: std::convert::Into<google_cloud_rpc::model::Status>,
3963    {
3964        self.error = std::option::Option::Some(v.into());
3965        self
3966    }
3967
3968    /// Sets or clears the value of [error][crate::model::TerraformError::error].
3969    ///
3970    /// # Example
3971    /// ```ignore,no_run
3972    /// # use google_cloud_config_v1::model::TerraformError;
3973    /// use google_cloud_rpc::model::Status;
3974    /// let x = TerraformError::new().set_or_clear_error(Some(Status::default()/* use setters */));
3975    /// let x = TerraformError::new().set_or_clear_error(None::<Status>);
3976    /// ```
3977    pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
3978    where
3979        T: std::convert::Into<google_cloud_rpc::model::Status>,
3980    {
3981        self.error = v.map(|x| x.into());
3982        self
3983    }
3984}
3985
3986impl wkt::message::Message for TerraformError {
3987    fn typename() -> &'static str {
3988        "type.googleapis.com/google.cloud.config.v1.TerraformError"
3989    }
3990}
3991
3992/// A set of files in a Git repository.
3993#[derive(Clone, Default, PartialEq)]
3994#[non_exhaustive]
3995pub struct GitSource {
3996    /// Optional. Repository URL.
3997    /// Example: '<https://github.com/kubernetes/examples.git>'
3998    pub repo: std::option::Option<std::string::String>,
3999
4000    /// Optional. Subdirectory inside the repository.
4001    /// Example: 'staging/my-package'
4002    pub directory: std::option::Option<std::string::String>,
4003
4004    /// Optional. Git reference (e.g. branch or tag).
4005    pub r#ref: std::option::Option<std::string::String>,
4006
4007    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4008}
4009
4010impl GitSource {
4011    pub fn new() -> Self {
4012        std::default::Default::default()
4013    }
4014
4015    /// Sets the value of [repo][crate::model::GitSource::repo].
4016    ///
4017    /// # Example
4018    /// ```ignore,no_run
4019    /// # use google_cloud_config_v1::model::GitSource;
4020    /// let x = GitSource::new().set_repo("example");
4021    /// ```
4022    pub fn set_repo<T>(mut self, v: T) -> Self
4023    where
4024        T: std::convert::Into<std::string::String>,
4025    {
4026        self.repo = std::option::Option::Some(v.into());
4027        self
4028    }
4029
4030    /// Sets or clears the value of [repo][crate::model::GitSource::repo].
4031    ///
4032    /// # Example
4033    /// ```ignore,no_run
4034    /// # use google_cloud_config_v1::model::GitSource;
4035    /// let x = GitSource::new().set_or_clear_repo(Some("example"));
4036    /// let x = GitSource::new().set_or_clear_repo(None::<String>);
4037    /// ```
4038    pub fn set_or_clear_repo<T>(mut self, v: std::option::Option<T>) -> Self
4039    where
4040        T: std::convert::Into<std::string::String>,
4041    {
4042        self.repo = v.map(|x| x.into());
4043        self
4044    }
4045
4046    /// Sets the value of [directory][crate::model::GitSource::directory].
4047    ///
4048    /// # Example
4049    /// ```ignore,no_run
4050    /// # use google_cloud_config_v1::model::GitSource;
4051    /// let x = GitSource::new().set_directory("example");
4052    /// ```
4053    pub fn set_directory<T>(mut self, v: T) -> Self
4054    where
4055        T: std::convert::Into<std::string::String>,
4056    {
4057        self.directory = std::option::Option::Some(v.into());
4058        self
4059    }
4060
4061    /// Sets or clears the value of [directory][crate::model::GitSource::directory].
4062    ///
4063    /// # Example
4064    /// ```ignore,no_run
4065    /// # use google_cloud_config_v1::model::GitSource;
4066    /// let x = GitSource::new().set_or_clear_directory(Some("example"));
4067    /// let x = GitSource::new().set_or_clear_directory(None::<String>);
4068    /// ```
4069    pub fn set_or_clear_directory<T>(mut self, v: std::option::Option<T>) -> Self
4070    where
4071        T: std::convert::Into<std::string::String>,
4072    {
4073        self.directory = v.map(|x| x.into());
4074        self
4075    }
4076
4077    /// Sets the value of [r#ref][crate::model::GitSource::ref].
4078    ///
4079    /// # Example
4080    /// ```ignore,no_run
4081    /// # use google_cloud_config_v1::model::GitSource;
4082    /// let x = GitSource::new().set_ref("example");
4083    /// ```
4084    pub fn set_ref<T>(mut self, v: T) -> Self
4085    where
4086        T: std::convert::Into<std::string::String>,
4087    {
4088        self.r#ref = std::option::Option::Some(v.into());
4089        self
4090    }
4091
4092    /// Sets or clears the value of [r#ref][crate::model::GitSource::ref].
4093    ///
4094    /// # Example
4095    /// ```ignore,no_run
4096    /// # use google_cloud_config_v1::model::GitSource;
4097    /// let x = GitSource::new().set_or_clear_ref(Some("example"));
4098    /// let x = GitSource::new().set_or_clear_ref(None::<String>);
4099    /// ```
4100    pub fn set_or_clear_ref<T>(mut self, v: std::option::Option<T>) -> Self
4101    where
4102        T: std::convert::Into<std::string::String>,
4103    {
4104        self.r#ref = v.map(|x| x.into());
4105        self
4106    }
4107}
4108
4109impl wkt::message::Message for GitSource {
4110    fn typename() -> &'static str {
4111        "type.googleapis.com/google.cloud.config.v1.GitSource"
4112    }
4113}
4114
4115/// Ephemeral metadata content describing the state of a deployment operation.
4116#[derive(Clone, Default, PartialEq)]
4117#[non_exhaustive]
4118pub struct DeploymentOperationMetadata {
4119    /// The current step the deployment operation is running.
4120    pub step: crate::model::deployment_operation_metadata::DeploymentStep,
4121
4122    /// Outputs and artifacts from applying a deployment.
4123    pub apply_results: std::option::Option<crate::model::ApplyResults>,
4124
4125    /// Output only. Cloud Build instance UUID associated with this operation.
4126    pub build: std::string::String,
4127
4128    /// Output only. Location of Deployment operations logs in
4129    /// `gs://{bucket}/{object}` format.
4130    pub logs: std::string::String,
4131
4132    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4133}
4134
4135impl DeploymentOperationMetadata {
4136    pub fn new() -> Self {
4137        std::default::Default::default()
4138    }
4139
4140    /// Sets the value of [step][crate::model::DeploymentOperationMetadata::step].
4141    ///
4142    /// # Example
4143    /// ```ignore,no_run
4144    /// # use google_cloud_config_v1::model::DeploymentOperationMetadata;
4145    /// use google_cloud_config_v1::model::deployment_operation_metadata::DeploymentStep;
4146    /// let x0 = DeploymentOperationMetadata::new().set_step(DeploymentStep::PreparingStorageBucket);
4147    /// let x1 = DeploymentOperationMetadata::new().set_step(DeploymentStep::DownloadingBlueprint);
4148    /// let x2 = DeploymentOperationMetadata::new().set_step(DeploymentStep::RunningTfInit);
4149    /// ```
4150    pub fn set_step<
4151        T: std::convert::Into<crate::model::deployment_operation_metadata::DeploymentStep>,
4152    >(
4153        mut self,
4154        v: T,
4155    ) -> Self {
4156        self.step = v.into();
4157        self
4158    }
4159
4160    /// Sets the value of [apply_results][crate::model::DeploymentOperationMetadata::apply_results].
4161    ///
4162    /// # Example
4163    /// ```ignore,no_run
4164    /// # use google_cloud_config_v1::model::DeploymentOperationMetadata;
4165    /// use google_cloud_config_v1::model::ApplyResults;
4166    /// let x = DeploymentOperationMetadata::new().set_apply_results(ApplyResults::default()/* use setters */);
4167    /// ```
4168    pub fn set_apply_results<T>(mut self, v: T) -> Self
4169    where
4170        T: std::convert::Into<crate::model::ApplyResults>,
4171    {
4172        self.apply_results = std::option::Option::Some(v.into());
4173        self
4174    }
4175
4176    /// Sets or clears the value of [apply_results][crate::model::DeploymentOperationMetadata::apply_results].
4177    ///
4178    /// # Example
4179    /// ```ignore,no_run
4180    /// # use google_cloud_config_v1::model::DeploymentOperationMetadata;
4181    /// use google_cloud_config_v1::model::ApplyResults;
4182    /// let x = DeploymentOperationMetadata::new().set_or_clear_apply_results(Some(ApplyResults::default()/* use setters */));
4183    /// let x = DeploymentOperationMetadata::new().set_or_clear_apply_results(None::<ApplyResults>);
4184    /// ```
4185    pub fn set_or_clear_apply_results<T>(mut self, v: std::option::Option<T>) -> Self
4186    where
4187        T: std::convert::Into<crate::model::ApplyResults>,
4188    {
4189        self.apply_results = v.map(|x| x.into());
4190        self
4191    }
4192
4193    /// Sets the value of [build][crate::model::DeploymentOperationMetadata::build].
4194    ///
4195    /// # Example
4196    /// ```ignore,no_run
4197    /// # use google_cloud_config_v1::model::DeploymentOperationMetadata;
4198    /// let x = DeploymentOperationMetadata::new().set_build("example");
4199    /// ```
4200    pub fn set_build<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4201        self.build = v.into();
4202        self
4203    }
4204
4205    /// Sets the value of [logs][crate::model::DeploymentOperationMetadata::logs].
4206    ///
4207    /// # Example
4208    /// ```ignore,no_run
4209    /// # use google_cloud_config_v1::model::DeploymentOperationMetadata;
4210    /// let x = DeploymentOperationMetadata::new().set_logs("example");
4211    /// ```
4212    pub fn set_logs<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4213        self.logs = v.into();
4214        self
4215    }
4216}
4217
4218impl wkt::message::Message for DeploymentOperationMetadata {
4219    fn typename() -> &'static str {
4220        "type.googleapis.com/google.cloud.config.v1.DeploymentOperationMetadata"
4221    }
4222}
4223
4224/// Defines additional types related to [DeploymentOperationMetadata].
4225pub mod deployment_operation_metadata {
4226    #[allow(unused_imports)]
4227    use super::*;
4228
4229    /// The possible steps a deployment may be running.
4230    ///
4231    /// # Working with unknown values
4232    ///
4233    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4234    /// additional enum variants at any time. Adding new variants is not considered
4235    /// a breaking change. Applications should write their code in anticipation of:
4236    ///
4237    /// - New values appearing in future releases of the client library, **and**
4238    /// - New values received dynamically, without application changes.
4239    ///
4240    /// Please consult the [Working with enums] section in the user guide for some
4241    /// guidelines.
4242    ///
4243    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
4244    #[derive(Clone, Debug, PartialEq)]
4245    #[non_exhaustive]
4246    pub enum DeploymentStep {
4247        /// Unspecified deployment step
4248        Unspecified,
4249        /// Infra Manager is creating a Google Cloud Storage bucket to store
4250        /// artifacts and metadata about the deployment and revision
4251        PreparingStorageBucket,
4252        /// Downloading the blueprint onto the Google Cloud Storage bucket
4253        DownloadingBlueprint,
4254        /// Initializing Terraform using `terraform init`
4255        RunningTfInit,
4256        /// Running `terraform plan`
4257        RunningTfPlan,
4258        /// Actuating resources using Terraform using `terraform apply`
4259        RunningTfApply,
4260        /// Destroying resources using Terraform using `terraform destroy`
4261        RunningTfDestroy,
4262        /// Validating the uploaded TF state file when unlocking a deployment
4263        RunningTfValidate,
4264        /// Unlocking a deployment
4265        UnlockingDeployment,
4266        /// Operation was successful
4267        Succeeded,
4268        /// Operation failed
4269        Failed,
4270        /// Validating the provided repository.
4271        ValidatingRepository,
4272        /// Running quota validation
4273        RunningQuotaValidation,
4274        /// If set, the enum was initialized with an unknown value.
4275        ///
4276        /// Applications can examine the value using [DeploymentStep::value] or
4277        /// [DeploymentStep::name].
4278        UnknownValue(deployment_step::UnknownValue),
4279    }
4280
4281    #[doc(hidden)]
4282    pub mod deployment_step {
4283        #[allow(unused_imports)]
4284        use super::*;
4285        #[derive(Clone, Debug, PartialEq)]
4286        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4287    }
4288
4289    impl DeploymentStep {
4290        /// Gets the enum value.
4291        ///
4292        /// Returns `None` if the enum contains an unknown value deserialized from
4293        /// the string representation of enums.
4294        pub fn value(&self) -> std::option::Option<i32> {
4295            match self {
4296                Self::Unspecified => std::option::Option::Some(0),
4297                Self::PreparingStorageBucket => std::option::Option::Some(1),
4298                Self::DownloadingBlueprint => std::option::Option::Some(2),
4299                Self::RunningTfInit => std::option::Option::Some(3),
4300                Self::RunningTfPlan => std::option::Option::Some(4),
4301                Self::RunningTfApply => std::option::Option::Some(5),
4302                Self::RunningTfDestroy => std::option::Option::Some(6),
4303                Self::RunningTfValidate => std::option::Option::Some(7),
4304                Self::UnlockingDeployment => std::option::Option::Some(8),
4305                Self::Succeeded => std::option::Option::Some(9),
4306                Self::Failed => std::option::Option::Some(10),
4307                Self::ValidatingRepository => std::option::Option::Some(11),
4308                Self::RunningQuotaValidation => std::option::Option::Some(12),
4309                Self::UnknownValue(u) => u.0.value(),
4310            }
4311        }
4312
4313        /// Gets the enum value as a string.
4314        ///
4315        /// Returns `None` if the enum contains an unknown value deserialized from
4316        /// the integer representation of enums.
4317        pub fn name(&self) -> std::option::Option<&str> {
4318            match self {
4319                Self::Unspecified => std::option::Option::Some("DEPLOYMENT_STEP_UNSPECIFIED"),
4320                Self::PreparingStorageBucket => {
4321                    std::option::Option::Some("PREPARING_STORAGE_BUCKET")
4322                }
4323                Self::DownloadingBlueprint => std::option::Option::Some("DOWNLOADING_BLUEPRINT"),
4324                Self::RunningTfInit => std::option::Option::Some("RUNNING_TF_INIT"),
4325                Self::RunningTfPlan => std::option::Option::Some("RUNNING_TF_PLAN"),
4326                Self::RunningTfApply => std::option::Option::Some("RUNNING_TF_APPLY"),
4327                Self::RunningTfDestroy => std::option::Option::Some("RUNNING_TF_DESTROY"),
4328                Self::RunningTfValidate => std::option::Option::Some("RUNNING_TF_VALIDATE"),
4329                Self::UnlockingDeployment => std::option::Option::Some("UNLOCKING_DEPLOYMENT"),
4330                Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
4331                Self::Failed => std::option::Option::Some("FAILED"),
4332                Self::ValidatingRepository => std::option::Option::Some("VALIDATING_REPOSITORY"),
4333                Self::RunningQuotaValidation => {
4334                    std::option::Option::Some("RUNNING_QUOTA_VALIDATION")
4335                }
4336                Self::UnknownValue(u) => u.0.name(),
4337            }
4338        }
4339    }
4340
4341    impl std::default::Default for DeploymentStep {
4342        fn default() -> Self {
4343            use std::convert::From;
4344            Self::from(0)
4345        }
4346    }
4347
4348    impl std::fmt::Display for DeploymentStep {
4349        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4350            wkt::internal::display_enum(f, self.name(), self.value())
4351        }
4352    }
4353
4354    impl std::convert::From<i32> for DeploymentStep {
4355        fn from(value: i32) -> Self {
4356            match value {
4357                0 => Self::Unspecified,
4358                1 => Self::PreparingStorageBucket,
4359                2 => Self::DownloadingBlueprint,
4360                3 => Self::RunningTfInit,
4361                4 => Self::RunningTfPlan,
4362                5 => Self::RunningTfApply,
4363                6 => Self::RunningTfDestroy,
4364                7 => Self::RunningTfValidate,
4365                8 => Self::UnlockingDeployment,
4366                9 => Self::Succeeded,
4367                10 => Self::Failed,
4368                11 => Self::ValidatingRepository,
4369                12 => Self::RunningQuotaValidation,
4370                _ => Self::UnknownValue(deployment_step::UnknownValue(
4371                    wkt::internal::UnknownEnumValue::Integer(value),
4372                )),
4373            }
4374        }
4375    }
4376
4377    impl std::convert::From<&str> for DeploymentStep {
4378        fn from(value: &str) -> Self {
4379            use std::string::ToString;
4380            match value {
4381                "DEPLOYMENT_STEP_UNSPECIFIED" => Self::Unspecified,
4382                "PREPARING_STORAGE_BUCKET" => Self::PreparingStorageBucket,
4383                "DOWNLOADING_BLUEPRINT" => Self::DownloadingBlueprint,
4384                "RUNNING_TF_INIT" => Self::RunningTfInit,
4385                "RUNNING_TF_PLAN" => Self::RunningTfPlan,
4386                "RUNNING_TF_APPLY" => Self::RunningTfApply,
4387                "RUNNING_TF_DESTROY" => Self::RunningTfDestroy,
4388                "RUNNING_TF_VALIDATE" => Self::RunningTfValidate,
4389                "UNLOCKING_DEPLOYMENT" => Self::UnlockingDeployment,
4390                "SUCCEEDED" => Self::Succeeded,
4391                "FAILED" => Self::Failed,
4392                "VALIDATING_REPOSITORY" => Self::ValidatingRepository,
4393                "RUNNING_QUOTA_VALIDATION" => Self::RunningQuotaValidation,
4394                _ => Self::UnknownValue(deployment_step::UnknownValue(
4395                    wkt::internal::UnknownEnumValue::String(value.to_string()),
4396                )),
4397            }
4398        }
4399    }
4400
4401    impl serde::ser::Serialize for DeploymentStep {
4402        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4403        where
4404            S: serde::Serializer,
4405        {
4406            match self {
4407                Self::Unspecified => serializer.serialize_i32(0),
4408                Self::PreparingStorageBucket => serializer.serialize_i32(1),
4409                Self::DownloadingBlueprint => serializer.serialize_i32(2),
4410                Self::RunningTfInit => serializer.serialize_i32(3),
4411                Self::RunningTfPlan => serializer.serialize_i32(4),
4412                Self::RunningTfApply => serializer.serialize_i32(5),
4413                Self::RunningTfDestroy => serializer.serialize_i32(6),
4414                Self::RunningTfValidate => serializer.serialize_i32(7),
4415                Self::UnlockingDeployment => serializer.serialize_i32(8),
4416                Self::Succeeded => serializer.serialize_i32(9),
4417                Self::Failed => serializer.serialize_i32(10),
4418                Self::ValidatingRepository => serializer.serialize_i32(11),
4419                Self::RunningQuotaValidation => serializer.serialize_i32(12),
4420                Self::UnknownValue(u) => u.0.serialize(serializer),
4421            }
4422        }
4423    }
4424
4425    impl<'de> serde::de::Deserialize<'de> for DeploymentStep {
4426        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4427        where
4428            D: serde::Deserializer<'de>,
4429        {
4430            deserializer.deserialize_any(wkt::internal::EnumVisitor::<DeploymentStep>::new(
4431                ".google.cloud.config.v1.DeploymentOperationMetadata.DeploymentStep",
4432            ))
4433        }
4434    }
4435}
4436
4437/// Resource represents a Google Cloud Platform resource actuated by IM.
4438/// Resources are child resources of Revisions.
4439#[derive(Clone, Default, PartialEq)]
4440#[non_exhaustive]
4441pub struct Resource {
4442    /// Output only. Resource name.
4443    /// Format:
4444    /// `projects/{project}/locations/{location}/deployments/{deployment}/revisions/{revision}/resources/{resource}`
4445    pub name: std::string::String,
4446
4447    /// Output only. Terraform-specific info if this resource was created using
4448    /// Terraform.
4449    pub terraform_info: std::option::Option<crate::model::ResourceTerraformInfo>,
4450
4451    /// Output only. Map of Cloud Asset Inventory (CAI) type to CAI info (e.g. CAI
4452    /// ID). CAI type format follows
4453    /// <https://cloud.google.com/asset-inventory/docs/supported-asset-types>
4454    pub cai_assets: std::collections::HashMap<std::string::String, crate::model::ResourceCAIInfo>,
4455
4456    /// Output only. Intent of the resource.
4457    pub intent: crate::model::resource::Intent,
4458
4459    /// Output only. Current state of the resource.
4460    pub state: crate::model::resource::State,
4461
4462    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4463}
4464
4465impl Resource {
4466    pub fn new() -> Self {
4467        std::default::Default::default()
4468    }
4469
4470    /// Sets the value of [name][crate::model::Resource::name].
4471    ///
4472    /// # Example
4473    /// ```ignore,no_run
4474    /// # use google_cloud_config_v1::model::Resource;
4475    /// let x = Resource::new().set_name("example");
4476    /// ```
4477    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4478        self.name = v.into();
4479        self
4480    }
4481
4482    /// Sets the value of [terraform_info][crate::model::Resource::terraform_info].
4483    ///
4484    /// # Example
4485    /// ```ignore,no_run
4486    /// # use google_cloud_config_v1::model::Resource;
4487    /// use google_cloud_config_v1::model::ResourceTerraformInfo;
4488    /// let x = Resource::new().set_terraform_info(ResourceTerraformInfo::default()/* use setters */);
4489    /// ```
4490    pub fn set_terraform_info<T>(mut self, v: T) -> Self
4491    where
4492        T: std::convert::Into<crate::model::ResourceTerraformInfo>,
4493    {
4494        self.terraform_info = std::option::Option::Some(v.into());
4495        self
4496    }
4497
4498    /// Sets or clears the value of [terraform_info][crate::model::Resource::terraform_info].
4499    ///
4500    /// # Example
4501    /// ```ignore,no_run
4502    /// # use google_cloud_config_v1::model::Resource;
4503    /// use google_cloud_config_v1::model::ResourceTerraformInfo;
4504    /// let x = Resource::new().set_or_clear_terraform_info(Some(ResourceTerraformInfo::default()/* use setters */));
4505    /// let x = Resource::new().set_or_clear_terraform_info(None::<ResourceTerraformInfo>);
4506    /// ```
4507    pub fn set_or_clear_terraform_info<T>(mut self, v: std::option::Option<T>) -> Self
4508    where
4509        T: std::convert::Into<crate::model::ResourceTerraformInfo>,
4510    {
4511        self.terraform_info = v.map(|x| x.into());
4512        self
4513    }
4514
4515    /// Sets the value of [cai_assets][crate::model::Resource::cai_assets].
4516    ///
4517    /// # Example
4518    /// ```ignore,no_run
4519    /// # use google_cloud_config_v1::model::Resource;
4520    /// use google_cloud_config_v1::model::ResourceCAIInfo;
4521    /// let x = Resource::new().set_cai_assets([
4522    ///     ("key0", ResourceCAIInfo::default()/* use setters */),
4523    ///     ("key1", ResourceCAIInfo::default()/* use (different) setters */),
4524    /// ]);
4525    /// ```
4526    pub fn set_cai_assets<T, K, V>(mut self, v: T) -> Self
4527    where
4528        T: std::iter::IntoIterator<Item = (K, V)>,
4529        K: std::convert::Into<std::string::String>,
4530        V: std::convert::Into<crate::model::ResourceCAIInfo>,
4531    {
4532        use std::iter::Iterator;
4533        self.cai_assets = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
4534        self
4535    }
4536
4537    /// Sets the value of [intent][crate::model::Resource::intent].
4538    ///
4539    /// # Example
4540    /// ```ignore,no_run
4541    /// # use google_cloud_config_v1::model::Resource;
4542    /// use google_cloud_config_v1::model::resource::Intent;
4543    /// let x0 = Resource::new().set_intent(Intent::Create);
4544    /// let x1 = Resource::new().set_intent(Intent::Update);
4545    /// let x2 = Resource::new().set_intent(Intent::Delete);
4546    /// ```
4547    pub fn set_intent<T: std::convert::Into<crate::model::resource::Intent>>(
4548        mut self,
4549        v: T,
4550    ) -> Self {
4551        self.intent = v.into();
4552        self
4553    }
4554
4555    /// Sets the value of [state][crate::model::Resource::state].
4556    ///
4557    /// # Example
4558    /// ```ignore,no_run
4559    /// # use google_cloud_config_v1::model::Resource;
4560    /// use google_cloud_config_v1::model::resource::State;
4561    /// let x0 = Resource::new().set_state(State::Planned);
4562    /// let x1 = Resource::new().set_state(State::InProgress);
4563    /// let x2 = Resource::new().set_state(State::Reconciled);
4564    /// ```
4565    pub fn set_state<T: std::convert::Into<crate::model::resource::State>>(mut self, v: T) -> Self {
4566        self.state = v.into();
4567        self
4568    }
4569}
4570
4571impl wkt::message::Message for Resource {
4572    fn typename() -> &'static str {
4573        "type.googleapis.com/google.cloud.config.v1.Resource"
4574    }
4575}
4576
4577/// Defines additional types related to [Resource].
4578pub mod resource {
4579    #[allow(unused_imports)]
4580    use super::*;
4581
4582    /// Possible intent of the resource.
4583    ///
4584    /// # Working with unknown values
4585    ///
4586    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4587    /// additional enum variants at any time. Adding new variants is not considered
4588    /// a breaking change. Applications should write their code in anticipation of:
4589    ///
4590    /// - New values appearing in future releases of the client library, **and**
4591    /// - New values received dynamically, without application changes.
4592    ///
4593    /// Please consult the [Working with enums] section in the user guide for some
4594    /// guidelines.
4595    ///
4596    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
4597    #[derive(Clone, Debug, PartialEq)]
4598    #[non_exhaustive]
4599    pub enum Intent {
4600        /// The default value. This value is used if the intent is omitted.
4601        Unspecified,
4602        /// Infra Manager will create this Resource.
4603        Create,
4604        /// Infra Manager will update this Resource.
4605        Update,
4606        /// Infra Manager will delete this Resource.
4607        Delete,
4608        /// Infra Manager will destroy and recreate this Resource.
4609        Recreate,
4610        /// Infra Manager will leave this Resource untouched.
4611        Unchanged,
4612        /// If set, the enum was initialized with an unknown value.
4613        ///
4614        /// Applications can examine the value using [Intent::value] or
4615        /// [Intent::name].
4616        UnknownValue(intent::UnknownValue),
4617    }
4618
4619    #[doc(hidden)]
4620    pub mod intent {
4621        #[allow(unused_imports)]
4622        use super::*;
4623        #[derive(Clone, Debug, PartialEq)]
4624        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4625    }
4626
4627    impl Intent {
4628        /// Gets the enum value.
4629        ///
4630        /// Returns `None` if the enum contains an unknown value deserialized from
4631        /// the string representation of enums.
4632        pub fn value(&self) -> std::option::Option<i32> {
4633            match self {
4634                Self::Unspecified => std::option::Option::Some(0),
4635                Self::Create => std::option::Option::Some(1),
4636                Self::Update => std::option::Option::Some(2),
4637                Self::Delete => std::option::Option::Some(3),
4638                Self::Recreate => std::option::Option::Some(4),
4639                Self::Unchanged => std::option::Option::Some(5),
4640                Self::UnknownValue(u) => u.0.value(),
4641            }
4642        }
4643
4644        /// Gets the enum value as a string.
4645        ///
4646        /// Returns `None` if the enum contains an unknown value deserialized from
4647        /// the integer representation of enums.
4648        pub fn name(&self) -> std::option::Option<&str> {
4649            match self {
4650                Self::Unspecified => std::option::Option::Some("INTENT_UNSPECIFIED"),
4651                Self::Create => std::option::Option::Some("CREATE"),
4652                Self::Update => std::option::Option::Some("UPDATE"),
4653                Self::Delete => std::option::Option::Some("DELETE"),
4654                Self::Recreate => std::option::Option::Some("RECREATE"),
4655                Self::Unchanged => std::option::Option::Some("UNCHANGED"),
4656                Self::UnknownValue(u) => u.0.name(),
4657            }
4658        }
4659    }
4660
4661    impl std::default::Default for Intent {
4662        fn default() -> Self {
4663            use std::convert::From;
4664            Self::from(0)
4665        }
4666    }
4667
4668    impl std::fmt::Display for Intent {
4669        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4670            wkt::internal::display_enum(f, self.name(), self.value())
4671        }
4672    }
4673
4674    impl std::convert::From<i32> for Intent {
4675        fn from(value: i32) -> Self {
4676            match value {
4677                0 => Self::Unspecified,
4678                1 => Self::Create,
4679                2 => Self::Update,
4680                3 => Self::Delete,
4681                4 => Self::Recreate,
4682                5 => Self::Unchanged,
4683                _ => Self::UnknownValue(intent::UnknownValue(
4684                    wkt::internal::UnknownEnumValue::Integer(value),
4685                )),
4686            }
4687        }
4688    }
4689
4690    impl std::convert::From<&str> for Intent {
4691        fn from(value: &str) -> Self {
4692            use std::string::ToString;
4693            match value {
4694                "INTENT_UNSPECIFIED" => Self::Unspecified,
4695                "CREATE" => Self::Create,
4696                "UPDATE" => Self::Update,
4697                "DELETE" => Self::Delete,
4698                "RECREATE" => Self::Recreate,
4699                "UNCHANGED" => Self::Unchanged,
4700                _ => Self::UnknownValue(intent::UnknownValue(
4701                    wkt::internal::UnknownEnumValue::String(value.to_string()),
4702                )),
4703            }
4704        }
4705    }
4706
4707    impl serde::ser::Serialize for Intent {
4708        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4709        where
4710            S: serde::Serializer,
4711        {
4712            match self {
4713                Self::Unspecified => serializer.serialize_i32(0),
4714                Self::Create => serializer.serialize_i32(1),
4715                Self::Update => serializer.serialize_i32(2),
4716                Self::Delete => serializer.serialize_i32(3),
4717                Self::Recreate => serializer.serialize_i32(4),
4718                Self::Unchanged => serializer.serialize_i32(5),
4719                Self::UnknownValue(u) => u.0.serialize(serializer),
4720            }
4721        }
4722    }
4723
4724    impl<'de> serde::de::Deserialize<'de> for Intent {
4725        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4726        where
4727            D: serde::Deserializer<'de>,
4728        {
4729            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Intent>::new(
4730                ".google.cloud.config.v1.Resource.Intent",
4731            ))
4732        }
4733    }
4734
4735    /// Possible states of a resource.
4736    ///
4737    /// # Working with unknown values
4738    ///
4739    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4740    /// additional enum variants at any time. Adding new variants is not considered
4741    /// a breaking change. Applications should write their code in anticipation of:
4742    ///
4743    /// - New values appearing in future releases of the client library, **and**
4744    /// - New values received dynamically, without application changes.
4745    ///
4746    /// Please consult the [Working with enums] section in the user guide for some
4747    /// guidelines.
4748    ///
4749    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
4750    #[derive(Clone, Debug, PartialEq)]
4751    #[non_exhaustive]
4752    pub enum State {
4753        /// The default value. This value is used if the state is omitted.
4754        Unspecified,
4755        /// Resource has been planned for reconcile.
4756        Planned,
4757        /// Resource is actively reconciling into the intended state.
4758        InProgress,
4759        /// Resource has reconciled to intended state.
4760        Reconciled,
4761        /// Resource failed to reconcile.
4762        Failed,
4763        /// If set, the enum was initialized with an unknown value.
4764        ///
4765        /// Applications can examine the value using [State::value] or
4766        /// [State::name].
4767        UnknownValue(state::UnknownValue),
4768    }
4769
4770    #[doc(hidden)]
4771    pub mod state {
4772        #[allow(unused_imports)]
4773        use super::*;
4774        #[derive(Clone, Debug, PartialEq)]
4775        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4776    }
4777
4778    impl State {
4779        /// Gets the enum value.
4780        ///
4781        /// Returns `None` if the enum contains an unknown value deserialized from
4782        /// the string representation of enums.
4783        pub fn value(&self) -> std::option::Option<i32> {
4784            match self {
4785                Self::Unspecified => std::option::Option::Some(0),
4786                Self::Planned => std::option::Option::Some(1),
4787                Self::InProgress => std::option::Option::Some(2),
4788                Self::Reconciled => std::option::Option::Some(3),
4789                Self::Failed => std::option::Option::Some(4),
4790                Self::UnknownValue(u) => u.0.value(),
4791            }
4792        }
4793
4794        /// Gets the enum value as a string.
4795        ///
4796        /// Returns `None` if the enum contains an unknown value deserialized from
4797        /// the integer representation of enums.
4798        pub fn name(&self) -> std::option::Option<&str> {
4799            match self {
4800                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
4801                Self::Planned => std::option::Option::Some("PLANNED"),
4802                Self::InProgress => std::option::Option::Some("IN_PROGRESS"),
4803                Self::Reconciled => std::option::Option::Some("RECONCILED"),
4804                Self::Failed => std::option::Option::Some("FAILED"),
4805                Self::UnknownValue(u) => u.0.name(),
4806            }
4807        }
4808    }
4809
4810    impl std::default::Default for State {
4811        fn default() -> Self {
4812            use std::convert::From;
4813            Self::from(0)
4814        }
4815    }
4816
4817    impl std::fmt::Display for State {
4818        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4819            wkt::internal::display_enum(f, self.name(), self.value())
4820        }
4821    }
4822
4823    impl std::convert::From<i32> for State {
4824        fn from(value: i32) -> Self {
4825            match value {
4826                0 => Self::Unspecified,
4827                1 => Self::Planned,
4828                2 => Self::InProgress,
4829                3 => Self::Reconciled,
4830                4 => Self::Failed,
4831                _ => Self::UnknownValue(state::UnknownValue(
4832                    wkt::internal::UnknownEnumValue::Integer(value),
4833                )),
4834            }
4835        }
4836    }
4837
4838    impl std::convert::From<&str> for State {
4839        fn from(value: &str) -> Self {
4840            use std::string::ToString;
4841            match value {
4842                "STATE_UNSPECIFIED" => Self::Unspecified,
4843                "PLANNED" => Self::Planned,
4844                "IN_PROGRESS" => Self::InProgress,
4845                "RECONCILED" => Self::Reconciled,
4846                "FAILED" => Self::Failed,
4847                _ => Self::UnknownValue(state::UnknownValue(
4848                    wkt::internal::UnknownEnumValue::String(value.to_string()),
4849                )),
4850            }
4851        }
4852    }
4853
4854    impl serde::ser::Serialize for State {
4855        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4856        where
4857            S: serde::Serializer,
4858        {
4859            match self {
4860                Self::Unspecified => serializer.serialize_i32(0),
4861                Self::Planned => serializer.serialize_i32(1),
4862                Self::InProgress => serializer.serialize_i32(2),
4863                Self::Reconciled => serializer.serialize_i32(3),
4864                Self::Failed => serializer.serialize_i32(4),
4865                Self::UnknownValue(u) => u.0.serialize(serializer),
4866            }
4867        }
4868    }
4869
4870    impl<'de> serde::de::Deserialize<'de> for State {
4871        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4872        where
4873            D: serde::Deserializer<'de>,
4874        {
4875            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
4876                ".google.cloud.config.v1.Resource.State",
4877            ))
4878        }
4879    }
4880}
4881
4882/// Terraform info of a Resource.
4883#[derive(Clone, Default, PartialEq)]
4884#[non_exhaustive]
4885pub struct ResourceTerraformInfo {
4886    /// TF resource address that uniquely identifies this resource within this
4887    /// deployment.
4888    pub address: std::string::String,
4889
4890    /// TF resource type
4891    pub r#type: std::string::String,
4892
4893    /// ID attribute of the TF resource
4894    pub id: std::string::String,
4895
4896    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4897}
4898
4899impl ResourceTerraformInfo {
4900    pub fn new() -> Self {
4901        std::default::Default::default()
4902    }
4903
4904    /// Sets the value of [address][crate::model::ResourceTerraformInfo::address].
4905    ///
4906    /// # Example
4907    /// ```ignore,no_run
4908    /// # use google_cloud_config_v1::model::ResourceTerraformInfo;
4909    /// let x = ResourceTerraformInfo::new().set_address("example");
4910    /// ```
4911    pub fn set_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4912        self.address = v.into();
4913        self
4914    }
4915
4916    /// Sets the value of [r#type][crate::model::ResourceTerraformInfo::type].
4917    ///
4918    /// # Example
4919    /// ```ignore,no_run
4920    /// # use google_cloud_config_v1::model::ResourceTerraformInfo;
4921    /// let x = ResourceTerraformInfo::new().set_type("example");
4922    /// ```
4923    pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4924        self.r#type = v.into();
4925        self
4926    }
4927
4928    /// Sets the value of [id][crate::model::ResourceTerraformInfo::id].
4929    ///
4930    /// # Example
4931    /// ```ignore,no_run
4932    /// # use google_cloud_config_v1::model::ResourceTerraformInfo;
4933    /// let x = ResourceTerraformInfo::new().set_id("example");
4934    /// ```
4935    pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4936        self.id = v.into();
4937        self
4938    }
4939}
4940
4941impl wkt::message::Message for ResourceTerraformInfo {
4942    fn typename() -> &'static str {
4943        "type.googleapis.com/google.cloud.config.v1.ResourceTerraformInfo"
4944    }
4945}
4946
4947/// CAI info of a Resource.
4948#[derive(Clone, Default, PartialEq)]
4949#[non_exhaustive]
4950pub struct ResourceCAIInfo {
4951    /// CAI resource name in the format following
4952    /// <https://cloud.google.com/apis/design/resource_names#full_resource_name>
4953    pub full_resource_name: std::string::String,
4954
4955    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4956}
4957
4958impl ResourceCAIInfo {
4959    pub fn new() -> Self {
4960        std::default::Default::default()
4961    }
4962
4963    /// Sets the value of [full_resource_name][crate::model::ResourceCAIInfo::full_resource_name].
4964    ///
4965    /// # Example
4966    /// ```ignore,no_run
4967    /// # use google_cloud_config_v1::model::ResourceCAIInfo;
4968    /// let x = ResourceCAIInfo::new().set_full_resource_name("example");
4969    /// ```
4970    pub fn set_full_resource_name<T: std::convert::Into<std::string::String>>(
4971        mut self,
4972        v: T,
4973    ) -> Self {
4974        self.full_resource_name = v.into();
4975        self
4976    }
4977}
4978
4979impl wkt::message::Message for ResourceCAIInfo {
4980    fn typename() -> &'static str {
4981        "type.googleapis.com/google.cloud.config.v1.ResourceCAIInfo"
4982    }
4983}
4984
4985/// A request to get a Resource from a 'GetResource' call.
4986#[derive(Clone, Default, PartialEq)]
4987#[non_exhaustive]
4988pub struct GetResourceRequest {
4989    /// Required. The name of the Resource in the format:
4990    /// 'projects/{project_id}/locations/{location}/deployments/{deployment}/revisions/{revision}/resource/{resource}'.
4991    pub name: std::string::String,
4992
4993    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4994}
4995
4996impl GetResourceRequest {
4997    pub fn new() -> Self {
4998        std::default::Default::default()
4999    }
5000
5001    /// Sets the value of [name][crate::model::GetResourceRequest::name].
5002    ///
5003    /// # Example
5004    /// ```ignore,no_run
5005    /// # use google_cloud_config_v1::model::GetResourceRequest;
5006    /// let x = GetResourceRequest::new().set_name("example");
5007    /// ```
5008    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5009        self.name = v.into();
5010        self
5011    }
5012}
5013
5014impl wkt::message::Message for GetResourceRequest {
5015    fn typename() -> &'static str {
5016        "type.googleapis.com/google.cloud.config.v1.GetResourceRequest"
5017    }
5018}
5019
5020/// A request to list Resources passed to a 'ListResources' call.
5021#[derive(Clone, Default, PartialEq)]
5022#[non_exhaustive]
5023pub struct ListResourcesRequest {
5024    /// Required. The parent in whose context the Resources are listed. The parent
5025    /// value is in the format:
5026    /// 'projects/{project_id}/locations/{location}/deployments/{deployment}/revisions/{revision}'.
5027    pub parent: std::string::String,
5028
5029    /// When requesting a page of resources, 'page_size' specifies number of
5030    /// resources to return. If unspecified, at most 500 will be returned. The
5031    /// maximum value is 1000.
5032    pub page_size: i32,
5033
5034    /// Token returned by previous call to 'ListResources' which specifies the
5035    /// position in the list from where to continue listing the resources.
5036    pub page_token: std::string::String,
5037
5038    /// Lists the Resources that match the filter expression. A filter
5039    /// expression filters the resources listed in the response. The expression
5040    /// must be of the form '{field} {operator} {value}' where operators: '<', '>',
5041    /// '<=',
5042    /// '>=',
5043    /// '!=', '=', ':' are supported (colon ':' represents a HAS operator which is
5044    /// roughly synonymous with equality). {field} can refer to a proto or JSON
5045    /// field, or a synthetic field. Field names can be camelCase or snake_case.
5046    ///
5047    /// Examples:
5048    ///
5049    /// - Filter by name:
5050    ///   name =
5051    ///   "projects/foo/locations/us-central1/deployments/dep/revisions/bar/resources/baz
5052    pub filter: std::string::String,
5053
5054    /// Field to use to sort the list.
5055    pub order_by: std::string::String,
5056
5057    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5058}
5059
5060impl ListResourcesRequest {
5061    pub fn new() -> Self {
5062        std::default::Default::default()
5063    }
5064
5065    /// Sets the value of [parent][crate::model::ListResourcesRequest::parent].
5066    ///
5067    /// # Example
5068    /// ```ignore,no_run
5069    /// # use google_cloud_config_v1::model::ListResourcesRequest;
5070    /// let x = ListResourcesRequest::new().set_parent("example");
5071    /// ```
5072    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5073        self.parent = v.into();
5074        self
5075    }
5076
5077    /// Sets the value of [page_size][crate::model::ListResourcesRequest::page_size].
5078    ///
5079    /// # Example
5080    /// ```ignore,no_run
5081    /// # use google_cloud_config_v1::model::ListResourcesRequest;
5082    /// let x = ListResourcesRequest::new().set_page_size(42);
5083    /// ```
5084    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5085        self.page_size = v.into();
5086        self
5087    }
5088
5089    /// Sets the value of [page_token][crate::model::ListResourcesRequest::page_token].
5090    ///
5091    /// # Example
5092    /// ```ignore,no_run
5093    /// # use google_cloud_config_v1::model::ListResourcesRequest;
5094    /// let x = ListResourcesRequest::new().set_page_token("example");
5095    /// ```
5096    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5097        self.page_token = v.into();
5098        self
5099    }
5100
5101    /// Sets the value of [filter][crate::model::ListResourcesRequest::filter].
5102    ///
5103    /// # Example
5104    /// ```ignore,no_run
5105    /// # use google_cloud_config_v1::model::ListResourcesRequest;
5106    /// let x = ListResourcesRequest::new().set_filter("example");
5107    /// ```
5108    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5109        self.filter = v.into();
5110        self
5111    }
5112
5113    /// Sets the value of [order_by][crate::model::ListResourcesRequest::order_by].
5114    ///
5115    /// # Example
5116    /// ```ignore,no_run
5117    /// # use google_cloud_config_v1::model::ListResourcesRequest;
5118    /// let x = ListResourcesRequest::new().set_order_by("example");
5119    /// ```
5120    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5121        self.order_by = v.into();
5122        self
5123    }
5124}
5125
5126impl wkt::message::Message for ListResourcesRequest {
5127    fn typename() -> &'static str {
5128        "type.googleapis.com/google.cloud.config.v1.ListResourcesRequest"
5129    }
5130}
5131
5132/// A response to a 'ListResources' call. Contains a list of Resources.
5133#[derive(Clone, Default, PartialEq)]
5134#[non_exhaustive]
5135pub struct ListResourcesResponse {
5136    /// List of [Resources][google.cloud.config.v1.Resource].
5137    ///
5138    /// [google.cloud.config.v1.Resource]: crate::model::Resource
5139    pub resources: std::vec::Vec<crate::model::Resource>,
5140
5141    /// A token to request the next page of resources from the 'ListResources'
5142    /// method. The value of an empty string means that there are no more resources
5143    /// to return.
5144    pub next_page_token: std::string::String,
5145
5146    /// Locations that could not be reached.
5147    pub unreachable: std::vec::Vec<std::string::String>,
5148
5149    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5150}
5151
5152impl ListResourcesResponse {
5153    pub fn new() -> Self {
5154        std::default::Default::default()
5155    }
5156
5157    /// Sets the value of [resources][crate::model::ListResourcesResponse::resources].
5158    ///
5159    /// # Example
5160    /// ```ignore,no_run
5161    /// # use google_cloud_config_v1::model::ListResourcesResponse;
5162    /// use google_cloud_config_v1::model::Resource;
5163    /// let x = ListResourcesResponse::new()
5164    ///     .set_resources([
5165    ///         Resource::default()/* use setters */,
5166    ///         Resource::default()/* use (different) setters */,
5167    ///     ]);
5168    /// ```
5169    pub fn set_resources<T, V>(mut self, v: T) -> Self
5170    where
5171        T: std::iter::IntoIterator<Item = V>,
5172        V: std::convert::Into<crate::model::Resource>,
5173    {
5174        use std::iter::Iterator;
5175        self.resources = v.into_iter().map(|i| i.into()).collect();
5176        self
5177    }
5178
5179    /// Sets the value of [next_page_token][crate::model::ListResourcesResponse::next_page_token].
5180    ///
5181    /// # Example
5182    /// ```ignore,no_run
5183    /// # use google_cloud_config_v1::model::ListResourcesResponse;
5184    /// let x = ListResourcesResponse::new().set_next_page_token("example");
5185    /// ```
5186    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5187        self.next_page_token = v.into();
5188        self
5189    }
5190
5191    /// Sets the value of [unreachable][crate::model::ListResourcesResponse::unreachable].
5192    ///
5193    /// # Example
5194    /// ```ignore,no_run
5195    /// # use google_cloud_config_v1::model::ListResourcesResponse;
5196    /// let x = ListResourcesResponse::new().set_unreachable(["a", "b", "c"]);
5197    /// ```
5198    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
5199    where
5200        T: std::iter::IntoIterator<Item = V>,
5201        V: std::convert::Into<std::string::String>,
5202    {
5203        use std::iter::Iterator;
5204        self.unreachable = v.into_iter().map(|i| i.into()).collect();
5205        self
5206    }
5207}
5208
5209impl wkt::message::Message for ListResourcesResponse {
5210    fn typename() -> &'static str {
5211        "type.googleapis.com/google.cloud.config.v1.ListResourcesResponse"
5212    }
5213}
5214
5215#[doc(hidden)]
5216impl google_cloud_gax::paginator::internal::PageableResponse for ListResourcesResponse {
5217    type PageItem = crate::model::Resource;
5218
5219    fn items(self) -> std::vec::Vec<Self::PageItem> {
5220        self.resources
5221    }
5222
5223    fn next_page_token(&self) -> std::string::String {
5224        use std::clone::Clone;
5225        self.next_page_token.clone()
5226    }
5227}
5228
5229/// Contains info about a Terraform state file
5230#[derive(Clone, Default, PartialEq)]
5231#[non_exhaustive]
5232pub struct Statefile {
5233    /// Output only. Cloud Storage signed URI used for downloading or uploading the
5234    /// state file.
5235    pub signed_uri: std::string::String,
5236
5237    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5238}
5239
5240impl Statefile {
5241    pub fn new() -> Self {
5242        std::default::Default::default()
5243    }
5244
5245    /// Sets the value of [signed_uri][crate::model::Statefile::signed_uri].
5246    ///
5247    /// # Example
5248    /// ```ignore,no_run
5249    /// # use google_cloud_config_v1::model::Statefile;
5250    /// let x = Statefile::new().set_signed_uri("example");
5251    /// ```
5252    pub fn set_signed_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5253        self.signed_uri = v.into();
5254        self
5255    }
5256}
5257
5258impl wkt::message::Message for Statefile {
5259    fn typename() -> &'static str {
5260        "type.googleapis.com/google.cloud.config.v1.Statefile"
5261    }
5262}
5263
5264/// A request to export a state file passed to a 'ExportDeploymentStatefile'
5265/// call.
5266#[derive(Clone, Default, PartialEq)]
5267#[non_exhaustive]
5268pub struct ExportDeploymentStatefileRequest {
5269    /// Required. The parent in whose context the statefile is listed. The parent
5270    /// value is in the format:
5271    /// 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
5272    pub parent: std::string::String,
5273
5274    /// Optional. If this flag is set to true, the exported deployment state file
5275    /// will be the draft state. This will enable the draft file to be validated
5276    /// before copying it over to the working state on unlock.
5277    pub draft: bool,
5278
5279    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5280}
5281
5282impl ExportDeploymentStatefileRequest {
5283    pub fn new() -> Self {
5284        std::default::Default::default()
5285    }
5286
5287    /// Sets the value of [parent][crate::model::ExportDeploymentStatefileRequest::parent].
5288    ///
5289    /// # Example
5290    /// ```ignore,no_run
5291    /// # use google_cloud_config_v1::model::ExportDeploymentStatefileRequest;
5292    /// let x = ExportDeploymentStatefileRequest::new().set_parent("example");
5293    /// ```
5294    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5295        self.parent = v.into();
5296        self
5297    }
5298
5299    /// Sets the value of [draft][crate::model::ExportDeploymentStatefileRequest::draft].
5300    ///
5301    /// # Example
5302    /// ```ignore,no_run
5303    /// # use google_cloud_config_v1::model::ExportDeploymentStatefileRequest;
5304    /// let x = ExportDeploymentStatefileRequest::new().set_draft(true);
5305    /// ```
5306    pub fn set_draft<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5307        self.draft = v.into();
5308        self
5309    }
5310}
5311
5312impl wkt::message::Message for ExportDeploymentStatefileRequest {
5313    fn typename() -> &'static str {
5314        "type.googleapis.com/google.cloud.config.v1.ExportDeploymentStatefileRequest"
5315    }
5316}
5317
5318/// A request to export a state file passed to a 'ExportRevisionStatefile'
5319/// call.
5320#[derive(Clone, Default, PartialEq)]
5321#[non_exhaustive]
5322pub struct ExportRevisionStatefileRequest {
5323    /// Required. The parent in whose context the statefile is listed. The parent
5324    /// value is in the format:
5325    /// 'projects/{project_id}/locations/{location}/deployments/{deployment}/revisions/{revision}'.
5326    pub parent: std::string::String,
5327
5328    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5329}
5330
5331impl ExportRevisionStatefileRequest {
5332    pub fn new() -> Self {
5333        std::default::Default::default()
5334    }
5335
5336    /// Sets the value of [parent][crate::model::ExportRevisionStatefileRequest::parent].
5337    ///
5338    /// # Example
5339    /// ```ignore,no_run
5340    /// # use google_cloud_config_v1::model::ExportRevisionStatefileRequest;
5341    /// let x = ExportRevisionStatefileRequest::new().set_parent("example");
5342    /// ```
5343    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5344        self.parent = v.into();
5345        self
5346    }
5347}
5348
5349impl wkt::message::Message for ExportRevisionStatefileRequest {
5350    fn typename() -> &'static str {
5351        "type.googleapis.com/google.cloud.config.v1.ExportRevisionStatefileRequest"
5352    }
5353}
5354
5355/// A request to import a state file passed to a 'ImportStatefile' call.
5356#[derive(Clone, Default, PartialEq)]
5357#[non_exhaustive]
5358pub struct ImportStatefileRequest {
5359    /// Required. The parent in whose context the statefile is listed. The parent
5360    /// value is in the format:
5361    /// 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
5362    pub parent: std::string::String,
5363
5364    /// Required. Lock ID of the lock file to verify that the user who is importing
5365    /// the state file previously locked the Deployment.
5366    pub lock_id: i64,
5367
5368    /// Optional.
5369    pub skip_draft: bool,
5370
5371    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5372}
5373
5374impl ImportStatefileRequest {
5375    pub fn new() -> Self {
5376        std::default::Default::default()
5377    }
5378
5379    /// Sets the value of [parent][crate::model::ImportStatefileRequest::parent].
5380    ///
5381    /// # Example
5382    /// ```ignore,no_run
5383    /// # use google_cloud_config_v1::model::ImportStatefileRequest;
5384    /// let x = ImportStatefileRequest::new().set_parent("example");
5385    /// ```
5386    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5387        self.parent = v.into();
5388        self
5389    }
5390
5391    /// Sets the value of [lock_id][crate::model::ImportStatefileRequest::lock_id].
5392    ///
5393    /// # Example
5394    /// ```ignore,no_run
5395    /// # use google_cloud_config_v1::model::ImportStatefileRequest;
5396    /// let x = ImportStatefileRequest::new().set_lock_id(42);
5397    /// ```
5398    pub fn set_lock_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
5399        self.lock_id = v.into();
5400        self
5401    }
5402
5403    /// Sets the value of [skip_draft][crate::model::ImportStatefileRequest::skip_draft].
5404    ///
5405    /// # Example
5406    /// ```ignore,no_run
5407    /// # use google_cloud_config_v1::model::ImportStatefileRequest;
5408    /// let x = ImportStatefileRequest::new().set_skip_draft(true);
5409    /// ```
5410    pub fn set_skip_draft<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5411        self.skip_draft = v.into();
5412        self
5413    }
5414}
5415
5416impl wkt::message::Message for ImportStatefileRequest {
5417    fn typename() -> &'static str {
5418        "type.googleapis.com/google.cloud.config.v1.ImportStatefileRequest"
5419    }
5420}
5421
5422/// A request to delete a state file passed to a 'DeleteStatefile' call.
5423#[derive(Clone, Default, PartialEq)]
5424#[non_exhaustive]
5425pub struct DeleteStatefileRequest {
5426    /// Required. The name of the deployment in the format:
5427    /// 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
5428    pub name: std::string::String,
5429
5430    /// Required. Lock ID of the lock file to verify that the user who is deleting
5431    /// the state file previously locked the Deployment.
5432    pub lock_id: i64,
5433
5434    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5435}
5436
5437impl DeleteStatefileRequest {
5438    pub fn new() -> Self {
5439        std::default::Default::default()
5440    }
5441
5442    /// Sets the value of [name][crate::model::DeleteStatefileRequest::name].
5443    ///
5444    /// # Example
5445    /// ```ignore,no_run
5446    /// # use google_cloud_config_v1::model::DeleteStatefileRequest;
5447    /// let x = DeleteStatefileRequest::new().set_name("example");
5448    /// ```
5449    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5450        self.name = v.into();
5451        self
5452    }
5453
5454    /// Sets the value of [lock_id][crate::model::DeleteStatefileRequest::lock_id].
5455    ///
5456    /// # Example
5457    /// ```ignore,no_run
5458    /// # use google_cloud_config_v1::model::DeleteStatefileRequest;
5459    /// let x = DeleteStatefileRequest::new().set_lock_id(42);
5460    /// ```
5461    pub fn set_lock_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
5462        self.lock_id = v.into();
5463        self
5464    }
5465}
5466
5467impl wkt::message::Message for DeleteStatefileRequest {
5468    fn typename() -> &'static str {
5469        "type.googleapis.com/google.cloud.config.v1.DeleteStatefileRequest"
5470    }
5471}
5472
5473/// A request to lock a deployment passed to a 'LockDeployment' call.
5474#[derive(Clone, Default, PartialEq)]
5475#[non_exhaustive]
5476pub struct LockDeploymentRequest {
5477    /// Required. The name of the deployment in the format:
5478    /// 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
5479    pub name: std::string::String,
5480
5481    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5482}
5483
5484impl LockDeploymentRequest {
5485    pub fn new() -> Self {
5486        std::default::Default::default()
5487    }
5488
5489    /// Sets the value of [name][crate::model::LockDeploymentRequest::name].
5490    ///
5491    /// # Example
5492    /// ```ignore,no_run
5493    /// # use google_cloud_config_v1::model::LockDeploymentRequest;
5494    /// let x = LockDeploymentRequest::new().set_name("example");
5495    /// ```
5496    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5497        self.name = v.into();
5498        self
5499    }
5500}
5501
5502impl wkt::message::Message for LockDeploymentRequest {
5503    fn typename() -> &'static str {
5504        "type.googleapis.com/google.cloud.config.v1.LockDeploymentRequest"
5505    }
5506}
5507
5508/// A request to unlock a state file passed to a 'UnlockDeployment' call.
5509#[derive(Clone, Default, PartialEq)]
5510#[non_exhaustive]
5511pub struct UnlockDeploymentRequest {
5512    /// Required. The name of the deployment in the format:
5513    /// 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
5514    pub name: std::string::String,
5515
5516    /// Required. Lock ID of the lock file to be unlocked.
5517    pub lock_id: i64,
5518
5519    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5520}
5521
5522impl UnlockDeploymentRequest {
5523    pub fn new() -> Self {
5524        std::default::Default::default()
5525    }
5526
5527    /// Sets the value of [name][crate::model::UnlockDeploymentRequest::name].
5528    ///
5529    /// # Example
5530    /// ```ignore,no_run
5531    /// # use google_cloud_config_v1::model::UnlockDeploymentRequest;
5532    /// let x = UnlockDeploymentRequest::new().set_name("example");
5533    /// ```
5534    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5535        self.name = v.into();
5536        self
5537    }
5538
5539    /// Sets the value of [lock_id][crate::model::UnlockDeploymentRequest::lock_id].
5540    ///
5541    /// # Example
5542    /// ```ignore,no_run
5543    /// # use google_cloud_config_v1::model::UnlockDeploymentRequest;
5544    /// let x = UnlockDeploymentRequest::new().set_lock_id(42);
5545    /// ```
5546    pub fn set_lock_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
5547        self.lock_id = v.into();
5548        self
5549    }
5550}
5551
5552impl wkt::message::Message for UnlockDeploymentRequest {
5553    fn typename() -> &'static str {
5554        "type.googleapis.com/google.cloud.config.v1.UnlockDeploymentRequest"
5555    }
5556}
5557
5558/// A request to get a state file lock info passed to a 'ExportLockInfo' call.
5559#[derive(Clone, Default, PartialEq)]
5560#[non_exhaustive]
5561pub struct ExportLockInfoRequest {
5562    /// Required. The name of the deployment in the format:
5563    /// 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
5564    pub name: std::string::String,
5565
5566    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5567}
5568
5569impl ExportLockInfoRequest {
5570    pub fn new() -> Self {
5571        std::default::Default::default()
5572    }
5573
5574    /// Sets the value of [name][crate::model::ExportLockInfoRequest::name].
5575    ///
5576    /// # Example
5577    /// ```ignore,no_run
5578    /// # use google_cloud_config_v1::model::ExportLockInfoRequest;
5579    /// let x = ExportLockInfoRequest::new().set_name("example");
5580    /// ```
5581    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5582        self.name = v.into();
5583        self
5584    }
5585}
5586
5587impl wkt::message::Message for ExportLockInfoRequest {
5588    fn typename() -> &'static str {
5589        "type.googleapis.com/google.cloud.config.v1.ExportLockInfoRequest"
5590    }
5591}
5592
5593/// Details about the lock which locked the deployment.
5594#[derive(Clone, Default, PartialEq)]
5595#[non_exhaustive]
5596pub struct LockInfo {
5597    /// Unique ID for the lock to be overridden with generation ID in the backend.
5598    pub lock_id: i64,
5599
5600    /// Terraform operation, provided by the caller.
5601    pub operation: std::string::String,
5602
5603    /// Extra information to store with the lock, provided by the caller.
5604    pub info: std::string::String,
5605
5606    /// user@hostname when available
5607    pub who: std::string::String,
5608
5609    /// Terraform version
5610    pub version: std::string::String,
5611
5612    /// Time that the lock was taken.
5613    pub create_time: std::option::Option<wkt::Timestamp>,
5614
5615    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5616}
5617
5618impl LockInfo {
5619    pub fn new() -> Self {
5620        std::default::Default::default()
5621    }
5622
5623    /// Sets the value of [lock_id][crate::model::LockInfo::lock_id].
5624    ///
5625    /// # Example
5626    /// ```ignore,no_run
5627    /// # use google_cloud_config_v1::model::LockInfo;
5628    /// let x = LockInfo::new().set_lock_id(42);
5629    /// ```
5630    pub fn set_lock_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
5631        self.lock_id = v.into();
5632        self
5633    }
5634
5635    /// Sets the value of [operation][crate::model::LockInfo::operation].
5636    ///
5637    /// # Example
5638    /// ```ignore,no_run
5639    /// # use google_cloud_config_v1::model::LockInfo;
5640    /// let x = LockInfo::new().set_operation("example");
5641    /// ```
5642    pub fn set_operation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5643        self.operation = v.into();
5644        self
5645    }
5646
5647    /// Sets the value of [info][crate::model::LockInfo::info].
5648    ///
5649    /// # Example
5650    /// ```ignore,no_run
5651    /// # use google_cloud_config_v1::model::LockInfo;
5652    /// let x = LockInfo::new().set_info("example");
5653    /// ```
5654    pub fn set_info<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5655        self.info = v.into();
5656        self
5657    }
5658
5659    /// Sets the value of [who][crate::model::LockInfo::who].
5660    ///
5661    /// # Example
5662    /// ```ignore,no_run
5663    /// # use google_cloud_config_v1::model::LockInfo;
5664    /// let x = LockInfo::new().set_who("example");
5665    /// ```
5666    pub fn set_who<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5667        self.who = v.into();
5668        self
5669    }
5670
5671    /// Sets the value of [version][crate::model::LockInfo::version].
5672    ///
5673    /// # Example
5674    /// ```ignore,no_run
5675    /// # use google_cloud_config_v1::model::LockInfo;
5676    /// let x = LockInfo::new().set_version("example");
5677    /// ```
5678    pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5679        self.version = v.into();
5680        self
5681    }
5682
5683    /// Sets the value of [create_time][crate::model::LockInfo::create_time].
5684    ///
5685    /// # Example
5686    /// ```ignore,no_run
5687    /// # use google_cloud_config_v1::model::LockInfo;
5688    /// use wkt::Timestamp;
5689    /// let x = LockInfo::new().set_create_time(Timestamp::default()/* use setters */);
5690    /// ```
5691    pub fn set_create_time<T>(mut self, v: T) -> Self
5692    where
5693        T: std::convert::Into<wkt::Timestamp>,
5694    {
5695        self.create_time = std::option::Option::Some(v.into());
5696        self
5697    }
5698
5699    /// Sets or clears the value of [create_time][crate::model::LockInfo::create_time].
5700    ///
5701    /// # Example
5702    /// ```ignore,no_run
5703    /// # use google_cloud_config_v1::model::LockInfo;
5704    /// use wkt::Timestamp;
5705    /// let x = LockInfo::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
5706    /// let x = LockInfo::new().set_or_clear_create_time(None::<Timestamp>);
5707    /// ```
5708    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
5709    where
5710        T: std::convert::Into<wkt::Timestamp>,
5711    {
5712        self.create_time = v.map(|x| x.into());
5713        self
5714    }
5715}
5716
5717impl wkt::message::Message for LockInfo {
5718    fn typename() -> &'static str {
5719        "type.googleapis.com/google.cloud.config.v1.LockInfo"
5720    }
5721}
5722
5723/// A preview represents a set of actions Infra Manager would perform
5724/// to move the resources towards the desired state as specified in the
5725/// configuration.
5726#[derive(Clone, Default, PartialEq)]
5727#[non_exhaustive]
5728pub struct Preview {
5729    /// Identifier. Resource name of the preview. Resource name can be user
5730    /// provided or server generated ID if unspecified. Format:
5731    /// `projects/{project}/locations/{location}/previews/{preview}`
5732    pub name: std::string::String,
5733
5734    /// Output only. Time the preview was created.
5735    pub create_time: std::option::Option<wkt::Timestamp>,
5736
5737    /// Optional. User-defined labels for the preview.
5738    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
5739
5740    /// Output only. Current state of the preview.
5741    pub state: crate::model::preview::State,
5742
5743    /// Optional. Optional deployment reference. If specified, the preview will be
5744    /// performed using the provided deployment's current state and use any
5745    /// relevant fields from the deployment unless explicitly specified in the
5746    /// preview create request.
5747    pub deployment: std::string::String,
5748
5749    /// Optional. Current mode of preview.
5750    pub preview_mode: crate::model::preview::PreviewMode,
5751
5752    /// Required. User-specified Service Account (SA) credentials to be used when
5753    /// previewing resources.
5754    /// Format: `projects/{projectID}/serviceAccounts/{serviceAccount}`
5755    pub service_account: std::string::String,
5756
5757    /// Optional. User-defined location of Cloud Build logs, artifacts, and
5758    /// in Google Cloud Storage.
5759    /// Format: `gs://{bucket}/{folder}`
5760    /// A default bucket will be bootstrapped if the field is not set or empty
5761    /// Default Bucket Format: `gs://<project number>-<region>-blueprint-config`
5762    /// Constraints:
5763    ///
5764    /// - The bucket needs to be in the same project as the deployment
5765    /// - The path cannot be within the path of `gcs_source`
5766    ///   If omitted and deployment resource ref provided has artifacts_gcs_bucket
5767    ///   defined, that artifact bucket is used.
5768    pub artifacts_gcs_bucket: std::option::Option<std::string::String>,
5769
5770    /// Optional. The user-specified Worker Pool resource in which the Cloud Build
5771    /// job will execute. Format
5772    /// projects/{project}/locations/{location}/workerPools/{workerPoolId} If this
5773    /// field is unspecified, the default Cloud Build worker pool will be used. If
5774    /// omitted and deployment resource ref provided has worker_pool defined, that
5775    /// worker pool is used.
5776    pub worker_pool: std::option::Option<std::string::String>,
5777
5778    /// Output only. Code describing any errors that may have occurred.
5779    pub error_code: crate::model::preview::ErrorCode,
5780
5781    /// Output only. Additional information regarding the current state.
5782    pub error_status: std::option::Option<google_cloud_rpc::model::Status>,
5783
5784    /// Output only. Cloud Build instance UUID associated with this preview.
5785    pub build: std::string::String,
5786
5787    /// Output only. Summary of errors encountered during Terraform preview.
5788    /// It has a size limit of 10, i.e. only top 10 errors will be summarized here.
5789    pub tf_errors: std::vec::Vec<crate::model::TerraformError>,
5790
5791    /// Output only. Link to tf-error.ndjson file, which contains the full list of
5792    /// the errors encountered during a Terraform preview.
5793    /// Format: `gs://{bucket}/{object}`.
5794    pub error_logs: std::string::String,
5795
5796    /// Output only. Artifacts from preview.
5797    pub preview_artifacts: std::option::Option<crate::model::PreviewArtifacts>,
5798
5799    /// Output only. Location of preview logs in `gs://{bucket}/{object}` format.
5800    pub logs: std::string::String,
5801
5802    /// Output only. The current Terraform version set on the preview.
5803    /// It is in the format of "Major.Minor.Patch", for example, "1.3.10".
5804    pub tf_version: std::string::String,
5805
5806    /// Optional. The user-specified Terraform version constraint.
5807    /// Example: "=1.3.10".
5808    pub tf_version_constraint: std::option::Option<std::string::String>,
5809
5810    /// Optional. Arbitrary key-value metadata storage e.g. to help client tools
5811    /// identify preview during automation. See
5812    /// <https://google.aip.dev/148#annotations> for details on format and size
5813    /// limitations.
5814    pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
5815
5816    /// Optional. This field specifies the provider configurations.
5817    pub provider_config: std::option::Option<crate::model::ProviderConfig>,
5818
5819    /// Blueprint to preview.
5820    pub blueprint: std::option::Option<crate::model::preview::Blueprint>,
5821
5822    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5823}
5824
5825impl Preview {
5826    pub fn new() -> Self {
5827        std::default::Default::default()
5828    }
5829
5830    /// Sets the value of [name][crate::model::Preview::name].
5831    ///
5832    /// # Example
5833    /// ```ignore,no_run
5834    /// # use google_cloud_config_v1::model::Preview;
5835    /// let x = Preview::new().set_name("example");
5836    /// ```
5837    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5838        self.name = v.into();
5839        self
5840    }
5841
5842    /// Sets the value of [create_time][crate::model::Preview::create_time].
5843    ///
5844    /// # Example
5845    /// ```ignore,no_run
5846    /// # use google_cloud_config_v1::model::Preview;
5847    /// use wkt::Timestamp;
5848    /// let x = Preview::new().set_create_time(Timestamp::default()/* use setters */);
5849    /// ```
5850    pub fn set_create_time<T>(mut self, v: T) -> Self
5851    where
5852        T: std::convert::Into<wkt::Timestamp>,
5853    {
5854        self.create_time = std::option::Option::Some(v.into());
5855        self
5856    }
5857
5858    /// Sets or clears the value of [create_time][crate::model::Preview::create_time].
5859    ///
5860    /// # Example
5861    /// ```ignore,no_run
5862    /// # use google_cloud_config_v1::model::Preview;
5863    /// use wkt::Timestamp;
5864    /// let x = Preview::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
5865    /// let x = Preview::new().set_or_clear_create_time(None::<Timestamp>);
5866    /// ```
5867    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
5868    where
5869        T: std::convert::Into<wkt::Timestamp>,
5870    {
5871        self.create_time = v.map(|x| x.into());
5872        self
5873    }
5874
5875    /// Sets the value of [labels][crate::model::Preview::labels].
5876    ///
5877    /// # Example
5878    /// ```ignore,no_run
5879    /// # use google_cloud_config_v1::model::Preview;
5880    /// let x = Preview::new().set_labels([
5881    ///     ("key0", "abc"),
5882    ///     ("key1", "xyz"),
5883    /// ]);
5884    /// ```
5885    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
5886    where
5887        T: std::iter::IntoIterator<Item = (K, V)>,
5888        K: std::convert::Into<std::string::String>,
5889        V: std::convert::Into<std::string::String>,
5890    {
5891        use std::iter::Iterator;
5892        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5893        self
5894    }
5895
5896    /// Sets the value of [state][crate::model::Preview::state].
5897    ///
5898    /// # Example
5899    /// ```ignore,no_run
5900    /// # use google_cloud_config_v1::model::Preview;
5901    /// use google_cloud_config_v1::model::preview::State;
5902    /// let x0 = Preview::new().set_state(State::Creating);
5903    /// let x1 = Preview::new().set_state(State::Succeeded);
5904    /// let x2 = Preview::new().set_state(State::Applying);
5905    /// ```
5906    pub fn set_state<T: std::convert::Into<crate::model::preview::State>>(mut self, v: T) -> Self {
5907        self.state = v.into();
5908        self
5909    }
5910
5911    /// Sets the value of [deployment][crate::model::Preview::deployment].
5912    ///
5913    /// # Example
5914    /// ```ignore,no_run
5915    /// # use google_cloud_config_v1::model::Preview;
5916    /// let x = Preview::new().set_deployment("example");
5917    /// ```
5918    pub fn set_deployment<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5919        self.deployment = v.into();
5920        self
5921    }
5922
5923    /// Sets the value of [preview_mode][crate::model::Preview::preview_mode].
5924    ///
5925    /// # Example
5926    /// ```ignore,no_run
5927    /// # use google_cloud_config_v1::model::Preview;
5928    /// use google_cloud_config_v1::model::preview::PreviewMode;
5929    /// let x0 = Preview::new().set_preview_mode(PreviewMode::Default);
5930    /// let x1 = Preview::new().set_preview_mode(PreviewMode::Delete);
5931    /// ```
5932    pub fn set_preview_mode<T: std::convert::Into<crate::model::preview::PreviewMode>>(
5933        mut self,
5934        v: T,
5935    ) -> Self {
5936        self.preview_mode = v.into();
5937        self
5938    }
5939
5940    /// Sets the value of [service_account][crate::model::Preview::service_account].
5941    ///
5942    /// # Example
5943    /// ```ignore,no_run
5944    /// # use google_cloud_config_v1::model::Preview;
5945    /// let x = Preview::new().set_service_account("example");
5946    /// ```
5947    pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5948        self.service_account = v.into();
5949        self
5950    }
5951
5952    /// Sets the value of [artifacts_gcs_bucket][crate::model::Preview::artifacts_gcs_bucket].
5953    ///
5954    /// # Example
5955    /// ```ignore,no_run
5956    /// # use google_cloud_config_v1::model::Preview;
5957    /// let x = Preview::new().set_artifacts_gcs_bucket("example");
5958    /// ```
5959    pub fn set_artifacts_gcs_bucket<T>(mut self, v: T) -> Self
5960    where
5961        T: std::convert::Into<std::string::String>,
5962    {
5963        self.artifacts_gcs_bucket = std::option::Option::Some(v.into());
5964        self
5965    }
5966
5967    /// Sets or clears the value of [artifacts_gcs_bucket][crate::model::Preview::artifacts_gcs_bucket].
5968    ///
5969    /// # Example
5970    /// ```ignore,no_run
5971    /// # use google_cloud_config_v1::model::Preview;
5972    /// let x = Preview::new().set_or_clear_artifacts_gcs_bucket(Some("example"));
5973    /// let x = Preview::new().set_or_clear_artifacts_gcs_bucket(None::<String>);
5974    /// ```
5975    pub fn set_or_clear_artifacts_gcs_bucket<T>(mut self, v: std::option::Option<T>) -> Self
5976    where
5977        T: std::convert::Into<std::string::String>,
5978    {
5979        self.artifacts_gcs_bucket = v.map(|x| x.into());
5980        self
5981    }
5982
5983    /// Sets the value of [worker_pool][crate::model::Preview::worker_pool].
5984    ///
5985    /// # Example
5986    /// ```ignore,no_run
5987    /// # use google_cloud_config_v1::model::Preview;
5988    /// let x = Preview::new().set_worker_pool("example");
5989    /// ```
5990    pub fn set_worker_pool<T>(mut self, v: T) -> Self
5991    where
5992        T: std::convert::Into<std::string::String>,
5993    {
5994        self.worker_pool = std::option::Option::Some(v.into());
5995        self
5996    }
5997
5998    /// Sets or clears the value of [worker_pool][crate::model::Preview::worker_pool].
5999    ///
6000    /// # Example
6001    /// ```ignore,no_run
6002    /// # use google_cloud_config_v1::model::Preview;
6003    /// let x = Preview::new().set_or_clear_worker_pool(Some("example"));
6004    /// let x = Preview::new().set_or_clear_worker_pool(None::<String>);
6005    /// ```
6006    pub fn set_or_clear_worker_pool<T>(mut self, v: std::option::Option<T>) -> Self
6007    where
6008        T: std::convert::Into<std::string::String>,
6009    {
6010        self.worker_pool = v.map(|x| x.into());
6011        self
6012    }
6013
6014    /// Sets the value of [error_code][crate::model::Preview::error_code].
6015    ///
6016    /// # Example
6017    /// ```ignore,no_run
6018    /// # use google_cloud_config_v1::model::Preview;
6019    /// use google_cloud_config_v1::model::preview::ErrorCode;
6020    /// let x0 = Preview::new().set_error_code(ErrorCode::CloudBuildPermissionDenied);
6021    /// let x1 = Preview::new().set_error_code(ErrorCode::BucketCreationPermissionDenied);
6022    /// let x2 = Preview::new().set_error_code(ErrorCode::BucketCreationFailed);
6023    /// ```
6024    pub fn set_error_code<T: std::convert::Into<crate::model::preview::ErrorCode>>(
6025        mut self,
6026        v: T,
6027    ) -> Self {
6028        self.error_code = v.into();
6029        self
6030    }
6031
6032    /// Sets the value of [error_status][crate::model::Preview::error_status].
6033    ///
6034    /// # Example
6035    /// ```ignore,no_run
6036    /// # use google_cloud_config_v1::model::Preview;
6037    /// use google_cloud_rpc::model::Status;
6038    /// let x = Preview::new().set_error_status(Status::default()/* use setters */);
6039    /// ```
6040    pub fn set_error_status<T>(mut self, v: T) -> Self
6041    where
6042        T: std::convert::Into<google_cloud_rpc::model::Status>,
6043    {
6044        self.error_status = std::option::Option::Some(v.into());
6045        self
6046    }
6047
6048    /// Sets or clears the value of [error_status][crate::model::Preview::error_status].
6049    ///
6050    /// # Example
6051    /// ```ignore,no_run
6052    /// # use google_cloud_config_v1::model::Preview;
6053    /// use google_cloud_rpc::model::Status;
6054    /// let x = Preview::new().set_or_clear_error_status(Some(Status::default()/* use setters */));
6055    /// let x = Preview::new().set_or_clear_error_status(None::<Status>);
6056    /// ```
6057    pub fn set_or_clear_error_status<T>(mut self, v: std::option::Option<T>) -> Self
6058    where
6059        T: std::convert::Into<google_cloud_rpc::model::Status>,
6060    {
6061        self.error_status = v.map(|x| x.into());
6062        self
6063    }
6064
6065    /// Sets the value of [build][crate::model::Preview::build].
6066    ///
6067    /// # Example
6068    /// ```ignore,no_run
6069    /// # use google_cloud_config_v1::model::Preview;
6070    /// let x = Preview::new().set_build("example");
6071    /// ```
6072    pub fn set_build<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6073        self.build = v.into();
6074        self
6075    }
6076
6077    /// Sets the value of [tf_errors][crate::model::Preview::tf_errors].
6078    ///
6079    /// # Example
6080    /// ```ignore,no_run
6081    /// # use google_cloud_config_v1::model::Preview;
6082    /// use google_cloud_config_v1::model::TerraformError;
6083    /// let x = Preview::new()
6084    ///     .set_tf_errors([
6085    ///         TerraformError::default()/* use setters */,
6086    ///         TerraformError::default()/* use (different) setters */,
6087    ///     ]);
6088    /// ```
6089    pub fn set_tf_errors<T, V>(mut self, v: T) -> Self
6090    where
6091        T: std::iter::IntoIterator<Item = V>,
6092        V: std::convert::Into<crate::model::TerraformError>,
6093    {
6094        use std::iter::Iterator;
6095        self.tf_errors = v.into_iter().map(|i| i.into()).collect();
6096        self
6097    }
6098
6099    /// Sets the value of [error_logs][crate::model::Preview::error_logs].
6100    ///
6101    /// # Example
6102    /// ```ignore,no_run
6103    /// # use google_cloud_config_v1::model::Preview;
6104    /// let x = Preview::new().set_error_logs("example");
6105    /// ```
6106    pub fn set_error_logs<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6107        self.error_logs = v.into();
6108        self
6109    }
6110
6111    /// Sets the value of [preview_artifacts][crate::model::Preview::preview_artifacts].
6112    ///
6113    /// # Example
6114    /// ```ignore,no_run
6115    /// # use google_cloud_config_v1::model::Preview;
6116    /// use google_cloud_config_v1::model::PreviewArtifacts;
6117    /// let x = Preview::new().set_preview_artifacts(PreviewArtifacts::default()/* use setters */);
6118    /// ```
6119    pub fn set_preview_artifacts<T>(mut self, v: T) -> Self
6120    where
6121        T: std::convert::Into<crate::model::PreviewArtifacts>,
6122    {
6123        self.preview_artifacts = std::option::Option::Some(v.into());
6124        self
6125    }
6126
6127    /// Sets or clears the value of [preview_artifacts][crate::model::Preview::preview_artifacts].
6128    ///
6129    /// # Example
6130    /// ```ignore,no_run
6131    /// # use google_cloud_config_v1::model::Preview;
6132    /// use google_cloud_config_v1::model::PreviewArtifacts;
6133    /// let x = Preview::new().set_or_clear_preview_artifacts(Some(PreviewArtifacts::default()/* use setters */));
6134    /// let x = Preview::new().set_or_clear_preview_artifacts(None::<PreviewArtifacts>);
6135    /// ```
6136    pub fn set_or_clear_preview_artifacts<T>(mut self, v: std::option::Option<T>) -> Self
6137    where
6138        T: std::convert::Into<crate::model::PreviewArtifacts>,
6139    {
6140        self.preview_artifacts = v.map(|x| x.into());
6141        self
6142    }
6143
6144    /// Sets the value of [logs][crate::model::Preview::logs].
6145    ///
6146    /// # Example
6147    /// ```ignore,no_run
6148    /// # use google_cloud_config_v1::model::Preview;
6149    /// let x = Preview::new().set_logs("example");
6150    /// ```
6151    pub fn set_logs<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6152        self.logs = v.into();
6153        self
6154    }
6155
6156    /// Sets the value of [tf_version][crate::model::Preview::tf_version].
6157    ///
6158    /// # Example
6159    /// ```ignore,no_run
6160    /// # use google_cloud_config_v1::model::Preview;
6161    /// let x = Preview::new().set_tf_version("example");
6162    /// ```
6163    pub fn set_tf_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6164        self.tf_version = v.into();
6165        self
6166    }
6167
6168    /// Sets the value of [tf_version_constraint][crate::model::Preview::tf_version_constraint].
6169    ///
6170    /// # Example
6171    /// ```ignore,no_run
6172    /// # use google_cloud_config_v1::model::Preview;
6173    /// let x = Preview::new().set_tf_version_constraint("example");
6174    /// ```
6175    pub fn set_tf_version_constraint<T>(mut self, v: T) -> Self
6176    where
6177        T: std::convert::Into<std::string::String>,
6178    {
6179        self.tf_version_constraint = std::option::Option::Some(v.into());
6180        self
6181    }
6182
6183    /// Sets or clears the value of [tf_version_constraint][crate::model::Preview::tf_version_constraint].
6184    ///
6185    /// # Example
6186    /// ```ignore,no_run
6187    /// # use google_cloud_config_v1::model::Preview;
6188    /// let x = Preview::new().set_or_clear_tf_version_constraint(Some("example"));
6189    /// let x = Preview::new().set_or_clear_tf_version_constraint(None::<String>);
6190    /// ```
6191    pub fn set_or_clear_tf_version_constraint<T>(mut self, v: std::option::Option<T>) -> Self
6192    where
6193        T: std::convert::Into<std::string::String>,
6194    {
6195        self.tf_version_constraint = v.map(|x| x.into());
6196        self
6197    }
6198
6199    /// Sets the value of [annotations][crate::model::Preview::annotations].
6200    ///
6201    /// # Example
6202    /// ```ignore,no_run
6203    /// # use google_cloud_config_v1::model::Preview;
6204    /// let x = Preview::new().set_annotations([
6205    ///     ("key0", "abc"),
6206    ///     ("key1", "xyz"),
6207    /// ]);
6208    /// ```
6209    pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
6210    where
6211        T: std::iter::IntoIterator<Item = (K, V)>,
6212        K: std::convert::Into<std::string::String>,
6213        V: std::convert::Into<std::string::String>,
6214    {
6215        use std::iter::Iterator;
6216        self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
6217        self
6218    }
6219
6220    /// Sets the value of [provider_config][crate::model::Preview::provider_config].
6221    ///
6222    /// # Example
6223    /// ```ignore,no_run
6224    /// # use google_cloud_config_v1::model::Preview;
6225    /// use google_cloud_config_v1::model::ProviderConfig;
6226    /// let x = Preview::new().set_provider_config(ProviderConfig::default()/* use setters */);
6227    /// ```
6228    pub fn set_provider_config<T>(mut self, v: T) -> Self
6229    where
6230        T: std::convert::Into<crate::model::ProviderConfig>,
6231    {
6232        self.provider_config = std::option::Option::Some(v.into());
6233        self
6234    }
6235
6236    /// Sets or clears the value of [provider_config][crate::model::Preview::provider_config].
6237    ///
6238    /// # Example
6239    /// ```ignore,no_run
6240    /// # use google_cloud_config_v1::model::Preview;
6241    /// use google_cloud_config_v1::model::ProviderConfig;
6242    /// let x = Preview::new().set_or_clear_provider_config(Some(ProviderConfig::default()/* use setters */));
6243    /// let x = Preview::new().set_or_clear_provider_config(None::<ProviderConfig>);
6244    /// ```
6245    pub fn set_or_clear_provider_config<T>(mut self, v: std::option::Option<T>) -> Self
6246    where
6247        T: std::convert::Into<crate::model::ProviderConfig>,
6248    {
6249        self.provider_config = v.map(|x| x.into());
6250        self
6251    }
6252
6253    /// Sets the value of [blueprint][crate::model::Preview::blueprint].
6254    ///
6255    /// Note that all the setters affecting `blueprint` are mutually
6256    /// exclusive.
6257    ///
6258    /// # Example
6259    /// ```ignore,no_run
6260    /// # use google_cloud_config_v1::model::Preview;
6261    /// use google_cloud_config_v1::model::TerraformBlueprint;
6262    /// let x = Preview::new().set_blueprint(Some(
6263    ///     google_cloud_config_v1::model::preview::Blueprint::TerraformBlueprint(TerraformBlueprint::default().into())));
6264    /// ```
6265    pub fn set_blueprint<
6266        T: std::convert::Into<std::option::Option<crate::model::preview::Blueprint>>,
6267    >(
6268        mut self,
6269        v: T,
6270    ) -> Self {
6271        self.blueprint = v.into();
6272        self
6273    }
6274
6275    /// The value of [blueprint][crate::model::Preview::blueprint]
6276    /// if it holds a `TerraformBlueprint`, `None` if the field is not set or
6277    /// holds a different branch.
6278    pub fn terraform_blueprint(
6279        &self,
6280    ) -> std::option::Option<&std::boxed::Box<crate::model::TerraformBlueprint>> {
6281        #[allow(unreachable_patterns)]
6282        self.blueprint.as_ref().and_then(|v| match v {
6283            crate::model::preview::Blueprint::TerraformBlueprint(v) => std::option::Option::Some(v),
6284            _ => std::option::Option::None,
6285        })
6286    }
6287
6288    /// Sets the value of [blueprint][crate::model::Preview::blueprint]
6289    /// to hold a `TerraformBlueprint`.
6290    ///
6291    /// Note that all the setters affecting `blueprint` are
6292    /// mutually exclusive.
6293    ///
6294    /// # Example
6295    /// ```ignore,no_run
6296    /// # use google_cloud_config_v1::model::Preview;
6297    /// use google_cloud_config_v1::model::TerraformBlueprint;
6298    /// let x = Preview::new().set_terraform_blueprint(TerraformBlueprint::default()/* use setters */);
6299    /// assert!(x.terraform_blueprint().is_some());
6300    /// ```
6301    pub fn set_terraform_blueprint<
6302        T: std::convert::Into<std::boxed::Box<crate::model::TerraformBlueprint>>,
6303    >(
6304        mut self,
6305        v: T,
6306    ) -> Self {
6307        self.blueprint = std::option::Option::Some(
6308            crate::model::preview::Blueprint::TerraformBlueprint(v.into()),
6309        );
6310        self
6311    }
6312}
6313
6314impl wkt::message::Message for Preview {
6315    fn typename() -> &'static str {
6316        "type.googleapis.com/google.cloud.config.v1.Preview"
6317    }
6318}
6319
6320/// Defines additional types related to [Preview].
6321pub mod preview {
6322    #[allow(unused_imports)]
6323    use super::*;
6324
6325    /// Possible states of a preview.
6326    ///
6327    /// # Working with unknown values
6328    ///
6329    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6330    /// additional enum variants at any time. Adding new variants is not considered
6331    /// a breaking change. Applications should write their code in anticipation of:
6332    ///
6333    /// - New values appearing in future releases of the client library, **and**
6334    /// - New values received dynamically, without application changes.
6335    ///
6336    /// Please consult the [Working with enums] section in the user guide for some
6337    /// guidelines.
6338    ///
6339    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
6340    #[derive(Clone, Debug, PartialEq)]
6341    #[non_exhaustive]
6342    pub enum State {
6343        /// The default value. This value is used if the state is unknown.
6344        Unspecified,
6345        /// The preview is being created.
6346        Creating,
6347        /// The preview has succeeded.
6348        Succeeded,
6349        /// The preview is being applied.
6350        Applying,
6351        /// The preview is stale. A preview can become stale if a revision has been
6352        /// applied after this preview was created.
6353        Stale,
6354        /// The preview is being deleted.
6355        Deleting,
6356        /// The preview has encountered an unexpected error.
6357        Failed,
6358        /// The preview has been deleted.
6359        Deleted,
6360        /// If set, the enum was initialized with an unknown value.
6361        ///
6362        /// Applications can examine the value using [State::value] or
6363        /// [State::name].
6364        UnknownValue(state::UnknownValue),
6365    }
6366
6367    #[doc(hidden)]
6368    pub mod state {
6369        #[allow(unused_imports)]
6370        use super::*;
6371        #[derive(Clone, Debug, PartialEq)]
6372        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6373    }
6374
6375    impl State {
6376        /// Gets the enum value.
6377        ///
6378        /// Returns `None` if the enum contains an unknown value deserialized from
6379        /// the string representation of enums.
6380        pub fn value(&self) -> std::option::Option<i32> {
6381            match self {
6382                Self::Unspecified => std::option::Option::Some(0),
6383                Self::Creating => std::option::Option::Some(1),
6384                Self::Succeeded => std::option::Option::Some(2),
6385                Self::Applying => std::option::Option::Some(3),
6386                Self::Stale => std::option::Option::Some(4),
6387                Self::Deleting => std::option::Option::Some(5),
6388                Self::Failed => std::option::Option::Some(6),
6389                Self::Deleted => std::option::Option::Some(7),
6390                Self::UnknownValue(u) => u.0.value(),
6391            }
6392        }
6393
6394        /// Gets the enum value as a string.
6395        ///
6396        /// Returns `None` if the enum contains an unknown value deserialized from
6397        /// the integer representation of enums.
6398        pub fn name(&self) -> std::option::Option<&str> {
6399            match self {
6400                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
6401                Self::Creating => std::option::Option::Some("CREATING"),
6402                Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
6403                Self::Applying => std::option::Option::Some("APPLYING"),
6404                Self::Stale => std::option::Option::Some("STALE"),
6405                Self::Deleting => std::option::Option::Some("DELETING"),
6406                Self::Failed => std::option::Option::Some("FAILED"),
6407                Self::Deleted => std::option::Option::Some("DELETED"),
6408                Self::UnknownValue(u) => u.0.name(),
6409            }
6410        }
6411    }
6412
6413    impl std::default::Default for State {
6414        fn default() -> Self {
6415            use std::convert::From;
6416            Self::from(0)
6417        }
6418    }
6419
6420    impl std::fmt::Display for State {
6421        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6422            wkt::internal::display_enum(f, self.name(), self.value())
6423        }
6424    }
6425
6426    impl std::convert::From<i32> for State {
6427        fn from(value: i32) -> Self {
6428            match value {
6429                0 => Self::Unspecified,
6430                1 => Self::Creating,
6431                2 => Self::Succeeded,
6432                3 => Self::Applying,
6433                4 => Self::Stale,
6434                5 => Self::Deleting,
6435                6 => Self::Failed,
6436                7 => Self::Deleted,
6437                _ => Self::UnknownValue(state::UnknownValue(
6438                    wkt::internal::UnknownEnumValue::Integer(value),
6439                )),
6440            }
6441        }
6442    }
6443
6444    impl std::convert::From<&str> for State {
6445        fn from(value: &str) -> Self {
6446            use std::string::ToString;
6447            match value {
6448                "STATE_UNSPECIFIED" => Self::Unspecified,
6449                "CREATING" => Self::Creating,
6450                "SUCCEEDED" => Self::Succeeded,
6451                "APPLYING" => Self::Applying,
6452                "STALE" => Self::Stale,
6453                "DELETING" => Self::Deleting,
6454                "FAILED" => Self::Failed,
6455                "DELETED" => Self::Deleted,
6456                _ => Self::UnknownValue(state::UnknownValue(
6457                    wkt::internal::UnknownEnumValue::String(value.to_string()),
6458                )),
6459            }
6460        }
6461    }
6462
6463    impl serde::ser::Serialize for State {
6464        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6465        where
6466            S: serde::Serializer,
6467        {
6468            match self {
6469                Self::Unspecified => serializer.serialize_i32(0),
6470                Self::Creating => serializer.serialize_i32(1),
6471                Self::Succeeded => serializer.serialize_i32(2),
6472                Self::Applying => serializer.serialize_i32(3),
6473                Self::Stale => serializer.serialize_i32(4),
6474                Self::Deleting => serializer.serialize_i32(5),
6475                Self::Failed => serializer.serialize_i32(6),
6476                Self::Deleted => serializer.serialize_i32(7),
6477                Self::UnknownValue(u) => u.0.serialize(serializer),
6478            }
6479        }
6480    }
6481
6482    impl<'de> serde::de::Deserialize<'de> for State {
6483        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6484        where
6485            D: serde::Deserializer<'de>,
6486        {
6487            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
6488                ".google.cloud.config.v1.Preview.State",
6489            ))
6490        }
6491    }
6492
6493    /// Preview mode provides options for customizing preview operations.
6494    ///
6495    /// # Working with unknown values
6496    ///
6497    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6498    /// additional enum variants at any time. Adding new variants is not considered
6499    /// a breaking change. Applications should write their code in anticipation of:
6500    ///
6501    /// - New values appearing in future releases of the client library, **and**
6502    /// - New values received dynamically, without application changes.
6503    ///
6504    /// Please consult the [Working with enums] section in the user guide for some
6505    /// guidelines.
6506    ///
6507    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
6508    #[derive(Clone, Debug, PartialEq)]
6509    #[non_exhaustive]
6510    pub enum PreviewMode {
6511        /// Unspecified policy, default mode will be used.
6512        Unspecified,
6513        /// DEFAULT mode generates an execution plan for reconciling current resource
6514        /// state into expected resource state.
6515        Default,
6516        /// DELETE mode generates as execution plan for destroying current resources.
6517        Delete,
6518        /// If set, the enum was initialized with an unknown value.
6519        ///
6520        /// Applications can examine the value using [PreviewMode::value] or
6521        /// [PreviewMode::name].
6522        UnknownValue(preview_mode::UnknownValue),
6523    }
6524
6525    #[doc(hidden)]
6526    pub mod preview_mode {
6527        #[allow(unused_imports)]
6528        use super::*;
6529        #[derive(Clone, Debug, PartialEq)]
6530        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6531    }
6532
6533    impl PreviewMode {
6534        /// Gets the enum value.
6535        ///
6536        /// Returns `None` if the enum contains an unknown value deserialized from
6537        /// the string representation of enums.
6538        pub fn value(&self) -> std::option::Option<i32> {
6539            match self {
6540                Self::Unspecified => std::option::Option::Some(0),
6541                Self::Default => std::option::Option::Some(1),
6542                Self::Delete => std::option::Option::Some(2),
6543                Self::UnknownValue(u) => u.0.value(),
6544            }
6545        }
6546
6547        /// Gets the enum value as a string.
6548        ///
6549        /// Returns `None` if the enum contains an unknown value deserialized from
6550        /// the integer representation of enums.
6551        pub fn name(&self) -> std::option::Option<&str> {
6552            match self {
6553                Self::Unspecified => std::option::Option::Some("PREVIEW_MODE_UNSPECIFIED"),
6554                Self::Default => std::option::Option::Some("DEFAULT"),
6555                Self::Delete => std::option::Option::Some("DELETE"),
6556                Self::UnknownValue(u) => u.0.name(),
6557            }
6558        }
6559    }
6560
6561    impl std::default::Default for PreviewMode {
6562        fn default() -> Self {
6563            use std::convert::From;
6564            Self::from(0)
6565        }
6566    }
6567
6568    impl std::fmt::Display for PreviewMode {
6569        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6570            wkt::internal::display_enum(f, self.name(), self.value())
6571        }
6572    }
6573
6574    impl std::convert::From<i32> for PreviewMode {
6575        fn from(value: i32) -> Self {
6576            match value {
6577                0 => Self::Unspecified,
6578                1 => Self::Default,
6579                2 => Self::Delete,
6580                _ => Self::UnknownValue(preview_mode::UnknownValue(
6581                    wkt::internal::UnknownEnumValue::Integer(value),
6582                )),
6583            }
6584        }
6585    }
6586
6587    impl std::convert::From<&str> for PreviewMode {
6588        fn from(value: &str) -> Self {
6589            use std::string::ToString;
6590            match value {
6591                "PREVIEW_MODE_UNSPECIFIED" => Self::Unspecified,
6592                "DEFAULT" => Self::Default,
6593                "DELETE" => Self::Delete,
6594                _ => Self::UnknownValue(preview_mode::UnknownValue(
6595                    wkt::internal::UnknownEnumValue::String(value.to_string()),
6596                )),
6597            }
6598        }
6599    }
6600
6601    impl serde::ser::Serialize for PreviewMode {
6602        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6603        where
6604            S: serde::Serializer,
6605        {
6606            match self {
6607                Self::Unspecified => serializer.serialize_i32(0),
6608                Self::Default => serializer.serialize_i32(1),
6609                Self::Delete => serializer.serialize_i32(2),
6610                Self::UnknownValue(u) => u.0.serialize(serializer),
6611            }
6612        }
6613    }
6614
6615    impl<'de> serde::de::Deserialize<'de> for PreviewMode {
6616        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6617        where
6618            D: serde::Deserializer<'de>,
6619        {
6620            deserializer.deserialize_any(wkt::internal::EnumVisitor::<PreviewMode>::new(
6621                ".google.cloud.config.v1.Preview.PreviewMode",
6622            ))
6623        }
6624    }
6625
6626    /// Possible errors that can occur with previews.
6627    ///
6628    /// # Working with unknown values
6629    ///
6630    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6631    /// additional enum variants at any time. Adding new variants is not considered
6632    /// a breaking change. Applications should write their code in anticipation of:
6633    ///
6634    /// - New values appearing in future releases of the client library, **and**
6635    /// - New values received dynamically, without application changes.
6636    ///
6637    /// Please consult the [Working with enums] section in the user guide for some
6638    /// guidelines.
6639    ///
6640    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
6641    #[derive(Clone, Debug, PartialEq)]
6642    #[non_exhaustive]
6643    pub enum ErrorCode {
6644        /// No error code was specified.
6645        Unspecified,
6646        /// Cloud Build failed due to a permissions issue.
6647        CloudBuildPermissionDenied,
6648        /// Cloud Storage bucket failed to create due to a permissions issue.
6649        BucketCreationPermissionDenied,
6650        /// Cloud Storage bucket failed for a non-permissions-related issue.
6651        BucketCreationFailed,
6652        /// Acquiring lock on provided deployment reference failed.
6653        DeploymentLockAcquireFailed,
6654        /// Preview encountered an error when trying to access Cloud Build API.
6655        PreviewBuildApiFailed,
6656        /// Preview created a build but build failed and logs were generated.
6657        PreviewBuildRunFailed,
6658        /// Failed to import values from an external source.
6659        ExternalValueSourceImportFailed,
6660        /// If set, the enum was initialized with an unknown value.
6661        ///
6662        /// Applications can examine the value using [ErrorCode::value] or
6663        /// [ErrorCode::name].
6664        UnknownValue(error_code::UnknownValue),
6665    }
6666
6667    #[doc(hidden)]
6668    pub mod error_code {
6669        #[allow(unused_imports)]
6670        use super::*;
6671        #[derive(Clone, Debug, PartialEq)]
6672        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6673    }
6674
6675    impl ErrorCode {
6676        /// Gets the enum value.
6677        ///
6678        /// Returns `None` if the enum contains an unknown value deserialized from
6679        /// the string representation of enums.
6680        pub fn value(&self) -> std::option::Option<i32> {
6681            match self {
6682                Self::Unspecified => std::option::Option::Some(0),
6683                Self::CloudBuildPermissionDenied => std::option::Option::Some(1),
6684                Self::BucketCreationPermissionDenied => std::option::Option::Some(2),
6685                Self::BucketCreationFailed => std::option::Option::Some(3),
6686                Self::DeploymentLockAcquireFailed => std::option::Option::Some(4),
6687                Self::PreviewBuildApiFailed => std::option::Option::Some(5),
6688                Self::PreviewBuildRunFailed => std::option::Option::Some(6),
6689                Self::ExternalValueSourceImportFailed => std::option::Option::Some(7),
6690                Self::UnknownValue(u) => u.0.value(),
6691            }
6692        }
6693
6694        /// Gets the enum value as a string.
6695        ///
6696        /// Returns `None` if the enum contains an unknown value deserialized from
6697        /// the integer representation of enums.
6698        pub fn name(&self) -> std::option::Option<&str> {
6699            match self {
6700                Self::Unspecified => std::option::Option::Some("ERROR_CODE_UNSPECIFIED"),
6701                Self::CloudBuildPermissionDenied => {
6702                    std::option::Option::Some("CLOUD_BUILD_PERMISSION_DENIED")
6703                }
6704                Self::BucketCreationPermissionDenied => {
6705                    std::option::Option::Some("BUCKET_CREATION_PERMISSION_DENIED")
6706                }
6707                Self::BucketCreationFailed => std::option::Option::Some("BUCKET_CREATION_FAILED"),
6708                Self::DeploymentLockAcquireFailed => {
6709                    std::option::Option::Some("DEPLOYMENT_LOCK_ACQUIRE_FAILED")
6710                }
6711                Self::PreviewBuildApiFailed => {
6712                    std::option::Option::Some("PREVIEW_BUILD_API_FAILED")
6713                }
6714                Self::PreviewBuildRunFailed => {
6715                    std::option::Option::Some("PREVIEW_BUILD_RUN_FAILED")
6716                }
6717                Self::ExternalValueSourceImportFailed => {
6718                    std::option::Option::Some("EXTERNAL_VALUE_SOURCE_IMPORT_FAILED")
6719                }
6720                Self::UnknownValue(u) => u.0.name(),
6721            }
6722        }
6723    }
6724
6725    impl std::default::Default for ErrorCode {
6726        fn default() -> Self {
6727            use std::convert::From;
6728            Self::from(0)
6729        }
6730    }
6731
6732    impl std::fmt::Display for ErrorCode {
6733        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6734            wkt::internal::display_enum(f, self.name(), self.value())
6735        }
6736    }
6737
6738    impl std::convert::From<i32> for ErrorCode {
6739        fn from(value: i32) -> Self {
6740            match value {
6741                0 => Self::Unspecified,
6742                1 => Self::CloudBuildPermissionDenied,
6743                2 => Self::BucketCreationPermissionDenied,
6744                3 => Self::BucketCreationFailed,
6745                4 => Self::DeploymentLockAcquireFailed,
6746                5 => Self::PreviewBuildApiFailed,
6747                6 => Self::PreviewBuildRunFailed,
6748                7 => Self::ExternalValueSourceImportFailed,
6749                _ => Self::UnknownValue(error_code::UnknownValue(
6750                    wkt::internal::UnknownEnumValue::Integer(value),
6751                )),
6752            }
6753        }
6754    }
6755
6756    impl std::convert::From<&str> for ErrorCode {
6757        fn from(value: &str) -> Self {
6758            use std::string::ToString;
6759            match value {
6760                "ERROR_CODE_UNSPECIFIED" => Self::Unspecified,
6761                "CLOUD_BUILD_PERMISSION_DENIED" => Self::CloudBuildPermissionDenied,
6762                "BUCKET_CREATION_PERMISSION_DENIED" => Self::BucketCreationPermissionDenied,
6763                "BUCKET_CREATION_FAILED" => Self::BucketCreationFailed,
6764                "DEPLOYMENT_LOCK_ACQUIRE_FAILED" => Self::DeploymentLockAcquireFailed,
6765                "PREVIEW_BUILD_API_FAILED" => Self::PreviewBuildApiFailed,
6766                "PREVIEW_BUILD_RUN_FAILED" => Self::PreviewBuildRunFailed,
6767                "EXTERNAL_VALUE_SOURCE_IMPORT_FAILED" => Self::ExternalValueSourceImportFailed,
6768                _ => Self::UnknownValue(error_code::UnknownValue(
6769                    wkt::internal::UnknownEnumValue::String(value.to_string()),
6770                )),
6771            }
6772        }
6773    }
6774
6775    impl serde::ser::Serialize for ErrorCode {
6776        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6777        where
6778            S: serde::Serializer,
6779        {
6780            match self {
6781                Self::Unspecified => serializer.serialize_i32(0),
6782                Self::CloudBuildPermissionDenied => serializer.serialize_i32(1),
6783                Self::BucketCreationPermissionDenied => serializer.serialize_i32(2),
6784                Self::BucketCreationFailed => serializer.serialize_i32(3),
6785                Self::DeploymentLockAcquireFailed => serializer.serialize_i32(4),
6786                Self::PreviewBuildApiFailed => serializer.serialize_i32(5),
6787                Self::PreviewBuildRunFailed => serializer.serialize_i32(6),
6788                Self::ExternalValueSourceImportFailed => serializer.serialize_i32(7),
6789                Self::UnknownValue(u) => u.0.serialize(serializer),
6790            }
6791        }
6792    }
6793
6794    impl<'de> serde::de::Deserialize<'de> for ErrorCode {
6795        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6796        where
6797            D: serde::Deserializer<'de>,
6798        {
6799            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ErrorCode>::new(
6800                ".google.cloud.config.v1.Preview.ErrorCode",
6801            ))
6802        }
6803    }
6804
6805    /// Blueprint to preview.
6806    #[derive(Clone, Debug, PartialEq)]
6807    #[non_exhaustive]
6808    pub enum Blueprint {
6809        /// The terraform blueprint to preview.
6810        TerraformBlueprint(std::boxed::Box<crate::model::TerraformBlueprint>),
6811    }
6812}
6813
6814/// Ephemeral metadata content describing the state of a preview operation.
6815#[derive(Clone, Default, PartialEq)]
6816#[non_exhaustive]
6817pub struct PreviewOperationMetadata {
6818    /// The current step the preview operation is running.
6819    pub step: crate::model::preview_operation_metadata::PreviewStep,
6820
6821    /// Artifacts from preview.
6822    pub preview_artifacts: std::option::Option<crate::model::PreviewArtifacts>,
6823
6824    /// Output only. Location of preview logs in `gs://{bucket}/{object}` format.
6825    pub logs: std::string::String,
6826
6827    /// Output only. Cloud Build instance UUID associated with this preview.
6828    pub build: std::string::String,
6829
6830    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6831}
6832
6833impl PreviewOperationMetadata {
6834    pub fn new() -> Self {
6835        std::default::Default::default()
6836    }
6837
6838    /// Sets the value of [step][crate::model::PreviewOperationMetadata::step].
6839    ///
6840    /// # Example
6841    /// ```ignore,no_run
6842    /// # use google_cloud_config_v1::model::PreviewOperationMetadata;
6843    /// use google_cloud_config_v1::model::preview_operation_metadata::PreviewStep;
6844    /// let x0 = PreviewOperationMetadata::new().set_step(PreviewStep::PreparingStorageBucket);
6845    /// let x1 = PreviewOperationMetadata::new().set_step(PreviewStep::DownloadingBlueprint);
6846    /// let x2 = PreviewOperationMetadata::new().set_step(PreviewStep::RunningTfInit);
6847    /// ```
6848    pub fn set_step<
6849        T: std::convert::Into<crate::model::preview_operation_metadata::PreviewStep>,
6850    >(
6851        mut self,
6852        v: T,
6853    ) -> Self {
6854        self.step = v.into();
6855        self
6856    }
6857
6858    /// Sets the value of [preview_artifacts][crate::model::PreviewOperationMetadata::preview_artifacts].
6859    ///
6860    /// # Example
6861    /// ```ignore,no_run
6862    /// # use google_cloud_config_v1::model::PreviewOperationMetadata;
6863    /// use google_cloud_config_v1::model::PreviewArtifacts;
6864    /// let x = PreviewOperationMetadata::new().set_preview_artifacts(PreviewArtifacts::default()/* use setters */);
6865    /// ```
6866    pub fn set_preview_artifacts<T>(mut self, v: T) -> Self
6867    where
6868        T: std::convert::Into<crate::model::PreviewArtifacts>,
6869    {
6870        self.preview_artifacts = std::option::Option::Some(v.into());
6871        self
6872    }
6873
6874    /// Sets or clears the value of [preview_artifacts][crate::model::PreviewOperationMetadata::preview_artifacts].
6875    ///
6876    /// # Example
6877    /// ```ignore,no_run
6878    /// # use google_cloud_config_v1::model::PreviewOperationMetadata;
6879    /// use google_cloud_config_v1::model::PreviewArtifacts;
6880    /// let x = PreviewOperationMetadata::new().set_or_clear_preview_artifacts(Some(PreviewArtifacts::default()/* use setters */));
6881    /// let x = PreviewOperationMetadata::new().set_or_clear_preview_artifacts(None::<PreviewArtifacts>);
6882    /// ```
6883    pub fn set_or_clear_preview_artifacts<T>(mut self, v: std::option::Option<T>) -> Self
6884    where
6885        T: std::convert::Into<crate::model::PreviewArtifacts>,
6886    {
6887        self.preview_artifacts = v.map(|x| x.into());
6888        self
6889    }
6890
6891    /// Sets the value of [logs][crate::model::PreviewOperationMetadata::logs].
6892    ///
6893    /// # Example
6894    /// ```ignore,no_run
6895    /// # use google_cloud_config_v1::model::PreviewOperationMetadata;
6896    /// let x = PreviewOperationMetadata::new().set_logs("example");
6897    /// ```
6898    pub fn set_logs<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6899        self.logs = v.into();
6900        self
6901    }
6902
6903    /// Sets the value of [build][crate::model::PreviewOperationMetadata::build].
6904    ///
6905    /// # Example
6906    /// ```ignore,no_run
6907    /// # use google_cloud_config_v1::model::PreviewOperationMetadata;
6908    /// let x = PreviewOperationMetadata::new().set_build("example");
6909    /// ```
6910    pub fn set_build<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6911        self.build = v.into();
6912        self
6913    }
6914}
6915
6916impl wkt::message::Message for PreviewOperationMetadata {
6917    fn typename() -> &'static str {
6918        "type.googleapis.com/google.cloud.config.v1.PreviewOperationMetadata"
6919    }
6920}
6921
6922/// Defines additional types related to [PreviewOperationMetadata].
6923pub mod preview_operation_metadata {
6924    #[allow(unused_imports)]
6925    use super::*;
6926
6927    /// The possible steps a preview may be running.
6928    ///
6929    /// # Working with unknown values
6930    ///
6931    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6932    /// additional enum variants at any time. Adding new variants is not considered
6933    /// a breaking change. Applications should write their code in anticipation of:
6934    ///
6935    /// - New values appearing in future releases of the client library, **and**
6936    /// - New values received dynamically, without application changes.
6937    ///
6938    /// Please consult the [Working with enums] section in the user guide for some
6939    /// guidelines.
6940    ///
6941    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
6942    #[derive(Clone, Debug, PartialEq)]
6943    #[non_exhaustive]
6944    pub enum PreviewStep {
6945        /// Unspecified preview step.
6946        Unspecified,
6947        /// Infra Manager is creating a Google Cloud Storage bucket to store
6948        /// artifacts and metadata about the preview.
6949        PreparingStorageBucket,
6950        /// Downloading the blueprint onto the Google Cloud Storage bucket.
6951        DownloadingBlueprint,
6952        /// Initializing Terraform using `terraform init`.
6953        RunningTfInit,
6954        /// Running `terraform plan`.
6955        RunningTfPlan,
6956        /// Fetching a deployment.
6957        FetchingDeployment,
6958        /// Locking a deployment.
6959        LockingDeployment,
6960        /// Unlocking a deployment.
6961        UnlockingDeployment,
6962        /// Operation was successful.
6963        Succeeded,
6964        /// Operation failed.
6965        Failed,
6966        /// Validating the provided repository.
6967        ValidatingRepository,
6968        /// If set, the enum was initialized with an unknown value.
6969        ///
6970        /// Applications can examine the value using [PreviewStep::value] or
6971        /// [PreviewStep::name].
6972        UnknownValue(preview_step::UnknownValue),
6973    }
6974
6975    #[doc(hidden)]
6976    pub mod preview_step {
6977        #[allow(unused_imports)]
6978        use super::*;
6979        #[derive(Clone, Debug, PartialEq)]
6980        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6981    }
6982
6983    impl PreviewStep {
6984        /// Gets the enum value.
6985        ///
6986        /// Returns `None` if the enum contains an unknown value deserialized from
6987        /// the string representation of enums.
6988        pub fn value(&self) -> std::option::Option<i32> {
6989            match self {
6990                Self::Unspecified => std::option::Option::Some(0),
6991                Self::PreparingStorageBucket => std::option::Option::Some(1),
6992                Self::DownloadingBlueprint => std::option::Option::Some(2),
6993                Self::RunningTfInit => std::option::Option::Some(3),
6994                Self::RunningTfPlan => std::option::Option::Some(4),
6995                Self::FetchingDeployment => std::option::Option::Some(5),
6996                Self::LockingDeployment => std::option::Option::Some(6),
6997                Self::UnlockingDeployment => std::option::Option::Some(7),
6998                Self::Succeeded => std::option::Option::Some(8),
6999                Self::Failed => std::option::Option::Some(9),
7000                Self::ValidatingRepository => std::option::Option::Some(10),
7001                Self::UnknownValue(u) => u.0.value(),
7002            }
7003        }
7004
7005        /// Gets the enum value as a string.
7006        ///
7007        /// Returns `None` if the enum contains an unknown value deserialized from
7008        /// the integer representation of enums.
7009        pub fn name(&self) -> std::option::Option<&str> {
7010            match self {
7011                Self::Unspecified => std::option::Option::Some("PREVIEW_STEP_UNSPECIFIED"),
7012                Self::PreparingStorageBucket => {
7013                    std::option::Option::Some("PREPARING_STORAGE_BUCKET")
7014                }
7015                Self::DownloadingBlueprint => std::option::Option::Some("DOWNLOADING_BLUEPRINT"),
7016                Self::RunningTfInit => std::option::Option::Some("RUNNING_TF_INIT"),
7017                Self::RunningTfPlan => std::option::Option::Some("RUNNING_TF_PLAN"),
7018                Self::FetchingDeployment => std::option::Option::Some("FETCHING_DEPLOYMENT"),
7019                Self::LockingDeployment => std::option::Option::Some("LOCKING_DEPLOYMENT"),
7020                Self::UnlockingDeployment => std::option::Option::Some("UNLOCKING_DEPLOYMENT"),
7021                Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
7022                Self::Failed => std::option::Option::Some("FAILED"),
7023                Self::ValidatingRepository => std::option::Option::Some("VALIDATING_REPOSITORY"),
7024                Self::UnknownValue(u) => u.0.name(),
7025            }
7026        }
7027    }
7028
7029    impl std::default::Default for PreviewStep {
7030        fn default() -> Self {
7031            use std::convert::From;
7032            Self::from(0)
7033        }
7034    }
7035
7036    impl std::fmt::Display for PreviewStep {
7037        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7038            wkt::internal::display_enum(f, self.name(), self.value())
7039        }
7040    }
7041
7042    impl std::convert::From<i32> for PreviewStep {
7043        fn from(value: i32) -> Self {
7044            match value {
7045                0 => Self::Unspecified,
7046                1 => Self::PreparingStorageBucket,
7047                2 => Self::DownloadingBlueprint,
7048                3 => Self::RunningTfInit,
7049                4 => Self::RunningTfPlan,
7050                5 => Self::FetchingDeployment,
7051                6 => Self::LockingDeployment,
7052                7 => Self::UnlockingDeployment,
7053                8 => Self::Succeeded,
7054                9 => Self::Failed,
7055                10 => Self::ValidatingRepository,
7056                _ => Self::UnknownValue(preview_step::UnknownValue(
7057                    wkt::internal::UnknownEnumValue::Integer(value),
7058                )),
7059            }
7060        }
7061    }
7062
7063    impl std::convert::From<&str> for PreviewStep {
7064        fn from(value: &str) -> Self {
7065            use std::string::ToString;
7066            match value {
7067                "PREVIEW_STEP_UNSPECIFIED" => Self::Unspecified,
7068                "PREPARING_STORAGE_BUCKET" => Self::PreparingStorageBucket,
7069                "DOWNLOADING_BLUEPRINT" => Self::DownloadingBlueprint,
7070                "RUNNING_TF_INIT" => Self::RunningTfInit,
7071                "RUNNING_TF_PLAN" => Self::RunningTfPlan,
7072                "FETCHING_DEPLOYMENT" => Self::FetchingDeployment,
7073                "LOCKING_DEPLOYMENT" => Self::LockingDeployment,
7074                "UNLOCKING_DEPLOYMENT" => Self::UnlockingDeployment,
7075                "SUCCEEDED" => Self::Succeeded,
7076                "FAILED" => Self::Failed,
7077                "VALIDATING_REPOSITORY" => Self::ValidatingRepository,
7078                _ => Self::UnknownValue(preview_step::UnknownValue(
7079                    wkt::internal::UnknownEnumValue::String(value.to_string()),
7080                )),
7081            }
7082        }
7083    }
7084
7085    impl serde::ser::Serialize for PreviewStep {
7086        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7087        where
7088            S: serde::Serializer,
7089        {
7090            match self {
7091                Self::Unspecified => serializer.serialize_i32(0),
7092                Self::PreparingStorageBucket => serializer.serialize_i32(1),
7093                Self::DownloadingBlueprint => serializer.serialize_i32(2),
7094                Self::RunningTfInit => serializer.serialize_i32(3),
7095                Self::RunningTfPlan => serializer.serialize_i32(4),
7096                Self::FetchingDeployment => serializer.serialize_i32(5),
7097                Self::LockingDeployment => serializer.serialize_i32(6),
7098                Self::UnlockingDeployment => serializer.serialize_i32(7),
7099                Self::Succeeded => serializer.serialize_i32(8),
7100                Self::Failed => serializer.serialize_i32(9),
7101                Self::ValidatingRepository => serializer.serialize_i32(10),
7102                Self::UnknownValue(u) => u.0.serialize(serializer),
7103            }
7104        }
7105    }
7106
7107    impl<'de> serde::de::Deserialize<'de> for PreviewStep {
7108        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7109        where
7110            D: serde::Deserializer<'de>,
7111        {
7112            deserializer.deserialize_any(wkt::internal::EnumVisitor::<PreviewStep>::new(
7113                ".google.cloud.config.v1.PreviewOperationMetadata.PreviewStep",
7114            ))
7115        }
7116    }
7117}
7118
7119/// Artifacts created by preview.
7120#[derive(Clone, Default, PartialEq)]
7121#[non_exhaustive]
7122pub struct PreviewArtifacts {
7123    /// Output only. Location of a blueprint copy and other content in Google Cloud
7124    /// Storage. Format: `gs://{bucket}/{object}`
7125    pub content: std::string::String,
7126
7127    /// Output only. Location of artifacts in Google Cloud Storage.
7128    /// Format: `gs://{bucket}/{object}`
7129    pub artifacts: std::string::String,
7130
7131    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7132}
7133
7134impl PreviewArtifacts {
7135    pub fn new() -> Self {
7136        std::default::Default::default()
7137    }
7138
7139    /// Sets the value of [content][crate::model::PreviewArtifacts::content].
7140    ///
7141    /// # Example
7142    /// ```ignore,no_run
7143    /// # use google_cloud_config_v1::model::PreviewArtifacts;
7144    /// let x = PreviewArtifacts::new().set_content("example");
7145    /// ```
7146    pub fn set_content<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7147        self.content = v.into();
7148        self
7149    }
7150
7151    /// Sets the value of [artifacts][crate::model::PreviewArtifacts::artifacts].
7152    ///
7153    /// # Example
7154    /// ```ignore,no_run
7155    /// # use google_cloud_config_v1::model::PreviewArtifacts;
7156    /// let x = PreviewArtifacts::new().set_artifacts("example");
7157    /// ```
7158    pub fn set_artifacts<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7159        self.artifacts = v.into();
7160        self
7161    }
7162}
7163
7164impl wkt::message::Message for PreviewArtifacts {
7165    fn typename() -> &'static str {
7166        "type.googleapis.com/google.cloud.config.v1.PreviewArtifacts"
7167    }
7168}
7169
7170/// A request to create a preview.
7171#[derive(Clone, Default, PartialEq)]
7172#[non_exhaustive]
7173pub struct CreatePreviewRequest {
7174    /// Required. The parent in whose context the Preview is created. The parent
7175    /// value is in the format: 'projects/{project_id}/locations/{location}'.
7176    pub parent: std::string::String,
7177
7178    /// Optional. The preview ID.
7179    pub preview_id: std::string::String,
7180
7181    /// Required. [Preview][google.cloud.config.v1.Preview] resource to be created.
7182    ///
7183    /// [google.cloud.config.v1.Preview]: crate::model::Preview
7184    pub preview: std::option::Option<crate::model::Preview>,
7185
7186    /// Optional. An optional request ID to identify requests. Specify a unique
7187    /// request ID so that if you must retry your request, the server will know to
7188    /// ignore the request if it has already been completed. The server will
7189    /// guarantee that for at least 60 minutes since the first request.
7190    ///
7191    /// For example, consider a situation where you make an initial request and the
7192    /// request times out. If you make the request again with the same request ID,
7193    /// the server can check if original operation with the same request ID was
7194    /// received, and if so, will ignore the second request. This prevents clients
7195    /// from accidentally creating duplicate commitments.
7196    ///
7197    /// The request ID must be a valid UUID with the exception that zero UUID is
7198    /// not supported (00000000-0000-0000-0000-000000000000).
7199    pub request_id: std::string::String,
7200
7201    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7202}
7203
7204impl CreatePreviewRequest {
7205    pub fn new() -> Self {
7206        std::default::Default::default()
7207    }
7208
7209    /// Sets the value of [parent][crate::model::CreatePreviewRequest::parent].
7210    ///
7211    /// # Example
7212    /// ```ignore,no_run
7213    /// # use google_cloud_config_v1::model::CreatePreviewRequest;
7214    /// let x = CreatePreviewRequest::new().set_parent("example");
7215    /// ```
7216    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7217        self.parent = v.into();
7218        self
7219    }
7220
7221    /// Sets the value of [preview_id][crate::model::CreatePreviewRequest::preview_id].
7222    ///
7223    /// # Example
7224    /// ```ignore,no_run
7225    /// # use google_cloud_config_v1::model::CreatePreviewRequest;
7226    /// let x = CreatePreviewRequest::new().set_preview_id("example");
7227    /// ```
7228    pub fn set_preview_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7229        self.preview_id = v.into();
7230        self
7231    }
7232
7233    /// Sets the value of [preview][crate::model::CreatePreviewRequest::preview].
7234    ///
7235    /// # Example
7236    /// ```ignore,no_run
7237    /// # use google_cloud_config_v1::model::CreatePreviewRequest;
7238    /// use google_cloud_config_v1::model::Preview;
7239    /// let x = CreatePreviewRequest::new().set_preview(Preview::default()/* use setters */);
7240    /// ```
7241    pub fn set_preview<T>(mut self, v: T) -> Self
7242    where
7243        T: std::convert::Into<crate::model::Preview>,
7244    {
7245        self.preview = std::option::Option::Some(v.into());
7246        self
7247    }
7248
7249    /// Sets or clears the value of [preview][crate::model::CreatePreviewRequest::preview].
7250    ///
7251    /// # Example
7252    /// ```ignore,no_run
7253    /// # use google_cloud_config_v1::model::CreatePreviewRequest;
7254    /// use google_cloud_config_v1::model::Preview;
7255    /// let x = CreatePreviewRequest::new().set_or_clear_preview(Some(Preview::default()/* use setters */));
7256    /// let x = CreatePreviewRequest::new().set_or_clear_preview(None::<Preview>);
7257    /// ```
7258    pub fn set_or_clear_preview<T>(mut self, v: std::option::Option<T>) -> Self
7259    where
7260        T: std::convert::Into<crate::model::Preview>,
7261    {
7262        self.preview = v.map(|x| x.into());
7263        self
7264    }
7265
7266    /// Sets the value of [request_id][crate::model::CreatePreviewRequest::request_id].
7267    ///
7268    /// # Example
7269    /// ```ignore,no_run
7270    /// # use google_cloud_config_v1::model::CreatePreviewRequest;
7271    /// let x = CreatePreviewRequest::new().set_request_id("example");
7272    /// ```
7273    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7274        self.request_id = v.into();
7275        self
7276    }
7277}
7278
7279impl wkt::message::Message for CreatePreviewRequest {
7280    fn typename() -> &'static str {
7281        "type.googleapis.com/google.cloud.config.v1.CreatePreviewRequest"
7282    }
7283}
7284
7285/// A request to get details about a preview.
7286#[derive(Clone, Default, PartialEq)]
7287#[non_exhaustive]
7288pub struct GetPreviewRequest {
7289    /// Required. The name of the preview. Format:
7290    /// 'projects/{project_id}/locations/{location}/previews/{preview}'.
7291    pub name: std::string::String,
7292
7293    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7294}
7295
7296impl GetPreviewRequest {
7297    pub fn new() -> Self {
7298        std::default::Default::default()
7299    }
7300
7301    /// Sets the value of [name][crate::model::GetPreviewRequest::name].
7302    ///
7303    /// # Example
7304    /// ```ignore,no_run
7305    /// # use google_cloud_config_v1::model::GetPreviewRequest;
7306    /// let x = GetPreviewRequest::new().set_name("example");
7307    /// ```
7308    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7309        self.name = v.into();
7310        self
7311    }
7312}
7313
7314impl wkt::message::Message for GetPreviewRequest {
7315    fn typename() -> &'static str {
7316        "type.googleapis.com/google.cloud.config.v1.GetPreviewRequest"
7317    }
7318}
7319
7320/// A request to list all previews for a given project and location.
7321#[derive(Clone, Default, PartialEq)]
7322#[non_exhaustive]
7323pub struct ListPreviewsRequest {
7324    /// Required. The parent in whose context the Previews are listed. The parent
7325    /// value is in the format: 'projects/{project_id}/locations/{location}'.
7326    pub parent: std::string::String,
7327
7328    /// Optional. When requesting a page of resources, 'page_size' specifies number
7329    /// of resources to return. If unspecified, at most 500 will be returned. The
7330    /// maximum value is 1000.
7331    pub page_size: i32,
7332
7333    /// Optional. Token returned by previous call to 'ListDeployments' which
7334    /// specifies the position in the list from where to continue listing the
7335    /// resources.
7336    pub page_token: std::string::String,
7337
7338    /// Optional. Lists the Deployments that match the filter expression. A filter
7339    /// expression filters the resources listed in the response. The expression
7340    /// must be of the form '{field} {operator} {value}' where operators: '<', '>',
7341    /// '<=', '>=', '!=', '=', ':' are supported (colon ':' represents a HAS
7342    /// operator which is roughly synonymous with equality). {field} can refer to a
7343    /// proto or JSON field, or a synthetic field. Field names can be camelCase or
7344    /// snake_case.
7345    ///
7346    /// Examples:
7347    ///
7348    /// - Filter by name:
7349    ///   name = "projects/foo/locations/us-central1/deployments/bar
7350    ///
7351    /// - Filter by labels:
7352    ///
7353    ///   - Resources that have a key called 'foo'
7354    ///     labels.foo:*
7355    ///   - Resources that have a key called 'foo' whose value is 'bar'
7356    ///     labels.foo = bar
7357    /// - Filter by state:
7358    ///
7359    ///   - Deployments in CREATING state.
7360    ///     state=CREATING
7361    pub filter: std::string::String,
7362
7363    /// Optional. Field to use to sort the list.
7364    pub order_by: std::string::String,
7365
7366    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7367}
7368
7369impl ListPreviewsRequest {
7370    pub fn new() -> Self {
7371        std::default::Default::default()
7372    }
7373
7374    /// Sets the value of [parent][crate::model::ListPreviewsRequest::parent].
7375    ///
7376    /// # Example
7377    /// ```ignore,no_run
7378    /// # use google_cloud_config_v1::model::ListPreviewsRequest;
7379    /// let x = ListPreviewsRequest::new().set_parent("example");
7380    /// ```
7381    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7382        self.parent = v.into();
7383        self
7384    }
7385
7386    /// Sets the value of [page_size][crate::model::ListPreviewsRequest::page_size].
7387    ///
7388    /// # Example
7389    /// ```ignore,no_run
7390    /// # use google_cloud_config_v1::model::ListPreviewsRequest;
7391    /// let x = ListPreviewsRequest::new().set_page_size(42);
7392    /// ```
7393    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7394        self.page_size = v.into();
7395        self
7396    }
7397
7398    /// Sets the value of [page_token][crate::model::ListPreviewsRequest::page_token].
7399    ///
7400    /// # Example
7401    /// ```ignore,no_run
7402    /// # use google_cloud_config_v1::model::ListPreviewsRequest;
7403    /// let x = ListPreviewsRequest::new().set_page_token("example");
7404    /// ```
7405    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7406        self.page_token = v.into();
7407        self
7408    }
7409
7410    /// Sets the value of [filter][crate::model::ListPreviewsRequest::filter].
7411    ///
7412    /// # Example
7413    /// ```ignore,no_run
7414    /// # use google_cloud_config_v1::model::ListPreviewsRequest;
7415    /// let x = ListPreviewsRequest::new().set_filter("example");
7416    /// ```
7417    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7418        self.filter = v.into();
7419        self
7420    }
7421
7422    /// Sets the value of [order_by][crate::model::ListPreviewsRequest::order_by].
7423    ///
7424    /// # Example
7425    /// ```ignore,no_run
7426    /// # use google_cloud_config_v1::model::ListPreviewsRequest;
7427    /// let x = ListPreviewsRequest::new().set_order_by("example");
7428    /// ```
7429    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7430        self.order_by = v.into();
7431        self
7432    }
7433}
7434
7435impl wkt::message::Message for ListPreviewsRequest {
7436    fn typename() -> &'static str {
7437        "type.googleapis.com/google.cloud.config.v1.ListPreviewsRequest"
7438    }
7439}
7440
7441/// A response to a `ListPreviews` call. Contains a list of Previews.
7442#[derive(Clone, Default, PartialEq)]
7443#[non_exhaustive]
7444pub struct ListPreviewsResponse {
7445    /// List of [Previews][google.cloud.config.v1.Preview].
7446    ///
7447    /// [google.cloud.config.v1.Preview]: crate::model::Preview
7448    pub previews: std::vec::Vec<crate::model::Preview>,
7449
7450    /// Token to be supplied to the next ListPreviews request via `page_token`
7451    /// to obtain the next set of results.
7452    pub next_page_token: std::string::String,
7453
7454    /// Locations that could not be reached.
7455    pub unreachable: std::vec::Vec<std::string::String>,
7456
7457    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7458}
7459
7460impl ListPreviewsResponse {
7461    pub fn new() -> Self {
7462        std::default::Default::default()
7463    }
7464
7465    /// Sets the value of [previews][crate::model::ListPreviewsResponse::previews].
7466    ///
7467    /// # Example
7468    /// ```ignore,no_run
7469    /// # use google_cloud_config_v1::model::ListPreviewsResponse;
7470    /// use google_cloud_config_v1::model::Preview;
7471    /// let x = ListPreviewsResponse::new()
7472    ///     .set_previews([
7473    ///         Preview::default()/* use setters */,
7474    ///         Preview::default()/* use (different) setters */,
7475    ///     ]);
7476    /// ```
7477    pub fn set_previews<T, V>(mut self, v: T) -> Self
7478    where
7479        T: std::iter::IntoIterator<Item = V>,
7480        V: std::convert::Into<crate::model::Preview>,
7481    {
7482        use std::iter::Iterator;
7483        self.previews = v.into_iter().map(|i| i.into()).collect();
7484        self
7485    }
7486
7487    /// Sets the value of [next_page_token][crate::model::ListPreviewsResponse::next_page_token].
7488    ///
7489    /// # Example
7490    /// ```ignore,no_run
7491    /// # use google_cloud_config_v1::model::ListPreviewsResponse;
7492    /// let x = ListPreviewsResponse::new().set_next_page_token("example");
7493    /// ```
7494    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7495        self.next_page_token = v.into();
7496        self
7497    }
7498
7499    /// Sets the value of [unreachable][crate::model::ListPreviewsResponse::unreachable].
7500    ///
7501    /// # Example
7502    /// ```ignore,no_run
7503    /// # use google_cloud_config_v1::model::ListPreviewsResponse;
7504    /// let x = ListPreviewsResponse::new().set_unreachable(["a", "b", "c"]);
7505    /// ```
7506    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
7507    where
7508        T: std::iter::IntoIterator<Item = V>,
7509        V: std::convert::Into<std::string::String>,
7510    {
7511        use std::iter::Iterator;
7512        self.unreachable = v.into_iter().map(|i| i.into()).collect();
7513        self
7514    }
7515}
7516
7517impl wkt::message::Message for ListPreviewsResponse {
7518    fn typename() -> &'static str {
7519        "type.googleapis.com/google.cloud.config.v1.ListPreviewsResponse"
7520    }
7521}
7522
7523#[doc(hidden)]
7524impl google_cloud_gax::paginator::internal::PageableResponse for ListPreviewsResponse {
7525    type PageItem = crate::model::Preview;
7526
7527    fn items(self) -> std::vec::Vec<Self::PageItem> {
7528        self.previews
7529    }
7530
7531    fn next_page_token(&self) -> std::string::String {
7532        use std::clone::Clone;
7533        self.next_page_token.clone()
7534    }
7535}
7536
7537/// A request to delete a preview.
7538#[derive(Clone, Default, PartialEq)]
7539#[non_exhaustive]
7540pub struct DeletePreviewRequest {
7541    /// Required. The name of the Preview in the format:
7542    /// 'projects/{project_id}/locations/{location}/previews/{preview}'.
7543    pub name: std::string::String,
7544
7545    /// Optional. An optional request ID to identify requests. Specify a unique
7546    /// request ID so that if you must retry your request, the server will know to
7547    /// ignore the request if it has already been completed. The server will
7548    /// guarantee that for at least 60 minutes after the first request.
7549    ///
7550    /// For example, consider a situation where you make an initial request and the
7551    /// request times out. If you make the request again with the same request ID,
7552    /// the server can check if original operation with the same request ID was
7553    /// received, and if so, will ignore the second request. This prevents clients
7554    /// from accidentally creating duplicate commitments.
7555    ///
7556    /// The request ID must be a valid UUID with the exception that zero UUID is
7557    /// not supported (00000000-0000-0000-0000-000000000000).
7558    pub request_id: std::string::String,
7559
7560    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7561}
7562
7563impl DeletePreviewRequest {
7564    pub fn new() -> Self {
7565        std::default::Default::default()
7566    }
7567
7568    /// Sets the value of [name][crate::model::DeletePreviewRequest::name].
7569    ///
7570    /// # Example
7571    /// ```ignore,no_run
7572    /// # use google_cloud_config_v1::model::DeletePreviewRequest;
7573    /// let x = DeletePreviewRequest::new().set_name("example");
7574    /// ```
7575    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7576        self.name = v.into();
7577        self
7578    }
7579
7580    /// Sets the value of [request_id][crate::model::DeletePreviewRequest::request_id].
7581    ///
7582    /// # Example
7583    /// ```ignore,no_run
7584    /// # use google_cloud_config_v1::model::DeletePreviewRequest;
7585    /// let x = DeletePreviewRequest::new().set_request_id("example");
7586    /// ```
7587    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7588        self.request_id = v.into();
7589        self
7590    }
7591}
7592
7593impl wkt::message::Message for DeletePreviewRequest {
7594    fn typename() -> &'static str {
7595        "type.googleapis.com/google.cloud.config.v1.DeletePreviewRequest"
7596    }
7597}
7598
7599/// A request to export preview results.
7600#[derive(Clone, Default, PartialEq)]
7601#[non_exhaustive]
7602pub struct ExportPreviewResultRequest {
7603    /// Required. The preview whose results should be exported. The preview value
7604    /// is in the format:
7605    /// 'projects/{project_id}/locations/{location}/previews/{preview}'.
7606    pub parent: std::string::String,
7607
7608    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7609}
7610
7611impl ExportPreviewResultRequest {
7612    pub fn new() -> Self {
7613        std::default::Default::default()
7614    }
7615
7616    /// Sets the value of [parent][crate::model::ExportPreviewResultRequest::parent].
7617    ///
7618    /// # Example
7619    /// ```ignore,no_run
7620    /// # use google_cloud_config_v1::model::ExportPreviewResultRequest;
7621    /// let x = ExportPreviewResultRequest::new().set_parent("example");
7622    /// ```
7623    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7624        self.parent = v.into();
7625        self
7626    }
7627}
7628
7629impl wkt::message::Message for ExportPreviewResultRequest {
7630    fn typename() -> &'static str {
7631        "type.googleapis.com/google.cloud.config.v1.ExportPreviewResultRequest"
7632    }
7633}
7634
7635/// A response to `ExportPreviewResult` call. Contains preview results.
7636#[derive(Clone, Default, PartialEq)]
7637#[non_exhaustive]
7638pub struct ExportPreviewResultResponse {
7639    /// Output only. Signed URLs for accessing the plan files.
7640    pub result: std::option::Option<crate::model::PreviewResult>,
7641
7642    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7643}
7644
7645impl ExportPreviewResultResponse {
7646    pub fn new() -> Self {
7647        std::default::Default::default()
7648    }
7649
7650    /// Sets the value of [result][crate::model::ExportPreviewResultResponse::result].
7651    ///
7652    /// # Example
7653    /// ```ignore,no_run
7654    /// # use google_cloud_config_v1::model::ExportPreviewResultResponse;
7655    /// use google_cloud_config_v1::model::PreviewResult;
7656    /// let x = ExportPreviewResultResponse::new().set_result(PreviewResult::default()/* use setters */);
7657    /// ```
7658    pub fn set_result<T>(mut self, v: T) -> Self
7659    where
7660        T: std::convert::Into<crate::model::PreviewResult>,
7661    {
7662        self.result = std::option::Option::Some(v.into());
7663        self
7664    }
7665
7666    /// Sets or clears the value of [result][crate::model::ExportPreviewResultResponse::result].
7667    ///
7668    /// # Example
7669    /// ```ignore,no_run
7670    /// # use google_cloud_config_v1::model::ExportPreviewResultResponse;
7671    /// use google_cloud_config_v1::model::PreviewResult;
7672    /// let x = ExportPreviewResultResponse::new().set_or_clear_result(Some(PreviewResult::default()/* use setters */));
7673    /// let x = ExportPreviewResultResponse::new().set_or_clear_result(None::<PreviewResult>);
7674    /// ```
7675    pub fn set_or_clear_result<T>(mut self, v: std::option::Option<T>) -> Self
7676    where
7677        T: std::convert::Into<crate::model::PreviewResult>,
7678    {
7679        self.result = v.map(|x| x.into());
7680        self
7681    }
7682}
7683
7684impl wkt::message::Message for ExportPreviewResultResponse {
7685    fn typename() -> &'static str {
7686        "type.googleapis.com/google.cloud.config.v1.ExportPreviewResultResponse"
7687    }
7688}
7689
7690/// Contains a signed Cloud Storage URLs.
7691#[derive(Clone, Default, PartialEq)]
7692#[non_exhaustive]
7693pub struct PreviewResult {
7694    /// Output only. Plan binary signed URL
7695    pub binary_signed_uri: std::string::String,
7696
7697    /// Output only. Plan JSON signed URL
7698    pub json_signed_uri: std::string::String,
7699
7700    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7701}
7702
7703impl PreviewResult {
7704    pub fn new() -> Self {
7705        std::default::Default::default()
7706    }
7707
7708    /// Sets the value of [binary_signed_uri][crate::model::PreviewResult::binary_signed_uri].
7709    ///
7710    /// # Example
7711    /// ```ignore,no_run
7712    /// # use google_cloud_config_v1::model::PreviewResult;
7713    /// let x = PreviewResult::new().set_binary_signed_uri("example");
7714    /// ```
7715    pub fn set_binary_signed_uri<T: std::convert::Into<std::string::String>>(
7716        mut self,
7717        v: T,
7718    ) -> Self {
7719        self.binary_signed_uri = v.into();
7720        self
7721    }
7722
7723    /// Sets the value of [json_signed_uri][crate::model::PreviewResult::json_signed_uri].
7724    ///
7725    /// # Example
7726    /// ```ignore,no_run
7727    /// # use google_cloud_config_v1::model::PreviewResult;
7728    /// let x = PreviewResult::new().set_json_signed_uri("example");
7729    /// ```
7730    pub fn set_json_signed_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7731        self.json_signed_uri = v.into();
7732        self
7733    }
7734}
7735
7736impl wkt::message::Message for PreviewResult {
7737    fn typename() -> &'static str {
7738        "type.googleapis.com/google.cloud.config.v1.PreviewResult"
7739    }
7740}
7741
7742/// The request message for the GetTerraformVersion method.
7743#[derive(Clone, Default, PartialEq)]
7744#[non_exhaustive]
7745pub struct GetTerraformVersionRequest {
7746    /// Required. The name of the TerraformVersion. Format:
7747    /// 'projects/{project_id}/locations/{location}/terraformVersions/{terraform_version}'
7748    pub name: std::string::String,
7749
7750    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7751}
7752
7753impl GetTerraformVersionRequest {
7754    pub fn new() -> Self {
7755        std::default::Default::default()
7756    }
7757
7758    /// Sets the value of [name][crate::model::GetTerraformVersionRequest::name].
7759    ///
7760    /// # Example
7761    /// ```ignore,no_run
7762    /// # use google_cloud_config_v1::model::GetTerraformVersionRequest;
7763    /// let x = GetTerraformVersionRequest::new().set_name("example");
7764    /// ```
7765    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7766        self.name = v.into();
7767        self
7768    }
7769}
7770
7771impl wkt::message::Message for GetTerraformVersionRequest {
7772    fn typename() -> &'static str {
7773        "type.googleapis.com/google.cloud.config.v1.GetTerraformVersionRequest"
7774    }
7775}
7776
7777/// The request message for the ListTerraformVersions method.
7778#[derive(Clone, Default, PartialEq)]
7779#[non_exhaustive]
7780pub struct ListTerraformVersionsRequest {
7781    /// Required. The parent in whose context the TerraformVersions are listed. The
7782    /// parent value is in the format:
7783    /// 'projects/{project_id}/locations/{location}'.
7784    pub parent: std::string::String,
7785
7786    /// Optional. When requesting a page of terraform versions, 'page_size'
7787    /// specifies number of terraform versions to return. If unspecified, at most
7788    /// 500 will be returned. The maximum value is 1000.
7789    pub page_size: i32,
7790
7791    /// Optional. Token returned by previous call to 'ListTerraformVersions' which
7792    /// specifies the position in the list from where to continue listing the
7793    /// terraform versions.
7794    pub page_token: std::string::String,
7795
7796    /// Optional. Lists the TerraformVersions that match the filter expression. A
7797    /// filter expression filters the resources listed in the response. The
7798    /// expression must be of the form '{field} {operator} {value}' where
7799    /// operators: '<', '>',
7800    /// '<=', '>=', '!=', '=', ':' are supported (colon ':' represents a HAS
7801    /// operator which is roughly synonymous with equality). {field} can refer to a
7802    /// proto or JSON field, or a synthetic field. Field names can be camelCase or
7803    /// snake_case.
7804    pub filter: std::string::String,
7805
7806    /// Optional. Field to use to sort the list.
7807    pub order_by: std::string::String,
7808
7809    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7810}
7811
7812impl ListTerraformVersionsRequest {
7813    pub fn new() -> Self {
7814        std::default::Default::default()
7815    }
7816
7817    /// Sets the value of [parent][crate::model::ListTerraformVersionsRequest::parent].
7818    ///
7819    /// # Example
7820    /// ```ignore,no_run
7821    /// # use google_cloud_config_v1::model::ListTerraformVersionsRequest;
7822    /// let x = ListTerraformVersionsRequest::new().set_parent("example");
7823    /// ```
7824    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7825        self.parent = v.into();
7826        self
7827    }
7828
7829    /// Sets the value of [page_size][crate::model::ListTerraformVersionsRequest::page_size].
7830    ///
7831    /// # Example
7832    /// ```ignore,no_run
7833    /// # use google_cloud_config_v1::model::ListTerraformVersionsRequest;
7834    /// let x = ListTerraformVersionsRequest::new().set_page_size(42);
7835    /// ```
7836    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7837        self.page_size = v.into();
7838        self
7839    }
7840
7841    /// Sets the value of [page_token][crate::model::ListTerraformVersionsRequest::page_token].
7842    ///
7843    /// # Example
7844    /// ```ignore,no_run
7845    /// # use google_cloud_config_v1::model::ListTerraformVersionsRequest;
7846    /// let x = ListTerraformVersionsRequest::new().set_page_token("example");
7847    /// ```
7848    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7849        self.page_token = v.into();
7850        self
7851    }
7852
7853    /// Sets the value of [filter][crate::model::ListTerraformVersionsRequest::filter].
7854    ///
7855    /// # Example
7856    /// ```ignore,no_run
7857    /// # use google_cloud_config_v1::model::ListTerraformVersionsRequest;
7858    /// let x = ListTerraformVersionsRequest::new().set_filter("example");
7859    /// ```
7860    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7861        self.filter = v.into();
7862        self
7863    }
7864
7865    /// Sets the value of [order_by][crate::model::ListTerraformVersionsRequest::order_by].
7866    ///
7867    /// # Example
7868    /// ```ignore,no_run
7869    /// # use google_cloud_config_v1::model::ListTerraformVersionsRequest;
7870    /// let x = ListTerraformVersionsRequest::new().set_order_by("example");
7871    /// ```
7872    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7873        self.order_by = v.into();
7874        self
7875    }
7876}
7877
7878impl wkt::message::Message for ListTerraformVersionsRequest {
7879    fn typename() -> &'static str {
7880        "type.googleapis.com/google.cloud.config.v1.ListTerraformVersionsRequest"
7881    }
7882}
7883
7884/// The response message for the `ListTerraformVersions` method.
7885#[derive(Clone, Default, PartialEq)]
7886#[non_exhaustive]
7887pub struct ListTerraformVersionsResponse {
7888    /// List of [TerraformVersion][google.cloud.config.v1.TerraformVersion]s.
7889    ///
7890    /// [google.cloud.config.v1.TerraformVersion]: crate::model::TerraformVersion
7891    pub terraform_versions: std::vec::Vec<crate::model::TerraformVersion>,
7892
7893    /// Token to be supplied to the next ListTerraformVersions request via
7894    /// `page_token` to obtain the next set of results.
7895    pub next_page_token: std::string::String,
7896
7897    /// Unreachable resources, if any.
7898    pub unreachable: std::vec::Vec<std::string::String>,
7899
7900    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7901}
7902
7903impl ListTerraformVersionsResponse {
7904    pub fn new() -> Self {
7905        std::default::Default::default()
7906    }
7907
7908    /// Sets the value of [terraform_versions][crate::model::ListTerraformVersionsResponse::terraform_versions].
7909    ///
7910    /// # Example
7911    /// ```ignore,no_run
7912    /// # use google_cloud_config_v1::model::ListTerraformVersionsResponse;
7913    /// use google_cloud_config_v1::model::TerraformVersion;
7914    /// let x = ListTerraformVersionsResponse::new()
7915    ///     .set_terraform_versions([
7916    ///         TerraformVersion::default()/* use setters */,
7917    ///         TerraformVersion::default()/* use (different) setters */,
7918    ///     ]);
7919    /// ```
7920    pub fn set_terraform_versions<T, V>(mut self, v: T) -> Self
7921    where
7922        T: std::iter::IntoIterator<Item = V>,
7923        V: std::convert::Into<crate::model::TerraformVersion>,
7924    {
7925        use std::iter::Iterator;
7926        self.terraform_versions = v.into_iter().map(|i| i.into()).collect();
7927        self
7928    }
7929
7930    /// Sets the value of [next_page_token][crate::model::ListTerraformVersionsResponse::next_page_token].
7931    ///
7932    /// # Example
7933    /// ```ignore,no_run
7934    /// # use google_cloud_config_v1::model::ListTerraformVersionsResponse;
7935    /// let x = ListTerraformVersionsResponse::new().set_next_page_token("example");
7936    /// ```
7937    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7938        self.next_page_token = v.into();
7939        self
7940    }
7941
7942    /// Sets the value of [unreachable][crate::model::ListTerraformVersionsResponse::unreachable].
7943    ///
7944    /// # Example
7945    /// ```ignore,no_run
7946    /// # use google_cloud_config_v1::model::ListTerraformVersionsResponse;
7947    /// let x = ListTerraformVersionsResponse::new().set_unreachable(["a", "b", "c"]);
7948    /// ```
7949    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
7950    where
7951        T: std::iter::IntoIterator<Item = V>,
7952        V: std::convert::Into<std::string::String>,
7953    {
7954        use std::iter::Iterator;
7955        self.unreachable = v.into_iter().map(|i| i.into()).collect();
7956        self
7957    }
7958}
7959
7960impl wkt::message::Message for ListTerraformVersionsResponse {
7961    fn typename() -> &'static str {
7962        "type.googleapis.com/google.cloud.config.v1.ListTerraformVersionsResponse"
7963    }
7964}
7965
7966#[doc(hidden)]
7967impl google_cloud_gax::paginator::internal::PageableResponse for ListTerraformVersionsResponse {
7968    type PageItem = crate::model::TerraformVersion;
7969
7970    fn items(self) -> std::vec::Vec<Self::PageItem> {
7971        self.terraform_versions
7972    }
7973
7974    fn next_page_token(&self) -> std::string::String {
7975        use std::clone::Clone;
7976        self.next_page_token.clone()
7977    }
7978}
7979
7980/// A TerraformVersion represents the support state the corresponding
7981/// Terraform version.
7982#[derive(Clone, Default, PartialEq)]
7983#[non_exhaustive]
7984pub struct TerraformVersion {
7985    /// Identifier. The version name is in the format:
7986    /// 'projects/{project_id}/locations/{location}/terraformVersions/{terraform_version}'.
7987    pub name: std::string::String,
7988
7989    /// Output only. The state of the version, ACTIVE, DEPRECATED or OBSOLETE.
7990    pub state: crate::model::terraform_version::State,
7991
7992    /// Output only. When the version is supported.
7993    pub support_time: std::option::Option<wkt::Timestamp>,
7994
7995    /// Output only. When the version is deprecated.
7996    pub deprecate_time: std::option::Option<wkt::Timestamp>,
7997
7998    /// Output only. When the version is obsolete.
7999    pub obsolete_time: std::option::Option<wkt::Timestamp>,
8000
8001    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8002}
8003
8004impl TerraformVersion {
8005    pub fn new() -> Self {
8006        std::default::Default::default()
8007    }
8008
8009    /// Sets the value of [name][crate::model::TerraformVersion::name].
8010    ///
8011    /// # Example
8012    /// ```ignore,no_run
8013    /// # use google_cloud_config_v1::model::TerraformVersion;
8014    /// let x = TerraformVersion::new().set_name("example");
8015    /// ```
8016    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8017        self.name = v.into();
8018        self
8019    }
8020
8021    /// Sets the value of [state][crate::model::TerraformVersion::state].
8022    ///
8023    /// # Example
8024    /// ```ignore,no_run
8025    /// # use google_cloud_config_v1::model::TerraformVersion;
8026    /// use google_cloud_config_v1::model::terraform_version::State;
8027    /// let x0 = TerraformVersion::new().set_state(State::Active);
8028    /// let x1 = TerraformVersion::new().set_state(State::Deprecated);
8029    /// let x2 = TerraformVersion::new().set_state(State::Obsolete);
8030    /// ```
8031    pub fn set_state<T: std::convert::Into<crate::model::terraform_version::State>>(
8032        mut self,
8033        v: T,
8034    ) -> Self {
8035        self.state = v.into();
8036        self
8037    }
8038
8039    /// Sets the value of [support_time][crate::model::TerraformVersion::support_time].
8040    ///
8041    /// # Example
8042    /// ```ignore,no_run
8043    /// # use google_cloud_config_v1::model::TerraformVersion;
8044    /// use wkt::Timestamp;
8045    /// let x = TerraformVersion::new().set_support_time(Timestamp::default()/* use setters */);
8046    /// ```
8047    pub fn set_support_time<T>(mut self, v: T) -> Self
8048    where
8049        T: std::convert::Into<wkt::Timestamp>,
8050    {
8051        self.support_time = std::option::Option::Some(v.into());
8052        self
8053    }
8054
8055    /// Sets or clears the value of [support_time][crate::model::TerraformVersion::support_time].
8056    ///
8057    /// # Example
8058    /// ```ignore,no_run
8059    /// # use google_cloud_config_v1::model::TerraformVersion;
8060    /// use wkt::Timestamp;
8061    /// let x = TerraformVersion::new().set_or_clear_support_time(Some(Timestamp::default()/* use setters */));
8062    /// let x = TerraformVersion::new().set_or_clear_support_time(None::<Timestamp>);
8063    /// ```
8064    pub fn set_or_clear_support_time<T>(mut self, v: std::option::Option<T>) -> Self
8065    where
8066        T: std::convert::Into<wkt::Timestamp>,
8067    {
8068        self.support_time = v.map(|x| x.into());
8069        self
8070    }
8071
8072    /// Sets the value of [deprecate_time][crate::model::TerraformVersion::deprecate_time].
8073    ///
8074    /// # Example
8075    /// ```ignore,no_run
8076    /// # use google_cloud_config_v1::model::TerraformVersion;
8077    /// use wkt::Timestamp;
8078    /// let x = TerraformVersion::new().set_deprecate_time(Timestamp::default()/* use setters */);
8079    /// ```
8080    pub fn set_deprecate_time<T>(mut self, v: T) -> Self
8081    where
8082        T: std::convert::Into<wkt::Timestamp>,
8083    {
8084        self.deprecate_time = std::option::Option::Some(v.into());
8085        self
8086    }
8087
8088    /// Sets or clears the value of [deprecate_time][crate::model::TerraformVersion::deprecate_time].
8089    ///
8090    /// # Example
8091    /// ```ignore,no_run
8092    /// # use google_cloud_config_v1::model::TerraformVersion;
8093    /// use wkt::Timestamp;
8094    /// let x = TerraformVersion::new().set_or_clear_deprecate_time(Some(Timestamp::default()/* use setters */));
8095    /// let x = TerraformVersion::new().set_or_clear_deprecate_time(None::<Timestamp>);
8096    /// ```
8097    pub fn set_or_clear_deprecate_time<T>(mut self, v: std::option::Option<T>) -> Self
8098    where
8099        T: std::convert::Into<wkt::Timestamp>,
8100    {
8101        self.deprecate_time = v.map(|x| x.into());
8102        self
8103    }
8104
8105    /// Sets the value of [obsolete_time][crate::model::TerraformVersion::obsolete_time].
8106    ///
8107    /// # Example
8108    /// ```ignore,no_run
8109    /// # use google_cloud_config_v1::model::TerraformVersion;
8110    /// use wkt::Timestamp;
8111    /// let x = TerraformVersion::new().set_obsolete_time(Timestamp::default()/* use setters */);
8112    /// ```
8113    pub fn set_obsolete_time<T>(mut self, v: T) -> Self
8114    where
8115        T: std::convert::Into<wkt::Timestamp>,
8116    {
8117        self.obsolete_time = std::option::Option::Some(v.into());
8118        self
8119    }
8120
8121    /// Sets or clears the value of [obsolete_time][crate::model::TerraformVersion::obsolete_time].
8122    ///
8123    /// # Example
8124    /// ```ignore,no_run
8125    /// # use google_cloud_config_v1::model::TerraformVersion;
8126    /// use wkt::Timestamp;
8127    /// let x = TerraformVersion::new().set_or_clear_obsolete_time(Some(Timestamp::default()/* use setters */));
8128    /// let x = TerraformVersion::new().set_or_clear_obsolete_time(None::<Timestamp>);
8129    /// ```
8130    pub fn set_or_clear_obsolete_time<T>(mut self, v: std::option::Option<T>) -> Self
8131    where
8132        T: std::convert::Into<wkt::Timestamp>,
8133    {
8134        self.obsolete_time = v.map(|x| x.into());
8135        self
8136    }
8137}
8138
8139impl wkt::message::Message for TerraformVersion {
8140    fn typename() -> &'static str {
8141        "type.googleapis.com/google.cloud.config.v1.TerraformVersion"
8142    }
8143}
8144
8145/// Defines additional types related to [TerraformVersion].
8146pub mod terraform_version {
8147    #[allow(unused_imports)]
8148    use super::*;
8149
8150    /// Possible states of a TerraformVersion.
8151    ///
8152    /// # Working with unknown values
8153    ///
8154    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8155    /// additional enum variants at any time. Adding new variants is not considered
8156    /// a breaking change. Applications should write their code in anticipation of:
8157    ///
8158    /// - New values appearing in future releases of the client library, **and**
8159    /// - New values received dynamically, without application changes.
8160    ///
8161    /// Please consult the [Working with enums] section in the user guide for some
8162    /// guidelines.
8163    ///
8164    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
8165    #[derive(Clone, Debug, PartialEq)]
8166    #[non_exhaustive]
8167    pub enum State {
8168        /// The default value. This value is used if the state is omitted.
8169        Unspecified,
8170        /// The version is actively supported.
8171        Active,
8172        /// The version is deprecated.
8173        Deprecated,
8174        /// The version is obsolete.
8175        Obsolete,
8176        /// If set, the enum was initialized with an unknown value.
8177        ///
8178        /// Applications can examine the value using [State::value] or
8179        /// [State::name].
8180        UnknownValue(state::UnknownValue),
8181    }
8182
8183    #[doc(hidden)]
8184    pub mod state {
8185        #[allow(unused_imports)]
8186        use super::*;
8187        #[derive(Clone, Debug, PartialEq)]
8188        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8189    }
8190
8191    impl State {
8192        /// Gets the enum value.
8193        ///
8194        /// Returns `None` if the enum contains an unknown value deserialized from
8195        /// the string representation of enums.
8196        pub fn value(&self) -> std::option::Option<i32> {
8197            match self {
8198                Self::Unspecified => std::option::Option::Some(0),
8199                Self::Active => std::option::Option::Some(1),
8200                Self::Deprecated => std::option::Option::Some(2),
8201                Self::Obsolete => std::option::Option::Some(3),
8202                Self::UnknownValue(u) => u.0.value(),
8203            }
8204        }
8205
8206        /// Gets the enum value as a string.
8207        ///
8208        /// Returns `None` if the enum contains an unknown value deserialized from
8209        /// the integer representation of enums.
8210        pub fn name(&self) -> std::option::Option<&str> {
8211            match self {
8212                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
8213                Self::Active => std::option::Option::Some("ACTIVE"),
8214                Self::Deprecated => std::option::Option::Some("DEPRECATED"),
8215                Self::Obsolete => std::option::Option::Some("OBSOLETE"),
8216                Self::UnknownValue(u) => u.0.name(),
8217            }
8218        }
8219    }
8220
8221    impl std::default::Default for State {
8222        fn default() -> Self {
8223            use std::convert::From;
8224            Self::from(0)
8225        }
8226    }
8227
8228    impl std::fmt::Display for State {
8229        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8230            wkt::internal::display_enum(f, self.name(), self.value())
8231        }
8232    }
8233
8234    impl std::convert::From<i32> for State {
8235        fn from(value: i32) -> Self {
8236            match value {
8237                0 => Self::Unspecified,
8238                1 => Self::Active,
8239                2 => Self::Deprecated,
8240                3 => Self::Obsolete,
8241                _ => Self::UnknownValue(state::UnknownValue(
8242                    wkt::internal::UnknownEnumValue::Integer(value),
8243                )),
8244            }
8245        }
8246    }
8247
8248    impl std::convert::From<&str> for State {
8249        fn from(value: &str) -> Self {
8250            use std::string::ToString;
8251            match value {
8252                "STATE_UNSPECIFIED" => Self::Unspecified,
8253                "ACTIVE" => Self::Active,
8254                "DEPRECATED" => Self::Deprecated,
8255                "OBSOLETE" => Self::Obsolete,
8256                _ => Self::UnknownValue(state::UnknownValue(
8257                    wkt::internal::UnknownEnumValue::String(value.to_string()),
8258                )),
8259            }
8260        }
8261    }
8262
8263    impl serde::ser::Serialize for State {
8264        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8265        where
8266            S: serde::Serializer,
8267        {
8268            match self {
8269                Self::Unspecified => serializer.serialize_i32(0),
8270                Self::Active => serializer.serialize_i32(1),
8271                Self::Deprecated => serializer.serialize_i32(2),
8272                Self::Obsolete => serializer.serialize_i32(3),
8273                Self::UnknownValue(u) => u.0.serialize(serializer),
8274            }
8275        }
8276    }
8277
8278    impl<'de> serde::de::Deserialize<'de> for State {
8279        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8280        where
8281            D: serde::Deserializer<'de>,
8282        {
8283            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
8284                ".google.cloud.config.v1.TerraformVersion.State",
8285            ))
8286        }
8287    }
8288}
8289
8290/// Terraform info of a ResourceChange.
8291#[derive(Clone, Default, PartialEq)]
8292#[non_exhaustive]
8293pub struct ResourceChangeTerraformInfo {
8294    /// Output only. TF resource address that uniquely identifies the resource.
8295    pub address: std::string::String,
8296
8297    /// Output only. TF resource type.
8298    pub r#type: std::string::String,
8299
8300    /// Output only. TF resource name.
8301    pub resource_name: std::string::String,
8302
8303    /// Output only. TF resource provider.
8304    pub provider: std::string::String,
8305
8306    /// Output only. TF resource actions.
8307    pub actions: std::vec::Vec<std::string::String>,
8308
8309    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8310}
8311
8312impl ResourceChangeTerraformInfo {
8313    pub fn new() -> Self {
8314        std::default::Default::default()
8315    }
8316
8317    /// Sets the value of [address][crate::model::ResourceChangeTerraformInfo::address].
8318    ///
8319    /// # Example
8320    /// ```ignore,no_run
8321    /// # use google_cloud_config_v1::model::ResourceChangeTerraformInfo;
8322    /// let x = ResourceChangeTerraformInfo::new().set_address("example");
8323    /// ```
8324    pub fn set_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8325        self.address = v.into();
8326        self
8327    }
8328
8329    /// Sets the value of [r#type][crate::model::ResourceChangeTerraformInfo::type].
8330    ///
8331    /// # Example
8332    /// ```ignore,no_run
8333    /// # use google_cloud_config_v1::model::ResourceChangeTerraformInfo;
8334    /// let x = ResourceChangeTerraformInfo::new().set_type("example");
8335    /// ```
8336    pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8337        self.r#type = v.into();
8338        self
8339    }
8340
8341    /// Sets the value of [resource_name][crate::model::ResourceChangeTerraformInfo::resource_name].
8342    ///
8343    /// # Example
8344    /// ```ignore,no_run
8345    /// # use google_cloud_config_v1::model::ResourceChangeTerraformInfo;
8346    /// let x = ResourceChangeTerraformInfo::new().set_resource_name("example");
8347    /// ```
8348    pub fn set_resource_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8349        self.resource_name = v.into();
8350        self
8351    }
8352
8353    /// Sets the value of [provider][crate::model::ResourceChangeTerraformInfo::provider].
8354    ///
8355    /// # Example
8356    /// ```ignore,no_run
8357    /// # use google_cloud_config_v1::model::ResourceChangeTerraformInfo;
8358    /// let x = ResourceChangeTerraformInfo::new().set_provider("example");
8359    /// ```
8360    pub fn set_provider<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8361        self.provider = v.into();
8362        self
8363    }
8364
8365    /// Sets the value of [actions][crate::model::ResourceChangeTerraformInfo::actions].
8366    ///
8367    /// # Example
8368    /// ```ignore,no_run
8369    /// # use google_cloud_config_v1::model::ResourceChangeTerraformInfo;
8370    /// let x = ResourceChangeTerraformInfo::new().set_actions(["a", "b", "c"]);
8371    /// ```
8372    pub fn set_actions<T, V>(mut self, v: T) -> Self
8373    where
8374        T: std::iter::IntoIterator<Item = V>,
8375        V: std::convert::Into<std::string::String>,
8376    {
8377        use std::iter::Iterator;
8378        self.actions = v.into_iter().map(|i| i.into()).collect();
8379        self
8380    }
8381}
8382
8383impl wkt::message::Message for ResourceChangeTerraformInfo {
8384    fn typename() -> &'static str {
8385        "type.googleapis.com/google.cloud.config.v1.ResourceChangeTerraformInfo"
8386    }
8387}
8388
8389/// A resource change represents a change to a resource in the state file.
8390#[derive(Clone, Default, PartialEq)]
8391#[non_exhaustive]
8392pub struct ResourceChange {
8393    /// Identifier. The name of the resource change.
8394    /// Format:
8395    /// 'projects/{project_id}/locations/{location}/previews/{preview}/resourceChanges/{resource_change}'.
8396    pub name: std::string::String,
8397
8398    /// Output only. Terraform info of the resource change.
8399    pub terraform_info: std::option::Option<crate::model::ResourceChangeTerraformInfo>,
8400
8401    /// Output only. The intent of the resource change.
8402    pub intent: crate::model::resource_change::Intent,
8403
8404    /// Output only. The property changes of the resource change.
8405    pub property_changes: std::vec::Vec<crate::model::PropertyChange>,
8406
8407    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8408}
8409
8410impl ResourceChange {
8411    pub fn new() -> Self {
8412        std::default::Default::default()
8413    }
8414
8415    /// Sets the value of [name][crate::model::ResourceChange::name].
8416    ///
8417    /// # Example
8418    /// ```ignore,no_run
8419    /// # use google_cloud_config_v1::model::ResourceChange;
8420    /// let x = ResourceChange::new().set_name("example");
8421    /// ```
8422    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8423        self.name = v.into();
8424        self
8425    }
8426
8427    /// Sets the value of [terraform_info][crate::model::ResourceChange::terraform_info].
8428    ///
8429    /// # Example
8430    /// ```ignore,no_run
8431    /// # use google_cloud_config_v1::model::ResourceChange;
8432    /// use google_cloud_config_v1::model::ResourceChangeTerraformInfo;
8433    /// let x = ResourceChange::new().set_terraform_info(ResourceChangeTerraformInfo::default()/* use setters */);
8434    /// ```
8435    pub fn set_terraform_info<T>(mut self, v: T) -> Self
8436    where
8437        T: std::convert::Into<crate::model::ResourceChangeTerraformInfo>,
8438    {
8439        self.terraform_info = std::option::Option::Some(v.into());
8440        self
8441    }
8442
8443    /// Sets or clears the value of [terraform_info][crate::model::ResourceChange::terraform_info].
8444    ///
8445    /// # Example
8446    /// ```ignore,no_run
8447    /// # use google_cloud_config_v1::model::ResourceChange;
8448    /// use google_cloud_config_v1::model::ResourceChangeTerraformInfo;
8449    /// let x = ResourceChange::new().set_or_clear_terraform_info(Some(ResourceChangeTerraformInfo::default()/* use setters */));
8450    /// let x = ResourceChange::new().set_or_clear_terraform_info(None::<ResourceChangeTerraformInfo>);
8451    /// ```
8452    pub fn set_or_clear_terraform_info<T>(mut self, v: std::option::Option<T>) -> Self
8453    where
8454        T: std::convert::Into<crate::model::ResourceChangeTerraformInfo>,
8455    {
8456        self.terraform_info = v.map(|x| x.into());
8457        self
8458    }
8459
8460    /// Sets the value of [intent][crate::model::ResourceChange::intent].
8461    ///
8462    /// # Example
8463    /// ```ignore,no_run
8464    /// # use google_cloud_config_v1::model::ResourceChange;
8465    /// use google_cloud_config_v1::model::resource_change::Intent;
8466    /// let x0 = ResourceChange::new().set_intent(Intent::Create);
8467    /// let x1 = ResourceChange::new().set_intent(Intent::Update);
8468    /// let x2 = ResourceChange::new().set_intent(Intent::Delete);
8469    /// ```
8470    pub fn set_intent<T: std::convert::Into<crate::model::resource_change::Intent>>(
8471        mut self,
8472        v: T,
8473    ) -> Self {
8474        self.intent = v.into();
8475        self
8476    }
8477
8478    /// Sets the value of [property_changes][crate::model::ResourceChange::property_changes].
8479    ///
8480    /// # Example
8481    /// ```ignore,no_run
8482    /// # use google_cloud_config_v1::model::ResourceChange;
8483    /// use google_cloud_config_v1::model::PropertyChange;
8484    /// let x = ResourceChange::new()
8485    ///     .set_property_changes([
8486    ///         PropertyChange::default()/* use setters */,
8487    ///         PropertyChange::default()/* use (different) setters */,
8488    ///     ]);
8489    /// ```
8490    pub fn set_property_changes<T, V>(mut self, v: T) -> Self
8491    where
8492        T: std::iter::IntoIterator<Item = V>,
8493        V: std::convert::Into<crate::model::PropertyChange>,
8494    {
8495        use std::iter::Iterator;
8496        self.property_changes = v.into_iter().map(|i| i.into()).collect();
8497        self
8498    }
8499}
8500
8501impl wkt::message::Message for ResourceChange {
8502    fn typename() -> &'static str {
8503        "type.googleapis.com/google.cloud.config.v1.ResourceChange"
8504    }
8505}
8506
8507/// Defines additional types related to [ResourceChange].
8508pub mod resource_change {
8509    #[allow(unused_imports)]
8510    use super::*;
8511
8512    /// Possible intent of the resource change.
8513    ///
8514    /// # Working with unknown values
8515    ///
8516    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8517    /// additional enum variants at any time. Adding new variants is not considered
8518    /// a breaking change. Applications should write their code in anticipation of:
8519    ///
8520    /// - New values appearing in future releases of the client library, **and**
8521    /// - New values received dynamically, without application changes.
8522    ///
8523    /// Please consult the [Working with enums] section in the user guide for some
8524    /// guidelines.
8525    ///
8526    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
8527    #[derive(Clone, Debug, PartialEq)]
8528    #[non_exhaustive]
8529    pub enum Intent {
8530        /// The default value.
8531        Unspecified,
8532        /// The resource will be created.
8533        Create,
8534        /// The resource will be updated.
8535        Update,
8536        /// The resource will be deleted.
8537        Delete,
8538        /// The resource will be recreated.
8539        Recreate,
8540        /// The resource will be untouched.
8541        Unchanged,
8542        /// If set, the enum was initialized with an unknown value.
8543        ///
8544        /// Applications can examine the value using [Intent::value] or
8545        /// [Intent::name].
8546        UnknownValue(intent::UnknownValue),
8547    }
8548
8549    #[doc(hidden)]
8550    pub mod intent {
8551        #[allow(unused_imports)]
8552        use super::*;
8553        #[derive(Clone, Debug, PartialEq)]
8554        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8555    }
8556
8557    impl Intent {
8558        /// Gets the enum value.
8559        ///
8560        /// Returns `None` if the enum contains an unknown value deserialized from
8561        /// the string representation of enums.
8562        pub fn value(&self) -> std::option::Option<i32> {
8563            match self {
8564                Self::Unspecified => std::option::Option::Some(0),
8565                Self::Create => std::option::Option::Some(1),
8566                Self::Update => std::option::Option::Some(2),
8567                Self::Delete => std::option::Option::Some(3),
8568                Self::Recreate => std::option::Option::Some(4),
8569                Self::Unchanged => std::option::Option::Some(5),
8570                Self::UnknownValue(u) => u.0.value(),
8571            }
8572        }
8573
8574        /// Gets the enum value as a string.
8575        ///
8576        /// Returns `None` if the enum contains an unknown value deserialized from
8577        /// the integer representation of enums.
8578        pub fn name(&self) -> std::option::Option<&str> {
8579            match self {
8580                Self::Unspecified => std::option::Option::Some("INTENT_UNSPECIFIED"),
8581                Self::Create => std::option::Option::Some("CREATE"),
8582                Self::Update => std::option::Option::Some("UPDATE"),
8583                Self::Delete => std::option::Option::Some("DELETE"),
8584                Self::Recreate => std::option::Option::Some("RECREATE"),
8585                Self::Unchanged => std::option::Option::Some("UNCHANGED"),
8586                Self::UnknownValue(u) => u.0.name(),
8587            }
8588        }
8589    }
8590
8591    impl std::default::Default for Intent {
8592        fn default() -> Self {
8593            use std::convert::From;
8594            Self::from(0)
8595        }
8596    }
8597
8598    impl std::fmt::Display for Intent {
8599        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8600            wkt::internal::display_enum(f, self.name(), self.value())
8601        }
8602    }
8603
8604    impl std::convert::From<i32> for Intent {
8605        fn from(value: i32) -> Self {
8606            match value {
8607                0 => Self::Unspecified,
8608                1 => Self::Create,
8609                2 => Self::Update,
8610                3 => Self::Delete,
8611                4 => Self::Recreate,
8612                5 => Self::Unchanged,
8613                _ => Self::UnknownValue(intent::UnknownValue(
8614                    wkt::internal::UnknownEnumValue::Integer(value),
8615                )),
8616            }
8617        }
8618    }
8619
8620    impl std::convert::From<&str> for Intent {
8621        fn from(value: &str) -> Self {
8622            use std::string::ToString;
8623            match value {
8624                "INTENT_UNSPECIFIED" => Self::Unspecified,
8625                "CREATE" => Self::Create,
8626                "UPDATE" => Self::Update,
8627                "DELETE" => Self::Delete,
8628                "RECREATE" => Self::Recreate,
8629                "UNCHANGED" => Self::Unchanged,
8630                _ => Self::UnknownValue(intent::UnknownValue(
8631                    wkt::internal::UnknownEnumValue::String(value.to_string()),
8632                )),
8633            }
8634        }
8635    }
8636
8637    impl serde::ser::Serialize for Intent {
8638        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8639        where
8640            S: serde::Serializer,
8641        {
8642            match self {
8643                Self::Unspecified => serializer.serialize_i32(0),
8644                Self::Create => serializer.serialize_i32(1),
8645                Self::Update => serializer.serialize_i32(2),
8646                Self::Delete => serializer.serialize_i32(3),
8647                Self::Recreate => serializer.serialize_i32(4),
8648                Self::Unchanged => serializer.serialize_i32(5),
8649                Self::UnknownValue(u) => u.0.serialize(serializer),
8650            }
8651        }
8652    }
8653
8654    impl<'de> serde::de::Deserialize<'de> for Intent {
8655        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8656        where
8657            D: serde::Deserializer<'de>,
8658        {
8659            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Intent>::new(
8660                ".google.cloud.config.v1.ResourceChange.Intent",
8661            ))
8662        }
8663    }
8664}
8665
8666/// A property change represents a change to a property in the state file.
8667#[derive(Clone, Default, PartialEq)]
8668#[non_exhaustive]
8669pub struct PropertyChange {
8670    /// Output only. The path of the property change.
8671    pub path: std::string::String,
8672
8673    /// Output only. The paths of sensitive fields in `before`. Paths are relative
8674    /// to `path`.
8675    pub before_sensitive_paths: std::vec::Vec<std::string::String>,
8676
8677    /// Output only. Representations of the object value before the actions.
8678    pub before: std::option::Option<wkt::Value>,
8679
8680    /// Output only. The paths of sensitive fields in `after`. Paths are relative
8681    /// to `path`.
8682    pub after_sensitive_paths: std::vec::Vec<std::string::String>,
8683
8684    /// Output only. Representations of the object value after the actions.
8685    pub after: std::option::Option<wkt::Value>,
8686
8687    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8688}
8689
8690impl PropertyChange {
8691    pub fn new() -> Self {
8692        std::default::Default::default()
8693    }
8694
8695    /// Sets the value of [path][crate::model::PropertyChange::path].
8696    ///
8697    /// # Example
8698    /// ```ignore,no_run
8699    /// # use google_cloud_config_v1::model::PropertyChange;
8700    /// let x = PropertyChange::new().set_path("example");
8701    /// ```
8702    pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8703        self.path = v.into();
8704        self
8705    }
8706
8707    /// Sets the value of [before_sensitive_paths][crate::model::PropertyChange::before_sensitive_paths].
8708    ///
8709    /// # Example
8710    /// ```ignore,no_run
8711    /// # use google_cloud_config_v1::model::PropertyChange;
8712    /// let x = PropertyChange::new().set_before_sensitive_paths(["a", "b", "c"]);
8713    /// ```
8714    pub fn set_before_sensitive_paths<T, V>(mut self, v: T) -> Self
8715    where
8716        T: std::iter::IntoIterator<Item = V>,
8717        V: std::convert::Into<std::string::String>,
8718    {
8719        use std::iter::Iterator;
8720        self.before_sensitive_paths = v.into_iter().map(|i| i.into()).collect();
8721        self
8722    }
8723
8724    /// Sets the value of [before][crate::model::PropertyChange::before].
8725    ///
8726    /// # Example
8727    /// ```ignore,no_run
8728    /// # use google_cloud_config_v1::model::PropertyChange;
8729    /// use wkt::Value;
8730    /// let x = PropertyChange::new().set_before(Value::default()/* use setters */);
8731    /// ```
8732    pub fn set_before<T>(mut self, v: T) -> Self
8733    where
8734        T: std::convert::Into<wkt::Value>,
8735    {
8736        self.before = std::option::Option::Some(v.into());
8737        self
8738    }
8739
8740    /// Sets or clears the value of [before][crate::model::PropertyChange::before].
8741    ///
8742    /// # Example
8743    /// ```ignore,no_run
8744    /// # use google_cloud_config_v1::model::PropertyChange;
8745    /// use wkt::Value;
8746    /// let x = PropertyChange::new().set_or_clear_before(Some(Value::default()/* use setters */));
8747    /// let x = PropertyChange::new().set_or_clear_before(None::<Value>);
8748    /// ```
8749    pub fn set_or_clear_before<T>(mut self, v: std::option::Option<T>) -> Self
8750    where
8751        T: std::convert::Into<wkt::Value>,
8752    {
8753        self.before = v.map(|x| x.into());
8754        self
8755    }
8756
8757    /// Sets the value of [after_sensitive_paths][crate::model::PropertyChange::after_sensitive_paths].
8758    ///
8759    /// # Example
8760    /// ```ignore,no_run
8761    /// # use google_cloud_config_v1::model::PropertyChange;
8762    /// let x = PropertyChange::new().set_after_sensitive_paths(["a", "b", "c"]);
8763    /// ```
8764    pub fn set_after_sensitive_paths<T, V>(mut self, v: T) -> Self
8765    where
8766        T: std::iter::IntoIterator<Item = V>,
8767        V: std::convert::Into<std::string::String>,
8768    {
8769        use std::iter::Iterator;
8770        self.after_sensitive_paths = v.into_iter().map(|i| i.into()).collect();
8771        self
8772    }
8773
8774    /// Sets the value of [after][crate::model::PropertyChange::after].
8775    ///
8776    /// # Example
8777    /// ```ignore,no_run
8778    /// # use google_cloud_config_v1::model::PropertyChange;
8779    /// use wkt::Value;
8780    /// let x = PropertyChange::new().set_after(Value::default()/* use setters */);
8781    /// ```
8782    pub fn set_after<T>(mut self, v: T) -> Self
8783    where
8784        T: std::convert::Into<wkt::Value>,
8785    {
8786        self.after = std::option::Option::Some(v.into());
8787        self
8788    }
8789
8790    /// Sets or clears the value of [after][crate::model::PropertyChange::after].
8791    ///
8792    /// # Example
8793    /// ```ignore,no_run
8794    /// # use google_cloud_config_v1::model::PropertyChange;
8795    /// use wkt::Value;
8796    /// let x = PropertyChange::new().set_or_clear_after(Some(Value::default()/* use setters */));
8797    /// let x = PropertyChange::new().set_or_clear_after(None::<Value>);
8798    /// ```
8799    pub fn set_or_clear_after<T>(mut self, v: std::option::Option<T>) -> Self
8800    where
8801        T: std::convert::Into<wkt::Value>,
8802    {
8803        self.after = v.map(|x| x.into());
8804        self
8805    }
8806}
8807
8808impl wkt::message::Message for PropertyChange {
8809    fn typename() -> &'static str {
8810        "type.googleapis.com/google.cloud.config.v1.PropertyChange"
8811    }
8812}
8813
8814/// The request message for the ListResourceChanges method.
8815#[derive(Clone, Default, PartialEq)]
8816#[non_exhaustive]
8817pub struct ListResourceChangesRequest {
8818    /// Required. The parent in whose context the ResourceChanges are listed. The
8819    /// parent value is in the format:
8820    /// 'projects/{project_id}/locations/{location}/previews/{preview}'.
8821    pub parent: std::string::String,
8822
8823    /// Optional. When requesting a page of resource changes, 'page_size' specifies
8824    /// number of resource changes to return. If unspecified, at most 500 will be
8825    /// returned. The maximum value is 1000.
8826    pub page_size: i32,
8827
8828    /// Optional. Token returned by previous call to 'ListResourceChanges' which
8829    /// specifies the position in the list from where to continue listing the
8830    /// resource changes.
8831    pub page_token: std::string::String,
8832
8833    /// Optional. Lists the resource changes that match the filter expression. A
8834    /// filter expression filters the resource changes listed in the response. The
8835    /// expression must be of the form '{field} {operator} {value}' where
8836    /// operators: '<', '>',
8837    /// '<=',
8838    /// '>=',
8839    /// '!=', '=', ':' are supported (colon ':' represents a HAS operator which is
8840    /// roughly synonymous with equality). {field} can refer to a proto or JSON
8841    /// field, or a synthetic field. Field names can be camelCase or snake_case.
8842    ///
8843    /// Examples:
8844    ///
8845    /// - Filter by name:
8846    ///   name =
8847    ///   "projects/foo/locations/us-central1/previews/dep/resourceChanges/baz
8848    pub filter: std::string::String,
8849
8850    /// Optional. Field to use to sort the list.
8851    pub order_by: std::string::String,
8852
8853    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8854}
8855
8856impl ListResourceChangesRequest {
8857    pub fn new() -> Self {
8858        std::default::Default::default()
8859    }
8860
8861    /// Sets the value of [parent][crate::model::ListResourceChangesRequest::parent].
8862    ///
8863    /// # Example
8864    /// ```ignore,no_run
8865    /// # use google_cloud_config_v1::model::ListResourceChangesRequest;
8866    /// let x = ListResourceChangesRequest::new().set_parent("example");
8867    /// ```
8868    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8869        self.parent = v.into();
8870        self
8871    }
8872
8873    /// Sets the value of [page_size][crate::model::ListResourceChangesRequest::page_size].
8874    ///
8875    /// # Example
8876    /// ```ignore,no_run
8877    /// # use google_cloud_config_v1::model::ListResourceChangesRequest;
8878    /// let x = ListResourceChangesRequest::new().set_page_size(42);
8879    /// ```
8880    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8881        self.page_size = v.into();
8882        self
8883    }
8884
8885    /// Sets the value of [page_token][crate::model::ListResourceChangesRequest::page_token].
8886    ///
8887    /// # Example
8888    /// ```ignore,no_run
8889    /// # use google_cloud_config_v1::model::ListResourceChangesRequest;
8890    /// let x = ListResourceChangesRequest::new().set_page_token("example");
8891    /// ```
8892    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8893        self.page_token = v.into();
8894        self
8895    }
8896
8897    /// Sets the value of [filter][crate::model::ListResourceChangesRequest::filter].
8898    ///
8899    /// # Example
8900    /// ```ignore,no_run
8901    /// # use google_cloud_config_v1::model::ListResourceChangesRequest;
8902    /// let x = ListResourceChangesRequest::new().set_filter("example");
8903    /// ```
8904    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8905        self.filter = v.into();
8906        self
8907    }
8908
8909    /// Sets the value of [order_by][crate::model::ListResourceChangesRequest::order_by].
8910    ///
8911    /// # Example
8912    /// ```ignore,no_run
8913    /// # use google_cloud_config_v1::model::ListResourceChangesRequest;
8914    /// let x = ListResourceChangesRequest::new().set_order_by("example");
8915    /// ```
8916    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8917        self.order_by = v.into();
8918        self
8919    }
8920}
8921
8922impl wkt::message::Message for ListResourceChangesRequest {
8923    fn typename() -> &'static str {
8924        "type.googleapis.com/google.cloud.config.v1.ListResourceChangesRequest"
8925    }
8926}
8927
8928/// A response to a 'ListResourceChanges' call. Contains a list of
8929/// ResourceChanges.
8930#[derive(Clone, Default, PartialEq)]
8931#[non_exhaustive]
8932pub struct ListResourceChangesResponse {
8933    /// List of ResourceChanges.
8934    pub resource_changes: std::vec::Vec<crate::model::ResourceChange>,
8935
8936    /// A token to request the next page of resources from the
8937    /// 'ListResourceChanges' method. The value of an empty string means that
8938    /// there are no more resources to return.
8939    pub next_page_token: std::string::String,
8940
8941    /// Unreachable resources, if any.
8942    pub unreachable: std::vec::Vec<std::string::String>,
8943
8944    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8945}
8946
8947impl ListResourceChangesResponse {
8948    pub fn new() -> Self {
8949        std::default::Default::default()
8950    }
8951
8952    /// Sets the value of [resource_changes][crate::model::ListResourceChangesResponse::resource_changes].
8953    ///
8954    /// # Example
8955    /// ```ignore,no_run
8956    /// # use google_cloud_config_v1::model::ListResourceChangesResponse;
8957    /// use google_cloud_config_v1::model::ResourceChange;
8958    /// let x = ListResourceChangesResponse::new()
8959    ///     .set_resource_changes([
8960    ///         ResourceChange::default()/* use setters */,
8961    ///         ResourceChange::default()/* use (different) setters */,
8962    ///     ]);
8963    /// ```
8964    pub fn set_resource_changes<T, V>(mut self, v: T) -> Self
8965    where
8966        T: std::iter::IntoIterator<Item = V>,
8967        V: std::convert::Into<crate::model::ResourceChange>,
8968    {
8969        use std::iter::Iterator;
8970        self.resource_changes = v.into_iter().map(|i| i.into()).collect();
8971        self
8972    }
8973
8974    /// Sets the value of [next_page_token][crate::model::ListResourceChangesResponse::next_page_token].
8975    ///
8976    /// # Example
8977    /// ```ignore,no_run
8978    /// # use google_cloud_config_v1::model::ListResourceChangesResponse;
8979    /// let x = ListResourceChangesResponse::new().set_next_page_token("example");
8980    /// ```
8981    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8982        self.next_page_token = v.into();
8983        self
8984    }
8985
8986    /// Sets the value of [unreachable][crate::model::ListResourceChangesResponse::unreachable].
8987    ///
8988    /// # Example
8989    /// ```ignore,no_run
8990    /// # use google_cloud_config_v1::model::ListResourceChangesResponse;
8991    /// let x = ListResourceChangesResponse::new().set_unreachable(["a", "b", "c"]);
8992    /// ```
8993    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
8994    where
8995        T: std::iter::IntoIterator<Item = V>,
8996        V: std::convert::Into<std::string::String>,
8997    {
8998        use std::iter::Iterator;
8999        self.unreachable = v.into_iter().map(|i| i.into()).collect();
9000        self
9001    }
9002}
9003
9004impl wkt::message::Message for ListResourceChangesResponse {
9005    fn typename() -> &'static str {
9006        "type.googleapis.com/google.cloud.config.v1.ListResourceChangesResponse"
9007    }
9008}
9009
9010#[doc(hidden)]
9011impl google_cloud_gax::paginator::internal::PageableResponse for ListResourceChangesResponse {
9012    type PageItem = crate::model::ResourceChange;
9013
9014    fn items(self) -> std::vec::Vec<Self::PageItem> {
9015        self.resource_changes
9016    }
9017
9018    fn next_page_token(&self) -> std::string::String {
9019        use std::clone::Clone;
9020        self.next_page_token.clone()
9021    }
9022}
9023
9024/// The request message for the GetResourceChange method.
9025#[derive(Clone, Default, PartialEq)]
9026#[non_exhaustive]
9027pub struct GetResourceChangeRequest {
9028    /// Required. The name of the resource change to retrieve.
9029    /// Format:
9030    /// 'projects/{project_id}/locations/{location}/previews/{preview}/resourceChanges/{resource_change}'.
9031    pub name: std::string::String,
9032
9033    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9034}
9035
9036impl GetResourceChangeRequest {
9037    pub fn new() -> Self {
9038        std::default::Default::default()
9039    }
9040
9041    /// Sets the value of [name][crate::model::GetResourceChangeRequest::name].
9042    ///
9043    /// # Example
9044    /// ```ignore,no_run
9045    /// # use google_cloud_config_v1::model::GetResourceChangeRequest;
9046    /// let x = GetResourceChangeRequest::new().set_name("example");
9047    /// ```
9048    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9049        self.name = v.into();
9050        self
9051    }
9052}
9053
9054impl wkt::message::Message for GetResourceChangeRequest {
9055    fn typename() -> &'static str {
9056        "type.googleapis.com/google.cloud.config.v1.GetResourceChangeRequest"
9057    }
9058}
9059
9060/// Terraform info of a ResourceChange.
9061#[derive(Clone, Default, PartialEq)]
9062#[non_exhaustive]
9063pub struct ResourceDriftTerraformInfo {
9064    /// Output only. The address of the drifted resource.
9065    pub address: std::string::String,
9066
9067    /// Output only. The type of the drifted resource.
9068    pub r#type: std::string::String,
9069
9070    /// Output only. TF resource name.
9071    pub resource_name: std::string::String,
9072
9073    /// Output only. The provider of the drifted resource.
9074    pub provider: std::string::String,
9075
9076    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9077}
9078
9079impl ResourceDriftTerraformInfo {
9080    pub fn new() -> Self {
9081        std::default::Default::default()
9082    }
9083
9084    /// Sets the value of [address][crate::model::ResourceDriftTerraformInfo::address].
9085    ///
9086    /// # Example
9087    /// ```ignore,no_run
9088    /// # use google_cloud_config_v1::model::ResourceDriftTerraformInfo;
9089    /// let x = ResourceDriftTerraformInfo::new().set_address("example");
9090    /// ```
9091    pub fn set_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9092        self.address = v.into();
9093        self
9094    }
9095
9096    /// Sets the value of [r#type][crate::model::ResourceDriftTerraformInfo::type].
9097    ///
9098    /// # Example
9099    /// ```ignore,no_run
9100    /// # use google_cloud_config_v1::model::ResourceDriftTerraformInfo;
9101    /// let x = ResourceDriftTerraformInfo::new().set_type("example");
9102    /// ```
9103    pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9104        self.r#type = v.into();
9105        self
9106    }
9107
9108    /// Sets the value of [resource_name][crate::model::ResourceDriftTerraformInfo::resource_name].
9109    ///
9110    /// # Example
9111    /// ```ignore,no_run
9112    /// # use google_cloud_config_v1::model::ResourceDriftTerraformInfo;
9113    /// let x = ResourceDriftTerraformInfo::new().set_resource_name("example");
9114    /// ```
9115    pub fn set_resource_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9116        self.resource_name = v.into();
9117        self
9118    }
9119
9120    /// Sets the value of [provider][crate::model::ResourceDriftTerraformInfo::provider].
9121    ///
9122    /// # Example
9123    /// ```ignore,no_run
9124    /// # use google_cloud_config_v1::model::ResourceDriftTerraformInfo;
9125    /// let x = ResourceDriftTerraformInfo::new().set_provider("example");
9126    /// ```
9127    pub fn set_provider<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9128        self.provider = v.into();
9129        self
9130    }
9131}
9132
9133impl wkt::message::Message for ResourceDriftTerraformInfo {
9134    fn typename() -> &'static str {
9135        "type.googleapis.com/google.cloud.config.v1.ResourceDriftTerraformInfo"
9136    }
9137}
9138
9139/// A resource drift represents a drift to a resource in the state file.
9140#[derive(Clone, Default, PartialEq)]
9141#[non_exhaustive]
9142pub struct ResourceDrift {
9143    /// Identifier. The name of the resource drift.
9144    /// Format:
9145    /// 'projects/{project_id}/locations/{location}/previews/{preview}/resourceDrifts/{resource_drift}'.
9146    pub name: std::string::String,
9147
9148    /// Output only. Terraform info of the resource drift.
9149    pub terraform_info: std::option::Option<crate::model::ResourceDriftTerraformInfo>,
9150
9151    /// Output only. The property drifts of the resource drift.
9152    pub property_drifts: std::vec::Vec<crate::model::PropertyDrift>,
9153
9154    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9155}
9156
9157impl ResourceDrift {
9158    pub fn new() -> Self {
9159        std::default::Default::default()
9160    }
9161
9162    /// Sets the value of [name][crate::model::ResourceDrift::name].
9163    ///
9164    /// # Example
9165    /// ```ignore,no_run
9166    /// # use google_cloud_config_v1::model::ResourceDrift;
9167    /// let x = ResourceDrift::new().set_name("example");
9168    /// ```
9169    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9170        self.name = v.into();
9171        self
9172    }
9173
9174    /// Sets the value of [terraform_info][crate::model::ResourceDrift::terraform_info].
9175    ///
9176    /// # Example
9177    /// ```ignore,no_run
9178    /// # use google_cloud_config_v1::model::ResourceDrift;
9179    /// use google_cloud_config_v1::model::ResourceDriftTerraformInfo;
9180    /// let x = ResourceDrift::new().set_terraform_info(ResourceDriftTerraformInfo::default()/* use setters */);
9181    /// ```
9182    pub fn set_terraform_info<T>(mut self, v: T) -> Self
9183    where
9184        T: std::convert::Into<crate::model::ResourceDriftTerraformInfo>,
9185    {
9186        self.terraform_info = std::option::Option::Some(v.into());
9187        self
9188    }
9189
9190    /// Sets or clears the value of [terraform_info][crate::model::ResourceDrift::terraform_info].
9191    ///
9192    /// # Example
9193    /// ```ignore,no_run
9194    /// # use google_cloud_config_v1::model::ResourceDrift;
9195    /// use google_cloud_config_v1::model::ResourceDriftTerraformInfo;
9196    /// let x = ResourceDrift::new().set_or_clear_terraform_info(Some(ResourceDriftTerraformInfo::default()/* use setters */));
9197    /// let x = ResourceDrift::new().set_or_clear_terraform_info(None::<ResourceDriftTerraformInfo>);
9198    /// ```
9199    pub fn set_or_clear_terraform_info<T>(mut self, v: std::option::Option<T>) -> Self
9200    where
9201        T: std::convert::Into<crate::model::ResourceDriftTerraformInfo>,
9202    {
9203        self.terraform_info = v.map(|x| x.into());
9204        self
9205    }
9206
9207    /// Sets the value of [property_drifts][crate::model::ResourceDrift::property_drifts].
9208    ///
9209    /// # Example
9210    /// ```ignore,no_run
9211    /// # use google_cloud_config_v1::model::ResourceDrift;
9212    /// use google_cloud_config_v1::model::PropertyDrift;
9213    /// let x = ResourceDrift::new()
9214    ///     .set_property_drifts([
9215    ///         PropertyDrift::default()/* use setters */,
9216    ///         PropertyDrift::default()/* use (different) setters */,
9217    ///     ]);
9218    /// ```
9219    pub fn set_property_drifts<T, V>(mut self, v: T) -> Self
9220    where
9221        T: std::iter::IntoIterator<Item = V>,
9222        V: std::convert::Into<crate::model::PropertyDrift>,
9223    {
9224        use std::iter::Iterator;
9225        self.property_drifts = v.into_iter().map(|i| i.into()).collect();
9226        self
9227    }
9228}
9229
9230impl wkt::message::Message for ResourceDrift {
9231    fn typename() -> &'static str {
9232        "type.googleapis.com/google.cloud.config.v1.ResourceDrift"
9233    }
9234}
9235
9236/// A property drift represents a drift to a property in the state file.
9237#[derive(Clone, Default, PartialEq)]
9238#[non_exhaustive]
9239pub struct PropertyDrift {
9240    /// Output only. The path of the property drift.
9241    pub path: std::string::String,
9242
9243    /// Output only. The paths of sensitive fields in `before`. Paths are relative
9244    /// to `path`.
9245    pub before_sensitive_paths: std::vec::Vec<std::string::String>,
9246
9247    /// Output only. Representations of the object value before the actions.
9248    pub before: std::option::Option<wkt::Value>,
9249
9250    /// Output only. The paths of sensitive fields in `after`. Paths are relative
9251    /// to `path`.
9252    pub after_sensitive_paths: std::vec::Vec<std::string::String>,
9253
9254    /// Output only. Representations of the object value after the actions.
9255    pub after: std::option::Option<wkt::Value>,
9256
9257    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9258}
9259
9260impl PropertyDrift {
9261    pub fn new() -> Self {
9262        std::default::Default::default()
9263    }
9264
9265    /// Sets the value of [path][crate::model::PropertyDrift::path].
9266    ///
9267    /// # Example
9268    /// ```ignore,no_run
9269    /// # use google_cloud_config_v1::model::PropertyDrift;
9270    /// let x = PropertyDrift::new().set_path("example");
9271    /// ```
9272    pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9273        self.path = v.into();
9274        self
9275    }
9276
9277    /// Sets the value of [before_sensitive_paths][crate::model::PropertyDrift::before_sensitive_paths].
9278    ///
9279    /// # Example
9280    /// ```ignore,no_run
9281    /// # use google_cloud_config_v1::model::PropertyDrift;
9282    /// let x = PropertyDrift::new().set_before_sensitive_paths(["a", "b", "c"]);
9283    /// ```
9284    pub fn set_before_sensitive_paths<T, V>(mut self, v: T) -> Self
9285    where
9286        T: std::iter::IntoIterator<Item = V>,
9287        V: std::convert::Into<std::string::String>,
9288    {
9289        use std::iter::Iterator;
9290        self.before_sensitive_paths = v.into_iter().map(|i| i.into()).collect();
9291        self
9292    }
9293
9294    /// Sets the value of [before][crate::model::PropertyDrift::before].
9295    ///
9296    /// # Example
9297    /// ```ignore,no_run
9298    /// # use google_cloud_config_v1::model::PropertyDrift;
9299    /// use wkt::Value;
9300    /// let x = PropertyDrift::new().set_before(Value::default()/* use setters */);
9301    /// ```
9302    pub fn set_before<T>(mut self, v: T) -> Self
9303    where
9304        T: std::convert::Into<wkt::Value>,
9305    {
9306        self.before = std::option::Option::Some(v.into());
9307        self
9308    }
9309
9310    /// Sets or clears the value of [before][crate::model::PropertyDrift::before].
9311    ///
9312    /// # Example
9313    /// ```ignore,no_run
9314    /// # use google_cloud_config_v1::model::PropertyDrift;
9315    /// use wkt::Value;
9316    /// let x = PropertyDrift::new().set_or_clear_before(Some(Value::default()/* use setters */));
9317    /// let x = PropertyDrift::new().set_or_clear_before(None::<Value>);
9318    /// ```
9319    pub fn set_or_clear_before<T>(mut self, v: std::option::Option<T>) -> Self
9320    where
9321        T: std::convert::Into<wkt::Value>,
9322    {
9323        self.before = v.map(|x| x.into());
9324        self
9325    }
9326
9327    /// Sets the value of [after_sensitive_paths][crate::model::PropertyDrift::after_sensitive_paths].
9328    ///
9329    /// # Example
9330    /// ```ignore,no_run
9331    /// # use google_cloud_config_v1::model::PropertyDrift;
9332    /// let x = PropertyDrift::new().set_after_sensitive_paths(["a", "b", "c"]);
9333    /// ```
9334    pub fn set_after_sensitive_paths<T, V>(mut self, v: T) -> Self
9335    where
9336        T: std::iter::IntoIterator<Item = V>,
9337        V: std::convert::Into<std::string::String>,
9338    {
9339        use std::iter::Iterator;
9340        self.after_sensitive_paths = v.into_iter().map(|i| i.into()).collect();
9341        self
9342    }
9343
9344    /// Sets the value of [after][crate::model::PropertyDrift::after].
9345    ///
9346    /// # Example
9347    /// ```ignore,no_run
9348    /// # use google_cloud_config_v1::model::PropertyDrift;
9349    /// use wkt::Value;
9350    /// let x = PropertyDrift::new().set_after(Value::default()/* use setters */);
9351    /// ```
9352    pub fn set_after<T>(mut self, v: T) -> Self
9353    where
9354        T: std::convert::Into<wkt::Value>,
9355    {
9356        self.after = std::option::Option::Some(v.into());
9357        self
9358    }
9359
9360    /// Sets or clears the value of [after][crate::model::PropertyDrift::after].
9361    ///
9362    /// # Example
9363    /// ```ignore,no_run
9364    /// # use google_cloud_config_v1::model::PropertyDrift;
9365    /// use wkt::Value;
9366    /// let x = PropertyDrift::new().set_or_clear_after(Some(Value::default()/* use setters */));
9367    /// let x = PropertyDrift::new().set_or_clear_after(None::<Value>);
9368    /// ```
9369    pub fn set_or_clear_after<T>(mut self, v: std::option::Option<T>) -> Self
9370    where
9371        T: std::convert::Into<wkt::Value>,
9372    {
9373        self.after = v.map(|x| x.into());
9374        self
9375    }
9376}
9377
9378impl wkt::message::Message for PropertyDrift {
9379    fn typename() -> &'static str {
9380        "type.googleapis.com/google.cloud.config.v1.PropertyDrift"
9381    }
9382}
9383
9384/// The request message for the ListResourceDrifts method.
9385#[derive(Clone, Default, PartialEq)]
9386#[non_exhaustive]
9387pub struct ListResourceDriftsRequest {
9388    /// Required. The parent in whose context the ResourceDrifts are listed. The
9389    /// parent value is in the format:
9390    /// 'projects/{project_id}/locations/{location}/previews/{preview}'.
9391    pub parent: std::string::String,
9392
9393    /// Optional. When requesting a page of resource drifts, 'page_size' specifies
9394    /// number of resource drifts to return. If unspecified, at most 500 will be
9395    /// returned. The maximum value is 1000.
9396    pub page_size: i32,
9397
9398    /// Optional. Token returned by previous call to 'ListResourceDrifts' which
9399    /// specifies the position in the list from where to continue listing the
9400    /// resource drifts.
9401    pub page_token: std::string::String,
9402
9403    /// Optional. Lists the resource drifts that match the filter expression. A
9404    /// filter expression filters the resource drifts listed in the response. The
9405    /// expression must be of the form '{field} {operator} {value}' where
9406    /// operators: '<', '>',
9407    /// '<=',
9408    /// '>=',
9409    /// '!=', '=', ':' are supported (colon ':' represents a HAS operator which is
9410    /// roughly synonymous with equality). {field} can refer to a proto or JSON
9411    /// field, or a synthetic field. Field names can be camelCase or snake_case.
9412    ///
9413    /// Examples:
9414    ///
9415    /// - Filter by name:
9416    ///   name =
9417    ///   "projects/foo/locations/us-central1/previews/dep/resourceDrifts/baz
9418    pub filter: std::string::String,
9419
9420    /// Optional. Field to use to sort the list.
9421    pub order_by: std::string::String,
9422
9423    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9424}
9425
9426impl ListResourceDriftsRequest {
9427    pub fn new() -> Self {
9428        std::default::Default::default()
9429    }
9430
9431    /// Sets the value of [parent][crate::model::ListResourceDriftsRequest::parent].
9432    ///
9433    /// # Example
9434    /// ```ignore,no_run
9435    /// # use google_cloud_config_v1::model::ListResourceDriftsRequest;
9436    /// let x = ListResourceDriftsRequest::new().set_parent("example");
9437    /// ```
9438    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9439        self.parent = v.into();
9440        self
9441    }
9442
9443    /// Sets the value of [page_size][crate::model::ListResourceDriftsRequest::page_size].
9444    ///
9445    /// # Example
9446    /// ```ignore,no_run
9447    /// # use google_cloud_config_v1::model::ListResourceDriftsRequest;
9448    /// let x = ListResourceDriftsRequest::new().set_page_size(42);
9449    /// ```
9450    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9451        self.page_size = v.into();
9452        self
9453    }
9454
9455    /// Sets the value of [page_token][crate::model::ListResourceDriftsRequest::page_token].
9456    ///
9457    /// # Example
9458    /// ```ignore,no_run
9459    /// # use google_cloud_config_v1::model::ListResourceDriftsRequest;
9460    /// let x = ListResourceDriftsRequest::new().set_page_token("example");
9461    /// ```
9462    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9463        self.page_token = v.into();
9464        self
9465    }
9466
9467    /// Sets the value of [filter][crate::model::ListResourceDriftsRequest::filter].
9468    ///
9469    /// # Example
9470    /// ```ignore,no_run
9471    /// # use google_cloud_config_v1::model::ListResourceDriftsRequest;
9472    /// let x = ListResourceDriftsRequest::new().set_filter("example");
9473    /// ```
9474    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9475        self.filter = v.into();
9476        self
9477    }
9478
9479    /// Sets the value of [order_by][crate::model::ListResourceDriftsRequest::order_by].
9480    ///
9481    /// # Example
9482    /// ```ignore,no_run
9483    /// # use google_cloud_config_v1::model::ListResourceDriftsRequest;
9484    /// let x = ListResourceDriftsRequest::new().set_order_by("example");
9485    /// ```
9486    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9487        self.order_by = v.into();
9488        self
9489    }
9490}
9491
9492impl wkt::message::Message for ListResourceDriftsRequest {
9493    fn typename() -> &'static str {
9494        "type.googleapis.com/google.cloud.config.v1.ListResourceDriftsRequest"
9495    }
9496}
9497
9498/// A response to a 'ListResourceDrifts' call. Contains a list of ResourceDrifts.
9499#[derive(Clone, Default, PartialEq)]
9500#[non_exhaustive]
9501pub struct ListResourceDriftsResponse {
9502    /// List of ResourceDrifts.
9503    pub resource_drifts: std::vec::Vec<crate::model::ResourceDrift>,
9504
9505    /// A token to request the next page of resources from the
9506    /// 'ListResourceDrifts' method. The value of an empty string means that
9507    /// there are no more resources to return.
9508    pub next_page_token: std::string::String,
9509
9510    /// Unreachable resources, if any.
9511    pub unreachable: std::vec::Vec<std::string::String>,
9512
9513    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9514}
9515
9516impl ListResourceDriftsResponse {
9517    pub fn new() -> Self {
9518        std::default::Default::default()
9519    }
9520
9521    /// Sets the value of [resource_drifts][crate::model::ListResourceDriftsResponse::resource_drifts].
9522    ///
9523    /// # Example
9524    /// ```ignore,no_run
9525    /// # use google_cloud_config_v1::model::ListResourceDriftsResponse;
9526    /// use google_cloud_config_v1::model::ResourceDrift;
9527    /// let x = ListResourceDriftsResponse::new()
9528    ///     .set_resource_drifts([
9529    ///         ResourceDrift::default()/* use setters */,
9530    ///         ResourceDrift::default()/* use (different) setters */,
9531    ///     ]);
9532    /// ```
9533    pub fn set_resource_drifts<T, V>(mut self, v: T) -> Self
9534    where
9535        T: std::iter::IntoIterator<Item = V>,
9536        V: std::convert::Into<crate::model::ResourceDrift>,
9537    {
9538        use std::iter::Iterator;
9539        self.resource_drifts = v.into_iter().map(|i| i.into()).collect();
9540        self
9541    }
9542
9543    /// Sets the value of [next_page_token][crate::model::ListResourceDriftsResponse::next_page_token].
9544    ///
9545    /// # Example
9546    /// ```ignore,no_run
9547    /// # use google_cloud_config_v1::model::ListResourceDriftsResponse;
9548    /// let x = ListResourceDriftsResponse::new().set_next_page_token("example");
9549    /// ```
9550    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9551        self.next_page_token = v.into();
9552        self
9553    }
9554
9555    /// Sets the value of [unreachable][crate::model::ListResourceDriftsResponse::unreachable].
9556    ///
9557    /// # Example
9558    /// ```ignore,no_run
9559    /// # use google_cloud_config_v1::model::ListResourceDriftsResponse;
9560    /// let x = ListResourceDriftsResponse::new().set_unreachable(["a", "b", "c"]);
9561    /// ```
9562    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
9563    where
9564        T: std::iter::IntoIterator<Item = V>,
9565        V: std::convert::Into<std::string::String>,
9566    {
9567        use std::iter::Iterator;
9568        self.unreachable = v.into_iter().map(|i| i.into()).collect();
9569        self
9570    }
9571}
9572
9573impl wkt::message::Message for ListResourceDriftsResponse {
9574    fn typename() -> &'static str {
9575        "type.googleapis.com/google.cloud.config.v1.ListResourceDriftsResponse"
9576    }
9577}
9578
9579#[doc(hidden)]
9580impl google_cloud_gax::paginator::internal::PageableResponse for ListResourceDriftsResponse {
9581    type PageItem = crate::model::ResourceDrift;
9582
9583    fn items(self) -> std::vec::Vec<Self::PageItem> {
9584        self.resource_drifts
9585    }
9586
9587    fn next_page_token(&self) -> std::string::String {
9588        use std::clone::Clone;
9589        self.next_page_token.clone()
9590    }
9591}
9592
9593/// The request message for the GetResourceDrift method.
9594#[derive(Clone, Default, PartialEq)]
9595#[non_exhaustive]
9596pub struct GetResourceDriftRequest {
9597    /// Required. The name of the resource drift to retrieve.
9598    /// Format:
9599    /// 'projects/{project_id}/locations/{location}/previews/{preview}/resourceDrifts/{resource_drift}'.
9600    pub name: std::string::String,
9601
9602    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9603}
9604
9605impl GetResourceDriftRequest {
9606    pub fn new() -> Self {
9607        std::default::Default::default()
9608    }
9609
9610    /// Sets the value of [name][crate::model::GetResourceDriftRequest::name].
9611    ///
9612    /// # Example
9613    /// ```ignore,no_run
9614    /// # use google_cloud_config_v1::model::GetResourceDriftRequest;
9615    /// let x = GetResourceDriftRequest::new().set_name("example");
9616    /// ```
9617    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9618        self.name = v.into();
9619        self
9620    }
9621}
9622
9623impl wkt::message::Message for GetResourceDriftRequest {
9624    fn typename() -> &'static str {
9625        "type.googleapis.com/google.cloud.config.v1.GetResourceDriftRequest"
9626    }
9627}
9628
9629/// ProviderConfig contains the provider configurations.
9630#[derive(Clone, Default, PartialEq)]
9631#[non_exhaustive]
9632pub struct ProviderConfig {
9633    /// Optional. ProviderSource specifies the source type of the provider.
9634    pub source_type: std::option::Option<crate::model::provider_config::ProviderSource>,
9635
9636    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9637}
9638
9639impl ProviderConfig {
9640    pub fn new() -> Self {
9641        std::default::Default::default()
9642    }
9643
9644    /// Sets the value of [source_type][crate::model::ProviderConfig::source_type].
9645    ///
9646    /// # Example
9647    /// ```ignore,no_run
9648    /// # use google_cloud_config_v1::model::ProviderConfig;
9649    /// use google_cloud_config_v1::model::provider_config::ProviderSource;
9650    /// let x0 = ProviderConfig::new().set_source_type(ProviderSource::ServiceMaintained);
9651    /// ```
9652    pub fn set_source_type<T>(mut self, v: T) -> Self
9653    where
9654        T: std::convert::Into<crate::model::provider_config::ProviderSource>,
9655    {
9656        self.source_type = std::option::Option::Some(v.into());
9657        self
9658    }
9659
9660    /// Sets or clears the value of [source_type][crate::model::ProviderConfig::source_type].
9661    ///
9662    /// # Example
9663    /// ```ignore,no_run
9664    /// # use google_cloud_config_v1::model::ProviderConfig;
9665    /// use google_cloud_config_v1::model::provider_config::ProviderSource;
9666    /// let x0 = ProviderConfig::new().set_or_clear_source_type(Some(ProviderSource::ServiceMaintained));
9667    /// let x_none = ProviderConfig::new().set_or_clear_source_type(None::<ProviderSource>);
9668    /// ```
9669    pub fn set_or_clear_source_type<T>(mut self, v: std::option::Option<T>) -> Self
9670    where
9671        T: std::convert::Into<crate::model::provider_config::ProviderSource>,
9672    {
9673        self.source_type = v.map(|x| x.into());
9674        self
9675    }
9676}
9677
9678impl wkt::message::Message for ProviderConfig {
9679    fn typename() -> &'static str {
9680        "type.googleapis.com/google.cloud.config.v1.ProviderConfig"
9681    }
9682}
9683
9684/// Defines additional types related to [ProviderConfig].
9685pub mod provider_config {
9686    #[allow(unused_imports)]
9687    use super::*;
9688
9689    /// ProviderSource represents the source type of the provider.
9690    ///
9691    /// # Working with unknown values
9692    ///
9693    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9694    /// additional enum variants at any time. Adding new variants is not considered
9695    /// a breaking change. Applications should write their code in anticipation of:
9696    ///
9697    /// - New values appearing in future releases of the client library, **and**
9698    /// - New values received dynamically, without application changes.
9699    ///
9700    /// Please consult the [Working with enums] section in the user guide for some
9701    /// guidelines.
9702    ///
9703    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
9704    #[derive(Clone, Debug, PartialEq)]
9705    #[non_exhaustive]
9706    pub enum ProviderSource {
9707        /// Unspecified source type, default to public sources.
9708        Unspecified,
9709        /// Service maintained provider source type.
9710        ServiceMaintained,
9711        /// If set, the enum was initialized with an unknown value.
9712        ///
9713        /// Applications can examine the value using [ProviderSource::value] or
9714        /// [ProviderSource::name].
9715        UnknownValue(provider_source::UnknownValue),
9716    }
9717
9718    #[doc(hidden)]
9719    pub mod provider_source {
9720        #[allow(unused_imports)]
9721        use super::*;
9722        #[derive(Clone, Debug, PartialEq)]
9723        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9724    }
9725
9726    impl ProviderSource {
9727        /// Gets the enum value.
9728        ///
9729        /// Returns `None` if the enum contains an unknown value deserialized from
9730        /// the string representation of enums.
9731        pub fn value(&self) -> std::option::Option<i32> {
9732            match self {
9733                Self::Unspecified => std::option::Option::Some(0),
9734                Self::ServiceMaintained => std::option::Option::Some(1),
9735                Self::UnknownValue(u) => u.0.value(),
9736            }
9737        }
9738
9739        /// Gets the enum value as a string.
9740        ///
9741        /// Returns `None` if the enum contains an unknown value deserialized from
9742        /// the integer representation of enums.
9743        pub fn name(&self) -> std::option::Option<&str> {
9744            match self {
9745                Self::Unspecified => std::option::Option::Some("PROVIDER_SOURCE_UNSPECIFIED"),
9746                Self::ServiceMaintained => std::option::Option::Some("SERVICE_MAINTAINED"),
9747                Self::UnknownValue(u) => u.0.name(),
9748            }
9749        }
9750    }
9751
9752    impl std::default::Default for ProviderSource {
9753        fn default() -> Self {
9754            use std::convert::From;
9755            Self::from(0)
9756        }
9757    }
9758
9759    impl std::fmt::Display for ProviderSource {
9760        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9761            wkt::internal::display_enum(f, self.name(), self.value())
9762        }
9763    }
9764
9765    impl std::convert::From<i32> for ProviderSource {
9766        fn from(value: i32) -> Self {
9767            match value {
9768                0 => Self::Unspecified,
9769                1 => Self::ServiceMaintained,
9770                _ => Self::UnknownValue(provider_source::UnknownValue(
9771                    wkt::internal::UnknownEnumValue::Integer(value),
9772                )),
9773            }
9774        }
9775    }
9776
9777    impl std::convert::From<&str> for ProviderSource {
9778        fn from(value: &str) -> Self {
9779            use std::string::ToString;
9780            match value {
9781                "PROVIDER_SOURCE_UNSPECIFIED" => Self::Unspecified,
9782                "SERVICE_MAINTAINED" => Self::ServiceMaintained,
9783                _ => Self::UnknownValue(provider_source::UnknownValue(
9784                    wkt::internal::UnknownEnumValue::String(value.to_string()),
9785                )),
9786            }
9787        }
9788    }
9789
9790    impl serde::ser::Serialize for ProviderSource {
9791        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9792        where
9793            S: serde::Serializer,
9794        {
9795            match self {
9796                Self::Unspecified => serializer.serialize_i32(0),
9797                Self::ServiceMaintained => serializer.serialize_i32(1),
9798                Self::UnknownValue(u) => u.0.serialize(serializer),
9799            }
9800        }
9801    }
9802
9803    impl<'de> serde::de::Deserialize<'de> for ProviderSource {
9804        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9805        where
9806            D: serde::Deserializer<'de>,
9807        {
9808            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ProviderSource>::new(
9809                ".google.cloud.config.v1.ProviderConfig.ProviderSource",
9810            ))
9811        }
9812    }
9813}
9814
9815/// The request message for the GetAutoMigrationConfig method.
9816#[derive(Clone, Default, PartialEq)]
9817#[non_exhaustive]
9818pub struct GetAutoMigrationConfigRequest {
9819    /// Required. The name of the AutoMigrationConfig.
9820    /// Format:
9821    /// 'projects/{project_id}/locations/{location}/AutoMigrationConfig'.
9822    pub name: std::string::String,
9823
9824    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9825}
9826
9827impl GetAutoMigrationConfigRequest {
9828    pub fn new() -> Self {
9829        std::default::Default::default()
9830    }
9831
9832    /// Sets the value of [name][crate::model::GetAutoMigrationConfigRequest::name].
9833    ///
9834    /// # Example
9835    /// ```ignore,no_run
9836    /// # use google_cloud_config_v1::model::GetAutoMigrationConfigRequest;
9837    /// let x = GetAutoMigrationConfigRequest::new().set_name("example");
9838    /// ```
9839    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9840        self.name = v.into();
9841        self
9842    }
9843}
9844
9845impl wkt::message::Message for GetAutoMigrationConfigRequest {
9846    fn typename() -> &'static str {
9847        "type.googleapis.com/google.cloud.config.v1.GetAutoMigrationConfigRequest"
9848    }
9849}
9850
9851/// AutoMigrationConfig contains the automigration configuration for a project.
9852#[derive(Clone, Default, PartialEq)]
9853#[non_exhaustive]
9854pub struct AutoMigrationConfig {
9855    /// Identifier. The name of the AutoMigrationConfig.
9856    /// Format:
9857    /// 'projects/{project_id}/locations/{location}/AutoMigrationConfig'.
9858    pub name: std::string::String,
9859
9860    /// Output only. Time the AutoMigrationConfig was last updated.
9861    pub update_time: std::option::Option<wkt::Timestamp>,
9862
9863    /// Optional. Whether the auto migration is enabled for the project.
9864    pub auto_migration_enabled: bool,
9865
9866    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9867}
9868
9869impl AutoMigrationConfig {
9870    pub fn new() -> Self {
9871        std::default::Default::default()
9872    }
9873
9874    /// Sets the value of [name][crate::model::AutoMigrationConfig::name].
9875    ///
9876    /// # Example
9877    /// ```ignore,no_run
9878    /// # use google_cloud_config_v1::model::AutoMigrationConfig;
9879    /// let x = AutoMigrationConfig::new().set_name("example");
9880    /// ```
9881    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9882        self.name = v.into();
9883        self
9884    }
9885
9886    /// Sets the value of [update_time][crate::model::AutoMigrationConfig::update_time].
9887    ///
9888    /// # Example
9889    /// ```ignore,no_run
9890    /// # use google_cloud_config_v1::model::AutoMigrationConfig;
9891    /// use wkt::Timestamp;
9892    /// let x = AutoMigrationConfig::new().set_update_time(Timestamp::default()/* use setters */);
9893    /// ```
9894    pub fn set_update_time<T>(mut self, v: T) -> Self
9895    where
9896        T: std::convert::Into<wkt::Timestamp>,
9897    {
9898        self.update_time = std::option::Option::Some(v.into());
9899        self
9900    }
9901
9902    /// Sets or clears the value of [update_time][crate::model::AutoMigrationConfig::update_time].
9903    ///
9904    /// # Example
9905    /// ```ignore,no_run
9906    /// # use google_cloud_config_v1::model::AutoMigrationConfig;
9907    /// use wkt::Timestamp;
9908    /// let x = AutoMigrationConfig::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
9909    /// let x = AutoMigrationConfig::new().set_or_clear_update_time(None::<Timestamp>);
9910    /// ```
9911    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
9912    where
9913        T: std::convert::Into<wkt::Timestamp>,
9914    {
9915        self.update_time = v.map(|x| x.into());
9916        self
9917    }
9918
9919    /// Sets the value of [auto_migration_enabled][crate::model::AutoMigrationConfig::auto_migration_enabled].
9920    ///
9921    /// # Example
9922    /// ```ignore,no_run
9923    /// # use google_cloud_config_v1::model::AutoMigrationConfig;
9924    /// let x = AutoMigrationConfig::new().set_auto_migration_enabled(true);
9925    /// ```
9926    pub fn set_auto_migration_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9927        self.auto_migration_enabled = v.into();
9928        self
9929    }
9930}
9931
9932impl wkt::message::Message for AutoMigrationConfig {
9933    fn typename() -> &'static str {
9934        "type.googleapis.com/google.cloud.config.v1.AutoMigrationConfig"
9935    }
9936}
9937
9938/// The request message for the UpdateAutoMigrationConfig method.
9939#[derive(Clone, Default, PartialEq)]
9940#[non_exhaustive]
9941pub struct UpdateAutoMigrationConfigRequest {
9942    /// Optional. The update mask applies to the resource. See
9943    /// [google.protobuf.FieldMask][google.protobuf.FieldMask].
9944    ///
9945    /// [google.protobuf.FieldMask]: wkt::FieldMask
9946    pub update_mask: std::option::Option<wkt::FieldMask>,
9947
9948    /// Required. The AutoMigrationConfig to update.
9949    pub auto_migration_config: std::option::Option<crate::model::AutoMigrationConfig>,
9950
9951    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9952}
9953
9954impl UpdateAutoMigrationConfigRequest {
9955    pub fn new() -> Self {
9956        std::default::Default::default()
9957    }
9958
9959    /// Sets the value of [update_mask][crate::model::UpdateAutoMigrationConfigRequest::update_mask].
9960    ///
9961    /// # Example
9962    /// ```ignore,no_run
9963    /// # use google_cloud_config_v1::model::UpdateAutoMigrationConfigRequest;
9964    /// use wkt::FieldMask;
9965    /// let x = UpdateAutoMigrationConfigRequest::new().set_update_mask(FieldMask::default()/* use setters */);
9966    /// ```
9967    pub fn set_update_mask<T>(mut self, v: T) -> Self
9968    where
9969        T: std::convert::Into<wkt::FieldMask>,
9970    {
9971        self.update_mask = std::option::Option::Some(v.into());
9972        self
9973    }
9974
9975    /// Sets or clears the value of [update_mask][crate::model::UpdateAutoMigrationConfigRequest::update_mask].
9976    ///
9977    /// # Example
9978    /// ```ignore,no_run
9979    /// # use google_cloud_config_v1::model::UpdateAutoMigrationConfigRequest;
9980    /// use wkt::FieldMask;
9981    /// let x = UpdateAutoMigrationConfigRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
9982    /// let x = UpdateAutoMigrationConfigRequest::new().set_or_clear_update_mask(None::<FieldMask>);
9983    /// ```
9984    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
9985    where
9986        T: std::convert::Into<wkt::FieldMask>,
9987    {
9988        self.update_mask = v.map(|x| x.into());
9989        self
9990    }
9991
9992    /// Sets the value of [auto_migration_config][crate::model::UpdateAutoMigrationConfigRequest::auto_migration_config].
9993    ///
9994    /// # Example
9995    /// ```ignore,no_run
9996    /// # use google_cloud_config_v1::model::UpdateAutoMigrationConfigRequest;
9997    /// use google_cloud_config_v1::model::AutoMigrationConfig;
9998    /// let x = UpdateAutoMigrationConfigRequest::new().set_auto_migration_config(AutoMigrationConfig::default()/* use setters */);
9999    /// ```
10000    pub fn set_auto_migration_config<T>(mut self, v: T) -> Self
10001    where
10002        T: std::convert::Into<crate::model::AutoMigrationConfig>,
10003    {
10004        self.auto_migration_config = std::option::Option::Some(v.into());
10005        self
10006    }
10007
10008    /// Sets or clears the value of [auto_migration_config][crate::model::UpdateAutoMigrationConfigRequest::auto_migration_config].
10009    ///
10010    /// # Example
10011    /// ```ignore,no_run
10012    /// # use google_cloud_config_v1::model::UpdateAutoMigrationConfigRequest;
10013    /// use google_cloud_config_v1::model::AutoMigrationConfig;
10014    /// let x = UpdateAutoMigrationConfigRequest::new().set_or_clear_auto_migration_config(Some(AutoMigrationConfig::default()/* use setters */));
10015    /// let x = UpdateAutoMigrationConfigRequest::new().set_or_clear_auto_migration_config(None::<AutoMigrationConfig>);
10016    /// ```
10017    pub fn set_or_clear_auto_migration_config<T>(mut self, v: std::option::Option<T>) -> Self
10018    where
10019        T: std::convert::Into<crate::model::AutoMigrationConfig>,
10020    {
10021        self.auto_migration_config = v.map(|x| x.into());
10022        self
10023    }
10024}
10025
10026impl wkt::message::Message for UpdateAutoMigrationConfigRequest {
10027    fn typename() -> &'static str {
10028        "type.googleapis.com/google.cloud.config.v1.UpdateAutoMigrationConfigRequest"
10029    }
10030}
10031
10032/// Enum values to control quota checks for resources in terraform
10033/// configuration files.
10034///
10035/// # Working with unknown values
10036///
10037/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10038/// additional enum variants at any time. Adding new variants is not considered
10039/// a breaking change. Applications should write their code in anticipation of:
10040///
10041/// - New values appearing in future releases of the client library, **and**
10042/// - New values received dynamically, without application changes.
10043///
10044/// Please consult the [Working with enums] section in the user guide for some
10045/// guidelines.
10046///
10047/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
10048#[derive(Clone, Debug, PartialEq)]
10049#[non_exhaustive]
10050pub enum QuotaValidation {
10051    /// The default value.
10052    /// QuotaValidation on terraform configuration files will be disabled in
10053    /// this case.
10054    Unspecified,
10055    /// Enable computing quotas for resources in terraform configuration files to
10056    /// get visibility on resources with insufficient quotas.
10057    Enabled,
10058    /// Enforce quota checks so deployment fails if there isn't sufficient quotas
10059    /// available to deploy resources in terraform configuration files.
10060    Enforced,
10061    /// If set, the enum was initialized with an unknown value.
10062    ///
10063    /// Applications can examine the value using [QuotaValidation::value] or
10064    /// [QuotaValidation::name].
10065    UnknownValue(quota_validation::UnknownValue),
10066}
10067
10068#[doc(hidden)]
10069pub mod quota_validation {
10070    #[allow(unused_imports)]
10071    use super::*;
10072    #[derive(Clone, Debug, PartialEq)]
10073    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10074}
10075
10076impl QuotaValidation {
10077    /// Gets the enum value.
10078    ///
10079    /// Returns `None` if the enum contains an unknown value deserialized from
10080    /// the string representation of enums.
10081    pub fn value(&self) -> std::option::Option<i32> {
10082        match self {
10083            Self::Unspecified => std::option::Option::Some(0),
10084            Self::Enabled => std::option::Option::Some(1),
10085            Self::Enforced => std::option::Option::Some(2),
10086            Self::UnknownValue(u) => u.0.value(),
10087        }
10088    }
10089
10090    /// Gets the enum value as a string.
10091    ///
10092    /// Returns `None` if the enum contains an unknown value deserialized from
10093    /// the integer representation of enums.
10094    pub fn name(&self) -> std::option::Option<&str> {
10095        match self {
10096            Self::Unspecified => std::option::Option::Some("QUOTA_VALIDATION_UNSPECIFIED"),
10097            Self::Enabled => std::option::Option::Some("ENABLED"),
10098            Self::Enforced => std::option::Option::Some("ENFORCED"),
10099            Self::UnknownValue(u) => u.0.name(),
10100        }
10101    }
10102}
10103
10104impl std::default::Default for QuotaValidation {
10105    fn default() -> Self {
10106        use std::convert::From;
10107        Self::from(0)
10108    }
10109}
10110
10111impl std::fmt::Display for QuotaValidation {
10112    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10113        wkt::internal::display_enum(f, self.name(), self.value())
10114    }
10115}
10116
10117impl std::convert::From<i32> for QuotaValidation {
10118    fn from(value: i32) -> Self {
10119        match value {
10120            0 => Self::Unspecified,
10121            1 => Self::Enabled,
10122            2 => Self::Enforced,
10123            _ => Self::UnknownValue(quota_validation::UnknownValue(
10124                wkt::internal::UnknownEnumValue::Integer(value),
10125            )),
10126        }
10127    }
10128}
10129
10130impl std::convert::From<&str> for QuotaValidation {
10131    fn from(value: &str) -> Self {
10132        use std::string::ToString;
10133        match value {
10134            "QUOTA_VALIDATION_UNSPECIFIED" => Self::Unspecified,
10135            "ENABLED" => Self::Enabled,
10136            "ENFORCED" => Self::Enforced,
10137            _ => Self::UnknownValue(quota_validation::UnknownValue(
10138                wkt::internal::UnknownEnumValue::String(value.to_string()),
10139            )),
10140        }
10141    }
10142}
10143
10144impl serde::ser::Serialize for QuotaValidation {
10145    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10146    where
10147        S: serde::Serializer,
10148    {
10149        match self {
10150            Self::Unspecified => serializer.serialize_i32(0),
10151            Self::Enabled => serializer.serialize_i32(1),
10152            Self::Enforced => serializer.serialize_i32(2),
10153            Self::UnknownValue(u) => u.0.serialize(serializer),
10154        }
10155    }
10156}
10157
10158impl<'de> serde::de::Deserialize<'de> for QuotaValidation {
10159    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10160    where
10161        D: serde::Deserializer<'de>,
10162    {
10163        deserializer.deserialize_any(wkt::internal::EnumVisitor::<QuotaValidation>::new(
10164            ".google.cloud.config.v1.QuotaValidation",
10165        ))
10166    }
10167}