Skip to main content

google_cloud_config_v1/
model.rs

1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17#![allow(rustdoc::redundant_explicit_links)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![no_implicit_prelude]
20extern crate async_trait;
21extern crate bytes;
22extern crate gaxi;
23extern crate google_cloud_gax;
24extern crate google_cloud_iam_v1;
25extern crate google_cloud_location;
26extern crate google_cloud_longrunning;
27extern crate google_cloud_lro;
28extern crate google_cloud_rpc;
29extern crate serde;
30extern crate serde_json;
31extern crate serde_with;
32extern crate std;
33extern crate tracing;
34extern crate wkt;
35
36mod debug;
37mod deserialize;
38mod serialize;
39
40/// A Deployment is a group of resources and configs managed and provisioned by
41/// Infra Manager.
42#[derive(Clone, Default, PartialEq)]
43#[non_exhaustive]
44pub struct Deployment {
45    /// Identifier. Resource name of the deployment.
46    /// Format: `projects/{project}/locations/{location}/deployments/{deployment}`
47    pub name: std::string::String,
48
49    /// Output only. Time when the deployment was created.
50    pub create_time: std::option::Option<wkt::Timestamp>,
51
52    /// Output only. Time when the deployment was last modified.
53    pub update_time: std::option::Option<wkt::Timestamp>,
54
55    /// Optional. User-defined metadata for the deployment.
56    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
57
58    /// Output only. Current state of the deployment.
59    pub state: crate::model::deployment::State,
60
61    /// Output only. Revision name that was most recently applied.
62    /// Format: `projects/{project}/locations/{location}/deployments/{deployment}/
63    /// revisions/{revision}`
64    pub latest_revision: std::string::String,
65
66    /// Output only. Additional information regarding the current state.
67    pub state_detail: std::string::String,
68
69    /// Output only. Error code describing errors that may have occurred.
70    pub error_code: crate::model::deployment::ErrorCode,
71
72    /// Output only. Location of artifacts from a DeleteDeployment operation.
73    pub delete_results: std::option::Option<crate::model::ApplyResults>,
74
75    /// Output only. Cloud Build instance UUID associated with deleting this
76    /// deployment.
77    pub delete_build: std::string::String,
78
79    /// Output only. Location of Cloud Build logs in Google Cloud Storage,
80    /// populated when deleting this deployment. Format: `gs://{bucket}/{object}`.
81    pub delete_logs: std::string::String,
82
83    /// Output only. Errors encountered when deleting this deployment.
84    /// Errors are truncated to 10 entries, see `delete_results` and `error_logs`
85    /// for full details.
86    pub tf_errors: std::vec::Vec<crate::model::TerraformError>,
87
88    /// Output only. Location of Terraform error logs in Google Cloud Storage.
89    /// Format: `gs://{bucket}/{object}`.
90    pub error_logs: std::string::String,
91
92    /// Optional. User-defined location of Cloud Build logs and artifacts in Google
93    /// Cloud Storage. Format: `gs://{bucket}/{folder}`
94    ///
95    /// A default bucket will be bootstrapped if the field is not set or empty.
96    /// Default bucket format: `gs://<project number>-<region>-blueprint-config`
97    /// Constraints:
98    ///
99    /// - The bucket needs to be in the same project as the deployment
100    /// - The path cannot be within the path of `gcs_source`
101    /// - The field cannot be updated, including changing its presence
102    pub artifacts_gcs_bucket: std::option::Option<std::string::String>,
103
104    /// Required. User-specified Service Account (SA) credentials to be used when
105    /// actuating resources.
106    /// Format: `projects/{projectID}/serviceAccounts/{serviceAccount}`
107    pub service_account: std::option::Option<std::string::String>,
108
109    /// By default, Infra Manager will return a failure when
110    /// Terraform encounters a 409 code (resource conflict error) during actuation.
111    /// If this flag is set to true, Infra Manager will instead
112    /// attempt to automatically import the resource into the Terraform state (for
113    /// supported resource types) and continue actuation.
114    ///
115    /// Not all resource types are supported, refer to documentation.
116    pub import_existing_resources: std::option::Option<bool>,
117
118    /// Optional. The user-specified Cloud Build worker pool resource in which the
119    /// Cloud Build job will execute. Format:
120    /// `projects/{project}/locations/{location}/workerPools/{workerPoolId}`.
121    /// If this field is unspecified, the default Cloud Build worker pool will be
122    /// used.
123    pub worker_pool: std::option::Option<std::string::String>,
124
125    /// Output only. Current lock state of the deployment.
126    pub lock_state: crate::model::deployment::LockState,
127
128    /// Optional. The user-specified Terraform version constraint.
129    /// Example: "=1.3.10".
130    pub tf_version_constraint: std::option::Option<std::string::String>,
131
132    /// Output only. The current Terraform version set on the deployment.
133    /// It is in the format of "Major.Minor.Patch", for example, "1.3.10".
134    pub tf_version: std::string::String,
135
136    /// Optional. Input to control quota checks for resources in terraform
137    /// configuration files. There are limited resources on which quota validation
138    /// applies.
139    pub quota_validation: crate::model::QuotaValidation,
140
141    /// Optional. Arbitrary key-value metadata storage e.g. to help client tools
142    /// identify deployments during automation. See
143    /// <https://google.aip.dev/148#annotations> for details on format and size
144    /// limitations.
145    pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
146
147    /// Optional. This field specifies the provider configurations.
148    pub provider_config: std::option::Option<crate::model::ProviderConfig>,
149
150    /// Blueprint to deploy.
151    pub blueprint: std::option::Option<crate::model::deployment::Blueprint>,
152
153    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
154}
155
156impl Deployment {
157    pub fn new() -> Self {
158        std::default::Default::default()
159    }
160
161    /// Sets the value of [name][crate::model::Deployment::name].
162    ///
163    /// # Example
164    /// ```ignore,no_run
165    /// # use google_cloud_config_v1::model::Deployment;
166    /// let x = Deployment::new().set_name("example");
167    /// ```
168    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
169        self.name = v.into();
170        self
171    }
172
173    /// Sets the value of [create_time][crate::model::Deployment::create_time].
174    ///
175    /// # Example
176    /// ```ignore,no_run
177    /// # use google_cloud_config_v1::model::Deployment;
178    /// use wkt::Timestamp;
179    /// let x = Deployment::new().set_create_time(Timestamp::default()/* use setters */);
180    /// ```
181    pub fn set_create_time<T>(mut self, v: T) -> Self
182    where
183        T: std::convert::Into<wkt::Timestamp>,
184    {
185        self.create_time = std::option::Option::Some(v.into());
186        self
187    }
188
189    /// Sets or clears the value of [create_time][crate::model::Deployment::create_time].
190    ///
191    /// # Example
192    /// ```ignore,no_run
193    /// # use google_cloud_config_v1::model::Deployment;
194    /// use wkt::Timestamp;
195    /// let x = Deployment::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
196    /// let x = Deployment::new().set_or_clear_create_time(None::<Timestamp>);
197    /// ```
198    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
199    where
200        T: std::convert::Into<wkt::Timestamp>,
201    {
202        self.create_time = v.map(|x| x.into());
203        self
204    }
205
206    /// Sets the value of [update_time][crate::model::Deployment::update_time].
207    ///
208    /// # Example
209    /// ```ignore,no_run
210    /// # use google_cloud_config_v1::model::Deployment;
211    /// use wkt::Timestamp;
212    /// let x = Deployment::new().set_update_time(Timestamp::default()/* use setters */);
213    /// ```
214    pub fn set_update_time<T>(mut self, v: T) -> Self
215    where
216        T: std::convert::Into<wkt::Timestamp>,
217    {
218        self.update_time = std::option::Option::Some(v.into());
219        self
220    }
221
222    /// Sets or clears the value of [update_time][crate::model::Deployment::update_time].
223    ///
224    /// # Example
225    /// ```ignore,no_run
226    /// # use google_cloud_config_v1::model::Deployment;
227    /// use wkt::Timestamp;
228    /// let x = Deployment::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
229    /// let x = Deployment::new().set_or_clear_update_time(None::<Timestamp>);
230    /// ```
231    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
232    where
233        T: std::convert::Into<wkt::Timestamp>,
234    {
235        self.update_time = v.map(|x| x.into());
236        self
237    }
238
239    /// Sets the value of [labels][crate::model::Deployment::labels].
240    ///
241    /// # Example
242    /// ```ignore,no_run
243    /// # use google_cloud_config_v1::model::Deployment;
244    /// let x = Deployment::new().set_labels([
245    ///     ("key0", "abc"),
246    ///     ("key1", "xyz"),
247    /// ]);
248    /// ```
249    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
250    where
251        T: std::iter::IntoIterator<Item = (K, V)>,
252        K: std::convert::Into<std::string::String>,
253        V: std::convert::Into<std::string::String>,
254    {
255        use std::iter::Iterator;
256        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
257        self
258    }
259
260    /// Sets the value of [state][crate::model::Deployment::state].
261    ///
262    /// # Example
263    /// ```ignore,no_run
264    /// # use google_cloud_config_v1::model::Deployment;
265    /// use google_cloud_config_v1::model::deployment::State;
266    /// let x0 = Deployment::new().set_state(State::Creating);
267    /// let x1 = Deployment::new().set_state(State::Active);
268    /// let x2 = Deployment::new().set_state(State::Updating);
269    /// ```
270    pub fn set_state<T: std::convert::Into<crate::model::deployment::State>>(
271        mut self,
272        v: T,
273    ) -> Self {
274        self.state = v.into();
275        self
276    }
277
278    /// Sets the value of [latest_revision][crate::model::Deployment::latest_revision].
279    ///
280    /// # Example
281    /// ```ignore,no_run
282    /// # use google_cloud_config_v1::model::Deployment;
283    /// let x = Deployment::new().set_latest_revision("example");
284    /// ```
285    pub fn set_latest_revision<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
286        self.latest_revision = v.into();
287        self
288    }
289
290    /// Sets the value of [state_detail][crate::model::Deployment::state_detail].
291    ///
292    /// # Example
293    /// ```ignore,no_run
294    /// # use google_cloud_config_v1::model::Deployment;
295    /// let x = Deployment::new().set_state_detail("example");
296    /// ```
297    pub fn set_state_detail<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
298        self.state_detail = v.into();
299        self
300    }
301
302    /// Sets the value of [error_code][crate::model::Deployment::error_code].
303    ///
304    /// # Example
305    /// ```ignore,no_run
306    /// # use google_cloud_config_v1::model::Deployment;
307    /// use google_cloud_config_v1::model::deployment::ErrorCode;
308    /// let x0 = Deployment::new().set_error_code(ErrorCode::RevisionFailed);
309    /// let x1 = Deployment::new().set_error_code(ErrorCode::CloudBuildPermissionDenied);
310    /// let x2 = Deployment::new().set_error_code(ErrorCode::DeleteBuildApiFailed);
311    /// ```
312    pub fn set_error_code<T: std::convert::Into<crate::model::deployment::ErrorCode>>(
313        mut self,
314        v: T,
315    ) -> Self {
316        self.error_code = v.into();
317        self
318    }
319
320    /// Sets the value of [delete_results][crate::model::Deployment::delete_results].
321    ///
322    /// # Example
323    /// ```ignore,no_run
324    /// # use google_cloud_config_v1::model::Deployment;
325    /// use google_cloud_config_v1::model::ApplyResults;
326    /// let x = Deployment::new().set_delete_results(ApplyResults::default()/* use setters */);
327    /// ```
328    pub fn set_delete_results<T>(mut self, v: T) -> Self
329    where
330        T: std::convert::Into<crate::model::ApplyResults>,
331    {
332        self.delete_results = std::option::Option::Some(v.into());
333        self
334    }
335
336    /// Sets or clears the value of [delete_results][crate::model::Deployment::delete_results].
337    ///
338    /// # Example
339    /// ```ignore,no_run
340    /// # use google_cloud_config_v1::model::Deployment;
341    /// use google_cloud_config_v1::model::ApplyResults;
342    /// let x = Deployment::new().set_or_clear_delete_results(Some(ApplyResults::default()/* use setters */));
343    /// let x = Deployment::new().set_or_clear_delete_results(None::<ApplyResults>);
344    /// ```
345    pub fn set_or_clear_delete_results<T>(mut self, v: std::option::Option<T>) -> Self
346    where
347        T: std::convert::Into<crate::model::ApplyResults>,
348    {
349        self.delete_results = v.map(|x| x.into());
350        self
351    }
352
353    /// Sets the value of [delete_build][crate::model::Deployment::delete_build].
354    ///
355    /// # Example
356    /// ```ignore,no_run
357    /// # use google_cloud_config_v1::model::Deployment;
358    /// let x = Deployment::new().set_delete_build("example");
359    /// ```
360    pub fn set_delete_build<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
361        self.delete_build = v.into();
362        self
363    }
364
365    /// Sets the value of [delete_logs][crate::model::Deployment::delete_logs].
366    ///
367    /// # Example
368    /// ```ignore,no_run
369    /// # use google_cloud_config_v1::model::Deployment;
370    /// let x = Deployment::new().set_delete_logs("example");
371    /// ```
372    pub fn set_delete_logs<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
373        self.delete_logs = v.into();
374        self
375    }
376
377    /// Sets the value of [tf_errors][crate::model::Deployment::tf_errors].
378    ///
379    /// # Example
380    /// ```ignore,no_run
381    /// # use google_cloud_config_v1::model::Deployment;
382    /// use google_cloud_config_v1::model::TerraformError;
383    /// let x = Deployment::new()
384    ///     .set_tf_errors([
385    ///         TerraformError::default()/* use setters */,
386    ///         TerraformError::default()/* use (different) setters */,
387    ///     ]);
388    /// ```
389    pub fn set_tf_errors<T, V>(mut self, v: T) -> Self
390    where
391        T: std::iter::IntoIterator<Item = V>,
392        V: std::convert::Into<crate::model::TerraformError>,
393    {
394        use std::iter::Iterator;
395        self.tf_errors = v.into_iter().map(|i| i.into()).collect();
396        self
397    }
398
399    /// Sets the value of [error_logs][crate::model::Deployment::error_logs].
400    ///
401    /// # Example
402    /// ```ignore,no_run
403    /// # use google_cloud_config_v1::model::Deployment;
404    /// let x = Deployment::new().set_error_logs("example");
405    /// ```
406    pub fn set_error_logs<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
407        self.error_logs = v.into();
408        self
409    }
410
411    /// Sets the value of [artifacts_gcs_bucket][crate::model::Deployment::artifacts_gcs_bucket].
412    ///
413    /// # Example
414    /// ```ignore,no_run
415    /// # use google_cloud_config_v1::model::Deployment;
416    /// let x = Deployment::new().set_artifacts_gcs_bucket("example");
417    /// ```
418    pub fn set_artifacts_gcs_bucket<T>(mut self, v: T) -> Self
419    where
420        T: std::convert::Into<std::string::String>,
421    {
422        self.artifacts_gcs_bucket = std::option::Option::Some(v.into());
423        self
424    }
425
426    /// Sets or clears the value of [artifacts_gcs_bucket][crate::model::Deployment::artifacts_gcs_bucket].
427    ///
428    /// # Example
429    /// ```ignore,no_run
430    /// # use google_cloud_config_v1::model::Deployment;
431    /// let x = Deployment::new().set_or_clear_artifacts_gcs_bucket(Some("example"));
432    /// let x = Deployment::new().set_or_clear_artifacts_gcs_bucket(None::<String>);
433    /// ```
434    pub fn set_or_clear_artifacts_gcs_bucket<T>(mut self, v: std::option::Option<T>) -> Self
435    where
436        T: std::convert::Into<std::string::String>,
437    {
438        self.artifacts_gcs_bucket = v.map(|x| x.into());
439        self
440    }
441
442    /// Sets the value of [service_account][crate::model::Deployment::service_account].
443    ///
444    /// # Example
445    /// ```ignore,no_run
446    /// # use google_cloud_config_v1::model::Deployment;
447    /// let x = Deployment::new().set_service_account("example");
448    /// ```
449    pub fn set_service_account<T>(mut self, v: T) -> Self
450    where
451        T: std::convert::Into<std::string::String>,
452    {
453        self.service_account = std::option::Option::Some(v.into());
454        self
455    }
456
457    /// Sets or clears the value of [service_account][crate::model::Deployment::service_account].
458    ///
459    /// # Example
460    /// ```ignore,no_run
461    /// # use google_cloud_config_v1::model::Deployment;
462    /// let x = Deployment::new().set_or_clear_service_account(Some("example"));
463    /// let x = Deployment::new().set_or_clear_service_account(None::<String>);
464    /// ```
465    pub fn set_or_clear_service_account<T>(mut self, v: std::option::Option<T>) -> Self
466    where
467        T: std::convert::Into<std::string::String>,
468    {
469        self.service_account = v.map(|x| x.into());
470        self
471    }
472
473    /// Sets the value of [import_existing_resources][crate::model::Deployment::import_existing_resources].
474    ///
475    /// # Example
476    /// ```ignore,no_run
477    /// # use google_cloud_config_v1::model::Deployment;
478    /// let x = Deployment::new().set_import_existing_resources(true);
479    /// ```
480    pub fn set_import_existing_resources<T>(mut self, v: T) -> Self
481    where
482        T: std::convert::Into<bool>,
483    {
484        self.import_existing_resources = std::option::Option::Some(v.into());
485        self
486    }
487
488    /// Sets or clears the value of [import_existing_resources][crate::model::Deployment::import_existing_resources].
489    ///
490    /// # Example
491    /// ```ignore,no_run
492    /// # use google_cloud_config_v1::model::Deployment;
493    /// let x = Deployment::new().set_or_clear_import_existing_resources(Some(false));
494    /// let x = Deployment::new().set_or_clear_import_existing_resources(None::<bool>);
495    /// ```
496    pub fn set_or_clear_import_existing_resources<T>(mut self, v: std::option::Option<T>) -> Self
497    where
498        T: std::convert::Into<bool>,
499    {
500        self.import_existing_resources = v.map(|x| x.into());
501        self
502    }
503
504    /// Sets the value of [worker_pool][crate::model::Deployment::worker_pool].
505    ///
506    /// # Example
507    /// ```ignore,no_run
508    /// # use google_cloud_config_v1::model::Deployment;
509    /// let x = Deployment::new().set_worker_pool("example");
510    /// ```
511    pub fn set_worker_pool<T>(mut self, v: T) -> Self
512    where
513        T: std::convert::Into<std::string::String>,
514    {
515        self.worker_pool = std::option::Option::Some(v.into());
516        self
517    }
518
519    /// Sets or clears the value of [worker_pool][crate::model::Deployment::worker_pool].
520    ///
521    /// # Example
522    /// ```ignore,no_run
523    /// # use google_cloud_config_v1::model::Deployment;
524    /// let x = Deployment::new().set_or_clear_worker_pool(Some("example"));
525    /// let x = Deployment::new().set_or_clear_worker_pool(None::<String>);
526    /// ```
527    pub fn set_or_clear_worker_pool<T>(mut self, v: std::option::Option<T>) -> Self
528    where
529        T: std::convert::Into<std::string::String>,
530    {
531        self.worker_pool = v.map(|x| x.into());
532        self
533    }
534
535    /// Sets the value of [lock_state][crate::model::Deployment::lock_state].
536    ///
537    /// # Example
538    /// ```ignore,no_run
539    /// # use google_cloud_config_v1::model::Deployment;
540    /// use google_cloud_config_v1::model::deployment::LockState;
541    /// let x0 = Deployment::new().set_lock_state(LockState::Locked);
542    /// let x1 = Deployment::new().set_lock_state(LockState::Unlocked);
543    /// let x2 = Deployment::new().set_lock_state(LockState::Locking);
544    /// ```
545    pub fn set_lock_state<T: std::convert::Into<crate::model::deployment::LockState>>(
546        mut self,
547        v: T,
548    ) -> Self {
549        self.lock_state = v.into();
550        self
551    }
552
553    /// Sets the value of [tf_version_constraint][crate::model::Deployment::tf_version_constraint].
554    ///
555    /// # Example
556    /// ```ignore,no_run
557    /// # use google_cloud_config_v1::model::Deployment;
558    /// let x = Deployment::new().set_tf_version_constraint("example");
559    /// ```
560    pub fn set_tf_version_constraint<T>(mut self, v: T) -> Self
561    where
562        T: std::convert::Into<std::string::String>,
563    {
564        self.tf_version_constraint = std::option::Option::Some(v.into());
565        self
566    }
567
568    /// Sets or clears the value of [tf_version_constraint][crate::model::Deployment::tf_version_constraint].
569    ///
570    /// # Example
571    /// ```ignore,no_run
572    /// # use google_cloud_config_v1::model::Deployment;
573    /// let x = Deployment::new().set_or_clear_tf_version_constraint(Some("example"));
574    /// let x = Deployment::new().set_or_clear_tf_version_constraint(None::<String>);
575    /// ```
576    pub fn set_or_clear_tf_version_constraint<T>(mut self, v: std::option::Option<T>) -> Self
577    where
578        T: std::convert::Into<std::string::String>,
579    {
580        self.tf_version_constraint = v.map(|x| x.into());
581        self
582    }
583
584    /// Sets the value of [tf_version][crate::model::Deployment::tf_version].
585    ///
586    /// # Example
587    /// ```ignore,no_run
588    /// # use google_cloud_config_v1::model::Deployment;
589    /// let x = Deployment::new().set_tf_version("example");
590    /// ```
591    pub fn set_tf_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
592        self.tf_version = v.into();
593        self
594    }
595
596    /// Sets the value of [quota_validation][crate::model::Deployment::quota_validation].
597    ///
598    /// # Example
599    /// ```ignore,no_run
600    /// # use google_cloud_config_v1::model::Deployment;
601    /// use google_cloud_config_v1::model::QuotaValidation;
602    /// let x0 = Deployment::new().set_quota_validation(QuotaValidation::Enabled);
603    /// let x1 = Deployment::new().set_quota_validation(QuotaValidation::Enforced);
604    /// ```
605    pub fn set_quota_validation<T: std::convert::Into<crate::model::QuotaValidation>>(
606        mut self,
607        v: T,
608    ) -> Self {
609        self.quota_validation = v.into();
610        self
611    }
612
613    /// Sets the value of [annotations][crate::model::Deployment::annotations].
614    ///
615    /// # Example
616    /// ```ignore,no_run
617    /// # use google_cloud_config_v1::model::Deployment;
618    /// let x = Deployment::new().set_annotations([
619    ///     ("key0", "abc"),
620    ///     ("key1", "xyz"),
621    /// ]);
622    /// ```
623    pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
624    where
625        T: std::iter::IntoIterator<Item = (K, V)>,
626        K: std::convert::Into<std::string::String>,
627        V: std::convert::Into<std::string::String>,
628    {
629        use std::iter::Iterator;
630        self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
631        self
632    }
633
634    /// Sets the value of [provider_config][crate::model::Deployment::provider_config].
635    ///
636    /// # Example
637    /// ```ignore,no_run
638    /// # use google_cloud_config_v1::model::Deployment;
639    /// use google_cloud_config_v1::model::ProviderConfig;
640    /// let x = Deployment::new().set_provider_config(ProviderConfig::default()/* use setters */);
641    /// ```
642    pub fn set_provider_config<T>(mut self, v: T) -> Self
643    where
644        T: std::convert::Into<crate::model::ProviderConfig>,
645    {
646        self.provider_config = std::option::Option::Some(v.into());
647        self
648    }
649
650    /// Sets or clears the value of [provider_config][crate::model::Deployment::provider_config].
651    ///
652    /// # Example
653    /// ```ignore,no_run
654    /// # use google_cloud_config_v1::model::Deployment;
655    /// use google_cloud_config_v1::model::ProviderConfig;
656    /// let x = Deployment::new().set_or_clear_provider_config(Some(ProviderConfig::default()/* use setters */));
657    /// let x = Deployment::new().set_or_clear_provider_config(None::<ProviderConfig>);
658    /// ```
659    pub fn set_or_clear_provider_config<T>(mut self, v: std::option::Option<T>) -> Self
660    where
661        T: std::convert::Into<crate::model::ProviderConfig>,
662    {
663        self.provider_config = v.map(|x| x.into());
664        self
665    }
666
667    /// Sets the value of [blueprint][crate::model::Deployment::blueprint].
668    ///
669    /// Note that all the setters affecting `blueprint` are mutually
670    /// exclusive.
671    ///
672    /// # Example
673    /// ```ignore,no_run
674    /// # use google_cloud_config_v1::model::Deployment;
675    /// use google_cloud_config_v1::model::TerraformBlueprint;
676    /// let x = Deployment::new().set_blueprint(Some(
677    ///     google_cloud_config_v1::model::deployment::Blueprint::TerraformBlueprint(TerraformBlueprint::default().into())));
678    /// ```
679    pub fn set_blueprint<
680        T: std::convert::Into<std::option::Option<crate::model::deployment::Blueprint>>,
681    >(
682        mut self,
683        v: T,
684    ) -> Self {
685        self.blueprint = v.into();
686        self
687    }
688
689    /// The value of [blueprint][crate::model::Deployment::blueprint]
690    /// if it holds a `TerraformBlueprint`, `None` if the field is not set or
691    /// holds a different branch.
692    pub fn terraform_blueprint(
693        &self,
694    ) -> std::option::Option<&std::boxed::Box<crate::model::TerraformBlueprint>> {
695        #[allow(unreachable_patterns)]
696        self.blueprint.as_ref().and_then(|v| match v {
697            crate::model::deployment::Blueprint::TerraformBlueprint(v) => {
698                std::option::Option::Some(v)
699            }
700            _ => std::option::Option::None,
701        })
702    }
703
704    /// Sets the value of [blueprint][crate::model::Deployment::blueprint]
705    /// to hold a `TerraformBlueprint`.
706    ///
707    /// Note that all the setters affecting `blueprint` are
708    /// mutually exclusive.
709    ///
710    /// # Example
711    /// ```ignore,no_run
712    /// # use google_cloud_config_v1::model::Deployment;
713    /// use google_cloud_config_v1::model::TerraformBlueprint;
714    /// let x = Deployment::new().set_terraform_blueprint(TerraformBlueprint::default()/* use setters */);
715    /// assert!(x.terraform_blueprint().is_some());
716    /// ```
717    pub fn set_terraform_blueprint<
718        T: std::convert::Into<std::boxed::Box<crate::model::TerraformBlueprint>>,
719    >(
720        mut self,
721        v: T,
722    ) -> Self {
723        self.blueprint = std::option::Option::Some(
724            crate::model::deployment::Blueprint::TerraformBlueprint(v.into()),
725        );
726        self
727    }
728}
729
730impl wkt::message::Message for Deployment {
731    fn typename() -> &'static str {
732        "type.googleapis.com/google.cloud.config.v1.Deployment"
733    }
734}
735
736/// Defines additional types related to [Deployment].
737pub mod deployment {
738    #[allow(unused_imports)]
739    use super::*;
740
741    /// Possible states of a deployment.
742    ///
743    /// # Working with unknown values
744    ///
745    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
746    /// additional enum variants at any time. Adding new variants is not considered
747    /// a breaking change. Applications should write their code in anticipation of:
748    ///
749    /// - New values appearing in future releases of the client library, **and**
750    /// - New values received dynamically, without application changes.
751    ///
752    /// Please consult the [Working with enums] section in the user guide for some
753    /// guidelines.
754    ///
755    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
756    #[derive(Clone, Debug, PartialEq)]
757    #[non_exhaustive]
758    pub enum State {
759        /// The default value. This value is used if the state is omitted.
760        Unspecified,
761        /// The deployment is being created.
762        Creating,
763        /// The deployment is healthy.
764        Active,
765        /// The deployment is being updated.
766        Updating,
767        /// The deployment is being deleted.
768        Deleting,
769        /// The deployment has encountered an unexpected error.
770        Failed,
771        /// The deployment is no longer being actively reconciled.
772        /// This may be the result of recovering the project after deletion.
773        Suspended,
774        /// The deployment has been deleted.
775        Deleted,
776        /// If set, the enum was initialized with an unknown value.
777        ///
778        /// Applications can examine the value using [State::value] or
779        /// [State::name].
780        UnknownValue(state::UnknownValue),
781    }
782
783    #[doc(hidden)]
784    pub mod state {
785        #[allow(unused_imports)]
786        use super::*;
787        #[derive(Clone, Debug, PartialEq)]
788        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
789    }
790
791    impl State {
792        /// Gets the enum value.
793        ///
794        /// Returns `None` if the enum contains an unknown value deserialized from
795        /// the string representation of enums.
796        pub fn value(&self) -> std::option::Option<i32> {
797            match self {
798                Self::Unspecified => std::option::Option::Some(0),
799                Self::Creating => std::option::Option::Some(1),
800                Self::Active => std::option::Option::Some(2),
801                Self::Updating => std::option::Option::Some(3),
802                Self::Deleting => std::option::Option::Some(4),
803                Self::Failed => std::option::Option::Some(5),
804                Self::Suspended => std::option::Option::Some(6),
805                Self::Deleted => std::option::Option::Some(7),
806                Self::UnknownValue(u) => u.0.value(),
807            }
808        }
809
810        /// Gets the enum value as a string.
811        ///
812        /// Returns `None` if the enum contains an unknown value deserialized from
813        /// the integer representation of enums.
814        pub fn name(&self) -> std::option::Option<&str> {
815            match self {
816                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
817                Self::Creating => std::option::Option::Some("CREATING"),
818                Self::Active => std::option::Option::Some("ACTIVE"),
819                Self::Updating => std::option::Option::Some("UPDATING"),
820                Self::Deleting => std::option::Option::Some("DELETING"),
821                Self::Failed => std::option::Option::Some("FAILED"),
822                Self::Suspended => std::option::Option::Some("SUSPENDED"),
823                Self::Deleted => std::option::Option::Some("DELETED"),
824                Self::UnknownValue(u) => u.0.name(),
825            }
826        }
827    }
828
829    impl std::default::Default for State {
830        fn default() -> Self {
831            use std::convert::From;
832            Self::from(0)
833        }
834    }
835
836    impl std::fmt::Display for State {
837        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
838            wkt::internal::display_enum(f, self.name(), self.value())
839        }
840    }
841
842    impl std::convert::From<i32> for State {
843        fn from(value: i32) -> Self {
844            match value {
845                0 => Self::Unspecified,
846                1 => Self::Creating,
847                2 => Self::Active,
848                3 => Self::Updating,
849                4 => Self::Deleting,
850                5 => Self::Failed,
851                6 => Self::Suspended,
852                7 => Self::Deleted,
853                _ => Self::UnknownValue(state::UnknownValue(
854                    wkt::internal::UnknownEnumValue::Integer(value),
855                )),
856            }
857        }
858    }
859
860    impl std::convert::From<&str> for State {
861        fn from(value: &str) -> Self {
862            use std::string::ToString;
863            match value {
864                "STATE_UNSPECIFIED" => Self::Unspecified,
865                "CREATING" => Self::Creating,
866                "ACTIVE" => Self::Active,
867                "UPDATING" => Self::Updating,
868                "DELETING" => Self::Deleting,
869                "FAILED" => Self::Failed,
870                "SUSPENDED" => Self::Suspended,
871                "DELETED" => Self::Deleted,
872                _ => Self::UnknownValue(state::UnknownValue(
873                    wkt::internal::UnknownEnumValue::String(value.to_string()),
874                )),
875            }
876        }
877    }
878
879    impl serde::ser::Serialize for State {
880        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
881        where
882            S: serde::Serializer,
883        {
884            match self {
885                Self::Unspecified => serializer.serialize_i32(0),
886                Self::Creating => serializer.serialize_i32(1),
887                Self::Active => serializer.serialize_i32(2),
888                Self::Updating => serializer.serialize_i32(3),
889                Self::Deleting => serializer.serialize_i32(4),
890                Self::Failed => serializer.serialize_i32(5),
891                Self::Suspended => serializer.serialize_i32(6),
892                Self::Deleted => serializer.serialize_i32(7),
893                Self::UnknownValue(u) => u.0.serialize(serializer),
894            }
895        }
896    }
897
898    impl<'de> serde::de::Deserialize<'de> for State {
899        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
900        where
901            D: serde::Deserializer<'de>,
902        {
903            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
904                ".google.cloud.config.v1.Deployment.State",
905            ))
906        }
907    }
908
909    /// Possible errors that can occur with deployments.
910    ///
911    /// # Working with unknown values
912    ///
913    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
914    /// additional enum variants at any time. Adding new variants is not considered
915    /// a breaking change. Applications should write their code in anticipation of:
916    ///
917    /// - New values appearing in future releases of the client library, **and**
918    /// - New values received dynamically, without application changes.
919    ///
920    /// Please consult the [Working with enums] section in the user guide for some
921    /// guidelines.
922    ///
923    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
924    #[derive(Clone, Debug, PartialEq)]
925    #[non_exhaustive]
926    pub enum ErrorCode {
927        /// No error code was specified.
928        Unspecified,
929        /// The revision failed. See Revision for more details.
930        RevisionFailed,
931        /// Cloud Build failed due to a permission issue.
932        CloudBuildPermissionDenied,
933        /// Cloud Build job associated with a deployment deletion could not be
934        /// started.
935        DeleteBuildApiFailed,
936        /// Cloud Build job associated with a deployment deletion was started but
937        /// failed.
938        DeleteBuildRunFailed,
939        /// Cloud Storage bucket creation failed due to a permission issue.
940        BucketCreationPermissionDenied,
941        /// Cloud Storage bucket creation failed due to an issue unrelated to
942        /// permissions.
943        BucketCreationFailed,
944        /// Failed to import values from an external source.
945        ExternalValueSourceImportFailed,
946        /// If set, the enum was initialized with an unknown value.
947        ///
948        /// Applications can examine the value using [ErrorCode::value] or
949        /// [ErrorCode::name].
950        UnknownValue(error_code::UnknownValue),
951    }
952
953    #[doc(hidden)]
954    pub mod error_code {
955        #[allow(unused_imports)]
956        use super::*;
957        #[derive(Clone, Debug, PartialEq)]
958        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
959    }
960
961    impl ErrorCode {
962        /// Gets the enum value.
963        ///
964        /// Returns `None` if the enum contains an unknown value deserialized from
965        /// the string representation of enums.
966        pub fn value(&self) -> std::option::Option<i32> {
967            match self {
968                Self::Unspecified => std::option::Option::Some(0),
969                Self::RevisionFailed => std::option::Option::Some(1),
970                Self::CloudBuildPermissionDenied => std::option::Option::Some(3),
971                Self::DeleteBuildApiFailed => std::option::Option::Some(5),
972                Self::DeleteBuildRunFailed => std::option::Option::Some(6),
973                Self::BucketCreationPermissionDenied => std::option::Option::Some(7),
974                Self::BucketCreationFailed => std::option::Option::Some(8),
975                Self::ExternalValueSourceImportFailed => std::option::Option::Some(10),
976                Self::UnknownValue(u) => u.0.value(),
977            }
978        }
979
980        /// Gets the enum value as a string.
981        ///
982        /// Returns `None` if the enum contains an unknown value deserialized from
983        /// the integer representation of enums.
984        pub fn name(&self) -> std::option::Option<&str> {
985            match self {
986                Self::Unspecified => std::option::Option::Some("ERROR_CODE_UNSPECIFIED"),
987                Self::RevisionFailed => std::option::Option::Some("REVISION_FAILED"),
988                Self::CloudBuildPermissionDenied => {
989                    std::option::Option::Some("CLOUD_BUILD_PERMISSION_DENIED")
990                }
991                Self::DeleteBuildApiFailed => std::option::Option::Some("DELETE_BUILD_API_FAILED"),
992                Self::DeleteBuildRunFailed => std::option::Option::Some("DELETE_BUILD_RUN_FAILED"),
993                Self::BucketCreationPermissionDenied => {
994                    std::option::Option::Some("BUCKET_CREATION_PERMISSION_DENIED")
995                }
996                Self::BucketCreationFailed => std::option::Option::Some("BUCKET_CREATION_FAILED"),
997                Self::ExternalValueSourceImportFailed => {
998                    std::option::Option::Some("EXTERNAL_VALUE_SOURCE_IMPORT_FAILED")
999                }
1000                Self::UnknownValue(u) => u.0.name(),
1001            }
1002        }
1003    }
1004
1005    impl std::default::Default for ErrorCode {
1006        fn default() -> Self {
1007            use std::convert::From;
1008            Self::from(0)
1009        }
1010    }
1011
1012    impl std::fmt::Display for ErrorCode {
1013        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1014            wkt::internal::display_enum(f, self.name(), self.value())
1015        }
1016    }
1017
1018    impl std::convert::From<i32> for ErrorCode {
1019        fn from(value: i32) -> Self {
1020            match value {
1021                0 => Self::Unspecified,
1022                1 => Self::RevisionFailed,
1023                3 => Self::CloudBuildPermissionDenied,
1024                5 => Self::DeleteBuildApiFailed,
1025                6 => Self::DeleteBuildRunFailed,
1026                7 => Self::BucketCreationPermissionDenied,
1027                8 => Self::BucketCreationFailed,
1028                10 => Self::ExternalValueSourceImportFailed,
1029                _ => Self::UnknownValue(error_code::UnknownValue(
1030                    wkt::internal::UnknownEnumValue::Integer(value),
1031                )),
1032            }
1033        }
1034    }
1035
1036    impl std::convert::From<&str> for ErrorCode {
1037        fn from(value: &str) -> Self {
1038            use std::string::ToString;
1039            match value {
1040                "ERROR_CODE_UNSPECIFIED" => Self::Unspecified,
1041                "REVISION_FAILED" => Self::RevisionFailed,
1042                "CLOUD_BUILD_PERMISSION_DENIED" => Self::CloudBuildPermissionDenied,
1043                "DELETE_BUILD_API_FAILED" => Self::DeleteBuildApiFailed,
1044                "DELETE_BUILD_RUN_FAILED" => Self::DeleteBuildRunFailed,
1045                "BUCKET_CREATION_PERMISSION_DENIED" => Self::BucketCreationPermissionDenied,
1046                "BUCKET_CREATION_FAILED" => Self::BucketCreationFailed,
1047                "EXTERNAL_VALUE_SOURCE_IMPORT_FAILED" => Self::ExternalValueSourceImportFailed,
1048                _ => Self::UnknownValue(error_code::UnknownValue(
1049                    wkt::internal::UnknownEnumValue::String(value.to_string()),
1050                )),
1051            }
1052        }
1053    }
1054
1055    impl serde::ser::Serialize for ErrorCode {
1056        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1057        where
1058            S: serde::Serializer,
1059        {
1060            match self {
1061                Self::Unspecified => serializer.serialize_i32(0),
1062                Self::RevisionFailed => serializer.serialize_i32(1),
1063                Self::CloudBuildPermissionDenied => serializer.serialize_i32(3),
1064                Self::DeleteBuildApiFailed => serializer.serialize_i32(5),
1065                Self::DeleteBuildRunFailed => serializer.serialize_i32(6),
1066                Self::BucketCreationPermissionDenied => serializer.serialize_i32(7),
1067                Self::BucketCreationFailed => serializer.serialize_i32(8),
1068                Self::ExternalValueSourceImportFailed => serializer.serialize_i32(10),
1069                Self::UnknownValue(u) => u.0.serialize(serializer),
1070            }
1071        }
1072    }
1073
1074    impl<'de> serde::de::Deserialize<'de> for ErrorCode {
1075        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1076        where
1077            D: serde::Deserializer<'de>,
1078        {
1079            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ErrorCode>::new(
1080                ".google.cloud.config.v1.Deployment.ErrorCode",
1081            ))
1082        }
1083    }
1084
1085    /// Possible lock states of a deployment.
1086    ///
1087    /// # Working with unknown values
1088    ///
1089    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1090    /// additional enum variants at any time. Adding new variants is not considered
1091    /// a breaking change. Applications should write their code in anticipation of:
1092    ///
1093    /// - New values appearing in future releases of the client library, **and**
1094    /// - New values received dynamically, without application changes.
1095    ///
1096    /// Please consult the [Working with enums] section in the user guide for some
1097    /// guidelines.
1098    ///
1099    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
1100    #[derive(Clone, Debug, PartialEq)]
1101    #[non_exhaustive]
1102    pub enum LockState {
1103        /// The default value. This value is used if the lock state is omitted.
1104        Unspecified,
1105        /// The deployment is locked.
1106        Locked,
1107        /// The deployment is unlocked.
1108        Unlocked,
1109        /// The deployment is being locked.
1110        Locking,
1111        /// The deployment is being unlocked.
1112        Unlocking,
1113        /// The deployment has failed to lock.
1114        LockFailed,
1115        /// The deployment has failed to unlock.
1116        UnlockFailed,
1117        /// If set, the enum was initialized with an unknown value.
1118        ///
1119        /// Applications can examine the value using [LockState::value] or
1120        /// [LockState::name].
1121        UnknownValue(lock_state::UnknownValue),
1122    }
1123
1124    #[doc(hidden)]
1125    pub mod lock_state {
1126        #[allow(unused_imports)]
1127        use super::*;
1128        #[derive(Clone, Debug, PartialEq)]
1129        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1130    }
1131
1132    impl LockState {
1133        /// Gets the enum value.
1134        ///
1135        /// Returns `None` if the enum contains an unknown value deserialized from
1136        /// the string representation of enums.
1137        pub fn value(&self) -> std::option::Option<i32> {
1138            match self {
1139                Self::Unspecified => std::option::Option::Some(0),
1140                Self::Locked => std::option::Option::Some(1),
1141                Self::Unlocked => std::option::Option::Some(2),
1142                Self::Locking => std::option::Option::Some(3),
1143                Self::Unlocking => std::option::Option::Some(4),
1144                Self::LockFailed => std::option::Option::Some(5),
1145                Self::UnlockFailed => std::option::Option::Some(6),
1146                Self::UnknownValue(u) => u.0.value(),
1147            }
1148        }
1149
1150        /// Gets the enum value as a string.
1151        ///
1152        /// Returns `None` if the enum contains an unknown value deserialized from
1153        /// the integer representation of enums.
1154        pub fn name(&self) -> std::option::Option<&str> {
1155            match self {
1156                Self::Unspecified => std::option::Option::Some("LOCK_STATE_UNSPECIFIED"),
1157                Self::Locked => std::option::Option::Some("LOCKED"),
1158                Self::Unlocked => std::option::Option::Some("UNLOCKED"),
1159                Self::Locking => std::option::Option::Some("LOCKING"),
1160                Self::Unlocking => std::option::Option::Some("UNLOCKING"),
1161                Self::LockFailed => std::option::Option::Some("LOCK_FAILED"),
1162                Self::UnlockFailed => std::option::Option::Some("UNLOCK_FAILED"),
1163                Self::UnknownValue(u) => u.0.name(),
1164            }
1165        }
1166    }
1167
1168    impl std::default::Default for LockState {
1169        fn default() -> Self {
1170            use std::convert::From;
1171            Self::from(0)
1172        }
1173    }
1174
1175    impl std::fmt::Display for LockState {
1176        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1177            wkt::internal::display_enum(f, self.name(), self.value())
1178        }
1179    }
1180
1181    impl std::convert::From<i32> for LockState {
1182        fn from(value: i32) -> Self {
1183            match value {
1184                0 => Self::Unspecified,
1185                1 => Self::Locked,
1186                2 => Self::Unlocked,
1187                3 => Self::Locking,
1188                4 => Self::Unlocking,
1189                5 => Self::LockFailed,
1190                6 => Self::UnlockFailed,
1191                _ => Self::UnknownValue(lock_state::UnknownValue(
1192                    wkt::internal::UnknownEnumValue::Integer(value),
1193                )),
1194            }
1195        }
1196    }
1197
1198    impl std::convert::From<&str> for LockState {
1199        fn from(value: &str) -> Self {
1200            use std::string::ToString;
1201            match value {
1202                "LOCK_STATE_UNSPECIFIED" => Self::Unspecified,
1203                "LOCKED" => Self::Locked,
1204                "UNLOCKED" => Self::Unlocked,
1205                "LOCKING" => Self::Locking,
1206                "UNLOCKING" => Self::Unlocking,
1207                "LOCK_FAILED" => Self::LockFailed,
1208                "UNLOCK_FAILED" => Self::UnlockFailed,
1209                _ => Self::UnknownValue(lock_state::UnknownValue(
1210                    wkt::internal::UnknownEnumValue::String(value.to_string()),
1211                )),
1212            }
1213        }
1214    }
1215
1216    impl serde::ser::Serialize for LockState {
1217        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1218        where
1219            S: serde::Serializer,
1220        {
1221            match self {
1222                Self::Unspecified => serializer.serialize_i32(0),
1223                Self::Locked => serializer.serialize_i32(1),
1224                Self::Unlocked => serializer.serialize_i32(2),
1225                Self::Locking => serializer.serialize_i32(3),
1226                Self::Unlocking => serializer.serialize_i32(4),
1227                Self::LockFailed => serializer.serialize_i32(5),
1228                Self::UnlockFailed => serializer.serialize_i32(6),
1229                Self::UnknownValue(u) => u.0.serialize(serializer),
1230            }
1231        }
1232    }
1233
1234    impl<'de> serde::de::Deserialize<'de> for LockState {
1235        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1236        where
1237            D: serde::Deserializer<'de>,
1238        {
1239            deserializer.deserialize_any(wkt::internal::EnumVisitor::<LockState>::new(
1240                ".google.cloud.config.v1.Deployment.LockState",
1241            ))
1242        }
1243    }
1244
1245    /// Blueprint to deploy.
1246    #[derive(Clone, Debug, PartialEq)]
1247    #[non_exhaustive]
1248    pub enum Blueprint {
1249        /// A blueprint described using Terraform's HashiCorp Configuration Language
1250        /// as a root module.
1251        TerraformBlueprint(std::boxed::Box<crate::model::TerraformBlueprint>),
1252    }
1253}
1254
1255/// TerraformBlueprint describes the source of a Terraform root module which
1256/// describes the resources and configs to be deployed.
1257#[derive(Clone, Default, PartialEq)]
1258#[non_exhaustive]
1259pub struct TerraformBlueprint {
1260    /// Optional. Input variable values for the Terraform blueprint.
1261    pub input_values:
1262        std::collections::HashMap<std::string::String, crate::model::TerraformVariable>,
1263
1264    /// Optional. Map of input variable names in this blueprint to configurations
1265    /// for importing values from external sources.
1266    pub external_values:
1267        std::collections::HashMap<std::string::String, crate::model::ExternalValueSource>,
1268
1269    /// Location of the source configs.
1270    /// Required.
1271    pub source: std::option::Option<crate::model::terraform_blueprint::Source>,
1272
1273    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1274}
1275
1276impl TerraformBlueprint {
1277    pub fn new() -> Self {
1278        std::default::Default::default()
1279    }
1280
1281    /// Sets the value of [input_values][crate::model::TerraformBlueprint::input_values].
1282    ///
1283    /// # Example
1284    /// ```ignore,no_run
1285    /// # use google_cloud_config_v1::model::TerraformBlueprint;
1286    /// use google_cloud_config_v1::model::TerraformVariable;
1287    /// let x = TerraformBlueprint::new().set_input_values([
1288    ///     ("key0", TerraformVariable::default()/* use setters */),
1289    ///     ("key1", TerraformVariable::default()/* use (different) setters */),
1290    /// ]);
1291    /// ```
1292    pub fn set_input_values<T, K, V>(mut self, v: T) -> Self
1293    where
1294        T: std::iter::IntoIterator<Item = (K, V)>,
1295        K: std::convert::Into<std::string::String>,
1296        V: std::convert::Into<crate::model::TerraformVariable>,
1297    {
1298        use std::iter::Iterator;
1299        self.input_values = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1300        self
1301    }
1302
1303    /// Sets the value of [external_values][crate::model::TerraformBlueprint::external_values].
1304    ///
1305    /// # Example
1306    /// ```ignore,no_run
1307    /// # use google_cloud_config_v1::model::TerraformBlueprint;
1308    /// use google_cloud_config_v1::model::ExternalValueSource;
1309    /// let x = TerraformBlueprint::new().set_external_values([
1310    ///     ("key0", ExternalValueSource::default()/* use setters */),
1311    ///     ("key1", ExternalValueSource::default()/* use (different) setters */),
1312    /// ]);
1313    /// ```
1314    pub fn set_external_values<T, K, V>(mut self, v: T) -> Self
1315    where
1316        T: std::iter::IntoIterator<Item = (K, V)>,
1317        K: std::convert::Into<std::string::String>,
1318        V: std::convert::Into<crate::model::ExternalValueSource>,
1319    {
1320        use std::iter::Iterator;
1321        self.external_values = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1322        self
1323    }
1324
1325    /// Sets the value of [source][crate::model::TerraformBlueprint::source].
1326    ///
1327    /// Note that all the setters affecting `source` are mutually
1328    /// exclusive.
1329    ///
1330    /// # Example
1331    /// ```ignore,no_run
1332    /// # use google_cloud_config_v1::model::TerraformBlueprint;
1333    /// use google_cloud_config_v1::model::terraform_blueprint::Source;
1334    /// let x = TerraformBlueprint::new().set_source(Some(Source::GcsSource("example".to_string())));
1335    /// ```
1336    pub fn set_source<
1337        T: std::convert::Into<std::option::Option<crate::model::terraform_blueprint::Source>>,
1338    >(
1339        mut self,
1340        v: T,
1341    ) -> Self {
1342        self.source = v.into();
1343        self
1344    }
1345
1346    /// The value of [source][crate::model::TerraformBlueprint::source]
1347    /// if it holds a `GcsSource`, `None` if the field is not set or
1348    /// holds a different branch.
1349    pub fn gcs_source(&self) -> std::option::Option<&std::string::String> {
1350        #[allow(unreachable_patterns)]
1351        self.source.as_ref().and_then(|v| match v {
1352            crate::model::terraform_blueprint::Source::GcsSource(v) => std::option::Option::Some(v),
1353            _ => std::option::Option::None,
1354        })
1355    }
1356
1357    /// Sets the value of [source][crate::model::TerraformBlueprint::source]
1358    /// to hold a `GcsSource`.
1359    ///
1360    /// Note that all the setters affecting `source` are
1361    /// mutually exclusive.
1362    ///
1363    /// # Example
1364    /// ```ignore,no_run
1365    /// # use google_cloud_config_v1::model::TerraformBlueprint;
1366    /// let x = TerraformBlueprint::new().set_gcs_source("example");
1367    /// assert!(x.gcs_source().is_some());
1368    /// assert!(x.git_source().is_none());
1369    /// ```
1370    pub fn set_gcs_source<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1371        self.source = std::option::Option::Some(
1372            crate::model::terraform_blueprint::Source::GcsSource(v.into()),
1373        );
1374        self
1375    }
1376
1377    /// The value of [source][crate::model::TerraformBlueprint::source]
1378    /// if it holds a `GitSource`, `None` if the field is not set or
1379    /// holds a different branch.
1380    pub fn git_source(&self) -> std::option::Option<&std::boxed::Box<crate::model::GitSource>> {
1381        #[allow(unreachable_patterns)]
1382        self.source.as_ref().and_then(|v| match v {
1383            crate::model::terraform_blueprint::Source::GitSource(v) => std::option::Option::Some(v),
1384            _ => std::option::Option::None,
1385        })
1386    }
1387
1388    /// Sets the value of [source][crate::model::TerraformBlueprint::source]
1389    /// to hold a `GitSource`.
1390    ///
1391    /// Note that all the setters affecting `source` are
1392    /// mutually exclusive.
1393    ///
1394    /// # Example
1395    /// ```ignore,no_run
1396    /// # use google_cloud_config_v1::model::TerraformBlueprint;
1397    /// use google_cloud_config_v1::model::GitSource;
1398    /// let x = TerraformBlueprint::new().set_git_source(GitSource::default()/* use setters */);
1399    /// assert!(x.git_source().is_some());
1400    /// assert!(x.gcs_source().is_none());
1401    /// ```
1402    pub fn set_git_source<T: std::convert::Into<std::boxed::Box<crate::model::GitSource>>>(
1403        mut self,
1404        v: T,
1405    ) -> Self {
1406        self.source = std::option::Option::Some(
1407            crate::model::terraform_blueprint::Source::GitSource(v.into()),
1408        );
1409        self
1410    }
1411}
1412
1413impl wkt::message::Message for TerraformBlueprint {
1414    fn typename() -> &'static str {
1415        "type.googleapis.com/google.cloud.config.v1.TerraformBlueprint"
1416    }
1417}
1418
1419/// Defines additional types related to [TerraformBlueprint].
1420pub mod terraform_blueprint {
1421    #[allow(unused_imports)]
1422    use super::*;
1423
1424    /// Location of the source configs.
1425    /// Required.
1426    #[derive(Clone, Debug, PartialEq)]
1427    #[non_exhaustive]
1428    pub enum Source {
1429        /// URI of an object in Google Cloud Storage.
1430        /// Format: `gs://{bucket}/{object}`
1431        ///
1432        /// URI may also specify an object version for zipped objects.
1433        /// Format: `gs://{bucket}/{object}#{version}`
1434        GcsSource(std::string::String),
1435        /// URI of a public Git repo.
1436        GitSource(std::boxed::Box<crate::model::GitSource>),
1437    }
1438}
1439
1440/// A Terraform input variable.
1441#[derive(Clone, Default, PartialEq)]
1442#[non_exhaustive]
1443pub struct TerraformVariable {
1444    /// Optional. Input variable value.
1445    pub input_value: std::option::Option<wkt::Value>,
1446
1447    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1448}
1449
1450impl TerraformVariable {
1451    pub fn new() -> Self {
1452        std::default::Default::default()
1453    }
1454
1455    /// Sets the value of [input_value][crate::model::TerraformVariable::input_value].
1456    ///
1457    /// # Example
1458    /// ```ignore,no_run
1459    /// # use google_cloud_config_v1::model::TerraformVariable;
1460    /// use wkt::Value;
1461    /// let x = TerraformVariable::new().set_input_value(Value::default()/* use setters */);
1462    /// ```
1463    pub fn set_input_value<T>(mut self, v: T) -> Self
1464    where
1465        T: std::convert::Into<wkt::Value>,
1466    {
1467        self.input_value = std::option::Option::Some(v.into());
1468        self
1469    }
1470
1471    /// Sets or clears the value of [input_value][crate::model::TerraformVariable::input_value].
1472    ///
1473    /// # Example
1474    /// ```ignore,no_run
1475    /// # use google_cloud_config_v1::model::TerraformVariable;
1476    /// use wkt::Value;
1477    /// let x = TerraformVariable::new().set_or_clear_input_value(Some(Value::default()/* use setters */));
1478    /// let x = TerraformVariable::new().set_or_clear_input_value(None::<Value>);
1479    /// ```
1480    pub fn set_or_clear_input_value<T>(mut self, v: std::option::Option<T>) -> Self
1481    where
1482        T: std::convert::Into<wkt::Value>,
1483    {
1484        self.input_value = v.map(|x| x.into());
1485        self
1486    }
1487}
1488
1489impl wkt::message::Message for TerraformVariable {
1490    fn typename() -> &'static str {
1491        "type.googleapis.com/google.cloud.config.v1.TerraformVariable"
1492    }
1493}
1494
1495/// Configuration for a source of an external value.
1496#[derive(Clone, Default, PartialEq)]
1497#[non_exhaustive]
1498pub struct ExternalValueSource {
1499    /// The source of the external value.
1500    pub source: std::option::Option<crate::model::external_value_source::Source>,
1501
1502    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1503}
1504
1505impl ExternalValueSource {
1506    pub fn new() -> Self {
1507        std::default::Default::default()
1508    }
1509
1510    /// Sets the value of [source][crate::model::ExternalValueSource::source].
1511    ///
1512    /// Note that all the setters affecting `source` are mutually
1513    /// exclusive.
1514    ///
1515    /// # Example
1516    /// ```ignore,no_run
1517    /// # use google_cloud_config_v1::model::ExternalValueSource;
1518    /// use google_cloud_config_v1::model::DeploymentSource;
1519    /// let x = ExternalValueSource::new().set_source(Some(
1520    ///     google_cloud_config_v1::model::external_value_source::Source::DeploymentSource(DeploymentSource::default().into())));
1521    /// ```
1522    pub fn set_source<
1523        T: std::convert::Into<std::option::Option<crate::model::external_value_source::Source>>,
1524    >(
1525        mut self,
1526        v: T,
1527    ) -> Self {
1528        self.source = v.into();
1529        self
1530    }
1531
1532    /// The value of [source][crate::model::ExternalValueSource::source]
1533    /// if it holds a `DeploymentSource`, `None` if the field is not set or
1534    /// holds a different branch.
1535    pub fn deployment_source(
1536        &self,
1537    ) -> std::option::Option<&std::boxed::Box<crate::model::DeploymentSource>> {
1538        #[allow(unreachable_patterns)]
1539        self.source.as_ref().and_then(|v| match v {
1540            crate::model::external_value_source::Source::DeploymentSource(v) => {
1541                std::option::Option::Some(v)
1542            }
1543            _ => std::option::Option::None,
1544        })
1545    }
1546
1547    /// Sets the value of [source][crate::model::ExternalValueSource::source]
1548    /// to hold a `DeploymentSource`.
1549    ///
1550    /// Note that all the setters affecting `source` are
1551    /// mutually exclusive.
1552    ///
1553    /// # Example
1554    /// ```ignore,no_run
1555    /// # use google_cloud_config_v1::model::ExternalValueSource;
1556    /// use google_cloud_config_v1::model::DeploymentSource;
1557    /// let x = ExternalValueSource::new().set_deployment_source(DeploymentSource::default()/* use setters */);
1558    /// assert!(x.deployment_source().is_some());
1559    /// ```
1560    pub fn set_deployment_source<
1561        T: std::convert::Into<std::boxed::Box<crate::model::DeploymentSource>>,
1562    >(
1563        mut self,
1564        v: T,
1565    ) -> Self {
1566        self.source = std::option::Option::Some(
1567            crate::model::external_value_source::Source::DeploymentSource(v.into()),
1568        );
1569        self
1570    }
1571}
1572
1573impl wkt::message::Message for ExternalValueSource {
1574    fn typename() -> &'static str {
1575        "type.googleapis.com/google.cloud.config.v1.ExternalValueSource"
1576    }
1577}
1578
1579/// Defines additional types related to [ExternalValueSource].
1580pub mod external_value_source {
1581    #[allow(unused_imports)]
1582    use super::*;
1583
1584    /// The source of the external value.
1585    #[derive(Clone, Debug, PartialEq)]
1586    #[non_exhaustive]
1587    pub enum Source {
1588        /// A source from a Deployment.
1589        DeploymentSource(std::boxed::Box<crate::model::DeploymentSource>),
1590    }
1591}
1592
1593/// Configuration for a value sourced from a Deployment.
1594#[derive(Clone, Default, PartialEq)]
1595#[non_exhaustive]
1596pub struct DeploymentSource {
1597    /// Required. The resource name of the source Deployment to import the output
1598    /// from. Format:
1599    /// projects/{project}/locations/{location}/deployments/{deployment} The source
1600    /// deployment must be in the same project and location.
1601    pub deployment: std::string::String,
1602
1603    /// Required. The name of the output variable in the source deployment's latest
1604    /// successfully applied revision.
1605    pub output_name: std::string::String,
1606
1607    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1608}
1609
1610impl DeploymentSource {
1611    pub fn new() -> Self {
1612        std::default::Default::default()
1613    }
1614
1615    /// Sets the value of [deployment][crate::model::DeploymentSource::deployment].
1616    ///
1617    /// # Example
1618    /// ```ignore,no_run
1619    /// # use google_cloud_config_v1::model::DeploymentSource;
1620    /// let x = DeploymentSource::new().set_deployment("example");
1621    /// ```
1622    pub fn set_deployment<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1623        self.deployment = v.into();
1624        self
1625    }
1626
1627    /// Sets the value of [output_name][crate::model::DeploymentSource::output_name].
1628    ///
1629    /// # Example
1630    /// ```ignore,no_run
1631    /// # use google_cloud_config_v1::model::DeploymentSource;
1632    /// let x = DeploymentSource::new().set_output_name("example");
1633    /// ```
1634    pub fn set_output_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1635        self.output_name = v.into();
1636        self
1637    }
1638}
1639
1640impl wkt::message::Message for DeploymentSource {
1641    fn typename() -> &'static str {
1642        "type.googleapis.com/google.cloud.config.v1.DeploymentSource"
1643    }
1644}
1645
1646/// Outputs and artifacts from applying a deployment.
1647#[derive(Clone, Default, PartialEq)]
1648#[non_exhaustive]
1649pub struct ApplyResults {
1650    /// Location of a blueprint copy and other manifests in Google Cloud Storage.
1651    /// Format: `gs://{bucket}/{object}`
1652    pub content: std::string::String,
1653
1654    /// Location of artifacts (e.g. logs) in Google Cloud Storage.
1655    /// Format: `gs://{bucket}/{object}`
1656    pub artifacts: std::string::String,
1657
1658    /// Map of output name to output info.
1659    pub outputs: std::collections::HashMap<std::string::String, crate::model::TerraformOutput>,
1660
1661    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1662}
1663
1664impl ApplyResults {
1665    pub fn new() -> Self {
1666        std::default::Default::default()
1667    }
1668
1669    /// Sets the value of [content][crate::model::ApplyResults::content].
1670    ///
1671    /// # Example
1672    /// ```ignore,no_run
1673    /// # use google_cloud_config_v1::model::ApplyResults;
1674    /// let x = ApplyResults::new().set_content("example");
1675    /// ```
1676    pub fn set_content<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1677        self.content = v.into();
1678        self
1679    }
1680
1681    /// Sets the value of [artifacts][crate::model::ApplyResults::artifacts].
1682    ///
1683    /// # Example
1684    /// ```ignore,no_run
1685    /// # use google_cloud_config_v1::model::ApplyResults;
1686    /// let x = ApplyResults::new().set_artifacts("example");
1687    /// ```
1688    pub fn set_artifacts<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1689        self.artifacts = v.into();
1690        self
1691    }
1692
1693    /// Sets the value of [outputs][crate::model::ApplyResults::outputs].
1694    ///
1695    /// # Example
1696    /// ```ignore,no_run
1697    /// # use google_cloud_config_v1::model::ApplyResults;
1698    /// use google_cloud_config_v1::model::TerraformOutput;
1699    /// let x = ApplyResults::new().set_outputs([
1700    ///     ("key0", TerraformOutput::default()/* use setters */),
1701    ///     ("key1", TerraformOutput::default()/* use (different) setters */),
1702    /// ]);
1703    /// ```
1704    pub fn set_outputs<T, K, V>(mut self, v: T) -> Self
1705    where
1706        T: std::iter::IntoIterator<Item = (K, V)>,
1707        K: std::convert::Into<std::string::String>,
1708        V: std::convert::Into<crate::model::TerraformOutput>,
1709    {
1710        use std::iter::Iterator;
1711        self.outputs = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1712        self
1713    }
1714}
1715
1716impl wkt::message::Message for ApplyResults {
1717    fn typename() -> &'static str {
1718        "type.googleapis.com/google.cloud.config.v1.ApplyResults"
1719    }
1720}
1721
1722/// Describes a Terraform output.
1723#[derive(Clone, Default, PartialEq)]
1724#[non_exhaustive]
1725pub struct TerraformOutput {
1726    /// Identifies whether Terraform has set this output as a potential
1727    /// sensitive value.
1728    pub sensitive: bool,
1729
1730    /// Value of output.
1731    pub value: std::option::Option<wkt::Value>,
1732
1733    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1734}
1735
1736impl TerraformOutput {
1737    pub fn new() -> Self {
1738        std::default::Default::default()
1739    }
1740
1741    /// Sets the value of [sensitive][crate::model::TerraformOutput::sensitive].
1742    ///
1743    /// # Example
1744    /// ```ignore,no_run
1745    /// # use google_cloud_config_v1::model::TerraformOutput;
1746    /// let x = TerraformOutput::new().set_sensitive(true);
1747    /// ```
1748    pub fn set_sensitive<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1749        self.sensitive = v.into();
1750        self
1751    }
1752
1753    /// Sets the value of [value][crate::model::TerraformOutput::value].
1754    ///
1755    /// # Example
1756    /// ```ignore,no_run
1757    /// # use google_cloud_config_v1::model::TerraformOutput;
1758    /// use wkt::Value;
1759    /// let x = TerraformOutput::new().set_value(Value::default()/* use setters */);
1760    /// ```
1761    pub fn set_value<T>(mut self, v: T) -> Self
1762    where
1763        T: std::convert::Into<wkt::Value>,
1764    {
1765        self.value = std::option::Option::Some(v.into());
1766        self
1767    }
1768
1769    /// Sets or clears the value of [value][crate::model::TerraformOutput::value].
1770    ///
1771    /// # Example
1772    /// ```ignore,no_run
1773    /// # use google_cloud_config_v1::model::TerraformOutput;
1774    /// use wkt::Value;
1775    /// let x = TerraformOutput::new().set_or_clear_value(Some(Value::default()/* use setters */));
1776    /// let x = TerraformOutput::new().set_or_clear_value(None::<Value>);
1777    /// ```
1778    pub fn set_or_clear_value<T>(mut self, v: std::option::Option<T>) -> Self
1779    where
1780        T: std::convert::Into<wkt::Value>,
1781    {
1782        self.value = v.map(|x| x.into());
1783        self
1784    }
1785}
1786
1787impl wkt::message::Message for TerraformOutput {
1788    fn typename() -> &'static str {
1789        "type.googleapis.com/google.cloud.config.v1.TerraformOutput"
1790    }
1791}
1792
1793#[derive(Clone, Default, PartialEq)]
1794#[non_exhaustive]
1795pub struct ListDeploymentsRequest {
1796    /// Required. The parent in whose context the Deployments are listed. The
1797    /// parent value is in the format:
1798    /// 'projects/{project_id}/locations/{location}'.
1799    pub parent: std::string::String,
1800
1801    /// When requesting a page of resources, 'page_size' specifies number of
1802    /// resources to return. If unspecified, at most 500 will be returned. The
1803    /// maximum value is 1000.
1804    pub page_size: i32,
1805
1806    /// Token returned by previous call to 'ListDeployments' which specifies the
1807    /// position in the list from where to continue listing the resources.
1808    pub page_token: std::string::String,
1809
1810    /// Lists the Deployments that match the filter expression. A filter
1811    /// expression filters the resources listed in the response. The expression
1812    /// must be of the form '{field} {operator} {value}' where operators: '<', '>',
1813    /// '<=', '>=', '!=', '=', ':' are supported (colon ':' represents a HAS
1814    /// operator which is roughly synonymous with equality). {field} can refer to a
1815    /// proto or JSON field, or a synthetic field. Field names can be camelCase or
1816    /// snake_case.
1817    ///
1818    /// Examples:
1819    ///
1820    /// - Filter by name:
1821    ///   name = "projects/foo/locations/us-central1/deployments/bar
1822    ///
1823    /// - Filter by labels:
1824    ///
1825    ///   - Resources that have a key called 'foo'
1826    ///     labels.foo:*
1827    ///   - Resources that have a key called 'foo' whose value is 'bar'
1828    ///     labels.foo = bar
1829    /// - Filter by state:
1830    ///
1831    ///   - Deployments in CREATING state.
1832    ///     state=CREATING
1833    pub filter: std::string::String,
1834
1835    /// Field to use to sort the list.
1836    pub order_by: std::string::String,
1837
1838    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1839}
1840
1841impl ListDeploymentsRequest {
1842    pub fn new() -> Self {
1843        std::default::Default::default()
1844    }
1845
1846    /// Sets the value of [parent][crate::model::ListDeploymentsRequest::parent].
1847    ///
1848    /// # Example
1849    /// ```ignore,no_run
1850    /// # use google_cloud_config_v1::model::ListDeploymentsRequest;
1851    /// let x = ListDeploymentsRequest::new().set_parent("example");
1852    /// ```
1853    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1854        self.parent = v.into();
1855        self
1856    }
1857
1858    /// Sets the value of [page_size][crate::model::ListDeploymentsRequest::page_size].
1859    ///
1860    /// # Example
1861    /// ```ignore,no_run
1862    /// # use google_cloud_config_v1::model::ListDeploymentsRequest;
1863    /// let x = ListDeploymentsRequest::new().set_page_size(42);
1864    /// ```
1865    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1866        self.page_size = v.into();
1867        self
1868    }
1869
1870    /// Sets the value of [page_token][crate::model::ListDeploymentsRequest::page_token].
1871    ///
1872    /// # Example
1873    /// ```ignore,no_run
1874    /// # use google_cloud_config_v1::model::ListDeploymentsRequest;
1875    /// let x = ListDeploymentsRequest::new().set_page_token("example");
1876    /// ```
1877    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1878        self.page_token = v.into();
1879        self
1880    }
1881
1882    /// Sets the value of [filter][crate::model::ListDeploymentsRequest::filter].
1883    ///
1884    /// # Example
1885    /// ```ignore,no_run
1886    /// # use google_cloud_config_v1::model::ListDeploymentsRequest;
1887    /// let x = ListDeploymentsRequest::new().set_filter("example");
1888    /// ```
1889    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1890        self.filter = v.into();
1891        self
1892    }
1893
1894    /// Sets the value of [order_by][crate::model::ListDeploymentsRequest::order_by].
1895    ///
1896    /// # Example
1897    /// ```ignore,no_run
1898    /// # use google_cloud_config_v1::model::ListDeploymentsRequest;
1899    /// let x = ListDeploymentsRequest::new().set_order_by("example");
1900    /// ```
1901    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1902        self.order_by = v.into();
1903        self
1904    }
1905}
1906
1907impl wkt::message::Message for ListDeploymentsRequest {
1908    fn typename() -> &'static str {
1909        "type.googleapis.com/google.cloud.config.v1.ListDeploymentsRequest"
1910    }
1911}
1912
1913#[derive(Clone, Default, PartialEq)]
1914#[non_exhaustive]
1915pub struct ListDeploymentsResponse {
1916    /// List of [Deployment][google.cloud.config.v1.Deployment]s.
1917    ///
1918    /// [google.cloud.config.v1.Deployment]: crate::model::Deployment
1919    pub deployments: std::vec::Vec<crate::model::Deployment>,
1920
1921    /// Token to be supplied to the next ListDeployments request via `page_token`
1922    /// to obtain the next set of results.
1923    pub next_page_token: std::string::String,
1924
1925    /// Locations that could not be reached.
1926    pub unreachable: std::vec::Vec<std::string::String>,
1927
1928    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1929}
1930
1931impl ListDeploymentsResponse {
1932    pub fn new() -> Self {
1933        std::default::Default::default()
1934    }
1935
1936    /// Sets the value of [deployments][crate::model::ListDeploymentsResponse::deployments].
1937    ///
1938    /// # Example
1939    /// ```ignore,no_run
1940    /// # use google_cloud_config_v1::model::ListDeploymentsResponse;
1941    /// use google_cloud_config_v1::model::Deployment;
1942    /// let x = ListDeploymentsResponse::new()
1943    ///     .set_deployments([
1944    ///         Deployment::default()/* use setters */,
1945    ///         Deployment::default()/* use (different) setters */,
1946    ///     ]);
1947    /// ```
1948    pub fn set_deployments<T, V>(mut self, v: T) -> Self
1949    where
1950        T: std::iter::IntoIterator<Item = V>,
1951        V: std::convert::Into<crate::model::Deployment>,
1952    {
1953        use std::iter::Iterator;
1954        self.deployments = v.into_iter().map(|i| i.into()).collect();
1955        self
1956    }
1957
1958    /// Sets the value of [next_page_token][crate::model::ListDeploymentsResponse::next_page_token].
1959    ///
1960    /// # Example
1961    /// ```ignore,no_run
1962    /// # use google_cloud_config_v1::model::ListDeploymentsResponse;
1963    /// let x = ListDeploymentsResponse::new().set_next_page_token("example");
1964    /// ```
1965    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1966        self.next_page_token = v.into();
1967        self
1968    }
1969
1970    /// Sets the value of [unreachable][crate::model::ListDeploymentsResponse::unreachable].
1971    ///
1972    /// # Example
1973    /// ```ignore,no_run
1974    /// # use google_cloud_config_v1::model::ListDeploymentsResponse;
1975    /// let x = ListDeploymentsResponse::new().set_unreachable(["a", "b", "c"]);
1976    /// ```
1977    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
1978    where
1979        T: std::iter::IntoIterator<Item = V>,
1980        V: std::convert::Into<std::string::String>,
1981    {
1982        use std::iter::Iterator;
1983        self.unreachable = v.into_iter().map(|i| i.into()).collect();
1984        self
1985    }
1986}
1987
1988impl wkt::message::Message for ListDeploymentsResponse {
1989    fn typename() -> &'static str {
1990        "type.googleapis.com/google.cloud.config.v1.ListDeploymentsResponse"
1991    }
1992}
1993
1994#[doc(hidden)]
1995impl google_cloud_gax::paginator::internal::PageableResponse for ListDeploymentsResponse {
1996    type PageItem = crate::model::Deployment;
1997
1998    fn items(self) -> std::vec::Vec<Self::PageItem> {
1999        self.deployments
2000    }
2001
2002    fn next_page_token(&self) -> std::string::String {
2003        use std::clone::Clone;
2004        self.next_page_token.clone()
2005    }
2006}
2007
2008#[derive(Clone, Default, PartialEq)]
2009#[non_exhaustive]
2010pub struct GetDeploymentRequest {
2011    /// Required. The name of the deployment. Format:
2012    /// 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
2013    pub name: std::string::String,
2014
2015    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2016}
2017
2018impl GetDeploymentRequest {
2019    pub fn new() -> Self {
2020        std::default::Default::default()
2021    }
2022
2023    /// Sets the value of [name][crate::model::GetDeploymentRequest::name].
2024    ///
2025    /// # Example
2026    /// ```ignore,no_run
2027    /// # use google_cloud_config_v1::model::GetDeploymentRequest;
2028    /// let x = GetDeploymentRequest::new().set_name("example");
2029    /// ```
2030    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2031        self.name = v.into();
2032        self
2033    }
2034}
2035
2036impl wkt::message::Message for GetDeploymentRequest {
2037    fn typename() -> &'static str {
2038        "type.googleapis.com/google.cloud.config.v1.GetDeploymentRequest"
2039    }
2040}
2041
2042/// A request to list Revisions passed to a 'ListRevisions' call.
2043#[derive(Clone, Default, PartialEq)]
2044#[non_exhaustive]
2045pub struct ListRevisionsRequest {
2046    /// Required. The parent in whose context the Revisions are listed. The parent
2047    /// value is in the format:
2048    /// 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
2049    pub parent: std::string::String,
2050
2051    /// When requesting a page of resources, `page_size` specifies number of
2052    /// resources to return. If unspecified, at most 500 will be returned. The
2053    /// maximum value is 1000.
2054    pub page_size: i32,
2055
2056    /// Token returned by previous call to 'ListRevisions' which specifies the
2057    /// position in the list from where to continue listing the resources.
2058    pub page_token: std::string::String,
2059
2060    /// Lists the Revisions that match the filter expression. A filter
2061    /// expression filters the resources listed in the response. The expression
2062    /// must be of the form '{field} {operator} {value}' where operators: '<', '>',
2063    /// '<=', '>=', '!=', '=', ':' are supported (colon ':' represents a HAS
2064    /// operator which is roughly synonymous with equality). {field} can refer to a
2065    /// proto or JSON field, or a synthetic field. Field names can be camelCase or
2066    /// snake_case.
2067    ///
2068    /// Examples:
2069    ///
2070    /// - Filter by name:
2071    ///   name = "projects/foo/locations/us-central1/deployments/dep/revisions/bar
2072    ///
2073    /// - Filter by labels:
2074    ///
2075    ///   - Resources that have a key called 'foo'
2076    ///     labels.foo:*
2077    ///   - Resources that have a key called 'foo' whose value is 'bar'
2078    ///     labels.foo = bar
2079    /// - Filter by state:
2080    ///
2081    ///   - Revisions in CREATING state.
2082    ///     state=CREATING
2083    pub filter: std::string::String,
2084
2085    /// Field to use to sort the list.
2086    pub order_by: std::string::String,
2087
2088    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2089}
2090
2091impl ListRevisionsRequest {
2092    pub fn new() -> Self {
2093        std::default::Default::default()
2094    }
2095
2096    /// Sets the value of [parent][crate::model::ListRevisionsRequest::parent].
2097    ///
2098    /// # Example
2099    /// ```ignore,no_run
2100    /// # use google_cloud_config_v1::model::ListRevisionsRequest;
2101    /// let x = ListRevisionsRequest::new().set_parent("example");
2102    /// ```
2103    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2104        self.parent = v.into();
2105        self
2106    }
2107
2108    /// Sets the value of [page_size][crate::model::ListRevisionsRequest::page_size].
2109    ///
2110    /// # Example
2111    /// ```ignore,no_run
2112    /// # use google_cloud_config_v1::model::ListRevisionsRequest;
2113    /// let x = ListRevisionsRequest::new().set_page_size(42);
2114    /// ```
2115    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2116        self.page_size = v.into();
2117        self
2118    }
2119
2120    /// Sets the value of [page_token][crate::model::ListRevisionsRequest::page_token].
2121    ///
2122    /// # Example
2123    /// ```ignore,no_run
2124    /// # use google_cloud_config_v1::model::ListRevisionsRequest;
2125    /// let x = ListRevisionsRequest::new().set_page_token("example");
2126    /// ```
2127    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2128        self.page_token = v.into();
2129        self
2130    }
2131
2132    /// Sets the value of [filter][crate::model::ListRevisionsRequest::filter].
2133    ///
2134    /// # Example
2135    /// ```ignore,no_run
2136    /// # use google_cloud_config_v1::model::ListRevisionsRequest;
2137    /// let x = ListRevisionsRequest::new().set_filter("example");
2138    /// ```
2139    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2140        self.filter = v.into();
2141        self
2142    }
2143
2144    /// Sets the value of [order_by][crate::model::ListRevisionsRequest::order_by].
2145    ///
2146    /// # Example
2147    /// ```ignore,no_run
2148    /// # use google_cloud_config_v1::model::ListRevisionsRequest;
2149    /// let x = ListRevisionsRequest::new().set_order_by("example");
2150    /// ```
2151    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2152        self.order_by = v.into();
2153        self
2154    }
2155}
2156
2157impl wkt::message::Message for ListRevisionsRequest {
2158    fn typename() -> &'static str {
2159        "type.googleapis.com/google.cloud.config.v1.ListRevisionsRequest"
2160    }
2161}
2162
2163/// A response to a 'ListRevisions' call. Contains a list of Revisions.
2164#[derive(Clone, Default, PartialEq)]
2165#[non_exhaustive]
2166pub struct ListRevisionsResponse {
2167    /// List of [Revision][google.cloud.config.v1.Revision]s.
2168    ///
2169    /// [google.cloud.config.v1.Revision]: crate::model::Revision
2170    pub revisions: std::vec::Vec<crate::model::Revision>,
2171
2172    /// A token to request the next page of resources from the 'ListRevisions'
2173    /// method. The value of an empty string means that there are no more resources
2174    /// to return.
2175    pub next_page_token: std::string::String,
2176
2177    /// Locations that could not be reached.
2178    pub unreachable: std::vec::Vec<std::string::String>,
2179
2180    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2181}
2182
2183impl ListRevisionsResponse {
2184    pub fn new() -> Self {
2185        std::default::Default::default()
2186    }
2187
2188    /// Sets the value of [revisions][crate::model::ListRevisionsResponse::revisions].
2189    ///
2190    /// # Example
2191    /// ```ignore,no_run
2192    /// # use google_cloud_config_v1::model::ListRevisionsResponse;
2193    /// use google_cloud_config_v1::model::Revision;
2194    /// let x = ListRevisionsResponse::new()
2195    ///     .set_revisions([
2196    ///         Revision::default()/* use setters */,
2197    ///         Revision::default()/* use (different) setters */,
2198    ///     ]);
2199    /// ```
2200    pub fn set_revisions<T, V>(mut self, v: T) -> Self
2201    where
2202        T: std::iter::IntoIterator<Item = V>,
2203        V: std::convert::Into<crate::model::Revision>,
2204    {
2205        use std::iter::Iterator;
2206        self.revisions = v.into_iter().map(|i| i.into()).collect();
2207        self
2208    }
2209
2210    /// Sets the value of [next_page_token][crate::model::ListRevisionsResponse::next_page_token].
2211    ///
2212    /// # Example
2213    /// ```ignore,no_run
2214    /// # use google_cloud_config_v1::model::ListRevisionsResponse;
2215    /// let x = ListRevisionsResponse::new().set_next_page_token("example");
2216    /// ```
2217    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2218        self.next_page_token = v.into();
2219        self
2220    }
2221
2222    /// Sets the value of [unreachable][crate::model::ListRevisionsResponse::unreachable].
2223    ///
2224    /// # Example
2225    /// ```ignore,no_run
2226    /// # use google_cloud_config_v1::model::ListRevisionsResponse;
2227    /// let x = ListRevisionsResponse::new().set_unreachable(["a", "b", "c"]);
2228    /// ```
2229    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
2230    where
2231        T: std::iter::IntoIterator<Item = V>,
2232        V: std::convert::Into<std::string::String>,
2233    {
2234        use std::iter::Iterator;
2235        self.unreachable = v.into_iter().map(|i| i.into()).collect();
2236        self
2237    }
2238}
2239
2240impl wkt::message::Message for ListRevisionsResponse {
2241    fn typename() -> &'static str {
2242        "type.googleapis.com/google.cloud.config.v1.ListRevisionsResponse"
2243    }
2244}
2245
2246#[doc(hidden)]
2247impl google_cloud_gax::paginator::internal::PageableResponse for ListRevisionsResponse {
2248    type PageItem = crate::model::Revision;
2249
2250    fn items(self) -> std::vec::Vec<Self::PageItem> {
2251        self.revisions
2252    }
2253
2254    fn next_page_token(&self) -> std::string::String {
2255        use std::clone::Clone;
2256        self.next_page_token.clone()
2257    }
2258}
2259
2260/// A request to get a Revision from a 'GetRevision' call.
2261#[derive(Clone, Default, PartialEq)]
2262#[non_exhaustive]
2263pub struct GetRevisionRequest {
2264    /// Required. The name of the Revision in the format:
2265    /// 'projects/{project_id}/locations/{location}/deployments/{deployment}/revisions/{revision}'.
2266    pub name: std::string::String,
2267
2268    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2269}
2270
2271impl GetRevisionRequest {
2272    pub fn new() -> Self {
2273        std::default::Default::default()
2274    }
2275
2276    /// Sets the value of [name][crate::model::GetRevisionRequest::name].
2277    ///
2278    /// # Example
2279    /// ```ignore,no_run
2280    /// # use google_cloud_config_v1::model::GetRevisionRequest;
2281    /// let x = GetRevisionRequest::new().set_name("example");
2282    /// ```
2283    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2284        self.name = v.into();
2285        self
2286    }
2287}
2288
2289impl wkt::message::Message for GetRevisionRequest {
2290    fn typename() -> &'static str {
2291        "type.googleapis.com/google.cloud.config.v1.GetRevisionRequest"
2292    }
2293}
2294
2295#[derive(Clone, Default, PartialEq)]
2296#[non_exhaustive]
2297pub struct CreateDeploymentRequest {
2298    /// Required. The parent in whose context the Deployment is created. The parent
2299    /// value is in the format: 'projects/{project_id}/locations/{location}'.
2300    pub parent: std::string::String,
2301
2302    /// Required. The Deployment ID.
2303    pub deployment_id: std::string::String,
2304
2305    /// Required. [Deployment][google.cloud.config.v1.Deployment] resource to be
2306    /// created.
2307    ///
2308    /// [google.cloud.config.v1.Deployment]: crate::model::Deployment
2309    pub deployment: std::option::Option<crate::model::Deployment>,
2310
2311    /// Optional. An optional request ID to identify requests. Specify a unique
2312    /// request ID so that if you must retry your request, the server will know to
2313    /// ignore the request if it has already been completed. The server will
2314    /// guarantee that for at least 60 minutes since the first request.
2315    ///
2316    /// For example, consider a situation where you make an initial request and the
2317    /// request times out. If you make the request again with the same request ID,
2318    /// the server can check if original operation with the same request ID was
2319    /// received, and if so, will ignore the second request. This prevents clients
2320    /// from accidentally creating duplicate commitments.
2321    ///
2322    /// The request ID must be a valid UUID with the exception that zero UUID is
2323    /// not supported (00000000-0000-0000-0000-000000000000).
2324    pub request_id: std::string::String,
2325
2326    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2327}
2328
2329impl CreateDeploymentRequest {
2330    pub fn new() -> Self {
2331        std::default::Default::default()
2332    }
2333
2334    /// Sets the value of [parent][crate::model::CreateDeploymentRequest::parent].
2335    ///
2336    /// # Example
2337    /// ```ignore,no_run
2338    /// # use google_cloud_config_v1::model::CreateDeploymentRequest;
2339    /// let x = CreateDeploymentRequest::new().set_parent("example");
2340    /// ```
2341    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2342        self.parent = v.into();
2343        self
2344    }
2345
2346    /// Sets the value of [deployment_id][crate::model::CreateDeploymentRequest::deployment_id].
2347    ///
2348    /// # Example
2349    /// ```ignore,no_run
2350    /// # use google_cloud_config_v1::model::CreateDeploymentRequest;
2351    /// let x = CreateDeploymentRequest::new().set_deployment_id("example");
2352    /// ```
2353    pub fn set_deployment_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2354        self.deployment_id = v.into();
2355        self
2356    }
2357
2358    /// Sets the value of [deployment][crate::model::CreateDeploymentRequest::deployment].
2359    ///
2360    /// # Example
2361    /// ```ignore,no_run
2362    /// # use google_cloud_config_v1::model::CreateDeploymentRequest;
2363    /// use google_cloud_config_v1::model::Deployment;
2364    /// let x = CreateDeploymentRequest::new().set_deployment(Deployment::default()/* use setters */);
2365    /// ```
2366    pub fn set_deployment<T>(mut self, v: T) -> Self
2367    where
2368        T: std::convert::Into<crate::model::Deployment>,
2369    {
2370        self.deployment = std::option::Option::Some(v.into());
2371        self
2372    }
2373
2374    /// Sets or clears the value of [deployment][crate::model::CreateDeploymentRequest::deployment].
2375    ///
2376    /// # Example
2377    /// ```ignore,no_run
2378    /// # use google_cloud_config_v1::model::CreateDeploymentRequest;
2379    /// use google_cloud_config_v1::model::Deployment;
2380    /// let x = CreateDeploymentRequest::new().set_or_clear_deployment(Some(Deployment::default()/* use setters */));
2381    /// let x = CreateDeploymentRequest::new().set_or_clear_deployment(None::<Deployment>);
2382    /// ```
2383    pub fn set_or_clear_deployment<T>(mut self, v: std::option::Option<T>) -> Self
2384    where
2385        T: std::convert::Into<crate::model::Deployment>,
2386    {
2387        self.deployment = v.map(|x| x.into());
2388        self
2389    }
2390
2391    /// Sets the value of [request_id][crate::model::CreateDeploymentRequest::request_id].
2392    ///
2393    /// # Example
2394    /// ```ignore,no_run
2395    /// # use google_cloud_config_v1::model::CreateDeploymentRequest;
2396    /// let x = CreateDeploymentRequest::new().set_request_id("example");
2397    /// ```
2398    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2399        self.request_id = v.into();
2400        self
2401    }
2402}
2403
2404impl wkt::message::Message for CreateDeploymentRequest {
2405    fn typename() -> &'static str {
2406        "type.googleapis.com/google.cloud.config.v1.CreateDeploymentRequest"
2407    }
2408}
2409
2410/// A request to create a deployment group
2411#[derive(Clone, Default, PartialEq)]
2412#[non_exhaustive]
2413pub struct CreateDeploymentGroupRequest {
2414    /// Required. The parent in whose context the Deployment Group is created. The
2415    /// parent value is in the format: 'projects/{project_id}/locations/{location}'
2416    pub parent: std::string::String,
2417
2418    /// Required. The deployment group ID.
2419    pub deployment_group_id: std::string::String,
2420
2421    /// Required. [Deployment Group][] resource to create
2422    pub deployment_group: std::option::Option<crate::model::DeploymentGroup>,
2423
2424    /// Optional. An optional request ID to identify requests. Specify a unique
2425    /// request ID so that if you must retry your request, the server will know to
2426    /// ignore the request if it has already been completed. The server will
2427    /// guarantee that for at least 60 minutes since the first request.
2428    ///
2429    /// For example, consider a situation where you make an initial request and the
2430    /// request times out. If you make the request again with the same request ID,
2431    /// the server can check if original operation with the same request ID was
2432    /// received, and if so, will ignore the second request. This prevents clients
2433    /// from accidentally creating duplicate commitments.
2434    ///
2435    /// The request ID must be a valid UUID with the exception that zero UUID is
2436    /// not supported (00000000-0000-0000-0000-000000000000).
2437    pub request_id: std::string::String,
2438
2439    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2440}
2441
2442impl CreateDeploymentGroupRequest {
2443    pub fn new() -> Self {
2444        std::default::Default::default()
2445    }
2446
2447    /// Sets the value of [parent][crate::model::CreateDeploymentGroupRequest::parent].
2448    ///
2449    /// # Example
2450    /// ```ignore,no_run
2451    /// # use google_cloud_config_v1::model::CreateDeploymentGroupRequest;
2452    /// let x = CreateDeploymentGroupRequest::new().set_parent("example");
2453    /// ```
2454    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2455        self.parent = v.into();
2456        self
2457    }
2458
2459    /// Sets the value of [deployment_group_id][crate::model::CreateDeploymentGroupRequest::deployment_group_id].
2460    ///
2461    /// # Example
2462    /// ```ignore,no_run
2463    /// # use google_cloud_config_v1::model::CreateDeploymentGroupRequest;
2464    /// let x = CreateDeploymentGroupRequest::new().set_deployment_group_id("example");
2465    /// ```
2466    pub fn set_deployment_group_id<T: std::convert::Into<std::string::String>>(
2467        mut self,
2468        v: T,
2469    ) -> Self {
2470        self.deployment_group_id = v.into();
2471        self
2472    }
2473
2474    /// Sets the value of [deployment_group][crate::model::CreateDeploymentGroupRequest::deployment_group].
2475    ///
2476    /// # Example
2477    /// ```ignore,no_run
2478    /// # use google_cloud_config_v1::model::CreateDeploymentGroupRequest;
2479    /// use google_cloud_config_v1::model::DeploymentGroup;
2480    /// let x = CreateDeploymentGroupRequest::new().set_deployment_group(DeploymentGroup::default()/* use setters */);
2481    /// ```
2482    pub fn set_deployment_group<T>(mut self, v: T) -> Self
2483    where
2484        T: std::convert::Into<crate::model::DeploymentGroup>,
2485    {
2486        self.deployment_group = std::option::Option::Some(v.into());
2487        self
2488    }
2489
2490    /// Sets or clears the value of [deployment_group][crate::model::CreateDeploymentGroupRequest::deployment_group].
2491    ///
2492    /// # Example
2493    /// ```ignore,no_run
2494    /// # use google_cloud_config_v1::model::CreateDeploymentGroupRequest;
2495    /// use google_cloud_config_v1::model::DeploymentGroup;
2496    /// let x = CreateDeploymentGroupRequest::new().set_or_clear_deployment_group(Some(DeploymentGroup::default()/* use setters */));
2497    /// let x = CreateDeploymentGroupRequest::new().set_or_clear_deployment_group(None::<DeploymentGroup>);
2498    /// ```
2499    pub fn set_or_clear_deployment_group<T>(mut self, v: std::option::Option<T>) -> Self
2500    where
2501        T: std::convert::Into<crate::model::DeploymentGroup>,
2502    {
2503        self.deployment_group = v.map(|x| x.into());
2504        self
2505    }
2506
2507    /// Sets the value of [request_id][crate::model::CreateDeploymentGroupRequest::request_id].
2508    ///
2509    /// # Example
2510    /// ```ignore,no_run
2511    /// # use google_cloud_config_v1::model::CreateDeploymentGroupRequest;
2512    /// let x = CreateDeploymentGroupRequest::new().set_request_id("example");
2513    /// ```
2514    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2515        self.request_id = v.into();
2516        self
2517    }
2518}
2519
2520impl wkt::message::Message for CreateDeploymentGroupRequest {
2521    fn typename() -> &'static str {
2522        "type.googleapis.com/google.cloud.config.v1.CreateDeploymentGroupRequest"
2523    }
2524}
2525
2526/// A request message for updating a deployment group
2527#[derive(Clone, Default, PartialEq)]
2528#[non_exhaustive]
2529pub struct UpdateDeploymentGroupRequest {
2530    /// Optional. Field mask used to specify the fields to be overwritten in the
2531    /// Deployment Group resource by the update.
2532    ///
2533    /// The fields specified in the update_mask are relative to the resource, not
2534    /// the full request. A field will be overwritten if it is in the mask. If the
2535    /// user does not provide a mask then all fields will be overwritten.
2536    pub update_mask: std::option::Option<wkt::FieldMask>,
2537
2538    /// Required. [DeploymentGroup][google.cloud.config.v1.DeploymentGroup] to
2539    /// update.
2540    ///
2541    /// The deployment group's `name` field is used to identify the resource to be
2542    /// updated. Format:
2543    /// `projects/{project}/locations/{location}/deploymentGroups/{deployment_group_id}`
2544    ///
2545    /// [google.cloud.config.v1.DeploymentGroup]: crate::model::DeploymentGroup
2546    pub deployment_group: std::option::Option<crate::model::DeploymentGroup>,
2547
2548    /// Optional. An optional request ID to identify requests. Specify a unique
2549    /// request ID so that if you must retry your request, the server will know to
2550    /// ignore the request if it has already been completed. The server will
2551    /// guarantee that for at least 60 minutes since the first request.
2552    ///
2553    /// For example, consider a situation where you make an initial request and the
2554    /// request times out. If you make the request again with the same request ID,
2555    /// the server can check if original operation with the same request ID was
2556    /// received, and if so, will ignore the second request. This prevents clients
2557    /// from accidentally creating duplicate commitments.
2558    ///
2559    /// The request ID must be a valid UUID with the exception that zero UUID is
2560    /// not supported (00000000-0000-0000-0000-000000000000).
2561    pub request_id: std::string::String,
2562
2563    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2564}
2565
2566impl UpdateDeploymentGroupRequest {
2567    pub fn new() -> Self {
2568        std::default::Default::default()
2569    }
2570
2571    /// Sets the value of [update_mask][crate::model::UpdateDeploymentGroupRequest::update_mask].
2572    ///
2573    /// # Example
2574    /// ```ignore,no_run
2575    /// # use google_cloud_config_v1::model::UpdateDeploymentGroupRequest;
2576    /// use wkt::FieldMask;
2577    /// let x = UpdateDeploymentGroupRequest::new().set_update_mask(FieldMask::default()/* use setters */);
2578    /// ```
2579    pub fn set_update_mask<T>(mut self, v: T) -> Self
2580    where
2581        T: std::convert::Into<wkt::FieldMask>,
2582    {
2583        self.update_mask = std::option::Option::Some(v.into());
2584        self
2585    }
2586
2587    /// Sets or clears the value of [update_mask][crate::model::UpdateDeploymentGroupRequest::update_mask].
2588    ///
2589    /// # Example
2590    /// ```ignore,no_run
2591    /// # use google_cloud_config_v1::model::UpdateDeploymentGroupRequest;
2592    /// use wkt::FieldMask;
2593    /// let x = UpdateDeploymentGroupRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
2594    /// let x = UpdateDeploymentGroupRequest::new().set_or_clear_update_mask(None::<FieldMask>);
2595    /// ```
2596    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2597    where
2598        T: std::convert::Into<wkt::FieldMask>,
2599    {
2600        self.update_mask = v.map(|x| x.into());
2601        self
2602    }
2603
2604    /// Sets the value of [deployment_group][crate::model::UpdateDeploymentGroupRequest::deployment_group].
2605    ///
2606    /// # Example
2607    /// ```ignore,no_run
2608    /// # use google_cloud_config_v1::model::UpdateDeploymentGroupRequest;
2609    /// use google_cloud_config_v1::model::DeploymentGroup;
2610    /// let x = UpdateDeploymentGroupRequest::new().set_deployment_group(DeploymentGroup::default()/* use setters */);
2611    /// ```
2612    pub fn set_deployment_group<T>(mut self, v: T) -> Self
2613    where
2614        T: std::convert::Into<crate::model::DeploymentGroup>,
2615    {
2616        self.deployment_group = std::option::Option::Some(v.into());
2617        self
2618    }
2619
2620    /// Sets or clears the value of [deployment_group][crate::model::UpdateDeploymentGroupRequest::deployment_group].
2621    ///
2622    /// # Example
2623    /// ```ignore,no_run
2624    /// # use google_cloud_config_v1::model::UpdateDeploymentGroupRequest;
2625    /// use google_cloud_config_v1::model::DeploymentGroup;
2626    /// let x = UpdateDeploymentGroupRequest::new().set_or_clear_deployment_group(Some(DeploymentGroup::default()/* use setters */));
2627    /// let x = UpdateDeploymentGroupRequest::new().set_or_clear_deployment_group(None::<DeploymentGroup>);
2628    /// ```
2629    pub fn set_or_clear_deployment_group<T>(mut self, v: std::option::Option<T>) -> Self
2630    where
2631        T: std::convert::Into<crate::model::DeploymentGroup>,
2632    {
2633        self.deployment_group = v.map(|x| x.into());
2634        self
2635    }
2636
2637    /// Sets the value of [request_id][crate::model::UpdateDeploymentGroupRequest::request_id].
2638    ///
2639    /// # Example
2640    /// ```ignore,no_run
2641    /// # use google_cloud_config_v1::model::UpdateDeploymentGroupRequest;
2642    /// let x = UpdateDeploymentGroupRequest::new().set_request_id("example");
2643    /// ```
2644    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2645        self.request_id = v.into();
2646        self
2647    }
2648}
2649
2650impl wkt::message::Message for UpdateDeploymentGroupRequest {
2651    fn typename() -> &'static str {
2652        "type.googleapis.com/google.cloud.config.v1.UpdateDeploymentGroupRequest"
2653    }
2654}
2655
2656/// Request message for Delete DeploymentGroup
2657#[derive(Clone, Default, PartialEq)]
2658#[non_exhaustive]
2659pub struct DeleteDeploymentGroupRequest {
2660    /// Required. The name of DeploymentGroup in the format
2661    /// projects/{project_id}/locations/{location_id}/deploymentGroups/{deploymentGroup}
2662    pub name: std::string::String,
2663
2664    /// Optional. An optional request ID to identify requests. Specify a unique
2665    /// request ID so that if you must retry your request, the server will know to
2666    /// ignore the request if it has already been completed. The server will
2667    /// guarantee that for at least 60 minutes after the first request.
2668    ///
2669    /// For example, consider a situation where you make an initial request and the
2670    /// request times out. If you make the request again with the same request ID,
2671    /// the server can check if original operation with the same request ID was
2672    /// received, and if so, will ignore the second request. This prevents clients
2673    /// from accidentally creating duplicate commitments.
2674    ///
2675    /// The request ID must be a valid UUID with the exception that zero UUID is
2676    /// not supported (00000000-0000-0000-0000-000000000000).
2677    pub request_id: std::string::String,
2678
2679    /// Optional. If set to true, any revisions for this deployment group will also
2680    /// be deleted. (Otherwise, the request will only work if the deployment group
2681    /// has no revisions.)
2682    pub force: bool,
2683
2684    /// Optional. Policy on how to handle referenced deployments when deleting the
2685    /// DeploymentGroup.
2686    /// If unspecified, the default behavior is to fail the deletion if any
2687    /// deployments currently referenced in the `deployment_units` of the
2688    /// DeploymentGroup or in the latest revision are not deleted.
2689    pub deployment_reference_policy:
2690        crate::model::delete_deployment_group_request::DeploymentReferencePolicy,
2691
2692    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2693}
2694
2695impl DeleteDeploymentGroupRequest {
2696    pub fn new() -> Self {
2697        std::default::Default::default()
2698    }
2699
2700    /// Sets the value of [name][crate::model::DeleteDeploymentGroupRequest::name].
2701    ///
2702    /// # Example
2703    /// ```ignore,no_run
2704    /// # use google_cloud_config_v1::model::DeleteDeploymentGroupRequest;
2705    /// let x = DeleteDeploymentGroupRequest::new().set_name("example");
2706    /// ```
2707    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2708        self.name = v.into();
2709        self
2710    }
2711
2712    /// Sets the value of [request_id][crate::model::DeleteDeploymentGroupRequest::request_id].
2713    ///
2714    /// # Example
2715    /// ```ignore,no_run
2716    /// # use google_cloud_config_v1::model::DeleteDeploymentGroupRequest;
2717    /// let x = DeleteDeploymentGroupRequest::new().set_request_id("example");
2718    /// ```
2719    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2720        self.request_id = v.into();
2721        self
2722    }
2723
2724    /// Sets the value of [force][crate::model::DeleteDeploymentGroupRequest::force].
2725    ///
2726    /// # Example
2727    /// ```ignore,no_run
2728    /// # use google_cloud_config_v1::model::DeleteDeploymentGroupRequest;
2729    /// let x = DeleteDeploymentGroupRequest::new().set_force(true);
2730    /// ```
2731    pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2732        self.force = v.into();
2733        self
2734    }
2735
2736    /// Sets the value of [deployment_reference_policy][crate::model::DeleteDeploymentGroupRequest::deployment_reference_policy].
2737    ///
2738    /// # Example
2739    /// ```ignore,no_run
2740    /// # use google_cloud_config_v1::model::DeleteDeploymentGroupRequest;
2741    /// use google_cloud_config_v1::model::delete_deployment_group_request::DeploymentReferencePolicy;
2742    /// let x0 = DeleteDeploymentGroupRequest::new().set_deployment_reference_policy(DeploymentReferencePolicy::FailIfAnyReferencesExist);
2743    /// let x1 = DeleteDeploymentGroupRequest::new().set_deployment_reference_policy(DeploymentReferencePolicy::FailIfMetadataReferencesExist);
2744    /// let x2 = DeleteDeploymentGroupRequest::new().set_deployment_reference_policy(DeploymentReferencePolicy::IgnoreDeploymentReferences);
2745    /// ```
2746    pub fn set_deployment_reference_policy<
2747        T: std::convert::Into<
2748                crate::model::delete_deployment_group_request::DeploymentReferencePolicy,
2749            >,
2750    >(
2751        mut self,
2752        v: T,
2753    ) -> Self {
2754        self.deployment_reference_policy = v.into();
2755        self
2756    }
2757}
2758
2759impl wkt::message::Message for DeleteDeploymentGroupRequest {
2760    fn typename() -> &'static str {
2761        "type.googleapis.com/google.cloud.config.v1.DeleteDeploymentGroupRequest"
2762    }
2763}
2764
2765/// Defines additional types related to [DeleteDeploymentGroupRequest].
2766pub mod delete_deployment_group_request {
2767    #[allow(unused_imports)]
2768    use super::*;
2769
2770    /// Policy on how to handle referenced deployments when deleting the
2771    /// DeploymentGroup.
2772    ///
2773    /// # Working with unknown values
2774    ///
2775    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2776    /// additional enum variants at any time. Adding new variants is not considered
2777    /// a breaking change. Applications should write their code in anticipation of:
2778    ///
2779    /// - New values appearing in future releases of the client library, **and**
2780    /// - New values received dynamically, without application changes.
2781    ///
2782    /// Please consult the [Working with enums] section in the user guide for some
2783    /// guidelines.
2784    ///
2785    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
2786    #[derive(Clone, Debug, PartialEq)]
2787    #[non_exhaustive]
2788    pub enum DeploymentReferencePolicy {
2789        /// The default behavior. If unspecified, the system will act as if
2790        /// `FAIL_IF_ANY_REFERENCES_EXIST` is specified.
2791        Unspecified,
2792        /// Fail the deletion if any deployments currently referenced in the
2793        /// `deployment_units` of the DeploymentGroup or in the latest revision
2794        /// are not deleted.
2795        FailIfAnyReferencesExist,
2796        /// Fail the deletion only if any deployments currently referenced in the
2797        /// `deployment_units` of the DeploymentGroup are not deleted.
2798        /// The deletion will proceed even if the deployments in the latest revision
2799        /// of the DeploymentGroup are not deleted.
2800        FailIfMetadataReferencesExist,
2801        /// Ignore any deployments currently referenced in the
2802        /// `deployment_units` of the DeploymentGroup or in the latest revision.
2803        IgnoreDeploymentReferences,
2804        /// If set, the enum was initialized with an unknown value.
2805        ///
2806        /// Applications can examine the value using [DeploymentReferencePolicy::value] or
2807        /// [DeploymentReferencePolicy::name].
2808        UnknownValue(deployment_reference_policy::UnknownValue),
2809    }
2810
2811    #[doc(hidden)]
2812    pub mod deployment_reference_policy {
2813        #[allow(unused_imports)]
2814        use super::*;
2815        #[derive(Clone, Debug, PartialEq)]
2816        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2817    }
2818
2819    impl DeploymentReferencePolicy {
2820        /// Gets the enum value.
2821        ///
2822        /// Returns `None` if the enum contains an unknown value deserialized from
2823        /// the string representation of enums.
2824        pub fn value(&self) -> std::option::Option<i32> {
2825            match self {
2826                Self::Unspecified => std::option::Option::Some(0),
2827                Self::FailIfAnyReferencesExist => std::option::Option::Some(1),
2828                Self::FailIfMetadataReferencesExist => std::option::Option::Some(2),
2829                Self::IgnoreDeploymentReferences => std::option::Option::Some(3),
2830                Self::UnknownValue(u) => u.0.value(),
2831            }
2832        }
2833
2834        /// Gets the enum value as a string.
2835        ///
2836        /// Returns `None` if the enum contains an unknown value deserialized from
2837        /// the integer representation of enums.
2838        pub fn name(&self) -> std::option::Option<&str> {
2839            match self {
2840                Self::Unspecified => {
2841                    std::option::Option::Some("DEPLOYMENT_REFERENCE_POLICY_UNSPECIFIED")
2842                }
2843                Self::FailIfAnyReferencesExist => {
2844                    std::option::Option::Some("FAIL_IF_ANY_REFERENCES_EXIST")
2845                }
2846                Self::FailIfMetadataReferencesExist => {
2847                    std::option::Option::Some("FAIL_IF_METADATA_REFERENCES_EXIST")
2848                }
2849                Self::IgnoreDeploymentReferences => {
2850                    std::option::Option::Some("IGNORE_DEPLOYMENT_REFERENCES")
2851                }
2852                Self::UnknownValue(u) => u.0.name(),
2853            }
2854        }
2855    }
2856
2857    impl std::default::Default for DeploymentReferencePolicy {
2858        fn default() -> Self {
2859            use std::convert::From;
2860            Self::from(0)
2861        }
2862    }
2863
2864    impl std::fmt::Display for DeploymentReferencePolicy {
2865        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2866            wkt::internal::display_enum(f, self.name(), self.value())
2867        }
2868    }
2869
2870    impl std::convert::From<i32> for DeploymentReferencePolicy {
2871        fn from(value: i32) -> Self {
2872            match value {
2873                0 => Self::Unspecified,
2874                1 => Self::FailIfAnyReferencesExist,
2875                2 => Self::FailIfMetadataReferencesExist,
2876                3 => Self::IgnoreDeploymentReferences,
2877                _ => Self::UnknownValue(deployment_reference_policy::UnknownValue(
2878                    wkt::internal::UnknownEnumValue::Integer(value),
2879                )),
2880            }
2881        }
2882    }
2883
2884    impl std::convert::From<&str> for DeploymentReferencePolicy {
2885        fn from(value: &str) -> Self {
2886            use std::string::ToString;
2887            match value {
2888                "DEPLOYMENT_REFERENCE_POLICY_UNSPECIFIED" => Self::Unspecified,
2889                "FAIL_IF_ANY_REFERENCES_EXIST" => Self::FailIfAnyReferencesExist,
2890                "FAIL_IF_METADATA_REFERENCES_EXIST" => Self::FailIfMetadataReferencesExist,
2891                "IGNORE_DEPLOYMENT_REFERENCES" => Self::IgnoreDeploymentReferences,
2892                _ => Self::UnknownValue(deployment_reference_policy::UnknownValue(
2893                    wkt::internal::UnknownEnumValue::String(value.to_string()),
2894                )),
2895            }
2896        }
2897    }
2898
2899    impl serde::ser::Serialize for DeploymentReferencePolicy {
2900        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2901        where
2902            S: serde::Serializer,
2903        {
2904            match self {
2905                Self::Unspecified => serializer.serialize_i32(0),
2906                Self::FailIfAnyReferencesExist => serializer.serialize_i32(1),
2907                Self::FailIfMetadataReferencesExist => serializer.serialize_i32(2),
2908                Self::IgnoreDeploymentReferences => serializer.serialize_i32(3),
2909                Self::UnknownValue(u) => u.0.serialize(serializer),
2910            }
2911        }
2912    }
2913
2914    impl<'de> serde::de::Deserialize<'de> for DeploymentReferencePolicy {
2915        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2916        where
2917            D: serde::Deserializer<'de>,
2918        {
2919            deserializer.deserialize_any(wkt::internal::EnumVisitor::<DeploymentReferencePolicy>::new(
2920                ".google.cloud.config.v1.DeleteDeploymentGroupRequest.DeploymentReferencePolicy"))
2921        }
2922    }
2923}
2924
2925#[derive(Clone, Default, PartialEq)]
2926#[non_exhaustive]
2927pub struct UpdateDeploymentRequest {
2928    /// Optional. Field mask used to specify the fields to be overwritten in the
2929    /// Deployment resource by the update.
2930    ///
2931    /// The fields specified in the update_mask are relative to the resource, not
2932    /// the full request. A field will be overwritten if it is in the mask. If the
2933    /// user does not provide a mask then all fields will be overwritten.
2934    pub update_mask: std::option::Option<wkt::FieldMask>,
2935
2936    /// Required. [Deployment][google.cloud.config.v1.Deployment] to update.
2937    ///
2938    /// The deployment's `name` field is used to identify the resource to be
2939    /// updated. Format:
2940    /// `projects/{project}/locations/{location}/deployments/{deployment}`
2941    ///
2942    /// [google.cloud.config.v1.Deployment]: crate::model::Deployment
2943    pub deployment: std::option::Option<crate::model::Deployment>,
2944
2945    /// Optional. An optional request ID to identify requests. Specify a unique
2946    /// request ID so that if you must retry your request, the server will know to
2947    /// ignore the request if it has already been completed. The server will
2948    /// guarantee that for at least 60 minutes since the first request.
2949    ///
2950    /// For example, consider a situation where you make an initial request and the
2951    /// request times out. If you make the request again with the same request ID,
2952    /// the server can check if original operation with the same request ID was
2953    /// received, and if so, will ignore the second request. This prevents clients
2954    /// from accidentally creating duplicate commitments.
2955    ///
2956    /// The request ID must be a valid UUID with the exception that zero UUID is
2957    /// not supported (00000000-0000-0000-0000-000000000000).
2958    pub request_id: std::string::String,
2959
2960    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2961}
2962
2963impl UpdateDeploymentRequest {
2964    pub fn new() -> Self {
2965        std::default::Default::default()
2966    }
2967
2968    /// Sets the value of [update_mask][crate::model::UpdateDeploymentRequest::update_mask].
2969    ///
2970    /// # Example
2971    /// ```ignore,no_run
2972    /// # use google_cloud_config_v1::model::UpdateDeploymentRequest;
2973    /// use wkt::FieldMask;
2974    /// let x = UpdateDeploymentRequest::new().set_update_mask(FieldMask::default()/* use setters */);
2975    /// ```
2976    pub fn set_update_mask<T>(mut self, v: T) -> Self
2977    where
2978        T: std::convert::Into<wkt::FieldMask>,
2979    {
2980        self.update_mask = std::option::Option::Some(v.into());
2981        self
2982    }
2983
2984    /// Sets or clears the value of [update_mask][crate::model::UpdateDeploymentRequest::update_mask].
2985    ///
2986    /// # Example
2987    /// ```ignore,no_run
2988    /// # use google_cloud_config_v1::model::UpdateDeploymentRequest;
2989    /// use wkt::FieldMask;
2990    /// let x = UpdateDeploymentRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
2991    /// let x = UpdateDeploymentRequest::new().set_or_clear_update_mask(None::<FieldMask>);
2992    /// ```
2993    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2994    where
2995        T: std::convert::Into<wkt::FieldMask>,
2996    {
2997        self.update_mask = v.map(|x| x.into());
2998        self
2999    }
3000
3001    /// Sets the value of [deployment][crate::model::UpdateDeploymentRequest::deployment].
3002    ///
3003    /// # Example
3004    /// ```ignore,no_run
3005    /// # use google_cloud_config_v1::model::UpdateDeploymentRequest;
3006    /// use google_cloud_config_v1::model::Deployment;
3007    /// let x = UpdateDeploymentRequest::new().set_deployment(Deployment::default()/* use setters */);
3008    /// ```
3009    pub fn set_deployment<T>(mut self, v: T) -> Self
3010    where
3011        T: std::convert::Into<crate::model::Deployment>,
3012    {
3013        self.deployment = std::option::Option::Some(v.into());
3014        self
3015    }
3016
3017    /// Sets or clears the value of [deployment][crate::model::UpdateDeploymentRequest::deployment].
3018    ///
3019    /// # Example
3020    /// ```ignore,no_run
3021    /// # use google_cloud_config_v1::model::UpdateDeploymentRequest;
3022    /// use google_cloud_config_v1::model::Deployment;
3023    /// let x = UpdateDeploymentRequest::new().set_or_clear_deployment(Some(Deployment::default()/* use setters */));
3024    /// let x = UpdateDeploymentRequest::new().set_or_clear_deployment(None::<Deployment>);
3025    /// ```
3026    pub fn set_or_clear_deployment<T>(mut self, v: std::option::Option<T>) -> Self
3027    where
3028        T: std::convert::Into<crate::model::Deployment>,
3029    {
3030        self.deployment = v.map(|x| x.into());
3031        self
3032    }
3033
3034    /// Sets the value of [request_id][crate::model::UpdateDeploymentRequest::request_id].
3035    ///
3036    /// # Example
3037    /// ```ignore,no_run
3038    /// # use google_cloud_config_v1::model::UpdateDeploymentRequest;
3039    /// let x = UpdateDeploymentRequest::new().set_request_id("example");
3040    /// ```
3041    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3042        self.request_id = v.into();
3043        self
3044    }
3045}
3046
3047impl wkt::message::Message for UpdateDeploymentRequest {
3048    fn typename() -> &'static str {
3049        "type.googleapis.com/google.cloud.config.v1.UpdateDeploymentRequest"
3050    }
3051}
3052
3053#[derive(Clone, Default, PartialEq)]
3054#[non_exhaustive]
3055pub struct DeleteDeploymentRequest {
3056    /// Required. The name of the Deployment in the format:
3057    /// 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
3058    pub name: std::string::String,
3059
3060    /// Optional. An optional request ID to identify requests. Specify a unique
3061    /// request ID so that if you must retry your request, the server will know to
3062    /// ignore the request if it has already been completed. The server will
3063    /// guarantee that for at least 60 minutes after the first request.
3064    ///
3065    /// For example, consider a situation where you make an initial request and the
3066    /// request times out. If you make the request again with the same request ID,
3067    /// the server can check if original operation with the same request ID was
3068    /// received, and if so, will ignore the second request. This prevents clients
3069    /// from accidentally creating duplicate commitments.
3070    ///
3071    /// The request ID must be a valid UUID with the exception that zero UUID is
3072    /// not supported (00000000-0000-0000-0000-000000000000).
3073    pub request_id: std::string::String,
3074
3075    /// Optional. If set to true, any revisions for this deployment will also be
3076    /// deleted. (Otherwise, the request will only work if the deployment has no
3077    /// revisions.)
3078    pub force: bool,
3079
3080    /// Optional. Policy on how resources actuated by the deployment should be
3081    /// deleted. If unspecified, the default behavior is to delete the underlying
3082    /// resources.
3083    pub delete_policy: crate::model::delete_deployment_request::DeletePolicy,
3084
3085    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3086}
3087
3088impl DeleteDeploymentRequest {
3089    pub fn new() -> Self {
3090        std::default::Default::default()
3091    }
3092
3093    /// Sets the value of [name][crate::model::DeleteDeploymentRequest::name].
3094    ///
3095    /// # Example
3096    /// ```ignore,no_run
3097    /// # use google_cloud_config_v1::model::DeleteDeploymentRequest;
3098    /// let x = DeleteDeploymentRequest::new().set_name("example");
3099    /// ```
3100    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3101        self.name = v.into();
3102        self
3103    }
3104
3105    /// Sets the value of [request_id][crate::model::DeleteDeploymentRequest::request_id].
3106    ///
3107    /// # Example
3108    /// ```ignore,no_run
3109    /// # use google_cloud_config_v1::model::DeleteDeploymentRequest;
3110    /// let x = DeleteDeploymentRequest::new().set_request_id("example");
3111    /// ```
3112    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3113        self.request_id = v.into();
3114        self
3115    }
3116
3117    /// Sets the value of [force][crate::model::DeleteDeploymentRequest::force].
3118    ///
3119    /// # Example
3120    /// ```ignore,no_run
3121    /// # use google_cloud_config_v1::model::DeleteDeploymentRequest;
3122    /// let x = DeleteDeploymentRequest::new().set_force(true);
3123    /// ```
3124    pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3125        self.force = v.into();
3126        self
3127    }
3128
3129    /// Sets the value of [delete_policy][crate::model::DeleteDeploymentRequest::delete_policy].
3130    ///
3131    /// # Example
3132    /// ```ignore,no_run
3133    /// # use google_cloud_config_v1::model::DeleteDeploymentRequest;
3134    /// use google_cloud_config_v1::model::delete_deployment_request::DeletePolicy;
3135    /// let x0 = DeleteDeploymentRequest::new().set_delete_policy(DeletePolicy::Delete);
3136    /// let x1 = DeleteDeploymentRequest::new().set_delete_policy(DeletePolicy::Abandon);
3137    /// ```
3138    pub fn set_delete_policy<
3139        T: std::convert::Into<crate::model::delete_deployment_request::DeletePolicy>,
3140    >(
3141        mut self,
3142        v: T,
3143    ) -> Self {
3144        self.delete_policy = v.into();
3145        self
3146    }
3147}
3148
3149impl wkt::message::Message for DeleteDeploymentRequest {
3150    fn typename() -> &'static str {
3151        "type.googleapis.com/google.cloud.config.v1.DeleteDeploymentRequest"
3152    }
3153}
3154
3155/// Defines additional types related to [DeleteDeploymentRequest].
3156pub mod delete_deployment_request {
3157    #[allow(unused_imports)]
3158    use super::*;
3159
3160    /// Policy on how resources actuated by the deployment should be deleted.
3161    ///
3162    /// # Working with unknown values
3163    ///
3164    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3165    /// additional enum variants at any time. Adding new variants is not considered
3166    /// a breaking change. Applications should write their code in anticipation of:
3167    ///
3168    /// - New values appearing in future releases of the client library, **and**
3169    /// - New values received dynamically, without application changes.
3170    ///
3171    /// Please consult the [Working with enums] section in the user guide for some
3172    /// guidelines.
3173    ///
3174    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
3175    #[derive(Clone, Debug, PartialEq)]
3176    #[non_exhaustive]
3177    pub enum DeletePolicy {
3178        /// Unspecified policy, resources will be deleted.
3179        Unspecified,
3180        /// Deletes resources actuated by the deployment.
3181        Delete,
3182        /// Abandons resources and only deletes the deployment and its metadata.
3183        Abandon,
3184        /// If set, the enum was initialized with an unknown value.
3185        ///
3186        /// Applications can examine the value using [DeletePolicy::value] or
3187        /// [DeletePolicy::name].
3188        UnknownValue(delete_policy::UnknownValue),
3189    }
3190
3191    #[doc(hidden)]
3192    pub mod delete_policy {
3193        #[allow(unused_imports)]
3194        use super::*;
3195        #[derive(Clone, Debug, PartialEq)]
3196        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3197    }
3198
3199    impl DeletePolicy {
3200        /// Gets the enum value.
3201        ///
3202        /// Returns `None` if the enum contains an unknown value deserialized from
3203        /// the string representation of enums.
3204        pub fn value(&self) -> std::option::Option<i32> {
3205            match self {
3206                Self::Unspecified => std::option::Option::Some(0),
3207                Self::Delete => std::option::Option::Some(1),
3208                Self::Abandon => std::option::Option::Some(2),
3209                Self::UnknownValue(u) => u.0.value(),
3210            }
3211        }
3212
3213        /// Gets the enum value as a string.
3214        ///
3215        /// Returns `None` if the enum contains an unknown value deserialized from
3216        /// the integer representation of enums.
3217        pub fn name(&self) -> std::option::Option<&str> {
3218            match self {
3219                Self::Unspecified => std::option::Option::Some("DELETE_POLICY_UNSPECIFIED"),
3220                Self::Delete => std::option::Option::Some("DELETE"),
3221                Self::Abandon => std::option::Option::Some("ABANDON"),
3222                Self::UnknownValue(u) => u.0.name(),
3223            }
3224        }
3225    }
3226
3227    impl std::default::Default for DeletePolicy {
3228        fn default() -> Self {
3229            use std::convert::From;
3230            Self::from(0)
3231        }
3232    }
3233
3234    impl std::fmt::Display for DeletePolicy {
3235        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3236            wkt::internal::display_enum(f, self.name(), self.value())
3237        }
3238    }
3239
3240    impl std::convert::From<i32> for DeletePolicy {
3241        fn from(value: i32) -> Self {
3242            match value {
3243                0 => Self::Unspecified,
3244                1 => Self::Delete,
3245                2 => Self::Abandon,
3246                _ => Self::UnknownValue(delete_policy::UnknownValue(
3247                    wkt::internal::UnknownEnumValue::Integer(value),
3248                )),
3249            }
3250        }
3251    }
3252
3253    impl std::convert::From<&str> for DeletePolicy {
3254        fn from(value: &str) -> Self {
3255            use std::string::ToString;
3256            match value {
3257                "DELETE_POLICY_UNSPECIFIED" => Self::Unspecified,
3258                "DELETE" => Self::Delete,
3259                "ABANDON" => Self::Abandon,
3260                _ => Self::UnknownValue(delete_policy::UnknownValue(
3261                    wkt::internal::UnknownEnumValue::String(value.to_string()),
3262                )),
3263            }
3264        }
3265    }
3266
3267    impl serde::ser::Serialize for DeletePolicy {
3268        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3269        where
3270            S: serde::Serializer,
3271        {
3272            match self {
3273                Self::Unspecified => serializer.serialize_i32(0),
3274                Self::Delete => serializer.serialize_i32(1),
3275                Self::Abandon => serializer.serialize_i32(2),
3276                Self::UnknownValue(u) => u.0.serialize(serializer),
3277            }
3278        }
3279    }
3280
3281    impl<'de> serde::de::Deserialize<'de> for DeletePolicy {
3282        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3283        where
3284            D: serde::Deserializer<'de>,
3285        {
3286            deserializer.deserialize_any(wkt::internal::EnumVisitor::<DeletePolicy>::new(
3287                ".google.cloud.config.v1.DeleteDeploymentRequest.DeletePolicy",
3288            ))
3289        }
3290    }
3291}
3292
3293/// Represents the metadata of the long-running operation.
3294#[derive(Clone, Default, PartialEq)]
3295#[non_exhaustive]
3296pub struct OperationMetadata {
3297    /// Output only. Time when the operation was created.
3298    pub create_time: std::option::Option<wkt::Timestamp>,
3299
3300    /// Output only. Time when the operation finished running.
3301    pub end_time: std::option::Option<wkt::Timestamp>,
3302
3303    /// Output only. Server-defined resource path for the target of the operation.
3304    pub target: std::string::String,
3305
3306    /// Output only. Name of the verb executed by the operation.
3307    pub verb: std::string::String,
3308
3309    /// Output only. Human-readable status of the operation, if any.
3310    pub status_message: std::string::String,
3311
3312    /// Output only. Identifies whether the user has requested cancellation of the
3313    /// operation. Operations that have successfully been cancelled have
3314    /// [google.longrunning.Operation.error][google.longrunning.Operation.error]
3315    /// value with a [google.rpc.Status.code][google.rpc.Status.code] of `1`,
3316    /// corresponding to `Code.CANCELLED`.
3317    ///
3318    /// [google.longrunning.Operation.error]: google_cloud_longrunning::model::Operation::result
3319    /// [google.rpc.Status.code]: google_cloud_rpc::model::Status::code
3320    pub requested_cancellation: bool,
3321
3322    /// Output only. API version used to start the operation.
3323    pub api_version: std::string::String,
3324
3325    /// Ephemeral metadata about the state of an operation for a particular
3326    /// resource.
3327    pub resource_metadata: std::option::Option<crate::model::operation_metadata::ResourceMetadata>,
3328
3329    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3330}
3331
3332impl OperationMetadata {
3333    pub fn new() -> Self {
3334        std::default::Default::default()
3335    }
3336
3337    /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
3338    ///
3339    /// # Example
3340    /// ```ignore,no_run
3341    /// # use google_cloud_config_v1::model::OperationMetadata;
3342    /// use wkt::Timestamp;
3343    /// let x = OperationMetadata::new().set_create_time(Timestamp::default()/* use setters */);
3344    /// ```
3345    pub fn set_create_time<T>(mut self, v: T) -> Self
3346    where
3347        T: std::convert::Into<wkt::Timestamp>,
3348    {
3349        self.create_time = std::option::Option::Some(v.into());
3350        self
3351    }
3352
3353    /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
3354    ///
3355    /// # Example
3356    /// ```ignore,no_run
3357    /// # use google_cloud_config_v1::model::OperationMetadata;
3358    /// use wkt::Timestamp;
3359    /// let x = OperationMetadata::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
3360    /// let x = OperationMetadata::new().set_or_clear_create_time(None::<Timestamp>);
3361    /// ```
3362    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
3363    where
3364        T: std::convert::Into<wkt::Timestamp>,
3365    {
3366        self.create_time = v.map(|x| x.into());
3367        self
3368    }
3369
3370    /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
3371    ///
3372    /// # Example
3373    /// ```ignore,no_run
3374    /// # use google_cloud_config_v1::model::OperationMetadata;
3375    /// use wkt::Timestamp;
3376    /// let x = OperationMetadata::new().set_end_time(Timestamp::default()/* use setters */);
3377    /// ```
3378    pub fn set_end_time<T>(mut self, v: T) -> Self
3379    where
3380        T: std::convert::Into<wkt::Timestamp>,
3381    {
3382        self.end_time = std::option::Option::Some(v.into());
3383        self
3384    }
3385
3386    /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
3387    ///
3388    /// # Example
3389    /// ```ignore,no_run
3390    /// # use google_cloud_config_v1::model::OperationMetadata;
3391    /// use wkt::Timestamp;
3392    /// let x = OperationMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
3393    /// let x = OperationMetadata::new().set_or_clear_end_time(None::<Timestamp>);
3394    /// ```
3395    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
3396    where
3397        T: std::convert::Into<wkt::Timestamp>,
3398    {
3399        self.end_time = v.map(|x| x.into());
3400        self
3401    }
3402
3403    /// Sets the value of [target][crate::model::OperationMetadata::target].
3404    ///
3405    /// # Example
3406    /// ```ignore,no_run
3407    /// # use google_cloud_config_v1::model::OperationMetadata;
3408    /// let x = OperationMetadata::new().set_target("example");
3409    /// ```
3410    pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3411        self.target = v.into();
3412        self
3413    }
3414
3415    /// Sets the value of [verb][crate::model::OperationMetadata::verb].
3416    ///
3417    /// # Example
3418    /// ```ignore,no_run
3419    /// # use google_cloud_config_v1::model::OperationMetadata;
3420    /// let x = OperationMetadata::new().set_verb("example");
3421    /// ```
3422    pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3423        self.verb = v.into();
3424        self
3425    }
3426
3427    /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
3428    ///
3429    /// # Example
3430    /// ```ignore,no_run
3431    /// # use google_cloud_config_v1::model::OperationMetadata;
3432    /// let x = OperationMetadata::new().set_status_message("example");
3433    /// ```
3434    pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3435        self.status_message = v.into();
3436        self
3437    }
3438
3439    /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
3440    ///
3441    /// # Example
3442    /// ```ignore,no_run
3443    /// # use google_cloud_config_v1::model::OperationMetadata;
3444    /// let x = OperationMetadata::new().set_requested_cancellation(true);
3445    /// ```
3446    pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3447        self.requested_cancellation = v.into();
3448        self
3449    }
3450
3451    /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
3452    ///
3453    /// # Example
3454    /// ```ignore,no_run
3455    /// # use google_cloud_config_v1::model::OperationMetadata;
3456    /// let x = OperationMetadata::new().set_api_version("example");
3457    /// ```
3458    pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3459        self.api_version = v.into();
3460        self
3461    }
3462
3463    /// Sets the value of [resource_metadata][crate::model::OperationMetadata::resource_metadata].
3464    ///
3465    /// Note that all the setters affecting `resource_metadata` are mutually
3466    /// exclusive.
3467    ///
3468    /// # Example
3469    /// ```ignore,no_run
3470    /// # use google_cloud_config_v1::model::OperationMetadata;
3471    /// use google_cloud_config_v1::model::DeploymentOperationMetadata;
3472    /// let x = OperationMetadata::new().set_resource_metadata(Some(
3473    ///     google_cloud_config_v1::model::operation_metadata::ResourceMetadata::DeploymentMetadata(DeploymentOperationMetadata::default().into())));
3474    /// ```
3475    pub fn set_resource_metadata<
3476        T: std::convert::Into<std::option::Option<crate::model::operation_metadata::ResourceMetadata>>,
3477    >(
3478        mut self,
3479        v: T,
3480    ) -> Self {
3481        self.resource_metadata = v.into();
3482        self
3483    }
3484
3485    /// The value of [resource_metadata][crate::model::OperationMetadata::resource_metadata]
3486    /// if it holds a `DeploymentMetadata`, `None` if the field is not set or
3487    /// holds a different branch.
3488    pub fn deployment_metadata(
3489        &self,
3490    ) -> std::option::Option<&std::boxed::Box<crate::model::DeploymentOperationMetadata>> {
3491        #[allow(unreachable_patterns)]
3492        self.resource_metadata.as_ref().and_then(|v| match v {
3493            crate::model::operation_metadata::ResourceMetadata::DeploymentMetadata(v) => {
3494                std::option::Option::Some(v)
3495            }
3496            _ => std::option::Option::None,
3497        })
3498    }
3499
3500    /// Sets the value of [resource_metadata][crate::model::OperationMetadata::resource_metadata]
3501    /// to hold a `DeploymentMetadata`.
3502    ///
3503    /// Note that all the setters affecting `resource_metadata` are
3504    /// mutually exclusive.
3505    ///
3506    /// # Example
3507    /// ```ignore,no_run
3508    /// # use google_cloud_config_v1::model::OperationMetadata;
3509    /// use google_cloud_config_v1::model::DeploymentOperationMetadata;
3510    /// let x = OperationMetadata::new().set_deployment_metadata(DeploymentOperationMetadata::default()/* use setters */);
3511    /// assert!(x.deployment_metadata().is_some());
3512    /// assert!(x.preview_metadata().is_none());
3513    /// assert!(x.provision_deployment_group_metadata().is_none());
3514    /// ```
3515    pub fn set_deployment_metadata<
3516        T: std::convert::Into<std::boxed::Box<crate::model::DeploymentOperationMetadata>>,
3517    >(
3518        mut self,
3519        v: T,
3520    ) -> Self {
3521        self.resource_metadata = std::option::Option::Some(
3522            crate::model::operation_metadata::ResourceMetadata::DeploymentMetadata(v.into()),
3523        );
3524        self
3525    }
3526
3527    /// The value of [resource_metadata][crate::model::OperationMetadata::resource_metadata]
3528    /// if it holds a `PreviewMetadata`, `None` if the field is not set or
3529    /// holds a different branch.
3530    pub fn preview_metadata(
3531        &self,
3532    ) -> std::option::Option<&std::boxed::Box<crate::model::PreviewOperationMetadata>> {
3533        #[allow(unreachable_patterns)]
3534        self.resource_metadata.as_ref().and_then(|v| match v {
3535            crate::model::operation_metadata::ResourceMetadata::PreviewMetadata(v) => {
3536                std::option::Option::Some(v)
3537            }
3538            _ => std::option::Option::None,
3539        })
3540    }
3541
3542    /// Sets the value of [resource_metadata][crate::model::OperationMetadata::resource_metadata]
3543    /// to hold a `PreviewMetadata`.
3544    ///
3545    /// Note that all the setters affecting `resource_metadata` are
3546    /// mutually exclusive.
3547    ///
3548    /// # Example
3549    /// ```ignore,no_run
3550    /// # use google_cloud_config_v1::model::OperationMetadata;
3551    /// use google_cloud_config_v1::model::PreviewOperationMetadata;
3552    /// let x = OperationMetadata::new().set_preview_metadata(PreviewOperationMetadata::default()/* use setters */);
3553    /// assert!(x.preview_metadata().is_some());
3554    /// assert!(x.deployment_metadata().is_none());
3555    /// assert!(x.provision_deployment_group_metadata().is_none());
3556    /// ```
3557    pub fn set_preview_metadata<
3558        T: std::convert::Into<std::boxed::Box<crate::model::PreviewOperationMetadata>>,
3559    >(
3560        mut self,
3561        v: T,
3562    ) -> Self {
3563        self.resource_metadata = std::option::Option::Some(
3564            crate::model::operation_metadata::ResourceMetadata::PreviewMetadata(v.into()),
3565        );
3566        self
3567    }
3568
3569    /// The value of [resource_metadata][crate::model::OperationMetadata::resource_metadata]
3570    /// if it holds a `ProvisionDeploymentGroupMetadata`, `None` if the field is not set or
3571    /// holds a different branch.
3572    pub fn provision_deployment_group_metadata(
3573        &self,
3574    ) -> std::option::Option<
3575        &std::boxed::Box<crate::model::ProvisionDeploymentGroupOperationMetadata>,
3576    > {
3577        #[allow(unreachable_patterns)]
3578        self.resource_metadata.as_ref().and_then(|v| match v {
3579            crate::model::operation_metadata::ResourceMetadata::ProvisionDeploymentGroupMetadata(v) => std::option::Option::Some(v),
3580            _ => std::option::Option::None,
3581        })
3582    }
3583
3584    /// Sets the value of [resource_metadata][crate::model::OperationMetadata::resource_metadata]
3585    /// to hold a `ProvisionDeploymentGroupMetadata`.
3586    ///
3587    /// Note that all the setters affecting `resource_metadata` are
3588    /// mutually exclusive.
3589    ///
3590    /// # Example
3591    /// ```ignore,no_run
3592    /// # use google_cloud_config_v1::model::OperationMetadata;
3593    /// use google_cloud_config_v1::model::ProvisionDeploymentGroupOperationMetadata;
3594    /// let x = OperationMetadata::new().set_provision_deployment_group_metadata(ProvisionDeploymentGroupOperationMetadata::default()/* use setters */);
3595    /// assert!(x.provision_deployment_group_metadata().is_some());
3596    /// assert!(x.deployment_metadata().is_none());
3597    /// assert!(x.preview_metadata().is_none());
3598    /// ```
3599    pub fn set_provision_deployment_group_metadata<
3600        T: std::convert::Into<
3601                std::boxed::Box<crate::model::ProvisionDeploymentGroupOperationMetadata>,
3602            >,
3603    >(
3604        mut self,
3605        v: T,
3606    ) -> Self {
3607        self.resource_metadata = std::option::Option::Some(
3608            crate::model::operation_metadata::ResourceMetadata::ProvisionDeploymentGroupMetadata(
3609                v.into(),
3610            ),
3611        );
3612        self
3613    }
3614}
3615
3616impl wkt::message::Message for OperationMetadata {
3617    fn typename() -> &'static str {
3618        "type.googleapis.com/google.cloud.config.v1.OperationMetadata"
3619    }
3620}
3621
3622/// Defines additional types related to [OperationMetadata].
3623pub mod operation_metadata {
3624    #[allow(unused_imports)]
3625    use super::*;
3626
3627    /// Ephemeral metadata about the state of an operation for a particular
3628    /// resource.
3629    #[derive(Clone, Debug, PartialEq)]
3630    #[non_exhaustive]
3631    pub enum ResourceMetadata {
3632        /// Output only. Metadata about the deployment operation state.
3633        DeploymentMetadata(std::boxed::Box<crate::model::DeploymentOperationMetadata>),
3634        /// Output only. Metadata about the preview operation state.
3635        PreviewMetadata(std::boxed::Box<crate::model::PreviewOperationMetadata>),
3636        /// Output only. Metadata about ProvisionDeploymentGroup operation state.
3637        ProvisionDeploymentGroupMetadata(
3638            std::boxed::Box<crate::model::ProvisionDeploymentGroupOperationMetadata>,
3639        ),
3640    }
3641}
3642
3643/// A child resource of a Deployment generated by a 'CreateDeployment' or
3644/// 'UpdateDeployment' call. Each Revision contains metadata pertaining to a
3645/// snapshot of a particular Deployment.
3646#[derive(Clone, Default, PartialEq)]
3647#[non_exhaustive]
3648pub struct Revision {
3649    /// Revision name. Format:
3650    /// `projects/{project}/locations/{location}/deployments/{deployment}/
3651    /// revisions/{revision}`
3652    pub name: std::string::String,
3653
3654    /// Output only. Time when the revision was created.
3655    pub create_time: std::option::Option<wkt::Timestamp>,
3656
3657    /// Output only. Time when the revision was last modified.
3658    pub update_time: std::option::Option<wkt::Timestamp>,
3659
3660    /// Output only. The action which created this revision
3661    pub action: crate::model::revision::Action,
3662
3663    /// Output only. Current state of the revision.
3664    pub state: crate::model::revision::State,
3665
3666    /// Output only. Outputs and artifacts from applying a deployment.
3667    pub apply_results: std::option::Option<crate::model::ApplyResults>,
3668
3669    /// Output only. Additional info regarding the current state.
3670    pub state_detail: std::string::String,
3671
3672    /// Output only. Code describing any errors that may have occurred.
3673    pub error_code: crate::model::revision::ErrorCode,
3674
3675    /// Output only. Cloud Build instance UUID associated with this revision.
3676    pub build: std::string::String,
3677
3678    /// Output only. Location of Revision operation logs in
3679    /// `gs://{bucket}/{object}` format.
3680    pub logs: std::string::String,
3681
3682    /// Output only. Errors encountered when creating or updating this deployment.
3683    /// Errors are truncated to 10 entries, see `delete_results` and `error_logs`
3684    /// for full details.
3685    pub tf_errors: std::vec::Vec<crate::model::TerraformError>,
3686
3687    /// Output only. Location of Terraform error logs in Google Cloud Storage.
3688    /// Format: `gs://{bucket}/{object}`.
3689    pub error_logs: std::string::String,
3690
3691    /// Output only. User-specified Service Account (SA) to be used as credential
3692    /// to manage resources. Format:
3693    /// `projects/{projectID}/serviceAccounts/{serviceAccount}`
3694    pub service_account: std::string::String,
3695
3696    /// Output only. By default, Infra Manager will return a failure when
3697    /// Terraform encounters a 409 code (resource conflict error) during actuation.
3698    /// If this flag is set to true, Infra Manager will instead
3699    /// attempt to automatically import the resource into the Terraform state (for
3700    /// supported resource types) and continue actuation.
3701    ///
3702    /// Not all resource types are supported, refer to documentation.
3703    pub import_existing_resources: bool,
3704
3705    /// Output only. The user-specified Cloud Build worker pool resource in which
3706    /// the Cloud Build job will execute. Format:
3707    /// `projects/{project}/locations/{location}/workerPools/{workerPoolId}`.
3708    /// If this field is unspecified, the default Cloud Build worker pool will be
3709    /// used.
3710    pub worker_pool: std::string::String,
3711
3712    /// Output only. The user-specified Terraform version constraint.
3713    /// Example: "=1.3.10".
3714    pub tf_version_constraint: std::string::String,
3715
3716    /// Output only. The version of Terraform used to create the Revision.
3717    /// It is in the format of "Major.Minor.Patch", for example, "1.3.10".
3718    pub tf_version: std::string::String,
3719
3720    /// Output only. Cloud Storage path containing quota validation results. This
3721    /// field is set when a user sets Deployment.quota_validation field to ENABLED
3722    /// or ENFORCED. Format: `gs://{bucket}/{object}`.
3723    pub quota_validation_results: std::string::String,
3724
3725    /// Optional. Input to control quota checks for resources in terraform
3726    /// configuration files. There are limited resources on which quota validation
3727    /// applies.
3728    pub quota_validation: crate::model::QuotaValidation,
3729
3730    /// Output only. This field specifies the provider configurations.
3731    pub provider_config: std::option::Option<crate::model::ProviderConfig>,
3732
3733    /// Blueprint that was deployed.
3734    pub blueprint: std::option::Option<crate::model::revision::Blueprint>,
3735
3736    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3737}
3738
3739impl Revision {
3740    pub fn new() -> Self {
3741        std::default::Default::default()
3742    }
3743
3744    /// Sets the value of [name][crate::model::Revision::name].
3745    ///
3746    /// # Example
3747    /// ```ignore,no_run
3748    /// # use google_cloud_config_v1::model::Revision;
3749    /// let x = Revision::new().set_name("example");
3750    /// ```
3751    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3752        self.name = v.into();
3753        self
3754    }
3755
3756    /// Sets the value of [create_time][crate::model::Revision::create_time].
3757    ///
3758    /// # Example
3759    /// ```ignore,no_run
3760    /// # use google_cloud_config_v1::model::Revision;
3761    /// use wkt::Timestamp;
3762    /// let x = Revision::new().set_create_time(Timestamp::default()/* use setters */);
3763    /// ```
3764    pub fn set_create_time<T>(mut self, v: T) -> Self
3765    where
3766        T: std::convert::Into<wkt::Timestamp>,
3767    {
3768        self.create_time = std::option::Option::Some(v.into());
3769        self
3770    }
3771
3772    /// Sets or clears the value of [create_time][crate::model::Revision::create_time].
3773    ///
3774    /// # Example
3775    /// ```ignore,no_run
3776    /// # use google_cloud_config_v1::model::Revision;
3777    /// use wkt::Timestamp;
3778    /// let x = Revision::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
3779    /// let x = Revision::new().set_or_clear_create_time(None::<Timestamp>);
3780    /// ```
3781    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
3782    where
3783        T: std::convert::Into<wkt::Timestamp>,
3784    {
3785        self.create_time = v.map(|x| x.into());
3786        self
3787    }
3788
3789    /// Sets the value of [update_time][crate::model::Revision::update_time].
3790    ///
3791    /// # Example
3792    /// ```ignore,no_run
3793    /// # use google_cloud_config_v1::model::Revision;
3794    /// use wkt::Timestamp;
3795    /// let x = Revision::new().set_update_time(Timestamp::default()/* use setters */);
3796    /// ```
3797    pub fn set_update_time<T>(mut self, v: T) -> Self
3798    where
3799        T: std::convert::Into<wkt::Timestamp>,
3800    {
3801        self.update_time = std::option::Option::Some(v.into());
3802        self
3803    }
3804
3805    /// Sets or clears the value of [update_time][crate::model::Revision::update_time].
3806    ///
3807    /// # Example
3808    /// ```ignore,no_run
3809    /// # use google_cloud_config_v1::model::Revision;
3810    /// use wkt::Timestamp;
3811    /// let x = Revision::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
3812    /// let x = Revision::new().set_or_clear_update_time(None::<Timestamp>);
3813    /// ```
3814    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
3815    where
3816        T: std::convert::Into<wkt::Timestamp>,
3817    {
3818        self.update_time = v.map(|x| x.into());
3819        self
3820    }
3821
3822    /// Sets the value of [action][crate::model::Revision::action].
3823    ///
3824    /// # Example
3825    /// ```ignore,no_run
3826    /// # use google_cloud_config_v1::model::Revision;
3827    /// use google_cloud_config_v1::model::revision::Action;
3828    /// let x0 = Revision::new().set_action(Action::Create);
3829    /// let x1 = Revision::new().set_action(Action::Update);
3830    /// let x2 = Revision::new().set_action(Action::Delete);
3831    /// ```
3832    pub fn set_action<T: std::convert::Into<crate::model::revision::Action>>(
3833        mut self,
3834        v: T,
3835    ) -> Self {
3836        self.action = v.into();
3837        self
3838    }
3839
3840    /// Sets the value of [state][crate::model::Revision::state].
3841    ///
3842    /// # Example
3843    /// ```ignore,no_run
3844    /// # use google_cloud_config_v1::model::Revision;
3845    /// use google_cloud_config_v1::model::revision::State;
3846    /// let x0 = Revision::new().set_state(State::Applying);
3847    /// let x1 = Revision::new().set_state(State::Applied);
3848    /// let x2 = Revision::new().set_state(State::Failed);
3849    /// ```
3850    pub fn set_state<T: std::convert::Into<crate::model::revision::State>>(mut self, v: T) -> Self {
3851        self.state = v.into();
3852        self
3853    }
3854
3855    /// Sets the value of [apply_results][crate::model::Revision::apply_results].
3856    ///
3857    /// # Example
3858    /// ```ignore,no_run
3859    /// # use google_cloud_config_v1::model::Revision;
3860    /// use google_cloud_config_v1::model::ApplyResults;
3861    /// let x = Revision::new().set_apply_results(ApplyResults::default()/* use setters */);
3862    /// ```
3863    pub fn set_apply_results<T>(mut self, v: T) -> Self
3864    where
3865        T: std::convert::Into<crate::model::ApplyResults>,
3866    {
3867        self.apply_results = std::option::Option::Some(v.into());
3868        self
3869    }
3870
3871    /// Sets or clears the value of [apply_results][crate::model::Revision::apply_results].
3872    ///
3873    /// # Example
3874    /// ```ignore,no_run
3875    /// # use google_cloud_config_v1::model::Revision;
3876    /// use google_cloud_config_v1::model::ApplyResults;
3877    /// let x = Revision::new().set_or_clear_apply_results(Some(ApplyResults::default()/* use setters */));
3878    /// let x = Revision::new().set_or_clear_apply_results(None::<ApplyResults>);
3879    /// ```
3880    pub fn set_or_clear_apply_results<T>(mut self, v: std::option::Option<T>) -> Self
3881    where
3882        T: std::convert::Into<crate::model::ApplyResults>,
3883    {
3884        self.apply_results = v.map(|x| x.into());
3885        self
3886    }
3887
3888    /// Sets the value of [state_detail][crate::model::Revision::state_detail].
3889    ///
3890    /// # Example
3891    /// ```ignore,no_run
3892    /// # use google_cloud_config_v1::model::Revision;
3893    /// let x = Revision::new().set_state_detail("example");
3894    /// ```
3895    pub fn set_state_detail<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3896        self.state_detail = v.into();
3897        self
3898    }
3899
3900    /// Sets the value of [error_code][crate::model::Revision::error_code].
3901    ///
3902    /// # Example
3903    /// ```ignore,no_run
3904    /// # use google_cloud_config_v1::model::Revision;
3905    /// use google_cloud_config_v1::model::revision::ErrorCode;
3906    /// let x0 = Revision::new().set_error_code(ErrorCode::CloudBuildPermissionDenied);
3907    /// let x1 = Revision::new().set_error_code(ErrorCode::ApplyBuildApiFailed);
3908    /// let x2 = Revision::new().set_error_code(ErrorCode::ApplyBuildRunFailed);
3909    /// ```
3910    pub fn set_error_code<T: std::convert::Into<crate::model::revision::ErrorCode>>(
3911        mut self,
3912        v: T,
3913    ) -> Self {
3914        self.error_code = v.into();
3915        self
3916    }
3917
3918    /// Sets the value of [build][crate::model::Revision::build].
3919    ///
3920    /// # Example
3921    /// ```ignore,no_run
3922    /// # use google_cloud_config_v1::model::Revision;
3923    /// let x = Revision::new().set_build("example");
3924    /// ```
3925    pub fn set_build<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3926        self.build = v.into();
3927        self
3928    }
3929
3930    /// Sets the value of [logs][crate::model::Revision::logs].
3931    ///
3932    /// # Example
3933    /// ```ignore,no_run
3934    /// # use google_cloud_config_v1::model::Revision;
3935    /// let x = Revision::new().set_logs("example");
3936    /// ```
3937    pub fn set_logs<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3938        self.logs = v.into();
3939        self
3940    }
3941
3942    /// Sets the value of [tf_errors][crate::model::Revision::tf_errors].
3943    ///
3944    /// # Example
3945    /// ```ignore,no_run
3946    /// # use google_cloud_config_v1::model::Revision;
3947    /// use google_cloud_config_v1::model::TerraformError;
3948    /// let x = Revision::new()
3949    ///     .set_tf_errors([
3950    ///         TerraformError::default()/* use setters */,
3951    ///         TerraformError::default()/* use (different) setters */,
3952    ///     ]);
3953    /// ```
3954    pub fn set_tf_errors<T, V>(mut self, v: T) -> Self
3955    where
3956        T: std::iter::IntoIterator<Item = V>,
3957        V: std::convert::Into<crate::model::TerraformError>,
3958    {
3959        use std::iter::Iterator;
3960        self.tf_errors = v.into_iter().map(|i| i.into()).collect();
3961        self
3962    }
3963
3964    /// Sets the value of [error_logs][crate::model::Revision::error_logs].
3965    ///
3966    /// # Example
3967    /// ```ignore,no_run
3968    /// # use google_cloud_config_v1::model::Revision;
3969    /// let x = Revision::new().set_error_logs("example");
3970    /// ```
3971    pub fn set_error_logs<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3972        self.error_logs = v.into();
3973        self
3974    }
3975
3976    /// Sets the value of [service_account][crate::model::Revision::service_account].
3977    ///
3978    /// # Example
3979    /// ```ignore,no_run
3980    /// # use google_cloud_config_v1::model::Revision;
3981    /// let x = Revision::new().set_service_account("example");
3982    /// ```
3983    pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3984        self.service_account = v.into();
3985        self
3986    }
3987
3988    /// Sets the value of [import_existing_resources][crate::model::Revision::import_existing_resources].
3989    ///
3990    /// # Example
3991    /// ```ignore,no_run
3992    /// # use google_cloud_config_v1::model::Revision;
3993    /// let x = Revision::new().set_import_existing_resources(true);
3994    /// ```
3995    pub fn set_import_existing_resources<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3996        self.import_existing_resources = v.into();
3997        self
3998    }
3999
4000    /// Sets the value of [worker_pool][crate::model::Revision::worker_pool].
4001    ///
4002    /// # Example
4003    /// ```ignore,no_run
4004    /// # use google_cloud_config_v1::model::Revision;
4005    /// let x = Revision::new().set_worker_pool("example");
4006    /// ```
4007    pub fn set_worker_pool<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4008        self.worker_pool = v.into();
4009        self
4010    }
4011
4012    /// Sets the value of [tf_version_constraint][crate::model::Revision::tf_version_constraint].
4013    ///
4014    /// # Example
4015    /// ```ignore,no_run
4016    /// # use google_cloud_config_v1::model::Revision;
4017    /// let x = Revision::new().set_tf_version_constraint("example");
4018    /// ```
4019    pub fn set_tf_version_constraint<T: std::convert::Into<std::string::String>>(
4020        mut self,
4021        v: T,
4022    ) -> Self {
4023        self.tf_version_constraint = v.into();
4024        self
4025    }
4026
4027    /// Sets the value of [tf_version][crate::model::Revision::tf_version].
4028    ///
4029    /// # Example
4030    /// ```ignore,no_run
4031    /// # use google_cloud_config_v1::model::Revision;
4032    /// let x = Revision::new().set_tf_version("example");
4033    /// ```
4034    pub fn set_tf_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4035        self.tf_version = v.into();
4036        self
4037    }
4038
4039    /// Sets the value of [quota_validation_results][crate::model::Revision::quota_validation_results].
4040    ///
4041    /// # Example
4042    /// ```ignore,no_run
4043    /// # use google_cloud_config_v1::model::Revision;
4044    /// let x = Revision::new().set_quota_validation_results("example");
4045    /// ```
4046    pub fn set_quota_validation_results<T: std::convert::Into<std::string::String>>(
4047        mut self,
4048        v: T,
4049    ) -> Self {
4050        self.quota_validation_results = v.into();
4051        self
4052    }
4053
4054    /// Sets the value of [quota_validation][crate::model::Revision::quota_validation].
4055    ///
4056    /// # Example
4057    /// ```ignore,no_run
4058    /// # use google_cloud_config_v1::model::Revision;
4059    /// use google_cloud_config_v1::model::QuotaValidation;
4060    /// let x0 = Revision::new().set_quota_validation(QuotaValidation::Enabled);
4061    /// let x1 = Revision::new().set_quota_validation(QuotaValidation::Enforced);
4062    /// ```
4063    pub fn set_quota_validation<T: std::convert::Into<crate::model::QuotaValidation>>(
4064        mut self,
4065        v: T,
4066    ) -> Self {
4067        self.quota_validation = v.into();
4068        self
4069    }
4070
4071    /// Sets the value of [provider_config][crate::model::Revision::provider_config].
4072    ///
4073    /// # Example
4074    /// ```ignore,no_run
4075    /// # use google_cloud_config_v1::model::Revision;
4076    /// use google_cloud_config_v1::model::ProviderConfig;
4077    /// let x = Revision::new().set_provider_config(ProviderConfig::default()/* use setters */);
4078    /// ```
4079    pub fn set_provider_config<T>(mut self, v: T) -> Self
4080    where
4081        T: std::convert::Into<crate::model::ProviderConfig>,
4082    {
4083        self.provider_config = std::option::Option::Some(v.into());
4084        self
4085    }
4086
4087    /// Sets or clears the value of [provider_config][crate::model::Revision::provider_config].
4088    ///
4089    /// # Example
4090    /// ```ignore,no_run
4091    /// # use google_cloud_config_v1::model::Revision;
4092    /// use google_cloud_config_v1::model::ProviderConfig;
4093    /// let x = Revision::new().set_or_clear_provider_config(Some(ProviderConfig::default()/* use setters */));
4094    /// let x = Revision::new().set_or_clear_provider_config(None::<ProviderConfig>);
4095    /// ```
4096    pub fn set_or_clear_provider_config<T>(mut self, v: std::option::Option<T>) -> Self
4097    where
4098        T: std::convert::Into<crate::model::ProviderConfig>,
4099    {
4100        self.provider_config = v.map(|x| x.into());
4101        self
4102    }
4103
4104    /// Sets the value of [blueprint][crate::model::Revision::blueprint].
4105    ///
4106    /// Note that all the setters affecting `blueprint` are mutually
4107    /// exclusive.
4108    ///
4109    /// # Example
4110    /// ```ignore,no_run
4111    /// # use google_cloud_config_v1::model::Revision;
4112    /// use google_cloud_config_v1::model::TerraformBlueprint;
4113    /// let x = Revision::new().set_blueprint(Some(
4114    ///     google_cloud_config_v1::model::revision::Blueprint::TerraformBlueprint(TerraformBlueprint::default().into())));
4115    /// ```
4116    pub fn set_blueprint<
4117        T: std::convert::Into<std::option::Option<crate::model::revision::Blueprint>>,
4118    >(
4119        mut self,
4120        v: T,
4121    ) -> Self {
4122        self.blueprint = v.into();
4123        self
4124    }
4125
4126    /// The value of [blueprint][crate::model::Revision::blueprint]
4127    /// if it holds a `TerraformBlueprint`, `None` if the field is not set or
4128    /// holds a different branch.
4129    pub fn terraform_blueprint(
4130        &self,
4131    ) -> std::option::Option<&std::boxed::Box<crate::model::TerraformBlueprint>> {
4132        #[allow(unreachable_patterns)]
4133        self.blueprint.as_ref().and_then(|v| match v {
4134            crate::model::revision::Blueprint::TerraformBlueprint(v) => {
4135                std::option::Option::Some(v)
4136            }
4137            _ => std::option::Option::None,
4138        })
4139    }
4140
4141    /// Sets the value of [blueprint][crate::model::Revision::blueprint]
4142    /// to hold a `TerraformBlueprint`.
4143    ///
4144    /// Note that all the setters affecting `blueprint` are
4145    /// mutually exclusive.
4146    ///
4147    /// # Example
4148    /// ```ignore,no_run
4149    /// # use google_cloud_config_v1::model::Revision;
4150    /// use google_cloud_config_v1::model::TerraformBlueprint;
4151    /// let x = Revision::new().set_terraform_blueprint(TerraformBlueprint::default()/* use setters */);
4152    /// assert!(x.terraform_blueprint().is_some());
4153    /// ```
4154    pub fn set_terraform_blueprint<
4155        T: std::convert::Into<std::boxed::Box<crate::model::TerraformBlueprint>>,
4156    >(
4157        mut self,
4158        v: T,
4159    ) -> Self {
4160        self.blueprint = std::option::Option::Some(
4161            crate::model::revision::Blueprint::TerraformBlueprint(v.into()),
4162        );
4163        self
4164    }
4165}
4166
4167impl wkt::message::Message for Revision {
4168    fn typename() -> &'static str {
4169        "type.googleapis.com/google.cloud.config.v1.Revision"
4170    }
4171}
4172
4173/// Defines additional types related to [Revision].
4174pub mod revision {
4175    #[allow(unused_imports)]
4176    use super::*;
4177
4178    /// Actions that generate a revision.
4179    ///
4180    /// # Working with unknown values
4181    ///
4182    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4183    /// additional enum variants at any time. Adding new variants is not considered
4184    /// a breaking change. Applications should write their code in anticipation of:
4185    ///
4186    /// - New values appearing in future releases of the client library, **and**
4187    /// - New values received dynamically, without application changes.
4188    ///
4189    /// Please consult the [Working with enums] section in the user guide for some
4190    /// guidelines.
4191    ///
4192    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
4193    #[derive(Clone, Debug, PartialEq)]
4194    #[non_exhaustive]
4195    pub enum Action {
4196        /// The default value. This value is used if the action is omitted.
4197        Unspecified,
4198        /// The revision was generated by creating a deployment.
4199        Create,
4200        /// The revision was generated by updating a deployment.
4201        Update,
4202        /// The revision was deleted.
4203        Delete,
4204        /// If set, the enum was initialized with an unknown value.
4205        ///
4206        /// Applications can examine the value using [Action::value] or
4207        /// [Action::name].
4208        UnknownValue(action::UnknownValue),
4209    }
4210
4211    #[doc(hidden)]
4212    pub mod action {
4213        #[allow(unused_imports)]
4214        use super::*;
4215        #[derive(Clone, Debug, PartialEq)]
4216        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4217    }
4218
4219    impl Action {
4220        /// Gets the enum value.
4221        ///
4222        /// Returns `None` if the enum contains an unknown value deserialized from
4223        /// the string representation of enums.
4224        pub fn value(&self) -> std::option::Option<i32> {
4225            match self {
4226                Self::Unspecified => std::option::Option::Some(0),
4227                Self::Create => std::option::Option::Some(1),
4228                Self::Update => std::option::Option::Some(2),
4229                Self::Delete => std::option::Option::Some(3),
4230                Self::UnknownValue(u) => u.0.value(),
4231            }
4232        }
4233
4234        /// Gets the enum value as a string.
4235        ///
4236        /// Returns `None` if the enum contains an unknown value deserialized from
4237        /// the integer representation of enums.
4238        pub fn name(&self) -> std::option::Option<&str> {
4239            match self {
4240                Self::Unspecified => std::option::Option::Some("ACTION_UNSPECIFIED"),
4241                Self::Create => std::option::Option::Some("CREATE"),
4242                Self::Update => std::option::Option::Some("UPDATE"),
4243                Self::Delete => std::option::Option::Some("DELETE"),
4244                Self::UnknownValue(u) => u.0.name(),
4245            }
4246        }
4247    }
4248
4249    impl std::default::Default for Action {
4250        fn default() -> Self {
4251            use std::convert::From;
4252            Self::from(0)
4253        }
4254    }
4255
4256    impl std::fmt::Display for Action {
4257        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4258            wkt::internal::display_enum(f, self.name(), self.value())
4259        }
4260    }
4261
4262    impl std::convert::From<i32> for Action {
4263        fn from(value: i32) -> Self {
4264            match value {
4265                0 => Self::Unspecified,
4266                1 => Self::Create,
4267                2 => Self::Update,
4268                3 => Self::Delete,
4269                _ => Self::UnknownValue(action::UnknownValue(
4270                    wkt::internal::UnknownEnumValue::Integer(value),
4271                )),
4272            }
4273        }
4274    }
4275
4276    impl std::convert::From<&str> for Action {
4277        fn from(value: &str) -> Self {
4278            use std::string::ToString;
4279            match value {
4280                "ACTION_UNSPECIFIED" => Self::Unspecified,
4281                "CREATE" => Self::Create,
4282                "UPDATE" => Self::Update,
4283                "DELETE" => Self::Delete,
4284                _ => Self::UnknownValue(action::UnknownValue(
4285                    wkt::internal::UnknownEnumValue::String(value.to_string()),
4286                )),
4287            }
4288        }
4289    }
4290
4291    impl serde::ser::Serialize for Action {
4292        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4293        where
4294            S: serde::Serializer,
4295        {
4296            match self {
4297                Self::Unspecified => serializer.serialize_i32(0),
4298                Self::Create => serializer.serialize_i32(1),
4299                Self::Update => serializer.serialize_i32(2),
4300                Self::Delete => serializer.serialize_i32(3),
4301                Self::UnknownValue(u) => u.0.serialize(serializer),
4302            }
4303        }
4304    }
4305
4306    impl<'de> serde::de::Deserialize<'de> for Action {
4307        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4308        where
4309            D: serde::Deserializer<'de>,
4310        {
4311            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Action>::new(
4312                ".google.cloud.config.v1.Revision.Action",
4313            ))
4314        }
4315    }
4316
4317    /// Possible states of a revision.
4318    ///
4319    /// # Working with unknown values
4320    ///
4321    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4322    /// additional enum variants at any time. Adding new variants is not considered
4323    /// a breaking change. Applications should write their code in anticipation of:
4324    ///
4325    /// - New values appearing in future releases of the client library, **and**
4326    /// - New values received dynamically, without application changes.
4327    ///
4328    /// Please consult the [Working with enums] section in the user guide for some
4329    /// guidelines.
4330    ///
4331    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
4332    #[derive(Clone, Debug, PartialEq)]
4333    #[non_exhaustive]
4334    pub enum State {
4335        /// The default value. This value is used if the state is omitted.
4336        Unspecified,
4337        /// The revision is being applied.
4338        Applying,
4339        /// The revision was applied successfully.
4340        Applied,
4341        /// The revision could not be applied successfully.
4342        Failed,
4343        /// If set, the enum was initialized with an unknown value.
4344        ///
4345        /// Applications can examine the value using [State::value] or
4346        /// [State::name].
4347        UnknownValue(state::UnknownValue),
4348    }
4349
4350    #[doc(hidden)]
4351    pub mod state {
4352        #[allow(unused_imports)]
4353        use super::*;
4354        #[derive(Clone, Debug, PartialEq)]
4355        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4356    }
4357
4358    impl State {
4359        /// Gets the enum value.
4360        ///
4361        /// Returns `None` if the enum contains an unknown value deserialized from
4362        /// the string representation of enums.
4363        pub fn value(&self) -> std::option::Option<i32> {
4364            match self {
4365                Self::Unspecified => std::option::Option::Some(0),
4366                Self::Applying => std::option::Option::Some(1),
4367                Self::Applied => std::option::Option::Some(2),
4368                Self::Failed => std::option::Option::Some(3),
4369                Self::UnknownValue(u) => u.0.value(),
4370            }
4371        }
4372
4373        /// Gets the enum value as a string.
4374        ///
4375        /// Returns `None` if the enum contains an unknown value deserialized from
4376        /// the integer representation of enums.
4377        pub fn name(&self) -> std::option::Option<&str> {
4378            match self {
4379                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
4380                Self::Applying => std::option::Option::Some("APPLYING"),
4381                Self::Applied => std::option::Option::Some("APPLIED"),
4382                Self::Failed => std::option::Option::Some("FAILED"),
4383                Self::UnknownValue(u) => u.0.name(),
4384            }
4385        }
4386    }
4387
4388    impl std::default::Default for State {
4389        fn default() -> Self {
4390            use std::convert::From;
4391            Self::from(0)
4392        }
4393    }
4394
4395    impl std::fmt::Display for State {
4396        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4397            wkt::internal::display_enum(f, self.name(), self.value())
4398        }
4399    }
4400
4401    impl std::convert::From<i32> for State {
4402        fn from(value: i32) -> Self {
4403            match value {
4404                0 => Self::Unspecified,
4405                1 => Self::Applying,
4406                2 => Self::Applied,
4407                3 => Self::Failed,
4408                _ => Self::UnknownValue(state::UnknownValue(
4409                    wkt::internal::UnknownEnumValue::Integer(value),
4410                )),
4411            }
4412        }
4413    }
4414
4415    impl std::convert::From<&str> for State {
4416        fn from(value: &str) -> Self {
4417            use std::string::ToString;
4418            match value {
4419                "STATE_UNSPECIFIED" => Self::Unspecified,
4420                "APPLYING" => Self::Applying,
4421                "APPLIED" => Self::Applied,
4422                "FAILED" => Self::Failed,
4423                _ => Self::UnknownValue(state::UnknownValue(
4424                    wkt::internal::UnknownEnumValue::String(value.to_string()),
4425                )),
4426            }
4427        }
4428    }
4429
4430    impl serde::ser::Serialize for State {
4431        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4432        where
4433            S: serde::Serializer,
4434        {
4435            match self {
4436                Self::Unspecified => serializer.serialize_i32(0),
4437                Self::Applying => serializer.serialize_i32(1),
4438                Self::Applied => serializer.serialize_i32(2),
4439                Self::Failed => serializer.serialize_i32(3),
4440                Self::UnknownValue(u) => u.0.serialize(serializer),
4441            }
4442        }
4443    }
4444
4445    impl<'de> serde::de::Deserialize<'de> for State {
4446        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4447        where
4448            D: serde::Deserializer<'de>,
4449        {
4450            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
4451                ".google.cloud.config.v1.Revision.State",
4452            ))
4453        }
4454    }
4455
4456    /// Possible errors if Revision could not be created or updated successfully.
4457    ///
4458    /// # Working with unknown values
4459    ///
4460    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4461    /// additional enum variants at any time. Adding new variants is not considered
4462    /// a breaking change. Applications should write their code in anticipation of:
4463    ///
4464    /// - New values appearing in future releases of the client library, **and**
4465    /// - New values received dynamically, without application changes.
4466    ///
4467    /// Please consult the [Working with enums] section in the user guide for some
4468    /// guidelines.
4469    ///
4470    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
4471    #[derive(Clone, Debug, PartialEq)]
4472    #[non_exhaustive]
4473    pub enum ErrorCode {
4474        /// No error code was specified.
4475        Unspecified,
4476        /// Cloud Build failed due to a permission issue.
4477        CloudBuildPermissionDenied,
4478        /// Cloud Build job associated with creating or updating a deployment could
4479        /// not be started.
4480        ApplyBuildApiFailed,
4481        /// Cloud Build job associated with creating or updating a deployment was
4482        /// started but failed.
4483        ApplyBuildRunFailed,
4484        /// quota validation failed for one or more resources in terraform
4485        /// configuration files.
4486        QuotaValidationFailed,
4487        /// Failed to import values from an external source.
4488        ExternalValueSourceImportFailed,
4489        /// If set, the enum was initialized with an unknown value.
4490        ///
4491        /// Applications can examine the value using [ErrorCode::value] or
4492        /// [ErrorCode::name].
4493        UnknownValue(error_code::UnknownValue),
4494    }
4495
4496    #[doc(hidden)]
4497    pub mod error_code {
4498        #[allow(unused_imports)]
4499        use super::*;
4500        #[derive(Clone, Debug, PartialEq)]
4501        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4502    }
4503
4504    impl ErrorCode {
4505        /// Gets the enum value.
4506        ///
4507        /// Returns `None` if the enum contains an unknown value deserialized from
4508        /// the string representation of enums.
4509        pub fn value(&self) -> std::option::Option<i32> {
4510            match self {
4511                Self::Unspecified => std::option::Option::Some(0),
4512                Self::CloudBuildPermissionDenied => std::option::Option::Some(1),
4513                Self::ApplyBuildApiFailed => std::option::Option::Some(4),
4514                Self::ApplyBuildRunFailed => std::option::Option::Some(5),
4515                Self::QuotaValidationFailed => std::option::Option::Some(7),
4516                Self::ExternalValueSourceImportFailed => std::option::Option::Some(8),
4517                Self::UnknownValue(u) => u.0.value(),
4518            }
4519        }
4520
4521        /// Gets the enum value as a string.
4522        ///
4523        /// Returns `None` if the enum contains an unknown value deserialized from
4524        /// the integer representation of enums.
4525        pub fn name(&self) -> std::option::Option<&str> {
4526            match self {
4527                Self::Unspecified => std::option::Option::Some("ERROR_CODE_UNSPECIFIED"),
4528                Self::CloudBuildPermissionDenied => {
4529                    std::option::Option::Some("CLOUD_BUILD_PERMISSION_DENIED")
4530                }
4531                Self::ApplyBuildApiFailed => std::option::Option::Some("APPLY_BUILD_API_FAILED"),
4532                Self::ApplyBuildRunFailed => std::option::Option::Some("APPLY_BUILD_RUN_FAILED"),
4533                Self::QuotaValidationFailed => std::option::Option::Some("QUOTA_VALIDATION_FAILED"),
4534                Self::ExternalValueSourceImportFailed => {
4535                    std::option::Option::Some("EXTERNAL_VALUE_SOURCE_IMPORT_FAILED")
4536                }
4537                Self::UnknownValue(u) => u.0.name(),
4538            }
4539        }
4540    }
4541
4542    impl std::default::Default for ErrorCode {
4543        fn default() -> Self {
4544            use std::convert::From;
4545            Self::from(0)
4546        }
4547    }
4548
4549    impl std::fmt::Display for ErrorCode {
4550        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4551            wkt::internal::display_enum(f, self.name(), self.value())
4552        }
4553    }
4554
4555    impl std::convert::From<i32> for ErrorCode {
4556        fn from(value: i32) -> Self {
4557            match value {
4558                0 => Self::Unspecified,
4559                1 => Self::CloudBuildPermissionDenied,
4560                4 => Self::ApplyBuildApiFailed,
4561                5 => Self::ApplyBuildRunFailed,
4562                7 => Self::QuotaValidationFailed,
4563                8 => Self::ExternalValueSourceImportFailed,
4564                _ => Self::UnknownValue(error_code::UnknownValue(
4565                    wkt::internal::UnknownEnumValue::Integer(value),
4566                )),
4567            }
4568        }
4569    }
4570
4571    impl std::convert::From<&str> for ErrorCode {
4572        fn from(value: &str) -> Self {
4573            use std::string::ToString;
4574            match value {
4575                "ERROR_CODE_UNSPECIFIED" => Self::Unspecified,
4576                "CLOUD_BUILD_PERMISSION_DENIED" => Self::CloudBuildPermissionDenied,
4577                "APPLY_BUILD_API_FAILED" => Self::ApplyBuildApiFailed,
4578                "APPLY_BUILD_RUN_FAILED" => Self::ApplyBuildRunFailed,
4579                "QUOTA_VALIDATION_FAILED" => Self::QuotaValidationFailed,
4580                "EXTERNAL_VALUE_SOURCE_IMPORT_FAILED" => Self::ExternalValueSourceImportFailed,
4581                _ => Self::UnknownValue(error_code::UnknownValue(
4582                    wkt::internal::UnknownEnumValue::String(value.to_string()),
4583                )),
4584            }
4585        }
4586    }
4587
4588    impl serde::ser::Serialize for ErrorCode {
4589        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4590        where
4591            S: serde::Serializer,
4592        {
4593            match self {
4594                Self::Unspecified => serializer.serialize_i32(0),
4595                Self::CloudBuildPermissionDenied => serializer.serialize_i32(1),
4596                Self::ApplyBuildApiFailed => serializer.serialize_i32(4),
4597                Self::ApplyBuildRunFailed => serializer.serialize_i32(5),
4598                Self::QuotaValidationFailed => serializer.serialize_i32(7),
4599                Self::ExternalValueSourceImportFailed => serializer.serialize_i32(8),
4600                Self::UnknownValue(u) => u.0.serialize(serializer),
4601            }
4602        }
4603    }
4604
4605    impl<'de> serde::de::Deserialize<'de> for ErrorCode {
4606        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4607        where
4608            D: serde::Deserializer<'de>,
4609        {
4610            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ErrorCode>::new(
4611                ".google.cloud.config.v1.Revision.ErrorCode",
4612            ))
4613        }
4614    }
4615
4616    /// Blueprint that was deployed.
4617    #[derive(Clone, Debug, PartialEq)]
4618    #[non_exhaustive]
4619    pub enum Blueprint {
4620        /// Output only. A blueprint described using Terraform's HashiCorp
4621        /// Configuration Language as a root module.
4622        TerraformBlueprint(std::boxed::Box<crate::model::TerraformBlueprint>),
4623    }
4624}
4625
4626/// Errors encountered during actuation using Terraform
4627#[derive(Clone, Default, PartialEq)]
4628#[non_exhaustive]
4629pub struct TerraformError {
4630    /// Address of the resource associated with the error,
4631    /// e.g. `google_compute_network.vpc_network`.
4632    pub resource_address: std::string::String,
4633
4634    /// HTTP response code returned from Google Cloud Platform APIs when Terraform
4635    /// fails to provision the resource. If unset or 0, no HTTP response code was
4636    /// returned by Terraform.
4637    pub http_response_code: i32,
4638
4639    /// A human-readable error description.
4640    pub error_description: std::string::String,
4641
4642    /// Output only. Original error response from underlying Google API, if
4643    /// available.
4644    pub error: std::option::Option<google_cloud_rpc::model::Status>,
4645
4646    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4647}
4648
4649impl TerraformError {
4650    pub fn new() -> Self {
4651        std::default::Default::default()
4652    }
4653
4654    /// Sets the value of [resource_address][crate::model::TerraformError::resource_address].
4655    ///
4656    /// # Example
4657    /// ```ignore,no_run
4658    /// # use google_cloud_config_v1::model::TerraformError;
4659    /// let x = TerraformError::new().set_resource_address("example");
4660    /// ```
4661    pub fn set_resource_address<T: std::convert::Into<std::string::String>>(
4662        mut self,
4663        v: T,
4664    ) -> Self {
4665        self.resource_address = v.into();
4666        self
4667    }
4668
4669    /// Sets the value of [http_response_code][crate::model::TerraformError::http_response_code].
4670    ///
4671    /// # Example
4672    /// ```ignore,no_run
4673    /// # use google_cloud_config_v1::model::TerraformError;
4674    /// let x = TerraformError::new().set_http_response_code(42);
4675    /// ```
4676    pub fn set_http_response_code<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4677        self.http_response_code = v.into();
4678        self
4679    }
4680
4681    /// Sets the value of [error_description][crate::model::TerraformError::error_description].
4682    ///
4683    /// # Example
4684    /// ```ignore,no_run
4685    /// # use google_cloud_config_v1::model::TerraformError;
4686    /// let x = TerraformError::new().set_error_description("example");
4687    /// ```
4688    pub fn set_error_description<T: std::convert::Into<std::string::String>>(
4689        mut self,
4690        v: T,
4691    ) -> Self {
4692        self.error_description = v.into();
4693        self
4694    }
4695
4696    /// Sets the value of [error][crate::model::TerraformError::error].
4697    ///
4698    /// # Example
4699    /// ```ignore,no_run
4700    /// # use google_cloud_config_v1::model::TerraformError;
4701    /// use google_cloud_rpc::model::Status;
4702    /// let x = TerraformError::new().set_error(Status::default()/* use setters */);
4703    /// ```
4704    pub fn set_error<T>(mut self, v: T) -> Self
4705    where
4706        T: std::convert::Into<google_cloud_rpc::model::Status>,
4707    {
4708        self.error = std::option::Option::Some(v.into());
4709        self
4710    }
4711
4712    /// Sets or clears the value of [error][crate::model::TerraformError::error].
4713    ///
4714    /// # Example
4715    /// ```ignore,no_run
4716    /// # use google_cloud_config_v1::model::TerraformError;
4717    /// use google_cloud_rpc::model::Status;
4718    /// let x = TerraformError::new().set_or_clear_error(Some(Status::default()/* use setters */));
4719    /// let x = TerraformError::new().set_or_clear_error(None::<Status>);
4720    /// ```
4721    pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
4722    where
4723        T: std::convert::Into<google_cloud_rpc::model::Status>,
4724    {
4725        self.error = v.map(|x| x.into());
4726        self
4727    }
4728}
4729
4730impl wkt::message::Message for TerraformError {
4731    fn typename() -> &'static str {
4732        "type.googleapis.com/google.cloud.config.v1.TerraformError"
4733    }
4734}
4735
4736/// A set of files in a Git repository.
4737#[derive(Clone, Default, PartialEq)]
4738#[non_exhaustive]
4739pub struct GitSource {
4740    /// Optional. Repository URL.
4741    /// Example: '<https://github.com/kubernetes/examples.git>'
4742    pub repo: std::option::Option<std::string::String>,
4743
4744    /// Optional. Subdirectory inside the repository.
4745    /// Example: 'staging/my-package'
4746    pub directory: std::option::Option<std::string::String>,
4747
4748    /// Optional. Git reference (e.g. branch or tag).
4749    pub r#ref: std::option::Option<std::string::String>,
4750
4751    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4752}
4753
4754impl GitSource {
4755    pub fn new() -> Self {
4756        std::default::Default::default()
4757    }
4758
4759    /// Sets the value of [repo][crate::model::GitSource::repo].
4760    ///
4761    /// # Example
4762    /// ```ignore,no_run
4763    /// # use google_cloud_config_v1::model::GitSource;
4764    /// let x = GitSource::new().set_repo("example");
4765    /// ```
4766    pub fn set_repo<T>(mut self, v: T) -> Self
4767    where
4768        T: std::convert::Into<std::string::String>,
4769    {
4770        self.repo = std::option::Option::Some(v.into());
4771        self
4772    }
4773
4774    /// Sets or clears the value of [repo][crate::model::GitSource::repo].
4775    ///
4776    /// # Example
4777    /// ```ignore,no_run
4778    /// # use google_cloud_config_v1::model::GitSource;
4779    /// let x = GitSource::new().set_or_clear_repo(Some("example"));
4780    /// let x = GitSource::new().set_or_clear_repo(None::<String>);
4781    /// ```
4782    pub fn set_or_clear_repo<T>(mut self, v: std::option::Option<T>) -> Self
4783    where
4784        T: std::convert::Into<std::string::String>,
4785    {
4786        self.repo = v.map(|x| x.into());
4787        self
4788    }
4789
4790    /// Sets the value of [directory][crate::model::GitSource::directory].
4791    ///
4792    /// # Example
4793    /// ```ignore,no_run
4794    /// # use google_cloud_config_v1::model::GitSource;
4795    /// let x = GitSource::new().set_directory("example");
4796    /// ```
4797    pub fn set_directory<T>(mut self, v: T) -> Self
4798    where
4799        T: std::convert::Into<std::string::String>,
4800    {
4801        self.directory = std::option::Option::Some(v.into());
4802        self
4803    }
4804
4805    /// Sets or clears the value of [directory][crate::model::GitSource::directory].
4806    ///
4807    /// # Example
4808    /// ```ignore,no_run
4809    /// # use google_cloud_config_v1::model::GitSource;
4810    /// let x = GitSource::new().set_or_clear_directory(Some("example"));
4811    /// let x = GitSource::new().set_or_clear_directory(None::<String>);
4812    /// ```
4813    pub fn set_or_clear_directory<T>(mut self, v: std::option::Option<T>) -> Self
4814    where
4815        T: std::convert::Into<std::string::String>,
4816    {
4817        self.directory = v.map(|x| x.into());
4818        self
4819    }
4820
4821    /// Sets the value of [r#ref][crate::model::GitSource::ref].
4822    ///
4823    /// # Example
4824    /// ```ignore,no_run
4825    /// # use google_cloud_config_v1::model::GitSource;
4826    /// let x = GitSource::new().set_ref("example");
4827    /// ```
4828    pub fn set_ref<T>(mut self, v: T) -> Self
4829    where
4830        T: std::convert::Into<std::string::String>,
4831    {
4832        self.r#ref = std::option::Option::Some(v.into());
4833        self
4834    }
4835
4836    /// Sets or clears the value of [r#ref][crate::model::GitSource::ref].
4837    ///
4838    /// # Example
4839    /// ```ignore,no_run
4840    /// # use google_cloud_config_v1::model::GitSource;
4841    /// let x = GitSource::new().set_or_clear_ref(Some("example"));
4842    /// let x = GitSource::new().set_or_clear_ref(None::<String>);
4843    /// ```
4844    pub fn set_or_clear_ref<T>(mut self, v: std::option::Option<T>) -> Self
4845    where
4846        T: std::convert::Into<std::string::String>,
4847    {
4848        self.r#ref = v.map(|x| x.into());
4849        self
4850    }
4851}
4852
4853impl wkt::message::Message for GitSource {
4854    fn typename() -> &'static str {
4855        "type.googleapis.com/google.cloud.config.v1.GitSource"
4856    }
4857}
4858
4859/// Ephemeral metadata content describing the state of a deployment operation.
4860#[derive(Clone, Default, PartialEq)]
4861#[non_exhaustive]
4862pub struct DeploymentOperationMetadata {
4863    /// The current step the deployment operation is running.
4864    pub step: crate::model::deployment_operation_metadata::DeploymentStep,
4865
4866    /// Outputs and artifacts from applying a deployment.
4867    pub apply_results: std::option::Option<crate::model::ApplyResults>,
4868
4869    /// Output only. Cloud Build instance UUID associated with this operation.
4870    pub build: std::string::String,
4871
4872    /// Output only. Location of Deployment operations logs in
4873    /// `gs://{bucket}/{object}` format.
4874    pub logs: std::string::String,
4875
4876    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4877}
4878
4879impl DeploymentOperationMetadata {
4880    pub fn new() -> Self {
4881        std::default::Default::default()
4882    }
4883
4884    /// Sets the value of [step][crate::model::DeploymentOperationMetadata::step].
4885    ///
4886    /// # Example
4887    /// ```ignore,no_run
4888    /// # use google_cloud_config_v1::model::DeploymentOperationMetadata;
4889    /// use google_cloud_config_v1::model::deployment_operation_metadata::DeploymentStep;
4890    /// let x0 = DeploymentOperationMetadata::new().set_step(DeploymentStep::PreparingStorageBucket);
4891    /// let x1 = DeploymentOperationMetadata::new().set_step(DeploymentStep::DownloadingBlueprint);
4892    /// let x2 = DeploymentOperationMetadata::new().set_step(DeploymentStep::RunningTfInit);
4893    /// ```
4894    pub fn set_step<
4895        T: std::convert::Into<crate::model::deployment_operation_metadata::DeploymentStep>,
4896    >(
4897        mut self,
4898        v: T,
4899    ) -> Self {
4900        self.step = v.into();
4901        self
4902    }
4903
4904    /// Sets the value of [apply_results][crate::model::DeploymentOperationMetadata::apply_results].
4905    ///
4906    /// # Example
4907    /// ```ignore,no_run
4908    /// # use google_cloud_config_v1::model::DeploymentOperationMetadata;
4909    /// use google_cloud_config_v1::model::ApplyResults;
4910    /// let x = DeploymentOperationMetadata::new().set_apply_results(ApplyResults::default()/* use setters */);
4911    /// ```
4912    pub fn set_apply_results<T>(mut self, v: T) -> Self
4913    where
4914        T: std::convert::Into<crate::model::ApplyResults>,
4915    {
4916        self.apply_results = std::option::Option::Some(v.into());
4917        self
4918    }
4919
4920    /// Sets or clears the value of [apply_results][crate::model::DeploymentOperationMetadata::apply_results].
4921    ///
4922    /// # Example
4923    /// ```ignore,no_run
4924    /// # use google_cloud_config_v1::model::DeploymentOperationMetadata;
4925    /// use google_cloud_config_v1::model::ApplyResults;
4926    /// let x = DeploymentOperationMetadata::new().set_or_clear_apply_results(Some(ApplyResults::default()/* use setters */));
4927    /// let x = DeploymentOperationMetadata::new().set_or_clear_apply_results(None::<ApplyResults>);
4928    /// ```
4929    pub fn set_or_clear_apply_results<T>(mut self, v: std::option::Option<T>) -> Self
4930    where
4931        T: std::convert::Into<crate::model::ApplyResults>,
4932    {
4933        self.apply_results = v.map(|x| x.into());
4934        self
4935    }
4936
4937    /// Sets the value of [build][crate::model::DeploymentOperationMetadata::build].
4938    ///
4939    /// # Example
4940    /// ```ignore,no_run
4941    /// # use google_cloud_config_v1::model::DeploymentOperationMetadata;
4942    /// let x = DeploymentOperationMetadata::new().set_build("example");
4943    /// ```
4944    pub fn set_build<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4945        self.build = v.into();
4946        self
4947    }
4948
4949    /// Sets the value of [logs][crate::model::DeploymentOperationMetadata::logs].
4950    ///
4951    /// # Example
4952    /// ```ignore,no_run
4953    /// # use google_cloud_config_v1::model::DeploymentOperationMetadata;
4954    /// let x = DeploymentOperationMetadata::new().set_logs("example");
4955    /// ```
4956    pub fn set_logs<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4957        self.logs = v.into();
4958        self
4959    }
4960}
4961
4962impl wkt::message::Message for DeploymentOperationMetadata {
4963    fn typename() -> &'static str {
4964        "type.googleapis.com/google.cloud.config.v1.DeploymentOperationMetadata"
4965    }
4966}
4967
4968/// Defines additional types related to [DeploymentOperationMetadata].
4969pub mod deployment_operation_metadata {
4970    #[allow(unused_imports)]
4971    use super::*;
4972
4973    /// The possible steps a deployment may be running.
4974    ///
4975    /// # Working with unknown values
4976    ///
4977    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4978    /// additional enum variants at any time. Adding new variants is not considered
4979    /// a breaking change. Applications should write their code in anticipation of:
4980    ///
4981    /// - New values appearing in future releases of the client library, **and**
4982    /// - New values received dynamically, without application changes.
4983    ///
4984    /// Please consult the [Working with enums] section in the user guide for some
4985    /// guidelines.
4986    ///
4987    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
4988    #[derive(Clone, Debug, PartialEq)]
4989    #[non_exhaustive]
4990    pub enum DeploymentStep {
4991        /// Unspecified deployment step
4992        Unspecified,
4993        /// Infra Manager is creating a Google Cloud Storage bucket to store
4994        /// artifacts and metadata about the deployment and revision
4995        PreparingStorageBucket,
4996        /// Downloading the blueprint onto the Google Cloud Storage bucket
4997        DownloadingBlueprint,
4998        /// Initializing Terraform using `terraform init`
4999        RunningTfInit,
5000        /// Running `terraform plan`
5001        RunningTfPlan,
5002        /// Actuating resources using Terraform using `terraform apply`
5003        RunningTfApply,
5004        /// Destroying resources using Terraform using `terraform destroy`
5005        RunningTfDestroy,
5006        /// Validating the uploaded TF state file when unlocking a deployment
5007        RunningTfValidate,
5008        /// Unlocking a deployment
5009        UnlockingDeployment,
5010        /// Operation was successful
5011        Succeeded,
5012        /// Operation failed
5013        Failed,
5014        /// Validating the provided repository.
5015        ValidatingRepository,
5016        /// Running quota validation
5017        RunningQuotaValidation,
5018        /// If set, the enum was initialized with an unknown value.
5019        ///
5020        /// Applications can examine the value using [DeploymentStep::value] or
5021        /// [DeploymentStep::name].
5022        UnknownValue(deployment_step::UnknownValue),
5023    }
5024
5025    #[doc(hidden)]
5026    pub mod deployment_step {
5027        #[allow(unused_imports)]
5028        use super::*;
5029        #[derive(Clone, Debug, PartialEq)]
5030        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5031    }
5032
5033    impl DeploymentStep {
5034        /// Gets the enum value.
5035        ///
5036        /// Returns `None` if the enum contains an unknown value deserialized from
5037        /// the string representation of enums.
5038        pub fn value(&self) -> std::option::Option<i32> {
5039            match self {
5040                Self::Unspecified => std::option::Option::Some(0),
5041                Self::PreparingStorageBucket => std::option::Option::Some(1),
5042                Self::DownloadingBlueprint => std::option::Option::Some(2),
5043                Self::RunningTfInit => std::option::Option::Some(3),
5044                Self::RunningTfPlan => std::option::Option::Some(4),
5045                Self::RunningTfApply => std::option::Option::Some(5),
5046                Self::RunningTfDestroy => std::option::Option::Some(6),
5047                Self::RunningTfValidate => std::option::Option::Some(7),
5048                Self::UnlockingDeployment => std::option::Option::Some(8),
5049                Self::Succeeded => std::option::Option::Some(9),
5050                Self::Failed => std::option::Option::Some(10),
5051                Self::ValidatingRepository => std::option::Option::Some(11),
5052                Self::RunningQuotaValidation => std::option::Option::Some(12),
5053                Self::UnknownValue(u) => u.0.value(),
5054            }
5055        }
5056
5057        /// Gets the enum value as a string.
5058        ///
5059        /// Returns `None` if the enum contains an unknown value deserialized from
5060        /// the integer representation of enums.
5061        pub fn name(&self) -> std::option::Option<&str> {
5062            match self {
5063                Self::Unspecified => std::option::Option::Some("DEPLOYMENT_STEP_UNSPECIFIED"),
5064                Self::PreparingStorageBucket => {
5065                    std::option::Option::Some("PREPARING_STORAGE_BUCKET")
5066                }
5067                Self::DownloadingBlueprint => std::option::Option::Some("DOWNLOADING_BLUEPRINT"),
5068                Self::RunningTfInit => std::option::Option::Some("RUNNING_TF_INIT"),
5069                Self::RunningTfPlan => std::option::Option::Some("RUNNING_TF_PLAN"),
5070                Self::RunningTfApply => std::option::Option::Some("RUNNING_TF_APPLY"),
5071                Self::RunningTfDestroy => std::option::Option::Some("RUNNING_TF_DESTROY"),
5072                Self::RunningTfValidate => std::option::Option::Some("RUNNING_TF_VALIDATE"),
5073                Self::UnlockingDeployment => std::option::Option::Some("UNLOCKING_DEPLOYMENT"),
5074                Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
5075                Self::Failed => std::option::Option::Some("FAILED"),
5076                Self::ValidatingRepository => std::option::Option::Some("VALIDATING_REPOSITORY"),
5077                Self::RunningQuotaValidation => {
5078                    std::option::Option::Some("RUNNING_QUOTA_VALIDATION")
5079                }
5080                Self::UnknownValue(u) => u.0.name(),
5081            }
5082        }
5083    }
5084
5085    impl std::default::Default for DeploymentStep {
5086        fn default() -> Self {
5087            use std::convert::From;
5088            Self::from(0)
5089        }
5090    }
5091
5092    impl std::fmt::Display for DeploymentStep {
5093        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5094            wkt::internal::display_enum(f, self.name(), self.value())
5095        }
5096    }
5097
5098    impl std::convert::From<i32> for DeploymentStep {
5099        fn from(value: i32) -> Self {
5100            match value {
5101                0 => Self::Unspecified,
5102                1 => Self::PreparingStorageBucket,
5103                2 => Self::DownloadingBlueprint,
5104                3 => Self::RunningTfInit,
5105                4 => Self::RunningTfPlan,
5106                5 => Self::RunningTfApply,
5107                6 => Self::RunningTfDestroy,
5108                7 => Self::RunningTfValidate,
5109                8 => Self::UnlockingDeployment,
5110                9 => Self::Succeeded,
5111                10 => Self::Failed,
5112                11 => Self::ValidatingRepository,
5113                12 => Self::RunningQuotaValidation,
5114                _ => Self::UnknownValue(deployment_step::UnknownValue(
5115                    wkt::internal::UnknownEnumValue::Integer(value),
5116                )),
5117            }
5118        }
5119    }
5120
5121    impl std::convert::From<&str> for DeploymentStep {
5122        fn from(value: &str) -> Self {
5123            use std::string::ToString;
5124            match value {
5125                "DEPLOYMENT_STEP_UNSPECIFIED" => Self::Unspecified,
5126                "PREPARING_STORAGE_BUCKET" => Self::PreparingStorageBucket,
5127                "DOWNLOADING_BLUEPRINT" => Self::DownloadingBlueprint,
5128                "RUNNING_TF_INIT" => Self::RunningTfInit,
5129                "RUNNING_TF_PLAN" => Self::RunningTfPlan,
5130                "RUNNING_TF_APPLY" => Self::RunningTfApply,
5131                "RUNNING_TF_DESTROY" => Self::RunningTfDestroy,
5132                "RUNNING_TF_VALIDATE" => Self::RunningTfValidate,
5133                "UNLOCKING_DEPLOYMENT" => Self::UnlockingDeployment,
5134                "SUCCEEDED" => Self::Succeeded,
5135                "FAILED" => Self::Failed,
5136                "VALIDATING_REPOSITORY" => Self::ValidatingRepository,
5137                "RUNNING_QUOTA_VALIDATION" => Self::RunningQuotaValidation,
5138                _ => Self::UnknownValue(deployment_step::UnknownValue(
5139                    wkt::internal::UnknownEnumValue::String(value.to_string()),
5140                )),
5141            }
5142        }
5143    }
5144
5145    impl serde::ser::Serialize for DeploymentStep {
5146        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5147        where
5148            S: serde::Serializer,
5149        {
5150            match self {
5151                Self::Unspecified => serializer.serialize_i32(0),
5152                Self::PreparingStorageBucket => serializer.serialize_i32(1),
5153                Self::DownloadingBlueprint => serializer.serialize_i32(2),
5154                Self::RunningTfInit => serializer.serialize_i32(3),
5155                Self::RunningTfPlan => serializer.serialize_i32(4),
5156                Self::RunningTfApply => serializer.serialize_i32(5),
5157                Self::RunningTfDestroy => serializer.serialize_i32(6),
5158                Self::RunningTfValidate => serializer.serialize_i32(7),
5159                Self::UnlockingDeployment => serializer.serialize_i32(8),
5160                Self::Succeeded => serializer.serialize_i32(9),
5161                Self::Failed => serializer.serialize_i32(10),
5162                Self::ValidatingRepository => serializer.serialize_i32(11),
5163                Self::RunningQuotaValidation => serializer.serialize_i32(12),
5164                Self::UnknownValue(u) => u.0.serialize(serializer),
5165            }
5166        }
5167    }
5168
5169    impl<'de> serde::de::Deserialize<'de> for DeploymentStep {
5170        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5171        where
5172            D: serde::Deserializer<'de>,
5173        {
5174            deserializer.deserialize_any(wkt::internal::EnumVisitor::<DeploymentStep>::new(
5175                ".google.cloud.config.v1.DeploymentOperationMetadata.DeploymentStep",
5176            ))
5177        }
5178    }
5179}
5180
5181/// Resource represents a Google Cloud Platform resource actuated by IM.
5182/// Resources are child resources of Revisions.
5183#[derive(Clone, Default, PartialEq)]
5184#[non_exhaustive]
5185pub struct Resource {
5186    /// Output only. Resource name.
5187    /// Format:
5188    /// `projects/{project}/locations/{location}/deployments/{deployment}/revisions/{revision}/resources/{resource}`
5189    pub name: std::string::String,
5190
5191    /// Output only. Terraform-specific info if this resource was created using
5192    /// Terraform.
5193    pub terraform_info: std::option::Option<crate::model::ResourceTerraformInfo>,
5194
5195    /// Output only. Map of Cloud Asset Inventory (CAI) type to CAI info (e.g. CAI
5196    /// ID). CAI type format follows
5197    /// <https://cloud.google.com/asset-inventory/docs/supported-asset-types>
5198    pub cai_assets: std::collections::HashMap<std::string::String, crate::model::ResourceCAIInfo>,
5199
5200    /// Output only. Intent of the resource.
5201    pub intent: crate::model::resource::Intent,
5202
5203    /// Output only. Current state of the resource.
5204    pub state: crate::model::resource::State,
5205
5206    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5207}
5208
5209impl Resource {
5210    pub fn new() -> Self {
5211        std::default::Default::default()
5212    }
5213
5214    /// Sets the value of [name][crate::model::Resource::name].
5215    ///
5216    /// # Example
5217    /// ```ignore,no_run
5218    /// # use google_cloud_config_v1::model::Resource;
5219    /// let x = Resource::new().set_name("example");
5220    /// ```
5221    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5222        self.name = v.into();
5223        self
5224    }
5225
5226    /// Sets the value of [terraform_info][crate::model::Resource::terraform_info].
5227    ///
5228    /// # Example
5229    /// ```ignore,no_run
5230    /// # use google_cloud_config_v1::model::Resource;
5231    /// use google_cloud_config_v1::model::ResourceTerraformInfo;
5232    /// let x = Resource::new().set_terraform_info(ResourceTerraformInfo::default()/* use setters */);
5233    /// ```
5234    pub fn set_terraform_info<T>(mut self, v: T) -> Self
5235    where
5236        T: std::convert::Into<crate::model::ResourceTerraformInfo>,
5237    {
5238        self.terraform_info = std::option::Option::Some(v.into());
5239        self
5240    }
5241
5242    /// Sets or clears the value of [terraform_info][crate::model::Resource::terraform_info].
5243    ///
5244    /// # Example
5245    /// ```ignore,no_run
5246    /// # use google_cloud_config_v1::model::Resource;
5247    /// use google_cloud_config_v1::model::ResourceTerraformInfo;
5248    /// let x = Resource::new().set_or_clear_terraform_info(Some(ResourceTerraformInfo::default()/* use setters */));
5249    /// let x = Resource::new().set_or_clear_terraform_info(None::<ResourceTerraformInfo>);
5250    /// ```
5251    pub fn set_or_clear_terraform_info<T>(mut self, v: std::option::Option<T>) -> Self
5252    where
5253        T: std::convert::Into<crate::model::ResourceTerraformInfo>,
5254    {
5255        self.terraform_info = v.map(|x| x.into());
5256        self
5257    }
5258
5259    /// Sets the value of [cai_assets][crate::model::Resource::cai_assets].
5260    ///
5261    /// # Example
5262    /// ```ignore,no_run
5263    /// # use google_cloud_config_v1::model::Resource;
5264    /// use google_cloud_config_v1::model::ResourceCAIInfo;
5265    /// let x = Resource::new().set_cai_assets([
5266    ///     ("key0", ResourceCAIInfo::default()/* use setters */),
5267    ///     ("key1", ResourceCAIInfo::default()/* use (different) setters */),
5268    /// ]);
5269    /// ```
5270    pub fn set_cai_assets<T, K, V>(mut self, v: T) -> Self
5271    where
5272        T: std::iter::IntoIterator<Item = (K, V)>,
5273        K: std::convert::Into<std::string::String>,
5274        V: std::convert::Into<crate::model::ResourceCAIInfo>,
5275    {
5276        use std::iter::Iterator;
5277        self.cai_assets = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5278        self
5279    }
5280
5281    /// Sets the value of [intent][crate::model::Resource::intent].
5282    ///
5283    /// # Example
5284    /// ```ignore,no_run
5285    /// # use google_cloud_config_v1::model::Resource;
5286    /// use google_cloud_config_v1::model::resource::Intent;
5287    /// let x0 = Resource::new().set_intent(Intent::Create);
5288    /// let x1 = Resource::new().set_intent(Intent::Update);
5289    /// let x2 = Resource::new().set_intent(Intent::Delete);
5290    /// ```
5291    pub fn set_intent<T: std::convert::Into<crate::model::resource::Intent>>(
5292        mut self,
5293        v: T,
5294    ) -> Self {
5295        self.intent = v.into();
5296        self
5297    }
5298
5299    /// Sets the value of [state][crate::model::Resource::state].
5300    ///
5301    /// # Example
5302    /// ```ignore,no_run
5303    /// # use google_cloud_config_v1::model::Resource;
5304    /// use google_cloud_config_v1::model::resource::State;
5305    /// let x0 = Resource::new().set_state(State::Planned);
5306    /// let x1 = Resource::new().set_state(State::InProgress);
5307    /// let x2 = Resource::new().set_state(State::Reconciled);
5308    /// ```
5309    pub fn set_state<T: std::convert::Into<crate::model::resource::State>>(mut self, v: T) -> Self {
5310        self.state = v.into();
5311        self
5312    }
5313}
5314
5315impl wkt::message::Message for Resource {
5316    fn typename() -> &'static str {
5317        "type.googleapis.com/google.cloud.config.v1.Resource"
5318    }
5319}
5320
5321/// Defines additional types related to [Resource].
5322pub mod resource {
5323    #[allow(unused_imports)]
5324    use super::*;
5325
5326    /// Possible intent of the resource.
5327    ///
5328    /// # Working with unknown values
5329    ///
5330    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5331    /// additional enum variants at any time. Adding new variants is not considered
5332    /// a breaking change. Applications should write their code in anticipation of:
5333    ///
5334    /// - New values appearing in future releases of the client library, **and**
5335    /// - New values received dynamically, without application changes.
5336    ///
5337    /// Please consult the [Working with enums] section in the user guide for some
5338    /// guidelines.
5339    ///
5340    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
5341    #[derive(Clone, Debug, PartialEq)]
5342    #[non_exhaustive]
5343    pub enum Intent {
5344        /// The default value. This value is used if the intent is omitted.
5345        Unspecified,
5346        /// Infra Manager will create this Resource.
5347        Create,
5348        /// Infra Manager will update this Resource.
5349        Update,
5350        /// Infra Manager will delete this Resource.
5351        Delete,
5352        /// Infra Manager will destroy and recreate this Resource.
5353        Recreate,
5354        /// Infra Manager will leave this Resource untouched.
5355        Unchanged,
5356        /// If set, the enum was initialized with an unknown value.
5357        ///
5358        /// Applications can examine the value using [Intent::value] or
5359        /// [Intent::name].
5360        UnknownValue(intent::UnknownValue),
5361    }
5362
5363    #[doc(hidden)]
5364    pub mod intent {
5365        #[allow(unused_imports)]
5366        use super::*;
5367        #[derive(Clone, Debug, PartialEq)]
5368        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5369    }
5370
5371    impl Intent {
5372        /// Gets the enum value.
5373        ///
5374        /// Returns `None` if the enum contains an unknown value deserialized from
5375        /// the string representation of enums.
5376        pub fn value(&self) -> std::option::Option<i32> {
5377            match self {
5378                Self::Unspecified => std::option::Option::Some(0),
5379                Self::Create => std::option::Option::Some(1),
5380                Self::Update => std::option::Option::Some(2),
5381                Self::Delete => std::option::Option::Some(3),
5382                Self::Recreate => std::option::Option::Some(4),
5383                Self::Unchanged => std::option::Option::Some(5),
5384                Self::UnknownValue(u) => u.0.value(),
5385            }
5386        }
5387
5388        /// Gets the enum value as a string.
5389        ///
5390        /// Returns `None` if the enum contains an unknown value deserialized from
5391        /// the integer representation of enums.
5392        pub fn name(&self) -> std::option::Option<&str> {
5393            match self {
5394                Self::Unspecified => std::option::Option::Some("INTENT_UNSPECIFIED"),
5395                Self::Create => std::option::Option::Some("CREATE"),
5396                Self::Update => std::option::Option::Some("UPDATE"),
5397                Self::Delete => std::option::Option::Some("DELETE"),
5398                Self::Recreate => std::option::Option::Some("RECREATE"),
5399                Self::Unchanged => std::option::Option::Some("UNCHANGED"),
5400                Self::UnknownValue(u) => u.0.name(),
5401            }
5402        }
5403    }
5404
5405    impl std::default::Default for Intent {
5406        fn default() -> Self {
5407            use std::convert::From;
5408            Self::from(0)
5409        }
5410    }
5411
5412    impl std::fmt::Display for Intent {
5413        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5414            wkt::internal::display_enum(f, self.name(), self.value())
5415        }
5416    }
5417
5418    impl std::convert::From<i32> for Intent {
5419        fn from(value: i32) -> Self {
5420            match value {
5421                0 => Self::Unspecified,
5422                1 => Self::Create,
5423                2 => Self::Update,
5424                3 => Self::Delete,
5425                4 => Self::Recreate,
5426                5 => Self::Unchanged,
5427                _ => Self::UnknownValue(intent::UnknownValue(
5428                    wkt::internal::UnknownEnumValue::Integer(value),
5429                )),
5430            }
5431        }
5432    }
5433
5434    impl std::convert::From<&str> for Intent {
5435        fn from(value: &str) -> Self {
5436            use std::string::ToString;
5437            match value {
5438                "INTENT_UNSPECIFIED" => Self::Unspecified,
5439                "CREATE" => Self::Create,
5440                "UPDATE" => Self::Update,
5441                "DELETE" => Self::Delete,
5442                "RECREATE" => Self::Recreate,
5443                "UNCHANGED" => Self::Unchanged,
5444                _ => Self::UnknownValue(intent::UnknownValue(
5445                    wkt::internal::UnknownEnumValue::String(value.to_string()),
5446                )),
5447            }
5448        }
5449    }
5450
5451    impl serde::ser::Serialize for Intent {
5452        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5453        where
5454            S: serde::Serializer,
5455        {
5456            match self {
5457                Self::Unspecified => serializer.serialize_i32(0),
5458                Self::Create => serializer.serialize_i32(1),
5459                Self::Update => serializer.serialize_i32(2),
5460                Self::Delete => serializer.serialize_i32(3),
5461                Self::Recreate => serializer.serialize_i32(4),
5462                Self::Unchanged => serializer.serialize_i32(5),
5463                Self::UnknownValue(u) => u.0.serialize(serializer),
5464            }
5465        }
5466    }
5467
5468    impl<'de> serde::de::Deserialize<'de> for Intent {
5469        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5470        where
5471            D: serde::Deserializer<'de>,
5472        {
5473            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Intent>::new(
5474                ".google.cloud.config.v1.Resource.Intent",
5475            ))
5476        }
5477    }
5478
5479    /// Possible states of a resource.
5480    ///
5481    /// # Working with unknown values
5482    ///
5483    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5484    /// additional enum variants at any time. Adding new variants is not considered
5485    /// a breaking change. Applications should write their code in anticipation of:
5486    ///
5487    /// - New values appearing in future releases of the client library, **and**
5488    /// - New values received dynamically, without application changes.
5489    ///
5490    /// Please consult the [Working with enums] section in the user guide for some
5491    /// guidelines.
5492    ///
5493    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
5494    #[derive(Clone, Debug, PartialEq)]
5495    #[non_exhaustive]
5496    pub enum State {
5497        /// The default value. This value is used if the state is omitted.
5498        Unspecified,
5499        /// Resource has been planned for reconcile.
5500        Planned,
5501        /// Resource is actively reconciling into the intended state.
5502        InProgress,
5503        /// Resource has reconciled to intended state.
5504        Reconciled,
5505        /// Resource failed to reconcile.
5506        Failed,
5507        /// If set, the enum was initialized with an unknown value.
5508        ///
5509        /// Applications can examine the value using [State::value] or
5510        /// [State::name].
5511        UnknownValue(state::UnknownValue),
5512    }
5513
5514    #[doc(hidden)]
5515    pub mod state {
5516        #[allow(unused_imports)]
5517        use super::*;
5518        #[derive(Clone, Debug, PartialEq)]
5519        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5520    }
5521
5522    impl State {
5523        /// Gets the enum value.
5524        ///
5525        /// Returns `None` if the enum contains an unknown value deserialized from
5526        /// the string representation of enums.
5527        pub fn value(&self) -> std::option::Option<i32> {
5528            match self {
5529                Self::Unspecified => std::option::Option::Some(0),
5530                Self::Planned => std::option::Option::Some(1),
5531                Self::InProgress => std::option::Option::Some(2),
5532                Self::Reconciled => std::option::Option::Some(3),
5533                Self::Failed => std::option::Option::Some(4),
5534                Self::UnknownValue(u) => u.0.value(),
5535            }
5536        }
5537
5538        /// Gets the enum value as a string.
5539        ///
5540        /// Returns `None` if the enum contains an unknown value deserialized from
5541        /// the integer representation of enums.
5542        pub fn name(&self) -> std::option::Option<&str> {
5543            match self {
5544                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
5545                Self::Planned => std::option::Option::Some("PLANNED"),
5546                Self::InProgress => std::option::Option::Some("IN_PROGRESS"),
5547                Self::Reconciled => std::option::Option::Some("RECONCILED"),
5548                Self::Failed => std::option::Option::Some("FAILED"),
5549                Self::UnknownValue(u) => u.0.name(),
5550            }
5551        }
5552    }
5553
5554    impl std::default::Default for State {
5555        fn default() -> Self {
5556            use std::convert::From;
5557            Self::from(0)
5558        }
5559    }
5560
5561    impl std::fmt::Display for State {
5562        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5563            wkt::internal::display_enum(f, self.name(), self.value())
5564        }
5565    }
5566
5567    impl std::convert::From<i32> for State {
5568        fn from(value: i32) -> Self {
5569            match value {
5570                0 => Self::Unspecified,
5571                1 => Self::Planned,
5572                2 => Self::InProgress,
5573                3 => Self::Reconciled,
5574                4 => Self::Failed,
5575                _ => Self::UnknownValue(state::UnknownValue(
5576                    wkt::internal::UnknownEnumValue::Integer(value),
5577                )),
5578            }
5579        }
5580    }
5581
5582    impl std::convert::From<&str> for State {
5583        fn from(value: &str) -> Self {
5584            use std::string::ToString;
5585            match value {
5586                "STATE_UNSPECIFIED" => Self::Unspecified,
5587                "PLANNED" => Self::Planned,
5588                "IN_PROGRESS" => Self::InProgress,
5589                "RECONCILED" => Self::Reconciled,
5590                "FAILED" => Self::Failed,
5591                _ => Self::UnknownValue(state::UnknownValue(
5592                    wkt::internal::UnknownEnumValue::String(value.to_string()),
5593                )),
5594            }
5595        }
5596    }
5597
5598    impl serde::ser::Serialize for State {
5599        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5600        where
5601            S: serde::Serializer,
5602        {
5603            match self {
5604                Self::Unspecified => serializer.serialize_i32(0),
5605                Self::Planned => serializer.serialize_i32(1),
5606                Self::InProgress => serializer.serialize_i32(2),
5607                Self::Reconciled => serializer.serialize_i32(3),
5608                Self::Failed => serializer.serialize_i32(4),
5609                Self::UnknownValue(u) => u.0.serialize(serializer),
5610            }
5611        }
5612    }
5613
5614    impl<'de> serde::de::Deserialize<'de> for State {
5615        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5616        where
5617            D: serde::Deserializer<'de>,
5618        {
5619            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
5620                ".google.cloud.config.v1.Resource.State",
5621            ))
5622        }
5623    }
5624}
5625
5626/// Terraform info of a Resource.
5627#[derive(Clone, Default, PartialEq)]
5628#[non_exhaustive]
5629pub struct ResourceTerraformInfo {
5630    /// TF resource address that uniquely identifies this resource within this
5631    /// deployment.
5632    pub address: std::string::String,
5633
5634    /// TF resource type
5635    pub r#type: std::string::String,
5636
5637    /// ID attribute of the TF resource
5638    pub id: std::string::String,
5639
5640    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5641}
5642
5643impl ResourceTerraformInfo {
5644    pub fn new() -> Self {
5645        std::default::Default::default()
5646    }
5647
5648    /// Sets the value of [address][crate::model::ResourceTerraformInfo::address].
5649    ///
5650    /// # Example
5651    /// ```ignore,no_run
5652    /// # use google_cloud_config_v1::model::ResourceTerraformInfo;
5653    /// let x = ResourceTerraformInfo::new().set_address("example");
5654    /// ```
5655    pub fn set_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5656        self.address = v.into();
5657        self
5658    }
5659
5660    /// Sets the value of [r#type][crate::model::ResourceTerraformInfo::type].
5661    ///
5662    /// # Example
5663    /// ```ignore,no_run
5664    /// # use google_cloud_config_v1::model::ResourceTerraformInfo;
5665    /// let x = ResourceTerraformInfo::new().set_type("example");
5666    /// ```
5667    pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5668        self.r#type = v.into();
5669        self
5670    }
5671
5672    /// Sets the value of [id][crate::model::ResourceTerraformInfo::id].
5673    ///
5674    /// # Example
5675    /// ```ignore,no_run
5676    /// # use google_cloud_config_v1::model::ResourceTerraformInfo;
5677    /// let x = ResourceTerraformInfo::new().set_id("example");
5678    /// ```
5679    pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5680        self.id = v.into();
5681        self
5682    }
5683}
5684
5685impl wkt::message::Message for ResourceTerraformInfo {
5686    fn typename() -> &'static str {
5687        "type.googleapis.com/google.cloud.config.v1.ResourceTerraformInfo"
5688    }
5689}
5690
5691/// CAI info of a Resource.
5692#[derive(Clone, Default, PartialEq)]
5693#[non_exhaustive]
5694pub struct ResourceCAIInfo {
5695    /// CAI resource name in the format following
5696    /// <https://cloud.google.com/apis/design/resource_names#full_resource_name>
5697    pub full_resource_name: std::string::String,
5698
5699    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5700}
5701
5702impl ResourceCAIInfo {
5703    pub fn new() -> Self {
5704        std::default::Default::default()
5705    }
5706
5707    /// Sets the value of [full_resource_name][crate::model::ResourceCAIInfo::full_resource_name].
5708    ///
5709    /// # Example
5710    /// ```ignore,no_run
5711    /// # use google_cloud_config_v1::model::ResourceCAIInfo;
5712    /// let x = ResourceCAIInfo::new().set_full_resource_name("example");
5713    /// ```
5714    pub fn set_full_resource_name<T: std::convert::Into<std::string::String>>(
5715        mut self,
5716        v: T,
5717    ) -> Self {
5718        self.full_resource_name = v.into();
5719        self
5720    }
5721}
5722
5723impl wkt::message::Message for ResourceCAIInfo {
5724    fn typename() -> &'static str {
5725        "type.googleapis.com/google.cloud.config.v1.ResourceCAIInfo"
5726    }
5727}
5728
5729/// A request to get a Resource from a 'GetResource' call.
5730#[derive(Clone, Default, PartialEq)]
5731#[non_exhaustive]
5732pub struct GetResourceRequest {
5733    /// Required. The name of the Resource in the format:
5734    /// 'projects/{project_id}/locations/{location}/deployments/{deployment}/revisions/{revision}/resource/{resource}'.
5735    pub name: std::string::String,
5736
5737    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5738}
5739
5740impl GetResourceRequest {
5741    pub fn new() -> Self {
5742        std::default::Default::default()
5743    }
5744
5745    /// Sets the value of [name][crate::model::GetResourceRequest::name].
5746    ///
5747    /// # Example
5748    /// ```ignore,no_run
5749    /// # use google_cloud_config_v1::model::GetResourceRequest;
5750    /// let x = GetResourceRequest::new().set_name("example");
5751    /// ```
5752    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5753        self.name = v.into();
5754        self
5755    }
5756}
5757
5758impl wkt::message::Message for GetResourceRequest {
5759    fn typename() -> &'static str {
5760        "type.googleapis.com/google.cloud.config.v1.GetResourceRequest"
5761    }
5762}
5763
5764/// A request to list Resources passed to a 'ListResources' call.
5765#[derive(Clone, Default, PartialEq)]
5766#[non_exhaustive]
5767pub struct ListResourcesRequest {
5768    /// Required. The parent in whose context the Resources are listed. The parent
5769    /// value is in the format:
5770    /// 'projects/{project_id}/locations/{location}/deployments/{deployment}/revisions/{revision}'.
5771    pub parent: std::string::String,
5772
5773    /// When requesting a page of resources, 'page_size' specifies number of
5774    /// resources to return. If unspecified, at most 500 will be returned. The
5775    /// maximum value is 1000.
5776    pub page_size: i32,
5777
5778    /// Token returned by previous call to 'ListResources' which specifies the
5779    /// position in the list from where to continue listing the resources.
5780    pub page_token: std::string::String,
5781
5782    /// Lists the Resources that match the filter expression. A filter
5783    /// expression filters the resources listed in the response. The expression
5784    /// must be of the form '{field} {operator} {value}' where operators: '<', '>',
5785    /// '<=',
5786    /// '>=',
5787    /// '!=', '=', ':' are supported (colon ':' represents a HAS operator which is
5788    /// roughly synonymous with equality). {field} can refer to a proto or JSON
5789    /// field, or a synthetic field. Field names can be camelCase or snake_case.
5790    ///
5791    /// Examples:
5792    ///
5793    /// - Filter by name:
5794    ///   name =
5795    ///   "projects/foo/locations/us-central1/deployments/dep/revisions/bar/resources/baz
5796    pub filter: std::string::String,
5797
5798    /// Field to use to sort the list.
5799    pub order_by: std::string::String,
5800
5801    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5802}
5803
5804impl ListResourcesRequest {
5805    pub fn new() -> Self {
5806        std::default::Default::default()
5807    }
5808
5809    /// Sets the value of [parent][crate::model::ListResourcesRequest::parent].
5810    ///
5811    /// # Example
5812    /// ```ignore,no_run
5813    /// # use google_cloud_config_v1::model::ListResourcesRequest;
5814    /// let x = ListResourcesRequest::new().set_parent("example");
5815    /// ```
5816    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5817        self.parent = v.into();
5818        self
5819    }
5820
5821    /// Sets the value of [page_size][crate::model::ListResourcesRequest::page_size].
5822    ///
5823    /// # Example
5824    /// ```ignore,no_run
5825    /// # use google_cloud_config_v1::model::ListResourcesRequest;
5826    /// let x = ListResourcesRequest::new().set_page_size(42);
5827    /// ```
5828    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5829        self.page_size = v.into();
5830        self
5831    }
5832
5833    /// Sets the value of [page_token][crate::model::ListResourcesRequest::page_token].
5834    ///
5835    /// # Example
5836    /// ```ignore,no_run
5837    /// # use google_cloud_config_v1::model::ListResourcesRequest;
5838    /// let x = ListResourcesRequest::new().set_page_token("example");
5839    /// ```
5840    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5841        self.page_token = v.into();
5842        self
5843    }
5844
5845    /// Sets the value of [filter][crate::model::ListResourcesRequest::filter].
5846    ///
5847    /// # Example
5848    /// ```ignore,no_run
5849    /// # use google_cloud_config_v1::model::ListResourcesRequest;
5850    /// let x = ListResourcesRequest::new().set_filter("example");
5851    /// ```
5852    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5853        self.filter = v.into();
5854        self
5855    }
5856
5857    /// Sets the value of [order_by][crate::model::ListResourcesRequest::order_by].
5858    ///
5859    /// # Example
5860    /// ```ignore,no_run
5861    /// # use google_cloud_config_v1::model::ListResourcesRequest;
5862    /// let x = ListResourcesRequest::new().set_order_by("example");
5863    /// ```
5864    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5865        self.order_by = v.into();
5866        self
5867    }
5868}
5869
5870impl wkt::message::Message for ListResourcesRequest {
5871    fn typename() -> &'static str {
5872        "type.googleapis.com/google.cloud.config.v1.ListResourcesRequest"
5873    }
5874}
5875
5876/// A response to a 'ListResources' call. Contains a list of Resources.
5877#[derive(Clone, Default, PartialEq)]
5878#[non_exhaustive]
5879pub struct ListResourcesResponse {
5880    /// List of [Resources][google.cloud.config.v1.Resource].
5881    ///
5882    /// [google.cloud.config.v1.Resource]: crate::model::Resource
5883    pub resources: std::vec::Vec<crate::model::Resource>,
5884
5885    /// A token to request the next page of resources from the 'ListResources'
5886    /// method. The value of an empty string means that there are no more resources
5887    /// to return.
5888    pub next_page_token: std::string::String,
5889
5890    /// Locations that could not be reached.
5891    pub unreachable: std::vec::Vec<std::string::String>,
5892
5893    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5894}
5895
5896impl ListResourcesResponse {
5897    pub fn new() -> Self {
5898        std::default::Default::default()
5899    }
5900
5901    /// Sets the value of [resources][crate::model::ListResourcesResponse::resources].
5902    ///
5903    /// # Example
5904    /// ```ignore,no_run
5905    /// # use google_cloud_config_v1::model::ListResourcesResponse;
5906    /// use google_cloud_config_v1::model::Resource;
5907    /// let x = ListResourcesResponse::new()
5908    ///     .set_resources([
5909    ///         Resource::default()/* use setters */,
5910    ///         Resource::default()/* use (different) setters */,
5911    ///     ]);
5912    /// ```
5913    pub fn set_resources<T, V>(mut self, v: T) -> Self
5914    where
5915        T: std::iter::IntoIterator<Item = V>,
5916        V: std::convert::Into<crate::model::Resource>,
5917    {
5918        use std::iter::Iterator;
5919        self.resources = v.into_iter().map(|i| i.into()).collect();
5920        self
5921    }
5922
5923    /// Sets the value of [next_page_token][crate::model::ListResourcesResponse::next_page_token].
5924    ///
5925    /// # Example
5926    /// ```ignore,no_run
5927    /// # use google_cloud_config_v1::model::ListResourcesResponse;
5928    /// let x = ListResourcesResponse::new().set_next_page_token("example");
5929    /// ```
5930    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5931        self.next_page_token = v.into();
5932        self
5933    }
5934
5935    /// Sets the value of [unreachable][crate::model::ListResourcesResponse::unreachable].
5936    ///
5937    /// # Example
5938    /// ```ignore,no_run
5939    /// # use google_cloud_config_v1::model::ListResourcesResponse;
5940    /// let x = ListResourcesResponse::new().set_unreachable(["a", "b", "c"]);
5941    /// ```
5942    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
5943    where
5944        T: std::iter::IntoIterator<Item = V>,
5945        V: std::convert::Into<std::string::String>,
5946    {
5947        use std::iter::Iterator;
5948        self.unreachable = v.into_iter().map(|i| i.into()).collect();
5949        self
5950    }
5951}
5952
5953impl wkt::message::Message for ListResourcesResponse {
5954    fn typename() -> &'static str {
5955        "type.googleapis.com/google.cloud.config.v1.ListResourcesResponse"
5956    }
5957}
5958
5959#[doc(hidden)]
5960impl google_cloud_gax::paginator::internal::PageableResponse for ListResourcesResponse {
5961    type PageItem = crate::model::Resource;
5962
5963    fn items(self) -> std::vec::Vec<Self::PageItem> {
5964        self.resources
5965    }
5966
5967    fn next_page_token(&self) -> std::string::String {
5968        use std::clone::Clone;
5969        self.next_page_token.clone()
5970    }
5971}
5972
5973/// Contains info about a Terraform state file
5974#[derive(Clone, Default, PartialEq)]
5975#[non_exhaustive]
5976pub struct Statefile {
5977    /// Output only. Cloud Storage signed URI used for downloading or uploading the
5978    /// state file.
5979    pub signed_uri: std::string::String,
5980
5981    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5982}
5983
5984impl Statefile {
5985    pub fn new() -> Self {
5986        std::default::Default::default()
5987    }
5988
5989    /// Sets the value of [signed_uri][crate::model::Statefile::signed_uri].
5990    ///
5991    /// # Example
5992    /// ```ignore,no_run
5993    /// # use google_cloud_config_v1::model::Statefile;
5994    /// let x = Statefile::new().set_signed_uri("example");
5995    /// ```
5996    pub fn set_signed_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5997        self.signed_uri = v.into();
5998        self
5999    }
6000}
6001
6002impl wkt::message::Message for Statefile {
6003    fn typename() -> &'static str {
6004        "type.googleapis.com/google.cloud.config.v1.Statefile"
6005    }
6006}
6007
6008/// A request to export a state file passed to a 'ExportDeploymentStatefile'
6009/// call.
6010#[derive(Clone, Default, PartialEq)]
6011#[non_exhaustive]
6012pub struct ExportDeploymentStatefileRequest {
6013    /// Required. The parent in whose context the statefile is listed. The parent
6014    /// value is in the format:
6015    /// 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
6016    pub parent: std::string::String,
6017
6018    /// Optional. If this flag is set to true, the exported deployment state file
6019    /// will be the draft state. This will enable the draft file to be validated
6020    /// before copying it over to the working state on unlock.
6021    pub draft: bool,
6022
6023    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6024}
6025
6026impl ExportDeploymentStatefileRequest {
6027    pub fn new() -> Self {
6028        std::default::Default::default()
6029    }
6030
6031    /// Sets the value of [parent][crate::model::ExportDeploymentStatefileRequest::parent].
6032    ///
6033    /// # Example
6034    /// ```ignore,no_run
6035    /// # use google_cloud_config_v1::model::ExportDeploymentStatefileRequest;
6036    /// let x = ExportDeploymentStatefileRequest::new().set_parent("example");
6037    /// ```
6038    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6039        self.parent = v.into();
6040        self
6041    }
6042
6043    /// Sets the value of [draft][crate::model::ExportDeploymentStatefileRequest::draft].
6044    ///
6045    /// # Example
6046    /// ```ignore,no_run
6047    /// # use google_cloud_config_v1::model::ExportDeploymentStatefileRequest;
6048    /// let x = ExportDeploymentStatefileRequest::new().set_draft(true);
6049    /// ```
6050    pub fn set_draft<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6051        self.draft = v.into();
6052        self
6053    }
6054}
6055
6056impl wkt::message::Message for ExportDeploymentStatefileRequest {
6057    fn typename() -> &'static str {
6058        "type.googleapis.com/google.cloud.config.v1.ExportDeploymentStatefileRequest"
6059    }
6060}
6061
6062/// A request to export a state file passed to a 'ExportRevisionStatefile'
6063/// call.
6064#[derive(Clone, Default, PartialEq)]
6065#[non_exhaustive]
6066pub struct ExportRevisionStatefileRequest {
6067    /// Required. The parent in whose context the statefile is listed. The parent
6068    /// value is in the format:
6069    /// 'projects/{project_id}/locations/{location}/deployments/{deployment}/revisions/{revision}'.
6070    pub parent: std::string::String,
6071
6072    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6073}
6074
6075impl ExportRevisionStatefileRequest {
6076    pub fn new() -> Self {
6077        std::default::Default::default()
6078    }
6079
6080    /// Sets the value of [parent][crate::model::ExportRevisionStatefileRequest::parent].
6081    ///
6082    /// # Example
6083    /// ```ignore,no_run
6084    /// # use google_cloud_config_v1::model::ExportRevisionStatefileRequest;
6085    /// let x = ExportRevisionStatefileRequest::new().set_parent("example");
6086    /// ```
6087    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6088        self.parent = v.into();
6089        self
6090    }
6091}
6092
6093impl wkt::message::Message for ExportRevisionStatefileRequest {
6094    fn typename() -> &'static str {
6095        "type.googleapis.com/google.cloud.config.v1.ExportRevisionStatefileRequest"
6096    }
6097}
6098
6099/// A request to import a state file passed to a 'ImportStatefile' call.
6100#[derive(Clone, Default, PartialEq)]
6101#[non_exhaustive]
6102pub struct ImportStatefileRequest {
6103    /// Required. The parent in whose context the statefile is listed. The parent
6104    /// value is in the format:
6105    /// 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
6106    pub parent: std::string::String,
6107
6108    /// Required. Lock ID of the lock file to verify that the user who is importing
6109    /// the state file previously locked the Deployment.
6110    pub lock_id: i64,
6111
6112    /// Optional.
6113    pub skip_draft: bool,
6114
6115    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6116}
6117
6118impl ImportStatefileRequest {
6119    pub fn new() -> Self {
6120        std::default::Default::default()
6121    }
6122
6123    /// Sets the value of [parent][crate::model::ImportStatefileRequest::parent].
6124    ///
6125    /// # Example
6126    /// ```ignore,no_run
6127    /// # use google_cloud_config_v1::model::ImportStatefileRequest;
6128    /// let x = ImportStatefileRequest::new().set_parent("example");
6129    /// ```
6130    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6131        self.parent = v.into();
6132        self
6133    }
6134
6135    /// Sets the value of [lock_id][crate::model::ImportStatefileRequest::lock_id].
6136    ///
6137    /// # Example
6138    /// ```ignore,no_run
6139    /// # use google_cloud_config_v1::model::ImportStatefileRequest;
6140    /// let x = ImportStatefileRequest::new().set_lock_id(42);
6141    /// ```
6142    pub fn set_lock_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
6143        self.lock_id = v.into();
6144        self
6145    }
6146
6147    /// Sets the value of [skip_draft][crate::model::ImportStatefileRequest::skip_draft].
6148    ///
6149    /// # Example
6150    /// ```ignore,no_run
6151    /// # use google_cloud_config_v1::model::ImportStatefileRequest;
6152    /// let x = ImportStatefileRequest::new().set_skip_draft(true);
6153    /// ```
6154    pub fn set_skip_draft<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6155        self.skip_draft = v.into();
6156        self
6157    }
6158}
6159
6160impl wkt::message::Message for ImportStatefileRequest {
6161    fn typename() -> &'static str {
6162        "type.googleapis.com/google.cloud.config.v1.ImportStatefileRequest"
6163    }
6164}
6165
6166/// A request to delete a state file passed to a 'DeleteStatefile' call.
6167#[derive(Clone, Default, PartialEq)]
6168#[non_exhaustive]
6169pub struct DeleteStatefileRequest {
6170    /// Required. The name of the deployment in the format:
6171    /// 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
6172    pub name: std::string::String,
6173
6174    /// Required. Lock ID of the lock file to verify that the user who is deleting
6175    /// the state file previously locked the Deployment.
6176    pub lock_id: i64,
6177
6178    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6179}
6180
6181impl DeleteStatefileRequest {
6182    pub fn new() -> Self {
6183        std::default::Default::default()
6184    }
6185
6186    /// Sets the value of [name][crate::model::DeleteStatefileRequest::name].
6187    ///
6188    /// # Example
6189    /// ```ignore,no_run
6190    /// # use google_cloud_config_v1::model::DeleteStatefileRequest;
6191    /// let x = DeleteStatefileRequest::new().set_name("example");
6192    /// ```
6193    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6194        self.name = v.into();
6195        self
6196    }
6197
6198    /// Sets the value of [lock_id][crate::model::DeleteStatefileRequest::lock_id].
6199    ///
6200    /// # Example
6201    /// ```ignore,no_run
6202    /// # use google_cloud_config_v1::model::DeleteStatefileRequest;
6203    /// let x = DeleteStatefileRequest::new().set_lock_id(42);
6204    /// ```
6205    pub fn set_lock_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
6206        self.lock_id = v.into();
6207        self
6208    }
6209}
6210
6211impl wkt::message::Message for DeleteStatefileRequest {
6212    fn typename() -> &'static str {
6213        "type.googleapis.com/google.cloud.config.v1.DeleteStatefileRequest"
6214    }
6215}
6216
6217/// A request to lock a deployment passed to a 'LockDeployment' call.
6218#[derive(Clone, Default, PartialEq)]
6219#[non_exhaustive]
6220pub struct LockDeploymentRequest {
6221    /// Required. The name of the deployment in the format:
6222    /// 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
6223    pub name: std::string::String,
6224
6225    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6226}
6227
6228impl LockDeploymentRequest {
6229    pub fn new() -> Self {
6230        std::default::Default::default()
6231    }
6232
6233    /// Sets the value of [name][crate::model::LockDeploymentRequest::name].
6234    ///
6235    /// # Example
6236    /// ```ignore,no_run
6237    /// # use google_cloud_config_v1::model::LockDeploymentRequest;
6238    /// let x = LockDeploymentRequest::new().set_name("example");
6239    /// ```
6240    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6241        self.name = v.into();
6242        self
6243    }
6244}
6245
6246impl wkt::message::Message for LockDeploymentRequest {
6247    fn typename() -> &'static str {
6248        "type.googleapis.com/google.cloud.config.v1.LockDeploymentRequest"
6249    }
6250}
6251
6252/// A request to unlock a state file passed to a 'UnlockDeployment' call.
6253#[derive(Clone, Default, PartialEq)]
6254#[non_exhaustive]
6255pub struct UnlockDeploymentRequest {
6256    /// Required. The name of the deployment in the format:
6257    /// 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
6258    pub name: std::string::String,
6259
6260    /// Required. Lock ID of the lock file to be unlocked.
6261    pub lock_id: i64,
6262
6263    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6264}
6265
6266impl UnlockDeploymentRequest {
6267    pub fn new() -> Self {
6268        std::default::Default::default()
6269    }
6270
6271    /// Sets the value of [name][crate::model::UnlockDeploymentRequest::name].
6272    ///
6273    /// # Example
6274    /// ```ignore,no_run
6275    /// # use google_cloud_config_v1::model::UnlockDeploymentRequest;
6276    /// let x = UnlockDeploymentRequest::new().set_name("example");
6277    /// ```
6278    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6279        self.name = v.into();
6280        self
6281    }
6282
6283    /// Sets the value of [lock_id][crate::model::UnlockDeploymentRequest::lock_id].
6284    ///
6285    /// # Example
6286    /// ```ignore,no_run
6287    /// # use google_cloud_config_v1::model::UnlockDeploymentRequest;
6288    /// let x = UnlockDeploymentRequest::new().set_lock_id(42);
6289    /// ```
6290    pub fn set_lock_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
6291        self.lock_id = v.into();
6292        self
6293    }
6294}
6295
6296impl wkt::message::Message for UnlockDeploymentRequest {
6297    fn typename() -> &'static str {
6298        "type.googleapis.com/google.cloud.config.v1.UnlockDeploymentRequest"
6299    }
6300}
6301
6302/// A request to get a state file lock info passed to a 'ExportLockInfo' call.
6303#[derive(Clone, Default, PartialEq)]
6304#[non_exhaustive]
6305pub struct ExportLockInfoRequest {
6306    /// Required. The name of the deployment in the format:
6307    /// 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
6308    pub name: std::string::String,
6309
6310    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6311}
6312
6313impl ExportLockInfoRequest {
6314    pub fn new() -> Self {
6315        std::default::Default::default()
6316    }
6317
6318    /// Sets the value of [name][crate::model::ExportLockInfoRequest::name].
6319    ///
6320    /// # Example
6321    /// ```ignore,no_run
6322    /// # use google_cloud_config_v1::model::ExportLockInfoRequest;
6323    /// let x = ExportLockInfoRequest::new().set_name("example");
6324    /// ```
6325    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6326        self.name = v.into();
6327        self
6328    }
6329}
6330
6331impl wkt::message::Message for ExportLockInfoRequest {
6332    fn typename() -> &'static str {
6333        "type.googleapis.com/google.cloud.config.v1.ExportLockInfoRequest"
6334    }
6335}
6336
6337/// Details about the lock which locked the deployment.
6338#[derive(Clone, Default, PartialEq)]
6339#[non_exhaustive]
6340pub struct LockInfo {
6341    /// Unique ID for the lock to be overridden with generation ID in the backend.
6342    pub lock_id: i64,
6343
6344    /// Terraform operation, provided by the caller.
6345    pub operation: std::string::String,
6346
6347    /// Extra information to store with the lock, provided by the caller.
6348    pub info: std::string::String,
6349
6350    /// user@hostname when available
6351    pub who: std::string::String,
6352
6353    /// Terraform version
6354    pub version: std::string::String,
6355
6356    /// Time that the lock was taken.
6357    pub create_time: std::option::Option<wkt::Timestamp>,
6358
6359    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6360}
6361
6362impl LockInfo {
6363    pub fn new() -> Self {
6364        std::default::Default::default()
6365    }
6366
6367    /// Sets the value of [lock_id][crate::model::LockInfo::lock_id].
6368    ///
6369    /// # Example
6370    /// ```ignore,no_run
6371    /// # use google_cloud_config_v1::model::LockInfo;
6372    /// let x = LockInfo::new().set_lock_id(42);
6373    /// ```
6374    pub fn set_lock_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
6375        self.lock_id = v.into();
6376        self
6377    }
6378
6379    /// Sets the value of [operation][crate::model::LockInfo::operation].
6380    ///
6381    /// # Example
6382    /// ```ignore,no_run
6383    /// # use google_cloud_config_v1::model::LockInfo;
6384    /// let x = LockInfo::new().set_operation("example");
6385    /// ```
6386    pub fn set_operation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6387        self.operation = v.into();
6388        self
6389    }
6390
6391    /// Sets the value of [info][crate::model::LockInfo::info].
6392    ///
6393    /// # Example
6394    /// ```ignore,no_run
6395    /// # use google_cloud_config_v1::model::LockInfo;
6396    /// let x = LockInfo::new().set_info("example");
6397    /// ```
6398    pub fn set_info<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6399        self.info = v.into();
6400        self
6401    }
6402
6403    /// Sets the value of [who][crate::model::LockInfo::who].
6404    ///
6405    /// # Example
6406    /// ```ignore,no_run
6407    /// # use google_cloud_config_v1::model::LockInfo;
6408    /// let x = LockInfo::new().set_who("example");
6409    /// ```
6410    pub fn set_who<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6411        self.who = v.into();
6412        self
6413    }
6414
6415    /// Sets the value of [version][crate::model::LockInfo::version].
6416    ///
6417    /// # Example
6418    /// ```ignore,no_run
6419    /// # use google_cloud_config_v1::model::LockInfo;
6420    /// let x = LockInfo::new().set_version("example");
6421    /// ```
6422    pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6423        self.version = v.into();
6424        self
6425    }
6426
6427    /// Sets the value of [create_time][crate::model::LockInfo::create_time].
6428    ///
6429    /// # Example
6430    /// ```ignore,no_run
6431    /// # use google_cloud_config_v1::model::LockInfo;
6432    /// use wkt::Timestamp;
6433    /// let x = LockInfo::new().set_create_time(Timestamp::default()/* use setters */);
6434    /// ```
6435    pub fn set_create_time<T>(mut self, v: T) -> Self
6436    where
6437        T: std::convert::Into<wkt::Timestamp>,
6438    {
6439        self.create_time = std::option::Option::Some(v.into());
6440        self
6441    }
6442
6443    /// Sets or clears the value of [create_time][crate::model::LockInfo::create_time].
6444    ///
6445    /// # Example
6446    /// ```ignore,no_run
6447    /// # use google_cloud_config_v1::model::LockInfo;
6448    /// use wkt::Timestamp;
6449    /// let x = LockInfo::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
6450    /// let x = LockInfo::new().set_or_clear_create_time(None::<Timestamp>);
6451    /// ```
6452    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
6453    where
6454        T: std::convert::Into<wkt::Timestamp>,
6455    {
6456        self.create_time = v.map(|x| x.into());
6457        self
6458    }
6459}
6460
6461impl wkt::message::Message for LockInfo {
6462    fn typename() -> &'static str {
6463        "type.googleapis.com/google.cloud.config.v1.LockInfo"
6464    }
6465}
6466
6467/// A preview represents a set of actions Infra Manager would perform
6468/// to move the resources towards the desired state as specified in the
6469/// configuration.
6470#[derive(Clone, Default, PartialEq)]
6471#[non_exhaustive]
6472pub struct Preview {
6473    /// Identifier. Resource name of the preview. Resource name can be user
6474    /// provided or server generated ID if unspecified. Format:
6475    /// `projects/{project}/locations/{location}/previews/{preview}`
6476    pub name: std::string::String,
6477
6478    /// Output only. Time the preview was created.
6479    pub create_time: std::option::Option<wkt::Timestamp>,
6480
6481    /// Optional. User-defined labels for the preview.
6482    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
6483
6484    /// Output only. Current state of the preview.
6485    pub state: crate::model::preview::State,
6486
6487    /// Optional. Optional deployment reference. If specified, the preview will be
6488    /// performed using the provided deployment's current state and use any
6489    /// relevant fields from the deployment unless explicitly specified in the
6490    /// preview create request.
6491    pub deployment: std::string::String,
6492
6493    /// Optional. Current mode of preview.
6494    pub preview_mode: crate::model::preview::PreviewMode,
6495
6496    /// Required. User-specified Service Account (SA) credentials to be used when
6497    /// previewing resources.
6498    /// Format: `projects/{projectID}/serviceAccounts/{serviceAccount}`
6499    pub service_account: std::string::String,
6500
6501    /// Optional. User-defined location of Cloud Build logs, artifacts, and
6502    /// in Google Cloud Storage.
6503    /// Format: `gs://{bucket}/{folder}`
6504    /// A default bucket will be bootstrapped if the field is not set or empty
6505    /// Default Bucket Format: `gs://<project number>-<region>-blueprint-config`
6506    /// Constraints:
6507    ///
6508    /// - The bucket needs to be in the same project as the deployment
6509    /// - The path cannot be within the path of `gcs_source`
6510    ///   If omitted and deployment resource ref provided has artifacts_gcs_bucket
6511    ///   defined, that artifact bucket is used.
6512    pub artifacts_gcs_bucket: std::option::Option<std::string::String>,
6513
6514    /// Optional. The user-specified Worker Pool resource in which the Cloud Build
6515    /// job will execute. Format
6516    /// projects/{project}/locations/{location}/workerPools/{workerPoolId} If this
6517    /// field is unspecified, the default Cloud Build worker pool will be used. If
6518    /// omitted and deployment resource ref provided has worker_pool defined, that
6519    /// worker pool is used.
6520    pub worker_pool: std::option::Option<std::string::String>,
6521
6522    /// Output only. Code describing any errors that may have occurred.
6523    pub error_code: crate::model::preview::ErrorCode,
6524
6525    /// Output only. Additional information regarding the current state.
6526    pub error_status: std::option::Option<google_cloud_rpc::model::Status>,
6527
6528    /// Output only. Cloud Build instance UUID associated with this preview.
6529    pub build: std::string::String,
6530
6531    /// Output only. Summary of errors encountered during Terraform preview.
6532    /// It has a size limit of 10, i.e. only top 10 errors will be summarized here.
6533    pub tf_errors: std::vec::Vec<crate::model::TerraformError>,
6534
6535    /// Output only. Link to tf-error.ndjson file, which contains the full list of
6536    /// the errors encountered during a Terraform preview.
6537    /// Format: `gs://{bucket}/{object}`.
6538    pub error_logs: std::string::String,
6539
6540    /// Output only. Artifacts from preview.
6541    pub preview_artifacts: std::option::Option<crate::model::PreviewArtifacts>,
6542
6543    /// Output only. Location of preview logs in `gs://{bucket}/{object}` format.
6544    pub logs: std::string::String,
6545
6546    /// Output only. The current Terraform version set on the preview.
6547    /// It is in the format of "Major.Minor.Patch", for example, "1.3.10".
6548    pub tf_version: std::string::String,
6549
6550    /// Optional. The user-specified Terraform version constraint.
6551    /// Example: "=1.3.10".
6552    pub tf_version_constraint: std::option::Option<std::string::String>,
6553
6554    /// Optional. Arbitrary key-value metadata storage e.g. to help client tools
6555    /// identify preview during automation. See
6556    /// <https://google.aip.dev/148#annotations> for details on format and size
6557    /// limitations.
6558    pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
6559
6560    /// Optional. This field specifies the provider configurations.
6561    pub provider_config: std::option::Option<crate::model::ProviderConfig>,
6562
6563    /// Blueprint to preview.
6564    pub blueprint: std::option::Option<crate::model::preview::Blueprint>,
6565
6566    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6567}
6568
6569impl Preview {
6570    pub fn new() -> Self {
6571        std::default::Default::default()
6572    }
6573
6574    /// Sets the value of [name][crate::model::Preview::name].
6575    ///
6576    /// # Example
6577    /// ```ignore,no_run
6578    /// # use google_cloud_config_v1::model::Preview;
6579    /// let x = Preview::new().set_name("example");
6580    /// ```
6581    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6582        self.name = v.into();
6583        self
6584    }
6585
6586    /// Sets the value of [create_time][crate::model::Preview::create_time].
6587    ///
6588    /// # Example
6589    /// ```ignore,no_run
6590    /// # use google_cloud_config_v1::model::Preview;
6591    /// use wkt::Timestamp;
6592    /// let x = Preview::new().set_create_time(Timestamp::default()/* use setters */);
6593    /// ```
6594    pub fn set_create_time<T>(mut self, v: T) -> Self
6595    where
6596        T: std::convert::Into<wkt::Timestamp>,
6597    {
6598        self.create_time = std::option::Option::Some(v.into());
6599        self
6600    }
6601
6602    /// Sets or clears the value of [create_time][crate::model::Preview::create_time].
6603    ///
6604    /// # Example
6605    /// ```ignore,no_run
6606    /// # use google_cloud_config_v1::model::Preview;
6607    /// use wkt::Timestamp;
6608    /// let x = Preview::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
6609    /// let x = Preview::new().set_or_clear_create_time(None::<Timestamp>);
6610    /// ```
6611    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
6612    where
6613        T: std::convert::Into<wkt::Timestamp>,
6614    {
6615        self.create_time = v.map(|x| x.into());
6616        self
6617    }
6618
6619    /// Sets the value of [labels][crate::model::Preview::labels].
6620    ///
6621    /// # Example
6622    /// ```ignore,no_run
6623    /// # use google_cloud_config_v1::model::Preview;
6624    /// let x = Preview::new().set_labels([
6625    ///     ("key0", "abc"),
6626    ///     ("key1", "xyz"),
6627    /// ]);
6628    /// ```
6629    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
6630    where
6631        T: std::iter::IntoIterator<Item = (K, V)>,
6632        K: std::convert::Into<std::string::String>,
6633        V: std::convert::Into<std::string::String>,
6634    {
6635        use std::iter::Iterator;
6636        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
6637        self
6638    }
6639
6640    /// Sets the value of [state][crate::model::Preview::state].
6641    ///
6642    /// # Example
6643    /// ```ignore,no_run
6644    /// # use google_cloud_config_v1::model::Preview;
6645    /// use google_cloud_config_v1::model::preview::State;
6646    /// let x0 = Preview::new().set_state(State::Creating);
6647    /// let x1 = Preview::new().set_state(State::Succeeded);
6648    /// let x2 = Preview::new().set_state(State::Applying);
6649    /// ```
6650    pub fn set_state<T: std::convert::Into<crate::model::preview::State>>(mut self, v: T) -> Self {
6651        self.state = v.into();
6652        self
6653    }
6654
6655    /// Sets the value of [deployment][crate::model::Preview::deployment].
6656    ///
6657    /// # Example
6658    /// ```ignore,no_run
6659    /// # use google_cloud_config_v1::model::Preview;
6660    /// let x = Preview::new().set_deployment("example");
6661    /// ```
6662    pub fn set_deployment<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6663        self.deployment = v.into();
6664        self
6665    }
6666
6667    /// Sets the value of [preview_mode][crate::model::Preview::preview_mode].
6668    ///
6669    /// # Example
6670    /// ```ignore,no_run
6671    /// # use google_cloud_config_v1::model::Preview;
6672    /// use google_cloud_config_v1::model::preview::PreviewMode;
6673    /// let x0 = Preview::new().set_preview_mode(PreviewMode::Default);
6674    /// let x1 = Preview::new().set_preview_mode(PreviewMode::Delete);
6675    /// ```
6676    pub fn set_preview_mode<T: std::convert::Into<crate::model::preview::PreviewMode>>(
6677        mut self,
6678        v: T,
6679    ) -> Self {
6680        self.preview_mode = v.into();
6681        self
6682    }
6683
6684    /// Sets the value of [service_account][crate::model::Preview::service_account].
6685    ///
6686    /// # Example
6687    /// ```ignore,no_run
6688    /// # use google_cloud_config_v1::model::Preview;
6689    /// let x = Preview::new().set_service_account("example");
6690    /// ```
6691    pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6692        self.service_account = v.into();
6693        self
6694    }
6695
6696    /// Sets the value of [artifacts_gcs_bucket][crate::model::Preview::artifacts_gcs_bucket].
6697    ///
6698    /// # Example
6699    /// ```ignore,no_run
6700    /// # use google_cloud_config_v1::model::Preview;
6701    /// let x = Preview::new().set_artifacts_gcs_bucket("example");
6702    /// ```
6703    pub fn set_artifacts_gcs_bucket<T>(mut self, v: T) -> Self
6704    where
6705        T: std::convert::Into<std::string::String>,
6706    {
6707        self.artifacts_gcs_bucket = std::option::Option::Some(v.into());
6708        self
6709    }
6710
6711    /// Sets or clears the value of [artifacts_gcs_bucket][crate::model::Preview::artifacts_gcs_bucket].
6712    ///
6713    /// # Example
6714    /// ```ignore,no_run
6715    /// # use google_cloud_config_v1::model::Preview;
6716    /// let x = Preview::new().set_or_clear_artifacts_gcs_bucket(Some("example"));
6717    /// let x = Preview::new().set_or_clear_artifacts_gcs_bucket(None::<String>);
6718    /// ```
6719    pub fn set_or_clear_artifacts_gcs_bucket<T>(mut self, v: std::option::Option<T>) -> Self
6720    where
6721        T: std::convert::Into<std::string::String>,
6722    {
6723        self.artifacts_gcs_bucket = v.map(|x| x.into());
6724        self
6725    }
6726
6727    /// Sets the value of [worker_pool][crate::model::Preview::worker_pool].
6728    ///
6729    /// # Example
6730    /// ```ignore,no_run
6731    /// # use google_cloud_config_v1::model::Preview;
6732    /// let x = Preview::new().set_worker_pool("example");
6733    /// ```
6734    pub fn set_worker_pool<T>(mut self, v: T) -> Self
6735    where
6736        T: std::convert::Into<std::string::String>,
6737    {
6738        self.worker_pool = std::option::Option::Some(v.into());
6739        self
6740    }
6741
6742    /// Sets or clears the value of [worker_pool][crate::model::Preview::worker_pool].
6743    ///
6744    /// # Example
6745    /// ```ignore,no_run
6746    /// # use google_cloud_config_v1::model::Preview;
6747    /// let x = Preview::new().set_or_clear_worker_pool(Some("example"));
6748    /// let x = Preview::new().set_or_clear_worker_pool(None::<String>);
6749    /// ```
6750    pub fn set_or_clear_worker_pool<T>(mut self, v: std::option::Option<T>) -> Self
6751    where
6752        T: std::convert::Into<std::string::String>,
6753    {
6754        self.worker_pool = v.map(|x| x.into());
6755        self
6756    }
6757
6758    /// Sets the value of [error_code][crate::model::Preview::error_code].
6759    ///
6760    /// # Example
6761    /// ```ignore,no_run
6762    /// # use google_cloud_config_v1::model::Preview;
6763    /// use google_cloud_config_v1::model::preview::ErrorCode;
6764    /// let x0 = Preview::new().set_error_code(ErrorCode::CloudBuildPermissionDenied);
6765    /// let x1 = Preview::new().set_error_code(ErrorCode::BucketCreationPermissionDenied);
6766    /// let x2 = Preview::new().set_error_code(ErrorCode::BucketCreationFailed);
6767    /// ```
6768    pub fn set_error_code<T: std::convert::Into<crate::model::preview::ErrorCode>>(
6769        mut self,
6770        v: T,
6771    ) -> Self {
6772        self.error_code = v.into();
6773        self
6774    }
6775
6776    /// Sets the value of [error_status][crate::model::Preview::error_status].
6777    ///
6778    /// # Example
6779    /// ```ignore,no_run
6780    /// # use google_cloud_config_v1::model::Preview;
6781    /// use google_cloud_rpc::model::Status;
6782    /// let x = Preview::new().set_error_status(Status::default()/* use setters */);
6783    /// ```
6784    pub fn set_error_status<T>(mut self, v: T) -> Self
6785    where
6786        T: std::convert::Into<google_cloud_rpc::model::Status>,
6787    {
6788        self.error_status = std::option::Option::Some(v.into());
6789        self
6790    }
6791
6792    /// Sets or clears the value of [error_status][crate::model::Preview::error_status].
6793    ///
6794    /// # Example
6795    /// ```ignore,no_run
6796    /// # use google_cloud_config_v1::model::Preview;
6797    /// use google_cloud_rpc::model::Status;
6798    /// let x = Preview::new().set_or_clear_error_status(Some(Status::default()/* use setters */));
6799    /// let x = Preview::new().set_or_clear_error_status(None::<Status>);
6800    /// ```
6801    pub fn set_or_clear_error_status<T>(mut self, v: std::option::Option<T>) -> Self
6802    where
6803        T: std::convert::Into<google_cloud_rpc::model::Status>,
6804    {
6805        self.error_status = v.map(|x| x.into());
6806        self
6807    }
6808
6809    /// Sets the value of [build][crate::model::Preview::build].
6810    ///
6811    /// # Example
6812    /// ```ignore,no_run
6813    /// # use google_cloud_config_v1::model::Preview;
6814    /// let x = Preview::new().set_build("example");
6815    /// ```
6816    pub fn set_build<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6817        self.build = v.into();
6818        self
6819    }
6820
6821    /// Sets the value of [tf_errors][crate::model::Preview::tf_errors].
6822    ///
6823    /// # Example
6824    /// ```ignore,no_run
6825    /// # use google_cloud_config_v1::model::Preview;
6826    /// use google_cloud_config_v1::model::TerraformError;
6827    /// let x = Preview::new()
6828    ///     .set_tf_errors([
6829    ///         TerraformError::default()/* use setters */,
6830    ///         TerraformError::default()/* use (different) setters */,
6831    ///     ]);
6832    /// ```
6833    pub fn set_tf_errors<T, V>(mut self, v: T) -> Self
6834    where
6835        T: std::iter::IntoIterator<Item = V>,
6836        V: std::convert::Into<crate::model::TerraformError>,
6837    {
6838        use std::iter::Iterator;
6839        self.tf_errors = v.into_iter().map(|i| i.into()).collect();
6840        self
6841    }
6842
6843    /// Sets the value of [error_logs][crate::model::Preview::error_logs].
6844    ///
6845    /// # Example
6846    /// ```ignore,no_run
6847    /// # use google_cloud_config_v1::model::Preview;
6848    /// let x = Preview::new().set_error_logs("example");
6849    /// ```
6850    pub fn set_error_logs<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6851        self.error_logs = v.into();
6852        self
6853    }
6854
6855    /// Sets the value of [preview_artifacts][crate::model::Preview::preview_artifacts].
6856    ///
6857    /// # Example
6858    /// ```ignore,no_run
6859    /// # use google_cloud_config_v1::model::Preview;
6860    /// use google_cloud_config_v1::model::PreviewArtifacts;
6861    /// let x = Preview::new().set_preview_artifacts(PreviewArtifacts::default()/* use setters */);
6862    /// ```
6863    pub fn set_preview_artifacts<T>(mut self, v: T) -> Self
6864    where
6865        T: std::convert::Into<crate::model::PreviewArtifacts>,
6866    {
6867        self.preview_artifacts = std::option::Option::Some(v.into());
6868        self
6869    }
6870
6871    /// Sets or clears the value of [preview_artifacts][crate::model::Preview::preview_artifacts].
6872    ///
6873    /// # Example
6874    /// ```ignore,no_run
6875    /// # use google_cloud_config_v1::model::Preview;
6876    /// use google_cloud_config_v1::model::PreviewArtifacts;
6877    /// let x = Preview::new().set_or_clear_preview_artifacts(Some(PreviewArtifacts::default()/* use setters */));
6878    /// let x = Preview::new().set_or_clear_preview_artifacts(None::<PreviewArtifacts>);
6879    /// ```
6880    pub fn set_or_clear_preview_artifacts<T>(mut self, v: std::option::Option<T>) -> Self
6881    where
6882        T: std::convert::Into<crate::model::PreviewArtifacts>,
6883    {
6884        self.preview_artifacts = v.map(|x| x.into());
6885        self
6886    }
6887
6888    /// Sets the value of [logs][crate::model::Preview::logs].
6889    ///
6890    /// # Example
6891    /// ```ignore,no_run
6892    /// # use google_cloud_config_v1::model::Preview;
6893    /// let x = Preview::new().set_logs("example");
6894    /// ```
6895    pub fn set_logs<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6896        self.logs = v.into();
6897        self
6898    }
6899
6900    /// Sets the value of [tf_version][crate::model::Preview::tf_version].
6901    ///
6902    /// # Example
6903    /// ```ignore,no_run
6904    /// # use google_cloud_config_v1::model::Preview;
6905    /// let x = Preview::new().set_tf_version("example");
6906    /// ```
6907    pub fn set_tf_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6908        self.tf_version = v.into();
6909        self
6910    }
6911
6912    /// Sets the value of [tf_version_constraint][crate::model::Preview::tf_version_constraint].
6913    ///
6914    /// # Example
6915    /// ```ignore,no_run
6916    /// # use google_cloud_config_v1::model::Preview;
6917    /// let x = Preview::new().set_tf_version_constraint("example");
6918    /// ```
6919    pub fn set_tf_version_constraint<T>(mut self, v: T) -> Self
6920    where
6921        T: std::convert::Into<std::string::String>,
6922    {
6923        self.tf_version_constraint = std::option::Option::Some(v.into());
6924        self
6925    }
6926
6927    /// Sets or clears the value of [tf_version_constraint][crate::model::Preview::tf_version_constraint].
6928    ///
6929    /// # Example
6930    /// ```ignore,no_run
6931    /// # use google_cloud_config_v1::model::Preview;
6932    /// let x = Preview::new().set_or_clear_tf_version_constraint(Some("example"));
6933    /// let x = Preview::new().set_or_clear_tf_version_constraint(None::<String>);
6934    /// ```
6935    pub fn set_or_clear_tf_version_constraint<T>(mut self, v: std::option::Option<T>) -> Self
6936    where
6937        T: std::convert::Into<std::string::String>,
6938    {
6939        self.tf_version_constraint = v.map(|x| x.into());
6940        self
6941    }
6942
6943    /// Sets the value of [annotations][crate::model::Preview::annotations].
6944    ///
6945    /// # Example
6946    /// ```ignore,no_run
6947    /// # use google_cloud_config_v1::model::Preview;
6948    /// let x = Preview::new().set_annotations([
6949    ///     ("key0", "abc"),
6950    ///     ("key1", "xyz"),
6951    /// ]);
6952    /// ```
6953    pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
6954    where
6955        T: std::iter::IntoIterator<Item = (K, V)>,
6956        K: std::convert::Into<std::string::String>,
6957        V: std::convert::Into<std::string::String>,
6958    {
6959        use std::iter::Iterator;
6960        self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
6961        self
6962    }
6963
6964    /// Sets the value of [provider_config][crate::model::Preview::provider_config].
6965    ///
6966    /// # Example
6967    /// ```ignore,no_run
6968    /// # use google_cloud_config_v1::model::Preview;
6969    /// use google_cloud_config_v1::model::ProviderConfig;
6970    /// let x = Preview::new().set_provider_config(ProviderConfig::default()/* use setters */);
6971    /// ```
6972    pub fn set_provider_config<T>(mut self, v: T) -> Self
6973    where
6974        T: std::convert::Into<crate::model::ProviderConfig>,
6975    {
6976        self.provider_config = std::option::Option::Some(v.into());
6977        self
6978    }
6979
6980    /// Sets or clears the value of [provider_config][crate::model::Preview::provider_config].
6981    ///
6982    /// # Example
6983    /// ```ignore,no_run
6984    /// # use google_cloud_config_v1::model::Preview;
6985    /// use google_cloud_config_v1::model::ProviderConfig;
6986    /// let x = Preview::new().set_or_clear_provider_config(Some(ProviderConfig::default()/* use setters */));
6987    /// let x = Preview::new().set_or_clear_provider_config(None::<ProviderConfig>);
6988    /// ```
6989    pub fn set_or_clear_provider_config<T>(mut self, v: std::option::Option<T>) -> Self
6990    where
6991        T: std::convert::Into<crate::model::ProviderConfig>,
6992    {
6993        self.provider_config = v.map(|x| x.into());
6994        self
6995    }
6996
6997    /// Sets the value of [blueprint][crate::model::Preview::blueprint].
6998    ///
6999    /// Note that all the setters affecting `blueprint` are mutually
7000    /// exclusive.
7001    ///
7002    /// # Example
7003    /// ```ignore,no_run
7004    /// # use google_cloud_config_v1::model::Preview;
7005    /// use google_cloud_config_v1::model::TerraformBlueprint;
7006    /// let x = Preview::new().set_blueprint(Some(
7007    ///     google_cloud_config_v1::model::preview::Blueprint::TerraformBlueprint(TerraformBlueprint::default().into())));
7008    /// ```
7009    pub fn set_blueprint<
7010        T: std::convert::Into<std::option::Option<crate::model::preview::Blueprint>>,
7011    >(
7012        mut self,
7013        v: T,
7014    ) -> Self {
7015        self.blueprint = v.into();
7016        self
7017    }
7018
7019    /// The value of [blueprint][crate::model::Preview::blueprint]
7020    /// if it holds a `TerraformBlueprint`, `None` if the field is not set or
7021    /// holds a different branch.
7022    pub fn terraform_blueprint(
7023        &self,
7024    ) -> std::option::Option<&std::boxed::Box<crate::model::TerraformBlueprint>> {
7025        #[allow(unreachable_patterns)]
7026        self.blueprint.as_ref().and_then(|v| match v {
7027            crate::model::preview::Blueprint::TerraformBlueprint(v) => std::option::Option::Some(v),
7028            _ => std::option::Option::None,
7029        })
7030    }
7031
7032    /// Sets the value of [blueprint][crate::model::Preview::blueprint]
7033    /// to hold a `TerraformBlueprint`.
7034    ///
7035    /// Note that all the setters affecting `blueprint` are
7036    /// mutually exclusive.
7037    ///
7038    /// # Example
7039    /// ```ignore,no_run
7040    /// # use google_cloud_config_v1::model::Preview;
7041    /// use google_cloud_config_v1::model::TerraformBlueprint;
7042    /// let x = Preview::new().set_terraform_blueprint(TerraformBlueprint::default()/* use setters */);
7043    /// assert!(x.terraform_blueprint().is_some());
7044    /// ```
7045    pub fn set_terraform_blueprint<
7046        T: std::convert::Into<std::boxed::Box<crate::model::TerraformBlueprint>>,
7047    >(
7048        mut self,
7049        v: T,
7050    ) -> Self {
7051        self.blueprint = std::option::Option::Some(
7052            crate::model::preview::Blueprint::TerraformBlueprint(v.into()),
7053        );
7054        self
7055    }
7056}
7057
7058impl wkt::message::Message for Preview {
7059    fn typename() -> &'static str {
7060        "type.googleapis.com/google.cloud.config.v1.Preview"
7061    }
7062}
7063
7064/// Defines additional types related to [Preview].
7065pub mod preview {
7066    #[allow(unused_imports)]
7067    use super::*;
7068
7069    /// Possible states of a preview.
7070    ///
7071    /// # Working with unknown values
7072    ///
7073    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7074    /// additional enum variants at any time. Adding new variants is not considered
7075    /// a breaking change. Applications should write their code in anticipation of:
7076    ///
7077    /// - New values appearing in future releases of the client library, **and**
7078    /// - New values received dynamically, without application changes.
7079    ///
7080    /// Please consult the [Working with enums] section in the user guide for some
7081    /// guidelines.
7082    ///
7083    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
7084    #[derive(Clone, Debug, PartialEq)]
7085    #[non_exhaustive]
7086    pub enum State {
7087        /// The default value. This value is used if the state is unknown.
7088        Unspecified,
7089        /// The preview is being created.
7090        Creating,
7091        /// The preview has succeeded.
7092        Succeeded,
7093        /// The preview is being applied.
7094        Applying,
7095        /// The preview is stale. A preview can become stale if a revision has been
7096        /// applied after this preview was created.
7097        Stale,
7098        /// The preview is being deleted.
7099        Deleting,
7100        /// The preview has encountered an unexpected error.
7101        Failed,
7102        /// The preview has been deleted.
7103        Deleted,
7104        /// If set, the enum was initialized with an unknown value.
7105        ///
7106        /// Applications can examine the value using [State::value] or
7107        /// [State::name].
7108        UnknownValue(state::UnknownValue),
7109    }
7110
7111    #[doc(hidden)]
7112    pub mod state {
7113        #[allow(unused_imports)]
7114        use super::*;
7115        #[derive(Clone, Debug, PartialEq)]
7116        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7117    }
7118
7119    impl State {
7120        /// Gets the enum value.
7121        ///
7122        /// Returns `None` if the enum contains an unknown value deserialized from
7123        /// the string representation of enums.
7124        pub fn value(&self) -> std::option::Option<i32> {
7125            match self {
7126                Self::Unspecified => std::option::Option::Some(0),
7127                Self::Creating => std::option::Option::Some(1),
7128                Self::Succeeded => std::option::Option::Some(2),
7129                Self::Applying => std::option::Option::Some(3),
7130                Self::Stale => std::option::Option::Some(4),
7131                Self::Deleting => std::option::Option::Some(5),
7132                Self::Failed => std::option::Option::Some(6),
7133                Self::Deleted => std::option::Option::Some(7),
7134                Self::UnknownValue(u) => u.0.value(),
7135            }
7136        }
7137
7138        /// Gets the enum value as a string.
7139        ///
7140        /// Returns `None` if the enum contains an unknown value deserialized from
7141        /// the integer representation of enums.
7142        pub fn name(&self) -> std::option::Option<&str> {
7143            match self {
7144                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
7145                Self::Creating => std::option::Option::Some("CREATING"),
7146                Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
7147                Self::Applying => std::option::Option::Some("APPLYING"),
7148                Self::Stale => std::option::Option::Some("STALE"),
7149                Self::Deleting => std::option::Option::Some("DELETING"),
7150                Self::Failed => std::option::Option::Some("FAILED"),
7151                Self::Deleted => std::option::Option::Some("DELETED"),
7152                Self::UnknownValue(u) => u.0.name(),
7153            }
7154        }
7155    }
7156
7157    impl std::default::Default for State {
7158        fn default() -> Self {
7159            use std::convert::From;
7160            Self::from(0)
7161        }
7162    }
7163
7164    impl std::fmt::Display for State {
7165        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7166            wkt::internal::display_enum(f, self.name(), self.value())
7167        }
7168    }
7169
7170    impl std::convert::From<i32> for State {
7171        fn from(value: i32) -> Self {
7172            match value {
7173                0 => Self::Unspecified,
7174                1 => Self::Creating,
7175                2 => Self::Succeeded,
7176                3 => Self::Applying,
7177                4 => Self::Stale,
7178                5 => Self::Deleting,
7179                6 => Self::Failed,
7180                7 => Self::Deleted,
7181                _ => Self::UnknownValue(state::UnknownValue(
7182                    wkt::internal::UnknownEnumValue::Integer(value),
7183                )),
7184            }
7185        }
7186    }
7187
7188    impl std::convert::From<&str> for State {
7189        fn from(value: &str) -> Self {
7190            use std::string::ToString;
7191            match value {
7192                "STATE_UNSPECIFIED" => Self::Unspecified,
7193                "CREATING" => Self::Creating,
7194                "SUCCEEDED" => Self::Succeeded,
7195                "APPLYING" => Self::Applying,
7196                "STALE" => Self::Stale,
7197                "DELETING" => Self::Deleting,
7198                "FAILED" => Self::Failed,
7199                "DELETED" => Self::Deleted,
7200                _ => Self::UnknownValue(state::UnknownValue(
7201                    wkt::internal::UnknownEnumValue::String(value.to_string()),
7202                )),
7203            }
7204        }
7205    }
7206
7207    impl serde::ser::Serialize for State {
7208        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7209        where
7210            S: serde::Serializer,
7211        {
7212            match self {
7213                Self::Unspecified => serializer.serialize_i32(0),
7214                Self::Creating => serializer.serialize_i32(1),
7215                Self::Succeeded => serializer.serialize_i32(2),
7216                Self::Applying => serializer.serialize_i32(3),
7217                Self::Stale => serializer.serialize_i32(4),
7218                Self::Deleting => serializer.serialize_i32(5),
7219                Self::Failed => serializer.serialize_i32(6),
7220                Self::Deleted => serializer.serialize_i32(7),
7221                Self::UnknownValue(u) => u.0.serialize(serializer),
7222            }
7223        }
7224    }
7225
7226    impl<'de> serde::de::Deserialize<'de> for State {
7227        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7228        where
7229            D: serde::Deserializer<'de>,
7230        {
7231            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
7232                ".google.cloud.config.v1.Preview.State",
7233            ))
7234        }
7235    }
7236
7237    /// Preview mode provides options for customizing preview operations.
7238    ///
7239    /// # Working with unknown values
7240    ///
7241    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7242    /// additional enum variants at any time. Adding new variants is not considered
7243    /// a breaking change. Applications should write their code in anticipation of:
7244    ///
7245    /// - New values appearing in future releases of the client library, **and**
7246    /// - New values received dynamically, without application changes.
7247    ///
7248    /// Please consult the [Working with enums] section in the user guide for some
7249    /// guidelines.
7250    ///
7251    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
7252    #[derive(Clone, Debug, PartialEq)]
7253    #[non_exhaustive]
7254    pub enum PreviewMode {
7255        /// Unspecified policy, default mode will be used.
7256        Unspecified,
7257        /// DEFAULT mode generates an execution plan for reconciling current resource
7258        /// state into expected resource state.
7259        Default,
7260        /// DELETE mode generates as execution plan for destroying current resources.
7261        Delete,
7262        /// If set, the enum was initialized with an unknown value.
7263        ///
7264        /// Applications can examine the value using [PreviewMode::value] or
7265        /// [PreviewMode::name].
7266        UnknownValue(preview_mode::UnknownValue),
7267    }
7268
7269    #[doc(hidden)]
7270    pub mod preview_mode {
7271        #[allow(unused_imports)]
7272        use super::*;
7273        #[derive(Clone, Debug, PartialEq)]
7274        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7275    }
7276
7277    impl PreviewMode {
7278        /// Gets the enum value.
7279        ///
7280        /// Returns `None` if the enum contains an unknown value deserialized from
7281        /// the string representation of enums.
7282        pub fn value(&self) -> std::option::Option<i32> {
7283            match self {
7284                Self::Unspecified => std::option::Option::Some(0),
7285                Self::Default => std::option::Option::Some(1),
7286                Self::Delete => std::option::Option::Some(2),
7287                Self::UnknownValue(u) => u.0.value(),
7288            }
7289        }
7290
7291        /// Gets the enum value as a string.
7292        ///
7293        /// Returns `None` if the enum contains an unknown value deserialized from
7294        /// the integer representation of enums.
7295        pub fn name(&self) -> std::option::Option<&str> {
7296            match self {
7297                Self::Unspecified => std::option::Option::Some("PREVIEW_MODE_UNSPECIFIED"),
7298                Self::Default => std::option::Option::Some("DEFAULT"),
7299                Self::Delete => std::option::Option::Some("DELETE"),
7300                Self::UnknownValue(u) => u.0.name(),
7301            }
7302        }
7303    }
7304
7305    impl std::default::Default for PreviewMode {
7306        fn default() -> Self {
7307            use std::convert::From;
7308            Self::from(0)
7309        }
7310    }
7311
7312    impl std::fmt::Display for PreviewMode {
7313        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7314            wkt::internal::display_enum(f, self.name(), self.value())
7315        }
7316    }
7317
7318    impl std::convert::From<i32> for PreviewMode {
7319        fn from(value: i32) -> Self {
7320            match value {
7321                0 => Self::Unspecified,
7322                1 => Self::Default,
7323                2 => Self::Delete,
7324                _ => Self::UnknownValue(preview_mode::UnknownValue(
7325                    wkt::internal::UnknownEnumValue::Integer(value),
7326                )),
7327            }
7328        }
7329    }
7330
7331    impl std::convert::From<&str> for PreviewMode {
7332        fn from(value: &str) -> Self {
7333            use std::string::ToString;
7334            match value {
7335                "PREVIEW_MODE_UNSPECIFIED" => Self::Unspecified,
7336                "DEFAULT" => Self::Default,
7337                "DELETE" => Self::Delete,
7338                _ => Self::UnknownValue(preview_mode::UnknownValue(
7339                    wkt::internal::UnknownEnumValue::String(value.to_string()),
7340                )),
7341            }
7342        }
7343    }
7344
7345    impl serde::ser::Serialize for PreviewMode {
7346        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7347        where
7348            S: serde::Serializer,
7349        {
7350            match self {
7351                Self::Unspecified => serializer.serialize_i32(0),
7352                Self::Default => serializer.serialize_i32(1),
7353                Self::Delete => serializer.serialize_i32(2),
7354                Self::UnknownValue(u) => u.0.serialize(serializer),
7355            }
7356        }
7357    }
7358
7359    impl<'de> serde::de::Deserialize<'de> for PreviewMode {
7360        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7361        where
7362            D: serde::Deserializer<'de>,
7363        {
7364            deserializer.deserialize_any(wkt::internal::EnumVisitor::<PreviewMode>::new(
7365                ".google.cloud.config.v1.Preview.PreviewMode",
7366            ))
7367        }
7368    }
7369
7370    /// Possible errors that can occur with previews.
7371    ///
7372    /// # Working with unknown values
7373    ///
7374    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7375    /// additional enum variants at any time. Adding new variants is not considered
7376    /// a breaking change. Applications should write their code in anticipation of:
7377    ///
7378    /// - New values appearing in future releases of the client library, **and**
7379    /// - New values received dynamically, without application changes.
7380    ///
7381    /// Please consult the [Working with enums] section in the user guide for some
7382    /// guidelines.
7383    ///
7384    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
7385    #[derive(Clone, Debug, PartialEq)]
7386    #[non_exhaustive]
7387    pub enum ErrorCode {
7388        /// No error code was specified.
7389        Unspecified,
7390        /// Cloud Build failed due to a permissions issue.
7391        CloudBuildPermissionDenied,
7392        /// Cloud Storage bucket failed to create due to a permissions issue.
7393        BucketCreationPermissionDenied,
7394        /// Cloud Storage bucket failed for a non-permissions-related issue.
7395        BucketCreationFailed,
7396        /// Acquiring lock on provided deployment reference failed.
7397        DeploymentLockAcquireFailed,
7398        /// Preview encountered an error when trying to access Cloud Build API.
7399        PreviewBuildApiFailed,
7400        /// Preview created a build but build failed and logs were generated.
7401        PreviewBuildRunFailed,
7402        /// Failed to import values from an external source.
7403        ExternalValueSourceImportFailed,
7404        /// If set, the enum was initialized with an unknown value.
7405        ///
7406        /// Applications can examine the value using [ErrorCode::value] or
7407        /// [ErrorCode::name].
7408        UnknownValue(error_code::UnknownValue),
7409    }
7410
7411    #[doc(hidden)]
7412    pub mod error_code {
7413        #[allow(unused_imports)]
7414        use super::*;
7415        #[derive(Clone, Debug, PartialEq)]
7416        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7417    }
7418
7419    impl ErrorCode {
7420        /// Gets the enum value.
7421        ///
7422        /// Returns `None` if the enum contains an unknown value deserialized from
7423        /// the string representation of enums.
7424        pub fn value(&self) -> std::option::Option<i32> {
7425            match self {
7426                Self::Unspecified => std::option::Option::Some(0),
7427                Self::CloudBuildPermissionDenied => std::option::Option::Some(1),
7428                Self::BucketCreationPermissionDenied => std::option::Option::Some(2),
7429                Self::BucketCreationFailed => std::option::Option::Some(3),
7430                Self::DeploymentLockAcquireFailed => std::option::Option::Some(4),
7431                Self::PreviewBuildApiFailed => std::option::Option::Some(5),
7432                Self::PreviewBuildRunFailed => std::option::Option::Some(6),
7433                Self::ExternalValueSourceImportFailed => std::option::Option::Some(7),
7434                Self::UnknownValue(u) => u.0.value(),
7435            }
7436        }
7437
7438        /// Gets the enum value as a string.
7439        ///
7440        /// Returns `None` if the enum contains an unknown value deserialized from
7441        /// the integer representation of enums.
7442        pub fn name(&self) -> std::option::Option<&str> {
7443            match self {
7444                Self::Unspecified => std::option::Option::Some("ERROR_CODE_UNSPECIFIED"),
7445                Self::CloudBuildPermissionDenied => {
7446                    std::option::Option::Some("CLOUD_BUILD_PERMISSION_DENIED")
7447                }
7448                Self::BucketCreationPermissionDenied => {
7449                    std::option::Option::Some("BUCKET_CREATION_PERMISSION_DENIED")
7450                }
7451                Self::BucketCreationFailed => std::option::Option::Some("BUCKET_CREATION_FAILED"),
7452                Self::DeploymentLockAcquireFailed => {
7453                    std::option::Option::Some("DEPLOYMENT_LOCK_ACQUIRE_FAILED")
7454                }
7455                Self::PreviewBuildApiFailed => {
7456                    std::option::Option::Some("PREVIEW_BUILD_API_FAILED")
7457                }
7458                Self::PreviewBuildRunFailed => {
7459                    std::option::Option::Some("PREVIEW_BUILD_RUN_FAILED")
7460                }
7461                Self::ExternalValueSourceImportFailed => {
7462                    std::option::Option::Some("EXTERNAL_VALUE_SOURCE_IMPORT_FAILED")
7463                }
7464                Self::UnknownValue(u) => u.0.name(),
7465            }
7466        }
7467    }
7468
7469    impl std::default::Default for ErrorCode {
7470        fn default() -> Self {
7471            use std::convert::From;
7472            Self::from(0)
7473        }
7474    }
7475
7476    impl std::fmt::Display for ErrorCode {
7477        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7478            wkt::internal::display_enum(f, self.name(), self.value())
7479        }
7480    }
7481
7482    impl std::convert::From<i32> for ErrorCode {
7483        fn from(value: i32) -> Self {
7484            match value {
7485                0 => Self::Unspecified,
7486                1 => Self::CloudBuildPermissionDenied,
7487                2 => Self::BucketCreationPermissionDenied,
7488                3 => Self::BucketCreationFailed,
7489                4 => Self::DeploymentLockAcquireFailed,
7490                5 => Self::PreviewBuildApiFailed,
7491                6 => Self::PreviewBuildRunFailed,
7492                7 => Self::ExternalValueSourceImportFailed,
7493                _ => Self::UnknownValue(error_code::UnknownValue(
7494                    wkt::internal::UnknownEnumValue::Integer(value),
7495                )),
7496            }
7497        }
7498    }
7499
7500    impl std::convert::From<&str> for ErrorCode {
7501        fn from(value: &str) -> Self {
7502            use std::string::ToString;
7503            match value {
7504                "ERROR_CODE_UNSPECIFIED" => Self::Unspecified,
7505                "CLOUD_BUILD_PERMISSION_DENIED" => Self::CloudBuildPermissionDenied,
7506                "BUCKET_CREATION_PERMISSION_DENIED" => Self::BucketCreationPermissionDenied,
7507                "BUCKET_CREATION_FAILED" => Self::BucketCreationFailed,
7508                "DEPLOYMENT_LOCK_ACQUIRE_FAILED" => Self::DeploymentLockAcquireFailed,
7509                "PREVIEW_BUILD_API_FAILED" => Self::PreviewBuildApiFailed,
7510                "PREVIEW_BUILD_RUN_FAILED" => Self::PreviewBuildRunFailed,
7511                "EXTERNAL_VALUE_SOURCE_IMPORT_FAILED" => Self::ExternalValueSourceImportFailed,
7512                _ => Self::UnknownValue(error_code::UnknownValue(
7513                    wkt::internal::UnknownEnumValue::String(value.to_string()),
7514                )),
7515            }
7516        }
7517    }
7518
7519    impl serde::ser::Serialize for ErrorCode {
7520        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7521        where
7522            S: serde::Serializer,
7523        {
7524            match self {
7525                Self::Unspecified => serializer.serialize_i32(0),
7526                Self::CloudBuildPermissionDenied => serializer.serialize_i32(1),
7527                Self::BucketCreationPermissionDenied => serializer.serialize_i32(2),
7528                Self::BucketCreationFailed => serializer.serialize_i32(3),
7529                Self::DeploymentLockAcquireFailed => serializer.serialize_i32(4),
7530                Self::PreviewBuildApiFailed => serializer.serialize_i32(5),
7531                Self::PreviewBuildRunFailed => serializer.serialize_i32(6),
7532                Self::ExternalValueSourceImportFailed => serializer.serialize_i32(7),
7533                Self::UnknownValue(u) => u.0.serialize(serializer),
7534            }
7535        }
7536    }
7537
7538    impl<'de> serde::de::Deserialize<'de> for ErrorCode {
7539        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7540        where
7541            D: serde::Deserializer<'de>,
7542        {
7543            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ErrorCode>::new(
7544                ".google.cloud.config.v1.Preview.ErrorCode",
7545            ))
7546        }
7547    }
7548
7549    /// Blueprint to preview.
7550    #[derive(Clone, Debug, PartialEq)]
7551    #[non_exhaustive]
7552    pub enum Blueprint {
7553        /// The terraform blueprint to preview.
7554        TerraformBlueprint(std::boxed::Box<crate::model::TerraformBlueprint>),
7555    }
7556}
7557
7558/// Ephemeral metadata content describing the state of a preview operation.
7559#[derive(Clone, Default, PartialEq)]
7560#[non_exhaustive]
7561pub struct PreviewOperationMetadata {
7562    /// The current step the preview operation is running.
7563    pub step: crate::model::preview_operation_metadata::PreviewStep,
7564
7565    /// Artifacts from preview.
7566    pub preview_artifacts: std::option::Option<crate::model::PreviewArtifacts>,
7567
7568    /// Output only. Location of preview logs in `gs://{bucket}/{object}` format.
7569    pub logs: std::string::String,
7570
7571    /// Output only. Cloud Build instance UUID associated with this preview.
7572    pub build: std::string::String,
7573
7574    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7575}
7576
7577impl PreviewOperationMetadata {
7578    pub fn new() -> Self {
7579        std::default::Default::default()
7580    }
7581
7582    /// Sets the value of [step][crate::model::PreviewOperationMetadata::step].
7583    ///
7584    /// # Example
7585    /// ```ignore,no_run
7586    /// # use google_cloud_config_v1::model::PreviewOperationMetadata;
7587    /// use google_cloud_config_v1::model::preview_operation_metadata::PreviewStep;
7588    /// let x0 = PreviewOperationMetadata::new().set_step(PreviewStep::PreparingStorageBucket);
7589    /// let x1 = PreviewOperationMetadata::new().set_step(PreviewStep::DownloadingBlueprint);
7590    /// let x2 = PreviewOperationMetadata::new().set_step(PreviewStep::RunningTfInit);
7591    /// ```
7592    pub fn set_step<
7593        T: std::convert::Into<crate::model::preview_operation_metadata::PreviewStep>,
7594    >(
7595        mut self,
7596        v: T,
7597    ) -> Self {
7598        self.step = v.into();
7599        self
7600    }
7601
7602    /// Sets the value of [preview_artifacts][crate::model::PreviewOperationMetadata::preview_artifacts].
7603    ///
7604    /// # Example
7605    /// ```ignore,no_run
7606    /// # use google_cloud_config_v1::model::PreviewOperationMetadata;
7607    /// use google_cloud_config_v1::model::PreviewArtifacts;
7608    /// let x = PreviewOperationMetadata::new().set_preview_artifacts(PreviewArtifacts::default()/* use setters */);
7609    /// ```
7610    pub fn set_preview_artifacts<T>(mut self, v: T) -> Self
7611    where
7612        T: std::convert::Into<crate::model::PreviewArtifacts>,
7613    {
7614        self.preview_artifacts = std::option::Option::Some(v.into());
7615        self
7616    }
7617
7618    /// Sets or clears the value of [preview_artifacts][crate::model::PreviewOperationMetadata::preview_artifacts].
7619    ///
7620    /// # Example
7621    /// ```ignore,no_run
7622    /// # use google_cloud_config_v1::model::PreviewOperationMetadata;
7623    /// use google_cloud_config_v1::model::PreviewArtifacts;
7624    /// let x = PreviewOperationMetadata::new().set_or_clear_preview_artifacts(Some(PreviewArtifacts::default()/* use setters */));
7625    /// let x = PreviewOperationMetadata::new().set_or_clear_preview_artifacts(None::<PreviewArtifacts>);
7626    /// ```
7627    pub fn set_or_clear_preview_artifacts<T>(mut self, v: std::option::Option<T>) -> Self
7628    where
7629        T: std::convert::Into<crate::model::PreviewArtifacts>,
7630    {
7631        self.preview_artifacts = v.map(|x| x.into());
7632        self
7633    }
7634
7635    /// Sets the value of [logs][crate::model::PreviewOperationMetadata::logs].
7636    ///
7637    /// # Example
7638    /// ```ignore,no_run
7639    /// # use google_cloud_config_v1::model::PreviewOperationMetadata;
7640    /// let x = PreviewOperationMetadata::new().set_logs("example");
7641    /// ```
7642    pub fn set_logs<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7643        self.logs = v.into();
7644        self
7645    }
7646
7647    /// Sets the value of [build][crate::model::PreviewOperationMetadata::build].
7648    ///
7649    /// # Example
7650    /// ```ignore,no_run
7651    /// # use google_cloud_config_v1::model::PreviewOperationMetadata;
7652    /// let x = PreviewOperationMetadata::new().set_build("example");
7653    /// ```
7654    pub fn set_build<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7655        self.build = v.into();
7656        self
7657    }
7658}
7659
7660impl wkt::message::Message for PreviewOperationMetadata {
7661    fn typename() -> &'static str {
7662        "type.googleapis.com/google.cloud.config.v1.PreviewOperationMetadata"
7663    }
7664}
7665
7666/// Defines additional types related to [PreviewOperationMetadata].
7667pub mod preview_operation_metadata {
7668    #[allow(unused_imports)]
7669    use super::*;
7670
7671    /// The possible steps a preview may be running.
7672    ///
7673    /// # Working with unknown values
7674    ///
7675    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7676    /// additional enum variants at any time. Adding new variants is not considered
7677    /// a breaking change. Applications should write their code in anticipation of:
7678    ///
7679    /// - New values appearing in future releases of the client library, **and**
7680    /// - New values received dynamically, without application changes.
7681    ///
7682    /// Please consult the [Working with enums] section in the user guide for some
7683    /// guidelines.
7684    ///
7685    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
7686    #[derive(Clone, Debug, PartialEq)]
7687    #[non_exhaustive]
7688    pub enum PreviewStep {
7689        /// Unspecified preview step.
7690        Unspecified,
7691        /// Infra Manager is creating a Google Cloud Storage bucket to store
7692        /// artifacts and metadata about the preview.
7693        PreparingStorageBucket,
7694        /// Downloading the blueprint onto the Google Cloud Storage bucket.
7695        DownloadingBlueprint,
7696        /// Initializing Terraform using `terraform init`.
7697        RunningTfInit,
7698        /// Running `terraform plan`.
7699        RunningTfPlan,
7700        /// Fetching a deployment.
7701        FetchingDeployment,
7702        /// Locking a deployment.
7703        LockingDeployment,
7704        /// Unlocking a deployment.
7705        UnlockingDeployment,
7706        /// Operation was successful.
7707        Succeeded,
7708        /// Operation failed.
7709        Failed,
7710        /// Validating the provided repository.
7711        ValidatingRepository,
7712        /// If set, the enum was initialized with an unknown value.
7713        ///
7714        /// Applications can examine the value using [PreviewStep::value] or
7715        /// [PreviewStep::name].
7716        UnknownValue(preview_step::UnknownValue),
7717    }
7718
7719    #[doc(hidden)]
7720    pub mod preview_step {
7721        #[allow(unused_imports)]
7722        use super::*;
7723        #[derive(Clone, Debug, PartialEq)]
7724        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7725    }
7726
7727    impl PreviewStep {
7728        /// Gets the enum value.
7729        ///
7730        /// Returns `None` if the enum contains an unknown value deserialized from
7731        /// the string representation of enums.
7732        pub fn value(&self) -> std::option::Option<i32> {
7733            match self {
7734                Self::Unspecified => std::option::Option::Some(0),
7735                Self::PreparingStorageBucket => std::option::Option::Some(1),
7736                Self::DownloadingBlueprint => std::option::Option::Some(2),
7737                Self::RunningTfInit => std::option::Option::Some(3),
7738                Self::RunningTfPlan => std::option::Option::Some(4),
7739                Self::FetchingDeployment => std::option::Option::Some(5),
7740                Self::LockingDeployment => std::option::Option::Some(6),
7741                Self::UnlockingDeployment => std::option::Option::Some(7),
7742                Self::Succeeded => std::option::Option::Some(8),
7743                Self::Failed => std::option::Option::Some(9),
7744                Self::ValidatingRepository => std::option::Option::Some(10),
7745                Self::UnknownValue(u) => u.0.value(),
7746            }
7747        }
7748
7749        /// Gets the enum value as a string.
7750        ///
7751        /// Returns `None` if the enum contains an unknown value deserialized from
7752        /// the integer representation of enums.
7753        pub fn name(&self) -> std::option::Option<&str> {
7754            match self {
7755                Self::Unspecified => std::option::Option::Some("PREVIEW_STEP_UNSPECIFIED"),
7756                Self::PreparingStorageBucket => {
7757                    std::option::Option::Some("PREPARING_STORAGE_BUCKET")
7758                }
7759                Self::DownloadingBlueprint => std::option::Option::Some("DOWNLOADING_BLUEPRINT"),
7760                Self::RunningTfInit => std::option::Option::Some("RUNNING_TF_INIT"),
7761                Self::RunningTfPlan => std::option::Option::Some("RUNNING_TF_PLAN"),
7762                Self::FetchingDeployment => std::option::Option::Some("FETCHING_DEPLOYMENT"),
7763                Self::LockingDeployment => std::option::Option::Some("LOCKING_DEPLOYMENT"),
7764                Self::UnlockingDeployment => std::option::Option::Some("UNLOCKING_DEPLOYMENT"),
7765                Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
7766                Self::Failed => std::option::Option::Some("FAILED"),
7767                Self::ValidatingRepository => std::option::Option::Some("VALIDATING_REPOSITORY"),
7768                Self::UnknownValue(u) => u.0.name(),
7769            }
7770        }
7771    }
7772
7773    impl std::default::Default for PreviewStep {
7774        fn default() -> Self {
7775            use std::convert::From;
7776            Self::from(0)
7777        }
7778    }
7779
7780    impl std::fmt::Display for PreviewStep {
7781        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7782            wkt::internal::display_enum(f, self.name(), self.value())
7783        }
7784    }
7785
7786    impl std::convert::From<i32> for PreviewStep {
7787        fn from(value: i32) -> Self {
7788            match value {
7789                0 => Self::Unspecified,
7790                1 => Self::PreparingStorageBucket,
7791                2 => Self::DownloadingBlueprint,
7792                3 => Self::RunningTfInit,
7793                4 => Self::RunningTfPlan,
7794                5 => Self::FetchingDeployment,
7795                6 => Self::LockingDeployment,
7796                7 => Self::UnlockingDeployment,
7797                8 => Self::Succeeded,
7798                9 => Self::Failed,
7799                10 => Self::ValidatingRepository,
7800                _ => Self::UnknownValue(preview_step::UnknownValue(
7801                    wkt::internal::UnknownEnumValue::Integer(value),
7802                )),
7803            }
7804        }
7805    }
7806
7807    impl std::convert::From<&str> for PreviewStep {
7808        fn from(value: &str) -> Self {
7809            use std::string::ToString;
7810            match value {
7811                "PREVIEW_STEP_UNSPECIFIED" => Self::Unspecified,
7812                "PREPARING_STORAGE_BUCKET" => Self::PreparingStorageBucket,
7813                "DOWNLOADING_BLUEPRINT" => Self::DownloadingBlueprint,
7814                "RUNNING_TF_INIT" => Self::RunningTfInit,
7815                "RUNNING_TF_PLAN" => Self::RunningTfPlan,
7816                "FETCHING_DEPLOYMENT" => Self::FetchingDeployment,
7817                "LOCKING_DEPLOYMENT" => Self::LockingDeployment,
7818                "UNLOCKING_DEPLOYMENT" => Self::UnlockingDeployment,
7819                "SUCCEEDED" => Self::Succeeded,
7820                "FAILED" => Self::Failed,
7821                "VALIDATING_REPOSITORY" => Self::ValidatingRepository,
7822                _ => Self::UnknownValue(preview_step::UnknownValue(
7823                    wkt::internal::UnknownEnumValue::String(value.to_string()),
7824                )),
7825            }
7826        }
7827    }
7828
7829    impl serde::ser::Serialize for PreviewStep {
7830        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7831        where
7832            S: serde::Serializer,
7833        {
7834            match self {
7835                Self::Unspecified => serializer.serialize_i32(0),
7836                Self::PreparingStorageBucket => serializer.serialize_i32(1),
7837                Self::DownloadingBlueprint => serializer.serialize_i32(2),
7838                Self::RunningTfInit => serializer.serialize_i32(3),
7839                Self::RunningTfPlan => serializer.serialize_i32(4),
7840                Self::FetchingDeployment => serializer.serialize_i32(5),
7841                Self::LockingDeployment => serializer.serialize_i32(6),
7842                Self::UnlockingDeployment => serializer.serialize_i32(7),
7843                Self::Succeeded => serializer.serialize_i32(8),
7844                Self::Failed => serializer.serialize_i32(9),
7845                Self::ValidatingRepository => serializer.serialize_i32(10),
7846                Self::UnknownValue(u) => u.0.serialize(serializer),
7847            }
7848        }
7849    }
7850
7851    impl<'de> serde::de::Deserialize<'de> for PreviewStep {
7852        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7853        where
7854            D: serde::Deserializer<'de>,
7855        {
7856            deserializer.deserialize_any(wkt::internal::EnumVisitor::<PreviewStep>::new(
7857                ".google.cloud.config.v1.PreviewOperationMetadata.PreviewStep",
7858            ))
7859        }
7860    }
7861}
7862
7863/// Artifacts created by preview.
7864#[derive(Clone, Default, PartialEq)]
7865#[non_exhaustive]
7866pub struct PreviewArtifacts {
7867    /// Output only. Location of a blueprint copy and other content in Google Cloud
7868    /// Storage. Format: `gs://{bucket}/{object}`
7869    pub content: std::string::String,
7870
7871    /// Output only. Location of artifacts in Google Cloud Storage.
7872    /// Format: `gs://{bucket}/{object}`
7873    pub artifacts: std::string::String,
7874
7875    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7876}
7877
7878impl PreviewArtifacts {
7879    pub fn new() -> Self {
7880        std::default::Default::default()
7881    }
7882
7883    /// Sets the value of [content][crate::model::PreviewArtifacts::content].
7884    ///
7885    /// # Example
7886    /// ```ignore,no_run
7887    /// # use google_cloud_config_v1::model::PreviewArtifacts;
7888    /// let x = PreviewArtifacts::new().set_content("example");
7889    /// ```
7890    pub fn set_content<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7891        self.content = v.into();
7892        self
7893    }
7894
7895    /// Sets the value of [artifacts][crate::model::PreviewArtifacts::artifacts].
7896    ///
7897    /// # Example
7898    /// ```ignore,no_run
7899    /// # use google_cloud_config_v1::model::PreviewArtifacts;
7900    /// let x = PreviewArtifacts::new().set_artifacts("example");
7901    /// ```
7902    pub fn set_artifacts<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7903        self.artifacts = v.into();
7904        self
7905    }
7906}
7907
7908impl wkt::message::Message for PreviewArtifacts {
7909    fn typename() -> &'static str {
7910        "type.googleapis.com/google.cloud.config.v1.PreviewArtifacts"
7911    }
7912}
7913
7914/// A request to create a preview.
7915#[derive(Clone, Default, PartialEq)]
7916#[non_exhaustive]
7917pub struct CreatePreviewRequest {
7918    /// Required. The parent in whose context the Preview is created. The parent
7919    /// value is in the format: 'projects/{project_id}/locations/{location}'.
7920    pub parent: std::string::String,
7921
7922    /// Optional. The preview ID.
7923    pub preview_id: std::string::String,
7924
7925    /// Required. [Preview][google.cloud.config.v1.Preview] resource to be created.
7926    ///
7927    /// [google.cloud.config.v1.Preview]: crate::model::Preview
7928    pub preview: std::option::Option<crate::model::Preview>,
7929
7930    /// Optional. An optional request ID to identify requests. Specify a unique
7931    /// request ID so that if you must retry your request, the server will know to
7932    /// ignore the request if it has already been completed. The server will
7933    /// guarantee that for at least 60 minutes since the first request.
7934    ///
7935    /// For example, consider a situation where you make an initial request and the
7936    /// request times out. If you make the request again with the same request ID,
7937    /// the server can check if original operation with the same request ID was
7938    /// received, and if so, will ignore the second request. This prevents clients
7939    /// from accidentally creating duplicate commitments.
7940    ///
7941    /// The request ID must be a valid UUID with the exception that zero UUID is
7942    /// not supported (00000000-0000-0000-0000-000000000000).
7943    pub request_id: std::string::String,
7944
7945    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7946}
7947
7948impl CreatePreviewRequest {
7949    pub fn new() -> Self {
7950        std::default::Default::default()
7951    }
7952
7953    /// Sets the value of [parent][crate::model::CreatePreviewRequest::parent].
7954    ///
7955    /// # Example
7956    /// ```ignore,no_run
7957    /// # use google_cloud_config_v1::model::CreatePreviewRequest;
7958    /// let x = CreatePreviewRequest::new().set_parent("example");
7959    /// ```
7960    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7961        self.parent = v.into();
7962        self
7963    }
7964
7965    /// Sets the value of [preview_id][crate::model::CreatePreviewRequest::preview_id].
7966    ///
7967    /// # Example
7968    /// ```ignore,no_run
7969    /// # use google_cloud_config_v1::model::CreatePreviewRequest;
7970    /// let x = CreatePreviewRequest::new().set_preview_id("example");
7971    /// ```
7972    pub fn set_preview_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7973        self.preview_id = v.into();
7974        self
7975    }
7976
7977    /// Sets the value of [preview][crate::model::CreatePreviewRequest::preview].
7978    ///
7979    /// # Example
7980    /// ```ignore,no_run
7981    /// # use google_cloud_config_v1::model::CreatePreviewRequest;
7982    /// use google_cloud_config_v1::model::Preview;
7983    /// let x = CreatePreviewRequest::new().set_preview(Preview::default()/* use setters */);
7984    /// ```
7985    pub fn set_preview<T>(mut self, v: T) -> Self
7986    where
7987        T: std::convert::Into<crate::model::Preview>,
7988    {
7989        self.preview = std::option::Option::Some(v.into());
7990        self
7991    }
7992
7993    /// Sets or clears the value of [preview][crate::model::CreatePreviewRequest::preview].
7994    ///
7995    /// # Example
7996    /// ```ignore,no_run
7997    /// # use google_cloud_config_v1::model::CreatePreviewRequest;
7998    /// use google_cloud_config_v1::model::Preview;
7999    /// let x = CreatePreviewRequest::new().set_or_clear_preview(Some(Preview::default()/* use setters */));
8000    /// let x = CreatePreviewRequest::new().set_or_clear_preview(None::<Preview>);
8001    /// ```
8002    pub fn set_or_clear_preview<T>(mut self, v: std::option::Option<T>) -> Self
8003    where
8004        T: std::convert::Into<crate::model::Preview>,
8005    {
8006        self.preview = v.map(|x| x.into());
8007        self
8008    }
8009
8010    /// Sets the value of [request_id][crate::model::CreatePreviewRequest::request_id].
8011    ///
8012    /// # Example
8013    /// ```ignore,no_run
8014    /// # use google_cloud_config_v1::model::CreatePreviewRequest;
8015    /// let x = CreatePreviewRequest::new().set_request_id("example");
8016    /// ```
8017    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8018        self.request_id = v.into();
8019        self
8020    }
8021}
8022
8023impl wkt::message::Message for CreatePreviewRequest {
8024    fn typename() -> &'static str {
8025        "type.googleapis.com/google.cloud.config.v1.CreatePreviewRequest"
8026    }
8027}
8028
8029/// A request to get details about a preview.
8030#[derive(Clone, Default, PartialEq)]
8031#[non_exhaustive]
8032pub struct GetPreviewRequest {
8033    /// Required. The name of the preview. Format:
8034    /// 'projects/{project_id}/locations/{location}/previews/{preview}'.
8035    pub name: std::string::String,
8036
8037    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8038}
8039
8040impl GetPreviewRequest {
8041    pub fn new() -> Self {
8042        std::default::Default::default()
8043    }
8044
8045    /// Sets the value of [name][crate::model::GetPreviewRequest::name].
8046    ///
8047    /// # Example
8048    /// ```ignore,no_run
8049    /// # use google_cloud_config_v1::model::GetPreviewRequest;
8050    /// let x = GetPreviewRequest::new().set_name("example");
8051    /// ```
8052    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8053        self.name = v.into();
8054        self
8055    }
8056}
8057
8058impl wkt::message::Message for GetPreviewRequest {
8059    fn typename() -> &'static str {
8060        "type.googleapis.com/google.cloud.config.v1.GetPreviewRequest"
8061    }
8062}
8063
8064/// A request to list all previews for a given project and location.
8065#[derive(Clone, Default, PartialEq)]
8066#[non_exhaustive]
8067pub struct ListPreviewsRequest {
8068    /// Required. The parent in whose context the Previews are listed. The parent
8069    /// value is in the format: 'projects/{project_id}/locations/{location}'.
8070    pub parent: std::string::String,
8071
8072    /// Optional. When requesting a page of resources, 'page_size' specifies number
8073    /// of resources to return. If unspecified, at most 500 will be returned. The
8074    /// maximum value is 1000.
8075    pub page_size: i32,
8076
8077    /// Optional. Token returned by previous call to 'ListDeployments' which
8078    /// specifies the position in the list from where to continue listing the
8079    /// resources.
8080    pub page_token: std::string::String,
8081
8082    /// Optional. Lists the Deployments that match the filter expression. A filter
8083    /// expression filters the resources listed in the response. The expression
8084    /// must be of the form '{field} {operator} {value}' where operators: '<', '>',
8085    /// '<=', '>=', '!=', '=', ':' are supported (colon ':' represents a HAS
8086    /// operator which is roughly synonymous with equality). {field} can refer to a
8087    /// proto or JSON field, or a synthetic field. Field names can be camelCase or
8088    /// snake_case.
8089    ///
8090    /// Examples:
8091    ///
8092    /// - Filter by name:
8093    ///   name = "projects/foo/locations/us-central1/deployments/bar
8094    ///
8095    /// - Filter by labels:
8096    ///
8097    ///   - Resources that have a key called 'foo'
8098    ///     labels.foo:*
8099    ///   - Resources that have a key called 'foo' whose value is 'bar'
8100    ///     labels.foo = bar
8101    /// - Filter by state:
8102    ///
8103    ///   - Deployments in CREATING state.
8104    ///     state=CREATING
8105    pub filter: std::string::String,
8106
8107    /// Optional. Field to use to sort the list.
8108    pub order_by: std::string::String,
8109
8110    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8111}
8112
8113impl ListPreviewsRequest {
8114    pub fn new() -> Self {
8115        std::default::Default::default()
8116    }
8117
8118    /// Sets the value of [parent][crate::model::ListPreviewsRequest::parent].
8119    ///
8120    /// # Example
8121    /// ```ignore,no_run
8122    /// # use google_cloud_config_v1::model::ListPreviewsRequest;
8123    /// let x = ListPreviewsRequest::new().set_parent("example");
8124    /// ```
8125    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8126        self.parent = v.into();
8127        self
8128    }
8129
8130    /// Sets the value of [page_size][crate::model::ListPreviewsRequest::page_size].
8131    ///
8132    /// # Example
8133    /// ```ignore,no_run
8134    /// # use google_cloud_config_v1::model::ListPreviewsRequest;
8135    /// let x = ListPreviewsRequest::new().set_page_size(42);
8136    /// ```
8137    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8138        self.page_size = v.into();
8139        self
8140    }
8141
8142    /// Sets the value of [page_token][crate::model::ListPreviewsRequest::page_token].
8143    ///
8144    /// # Example
8145    /// ```ignore,no_run
8146    /// # use google_cloud_config_v1::model::ListPreviewsRequest;
8147    /// let x = ListPreviewsRequest::new().set_page_token("example");
8148    /// ```
8149    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8150        self.page_token = v.into();
8151        self
8152    }
8153
8154    /// Sets the value of [filter][crate::model::ListPreviewsRequest::filter].
8155    ///
8156    /// # Example
8157    /// ```ignore,no_run
8158    /// # use google_cloud_config_v1::model::ListPreviewsRequest;
8159    /// let x = ListPreviewsRequest::new().set_filter("example");
8160    /// ```
8161    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8162        self.filter = v.into();
8163        self
8164    }
8165
8166    /// Sets the value of [order_by][crate::model::ListPreviewsRequest::order_by].
8167    ///
8168    /// # Example
8169    /// ```ignore,no_run
8170    /// # use google_cloud_config_v1::model::ListPreviewsRequest;
8171    /// let x = ListPreviewsRequest::new().set_order_by("example");
8172    /// ```
8173    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8174        self.order_by = v.into();
8175        self
8176    }
8177}
8178
8179impl wkt::message::Message for ListPreviewsRequest {
8180    fn typename() -> &'static str {
8181        "type.googleapis.com/google.cloud.config.v1.ListPreviewsRequest"
8182    }
8183}
8184
8185/// A response to a `ListPreviews` call. Contains a list of Previews.
8186#[derive(Clone, Default, PartialEq)]
8187#[non_exhaustive]
8188pub struct ListPreviewsResponse {
8189    /// List of [Previews][google.cloud.config.v1.Preview].
8190    ///
8191    /// [google.cloud.config.v1.Preview]: crate::model::Preview
8192    pub previews: std::vec::Vec<crate::model::Preview>,
8193
8194    /// Token to be supplied to the next ListPreviews request via `page_token`
8195    /// to obtain the next set of results.
8196    pub next_page_token: std::string::String,
8197
8198    /// Locations that could not be reached.
8199    pub unreachable: std::vec::Vec<std::string::String>,
8200
8201    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8202}
8203
8204impl ListPreviewsResponse {
8205    pub fn new() -> Self {
8206        std::default::Default::default()
8207    }
8208
8209    /// Sets the value of [previews][crate::model::ListPreviewsResponse::previews].
8210    ///
8211    /// # Example
8212    /// ```ignore,no_run
8213    /// # use google_cloud_config_v1::model::ListPreviewsResponse;
8214    /// use google_cloud_config_v1::model::Preview;
8215    /// let x = ListPreviewsResponse::new()
8216    ///     .set_previews([
8217    ///         Preview::default()/* use setters */,
8218    ///         Preview::default()/* use (different) setters */,
8219    ///     ]);
8220    /// ```
8221    pub fn set_previews<T, V>(mut self, v: T) -> Self
8222    where
8223        T: std::iter::IntoIterator<Item = V>,
8224        V: std::convert::Into<crate::model::Preview>,
8225    {
8226        use std::iter::Iterator;
8227        self.previews = v.into_iter().map(|i| i.into()).collect();
8228        self
8229    }
8230
8231    /// Sets the value of [next_page_token][crate::model::ListPreviewsResponse::next_page_token].
8232    ///
8233    /// # Example
8234    /// ```ignore,no_run
8235    /// # use google_cloud_config_v1::model::ListPreviewsResponse;
8236    /// let x = ListPreviewsResponse::new().set_next_page_token("example");
8237    /// ```
8238    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8239        self.next_page_token = v.into();
8240        self
8241    }
8242
8243    /// Sets the value of [unreachable][crate::model::ListPreviewsResponse::unreachable].
8244    ///
8245    /// # Example
8246    /// ```ignore,no_run
8247    /// # use google_cloud_config_v1::model::ListPreviewsResponse;
8248    /// let x = ListPreviewsResponse::new().set_unreachable(["a", "b", "c"]);
8249    /// ```
8250    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
8251    where
8252        T: std::iter::IntoIterator<Item = V>,
8253        V: std::convert::Into<std::string::String>,
8254    {
8255        use std::iter::Iterator;
8256        self.unreachable = v.into_iter().map(|i| i.into()).collect();
8257        self
8258    }
8259}
8260
8261impl wkt::message::Message for ListPreviewsResponse {
8262    fn typename() -> &'static str {
8263        "type.googleapis.com/google.cloud.config.v1.ListPreviewsResponse"
8264    }
8265}
8266
8267#[doc(hidden)]
8268impl google_cloud_gax::paginator::internal::PageableResponse for ListPreviewsResponse {
8269    type PageItem = crate::model::Preview;
8270
8271    fn items(self) -> std::vec::Vec<Self::PageItem> {
8272        self.previews
8273    }
8274
8275    fn next_page_token(&self) -> std::string::String {
8276        use std::clone::Clone;
8277        self.next_page_token.clone()
8278    }
8279}
8280
8281/// A request to delete a preview.
8282#[derive(Clone, Default, PartialEq)]
8283#[non_exhaustive]
8284pub struct DeletePreviewRequest {
8285    /// Required. The name of the Preview in the format:
8286    /// 'projects/{project_id}/locations/{location}/previews/{preview}'.
8287    pub name: std::string::String,
8288
8289    /// Optional. An optional request ID to identify requests. Specify a unique
8290    /// request ID so that if you must retry your request, the server will know to
8291    /// ignore the request if it has already been completed. The server will
8292    /// guarantee that for at least 60 minutes after the first request.
8293    ///
8294    /// For example, consider a situation where you make an initial request and the
8295    /// request times out. If you make the request again with the same request ID,
8296    /// the server can check if original operation with the same request ID was
8297    /// received, and if so, will ignore the second request. This prevents clients
8298    /// from accidentally creating duplicate commitments.
8299    ///
8300    /// The request ID must be a valid UUID with the exception that zero UUID is
8301    /// not supported (00000000-0000-0000-0000-000000000000).
8302    pub request_id: std::string::String,
8303
8304    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8305}
8306
8307impl DeletePreviewRequest {
8308    pub fn new() -> Self {
8309        std::default::Default::default()
8310    }
8311
8312    /// Sets the value of [name][crate::model::DeletePreviewRequest::name].
8313    ///
8314    /// # Example
8315    /// ```ignore,no_run
8316    /// # use google_cloud_config_v1::model::DeletePreviewRequest;
8317    /// let x = DeletePreviewRequest::new().set_name("example");
8318    /// ```
8319    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8320        self.name = v.into();
8321        self
8322    }
8323
8324    /// Sets the value of [request_id][crate::model::DeletePreviewRequest::request_id].
8325    ///
8326    /// # Example
8327    /// ```ignore,no_run
8328    /// # use google_cloud_config_v1::model::DeletePreviewRequest;
8329    /// let x = DeletePreviewRequest::new().set_request_id("example");
8330    /// ```
8331    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8332        self.request_id = v.into();
8333        self
8334    }
8335}
8336
8337impl wkt::message::Message for DeletePreviewRequest {
8338    fn typename() -> &'static str {
8339        "type.googleapis.com/google.cloud.config.v1.DeletePreviewRequest"
8340    }
8341}
8342
8343/// A request to export preview results.
8344#[derive(Clone, Default, PartialEq)]
8345#[non_exhaustive]
8346pub struct ExportPreviewResultRequest {
8347    /// Required. The preview whose results should be exported. The preview value
8348    /// is in the format:
8349    /// 'projects/{project_id}/locations/{location}/previews/{preview}'.
8350    pub parent: std::string::String,
8351
8352    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8353}
8354
8355impl ExportPreviewResultRequest {
8356    pub fn new() -> Self {
8357        std::default::Default::default()
8358    }
8359
8360    /// Sets the value of [parent][crate::model::ExportPreviewResultRequest::parent].
8361    ///
8362    /// # Example
8363    /// ```ignore,no_run
8364    /// # use google_cloud_config_v1::model::ExportPreviewResultRequest;
8365    /// let x = ExportPreviewResultRequest::new().set_parent("example");
8366    /// ```
8367    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8368        self.parent = v.into();
8369        self
8370    }
8371}
8372
8373impl wkt::message::Message for ExportPreviewResultRequest {
8374    fn typename() -> &'static str {
8375        "type.googleapis.com/google.cloud.config.v1.ExportPreviewResultRequest"
8376    }
8377}
8378
8379/// A response to `ExportPreviewResult` call. Contains preview results.
8380#[derive(Clone, Default, PartialEq)]
8381#[non_exhaustive]
8382pub struct ExportPreviewResultResponse {
8383    /// Output only. Signed URLs for accessing the plan files.
8384    pub result: std::option::Option<crate::model::PreviewResult>,
8385
8386    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8387}
8388
8389impl ExportPreviewResultResponse {
8390    pub fn new() -> Self {
8391        std::default::Default::default()
8392    }
8393
8394    /// Sets the value of [result][crate::model::ExportPreviewResultResponse::result].
8395    ///
8396    /// # Example
8397    /// ```ignore,no_run
8398    /// # use google_cloud_config_v1::model::ExportPreviewResultResponse;
8399    /// use google_cloud_config_v1::model::PreviewResult;
8400    /// let x = ExportPreviewResultResponse::new().set_result(PreviewResult::default()/* use setters */);
8401    /// ```
8402    pub fn set_result<T>(mut self, v: T) -> Self
8403    where
8404        T: std::convert::Into<crate::model::PreviewResult>,
8405    {
8406        self.result = std::option::Option::Some(v.into());
8407        self
8408    }
8409
8410    /// Sets or clears the value of [result][crate::model::ExportPreviewResultResponse::result].
8411    ///
8412    /// # Example
8413    /// ```ignore,no_run
8414    /// # use google_cloud_config_v1::model::ExportPreviewResultResponse;
8415    /// use google_cloud_config_v1::model::PreviewResult;
8416    /// let x = ExportPreviewResultResponse::new().set_or_clear_result(Some(PreviewResult::default()/* use setters */));
8417    /// let x = ExportPreviewResultResponse::new().set_or_clear_result(None::<PreviewResult>);
8418    /// ```
8419    pub fn set_or_clear_result<T>(mut self, v: std::option::Option<T>) -> Self
8420    where
8421        T: std::convert::Into<crate::model::PreviewResult>,
8422    {
8423        self.result = v.map(|x| x.into());
8424        self
8425    }
8426}
8427
8428impl wkt::message::Message for ExportPreviewResultResponse {
8429    fn typename() -> &'static str {
8430        "type.googleapis.com/google.cloud.config.v1.ExportPreviewResultResponse"
8431    }
8432}
8433
8434/// Contains a signed Cloud Storage URLs.
8435#[derive(Clone, Default, PartialEq)]
8436#[non_exhaustive]
8437pub struct PreviewResult {
8438    /// Output only. Plan binary signed URL
8439    pub binary_signed_uri: std::string::String,
8440
8441    /// Output only. Plan JSON signed URL
8442    pub json_signed_uri: std::string::String,
8443
8444    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8445}
8446
8447impl PreviewResult {
8448    pub fn new() -> Self {
8449        std::default::Default::default()
8450    }
8451
8452    /// Sets the value of [binary_signed_uri][crate::model::PreviewResult::binary_signed_uri].
8453    ///
8454    /// # Example
8455    /// ```ignore,no_run
8456    /// # use google_cloud_config_v1::model::PreviewResult;
8457    /// let x = PreviewResult::new().set_binary_signed_uri("example");
8458    /// ```
8459    pub fn set_binary_signed_uri<T: std::convert::Into<std::string::String>>(
8460        mut self,
8461        v: T,
8462    ) -> Self {
8463        self.binary_signed_uri = v.into();
8464        self
8465    }
8466
8467    /// Sets the value of [json_signed_uri][crate::model::PreviewResult::json_signed_uri].
8468    ///
8469    /// # Example
8470    /// ```ignore,no_run
8471    /// # use google_cloud_config_v1::model::PreviewResult;
8472    /// let x = PreviewResult::new().set_json_signed_uri("example");
8473    /// ```
8474    pub fn set_json_signed_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8475        self.json_signed_uri = v.into();
8476        self
8477    }
8478}
8479
8480impl wkt::message::Message for PreviewResult {
8481    fn typename() -> &'static str {
8482        "type.googleapis.com/google.cloud.config.v1.PreviewResult"
8483    }
8484}
8485
8486/// The request message for the GetTerraformVersion method.
8487#[derive(Clone, Default, PartialEq)]
8488#[non_exhaustive]
8489pub struct GetTerraformVersionRequest {
8490    /// Required. The name of the TerraformVersion. Format:
8491    /// 'projects/{project_id}/locations/{location}/terraformVersions/{terraform_version}'
8492    pub name: std::string::String,
8493
8494    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8495}
8496
8497impl GetTerraformVersionRequest {
8498    pub fn new() -> Self {
8499        std::default::Default::default()
8500    }
8501
8502    /// Sets the value of [name][crate::model::GetTerraformVersionRequest::name].
8503    ///
8504    /// # Example
8505    /// ```ignore,no_run
8506    /// # use google_cloud_config_v1::model::GetTerraformVersionRequest;
8507    /// let x = GetTerraformVersionRequest::new().set_name("example");
8508    /// ```
8509    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8510        self.name = v.into();
8511        self
8512    }
8513}
8514
8515impl wkt::message::Message for GetTerraformVersionRequest {
8516    fn typename() -> &'static str {
8517        "type.googleapis.com/google.cloud.config.v1.GetTerraformVersionRequest"
8518    }
8519}
8520
8521/// The request message for the ListTerraformVersions method.
8522#[derive(Clone, Default, PartialEq)]
8523#[non_exhaustive]
8524pub struct ListTerraformVersionsRequest {
8525    /// Required. The parent in whose context the TerraformVersions are listed. The
8526    /// parent value is in the format:
8527    /// 'projects/{project_id}/locations/{location}'.
8528    pub parent: std::string::String,
8529
8530    /// Optional. When requesting a page of terraform versions, 'page_size'
8531    /// specifies number of terraform versions to return. If unspecified, at most
8532    /// 500 will be returned. The maximum value is 1000.
8533    pub page_size: i32,
8534
8535    /// Optional. Token returned by previous call to 'ListTerraformVersions' which
8536    /// specifies the position in the list from where to continue listing the
8537    /// terraform versions.
8538    pub page_token: std::string::String,
8539
8540    /// Optional. Lists the TerraformVersions that match the filter expression. A
8541    /// filter expression filters the resources listed in the response. The
8542    /// expression must be of the form '{field} {operator} {value}' where
8543    /// operators: '<', '>',
8544    /// '<=', '>=', '!=', '=', ':' are supported (colon ':' represents a HAS
8545    /// operator which is roughly synonymous with equality). {field} can refer to a
8546    /// proto or JSON field, or a synthetic field. Field names can be camelCase or
8547    /// snake_case.
8548    pub filter: std::string::String,
8549
8550    /// Optional. Field to use to sort the list.
8551    pub order_by: std::string::String,
8552
8553    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8554}
8555
8556impl ListTerraformVersionsRequest {
8557    pub fn new() -> Self {
8558        std::default::Default::default()
8559    }
8560
8561    /// Sets the value of [parent][crate::model::ListTerraformVersionsRequest::parent].
8562    ///
8563    /// # Example
8564    /// ```ignore,no_run
8565    /// # use google_cloud_config_v1::model::ListTerraformVersionsRequest;
8566    /// let x = ListTerraformVersionsRequest::new().set_parent("example");
8567    /// ```
8568    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8569        self.parent = v.into();
8570        self
8571    }
8572
8573    /// Sets the value of [page_size][crate::model::ListTerraformVersionsRequest::page_size].
8574    ///
8575    /// # Example
8576    /// ```ignore,no_run
8577    /// # use google_cloud_config_v1::model::ListTerraformVersionsRequest;
8578    /// let x = ListTerraformVersionsRequest::new().set_page_size(42);
8579    /// ```
8580    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8581        self.page_size = v.into();
8582        self
8583    }
8584
8585    /// Sets the value of [page_token][crate::model::ListTerraformVersionsRequest::page_token].
8586    ///
8587    /// # Example
8588    /// ```ignore,no_run
8589    /// # use google_cloud_config_v1::model::ListTerraformVersionsRequest;
8590    /// let x = ListTerraformVersionsRequest::new().set_page_token("example");
8591    /// ```
8592    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8593        self.page_token = v.into();
8594        self
8595    }
8596
8597    /// Sets the value of [filter][crate::model::ListTerraformVersionsRequest::filter].
8598    ///
8599    /// # Example
8600    /// ```ignore,no_run
8601    /// # use google_cloud_config_v1::model::ListTerraformVersionsRequest;
8602    /// let x = ListTerraformVersionsRequest::new().set_filter("example");
8603    /// ```
8604    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8605        self.filter = v.into();
8606        self
8607    }
8608
8609    /// Sets the value of [order_by][crate::model::ListTerraformVersionsRequest::order_by].
8610    ///
8611    /// # Example
8612    /// ```ignore,no_run
8613    /// # use google_cloud_config_v1::model::ListTerraformVersionsRequest;
8614    /// let x = ListTerraformVersionsRequest::new().set_order_by("example");
8615    /// ```
8616    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8617        self.order_by = v.into();
8618        self
8619    }
8620}
8621
8622impl wkt::message::Message for ListTerraformVersionsRequest {
8623    fn typename() -> &'static str {
8624        "type.googleapis.com/google.cloud.config.v1.ListTerraformVersionsRequest"
8625    }
8626}
8627
8628/// The response message for the `ListTerraformVersions` method.
8629#[derive(Clone, Default, PartialEq)]
8630#[non_exhaustive]
8631pub struct ListTerraformVersionsResponse {
8632    /// List of [TerraformVersion][google.cloud.config.v1.TerraformVersion]s.
8633    ///
8634    /// [google.cloud.config.v1.TerraformVersion]: crate::model::TerraformVersion
8635    pub terraform_versions: std::vec::Vec<crate::model::TerraformVersion>,
8636
8637    /// Token to be supplied to the next ListTerraformVersions request via
8638    /// `page_token` to obtain the next set of results.
8639    pub next_page_token: std::string::String,
8640
8641    /// Unreachable resources, if any.
8642    pub unreachable: std::vec::Vec<std::string::String>,
8643
8644    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8645}
8646
8647impl ListTerraformVersionsResponse {
8648    pub fn new() -> Self {
8649        std::default::Default::default()
8650    }
8651
8652    /// Sets the value of [terraform_versions][crate::model::ListTerraformVersionsResponse::terraform_versions].
8653    ///
8654    /// # Example
8655    /// ```ignore,no_run
8656    /// # use google_cloud_config_v1::model::ListTerraformVersionsResponse;
8657    /// use google_cloud_config_v1::model::TerraformVersion;
8658    /// let x = ListTerraformVersionsResponse::new()
8659    ///     .set_terraform_versions([
8660    ///         TerraformVersion::default()/* use setters */,
8661    ///         TerraformVersion::default()/* use (different) setters */,
8662    ///     ]);
8663    /// ```
8664    pub fn set_terraform_versions<T, V>(mut self, v: T) -> Self
8665    where
8666        T: std::iter::IntoIterator<Item = V>,
8667        V: std::convert::Into<crate::model::TerraformVersion>,
8668    {
8669        use std::iter::Iterator;
8670        self.terraform_versions = v.into_iter().map(|i| i.into()).collect();
8671        self
8672    }
8673
8674    /// Sets the value of [next_page_token][crate::model::ListTerraformVersionsResponse::next_page_token].
8675    ///
8676    /// # Example
8677    /// ```ignore,no_run
8678    /// # use google_cloud_config_v1::model::ListTerraformVersionsResponse;
8679    /// let x = ListTerraformVersionsResponse::new().set_next_page_token("example");
8680    /// ```
8681    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8682        self.next_page_token = v.into();
8683        self
8684    }
8685
8686    /// Sets the value of [unreachable][crate::model::ListTerraformVersionsResponse::unreachable].
8687    ///
8688    /// # Example
8689    /// ```ignore,no_run
8690    /// # use google_cloud_config_v1::model::ListTerraformVersionsResponse;
8691    /// let x = ListTerraformVersionsResponse::new().set_unreachable(["a", "b", "c"]);
8692    /// ```
8693    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
8694    where
8695        T: std::iter::IntoIterator<Item = V>,
8696        V: std::convert::Into<std::string::String>,
8697    {
8698        use std::iter::Iterator;
8699        self.unreachable = v.into_iter().map(|i| i.into()).collect();
8700        self
8701    }
8702}
8703
8704impl wkt::message::Message for ListTerraformVersionsResponse {
8705    fn typename() -> &'static str {
8706        "type.googleapis.com/google.cloud.config.v1.ListTerraformVersionsResponse"
8707    }
8708}
8709
8710#[doc(hidden)]
8711impl google_cloud_gax::paginator::internal::PageableResponse for ListTerraformVersionsResponse {
8712    type PageItem = crate::model::TerraformVersion;
8713
8714    fn items(self) -> std::vec::Vec<Self::PageItem> {
8715        self.terraform_versions
8716    }
8717
8718    fn next_page_token(&self) -> std::string::String {
8719        use std::clone::Clone;
8720        self.next_page_token.clone()
8721    }
8722}
8723
8724/// A TerraformVersion represents the support state the corresponding
8725/// Terraform version.
8726#[derive(Clone, Default, PartialEq)]
8727#[non_exhaustive]
8728pub struct TerraformVersion {
8729    /// Identifier. The version name is in the format:
8730    /// 'projects/{project_id}/locations/{location}/terraformVersions/{terraform_version}'.
8731    pub name: std::string::String,
8732
8733    /// Output only. The state of the version, ACTIVE, DEPRECATED or OBSOLETE.
8734    pub state: crate::model::terraform_version::State,
8735
8736    /// Output only. When the version is supported.
8737    pub support_time: std::option::Option<wkt::Timestamp>,
8738
8739    /// Output only. When the version is deprecated.
8740    pub deprecate_time: std::option::Option<wkt::Timestamp>,
8741
8742    /// Output only. When the version is obsolete.
8743    pub obsolete_time: std::option::Option<wkt::Timestamp>,
8744
8745    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8746}
8747
8748impl TerraformVersion {
8749    pub fn new() -> Self {
8750        std::default::Default::default()
8751    }
8752
8753    /// Sets the value of [name][crate::model::TerraformVersion::name].
8754    ///
8755    /// # Example
8756    /// ```ignore,no_run
8757    /// # use google_cloud_config_v1::model::TerraformVersion;
8758    /// let x = TerraformVersion::new().set_name("example");
8759    /// ```
8760    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8761        self.name = v.into();
8762        self
8763    }
8764
8765    /// Sets the value of [state][crate::model::TerraformVersion::state].
8766    ///
8767    /// # Example
8768    /// ```ignore,no_run
8769    /// # use google_cloud_config_v1::model::TerraformVersion;
8770    /// use google_cloud_config_v1::model::terraform_version::State;
8771    /// let x0 = TerraformVersion::new().set_state(State::Active);
8772    /// let x1 = TerraformVersion::new().set_state(State::Deprecated);
8773    /// let x2 = TerraformVersion::new().set_state(State::Obsolete);
8774    /// ```
8775    pub fn set_state<T: std::convert::Into<crate::model::terraform_version::State>>(
8776        mut self,
8777        v: T,
8778    ) -> Self {
8779        self.state = v.into();
8780        self
8781    }
8782
8783    /// Sets the value of [support_time][crate::model::TerraformVersion::support_time].
8784    ///
8785    /// # Example
8786    /// ```ignore,no_run
8787    /// # use google_cloud_config_v1::model::TerraformVersion;
8788    /// use wkt::Timestamp;
8789    /// let x = TerraformVersion::new().set_support_time(Timestamp::default()/* use setters */);
8790    /// ```
8791    pub fn set_support_time<T>(mut self, v: T) -> Self
8792    where
8793        T: std::convert::Into<wkt::Timestamp>,
8794    {
8795        self.support_time = std::option::Option::Some(v.into());
8796        self
8797    }
8798
8799    /// Sets or clears the value of [support_time][crate::model::TerraformVersion::support_time].
8800    ///
8801    /// # Example
8802    /// ```ignore,no_run
8803    /// # use google_cloud_config_v1::model::TerraformVersion;
8804    /// use wkt::Timestamp;
8805    /// let x = TerraformVersion::new().set_or_clear_support_time(Some(Timestamp::default()/* use setters */));
8806    /// let x = TerraformVersion::new().set_or_clear_support_time(None::<Timestamp>);
8807    /// ```
8808    pub fn set_or_clear_support_time<T>(mut self, v: std::option::Option<T>) -> Self
8809    where
8810        T: std::convert::Into<wkt::Timestamp>,
8811    {
8812        self.support_time = v.map(|x| x.into());
8813        self
8814    }
8815
8816    /// Sets the value of [deprecate_time][crate::model::TerraformVersion::deprecate_time].
8817    ///
8818    /// # Example
8819    /// ```ignore,no_run
8820    /// # use google_cloud_config_v1::model::TerraformVersion;
8821    /// use wkt::Timestamp;
8822    /// let x = TerraformVersion::new().set_deprecate_time(Timestamp::default()/* use setters */);
8823    /// ```
8824    pub fn set_deprecate_time<T>(mut self, v: T) -> Self
8825    where
8826        T: std::convert::Into<wkt::Timestamp>,
8827    {
8828        self.deprecate_time = std::option::Option::Some(v.into());
8829        self
8830    }
8831
8832    /// Sets or clears the value of [deprecate_time][crate::model::TerraformVersion::deprecate_time].
8833    ///
8834    /// # Example
8835    /// ```ignore,no_run
8836    /// # use google_cloud_config_v1::model::TerraformVersion;
8837    /// use wkt::Timestamp;
8838    /// let x = TerraformVersion::new().set_or_clear_deprecate_time(Some(Timestamp::default()/* use setters */));
8839    /// let x = TerraformVersion::new().set_or_clear_deprecate_time(None::<Timestamp>);
8840    /// ```
8841    pub fn set_or_clear_deprecate_time<T>(mut self, v: std::option::Option<T>) -> Self
8842    where
8843        T: std::convert::Into<wkt::Timestamp>,
8844    {
8845        self.deprecate_time = v.map(|x| x.into());
8846        self
8847    }
8848
8849    /// Sets the value of [obsolete_time][crate::model::TerraformVersion::obsolete_time].
8850    ///
8851    /// # Example
8852    /// ```ignore,no_run
8853    /// # use google_cloud_config_v1::model::TerraformVersion;
8854    /// use wkt::Timestamp;
8855    /// let x = TerraformVersion::new().set_obsolete_time(Timestamp::default()/* use setters */);
8856    /// ```
8857    pub fn set_obsolete_time<T>(mut self, v: T) -> Self
8858    where
8859        T: std::convert::Into<wkt::Timestamp>,
8860    {
8861        self.obsolete_time = std::option::Option::Some(v.into());
8862        self
8863    }
8864
8865    /// Sets or clears the value of [obsolete_time][crate::model::TerraformVersion::obsolete_time].
8866    ///
8867    /// # Example
8868    /// ```ignore,no_run
8869    /// # use google_cloud_config_v1::model::TerraformVersion;
8870    /// use wkt::Timestamp;
8871    /// let x = TerraformVersion::new().set_or_clear_obsolete_time(Some(Timestamp::default()/* use setters */));
8872    /// let x = TerraformVersion::new().set_or_clear_obsolete_time(None::<Timestamp>);
8873    /// ```
8874    pub fn set_or_clear_obsolete_time<T>(mut self, v: std::option::Option<T>) -> Self
8875    where
8876        T: std::convert::Into<wkt::Timestamp>,
8877    {
8878        self.obsolete_time = v.map(|x| x.into());
8879        self
8880    }
8881}
8882
8883impl wkt::message::Message for TerraformVersion {
8884    fn typename() -> &'static str {
8885        "type.googleapis.com/google.cloud.config.v1.TerraformVersion"
8886    }
8887}
8888
8889/// Defines additional types related to [TerraformVersion].
8890pub mod terraform_version {
8891    #[allow(unused_imports)]
8892    use super::*;
8893
8894    /// Possible states of a TerraformVersion.
8895    ///
8896    /// # Working with unknown values
8897    ///
8898    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8899    /// additional enum variants at any time. Adding new variants is not considered
8900    /// a breaking change. Applications should write their code in anticipation of:
8901    ///
8902    /// - New values appearing in future releases of the client library, **and**
8903    /// - New values received dynamically, without application changes.
8904    ///
8905    /// Please consult the [Working with enums] section in the user guide for some
8906    /// guidelines.
8907    ///
8908    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
8909    #[derive(Clone, Debug, PartialEq)]
8910    #[non_exhaustive]
8911    pub enum State {
8912        /// The default value. This value is used if the state is omitted.
8913        Unspecified,
8914        /// The version is actively supported.
8915        Active,
8916        /// The version is deprecated.
8917        Deprecated,
8918        /// The version is obsolete.
8919        Obsolete,
8920        /// If set, the enum was initialized with an unknown value.
8921        ///
8922        /// Applications can examine the value using [State::value] or
8923        /// [State::name].
8924        UnknownValue(state::UnknownValue),
8925    }
8926
8927    #[doc(hidden)]
8928    pub mod state {
8929        #[allow(unused_imports)]
8930        use super::*;
8931        #[derive(Clone, Debug, PartialEq)]
8932        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8933    }
8934
8935    impl State {
8936        /// Gets the enum value.
8937        ///
8938        /// Returns `None` if the enum contains an unknown value deserialized from
8939        /// the string representation of enums.
8940        pub fn value(&self) -> std::option::Option<i32> {
8941            match self {
8942                Self::Unspecified => std::option::Option::Some(0),
8943                Self::Active => std::option::Option::Some(1),
8944                Self::Deprecated => std::option::Option::Some(2),
8945                Self::Obsolete => std::option::Option::Some(3),
8946                Self::UnknownValue(u) => u.0.value(),
8947            }
8948        }
8949
8950        /// Gets the enum value as a string.
8951        ///
8952        /// Returns `None` if the enum contains an unknown value deserialized from
8953        /// the integer representation of enums.
8954        pub fn name(&self) -> std::option::Option<&str> {
8955            match self {
8956                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
8957                Self::Active => std::option::Option::Some("ACTIVE"),
8958                Self::Deprecated => std::option::Option::Some("DEPRECATED"),
8959                Self::Obsolete => std::option::Option::Some("OBSOLETE"),
8960                Self::UnknownValue(u) => u.0.name(),
8961            }
8962        }
8963    }
8964
8965    impl std::default::Default for State {
8966        fn default() -> Self {
8967            use std::convert::From;
8968            Self::from(0)
8969        }
8970    }
8971
8972    impl std::fmt::Display for State {
8973        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8974            wkt::internal::display_enum(f, self.name(), self.value())
8975        }
8976    }
8977
8978    impl std::convert::From<i32> for State {
8979        fn from(value: i32) -> Self {
8980            match value {
8981                0 => Self::Unspecified,
8982                1 => Self::Active,
8983                2 => Self::Deprecated,
8984                3 => Self::Obsolete,
8985                _ => Self::UnknownValue(state::UnknownValue(
8986                    wkt::internal::UnknownEnumValue::Integer(value),
8987                )),
8988            }
8989        }
8990    }
8991
8992    impl std::convert::From<&str> for State {
8993        fn from(value: &str) -> Self {
8994            use std::string::ToString;
8995            match value {
8996                "STATE_UNSPECIFIED" => Self::Unspecified,
8997                "ACTIVE" => Self::Active,
8998                "DEPRECATED" => Self::Deprecated,
8999                "OBSOLETE" => Self::Obsolete,
9000                _ => Self::UnknownValue(state::UnknownValue(
9001                    wkt::internal::UnknownEnumValue::String(value.to_string()),
9002                )),
9003            }
9004        }
9005    }
9006
9007    impl serde::ser::Serialize for State {
9008        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9009        where
9010            S: serde::Serializer,
9011        {
9012            match self {
9013                Self::Unspecified => serializer.serialize_i32(0),
9014                Self::Active => serializer.serialize_i32(1),
9015                Self::Deprecated => serializer.serialize_i32(2),
9016                Self::Obsolete => serializer.serialize_i32(3),
9017                Self::UnknownValue(u) => u.0.serialize(serializer),
9018            }
9019        }
9020    }
9021
9022    impl<'de> serde::de::Deserialize<'de> for State {
9023        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9024        where
9025            D: serde::Deserializer<'de>,
9026        {
9027            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
9028                ".google.cloud.config.v1.TerraformVersion.State",
9029            ))
9030        }
9031    }
9032}
9033
9034/// Terraform info of a ResourceChange.
9035#[derive(Clone, Default, PartialEq)]
9036#[non_exhaustive]
9037pub struct ResourceChangeTerraformInfo {
9038    /// Output only. TF resource address that uniquely identifies the resource.
9039    pub address: std::string::String,
9040
9041    /// Output only. TF resource type.
9042    pub r#type: std::string::String,
9043
9044    /// Output only. TF resource name.
9045    pub resource_name: std::string::String,
9046
9047    /// Output only. TF resource provider.
9048    pub provider: std::string::String,
9049
9050    /// Output only. TF resource actions.
9051    pub actions: std::vec::Vec<std::string::String>,
9052
9053    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9054}
9055
9056impl ResourceChangeTerraformInfo {
9057    pub fn new() -> Self {
9058        std::default::Default::default()
9059    }
9060
9061    /// Sets the value of [address][crate::model::ResourceChangeTerraformInfo::address].
9062    ///
9063    /// # Example
9064    /// ```ignore,no_run
9065    /// # use google_cloud_config_v1::model::ResourceChangeTerraformInfo;
9066    /// let x = ResourceChangeTerraformInfo::new().set_address("example");
9067    /// ```
9068    pub fn set_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9069        self.address = v.into();
9070        self
9071    }
9072
9073    /// Sets the value of [r#type][crate::model::ResourceChangeTerraformInfo::type].
9074    ///
9075    /// # Example
9076    /// ```ignore,no_run
9077    /// # use google_cloud_config_v1::model::ResourceChangeTerraformInfo;
9078    /// let x = ResourceChangeTerraformInfo::new().set_type("example");
9079    /// ```
9080    pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9081        self.r#type = v.into();
9082        self
9083    }
9084
9085    /// Sets the value of [resource_name][crate::model::ResourceChangeTerraformInfo::resource_name].
9086    ///
9087    /// # Example
9088    /// ```ignore,no_run
9089    /// # use google_cloud_config_v1::model::ResourceChangeTerraformInfo;
9090    /// let x = ResourceChangeTerraformInfo::new().set_resource_name("example");
9091    /// ```
9092    pub fn set_resource_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9093        self.resource_name = v.into();
9094        self
9095    }
9096
9097    /// Sets the value of [provider][crate::model::ResourceChangeTerraformInfo::provider].
9098    ///
9099    /// # Example
9100    /// ```ignore,no_run
9101    /// # use google_cloud_config_v1::model::ResourceChangeTerraformInfo;
9102    /// let x = ResourceChangeTerraformInfo::new().set_provider("example");
9103    /// ```
9104    pub fn set_provider<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9105        self.provider = v.into();
9106        self
9107    }
9108
9109    /// Sets the value of [actions][crate::model::ResourceChangeTerraformInfo::actions].
9110    ///
9111    /// # Example
9112    /// ```ignore,no_run
9113    /// # use google_cloud_config_v1::model::ResourceChangeTerraformInfo;
9114    /// let x = ResourceChangeTerraformInfo::new().set_actions(["a", "b", "c"]);
9115    /// ```
9116    pub fn set_actions<T, V>(mut self, v: T) -> Self
9117    where
9118        T: std::iter::IntoIterator<Item = V>,
9119        V: std::convert::Into<std::string::String>,
9120    {
9121        use std::iter::Iterator;
9122        self.actions = v.into_iter().map(|i| i.into()).collect();
9123        self
9124    }
9125}
9126
9127impl wkt::message::Message for ResourceChangeTerraformInfo {
9128    fn typename() -> &'static str {
9129        "type.googleapis.com/google.cloud.config.v1.ResourceChangeTerraformInfo"
9130    }
9131}
9132
9133/// A resource change represents a change to a resource in the state file.
9134#[derive(Clone, Default, PartialEq)]
9135#[non_exhaustive]
9136pub struct ResourceChange {
9137    /// Identifier. The name of the resource change.
9138    /// Format:
9139    /// 'projects/{project_id}/locations/{location}/previews/{preview}/resourceChanges/{resource_change}'.
9140    pub name: std::string::String,
9141
9142    /// Output only. Terraform info of the resource change.
9143    pub terraform_info: std::option::Option<crate::model::ResourceChangeTerraformInfo>,
9144
9145    /// Output only. The intent of the resource change.
9146    pub intent: crate::model::resource_change::Intent,
9147
9148    /// Output only. The property changes of the resource change.
9149    pub property_changes: std::vec::Vec<crate::model::PropertyChange>,
9150
9151    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9152}
9153
9154impl ResourceChange {
9155    pub fn new() -> Self {
9156        std::default::Default::default()
9157    }
9158
9159    /// Sets the value of [name][crate::model::ResourceChange::name].
9160    ///
9161    /// # Example
9162    /// ```ignore,no_run
9163    /// # use google_cloud_config_v1::model::ResourceChange;
9164    /// let x = ResourceChange::new().set_name("example");
9165    /// ```
9166    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9167        self.name = v.into();
9168        self
9169    }
9170
9171    /// Sets the value of [terraform_info][crate::model::ResourceChange::terraform_info].
9172    ///
9173    /// # Example
9174    /// ```ignore,no_run
9175    /// # use google_cloud_config_v1::model::ResourceChange;
9176    /// use google_cloud_config_v1::model::ResourceChangeTerraformInfo;
9177    /// let x = ResourceChange::new().set_terraform_info(ResourceChangeTerraformInfo::default()/* use setters */);
9178    /// ```
9179    pub fn set_terraform_info<T>(mut self, v: T) -> Self
9180    where
9181        T: std::convert::Into<crate::model::ResourceChangeTerraformInfo>,
9182    {
9183        self.terraform_info = std::option::Option::Some(v.into());
9184        self
9185    }
9186
9187    /// Sets or clears the value of [terraform_info][crate::model::ResourceChange::terraform_info].
9188    ///
9189    /// # Example
9190    /// ```ignore,no_run
9191    /// # use google_cloud_config_v1::model::ResourceChange;
9192    /// use google_cloud_config_v1::model::ResourceChangeTerraformInfo;
9193    /// let x = ResourceChange::new().set_or_clear_terraform_info(Some(ResourceChangeTerraformInfo::default()/* use setters */));
9194    /// let x = ResourceChange::new().set_or_clear_terraform_info(None::<ResourceChangeTerraformInfo>);
9195    /// ```
9196    pub fn set_or_clear_terraform_info<T>(mut self, v: std::option::Option<T>) -> Self
9197    where
9198        T: std::convert::Into<crate::model::ResourceChangeTerraformInfo>,
9199    {
9200        self.terraform_info = v.map(|x| x.into());
9201        self
9202    }
9203
9204    /// Sets the value of [intent][crate::model::ResourceChange::intent].
9205    ///
9206    /// # Example
9207    /// ```ignore,no_run
9208    /// # use google_cloud_config_v1::model::ResourceChange;
9209    /// use google_cloud_config_v1::model::resource_change::Intent;
9210    /// let x0 = ResourceChange::new().set_intent(Intent::Create);
9211    /// let x1 = ResourceChange::new().set_intent(Intent::Update);
9212    /// let x2 = ResourceChange::new().set_intent(Intent::Delete);
9213    /// ```
9214    pub fn set_intent<T: std::convert::Into<crate::model::resource_change::Intent>>(
9215        mut self,
9216        v: T,
9217    ) -> Self {
9218        self.intent = v.into();
9219        self
9220    }
9221
9222    /// Sets the value of [property_changes][crate::model::ResourceChange::property_changes].
9223    ///
9224    /// # Example
9225    /// ```ignore,no_run
9226    /// # use google_cloud_config_v1::model::ResourceChange;
9227    /// use google_cloud_config_v1::model::PropertyChange;
9228    /// let x = ResourceChange::new()
9229    ///     .set_property_changes([
9230    ///         PropertyChange::default()/* use setters */,
9231    ///         PropertyChange::default()/* use (different) setters */,
9232    ///     ]);
9233    /// ```
9234    pub fn set_property_changes<T, V>(mut self, v: T) -> Self
9235    where
9236        T: std::iter::IntoIterator<Item = V>,
9237        V: std::convert::Into<crate::model::PropertyChange>,
9238    {
9239        use std::iter::Iterator;
9240        self.property_changes = v.into_iter().map(|i| i.into()).collect();
9241        self
9242    }
9243}
9244
9245impl wkt::message::Message for ResourceChange {
9246    fn typename() -> &'static str {
9247        "type.googleapis.com/google.cloud.config.v1.ResourceChange"
9248    }
9249}
9250
9251/// Defines additional types related to [ResourceChange].
9252pub mod resource_change {
9253    #[allow(unused_imports)]
9254    use super::*;
9255
9256    /// Possible intent of the resource change.
9257    ///
9258    /// # Working with unknown values
9259    ///
9260    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9261    /// additional enum variants at any time. Adding new variants is not considered
9262    /// a breaking change. Applications should write their code in anticipation of:
9263    ///
9264    /// - New values appearing in future releases of the client library, **and**
9265    /// - New values received dynamically, without application changes.
9266    ///
9267    /// Please consult the [Working with enums] section in the user guide for some
9268    /// guidelines.
9269    ///
9270    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
9271    #[derive(Clone, Debug, PartialEq)]
9272    #[non_exhaustive]
9273    pub enum Intent {
9274        /// The default value.
9275        Unspecified,
9276        /// The resource will be created.
9277        Create,
9278        /// The resource will be updated.
9279        Update,
9280        /// The resource will be deleted.
9281        Delete,
9282        /// The resource will be recreated.
9283        Recreate,
9284        /// The resource will be untouched.
9285        Unchanged,
9286        /// If set, the enum was initialized with an unknown value.
9287        ///
9288        /// Applications can examine the value using [Intent::value] or
9289        /// [Intent::name].
9290        UnknownValue(intent::UnknownValue),
9291    }
9292
9293    #[doc(hidden)]
9294    pub mod intent {
9295        #[allow(unused_imports)]
9296        use super::*;
9297        #[derive(Clone, Debug, PartialEq)]
9298        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9299    }
9300
9301    impl Intent {
9302        /// Gets the enum value.
9303        ///
9304        /// Returns `None` if the enum contains an unknown value deserialized from
9305        /// the string representation of enums.
9306        pub fn value(&self) -> std::option::Option<i32> {
9307            match self {
9308                Self::Unspecified => std::option::Option::Some(0),
9309                Self::Create => std::option::Option::Some(1),
9310                Self::Update => std::option::Option::Some(2),
9311                Self::Delete => std::option::Option::Some(3),
9312                Self::Recreate => std::option::Option::Some(4),
9313                Self::Unchanged => std::option::Option::Some(5),
9314                Self::UnknownValue(u) => u.0.value(),
9315            }
9316        }
9317
9318        /// Gets the enum value as a string.
9319        ///
9320        /// Returns `None` if the enum contains an unknown value deserialized from
9321        /// the integer representation of enums.
9322        pub fn name(&self) -> std::option::Option<&str> {
9323            match self {
9324                Self::Unspecified => std::option::Option::Some("INTENT_UNSPECIFIED"),
9325                Self::Create => std::option::Option::Some("CREATE"),
9326                Self::Update => std::option::Option::Some("UPDATE"),
9327                Self::Delete => std::option::Option::Some("DELETE"),
9328                Self::Recreate => std::option::Option::Some("RECREATE"),
9329                Self::Unchanged => std::option::Option::Some("UNCHANGED"),
9330                Self::UnknownValue(u) => u.0.name(),
9331            }
9332        }
9333    }
9334
9335    impl std::default::Default for Intent {
9336        fn default() -> Self {
9337            use std::convert::From;
9338            Self::from(0)
9339        }
9340    }
9341
9342    impl std::fmt::Display for Intent {
9343        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9344            wkt::internal::display_enum(f, self.name(), self.value())
9345        }
9346    }
9347
9348    impl std::convert::From<i32> for Intent {
9349        fn from(value: i32) -> Self {
9350            match value {
9351                0 => Self::Unspecified,
9352                1 => Self::Create,
9353                2 => Self::Update,
9354                3 => Self::Delete,
9355                4 => Self::Recreate,
9356                5 => Self::Unchanged,
9357                _ => Self::UnknownValue(intent::UnknownValue(
9358                    wkt::internal::UnknownEnumValue::Integer(value),
9359                )),
9360            }
9361        }
9362    }
9363
9364    impl std::convert::From<&str> for Intent {
9365        fn from(value: &str) -> Self {
9366            use std::string::ToString;
9367            match value {
9368                "INTENT_UNSPECIFIED" => Self::Unspecified,
9369                "CREATE" => Self::Create,
9370                "UPDATE" => Self::Update,
9371                "DELETE" => Self::Delete,
9372                "RECREATE" => Self::Recreate,
9373                "UNCHANGED" => Self::Unchanged,
9374                _ => Self::UnknownValue(intent::UnknownValue(
9375                    wkt::internal::UnknownEnumValue::String(value.to_string()),
9376                )),
9377            }
9378        }
9379    }
9380
9381    impl serde::ser::Serialize for Intent {
9382        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9383        where
9384            S: serde::Serializer,
9385        {
9386            match self {
9387                Self::Unspecified => serializer.serialize_i32(0),
9388                Self::Create => serializer.serialize_i32(1),
9389                Self::Update => serializer.serialize_i32(2),
9390                Self::Delete => serializer.serialize_i32(3),
9391                Self::Recreate => serializer.serialize_i32(4),
9392                Self::Unchanged => serializer.serialize_i32(5),
9393                Self::UnknownValue(u) => u.0.serialize(serializer),
9394            }
9395        }
9396    }
9397
9398    impl<'de> serde::de::Deserialize<'de> for Intent {
9399        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9400        where
9401            D: serde::Deserializer<'de>,
9402        {
9403            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Intent>::new(
9404                ".google.cloud.config.v1.ResourceChange.Intent",
9405            ))
9406        }
9407    }
9408}
9409
9410/// A property change represents a change to a property in the state file.
9411#[derive(Clone, Default, PartialEq)]
9412#[non_exhaustive]
9413pub struct PropertyChange {
9414    /// Output only. The path of the property change.
9415    pub path: std::string::String,
9416
9417    /// Output only. The paths of sensitive fields in `before`. Paths are relative
9418    /// to `path`.
9419    pub before_sensitive_paths: std::vec::Vec<std::string::String>,
9420
9421    /// Output only. Representations of the object value before the actions.
9422    pub before: std::option::Option<wkt::Value>,
9423
9424    /// Output only. The paths of sensitive fields in `after`. Paths are relative
9425    /// to `path`.
9426    pub after_sensitive_paths: std::vec::Vec<std::string::String>,
9427
9428    /// Output only. Representations of the object value after the actions.
9429    pub after: std::option::Option<wkt::Value>,
9430
9431    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9432}
9433
9434impl PropertyChange {
9435    pub fn new() -> Self {
9436        std::default::Default::default()
9437    }
9438
9439    /// Sets the value of [path][crate::model::PropertyChange::path].
9440    ///
9441    /// # Example
9442    /// ```ignore,no_run
9443    /// # use google_cloud_config_v1::model::PropertyChange;
9444    /// let x = PropertyChange::new().set_path("example");
9445    /// ```
9446    pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9447        self.path = v.into();
9448        self
9449    }
9450
9451    /// Sets the value of [before_sensitive_paths][crate::model::PropertyChange::before_sensitive_paths].
9452    ///
9453    /// # Example
9454    /// ```ignore,no_run
9455    /// # use google_cloud_config_v1::model::PropertyChange;
9456    /// let x = PropertyChange::new().set_before_sensitive_paths(["a", "b", "c"]);
9457    /// ```
9458    pub fn set_before_sensitive_paths<T, V>(mut self, v: T) -> Self
9459    where
9460        T: std::iter::IntoIterator<Item = V>,
9461        V: std::convert::Into<std::string::String>,
9462    {
9463        use std::iter::Iterator;
9464        self.before_sensitive_paths = v.into_iter().map(|i| i.into()).collect();
9465        self
9466    }
9467
9468    /// Sets the value of [before][crate::model::PropertyChange::before].
9469    ///
9470    /// # Example
9471    /// ```ignore,no_run
9472    /// # use google_cloud_config_v1::model::PropertyChange;
9473    /// use wkt::Value;
9474    /// let x = PropertyChange::new().set_before(Value::default()/* use setters */);
9475    /// ```
9476    pub fn set_before<T>(mut self, v: T) -> Self
9477    where
9478        T: std::convert::Into<wkt::Value>,
9479    {
9480        self.before = std::option::Option::Some(v.into());
9481        self
9482    }
9483
9484    /// Sets or clears the value of [before][crate::model::PropertyChange::before].
9485    ///
9486    /// # Example
9487    /// ```ignore,no_run
9488    /// # use google_cloud_config_v1::model::PropertyChange;
9489    /// use wkt::Value;
9490    /// let x = PropertyChange::new().set_or_clear_before(Some(Value::default()/* use setters */));
9491    /// let x = PropertyChange::new().set_or_clear_before(None::<Value>);
9492    /// ```
9493    pub fn set_or_clear_before<T>(mut self, v: std::option::Option<T>) -> Self
9494    where
9495        T: std::convert::Into<wkt::Value>,
9496    {
9497        self.before = v.map(|x| x.into());
9498        self
9499    }
9500
9501    /// Sets the value of [after_sensitive_paths][crate::model::PropertyChange::after_sensitive_paths].
9502    ///
9503    /// # Example
9504    /// ```ignore,no_run
9505    /// # use google_cloud_config_v1::model::PropertyChange;
9506    /// let x = PropertyChange::new().set_after_sensitive_paths(["a", "b", "c"]);
9507    /// ```
9508    pub fn set_after_sensitive_paths<T, V>(mut self, v: T) -> Self
9509    where
9510        T: std::iter::IntoIterator<Item = V>,
9511        V: std::convert::Into<std::string::String>,
9512    {
9513        use std::iter::Iterator;
9514        self.after_sensitive_paths = v.into_iter().map(|i| i.into()).collect();
9515        self
9516    }
9517
9518    /// Sets the value of [after][crate::model::PropertyChange::after].
9519    ///
9520    /// # Example
9521    /// ```ignore,no_run
9522    /// # use google_cloud_config_v1::model::PropertyChange;
9523    /// use wkt::Value;
9524    /// let x = PropertyChange::new().set_after(Value::default()/* use setters */);
9525    /// ```
9526    pub fn set_after<T>(mut self, v: T) -> Self
9527    where
9528        T: std::convert::Into<wkt::Value>,
9529    {
9530        self.after = std::option::Option::Some(v.into());
9531        self
9532    }
9533
9534    /// Sets or clears the value of [after][crate::model::PropertyChange::after].
9535    ///
9536    /// # Example
9537    /// ```ignore,no_run
9538    /// # use google_cloud_config_v1::model::PropertyChange;
9539    /// use wkt::Value;
9540    /// let x = PropertyChange::new().set_or_clear_after(Some(Value::default()/* use setters */));
9541    /// let x = PropertyChange::new().set_or_clear_after(None::<Value>);
9542    /// ```
9543    pub fn set_or_clear_after<T>(mut self, v: std::option::Option<T>) -> Self
9544    where
9545        T: std::convert::Into<wkt::Value>,
9546    {
9547        self.after = v.map(|x| x.into());
9548        self
9549    }
9550}
9551
9552impl wkt::message::Message for PropertyChange {
9553    fn typename() -> &'static str {
9554        "type.googleapis.com/google.cloud.config.v1.PropertyChange"
9555    }
9556}
9557
9558/// The request message for the ListResourceChanges method.
9559#[derive(Clone, Default, PartialEq)]
9560#[non_exhaustive]
9561pub struct ListResourceChangesRequest {
9562    /// Required. The parent in whose context the ResourceChanges are listed. The
9563    /// parent value is in the format:
9564    /// 'projects/{project_id}/locations/{location}/previews/{preview}'.
9565    pub parent: std::string::String,
9566
9567    /// Optional. When requesting a page of resource changes, 'page_size' specifies
9568    /// number of resource changes to return. If unspecified, at most 500 will be
9569    /// returned. The maximum value is 1000.
9570    pub page_size: i32,
9571
9572    /// Optional. Token returned by previous call to 'ListResourceChanges' which
9573    /// specifies the position in the list from where to continue listing the
9574    /// resource changes.
9575    pub page_token: std::string::String,
9576
9577    /// Optional. Lists the resource changes that match the filter expression. A
9578    /// filter expression filters the resource changes listed in the response. The
9579    /// expression must be of the form '{field} {operator} {value}' where
9580    /// operators: '<', '>',
9581    /// '<=',
9582    /// '>=',
9583    /// '!=', '=', ':' are supported (colon ':' represents a HAS operator which is
9584    /// roughly synonymous with equality). {field} can refer to a proto or JSON
9585    /// field, or a synthetic field. Field names can be camelCase or snake_case.
9586    ///
9587    /// Examples:
9588    ///
9589    /// - Filter by name:
9590    ///   name =
9591    ///   "projects/foo/locations/us-central1/previews/dep/resourceChanges/baz
9592    pub filter: std::string::String,
9593
9594    /// Optional. Field to use to sort the list.
9595    pub order_by: std::string::String,
9596
9597    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9598}
9599
9600impl ListResourceChangesRequest {
9601    pub fn new() -> Self {
9602        std::default::Default::default()
9603    }
9604
9605    /// Sets the value of [parent][crate::model::ListResourceChangesRequest::parent].
9606    ///
9607    /// # Example
9608    /// ```ignore,no_run
9609    /// # use google_cloud_config_v1::model::ListResourceChangesRequest;
9610    /// let x = ListResourceChangesRequest::new().set_parent("example");
9611    /// ```
9612    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9613        self.parent = v.into();
9614        self
9615    }
9616
9617    /// Sets the value of [page_size][crate::model::ListResourceChangesRequest::page_size].
9618    ///
9619    /// # Example
9620    /// ```ignore,no_run
9621    /// # use google_cloud_config_v1::model::ListResourceChangesRequest;
9622    /// let x = ListResourceChangesRequest::new().set_page_size(42);
9623    /// ```
9624    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9625        self.page_size = v.into();
9626        self
9627    }
9628
9629    /// Sets the value of [page_token][crate::model::ListResourceChangesRequest::page_token].
9630    ///
9631    /// # Example
9632    /// ```ignore,no_run
9633    /// # use google_cloud_config_v1::model::ListResourceChangesRequest;
9634    /// let x = ListResourceChangesRequest::new().set_page_token("example");
9635    /// ```
9636    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9637        self.page_token = v.into();
9638        self
9639    }
9640
9641    /// Sets the value of [filter][crate::model::ListResourceChangesRequest::filter].
9642    ///
9643    /// # Example
9644    /// ```ignore,no_run
9645    /// # use google_cloud_config_v1::model::ListResourceChangesRequest;
9646    /// let x = ListResourceChangesRequest::new().set_filter("example");
9647    /// ```
9648    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9649        self.filter = v.into();
9650        self
9651    }
9652
9653    /// Sets the value of [order_by][crate::model::ListResourceChangesRequest::order_by].
9654    ///
9655    /// # Example
9656    /// ```ignore,no_run
9657    /// # use google_cloud_config_v1::model::ListResourceChangesRequest;
9658    /// let x = ListResourceChangesRequest::new().set_order_by("example");
9659    /// ```
9660    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9661        self.order_by = v.into();
9662        self
9663    }
9664}
9665
9666impl wkt::message::Message for ListResourceChangesRequest {
9667    fn typename() -> &'static str {
9668        "type.googleapis.com/google.cloud.config.v1.ListResourceChangesRequest"
9669    }
9670}
9671
9672/// A response to a 'ListResourceChanges' call. Contains a list of
9673/// ResourceChanges.
9674#[derive(Clone, Default, PartialEq)]
9675#[non_exhaustive]
9676pub struct ListResourceChangesResponse {
9677    /// List of ResourceChanges.
9678    pub resource_changes: std::vec::Vec<crate::model::ResourceChange>,
9679
9680    /// A token to request the next page of resources from the
9681    /// 'ListResourceChanges' method. The value of an empty string means that
9682    /// there are no more resources to return.
9683    pub next_page_token: std::string::String,
9684
9685    /// Unreachable resources, if any.
9686    pub unreachable: std::vec::Vec<std::string::String>,
9687
9688    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9689}
9690
9691impl ListResourceChangesResponse {
9692    pub fn new() -> Self {
9693        std::default::Default::default()
9694    }
9695
9696    /// Sets the value of [resource_changes][crate::model::ListResourceChangesResponse::resource_changes].
9697    ///
9698    /// # Example
9699    /// ```ignore,no_run
9700    /// # use google_cloud_config_v1::model::ListResourceChangesResponse;
9701    /// use google_cloud_config_v1::model::ResourceChange;
9702    /// let x = ListResourceChangesResponse::new()
9703    ///     .set_resource_changes([
9704    ///         ResourceChange::default()/* use setters */,
9705    ///         ResourceChange::default()/* use (different) setters */,
9706    ///     ]);
9707    /// ```
9708    pub fn set_resource_changes<T, V>(mut self, v: T) -> Self
9709    where
9710        T: std::iter::IntoIterator<Item = V>,
9711        V: std::convert::Into<crate::model::ResourceChange>,
9712    {
9713        use std::iter::Iterator;
9714        self.resource_changes = v.into_iter().map(|i| i.into()).collect();
9715        self
9716    }
9717
9718    /// Sets the value of [next_page_token][crate::model::ListResourceChangesResponse::next_page_token].
9719    ///
9720    /// # Example
9721    /// ```ignore,no_run
9722    /// # use google_cloud_config_v1::model::ListResourceChangesResponse;
9723    /// let x = ListResourceChangesResponse::new().set_next_page_token("example");
9724    /// ```
9725    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9726        self.next_page_token = v.into();
9727        self
9728    }
9729
9730    /// Sets the value of [unreachable][crate::model::ListResourceChangesResponse::unreachable].
9731    ///
9732    /// # Example
9733    /// ```ignore,no_run
9734    /// # use google_cloud_config_v1::model::ListResourceChangesResponse;
9735    /// let x = ListResourceChangesResponse::new().set_unreachable(["a", "b", "c"]);
9736    /// ```
9737    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
9738    where
9739        T: std::iter::IntoIterator<Item = V>,
9740        V: std::convert::Into<std::string::String>,
9741    {
9742        use std::iter::Iterator;
9743        self.unreachable = v.into_iter().map(|i| i.into()).collect();
9744        self
9745    }
9746}
9747
9748impl wkt::message::Message for ListResourceChangesResponse {
9749    fn typename() -> &'static str {
9750        "type.googleapis.com/google.cloud.config.v1.ListResourceChangesResponse"
9751    }
9752}
9753
9754#[doc(hidden)]
9755impl google_cloud_gax::paginator::internal::PageableResponse for ListResourceChangesResponse {
9756    type PageItem = crate::model::ResourceChange;
9757
9758    fn items(self) -> std::vec::Vec<Self::PageItem> {
9759        self.resource_changes
9760    }
9761
9762    fn next_page_token(&self) -> std::string::String {
9763        use std::clone::Clone;
9764        self.next_page_token.clone()
9765    }
9766}
9767
9768/// The request message for the GetResourceChange method.
9769#[derive(Clone, Default, PartialEq)]
9770#[non_exhaustive]
9771pub struct GetResourceChangeRequest {
9772    /// Required. The name of the resource change to retrieve.
9773    /// Format:
9774    /// 'projects/{project_id}/locations/{location}/previews/{preview}/resourceChanges/{resource_change}'.
9775    pub name: std::string::String,
9776
9777    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9778}
9779
9780impl GetResourceChangeRequest {
9781    pub fn new() -> Self {
9782        std::default::Default::default()
9783    }
9784
9785    /// Sets the value of [name][crate::model::GetResourceChangeRequest::name].
9786    ///
9787    /// # Example
9788    /// ```ignore,no_run
9789    /// # use google_cloud_config_v1::model::GetResourceChangeRequest;
9790    /// let x = GetResourceChangeRequest::new().set_name("example");
9791    /// ```
9792    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9793        self.name = v.into();
9794        self
9795    }
9796}
9797
9798impl wkt::message::Message for GetResourceChangeRequest {
9799    fn typename() -> &'static str {
9800        "type.googleapis.com/google.cloud.config.v1.GetResourceChangeRequest"
9801    }
9802}
9803
9804/// Terraform info of a ResourceChange.
9805#[derive(Clone, Default, PartialEq)]
9806#[non_exhaustive]
9807pub struct ResourceDriftTerraformInfo {
9808    /// Output only. The address of the drifted resource.
9809    pub address: std::string::String,
9810
9811    /// Output only. The type of the drifted resource.
9812    pub r#type: std::string::String,
9813
9814    /// Output only. TF resource name.
9815    pub resource_name: std::string::String,
9816
9817    /// Output only. The provider of the drifted resource.
9818    pub provider: std::string::String,
9819
9820    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9821}
9822
9823impl ResourceDriftTerraformInfo {
9824    pub fn new() -> Self {
9825        std::default::Default::default()
9826    }
9827
9828    /// Sets the value of [address][crate::model::ResourceDriftTerraformInfo::address].
9829    ///
9830    /// # Example
9831    /// ```ignore,no_run
9832    /// # use google_cloud_config_v1::model::ResourceDriftTerraformInfo;
9833    /// let x = ResourceDriftTerraformInfo::new().set_address("example");
9834    /// ```
9835    pub fn set_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9836        self.address = v.into();
9837        self
9838    }
9839
9840    /// Sets the value of [r#type][crate::model::ResourceDriftTerraformInfo::type].
9841    ///
9842    /// # Example
9843    /// ```ignore,no_run
9844    /// # use google_cloud_config_v1::model::ResourceDriftTerraformInfo;
9845    /// let x = ResourceDriftTerraformInfo::new().set_type("example");
9846    /// ```
9847    pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9848        self.r#type = v.into();
9849        self
9850    }
9851
9852    /// Sets the value of [resource_name][crate::model::ResourceDriftTerraformInfo::resource_name].
9853    ///
9854    /// # Example
9855    /// ```ignore,no_run
9856    /// # use google_cloud_config_v1::model::ResourceDriftTerraformInfo;
9857    /// let x = ResourceDriftTerraformInfo::new().set_resource_name("example");
9858    /// ```
9859    pub fn set_resource_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9860        self.resource_name = v.into();
9861        self
9862    }
9863
9864    /// Sets the value of [provider][crate::model::ResourceDriftTerraformInfo::provider].
9865    ///
9866    /// # Example
9867    /// ```ignore,no_run
9868    /// # use google_cloud_config_v1::model::ResourceDriftTerraformInfo;
9869    /// let x = ResourceDriftTerraformInfo::new().set_provider("example");
9870    /// ```
9871    pub fn set_provider<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9872        self.provider = v.into();
9873        self
9874    }
9875}
9876
9877impl wkt::message::Message for ResourceDriftTerraformInfo {
9878    fn typename() -> &'static str {
9879        "type.googleapis.com/google.cloud.config.v1.ResourceDriftTerraformInfo"
9880    }
9881}
9882
9883/// A resource drift represents a drift to a resource in the state file.
9884#[derive(Clone, Default, PartialEq)]
9885#[non_exhaustive]
9886pub struct ResourceDrift {
9887    /// Identifier. The name of the resource drift.
9888    /// Format:
9889    /// 'projects/{project_id}/locations/{location}/previews/{preview}/resourceDrifts/{resource_drift}'.
9890    pub name: std::string::String,
9891
9892    /// Output only. Terraform info of the resource drift.
9893    pub terraform_info: std::option::Option<crate::model::ResourceDriftTerraformInfo>,
9894
9895    /// Output only. The property drifts of the resource drift.
9896    pub property_drifts: std::vec::Vec<crate::model::PropertyDrift>,
9897
9898    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9899}
9900
9901impl ResourceDrift {
9902    pub fn new() -> Self {
9903        std::default::Default::default()
9904    }
9905
9906    /// Sets the value of [name][crate::model::ResourceDrift::name].
9907    ///
9908    /// # Example
9909    /// ```ignore,no_run
9910    /// # use google_cloud_config_v1::model::ResourceDrift;
9911    /// let x = ResourceDrift::new().set_name("example");
9912    /// ```
9913    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9914        self.name = v.into();
9915        self
9916    }
9917
9918    /// Sets the value of [terraform_info][crate::model::ResourceDrift::terraform_info].
9919    ///
9920    /// # Example
9921    /// ```ignore,no_run
9922    /// # use google_cloud_config_v1::model::ResourceDrift;
9923    /// use google_cloud_config_v1::model::ResourceDriftTerraformInfo;
9924    /// let x = ResourceDrift::new().set_terraform_info(ResourceDriftTerraformInfo::default()/* use setters */);
9925    /// ```
9926    pub fn set_terraform_info<T>(mut self, v: T) -> Self
9927    where
9928        T: std::convert::Into<crate::model::ResourceDriftTerraformInfo>,
9929    {
9930        self.terraform_info = std::option::Option::Some(v.into());
9931        self
9932    }
9933
9934    /// Sets or clears the value of [terraform_info][crate::model::ResourceDrift::terraform_info].
9935    ///
9936    /// # Example
9937    /// ```ignore,no_run
9938    /// # use google_cloud_config_v1::model::ResourceDrift;
9939    /// use google_cloud_config_v1::model::ResourceDriftTerraformInfo;
9940    /// let x = ResourceDrift::new().set_or_clear_terraform_info(Some(ResourceDriftTerraformInfo::default()/* use setters */));
9941    /// let x = ResourceDrift::new().set_or_clear_terraform_info(None::<ResourceDriftTerraformInfo>);
9942    /// ```
9943    pub fn set_or_clear_terraform_info<T>(mut self, v: std::option::Option<T>) -> Self
9944    where
9945        T: std::convert::Into<crate::model::ResourceDriftTerraformInfo>,
9946    {
9947        self.terraform_info = v.map(|x| x.into());
9948        self
9949    }
9950
9951    /// Sets the value of [property_drifts][crate::model::ResourceDrift::property_drifts].
9952    ///
9953    /// # Example
9954    /// ```ignore,no_run
9955    /// # use google_cloud_config_v1::model::ResourceDrift;
9956    /// use google_cloud_config_v1::model::PropertyDrift;
9957    /// let x = ResourceDrift::new()
9958    ///     .set_property_drifts([
9959    ///         PropertyDrift::default()/* use setters */,
9960    ///         PropertyDrift::default()/* use (different) setters */,
9961    ///     ]);
9962    /// ```
9963    pub fn set_property_drifts<T, V>(mut self, v: T) -> Self
9964    where
9965        T: std::iter::IntoIterator<Item = V>,
9966        V: std::convert::Into<crate::model::PropertyDrift>,
9967    {
9968        use std::iter::Iterator;
9969        self.property_drifts = v.into_iter().map(|i| i.into()).collect();
9970        self
9971    }
9972}
9973
9974impl wkt::message::Message for ResourceDrift {
9975    fn typename() -> &'static str {
9976        "type.googleapis.com/google.cloud.config.v1.ResourceDrift"
9977    }
9978}
9979
9980/// A property drift represents a drift to a property in the state file.
9981#[derive(Clone, Default, PartialEq)]
9982#[non_exhaustive]
9983pub struct PropertyDrift {
9984    /// Output only. The path of the property drift.
9985    pub path: std::string::String,
9986
9987    /// Output only. The paths of sensitive fields in `before`. Paths are relative
9988    /// to `path`.
9989    pub before_sensitive_paths: std::vec::Vec<std::string::String>,
9990
9991    /// Output only. Representations of the object value before the actions.
9992    pub before: std::option::Option<wkt::Value>,
9993
9994    /// Output only. The paths of sensitive fields in `after`. Paths are relative
9995    /// to `path`.
9996    pub after_sensitive_paths: std::vec::Vec<std::string::String>,
9997
9998    /// Output only. Representations of the object value after the actions.
9999    pub after: std::option::Option<wkt::Value>,
10000
10001    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10002}
10003
10004impl PropertyDrift {
10005    pub fn new() -> Self {
10006        std::default::Default::default()
10007    }
10008
10009    /// Sets the value of [path][crate::model::PropertyDrift::path].
10010    ///
10011    /// # Example
10012    /// ```ignore,no_run
10013    /// # use google_cloud_config_v1::model::PropertyDrift;
10014    /// let x = PropertyDrift::new().set_path("example");
10015    /// ```
10016    pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10017        self.path = v.into();
10018        self
10019    }
10020
10021    /// Sets the value of [before_sensitive_paths][crate::model::PropertyDrift::before_sensitive_paths].
10022    ///
10023    /// # Example
10024    /// ```ignore,no_run
10025    /// # use google_cloud_config_v1::model::PropertyDrift;
10026    /// let x = PropertyDrift::new().set_before_sensitive_paths(["a", "b", "c"]);
10027    /// ```
10028    pub fn set_before_sensitive_paths<T, V>(mut self, v: T) -> Self
10029    where
10030        T: std::iter::IntoIterator<Item = V>,
10031        V: std::convert::Into<std::string::String>,
10032    {
10033        use std::iter::Iterator;
10034        self.before_sensitive_paths = v.into_iter().map(|i| i.into()).collect();
10035        self
10036    }
10037
10038    /// Sets the value of [before][crate::model::PropertyDrift::before].
10039    ///
10040    /// # Example
10041    /// ```ignore,no_run
10042    /// # use google_cloud_config_v1::model::PropertyDrift;
10043    /// use wkt::Value;
10044    /// let x = PropertyDrift::new().set_before(Value::default()/* use setters */);
10045    /// ```
10046    pub fn set_before<T>(mut self, v: T) -> Self
10047    where
10048        T: std::convert::Into<wkt::Value>,
10049    {
10050        self.before = std::option::Option::Some(v.into());
10051        self
10052    }
10053
10054    /// Sets or clears the value of [before][crate::model::PropertyDrift::before].
10055    ///
10056    /// # Example
10057    /// ```ignore,no_run
10058    /// # use google_cloud_config_v1::model::PropertyDrift;
10059    /// use wkt::Value;
10060    /// let x = PropertyDrift::new().set_or_clear_before(Some(Value::default()/* use setters */));
10061    /// let x = PropertyDrift::new().set_or_clear_before(None::<Value>);
10062    /// ```
10063    pub fn set_or_clear_before<T>(mut self, v: std::option::Option<T>) -> Self
10064    where
10065        T: std::convert::Into<wkt::Value>,
10066    {
10067        self.before = v.map(|x| x.into());
10068        self
10069    }
10070
10071    /// Sets the value of [after_sensitive_paths][crate::model::PropertyDrift::after_sensitive_paths].
10072    ///
10073    /// # Example
10074    /// ```ignore,no_run
10075    /// # use google_cloud_config_v1::model::PropertyDrift;
10076    /// let x = PropertyDrift::new().set_after_sensitive_paths(["a", "b", "c"]);
10077    /// ```
10078    pub fn set_after_sensitive_paths<T, V>(mut self, v: T) -> Self
10079    where
10080        T: std::iter::IntoIterator<Item = V>,
10081        V: std::convert::Into<std::string::String>,
10082    {
10083        use std::iter::Iterator;
10084        self.after_sensitive_paths = v.into_iter().map(|i| i.into()).collect();
10085        self
10086    }
10087
10088    /// Sets the value of [after][crate::model::PropertyDrift::after].
10089    ///
10090    /// # Example
10091    /// ```ignore,no_run
10092    /// # use google_cloud_config_v1::model::PropertyDrift;
10093    /// use wkt::Value;
10094    /// let x = PropertyDrift::new().set_after(Value::default()/* use setters */);
10095    /// ```
10096    pub fn set_after<T>(mut self, v: T) -> Self
10097    where
10098        T: std::convert::Into<wkt::Value>,
10099    {
10100        self.after = std::option::Option::Some(v.into());
10101        self
10102    }
10103
10104    /// Sets or clears the value of [after][crate::model::PropertyDrift::after].
10105    ///
10106    /// # Example
10107    /// ```ignore,no_run
10108    /// # use google_cloud_config_v1::model::PropertyDrift;
10109    /// use wkt::Value;
10110    /// let x = PropertyDrift::new().set_or_clear_after(Some(Value::default()/* use setters */));
10111    /// let x = PropertyDrift::new().set_or_clear_after(None::<Value>);
10112    /// ```
10113    pub fn set_or_clear_after<T>(mut self, v: std::option::Option<T>) -> Self
10114    where
10115        T: std::convert::Into<wkt::Value>,
10116    {
10117        self.after = v.map(|x| x.into());
10118        self
10119    }
10120}
10121
10122impl wkt::message::Message for PropertyDrift {
10123    fn typename() -> &'static str {
10124        "type.googleapis.com/google.cloud.config.v1.PropertyDrift"
10125    }
10126}
10127
10128/// The request message for the ListResourceDrifts method.
10129#[derive(Clone, Default, PartialEq)]
10130#[non_exhaustive]
10131pub struct ListResourceDriftsRequest {
10132    /// Required. The parent in whose context the ResourceDrifts are listed. The
10133    /// parent value is in the format:
10134    /// 'projects/{project_id}/locations/{location}/previews/{preview}'.
10135    pub parent: std::string::String,
10136
10137    /// Optional. When requesting a page of resource drifts, 'page_size' specifies
10138    /// number of resource drifts to return. If unspecified, at most 500 will be
10139    /// returned. The maximum value is 1000.
10140    pub page_size: i32,
10141
10142    /// Optional. Token returned by previous call to 'ListResourceDrifts' which
10143    /// specifies the position in the list from where to continue listing the
10144    /// resource drifts.
10145    pub page_token: std::string::String,
10146
10147    /// Optional. Lists the resource drifts that match the filter expression. A
10148    /// filter expression filters the resource drifts listed in the response. The
10149    /// expression must be of the form '{field} {operator} {value}' where
10150    /// operators: '<', '>',
10151    /// '<=',
10152    /// '>=',
10153    /// '!=', '=', ':' are supported (colon ':' represents a HAS operator which is
10154    /// roughly synonymous with equality). {field} can refer to a proto or JSON
10155    /// field, or a synthetic field. Field names can be camelCase or snake_case.
10156    ///
10157    /// Examples:
10158    ///
10159    /// - Filter by name:
10160    ///   name =
10161    ///   "projects/foo/locations/us-central1/previews/dep/resourceDrifts/baz
10162    pub filter: std::string::String,
10163
10164    /// Optional. Field to use to sort the list.
10165    pub order_by: std::string::String,
10166
10167    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10168}
10169
10170impl ListResourceDriftsRequest {
10171    pub fn new() -> Self {
10172        std::default::Default::default()
10173    }
10174
10175    /// Sets the value of [parent][crate::model::ListResourceDriftsRequest::parent].
10176    ///
10177    /// # Example
10178    /// ```ignore,no_run
10179    /// # use google_cloud_config_v1::model::ListResourceDriftsRequest;
10180    /// let x = ListResourceDriftsRequest::new().set_parent("example");
10181    /// ```
10182    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10183        self.parent = v.into();
10184        self
10185    }
10186
10187    /// Sets the value of [page_size][crate::model::ListResourceDriftsRequest::page_size].
10188    ///
10189    /// # Example
10190    /// ```ignore,no_run
10191    /// # use google_cloud_config_v1::model::ListResourceDriftsRequest;
10192    /// let x = ListResourceDriftsRequest::new().set_page_size(42);
10193    /// ```
10194    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10195        self.page_size = v.into();
10196        self
10197    }
10198
10199    /// Sets the value of [page_token][crate::model::ListResourceDriftsRequest::page_token].
10200    ///
10201    /// # Example
10202    /// ```ignore,no_run
10203    /// # use google_cloud_config_v1::model::ListResourceDriftsRequest;
10204    /// let x = ListResourceDriftsRequest::new().set_page_token("example");
10205    /// ```
10206    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10207        self.page_token = v.into();
10208        self
10209    }
10210
10211    /// Sets the value of [filter][crate::model::ListResourceDriftsRequest::filter].
10212    ///
10213    /// # Example
10214    /// ```ignore,no_run
10215    /// # use google_cloud_config_v1::model::ListResourceDriftsRequest;
10216    /// let x = ListResourceDriftsRequest::new().set_filter("example");
10217    /// ```
10218    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10219        self.filter = v.into();
10220        self
10221    }
10222
10223    /// Sets the value of [order_by][crate::model::ListResourceDriftsRequest::order_by].
10224    ///
10225    /// # Example
10226    /// ```ignore,no_run
10227    /// # use google_cloud_config_v1::model::ListResourceDriftsRequest;
10228    /// let x = ListResourceDriftsRequest::new().set_order_by("example");
10229    /// ```
10230    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10231        self.order_by = v.into();
10232        self
10233    }
10234}
10235
10236impl wkt::message::Message for ListResourceDriftsRequest {
10237    fn typename() -> &'static str {
10238        "type.googleapis.com/google.cloud.config.v1.ListResourceDriftsRequest"
10239    }
10240}
10241
10242/// A response to a 'ListResourceDrifts' call. Contains a list of ResourceDrifts.
10243#[derive(Clone, Default, PartialEq)]
10244#[non_exhaustive]
10245pub struct ListResourceDriftsResponse {
10246    /// List of ResourceDrifts.
10247    pub resource_drifts: std::vec::Vec<crate::model::ResourceDrift>,
10248
10249    /// A token to request the next page of resources from the
10250    /// 'ListResourceDrifts' method. The value of an empty string means that
10251    /// there are no more resources to return.
10252    pub next_page_token: std::string::String,
10253
10254    /// Unreachable resources, if any.
10255    pub unreachable: std::vec::Vec<std::string::String>,
10256
10257    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10258}
10259
10260impl ListResourceDriftsResponse {
10261    pub fn new() -> Self {
10262        std::default::Default::default()
10263    }
10264
10265    /// Sets the value of [resource_drifts][crate::model::ListResourceDriftsResponse::resource_drifts].
10266    ///
10267    /// # Example
10268    /// ```ignore,no_run
10269    /// # use google_cloud_config_v1::model::ListResourceDriftsResponse;
10270    /// use google_cloud_config_v1::model::ResourceDrift;
10271    /// let x = ListResourceDriftsResponse::new()
10272    ///     .set_resource_drifts([
10273    ///         ResourceDrift::default()/* use setters */,
10274    ///         ResourceDrift::default()/* use (different) setters */,
10275    ///     ]);
10276    /// ```
10277    pub fn set_resource_drifts<T, V>(mut self, v: T) -> Self
10278    where
10279        T: std::iter::IntoIterator<Item = V>,
10280        V: std::convert::Into<crate::model::ResourceDrift>,
10281    {
10282        use std::iter::Iterator;
10283        self.resource_drifts = v.into_iter().map(|i| i.into()).collect();
10284        self
10285    }
10286
10287    /// Sets the value of [next_page_token][crate::model::ListResourceDriftsResponse::next_page_token].
10288    ///
10289    /// # Example
10290    /// ```ignore,no_run
10291    /// # use google_cloud_config_v1::model::ListResourceDriftsResponse;
10292    /// let x = ListResourceDriftsResponse::new().set_next_page_token("example");
10293    /// ```
10294    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10295        self.next_page_token = v.into();
10296        self
10297    }
10298
10299    /// Sets the value of [unreachable][crate::model::ListResourceDriftsResponse::unreachable].
10300    ///
10301    /// # Example
10302    /// ```ignore,no_run
10303    /// # use google_cloud_config_v1::model::ListResourceDriftsResponse;
10304    /// let x = ListResourceDriftsResponse::new().set_unreachable(["a", "b", "c"]);
10305    /// ```
10306    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
10307    where
10308        T: std::iter::IntoIterator<Item = V>,
10309        V: std::convert::Into<std::string::String>,
10310    {
10311        use std::iter::Iterator;
10312        self.unreachable = v.into_iter().map(|i| i.into()).collect();
10313        self
10314    }
10315}
10316
10317impl wkt::message::Message for ListResourceDriftsResponse {
10318    fn typename() -> &'static str {
10319        "type.googleapis.com/google.cloud.config.v1.ListResourceDriftsResponse"
10320    }
10321}
10322
10323#[doc(hidden)]
10324impl google_cloud_gax::paginator::internal::PageableResponse for ListResourceDriftsResponse {
10325    type PageItem = crate::model::ResourceDrift;
10326
10327    fn items(self) -> std::vec::Vec<Self::PageItem> {
10328        self.resource_drifts
10329    }
10330
10331    fn next_page_token(&self) -> std::string::String {
10332        use std::clone::Clone;
10333        self.next_page_token.clone()
10334    }
10335}
10336
10337/// The request message for the GetResourceDrift method.
10338#[derive(Clone, Default, PartialEq)]
10339#[non_exhaustive]
10340pub struct GetResourceDriftRequest {
10341    /// Required. The name of the resource drift to retrieve.
10342    /// Format:
10343    /// 'projects/{project_id}/locations/{location}/previews/{preview}/resourceDrifts/{resource_drift}'.
10344    pub name: std::string::String,
10345
10346    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10347}
10348
10349impl GetResourceDriftRequest {
10350    pub fn new() -> Self {
10351        std::default::Default::default()
10352    }
10353
10354    /// Sets the value of [name][crate::model::GetResourceDriftRequest::name].
10355    ///
10356    /// # Example
10357    /// ```ignore,no_run
10358    /// # use google_cloud_config_v1::model::GetResourceDriftRequest;
10359    /// let x = GetResourceDriftRequest::new().set_name("example");
10360    /// ```
10361    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10362        self.name = v.into();
10363        self
10364    }
10365}
10366
10367impl wkt::message::Message for GetResourceDriftRequest {
10368    fn typename() -> &'static str {
10369        "type.googleapis.com/google.cloud.config.v1.GetResourceDriftRequest"
10370    }
10371}
10372
10373/// ProviderConfig contains the provider configurations.
10374#[derive(Clone, Default, PartialEq)]
10375#[non_exhaustive]
10376pub struct ProviderConfig {
10377    /// Optional. ProviderSource specifies the source type of the provider.
10378    pub source_type: std::option::Option<crate::model::provider_config::ProviderSource>,
10379
10380    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10381}
10382
10383impl ProviderConfig {
10384    pub fn new() -> Self {
10385        std::default::Default::default()
10386    }
10387
10388    /// Sets the value of [source_type][crate::model::ProviderConfig::source_type].
10389    ///
10390    /// # Example
10391    /// ```ignore,no_run
10392    /// # use google_cloud_config_v1::model::ProviderConfig;
10393    /// use google_cloud_config_v1::model::provider_config::ProviderSource;
10394    /// let x0 = ProviderConfig::new().set_source_type(ProviderSource::ServiceMaintained);
10395    /// ```
10396    pub fn set_source_type<T>(mut self, v: T) -> Self
10397    where
10398        T: std::convert::Into<crate::model::provider_config::ProviderSource>,
10399    {
10400        self.source_type = std::option::Option::Some(v.into());
10401        self
10402    }
10403
10404    /// Sets or clears the value of [source_type][crate::model::ProviderConfig::source_type].
10405    ///
10406    /// # Example
10407    /// ```ignore,no_run
10408    /// # use google_cloud_config_v1::model::ProviderConfig;
10409    /// use google_cloud_config_v1::model::provider_config::ProviderSource;
10410    /// let x0 = ProviderConfig::new().set_or_clear_source_type(Some(ProviderSource::ServiceMaintained));
10411    /// let x_none = ProviderConfig::new().set_or_clear_source_type(None::<ProviderSource>);
10412    /// ```
10413    pub fn set_or_clear_source_type<T>(mut self, v: std::option::Option<T>) -> Self
10414    where
10415        T: std::convert::Into<crate::model::provider_config::ProviderSource>,
10416    {
10417        self.source_type = v.map(|x| x.into());
10418        self
10419    }
10420}
10421
10422impl wkt::message::Message for ProviderConfig {
10423    fn typename() -> &'static str {
10424        "type.googleapis.com/google.cloud.config.v1.ProviderConfig"
10425    }
10426}
10427
10428/// Defines additional types related to [ProviderConfig].
10429pub mod provider_config {
10430    #[allow(unused_imports)]
10431    use super::*;
10432
10433    /// ProviderSource represents the source type of the provider.
10434    ///
10435    /// # Working with unknown values
10436    ///
10437    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10438    /// additional enum variants at any time. Adding new variants is not considered
10439    /// a breaking change. Applications should write their code in anticipation of:
10440    ///
10441    /// - New values appearing in future releases of the client library, **and**
10442    /// - New values received dynamically, without application changes.
10443    ///
10444    /// Please consult the [Working with enums] section in the user guide for some
10445    /// guidelines.
10446    ///
10447    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
10448    #[derive(Clone, Debug, PartialEq)]
10449    #[non_exhaustive]
10450    pub enum ProviderSource {
10451        /// Unspecified source type, default to public sources.
10452        Unspecified,
10453        /// Service maintained provider source type.
10454        ServiceMaintained,
10455        /// If set, the enum was initialized with an unknown value.
10456        ///
10457        /// Applications can examine the value using [ProviderSource::value] or
10458        /// [ProviderSource::name].
10459        UnknownValue(provider_source::UnknownValue),
10460    }
10461
10462    #[doc(hidden)]
10463    pub mod provider_source {
10464        #[allow(unused_imports)]
10465        use super::*;
10466        #[derive(Clone, Debug, PartialEq)]
10467        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10468    }
10469
10470    impl ProviderSource {
10471        /// Gets the enum value.
10472        ///
10473        /// Returns `None` if the enum contains an unknown value deserialized from
10474        /// the string representation of enums.
10475        pub fn value(&self) -> std::option::Option<i32> {
10476            match self {
10477                Self::Unspecified => std::option::Option::Some(0),
10478                Self::ServiceMaintained => std::option::Option::Some(1),
10479                Self::UnknownValue(u) => u.0.value(),
10480            }
10481        }
10482
10483        /// Gets the enum value as a string.
10484        ///
10485        /// Returns `None` if the enum contains an unknown value deserialized from
10486        /// the integer representation of enums.
10487        pub fn name(&self) -> std::option::Option<&str> {
10488            match self {
10489                Self::Unspecified => std::option::Option::Some("PROVIDER_SOURCE_UNSPECIFIED"),
10490                Self::ServiceMaintained => std::option::Option::Some("SERVICE_MAINTAINED"),
10491                Self::UnknownValue(u) => u.0.name(),
10492            }
10493        }
10494    }
10495
10496    impl std::default::Default for ProviderSource {
10497        fn default() -> Self {
10498            use std::convert::From;
10499            Self::from(0)
10500        }
10501    }
10502
10503    impl std::fmt::Display for ProviderSource {
10504        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10505            wkt::internal::display_enum(f, self.name(), self.value())
10506        }
10507    }
10508
10509    impl std::convert::From<i32> for ProviderSource {
10510        fn from(value: i32) -> Self {
10511            match value {
10512                0 => Self::Unspecified,
10513                1 => Self::ServiceMaintained,
10514                _ => Self::UnknownValue(provider_source::UnknownValue(
10515                    wkt::internal::UnknownEnumValue::Integer(value),
10516                )),
10517            }
10518        }
10519    }
10520
10521    impl std::convert::From<&str> for ProviderSource {
10522        fn from(value: &str) -> Self {
10523            use std::string::ToString;
10524            match value {
10525                "PROVIDER_SOURCE_UNSPECIFIED" => Self::Unspecified,
10526                "SERVICE_MAINTAINED" => Self::ServiceMaintained,
10527                _ => Self::UnknownValue(provider_source::UnknownValue(
10528                    wkt::internal::UnknownEnumValue::String(value.to_string()),
10529                )),
10530            }
10531        }
10532    }
10533
10534    impl serde::ser::Serialize for ProviderSource {
10535        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10536        where
10537            S: serde::Serializer,
10538        {
10539            match self {
10540                Self::Unspecified => serializer.serialize_i32(0),
10541                Self::ServiceMaintained => serializer.serialize_i32(1),
10542                Self::UnknownValue(u) => u.0.serialize(serializer),
10543            }
10544        }
10545    }
10546
10547    impl<'de> serde::de::Deserialize<'de> for ProviderSource {
10548        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10549        where
10550            D: serde::Deserializer<'de>,
10551        {
10552            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ProviderSource>::new(
10553                ".google.cloud.config.v1.ProviderConfig.ProviderSource",
10554            ))
10555        }
10556    }
10557}
10558
10559/// The request message for the GetAutoMigrationConfig method.
10560#[derive(Clone, Default, PartialEq)]
10561#[non_exhaustive]
10562pub struct GetAutoMigrationConfigRequest {
10563    /// Required. The name of the AutoMigrationConfig.
10564    /// Format:
10565    /// 'projects/{project_id}/locations/{location}/AutoMigrationConfig'.
10566    pub name: std::string::String,
10567
10568    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10569}
10570
10571impl GetAutoMigrationConfigRequest {
10572    pub fn new() -> Self {
10573        std::default::Default::default()
10574    }
10575
10576    /// Sets the value of [name][crate::model::GetAutoMigrationConfigRequest::name].
10577    ///
10578    /// # Example
10579    /// ```ignore,no_run
10580    /// # use google_cloud_config_v1::model::GetAutoMigrationConfigRequest;
10581    /// let x = GetAutoMigrationConfigRequest::new().set_name("example");
10582    /// ```
10583    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10584        self.name = v.into();
10585        self
10586    }
10587}
10588
10589impl wkt::message::Message for GetAutoMigrationConfigRequest {
10590    fn typename() -> &'static str {
10591        "type.googleapis.com/google.cloud.config.v1.GetAutoMigrationConfigRequest"
10592    }
10593}
10594
10595/// AutoMigrationConfig contains the automigration configuration for a project.
10596#[derive(Clone, Default, PartialEq)]
10597#[non_exhaustive]
10598pub struct AutoMigrationConfig {
10599    /// Identifier. The name of the AutoMigrationConfig.
10600    /// Format:
10601    /// 'projects/{project_id}/locations/{location}/AutoMigrationConfig'.
10602    pub name: std::string::String,
10603
10604    /// Output only. Time the AutoMigrationConfig was last updated.
10605    pub update_time: std::option::Option<wkt::Timestamp>,
10606
10607    /// Optional. Whether the auto migration is enabled for the project.
10608    pub auto_migration_enabled: bool,
10609
10610    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10611}
10612
10613impl AutoMigrationConfig {
10614    pub fn new() -> Self {
10615        std::default::Default::default()
10616    }
10617
10618    /// Sets the value of [name][crate::model::AutoMigrationConfig::name].
10619    ///
10620    /// # Example
10621    /// ```ignore,no_run
10622    /// # use google_cloud_config_v1::model::AutoMigrationConfig;
10623    /// let x = AutoMigrationConfig::new().set_name("example");
10624    /// ```
10625    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10626        self.name = v.into();
10627        self
10628    }
10629
10630    /// Sets the value of [update_time][crate::model::AutoMigrationConfig::update_time].
10631    ///
10632    /// # Example
10633    /// ```ignore,no_run
10634    /// # use google_cloud_config_v1::model::AutoMigrationConfig;
10635    /// use wkt::Timestamp;
10636    /// let x = AutoMigrationConfig::new().set_update_time(Timestamp::default()/* use setters */);
10637    /// ```
10638    pub fn set_update_time<T>(mut self, v: T) -> Self
10639    where
10640        T: std::convert::Into<wkt::Timestamp>,
10641    {
10642        self.update_time = std::option::Option::Some(v.into());
10643        self
10644    }
10645
10646    /// Sets or clears the value of [update_time][crate::model::AutoMigrationConfig::update_time].
10647    ///
10648    /// # Example
10649    /// ```ignore,no_run
10650    /// # use google_cloud_config_v1::model::AutoMigrationConfig;
10651    /// use wkt::Timestamp;
10652    /// let x = AutoMigrationConfig::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
10653    /// let x = AutoMigrationConfig::new().set_or_clear_update_time(None::<Timestamp>);
10654    /// ```
10655    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
10656    where
10657        T: std::convert::Into<wkt::Timestamp>,
10658    {
10659        self.update_time = v.map(|x| x.into());
10660        self
10661    }
10662
10663    /// Sets the value of [auto_migration_enabled][crate::model::AutoMigrationConfig::auto_migration_enabled].
10664    ///
10665    /// # Example
10666    /// ```ignore,no_run
10667    /// # use google_cloud_config_v1::model::AutoMigrationConfig;
10668    /// let x = AutoMigrationConfig::new().set_auto_migration_enabled(true);
10669    /// ```
10670    pub fn set_auto_migration_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10671        self.auto_migration_enabled = v.into();
10672        self
10673    }
10674}
10675
10676impl wkt::message::Message for AutoMigrationConfig {
10677    fn typename() -> &'static str {
10678        "type.googleapis.com/google.cloud.config.v1.AutoMigrationConfig"
10679    }
10680}
10681
10682/// The request message for the UpdateAutoMigrationConfig method.
10683#[derive(Clone, Default, PartialEq)]
10684#[non_exhaustive]
10685pub struct UpdateAutoMigrationConfigRequest {
10686    /// Optional. The update mask applies to the resource. See
10687    /// [google.protobuf.FieldMask][google.protobuf.FieldMask].
10688    ///
10689    /// [google.protobuf.FieldMask]: wkt::FieldMask
10690    pub update_mask: std::option::Option<wkt::FieldMask>,
10691
10692    /// Required. The AutoMigrationConfig to update.
10693    pub auto_migration_config: std::option::Option<crate::model::AutoMigrationConfig>,
10694
10695    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10696}
10697
10698impl UpdateAutoMigrationConfigRequest {
10699    pub fn new() -> Self {
10700        std::default::Default::default()
10701    }
10702
10703    /// Sets the value of [update_mask][crate::model::UpdateAutoMigrationConfigRequest::update_mask].
10704    ///
10705    /// # Example
10706    /// ```ignore,no_run
10707    /// # use google_cloud_config_v1::model::UpdateAutoMigrationConfigRequest;
10708    /// use wkt::FieldMask;
10709    /// let x = UpdateAutoMigrationConfigRequest::new().set_update_mask(FieldMask::default()/* use setters */);
10710    /// ```
10711    pub fn set_update_mask<T>(mut self, v: T) -> Self
10712    where
10713        T: std::convert::Into<wkt::FieldMask>,
10714    {
10715        self.update_mask = std::option::Option::Some(v.into());
10716        self
10717    }
10718
10719    /// Sets or clears the value of [update_mask][crate::model::UpdateAutoMigrationConfigRequest::update_mask].
10720    ///
10721    /// # Example
10722    /// ```ignore,no_run
10723    /// # use google_cloud_config_v1::model::UpdateAutoMigrationConfigRequest;
10724    /// use wkt::FieldMask;
10725    /// let x = UpdateAutoMigrationConfigRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
10726    /// let x = UpdateAutoMigrationConfigRequest::new().set_or_clear_update_mask(None::<FieldMask>);
10727    /// ```
10728    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
10729    where
10730        T: std::convert::Into<wkt::FieldMask>,
10731    {
10732        self.update_mask = v.map(|x| x.into());
10733        self
10734    }
10735
10736    /// Sets the value of [auto_migration_config][crate::model::UpdateAutoMigrationConfigRequest::auto_migration_config].
10737    ///
10738    /// # Example
10739    /// ```ignore,no_run
10740    /// # use google_cloud_config_v1::model::UpdateAutoMigrationConfigRequest;
10741    /// use google_cloud_config_v1::model::AutoMigrationConfig;
10742    /// let x = UpdateAutoMigrationConfigRequest::new().set_auto_migration_config(AutoMigrationConfig::default()/* use setters */);
10743    /// ```
10744    pub fn set_auto_migration_config<T>(mut self, v: T) -> Self
10745    where
10746        T: std::convert::Into<crate::model::AutoMigrationConfig>,
10747    {
10748        self.auto_migration_config = std::option::Option::Some(v.into());
10749        self
10750    }
10751
10752    /// Sets or clears the value of [auto_migration_config][crate::model::UpdateAutoMigrationConfigRequest::auto_migration_config].
10753    ///
10754    /// # Example
10755    /// ```ignore,no_run
10756    /// # use google_cloud_config_v1::model::UpdateAutoMigrationConfigRequest;
10757    /// use google_cloud_config_v1::model::AutoMigrationConfig;
10758    /// let x = UpdateAutoMigrationConfigRequest::new().set_or_clear_auto_migration_config(Some(AutoMigrationConfig::default()/* use setters */));
10759    /// let x = UpdateAutoMigrationConfigRequest::new().set_or_clear_auto_migration_config(None::<AutoMigrationConfig>);
10760    /// ```
10761    pub fn set_or_clear_auto_migration_config<T>(mut self, v: std::option::Option<T>) -> Self
10762    where
10763        T: std::convert::Into<crate::model::AutoMigrationConfig>,
10764    {
10765        self.auto_migration_config = v.map(|x| x.into());
10766        self
10767    }
10768}
10769
10770impl wkt::message::Message for UpdateAutoMigrationConfigRequest {
10771    fn typename() -> &'static str {
10772        "type.googleapis.com/google.cloud.config.v1.UpdateAutoMigrationConfigRequest"
10773    }
10774}
10775
10776/// A DeploymentGroup is a collection of DeploymentUnits that in a DAG-like
10777/// structure.
10778#[derive(Clone, Default, PartialEq)]
10779#[non_exhaustive]
10780pub struct DeploymentGroup {
10781    /// Identifier. The name of the deployment group.
10782    /// Format:
10783    /// 'projects/{project_id}/locations/{location}/deploymentGroups/{deployment_group}'.
10784    pub name: std::string::String,
10785
10786    /// Output only. Time when the deployment group was created.
10787    pub create_time: std::option::Option<wkt::Timestamp>,
10788
10789    /// Output only. Time when the deployment group was last updated.
10790    pub update_time: std::option::Option<wkt::Timestamp>,
10791
10792    /// Optional. User-defined metadata for the deployment group.
10793    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
10794
10795    /// Optional. Arbitrary key-value metadata storage e.g. to help client tools
10796    /// identify deployment group during automation. See
10797    /// <https://google.aip.dev/148#annotations> for details on format and size
10798    /// limitations.
10799    pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
10800
10801    /// Output only. Current state of the deployment group.
10802    pub state: crate::model::deployment_group::State,
10803
10804    /// Output only. Additional information regarding the current state.
10805    pub state_description: std::string::String,
10806
10807    /// The deployment units of the deployment group in a DAG like structure.
10808    /// When a deployment group is being provisioned, the deployment units are
10809    /// deployed in a DAG order.
10810    /// The provided units must be in a DAG order, otherwise an error will be
10811    /// returned.
10812    pub deployment_units: std::vec::Vec<crate::model::DeploymentUnit>,
10813
10814    /// Output only. The provisioning state of the deployment group.
10815    pub provisioning_state: crate::model::deployment_group::ProvisioningState,
10816
10817    /// Output only. Additional information regarding the current provisioning
10818    /// state.
10819    pub provisioning_state_description: std::string::String,
10820
10821    /// Output only. The error status of the deployment group provisioning or
10822    /// deprovisioning.
10823    pub provisioning_error: std::option::Option<google_cloud_rpc::model::Status>,
10824
10825    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10826}
10827
10828impl DeploymentGroup {
10829    pub fn new() -> Self {
10830        std::default::Default::default()
10831    }
10832
10833    /// Sets the value of [name][crate::model::DeploymentGroup::name].
10834    ///
10835    /// # Example
10836    /// ```ignore,no_run
10837    /// # use google_cloud_config_v1::model::DeploymentGroup;
10838    /// let x = DeploymentGroup::new().set_name("example");
10839    /// ```
10840    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10841        self.name = v.into();
10842        self
10843    }
10844
10845    /// Sets the value of [create_time][crate::model::DeploymentGroup::create_time].
10846    ///
10847    /// # Example
10848    /// ```ignore,no_run
10849    /// # use google_cloud_config_v1::model::DeploymentGroup;
10850    /// use wkt::Timestamp;
10851    /// let x = DeploymentGroup::new().set_create_time(Timestamp::default()/* use setters */);
10852    /// ```
10853    pub fn set_create_time<T>(mut self, v: T) -> Self
10854    where
10855        T: std::convert::Into<wkt::Timestamp>,
10856    {
10857        self.create_time = std::option::Option::Some(v.into());
10858        self
10859    }
10860
10861    /// Sets or clears the value of [create_time][crate::model::DeploymentGroup::create_time].
10862    ///
10863    /// # Example
10864    /// ```ignore,no_run
10865    /// # use google_cloud_config_v1::model::DeploymentGroup;
10866    /// use wkt::Timestamp;
10867    /// let x = DeploymentGroup::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
10868    /// let x = DeploymentGroup::new().set_or_clear_create_time(None::<Timestamp>);
10869    /// ```
10870    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
10871    where
10872        T: std::convert::Into<wkt::Timestamp>,
10873    {
10874        self.create_time = v.map(|x| x.into());
10875        self
10876    }
10877
10878    /// Sets the value of [update_time][crate::model::DeploymentGroup::update_time].
10879    ///
10880    /// # Example
10881    /// ```ignore,no_run
10882    /// # use google_cloud_config_v1::model::DeploymentGroup;
10883    /// use wkt::Timestamp;
10884    /// let x = DeploymentGroup::new().set_update_time(Timestamp::default()/* use setters */);
10885    /// ```
10886    pub fn set_update_time<T>(mut self, v: T) -> Self
10887    where
10888        T: std::convert::Into<wkt::Timestamp>,
10889    {
10890        self.update_time = std::option::Option::Some(v.into());
10891        self
10892    }
10893
10894    /// Sets or clears the value of [update_time][crate::model::DeploymentGroup::update_time].
10895    ///
10896    /// # Example
10897    /// ```ignore,no_run
10898    /// # use google_cloud_config_v1::model::DeploymentGroup;
10899    /// use wkt::Timestamp;
10900    /// let x = DeploymentGroup::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
10901    /// let x = DeploymentGroup::new().set_or_clear_update_time(None::<Timestamp>);
10902    /// ```
10903    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
10904    where
10905        T: std::convert::Into<wkt::Timestamp>,
10906    {
10907        self.update_time = v.map(|x| x.into());
10908        self
10909    }
10910
10911    /// Sets the value of [labels][crate::model::DeploymentGroup::labels].
10912    ///
10913    /// # Example
10914    /// ```ignore,no_run
10915    /// # use google_cloud_config_v1::model::DeploymentGroup;
10916    /// let x = DeploymentGroup::new().set_labels([
10917    ///     ("key0", "abc"),
10918    ///     ("key1", "xyz"),
10919    /// ]);
10920    /// ```
10921    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
10922    where
10923        T: std::iter::IntoIterator<Item = (K, V)>,
10924        K: std::convert::Into<std::string::String>,
10925        V: std::convert::Into<std::string::String>,
10926    {
10927        use std::iter::Iterator;
10928        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
10929        self
10930    }
10931
10932    /// Sets the value of [annotations][crate::model::DeploymentGroup::annotations].
10933    ///
10934    /// # Example
10935    /// ```ignore,no_run
10936    /// # use google_cloud_config_v1::model::DeploymentGroup;
10937    /// let x = DeploymentGroup::new().set_annotations([
10938    ///     ("key0", "abc"),
10939    ///     ("key1", "xyz"),
10940    /// ]);
10941    /// ```
10942    pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
10943    where
10944        T: std::iter::IntoIterator<Item = (K, V)>,
10945        K: std::convert::Into<std::string::String>,
10946        V: std::convert::Into<std::string::String>,
10947    {
10948        use std::iter::Iterator;
10949        self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
10950        self
10951    }
10952
10953    /// Sets the value of [state][crate::model::DeploymentGroup::state].
10954    ///
10955    /// # Example
10956    /// ```ignore,no_run
10957    /// # use google_cloud_config_v1::model::DeploymentGroup;
10958    /// use google_cloud_config_v1::model::deployment_group::State;
10959    /// let x0 = DeploymentGroup::new().set_state(State::Creating);
10960    /// let x1 = DeploymentGroup::new().set_state(State::Active);
10961    /// let x2 = DeploymentGroup::new().set_state(State::Updating);
10962    /// ```
10963    pub fn set_state<T: std::convert::Into<crate::model::deployment_group::State>>(
10964        mut self,
10965        v: T,
10966    ) -> Self {
10967        self.state = v.into();
10968        self
10969    }
10970
10971    /// Sets the value of [state_description][crate::model::DeploymentGroup::state_description].
10972    ///
10973    /// # Example
10974    /// ```ignore,no_run
10975    /// # use google_cloud_config_v1::model::DeploymentGroup;
10976    /// let x = DeploymentGroup::new().set_state_description("example");
10977    /// ```
10978    pub fn set_state_description<T: std::convert::Into<std::string::String>>(
10979        mut self,
10980        v: T,
10981    ) -> Self {
10982        self.state_description = v.into();
10983        self
10984    }
10985
10986    /// Sets the value of [deployment_units][crate::model::DeploymentGroup::deployment_units].
10987    ///
10988    /// # Example
10989    /// ```ignore,no_run
10990    /// # use google_cloud_config_v1::model::DeploymentGroup;
10991    /// use google_cloud_config_v1::model::DeploymentUnit;
10992    /// let x = DeploymentGroup::new()
10993    ///     .set_deployment_units([
10994    ///         DeploymentUnit::default()/* use setters */,
10995    ///         DeploymentUnit::default()/* use (different) setters */,
10996    ///     ]);
10997    /// ```
10998    pub fn set_deployment_units<T, V>(mut self, v: T) -> Self
10999    where
11000        T: std::iter::IntoIterator<Item = V>,
11001        V: std::convert::Into<crate::model::DeploymentUnit>,
11002    {
11003        use std::iter::Iterator;
11004        self.deployment_units = v.into_iter().map(|i| i.into()).collect();
11005        self
11006    }
11007
11008    /// Sets the value of [provisioning_state][crate::model::DeploymentGroup::provisioning_state].
11009    ///
11010    /// # Example
11011    /// ```ignore,no_run
11012    /// # use google_cloud_config_v1::model::DeploymentGroup;
11013    /// use google_cloud_config_v1::model::deployment_group::ProvisioningState;
11014    /// let x0 = DeploymentGroup::new().set_provisioning_state(ProvisioningState::Provisioning);
11015    /// let x1 = DeploymentGroup::new().set_provisioning_state(ProvisioningState::Provisioned);
11016    /// let x2 = DeploymentGroup::new().set_provisioning_state(ProvisioningState::FailedToProvision);
11017    /// ```
11018    pub fn set_provisioning_state<
11019        T: std::convert::Into<crate::model::deployment_group::ProvisioningState>,
11020    >(
11021        mut self,
11022        v: T,
11023    ) -> Self {
11024        self.provisioning_state = v.into();
11025        self
11026    }
11027
11028    /// Sets the value of [provisioning_state_description][crate::model::DeploymentGroup::provisioning_state_description].
11029    ///
11030    /// # Example
11031    /// ```ignore,no_run
11032    /// # use google_cloud_config_v1::model::DeploymentGroup;
11033    /// let x = DeploymentGroup::new().set_provisioning_state_description("example");
11034    /// ```
11035    pub fn set_provisioning_state_description<T: std::convert::Into<std::string::String>>(
11036        mut self,
11037        v: T,
11038    ) -> Self {
11039        self.provisioning_state_description = v.into();
11040        self
11041    }
11042
11043    /// Sets the value of [provisioning_error][crate::model::DeploymentGroup::provisioning_error].
11044    ///
11045    /// # Example
11046    /// ```ignore,no_run
11047    /// # use google_cloud_config_v1::model::DeploymentGroup;
11048    /// use google_cloud_rpc::model::Status;
11049    /// let x = DeploymentGroup::new().set_provisioning_error(Status::default()/* use setters */);
11050    /// ```
11051    pub fn set_provisioning_error<T>(mut self, v: T) -> Self
11052    where
11053        T: std::convert::Into<google_cloud_rpc::model::Status>,
11054    {
11055        self.provisioning_error = std::option::Option::Some(v.into());
11056        self
11057    }
11058
11059    /// Sets or clears the value of [provisioning_error][crate::model::DeploymentGroup::provisioning_error].
11060    ///
11061    /// # Example
11062    /// ```ignore,no_run
11063    /// # use google_cloud_config_v1::model::DeploymentGroup;
11064    /// use google_cloud_rpc::model::Status;
11065    /// let x = DeploymentGroup::new().set_or_clear_provisioning_error(Some(Status::default()/* use setters */));
11066    /// let x = DeploymentGroup::new().set_or_clear_provisioning_error(None::<Status>);
11067    /// ```
11068    pub fn set_or_clear_provisioning_error<T>(mut self, v: std::option::Option<T>) -> Self
11069    where
11070        T: std::convert::Into<google_cloud_rpc::model::Status>,
11071    {
11072        self.provisioning_error = v.map(|x| x.into());
11073        self
11074    }
11075}
11076
11077impl wkt::message::Message for DeploymentGroup {
11078    fn typename() -> &'static str {
11079        "type.googleapis.com/google.cloud.config.v1.DeploymentGroup"
11080    }
11081}
11082
11083/// Defines additional types related to [DeploymentGroup].
11084pub mod deployment_group {
11085    #[allow(unused_imports)]
11086    use super::*;
11087
11088    /// Possible states of a deployment group.
11089    ///
11090    /// # Working with unknown values
11091    ///
11092    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11093    /// additional enum variants at any time. Adding new variants is not considered
11094    /// a breaking change. Applications should write their code in anticipation of:
11095    ///
11096    /// - New values appearing in future releases of the client library, **and**
11097    /// - New values received dynamically, without application changes.
11098    ///
11099    /// Please consult the [Working with enums] section in the user guide for some
11100    /// guidelines.
11101    ///
11102    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
11103    #[derive(Clone, Debug, PartialEq)]
11104    #[non_exhaustive]
11105    pub enum State {
11106        /// The default value. This value is used if the state is omitted.
11107        Unspecified,
11108        /// The deployment group is being created.
11109        Creating,
11110        /// The deployment group is healthy.
11111        Active,
11112        /// The deployment group is being updated.
11113        Updating,
11114        /// The deployment group is being deleted.
11115        Deleting,
11116        /// The deployment group has encountered an unexpected error.
11117        Failed,
11118        /// The deployment group is no longer being actively reconciled.
11119        /// This may be the result of recovering the project after deletion.
11120        Suspended,
11121        /// The deployment group has been deleted.
11122        Deleted,
11123        /// If set, the enum was initialized with an unknown value.
11124        ///
11125        /// Applications can examine the value using [State::value] or
11126        /// [State::name].
11127        UnknownValue(state::UnknownValue),
11128    }
11129
11130    #[doc(hidden)]
11131    pub mod state {
11132        #[allow(unused_imports)]
11133        use super::*;
11134        #[derive(Clone, Debug, PartialEq)]
11135        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11136    }
11137
11138    impl State {
11139        /// Gets the enum value.
11140        ///
11141        /// Returns `None` if the enum contains an unknown value deserialized from
11142        /// the string representation of enums.
11143        pub fn value(&self) -> std::option::Option<i32> {
11144            match self {
11145                Self::Unspecified => std::option::Option::Some(0),
11146                Self::Creating => std::option::Option::Some(1),
11147                Self::Active => std::option::Option::Some(2),
11148                Self::Updating => std::option::Option::Some(3),
11149                Self::Deleting => std::option::Option::Some(4),
11150                Self::Failed => std::option::Option::Some(5),
11151                Self::Suspended => std::option::Option::Some(6),
11152                Self::Deleted => std::option::Option::Some(7),
11153                Self::UnknownValue(u) => u.0.value(),
11154            }
11155        }
11156
11157        /// Gets the enum value as a string.
11158        ///
11159        /// Returns `None` if the enum contains an unknown value deserialized from
11160        /// the integer representation of enums.
11161        pub fn name(&self) -> std::option::Option<&str> {
11162            match self {
11163                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
11164                Self::Creating => std::option::Option::Some("CREATING"),
11165                Self::Active => std::option::Option::Some("ACTIVE"),
11166                Self::Updating => std::option::Option::Some("UPDATING"),
11167                Self::Deleting => std::option::Option::Some("DELETING"),
11168                Self::Failed => std::option::Option::Some("FAILED"),
11169                Self::Suspended => std::option::Option::Some("SUSPENDED"),
11170                Self::Deleted => std::option::Option::Some("DELETED"),
11171                Self::UnknownValue(u) => u.0.name(),
11172            }
11173        }
11174    }
11175
11176    impl std::default::Default for State {
11177        fn default() -> Self {
11178            use std::convert::From;
11179            Self::from(0)
11180        }
11181    }
11182
11183    impl std::fmt::Display for State {
11184        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11185            wkt::internal::display_enum(f, self.name(), self.value())
11186        }
11187    }
11188
11189    impl std::convert::From<i32> for State {
11190        fn from(value: i32) -> Self {
11191            match value {
11192                0 => Self::Unspecified,
11193                1 => Self::Creating,
11194                2 => Self::Active,
11195                3 => Self::Updating,
11196                4 => Self::Deleting,
11197                5 => Self::Failed,
11198                6 => Self::Suspended,
11199                7 => Self::Deleted,
11200                _ => Self::UnknownValue(state::UnknownValue(
11201                    wkt::internal::UnknownEnumValue::Integer(value),
11202                )),
11203            }
11204        }
11205    }
11206
11207    impl std::convert::From<&str> for State {
11208        fn from(value: &str) -> Self {
11209            use std::string::ToString;
11210            match value {
11211                "STATE_UNSPECIFIED" => Self::Unspecified,
11212                "CREATING" => Self::Creating,
11213                "ACTIVE" => Self::Active,
11214                "UPDATING" => Self::Updating,
11215                "DELETING" => Self::Deleting,
11216                "FAILED" => Self::Failed,
11217                "SUSPENDED" => Self::Suspended,
11218                "DELETED" => Self::Deleted,
11219                _ => Self::UnknownValue(state::UnknownValue(
11220                    wkt::internal::UnknownEnumValue::String(value.to_string()),
11221                )),
11222            }
11223        }
11224    }
11225
11226    impl serde::ser::Serialize for State {
11227        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11228        where
11229            S: serde::Serializer,
11230        {
11231            match self {
11232                Self::Unspecified => serializer.serialize_i32(0),
11233                Self::Creating => serializer.serialize_i32(1),
11234                Self::Active => serializer.serialize_i32(2),
11235                Self::Updating => serializer.serialize_i32(3),
11236                Self::Deleting => serializer.serialize_i32(4),
11237                Self::Failed => serializer.serialize_i32(5),
11238                Self::Suspended => serializer.serialize_i32(6),
11239                Self::Deleted => serializer.serialize_i32(7),
11240                Self::UnknownValue(u) => u.0.serialize(serializer),
11241            }
11242        }
11243    }
11244
11245    impl<'de> serde::de::Deserialize<'de> for State {
11246        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11247        where
11248            D: serde::Deserializer<'de>,
11249        {
11250            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
11251                ".google.cloud.config.v1.DeploymentGroup.State",
11252            ))
11253        }
11254    }
11255
11256    /// Possible provisioning states of a deployment group.
11257    ///
11258    /// # Working with unknown values
11259    ///
11260    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11261    /// additional enum variants at any time. Adding new variants is not considered
11262    /// a breaking change. Applications should write their code in anticipation of:
11263    ///
11264    /// - New values appearing in future releases of the client library, **and**
11265    /// - New values received dynamically, without application changes.
11266    ///
11267    /// Please consult the [Working with enums] section in the user guide for some
11268    /// guidelines.
11269    ///
11270    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
11271    #[derive(Clone, Debug, PartialEq)]
11272    #[non_exhaustive]
11273    pub enum ProvisioningState {
11274        /// Unspecified provisioning state.
11275        Unspecified,
11276        /// The deployment group is being provisioned.
11277        Provisioning,
11278        /// The deployment group is provisioned.
11279        Provisioned,
11280        /// The deployment group failed to be provisioned.
11281        FailedToProvision,
11282        /// The deployment group is being deprovisioned.
11283        Deprovisioning,
11284        /// The deployment group is deprovisioned.
11285        Deprovisioned,
11286        /// The deployment group failed to be deprovisioned.
11287        FailedToDeprovision,
11288        /// If set, the enum was initialized with an unknown value.
11289        ///
11290        /// Applications can examine the value using [ProvisioningState::value] or
11291        /// [ProvisioningState::name].
11292        UnknownValue(provisioning_state::UnknownValue),
11293    }
11294
11295    #[doc(hidden)]
11296    pub mod provisioning_state {
11297        #[allow(unused_imports)]
11298        use super::*;
11299        #[derive(Clone, Debug, PartialEq)]
11300        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11301    }
11302
11303    impl ProvisioningState {
11304        /// Gets the enum value.
11305        ///
11306        /// Returns `None` if the enum contains an unknown value deserialized from
11307        /// the string representation of enums.
11308        pub fn value(&self) -> std::option::Option<i32> {
11309            match self {
11310                Self::Unspecified => std::option::Option::Some(0),
11311                Self::Provisioning => std::option::Option::Some(1),
11312                Self::Provisioned => std::option::Option::Some(2),
11313                Self::FailedToProvision => std::option::Option::Some(3),
11314                Self::Deprovisioning => std::option::Option::Some(4),
11315                Self::Deprovisioned => std::option::Option::Some(5),
11316                Self::FailedToDeprovision => std::option::Option::Some(6),
11317                Self::UnknownValue(u) => u.0.value(),
11318            }
11319        }
11320
11321        /// Gets the enum value as a string.
11322        ///
11323        /// Returns `None` if the enum contains an unknown value deserialized from
11324        /// the integer representation of enums.
11325        pub fn name(&self) -> std::option::Option<&str> {
11326            match self {
11327                Self::Unspecified => std::option::Option::Some("PROVISIONING_STATE_UNSPECIFIED"),
11328                Self::Provisioning => std::option::Option::Some("PROVISIONING"),
11329                Self::Provisioned => std::option::Option::Some("PROVISIONED"),
11330                Self::FailedToProvision => std::option::Option::Some("FAILED_TO_PROVISION"),
11331                Self::Deprovisioning => std::option::Option::Some("DEPROVISIONING"),
11332                Self::Deprovisioned => std::option::Option::Some("DEPROVISIONED"),
11333                Self::FailedToDeprovision => std::option::Option::Some("FAILED_TO_DEPROVISION"),
11334                Self::UnknownValue(u) => u.0.name(),
11335            }
11336        }
11337    }
11338
11339    impl std::default::Default for ProvisioningState {
11340        fn default() -> Self {
11341            use std::convert::From;
11342            Self::from(0)
11343        }
11344    }
11345
11346    impl std::fmt::Display for ProvisioningState {
11347        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11348            wkt::internal::display_enum(f, self.name(), self.value())
11349        }
11350    }
11351
11352    impl std::convert::From<i32> for ProvisioningState {
11353        fn from(value: i32) -> Self {
11354            match value {
11355                0 => Self::Unspecified,
11356                1 => Self::Provisioning,
11357                2 => Self::Provisioned,
11358                3 => Self::FailedToProvision,
11359                4 => Self::Deprovisioning,
11360                5 => Self::Deprovisioned,
11361                6 => Self::FailedToDeprovision,
11362                _ => Self::UnknownValue(provisioning_state::UnknownValue(
11363                    wkt::internal::UnknownEnumValue::Integer(value),
11364                )),
11365            }
11366        }
11367    }
11368
11369    impl std::convert::From<&str> for ProvisioningState {
11370        fn from(value: &str) -> Self {
11371            use std::string::ToString;
11372            match value {
11373                "PROVISIONING_STATE_UNSPECIFIED" => Self::Unspecified,
11374                "PROVISIONING" => Self::Provisioning,
11375                "PROVISIONED" => Self::Provisioned,
11376                "FAILED_TO_PROVISION" => Self::FailedToProvision,
11377                "DEPROVISIONING" => Self::Deprovisioning,
11378                "DEPROVISIONED" => Self::Deprovisioned,
11379                "FAILED_TO_DEPROVISION" => Self::FailedToDeprovision,
11380                _ => Self::UnknownValue(provisioning_state::UnknownValue(
11381                    wkt::internal::UnknownEnumValue::String(value.to_string()),
11382                )),
11383            }
11384        }
11385    }
11386
11387    impl serde::ser::Serialize for ProvisioningState {
11388        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11389        where
11390            S: serde::Serializer,
11391        {
11392            match self {
11393                Self::Unspecified => serializer.serialize_i32(0),
11394                Self::Provisioning => serializer.serialize_i32(1),
11395                Self::Provisioned => serializer.serialize_i32(2),
11396                Self::FailedToProvision => serializer.serialize_i32(3),
11397                Self::Deprovisioning => serializer.serialize_i32(4),
11398                Self::Deprovisioned => serializer.serialize_i32(5),
11399                Self::FailedToDeprovision => serializer.serialize_i32(6),
11400                Self::UnknownValue(u) => u.0.serialize(serializer),
11401            }
11402        }
11403    }
11404
11405    impl<'de> serde::de::Deserialize<'de> for ProvisioningState {
11406        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11407        where
11408            D: serde::Deserializer<'de>,
11409        {
11410            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ProvisioningState>::new(
11411                ".google.cloud.config.v1.DeploymentGroup.ProvisioningState",
11412            ))
11413        }
11414    }
11415}
11416
11417/// A DeploymentUnit is a container for a deployment and its dependencies.
11418/// An existing deployment can be provided directly in the unit, or the unit
11419/// can act as a placeholder to define the DAG, with the deployment specs
11420/// supplied in a `provisionDeploymentRequest`.
11421#[derive(Clone, Default, PartialEq)]
11422#[non_exhaustive]
11423pub struct DeploymentUnit {
11424    /// The id of the deployment unit. Must be unique within the deployment group.
11425    pub id: std::string::String,
11426
11427    /// Optional. The name of the deployment to be provisioned.
11428    /// Format:
11429    /// 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
11430    pub deployment: std::option::Option<std::string::String>,
11431
11432    /// Required. The IDs of the deployment units within the deployment group that
11433    /// this unit depends on.
11434    pub dependencies: std::vec::Vec<std::string::String>,
11435
11436    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11437}
11438
11439impl DeploymentUnit {
11440    pub fn new() -> Self {
11441        std::default::Default::default()
11442    }
11443
11444    /// Sets the value of [id][crate::model::DeploymentUnit::id].
11445    ///
11446    /// # Example
11447    /// ```ignore,no_run
11448    /// # use google_cloud_config_v1::model::DeploymentUnit;
11449    /// let x = DeploymentUnit::new().set_id("example");
11450    /// ```
11451    pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11452        self.id = v.into();
11453        self
11454    }
11455
11456    /// Sets the value of [deployment][crate::model::DeploymentUnit::deployment].
11457    ///
11458    /// # Example
11459    /// ```ignore,no_run
11460    /// # use google_cloud_config_v1::model::DeploymentUnit;
11461    /// let x = DeploymentUnit::new().set_deployment("example");
11462    /// ```
11463    pub fn set_deployment<T>(mut self, v: T) -> Self
11464    where
11465        T: std::convert::Into<std::string::String>,
11466    {
11467        self.deployment = std::option::Option::Some(v.into());
11468        self
11469    }
11470
11471    /// Sets or clears the value of [deployment][crate::model::DeploymentUnit::deployment].
11472    ///
11473    /// # Example
11474    /// ```ignore,no_run
11475    /// # use google_cloud_config_v1::model::DeploymentUnit;
11476    /// let x = DeploymentUnit::new().set_or_clear_deployment(Some("example"));
11477    /// let x = DeploymentUnit::new().set_or_clear_deployment(None::<String>);
11478    /// ```
11479    pub fn set_or_clear_deployment<T>(mut self, v: std::option::Option<T>) -> Self
11480    where
11481        T: std::convert::Into<std::string::String>,
11482    {
11483        self.deployment = v.map(|x| x.into());
11484        self
11485    }
11486
11487    /// Sets the value of [dependencies][crate::model::DeploymentUnit::dependencies].
11488    ///
11489    /// # Example
11490    /// ```ignore,no_run
11491    /// # use google_cloud_config_v1::model::DeploymentUnit;
11492    /// let x = DeploymentUnit::new().set_dependencies(["a", "b", "c"]);
11493    /// ```
11494    pub fn set_dependencies<T, V>(mut self, v: T) -> Self
11495    where
11496        T: std::iter::IntoIterator<Item = V>,
11497        V: std::convert::Into<std::string::String>,
11498    {
11499        use std::iter::Iterator;
11500        self.dependencies = v.into_iter().map(|i| i.into()).collect();
11501        self
11502    }
11503}
11504
11505impl wkt::message::Message for DeploymentUnit {
11506    fn typename() -> &'static str {
11507        "type.googleapis.com/google.cloud.config.v1.DeploymentUnit"
11508    }
11509}
11510
11511/// Spec for a deployment to be created.
11512#[derive(Clone, Default, PartialEq)]
11513#[non_exhaustive]
11514pub struct DeploymentSpec {
11515    /// Required. The id of the deployment to be created which doesn't include the
11516    /// project id and location.
11517    pub deployment_id: std::string::String,
11518
11519    /// Required. The deployment to be created.
11520    pub deployment: std::option::Option<crate::model::Deployment>,
11521
11522    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11523}
11524
11525impl DeploymentSpec {
11526    pub fn new() -> Self {
11527        std::default::Default::default()
11528    }
11529
11530    /// Sets the value of [deployment_id][crate::model::DeploymentSpec::deployment_id].
11531    ///
11532    /// # Example
11533    /// ```ignore,no_run
11534    /// # use google_cloud_config_v1::model::DeploymentSpec;
11535    /// let x = DeploymentSpec::new().set_deployment_id("example");
11536    /// ```
11537    pub fn set_deployment_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11538        self.deployment_id = v.into();
11539        self
11540    }
11541
11542    /// Sets the value of [deployment][crate::model::DeploymentSpec::deployment].
11543    ///
11544    /// # Example
11545    /// ```ignore,no_run
11546    /// # use google_cloud_config_v1::model::DeploymentSpec;
11547    /// use google_cloud_config_v1::model::Deployment;
11548    /// let x = DeploymentSpec::new().set_deployment(Deployment::default()/* use setters */);
11549    /// ```
11550    pub fn set_deployment<T>(mut self, v: T) -> Self
11551    where
11552        T: std::convert::Into<crate::model::Deployment>,
11553    {
11554        self.deployment = std::option::Option::Some(v.into());
11555        self
11556    }
11557
11558    /// Sets or clears the value of [deployment][crate::model::DeploymentSpec::deployment].
11559    ///
11560    /// # Example
11561    /// ```ignore,no_run
11562    /// # use google_cloud_config_v1::model::DeploymentSpec;
11563    /// use google_cloud_config_v1::model::Deployment;
11564    /// let x = DeploymentSpec::new().set_or_clear_deployment(Some(Deployment::default()/* use setters */));
11565    /// let x = DeploymentSpec::new().set_or_clear_deployment(None::<Deployment>);
11566    /// ```
11567    pub fn set_or_clear_deployment<T>(mut self, v: std::option::Option<T>) -> Self
11568    where
11569        T: std::convert::Into<crate::model::Deployment>,
11570    {
11571        self.deployment = v.map(|x| x.into());
11572        self
11573    }
11574}
11575
11576impl wkt::message::Message for DeploymentSpec {
11577    fn typename() -> &'static str {
11578        "type.googleapis.com/google.cloud.config.v1.DeploymentSpec"
11579    }
11580}
11581
11582/// The request message for the GetDeploymentGroup method.
11583#[derive(Clone, Default, PartialEq)]
11584#[non_exhaustive]
11585pub struct GetDeploymentGroupRequest {
11586    /// Required. The name of the deployment group to retrieve.
11587    /// Format:
11588    /// 'projects/{project_id}/locations/{location}/deploymentGroups/{deployment_group}'.
11589    pub name: std::string::String,
11590
11591    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11592}
11593
11594impl GetDeploymentGroupRequest {
11595    pub fn new() -> Self {
11596        std::default::Default::default()
11597    }
11598
11599    /// Sets the value of [name][crate::model::GetDeploymentGroupRequest::name].
11600    ///
11601    /// # Example
11602    /// ```ignore,no_run
11603    /// # use google_cloud_config_v1::model::GetDeploymentGroupRequest;
11604    /// let x = GetDeploymentGroupRequest::new().set_name("example");
11605    /// ```
11606    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11607        self.name = v.into();
11608        self
11609    }
11610}
11611
11612impl wkt::message::Message for GetDeploymentGroupRequest {
11613    fn typename() -> &'static str {
11614        "type.googleapis.com/google.cloud.config.v1.GetDeploymentGroupRequest"
11615    }
11616}
11617
11618/// The request message for the ListDeploymentGroups method.
11619#[derive(Clone, Default, PartialEq)]
11620#[non_exhaustive]
11621pub struct ListDeploymentGroupsRequest {
11622    /// Required. The parent, which owns this collection of deployment groups.
11623    /// Format: 'projects/{project_id}/locations/{location}'.
11624    pub parent: std::string::String,
11625
11626    /// Optional. When requesting a page of resources, 'page_size' specifies number
11627    /// of resources to return. If unspecified, at most 500 will be returned. The
11628    /// maximum value is 1000.
11629    pub page_size: i32,
11630
11631    /// Optional. Token returned by previous call to 'ListDeploymentGroups' which
11632    /// specifies the position in the list from where to continue listing the
11633    /// deployment groups.
11634    pub page_token: std::string::String,
11635
11636    /// Optional. Lists the DeploymentGroups that match the filter expression. A
11637    /// filter expression filters the deployment groups listed in the response. The
11638    /// expression must be of the form '{field} {operator} {value}' where
11639    /// operators: '<', '>',
11640    /// '<=', '>=', '!=', '=', ':' are supported (colon ':' represents a HAS
11641    /// operator which is roughly synonymous with equality). {field} can refer to a
11642    /// proto or JSON field, or a synthetic field. Field names can be camelCase or
11643    /// snake_case.
11644    ///
11645    /// Examples:
11646    ///
11647    /// - Filter by name:
11648    ///   name = "projects/foo/locations/us-central1/deploymentGroups/bar"
11649    ///
11650    /// - Filter by labels:
11651    ///
11652    ///   - Resources that have a key called 'foo'
11653    ///     labels.foo:*
11654    ///   - Resources that have a key called 'foo' whose value is 'bar'
11655    ///     labels.foo = bar
11656    /// - Filter by state:
11657    ///
11658    ///   - DeploymentGroups in CREATING state.
11659    ///     state=CREATING
11660    pub filter: std::string::String,
11661
11662    /// Optional. Field to use to sort the list.
11663    pub order_by: std::string::String,
11664
11665    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11666}
11667
11668impl ListDeploymentGroupsRequest {
11669    pub fn new() -> Self {
11670        std::default::Default::default()
11671    }
11672
11673    /// Sets the value of [parent][crate::model::ListDeploymentGroupsRequest::parent].
11674    ///
11675    /// # Example
11676    /// ```ignore,no_run
11677    /// # use google_cloud_config_v1::model::ListDeploymentGroupsRequest;
11678    /// let x = ListDeploymentGroupsRequest::new().set_parent("example");
11679    /// ```
11680    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11681        self.parent = v.into();
11682        self
11683    }
11684
11685    /// Sets the value of [page_size][crate::model::ListDeploymentGroupsRequest::page_size].
11686    ///
11687    /// # Example
11688    /// ```ignore,no_run
11689    /// # use google_cloud_config_v1::model::ListDeploymentGroupsRequest;
11690    /// let x = ListDeploymentGroupsRequest::new().set_page_size(42);
11691    /// ```
11692    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11693        self.page_size = v.into();
11694        self
11695    }
11696
11697    /// Sets the value of [page_token][crate::model::ListDeploymentGroupsRequest::page_token].
11698    ///
11699    /// # Example
11700    /// ```ignore,no_run
11701    /// # use google_cloud_config_v1::model::ListDeploymentGroupsRequest;
11702    /// let x = ListDeploymentGroupsRequest::new().set_page_token("example");
11703    /// ```
11704    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11705        self.page_token = v.into();
11706        self
11707    }
11708
11709    /// Sets the value of [filter][crate::model::ListDeploymentGroupsRequest::filter].
11710    ///
11711    /// # Example
11712    /// ```ignore,no_run
11713    /// # use google_cloud_config_v1::model::ListDeploymentGroupsRequest;
11714    /// let x = ListDeploymentGroupsRequest::new().set_filter("example");
11715    /// ```
11716    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11717        self.filter = v.into();
11718        self
11719    }
11720
11721    /// Sets the value of [order_by][crate::model::ListDeploymentGroupsRequest::order_by].
11722    ///
11723    /// # Example
11724    /// ```ignore,no_run
11725    /// # use google_cloud_config_v1::model::ListDeploymentGroupsRequest;
11726    /// let x = ListDeploymentGroupsRequest::new().set_order_by("example");
11727    /// ```
11728    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11729        self.order_by = v.into();
11730        self
11731    }
11732}
11733
11734impl wkt::message::Message for ListDeploymentGroupsRequest {
11735    fn typename() -> &'static str {
11736        "type.googleapis.com/google.cloud.config.v1.ListDeploymentGroupsRequest"
11737    }
11738}
11739
11740/// The response message for the ListDeploymentGroups method.
11741#[derive(Clone, Default, PartialEq)]
11742#[non_exhaustive]
11743pub struct ListDeploymentGroupsResponse {
11744    /// The deployment groups from the specified collection.
11745    pub deployment_groups: std::vec::Vec<crate::model::DeploymentGroup>,
11746
11747    /// Token to be supplied to the next ListDeploymentGroups request via
11748    /// `page_token` to obtain the next set of results.
11749    pub next_page_token: std::string::String,
11750
11751    /// Locations that could not be reached.
11752    pub unreachable: std::vec::Vec<std::string::String>,
11753
11754    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11755}
11756
11757impl ListDeploymentGroupsResponse {
11758    pub fn new() -> Self {
11759        std::default::Default::default()
11760    }
11761
11762    /// Sets the value of [deployment_groups][crate::model::ListDeploymentGroupsResponse::deployment_groups].
11763    ///
11764    /// # Example
11765    /// ```ignore,no_run
11766    /// # use google_cloud_config_v1::model::ListDeploymentGroupsResponse;
11767    /// use google_cloud_config_v1::model::DeploymentGroup;
11768    /// let x = ListDeploymentGroupsResponse::new()
11769    ///     .set_deployment_groups([
11770    ///         DeploymentGroup::default()/* use setters */,
11771    ///         DeploymentGroup::default()/* use (different) setters */,
11772    ///     ]);
11773    /// ```
11774    pub fn set_deployment_groups<T, V>(mut self, v: T) -> Self
11775    where
11776        T: std::iter::IntoIterator<Item = V>,
11777        V: std::convert::Into<crate::model::DeploymentGroup>,
11778    {
11779        use std::iter::Iterator;
11780        self.deployment_groups = v.into_iter().map(|i| i.into()).collect();
11781        self
11782    }
11783
11784    /// Sets the value of [next_page_token][crate::model::ListDeploymentGroupsResponse::next_page_token].
11785    ///
11786    /// # Example
11787    /// ```ignore,no_run
11788    /// # use google_cloud_config_v1::model::ListDeploymentGroupsResponse;
11789    /// let x = ListDeploymentGroupsResponse::new().set_next_page_token("example");
11790    /// ```
11791    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11792        self.next_page_token = v.into();
11793        self
11794    }
11795
11796    /// Sets the value of [unreachable][crate::model::ListDeploymentGroupsResponse::unreachable].
11797    ///
11798    /// # Example
11799    /// ```ignore,no_run
11800    /// # use google_cloud_config_v1::model::ListDeploymentGroupsResponse;
11801    /// let x = ListDeploymentGroupsResponse::new().set_unreachable(["a", "b", "c"]);
11802    /// ```
11803    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
11804    where
11805        T: std::iter::IntoIterator<Item = V>,
11806        V: std::convert::Into<std::string::String>,
11807    {
11808        use std::iter::Iterator;
11809        self.unreachable = v.into_iter().map(|i| i.into()).collect();
11810        self
11811    }
11812}
11813
11814impl wkt::message::Message for ListDeploymentGroupsResponse {
11815    fn typename() -> &'static str {
11816        "type.googleapis.com/google.cloud.config.v1.ListDeploymentGroupsResponse"
11817    }
11818}
11819
11820#[doc(hidden)]
11821impl google_cloud_gax::paginator::internal::PageableResponse for ListDeploymentGroupsResponse {
11822    type PageItem = crate::model::DeploymentGroup;
11823
11824    fn items(self) -> std::vec::Vec<Self::PageItem> {
11825        self.deployment_groups
11826    }
11827
11828    fn next_page_token(&self) -> std::string::String {
11829        use std::clone::Clone;
11830        self.next_page_token.clone()
11831    }
11832}
11833
11834/// The request message for the ProvisionDeploymentGroup method.
11835#[derive(Clone, Default, PartialEq)]
11836#[non_exhaustive]
11837pub struct ProvisionDeploymentGroupRequest {
11838    /// Required. The name of the deployment group to provision.
11839    /// Format:
11840    /// 'projects/{project_id}/locations/{location}/deploymentGroups/{deployment_group}'.
11841    pub name: std::string::String,
11842
11843    /// Optional. The deployment specs of the deployment units to be created within
11844    /// the same project and location of the deployment group. The key is the unit
11845    /// ID, and the value is the `DeploymentSpec`. Provisioning will fail if a
11846    /// `deployment_spec` has a `deployment_id` that matches an existing deployment
11847    /// in the same project and location. If an existing deployment was part of the
11848    /// last successful revision but is no longer in the current DeploymentGroup's
11849    /// `deployment_units`, it will be recreated if included in `deployment_specs`.
11850    pub deployment_specs:
11851        std::collections::HashMap<std::string::String, crate::model::DeploymentSpec>,
11852
11853    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11854}
11855
11856impl ProvisionDeploymentGroupRequest {
11857    pub fn new() -> Self {
11858        std::default::Default::default()
11859    }
11860
11861    /// Sets the value of [name][crate::model::ProvisionDeploymentGroupRequest::name].
11862    ///
11863    /// # Example
11864    /// ```ignore,no_run
11865    /// # use google_cloud_config_v1::model::ProvisionDeploymentGroupRequest;
11866    /// let x = ProvisionDeploymentGroupRequest::new().set_name("example");
11867    /// ```
11868    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11869        self.name = v.into();
11870        self
11871    }
11872
11873    /// Sets the value of [deployment_specs][crate::model::ProvisionDeploymentGroupRequest::deployment_specs].
11874    ///
11875    /// # Example
11876    /// ```ignore,no_run
11877    /// # use google_cloud_config_v1::model::ProvisionDeploymentGroupRequest;
11878    /// use google_cloud_config_v1::model::DeploymentSpec;
11879    /// let x = ProvisionDeploymentGroupRequest::new().set_deployment_specs([
11880    ///     ("key0", DeploymentSpec::default()/* use setters */),
11881    ///     ("key1", DeploymentSpec::default()/* use (different) setters */),
11882    /// ]);
11883    /// ```
11884    pub fn set_deployment_specs<T, K, V>(mut self, v: T) -> Self
11885    where
11886        T: std::iter::IntoIterator<Item = (K, V)>,
11887        K: std::convert::Into<std::string::String>,
11888        V: std::convert::Into<crate::model::DeploymentSpec>,
11889    {
11890        use std::iter::Iterator;
11891        self.deployment_specs = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
11892        self
11893    }
11894}
11895
11896impl wkt::message::Message for ProvisionDeploymentGroupRequest {
11897    fn typename() -> &'static str {
11898        "type.googleapis.com/google.cloud.config.v1.ProvisionDeploymentGroupRequest"
11899    }
11900}
11901
11902/// The request message for the DeprovisionDeploymentGroup method.
11903#[derive(Clone, Default, PartialEq)]
11904#[non_exhaustive]
11905pub struct DeprovisionDeploymentGroupRequest {
11906    /// Required. The name of the deployment group to deprovision.
11907    /// Format:
11908    /// 'projects/{project_id}/locations/{location}/deploymentGroups/{deployment_group}'.
11909    pub name: std::string::String,
11910
11911    /// Optional. If set to true, this option is propagated to the deletion of each
11912    /// deployment in the group. This corresponds to the 'force' field
11913    /// in DeleteDeploymentRequest.
11914    pub force: bool,
11915
11916    /// Optional. Policy on how resources within each deployment should be handled
11917    /// during deletion. This policy is applied globally to the deletion of all
11918    /// deployments in this group. This corresponds to the 'delete_policy' field
11919    /// in DeleteDeploymentRequest.
11920    pub delete_policy: crate::model::delete_deployment_request::DeletePolicy,
11921
11922    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11923}
11924
11925impl DeprovisionDeploymentGroupRequest {
11926    pub fn new() -> Self {
11927        std::default::Default::default()
11928    }
11929
11930    /// Sets the value of [name][crate::model::DeprovisionDeploymentGroupRequest::name].
11931    ///
11932    /// # Example
11933    /// ```ignore,no_run
11934    /// # use google_cloud_config_v1::model::DeprovisionDeploymentGroupRequest;
11935    /// let x = DeprovisionDeploymentGroupRequest::new().set_name("example");
11936    /// ```
11937    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11938        self.name = v.into();
11939        self
11940    }
11941
11942    /// Sets the value of [force][crate::model::DeprovisionDeploymentGroupRequest::force].
11943    ///
11944    /// # Example
11945    /// ```ignore,no_run
11946    /// # use google_cloud_config_v1::model::DeprovisionDeploymentGroupRequest;
11947    /// let x = DeprovisionDeploymentGroupRequest::new().set_force(true);
11948    /// ```
11949    pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
11950        self.force = v.into();
11951        self
11952    }
11953
11954    /// Sets the value of [delete_policy][crate::model::DeprovisionDeploymentGroupRequest::delete_policy].
11955    ///
11956    /// # Example
11957    /// ```ignore,no_run
11958    /// # use google_cloud_config_v1::model::DeprovisionDeploymentGroupRequest;
11959    /// use google_cloud_config_v1::model::delete_deployment_request::DeletePolicy;
11960    /// let x0 = DeprovisionDeploymentGroupRequest::new().set_delete_policy(DeletePolicy::Delete);
11961    /// let x1 = DeprovisionDeploymentGroupRequest::new().set_delete_policy(DeletePolicy::Abandon);
11962    /// ```
11963    pub fn set_delete_policy<
11964        T: std::convert::Into<crate::model::delete_deployment_request::DeletePolicy>,
11965    >(
11966        mut self,
11967        v: T,
11968    ) -> Self {
11969        self.delete_policy = v.into();
11970        self
11971    }
11972}
11973
11974impl wkt::message::Message for DeprovisionDeploymentGroupRequest {
11975    fn typename() -> &'static str {
11976        "type.googleapis.com/google.cloud.config.v1.DeprovisionDeploymentGroupRequest"
11977    }
11978}
11979
11980/// The summary of the deployment operation.
11981#[derive(Clone, Default, PartialEq)]
11982#[non_exhaustive]
11983pub struct DeploymentOperationSummary {
11984    /// Output only. The current step the deployment operation is running.
11985    pub deployment_step: crate::model::deployment_operation_metadata::DeploymentStep,
11986
11987    /// Output only. Cloud Build instance UUID associated with this operation.
11988    pub build: std::string::String,
11989
11990    /// Output only. Location of Deployment operations logs in
11991    /// `gs://{bucket}/{object}` format.
11992    pub logs: std::string::String,
11993
11994    /// Output only. Location of Deployment operations content in
11995    /// `gs://{bucket}/{object}` format.
11996    pub content: std::string::String,
11997
11998    /// Output only. Location of Deployment operations artifacts in
11999    /// `gs://{bucket}/{object}` format.
12000    pub artifacts: std::string::String,
12001
12002    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12003}
12004
12005impl DeploymentOperationSummary {
12006    pub fn new() -> Self {
12007        std::default::Default::default()
12008    }
12009
12010    /// Sets the value of [deployment_step][crate::model::DeploymentOperationSummary::deployment_step].
12011    ///
12012    /// # Example
12013    /// ```ignore,no_run
12014    /// # use google_cloud_config_v1::model::DeploymentOperationSummary;
12015    /// use google_cloud_config_v1::model::deployment_operation_metadata::DeploymentStep;
12016    /// let x0 = DeploymentOperationSummary::new().set_deployment_step(DeploymentStep::PreparingStorageBucket);
12017    /// let x1 = DeploymentOperationSummary::new().set_deployment_step(DeploymentStep::DownloadingBlueprint);
12018    /// let x2 = DeploymentOperationSummary::new().set_deployment_step(DeploymentStep::RunningTfInit);
12019    /// ```
12020    pub fn set_deployment_step<
12021        T: std::convert::Into<crate::model::deployment_operation_metadata::DeploymentStep>,
12022    >(
12023        mut self,
12024        v: T,
12025    ) -> Self {
12026        self.deployment_step = v.into();
12027        self
12028    }
12029
12030    /// Sets the value of [build][crate::model::DeploymentOperationSummary::build].
12031    ///
12032    /// # Example
12033    /// ```ignore,no_run
12034    /// # use google_cloud_config_v1::model::DeploymentOperationSummary;
12035    /// let x = DeploymentOperationSummary::new().set_build("example");
12036    /// ```
12037    pub fn set_build<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12038        self.build = v.into();
12039        self
12040    }
12041
12042    /// Sets the value of [logs][crate::model::DeploymentOperationSummary::logs].
12043    ///
12044    /// # Example
12045    /// ```ignore,no_run
12046    /// # use google_cloud_config_v1::model::DeploymentOperationSummary;
12047    /// let x = DeploymentOperationSummary::new().set_logs("example");
12048    /// ```
12049    pub fn set_logs<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12050        self.logs = v.into();
12051        self
12052    }
12053
12054    /// Sets the value of [content][crate::model::DeploymentOperationSummary::content].
12055    ///
12056    /// # Example
12057    /// ```ignore,no_run
12058    /// # use google_cloud_config_v1::model::DeploymentOperationSummary;
12059    /// let x = DeploymentOperationSummary::new().set_content("example");
12060    /// ```
12061    pub fn set_content<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12062        self.content = v.into();
12063        self
12064    }
12065
12066    /// Sets the value of [artifacts][crate::model::DeploymentOperationSummary::artifacts].
12067    ///
12068    /// # Example
12069    /// ```ignore,no_run
12070    /// # use google_cloud_config_v1::model::DeploymentOperationSummary;
12071    /// let x = DeploymentOperationSummary::new().set_artifacts("example");
12072    /// ```
12073    pub fn set_artifacts<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12074        self.artifacts = v.into();
12075        self
12076    }
12077}
12078
12079impl wkt::message::Message for DeploymentOperationSummary {
12080    fn typename() -> &'static str {
12081        "type.googleapis.com/google.cloud.config.v1.DeploymentOperationSummary"
12082    }
12083}
12084
12085/// The progress of a deployment unit provisioning or deprovisioning.
12086#[derive(Clone, Default, PartialEq)]
12087#[non_exhaustive]
12088pub struct DeploymentUnitProgress {
12089    /// Output only. The unit id of the deployment unit to be provisioned.
12090    pub unit_id: std::string::String,
12091
12092    /// Output only. The name of the deployment to be provisioned.
12093    /// Format:
12094    /// 'projects/{project}/locations/{location}/deployments/{deployment}'.
12095    pub deployment: std::string::String,
12096
12097    /// Output only. The current step of the deployment unit provisioning.
12098    pub state: crate::model::deployment_unit_progress::State,
12099
12100    /// Output only. Additional information regarding the current state.
12101    pub state_description: std::string::String,
12102
12103    /// Output only. The summary of the deployment operation.
12104    pub deployment_operation_summary: std::option::Option<crate::model::DeploymentOperationSummary>,
12105
12106    /// Output only. Holds the error status of the deployment unit provisioning.
12107    pub error: std::option::Option<google_cloud_rpc::model::Status>,
12108
12109    /// Output only. The intent of the deployment unit.
12110    pub intent: crate::model::deployment_unit_progress::Intent,
12111
12112    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12113}
12114
12115impl DeploymentUnitProgress {
12116    pub fn new() -> Self {
12117        std::default::Default::default()
12118    }
12119
12120    /// Sets the value of [unit_id][crate::model::DeploymentUnitProgress::unit_id].
12121    ///
12122    /// # Example
12123    /// ```ignore,no_run
12124    /// # use google_cloud_config_v1::model::DeploymentUnitProgress;
12125    /// let x = DeploymentUnitProgress::new().set_unit_id("example");
12126    /// ```
12127    pub fn set_unit_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12128        self.unit_id = v.into();
12129        self
12130    }
12131
12132    /// Sets the value of [deployment][crate::model::DeploymentUnitProgress::deployment].
12133    ///
12134    /// # Example
12135    /// ```ignore,no_run
12136    /// # use google_cloud_config_v1::model::DeploymentUnitProgress;
12137    /// let x = DeploymentUnitProgress::new().set_deployment("example");
12138    /// ```
12139    pub fn set_deployment<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12140        self.deployment = v.into();
12141        self
12142    }
12143
12144    /// Sets the value of [state][crate::model::DeploymentUnitProgress::state].
12145    ///
12146    /// # Example
12147    /// ```ignore,no_run
12148    /// # use google_cloud_config_v1::model::DeploymentUnitProgress;
12149    /// use google_cloud_config_v1::model::deployment_unit_progress::State;
12150    /// let x0 = DeploymentUnitProgress::new().set_state(State::Queued);
12151    /// let x1 = DeploymentUnitProgress::new().set_state(State::ApplyingDeployment);
12152    /// let x2 = DeploymentUnitProgress::new().set_state(State::Succeeded);
12153    /// ```
12154    pub fn set_state<T: std::convert::Into<crate::model::deployment_unit_progress::State>>(
12155        mut self,
12156        v: T,
12157    ) -> Self {
12158        self.state = v.into();
12159        self
12160    }
12161
12162    /// Sets the value of [state_description][crate::model::DeploymentUnitProgress::state_description].
12163    ///
12164    /// # Example
12165    /// ```ignore,no_run
12166    /// # use google_cloud_config_v1::model::DeploymentUnitProgress;
12167    /// let x = DeploymentUnitProgress::new().set_state_description("example");
12168    /// ```
12169    pub fn set_state_description<T: std::convert::Into<std::string::String>>(
12170        mut self,
12171        v: T,
12172    ) -> Self {
12173        self.state_description = v.into();
12174        self
12175    }
12176
12177    /// Sets the value of [deployment_operation_summary][crate::model::DeploymentUnitProgress::deployment_operation_summary].
12178    ///
12179    /// # Example
12180    /// ```ignore,no_run
12181    /// # use google_cloud_config_v1::model::DeploymentUnitProgress;
12182    /// use google_cloud_config_v1::model::DeploymentOperationSummary;
12183    /// let x = DeploymentUnitProgress::new().set_deployment_operation_summary(DeploymentOperationSummary::default()/* use setters */);
12184    /// ```
12185    pub fn set_deployment_operation_summary<T>(mut self, v: T) -> Self
12186    where
12187        T: std::convert::Into<crate::model::DeploymentOperationSummary>,
12188    {
12189        self.deployment_operation_summary = std::option::Option::Some(v.into());
12190        self
12191    }
12192
12193    /// Sets or clears the value of [deployment_operation_summary][crate::model::DeploymentUnitProgress::deployment_operation_summary].
12194    ///
12195    /// # Example
12196    /// ```ignore,no_run
12197    /// # use google_cloud_config_v1::model::DeploymentUnitProgress;
12198    /// use google_cloud_config_v1::model::DeploymentOperationSummary;
12199    /// let x = DeploymentUnitProgress::new().set_or_clear_deployment_operation_summary(Some(DeploymentOperationSummary::default()/* use setters */));
12200    /// let x = DeploymentUnitProgress::new().set_or_clear_deployment_operation_summary(None::<DeploymentOperationSummary>);
12201    /// ```
12202    pub fn set_or_clear_deployment_operation_summary<T>(mut self, v: std::option::Option<T>) -> Self
12203    where
12204        T: std::convert::Into<crate::model::DeploymentOperationSummary>,
12205    {
12206        self.deployment_operation_summary = v.map(|x| x.into());
12207        self
12208    }
12209
12210    /// Sets the value of [error][crate::model::DeploymentUnitProgress::error].
12211    ///
12212    /// # Example
12213    /// ```ignore,no_run
12214    /// # use google_cloud_config_v1::model::DeploymentUnitProgress;
12215    /// use google_cloud_rpc::model::Status;
12216    /// let x = DeploymentUnitProgress::new().set_error(Status::default()/* use setters */);
12217    /// ```
12218    pub fn set_error<T>(mut self, v: T) -> Self
12219    where
12220        T: std::convert::Into<google_cloud_rpc::model::Status>,
12221    {
12222        self.error = std::option::Option::Some(v.into());
12223        self
12224    }
12225
12226    /// Sets or clears the value of [error][crate::model::DeploymentUnitProgress::error].
12227    ///
12228    /// # Example
12229    /// ```ignore,no_run
12230    /// # use google_cloud_config_v1::model::DeploymentUnitProgress;
12231    /// use google_cloud_rpc::model::Status;
12232    /// let x = DeploymentUnitProgress::new().set_or_clear_error(Some(Status::default()/* use setters */));
12233    /// let x = DeploymentUnitProgress::new().set_or_clear_error(None::<Status>);
12234    /// ```
12235    pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
12236    where
12237        T: std::convert::Into<google_cloud_rpc::model::Status>,
12238    {
12239        self.error = v.map(|x| x.into());
12240        self
12241    }
12242
12243    /// Sets the value of [intent][crate::model::DeploymentUnitProgress::intent].
12244    ///
12245    /// # Example
12246    /// ```ignore,no_run
12247    /// # use google_cloud_config_v1::model::DeploymentUnitProgress;
12248    /// use google_cloud_config_v1::model::deployment_unit_progress::Intent;
12249    /// let x0 = DeploymentUnitProgress::new().set_intent(Intent::CreateDeployment);
12250    /// let x1 = DeploymentUnitProgress::new().set_intent(Intent::UpdateDeployment);
12251    /// let x2 = DeploymentUnitProgress::new().set_intent(Intent::DeleteDeployment);
12252    /// ```
12253    pub fn set_intent<T: std::convert::Into<crate::model::deployment_unit_progress::Intent>>(
12254        mut self,
12255        v: T,
12256    ) -> Self {
12257        self.intent = v.into();
12258        self
12259    }
12260}
12261
12262impl wkt::message::Message for DeploymentUnitProgress {
12263    fn typename() -> &'static str {
12264        "type.googleapis.com/google.cloud.config.v1.DeploymentUnitProgress"
12265    }
12266}
12267
12268/// Defines additional types related to [DeploymentUnitProgress].
12269pub mod deployment_unit_progress {
12270    #[allow(unused_imports)]
12271    use super::*;
12272
12273    /// The possible steps a deployment unit provisioning may be running.
12274    ///
12275    /// # Working with unknown values
12276    ///
12277    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12278    /// additional enum variants at any time. Adding new variants is not considered
12279    /// a breaking change. Applications should write their code in anticipation of:
12280    ///
12281    /// - New values appearing in future releases of the client library, **and**
12282    /// - New values received dynamically, without application changes.
12283    ///
12284    /// Please consult the [Working with enums] section in the user guide for some
12285    /// guidelines.
12286    ///
12287    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
12288    #[derive(Clone, Debug, PartialEq)]
12289    #[non_exhaustive]
12290    pub enum State {
12291        /// The default value. This value is unused.
12292        Unspecified,
12293        /// The deployment unit is queued for deployment creation or update.
12294        Queued,
12295        /// The underlying deployment of the unit is being created or updated.
12296        ApplyingDeployment,
12297        /// The underlying deployment operation of the unit has succeeded.
12298        Succeeded,
12299        /// The underlying deployment operation of the unit has failed.
12300        Failed,
12301        /// The deployment unit was aborted, likely due to failures in other
12302        /// dependent deployment units.
12303        Aborted,
12304        /// The deployment unit was skipped because there were no changes to apply.
12305        Skipped,
12306        /// The deployment is being deleted.
12307        DeletingDeployment,
12308        /// The deployment is being previewed.
12309        PreviewingDeployment,
12310        /// If set, the enum was initialized with an unknown value.
12311        ///
12312        /// Applications can examine the value using [State::value] or
12313        /// [State::name].
12314        UnknownValue(state::UnknownValue),
12315    }
12316
12317    #[doc(hidden)]
12318    pub mod state {
12319        #[allow(unused_imports)]
12320        use super::*;
12321        #[derive(Clone, Debug, PartialEq)]
12322        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12323    }
12324
12325    impl State {
12326        /// Gets the enum value.
12327        ///
12328        /// Returns `None` if the enum contains an unknown value deserialized from
12329        /// the string representation of enums.
12330        pub fn value(&self) -> std::option::Option<i32> {
12331            match self {
12332                Self::Unspecified => std::option::Option::Some(0),
12333                Self::Queued => std::option::Option::Some(1),
12334                Self::ApplyingDeployment => std::option::Option::Some(2),
12335                Self::Succeeded => std::option::Option::Some(4),
12336                Self::Failed => std::option::Option::Some(5),
12337                Self::Aborted => std::option::Option::Some(6),
12338                Self::Skipped => std::option::Option::Some(7),
12339                Self::DeletingDeployment => std::option::Option::Some(8),
12340                Self::PreviewingDeployment => std::option::Option::Some(9),
12341                Self::UnknownValue(u) => u.0.value(),
12342            }
12343        }
12344
12345        /// Gets the enum value as a string.
12346        ///
12347        /// Returns `None` if the enum contains an unknown value deserialized from
12348        /// the integer representation of enums.
12349        pub fn name(&self) -> std::option::Option<&str> {
12350            match self {
12351                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
12352                Self::Queued => std::option::Option::Some("QUEUED"),
12353                Self::ApplyingDeployment => std::option::Option::Some("APPLYING_DEPLOYMENT"),
12354                Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
12355                Self::Failed => std::option::Option::Some("FAILED"),
12356                Self::Aborted => std::option::Option::Some("ABORTED"),
12357                Self::Skipped => std::option::Option::Some("SKIPPED"),
12358                Self::DeletingDeployment => std::option::Option::Some("DELETING_DEPLOYMENT"),
12359                Self::PreviewingDeployment => std::option::Option::Some("PREVIEWING_DEPLOYMENT"),
12360                Self::UnknownValue(u) => u.0.name(),
12361            }
12362        }
12363    }
12364
12365    impl std::default::Default for State {
12366        fn default() -> Self {
12367            use std::convert::From;
12368            Self::from(0)
12369        }
12370    }
12371
12372    impl std::fmt::Display for State {
12373        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12374            wkt::internal::display_enum(f, self.name(), self.value())
12375        }
12376    }
12377
12378    impl std::convert::From<i32> for State {
12379        fn from(value: i32) -> Self {
12380            match value {
12381                0 => Self::Unspecified,
12382                1 => Self::Queued,
12383                2 => Self::ApplyingDeployment,
12384                4 => Self::Succeeded,
12385                5 => Self::Failed,
12386                6 => Self::Aborted,
12387                7 => Self::Skipped,
12388                8 => Self::DeletingDeployment,
12389                9 => Self::PreviewingDeployment,
12390                _ => Self::UnknownValue(state::UnknownValue(
12391                    wkt::internal::UnknownEnumValue::Integer(value),
12392                )),
12393            }
12394        }
12395    }
12396
12397    impl std::convert::From<&str> for State {
12398        fn from(value: &str) -> Self {
12399            use std::string::ToString;
12400            match value {
12401                "STATE_UNSPECIFIED" => Self::Unspecified,
12402                "QUEUED" => Self::Queued,
12403                "APPLYING_DEPLOYMENT" => Self::ApplyingDeployment,
12404                "SUCCEEDED" => Self::Succeeded,
12405                "FAILED" => Self::Failed,
12406                "ABORTED" => Self::Aborted,
12407                "SKIPPED" => Self::Skipped,
12408                "DELETING_DEPLOYMENT" => Self::DeletingDeployment,
12409                "PREVIEWING_DEPLOYMENT" => Self::PreviewingDeployment,
12410                _ => Self::UnknownValue(state::UnknownValue(
12411                    wkt::internal::UnknownEnumValue::String(value.to_string()),
12412                )),
12413            }
12414        }
12415    }
12416
12417    impl serde::ser::Serialize for State {
12418        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12419        where
12420            S: serde::Serializer,
12421        {
12422            match self {
12423                Self::Unspecified => serializer.serialize_i32(0),
12424                Self::Queued => serializer.serialize_i32(1),
12425                Self::ApplyingDeployment => serializer.serialize_i32(2),
12426                Self::Succeeded => serializer.serialize_i32(4),
12427                Self::Failed => serializer.serialize_i32(5),
12428                Self::Aborted => serializer.serialize_i32(6),
12429                Self::Skipped => serializer.serialize_i32(7),
12430                Self::DeletingDeployment => serializer.serialize_i32(8),
12431                Self::PreviewingDeployment => serializer.serialize_i32(9),
12432                Self::UnknownValue(u) => u.0.serialize(serializer),
12433            }
12434        }
12435    }
12436
12437    impl<'de> serde::de::Deserialize<'de> for State {
12438        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12439        where
12440            D: serde::Deserializer<'de>,
12441        {
12442            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
12443                ".google.cloud.config.v1.DeploymentUnitProgress.State",
12444            ))
12445        }
12446    }
12447
12448    /// The possible intents of a deployment unit.
12449    ///
12450    /// # Working with unknown values
12451    ///
12452    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12453    /// additional enum variants at any time. Adding new variants is not considered
12454    /// a breaking change. Applications should write their code in anticipation of:
12455    ///
12456    /// - New values appearing in future releases of the client library, **and**
12457    /// - New values received dynamically, without application changes.
12458    ///
12459    /// Please consult the [Working with enums] section in the user guide for some
12460    /// guidelines.
12461    ///
12462    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
12463    #[derive(Clone, Debug, PartialEq)]
12464    #[non_exhaustive]
12465    pub enum Intent {
12466        /// Unspecified intent.
12467        Unspecified,
12468        /// Create deployment in the unit from the deployment spec.
12469        CreateDeployment,
12470        /// Update deployment in the unit.
12471        UpdateDeployment,
12472        /// Delete deployment in the unit.
12473        DeleteDeployment,
12474        /// Recreate deployment in the unit.
12475        RecreateDeployment,
12476        /// Delete deployment in latest successful revision while no longer
12477        /// referenced in any deployment unit in the current deployment group.
12478        CleanUp,
12479        /// Expected to be unchanged.
12480        Unchanged,
12481        /// If set, the enum was initialized with an unknown value.
12482        ///
12483        /// Applications can examine the value using [Intent::value] or
12484        /// [Intent::name].
12485        UnknownValue(intent::UnknownValue),
12486    }
12487
12488    #[doc(hidden)]
12489    pub mod intent {
12490        #[allow(unused_imports)]
12491        use super::*;
12492        #[derive(Clone, Debug, PartialEq)]
12493        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12494    }
12495
12496    impl Intent {
12497        /// Gets the enum value.
12498        ///
12499        /// Returns `None` if the enum contains an unknown value deserialized from
12500        /// the string representation of enums.
12501        pub fn value(&self) -> std::option::Option<i32> {
12502            match self {
12503                Self::Unspecified => std::option::Option::Some(0),
12504                Self::CreateDeployment => std::option::Option::Some(1),
12505                Self::UpdateDeployment => std::option::Option::Some(2),
12506                Self::DeleteDeployment => std::option::Option::Some(3),
12507                Self::RecreateDeployment => std::option::Option::Some(4),
12508                Self::CleanUp => std::option::Option::Some(5),
12509                Self::Unchanged => std::option::Option::Some(6),
12510                Self::UnknownValue(u) => u.0.value(),
12511            }
12512        }
12513
12514        /// Gets the enum value as a string.
12515        ///
12516        /// Returns `None` if the enum contains an unknown value deserialized from
12517        /// the integer representation of enums.
12518        pub fn name(&self) -> std::option::Option<&str> {
12519            match self {
12520                Self::Unspecified => std::option::Option::Some("INTENT_UNSPECIFIED"),
12521                Self::CreateDeployment => std::option::Option::Some("CREATE_DEPLOYMENT"),
12522                Self::UpdateDeployment => std::option::Option::Some("UPDATE_DEPLOYMENT"),
12523                Self::DeleteDeployment => std::option::Option::Some("DELETE_DEPLOYMENT"),
12524                Self::RecreateDeployment => std::option::Option::Some("RECREATE_DEPLOYMENT"),
12525                Self::CleanUp => std::option::Option::Some("CLEAN_UP"),
12526                Self::Unchanged => std::option::Option::Some("UNCHANGED"),
12527                Self::UnknownValue(u) => u.0.name(),
12528            }
12529        }
12530    }
12531
12532    impl std::default::Default for Intent {
12533        fn default() -> Self {
12534            use std::convert::From;
12535            Self::from(0)
12536        }
12537    }
12538
12539    impl std::fmt::Display for Intent {
12540        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12541            wkt::internal::display_enum(f, self.name(), self.value())
12542        }
12543    }
12544
12545    impl std::convert::From<i32> for Intent {
12546        fn from(value: i32) -> Self {
12547            match value {
12548                0 => Self::Unspecified,
12549                1 => Self::CreateDeployment,
12550                2 => Self::UpdateDeployment,
12551                3 => Self::DeleteDeployment,
12552                4 => Self::RecreateDeployment,
12553                5 => Self::CleanUp,
12554                6 => Self::Unchanged,
12555                _ => Self::UnknownValue(intent::UnknownValue(
12556                    wkt::internal::UnknownEnumValue::Integer(value),
12557                )),
12558            }
12559        }
12560    }
12561
12562    impl std::convert::From<&str> for Intent {
12563        fn from(value: &str) -> Self {
12564            use std::string::ToString;
12565            match value {
12566                "INTENT_UNSPECIFIED" => Self::Unspecified,
12567                "CREATE_DEPLOYMENT" => Self::CreateDeployment,
12568                "UPDATE_DEPLOYMENT" => Self::UpdateDeployment,
12569                "DELETE_DEPLOYMENT" => Self::DeleteDeployment,
12570                "RECREATE_DEPLOYMENT" => Self::RecreateDeployment,
12571                "CLEAN_UP" => Self::CleanUp,
12572                "UNCHANGED" => Self::Unchanged,
12573                _ => Self::UnknownValue(intent::UnknownValue(
12574                    wkt::internal::UnknownEnumValue::String(value.to_string()),
12575                )),
12576            }
12577        }
12578    }
12579
12580    impl serde::ser::Serialize for Intent {
12581        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12582        where
12583            S: serde::Serializer,
12584        {
12585            match self {
12586                Self::Unspecified => serializer.serialize_i32(0),
12587                Self::CreateDeployment => serializer.serialize_i32(1),
12588                Self::UpdateDeployment => serializer.serialize_i32(2),
12589                Self::DeleteDeployment => serializer.serialize_i32(3),
12590                Self::RecreateDeployment => serializer.serialize_i32(4),
12591                Self::CleanUp => serializer.serialize_i32(5),
12592                Self::Unchanged => serializer.serialize_i32(6),
12593                Self::UnknownValue(u) => u.0.serialize(serializer),
12594            }
12595        }
12596    }
12597
12598    impl<'de> serde::de::Deserialize<'de> for Intent {
12599        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12600        where
12601            D: serde::Deserializer<'de>,
12602        {
12603            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Intent>::new(
12604                ".google.cloud.config.v1.DeploymentUnitProgress.Intent",
12605            ))
12606        }
12607    }
12608}
12609
12610/// Operation metadata for `ProvisionDeploymentGroup` and
12611/// `DeprovisionDeploymentGroup` long-running operations.
12612#[derive(Clone, Default, PartialEq)]
12613#[non_exhaustive]
12614pub struct ProvisionDeploymentGroupOperationMetadata {
12615    /// Output only. The current step of the deployment group operation.
12616    pub step:
12617        crate::model::provision_deployment_group_operation_metadata::ProvisionDeploymentGroupStep,
12618
12619    /// Output only. Progress information for each deployment unit within the
12620    /// operation.
12621    pub deployment_unit_progresses: std::vec::Vec<crate::model::DeploymentUnitProgress>,
12622
12623    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12624}
12625
12626impl ProvisionDeploymentGroupOperationMetadata {
12627    pub fn new() -> Self {
12628        std::default::Default::default()
12629    }
12630
12631    /// Sets the value of [step][crate::model::ProvisionDeploymentGroupOperationMetadata::step].
12632    ///
12633    /// # Example
12634    /// ```ignore,no_run
12635    /// # use google_cloud_config_v1::model::ProvisionDeploymentGroupOperationMetadata;
12636    /// use google_cloud_config_v1::model::provision_deployment_group_operation_metadata::ProvisionDeploymentGroupStep;
12637    /// let x0 = ProvisionDeploymentGroupOperationMetadata::new().set_step(ProvisionDeploymentGroupStep::ValidatingDeploymentGroup);
12638    /// let x1 = ProvisionDeploymentGroupOperationMetadata::new().set_step(ProvisionDeploymentGroupStep::AssociatingDeploymentsToDeploymentGroup);
12639    /// let x2 = ProvisionDeploymentGroupOperationMetadata::new().set_step(ProvisionDeploymentGroupStep::ProvisioningDeploymentUnits);
12640    /// ```
12641    pub fn set_step<T: std::convert::Into<crate::model::provision_deployment_group_operation_metadata::ProvisionDeploymentGroupStep>>(mut self, v: T) -> Self{
12642        self.step = v.into();
12643        self
12644    }
12645
12646    /// Sets the value of [deployment_unit_progresses][crate::model::ProvisionDeploymentGroupOperationMetadata::deployment_unit_progresses].
12647    ///
12648    /// # Example
12649    /// ```ignore,no_run
12650    /// # use google_cloud_config_v1::model::ProvisionDeploymentGroupOperationMetadata;
12651    /// use google_cloud_config_v1::model::DeploymentUnitProgress;
12652    /// let x = ProvisionDeploymentGroupOperationMetadata::new()
12653    ///     .set_deployment_unit_progresses([
12654    ///         DeploymentUnitProgress::default()/* use setters */,
12655    ///         DeploymentUnitProgress::default()/* use (different) setters */,
12656    ///     ]);
12657    /// ```
12658    pub fn set_deployment_unit_progresses<T, V>(mut self, v: T) -> Self
12659    where
12660        T: std::iter::IntoIterator<Item = V>,
12661        V: std::convert::Into<crate::model::DeploymentUnitProgress>,
12662    {
12663        use std::iter::Iterator;
12664        self.deployment_unit_progresses = v.into_iter().map(|i| i.into()).collect();
12665        self
12666    }
12667}
12668
12669impl wkt::message::Message for ProvisionDeploymentGroupOperationMetadata {
12670    fn typename() -> &'static str {
12671        "type.googleapis.com/google.cloud.config.v1.ProvisionDeploymentGroupOperationMetadata"
12672    }
12673}
12674
12675/// Defines additional types related to [ProvisionDeploymentGroupOperationMetadata].
12676pub mod provision_deployment_group_operation_metadata {
12677    #[allow(unused_imports)]
12678    use super::*;
12679
12680    /// Possible steps during a deployment group provisioning or deprovisioning
12681    /// operation.
12682    ///
12683    /// # Working with unknown values
12684    ///
12685    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12686    /// additional enum variants at any time. Adding new variants is not considered
12687    /// a breaking change. Applications should write their code in anticipation of:
12688    ///
12689    /// - New values appearing in future releases of the client library, **and**
12690    /// - New values received dynamically, without application changes.
12691    ///
12692    /// Please consult the [Working with enums] section in the user guide for some
12693    /// guidelines.
12694    ///
12695    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
12696    #[derive(Clone, Debug, PartialEq)]
12697    #[non_exhaustive]
12698    pub enum ProvisionDeploymentGroupStep {
12699        /// Unspecified step.
12700        Unspecified,
12701        /// Validating the deployment group.
12702        ValidatingDeploymentGroup,
12703        /// Locking the deployments to the deployment group for atomic actuation.
12704        AssociatingDeploymentsToDeploymentGroup,
12705        /// Provisioning the deployment units.
12706        ProvisioningDeploymentUnits,
12707        /// Unlocking the deployments from the deployment group after actuation.
12708        DisassociatingDeploymentsFromDeploymentGroup,
12709        /// The operation has succeeded.
12710        Succeeded,
12711        /// The operation has failed.
12712        Failed,
12713        /// Deprovisioning the deployment units.
12714        DeprovisioningDeploymentUnits,
12715        /// If set, the enum was initialized with an unknown value.
12716        ///
12717        /// Applications can examine the value using [ProvisionDeploymentGroupStep::value] or
12718        /// [ProvisionDeploymentGroupStep::name].
12719        UnknownValue(provision_deployment_group_step::UnknownValue),
12720    }
12721
12722    #[doc(hidden)]
12723    pub mod provision_deployment_group_step {
12724        #[allow(unused_imports)]
12725        use super::*;
12726        #[derive(Clone, Debug, PartialEq)]
12727        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12728    }
12729
12730    impl ProvisionDeploymentGroupStep {
12731        /// Gets the enum value.
12732        ///
12733        /// Returns `None` if the enum contains an unknown value deserialized from
12734        /// the string representation of enums.
12735        pub fn value(&self) -> std::option::Option<i32> {
12736            match self {
12737                Self::Unspecified => std::option::Option::Some(0),
12738                Self::ValidatingDeploymentGroup => std::option::Option::Some(1),
12739                Self::AssociatingDeploymentsToDeploymentGroup => std::option::Option::Some(2),
12740                Self::ProvisioningDeploymentUnits => std::option::Option::Some(3),
12741                Self::DisassociatingDeploymentsFromDeploymentGroup => std::option::Option::Some(4),
12742                Self::Succeeded => std::option::Option::Some(5),
12743                Self::Failed => std::option::Option::Some(6),
12744                Self::DeprovisioningDeploymentUnits => std::option::Option::Some(7),
12745                Self::UnknownValue(u) => u.0.value(),
12746            }
12747        }
12748
12749        /// Gets the enum value as a string.
12750        ///
12751        /// Returns `None` if the enum contains an unknown value deserialized from
12752        /// the integer representation of enums.
12753        pub fn name(&self) -> std::option::Option<&str> {
12754            match self {
12755                Self::Unspecified => {
12756                    std::option::Option::Some("PROVISION_DEPLOYMENT_GROUP_STEP_UNSPECIFIED")
12757                }
12758                Self::ValidatingDeploymentGroup => {
12759                    std::option::Option::Some("VALIDATING_DEPLOYMENT_GROUP")
12760                }
12761                Self::AssociatingDeploymentsToDeploymentGroup => {
12762                    std::option::Option::Some("ASSOCIATING_DEPLOYMENTS_TO_DEPLOYMENT_GROUP")
12763                }
12764                Self::ProvisioningDeploymentUnits => {
12765                    std::option::Option::Some("PROVISIONING_DEPLOYMENT_UNITS")
12766                }
12767                Self::DisassociatingDeploymentsFromDeploymentGroup => {
12768                    std::option::Option::Some("DISASSOCIATING_DEPLOYMENTS_FROM_DEPLOYMENT_GROUP")
12769                }
12770                Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
12771                Self::Failed => std::option::Option::Some("FAILED"),
12772                Self::DeprovisioningDeploymentUnits => {
12773                    std::option::Option::Some("DEPROVISIONING_DEPLOYMENT_UNITS")
12774                }
12775                Self::UnknownValue(u) => u.0.name(),
12776            }
12777        }
12778    }
12779
12780    impl std::default::Default for ProvisionDeploymentGroupStep {
12781        fn default() -> Self {
12782            use std::convert::From;
12783            Self::from(0)
12784        }
12785    }
12786
12787    impl std::fmt::Display for ProvisionDeploymentGroupStep {
12788        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12789            wkt::internal::display_enum(f, self.name(), self.value())
12790        }
12791    }
12792
12793    impl std::convert::From<i32> for ProvisionDeploymentGroupStep {
12794        fn from(value: i32) -> Self {
12795            match value {
12796                0 => Self::Unspecified,
12797                1 => Self::ValidatingDeploymentGroup,
12798                2 => Self::AssociatingDeploymentsToDeploymentGroup,
12799                3 => Self::ProvisioningDeploymentUnits,
12800                4 => Self::DisassociatingDeploymentsFromDeploymentGroup,
12801                5 => Self::Succeeded,
12802                6 => Self::Failed,
12803                7 => Self::DeprovisioningDeploymentUnits,
12804                _ => Self::UnknownValue(provision_deployment_group_step::UnknownValue(
12805                    wkt::internal::UnknownEnumValue::Integer(value),
12806                )),
12807            }
12808        }
12809    }
12810
12811    impl std::convert::From<&str> for ProvisionDeploymentGroupStep {
12812        fn from(value: &str) -> Self {
12813            use std::string::ToString;
12814            match value {
12815                "PROVISION_DEPLOYMENT_GROUP_STEP_UNSPECIFIED" => Self::Unspecified,
12816                "VALIDATING_DEPLOYMENT_GROUP" => Self::ValidatingDeploymentGroup,
12817                "ASSOCIATING_DEPLOYMENTS_TO_DEPLOYMENT_GROUP" => {
12818                    Self::AssociatingDeploymentsToDeploymentGroup
12819                }
12820                "PROVISIONING_DEPLOYMENT_UNITS" => Self::ProvisioningDeploymentUnits,
12821                "DISASSOCIATING_DEPLOYMENTS_FROM_DEPLOYMENT_GROUP" => {
12822                    Self::DisassociatingDeploymentsFromDeploymentGroup
12823                }
12824                "SUCCEEDED" => Self::Succeeded,
12825                "FAILED" => Self::Failed,
12826                "DEPROVISIONING_DEPLOYMENT_UNITS" => Self::DeprovisioningDeploymentUnits,
12827                _ => Self::UnknownValue(provision_deployment_group_step::UnknownValue(
12828                    wkt::internal::UnknownEnumValue::String(value.to_string()),
12829                )),
12830            }
12831        }
12832    }
12833
12834    impl serde::ser::Serialize for ProvisionDeploymentGroupStep {
12835        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12836        where
12837            S: serde::Serializer,
12838        {
12839            match self {
12840                Self::Unspecified => serializer.serialize_i32(0),
12841                Self::ValidatingDeploymentGroup => serializer.serialize_i32(1),
12842                Self::AssociatingDeploymentsToDeploymentGroup => serializer.serialize_i32(2),
12843                Self::ProvisioningDeploymentUnits => serializer.serialize_i32(3),
12844                Self::DisassociatingDeploymentsFromDeploymentGroup => serializer.serialize_i32(4),
12845                Self::Succeeded => serializer.serialize_i32(5),
12846                Self::Failed => serializer.serialize_i32(6),
12847                Self::DeprovisioningDeploymentUnits => serializer.serialize_i32(7),
12848                Self::UnknownValue(u) => u.0.serialize(serializer),
12849            }
12850        }
12851    }
12852
12853    impl<'de> serde::de::Deserialize<'de> for ProvisionDeploymentGroupStep {
12854        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12855        where
12856            D: serde::Deserializer<'de>,
12857        {
12858            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ProvisionDeploymentGroupStep>::new(
12859                ".google.cloud.config.v1.ProvisionDeploymentGroupOperationMetadata.ProvisionDeploymentGroupStep"))
12860        }
12861    }
12862}
12863
12864/// A DeploymentGroupRevision represents a snapshot of a
12865/// [DeploymentGroup][google.cloud.config.v1.DeploymentGroup] at a given point in
12866/// time, created when a DeploymentGroup is provisioned or deprovisioned.
12867///
12868/// [google.cloud.config.v1.DeploymentGroup]: crate::model::DeploymentGroup
12869#[derive(Clone, Default, PartialEq)]
12870#[non_exhaustive]
12871pub struct DeploymentGroupRevision {
12872    /// Identifier. The name of the deployment group revision.
12873    /// Format:
12874    /// 'projects/{project_id}/locations/{location}/deploymentGroups/{deployment_group}/revisions/{revision}'.
12875    pub name: std::string::String,
12876
12877    /// Output only. The snapshot of the deployment group at this revision.
12878    pub snapshot: std::option::Option<crate::model::DeploymentGroup>,
12879
12880    /// Output only. Time when the deployment group revision was created.
12881    pub create_time: std::option::Option<wkt::Timestamp>,
12882
12883    /// Output only. The alternative IDs of the deployment group revision.
12884    pub alternative_ids: std::vec::Vec<std::string::String>,
12885
12886    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12887}
12888
12889impl DeploymentGroupRevision {
12890    pub fn new() -> Self {
12891        std::default::Default::default()
12892    }
12893
12894    /// Sets the value of [name][crate::model::DeploymentGroupRevision::name].
12895    ///
12896    /// # Example
12897    /// ```ignore,no_run
12898    /// # use google_cloud_config_v1::model::DeploymentGroupRevision;
12899    /// let x = DeploymentGroupRevision::new().set_name("example");
12900    /// ```
12901    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12902        self.name = v.into();
12903        self
12904    }
12905
12906    /// Sets the value of [snapshot][crate::model::DeploymentGroupRevision::snapshot].
12907    ///
12908    /// # Example
12909    /// ```ignore,no_run
12910    /// # use google_cloud_config_v1::model::DeploymentGroupRevision;
12911    /// use google_cloud_config_v1::model::DeploymentGroup;
12912    /// let x = DeploymentGroupRevision::new().set_snapshot(DeploymentGroup::default()/* use setters */);
12913    /// ```
12914    pub fn set_snapshot<T>(mut self, v: T) -> Self
12915    where
12916        T: std::convert::Into<crate::model::DeploymentGroup>,
12917    {
12918        self.snapshot = std::option::Option::Some(v.into());
12919        self
12920    }
12921
12922    /// Sets or clears the value of [snapshot][crate::model::DeploymentGroupRevision::snapshot].
12923    ///
12924    /// # Example
12925    /// ```ignore,no_run
12926    /// # use google_cloud_config_v1::model::DeploymentGroupRevision;
12927    /// use google_cloud_config_v1::model::DeploymentGroup;
12928    /// let x = DeploymentGroupRevision::new().set_or_clear_snapshot(Some(DeploymentGroup::default()/* use setters */));
12929    /// let x = DeploymentGroupRevision::new().set_or_clear_snapshot(None::<DeploymentGroup>);
12930    /// ```
12931    pub fn set_or_clear_snapshot<T>(mut self, v: std::option::Option<T>) -> Self
12932    where
12933        T: std::convert::Into<crate::model::DeploymentGroup>,
12934    {
12935        self.snapshot = v.map(|x| x.into());
12936        self
12937    }
12938
12939    /// Sets the value of [create_time][crate::model::DeploymentGroupRevision::create_time].
12940    ///
12941    /// # Example
12942    /// ```ignore,no_run
12943    /// # use google_cloud_config_v1::model::DeploymentGroupRevision;
12944    /// use wkt::Timestamp;
12945    /// let x = DeploymentGroupRevision::new().set_create_time(Timestamp::default()/* use setters */);
12946    /// ```
12947    pub fn set_create_time<T>(mut self, v: T) -> Self
12948    where
12949        T: std::convert::Into<wkt::Timestamp>,
12950    {
12951        self.create_time = std::option::Option::Some(v.into());
12952        self
12953    }
12954
12955    /// Sets or clears the value of [create_time][crate::model::DeploymentGroupRevision::create_time].
12956    ///
12957    /// # Example
12958    /// ```ignore,no_run
12959    /// # use google_cloud_config_v1::model::DeploymentGroupRevision;
12960    /// use wkt::Timestamp;
12961    /// let x = DeploymentGroupRevision::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
12962    /// let x = DeploymentGroupRevision::new().set_or_clear_create_time(None::<Timestamp>);
12963    /// ```
12964    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
12965    where
12966        T: std::convert::Into<wkt::Timestamp>,
12967    {
12968        self.create_time = v.map(|x| x.into());
12969        self
12970    }
12971
12972    /// Sets the value of [alternative_ids][crate::model::DeploymentGroupRevision::alternative_ids].
12973    ///
12974    /// # Example
12975    /// ```ignore,no_run
12976    /// # use google_cloud_config_v1::model::DeploymentGroupRevision;
12977    /// let x = DeploymentGroupRevision::new().set_alternative_ids(["a", "b", "c"]);
12978    /// ```
12979    pub fn set_alternative_ids<T, V>(mut self, v: T) -> Self
12980    where
12981        T: std::iter::IntoIterator<Item = V>,
12982        V: std::convert::Into<std::string::String>,
12983    {
12984        use std::iter::Iterator;
12985        self.alternative_ids = v.into_iter().map(|i| i.into()).collect();
12986        self
12987    }
12988}
12989
12990impl wkt::message::Message for DeploymentGroupRevision {
12991    fn typename() -> &'static str {
12992        "type.googleapis.com/google.cloud.config.v1.DeploymentGroupRevision"
12993    }
12994}
12995
12996/// The request message for the GetDeploymentGroupRevision method.
12997#[derive(Clone, Default, PartialEq)]
12998#[non_exhaustive]
12999pub struct GetDeploymentGroupRevisionRequest {
13000    /// Required. The name of the deployment group revision to retrieve.
13001    /// Format:
13002    /// 'projects/{project_id}/locations/{location}/deploymentGroups/{deployment_group}/revisions/{revision}'.
13003    pub name: std::string::String,
13004
13005    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13006}
13007
13008impl GetDeploymentGroupRevisionRequest {
13009    pub fn new() -> Self {
13010        std::default::Default::default()
13011    }
13012
13013    /// Sets the value of [name][crate::model::GetDeploymentGroupRevisionRequest::name].
13014    ///
13015    /// # Example
13016    /// ```ignore,no_run
13017    /// # use google_cloud_config_v1::model::GetDeploymentGroupRevisionRequest;
13018    /// let x = GetDeploymentGroupRevisionRequest::new().set_name("example");
13019    /// ```
13020    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13021        self.name = v.into();
13022        self
13023    }
13024}
13025
13026impl wkt::message::Message for GetDeploymentGroupRevisionRequest {
13027    fn typename() -> &'static str {
13028        "type.googleapis.com/google.cloud.config.v1.GetDeploymentGroupRevisionRequest"
13029    }
13030}
13031
13032/// The request message for the ListDeploymentGroupRevisions method.
13033#[derive(Clone, Default, PartialEq)]
13034#[non_exhaustive]
13035pub struct ListDeploymentGroupRevisionsRequest {
13036    /// Required. The parent, which owns this collection of deployment group
13037    /// revisions. Format:
13038    /// 'projects/{project_id}/locations/{location}/deploymentGroups/{deployment_group}'.
13039    pub parent: std::string::String,
13040
13041    /// Optional. When requesting a page of resources, 'page_size' specifies number
13042    /// of resources to return. If unspecified, a sensible default will be used by
13043    /// the server. The maximum value is 1000; values above 1000 will be coerced to
13044    /// 1000.
13045    pub page_size: i32,
13046
13047    /// Optional. Token returned by previous call to 'ListDeploymentGroupRevisions'
13048    /// which specifies the position in the list from where to continue listing the
13049    /// deployment group revisions. All other parameters provided to
13050    /// `ListDeploymentGroupRevisions` must match the call that provided the page
13051    /// token.
13052    pub page_token: std::string::String,
13053
13054    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13055}
13056
13057impl ListDeploymentGroupRevisionsRequest {
13058    pub fn new() -> Self {
13059        std::default::Default::default()
13060    }
13061
13062    /// Sets the value of [parent][crate::model::ListDeploymentGroupRevisionsRequest::parent].
13063    ///
13064    /// # Example
13065    /// ```ignore,no_run
13066    /// # use google_cloud_config_v1::model::ListDeploymentGroupRevisionsRequest;
13067    /// let x = ListDeploymentGroupRevisionsRequest::new().set_parent("example");
13068    /// ```
13069    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13070        self.parent = v.into();
13071        self
13072    }
13073
13074    /// Sets the value of [page_size][crate::model::ListDeploymentGroupRevisionsRequest::page_size].
13075    ///
13076    /// # Example
13077    /// ```ignore,no_run
13078    /// # use google_cloud_config_v1::model::ListDeploymentGroupRevisionsRequest;
13079    /// let x = ListDeploymentGroupRevisionsRequest::new().set_page_size(42);
13080    /// ```
13081    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
13082        self.page_size = v.into();
13083        self
13084    }
13085
13086    /// Sets the value of [page_token][crate::model::ListDeploymentGroupRevisionsRequest::page_token].
13087    ///
13088    /// # Example
13089    /// ```ignore,no_run
13090    /// # use google_cloud_config_v1::model::ListDeploymentGroupRevisionsRequest;
13091    /// let x = ListDeploymentGroupRevisionsRequest::new().set_page_token("example");
13092    /// ```
13093    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13094        self.page_token = v.into();
13095        self
13096    }
13097}
13098
13099impl wkt::message::Message for ListDeploymentGroupRevisionsRequest {
13100    fn typename() -> &'static str {
13101        "type.googleapis.com/google.cloud.config.v1.ListDeploymentGroupRevisionsRequest"
13102    }
13103}
13104
13105/// The response message for the ListDeploymentGroupRevisions method.
13106#[derive(Clone, Default, PartialEq)]
13107#[non_exhaustive]
13108pub struct ListDeploymentGroupRevisionsResponse {
13109    /// The deployment group revisions from the specified collection.
13110    pub deployment_group_revisions: std::vec::Vec<crate::model::DeploymentGroupRevision>,
13111
13112    /// Token to be supplied to the next ListDeploymentGroupRevisions request via
13113    /// `page_token` to obtain the next set of results.
13114    pub next_page_token: std::string::String,
13115
13116    /// Unordered list. Locations that could not be reached.
13117    pub unreachable: std::vec::Vec<std::string::String>,
13118
13119    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13120}
13121
13122impl ListDeploymentGroupRevisionsResponse {
13123    pub fn new() -> Self {
13124        std::default::Default::default()
13125    }
13126
13127    /// Sets the value of [deployment_group_revisions][crate::model::ListDeploymentGroupRevisionsResponse::deployment_group_revisions].
13128    ///
13129    /// # Example
13130    /// ```ignore,no_run
13131    /// # use google_cloud_config_v1::model::ListDeploymentGroupRevisionsResponse;
13132    /// use google_cloud_config_v1::model::DeploymentGroupRevision;
13133    /// let x = ListDeploymentGroupRevisionsResponse::new()
13134    ///     .set_deployment_group_revisions([
13135    ///         DeploymentGroupRevision::default()/* use setters */,
13136    ///         DeploymentGroupRevision::default()/* use (different) setters */,
13137    ///     ]);
13138    /// ```
13139    pub fn set_deployment_group_revisions<T, V>(mut self, v: T) -> Self
13140    where
13141        T: std::iter::IntoIterator<Item = V>,
13142        V: std::convert::Into<crate::model::DeploymentGroupRevision>,
13143    {
13144        use std::iter::Iterator;
13145        self.deployment_group_revisions = v.into_iter().map(|i| i.into()).collect();
13146        self
13147    }
13148
13149    /// Sets the value of [next_page_token][crate::model::ListDeploymentGroupRevisionsResponse::next_page_token].
13150    ///
13151    /// # Example
13152    /// ```ignore,no_run
13153    /// # use google_cloud_config_v1::model::ListDeploymentGroupRevisionsResponse;
13154    /// let x = ListDeploymentGroupRevisionsResponse::new().set_next_page_token("example");
13155    /// ```
13156    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13157        self.next_page_token = v.into();
13158        self
13159    }
13160
13161    /// Sets the value of [unreachable][crate::model::ListDeploymentGroupRevisionsResponse::unreachable].
13162    ///
13163    /// # Example
13164    /// ```ignore,no_run
13165    /// # use google_cloud_config_v1::model::ListDeploymentGroupRevisionsResponse;
13166    /// let x = ListDeploymentGroupRevisionsResponse::new().set_unreachable(["a", "b", "c"]);
13167    /// ```
13168    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
13169    where
13170        T: std::iter::IntoIterator<Item = V>,
13171        V: std::convert::Into<std::string::String>,
13172    {
13173        use std::iter::Iterator;
13174        self.unreachable = v.into_iter().map(|i| i.into()).collect();
13175        self
13176    }
13177}
13178
13179impl wkt::message::Message for ListDeploymentGroupRevisionsResponse {
13180    fn typename() -> &'static str {
13181        "type.googleapis.com/google.cloud.config.v1.ListDeploymentGroupRevisionsResponse"
13182    }
13183}
13184
13185#[doc(hidden)]
13186impl google_cloud_gax::paginator::internal::PageableResponse
13187    for ListDeploymentGroupRevisionsResponse
13188{
13189    type PageItem = crate::model::DeploymentGroupRevision;
13190
13191    fn items(self) -> std::vec::Vec<Self::PageItem> {
13192        self.deployment_group_revisions
13193    }
13194
13195    fn next_page_token(&self) -> std::string::String {
13196        use std::clone::Clone;
13197        self.next_page_token.clone()
13198    }
13199}
13200
13201/// Enum values to control quota checks for resources in terraform
13202/// configuration files.
13203///
13204/// # Working with unknown values
13205///
13206/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13207/// additional enum variants at any time. Adding new variants is not considered
13208/// a breaking change. Applications should write their code in anticipation of:
13209///
13210/// - New values appearing in future releases of the client library, **and**
13211/// - New values received dynamically, without application changes.
13212///
13213/// Please consult the [Working with enums] section in the user guide for some
13214/// guidelines.
13215///
13216/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
13217#[derive(Clone, Debug, PartialEq)]
13218#[non_exhaustive]
13219pub enum QuotaValidation {
13220    /// The default value.
13221    /// QuotaValidation on terraform configuration files will be disabled in
13222    /// this case.
13223    Unspecified,
13224    /// Enable computing quotas for resources in terraform configuration files to
13225    /// get visibility on resources with insufficient quotas.
13226    Enabled,
13227    /// Enforce quota checks so deployment fails if there isn't sufficient quotas
13228    /// available to deploy resources in terraform configuration files.
13229    Enforced,
13230    /// If set, the enum was initialized with an unknown value.
13231    ///
13232    /// Applications can examine the value using [QuotaValidation::value] or
13233    /// [QuotaValidation::name].
13234    UnknownValue(quota_validation::UnknownValue),
13235}
13236
13237#[doc(hidden)]
13238pub mod quota_validation {
13239    #[allow(unused_imports)]
13240    use super::*;
13241    #[derive(Clone, Debug, PartialEq)]
13242    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13243}
13244
13245impl QuotaValidation {
13246    /// Gets the enum value.
13247    ///
13248    /// Returns `None` if the enum contains an unknown value deserialized from
13249    /// the string representation of enums.
13250    pub fn value(&self) -> std::option::Option<i32> {
13251        match self {
13252            Self::Unspecified => std::option::Option::Some(0),
13253            Self::Enabled => std::option::Option::Some(1),
13254            Self::Enforced => std::option::Option::Some(2),
13255            Self::UnknownValue(u) => u.0.value(),
13256        }
13257    }
13258
13259    /// Gets the enum value as a string.
13260    ///
13261    /// Returns `None` if the enum contains an unknown value deserialized from
13262    /// the integer representation of enums.
13263    pub fn name(&self) -> std::option::Option<&str> {
13264        match self {
13265            Self::Unspecified => std::option::Option::Some("QUOTA_VALIDATION_UNSPECIFIED"),
13266            Self::Enabled => std::option::Option::Some("ENABLED"),
13267            Self::Enforced => std::option::Option::Some("ENFORCED"),
13268            Self::UnknownValue(u) => u.0.name(),
13269        }
13270    }
13271}
13272
13273impl std::default::Default for QuotaValidation {
13274    fn default() -> Self {
13275        use std::convert::From;
13276        Self::from(0)
13277    }
13278}
13279
13280impl std::fmt::Display for QuotaValidation {
13281    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13282        wkt::internal::display_enum(f, self.name(), self.value())
13283    }
13284}
13285
13286impl std::convert::From<i32> for QuotaValidation {
13287    fn from(value: i32) -> Self {
13288        match value {
13289            0 => Self::Unspecified,
13290            1 => Self::Enabled,
13291            2 => Self::Enforced,
13292            _ => Self::UnknownValue(quota_validation::UnknownValue(
13293                wkt::internal::UnknownEnumValue::Integer(value),
13294            )),
13295        }
13296    }
13297}
13298
13299impl std::convert::From<&str> for QuotaValidation {
13300    fn from(value: &str) -> Self {
13301        use std::string::ToString;
13302        match value {
13303            "QUOTA_VALIDATION_UNSPECIFIED" => Self::Unspecified,
13304            "ENABLED" => Self::Enabled,
13305            "ENFORCED" => Self::Enforced,
13306            _ => Self::UnknownValue(quota_validation::UnknownValue(
13307                wkt::internal::UnknownEnumValue::String(value.to_string()),
13308            )),
13309        }
13310    }
13311}
13312
13313impl serde::ser::Serialize for QuotaValidation {
13314    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13315    where
13316        S: serde::Serializer,
13317    {
13318        match self {
13319            Self::Unspecified => serializer.serialize_i32(0),
13320            Self::Enabled => serializer.serialize_i32(1),
13321            Self::Enforced => serializer.serialize_i32(2),
13322            Self::UnknownValue(u) => u.0.serialize(serializer),
13323        }
13324    }
13325}
13326
13327impl<'de> serde::de::Deserialize<'de> for QuotaValidation {
13328    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13329    where
13330        D: serde::Deserializer<'de>,
13331    {
13332        deserializer.deserialize_any(wkt::internal::EnumVisitor::<QuotaValidation>::new(
13333            ".google.cloud.config.v1.QuotaValidation",
13334        ))
13335    }
13336}