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::bare_urls)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![allow(rustdoc::invalid_html_tags)]
20#![allow(rustdoc::redundant_explicit_links)]
21#![no_implicit_prelude]
22extern crate async_trait;
23extern crate bytes;
24extern crate gaxi;
25extern crate google_cloud_gax;
26extern crate google_cloud_iam_v1;
27extern crate google_cloud_location;
28extern crate google_cloud_longrunning;
29extern crate google_cloud_lro;
30extern crate google_cloud_rpc;
31extern crate serde;
32extern crate serde_json;
33extern crate serde_with;
34extern crate std;
35extern crate tracing;
36extern crate wkt;
37
38mod debug;
39mod deserialize;
40mod serialize;
41
42/// A Deployment is a group of resources and configs managed and provisioned by
43/// Infra Manager.
44#[derive(Clone, Default, PartialEq)]
45#[non_exhaustive]
46pub struct Deployment {
47    /// Identifier. Resource name of the deployment.
48    /// Format: `projects/{project}/locations/{location}/deployments/{deployment}`
49    pub name: std::string::String,
50
51    /// Output only. Time when the deployment was created.
52    pub create_time: std::option::Option<wkt::Timestamp>,
53
54    /// Output only. Time when the deployment was last modified.
55    pub update_time: std::option::Option<wkt::Timestamp>,
56
57    /// Optional. User-defined metadata for the deployment.
58    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
59
60    /// Output only. Current state of the deployment.
61    pub state: crate::model::deployment::State,
62
63    /// Output only. Revision name that was most recently applied.
64    /// Format: `projects/{project}/locations/{location}/deployments/{deployment}/
65    /// revisions/{revision}`
66    pub latest_revision: std::string::String,
67
68    /// Output only. Additional information regarding the current state.
69    pub state_detail: std::string::String,
70
71    /// Output only. Error code describing errors that may have occurred.
72    pub error_code: crate::model::deployment::ErrorCode,
73
74    /// Output only. Location of artifacts from a DeleteDeployment operation.
75    pub delete_results: std::option::Option<crate::model::ApplyResults>,
76
77    /// Output only. Cloud Build instance UUID associated with deleting this
78    /// deployment.
79    pub delete_build: std::string::String,
80
81    /// Output only. Location of Cloud Build logs in Google Cloud Storage,
82    /// populated when deleting this deployment. Format: `gs://{bucket}/{object}`.
83    pub delete_logs: std::string::String,
84
85    /// Output only. Errors encountered when deleting this deployment.
86    /// Errors are truncated to 10 entries, see `delete_results` and `error_logs`
87    /// for full details.
88    pub tf_errors: std::vec::Vec<crate::model::TerraformError>,
89
90    /// Output only. Location of Terraform error logs in Google Cloud Storage.
91    /// Format: `gs://{bucket}/{object}`.
92    pub error_logs: std::string::String,
93
94    /// Optional. User-defined location of Cloud Build logs and artifacts in Google
95    /// Cloud Storage. Format: `gs://{bucket}/{folder}`
96    ///
97    /// A default bucket will be bootstrapped if the field is not set or empty.
98    /// Default bucket format: `gs://<project number>-<region>-blueprint-config`
99    /// Constraints:
100    ///
101    /// - The bucket needs to be in the same project as the deployment
102    /// - The path cannot be within the path of `gcs_source`
103    /// - The field cannot be updated, including changing its presence
104    pub artifacts_gcs_bucket: std::option::Option<std::string::String>,
105
106    /// Required. User-specified Service Account (SA) credentials to be used when
107    /// actuating resources.
108    /// Format: `projects/{projectID}/serviceAccounts/{serviceAccount}`
109    pub service_account: std::option::Option<std::string::String>,
110
111    /// By default, Infra Manager will return a failure when
112    /// Terraform encounters a 409 code (resource conflict error) during actuation.
113    /// If this flag is set to true, Infra Manager will instead
114    /// attempt to automatically import the resource into the Terraform state (for
115    /// supported resource types) and continue actuation.
116    ///
117    /// Not all resource types are supported, refer to documentation.
118    pub import_existing_resources: std::option::Option<bool>,
119
120    /// Optional. The user-specified Cloud Build worker pool resource in which the
121    /// Cloud Build job will execute. Format:
122    /// `projects/{project}/locations/{location}/workerPools/{workerPoolId}`.
123    /// If this field is unspecified, the default Cloud Build worker pool will be
124    /// used.
125    pub worker_pool: std::option::Option<std::string::String>,
126
127    /// Output only. Current lock state of the deployment.
128    pub lock_state: crate::model::deployment::LockState,
129
130    /// Optional. The user-specified Terraform version constraint.
131    /// Example: "=1.3.10".
132    pub tf_version_constraint: std::option::Option<std::string::String>,
133
134    /// Output only. The current Terraform version set on the deployment.
135    /// It is in the format of "Major.Minor.Patch", for example, "1.3.10".
136    pub tf_version: std::string::String,
137
138    /// Optional. Input to control quota checks for resources in terraform
139    /// configuration files. There are limited resources on which quota validation
140    /// applies.
141    pub quota_validation: crate::model::QuotaValidation,
142
143    /// Optional. Arbitrary key-value metadata storage e.g. to help client tools
144    /// identify deployments during automation. See
145    /// <https://google.aip.dev/148#annotations> for details on format and size
146    /// limitations.
147    pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
148
149    /// Optional. This field specifies the provider configurations.
150    pub provider_config: std::option::Option<crate::model::ProviderConfig>,
151
152    /// Blueprint to deploy.
153    pub blueprint: std::option::Option<crate::model::deployment::Blueprint>,
154
155    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
156}
157
158impl Deployment {
159    /// Creates a new default instance.
160    pub fn new() -> Self {
161        std::default::Default::default()
162    }
163
164    /// Sets the value of [name][crate::model::Deployment::name].
165    ///
166    /// # Example
167    /// ```ignore,no_run
168    /// # use google_cloud_config_v1::model::Deployment;
169    /// # let project_id = "project_id";
170    /// # let location_id = "location_id";
171    /// # let deployment_id = "deployment_id";
172    /// let x = Deployment::new().set_name(format!("projects/{project_id}/locations/{location_id}/deployments/{deployment_id}"));
173    /// ```
174    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
175        self.name = v.into();
176        self
177    }
178
179    /// Sets the value of [create_time][crate::model::Deployment::create_time].
180    ///
181    /// # Example
182    /// ```ignore,no_run
183    /// # use google_cloud_config_v1::model::Deployment;
184    /// use wkt::Timestamp;
185    /// let x = Deployment::new().set_create_time(Timestamp::default()/* use setters */);
186    /// ```
187    pub fn set_create_time<T>(mut self, v: T) -> Self
188    where
189        T: std::convert::Into<wkt::Timestamp>,
190    {
191        self.create_time = std::option::Option::Some(v.into());
192        self
193    }
194
195    /// Sets or clears the value of [create_time][crate::model::Deployment::create_time].
196    ///
197    /// # Example
198    /// ```ignore,no_run
199    /// # use google_cloud_config_v1::model::Deployment;
200    /// use wkt::Timestamp;
201    /// let x = Deployment::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
202    /// let x = Deployment::new().set_or_clear_create_time(None::<Timestamp>);
203    /// ```
204    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
205    where
206        T: std::convert::Into<wkt::Timestamp>,
207    {
208        self.create_time = v.map(|x| x.into());
209        self
210    }
211
212    /// Sets the value of [update_time][crate::model::Deployment::update_time].
213    ///
214    /// # Example
215    /// ```ignore,no_run
216    /// # use google_cloud_config_v1::model::Deployment;
217    /// use wkt::Timestamp;
218    /// let x = Deployment::new().set_update_time(Timestamp::default()/* use setters */);
219    /// ```
220    pub fn set_update_time<T>(mut self, v: T) -> Self
221    where
222        T: std::convert::Into<wkt::Timestamp>,
223    {
224        self.update_time = std::option::Option::Some(v.into());
225        self
226    }
227
228    /// Sets or clears the value of [update_time][crate::model::Deployment::update_time].
229    ///
230    /// # Example
231    /// ```ignore,no_run
232    /// # use google_cloud_config_v1::model::Deployment;
233    /// use wkt::Timestamp;
234    /// let x = Deployment::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
235    /// let x = Deployment::new().set_or_clear_update_time(None::<Timestamp>);
236    /// ```
237    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
238    where
239        T: std::convert::Into<wkt::Timestamp>,
240    {
241        self.update_time = v.map(|x| x.into());
242        self
243    }
244
245    /// Sets the value of [labels][crate::model::Deployment::labels].
246    ///
247    /// # Example
248    /// ```ignore,no_run
249    /// # use google_cloud_config_v1::model::Deployment;
250    /// let x = Deployment::new().set_labels([
251    ///     ("key0", "abc"),
252    ///     ("key1", "xyz"),
253    /// ]);
254    /// ```
255    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
256    where
257        T: std::iter::IntoIterator<Item = (K, V)>,
258        K: std::convert::Into<std::string::String>,
259        V: std::convert::Into<std::string::String>,
260    {
261        use std::iter::Iterator;
262        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
263        self
264    }
265
266    /// Sets the value of [state][crate::model::Deployment::state].
267    ///
268    /// # Example
269    /// ```ignore,no_run
270    /// # use google_cloud_config_v1::model::Deployment;
271    /// use google_cloud_config_v1::model::deployment::State;
272    /// let x0 = Deployment::new().set_state(State::Creating);
273    /// let x1 = Deployment::new().set_state(State::Active);
274    /// let x2 = Deployment::new().set_state(State::Updating);
275    /// ```
276    pub fn set_state<T: std::convert::Into<crate::model::deployment::State>>(
277        mut self,
278        v: T,
279    ) -> Self {
280        self.state = v.into();
281        self
282    }
283
284    /// Sets the value of [latest_revision][crate::model::Deployment::latest_revision].
285    ///
286    /// # Example
287    /// ```ignore,no_run
288    /// # use google_cloud_config_v1::model::Deployment;
289    /// let x = Deployment::new().set_latest_revision("example");
290    /// ```
291    pub fn set_latest_revision<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
292        self.latest_revision = v.into();
293        self
294    }
295
296    /// Sets the value of [state_detail][crate::model::Deployment::state_detail].
297    ///
298    /// # Example
299    /// ```ignore,no_run
300    /// # use google_cloud_config_v1::model::Deployment;
301    /// let x = Deployment::new().set_state_detail("example");
302    /// ```
303    pub fn set_state_detail<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
304        self.state_detail = v.into();
305        self
306    }
307
308    /// Sets the value of [error_code][crate::model::Deployment::error_code].
309    ///
310    /// # Example
311    /// ```ignore,no_run
312    /// # use google_cloud_config_v1::model::Deployment;
313    /// use google_cloud_config_v1::model::deployment::ErrorCode;
314    /// let x0 = Deployment::new().set_error_code(ErrorCode::RevisionFailed);
315    /// let x1 = Deployment::new().set_error_code(ErrorCode::CloudBuildPermissionDenied);
316    /// let x2 = Deployment::new().set_error_code(ErrorCode::DeleteBuildApiFailed);
317    /// ```
318    pub fn set_error_code<T: std::convert::Into<crate::model::deployment::ErrorCode>>(
319        mut self,
320        v: T,
321    ) -> Self {
322        self.error_code = v.into();
323        self
324    }
325
326    /// Sets the value of [delete_results][crate::model::Deployment::delete_results].
327    ///
328    /// # Example
329    /// ```ignore,no_run
330    /// # use google_cloud_config_v1::model::Deployment;
331    /// use google_cloud_config_v1::model::ApplyResults;
332    /// let x = Deployment::new().set_delete_results(ApplyResults::default()/* use setters */);
333    /// ```
334    pub fn set_delete_results<T>(mut self, v: T) -> Self
335    where
336        T: std::convert::Into<crate::model::ApplyResults>,
337    {
338        self.delete_results = std::option::Option::Some(v.into());
339        self
340    }
341
342    /// Sets or clears the value of [delete_results][crate::model::Deployment::delete_results].
343    ///
344    /// # Example
345    /// ```ignore,no_run
346    /// # use google_cloud_config_v1::model::Deployment;
347    /// use google_cloud_config_v1::model::ApplyResults;
348    /// let x = Deployment::new().set_or_clear_delete_results(Some(ApplyResults::default()/* use setters */));
349    /// let x = Deployment::new().set_or_clear_delete_results(None::<ApplyResults>);
350    /// ```
351    pub fn set_or_clear_delete_results<T>(mut self, v: std::option::Option<T>) -> Self
352    where
353        T: std::convert::Into<crate::model::ApplyResults>,
354    {
355        self.delete_results = v.map(|x| x.into());
356        self
357    }
358
359    /// Sets the value of [delete_build][crate::model::Deployment::delete_build].
360    ///
361    /// # Example
362    /// ```ignore,no_run
363    /// # use google_cloud_config_v1::model::Deployment;
364    /// let x = Deployment::new().set_delete_build("example");
365    /// ```
366    pub fn set_delete_build<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
367        self.delete_build = v.into();
368        self
369    }
370
371    /// Sets the value of [delete_logs][crate::model::Deployment::delete_logs].
372    ///
373    /// # Example
374    /// ```ignore,no_run
375    /// # use google_cloud_config_v1::model::Deployment;
376    /// let x = Deployment::new().set_delete_logs("example");
377    /// ```
378    pub fn set_delete_logs<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
379        self.delete_logs = v.into();
380        self
381    }
382
383    /// Sets the value of [tf_errors][crate::model::Deployment::tf_errors].
384    ///
385    /// # Example
386    /// ```ignore,no_run
387    /// # use google_cloud_config_v1::model::Deployment;
388    /// use google_cloud_config_v1::model::TerraformError;
389    /// let x = Deployment::new()
390    ///     .set_tf_errors([
391    ///         TerraformError::default()/* use setters */,
392    ///         TerraformError::default()/* use (different) setters */,
393    ///     ]);
394    /// ```
395    pub fn set_tf_errors<T, V>(mut self, v: T) -> Self
396    where
397        T: std::iter::IntoIterator<Item = V>,
398        V: std::convert::Into<crate::model::TerraformError>,
399    {
400        use std::iter::Iterator;
401        self.tf_errors = v.into_iter().map(|i| i.into()).collect();
402        self
403    }
404
405    /// Sets the value of [error_logs][crate::model::Deployment::error_logs].
406    ///
407    /// # Example
408    /// ```ignore,no_run
409    /// # use google_cloud_config_v1::model::Deployment;
410    /// let x = Deployment::new().set_error_logs("example");
411    /// ```
412    pub fn set_error_logs<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
413        self.error_logs = v.into();
414        self
415    }
416
417    /// Sets the value of [artifacts_gcs_bucket][crate::model::Deployment::artifacts_gcs_bucket].
418    ///
419    /// # Example
420    /// ```ignore,no_run
421    /// # use google_cloud_config_v1::model::Deployment;
422    /// let x = Deployment::new().set_artifacts_gcs_bucket("example");
423    /// ```
424    pub fn set_artifacts_gcs_bucket<T>(mut self, v: T) -> Self
425    where
426        T: std::convert::Into<std::string::String>,
427    {
428        self.artifacts_gcs_bucket = std::option::Option::Some(v.into());
429        self
430    }
431
432    /// Sets or clears the value of [artifacts_gcs_bucket][crate::model::Deployment::artifacts_gcs_bucket].
433    ///
434    /// # Example
435    /// ```ignore,no_run
436    /// # use google_cloud_config_v1::model::Deployment;
437    /// let x = Deployment::new().set_or_clear_artifacts_gcs_bucket(Some("example"));
438    /// let x = Deployment::new().set_or_clear_artifacts_gcs_bucket(None::<String>);
439    /// ```
440    pub fn set_or_clear_artifacts_gcs_bucket<T>(mut self, v: std::option::Option<T>) -> Self
441    where
442        T: std::convert::Into<std::string::String>,
443    {
444        self.artifacts_gcs_bucket = v.map(|x| x.into());
445        self
446    }
447
448    /// Sets the value of [service_account][crate::model::Deployment::service_account].
449    ///
450    /// # Example
451    /// ```ignore,no_run
452    /// # use google_cloud_config_v1::model::Deployment;
453    /// let x = Deployment::new().set_service_account("example");
454    /// ```
455    pub fn set_service_account<T>(mut self, v: T) -> Self
456    where
457        T: std::convert::Into<std::string::String>,
458    {
459        self.service_account = std::option::Option::Some(v.into());
460        self
461    }
462
463    /// Sets or clears the value of [service_account][crate::model::Deployment::service_account].
464    ///
465    /// # Example
466    /// ```ignore,no_run
467    /// # use google_cloud_config_v1::model::Deployment;
468    /// let x = Deployment::new().set_or_clear_service_account(Some("example"));
469    /// let x = Deployment::new().set_or_clear_service_account(None::<String>);
470    /// ```
471    pub fn set_or_clear_service_account<T>(mut self, v: std::option::Option<T>) -> Self
472    where
473        T: std::convert::Into<std::string::String>,
474    {
475        self.service_account = v.map(|x| x.into());
476        self
477    }
478
479    /// Sets the value of [import_existing_resources][crate::model::Deployment::import_existing_resources].
480    ///
481    /// # Example
482    /// ```ignore,no_run
483    /// # use google_cloud_config_v1::model::Deployment;
484    /// let x = Deployment::new().set_import_existing_resources(true);
485    /// ```
486    pub fn set_import_existing_resources<T>(mut self, v: T) -> Self
487    where
488        T: std::convert::Into<bool>,
489    {
490        self.import_existing_resources = std::option::Option::Some(v.into());
491        self
492    }
493
494    /// Sets or clears the value of [import_existing_resources][crate::model::Deployment::import_existing_resources].
495    ///
496    /// # Example
497    /// ```ignore,no_run
498    /// # use google_cloud_config_v1::model::Deployment;
499    /// let x = Deployment::new().set_or_clear_import_existing_resources(Some(false));
500    /// let x = Deployment::new().set_or_clear_import_existing_resources(None::<bool>);
501    /// ```
502    pub fn set_or_clear_import_existing_resources<T>(mut self, v: std::option::Option<T>) -> Self
503    where
504        T: std::convert::Into<bool>,
505    {
506        self.import_existing_resources = v.map(|x| x.into());
507        self
508    }
509
510    /// Sets the value of [worker_pool][crate::model::Deployment::worker_pool].
511    ///
512    /// # Example
513    /// ```ignore,no_run
514    /// # use google_cloud_config_v1::model::Deployment;
515    /// let x = Deployment::new().set_worker_pool("example");
516    /// ```
517    pub fn set_worker_pool<T>(mut self, v: T) -> Self
518    where
519        T: std::convert::Into<std::string::String>,
520    {
521        self.worker_pool = std::option::Option::Some(v.into());
522        self
523    }
524
525    /// Sets or clears the value of [worker_pool][crate::model::Deployment::worker_pool].
526    ///
527    /// # Example
528    /// ```ignore,no_run
529    /// # use google_cloud_config_v1::model::Deployment;
530    /// let x = Deployment::new().set_or_clear_worker_pool(Some("example"));
531    /// let x = Deployment::new().set_or_clear_worker_pool(None::<String>);
532    /// ```
533    pub fn set_or_clear_worker_pool<T>(mut self, v: std::option::Option<T>) -> Self
534    where
535        T: std::convert::Into<std::string::String>,
536    {
537        self.worker_pool = v.map(|x| x.into());
538        self
539    }
540
541    /// Sets the value of [lock_state][crate::model::Deployment::lock_state].
542    ///
543    /// # Example
544    /// ```ignore,no_run
545    /// # use google_cloud_config_v1::model::Deployment;
546    /// use google_cloud_config_v1::model::deployment::LockState;
547    /// let x0 = Deployment::new().set_lock_state(LockState::Locked);
548    /// let x1 = Deployment::new().set_lock_state(LockState::Unlocked);
549    /// let x2 = Deployment::new().set_lock_state(LockState::Locking);
550    /// ```
551    pub fn set_lock_state<T: std::convert::Into<crate::model::deployment::LockState>>(
552        mut self,
553        v: T,
554    ) -> Self {
555        self.lock_state = v.into();
556        self
557    }
558
559    /// Sets the value of [tf_version_constraint][crate::model::Deployment::tf_version_constraint].
560    ///
561    /// # Example
562    /// ```ignore,no_run
563    /// # use google_cloud_config_v1::model::Deployment;
564    /// let x = Deployment::new().set_tf_version_constraint("example");
565    /// ```
566    pub fn set_tf_version_constraint<T>(mut self, v: T) -> Self
567    where
568        T: std::convert::Into<std::string::String>,
569    {
570        self.tf_version_constraint = std::option::Option::Some(v.into());
571        self
572    }
573
574    /// Sets or clears the value of [tf_version_constraint][crate::model::Deployment::tf_version_constraint].
575    ///
576    /// # Example
577    /// ```ignore,no_run
578    /// # use google_cloud_config_v1::model::Deployment;
579    /// let x = Deployment::new().set_or_clear_tf_version_constraint(Some("example"));
580    /// let x = Deployment::new().set_or_clear_tf_version_constraint(None::<String>);
581    /// ```
582    pub fn set_or_clear_tf_version_constraint<T>(mut self, v: std::option::Option<T>) -> Self
583    where
584        T: std::convert::Into<std::string::String>,
585    {
586        self.tf_version_constraint = v.map(|x| x.into());
587        self
588    }
589
590    /// Sets the value of [tf_version][crate::model::Deployment::tf_version].
591    ///
592    /// # Example
593    /// ```ignore,no_run
594    /// # use google_cloud_config_v1::model::Deployment;
595    /// let x = Deployment::new().set_tf_version("example");
596    /// ```
597    pub fn set_tf_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
598        self.tf_version = v.into();
599        self
600    }
601
602    /// Sets the value of [quota_validation][crate::model::Deployment::quota_validation].
603    ///
604    /// # Example
605    /// ```ignore,no_run
606    /// # use google_cloud_config_v1::model::Deployment;
607    /// use google_cloud_config_v1::model::QuotaValidation;
608    /// let x0 = Deployment::new().set_quota_validation(QuotaValidation::Enabled);
609    /// let x1 = Deployment::new().set_quota_validation(QuotaValidation::Enforced);
610    /// ```
611    pub fn set_quota_validation<T: std::convert::Into<crate::model::QuotaValidation>>(
612        mut self,
613        v: T,
614    ) -> Self {
615        self.quota_validation = v.into();
616        self
617    }
618
619    /// Sets the value of [annotations][crate::model::Deployment::annotations].
620    ///
621    /// # Example
622    /// ```ignore,no_run
623    /// # use google_cloud_config_v1::model::Deployment;
624    /// let x = Deployment::new().set_annotations([
625    ///     ("key0", "abc"),
626    ///     ("key1", "xyz"),
627    /// ]);
628    /// ```
629    pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
630    where
631        T: std::iter::IntoIterator<Item = (K, V)>,
632        K: std::convert::Into<std::string::String>,
633        V: std::convert::Into<std::string::String>,
634    {
635        use std::iter::Iterator;
636        self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
637        self
638    }
639
640    /// Sets the value of [provider_config][crate::model::Deployment::provider_config].
641    ///
642    /// # Example
643    /// ```ignore,no_run
644    /// # use google_cloud_config_v1::model::Deployment;
645    /// use google_cloud_config_v1::model::ProviderConfig;
646    /// let x = Deployment::new().set_provider_config(ProviderConfig::default()/* use setters */);
647    /// ```
648    pub fn set_provider_config<T>(mut self, v: T) -> Self
649    where
650        T: std::convert::Into<crate::model::ProviderConfig>,
651    {
652        self.provider_config = std::option::Option::Some(v.into());
653        self
654    }
655
656    /// Sets or clears the value of [provider_config][crate::model::Deployment::provider_config].
657    ///
658    /// # Example
659    /// ```ignore,no_run
660    /// # use google_cloud_config_v1::model::Deployment;
661    /// use google_cloud_config_v1::model::ProviderConfig;
662    /// let x = Deployment::new().set_or_clear_provider_config(Some(ProviderConfig::default()/* use setters */));
663    /// let x = Deployment::new().set_or_clear_provider_config(None::<ProviderConfig>);
664    /// ```
665    pub fn set_or_clear_provider_config<T>(mut self, v: std::option::Option<T>) -> Self
666    where
667        T: std::convert::Into<crate::model::ProviderConfig>,
668    {
669        self.provider_config = v.map(|x| x.into());
670        self
671    }
672
673    /// Sets the value of [blueprint][crate::model::Deployment::blueprint].
674    ///
675    /// Note that all the setters affecting `blueprint` are mutually
676    /// exclusive.
677    ///
678    /// # Example
679    /// ```ignore,no_run
680    /// # use google_cloud_config_v1::model::Deployment;
681    /// use google_cloud_config_v1::model::TerraformBlueprint;
682    /// let x = Deployment::new().set_blueprint(Some(
683    ///     google_cloud_config_v1::model::deployment::Blueprint::TerraformBlueprint(TerraformBlueprint::default().into())));
684    /// ```
685    pub fn set_blueprint<
686        T: std::convert::Into<std::option::Option<crate::model::deployment::Blueprint>>,
687    >(
688        mut self,
689        v: T,
690    ) -> Self {
691        self.blueprint = v.into();
692        self
693    }
694
695    /// The value of [blueprint][crate::model::Deployment::blueprint]
696    /// if it holds a `TerraformBlueprint`, `None` if the field is not set or
697    /// holds a different branch.
698    pub fn terraform_blueprint(
699        &self,
700    ) -> std::option::Option<&std::boxed::Box<crate::model::TerraformBlueprint>> {
701        #[allow(unreachable_patterns)]
702        self.blueprint.as_ref().and_then(|v| match v {
703            crate::model::deployment::Blueprint::TerraformBlueprint(v) => {
704                std::option::Option::Some(v)
705            }
706            _ => std::option::Option::None,
707        })
708    }
709
710    /// Sets the value of [blueprint][crate::model::Deployment::blueprint]
711    /// to hold a `TerraformBlueprint`.
712    ///
713    /// Note that all the setters affecting `blueprint` are
714    /// mutually exclusive.
715    ///
716    /// # Example
717    /// ```ignore,no_run
718    /// # use google_cloud_config_v1::model::Deployment;
719    /// use google_cloud_config_v1::model::TerraformBlueprint;
720    /// let x = Deployment::new().set_terraform_blueprint(TerraformBlueprint::default()/* use setters */);
721    /// assert!(x.terraform_blueprint().is_some());
722    /// ```
723    pub fn set_terraform_blueprint<
724        T: std::convert::Into<std::boxed::Box<crate::model::TerraformBlueprint>>,
725    >(
726        mut self,
727        v: T,
728    ) -> Self {
729        self.blueprint = std::option::Option::Some(
730            crate::model::deployment::Blueprint::TerraformBlueprint(v.into()),
731        );
732        self
733    }
734}
735
736impl wkt::message::Message for Deployment {
737    fn typename() -> &'static str {
738        "type.googleapis.com/google.cloud.config.v1.Deployment"
739    }
740}
741
742/// Defines additional types related to [Deployment].
743pub mod deployment {
744    #[allow(unused_imports)]
745    use super::*;
746
747    /// Possible states of a deployment.
748    ///
749    /// # Working with unknown values
750    ///
751    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
752    /// additional enum variants at any time. Adding new variants is not considered
753    /// a breaking change. Applications should write their code in anticipation of:
754    ///
755    /// - New values appearing in future releases of the client library, **and**
756    /// - New values received dynamically, without application changes.
757    ///
758    /// Please consult the [Working with enums] section in the user guide for some
759    /// guidelines.
760    ///
761    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
762    #[derive(Clone, Debug, PartialEq)]
763    #[non_exhaustive]
764    pub enum State {
765        /// The default value. This value is used if the state is omitted.
766        Unspecified,
767        /// The deployment is being created.
768        Creating,
769        /// The deployment is healthy.
770        Active,
771        /// The deployment is being updated.
772        Updating,
773        /// The deployment is being deleted.
774        Deleting,
775        /// The deployment has encountered an unexpected error.
776        Failed,
777        /// The deployment is no longer being actively reconciled.
778        /// This may be the result of recovering the project after deletion.
779        Suspended,
780        /// The deployment has been deleted.
781        Deleted,
782        /// If set, the enum was initialized with an unknown value.
783        ///
784        /// Applications can examine the value using [State::value] or
785        /// [State::name].
786        UnknownValue(state::UnknownValue),
787    }
788
789    #[doc(hidden)]
790    pub mod state {
791        #[allow(unused_imports)]
792        use super::*;
793        #[derive(Clone, Debug, PartialEq)]
794        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
795    }
796
797    impl State {
798        /// Gets the enum value.
799        ///
800        /// Returns `None` if the enum contains an unknown value deserialized from
801        /// the string representation of enums.
802        pub fn value(&self) -> std::option::Option<i32> {
803            match self {
804                Self::Unspecified => std::option::Option::Some(0),
805                Self::Creating => std::option::Option::Some(1),
806                Self::Active => std::option::Option::Some(2),
807                Self::Updating => std::option::Option::Some(3),
808                Self::Deleting => std::option::Option::Some(4),
809                Self::Failed => std::option::Option::Some(5),
810                Self::Suspended => std::option::Option::Some(6),
811                Self::Deleted => std::option::Option::Some(7),
812                Self::UnknownValue(u) => u.0.value(),
813            }
814        }
815
816        /// Gets the enum value as a string.
817        ///
818        /// Returns `None` if the enum contains an unknown value deserialized from
819        /// the integer representation of enums.
820        pub fn name(&self) -> std::option::Option<&str> {
821            match self {
822                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
823                Self::Creating => std::option::Option::Some("CREATING"),
824                Self::Active => std::option::Option::Some("ACTIVE"),
825                Self::Updating => std::option::Option::Some("UPDATING"),
826                Self::Deleting => std::option::Option::Some("DELETING"),
827                Self::Failed => std::option::Option::Some("FAILED"),
828                Self::Suspended => std::option::Option::Some("SUSPENDED"),
829                Self::Deleted => std::option::Option::Some("DELETED"),
830                Self::UnknownValue(u) => u.0.name(),
831            }
832        }
833    }
834
835    impl std::default::Default for State {
836        fn default() -> Self {
837            use std::convert::From;
838            Self::from(0)
839        }
840    }
841
842    impl std::fmt::Display for State {
843        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
844            wkt::internal::display_enum(f, self.name(), self.value())
845        }
846    }
847
848    impl std::convert::From<i32> for State {
849        fn from(value: i32) -> Self {
850            match value {
851                0 => Self::Unspecified,
852                1 => Self::Creating,
853                2 => Self::Active,
854                3 => Self::Updating,
855                4 => Self::Deleting,
856                5 => Self::Failed,
857                6 => Self::Suspended,
858                7 => Self::Deleted,
859                _ => Self::UnknownValue(state::UnknownValue(
860                    wkt::internal::UnknownEnumValue::Integer(value),
861                )),
862            }
863        }
864    }
865
866    impl std::convert::From<&str> for State {
867        fn from(value: &str) -> Self {
868            use std::string::ToString;
869            match value {
870                "STATE_UNSPECIFIED" => Self::Unspecified,
871                "CREATING" => Self::Creating,
872                "ACTIVE" => Self::Active,
873                "UPDATING" => Self::Updating,
874                "DELETING" => Self::Deleting,
875                "FAILED" => Self::Failed,
876                "SUSPENDED" => Self::Suspended,
877                "DELETED" => Self::Deleted,
878                _ => Self::UnknownValue(state::UnknownValue(
879                    wkt::internal::UnknownEnumValue::String(value.to_string()),
880                )),
881            }
882        }
883    }
884
885    impl serde::ser::Serialize for State {
886        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
887        where
888            S: serde::Serializer,
889        {
890            match self {
891                Self::Unspecified => serializer.serialize_i32(0),
892                Self::Creating => serializer.serialize_i32(1),
893                Self::Active => serializer.serialize_i32(2),
894                Self::Updating => serializer.serialize_i32(3),
895                Self::Deleting => serializer.serialize_i32(4),
896                Self::Failed => serializer.serialize_i32(5),
897                Self::Suspended => serializer.serialize_i32(6),
898                Self::Deleted => serializer.serialize_i32(7),
899                Self::UnknownValue(u) => u.0.serialize(serializer),
900            }
901        }
902    }
903
904    impl<'de> serde::de::Deserialize<'de> for State {
905        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
906        where
907            D: serde::Deserializer<'de>,
908        {
909            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
910                ".google.cloud.config.v1.Deployment.State",
911            ))
912        }
913    }
914
915    /// Possible errors that can occur with deployments.
916    ///
917    /// # Working with unknown values
918    ///
919    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
920    /// additional enum variants at any time. Adding new variants is not considered
921    /// a breaking change. Applications should write their code in anticipation of:
922    ///
923    /// - New values appearing in future releases of the client library, **and**
924    /// - New values received dynamically, without application changes.
925    ///
926    /// Please consult the [Working with enums] section in the user guide for some
927    /// guidelines.
928    ///
929    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
930    #[derive(Clone, Debug, PartialEq)]
931    #[non_exhaustive]
932    pub enum ErrorCode {
933        /// No error code was specified.
934        Unspecified,
935        /// The revision failed. See Revision for more details.
936        RevisionFailed,
937        /// Cloud Build failed due to a permission issue.
938        CloudBuildPermissionDenied,
939        /// Cloud Build job associated with a deployment deletion could not be
940        /// started.
941        DeleteBuildApiFailed,
942        /// Cloud Build job associated with a deployment deletion was started but
943        /// failed.
944        DeleteBuildRunFailed,
945        /// Cloud Storage bucket creation failed due to a permission issue.
946        BucketCreationPermissionDenied,
947        /// Cloud Storage bucket creation failed due to an issue unrelated to
948        /// permissions.
949        BucketCreationFailed,
950        /// Failed to import values from an external source.
951        ExternalValueSourceImportFailed,
952        /// If set, the enum was initialized with an unknown value.
953        ///
954        /// Applications can examine the value using [ErrorCode::value] or
955        /// [ErrorCode::name].
956        UnknownValue(error_code::UnknownValue),
957    }
958
959    #[doc(hidden)]
960    pub mod error_code {
961        #[allow(unused_imports)]
962        use super::*;
963        #[derive(Clone, Debug, PartialEq)]
964        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
965    }
966
967    impl ErrorCode {
968        /// Gets the enum value.
969        ///
970        /// Returns `None` if the enum contains an unknown value deserialized from
971        /// the string representation of enums.
972        pub fn value(&self) -> std::option::Option<i32> {
973            match self {
974                Self::Unspecified => std::option::Option::Some(0),
975                Self::RevisionFailed => std::option::Option::Some(1),
976                Self::CloudBuildPermissionDenied => std::option::Option::Some(3),
977                Self::DeleteBuildApiFailed => std::option::Option::Some(5),
978                Self::DeleteBuildRunFailed => std::option::Option::Some(6),
979                Self::BucketCreationPermissionDenied => std::option::Option::Some(7),
980                Self::BucketCreationFailed => std::option::Option::Some(8),
981                Self::ExternalValueSourceImportFailed => std::option::Option::Some(10),
982                Self::UnknownValue(u) => u.0.value(),
983            }
984        }
985
986        /// Gets the enum value as a string.
987        ///
988        /// Returns `None` if the enum contains an unknown value deserialized from
989        /// the integer representation of enums.
990        pub fn name(&self) -> std::option::Option<&str> {
991            match self {
992                Self::Unspecified => std::option::Option::Some("ERROR_CODE_UNSPECIFIED"),
993                Self::RevisionFailed => std::option::Option::Some("REVISION_FAILED"),
994                Self::CloudBuildPermissionDenied => {
995                    std::option::Option::Some("CLOUD_BUILD_PERMISSION_DENIED")
996                }
997                Self::DeleteBuildApiFailed => std::option::Option::Some("DELETE_BUILD_API_FAILED"),
998                Self::DeleteBuildRunFailed => std::option::Option::Some("DELETE_BUILD_RUN_FAILED"),
999                Self::BucketCreationPermissionDenied => {
1000                    std::option::Option::Some("BUCKET_CREATION_PERMISSION_DENIED")
1001                }
1002                Self::BucketCreationFailed => std::option::Option::Some("BUCKET_CREATION_FAILED"),
1003                Self::ExternalValueSourceImportFailed => {
1004                    std::option::Option::Some("EXTERNAL_VALUE_SOURCE_IMPORT_FAILED")
1005                }
1006                Self::UnknownValue(u) => u.0.name(),
1007            }
1008        }
1009    }
1010
1011    impl std::default::Default for ErrorCode {
1012        fn default() -> Self {
1013            use std::convert::From;
1014            Self::from(0)
1015        }
1016    }
1017
1018    impl std::fmt::Display for ErrorCode {
1019        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1020            wkt::internal::display_enum(f, self.name(), self.value())
1021        }
1022    }
1023
1024    impl std::convert::From<i32> for ErrorCode {
1025        fn from(value: i32) -> Self {
1026            match value {
1027                0 => Self::Unspecified,
1028                1 => Self::RevisionFailed,
1029                3 => Self::CloudBuildPermissionDenied,
1030                5 => Self::DeleteBuildApiFailed,
1031                6 => Self::DeleteBuildRunFailed,
1032                7 => Self::BucketCreationPermissionDenied,
1033                8 => Self::BucketCreationFailed,
1034                10 => Self::ExternalValueSourceImportFailed,
1035                _ => Self::UnknownValue(error_code::UnknownValue(
1036                    wkt::internal::UnknownEnumValue::Integer(value),
1037                )),
1038            }
1039        }
1040    }
1041
1042    impl std::convert::From<&str> for ErrorCode {
1043        fn from(value: &str) -> Self {
1044            use std::string::ToString;
1045            match value {
1046                "ERROR_CODE_UNSPECIFIED" => Self::Unspecified,
1047                "REVISION_FAILED" => Self::RevisionFailed,
1048                "CLOUD_BUILD_PERMISSION_DENIED" => Self::CloudBuildPermissionDenied,
1049                "DELETE_BUILD_API_FAILED" => Self::DeleteBuildApiFailed,
1050                "DELETE_BUILD_RUN_FAILED" => Self::DeleteBuildRunFailed,
1051                "BUCKET_CREATION_PERMISSION_DENIED" => Self::BucketCreationPermissionDenied,
1052                "BUCKET_CREATION_FAILED" => Self::BucketCreationFailed,
1053                "EXTERNAL_VALUE_SOURCE_IMPORT_FAILED" => Self::ExternalValueSourceImportFailed,
1054                _ => Self::UnknownValue(error_code::UnknownValue(
1055                    wkt::internal::UnknownEnumValue::String(value.to_string()),
1056                )),
1057            }
1058        }
1059    }
1060
1061    impl serde::ser::Serialize for ErrorCode {
1062        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1063        where
1064            S: serde::Serializer,
1065        {
1066            match self {
1067                Self::Unspecified => serializer.serialize_i32(0),
1068                Self::RevisionFailed => serializer.serialize_i32(1),
1069                Self::CloudBuildPermissionDenied => serializer.serialize_i32(3),
1070                Self::DeleteBuildApiFailed => serializer.serialize_i32(5),
1071                Self::DeleteBuildRunFailed => serializer.serialize_i32(6),
1072                Self::BucketCreationPermissionDenied => serializer.serialize_i32(7),
1073                Self::BucketCreationFailed => serializer.serialize_i32(8),
1074                Self::ExternalValueSourceImportFailed => serializer.serialize_i32(10),
1075                Self::UnknownValue(u) => u.0.serialize(serializer),
1076            }
1077        }
1078    }
1079
1080    impl<'de> serde::de::Deserialize<'de> for ErrorCode {
1081        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1082        where
1083            D: serde::Deserializer<'de>,
1084        {
1085            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ErrorCode>::new(
1086                ".google.cloud.config.v1.Deployment.ErrorCode",
1087            ))
1088        }
1089    }
1090
1091    /// Possible lock states of a deployment.
1092    ///
1093    /// # Working with unknown values
1094    ///
1095    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1096    /// additional enum variants at any time. Adding new variants is not considered
1097    /// a breaking change. Applications should write their code in anticipation of:
1098    ///
1099    /// - New values appearing in future releases of the client library, **and**
1100    /// - New values received dynamically, without application changes.
1101    ///
1102    /// Please consult the [Working with enums] section in the user guide for some
1103    /// guidelines.
1104    ///
1105    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
1106    #[derive(Clone, Debug, PartialEq)]
1107    #[non_exhaustive]
1108    pub enum LockState {
1109        /// The default value. This value is used if the lock state is omitted.
1110        Unspecified,
1111        /// The deployment is locked.
1112        Locked,
1113        /// The deployment is unlocked.
1114        Unlocked,
1115        /// The deployment is being locked.
1116        Locking,
1117        /// The deployment is being unlocked.
1118        Unlocking,
1119        /// The deployment has failed to lock.
1120        LockFailed,
1121        /// The deployment has failed to unlock.
1122        UnlockFailed,
1123        /// If set, the enum was initialized with an unknown value.
1124        ///
1125        /// Applications can examine the value using [LockState::value] or
1126        /// [LockState::name].
1127        UnknownValue(lock_state::UnknownValue),
1128    }
1129
1130    #[doc(hidden)]
1131    pub mod lock_state {
1132        #[allow(unused_imports)]
1133        use super::*;
1134        #[derive(Clone, Debug, PartialEq)]
1135        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1136    }
1137
1138    impl LockState {
1139        /// Gets the enum value.
1140        ///
1141        /// Returns `None` if the enum contains an unknown value deserialized from
1142        /// the string representation of enums.
1143        pub fn value(&self) -> std::option::Option<i32> {
1144            match self {
1145                Self::Unspecified => std::option::Option::Some(0),
1146                Self::Locked => std::option::Option::Some(1),
1147                Self::Unlocked => std::option::Option::Some(2),
1148                Self::Locking => std::option::Option::Some(3),
1149                Self::Unlocking => std::option::Option::Some(4),
1150                Self::LockFailed => std::option::Option::Some(5),
1151                Self::UnlockFailed => std::option::Option::Some(6),
1152                Self::UnknownValue(u) => u.0.value(),
1153            }
1154        }
1155
1156        /// Gets the enum value as a string.
1157        ///
1158        /// Returns `None` if the enum contains an unknown value deserialized from
1159        /// the integer representation of enums.
1160        pub fn name(&self) -> std::option::Option<&str> {
1161            match self {
1162                Self::Unspecified => std::option::Option::Some("LOCK_STATE_UNSPECIFIED"),
1163                Self::Locked => std::option::Option::Some("LOCKED"),
1164                Self::Unlocked => std::option::Option::Some("UNLOCKED"),
1165                Self::Locking => std::option::Option::Some("LOCKING"),
1166                Self::Unlocking => std::option::Option::Some("UNLOCKING"),
1167                Self::LockFailed => std::option::Option::Some("LOCK_FAILED"),
1168                Self::UnlockFailed => std::option::Option::Some("UNLOCK_FAILED"),
1169                Self::UnknownValue(u) => u.0.name(),
1170            }
1171        }
1172    }
1173
1174    impl std::default::Default for LockState {
1175        fn default() -> Self {
1176            use std::convert::From;
1177            Self::from(0)
1178        }
1179    }
1180
1181    impl std::fmt::Display for LockState {
1182        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1183            wkt::internal::display_enum(f, self.name(), self.value())
1184        }
1185    }
1186
1187    impl std::convert::From<i32> for LockState {
1188        fn from(value: i32) -> Self {
1189            match value {
1190                0 => Self::Unspecified,
1191                1 => Self::Locked,
1192                2 => Self::Unlocked,
1193                3 => Self::Locking,
1194                4 => Self::Unlocking,
1195                5 => Self::LockFailed,
1196                6 => Self::UnlockFailed,
1197                _ => Self::UnknownValue(lock_state::UnknownValue(
1198                    wkt::internal::UnknownEnumValue::Integer(value),
1199                )),
1200            }
1201        }
1202    }
1203
1204    impl std::convert::From<&str> for LockState {
1205        fn from(value: &str) -> Self {
1206            use std::string::ToString;
1207            match value {
1208                "LOCK_STATE_UNSPECIFIED" => Self::Unspecified,
1209                "LOCKED" => Self::Locked,
1210                "UNLOCKED" => Self::Unlocked,
1211                "LOCKING" => Self::Locking,
1212                "UNLOCKING" => Self::Unlocking,
1213                "LOCK_FAILED" => Self::LockFailed,
1214                "UNLOCK_FAILED" => Self::UnlockFailed,
1215                _ => Self::UnknownValue(lock_state::UnknownValue(
1216                    wkt::internal::UnknownEnumValue::String(value.to_string()),
1217                )),
1218            }
1219        }
1220    }
1221
1222    impl serde::ser::Serialize for LockState {
1223        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1224        where
1225            S: serde::Serializer,
1226        {
1227            match self {
1228                Self::Unspecified => serializer.serialize_i32(0),
1229                Self::Locked => serializer.serialize_i32(1),
1230                Self::Unlocked => serializer.serialize_i32(2),
1231                Self::Locking => serializer.serialize_i32(3),
1232                Self::Unlocking => serializer.serialize_i32(4),
1233                Self::LockFailed => serializer.serialize_i32(5),
1234                Self::UnlockFailed => serializer.serialize_i32(6),
1235                Self::UnknownValue(u) => u.0.serialize(serializer),
1236            }
1237        }
1238    }
1239
1240    impl<'de> serde::de::Deserialize<'de> for LockState {
1241        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1242        where
1243            D: serde::Deserializer<'de>,
1244        {
1245            deserializer.deserialize_any(wkt::internal::EnumVisitor::<LockState>::new(
1246                ".google.cloud.config.v1.Deployment.LockState",
1247            ))
1248        }
1249    }
1250
1251    /// Blueprint to deploy.
1252    #[derive(Clone, Debug, PartialEq)]
1253    #[non_exhaustive]
1254    pub enum Blueprint {
1255        /// A blueprint described using Terraform's HashiCorp Configuration Language
1256        /// as a root module.
1257        TerraformBlueprint(std::boxed::Box<crate::model::TerraformBlueprint>),
1258    }
1259}
1260
1261/// TerraformBlueprint describes the source of a Terraform root module which
1262/// describes the resources and configs to be deployed.
1263#[derive(Clone, Default, PartialEq)]
1264#[non_exhaustive]
1265pub struct TerraformBlueprint {
1266    /// Optional. Input variable values for the Terraform blueprint.
1267    pub input_values:
1268        std::collections::HashMap<std::string::String, crate::model::TerraformVariable>,
1269
1270    /// Optional. Map of input variable names in this blueprint to configurations
1271    /// for importing values from external sources.
1272    pub external_values:
1273        std::collections::HashMap<std::string::String, crate::model::ExternalValueSource>,
1274
1275    /// Location of the source configs.
1276    /// Required.
1277    pub source: std::option::Option<crate::model::terraform_blueprint::Source>,
1278
1279    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1280}
1281
1282impl TerraformBlueprint {
1283    /// Creates a new default instance.
1284    pub fn new() -> Self {
1285        std::default::Default::default()
1286    }
1287
1288    /// Sets the value of [input_values][crate::model::TerraformBlueprint::input_values].
1289    ///
1290    /// # Example
1291    /// ```ignore,no_run
1292    /// # use google_cloud_config_v1::model::TerraformBlueprint;
1293    /// use google_cloud_config_v1::model::TerraformVariable;
1294    /// let x = TerraformBlueprint::new().set_input_values([
1295    ///     ("key0", TerraformVariable::default()/* use setters */),
1296    ///     ("key1", TerraformVariable::default()/* use (different) setters */),
1297    /// ]);
1298    /// ```
1299    pub fn set_input_values<T, K, V>(mut self, v: T) -> Self
1300    where
1301        T: std::iter::IntoIterator<Item = (K, V)>,
1302        K: std::convert::Into<std::string::String>,
1303        V: std::convert::Into<crate::model::TerraformVariable>,
1304    {
1305        use std::iter::Iterator;
1306        self.input_values = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1307        self
1308    }
1309
1310    /// Sets the value of [external_values][crate::model::TerraformBlueprint::external_values].
1311    ///
1312    /// # Example
1313    /// ```ignore,no_run
1314    /// # use google_cloud_config_v1::model::TerraformBlueprint;
1315    /// use google_cloud_config_v1::model::ExternalValueSource;
1316    /// let x = TerraformBlueprint::new().set_external_values([
1317    ///     ("key0", ExternalValueSource::default()/* use setters */),
1318    ///     ("key1", ExternalValueSource::default()/* use (different) setters */),
1319    /// ]);
1320    /// ```
1321    pub fn set_external_values<T, K, V>(mut self, v: T) -> Self
1322    where
1323        T: std::iter::IntoIterator<Item = (K, V)>,
1324        K: std::convert::Into<std::string::String>,
1325        V: std::convert::Into<crate::model::ExternalValueSource>,
1326    {
1327        use std::iter::Iterator;
1328        self.external_values = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1329        self
1330    }
1331
1332    /// Sets the value of [source][crate::model::TerraformBlueprint::source].
1333    ///
1334    /// Note that all the setters affecting `source` are mutually
1335    /// exclusive.
1336    ///
1337    /// # Example
1338    /// ```ignore,no_run
1339    /// # use google_cloud_config_v1::model::TerraformBlueprint;
1340    /// use google_cloud_config_v1::model::terraform_blueprint::Source;
1341    /// let x = TerraformBlueprint::new().set_source(Some(Source::GcsSource("example".to_string())));
1342    /// ```
1343    pub fn set_source<
1344        T: std::convert::Into<std::option::Option<crate::model::terraform_blueprint::Source>>,
1345    >(
1346        mut self,
1347        v: T,
1348    ) -> Self {
1349        self.source = v.into();
1350        self
1351    }
1352
1353    /// The value of [source][crate::model::TerraformBlueprint::source]
1354    /// if it holds a `GcsSource`, `None` if the field is not set or
1355    /// holds a different branch.
1356    pub fn gcs_source(&self) -> std::option::Option<&std::string::String> {
1357        #[allow(unreachable_patterns)]
1358        self.source.as_ref().and_then(|v| match v {
1359            crate::model::terraform_blueprint::Source::GcsSource(v) => std::option::Option::Some(v),
1360            _ => std::option::Option::None,
1361        })
1362    }
1363
1364    /// Sets the value of [source][crate::model::TerraformBlueprint::source]
1365    /// to hold a `GcsSource`.
1366    ///
1367    /// Note that all the setters affecting `source` are
1368    /// mutually exclusive.
1369    ///
1370    /// # Example
1371    /// ```ignore,no_run
1372    /// # use google_cloud_config_v1::model::TerraformBlueprint;
1373    /// let x = TerraformBlueprint::new().set_gcs_source("example");
1374    /// assert!(x.gcs_source().is_some());
1375    /// assert!(x.git_source().is_none());
1376    /// ```
1377    pub fn set_gcs_source<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1378        self.source = std::option::Option::Some(
1379            crate::model::terraform_blueprint::Source::GcsSource(v.into()),
1380        );
1381        self
1382    }
1383
1384    /// The value of [source][crate::model::TerraformBlueprint::source]
1385    /// if it holds a `GitSource`, `None` if the field is not set or
1386    /// holds a different branch.
1387    pub fn git_source(&self) -> std::option::Option<&std::boxed::Box<crate::model::GitSource>> {
1388        #[allow(unreachable_patterns)]
1389        self.source.as_ref().and_then(|v| match v {
1390            crate::model::terraform_blueprint::Source::GitSource(v) => std::option::Option::Some(v),
1391            _ => std::option::Option::None,
1392        })
1393    }
1394
1395    /// Sets the value of [source][crate::model::TerraformBlueprint::source]
1396    /// to hold a `GitSource`.
1397    ///
1398    /// Note that all the setters affecting `source` are
1399    /// mutually exclusive.
1400    ///
1401    /// # Example
1402    /// ```ignore,no_run
1403    /// # use google_cloud_config_v1::model::TerraformBlueprint;
1404    /// use google_cloud_config_v1::model::GitSource;
1405    /// let x = TerraformBlueprint::new().set_git_source(GitSource::default()/* use setters */);
1406    /// assert!(x.git_source().is_some());
1407    /// assert!(x.gcs_source().is_none());
1408    /// ```
1409    pub fn set_git_source<T: std::convert::Into<std::boxed::Box<crate::model::GitSource>>>(
1410        mut self,
1411        v: T,
1412    ) -> Self {
1413        self.source = std::option::Option::Some(
1414            crate::model::terraform_blueprint::Source::GitSource(v.into()),
1415        );
1416        self
1417    }
1418}
1419
1420impl wkt::message::Message for TerraformBlueprint {
1421    fn typename() -> &'static str {
1422        "type.googleapis.com/google.cloud.config.v1.TerraformBlueprint"
1423    }
1424}
1425
1426/// Defines additional types related to [TerraformBlueprint].
1427pub mod terraform_blueprint {
1428    #[allow(unused_imports)]
1429    use super::*;
1430
1431    /// Location of the source configs.
1432    /// Required.
1433    #[derive(Clone, Debug, PartialEq)]
1434    #[non_exhaustive]
1435    pub enum Source {
1436        /// URI of an object in Google Cloud Storage.
1437        /// Format: `gs://{bucket}/{object}`
1438        ///
1439        /// URI may also specify an object version for zipped objects.
1440        /// Format: `gs://{bucket}/{object}#{version}`
1441        GcsSource(std::string::String),
1442        /// URI of a public Git repo.
1443        GitSource(std::boxed::Box<crate::model::GitSource>),
1444    }
1445}
1446
1447/// A Terraform input variable.
1448#[derive(Clone, Default, PartialEq)]
1449#[non_exhaustive]
1450pub struct TerraformVariable {
1451    /// Optional. Input variable value.
1452    pub input_value: std::option::Option<wkt::Value>,
1453
1454    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1455}
1456
1457impl TerraformVariable {
1458    /// Creates a new default instance.
1459    pub fn new() -> Self {
1460        std::default::Default::default()
1461    }
1462
1463    /// Sets the value of [input_value][crate::model::TerraformVariable::input_value].
1464    ///
1465    /// # Example
1466    /// ```ignore,no_run
1467    /// # use google_cloud_config_v1::model::TerraformVariable;
1468    /// use wkt::Value;
1469    /// let x = TerraformVariable::new().set_input_value(Value::default()/* use setters */);
1470    /// ```
1471    pub fn set_input_value<T>(mut self, v: T) -> Self
1472    where
1473        T: std::convert::Into<wkt::Value>,
1474    {
1475        self.input_value = std::option::Option::Some(v.into());
1476        self
1477    }
1478
1479    /// Sets or clears the value of [input_value][crate::model::TerraformVariable::input_value].
1480    ///
1481    /// # Example
1482    /// ```ignore,no_run
1483    /// # use google_cloud_config_v1::model::TerraformVariable;
1484    /// use wkt::Value;
1485    /// let x = TerraformVariable::new().set_or_clear_input_value(Some(Value::default()/* use setters */));
1486    /// let x = TerraformVariable::new().set_or_clear_input_value(None::<Value>);
1487    /// ```
1488    pub fn set_or_clear_input_value<T>(mut self, v: std::option::Option<T>) -> Self
1489    where
1490        T: std::convert::Into<wkt::Value>,
1491    {
1492        self.input_value = v.map(|x| x.into());
1493        self
1494    }
1495}
1496
1497impl wkt::message::Message for TerraformVariable {
1498    fn typename() -> &'static str {
1499        "type.googleapis.com/google.cloud.config.v1.TerraformVariable"
1500    }
1501}
1502
1503/// Configuration for a source of an external value.
1504#[derive(Clone, Default, PartialEq)]
1505#[non_exhaustive]
1506pub struct ExternalValueSource {
1507    /// The source of the external value.
1508    pub source: std::option::Option<crate::model::external_value_source::Source>,
1509
1510    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1511}
1512
1513impl ExternalValueSource {
1514    /// Creates a new default instance.
1515    pub fn new() -> Self {
1516        std::default::Default::default()
1517    }
1518
1519    /// Sets the value of [source][crate::model::ExternalValueSource::source].
1520    ///
1521    /// Note that all the setters affecting `source` are mutually
1522    /// exclusive.
1523    ///
1524    /// # Example
1525    /// ```ignore,no_run
1526    /// # use google_cloud_config_v1::model::ExternalValueSource;
1527    /// use google_cloud_config_v1::model::DeploymentSource;
1528    /// let x = ExternalValueSource::new().set_source(Some(
1529    ///     google_cloud_config_v1::model::external_value_source::Source::DeploymentSource(DeploymentSource::default().into())));
1530    /// ```
1531    pub fn set_source<
1532        T: std::convert::Into<std::option::Option<crate::model::external_value_source::Source>>,
1533    >(
1534        mut self,
1535        v: T,
1536    ) -> Self {
1537        self.source = v.into();
1538        self
1539    }
1540
1541    /// The value of [source][crate::model::ExternalValueSource::source]
1542    /// if it holds a `DeploymentSource`, `None` if the field is not set or
1543    /// holds a different branch.
1544    pub fn deployment_source(
1545        &self,
1546    ) -> std::option::Option<&std::boxed::Box<crate::model::DeploymentSource>> {
1547        #[allow(unreachable_patterns)]
1548        self.source.as_ref().and_then(|v| match v {
1549            crate::model::external_value_source::Source::DeploymentSource(v) => {
1550                std::option::Option::Some(v)
1551            }
1552            _ => std::option::Option::None,
1553        })
1554    }
1555
1556    /// Sets the value of [source][crate::model::ExternalValueSource::source]
1557    /// to hold a `DeploymentSource`.
1558    ///
1559    /// Note that all the setters affecting `source` are
1560    /// mutually exclusive.
1561    ///
1562    /// # Example
1563    /// ```ignore,no_run
1564    /// # use google_cloud_config_v1::model::ExternalValueSource;
1565    /// use google_cloud_config_v1::model::DeploymentSource;
1566    /// let x = ExternalValueSource::new().set_deployment_source(DeploymentSource::default()/* use setters */);
1567    /// assert!(x.deployment_source().is_some());
1568    /// ```
1569    pub fn set_deployment_source<
1570        T: std::convert::Into<std::boxed::Box<crate::model::DeploymentSource>>,
1571    >(
1572        mut self,
1573        v: T,
1574    ) -> Self {
1575        self.source = std::option::Option::Some(
1576            crate::model::external_value_source::Source::DeploymentSource(v.into()),
1577        );
1578        self
1579    }
1580}
1581
1582impl wkt::message::Message for ExternalValueSource {
1583    fn typename() -> &'static str {
1584        "type.googleapis.com/google.cloud.config.v1.ExternalValueSource"
1585    }
1586}
1587
1588/// Defines additional types related to [ExternalValueSource].
1589pub mod external_value_source {
1590    #[allow(unused_imports)]
1591    use super::*;
1592
1593    /// The source of the external value.
1594    #[derive(Clone, Debug, PartialEq)]
1595    #[non_exhaustive]
1596    pub enum Source {
1597        /// A source from a Deployment.
1598        DeploymentSource(std::boxed::Box<crate::model::DeploymentSource>),
1599    }
1600}
1601
1602/// Configuration for a value sourced from a Deployment.
1603#[derive(Clone, Default, PartialEq)]
1604#[non_exhaustive]
1605pub struct DeploymentSource {
1606    /// Required. The resource name of the source Deployment to import the output
1607    /// from. Format:
1608    /// projects/{project}/locations/{location}/deployments/{deployment} The source
1609    /// deployment must be in the same project and location.
1610    pub deployment: std::string::String,
1611
1612    /// Required. The name of the output variable in the source deployment's latest
1613    /// successfully applied revision.
1614    pub output_name: std::string::String,
1615
1616    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1617}
1618
1619impl DeploymentSource {
1620    /// Creates a new default instance.
1621    pub fn new() -> Self {
1622        std::default::Default::default()
1623    }
1624
1625    /// Sets the value of [deployment][crate::model::DeploymentSource::deployment].
1626    ///
1627    /// # Example
1628    /// ```ignore,no_run
1629    /// # use google_cloud_config_v1::model::DeploymentSource;
1630    /// # let project_id = "project_id";
1631    /// # let location_id = "location_id";
1632    /// # let deployment_id = "deployment_id";
1633    /// let x = DeploymentSource::new().set_deployment(format!("projects/{project_id}/locations/{location_id}/deployments/{deployment_id}"));
1634    /// ```
1635    pub fn set_deployment<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1636        self.deployment = v.into();
1637        self
1638    }
1639
1640    /// Sets the value of [output_name][crate::model::DeploymentSource::output_name].
1641    ///
1642    /// # Example
1643    /// ```ignore,no_run
1644    /// # use google_cloud_config_v1::model::DeploymentSource;
1645    /// let x = DeploymentSource::new().set_output_name("example");
1646    /// ```
1647    pub fn set_output_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1648        self.output_name = v.into();
1649        self
1650    }
1651}
1652
1653impl wkt::message::Message for DeploymentSource {
1654    fn typename() -> &'static str {
1655        "type.googleapis.com/google.cloud.config.v1.DeploymentSource"
1656    }
1657}
1658
1659/// Outputs and artifacts from applying a deployment.
1660#[derive(Clone, Default, PartialEq)]
1661#[non_exhaustive]
1662pub struct ApplyResults {
1663    /// Location of a blueprint copy and other manifests in Google Cloud Storage.
1664    /// Format: `gs://{bucket}/{object}`
1665    pub content: std::string::String,
1666
1667    /// Location of artifacts (e.g. logs) in Google Cloud Storage.
1668    /// Format: `gs://{bucket}/{object}`
1669    pub artifacts: std::string::String,
1670
1671    /// Map of output name to output info.
1672    pub outputs: std::collections::HashMap<std::string::String, crate::model::TerraformOutput>,
1673
1674    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1675}
1676
1677impl ApplyResults {
1678    /// Creates a new default instance.
1679    pub fn new() -> Self {
1680        std::default::Default::default()
1681    }
1682
1683    /// Sets the value of [content][crate::model::ApplyResults::content].
1684    ///
1685    /// # Example
1686    /// ```ignore,no_run
1687    /// # use google_cloud_config_v1::model::ApplyResults;
1688    /// let x = ApplyResults::new().set_content("example");
1689    /// ```
1690    pub fn set_content<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1691        self.content = v.into();
1692        self
1693    }
1694
1695    /// Sets the value of [artifacts][crate::model::ApplyResults::artifacts].
1696    ///
1697    /// # Example
1698    /// ```ignore,no_run
1699    /// # use google_cloud_config_v1::model::ApplyResults;
1700    /// let x = ApplyResults::new().set_artifacts("example");
1701    /// ```
1702    pub fn set_artifacts<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1703        self.artifacts = v.into();
1704        self
1705    }
1706
1707    /// Sets the value of [outputs][crate::model::ApplyResults::outputs].
1708    ///
1709    /// # Example
1710    /// ```ignore,no_run
1711    /// # use google_cloud_config_v1::model::ApplyResults;
1712    /// use google_cloud_config_v1::model::TerraformOutput;
1713    /// let x = ApplyResults::new().set_outputs([
1714    ///     ("key0", TerraformOutput::default()/* use setters */),
1715    ///     ("key1", TerraformOutput::default()/* use (different) setters */),
1716    /// ]);
1717    /// ```
1718    pub fn set_outputs<T, K, V>(mut self, v: T) -> Self
1719    where
1720        T: std::iter::IntoIterator<Item = (K, V)>,
1721        K: std::convert::Into<std::string::String>,
1722        V: std::convert::Into<crate::model::TerraformOutput>,
1723    {
1724        use std::iter::Iterator;
1725        self.outputs = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1726        self
1727    }
1728}
1729
1730impl wkt::message::Message for ApplyResults {
1731    fn typename() -> &'static str {
1732        "type.googleapis.com/google.cloud.config.v1.ApplyResults"
1733    }
1734}
1735
1736/// Describes a Terraform output.
1737#[derive(Clone, Default, PartialEq)]
1738#[non_exhaustive]
1739pub struct TerraformOutput {
1740    /// Identifies whether Terraform has set this output as a potential
1741    /// sensitive value.
1742    pub sensitive: bool,
1743
1744    /// Value of output.
1745    pub value: std::option::Option<wkt::Value>,
1746
1747    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1748}
1749
1750impl TerraformOutput {
1751    /// Creates a new default instance.
1752    pub fn new() -> Self {
1753        std::default::Default::default()
1754    }
1755
1756    /// Sets the value of [sensitive][crate::model::TerraformOutput::sensitive].
1757    ///
1758    /// # Example
1759    /// ```ignore,no_run
1760    /// # use google_cloud_config_v1::model::TerraformOutput;
1761    /// let x = TerraformOutput::new().set_sensitive(true);
1762    /// ```
1763    pub fn set_sensitive<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1764        self.sensitive = v.into();
1765        self
1766    }
1767
1768    /// Sets the value of [value][crate::model::TerraformOutput::value].
1769    ///
1770    /// # Example
1771    /// ```ignore,no_run
1772    /// # use google_cloud_config_v1::model::TerraformOutput;
1773    /// use wkt::Value;
1774    /// let x = TerraformOutput::new().set_value(Value::default()/* use setters */);
1775    /// ```
1776    pub fn set_value<T>(mut self, v: T) -> Self
1777    where
1778        T: std::convert::Into<wkt::Value>,
1779    {
1780        self.value = std::option::Option::Some(v.into());
1781        self
1782    }
1783
1784    /// Sets or clears the value of [value][crate::model::TerraformOutput::value].
1785    ///
1786    /// # Example
1787    /// ```ignore,no_run
1788    /// # use google_cloud_config_v1::model::TerraformOutput;
1789    /// use wkt::Value;
1790    /// let x = TerraformOutput::new().set_or_clear_value(Some(Value::default()/* use setters */));
1791    /// let x = TerraformOutput::new().set_or_clear_value(None::<Value>);
1792    /// ```
1793    pub fn set_or_clear_value<T>(mut self, v: std::option::Option<T>) -> Self
1794    where
1795        T: std::convert::Into<wkt::Value>,
1796    {
1797        self.value = v.map(|x| x.into());
1798        self
1799    }
1800}
1801
1802impl wkt::message::Message for TerraformOutput {
1803    fn typename() -> &'static str {
1804        "type.googleapis.com/google.cloud.config.v1.TerraformOutput"
1805    }
1806}
1807
1808#[allow(missing_docs)]
1809#[derive(Clone, Default, PartialEq)]
1810#[non_exhaustive]
1811pub struct ListDeploymentsRequest {
1812    /// Required. The parent in whose context the Deployments are listed. The
1813    /// parent value is in the format:
1814    /// 'projects/{project_id}/locations/{location}'.
1815    pub parent: std::string::String,
1816
1817    /// When requesting a page of resources, 'page_size' specifies number of
1818    /// resources to return. If unspecified, at most 500 will be returned. The
1819    /// maximum value is 1000.
1820    pub page_size: i32,
1821
1822    /// Token returned by previous call to 'ListDeployments' which specifies the
1823    /// position in the list from where to continue listing the resources.
1824    pub page_token: std::string::String,
1825
1826    /// Lists the Deployments that match the filter expression. A filter
1827    /// expression filters the resources listed in the response. The expression
1828    /// must be of the form '{field} {operator} {value}' where operators: '<', '>',
1829    /// '<=', '>=', '!=', '=', ':' are supported (colon ':' represents a HAS
1830    /// operator which is roughly synonymous with equality). {field} can refer to a
1831    /// proto or JSON field, or a synthetic field. Field names can be camelCase or
1832    /// snake_case.
1833    ///
1834    /// Examples:
1835    ///
1836    /// - Filter by name:
1837    ///   name = "projects/foo/locations/us-central1/deployments/bar
1838    ///
1839    /// - Filter by labels:
1840    ///
1841    ///   - Resources that have a key called 'foo'
1842    ///     labels.foo:*
1843    ///   - Resources that have a key called 'foo' whose value is 'bar'
1844    ///     labels.foo = bar
1845    /// - Filter by state:
1846    ///
1847    ///   - Deployments in CREATING state.
1848    ///     state=CREATING
1849    pub filter: std::string::String,
1850
1851    /// Field to use to sort the list.
1852    pub order_by: std::string::String,
1853
1854    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1855}
1856
1857impl ListDeploymentsRequest {
1858    /// Creates a new default instance.
1859    pub fn new() -> Self {
1860        std::default::Default::default()
1861    }
1862
1863    /// Sets the value of [parent][crate::model::ListDeploymentsRequest::parent].
1864    ///
1865    /// # Example
1866    /// ```ignore,no_run
1867    /// # use google_cloud_config_v1::model::ListDeploymentsRequest;
1868    /// let x = ListDeploymentsRequest::new().set_parent("example");
1869    /// ```
1870    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1871        self.parent = v.into();
1872        self
1873    }
1874
1875    /// Sets the value of [page_size][crate::model::ListDeploymentsRequest::page_size].
1876    ///
1877    /// # Example
1878    /// ```ignore,no_run
1879    /// # use google_cloud_config_v1::model::ListDeploymentsRequest;
1880    /// let x = ListDeploymentsRequest::new().set_page_size(42);
1881    /// ```
1882    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1883        self.page_size = v.into();
1884        self
1885    }
1886
1887    /// Sets the value of [page_token][crate::model::ListDeploymentsRequest::page_token].
1888    ///
1889    /// # Example
1890    /// ```ignore,no_run
1891    /// # use google_cloud_config_v1::model::ListDeploymentsRequest;
1892    /// let x = ListDeploymentsRequest::new().set_page_token("example");
1893    /// ```
1894    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1895        self.page_token = v.into();
1896        self
1897    }
1898
1899    /// Sets the value of [filter][crate::model::ListDeploymentsRequest::filter].
1900    ///
1901    /// # Example
1902    /// ```ignore,no_run
1903    /// # use google_cloud_config_v1::model::ListDeploymentsRequest;
1904    /// let x = ListDeploymentsRequest::new().set_filter("example");
1905    /// ```
1906    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1907        self.filter = v.into();
1908        self
1909    }
1910
1911    /// Sets the value of [order_by][crate::model::ListDeploymentsRequest::order_by].
1912    ///
1913    /// # Example
1914    /// ```ignore,no_run
1915    /// # use google_cloud_config_v1::model::ListDeploymentsRequest;
1916    /// let x = ListDeploymentsRequest::new().set_order_by("example");
1917    /// ```
1918    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1919        self.order_by = v.into();
1920        self
1921    }
1922}
1923
1924impl wkt::message::Message for ListDeploymentsRequest {
1925    fn typename() -> &'static str {
1926        "type.googleapis.com/google.cloud.config.v1.ListDeploymentsRequest"
1927    }
1928}
1929
1930#[allow(missing_docs)]
1931#[derive(Clone, Default, PartialEq)]
1932#[non_exhaustive]
1933pub struct ListDeploymentsResponse {
1934    /// List of [Deployment][google.cloud.config.v1.Deployment]s.
1935    ///
1936    /// [google.cloud.config.v1.Deployment]: crate::model::Deployment
1937    pub deployments: std::vec::Vec<crate::model::Deployment>,
1938
1939    /// Token to be supplied to the next ListDeployments request via `page_token`
1940    /// to obtain the next set of results.
1941    pub next_page_token: std::string::String,
1942
1943    /// Locations that could not be reached.
1944    pub unreachable: std::vec::Vec<std::string::String>,
1945
1946    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1947}
1948
1949impl ListDeploymentsResponse {
1950    /// Creates a new default instance.
1951    pub fn new() -> Self {
1952        std::default::Default::default()
1953    }
1954
1955    /// Sets the value of [deployments][crate::model::ListDeploymentsResponse::deployments].
1956    ///
1957    /// # Example
1958    /// ```ignore,no_run
1959    /// # use google_cloud_config_v1::model::ListDeploymentsResponse;
1960    /// use google_cloud_config_v1::model::Deployment;
1961    /// let x = ListDeploymentsResponse::new()
1962    ///     .set_deployments([
1963    ///         Deployment::default()/* use setters */,
1964    ///         Deployment::default()/* use (different) setters */,
1965    ///     ]);
1966    /// ```
1967    pub fn set_deployments<T, V>(mut self, v: T) -> Self
1968    where
1969        T: std::iter::IntoIterator<Item = V>,
1970        V: std::convert::Into<crate::model::Deployment>,
1971    {
1972        use std::iter::Iterator;
1973        self.deployments = v.into_iter().map(|i| i.into()).collect();
1974        self
1975    }
1976
1977    /// Sets the value of [next_page_token][crate::model::ListDeploymentsResponse::next_page_token].
1978    ///
1979    /// # Example
1980    /// ```ignore,no_run
1981    /// # use google_cloud_config_v1::model::ListDeploymentsResponse;
1982    /// let x = ListDeploymentsResponse::new().set_next_page_token("example");
1983    /// ```
1984    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1985        self.next_page_token = v.into();
1986        self
1987    }
1988
1989    /// Sets the value of [unreachable][crate::model::ListDeploymentsResponse::unreachable].
1990    ///
1991    /// # Example
1992    /// ```ignore,no_run
1993    /// # use google_cloud_config_v1::model::ListDeploymentsResponse;
1994    /// let x = ListDeploymentsResponse::new().set_unreachable(["a", "b", "c"]);
1995    /// ```
1996    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
1997    where
1998        T: std::iter::IntoIterator<Item = V>,
1999        V: std::convert::Into<std::string::String>,
2000    {
2001        use std::iter::Iterator;
2002        self.unreachable = v.into_iter().map(|i| i.into()).collect();
2003        self
2004    }
2005}
2006
2007impl wkt::message::Message for ListDeploymentsResponse {
2008    fn typename() -> &'static str {
2009        "type.googleapis.com/google.cloud.config.v1.ListDeploymentsResponse"
2010    }
2011}
2012
2013#[doc(hidden)]
2014impl google_cloud_gax::paginator::internal::PageableResponse for ListDeploymentsResponse {
2015    type PageItem = crate::model::Deployment;
2016
2017    fn items(self) -> std::vec::Vec<Self::PageItem> {
2018        self.deployments
2019    }
2020
2021    fn next_page_token(&self) -> std::string::String {
2022        use std::clone::Clone;
2023        self.next_page_token.clone()
2024    }
2025}
2026
2027#[allow(missing_docs)]
2028#[derive(Clone, Default, PartialEq)]
2029#[non_exhaustive]
2030pub struct GetDeploymentRequest {
2031    /// Required. The name of the deployment. Format:
2032    /// 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
2033    pub name: std::string::String,
2034
2035    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2036}
2037
2038impl GetDeploymentRequest {
2039    /// Creates a new default instance.
2040    pub fn new() -> Self {
2041        std::default::Default::default()
2042    }
2043
2044    /// Sets the value of [name][crate::model::GetDeploymentRequest::name].
2045    ///
2046    /// # Example
2047    /// ```ignore,no_run
2048    /// # use google_cloud_config_v1::model::GetDeploymentRequest;
2049    /// # let project_id = "project_id";
2050    /// # let location_id = "location_id";
2051    /// # let deployment_id = "deployment_id";
2052    /// let x = GetDeploymentRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/deployments/{deployment_id}"));
2053    /// ```
2054    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2055        self.name = v.into();
2056        self
2057    }
2058}
2059
2060impl wkt::message::Message for GetDeploymentRequest {
2061    fn typename() -> &'static str {
2062        "type.googleapis.com/google.cloud.config.v1.GetDeploymentRequest"
2063    }
2064}
2065
2066/// A request to list Revisions passed to a 'ListRevisions' call.
2067#[derive(Clone, Default, PartialEq)]
2068#[non_exhaustive]
2069pub struct ListRevisionsRequest {
2070    /// Required. The parent in whose context the Revisions are listed. The parent
2071    /// value is in the format:
2072    /// 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
2073    pub parent: std::string::String,
2074
2075    /// When requesting a page of resources, `page_size` specifies number of
2076    /// resources to return. If unspecified, at most 500 will be returned. The
2077    /// maximum value is 1000.
2078    pub page_size: i32,
2079
2080    /// Token returned by previous call to 'ListRevisions' which specifies the
2081    /// position in the list from where to continue listing the resources.
2082    pub page_token: std::string::String,
2083
2084    /// Lists the Revisions that match the filter expression. A filter
2085    /// expression filters the resources listed in the response. The expression
2086    /// must be of the form '{field} {operator} {value}' where operators: '<', '>',
2087    /// '<=', '>=', '!=', '=', ':' are supported (colon ':' represents a HAS
2088    /// operator which is roughly synonymous with equality). {field} can refer to a
2089    /// proto or JSON field, or a synthetic field. Field names can be camelCase or
2090    /// snake_case.
2091    ///
2092    /// Examples:
2093    ///
2094    /// - Filter by name:
2095    ///   name = "projects/foo/locations/us-central1/deployments/dep/revisions/bar
2096    ///
2097    /// - Filter by labels:
2098    ///
2099    ///   - Resources that have a key called 'foo'
2100    ///     labels.foo:*
2101    ///   - Resources that have a key called 'foo' whose value is 'bar'
2102    ///     labels.foo = bar
2103    /// - Filter by state:
2104    ///
2105    ///   - Revisions in CREATING state.
2106    ///     state=CREATING
2107    pub filter: std::string::String,
2108
2109    /// Field to use to sort the list.
2110    pub order_by: std::string::String,
2111
2112    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2113}
2114
2115impl ListRevisionsRequest {
2116    /// Creates a new default instance.
2117    pub fn new() -> Self {
2118        std::default::Default::default()
2119    }
2120
2121    /// Sets the value of [parent][crate::model::ListRevisionsRequest::parent].
2122    ///
2123    /// # Example
2124    /// ```ignore,no_run
2125    /// # use google_cloud_config_v1::model::ListRevisionsRequest;
2126    /// # let project_id = "project_id";
2127    /// # let location_id = "location_id";
2128    /// # let deployment_id = "deployment_id";
2129    /// let x = ListRevisionsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/deployments/{deployment_id}"));
2130    /// ```
2131    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2132        self.parent = v.into();
2133        self
2134    }
2135
2136    /// Sets the value of [page_size][crate::model::ListRevisionsRequest::page_size].
2137    ///
2138    /// # Example
2139    /// ```ignore,no_run
2140    /// # use google_cloud_config_v1::model::ListRevisionsRequest;
2141    /// let x = ListRevisionsRequest::new().set_page_size(42);
2142    /// ```
2143    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2144        self.page_size = v.into();
2145        self
2146    }
2147
2148    /// Sets the value of [page_token][crate::model::ListRevisionsRequest::page_token].
2149    ///
2150    /// # Example
2151    /// ```ignore,no_run
2152    /// # use google_cloud_config_v1::model::ListRevisionsRequest;
2153    /// let x = ListRevisionsRequest::new().set_page_token("example");
2154    /// ```
2155    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2156        self.page_token = v.into();
2157        self
2158    }
2159
2160    /// Sets the value of [filter][crate::model::ListRevisionsRequest::filter].
2161    ///
2162    /// # Example
2163    /// ```ignore,no_run
2164    /// # use google_cloud_config_v1::model::ListRevisionsRequest;
2165    /// let x = ListRevisionsRequest::new().set_filter("example");
2166    /// ```
2167    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2168        self.filter = v.into();
2169        self
2170    }
2171
2172    /// Sets the value of [order_by][crate::model::ListRevisionsRequest::order_by].
2173    ///
2174    /// # Example
2175    /// ```ignore,no_run
2176    /// # use google_cloud_config_v1::model::ListRevisionsRequest;
2177    /// let x = ListRevisionsRequest::new().set_order_by("example");
2178    /// ```
2179    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2180        self.order_by = v.into();
2181        self
2182    }
2183}
2184
2185impl wkt::message::Message for ListRevisionsRequest {
2186    fn typename() -> &'static str {
2187        "type.googleapis.com/google.cloud.config.v1.ListRevisionsRequest"
2188    }
2189}
2190
2191/// A response to a 'ListRevisions' call. Contains a list of Revisions.
2192#[derive(Clone, Default, PartialEq)]
2193#[non_exhaustive]
2194pub struct ListRevisionsResponse {
2195    /// List of [Revision][google.cloud.config.v1.Revision]s.
2196    ///
2197    /// [google.cloud.config.v1.Revision]: crate::model::Revision
2198    pub revisions: std::vec::Vec<crate::model::Revision>,
2199
2200    /// A token to request the next page of resources from the 'ListRevisions'
2201    /// method. The value of an empty string means that there are no more resources
2202    /// to return.
2203    pub next_page_token: std::string::String,
2204
2205    /// Locations that could not be reached.
2206    pub unreachable: std::vec::Vec<std::string::String>,
2207
2208    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2209}
2210
2211impl ListRevisionsResponse {
2212    /// Creates a new default instance.
2213    pub fn new() -> Self {
2214        std::default::Default::default()
2215    }
2216
2217    /// Sets the value of [revisions][crate::model::ListRevisionsResponse::revisions].
2218    ///
2219    /// # Example
2220    /// ```ignore,no_run
2221    /// # use google_cloud_config_v1::model::ListRevisionsResponse;
2222    /// use google_cloud_config_v1::model::Revision;
2223    /// let x = ListRevisionsResponse::new()
2224    ///     .set_revisions([
2225    ///         Revision::default()/* use setters */,
2226    ///         Revision::default()/* use (different) setters */,
2227    ///     ]);
2228    /// ```
2229    pub fn set_revisions<T, V>(mut self, v: T) -> Self
2230    where
2231        T: std::iter::IntoIterator<Item = V>,
2232        V: std::convert::Into<crate::model::Revision>,
2233    {
2234        use std::iter::Iterator;
2235        self.revisions = v.into_iter().map(|i| i.into()).collect();
2236        self
2237    }
2238
2239    /// Sets the value of [next_page_token][crate::model::ListRevisionsResponse::next_page_token].
2240    ///
2241    /// # Example
2242    /// ```ignore,no_run
2243    /// # use google_cloud_config_v1::model::ListRevisionsResponse;
2244    /// let x = ListRevisionsResponse::new().set_next_page_token("example");
2245    /// ```
2246    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2247        self.next_page_token = v.into();
2248        self
2249    }
2250
2251    /// Sets the value of [unreachable][crate::model::ListRevisionsResponse::unreachable].
2252    ///
2253    /// # Example
2254    /// ```ignore,no_run
2255    /// # use google_cloud_config_v1::model::ListRevisionsResponse;
2256    /// let x = ListRevisionsResponse::new().set_unreachable(["a", "b", "c"]);
2257    /// ```
2258    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
2259    where
2260        T: std::iter::IntoIterator<Item = V>,
2261        V: std::convert::Into<std::string::String>,
2262    {
2263        use std::iter::Iterator;
2264        self.unreachable = v.into_iter().map(|i| i.into()).collect();
2265        self
2266    }
2267}
2268
2269impl wkt::message::Message for ListRevisionsResponse {
2270    fn typename() -> &'static str {
2271        "type.googleapis.com/google.cloud.config.v1.ListRevisionsResponse"
2272    }
2273}
2274
2275#[doc(hidden)]
2276impl google_cloud_gax::paginator::internal::PageableResponse for ListRevisionsResponse {
2277    type PageItem = crate::model::Revision;
2278
2279    fn items(self) -> std::vec::Vec<Self::PageItem> {
2280        self.revisions
2281    }
2282
2283    fn next_page_token(&self) -> std::string::String {
2284        use std::clone::Clone;
2285        self.next_page_token.clone()
2286    }
2287}
2288
2289/// A request to get a Revision from a 'GetRevision' call.
2290#[derive(Clone, Default, PartialEq)]
2291#[non_exhaustive]
2292pub struct GetRevisionRequest {
2293    /// Required. The name of the Revision in the format:
2294    /// 'projects/{project_id}/locations/{location}/deployments/{deployment}/revisions/{revision}'.
2295    pub name: std::string::String,
2296
2297    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2298}
2299
2300impl GetRevisionRequest {
2301    /// Creates a new default instance.
2302    pub fn new() -> Self {
2303        std::default::Default::default()
2304    }
2305
2306    /// Sets the value of [name][crate::model::GetRevisionRequest::name].
2307    ///
2308    /// # Example
2309    /// ```ignore,no_run
2310    /// # use google_cloud_config_v1::model::GetRevisionRequest;
2311    /// # let project_id = "project_id";
2312    /// # let location_id = "location_id";
2313    /// # let deployment_id = "deployment_id";
2314    /// # let revision_id = "revision_id";
2315    /// let x = GetRevisionRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/deployments/{deployment_id}/revisions/{revision_id}"));
2316    /// ```
2317    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2318        self.name = v.into();
2319        self
2320    }
2321}
2322
2323impl wkt::message::Message for GetRevisionRequest {
2324    fn typename() -> &'static str {
2325        "type.googleapis.com/google.cloud.config.v1.GetRevisionRequest"
2326    }
2327}
2328
2329#[allow(missing_docs)]
2330#[derive(Clone, Default, PartialEq)]
2331#[non_exhaustive]
2332pub struct CreateDeploymentRequest {
2333    /// Required. The parent in whose context the Deployment is created. The parent
2334    /// value is in the format: 'projects/{project_id}/locations/{location}'.
2335    pub parent: std::string::String,
2336
2337    /// Required. The Deployment ID.
2338    pub deployment_id: std::string::String,
2339
2340    /// Required. [Deployment][google.cloud.config.v1.Deployment] resource to be
2341    /// created.
2342    ///
2343    /// [google.cloud.config.v1.Deployment]: crate::model::Deployment
2344    pub deployment: std::option::Option<crate::model::Deployment>,
2345
2346    /// Optional. An optional request ID to identify requests. Specify a unique
2347    /// request ID so that if you must retry your request, the server will know to
2348    /// ignore the request if it has already been completed. The server will
2349    /// guarantee that for at least 60 minutes since the first request.
2350    ///
2351    /// For example, consider a situation where you make an initial request and the
2352    /// request times out. If you make the request again with the same request ID,
2353    /// the server can check if original operation with the same request ID was
2354    /// received, and if so, will ignore the second request. This prevents clients
2355    /// from accidentally creating duplicate commitments.
2356    ///
2357    /// The request ID must be a valid UUID with the exception that zero UUID is
2358    /// not supported (00000000-0000-0000-0000-000000000000).
2359    pub request_id: std::string::String,
2360
2361    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2362}
2363
2364impl CreateDeploymentRequest {
2365    /// Creates a new default instance.
2366    pub fn new() -> Self {
2367        std::default::Default::default()
2368    }
2369
2370    /// Sets the value of [parent][crate::model::CreateDeploymentRequest::parent].
2371    ///
2372    /// # Example
2373    /// ```ignore,no_run
2374    /// # use google_cloud_config_v1::model::CreateDeploymentRequest;
2375    /// let x = CreateDeploymentRequest::new().set_parent("example");
2376    /// ```
2377    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2378        self.parent = v.into();
2379        self
2380    }
2381
2382    /// Sets the value of [deployment_id][crate::model::CreateDeploymentRequest::deployment_id].
2383    ///
2384    /// # Example
2385    /// ```ignore,no_run
2386    /// # use google_cloud_config_v1::model::CreateDeploymentRequest;
2387    /// let x = CreateDeploymentRequest::new().set_deployment_id("example");
2388    /// ```
2389    pub fn set_deployment_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2390        self.deployment_id = v.into();
2391        self
2392    }
2393
2394    /// Sets the value of [deployment][crate::model::CreateDeploymentRequest::deployment].
2395    ///
2396    /// # Example
2397    /// ```ignore,no_run
2398    /// # use google_cloud_config_v1::model::CreateDeploymentRequest;
2399    /// use google_cloud_config_v1::model::Deployment;
2400    /// let x = CreateDeploymentRequest::new().set_deployment(Deployment::default()/* use setters */);
2401    /// ```
2402    pub fn set_deployment<T>(mut self, v: T) -> Self
2403    where
2404        T: std::convert::Into<crate::model::Deployment>,
2405    {
2406        self.deployment = std::option::Option::Some(v.into());
2407        self
2408    }
2409
2410    /// Sets or clears the value of [deployment][crate::model::CreateDeploymentRequest::deployment].
2411    ///
2412    /// # Example
2413    /// ```ignore,no_run
2414    /// # use google_cloud_config_v1::model::CreateDeploymentRequest;
2415    /// use google_cloud_config_v1::model::Deployment;
2416    /// let x = CreateDeploymentRequest::new().set_or_clear_deployment(Some(Deployment::default()/* use setters */));
2417    /// let x = CreateDeploymentRequest::new().set_or_clear_deployment(None::<Deployment>);
2418    /// ```
2419    pub fn set_or_clear_deployment<T>(mut self, v: std::option::Option<T>) -> Self
2420    where
2421        T: std::convert::Into<crate::model::Deployment>,
2422    {
2423        self.deployment = v.map(|x| x.into());
2424        self
2425    }
2426
2427    /// Sets the value of [request_id][crate::model::CreateDeploymentRequest::request_id].
2428    ///
2429    /// # Example
2430    /// ```ignore,no_run
2431    /// # use google_cloud_config_v1::model::CreateDeploymentRequest;
2432    /// let x = CreateDeploymentRequest::new().set_request_id("example");
2433    /// ```
2434    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2435        self.request_id = v.into();
2436        self
2437    }
2438}
2439
2440impl wkt::message::Message for CreateDeploymentRequest {
2441    fn typename() -> &'static str {
2442        "type.googleapis.com/google.cloud.config.v1.CreateDeploymentRequest"
2443    }
2444}
2445
2446/// A request to create a deployment group
2447#[derive(Clone, Default, PartialEq)]
2448#[non_exhaustive]
2449pub struct CreateDeploymentGroupRequest {
2450    /// Required. The parent in whose context the Deployment Group is created. The
2451    /// parent value is in the format: 'projects/{project_id}/locations/{location}'
2452    pub parent: std::string::String,
2453
2454    /// Required. The deployment group ID.
2455    pub deployment_group_id: std::string::String,
2456
2457    /// Required. [Deployment Group][] resource to create
2458    pub deployment_group: std::option::Option<crate::model::DeploymentGroup>,
2459
2460    /// Optional. An optional request ID to identify requests. Specify a unique
2461    /// request ID so that if you must retry your request, the server will know to
2462    /// ignore the request if it has already been completed. The server will
2463    /// guarantee that for at least 60 minutes since the first request.
2464    ///
2465    /// For example, consider a situation where you make an initial request and the
2466    /// request times out. If you make the request again with the same request ID,
2467    /// the server can check if original operation with the same request ID was
2468    /// received, and if so, will ignore the second request. This prevents clients
2469    /// from accidentally creating duplicate commitments.
2470    ///
2471    /// The request ID must be a valid UUID with the exception that zero UUID is
2472    /// not supported (00000000-0000-0000-0000-000000000000).
2473    pub request_id: std::string::String,
2474
2475    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2476}
2477
2478impl CreateDeploymentGroupRequest {
2479    /// Creates a new default instance.
2480    pub fn new() -> Self {
2481        std::default::Default::default()
2482    }
2483
2484    /// Sets the value of [parent][crate::model::CreateDeploymentGroupRequest::parent].
2485    ///
2486    /// # Example
2487    /// ```ignore,no_run
2488    /// # use google_cloud_config_v1::model::CreateDeploymentGroupRequest;
2489    /// let x = CreateDeploymentGroupRequest::new().set_parent("example");
2490    /// ```
2491    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2492        self.parent = v.into();
2493        self
2494    }
2495
2496    /// Sets the value of [deployment_group_id][crate::model::CreateDeploymentGroupRequest::deployment_group_id].
2497    ///
2498    /// # Example
2499    /// ```ignore,no_run
2500    /// # use google_cloud_config_v1::model::CreateDeploymentGroupRequest;
2501    /// let x = CreateDeploymentGroupRequest::new().set_deployment_group_id("example");
2502    /// ```
2503    pub fn set_deployment_group_id<T: std::convert::Into<std::string::String>>(
2504        mut self,
2505        v: T,
2506    ) -> Self {
2507        self.deployment_group_id = v.into();
2508        self
2509    }
2510
2511    /// Sets the value of [deployment_group][crate::model::CreateDeploymentGroupRequest::deployment_group].
2512    ///
2513    /// # Example
2514    /// ```ignore,no_run
2515    /// # use google_cloud_config_v1::model::CreateDeploymentGroupRequest;
2516    /// use google_cloud_config_v1::model::DeploymentGroup;
2517    /// let x = CreateDeploymentGroupRequest::new().set_deployment_group(DeploymentGroup::default()/* use setters */);
2518    /// ```
2519    pub fn set_deployment_group<T>(mut self, v: T) -> Self
2520    where
2521        T: std::convert::Into<crate::model::DeploymentGroup>,
2522    {
2523        self.deployment_group = std::option::Option::Some(v.into());
2524        self
2525    }
2526
2527    /// Sets or clears the value of [deployment_group][crate::model::CreateDeploymentGroupRequest::deployment_group].
2528    ///
2529    /// # Example
2530    /// ```ignore,no_run
2531    /// # use google_cloud_config_v1::model::CreateDeploymentGroupRequest;
2532    /// use google_cloud_config_v1::model::DeploymentGroup;
2533    /// let x = CreateDeploymentGroupRequest::new().set_or_clear_deployment_group(Some(DeploymentGroup::default()/* use setters */));
2534    /// let x = CreateDeploymentGroupRequest::new().set_or_clear_deployment_group(None::<DeploymentGroup>);
2535    /// ```
2536    pub fn set_or_clear_deployment_group<T>(mut self, v: std::option::Option<T>) -> Self
2537    where
2538        T: std::convert::Into<crate::model::DeploymentGroup>,
2539    {
2540        self.deployment_group = v.map(|x| x.into());
2541        self
2542    }
2543
2544    /// Sets the value of [request_id][crate::model::CreateDeploymentGroupRequest::request_id].
2545    ///
2546    /// # Example
2547    /// ```ignore,no_run
2548    /// # use google_cloud_config_v1::model::CreateDeploymentGroupRequest;
2549    /// let x = CreateDeploymentGroupRequest::new().set_request_id("example");
2550    /// ```
2551    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2552        self.request_id = v.into();
2553        self
2554    }
2555}
2556
2557impl wkt::message::Message for CreateDeploymentGroupRequest {
2558    fn typename() -> &'static str {
2559        "type.googleapis.com/google.cloud.config.v1.CreateDeploymentGroupRequest"
2560    }
2561}
2562
2563/// A request message for updating a deployment group
2564#[derive(Clone, Default, PartialEq)]
2565#[non_exhaustive]
2566pub struct UpdateDeploymentGroupRequest {
2567    /// Optional. Field mask used to specify the fields to be overwritten in the
2568    /// Deployment Group resource by the update.
2569    ///
2570    /// The fields specified in the update_mask are relative to the resource, not
2571    /// the full request. A field will be overwritten if it is in the mask. If the
2572    /// user does not provide a mask then all fields will be overwritten.
2573    pub update_mask: std::option::Option<wkt::FieldMask>,
2574
2575    /// Required. [DeploymentGroup][google.cloud.config.v1.DeploymentGroup] to
2576    /// update.
2577    ///
2578    /// The deployment group's `name` field is used to identify the resource to be
2579    /// updated. Format:
2580    /// `projects/{project}/locations/{location}/deploymentGroups/{deployment_group_id}`
2581    ///
2582    /// [google.cloud.config.v1.DeploymentGroup]: crate::model::DeploymentGroup
2583    pub deployment_group: std::option::Option<crate::model::DeploymentGroup>,
2584
2585    /// Optional. An optional request ID to identify requests. Specify a unique
2586    /// request ID so that if you must retry your request, the server will know to
2587    /// ignore the request if it has already been completed. The server will
2588    /// guarantee that for at least 60 minutes since the first request.
2589    ///
2590    /// For example, consider a situation where you make an initial request and the
2591    /// request times out. If you make the request again with the same request ID,
2592    /// the server can check if original operation with the same request ID was
2593    /// received, and if so, will ignore the second request. This prevents clients
2594    /// from accidentally creating duplicate commitments.
2595    ///
2596    /// The request ID must be a valid UUID with the exception that zero UUID is
2597    /// not supported (00000000-0000-0000-0000-000000000000).
2598    pub request_id: std::string::String,
2599
2600    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2601}
2602
2603impl UpdateDeploymentGroupRequest {
2604    /// Creates a new default instance.
2605    pub fn new() -> Self {
2606        std::default::Default::default()
2607    }
2608
2609    /// Sets the value of [update_mask][crate::model::UpdateDeploymentGroupRequest::update_mask].
2610    ///
2611    /// # Example
2612    /// ```ignore,no_run
2613    /// # use google_cloud_config_v1::model::UpdateDeploymentGroupRequest;
2614    /// use wkt::FieldMask;
2615    /// let x = UpdateDeploymentGroupRequest::new().set_update_mask(FieldMask::default()/* use setters */);
2616    /// ```
2617    pub fn set_update_mask<T>(mut self, v: T) -> Self
2618    where
2619        T: std::convert::Into<wkt::FieldMask>,
2620    {
2621        self.update_mask = std::option::Option::Some(v.into());
2622        self
2623    }
2624
2625    /// Sets or clears the value of [update_mask][crate::model::UpdateDeploymentGroupRequest::update_mask].
2626    ///
2627    /// # Example
2628    /// ```ignore,no_run
2629    /// # use google_cloud_config_v1::model::UpdateDeploymentGroupRequest;
2630    /// use wkt::FieldMask;
2631    /// let x = UpdateDeploymentGroupRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
2632    /// let x = UpdateDeploymentGroupRequest::new().set_or_clear_update_mask(None::<FieldMask>);
2633    /// ```
2634    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2635    where
2636        T: std::convert::Into<wkt::FieldMask>,
2637    {
2638        self.update_mask = v.map(|x| x.into());
2639        self
2640    }
2641
2642    /// Sets the value of [deployment_group][crate::model::UpdateDeploymentGroupRequest::deployment_group].
2643    ///
2644    /// # Example
2645    /// ```ignore,no_run
2646    /// # use google_cloud_config_v1::model::UpdateDeploymentGroupRequest;
2647    /// use google_cloud_config_v1::model::DeploymentGroup;
2648    /// let x = UpdateDeploymentGroupRequest::new().set_deployment_group(DeploymentGroup::default()/* use setters */);
2649    /// ```
2650    pub fn set_deployment_group<T>(mut self, v: T) -> Self
2651    where
2652        T: std::convert::Into<crate::model::DeploymentGroup>,
2653    {
2654        self.deployment_group = std::option::Option::Some(v.into());
2655        self
2656    }
2657
2658    /// Sets or clears the value of [deployment_group][crate::model::UpdateDeploymentGroupRequest::deployment_group].
2659    ///
2660    /// # Example
2661    /// ```ignore,no_run
2662    /// # use google_cloud_config_v1::model::UpdateDeploymentGroupRequest;
2663    /// use google_cloud_config_v1::model::DeploymentGroup;
2664    /// let x = UpdateDeploymentGroupRequest::new().set_or_clear_deployment_group(Some(DeploymentGroup::default()/* use setters */));
2665    /// let x = UpdateDeploymentGroupRequest::new().set_or_clear_deployment_group(None::<DeploymentGroup>);
2666    /// ```
2667    pub fn set_or_clear_deployment_group<T>(mut self, v: std::option::Option<T>) -> Self
2668    where
2669        T: std::convert::Into<crate::model::DeploymentGroup>,
2670    {
2671        self.deployment_group = v.map(|x| x.into());
2672        self
2673    }
2674
2675    /// Sets the value of [request_id][crate::model::UpdateDeploymentGroupRequest::request_id].
2676    ///
2677    /// # Example
2678    /// ```ignore,no_run
2679    /// # use google_cloud_config_v1::model::UpdateDeploymentGroupRequest;
2680    /// let x = UpdateDeploymentGroupRequest::new().set_request_id("example");
2681    /// ```
2682    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2683        self.request_id = v.into();
2684        self
2685    }
2686}
2687
2688impl wkt::message::Message for UpdateDeploymentGroupRequest {
2689    fn typename() -> &'static str {
2690        "type.googleapis.com/google.cloud.config.v1.UpdateDeploymentGroupRequest"
2691    }
2692}
2693
2694/// Request message for Delete DeploymentGroup
2695#[derive(Clone, Default, PartialEq)]
2696#[non_exhaustive]
2697pub struct DeleteDeploymentGroupRequest {
2698    /// Required. The name of DeploymentGroup in the format
2699    /// projects/{project_id}/locations/{location_id}/deploymentGroups/{deploymentGroup}
2700    pub name: std::string::String,
2701
2702    /// Optional. An optional request ID to identify requests. Specify a unique
2703    /// request ID so that if you must retry your request, the server will know to
2704    /// ignore the request if it has already been completed. The server will
2705    /// guarantee that for at least 60 minutes after the first request.
2706    ///
2707    /// For example, consider a situation where you make an initial request and the
2708    /// request times out. If you make the request again with the same request ID,
2709    /// the server can check if original operation with the same request ID was
2710    /// received, and if so, will ignore the second request. This prevents clients
2711    /// from accidentally creating duplicate commitments.
2712    ///
2713    /// The request ID must be a valid UUID with the exception that zero UUID is
2714    /// not supported (00000000-0000-0000-0000-000000000000).
2715    pub request_id: std::string::String,
2716
2717    /// Optional. If set to true, any revisions for this deployment group will also
2718    /// be deleted. (Otherwise, the request will only work if the deployment group
2719    /// has no revisions.)
2720    pub force: bool,
2721
2722    /// Optional. Policy on how to handle referenced deployments when deleting the
2723    /// DeploymentGroup.
2724    /// If unspecified, the default behavior is to fail the deletion if any
2725    /// deployments currently referenced in the `deployment_units` of the
2726    /// DeploymentGroup or in the latest revision are not deleted.
2727    pub deployment_reference_policy:
2728        crate::model::delete_deployment_group_request::DeploymentReferencePolicy,
2729
2730    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2731}
2732
2733impl DeleteDeploymentGroupRequest {
2734    /// Creates a new default instance.
2735    pub fn new() -> Self {
2736        std::default::Default::default()
2737    }
2738
2739    /// Sets the value of [name][crate::model::DeleteDeploymentGroupRequest::name].
2740    ///
2741    /// # Example
2742    /// ```ignore,no_run
2743    /// # use google_cloud_config_v1::model::DeleteDeploymentGroupRequest;
2744    /// # let project_id = "project_id";
2745    /// # let location_id = "location_id";
2746    /// # let deployment_group_id = "deployment_group_id";
2747    /// let x = DeleteDeploymentGroupRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/deploymentGroups/{deployment_group_id}"));
2748    /// ```
2749    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2750        self.name = v.into();
2751        self
2752    }
2753
2754    /// Sets the value of [request_id][crate::model::DeleteDeploymentGroupRequest::request_id].
2755    ///
2756    /// # Example
2757    /// ```ignore,no_run
2758    /// # use google_cloud_config_v1::model::DeleteDeploymentGroupRequest;
2759    /// let x = DeleteDeploymentGroupRequest::new().set_request_id("example");
2760    /// ```
2761    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2762        self.request_id = v.into();
2763        self
2764    }
2765
2766    /// Sets the value of [force][crate::model::DeleteDeploymentGroupRequest::force].
2767    ///
2768    /// # Example
2769    /// ```ignore,no_run
2770    /// # use google_cloud_config_v1::model::DeleteDeploymentGroupRequest;
2771    /// let x = DeleteDeploymentGroupRequest::new().set_force(true);
2772    /// ```
2773    pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2774        self.force = v.into();
2775        self
2776    }
2777
2778    /// Sets the value of [deployment_reference_policy][crate::model::DeleteDeploymentGroupRequest::deployment_reference_policy].
2779    ///
2780    /// # Example
2781    /// ```ignore,no_run
2782    /// # use google_cloud_config_v1::model::DeleteDeploymentGroupRequest;
2783    /// use google_cloud_config_v1::model::delete_deployment_group_request::DeploymentReferencePolicy;
2784    /// let x0 = DeleteDeploymentGroupRequest::new().set_deployment_reference_policy(DeploymentReferencePolicy::FailIfAnyReferencesExist);
2785    /// let x1 = DeleteDeploymentGroupRequest::new().set_deployment_reference_policy(DeploymentReferencePolicy::FailIfMetadataReferencesExist);
2786    /// let x2 = DeleteDeploymentGroupRequest::new().set_deployment_reference_policy(DeploymentReferencePolicy::IgnoreDeploymentReferences);
2787    /// ```
2788    pub fn set_deployment_reference_policy<
2789        T: std::convert::Into<
2790                crate::model::delete_deployment_group_request::DeploymentReferencePolicy,
2791            >,
2792    >(
2793        mut self,
2794        v: T,
2795    ) -> Self {
2796        self.deployment_reference_policy = v.into();
2797        self
2798    }
2799}
2800
2801impl wkt::message::Message for DeleteDeploymentGroupRequest {
2802    fn typename() -> &'static str {
2803        "type.googleapis.com/google.cloud.config.v1.DeleteDeploymentGroupRequest"
2804    }
2805}
2806
2807/// Defines additional types related to [DeleteDeploymentGroupRequest].
2808pub mod delete_deployment_group_request {
2809    #[allow(unused_imports)]
2810    use super::*;
2811
2812    /// Policy on how to handle referenced deployments when deleting the
2813    /// DeploymentGroup.
2814    ///
2815    /// # Working with unknown values
2816    ///
2817    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2818    /// additional enum variants at any time. Adding new variants is not considered
2819    /// a breaking change. Applications should write their code in anticipation of:
2820    ///
2821    /// - New values appearing in future releases of the client library, **and**
2822    /// - New values received dynamically, without application changes.
2823    ///
2824    /// Please consult the [Working with enums] section in the user guide for some
2825    /// guidelines.
2826    ///
2827    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
2828    #[derive(Clone, Debug, PartialEq)]
2829    #[non_exhaustive]
2830    pub enum DeploymentReferencePolicy {
2831        /// The default behavior. If unspecified, the system will act as if
2832        /// `FAIL_IF_ANY_REFERENCES_EXIST` is specified.
2833        Unspecified,
2834        /// Fail the deletion if any deployments currently referenced in the
2835        /// `deployment_units` of the DeploymentGroup or in the latest revision
2836        /// are not deleted.
2837        FailIfAnyReferencesExist,
2838        /// Fail the deletion only if any deployments currently referenced in the
2839        /// `deployment_units` of the DeploymentGroup are not deleted.
2840        /// The deletion will proceed even if the deployments in the latest revision
2841        /// of the DeploymentGroup are not deleted.
2842        FailIfMetadataReferencesExist,
2843        /// Ignore any deployments currently referenced in the
2844        /// `deployment_units` of the DeploymentGroup or in the latest revision.
2845        IgnoreDeploymentReferences,
2846        /// If set, the enum was initialized with an unknown value.
2847        ///
2848        /// Applications can examine the value using [DeploymentReferencePolicy::value] or
2849        /// [DeploymentReferencePolicy::name].
2850        UnknownValue(deployment_reference_policy::UnknownValue),
2851    }
2852
2853    #[doc(hidden)]
2854    pub mod deployment_reference_policy {
2855        #[allow(unused_imports)]
2856        use super::*;
2857        #[derive(Clone, Debug, PartialEq)]
2858        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2859    }
2860
2861    impl DeploymentReferencePolicy {
2862        /// Gets the enum value.
2863        ///
2864        /// Returns `None` if the enum contains an unknown value deserialized from
2865        /// the string representation of enums.
2866        pub fn value(&self) -> std::option::Option<i32> {
2867            match self {
2868                Self::Unspecified => std::option::Option::Some(0),
2869                Self::FailIfAnyReferencesExist => std::option::Option::Some(1),
2870                Self::FailIfMetadataReferencesExist => std::option::Option::Some(2),
2871                Self::IgnoreDeploymentReferences => std::option::Option::Some(3),
2872                Self::UnknownValue(u) => u.0.value(),
2873            }
2874        }
2875
2876        /// Gets the enum value as a string.
2877        ///
2878        /// Returns `None` if the enum contains an unknown value deserialized from
2879        /// the integer representation of enums.
2880        pub fn name(&self) -> std::option::Option<&str> {
2881            match self {
2882                Self::Unspecified => {
2883                    std::option::Option::Some("DEPLOYMENT_REFERENCE_POLICY_UNSPECIFIED")
2884                }
2885                Self::FailIfAnyReferencesExist => {
2886                    std::option::Option::Some("FAIL_IF_ANY_REFERENCES_EXIST")
2887                }
2888                Self::FailIfMetadataReferencesExist => {
2889                    std::option::Option::Some("FAIL_IF_METADATA_REFERENCES_EXIST")
2890                }
2891                Self::IgnoreDeploymentReferences => {
2892                    std::option::Option::Some("IGNORE_DEPLOYMENT_REFERENCES")
2893                }
2894                Self::UnknownValue(u) => u.0.name(),
2895            }
2896        }
2897    }
2898
2899    impl std::default::Default for DeploymentReferencePolicy {
2900        fn default() -> Self {
2901            use std::convert::From;
2902            Self::from(0)
2903        }
2904    }
2905
2906    impl std::fmt::Display for DeploymentReferencePolicy {
2907        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2908            wkt::internal::display_enum(f, self.name(), self.value())
2909        }
2910    }
2911
2912    impl std::convert::From<i32> for DeploymentReferencePolicy {
2913        fn from(value: i32) -> Self {
2914            match value {
2915                0 => Self::Unspecified,
2916                1 => Self::FailIfAnyReferencesExist,
2917                2 => Self::FailIfMetadataReferencesExist,
2918                3 => Self::IgnoreDeploymentReferences,
2919                _ => Self::UnknownValue(deployment_reference_policy::UnknownValue(
2920                    wkt::internal::UnknownEnumValue::Integer(value),
2921                )),
2922            }
2923        }
2924    }
2925
2926    impl std::convert::From<&str> for DeploymentReferencePolicy {
2927        fn from(value: &str) -> Self {
2928            use std::string::ToString;
2929            match value {
2930                "DEPLOYMENT_REFERENCE_POLICY_UNSPECIFIED" => Self::Unspecified,
2931                "FAIL_IF_ANY_REFERENCES_EXIST" => Self::FailIfAnyReferencesExist,
2932                "FAIL_IF_METADATA_REFERENCES_EXIST" => Self::FailIfMetadataReferencesExist,
2933                "IGNORE_DEPLOYMENT_REFERENCES" => Self::IgnoreDeploymentReferences,
2934                _ => Self::UnknownValue(deployment_reference_policy::UnknownValue(
2935                    wkt::internal::UnknownEnumValue::String(value.to_string()),
2936                )),
2937            }
2938        }
2939    }
2940
2941    impl serde::ser::Serialize for DeploymentReferencePolicy {
2942        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2943        where
2944            S: serde::Serializer,
2945        {
2946            match self {
2947                Self::Unspecified => serializer.serialize_i32(0),
2948                Self::FailIfAnyReferencesExist => serializer.serialize_i32(1),
2949                Self::FailIfMetadataReferencesExist => serializer.serialize_i32(2),
2950                Self::IgnoreDeploymentReferences => serializer.serialize_i32(3),
2951                Self::UnknownValue(u) => u.0.serialize(serializer),
2952            }
2953        }
2954    }
2955
2956    impl<'de> serde::de::Deserialize<'de> for DeploymentReferencePolicy {
2957        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2958        where
2959            D: serde::Deserializer<'de>,
2960        {
2961            deserializer.deserialize_any(wkt::internal::EnumVisitor::<DeploymentReferencePolicy>::new(
2962                ".google.cloud.config.v1.DeleteDeploymentGroupRequest.DeploymentReferencePolicy"))
2963        }
2964    }
2965}
2966
2967#[allow(missing_docs)]
2968#[derive(Clone, Default, PartialEq)]
2969#[non_exhaustive]
2970pub struct UpdateDeploymentRequest {
2971    /// Optional. Field mask used to specify the fields to be overwritten in the
2972    /// Deployment resource by the update.
2973    ///
2974    /// The fields specified in the update_mask are relative to the resource, not
2975    /// the full request. A field will be overwritten if it is in the mask. If the
2976    /// user does not provide a mask then all fields will be overwritten.
2977    pub update_mask: std::option::Option<wkt::FieldMask>,
2978
2979    /// Required. [Deployment][google.cloud.config.v1.Deployment] to update.
2980    ///
2981    /// The deployment's `name` field is used to identify the resource to be
2982    /// updated. Format:
2983    /// `projects/{project}/locations/{location}/deployments/{deployment}`
2984    ///
2985    /// [google.cloud.config.v1.Deployment]: crate::model::Deployment
2986    pub deployment: std::option::Option<crate::model::Deployment>,
2987
2988    /// Optional. An optional request ID to identify requests. Specify a unique
2989    /// request ID so that if you must retry your request, the server will know to
2990    /// ignore the request if it has already been completed. The server will
2991    /// guarantee that for at least 60 minutes since the first request.
2992    ///
2993    /// For example, consider a situation where you make an initial request and the
2994    /// request times out. If you make the request again with the same request ID,
2995    /// the server can check if original operation with the same request ID was
2996    /// received, and if so, will ignore the second request. This prevents clients
2997    /// from accidentally creating duplicate commitments.
2998    ///
2999    /// The request ID must be a valid UUID with the exception that zero UUID is
3000    /// not supported (00000000-0000-0000-0000-000000000000).
3001    pub request_id: std::string::String,
3002
3003    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3004}
3005
3006impl UpdateDeploymentRequest {
3007    /// Creates a new default instance.
3008    pub fn new() -> Self {
3009        std::default::Default::default()
3010    }
3011
3012    /// Sets the value of [update_mask][crate::model::UpdateDeploymentRequest::update_mask].
3013    ///
3014    /// # Example
3015    /// ```ignore,no_run
3016    /// # use google_cloud_config_v1::model::UpdateDeploymentRequest;
3017    /// use wkt::FieldMask;
3018    /// let x = UpdateDeploymentRequest::new().set_update_mask(FieldMask::default()/* use setters */);
3019    /// ```
3020    pub fn set_update_mask<T>(mut self, v: T) -> Self
3021    where
3022        T: std::convert::Into<wkt::FieldMask>,
3023    {
3024        self.update_mask = std::option::Option::Some(v.into());
3025        self
3026    }
3027
3028    /// Sets or clears the value of [update_mask][crate::model::UpdateDeploymentRequest::update_mask].
3029    ///
3030    /// # Example
3031    /// ```ignore,no_run
3032    /// # use google_cloud_config_v1::model::UpdateDeploymentRequest;
3033    /// use wkt::FieldMask;
3034    /// let x = UpdateDeploymentRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
3035    /// let x = UpdateDeploymentRequest::new().set_or_clear_update_mask(None::<FieldMask>);
3036    /// ```
3037    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3038    where
3039        T: std::convert::Into<wkt::FieldMask>,
3040    {
3041        self.update_mask = v.map(|x| x.into());
3042        self
3043    }
3044
3045    /// Sets the value of [deployment][crate::model::UpdateDeploymentRequest::deployment].
3046    ///
3047    /// # Example
3048    /// ```ignore,no_run
3049    /// # use google_cloud_config_v1::model::UpdateDeploymentRequest;
3050    /// use google_cloud_config_v1::model::Deployment;
3051    /// let x = UpdateDeploymentRequest::new().set_deployment(Deployment::default()/* use setters */);
3052    /// ```
3053    pub fn set_deployment<T>(mut self, v: T) -> Self
3054    where
3055        T: std::convert::Into<crate::model::Deployment>,
3056    {
3057        self.deployment = std::option::Option::Some(v.into());
3058        self
3059    }
3060
3061    /// Sets or clears the value of [deployment][crate::model::UpdateDeploymentRequest::deployment].
3062    ///
3063    /// # Example
3064    /// ```ignore,no_run
3065    /// # use google_cloud_config_v1::model::UpdateDeploymentRequest;
3066    /// use google_cloud_config_v1::model::Deployment;
3067    /// let x = UpdateDeploymentRequest::new().set_or_clear_deployment(Some(Deployment::default()/* use setters */));
3068    /// let x = UpdateDeploymentRequest::new().set_or_clear_deployment(None::<Deployment>);
3069    /// ```
3070    pub fn set_or_clear_deployment<T>(mut self, v: std::option::Option<T>) -> Self
3071    where
3072        T: std::convert::Into<crate::model::Deployment>,
3073    {
3074        self.deployment = v.map(|x| x.into());
3075        self
3076    }
3077
3078    /// Sets the value of [request_id][crate::model::UpdateDeploymentRequest::request_id].
3079    ///
3080    /// # Example
3081    /// ```ignore,no_run
3082    /// # use google_cloud_config_v1::model::UpdateDeploymentRequest;
3083    /// let x = UpdateDeploymentRequest::new().set_request_id("example");
3084    /// ```
3085    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3086        self.request_id = v.into();
3087        self
3088    }
3089}
3090
3091impl wkt::message::Message for UpdateDeploymentRequest {
3092    fn typename() -> &'static str {
3093        "type.googleapis.com/google.cloud.config.v1.UpdateDeploymentRequest"
3094    }
3095}
3096
3097#[allow(missing_docs)]
3098#[derive(Clone, Default, PartialEq)]
3099#[non_exhaustive]
3100pub struct DeleteDeploymentRequest {
3101    /// Required. The name of the Deployment in the format:
3102    /// 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
3103    pub name: std::string::String,
3104
3105    /// Optional. An optional request ID to identify requests. Specify a unique
3106    /// request ID so that if you must retry your request, the server will know to
3107    /// ignore the request if it has already been completed. The server will
3108    /// guarantee that for at least 60 minutes after the first request.
3109    ///
3110    /// For example, consider a situation where you make an initial request and the
3111    /// request times out. If you make the request again with the same request ID,
3112    /// the server can check if original operation with the same request ID was
3113    /// received, and if so, will ignore the second request. This prevents clients
3114    /// from accidentally creating duplicate commitments.
3115    ///
3116    /// The request ID must be a valid UUID with the exception that zero UUID is
3117    /// not supported (00000000-0000-0000-0000-000000000000).
3118    pub request_id: std::string::String,
3119
3120    /// Optional. If set to true, any revisions for this deployment will also be
3121    /// deleted. (Otherwise, the request will only work if the deployment has no
3122    /// revisions.)
3123    pub force: bool,
3124
3125    /// Optional. Policy on how resources actuated by the deployment should be
3126    /// deleted. If unspecified, the default behavior is to delete the underlying
3127    /// resources.
3128    pub delete_policy: crate::model::delete_deployment_request::DeletePolicy,
3129
3130    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3131}
3132
3133impl DeleteDeploymentRequest {
3134    /// Creates a new default instance.
3135    pub fn new() -> Self {
3136        std::default::Default::default()
3137    }
3138
3139    /// Sets the value of [name][crate::model::DeleteDeploymentRequest::name].
3140    ///
3141    /// # Example
3142    /// ```ignore,no_run
3143    /// # use google_cloud_config_v1::model::DeleteDeploymentRequest;
3144    /// # let project_id = "project_id";
3145    /// # let location_id = "location_id";
3146    /// # let deployment_id = "deployment_id";
3147    /// let x = DeleteDeploymentRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/deployments/{deployment_id}"));
3148    /// ```
3149    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3150        self.name = v.into();
3151        self
3152    }
3153
3154    /// Sets the value of [request_id][crate::model::DeleteDeploymentRequest::request_id].
3155    ///
3156    /// # Example
3157    /// ```ignore,no_run
3158    /// # use google_cloud_config_v1::model::DeleteDeploymentRequest;
3159    /// let x = DeleteDeploymentRequest::new().set_request_id("example");
3160    /// ```
3161    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3162        self.request_id = v.into();
3163        self
3164    }
3165
3166    /// Sets the value of [force][crate::model::DeleteDeploymentRequest::force].
3167    ///
3168    /// # Example
3169    /// ```ignore,no_run
3170    /// # use google_cloud_config_v1::model::DeleteDeploymentRequest;
3171    /// let x = DeleteDeploymentRequest::new().set_force(true);
3172    /// ```
3173    pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3174        self.force = v.into();
3175        self
3176    }
3177
3178    /// Sets the value of [delete_policy][crate::model::DeleteDeploymentRequest::delete_policy].
3179    ///
3180    /// # Example
3181    /// ```ignore,no_run
3182    /// # use google_cloud_config_v1::model::DeleteDeploymentRequest;
3183    /// use google_cloud_config_v1::model::delete_deployment_request::DeletePolicy;
3184    /// let x0 = DeleteDeploymentRequest::new().set_delete_policy(DeletePolicy::Delete);
3185    /// let x1 = DeleteDeploymentRequest::new().set_delete_policy(DeletePolicy::Abandon);
3186    /// ```
3187    pub fn set_delete_policy<
3188        T: std::convert::Into<crate::model::delete_deployment_request::DeletePolicy>,
3189    >(
3190        mut self,
3191        v: T,
3192    ) -> Self {
3193        self.delete_policy = v.into();
3194        self
3195    }
3196}
3197
3198impl wkt::message::Message for DeleteDeploymentRequest {
3199    fn typename() -> &'static str {
3200        "type.googleapis.com/google.cloud.config.v1.DeleteDeploymentRequest"
3201    }
3202}
3203
3204/// Defines additional types related to [DeleteDeploymentRequest].
3205pub mod delete_deployment_request {
3206    #[allow(unused_imports)]
3207    use super::*;
3208
3209    /// Policy on how resources actuated by the deployment should be deleted.
3210    ///
3211    /// # Working with unknown values
3212    ///
3213    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3214    /// additional enum variants at any time. Adding new variants is not considered
3215    /// a breaking change. Applications should write their code in anticipation of:
3216    ///
3217    /// - New values appearing in future releases of the client library, **and**
3218    /// - New values received dynamically, without application changes.
3219    ///
3220    /// Please consult the [Working with enums] section in the user guide for some
3221    /// guidelines.
3222    ///
3223    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
3224    #[derive(Clone, Debug, PartialEq)]
3225    #[non_exhaustive]
3226    pub enum DeletePolicy {
3227        /// Unspecified policy, resources will be deleted.
3228        Unspecified,
3229        /// Deletes resources actuated by the deployment.
3230        Delete,
3231        /// Abandons resources and only deletes the deployment and its metadata.
3232        Abandon,
3233        /// If set, the enum was initialized with an unknown value.
3234        ///
3235        /// Applications can examine the value using [DeletePolicy::value] or
3236        /// [DeletePolicy::name].
3237        UnknownValue(delete_policy::UnknownValue),
3238    }
3239
3240    #[doc(hidden)]
3241    pub mod delete_policy {
3242        #[allow(unused_imports)]
3243        use super::*;
3244        #[derive(Clone, Debug, PartialEq)]
3245        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3246    }
3247
3248    impl DeletePolicy {
3249        /// Gets the enum value.
3250        ///
3251        /// Returns `None` if the enum contains an unknown value deserialized from
3252        /// the string representation of enums.
3253        pub fn value(&self) -> std::option::Option<i32> {
3254            match self {
3255                Self::Unspecified => std::option::Option::Some(0),
3256                Self::Delete => std::option::Option::Some(1),
3257                Self::Abandon => std::option::Option::Some(2),
3258                Self::UnknownValue(u) => u.0.value(),
3259            }
3260        }
3261
3262        /// Gets the enum value as a string.
3263        ///
3264        /// Returns `None` if the enum contains an unknown value deserialized from
3265        /// the integer representation of enums.
3266        pub fn name(&self) -> std::option::Option<&str> {
3267            match self {
3268                Self::Unspecified => std::option::Option::Some("DELETE_POLICY_UNSPECIFIED"),
3269                Self::Delete => std::option::Option::Some("DELETE"),
3270                Self::Abandon => std::option::Option::Some("ABANDON"),
3271                Self::UnknownValue(u) => u.0.name(),
3272            }
3273        }
3274    }
3275
3276    impl std::default::Default for DeletePolicy {
3277        fn default() -> Self {
3278            use std::convert::From;
3279            Self::from(0)
3280        }
3281    }
3282
3283    impl std::fmt::Display for DeletePolicy {
3284        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3285            wkt::internal::display_enum(f, self.name(), self.value())
3286        }
3287    }
3288
3289    impl std::convert::From<i32> for DeletePolicy {
3290        fn from(value: i32) -> Self {
3291            match value {
3292                0 => Self::Unspecified,
3293                1 => Self::Delete,
3294                2 => Self::Abandon,
3295                _ => Self::UnknownValue(delete_policy::UnknownValue(
3296                    wkt::internal::UnknownEnumValue::Integer(value),
3297                )),
3298            }
3299        }
3300    }
3301
3302    impl std::convert::From<&str> for DeletePolicy {
3303        fn from(value: &str) -> Self {
3304            use std::string::ToString;
3305            match value {
3306                "DELETE_POLICY_UNSPECIFIED" => Self::Unspecified,
3307                "DELETE" => Self::Delete,
3308                "ABANDON" => Self::Abandon,
3309                _ => Self::UnknownValue(delete_policy::UnknownValue(
3310                    wkt::internal::UnknownEnumValue::String(value.to_string()),
3311                )),
3312            }
3313        }
3314    }
3315
3316    impl serde::ser::Serialize for DeletePolicy {
3317        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3318        where
3319            S: serde::Serializer,
3320        {
3321            match self {
3322                Self::Unspecified => serializer.serialize_i32(0),
3323                Self::Delete => serializer.serialize_i32(1),
3324                Self::Abandon => serializer.serialize_i32(2),
3325                Self::UnknownValue(u) => u.0.serialize(serializer),
3326            }
3327        }
3328    }
3329
3330    impl<'de> serde::de::Deserialize<'de> for DeletePolicy {
3331        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3332        where
3333            D: serde::Deserializer<'de>,
3334        {
3335            deserializer.deserialize_any(wkt::internal::EnumVisitor::<DeletePolicy>::new(
3336                ".google.cloud.config.v1.DeleteDeploymentRequest.DeletePolicy",
3337            ))
3338        }
3339    }
3340}
3341
3342/// Represents the metadata of the long-running operation.
3343#[derive(Clone, Default, PartialEq)]
3344#[non_exhaustive]
3345pub struct OperationMetadata {
3346    /// Output only. Time when the operation was created.
3347    pub create_time: std::option::Option<wkt::Timestamp>,
3348
3349    /// Output only. Time when the operation finished running.
3350    pub end_time: std::option::Option<wkt::Timestamp>,
3351
3352    /// Output only. Server-defined resource path for the target of the operation.
3353    pub target: std::string::String,
3354
3355    /// Output only. Name of the verb executed by the operation.
3356    pub verb: std::string::String,
3357
3358    /// Output only. Human-readable status of the operation, if any.
3359    pub status_message: std::string::String,
3360
3361    /// Output only. Identifies whether the user has requested cancellation of the
3362    /// operation. Operations that have successfully been cancelled have
3363    /// [google.longrunning.Operation.error][google.longrunning.Operation.error]
3364    /// value with a [google.rpc.Status.code][google.rpc.Status.code] of `1`,
3365    /// corresponding to `Code.CANCELLED`.
3366    ///
3367    /// [google.longrunning.Operation.error]: google_cloud_longrunning::model::Operation::result
3368    /// [google.rpc.Status.code]: google_cloud_rpc::model::Status::code
3369    pub requested_cancellation: bool,
3370
3371    /// Output only. API version used to start the operation.
3372    pub api_version: std::string::String,
3373
3374    /// Ephemeral metadata about the state of an operation for a particular
3375    /// resource.
3376    pub resource_metadata: std::option::Option<crate::model::operation_metadata::ResourceMetadata>,
3377
3378    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3379}
3380
3381impl OperationMetadata {
3382    /// Creates a new default instance.
3383    pub fn new() -> Self {
3384        std::default::Default::default()
3385    }
3386
3387    /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
3388    ///
3389    /// # Example
3390    /// ```ignore,no_run
3391    /// # use google_cloud_config_v1::model::OperationMetadata;
3392    /// use wkt::Timestamp;
3393    /// let x = OperationMetadata::new().set_create_time(Timestamp::default()/* use setters */);
3394    /// ```
3395    pub fn set_create_time<T>(mut self, v: T) -> Self
3396    where
3397        T: std::convert::Into<wkt::Timestamp>,
3398    {
3399        self.create_time = std::option::Option::Some(v.into());
3400        self
3401    }
3402
3403    /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
3404    ///
3405    /// # Example
3406    /// ```ignore,no_run
3407    /// # use google_cloud_config_v1::model::OperationMetadata;
3408    /// use wkt::Timestamp;
3409    /// let x = OperationMetadata::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
3410    /// let x = OperationMetadata::new().set_or_clear_create_time(None::<Timestamp>);
3411    /// ```
3412    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
3413    where
3414        T: std::convert::Into<wkt::Timestamp>,
3415    {
3416        self.create_time = v.map(|x| x.into());
3417        self
3418    }
3419
3420    /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
3421    ///
3422    /// # Example
3423    /// ```ignore,no_run
3424    /// # use google_cloud_config_v1::model::OperationMetadata;
3425    /// use wkt::Timestamp;
3426    /// let x = OperationMetadata::new().set_end_time(Timestamp::default()/* use setters */);
3427    /// ```
3428    pub fn set_end_time<T>(mut self, v: T) -> Self
3429    where
3430        T: std::convert::Into<wkt::Timestamp>,
3431    {
3432        self.end_time = std::option::Option::Some(v.into());
3433        self
3434    }
3435
3436    /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
3437    ///
3438    /// # Example
3439    /// ```ignore,no_run
3440    /// # use google_cloud_config_v1::model::OperationMetadata;
3441    /// use wkt::Timestamp;
3442    /// let x = OperationMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
3443    /// let x = OperationMetadata::new().set_or_clear_end_time(None::<Timestamp>);
3444    /// ```
3445    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
3446    where
3447        T: std::convert::Into<wkt::Timestamp>,
3448    {
3449        self.end_time = v.map(|x| x.into());
3450        self
3451    }
3452
3453    /// Sets the value of [target][crate::model::OperationMetadata::target].
3454    ///
3455    /// # Example
3456    /// ```ignore,no_run
3457    /// # use google_cloud_config_v1::model::OperationMetadata;
3458    /// let x = OperationMetadata::new().set_target("example");
3459    /// ```
3460    pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3461        self.target = v.into();
3462        self
3463    }
3464
3465    /// Sets the value of [verb][crate::model::OperationMetadata::verb].
3466    ///
3467    /// # Example
3468    /// ```ignore,no_run
3469    /// # use google_cloud_config_v1::model::OperationMetadata;
3470    /// let x = OperationMetadata::new().set_verb("example");
3471    /// ```
3472    pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3473        self.verb = v.into();
3474        self
3475    }
3476
3477    /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
3478    ///
3479    /// # Example
3480    /// ```ignore,no_run
3481    /// # use google_cloud_config_v1::model::OperationMetadata;
3482    /// let x = OperationMetadata::new().set_status_message("example");
3483    /// ```
3484    pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3485        self.status_message = v.into();
3486        self
3487    }
3488
3489    /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
3490    ///
3491    /// # Example
3492    /// ```ignore,no_run
3493    /// # use google_cloud_config_v1::model::OperationMetadata;
3494    /// let x = OperationMetadata::new().set_requested_cancellation(true);
3495    /// ```
3496    pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3497        self.requested_cancellation = v.into();
3498        self
3499    }
3500
3501    /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
3502    ///
3503    /// # Example
3504    /// ```ignore,no_run
3505    /// # use google_cloud_config_v1::model::OperationMetadata;
3506    /// let x = OperationMetadata::new().set_api_version("example");
3507    /// ```
3508    pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3509        self.api_version = v.into();
3510        self
3511    }
3512
3513    /// Sets the value of [resource_metadata][crate::model::OperationMetadata::resource_metadata].
3514    ///
3515    /// Note that all the setters affecting `resource_metadata` are mutually
3516    /// exclusive.
3517    ///
3518    /// # Example
3519    /// ```ignore,no_run
3520    /// # use google_cloud_config_v1::model::OperationMetadata;
3521    /// use google_cloud_config_v1::model::DeploymentOperationMetadata;
3522    /// let x = OperationMetadata::new().set_resource_metadata(Some(
3523    ///     google_cloud_config_v1::model::operation_metadata::ResourceMetadata::DeploymentMetadata(DeploymentOperationMetadata::default().into())));
3524    /// ```
3525    pub fn set_resource_metadata<
3526        T: std::convert::Into<std::option::Option<crate::model::operation_metadata::ResourceMetadata>>,
3527    >(
3528        mut self,
3529        v: T,
3530    ) -> Self {
3531        self.resource_metadata = v.into();
3532        self
3533    }
3534
3535    /// The value of [resource_metadata][crate::model::OperationMetadata::resource_metadata]
3536    /// if it holds a `DeploymentMetadata`, `None` if the field is not set or
3537    /// holds a different branch.
3538    pub fn deployment_metadata(
3539        &self,
3540    ) -> std::option::Option<&std::boxed::Box<crate::model::DeploymentOperationMetadata>> {
3541        #[allow(unreachable_patterns)]
3542        self.resource_metadata.as_ref().and_then(|v| match v {
3543            crate::model::operation_metadata::ResourceMetadata::DeploymentMetadata(v) => {
3544                std::option::Option::Some(v)
3545            }
3546            _ => std::option::Option::None,
3547        })
3548    }
3549
3550    /// Sets the value of [resource_metadata][crate::model::OperationMetadata::resource_metadata]
3551    /// to hold a `DeploymentMetadata`.
3552    ///
3553    /// Note that all the setters affecting `resource_metadata` are
3554    /// mutually exclusive.
3555    ///
3556    /// # Example
3557    /// ```ignore,no_run
3558    /// # use google_cloud_config_v1::model::OperationMetadata;
3559    /// use google_cloud_config_v1::model::DeploymentOperationMetadata;
3560    /// let x = OperationMetadata::new().set_deployment_metadata(DeploymentOperationMetadata::default()/* use setters */);
3561    /// assert!(x.deployment_metadata().is_some());
3562    /// assert!(x.preview_metadata().is_none());
3563    /// assert!(x.provision_deployment_group_metadata().is_none());
3564    /// ```
3565    pub fn set_deployment_metadata<
3566        T: std::convert::Into<std::boxed::Box<crate::model::DeploymentOperationMetadata>>,
3567    >(
3568        mut self,
3569        v: T,
3570    ) -> Self {
3571        self.resource_metadata = std::option::Option::Some(
3572            crate::model::operation_metadata::ResourceMetadata::DeploymentMetadata(v.into()),
3573        );
3574        self
3575    }
3576
3577    /// The value of [resource_metadata][crate::model::OperationMetadata::resource_metadata]
3578    /// if it holds a `PreviewMetadata`, `None` if the field is not set or
3579    /// holds a different branch.
3580    pub fn preview_metadata(
3581        &self,
3582    ) -> std::option::Option<&std::boxed::Box<crate::model::PreviewOperationMetadata>> {
3583        #[allow(unreachable_patterns)]
3584        self.resource_metadata.as_ref().and_then(|v| match v {
3585            crate::model::operation_metadata::ResourceMetadata::PreviewMetadata(v) => {
3586                std::option::Option::Some(v)
3587            }
3588            _ => std::option::Option::None,
3589        })
3590    }
3591
3592    /// Sets the value of [resource_metadata][crate::model::OperationMetadata::resource_metadata]
3593    /// to hold a `PreviewMetadata`.
3594    ///
3595    /// Note that all the setters affecting `resource_metadata` are
3596    /// mutually exclusive.
3597    ///
3598    /// # Example
3599    /// ```ignore,no_run
3600    /// # use google_cloud_config_v1::model::OperationMetadata;
3601    /// use google_cloud_config_v1::model::PreviewOperationMetadata;
3602    /// let x = OperationMetadata::new().set_preview_metadata(PreviewOperationMetadata::default()/* use setters */);
3603    /// assert!(x.preview_metadata().is_some());
3604    /// assert!(x.deployment_metadata().is_none());
3605    /// assert!(x.provision_deployment_group_metadata().is_none());
3606    /// ```
3607    pub fn set_preview_metadata<
3608        T: std::convert::Into<std::boxed::Box<crate::model::PreviewOperationMetadata>>,
3609    >(
3610        mut self,
3611        v: T,
3612    ) -> Self {
3613        self.resource_metadata = std::option::Option::Some(
3614            crate::model::operation_metadata::ResourceMetadata::PreviewMetadata(v.into()),
3615        );
3616        self
3617    }
3618
3619    /// The value of [resource_metadata][crate::model::OperationMetadata::resource_metadata]
3620    /// if it holds a `ProvisionDeploymentGroupMetadata`, `None` if the field is not set or
3621    /// holds a different branch.
3622    pub fn provision_deployment_group_metadata(
3623        &self,
3624    ) -> std::option::Option<
3625        &std::boxed::Box<crate::model::ProvisionDeploymentGroupOperationMetadata>,
3626    > {
3627        #[allow(unreachable_patterns)]
3628        self.resource_metadata.as_ref().and_then(|v| match v {
3629            crate::model::operation_metadata::ResourceMetadata::ProvisionDeploymentGroupMetadata(v) => std::option::Option::Some(v),
3630            _ => std::option::Option::None,
3631        })
3632    }
3633
3634    /// Sets the value of [resource_metadata][crate::model::OperationMetadata::resource_metadata]
3635    /// to hold a `ProvisionDeploymentGroupMetadata`.
3636    ///
3637    /// Note that all the setters affecting `resource_metadata` are
3638    /// mutually exclusive.
3639    ///
3640    /// # Example
3641    /// ```ignore,no_run
3642    /// # use google_cloud_config_v1::model::OperationMetadata;
3643    /// use google_cloud_config_v1::model::ProvisionDeploymentGroupOperationMetadata;
3644    /// let x = OperationMetadata::new().set_provision_deployment_group_metadata(ProvisionDeploymentGroupOperationMetadata::default()/* use setters */);
3645    /// assert!(x.provision_deployment_group_metadata().is_some());
3646    /// assert!(x.deployment_metadata().is_none());
3647    /// assert!(x.preview_metadata().is_none());
3648    /// ```
3649    pub fn set_provision_deployment_group_metadata<
3650        T: std::convert::Into<
3651                std::boxed::Box<crate::model::ProvisionDeploymentGroupOperationMetadata>,
3652            >,
3653    >(
3654        mut self,
3655        v: T,
3656    ) -> Self {
3657        self.resource_metadata = std::option::Option::Some(
3658            crate::model::operation_metadata::ResourceMetadata::ProvisionDeploymentGroupMetadata(
3659                v.into(),
3660            ),
3661        );
3662        self
3663    }
3664}
3665
3666impl wkt::message::Message for OperationMetadata {
3667    fn typename() -> &'static str {
3668        "type.googleapis.com/google.cloud.config.v1.OperationMetadata"
3669    }
3670}
3671
3672/// Defines additional types related to [OperationMetadata].
3673pub mod operation_metadata {
3674    #[allow(unused_imports)]
3675    use super::*;
3676
3677    /// Ephemeral metadata about the state of an operation for a particular
3678    /// resource.
3679    #[derive(Clone, Debug, PartialEq)]
3680    #[non_exhaustive]
3681    pub enum ResourceMetadata {
3682        /// Output only. Metadata about the deployment operation state.
3683        DeploymentMetadata(std::boxed::Box<crate::model::DeploymentOperationMetadata>),
3684        /// Output only. Metadata about the preview operation state.
3685        PreviewMetadata(std::boxed::Box<crate::model::PreviewOperationMetadata>),
3686        /// Output only. Metadata about ProvisionDeploymentGroup operation state.
3687        ProvisionDeploymentGroupMetadata(
3688            std::boxed::Box<crate::model::ProvisionDeploymentGroupOperationMetadata>,
3689        ),
3690    }
3691}
3692
3693/// A child resource of a Deployment generated by a 'CreateDeployment' or
3694/// 'UpdateDeployment' call. Each Revision contains metadata pertaining to a
3695/// snapshot of a particular Deployment.
3696#[derive(Clone, Default, PartialEq)]
3697#[non_exhaustive]
3698pub struct Revision {
3699    /// Revision name. Format:
3700    /// `projects/{project}/locations/{location}/deployments/{deployment}/
3701    /// revisions/{revision}`
3702    pub name: std::string::String,
3703
3704    /// Output only. Time when the revision was created.
3705    pub create_time: std::option::Option<wkt::Timestamp>,
3706
3707    /// Output only. Time when the revision was last modified.
3708    pub update_time: std::option::Option<wkt::Timestamp>,
3709
3710    /// Output only. The action which created this revision
3711    pub action: crate::model::revision::Action,
3712
3713    /// Output only. Current state of the revision.
3714    pub state: crate::model::revision::State,
3715
3716    /// Output only. Outputs and artifacts from applying a deployment.
3717    pub apply_results: std::option::Option<crate::model::ApplyResults>,
3718
3719    /// Output only. Additional info regarding the current state.
3720    pub state_detail: std::string::String,
3721
3722    /// Output only. Code describing any errors that may have occurred.
3723    pub error_code: crate::model::revision::ErrorCode,
3724
3725    /// Output only. Cloud Build instance UUID associated with this revision.
3726    pub build: std::string::String,
3727
3728    /// Output only. Location of Revision operation logs in
3729    /// `gs://{bucket}/{object}` format.
3730    pub logs: std::string::String,
3731
3732    /// Output only. Errors encountered when creating or updating this deployment.
3733    /// Errors are truncated to 10 entries, see `delete_results` and `error_logs`
3734    /// for full details.
3735    pub tf_errors: std::vec::Vec<crate::model::TerraformError>,
3736
3737    /// Output only. Location of Terraform error logs in Google Cloud Storage.
3738    /// Format: `gs://{bucket}/{object}`.
3739    pub error_logs: std::string::String,
3740
3741    /// Output only. User-specified Service Account (SA) to be used as credential
3742    /// to manage resources. Format:
3743    /// `projects/{projectID}/serviceAccounts/{serviceAccount}`
3744    pub service_account: std::string::String,
3745
3746    /// Output only. By default, Infra Manager will return a failure when
3747    /// Terraform encounters a 409 code (resource conflict error) during actuation.
3748    /// If this flag is set to true, Infra Manager will instead
3749    /// attempt to automatically import the resource into the Terraform state (for
3750    /// supported resource types) and continue actuation.
3751    ///
3752    /// Not all resource types are supported, refer to documentation.
3753    pub import_existing_resources: bool,
3754
3755    /// Output only. The user-specified Cloud Build worker pool resource in which
3756    /// the Cloud Build job will execute. Format:
3757    /// `projects/{project}/locations/{location}/workerPools/{workerPoolId}`.
3758    /// If this field is unspecified, the default Cloud Build worker pool will be
3759    /// used.
3760    pub worker_pool: std::string::String,
3761
3762    /// Output only. The user-specified Terraform version constraint.
3763    /// Example: "=1.3.10".
3764    pub tf_version_constraint: std::string::String,
3765
3766    /// Output only. The version of Terraform used to create the Revision.
3767    /// It is in the format of "Major.Minor.Patch", for example, "1.3.10".
3768    pub tf_version: std::string::String,
3769
3770    /// Output only. Cloud Storage path containing quota validation results. This
3771    /// field is set when a user sets Deployment.quota_validation field to ENABLED
3772    /// or ENFORCED. Format: `gs://{bucket}/{object}`.
3773    pub quota_validation_results: std::string::String,
3774
3775    /// Optional. Input to control quota checks for resources in terraform
3776    /// configuration files. There are limited resources on which quota validation
3777    /// applies.
3778    pub quota_validation: crate::model::QuotaValidation,
3779
3780    /// Output only. This field specifies the provider configurations.
3781    pub provider_config: std::option::Option<crate::model::ProviderConfig>,
3782
3783    /// Blueprint that was deployed.
3784    pub blueprint: std::option::Option<crate::model::revision::Blueprint>,
3785
3786    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3787}
3788
3789impl Revision {
3790    /// Creates a new default instance.
3791    pub fn new() -> Self {
3792        std::default::Default::default()
3793    }
3794
3795    /// Sets the value of [name][crate::model::Revision::name].
3796    ///
3797    /// # Example
3798    /// ```ignore,no_run
3799    /// # use google_cloud_config_v1::model::Revision;
3800    /// # let project_id = "project_id";
3801    /// # let location_id = "location_id";
3802    /// # let deployment_id = "deployment_id";
3803    /// # let revision_id = "revision_id";
3804    /// let x = Revision::new().set_name(format!("projects/{project_id}/locations/{location_id}/deployments/{deployment_id}/revisions/{revision_id}"));
3805    /// ```
3806    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3807        self.name = v.into();
3808        self
3809    }
3810
3811    /// Sets the value of [create_time][crate::model::Revision::create_time].
3812    ///
3813    /// # Example
3814    /// ```ignore,no_run
3815    /// # use google_cloud_config_v1::model::Revision;
3816    /// use wkt::Timestamp;
3817    /// let x = Revision::new().set_create_time(Timestamp::default()/* use setters */);
3818    /// ```
3819    pub fn set_create_time<T>(mut self, v: T) -> Self
3820    where
3821        T: std::convert::Into<wkt::Timestamp>,
3822    {
3823        self.create_time = std::option::Option::Some(v.into());
3824        self
3825    }
3826
3827    /// Sets or clears the value of [create_time][crate::model::Revision::create_time].
3828    ///
3829    /// # Example
3830    /// ```ignore,no_run
3831    /// # use google_cloud_config_v1::model::Revision;
3832    /// use wkt::Timestamp;
3833    /// let x = Revision::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
3834    /// let x = Revision::new().set_or_clear_create_time(None::<Timestamp>);
3835    /// ```
3836    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
3837    where
3838        T: std::convert::Into<wkt::Timestamp>,
3839    {
3840        self.create_time = v.map(|x| x.into());
3841        self
3842    }
3843
3844    /// Sets the value of [update_time][crate::model::Revision::update_time].
3845    ///
3846    /// # Example
3847    /// ```ignore,no_run
3848    /// # use google_cloud_config_v1::model::Revision;
3849    /// use wkt::Timestamp;
3850    /// let x = Revision::new().set_update_time(Timestamp::default()/* use setters */);
3851    /// ```
3852    pub fn set_update_time<T>(mut self, v: T) -> Self
3853    where
3854        T: std::convert::Into<wkt::Timestamp>,
3855    {
3856        self.update_time = std::option::Option::Some(v.into());
3857        self
3858    }
3859
3860    /// Sets or clears the value of [update_time][crate::model::Revision::update_time].
3861    ///
3862    /// # Example
3863    /// ```ignore,no_run
3864    /// # use google_cloud_config_v1::model::Revision;
3865    /// use wkt::Timestamp;
3866    /// let x = Revision::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
3867    /// let x = Revision::new().set_or_clear_update_time(None::<Timestamp>);
3868    /// ```
3869    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
3870    where
3871        T: std::convert::Into<wkt::Timestamp>,
3872    {
3873        self.update_time = v.map(|x| x.into());
3874        self
3875    }
3876
3877    /// Sets the value of [action][crate::model::Revision::action].
3878    ///
3879    /// # Example
3880    /// ```ignore,no_run
3881    /// # use google_cloud_config_v1::model::Revision;
3882    /// use google_cloud_config_v1::model::revision::Action;
3883    /// let x0 = Revision::new().set_action(Action::Create);
3884    /// let x1 = Revision::new().set_action(Action::Update);
3885    /// let x2 = Revision::new().set_action(Action::Delete);
3886    /// ```
3887    pub fn set_action<T: std::convert::Into<crate::model::revision::Action>>(
3888        mut self,
3889        v: T,
3890    ) -> Self {
3891        self.action = v.into();
3892        self
3893    }
3894
3895    /// Sets the value of [state][crate::model::Revision::state].
3896    ///
3897    /// # Example
3898    /// ```ignore,no_run
3899    /// # use google_cloud_config_v1::model::Revision;
3900    /// use google_cloud_config_v1::model::revision::State;
3901    /// let x0 = Revision::new().set_state(State::Applying);
3902    /// let x1 = Revision::new().set_state(State::Applied);
3903    /// let x2 = Revision::new().set_state(State::Failed);
3904    /// ```
3905    pub fn set_state<T: std::convert::Into<crate::model::revision::State>>(mut self, v: T) -> Self {
3906        self.state = v.into();
3907        self
3908    }
3909
3910    /// Sets the value of [apply_results][crate::model::Revision::apply_results].
3911    ///
3912    /// # Example
3913    /// ```ignore,no_run
3914    /// # use google_cloud_config_v1::model::Revision;
3915    /// use google_cloud_config_v1::model::ApplyResults;
3916    /// let x = Revision::new().set_apply_results(ApplyResults::default()/* use setters */);
3917    /// ```
3918    pub fn set_apply_results<T>(mut self, v: T) -> Self
3919    where
3920        T: std::convert::Into<crate::model::ApplyResults>,
3921    {
3922        self.apply_results = std::option::Option::Some(v.into());
3923        self
3924    }
3925
3926    /// Sets or clears the value of [apply_results][crate::model::Revision::apply_results].
3927    ///
3928    /// # Example
3929    /// ```ignore,no_run
3930    /// # use google_cloud_config_v1::model::Revision;
3931    /// use google_cloud_config_v1::model::ApplyResults;
3932    /// let x = Revision::new().set_or_clear_apply_results(Some(ApplyResults::default()/* use setters */));
3933    /// let x = Revision::new().set_or_clear_apply_results(None::<ApplyResults>);
3934    /// ```
3935    pub fn set_or_clear_apply_results<T>(mut self, v: std::option::Option<T>) -> Self
3936    where
3937        T: std::convert::Into<crate::model::ApplyResults>,
3938    {
3939        self.apply_results = v.map(|x| x.into());
3940        self
3941    }
3942
3943    /// Sets the value of [state_detail][crate::model::Revision::state_detail].
3944    ///
3945    /// # Example
3946    /// ```ignore,no_run
3947    /// # use google_cloud_config_v1::model::Revision;
3948    /// let x = Revision::new().set_state_detail("example");
3949    /// ```
3950    pub fn set_state_detail<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3951        self.state_detail = v.into();
3952        self
3953    }
3954
3955    /// Sets the value of [error_code][crate::model::Revision::error_code].
3956    ///
3957    /// # Example
3958    /// ```ignore,no_run
3959    /// # use google_cloud_config_v1::model::Revision;
3960    /// use google_cloud_config_v1::model::revision::ErrorCode;
3961    /// let x0 = Revision::new().set_error_code(ErrorCode::CloudBuildPermissionDenied);
3962    /// let x1 = Revision::new().set_error_code(ErrorCode::ApplyBuildApiFailed);
3963    /// let x2 = Revision::new().set_error_code(ErrorCode::ApplyBuildRunFailed);
3964    /// ```
3965    pub fn set_error_code<T: std::convert::Into<crate::model::revision::ErrorCode>>(
3966        mut self,
3967        v: T,
3968    ) -> Self {
3969        self.error_code = v.into();
3970        self
3971    }
3972
3973    /// Sets the value of [build][crate::model::Revision::build].
3974    ///
3975    /// # Example
3976    /// ```ignore,no_run
3977    /// # use google_cloud_config_v1::model::Revision;
3978    /// let x = Revision::new().set_build("example");
3979    /// ```
3980    pub fn set_build<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3981        self.build = v.into();
3982        self
3983    }
3984
3985    /// Sets the value of [logs][crate::model::Revision::logs].
3986    ///
3987    /// # Example
3988    /// ```ignore,no_run
3989    /// # use google_cloud_config_v1::model::Revision;
3990    /// let x = Revision::new().set_logs("example");
3991    /// ```
3992    pub fn set_logs<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3993        self.logs = v.into();
3994        self
3995    }
3996
3997    /// Sets the value of [tf_errors][crate::model::Revision::tf_errors].
3998    ///
3999    /// # Example
4000    /// ```ignore,no_run
4001    /// # use google_cloud_config_v1::model::Revision;
4002    /// use google_cloud_config_v1::model::TerraformError;
4003    /// let x = Revision::new()
4004    ///     .set_tf_errors([
4005    ///         TerraformError::default()/* use setters */,
4006    ///         TerraformError::default()/* use (different) setters */,
4007    ///     ]);
4008    /// ```
4009    pub fn set_tf_errors<T, V>(mut self, v: T) -> Self
4010    where
4011        T: std::iter::IntoIterator<Item = V>,
4012        V: std::convert::Into<crate::model::TerraformError>,
4013    {
4014        use std::iter::Iterator;
4015        self.tf_errors = v.into_iter().map(|i| i.into()).collect();
4016        self
4017    }
4018
4019    /// Sets the value of [error_logs][crate::model::Revision::error_logs].
4020    ///
4021    /// # Example
4022    /// ```ignore,no_run
4023    /// # use google_cloud_config_v1::model::Revision;
4024    /// let x = Revision::new().set_error_logs("example");
4025    /// ```
4026    pub fn set_error_logs<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4027        self.error_logs = v.into();
4028        self
4029    }
4030
4031    /// Sets the value of [service_account][crate::model::Revision::service_account].
4032    ///
4033    /// # Example
4034    /// ```ignore,no_run
4035    /// # use google_cloud_config_v1::model::Revision;
4036    /// let x = Revision::new().set_service_account("example");
4037    /// ```
4038    pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4039        self.service_account = v.into();
4040        self
4041    }
4042
4043    /// Sets the value of [import_existing_resources][crate::model::Revision::import_existing_resources].
4044    ///
4045    /// # Example
4046    /// ```ignore,no_run
4047    /// # use google_cloud_config_v1::model::Revision;
4048    /// let x = Revision::new().set_import_existing_resources(true);
4049    /// ```
4050    pub fn set_import_existing_resources<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4051        self.import_existing_resources = v.into();
4052        self
4053    }
4054
4055    /// Sets the value of [worker_pool][crate::model::Revision::worker_pool].
4056    ///
4057    /// # Example
4058    /// ```ignore,no_run
4059    /// # use google_cloud_config_v1::model::Revision;
4060    /// let x = Revision::new().set_worker_pool("example");
4061    /// ```
4062    pub fn set_worker_pool<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4063        self.worker_pool = v.into();
4064        self
4065    }
4066
4067    /// Sets the value of [tf_version_constraint][crate::model::Revision::tf_version_constraint].
4068    ///
4069    /// # Example
4070    /// ```ignore,no_run
4071    /// # use google_cloud_config_v1::model::Revision;
4072    /// let x = Revision::new().set_tf_version_constraint("example");
4073    /// ```
4074    pub fn set_tf_version_constraint<T: std::convert::Into<std::string::String>>(
4075        mut self,
4076        v: T,
4077    ) -> Self {
4078        self.tf_version_constraint = v.into();
4079        self
4080    }
4081
4082    /// Sets the value of [tf_version][crate::model::Revision::tf_version].
4083    ///
4084    /// # Example
4085    /// ```ignore,no_run
4086    /// # use google_cloud_config_v1::model::Revision;
4087    /// let x = Revision::new().set_tf_version("example");
4088    /// ```
4089    pub fn set_tf_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4090        self.tf_version = v.into();
4091        self
4092    }
4093
4094    /// Sets the value of [quota_validation_results][crate::model::Revision::quota_validation_results].
4095    ///
4096    /// # Example
4097    /// ```ignore,no_run
4098    /// # use google_cloud_config_v1::model::Revision;
4099    /// let x = Revision::new().set_quota_validation_results("example");
4100    /// ```
4101    pub fn set_quota_validation_results<T: std::convert::Into<std::string::String>>(
4102        mut self,
4103        v: T,
4104    ) -> Self {
4105        self.quota_validation_results = v.into();
4106        self
4107    }
4108
4109    /// Sets the value of [quota_validation][crate::model::Revision::quota_validation].
4110    ///
4111    /// # Example
4112    /// ```ignore,no_run
4113    /// # use google_cloud_config_v1::model::Revision;
4114    /// use google_cloud_config_v1::model::QuotaValidation;
4115    /// let x0 = Revision::new().set_quota_validation(QuotaValidation::Enabled);
4116    /// let x1 = Revision::new().set_quota_validation(QuotaValidation::Enforced);
4117    /// ```
4118    pub fn set_quota_validation<T: std::convert::Into<crate::model::QuotaValidation>>(
4119        mut self,
4120        v: T,
4121    ) -> Self {
4122        self.quota_validation = v.into();
4123        self
4124    }
4125
4126    /// Sets the value of [provider_config][crate::model::Revision::provider_config].
4127    ///
4128    /// # Example
4129    /// ```ignore,no_run
4130    /// # use google_cloud_config_v1::model::Revision;
4131    /// use google_cloud_config_v1::model::ProviderConfig;
4132    /// let x = Revision::new().set_provider_config(ProviderConfig::default()/* use setters */);
4133    /// ```
4134    pub fn set_provider_config<T>(mut self, v: T) -> Self
4135    where
4136        T: std::convert::Into<crate::model::ProviderConfig>,
4137    {
4138        self.provider_config = std::option::Option::Some(v.into());
4139        self
4140    }
4141
4142    /// Sets or clears the value of [provider_config][crate::model::Revision::provider_config].
4143    ///
4144    /// # Example
4145    /// ```ignore,no_run
4146    /// # use google_cloud_config_v1::model::Revision;
4147    /// use google_cloud_config_v1::model::ProviderConfig;
4148    /// let x = Revision::new().set_or_clear_provider_config(Some(ProviderConfig::default()/* use setters */));
4149    /// let x = Revision::new().set_or_clear_provider_config(None::<ProviderConfig>);
4150    /// ```
4151    pub fn set_or_clear_provider_config<T>(mut self, v: std::option::Option<T>) -> Self
4152    where
4153        T: std::convert::Into<crate::model::ProviderConfig>,
4154    {
4155        self.provider_config = v.map(|x| x.into());
4156        self
4157    }
4158
4159    /// Sets the value of [blueprint][crate::model::Revision::blueprint].
4160    ///
4161    /// Note that all the setters affecting `blueprint` are mutually
4162    /// exclusive.
4163    ///
4164    /// # Example
4165    /// ```ignore,no_run
4166    /// # use google_cloud_config_v1::model::Revision;
4167    /// use google_cloud_config_v1::model::TerraformBlueprint;
4168    /// let x = Revision::new().set_blueprint(Some(
4169    ///     google_cloud_config_v1::model::revision::Blueprint::TerraformBlueprint(TerraformBlueprint::default().into())));
4170    /// ```
4171    pub fn set_blueprint<
4172        T: std::convert::Into<std::option::Option<crate::model::revision::Blueprint>>,
4173    >(
4174        mut self,
4175        v: T,
4176    ) -> Self {
4177        self.blueprint = v.into();
4178        self
4179    }
4180
4181    /// The value of [blueprint][crate::model::Revision::blueprint]
4182    /// if it holds a `TerraformBlueprint`, `None` if the field is not set or
4183    /// holds a different branch.
4184    pub fn terraform_blueprint(
4185        &self,
4186    ) -> std::option::Option<&std::boxed::Box<crate::model::TerraformBlueprint>> {
4187        #[allow(unreachable_patterns)]
4188        self.blueprint.as_ref().and_then(|v| match v {
4189            crate::model::revision::Blueprint::TerraformBlueprint(v) => {
4190                std::option::Option::Some(v)
4191            }
4192            _ => std::option::Option::None,
4193        })
4194    }
4195
4196    /// Sets the value of [blueprint][crate::model::Revision::blueprint]
4197    /// to hold a `TerraformBlueprint`.
4198    ///
4199    /// Note that all the setters affecting `blueprint` are
4200    /// mutually exclusive.
4201    ///
4202    /// # Example
4203    /// ```ignore,no_run
4204    /// # use google_cloud_config_v1::model::Revision;
4205    /// use google_cloud_config_v1::model::TerraformBlueprint;
4206    /// let x = Revision::new().set_terraform_blueprint(TerraformBlueprint::default()/* use setters */);
4207    /// assert!(x.terraform_blueprint().is_some());
4208    /// ```
4209    pub fn set_terraform_blueprint<
4210        T: std::convert::Into<std::boxed::Box<crate::model::TerraformBlueprint>>,
4211    >(
4212        mut self,
4213        v: T,
4214    ) -> Self {
4215        self.blueprint = std::option::Option::Some(
4216            crate::model::revision::Blueprint::TerraformBlueprint(v.into()),
4217        );
4218        self
4219    }
4220}
4221
4222impl wkt::message::Message for Revision {
4223    fn typename() -> &'static str {
4224        "type.googleapis.com/google.cloud.config.v1.Revision"
4225    }
4226}
4227
4228/// Defines additional types related to [Revision].
4229pub mod revision {
4230    #[allow(unused_imports)]
4231    use super::*;
4232
4233    /// Actions that generate a revision.
4234    ///
4235    /// # Working with unknown values
4236    ///
4237    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4238    /// additional enum variants at any time. Adding new variants is not considered
4239    /// a breaking change. Applications should write their code in anticipation of:
4240    ///
4241    /// - New values appearing in future releases of the client library, **and**
4242    /// - New values received dynamically, without application changes.
4243    ///
4244    /// Please consult the [Working with enums] section in the user guide for some
4245    /// guidelines.
4246    ///
4247    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
4248    #[derive(Clone, Debug, PartialEq)]
4249    #[non_exhaustive]
4250    pub enum Action {
4251        /// The default value. This value is used if the action is omitted.
4252        Unspecified,
4253        /// The revision was generated by creating a deployment.
4254        Create,
4255        /// The revision was generated by updating a deployment.
4256        Update,
4257        /// The revision was deleted.
4258        Delete,
4259        /// If set, the enum was initialized with an unknown value.
4260        ///
4261        /// Applications can examine the value using [Action::value] or
4262        /// [Action::name].
4263        UnknownValue(action::UnknownValue),
4264    }
4265
4266    #[doc(hidden)]
4267    pub mod action {
4268        #[allow(unused_imports)]
4269        use super::*;
4270        #[derive(Clone, Debug, PartialEq)]
4271        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4272    }
4273
4274    impl Action {
4275        /// Gets the enum value.
4276        ///
4277        /// Returns `None` if the enum contains an unknown value deserialized from
4278        /// the string representation of enums.
4279        pub fn value(&self) -> std::option::Option<i32> {
4280            match self {
4281                Self::Unspecified => std::option::Option::Some(0),
4282                Self::Create => std::option::Option::Some(1),
4283                Self::Update => std::option::Option::Some(2),
4284                Self::Delete => std::option::Option::Some(3),
4285                Self::UnknownValue(u) => u.0.value(),
4286            }
4287        }
4288
4289        /// Gets the enum value as a string.
4290        ///
4291        /// Returns `None` if the enum contains an unknown value deserialized from
4292        /// the integer representation of enums.
4293        pub fn name(&self) -> std::option::Option<&str> {
4294            match self {
4295                Self::Unspecified => std::option::Option::Some("ACTION_UNSPECIFIED"),
4296                Self::Create => std::option::Option::Some("CREATE"),
4297                Self::Update => std::option::Option::Some("UPDATE"),
4298                Self::Delete => std::option::Option::Some("DELETE"),
4299                Self::UnknownValue(u) => u.0.name(),
4300            }
4301        }
4302    }
4303
4304    impl std::default::Default for Action {
4305        fn default() -> Self {
4306            use std::convert::From;
4307            Self::from(0)
4308        }
4309    }
4310
4311    impl std::fmt::Display for Action {
4312        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4313            wkt::internal::display_enum(f, self.name(), self.value())
4314        }
4315    }
4316
4317    impl std::convert::From<i32> for Action {
4318        fn from(value: i32) -> Self {
4319            match value {
4320                0 => Self::Unspecified,
4321                1 => Self::Create,
4322                2 => Self::Update,
4323                3 => Self::Delete,
4324                _ => Self::UnknownValue(action::UnknownValue(
4325                    wkt::internal::UnknownEnumValue::Integer(value),
4326                )),
4327            }
4328        }
4329    }
4330
4331    impl std::convert::From<&str> for Action {
4332        fn from(value: &str) -> Self {
4333            use std::string::ToString;
4334            match value {
4335                "ACTION_UNSPECIFIED" => Self::Unspecified,
4336                "CREATE" => Self::Create,
4337                "UPDATE" => Self::Update,
4338                "DELETE" => Self::Delete,
4339                _ => Self::UnknownValue(action::UnknownValue(
4340                    wkt::internal::UnknownEnumValue::String(value.to_string()),
4341                )),
4342            }
4343        }
4344    }
4345
4346    impl serde::ser::Serialize for Action {
4347        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4348        where
4349            S: serde::Serializer,
4350        {
4351            match self {
4352                Self::Unspecified => serializer.serialize_i32(0),
4353                Self::Create => serializer.serialize_i32(1),
4354                Self::Update => serializer.serialize_i32(2),
4355                Self::Delete => serializer.serialize_i32(3),
4356                Self::UnknownValue(u) => u.0.serialize(serializer),
4357            }
4358        }
4359    }
4360
4361    impl<'de> serde::de::Deserialize<'de> for Action {
4362        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4363        where
4364            D: serde::Deserializer<'de>,
4365        {
4366            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Action>::new(
4367                ".google.cloud.config.v1.Revision.Action",
4368            ))
4369        }
4370    }
4371
4372    /// Possible states of a revision.
4373    ///
4374    /// # Working with unknown values
4375    ///
4376    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4377    /// additional enum variants at any time. Adding new variants is not considered
4378    /// a breaking change. Applications should write their code in anticipation of:
4379    ///
4380    /// - New values appearing in future releases of the client library, **and**
4381    /// - New values received dynamically, without application changes.
4382    ///
4383    /// Please consult the [Working with enums] section in the user guide for some
4384    /// guidelines.
4385    ///
4386    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
4387    #[derive(Clone, Debug, PartialEq)]
4388    #[non_exhaustive]
4389    pub enum State {
4390        /// The default value. This value is used if the state is omitted.
4391        Unspecified,
4392        /// The revision is being applied.
4393        Applying,
4394        /// The revision was applied successfully.
4395        Applied,
4396        /// The revision could not be applied successfully.
4397        Failed,
4398        /// If set, the enum was initialized with an unknown value.
4399        ///
4400        /// Applications can examine the value using [State::value] or
4401        /// [State::name].
4402        UnknownValue(state::UnknownValue),
4403    }
4404
4405    #[doc(hidden)]
4406    pub mod state {
4407        #[allow(unused_imports)]
4408        use super::*;
4409        #[derive(Clone, Debug, PartialEq)]
4410        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4411    }
4412
4413    impl State {
4414        /// Gets the enum value.
4415        ///
4416        /// Returns `None` if the enum contains an unknown value deserialized from
4417        /// the string representation of enums.
4418        pub fn value(&self) -> std::option::Option<i32> {
4419            match self {
4420                Self::Unspecified => std::option::Option::Some(0),
4421                Self::Applying => std::option::Option::Some(1),
4422                Self::Applied => std::option::Option::Some(2),
4423                Self::Failed => std::option::Option::Some(3),
4424                Self::UnknownValue(u) => u.0.value(),
4425            }
4426        }
4427
4428        /// Gets the enum value as a string.
4429        ///
4430        /// Returns `None` if the enum contains an unknown value deserialized from
4431        /// the integer representation of enums.
4432        pub fn name(&self) -> std::option::Option<&str> {
4433            match self {
4434                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
4435                Self::Applying => std::option::Option::Some("APPLYING"),
4436                Self::Applied => std::option::Option::Some("APPLIED"),
4437                Self::Failed => std::option::Option::Some("FAILED"),
4438                Self::UnknownValue(u) => u.0.name(),
4439            }
4440        }
4441    }
4442
4443    impl std::default::Default for State {
4444        fn default() -> Self {
4445            use std::convert::From;
4446            Self::from(0)
4447        }
4448    }
4449
4450    impl std::fmt::Display for State {
4451        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4452            wkt::internal::display_enum(f, self.name(), self.value())
4453        }
4454    }
4455
4456    impl std::convert::From<i32> for State {
4457        fn from(value: i32) -> Self {
4458            match value {
4459                0 => Self::Unspecified,
4460                1 => Self::Applying,
4461                2 => Self::Applied,
4462                3 => Self::Failed,
4463                _ => Self::UnknownValue(state::UnknownValue(
4464                    wkt::internal::UnknownEnumValue::Integer(value),
4465                )),
4466            }
4467        }
4468    }
4469
4470    impl std::convert::From<&str> for State {
4471        fn from(value: &str) -> Self {
4472            use std::string::ToString;
4473            match value {
4474                "STATE_UNSPECIFIED" => Self::Unspecified,
4475                "APPLYING" => Self::Applying,
4476                "APPLIED" => Self::Applied,
4477                "FAILED" => Self::Failed,
4478                _ => Self::UnknownValue(state::UnknownValue(
4479                    wkt::internal::UnknownEnumValue::String(value.to_string()),
4480                )),
4481            }
4482        }
4483    }
4484
4485    impl serde::ser::Serialize for State {
4486        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4487        where
4488            S: serde::Serializer,
4489        {
4490            match self {
4491                Self::Unspecified => serializer.serialize_i32(0),
4492                Self::Applying => serializer.serialize_i32(1),
4493                Self::Applied => serializer.serialize_i32(2),
4494                Self::Failed => serializer.serialize_i32(3),
4495                Self::UnknownValue(u) => u.0.serialize(serializer),
4496            }
4497        }
4498    }
4499
4500    impl<'de> serde::de::Deserialize<'de> for State {
4501        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4502        where
4503            D: serde::Deserializer<'de>,
4504        {
4505            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
4506                ".google.cloud.config.v1.Revision.State",
4507            ))
4508        }
4509    }
4510
4511    /// Possible errors if Revision could not be created or updated successfully.
4512    ///
4513    /// # Working with unknown values
4514    ///
4515    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4516    /// additional enum variants at any time. Adding new variants is not considered
4517    /// a breaking change. Applications should write their code in anticipation of:
4518    ///
4519    /// - New values appearing in future releases of the client library, **and**
4520    /// - New values received dynamically, without application changes.
4521    ///
4522    /// Please consult the [Working with enums] section in the user guide for some
4523    /// guidelines.
4524    ///
4525    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
4526    #[derive(Clone, Debug, PartialEq)]
4527    #[non_exhaustive]
4528    pub enum ErrorCode {
4529        /// No error code was specified.
4530        Unspecified,
4531        /// Cloud Build failed due to a permission issue.
4532        CloudBuildPermissionDenied,
4533        /// Cloud Build job associated with creating or updating a deployment could
4534        /// not be started.
4535        ApplyBuildApiFailed,
4536        /// Cloud Build job associated with creating or updating a deployment was
4537        /// started but failed.
4538        ApplyBuildRunFailed,
4539        /// quota validation failed for one or more resources in terraform
4540        /// configuration files.
4541        QuotaValidationFailed,
4542        /// Failed to import values from an external source.
4543        ExternalValueSourceImportFailed,
4544        /// If set, the enum was initialized with an unknown value.
4545        ///
4546        /// Applications can examine the value using [ErrorCode::value] or
4547        /// [ErrorCode::name].
4548        UnknownValue(error_code::UnknownValue),
4549    }
4550
4551    #[doc(hidden)]
4552    pub mod error_code {
4553        #[allow(unused_imports)]
4554        use super::*;
4555        #[derive(Clone, Debug, PartialEq)]
4556        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4557    }
4558
4559    impl ErrorCode {
4560        /// Gets the enum value.
4561        ///
4562        /// Returns `None` if the enum contains an unknown value deserialized from
4563        /// the string representation of enums.
4564        pub fn value(&self) -> std::option::Option<i32> {
4565            match self {
4566                Self::Unspecified => std::option::Option::Some(0),
4567                Self::CloudBuildPermissionDenied => std::option::Option::Some(1),
4568                Self::ApplyBuildApiFailed => std::option::Option::Some(4),
4569                Self::ApplyBuildRunFailed => std::option::Option::Some(5),
4570                Self::QuotaValidationFailed => std::option::Option::Some(7),
4571                Self::ExternalValueSourceImportFailed => std::option::Option::Some(8),
4572                Self::UnknownValue(u) => u.0.value(),
4573            }
4574        }
4575
4576        /// Gets the enum value as a string.
4577        ///
4578        /// Returns `None` if the enum contains an unknown value deserialized from
4579        /// the integer representation of enums.
4580        pub fn name(&self) -> std::option::Option<&str> {
4581            match self {
4582                Self::Unspecified => std::option::Option::Some("ERROR_CODE_UNSPECIFIED"),
4583                Self::CloudBuildPermissionDenied => {
4584                    std::option::Option::Some("CLOUD_BUILD_PERMISSION_DENIED")
4585                }
4586                Self::ApplyBuildApiFailed => std::option::Option::Some("APPLY_BUILD_API_FAILED"),
4587                Self::ApplyBuildRunFailed => std::option::Option::Some("APPLY_BUILD_RUN_FAILED"),
4588                Self::QuotaValidationFailed => std::option::Option::Some("QUOTA_VALIDATION_FAILED"),
4589                Self::ExternalValueSourceImportFailed => {
4590                    std::option::Option::Some("EXTERNAL_VALUE_SOURCE_IMPORT_FAILED")
4591                }
4592                Self::UnknownValue(u) => u.0.name(),
4593            }
4594        }
4595    }
4596
4597    impl std::default::Default for ErrorCode {
4598        fn default() -> Self {
4599            use std::convert::From;
4600            Self::from(0)
4601        }
4602    }
4603
4604    impl std::fmt::Display for ErrorCode {
4605        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4606            wkt::internal::display_enum(f, self.name(), self.value())
4607        }
4608    }
4609
4610    impl std::convert::From<i32> for ErrorCode {
4611        fn from(value: i32) -> Self {
4612            match value {
4613                0 => Self::Unspecified,
4614                1 => Self::CloudBuildPermissionDenied,
4615                4 => Self::ApplyBuildApiFailed,
4616                5 => Self::ApplyBuildRunFailed,
4617                7 => Self::QuotaValidationFailed,
4618                8 => Self::ExternalValueSourceImportFailed,
4619                _ => Self::UnknownValue(error_code::UnknownValue(
4620                    wkt::internal::UnknownEnumValue::Integer(value),
4621                )),
4622            }
4623        }
4624    }
4625
4626    impl std::convert::From<&str> for ErrorCode {
4627        fn from(value: &str) -> Self {
4628            use std::string::ToString;
4629            match value {
4630                "ERROR_CODE_UNSPECIFIED" => Self::Unspecified,
4631                "CLOUD_BUILD_PERMISSION_DENIED" => Self::CloudBuildPermissionDenied,
4632                "APPLY_BUILD_API_FAILED" => Self::ApplyBuildApiFailed,
4633                "APPLY_BUILD_RUN_FAILED" => Self::ApplyBuildRunFailed,
4634                "QUOTA_VALIDATION_FAILED" => Self::QuotaValidationFailed,
4635                "EXTERNAL_VALUE_SOURCE_IMPORT_FAILED" => Self::ExternalValueSourceImportFailed,
4636                _ => Self::UnknownValue(error_code::UnknownValue(
4637                    wkt::internal::UnknownEnumValue::String(value.to_string()),
4638                )),
4639            }
4640        }
4641    }
4642
4643    impl serde::ser::Serialize for ErrorCode {
4644        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4645        where
4646            S: serde::Serializer,
4647        {
4648            match self {
4649                Self::Unspecified => serializer.serialize_i32(0),
4650                Self::CloudBuildPermissionDenied => serializer.serialize_i32(1),
4651                Self::ApplyBuildApiFailed => serializer.serialize_i32(4),
4652                Self::ApplyBuildRunFailed => serializer.serialize_i32(5),
4653                Self::QuotaValidationFailed => serializer.serialize_i32(7),
4654                Self::ExternalValueSourceImportFailed => serializer.serialize_i32(8),
4655                Self::UnknownValue(u) => u.0.serialize(serializer),
4656            }
4657        }
4658    }
4659
4660    impl<'de> serde::de::Deserialize<'de> for ErrorCode {
4661        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4662        where
4663            D: serde::Deserializer<'de>,
4664        {
4665            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ErrorCode>::new(
4666                ".google.cloud.config.v1.Revision.ErrorCode",
4667            ))
4668        }
4669    }
4670
4671    /// Blueprint that was deployed.
4672    #[derive(Clone, Debug, PartialEq)]
4673    #[non_exhaustive]
4674    pub enum Blueprint {
4675        /// Output only. A blueprint described using Terraform's HashiCorp
4676        /// Configuration Language as a root module.
4677        TerraformBlueprint(std::boxed::Box<crate::model::TerraformBlueprint>),
4678    }
4679}
4680
4681/// Errors encountered during actuation using Terraform
4682#[derive(Clone, Default, PartialEq)]
4683#[non_exhaustive]
4684pub struct TerraformError {
4685    /// Address of the resource associated with the error,
4686    /// e.g. `google_compute_network.vpc_network`.
4687    pub resource_address: std::string::String,
4688
4689    /// HTTP response code returned from Google Cloud Platform APIs when Terraform
4690    /// fails to provision the resource. If unset or 0, no HTTP response code was
4691    /// returned by Terraform.
4692    pub http_response_code: i32,
4693
4694    /// A human-readable error description.
4695    pub error_description: std::string::String,
4696
4697    /// Output only. Original error response from underlying Google API, if
4698    /// available.
4699    pub error: std::option::Option<google_cloud_rpc::model::Status>,
4700
4701    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4702}
4703
4704impl TerraformError {
4705    /// Creates a new default instance.
4706    pub fn new() -> Self {
4707        std::default::Default::default()
4708    }
4709
4710    /// Sets the value of [resource_address][crate::model::TerraformError::resource_address].
4711    ///
4712    /// # Example
4713    /// ```ignore,no_run
4714    /// # use google_cloud_config_v1::model::TerraformError;
4715    /// let x = TerraformError::new().set_resource_address("example");
4716    /// ```
4717    pub fn set_resource_address<T: std::convert::Into<std::string::String>>(
4718        mut self,
4719        v: T,
4720    ) -> Self {
4721        self.resource_address = v.into();
4722        self
4723    }
4724
4725    /// Sets the value of [http_response_code][crate::model::TerraformError::http_response_code].
4726    ///
4727    /// # Example
4728    /// ```ignore,no_run
4729    /// # use google_cloud_config_v1::model::TerraformError;
4730    /// let x = TerraformError::new().set_http_response_code(42);
4731    /// ```
4732    pub fn set_http_response_code<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4733        self.http_response_code = v.into();
4734        self
4735    }
4736
4737    /// Sets the value of [error_description][crate::model::TerraformError::error_description].
4738    ///
4739    /// # Example
4740    /// ```ignore,no_run
4741    /// # use google_cloud_config_v1::model::TerraformError;
4742    /// let x = TerraformError::new().set_error_description("example");
4743    /// ```
4744    pub fn set_error_description<T: std::convert::Into<std::string::String>>(
4745        mut self,
4746        v: T,
4747    ) -> Self {
4748        self.error_description = v.into();
4749        self
4750    }
4751
4752    /// Sets the value of [error][crate::model::TerraformError::error].
4753    ///
4754    /// # Example
4755    /// ```ignore,no_run
4756    /// # use google_cloud_config_v1::model::TerraformError;
4757    /// use google_cloud_rpc::model::Status;
4758    /// let x = TerraformError::new().set_error(Status::default()/* use setters */);
4759    /// ```
4760    pub fn set_error<T>(mut self, v: T) -> Self
4761    where
4762        T: std::convert::Into<google_cloud_rpc::model::Status>,
4763    {
4764        self.error = std::option::Option::Some(v.into());
4765        self
4766    }
4767
4768    /// Sets or clears the value of [error][crate::model::TerraformError::error].
4769    ///
4770    /// # Example
4771    /// ```ignore,no_run
4772    /// # use google_cloud_config_v1::model::TerraformError;
4773    /// use google_cloud_rpc::model::Status;
4774    /// let x = TerraformError::new().set_or_clear_error(Some(Status::default()/* use setters */));
4775    /// let x = TerraformError::new().set_or_clear_error(None::<Status>);
4776    /// ```
4777    pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
4778    where
4779        T: std::convert::Into<google_cloud_rpc::model::Status>,
4780    {
4781        self.error = v.map(|x| x.into());
4782        self
4783    }
4784}
4785
4786impl wkt::message::Message for TerraformError {
4787    fn typename() -> &'static str {
4788        "type.googleapis.com/google.cloud.config.v1.TerraformError"
4789    }
4790}
4791
4792/// A set of files in a Git repository.
4793#[derive(Clone, Default, PartialEq)]
4794#[non_exhaustive]
4795pub struct GitSource {
4796    /// Optional. Repository URL.
4797    /// Example: '<https://github.com/kubernetes/examples.git>'
4798    pub repo: std::option::Option<std::string::String>,
4799
4800    /// Optional. Subdirectory inside the repository.
4801    /// Example: 'staging/my-package'
4802    pub directory: std::option::Option<std::string::String>,
4803
4804    /// Optional. Git reference (e.g. branch or tag).
4805    pub r#ref: std::option::Option<std::string::String>,
4806
4807    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4808}
4809
4810impl GitSource {
4811    /// Creates a new default instance.
4812    pub fn new() -> Self {
4813        std::default::Default::default()
4814    }
4815
4816    /// Sets the value of [repo][crate::model::GitSource::repo].
4817    ///
4818    /// # Example
4819    /// ```ignore,no_run
4820    /// # use google_cloud_config_v1::model::GitSource;
4821    /// let x = GitSource::new().set_repo("example");
4822    /// ```
4823    pub fn set_repo<T>(mut self, v: T) -> Self
4824    where
4825        T: std::convert::Into<std::string::String>,
4826    {
4827        self.repo = std::option::Option::Some(v.into());
4828        self
4829    }
4830
4831    /// Sets or clears the value of [repo][crate::model::GitSource::repo].
4832    ///
4833    /// # Example
4834    /// ```ignore,no_run
4835    /// # use google_cloud_config_v1::model::GitSource;
4836    /// let x = GitSource::new().set_or_clear_repo(Some("example"));
4837    /// let x = GitSource::new().set_or_clear_repo(None::<String>);
4838    /// ```
4839    pub fn set_or_clear_repo<T>(mut self, v: std::option::Option<T>) -> Self
4840    where
4841        T: std::convert::Into<std::string::String>,
4842    {
4843        self.repo = v.map(|x| x.into());
4844        self
4845    }
4846
4847    /// Sets the value of [directory][crate::model::GitSource::directory].
4848    ///
4849    /// # Example
4850    /// ```ignore,no_run
4851    /// # use google_cloud_config_v1::model::GitSource;
4852    /// let x = GitSource::new().set_directory("example");
4853    /// ```
4854    pub fn set_directory<T>(mut self, v: T) -> Self
4855    where
4856        T: std::convert::Into<std::string::String>,
4857    {
4858        self.directory = std::option::Option::Some(v.into());
4859        self
4860    }
4861
4862    /// Sets or clears the value of [directory][crate::model::GitSource::directory].
4863    ///
4864    /// # Example
4865    /// ```ignore,no_run
4866    /// # use google_cloud_config_v1::model::GitSource;
4867    /// let x = GitSource::new().set_or_clear_directory(Some("example"));
4868    /// let x = GitSource::new().set_or_clear_directory(None::<String>);
4869    /// ```
4870    pub fn set_or_clear_directory<T>(mut self, v: std::option::Option<T>) -> Self
4871    where
4872        T: std::convert::Into<std::string::String>,
4873    {
4874        self.directory = v.map(|x| x.into());
4875        self
4876    }
4877
4878    /// Sets the value of [r#ref][crate::model::GitSource::ref].
4879    ///
4880    /// # Example
4881    /// ```ignore,no_run
4882    /// # use google_cloud_config_v1::model::GitSource;
4883    /// let x = GitSource::new().set_ref("example");
4884    /// ```
4885    pub fn set_ref<T>(mut self, v: T) -> Self
4886    where
4887        T: std::convert::Into<std::string::String>,
4888    {
4889        self.r#ref = std::option::Option::Some(v.into());
4890        self
4891    }
4892
4893    /// Sets or clears the value of [r#ref][crate::model::GitSource::ref].
4894    ///
4895    /// # Example
4896    /// ```ignore,no_run
4897    /// # use google_cloud_config_v1::model::GitSource;
4898    /// let x = GitSource::new().set_or_clear_ref(Some("example"));
4899    /// let x = GitSource::new().set_or_clear_ref(None::<String>);
4900    /// ```
4901    pub fn set_or_clear_ref<T>(mut self, v: std::option::Option<T>) -> Self
4902    where
4903        T: std::convert::Into<std::string::String>,
4904    {
4905        self.r#ref = v.map(|x| x.into());
4906        self
4907    }
4908}
4909
4910impl wkt::message::Message for GitSource {
4911    fn typename() -> &'static str {
4912        "type.googleapis.com/google.cloud.config.v1.GitSource"
4913    }
4914}
4915
4916/// Ephemeral metadata content describing the state of a deployment operation.
4917#[derive(Clone, Default, PartialEq)]
4918#[non_exhaustive]
4919pub struct DeploymentOperationMetadata {
4920    /// The current step the deployment operation is running.
4921    pub step: crate::model::deployment_operation_metadata::DeploymentStep,
4922
4923    /// Outputs and artifacts from applying a deployment.
4924    pub apply_results: std::option::Option<crate::model::ApplyResults>,
4925
4926    /// Output only. Cloud Build instance UUID associated with this operation.
4927    pub build: std::string::String,
4928
4929    /// Output only. Location of Deployment operations logs in
4930    /// `gs://{bucket}/{object}` format.
4931    pub logs: std::string::String,
4932
4933    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4934}
4935
4936impl DeploymentOperationMetadata {
4937    /// Creates a new default instance.
4938    pub fn new() -> Self {
4939        std::default::Default::default()
4940    }
4941
4942    /// Sets the value of [step][crate::model::DeploymentOperationMetadata::step].
4943    ///
4944    /// # Example
4945    /// ```ignore,no_run
4946    /// # use google_cloud_config_v1::model::DeploymentOperationMetadata;
4947    /// use google_cloud_config_v1::model::deployment_operation_metadata::DeploymentStep;
4948    /// let x0 = DeploymentOperationMetadata::new().set_step(DeploymentStep::PreparingStorageBucket);
4949    /// let x1 = DeploymentOperationMetadata::new().set_step(DeploymentStep::DownloadingBlueprint);
4950    /// let x2 = DeploymentOperationMetadata::new().set_step(DeploymentStep::RunningTfInit);
4951    /// ```
4952    pub fn set_step<
4953        T: std::convert::Into<crate::model::deployment_operation_metadata::DeploymentStep>,
4954    >(
4955        mut self,
4956        v: T,
4957    ) -> Self {
4958        self.step = v.into();
4959        self
4960    }
4961
4962    /// Sets the value of [apply_results][crate::model::DeploymentOperationMetadata::apply_results].
4963    ///
4964    /// # Example
4965    /// ```ignore,no_run
4966    /// # use google_cloud_config_v1::model::DeploymentOperationMetadata;
4967    /// use google_cloud_config_v1::model::ApplyResults;
4968    /// let x = DeploymentOperationMetadata::new().set_apply_results(ApplyResults::default()/* use setters */);
4969    /// ```
4970    pub fn set_apply_results<T>(mut self, v: T) -> Self
4971    where
4972        T: std::convert::Into<crate::model::ApplyResults>,
4973    {
4974        self.apply_results = std::option::Option::Some(v.into());
4975        self
4976    }
4977
4978    /// Sets or clears the value of [apply_results][crate::model::DeploymentOperationMetadata::apply_results].
4979    ///
4980    /// # Example
4981    /// ```ignore,no_run
4982    /// # use google_cloud_config_v1::model::DeploymentOperationMetadata;
4983    /// use google_cloud_config_v1::model::ApplyResults;
4984    /// let x = DeploymentOperationMetadata::new().set_or_clear_apply_results(Some(ApplyResults::default()/* use setters */));
4985    /// let x = DeploymentOperationMetadata::new().set_or_clear_apply_results(None::<ApplyResults>);
4986    /// ```
4987    pub fn set_or_clear_apply_results<T>(mut self, v: std::option::Option<T>) -> Self
4988    where
4989        T: std::convert::Into<crate::model::ApplyResults>,
4990    {
4991        self.apply_results = v.map(|x| x.into());
4992        self
4993    }
4994
4995    /// Sets the value of [build][crate::model::DeploymentOperationMetadata::build].
4996    ///
4997    /// # Example
4998    /// ```ignore,no_run
4999    /// # use google_cloud_config_v1::model::DeploymentOperationMetadata;
5000    /// let x = DeploymentOperationMetadata::new().set_build("example");
5001    /// ```
5002    pub fn set_build<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5003        self.build = v.into();
5004        self
5005    }
5006
5007    /// Sets the value of [logs][crate::model::DeploymentOperationMetadata::logs].
5008    ///
5009    /// # Example
5010    /// ```ignore,no_run
5011    /// # use google_cloud_config_v1::model::DeploymentOperationMetadata;
5012    /// let x = DeploymentOperationMetadata::new().set_logs("example");
5013    /// ```
5014    pub fn set_logs<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5015        self.logs = v.into();
5016        self
5017    }
5018}
5019
5020impl wkt::message::Message for DeploymentOperationMetadata {
5021    fn typename() -> &'static str {
5022        "type.googleapis.com/google.cloud.config.v1.DeploymentOperationMetadata"
5023    }
5024}
5025
5026/// Defines additional types related to [DeploymentOperationMetadata].
5027pub mod deployment_operation_metadata {
5028    #[allow(unused_imports)]
5029    use super::*;
5030
5031    /// The possible steps a deployment may be running.
5032    ///
5033    /// # Working with unknown values
5034    ///
5035    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5036    /// additional enum variants at any time. Adding new variants is not considered
5037    /// a breaking change. Applications should write their code in anticipation of:
5038    ///
5039    /// - New values appearing in future releases of the client library, **and**
5040    /// - New values received dynamically, without application changes.
5041    ///
5042    /// Please consult the [Working with enums] section in the user guide for some
5043    /// guidelines.
5044    ///
5045    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
5046    #[derive(Clone, Debug, PartialEq)]
5047    #[non_exhaustive]
5048    pub enum DeploymentStep {
5049        /// Unspecified deployment step
5050        Unspecified,
5051        /// Infra Manager is creating a Google Cloud Storage bucket to store
5052        /// artifacts and metadata about the deployment and revision
5053        PreparingStorageBucket,
5054        /// Downloading the blueprint onto the Google Cloud Storage bucket
5055        DownloadingBlueprint,
5056        /// Initializing Terraform using `terraform init`
5057        RunningTfInit,
5058        /// Running `terraform plan`
5059        RunningTfPlan,
5060        /// Actuating resources using Terraform using `terraform apply`
5061        RunningTfApply,
5062        /// Destroying resources using Terraform using `terraform destroy`
5063        RunningTfDestroy,
5064        /// Validating the uploaded TF state file when unlocking a deployment
5065        RunningTfValidate,
5066        /// Unlocking a deployment
5067        UnlockingDeployment,
5068        /// Operation was successful
5069        Succeeded,
5070        /// Operation failed
5071        Failed,
5072        /// Validating the provided repository.
5073        ValidatingRepository,
5074        /// Running quota validation
5075        RunningQuotaValidation,
5076        /// If set, the enum was initialized with an unknown value.
5077        ///
5078        /// Applications can examine the value using [DeploymentStep::value] or
5079        /// [DeploymentStep::name].
5080        UnknownValue(deployment_step::UnknownValue),
5081    }
5082
5083    #[doc(hidden)]
5084    pub mod deployment_step {
5085        #[allow(unused_imports)]
5086        use super::*;
5087        #[derive(Clone, Debug, PartialEq)]
5088        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5089    }
5090
5091    impl DeploymentStep {
5092        /// Gets the enum value.
5093        ///
5094        /// Returns `None` if the enum contains an unknown value deserialized from
5095        /// the string representation of enums.
5096        pub fn value(&self) -> std::option::Option<i32> {
5097            match self {
5098                Self::Unspecified => std::option::Option::Some(0),
5099                Self::PreparingStorageBucket => std::option::Option::Some(1),
5100                Self::DownloadingBlueprint => std::option::Option::Some(2),
5101                Self::RunningTfInit => std::option::Option::Some(3),
5102                Self::RunningTfPlan => std::option::Option::Some(4),
5103                Self::RunningTfApply => std::option::Option::Some(5),
5104                Self::RunningTfDestroy => std::option::Option::Some(6),
5105                Self::RunningTfValidate => std::option::Option::Some(7),
5106                Self::UnlockingDeployment => std::option::Option::Some(8),
5107                Self::Succeeded => std::option::Option::Some(9),
5108                Self::Failed => std::option::Option::Some(10),
5109                Self::ValidatingRepository => std::option::Option::Some(11),
5110                Self::RunningQuotaValidation => std::option::Option::Some(12),
5111                Self::UnknownValue(u) => u.0.value(),
5112            }
5113        }
5114
5115        /// Gets the enum value as a string.
5116        ///
5117        /// Returns `None` if the enum contains an unknown value deserialized from
5118        /// the integer representation of enums.
5119        pub fn name(&self) -> std::option::Option<&str> {
5120            match self {
5121                Self::Unspecified => std::option::Option::Some("DEPLOYMENT_STEP_UNSPECIFIED"),
5122                Self::PreparingStorageBucket => {
5123                    std::option::Option::Some("PREPARING_STORAGE_BUCKET")
5124                }
5125                Self::DownloadingBlueprint => std::option::Option::Some("DOWNLOADING_BLUEPRINT"),
5126                Self::RunningTfInit => std::option::Option::Some("RUNNING_TF_INIT"),
5127                Self::RunningTfPlan => std::option::Option::Some("RUNNING_TF_PLAN"),
5128                Self::RunningTfApply => std::option::Option::Some("RUNNING_TF_APPLY"),
5129                Self::RunningTfDestroy => std::option::Option::Some("RUNNING_TF_DESTROY"),
5130                Self::RunningTfValidate => std::option::Option::Some("RUNNING_TF_VALIDATE"),
5131                Self::UnlockingDeployment => std::option::Option::Some("UNLOCKING_DEPLOYMENT"),
5132                Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
5133                Self::Failed => std::option::Option::Some("FAILED"),
5134                Self::ValidatingRepository => std::option::Option::Some("VALIDATING_REPOSITORY"),
5135                Self::RunningQuotaValidation => {
5136                    std::option::Option::Some("RUNNING_QUOTA_VALIDATION")
5137                }
5138                Self::UnknownValue(u) => u.0.name(),
5139            }
5140        }
5141    }
5142
5143    impl std::default::Default for DeploymentStep {
5144        fn default() -> Self {
5145            use std::convert::From;
5146            Self::from(0)
5147        }
5148    }
5149
5150    impl std::fmt::Display for DeploymentStep {
5151        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5152            wkt::internal::display_enum(f, self.name(), self.value())
5153        }
5154    }
5155
5156    impl std::convert::From<i32> for DeploymentStep {
5157        fn from(value: i32) -> Self {
5158            match value {
5159                0 => Self::Unspecified,
5160                1 => Self::PreparingStorageBucket,
5161                2 => Self::DownloadingBlueprint,
5162                3 => Self::RunningTfInit,
5163                4 => Self::RunningTfPlan,
5164                5 => Self::RunningTfApply,
5165                6 => Self::RunningTfDestroy,
5166                7 => Self::RunningTfValidate,
5167                8 => Self::UnlockingDeployment,
5168                9 => Self::Succeeded,
5169                10 => Self::Failed,
5170                11 => Self::ValidatingRepository,
5171                12 => Self::RunningQuotaValidation,
5172                _ => Self::UnknownValue(deployment_step::UnknownValue(
5173                    wkt::internal::UnknownEnumValue::Integer(value),
5174                )),
5175            }
5176        }
5177    }
5178
5179    impl std::convert::From<&str> for DeploymentStep {
5180        fn from(value: &str) -> Self {
5181            use std::string::ToString;
5182            match value {
5183                "DEPLOYMENT_STEP_UNSPECIFIED" => Self::Unspecified,
5184                "PREPARING_STORAGE_BUCKET" => Self::PreparingStorageBucket,
5185                "DOWNLOADING_BLUEPRINT" => Self::DownloadingBlueprint,
5186                "RUNNING_TF_INIT" => Self::RunningTfInit,
5187                "RUNNING_TF_PLAN" => Self::RunningTfPlan,
5188                "RUNNING_TF_APPLY" => Self::RunningTfApply,
5189                "RUNNING_TF_DESTROY" => Self::RunningTfDestroy,
5190                "RUNNING_TF_VALIDATE" => Self::RunningTfValidate,
5191                "UNLOCKING_DEPLOYMENT" => Self::UnlockingDeployment,
5192                "SUCCEEDED" => Self::Succeeded,
5193                "FAILED" => Self::Failed,
5194                "VALIDATING_REPOSITORY" => Self::ValidatingRepository,
5195                "RUNNING_QUOTA_VALIDATION" => Self::RunningQuotaValidation,
5196                _ => Self::UnknownValue(deployment_step::UnknownValue(
5197                    wkt::internal::UnknownEnumValue::String(value.to_string()),
5198                )),
5199            }
5200        }
5201    }
5202
5203    impl serde::ser::Serialize for DeploymentStep {
5204        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5205        where
5206            S: serde::Serializer,
5207        {
5208            match self {
5209                Self::Unspecified => serializer.serialize_i32(0),
5210                Self::PreparingStorageBucket => serializer.serialize_i32(1),
5211                Self::DownloadingBlueprint => serializer.serialize_i32(2),
5212                Self::RunningTfInit => serializer.serialize_i32(3),
5213                Self::RunningTfPlan => serializer.serialize_i32(4),
5214                Self::RunningTfApply => serializer.serialize_i32(5),
5215                Self::RunningTfDestroy => serializer.serialize_i32(6),
5216                Self::RunningTfValidate => serializer.serialize_i32(7),
5217                Self::UnlockingDeployment => serializer.serialize_i32(8),
5218                Self::Succeeded => serializer.serialize_i32(9),
5219                Self::Failed => serializer.serialize_i32(10),
5220                Self::ValidatingRepository => serializer.serialize_i32(11),
5221                Self::RunningQuotaValidation => serializer.serialize_i32(12),
5222                Self::UnknownValue(u) => u.0.serialize(serializer),
5223            }
5224        }
5225    }
5226
5227    impl<'de> serde::de::Deserialize<'de> for DeploymentStep {
5228        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5229        where
5230            D: serde::Deserializer<'de>,
5231        {
5232            deserializer.deserialize_any(wkt::internal::EnumVisitor::<DeploymentStep>::new(
5233                ".google.cloud.config.v1.DeploymentOperationMetadata.DeploymentStep",
5234            ))
5235        }
5236    }
5237}
5238
5239/// Resource represents a Google Cloud Platform resource actuated by IM.
5240/// Resources are child resources of Revisions.
5241#[derive(Clone, Default, PartialEq)]
5242#[non_exhaustive]
5243pub struct Resource {
5244    /// Output only. Resource name.
5245    /// Format:
5246    /// `projects/{project}/locations/{location}/deployments/{deployment}/revisions/{revision}/resources/{resource}`
5247    pub name: std::string::String,
5248
5249    /// Output only. Terraform-specific info if this resource was created using
5250    /// Terraform.
5251    pub terraform_info: std::option::Option<crate::model::ResourceTerraformInfo>,
5252
5253    /// Output only. Map of Cloud Asset Inventory (CAI) type to CAI info (e.g. CAI
5254    /// ID). CAI type format follows
5255    /// <https://cloud.google.com/asset-inventory/docs/supported-asset-types>
5256    pub cai_assets: std::collections::HashMap<std::string::String, crate::model::ResourceCAIInfo>,
5257
5258    /// Output only. Intent of the resource.
5259    pub intent: crate::model::resource::Intent,
5260
5261    /// Output only. Current state of the resource.
5262    pub state: crate::model::resource::State,
5263
5264    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5265}
5266
5267impl Resource {
5268    /// Creates a new default instance.
5269    pub fn new() -> Self {
5270        std::default::Default::default()
5271    }
5272
5273    /// Sets the value of [name][crate::model::Resource::name].
5274    ///
5275    /// # Example
5276    /// ```ignore,no_run
5277    /// # use google_cloud_config_v1::model::Resource;
5278    /// # let project_id = "project_id";
5279    /// # let location_id = "location_id";
5280    /// # let deployment_id = "deployment_id";
5281    /// # let revision_id = "revision_id";
5282    /// # let resource_id = "resource_id";
5283    /// let x = Resource::new().set_name(format!("projects/{project_id}/locations/{location_id}/deployments/{deployment_id}/revisions/{revision_id}/resources/{resource_id}"));
5284    /// ```
5285    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5286        self.name = v.into();
5287        self
5288    }
5289
5290    /// Sets the value of [terraform_info][crate::model::Resource::terraform_info].
5291    ///
5292    /// # Example
5293    /// ```ignore,no_run
5294    /// # use google_cloud_config_v1::model::Resource;
5295    /// use google_cloud_config_v1::model::ResourceTerraformInfo;
5296    /// let x = Resource::new().set_terraform_info(ResourceTerraformInfo::default()/* use setters */);
5297    /// ```
5298    pub fn set_terraform_info<T>(mut self, v: T) -> Self
5299    where
5300        T: std::convert::Into<crate::model::ResourceTerraformInfo>,
5301    {
5302        self.terraform_info = std::option::Option::Some(v.into());
5303        self
5304    }
5305
5306    /// Sets or clears the value of [terraform_info][crate::model::Resource::terraform_info].
5307    ///
5308    /// # Example
5309    /// ```ignore,no_run
5310    /// # use google_cloud_config_v1::model::Resource;
5311    /// use google_cloud_config_v1::model::ResourceTerraformInfo;
5312    /// let x = Resource::new().set_or_clear_terraform_info(Some(ResourceTerraformInfo::default()/* use setters */));
5313    /// let x = Resource::new().set_or_clear_terraform_info(None::<ResourceTerraformInfo>);
5314    /// ```
5315    pub fn set_or_clear_terraform_info<T>(mut self, v: std::option::Option<T>) -> Self
5316    where
5317        T: std::convert::Into<crate::model::ResourceTerraformInfo>,
5318    {
5319        self.terraform_info = v.map(|x| x.into());
5320        self
5321    }
5322
5323    /// Sets the value of [cai_assets][crate::model::Resource::cai_assets].
5324    ///
5325    /// # Example
5326    /// ```ignore,no_run
5327    /// # use google_cloud_config_v1::model::Resource;
5328    /// use google_cloud_config_v1::model::ResourceCAIInfo;
5329    /// let x = Resource::new().set_cai_assets([
5330    ///     ("key0", ResourceCAIInfo::default()/* use setters */),
5331    ///     ("key1", ResourceCAIInfo::default()/* use (different) setters */),
5332    /// ]);
5333    /// ```
5334    pub fn set_cai_assets<T, K, V>(mut self, v: T) -> Self
5335    where
5336        T: std::iter::IntoIterator<Item = (K, V)>,
5337        K: std::convert::Into<std::string::String>,
5338        V: std::convert::Into<crate::model::ResourceCAIInfo>,
5339    {
5340        use std::iter::Iterator;
5341        self.cai_assets = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5342        self
5343    }
5344
5345    /// Sets the value of [intent][crate::model::Resource::intent].
5346    ///
5347    /// # Example
5348    /// ```ignore,no_run
5349    /// # use google_cloud_config_v1::model::Resource;
5350    /// use google_cloud_config_v1::model::resource::Intent;
5351    /// let x0 = Resource::new().set_intent(Intent::Create);
5352    /// let x1 = Resource::new().set_intent(Intent::Update);
5353    /// let x2 = Resource::new().set_intent(Intent::Delete);
5354    /// ```
5355    pub fn set_intent<T: std::convert::Into<crate::model::resource::Intent>>(
5356        mut self,
5357        v: T,
5358    ) -> Self {
5359        self.intent = v.into();
5360        self
5361    }
5362
5363    /// Sets the value of [state][crate::model::Resource::state].
5364    ///
5365    /// # Example
5366    /// ```ignore,no_run
5367    /// # use google_cloud_config_v1::model::Resource;
5368    /// use google_cloud_config_v1::model::resource::State;
5369    /// let x0 = Resource::new().set_state(State::Planned);
5370    /// let x1 = Resource::new().set_state(State::InProgress);
5371    /// let x2 = Resource::new().set_state(State::Reconciled);
5372    /// ```
5373    pub fn set_state<T: std::convert::Into<crate::model::resource::State>>(mut self, v: T) -> Self {
5374        self.state = v.into();
5375        self
5376    }
5377}
5378
5379impl wkt::message::Message for Resource {
5380    fn typename() -> &'static str {
5381        "type.googleapis.com/google.cloud.config.v1.Resource"
5382    }
5383}
5384
5385/// Defines additional types related to [Resource].
5386pub mod resource {
5387    #[allow(unused_imports)]
5388    use super::*;
5389
5390    /// Possible intent of the resource.
5391    ///
5392    /// # Working with unknown values
5393    ///
5394    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5395    /// additional enum variants at any time. Adding new variants is not considered
5396    /// a breaking change. Applications should write their code in anticipation of:
5397    ///
5398    /// - New values appearing in future releases of the client library, **and**
5399    /// - New values received dynamically, without application changes.
5400    ///
5401    /// Please consult the [Working with enums] section in the user guide for some
5402    /// guidelines.
5403    ///
5404    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
5405    #[derive(Clone, Debug, PartialEq)]
5406    #[non_exhaustive]
5407    pub enum Intent {
5408        /// The default value. This value is used if the intent is omitted.
5409        Unspecified,
5410        /// Infra Manager will create this Resource.
5411        Create,
5412        /// Infra Manager will update this Resource.
5413        Update,
5414        /// Infra Manager will delete this Resource.
5415        Delete,
5416        /// Infra Manager will destroy and recreate this Resource.
5417        Recreate,
5418        /// Infra Manager will leave this Resource untouched.
5419        Unchanged,
5420        /// If set, the enum was initialized with an unknown value.
5421        ///
5422        /// Applications can examine the value using [Intent::value] or
5423        /// [Intent::name].
5424        UnknownValue(intent::UnknownValue),
5425    }
5426
5427    #[doc(hidden)]
5428    pub mod intent {
5429        #[allow(unused_imports)]
5430        use super::*;
5431        #[derive(Clone, Debug, PartialEq)]
5432        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5433    }
5434
5435    impl Intent {
5436        /// Gets the enum value.
5437        ///
5438        /// Returns `None` if the enum contains an unknown value deserialized from
5439        /// the string representation of enums.
5440        pub fn value(&self) -> std::option::Option<i32> {
5441            match self {
5442                Self::Unspecified => std::option::Option::Some(0),
5443                Self::Create => std::option::Option::Some(1),
5444                Self::Update => std::option::Option::Some(2),
5445                Self::Delete => std::option::Option::Some(3),
5446                Self::Recreate => std::option::Option::Some(4),
5447                Self::Unchanged => std::option::Option::Some(5),
5448                Self::UnknownValue(u) => u.0.value(),
5449            }
5450        }
5451
5452        /// Gets the enum value as a string.
5453        ///
5454        /// Returns `None` if the enum contains an unknown value deserialized from
5455        /// the integer representation of enums.
5456        pub fn name(&self) -> std::option::Option<&str> {
5457            match self {
5458                Self::Unspecified => std::option::Option::Some("INTENT_UNSPECIFIED"),
5459                Self::Create => std::option::Option::Some("CREATE"),
5460                Self::Update => std::option::Option::Some("UPDATE"),
5461                Self::Delete => std::option::Option::Some("DELETE"),
5462                Self::Recreate => std::option::Option::Some("RECREATE"),
5463                Self::Unchanged => std::option::Option::Some("UNCHANGED"),
5464                Self::UnknownValue(u) => u.0.name(),
5465            }
5466        }
5467    }
5468
5469    impl std::default::Default for Intent {
5470        fn default() -> Self {
5471            use std::convert::From;
5472            Self::from(0)
5473        }
5474    }
5475
5476    impl std::fmt::Display for Intent {
5477        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5478            wkt::internal::display_enum(f, self.name(), self.value())
5479        }
5480    }
5481
5482    impl std::convert::From<i32> for Intent {
5483        fn from(value: i32) -> Self {
5484            match value {
5485                0 => Self::Unspecified,
5486                1 => Self::Create,
5487                2 => Self::Update,
5488                3 => Self::Delete,
5489                4 => Self::Recreate,
5490                5 => Self::Unchanged,
5491                _ => Self::UnknownValue(intent::UnknownValue(
5492                    wkt::internal::UnknownEnumValue::Integer(value),
5493                )),
5494            }
5495        }
5496    }
5497
5498    impl std::convert::From<&str> for Intent {
5499        fn from(value: &str) -> Self {
5500            use std::string::ToString;
5501            match value {
5502                "INTENT_UNSPECIFIED" => Self::Unspecified,
5503                "CREATE" => Self::Create,
5504                "UPDATE" => Self::Update,
5505                "DELETE" => Self::Delete,
5506                "RECREATE" => Self::Recreate,
5507                "UNCHANGED" => Self::Unchanged,
5508                _ => Self::UnknownValue(intent::UnknownValue(
5509                    wkt::internal::UnknownEnumValue::String(value.to_string()),
5510                )),
5511            }
5512        }
5513    }
5514
5515    impl serde::ser::Serialize for Intent {
5516        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5517        where
5518            S: serde::Serializer,
5519        {
5520            match self {
5521                Self::Unspecified => serializer.serialize_i32(0),
5522                Self::Create => serializer.serialize_i32(1),
5523                Self::Update => serializer.serialize_i32(2),
5524                Self::Delete => serializer.serialize_i32(3),
5525                Self::Recreate => serializer.serialize_i32(4),
5526                Self::Unchanged => serializer.serialize_i32(5),
5527                Self::UnknownValue(u) => u.0.serialize(serializer),
5528            }
5529        }
5530    }
5531
5532    impl<'de> serde::de::Deserialize<'de> for Intent {
5533        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5534        where
5535            D: serde::Deserializer<'de>,
5536        {
5537            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Intent>::new(
5538                ".google.cloud.config.v1.Resource.Intent",
5539            ))
5540        }
5541    }
5542
5543    /// Possible states of a resource.
5544    ///
5545    /// # Working with unknown values
5546    ///
5547    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5548    /// additional enum variants at any time. Adding new variants is not considered
5549    /// a breaking change. Applications should write their code in anticipation of:
5550    ///
5551    /// - New values appearing in future releases of the client library, **and**
5552    /// - New values received dynamically, without application changes.
5553    ///
5554    /// Please consult the [Working with enums] section in the user guide for some
5555    /// guidelines.
5556    ///
5557    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
5558    #[derive(Clone, Debug, PartialEq)]
5559    #[non_exhaustive]
5560    pub enum State {
5561        /// The default value. This value is used if the state is omitted.
5562        Unspecified,
5563        /// Resource has been planned for reconcile.
5564        Planned,
5565        /// Resource is actively reconciling into the intended state.
5566        InProgress,
5567        /// Resource has reconciled to intended state.
5568        Reconciled,
5569        /// Resource failed to reconcile.
5570        Failed,
5571        /// If set, the enum was initialized with an unknown value.
5572        ///
5573        /// Applications can examine the value using [State::value] or
5574        /// [State::name].
5575        UnknownValue(state::UnknownValue),
5576    }
5577
5578    #[doc(hidden)]
5579    pub mod state {
5580        #[allow(unused_imports)]
5581        use super::*;
5582        #[derive(Clone, Debug, PartialEq)]
5583        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5584    }
5585
5586    impl State {
5587        /// Gets the enum value.
5588        ///
5589        /// Returns `None` if the enum contains an unknown value deserialized from
5590        /// the string representation of enums.
5591        pub fn value(&self) -> std::option::Option<i32> {
5592            match self {
5593                Self::Unspecified => std::option::Option::Some(0),
5594                Self::Planned => std::option::Option::Some(1),
5595                Self::InProgress => std::option::Option::Some(2),
5596                Self::Reconciled => std::option::Option::Some(3),
5597                Self::Failed => std::option::Option::Some(4),
5598                Self::UnknownValue(u) => u.0.value(),
5599            }
5600        }
5601
5602        /// Gets the enum value as a string.
5603        ///
5604        /// Returns `None` if the enum contains an unknown value deserialized from
5605        /// the integer representation of enums.
5606        pub fn name(&self) -> std::option::Option<&str> {
5607            match self {
5608                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
5609                Self::Planned => std::option::Option::Some("PLANNED"),
5610                Self::InProgress => std::option::Option::Some("IN_PROGRESS"),
5611                Self::Reconciled => std::option::Option::Some("RECONCILED"),
5612                Self::Failed => std::option::Option::Some("FAILED"),
5613                Self::UnknownValue(u) => u.0.name(),
5614            }
5615        }
5616    }
5617
5618    impl std::default::Default for State {
5619        fn default() -> Self {
5620            use std::convert::From;
5621            Self::from(0)
5622        }
5623    }
5624
5625    impl std::fmt::Display for State {
5626        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5627            wkt::internal::display_enum(f, self.name(), self.value())
5628        }
5629    }
5630
5631    impl std::convert::From<i32> for State {
5632        fn from(value: i32) -> Self {
5633            match value {
5634                0 => Self::Unspecified,
5635                1 => Self::Planned,
5636                2 => Self::InProgress,
5637                3 => Self::Reconciled,
5638                4 => Self::Failed,
5639                _ => Self::UnknownValue(state::UnknownValue(
5640                    wkt::internal::UnknownEnumValue::Integer(value),
5641                )),
5642            }
5643        }
5644    }
5645
5646    impl std::convert::From<&str> for State {
5647        fn from(value: &str) -> Self {
5648            use std::string::ToString;
5649            match value {
5650                "STATE_UNSPECIFIED" => Self::Unspecified,
5651                "PLANNED" => Self::Planned,
5652                "IN_PROGRESS" => Self::InProgress,
5653                "RECONCILED" => Self::Reconciled,
5654                "FAILED" => Self::Failed,
5655                _ => Self::UnknownValue(state::UnknownValue(
5656                    wkt::internal::UnknownEnumValue::String(value.to_string()),
5657                )),
5658            }
5659        }
5660    }
5661
5662    impl serde::ser::Serialize for State {
5663        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5664        where
5665            S: serde::Serializer,
5666        {
5667            match self {
5668                Self::Unspecified => serializer.serialize_i32(0),
5669                Self::Planned => serializer.serialize_i32(1),
5670                Self::InProgress => serializer.serialize_i32(2),
5671                Self::Reconciled => serializer.serialize_i32(3),
5672                Self::Failed => serializer.serialize_i32(4),
5673                Self::UnknownValue(u) => u.0.serialize(serializer),
5674            }
5675        }
5676    }
5677
5678    impl<'de> serde::de::Deserialize<'de> for State {
5679        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5680        where
5681            D: serde::Deserializer<'de>,
5682        {
5683            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
5684                ".google.cloud.config.v1.Resource.State",
5685            ))
5686        }
5687    }
5688}
5689
5690/// Terraform info of a Resource.
5691#[derive(Clone, Default, PartialEq)]
5692#[non_exhaustive]
5693pub struct ResourceTerraformInfo {
5694    /// TF resource address that uniquely identifies this resource within this
5695    /// deployment.
5696    pub address: std::string::String,
5697
5698    /// TF resource type
5699    pub r#type: std::string::String,
5700
5701    /// ID attribute of the TF resource
5702    pub id: std::string::String,
5703
5704    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5705}
5706
5707impl ResourceTerraformInfo {
5708    /// Creates a new default instance.
5709    pub fn new() -> Self {
5710        std::default::Default::default()
5711    }
5712
5713    /// Sets the value of [address][crate::model::ResourceTerraformInfo::address].
5714    ///
5715    /// # Example
5716    /// ```ignore,no_run
5717    /// # use google_cloud_config_v1::model::ResourceTerraformInfo;
5718    /// let x = ResourceTerraformInfo::new().set_address("example");
5719    /// ```
5720    pub fn set_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5721        self.address = v.into();
5722        self
5723    }
5724
5725    /// Sets the value of [r#type][crate::model::ResourceTerraformInfo::type].
5726    ///
5727    /// # Example
5728    /// ```ignore,no_run
5729    /// # use google_cloud_config_v1::model::ResourceTerraformInfo;
5730    /// let x = ResourceTerraformInfo::new().set_type("example");
5731    /// ```
5732    pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5733        self.r#type = v.into();
5734        self
5735    }
5736
5737    /// Sets the value of [id][crate::model::ResourceTerraformInfo::id].
5738    ///
5739    /// # Example
5740    /// ```ignore,no_run
5741    /// # use google_cloud_config_v1::model::ResourceTerraformInfo;
5742    /// let x = ResourceTerraformInfo::new().set_id("example");
5743    /// ```
5744    pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5745        self.id = v.into();
5746        self
5747    }
5748}
5749
5750impl wkt::message::Message for ResourceTerraformInfo {
5751    fn typename() -> &'static str {
5752        "type.googleapis.com/google.cloud.config.v1.ResourceTerraformInfo"
5753    }
5754}
5755
5756/// CAI info of a Resource.
5757#[derive(Clone, Default, PartialEq)]
5758#[non_exhaustive]
5759pub struct ResourceCAIInfo {
5760    /// CAI resource name in the format following
5761    /// <https://cloud.google.com/apis/design/resource_names#full_resource_name>
5762    pub full_resource_name: std::string::String,
5763
5764    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5765}
5766
5767impl ResourceCAIInfo {
5768    /// Creates a new default instance.
5769    pub fn new() -> Self {
5770        std::default::Default::default()
5771    }
5772
5773    /// Sets the value of [full_resource_name][crate::model::ResourceCAIInfo::full_resource_name].
5774    ///
5775    /// # Example
5776    /// ```ignore,no_run
5777    /// # use google_cloud_config_v1::model::ResourceCAIInfo;
5778    /// let x = ResourceCAIInfo::new().set_full_resource_name("example");
5779    /// ```
5780    pub fn set_full_resource_name<T: std::convert::Into<std::string::String>>(
5781        mut self,
5782        v: T,
5783    ) -> Self {
5784        self.full_resource_name = v.into();
5785        self
5786    }
5787}
5788
5789impl wkt::message::Message for ResourceCAIInfo {
5790    fn typename() -> &'static str {
5791        "type.googleapis.com/google.cloud.config.v1.ResourceCAIInfo"
5792    }
5793}
5794
5795/// A request to get a Resource from a 'GetResource' call.
5796#[derive(Clone, Default, PartialEq)]
5797#[non_exhaustive]
5798pub struct GetResourceRequest {
5799    /// Required. The name of the Resource in the format:
5800    /// 'projects/{project_id}/locations/{location}/deployments/{deployment}/revisions/{revision}/resource/{resource}'.
5801    pub name: std::string::String,
5802
5803    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5804}
5805
5806impl GetResourceRequest {
5807    /// Creates a new default instance.
5808    pub fn new() -> Self {
5809        std::default::Default::default()
5810    }
5811
5812    /// Sets the value of [name][crate::model::GetResourceRequest::name].
5813    ///
5814    /// # Example
5815    /// ```ignore,no_run
5816    /// # use google_cloud_config_v1::model::GetResourceRequest;
5817    /// # let project_id = "project_id";
5818    /// # let location_id = "location_id";
5819    /// # let deployment_id = "deployment_id";
5820    /// # let revision_id = "revision_id";
5821    /// # let resource_id = "resource_id";
5822    /// let x = GetResourceRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/deployments/{deployment_id}/revisions/{revision_id}/resources/{resource_id}"));
5823    /// ```
5824    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5825        self.name = v.into();
5826        self
5827    }
5828}
5829
5830impl wkt::message::Message for GetResourceRequest {
5831    fn typename() -> &'static str {
5832        "type.googleapis.com/google.cloud.config.v1.GetResourceRequest"
5833    }
5834}
5835
5836/// A request to list Resources passed to a 'ListResources' call.
5837#[derive(Clone, Default, PartialEq)]
5838#[non_exhaustive]
5839pub struct ListResourcesRequest {
5840    /// Required. The parent in whose context the Resources are listed. The parent
5841    /// value is in the format:
5842    /// 'projects/{project_id}/locations/{location}/deployments/{deployment}/revisions/{revision}'.
5843    pub parent: std::string::String,
5844
5845    /// When requesting a page of resources, 'page_size' specifies number of
5846    /// resources to return. If unspecified, at most 500 will be returned. The
5847    /// maximum value is 1000.
5848    pub page_size: i32,
5849
5850    /// Token returned by previous call to 'ListResources' which specifies the
5851    /// position in the list from where to continue listing the resources.
5852    pub page_token: std::string::String,
5853
5854    /// Lists the Resources that match the filter expression. A filter
5855    /// expression filters the resources listed in the response. The expression
5856    /// must be of the form '{field} {operator} {value}' where operators: '<', '>',
5857    /// '<=',
5858    /// '>=',
5859    /// '!=', '=', ':' are supported (colon ':' represents a HAS operator which is
5860    /// roughly synonymous with equality). {field} can refer to a proto or JSON
5861    /// field, or a synthetic field. Field names can be camelCase or snake_case.
5862    ///
5863    /// Examples:
5864    ///
5865    /// - Filter by name:
5866    ///   name =
5867    ///   "projects/foo/locations/us-central1/deployments/dep/revisions/bar/resources/baz
5868    pub filter: std::string::String,
5869
5870    /// Field to use to sort the list.
5871    pub order_by: std::string::String,
5872
5873    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5874}
5875
5876impl ListResourcesRequest {
5877    /// Creates a new default instance.
5878    pub fn new() -> Self {
5879        std::default::Default::default()
5880    }
5881
5882    /// Sets the value of [parent][crate::model::ListResourcesRequest::parent].
5883    ///
5884    /// # Example
5885    /// ```ignore,no_run
5886    /// # use google_cloud_config_v1::model::ListResourcesRequest;
5887    /// # let project_id = "project_id";
5888    /// # let location_id = "location_id";
5889    /// # let deployment_id = "deployment_id";
5890    /// # let revision_id = "revision_id";
5891    /// let x = ListResourcesRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/deployments/{deployment_id}/revisions/{revision_id}"));
5892    /// ```
5893    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5894        self.parent = v.into();
5895        self
5896    }
5897
5898    /// Sets the value of [page_size][crate::model::ListResourcesRequest::page_size].
5899    ///
5900    /// # Example
5901    /// ```ignore,no_run
5902    /// # use google_cloud_config_v1::model::ListResourcesRequest;
5903    /// let x = ListResourcesRequest::new().set_page_size(42);
5904    /// ```
5905    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5906        self.page_size = v.into();
5907        self
5908    }
5909
5910    /// Sets the value of [page_token][crate::model::ListResourcesRequest::page_token].
5911    ///
5912    /// # Example
5913    /// ```ignore,no_run
5914    /// # use google_cloud_config_v1::model::ListResourcesRequest;
5915    /// let x = ListResourcesRequest::new().set_page_token("example");
5916    /// ```
5917    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5918        self.page_token = v.into();
5919        self
5920    }
5921
5922    /// Sets the value of [filter][crate::model::ListResourcesRequest::filter].
5923    ///
5924    /// # Example
5925    /// ```ignore,no_run
5926    /// # use google_cloud_config_v1::model::ListResourcesRequest;
5927    /// let x = ListResourcesRequest::new().set_filter("example");
5928    /// ```
5929    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5930        self.filter = v.into();
5931        self
5932    }
5933
5934    /// Sets the value of [order_by][crate::model::ListResourcesRequest::order_by].
5935    ///
5936    /// # Example
5937    /// ```ignore,no_run
5938    /// # use google_cloud_config_v1::model::ListResourcesRequest;
5939    /// let x = ListResourcesRequest::new().set_order_by("example");
5940    /// ```
5941    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5942        self.order_by = v.into();
5943        self
5944    }
5945}
5946
5947impl wkt::message::Message for ListResourcesRequest {
5948    fn typename() -> &'static str {
5949        "type.googleapis.com/google.cloud.config.v1.ListResourcesRequest"
5950    }
5951}
5952
5953/// A response to a 'ListResources' call. Contains a list of Resources.
5954#[derive(Clone, Default, PartialEq)]
5955#[non_exhaustive]
5956pub struct ListResourcesResponse {
5957    /// List of [Resources][google.cloud.config.v1.Resource].
5958    ///
5959    /// [google.cloud.config.v1.Resource]: crate::model::Resource
5960    pub resources: std::vec::Vec<crate::model::Resource>,
5961
5962    /// A token to request the next page of resources from the 'ListResources'
5963    /// method. The value of an empty string means that there are no more resources
5964    /// to return.
5965    pub next_page_token: std::string::String,
5966
5967    /// Locations that could not be reached.
5968    pub unreachable: std::vec::Vec<std::string::String>,
5969
5970    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5971}
5972
5973impl ListResourcesResponse {
5974    /// Creates a new default instance.
5975    pub fn new() -> Self {
5976        std::default::Default::default()
5977    }
5978
5979    /// Sets the value of [resources][crate::model::ListResourcesResponse::resources].
5980    ///
5981    /// # Example
5982    /// ```ignore,no_run
5983    /// # use google_cloud_config_v1::model::ListResourcesResponse;
5984    /// use google_cloud_config_v1::model::Resource;
5985    /// let x = ListResourcesResponse::new()
5986    ///     .set_resources([
5987    ///         Resource::default()/* use setters */,
5988    ///         Resource::default()/* use (different) setters */,
5989    ///     ]);
5990    /// ```
5991    pub fn set_resources<T, V>(mut self, v: T) -> Self
5992    where
5993        T: std::iter::IntoIterator<Item = V>,
5994        V: std::convert::Into<crate::model::Resource>,
5995    {
5996        use std::iter::Iterator;
5997        self.resources = v.into_iter().map(|i| i.into()).collect();
5998        self
5999    }
6000
6001    /// Sets the value of [next_page_token][crate::model::ListResourcesResponse::next_page_token].
6002    ///
6003    /// # Example
6004    /// ```ignore,no_run
6005    /// # use google_cloud_config_v1::model::ListResourcesResponse;
6006    /// let x = ListResourcesResponse::new().set_next_page_token("example");
6007    /// ```
6008    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6009        self.next_page_token = v.into();
6010        self
6011    }
6012
6013    /// Sets the value of [unreachable][crate::model::ListResourcesResponse::unreachable].
6014    ///
6015    /// # Example
6016    /// ```ignore,no_run
6017    /// # use google_cloud_config_v1::model::ListResourcesResponse;
6018    /// let x = ListResourcesResponse::new().set_unreachable(["a", "b", "c"]);
6019    /// ```
6020    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
6021    where
6022        T: std::iter::IntoIterator<Item = V>,
6023        V: std::convert::Into<std::string::String>,
6024    {
6025        use std::iter::Iterator;
6026        self.unreachable = v.into_iter().map(|i| i.into()).collect();
6027        self
6028    }
6029}
6030
6031impl wkt::message::Message for ListResourcesResponse {
6032    fn typename() -> &'static str {
6033        "type.googleapis.com/google.cloud.config.v1.ListResourcesResponse"
6034    }
6035}
6036
6037#[doc(hidden)]
6038impl google_cloud_gax::paginator::internal::PageableResponse for ListResourcesResponse {
6039    type PageItem = crate::model::Resource;
6040
6041    fn items(self) -> std::vec::Vec<Self::PageItem> {
6042        self.resources
6043    }
6044
6045    fn next_page_token(&self) -> std::string::String {
6046        use std::clone::Clone;
6047        self.next_page_token.clone()
6048    }
6049}
6050
6051/// Contains info about a Terraform state file
6052#[derive(Clone, Default, PartialEq)]
6053#[non_exhaustive]
6054pub struct Statefile {
6055    /// Output only. Cloud Storage signed URI used for downloading or uploading the
6056    /// state file.
6057    pub signed_uri: std::string::String,
6058
6059    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6060}
6061
6062impl Statefile {
6063    /// Creates a new default instance.
6064    pub fn new() -> Self {
6065        std::default::Default::default()
6066    }
6067
6068    /// Sets the value of [signed_uri][crate::model::Statefile::signed_uri].
6069    ///
6070    /// # Example
6071    /// ```ignore,no_run
6072    /// # use google_cloud_config_v1::model::Statefile;
6073    /// let x = Statefile::new().set_signed_uri("example");
6074    /// ```
6075    pub fn set_signed_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6076        self.signed_uri = v.into();
6077        self
6078    }
6079}
6080
6081impl wkt::message::Message for Statefile {
6082    fn typename() -> &'static str {
6083        "type.googleapis.com/google.cloud.config.v1.Statefile"
6084    }
6085}
6086
6087/// A request to export a state file passed to a 'ExportDeploymentStatefile'
6088/// call.
6089#[derive(Clone, Default, PartialEq)]
6090#[non_exhaustive]
6091pub struct ExportDeploymentStatefileRequest {
6092    /// Required. The parent in whose context the statefile is listed. The parent
6093    /// value is in the format:
6094    /// 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
6095    pub parent: std::string::String,
6096
6097    /// Optional. If this flag is set to true, the exported deployment state file
6098    /// will be the draft state. This will enable the draft file to be validated
6099    /// before copying it over to the working state on unlock.
6100    pub draft: bool,
6101
6102    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6103}
6104
6105impl ExportDeploymentStatefileRequest {
6106    /// Creates a new default instance.
6107    pub fn new() -> Self {
6108        std::default::Default::default()
6109    }
6110
6111    /// Sets the value of [parent][crate::model::ExportDeploymentStatefileRequest::parent].
6112    ///
6113    /// # Example
6114    /// ```ignore,no_run
6115    /// # use google_cloud_config_v1::model::ExportDeploymentStatefileRequest;
6116    /// # let project_id = "project_id";
6117    /// # let location_id = "location_id";
6118    /// # let deployment_id = "deployment_id";
6119    /// let x = ExportDeploymentStatefileRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/deployments/{deployment_id}"));
6120    /// ```
6121    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6122        self.parent = v.into();
6123        self
6124    }
6125
6126    /// Sets the value of [draft][crate::model::ExportDeploymentStatefileRequest::draft].
6127    ///
6128    /// # Example
6129    /// ```ignore,no_run
6130    /// # use google_cloud_config_v1::model::ExportDeploymentStatefileRequest;
6131    /// let x = ExportDeploymentStatefileRequest::new().set_draft(true);
6132    /// ```
6133    pub fn set_draft<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6134        self.draft = v.into();
6135        self
6136    }
6137}
6138
6139impl wkt::message::Message for ExportDeploymentStatefileRequest {
6140    fn typename() -> &'static str {
6141        "type.googleapis.com/google.cloud.config.v1.ExportDeploymentStatefileRequest"
6142    }
6143}
6144
6145/// A request to export a state file passed to a 'ExportRevisionStatefile'
6146/// call.
6147#[derive(Clone, Default, PartialEq)]
6148#[non_exhaustive]
6149pub struct ExportRevisionStatefileRequest {
6150    /// Required. The parent in whose context the statefile is listed. The parent
6151    /// value is in the format:
6152    /// 'projects/{project_id}/locations/{location}/deployments/{deployment}/revisions/{revision}'.
6153    pub parent: std::string::String,
6154
6155    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6156}
6157
6158impl ExportRevisionStatefileRequest {
6159    /// Creates a new default instance.
6160    pub fn new() -> Self {
6161        std::default::Default::default()
6162    }
6163
6164    /// Sets the value of [parent][crate::model::ExportRevisionStatefileRequest::parent].
6165    ///
6166    /// # Example
6167    /// ```ignore,no_run
6168    /// # use google_cloud_config_v1::model::ExportRevisionStatefileRequest;
6169    /// # let project_id = "project_id";
6170    /// # let location_id = "location_id";
6171    /// # let deployment_id = "deployment_id";
6172    /// # let revision_id = "revision_id";
6173    /// let x = ExportRevisionStatefileRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/deployments/{deployment_id}/revisions/{revision_id}"));
6174    /// ```
6175    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6176        self.parent = v.into();
6177        self
6178    }
6179}
6180
6181impl wkt::message::Message for ExportRevisionStatefileRequest {
6182    fn typename() -> &'static str {
6183        "type.googleapis.com/google.cloud.config.v1.ExportRevisionStatefileRequest"
6184    }
6185}
6186
6187/// A request to import a state file passed to a 'ImportStatefile' call.
6188#[derive(Clone, Default, PartialEq)]
6189#[non_exhaustive]
6190pub struct ImportStatefileRequest {
6191    /// Required. The parent in whose context the statefile is listed. The parent
6192    /// value is in the format:
6193    /// 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
6194    pub parent: std::string::String,
6195
6196    /// Required. Lock ID of the lock file to verify that the user who is importing
6197    /// the state file previously locked the Deployment.
6198    pub lock_id: i64,
6199
6200    /// Optional.
6201    pub skip_draft: bool,
6202
6203    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6204}
6205
6206impl ImportStatefileRequest {
6207    /// Creates a new default instance.
6208    pub fn new() -> Self {
6209        std::default::Default::default()
6210    }
6211
6212    /// Sets the value of [parent][crate::model::ImportStatefileRequest::parent].
6213    ///
6214    /// # Example
6215    /// ```ignore,no_run
6216    /// # use google_cloud_config_v1::model::ImportStatefileRequest;
6217    /// # let project_id = "project_id";
6218    /// # let location_id = "location_id";
6219    /// # let deployment_id = "deployment_id";
6220    /// let x = ImportStatefileRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/deployments/{deployment_id}"));
6221    /// ```
6222    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6223        self.parent = v.into();
6224        self
6225    }
6226
6227    /// Sets the value of [lock_id][crate::model::ImportStatefileRequest::lock_id].
6228    ///
6229    /// # Example
6230    /// ```ignore,no_run
6231    /// # use google_cloud_config_v1::model::ImportStatefileRequest;
6232    /// let x = ImportStatefileRequest::new().set_lock_id(42);
6233    /// ```
6234    pub fn set_lock_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
6235        self.lock_id = v.into();
6236        self
6237    }
6238
6239    /// Sets the value of [skip_draft][crate::model::ImportStatefileRequest::skip_draft].
6240    ///
6241    /// # Example
6242    /// ```ignore,no_run
6243    /// # use google_cloud_config_v1::model::ImportStatefileRequest;
6244    /// let x = ImportStatefileRequest::new().set_skip_draft(true);
6245    /// ```
6246    pub fn set_skip_draft<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6247        self.skip_draft = v.into();
6248        self
6249    }
6250}
6251
6252impl wkt::message::Message for ImportStatefileRequest {
6253    fn typename() -> &'static str {
6254        "type.googleapis.com/google.cloud.config.v1.ImportStatefileRequest"
6255    }
6256}
6257
6258/// A request to delete a state file passed to a 'DeleteStatefile' call.
6259#[derive(Clone, Default, PartialEq)]
6260#[non_exhaustive]
6261pub struct DeleteStatefileRequest {
6262    /// Required. The name of the deployment in the format:
6263    /// 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
6264    pub name: std::string::String,
6265
6266    /// Required. Lock ID of the lock file to verify that the user who is deleting
6267    /// the state file previously locked the Deployment.
6268    pub lock_id: i64,
6269
6270    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6271}
6272
6273impl DeleteStatefileRequest {
6274    /// Creates a new default instance.
6275    pub fn new() -> Self {
6276        std::default::Default::default()
6277    }
6278
6279    /// Sets the value of [name][crate::model::DeleteStatefileRequest::name].
6280    ///
6281    /// # Example
6282    /// ```ignore,no_run
6283    /// # use google_cloud_config_v1::model::DeleteStatefileRequest;
6284    /// # let project_id = "project_id";
6285    /// # let location_id = "location_id";
6286    /// # let deployment_id = "deployment_id";
6287    /// let x = DeleteStatefileRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/deployments/{deployment_id}"));
6288    /// ```
6289    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6290        self.name = v.into();
6291        self
6292    }
6293
6294    /// Sets the value of [lock_id][crate::model::DeleteStatefileRequest::lock_id].
6295    ///
6296    /// # Example
6297    /// ```ignore,no_run
6298    /// # use google_cloud_config_v1::model::DeleteStatefileRequest;
6299    /// let x = DeleteStatefileRequest::new().set_lock_id(42);
6300    /// ```
6301    pub fn set_lock_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
6302        self.lock_id = v.into();
6303        self
6304    }
6305}
6306
6307impl wkt::message::Message for DeleteStatefileRequest {
6308    fn typename() -> &'static str {
6309        "type.googleapis.com/google.cloud.config.v1.DeleteStatefileRequest"
6310    }
6311}
6312
6313/// A request to lock a deployment passed to a 'LockDeployment' call.
6314#[derive(Clone, Default, PartialEq)]
6315#[non_exhaustive]
6316pub struct LockDeploymentRequest {
6317    /// Required. The name of the deployment in the format:
6318    /// 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
6319    pub name: std::string::String,
6320
6321    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6322}
6323
6324impl LockDeploymentRequest {
6325    /// Creates a new default instance.
6326    pub fn new() -> Self {
6327        std::default::Default::default()
6328    }
6329
6330    /// Sets the value of [name][crate::model::LockDeploymentRequest::name].
6331    ///
6332    /// # Example
6333    /// ```ignore,no_run
6334    /// # use google_cloud_config_v1::model::LockDeploymentRequest;
6335    /// # let project_id = "project_id";
6336    /// # let location_id = "location_id";
6337    /// # let deployment_id = "deployment_id";
6338    /// let x = LockDeploymentRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/deployments/{deployment_id}"));
6339    /// ```
6340    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6341        self.name = v.into();
6342        self
6343    }
6344}
6345
6346impl wkt::message::Message for LockDeploymentRequest {
6347    fn typename() -> &'static str {
6348        "type.googleapis.com/google.cloud.config.v1.LockDeploymentRequest"
6349    }
6350}
6351
6352/// A request to unlock a state file passed to a 'UnlockDeployment' call.
6353#[derive(Clone, Default, PartialEq)]
6354#[non_exhaustive]
6355pub struct UnlockDeploymentRequest {
6356    /// Required. The name of the deployment in the format:
6357    /// 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
6358    pub name: std::string::String,
6359
6360    /// Required. Lock ID of the lock file to be unlocked.
6361    pub lock_id: i64,
6362
6363    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6364}
6365
6366impl UnlockDeploymentRequest {
6367    /// Creates a new default instance.
6368    pub fn new() -> Self {
6369        std::default::Default::default()
6370    }
6371
6372    /// Sets the value of [name][crate::model::UnlockDeploymentRequest::name].
6373    ///
6374    /// # Example
6375    /// ```ignore,no_run
6376    /// # use google_cloud_config_v1::model::UnlockDeploymentRequest;
6377    /// # let project_id = "project_id";
6378    /// # let location_id = "location_id";
6379    /// # let deployment_id = "deployment_id";
6380    /// let x = UnlockDeploymentRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/deployments/{deployment_id}"));
6381    /// ```
6382    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6383        self.name = v.into();
6384        self
6385    }
6386
6387    /// Sets the value of [lock_id][crate::model::UnlockDeploymentRequest::lock_id].
6388    ///
6389    /// # Example
6390    /// ```ignore,no_run
6391    /// # use google_cloud_config_v1::model::UnlockDeploymentRequest;
6392    /// let x = UnlockDeploymentRequest::new().set_lock_id(42);
6393    /// ```
6394    pub fn set_lock_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
6395        self.lock_id = v.into();
6396        self
6397    }
6398}
6399
6400impl wkt::message::Message for UnlockDeploymentRequest {
6401    fn typename() -> &'static str {
6402        "type.googleapis.com/google.cloud.config.v1.UnlockDeploymentRequest"
6403    }
6404}
6405
6406/// A request to get a state file lock info passed to a 'ExportLockInfo' call.
6407#[derive(Clone, Default, PartialEq)]
6408#[non_exhaustive]
6409pub struct ExportLockInfoRequest {
6410    /// Required. The name of the deployment in the format:
6411    /// 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
6412    pub name: std::string::String,
6413
6414    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6415}
6416
6417impl ExportLockInfoRequest {
6418    /// Creates a new default instance.
6419    pub fn new() -> Self {
6420        std::default::Default::default()
6421    }
6422
6423    /// Sets the value of [name][crate::model::ExportLockInfoRequest::name].
6424    ///
6425    /// # Example
6426    /// ```ignore,no_run
6427    /// # use google_cloud_config_v1::model::ExportLockInfoRequest;
6428    /// # let project_id = "project_id";
6429    /// # let location_id = "location_id";
6430    /// # let deployment_id = "deployment_id";
6431    /// let x = ExportLockInfoRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/deployments/{deployment_id}"));
6432    /// ```
6433    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6434        self.name = v.into();
6435        self
6436    }
6437}
6438
6439impl wkt::message::Message for ExportLockInfoRequest {
6440    fn typename() -> &'static str {
6441        "type.googleapis.com/google.cloud.config.v1.ExportLockInfoRequest"
6442    }
6443}
6444
6445/// Details about the lock which locked the deployment.
6446#[derive(Clone, Default, PartialEq)]
6447#[non_exhaustive]
6448pub struct LockInfo {
6449    /// Unique ID for the lock to be overridden with generation ID in the backend.
6450    pub lock_id: i64,
6451
6452    /// Terraform operation, provided by the caller.
6453    pub operation: std::string::String,
6454
6455    /// Extra information to store with the lock, provided by the caller.
6456    pub info: std::string::String,
6457
6458    /// user@hostname when available
6459    pub who: std::string::String,
6460
6461    /// Terraform version
6462    pub version: std::string::String,
6463
6464    /// Time that the lock was taken.
6465    pub create_time: std::option::Option<wkt::Timestamp>,
6466
6467    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6468}
6469
6470impl LockInfo {
6471    /// Creates a new default instance.
6472    pub fn new() -> Self {
6473        std::default::Default::default()
6474    }
6475
6476    /// Sets the value of [lock_id][crate::model::LockInfo::lock_id].
6477    ///
6478    /// # Example
6479    /// ```ignore,no_run
6480    /// # use google_cloud_config_v1::model::LockInfo;
6481    /// let x = LockInfo::new().set_lock_id(42);
6482    /// ```
6483    pub fn set_lock_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
6484        self.lock_id = v.into();
6485        self
6486    }
6487
6488    /// Sets the value of [operation][crate::model::LockInfo::operation].
6489    ///
6490    /// # Example
6491    /// ```ignore,no_run
6492    /// # use google_cloud_config_v1::model::LockInfo;
6493    /// let x = LockInfo::new().set_operation("example");
6494    /// ```
6495    pub fn set_operation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6496        self.operation = v.into();
6497        self
6498    }
6499
6500    /// Sets the value of [info][crate::model::LockInfo::info].
6501    ///
6502    /// # Example
6503    /// ```ignore,no_run
6504    /// # use google_cloud_config_v1::model::LockInfo;
6505    /// let x = LockInfo::new().set_info("example");
6506    /// ```
6507    pub fn set_info<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6508        self.info = v.into();
6509        self
6510    }
6511
6512    /// Sets the value of [who][crate::model::LockInfo::who].
6513    ///
6514    /// # Example
6515    /// ```ignore,no_run
6516    /// # use google_cloud_config_v1::model::LockInfo;
6517    /// let x = LockInfo::new().set_who("example");
6518    /// ```
6519    pub fn set_who<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6520        self.who = v.into();
6521        self
6522    }
6523
6524    /// Sets the value of [version][crate::model::LockInfo::version].
6525    ///
6526    /// # Example
6527    /// ```ignore,no_run
6528    /// # use google_cloud_config_v1::model::LockInfo;
6529    /// let x = LockInfo::new().set_version("example");
6530    /// ```
6531    pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6532        self.version = v.into();
6533        self
6534    }
6535
6536    /// Sets the value of [create_time][crate::model::LockInfo::create_time].
6537    ///
6538    /// # Example
6539    /// ```ignore,no_run
6540    /// # use google_cloud_config_v1::model::LockInfo;
6541    /// use wkt::Timestamp;
6542    /// let x = LockInfo::new().set_create_time(Timestamp::default()/* use setters */);
6543    /// ```
6544    pub fn set_create_time<T>(mut self, v: T) -> Self
6545    where
6546        T: std::convert::Into<wkt::Timestamp>,
6547    {
6548        self.create_time = std::option::Option::Some(v.into());
6549        self
6550    }
6551
6552    /// Sets or clears the value of [create_time][crate::model::LockInfo::create_time].
6553    ///
6554    /// # Example
6555    /// ```ignore,no_run
6556    /// # use google_cloud_config_v1::model::LockInfo;
6557    /// use wkt::Timestamp;
6558    /// let x = LockInfo::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
6559    /// let x = LockInfo::new().set_or_clear_create_time(None::<Timestamp>);
6560    /// ```
6561    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
6562    where
6563        T: std::convert::Into<wkt::Timestamp>,
6564    {
6565        self.create_time = v.map(|x| x.into());
6566        self
6567    }
6568}
6569
6570impl wkt::message::Message for LockInfo {
6571    fn typename() -> &'static str {
6572        "type.googleapis.com/google.cloud.config.v1.LockInfo"
6573    }
6574}
6575
6576/// A preview represents a set of actions Infra Manager would perform
6577/// to move the resources towards the desired state as specified in the
6578/// configuration.
6579#[derive(Clone, Default, PartialEq)]
6580#[non_exhaustive]
6581pub struct Preview {
6582    /// Identifier. Resource name of the preview. Resource name can be user
6583    /// provided or server generated ID if unspecified. Format:
6584    /// `projects/{project}/locations/{location}/previews/{preview}`
6585    pub name: std::string::String,
6586
6587    /// Output only. Time the preview was created.
6588    pub create_time: std::option::Option<wkt::Timestamp>,
6589
6590    /// Optional. User-defined labels for the preview.
6591    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
6592
6593    /// Output only. Current state of the preview.
6594    pub state: crate::model::preview::State,
6595
6596    /// Optional. Optional deployment reference. If specified, the preview will be
6597    /// performed using the provided deployment's current state and use any
6598    /// relevant fields from the deployment unless explicitly specified in the
6599    /// preview create request.
6600    pub deployment: std::string::String,
6601
6602    /// Optional. Current mode of preview.
6603    pub preview_mode: crate::model::preview::PreviewMode,
6604
6605    /// Required. User-specified Service Account (SA) credentials to be used when
6606    /// previewing resources.
6607    /// Format: `projects/{projectID}/serviceAccounts/{serviceAccount}`
6608    pub service_account: std::string::String,
6609
6610    /// Optional. User-defined location of Cloud Build logs, artifacts, and
6611    /// in Google Cloud Storage.
6612    /// Format: `gs://{bucket}/{folder}`
6613    /// A default bucket will be bootstrapped if the field is not set or empty
6614    /// Default Bucket Format: `gs://<project number>-<region>-blueprint-config`
6615    /// Constraints:
6616    ///
6617    /// - The bucket needs to be in the same project as the deployment
6618    /// - The path cannot be within the path of `gcs_source`
6619    ///   If omitted and deployment resource ref provided has artifacts_gcs_bucket
6620    ///   defined, that artifact bucket is used.
6621    pub artifacts_gcs_bucket: std::option::Option<std::string::String>,
6622
6623    /// Optional. The user-specified Worker Pool resource in which the Cloud Build
6624    /// job will execute. Format
6625    /// projects/{project}/locations/{location}/workerPools/{workerPoolId} If this
6626    /// field is unspecified, the default Cloud Build worker pool will be used. If
6627    /// omitted and deployment resource ref provided has worker_pool defined, that
6628    /// worker pool is used.
6629    pub worker_pool: std::option::Option<std::string::String>,
6630
6631    /// Output only. Code describing any errors that may have occurred.
6632    pub error_code: crate::model::preview::ErrorCode,
6633
6634    /// Output only. Additional information regarding the current state.
6635    pub error_status: std::option::Option<google_cloud_rpc::model::Status>,
6636
6637    /// Output only. Cloud Build instance UUID associated with this preview.
6638    pub build: std::string::String,
6639
6640    /// Output only. Summary of errors encountered during Terraform preview.
6641    /// It has a size limit of 10, i.e. only top 10 errors will be summarized here.
6642    pub tf_errors: std::vec::Vec<crate::model::TerraformError>,
6643
6644    /// Output only. Link to tf-error.ndjson file, which contains the full list of
6645    /// the errors encountered during a Terraform preview.
6646    /// Format: `gs://{bucket}/{object}`.
6647    pub error_logs: std::string::String,
6648
6649    /// Output only. Artifacts from preview.
6650    pub preview_artifacts: std::option::Option<crate::model::PreviewArtifacts>,
6651
6652    /// Output only. Location of preview logs in `gs://{bucket}/{object}` format.
6653    pub logs: std::string::String,
6654
6655    /// Output only. The current Terraform version set on the preview.
6656    /// It is in the format of "Major.Minor.Patch", for example, "1.3.10".
6657    pub tf_version: std::string::String,
6658
6659    /// Optional. The user-specified Terraform version constraint.
6660    /// Example: "=1.3.10".
6661    pub tf_version_constraint: std::option::Option<std::string::String>,
6662
6663    /// Optional. Arbitrary key-value metadata storage e.g. to help client tools
6664    /// identify preview during automation. See
6665    /// <https://google.aip.dev/148#annotations> for details on format and size
6666    /// limitations.
6667    pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
6668
6669    /// Optional. This field specifies the provider configurations.
6670    pub provider_config: std::option::Option<crate::model::ProviderConfig>,
6671
6672    /// Blueprint to preview.
6673    pub blueprint: std::option::Option<crate::model::preview::Blueprint>,
6674
6675    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6676}
6677
6678impl Preview {
6679    /// Creates a new default instance.
6680    pub fn new() -> Self {
6681        std::default::Default::default()
6682    }
6683
6684    /// Sets the value of [name][crate::model::Preview::name].
6685    ///
6686    /// # Example
6687    /// ```ignore,no_run
6688    /// # use google_cloud_config_v1::model::Preview;
6689    /// # let project_id = "project_id";
6690    /// # let location_id = "location_id";
6691    /// # let preview_id = "preview_id";
6692    /// let x = Preview::new().set_name(format!("projects/{project_id}/locations/{location_id}/previews/{preview_id}"));
6693    /// ```
6694    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6695        self.name = v.into();
6696        self
6697    }
6698
6699    /// Sets the value of [create_time][crate::model::Preview::create_time].
6700    ///
6701    /// # Example
6702    /// ```ignore,no_run
6703    /// # use google_cloud_config_v1::model::Preview;
6704    /// use wkt::Timestamp;
6705    /// let x = Preview::new().set_create_time(Timestamp::default()/* use setters */);
6706    /// ```
6707    pub fn set_create_time<T>(mut self, v: T) -> Self
6708    where
6709        T: std::convert::Into<wkt::Timestamp>,
6710    {
6711        self.create_time = std::option::Option::Some(v.into());
6712        self
6713    }
6714
6715    /// Sets or clears the value of [create_time][crate::model::Preview::create_time].
6716    ///
6717    /// # Example
6718    /// ```ignore,no_run
6719    /// # use google_cloud_config_v1::model::Preview;
6720    /// use wkt::Timestamp;
6721    /// let x = Preview::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
6722    /// let x = Preview::new().set_or_clear_create_time(None::<Timestamp>);
6723    /// ```
6724    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
6725    where
6726        T: std::convert::Into<wkt::Timestamp>,
6727    {
6728        self.create_time = v.map(|x| x.into());
6729        self
6730    }
6731
6732    /// Sets the value of [labels][crate::model::Preview::labels].
6733    ///
6734    /// # Example
6735    /// ```ignore,no_run
6736    /// # use google_cloud_config_v1::model::Preview;
6737    /// let x = Preview::new().set_labels([
6738    ///     ("key0", "abc"),
6739    ///     ("key1", "xyz"),
6740    /// ]);
6741    /// ```
6742    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
6743    where
6744        T: std::iter::IntoIterator<Item = (K, V)>,
6745        K: std::convert::Into<std::string::String>,
6746        V: std::convert::Into<std::string::String>,
6747    {
6748        use std::iter::Iterator;
6749        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
6750        self
6751    }
6752
6753    /// Sets the value of [state][crate::model::Preview::state].
6754    ///
6755    /// # Example
6756    /// ```ignore,no_run
6757    /// # use google_cloud_config_v1::model::Preview;
6758    /// use google_cloud_config_v1::model::preview::State;
6759    /// let x0 = Preview::new().set_state(State::Creating);
6760    /// let x1 = Preview::new().set_state(State::Succeeded);
6761    /// let x2 = Preview::new().set_state(State::Applying);
6762    /// ```
6763    pub fn set_state<T: std::convert::Into<crate::model::preview::State>>(mut self, v: T) -> Self {
6764        self.state = v.into();
6765        self
6766    }
6767
6768    /// Sets the value of [deployment][crate::model::Preview::deployment].
6769    ///
6770    /// # Example
6771    /// ```ignore,no_run
6772    /// # use google_cloud_config_v1::model::Preview;
6773    /// # let project_id = "project_id";
6774    /// # let location_id = "location_id";
6775    /// # let deployment_id = "deployment_id";
6776    /// let x = Preview::new().set_deployment(format!("projects/{project_id}/locations/{location_id}/deployments/{deployment_id}"));
6777    /// ```
6778    pub fn set_deployment<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6779        self.deployment = v.into();
6780        self
6781    }
6782
6783    /// Sets the value of [preview_mode][crate::model::Preview::preview_mode].
6784    ///
6785    /// # Example
6786    /// ```ignore,no_run
6787    /// # use google_cloud_config_v1::model::Preview;
6788    /// use google_cloud_config_v1::model::preview::PreviewMode;
6789    /// let x0 = Preview::new().set_preview_mode(PreviewMode::Default);
6790    /// let x1 = Preview::new().set_preview_mode(PreviewMode::Delete);
6791    /// ```
6792    pub fn set_preview_mode<T: std::convert::Into<crate::model::preview::PreviewMode>>(
6793        mut self,
6794        v: T,
6795    ) -> Self {
6796        self.preview_mode = v.into();
6797        self
6798    }
6799
6800    /// Sets the value of [service_account][crate::model::Preview::service_account].
6801    ///
6802    /// # Example
6803    /// ```ignore,no_run
6804    /// # use google_cloud_config_v1::model::Preview;
6805    /// let x = Preview::new().set_service_account("example");
6806    /// ```
6807    pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6808        self.service_account = v.into();
6809        self
6810    }
6811
6812    /// Sets the value of [artifacts_gcs_bucket][crate::model::Preview::artifacts_gcs_bucket].
6813    ///
6814    /// # Example
6815    /// ```ignore,no_run
6816    /// # use google_cloud_config_v1::model::Preview;
6817    /// let x = Preview::new().set_artifacts_gcs_bucket("example");
6818    /// ```
6819    pub fn set_artifacts_gcs_bucket<T>(mut self, v: T) -> Self
6820    where
6821        T: std::convert::Into<std::string::String>,
6822    {
6823        self.artifacts_gcs_bucket = std::option::Option::Some(v.into());
6824        self
6825    }
6826
6827    /// Sets or clears the value of [artifacts_gcs_bucket][crate::model::Preview::artifacts_gcs_bucket].
6828    ///
6829    /// # Example
6830    /// ```ignore,no_run
6831    /// # use google_cloud_config_v1::model::Preview;
6832    /// let x = Preview::new().set_or_clear_artifacts_gcs_bucket(Some("example"));
6833    /// let x = Preview::new().set_or_clear_artifacts_gcs_bucket(None::<String>);
6834    /// ```
6835    pub fn set_or_clear_artifacts_gcs_bucket<T>(mut self, v: std::option::Option<T>) -> Self
6836    where
6837        T: std::convert::Into<std::string::String>,
6838    {
6839        self.artifacts_gcs_bucket = v.map(|x| x.into());
6840        self
6841    }
6842
6843    /// Sets the value of [worker_pool][crate::model::Preview::worker_pool].
6844    ///
6845    /// # Example
6846    /// ```ignore,no_run
6847    /// # use google_cloud_config_v1::model::Preview;
6848    /// let x = Preview::new().set_worker_pool("example");
6849    /// ```
6850    pub fn set_worker_pool<T>(mut self, v: T) -> Self
6851    where
6852        T: std::convert::Into<std::string::String>,
6853    {
6854        self.worker_pool = std::option::Option::Some(v.into());
6855        self
6856    }
6857
6858    /// Sets or clears the value of [worker_pool][crate::model::Preview::worker_pool].
6859    ///
6860    /// # Example
6861    /// ```ignore,no_run
6862    /// # use google_cloud_config_v1::model::Preview;
6863    /// let x = Preview::new().set_or_clear_worker_pool(Some("example"));
6864    /// let x = Preview::new().set_or_clear_worker_pool(None::<String>);
6865    /// ```
6866    pub fn set_or_clear_worker_pool<T>(mut self, v: std::option::Option<T>) -> Self
6867    where
6868        T: std::convert::Into<std::string::String>,
6869    {
6870        self.worker_pool = v.map(|x| x.into());
6871        self
6872    }
6873
6874    /// Sets the value of [error_code][crate::model::Preview::error_code].
6875    ///
6876    /// # Example
6877    /// ```ignore,no_run
6878    /// # use google_cloud_config_v1::model::Preview;
6879    /// use google_cloud_config_v1::model::preview::ErrorCode;
6880    /// let x0 = Preview::new().set_error_code(ErrorCode::CloudBuildPermissionDenied);
6881    /// let x1 = Preview::new().set_error_code(ErrorCode::BucketCreationPermissionDenied);
6882    /// let x2 = Preview::new().set_error_code(ErrorCode::BucketCreationFailed);
6883    /// ```
6884    pub fn set_error_code<T: std::convert::Into<crate::model::preview::ErrorCode>>(
6885        mut self,
6886        v: T,
6887    ) -> Self {
6888        self.error_code = v.into();
6889        self
6890    }
6891
6892    /// Sets the value of [error_status][crate::model::Preview::error_status].
6893    ///
6894    /// # Example
6895    /// ```ignore,no_run
6896    /// # use google_cloud_config_v1::model::Preview;
6897    /// use google_cloud_rpc::model::Status;
6898    /// let x = Preview::new().set_error_status(Status::default()/* use setters */);
6899    /// ```
6900    pub fn set_error_status<T>(mut self, v: T) -> Self
6901    where
6902        T: std::convert::Into<google_cloud_rpc::model::Status>,
6903    {
6904        self.error_status = std::option::Option::Some(v.into());
6905        self
6906    }
6907
6908    /// Sets or clears the value of [error_status][crate::model::Preview::error_status].
6909    ///
6910    /// # Example
6911    /// ```ignore,no_run
6912    /// # use google_cloud_config_v1::model::Preview;
6913    /// use google_cloud_rpc::model::Status;
6914    /// let x = Preview::new().set_or_clear_error_status(Some(Status::default()/* use setters */));
6915    /// let x = Preview::new().set_or_clear_error_status(None::<Status>);
6916    /// ```
6917    pub fn set_or_clear_error_status<T>(mut self, v: std::option::Option<T>) -> Self
6918    where
6919        T: std::convert::Into<google_cloud_rpc::model::Status>,
6920    {
6921        self.error_status = v.map(|x| x.into());
6922        self
6923    }
6924
6925    /// Sets the value of [build][crate::model::Preview::build].
6926    ///
6927    /// # Example
6928    /// ```ignore,no_run
6929    /// # use google_cloud_config_v1::model::Preview;
6930    /// let x = Preview::new().set_build("example");
6931    /// ```
6932    pub fn set_build<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6933        self.build = v.into();
6934        self
6935    }
6936
6937    /// Sets the value of [tf_errors][crate::model::Preview::tf_errors].
6938    ///
6939    /// # Example
6940    /// ```ignore,no_run
6941    /// # use google_cloud_config_v1::model::Preview;
6942    /// use google_cloud_config_v1::model::TerraformError;
6943    /// let x = Preview::new()
6944    ///     .set_tf_errors([
6945    ///         TerraformError::default()/* use setters */,
6946    ///         TerraformError::default()/* use (different) setters */,
6947    ///     ]);
6948    /// ```
6949    pub fn set_tf_errors<T, V>(mut self, v: T) -> Self
6950    where
6951        T: std::iter::IntoIterator<Item = V>,
6952        V: std::convert::Into<crate::model::TerraformError>,
6953    {
6954        use std::iter::Iterator;
6955        self.tf_errors = v.into_iter().map(|i| i.into()).collect();
6956        self
6957    }
6958
6959    /// Sets the value of [error_logs][crate::model::Preview::error_logs].
6960    ///
6961    /// # Example
6962    /// ```ignore,no_run
6963    /// # use google_cloud_config_v1::model::Preview;
6964    /// let x = Preview::new().set_error_logs("example");
6965    /// ```
6966    pub fn set_error_logs<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6967        self.error_logs = v.into();
6968        self
6969    }
6970
6971    /// Sets the value of [preview_artifacts][crate::model::Preview::preview_artifacts].
6972    ///
6973    /// # Example
6974    /// ```ignore,no_run
6975    /// # use google_cloud_config_v1::model::Preview;
6976    /// use google_cloud_config_v1::model::PreviewArtifacts;
6977    /// let x = Preview::new().set_preview_artifacts(PreviewArtifacts::default()/* use setters */);
6978    /// ```
6979    pub fn set_preview_artifacts<T>(mut self, v: T) -> Self
6980    where
6981        T: std::convert::Into<crate::model::PreviewArtifacts>,
6982    {
6983        self.preview_artifacts = std::option::Option::Some(v.into());
6984        self
6985    }
6986
6987    /// Sets or clears the value of [preview_artifacts][crate::model::Preview::preview_artifacts].
6988    ///
6989    /// # Example
6990    /// ```ignore,no_run
6991    /// # use google_cloud_config_v1::model::Preview;
6992    /// use google_cloud_config_v1::model::PreviewArtifacts;
6993    /// let x = Preview::new().set_or_clear_preview_artifacts(Some(PreviewArtifacts::default()/* use setters */));
6994    /// let x = Preview::new().set_or_clear_preview_artifacts(None::<PreviewArtifacts>);
6995    /// ```
6996    pub fn set_or_clear_preview_artifacts<T>(mut self, v: std::option::Option<T>) -> Self
6997    where
6998        T: std::convert::Into<crate::model::PreviewArtifacts>,
6999    {
7000        self.preview_artifacts = v.map(|x| x.into());
7001        self
7002    }
7003
7004    /// Sets the value of [logs][crate::model::Preview::logs].
7005    ///
7006    /// # Example
7007    /// ```ignore,no_run
7008    /// # use google_cloud_config_v1::model::Preview;
7009    /// let x = Preview::new().set_logs("example");
7010    /// ```
7011    pub fn set_logs<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7012        self.logs = v.into();
7013        self
7014    }
7015
7016    /// Sets the value of [tf_version][crate::model::Preview::tf_version].
7017    ///
7018    /// # Example
7019    /// ```ignore,no_run
7020    /// # use google_cloud_config_v1::model::Preview;
7021    /// let x = Preview::new().set_tf_version("example");
7022    /// ```
7023    pub fn set_tf_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7024        self.tf_version = v.into();
7025        self
7026    }
7027
7028    /// Sets the value of [tf_version_constraint][crate::model::Preview::tf_version_constraint].
7029    ///
7030    /// # Example
7031    /// ```ignore,no_run
7032    /// # use google_cloud_config_v1::model::Preview;
7033    /// let x = Preview::new().set_tf_version_constraint("example");
7034    /// ```
7035    pub fn set_tf_version_constraint<T>(mut self, v: T) -> Self
7036    where
7037        T: std::convert::Into<std::string::String>,
7038    {
7039        self.tf_version_constraint = std::option::Option::Some(v.into());
7040        self
7041    }
7042
7043    /// Sets or clears the value of [tf_version_constraint][crate::model::Preview::tf_version_constraint].
7044    ///
7045    /// # Example
7046    /// ```ignore,no_run
7047    /// # use google_cloud_config_v1::model::Preview;
7048    /// let x = Preview::new().set_or_clear_tf_version_constraint(Some("example"));
7049    /// let x = Preview::new().set_or_clear_tf_version_constraint(None::<String>);
7050    /// ```
7051    pub fn set_or_clear_tf_version_constraint<T>(mut self, v: std::option::Option<T>) -> Self
7052    where
7053        T: std::convert::Into<std::string::String>,
7054    {
7055        self.tf_version_constraint = v.map(|x| x.into());
7056        self
7057    }
7058
7059    /// Sets the value of [annotations][crate::model::Preview::annotations].
7060    ///
7061    /// # Example
7062    /// ```ignore,no_run
7063    /// # use google_cloud_config_v1::model::Preview;
7064    /// let x = Preview::new().set_annotations([
7065    ///     ("key0", "abc"),
7066    ///     ("key1", "xyz"),
7067    /// ]);
7068    /// ```
7069    pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
7070    where
7071        T: std::iter::IntoIterator<Item = (K, V)>,
7072        K: std::convert::Into<std::string::String>,
7073        V: std::convert::Into<std::string::String>,
7074    {
7075        use std::iter::Iterator;
7076        self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7077        self
7078    }
7079
7080    /// Sets the value of [provider_config][crate::model::Preview::provider_config].
7081    ///
7082    /// # Example
7083    /// ```ignore,no_run
7084    /// # use google_cloud_config_v1::model::Preview;
7085    /// use google_cloud_config_v1::model::ProviderConfig;
7086    /// let x = Preview::new().set_provider_config(ProviderConfig::default()/* use setters */);
7087    /// ```
7088    pub fn set_provider_config<T>(mut self, v: T) -> Self
7089    where
7090        T: std::convert::Into<crate::model::ProviderConfig>,
7091    {
7092        self.provider_config = std::option::Option::Some(v.into());
7093        self
7094    }
7095
7096    /// Sets or clears the value of [provider_config][crate::model::Preview::provider_config].
7097    ///
7098    /// # Example
7099    /// ```ignore,no_run
7100    /// # use google_cloud_config_v1::model::Preview;
7101    /// use google_cloud_config_v1::model::ProviderConfig;
7102    /// let x = Preview::new().set_or_clear_provider_config(Some(ProviderConfig::default()/* use setters */));
7103    /// let x = Preview::new().set_or_clear_provider_config(None::<ProviderConfig>);
7104    /// ```
7105    pub fn set_or_clear_provider_config<T>(mut self, v: std::option::Option<T>) -> Self
7106    where
7107        T: std::convert::Into<crate::model::ProviderConfig>,
7108    {
7109        self.provider_config = v.map(|x| x.into());
7110        self
7111    }
7112
7113    /// Sets the value of [blueprint][crate::model::Preview::blueprint].
7114    ///
7115    /// Note that all the setters affecting `blueprint` are mutually
7116    /// exclusive.
7117    ///
7118    /// # Example
7119    /// ```ignore,no_run
7120    /// # use google_cloud_config_v1::model::Preview;
7121    /// use google_cloud_config_v1::model::TerraformBlueprint;
7122    /// let x = Preview::new().set_blueprint(Some(
7123    ///     google_cloud_config_v1::model::preview::Blueprint::TerraformBlueprint(TerraformBlueprint::default().into())));
7124    /// ```
7125    pub fn set_blueprint<
7126        T: std::convert::Into<std::option::Option<crate::model::preview::Blueprint>>,
7127    >(
7128        mut self,
7129        v: T,
7130    ) -> Self {
7131        self.blueprint = v.into();
7132        self
7133    }
7134
7135    /// The value of [blueprint][crate::model::Preview::blueprint]
7136    /// if it holds a `TerraformBlueprint`, `None` if the field is not set or
7137    /// holds a different branch.
7138    pub fn terraform_blueprint(
7139        &self,
7140    ) -> std::option::Option<&std::boxed::Box<crate::model::TerraformBlueprint>> {
7141        #[allow(unreachable_patterns)]
7142        self.blueprint.as_ref().and_then(|v| match v {
7143            crate::model::preview::Blueprint::TerraformBlueprint(v) => std::option::Option::Some(v),
7144            _ => std::option::Option::None,
7145        })
7146    }
7147
7148    /// Sets the value of [blueprint][crate::model::Preview::blueprint]
7149    /// to hold a `TerraformBlueprint`.
7150    ///
7151    /// Note that all the setters affecting `blueprint` are
7152    /// mutually exclusive.
7153    ///
7154    /// # Example
7155    /// ```ignore,no_run
7156    /// # use google_cloud_config_v1::model::Preview;
7157    /// use google_cloud_config_v1::model::TerraformBlueprint;
7158    /// let x = Preview::new().set_terraform_blueprint(TerraformBlueprint::default()/* use setters */);
7159    /// assert!(x.terraform_blueprint().is_some());
7160    /// ```
7161    pub fn set_terraform_blueprint<
7162        T: std::convert::Into<std::boxed::Box<crate::model::TerraformBlueprint>>,
7163    >(
7164        mut self,
7165        v: T,
7166    ) -> Self {
7167        self.blueprint = std::option::Option::Some(
7168            crate::model::preview::Blueprint::TerraformBlueprint(v.into()),
7169        );
7170        self
7171    }
7172}
7173
7174impl wkt::message::Message for Preview {
7175    fn typename() -> &'static str {
7176        "type.googleapis.com/google.cloud.config.v1.Preview"
7177    }
7178}
7179
7180/// Defines additional types related to [Preview].
7181pub mod preview {
7182    #[allow(unused_imports)]
7183    use super::*;
7184
7185    /// Possible states of a preview.
7186    ///
7187    /// # Working with unknown values
7188    ///
7189    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7190    /// additional enum variants at any time. Adding new variants is not considered
7191    /// a breaking change. Applications should write their code in anticipation of:
7192    ///
7193    /// - New values appearing in future releases of the client library, **and**
7194    /// - New values received dynamically, without application changes.
7195    ///
7196    /// Please consult the [Working with enums] section in the user guide for some
7197    /// guidelines.
7198    ///
7199    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
7200    #[derive(Clone, Debug, PartialEq)]
7201    #[non_exhaustive]
7202    pub enum State {
7203        /// The default value. This value is used if the state is unknown.
7204        Unspecified,
7205        /// The preview is being created.
7206        Creating,
7207        /// The preview has succeeded.
7208        Succeeded,
7209        /// The preview is being applied.
7210        Applying,
7211        /// The preview is stale. A preview can become stale if a revision has been
7212        /// applied after this preview was created.
7213        Stale,
7214        /// The preview is being deleted.
7215        Deleting,
7216        /// The preview has encountered an unexpected error.
7217        Failed,
7218        /// The preview has been deleted.
7219        Deleted,
7220        /// If set, the enum was initialized with an unknown value.
7221        ///
7222        /// Applications can examine the value using [State::value] or
7223        /// [State::name].
7224        UnknownValue(state::UnknownValue),
7225    }
7226
7227    #[doc(hidden)]
7228    pub mod state {
7229        #[allow(unused_imports)]
7230        use super::*;
7231        #[derive(Clone, Debug, PartialEq)]
7232        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7233    }
7234
7235    impl State {
7236        /// Gets the enum value.
7237        ///
7238        /// Returns `None` if the enum contains an unknown value deserialized from
7239        /// the string representation of enums.
7240        pub fn value(&self) -> std::option::Option<i32> {
7241            match self {
7242                Self::Unspecified => std::option::Option::Some(0),
7243                Self::Creating => std::option::Option::Some(1),
7244                Self::Succeeded => std::option::Option::Some(2),
7245                Self::Applying => std::option::Option::Some(3),
7246                Self::Stale => std::option::Option::Some(4),
7247                Self::Deleting => std::option::Option::Some(5),
7248                Self::Failed => std::option::Option::Some(6),
7249                Self::Deleted => std::option::Option::Some(7),
7250                Self::UnknownValue(u) => u.0.value(),
7251            }
7252        }
7253
7254        /// Gets the enum value as a string.
7255        ///
7256        /// Returns `None` if the enum contains an unknown value deserialized from
7257        /// the integer representation of enums.
7258        pub fn name(&self) -> std::option::Option<&str> {
7259            match self {
7260                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
7261                Self::Creating => std::option::Option::Some("CREATING"),
7262                Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
7263                Self::Applying => std::option::Option::Some("APPLYING"),
7264                Self::Stale => std::option::Option::Some("STALE"),
7265                Self::Deleting => std::option::Option::Some("DELETING"),
7266                Self::Failed => std::option::Option::Some("FAILED"),
7267                Self::Deleted => std::option::Option::Some("DELETED"),
7268                Self::UnknownValue(u) => u.0.name(),
7269            }
7270        }
7271    }
7272
7273    impl std::default::Default for State {
7274        fn default() -> Self {
7275            use std::convert::From;
7276            Self::from(0)
7277        }
7278    }
7279
7280    impl std::fmt::Display for State {
7281        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7282            wkt::internal::display_enum(f, self.name(), self.value())
7283        }
7284    }
7285
7286    impl std::convert::From<i32> for State {
7287        fn from(value: i32) -> Self {
7288            match value {
7289                0 => Self::Unspecified,
7290                1 => Self::Creating,
7291                2 => Self::Succeeded,
7292                3 => Self::Applying,
7293                4 => Self::Stale,
7294                5 => Self::Deleting,
7295                6 => Self::Failed,
7296                7 => Self::Deleted,
7297                _ => Self::UnknownValue(state::UnknownValue(
7298                    wkt::internal::UnknownEnumValue::Integer(value),
7299                )),
7300            }
7301        }
7302    }
7303
7304    impl std::convert::From<&str> for State {
7305        fn from(value: &str) -> Self {
7306            use std::string::ToString;
7307            match value {
7308                "STATE_UNSPECIFIED" => Self::Unspecified,
7309                "CREATING" => Self::Creating,
7310                "SUCCEEDED" => Self::Succeeded,
7311                "APPLYING" => Self::Applying,
7312                "STALE" => Self::Stale,
7313                "DELETING" => Self::Deleting,
7314                "FAILED" => Self::Failed,
7315                "DELETED" => Self::Deleted,
7316                _ => Self::UnknownValue(state::UnknownValue(
7317                    wkt::internal::UnknownEnumValue::String(value.to_string()),
7318                )),
7319            }
7320        }
7321    }
7322
7323    impl serde::ser::Serialize for State {
7324        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7325        where
7326            S: serde::Serializer,
7327        {
7328            match self {
7329                Self::Unspecified => serializer.serialize_i32(0),
7330                Self::Creating => serializer.serialize_i32(1),
7331                Self::Succeeded => serializer.serialize_i32(2),
7332                Self::Applying => serializer.serialize_i32(3),
7333                Self::Stale => serializer.serialize_i32(4),
7334                Self::Deleting => serializer.serialize_i32(5),
7335                Self::Failed => serializer.serialize_i32(6),
7336                Self::Deleted => serializer.serialize_i32(7),
7337                Self::UnknownValue(u) => u.0.serialize(serializer),
7338            }
7339        }
7340    }
7341
7342    impl<'de> serde::de::Deserialize<'de> for State {
7343        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7344        where
7345            D: serde::Deserializer<'de>,
7346        {
7347            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
7348                ".google.cloud.config.v1.Preview.State",
7349            ))
7350        }
7351    }
7352
7353    /// Preview mode provides options for customizing preview operations.
7354    ///
7355    /// # Working with unknown values
7356    ///
7357    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7358    /// additional enum variants at any time. Adding new variants is not considered
7359    /// a breaking change. Applications should write their code in anticipation of:
7360    ///
7361    /// - New values appearing in future releases of the client library, **and**
7362    /// - New values received dynamically, without application changes.
7363    ///
7364    /// Please consult the [Working with enums] section in the user guide for some
7365    /// guidelines.
7366    ///
7367    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
7368    #[derive(Clone, Debug, PartialEq)]
7369    #[non_exhaustive]
7370    pub enum PreviewMode {
7371        /// Unspecified policy, default mode will be used.
7372        Unspecified,
7373        /// DEFAULT mode generates an execution plan for reconciling current resource
7374        /// state into expected resource state.
7375        Default,
7376        /// DELETE mode generates as execution plan for destroying current resources.
7377        Delete,
7378        /// If set, the enum was initialized with an unknown value.
7379        ///
7380        /// Applications can examine the value using [PreviewMode::value] or
7381        /// [PreviewMode::name].
7382        UnknownValue(preview_mode::UnknownValue),
7383    }
7384
7385    #[doc(hidden)]
7386    pub mod preview_mode {
7387        #[allow(unused_imports)]
7388        use super::*;
7389        #[derive(Clone, Debug, PartialEq)]
7390        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7391    }
7392
7393    impl PreviewMode {
7394        /// Gets the enum value.
7395        ///
7396        /// Returns `None` if the enum contains an unknown value deserialized from
7397        /// the string representation of enums.
7398        pub fn value(&self) -> std::option::Option<i32> {
7399            match self {
7400                Self::Unspecified => std::option::Option::Some(0),
7401                Self::Default => std::option::Option::Some(1),
7402                Self::Delete => std::option::Option::Some(2),
7403                Self::UnknownValue(u) => u.0.value(),
7404            }
7405        }
7406
7407        /// Gets the enum value as a string.
7408        ///
7409        /// Returns `None` if the enum contains an unknown value deserialized from
7410        /// the integer representation of enums.
7411        pub fn name(&self) -> std::option::Option<&str> {
7412            match self {
7413                Self::Unspecified => std::option::Option::Some("PREVIEW_MODE_UNSPECIFIED"),
7414                Self::Default => std::option::Option::Some("DEFAULT"),
7415                Self::Delete => std::option::Option::Some("DELETE"),
7416                Self::UnknownValue(u) => u.0.name(),
7417            }
7418        }
7419    }
7420
7421    impl std::default::Default for PreviewMode {
7422        fn default() -> Self {
7423            use std::convert::From;
7424            Self::from(0)
7425        }
7426    }
7427
7428    impl std::fmt::Display for PreviewMode {
7429        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7430            wkt::internal::display_enum(f, self.name(), self.value())
7431        }
7432    }
7433
7434    impl std::convert::From<i32> for PreviewMode {
7435        fn from(value: i32) -> Self {
7436            match value {
7437                0 => Self::Unspecified,
7438                1 => Self::Default,
7439                2 => Self::Delete,
7440                _ => Self::UnknownValue(preview_mode::UnknownValue(
7441                    wkt::internal::UnknownEnumValue::Integer(value),
7442                )),
7443            }
7444        }
7445    }
7446
7447    impl std::convert::From<&str> for PreviewMode {
7448        fn from(value: &str) -> Self {
7449            use std::string::ToString;
7450            match value {
7451                "PREVIEW_MODE_UNSPECIFIED" => Self::Unspecified,
7452                "DEFAULT" => Self::Default,
7453                "DELETE" => Self::Delete,
7454                _ => Self::UnknownValue(preview_mode::UnknownValue(
7455                    wkt::internal::UnknownEnumValue::String(value.to_string()),
7456                )),
7457            }
7458        }
7459    }
7460
7461    impl serde::ser::Serialize for PreviewMode {
7462        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7463        where
7464            S: serde::Serializer,
7465        {
7466            match self {
7467                Self::Unspecified => serializer.serialize_i32(0),
7468                Self::Default => serializer.serialize_i32(1),
7469                Self::Delete => serializer.serialize_i32(2),
7470                Self::UnknownValue(u) => u.0.serialize(serializer),
7471            }
7472        }
7473    }
7474
7475    impl<'de> serde::de::Deserialize<'de> for PreviewMode {
7476        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7477        where
7478            D: serde::Deserializer<'de>,
7479        {
7480            deserializer.deserialize_any(wkt::internal::EnumVisitor::<PreviewMode>::new(
7481                ".google.cloud.config.v1.Preview.PreviewMode",
7482            ))
7483        }
7484    }
7485
7486    /// Possible errors that can occur with previews.
7487    ///
7488    /// # Working with unknown values
7489    ///
7490    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7491    /// additional enum variants at any time. Adding new variants is not considered
7492    /// a breaking change. Applications should write their code in anticipation of:
7493    ///
7494    /// - New values appearing in future releases of the client library, **and**
7495    /// - New values received dynamically, without application changes.
7496    ///
7497    /// Please consult the [Working with enums] section in the user guide for some
7498    /// guidelines.
7499    ///
7500    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
7501    #[derive(Clone, Debug, PartialEq)]
7502    #[non_exhaustive]
7503    pub enum ErrorCode {
7504        /// No error code was specified.
7505        Unspecified,
7506        /// Cloud Build failed due to a permissions issue.
7507        CloudBuildPermissionDenied,
7508        /// Cloud Storage bucket failed to create due to a permissions issue.
7509        BucketCreationPermissionDenied,
7510        /// Cloud Storage bucket failed for a non-permissions-related issue.
7511        BucketCreationFailed,
7512        /// Acquiring lock on provided deployment reference failed.
7513        DeploymentLockAcquireFailed,
7514        /// Preview encountered an error when trying to access Cloud Build API.
7515        PreviewBuildApiFailed,
7516        /// Preview created a build but build failed and logs were generated.
7517        PreviewBuildRunFailed,
7518        /// Failed to import values from an external source.
7519        ExternalValueSourceImportFailed,
7520        /// If set, the enum was initialized with an unknown value.
7521        ///
7522        /// Applications can examine the value using [ErrorCode::value] or
7523        /// [ErrorCode::name].
7524        UnknownValue(error_code::UnknownValue),
7525    }
7526
7527    #[doc(hidden)]
7528    pub mod error_code {
7529        #[allow(unused_imports)]
7530        use super::*;
7531        #[derive(Clone, Debug, PartialEq)]
7532        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7533    }
7534
7535    impl ErrorCode {
7536        /// Gets the enum value.
7537        ///
7538        /// Returns `None` if the enum contains an unknown value deserialized from
7539        /// the string representation of enums.
7540        pub fn value(&self) -> std::option::Option<i32> {
7541            match self {
7542                Self::Unspecified => std::option::Option::Some(0),
7543                Self::CloudBuildPermissionDenied => std::option::Option::Some(1),
7544                Self::BucketCreationPermissionDenied => std::option::Option::Some(2),
7545                Self::BucketCreationFailed => std::option::Option::Some(3),
7546                Self::DeploymentLockAcquireFailed => std::option::Option::Some(4),
7547                Self::PreviewBuildApiFailed => std::option::Option::Some(5),
7548                Self::PreviewBuildRunFailed => std::option::Option::Some(6),
7549                Self::ExternalValueSourceImportFailed => std::option::Option::Some(7),
7550                Self::UnknownValue(u) => u.0.value(),
7551            }
7552        }
7553
7554        /// Gets the enum value as a string.
7555        ///
7556        /// Returns `None` if the enum contains an unknown value deserialized from
7557        /// the integer representation of enums.
7558        pub fn name(&self) -> std::option::Option<&str> {
7559            match self {
7560                Self::Unspecified => std::option::Option::Some("ERROR_CODE_UNSPECIFIED"),
7561                Self::CloudBuildPermissionDenied => {
7562                    std::option::Option::Some("CLOUD_BUILD_PERMISSION_DENIED")
7563                }
7564                Self::BucketCreationPermissionDenied => {
7565                    std::option::Option::Some("BUCKET_CREATION_PERMISSION_DENIED")
7566                }
7567                Self::BucketCreationFailed => std::option::Option::Some("BUCKET_CREATION_FAILED"),
7568                Self::DeploymentLockAcquireFailed => {
7569                    std::option::Option::Some("DEPLOYMENT_LOCK_ACQUIRE_FAILED")
7570                }
7571                Self::PreviewBuildApiFailed => {
7572                    std::option::Option::Some("PREVIEW_BUILD_API_FAILED")
7573                }
7574                Self::PreviewBuildRunFailed => {
7575                    std::option::Option::Some("PREVIEW_BUILD_RUN_FAILED")
7576                }
7577                Self::ExternalValueSourceImportFailed => {
7578                    std::option::Option::Some("EXTERNAL_VALUE_SOURCE_IMPORT_FAILED")
7579                }
7580                Self::UnknownValue(u) => u.0.name(),
7581            }
7582        }
7583    }
7584
7585    impl std::default::Default for ErrorCode {
7586        fn default() -> Self {
7587            use std::convert::From;
7588            Self::from(0)
7589        }
7590    }
7591
7592    impl std::fmt::Display for ErrorCode {
7593        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7594            wkt::internal::display_enum(f, self.name(), self.value())
7595        }
7596    }
7597
7598    impl std::convert::From<i32> for ErrorCode {
7599        fn from(value: i32) -> Self {
7600            match value {
7601                0 => Self::Unspecified,
7602                1 => Self::CloudBuildPermissionDenied,
7603                2 => Self::BucketCreationPermissionDenied,
7604                3 => Self::BucketCreationFailed,
7605                4 => Self::DeploymentLockAcquireFailed,
7606                5 => Self::PreviewBuildApiFailed,
7607                6 => Self::PreviewBuildRunFailed,
7608                7 => Self::ExternalValueSourceImportFailed,
7609                _ => Self::UnknownValue(error_code::UnknownValue(
7610                    wkt::internal::UnknownEnumValue::Integer(value),
7611                )),
7612            }
7613        }
7614    }
7615
7616    impl std::convert::From<&str> for ErrorCode {
7617        fn from(value: &str) -> Self {
7618            use std::string::ToString;
7619            match value {
7620                "ERROR_CODE_UNSPECIFIED" => Self::Unspecified,
7621                "CLOUD_BUILD_PERMISSION_DENIED" => Self::CloudBuildPermissionDenied,
7622                "BUCKET_CREATION_PERMISSION_DENIED" => Self::BucketCreationPermissionDenied,
7623                "BUCKET_CREATION_FAILED" => Self::BucketCreationFailed,
7624                "DEPLOYMENT_LOCK_ACQUIRE_FAILED" => Self::DeploymentLockAcquireFailed,
7625                "PREVIEW_BUILD_API_FAILED" => Self::PreviewBuildApiFailed,
7626                "PREVIEW_BUILD_RUN_FAILED" => Self::PreviewBuildRunFailed,
7627                "EXTERNAL_VALUE_SOURCE_IMPORT_FAILED" => Self::ExternalValueSourceImportFailed,
7628                _ => Self::UnknownValue(error_code::UnknownValue(
7629                    wkt::internal::UnknownEnumValue::String(value.to_string()),
7630                )),
7631            }
7632        }
7633    }
7634
7635    impl serde::ser::Serialize for ErrorCode {
7636        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7637        where
7638            S: serde::Serializer,
7639        {
7640            match self {
7641                Self::Unspecified => serializer.serialize_i32(0),
7642                Self::CloudBuildPermissionDenied => serializer.serialize_i32(1),
7643                Self::BucketCreationPermissionDenied => serializer.serialize_i32(2),
7644                Self::BucketCreationFailed => serializer.serialize_i32(3),
7645                Self::DeploymentLockAcquireFailed => serializer.serialize_i32(4),
7646                Self::PreviewBuildApiFailed => serializer.serialize_i32(5),
7647                Self::PreviewBuildRunFailed => serializer.serialize_i32(6),
7648                Self::ExternalValueSourceImportFailed => serializer.serialize_i32(7),
7649                Self::UnknownValue(u) => u.0.serialize(serializer),
7650            }
7651        }
7652    }
7653
7654    impl<'de> serde::de::Deserialize<'de> for ErrorCode {
7655        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7656        where
7657            D: serde::Deserializer<'de>,
7658        {
7659            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ErrorCode>::new(
7660                ".google.cloud.config.v1.Preview.ErrorCode",
7661            ))
7662        }
7663    }
7664
7665    /// Blueprint to preview.
7666    #[derive(Clone, Debug, PartialEq)]
7667    #[non_exhaustive]
7668    pub enum Blueprint {
7669        /// The terraform blueprint to preview.
7670        TerraformBlueprint(std::boxed::Box<crate::model::TerraformBlueprint>),
7671    }
7672}
7673
7674/// Ephemeral metadata content describing the state of a preview operation.
7675#[derive(Clone, Default, PartialEq)]
7676#[non_exhaustive]
7677pub struct PreviewOperationMetadata {
7678    /// The current step the preview operation is running.
7679    pub step: crate::model::preview_operation_metadata::PreviewStep,
7680
7681    /// Artifacts from preview.
7682    pub preview_artifacts: std::option::Option<crate::model::PreviewArtifacts>,
7683
7684    /// Output only. Location of preview logs in `gs://{bucket}/{object}` format.
7685    pub logs: std::string::String,
7686
7687    /// Output only. Cloud Build instance UUID associated with this preview.
7688    pub build: std::string::String,
7689
7690    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7691}
7692
7693impl PreviewOperationMetadata {
7694    /// Creates a new default instance.
7695    pub fn new() -> Self {
7696        std::default::Default::default()
7697    }
7698
7699    /// Sets the value of [step][crate::model::PreviewOperationMetadata::step].
7700    ///
7701    /// # Example
7702    /// ```ignore,no_run
7703    /// # use google_cloud_config_v1::model::PreviewOperationMetadata;
7704    /// use google_cloud_config_v1::model::preview_operation_metadata::PreviewStep;
7705    /// let x0 = PreviewOperationMetadata::new().set_step(PreviewStep::PreparingStorageBucket);
7706    /// let x1 = PreviewOperationMetadata::new().set_step(PreviewStep::DownloadingBlueprint);
7707    /// let x2 = PreviewOperationMetadata::new().set_step(PreviewStep::RunningTfInit);
7708    /// ```
7709    pub fn set_step<
7710        T: std::convert::Into<crate::model::preview_operation_metadata::PreviewStep>,
7711    >(
7712        mut self,
7713        v: T,
7714    ) -> Self {
7715        self.step = v.into();
7716        self
7717    }
7718
7719    /// Sets the value of [preview_artifacts][crate::model::PreviewOperationMetadata::preview_artifacts].
7720    ///
7721    /// # Example
7722    /// ```ignore,no_run
7723    /// # use google_cloud_config_v1::model::PreviewOperationMetadata;
7724    /// use google_cloud_config_v1::model::PreviewArtifacts;
7725    /// let x = PreviewOperationMetadata::new().set_preview_artifacts(PreviewArtifacts::default()/* use setters */);
7726    /// ```
7727    pub fn set_preview_artifacts<T>(mut self, v: T) -> Self
7728    where
7729        T: std::convert::Into<crate::model::PreviewArtifacts>,
7730    {
7731        self.preview_artifacts = std::option::Option::Some(v.into());
7732        self
7733    }
7734
7735    /// Sets or clears the value of [preview_artifacts][crate::model::PreviewOperationMetadata::preview_artifacts].
7736    ///
7737    /// # Example
7738    /// ```ignore,no_run
7739    /// # use google_cloud_config_v1::model::PreviewOperationMetadata;
7740    /// use google_cloud_config_v1::model::PreviewArtifacts;
7741    /// let x = PreviewOperationMetadata::new().set_or_clear_preview_artifacts(Some(PreviewArtifacts::default()/* use setters */));
7742    /// let x = PreviewOperationMetadata::new().set_or_clear_preview_artifacts(None::<PreviewArtifacts>);
7743    /// ```
7744    pub fn set_or_clear_preview_artifacts<T>(mut self, v: std::option::Option<T>) -> Self
7745    where
7746        T: std::convert::Into<crate::model::PreviewArtifacts>,
7747    {
7748        self.preview_artifacts = v.map(|x| x.into());
7749        self
7750    }
7751
7752    /// Sets the value of [logs][crate::model::PreviewOperationMetadata::logs].
7753    ///
7754    /// # Example
7755    /// ```ignore,no_run
7756    /// # use google_cloud_config_v1::model::PreviewOperationMetadata;
7757    /// let x = PreviewOperationMetadata::new().set_logs("example");
7758    /// ```
7759    pub fn set_logs<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7760        self.logs = v.into();
7761        self
7762    }
7763
7764    /// Sets the value of [build][crate::model::PreviewOperationMetadata::build].
7765    ///
7766    /// # Example
7767    /// ```ignore,no_run
7768    /// # use google_cloud_config_v1::model::PreviewOperationMetadata;
7769    /// let x = PreviewOperationMetadata::new().set_build("example");
7770    /// ```
7771    pub fn set_build<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7772        self.build = v.into();
7773        self
7774    }
7775}
7776
7777impl wkt::message::Message for PreviewOperationMetadata {
7778    fn typename() -> &'static str {
7779        "type.googleapis.com/google.cloud.config.v1.PreviewOperationMetadata"
7780    }
7781}
7782
7783/// Defines additional types related to [PreviewOperationMetadata].
7784pub mod preview_operation_metadata {
7785    #[allow(unused_imports)]
7786    use super::*;
7787
7788    /// The possible steps a preview may be running.
7789    ///
7790    /// # Working with unknown values
7791    ///
7792    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7793    /// additional enum variants at any time. Adding new variants is not considered
7794    /// a breaking change. Applications should write their code in anticipation of:
7795    ///
7796    /// - New values appearing in future releases of the client library, **and**
7797    /// - New values received dynamically, without application changes.
7798    ///
7799    /// Please consult the [Working with enums] section in the user guide for some
7800    /// guidelines.
7801    ///
7802    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
7803    #[derive(Clone, Debug, PartialEq)]
7804    #[non_exhaustive]
7805    pub enum PreviewStep {
7806        /// Unspecified preview step.
7807        Unspecified,
7808        /// Infra Manager is creating a Google Cloud Storage bucket to store
7809        /// artifacts and metadata about the preview.
7810        PreparingStorageBucket,
7811        /// Downloading the blueprint onto the Google Cloud Storage bucket.
7812        DownloadingBlueprint,
7813        /// Initializing Terraform using `terraform init`.
7814        RunningTfInit,
7815        /// Running `terraform plan`.
7816        RunningTfPlan,
7817        /// Fetching a deployment.
7818        FetchingDeployment,
7819        /// Locking a deployment.
7820        LockingDeployment,
7821        /// Unlocking a deployment.
7822        UnlockingDeployment,
7823        /// Operation was successful.
7824        Succeeded,
7825        /// Operation failed.
7826        Failed,
7827        /// Validating the provided repository.
7828        ValidatingRepository,
7829        /// If set, the enum was initialized with an unknown value.
7830        ///
7831        /// Applications can examine the value using [PreviewStep::value] or
7832        /// [PreviewStep::name].
7833        UnknownValue(preview_step::UnknownValue),
7834    }
7835
7836    #[doc(hidden)]
7837    pub mod preview_step {
7838        #[allow(unused_imports)]
7839        use super::*;
7840        #[derive(Clone, Debug, PartialEq)]
7841        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7842    }
7843
7844    impl PreviewStep {
7845        /// Gets the enum value.
7846        ///
7847        /// Returns `None` if the enum contains an unknown value deserialized from
7848        /// the string representation of enums.
7849        pub fn value(&self) -> std::option::Option<i32> {
7850            match self {
7851                Self::Unspecified => std::option::Option::Some(0),
7852                Self::PreparingStorageBucket => std::option::Option::Some(1),
7853                Self::DownloadingBlueprint => std::option::Option::Some(2),
7854                Self::RunningTfInit => std::option::Option::Some(3),
7855                Self::RunningTfPlan => std::option::Option::Some(4),
7856                Self::FetchingDeployment => std::option::Option::Some(5),
7857                Self::LockingDeployment => std::option::Option::Some(6),
7858                Self::UnlockingDeployment => std::option::Option::Some(7),
7859                Self::Succeeded => std::option::Option::Some(8),
7860                Self::Failed => std::option::Option::Some(9),
7861                Self::ValidatingRepository => std::option::Option::Some(10),
7862                Self::UnknownValue(u) => u.0.value(),
7863            }
7864        }
7865
7866        /// Gets the enum value as a string.
7867        ///
7868        /// Returns `None` if the enum contains an unknown value deserialized from
7869        /// the integer representation of enums.
7870        pub fn name(&self) -> std::option::Option<&str> {
7871            match self {
7872                Self::Unspecified => std::option::Option::Some("PREVIEW_STEP_UNSPECIFIED"),
7873                Self::PreparingStorageBucket => {
7874                    std::option::Option::Some("PREPARING_STORAGE_BUCKET")
7875                }
7876                Self::DownloadingBlueprint => std::option::Option::Some("DOWNLOADING_BLUEPRINT"),
7877                Self::RunningTfInit => std::option::Option::Some("RUNNING_TF_INIT"),
7878                Self::RunningTfPlan => std::option::Option::Some("RUNNING_TF_PLAN"),
7879                Self::FetchingDeployment => std::option::Option::Some("FETCHING_DEPLOYMENT"),
7880                Self::LockingDeployment => std::option::Option::Some("LOCKING_DEPLOYMENT"),
7881                Self::UnlockingDeployment => std::option::Option::Some("UNLOCKING_DEPLOYMENT"),
7882                Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
7883                Self::Failed => std::option::Option::Some("FAILED"),
7884                Self::ValidatingRepository => std::option::Option::Some("VALIDATING_REPOSITORY"),
7885                Self::UnknownValue(u) => u.0.name(),
7886            }
7887        }
7888    }
7889
7890    impl std::default::Default for PreviewStep {
7891        fn default() -> Self {
7892            use std::convert::From;
7893            Self::from(0)
7894        }
7895    }
7896
7897    impl std::fmt::Display for PreviewStep {
7898        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7899            wkt::internal::display_enum(f, self.name(), self.value())
7900        }
7901    }
7902
7903    impl std::convert::From<i32> for PreviewStep {
7904        fn from(value: i32) -> Self {
7905            match value {
7906                0 => Self::Unspecified,
7907                1 => Self::PreparingStorageBucket,
7908                2 => Self::DownloadingBlueprint,
7909                3 => Self::RunningTfInit,
7910                4 => Self::RunningTfPlan,
7911                5 => Self::FetchingDeployment,
7912                6 => Self::LockingDeployment,
7913                7 => Self::UnlockingDeployment,
7914                8 => Self::Succeeded,
7915                9 => Self::Failed,
7916                10 => Self::ValidatingRepository,
7917                _ => Self::UnknownValue(preview_step::UnknownValue(
7918                    wkt::internal::UnknownEnumValue::Integer(value),
7919                )),
7920            }
7921        }
7922    }
7923
7924    impl std::convert::From<&str> for PreviewStep {
7925        fn from(value: &str) -> Self {
7926            use std::string::ToString;
7927            match value {
7928                "PREVIEW_STEP_UNSPECIFIED" => Self::Unspecified,
7929                "PREPARING_STORAGE_BUCKET" => Self::PreparingStorageBucket,
7930                "DOWNLOADING_BLUEPRINT" => Self::DownloadingBlueprint,
7931                "RUNNING_TF_INIT" => Self::RunningTfInit,
7932                "RUNNING_TF_PLAN" => Self::RunningTfPlan,
7933                "FETCHING_DEPLOYMENT" => Self::FetchingDeployment,
7934                "LOCKING_DEPLOYMENT" => Self::LockingDeployment,
7935                "UNLOCKING_DEPLOYMENT" => Self::UnlockingDeployment,
7936                "SUCCEEDED" => Self::Succeeded,
7937                "FAILED" => Self::Failed,
7938                "VALIDATING_REPOSITORY" => Self::ValidatingRepository,
7939                _ => Self::UnknownValue(preview_step::UnknownValue(
7940                    wkt::internal::UnknownEnumValue::String(value.to_string()),
7941                )),
7942            }
7943        }
7944    }
7945
7946    impl serde::ser::Serialize for PreviewStep {
7947        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7948        where
7949            S: serde::Serializer,
7950        {
7951            match self {
7952                Self::Unspecified => serializer.serialize_i32(0),
7953                Self::PreparingStorageBucket => serializer.serialize_i32(1),
7954                Self::DownloadingBlueprint => serializer.serialize_i32(2),
7955                Self::RunningTfInit => serializer.serialize_i32(3),
7956                Self::RunningTfPlan => serializer.serialize_i32(4),
7957                Self::FetchingDeployment => serializer.serialize_i32(5),
7958                Self::LockingDeployment => serializer.serialize_i32(6),
7959                Self::UnlockingDeployment => serializer.serialize_i32(7),
7960                Self::Succeeded => serializer.serialize_i32(8),
7961                Self::Failed => serializer.serialize_i32(9),
7962                Self::ValidatingRepository => serializer.serialize_i32(10),
7963                Self::UnknownValue(u) => u.0.serialize(serializer),
7964            }
7965        }
7966    }
7967
7968    impl<'de> serde::de::Deserialize<'de> for PreviewStep {
7969        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7970        where
7971            D: serde::Deserializer<'de>,
7972        {
7973            deserializer.deserialize_any(wkt::internal::EnumVisitor::<PreviewStep>::new(
7974                ".google.cloud.config.v1.PreviewOperationMetadata.PreviewStep",
7975            ))
7976        }
7977    }
7978}
7979
7980/// Artifacts created by preview.
7981#[derive(Clone, Default, PartialEq)]
7982#[non_exhaustive]
7983pub struct PreviewArtifacts {
7984    /// Output only. Location of a blueprint copy and other content in Google Cloud
7985    /// Storage. Format: `gs://{bucket}/{object}`
7986    pub content: std::string::String,
7987
7988    /// Output only. Location of artifacts in Google Cloud Storage.
7989    /// Format: `gs://{bucket}/{object}`
7990    pub artifacts: std::string::String,
7991
7992    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7993}
7994
7995impl PreviewArtifacts {
7996    /// Creates a new default instance.
7997    pub fn new() -> Self {
7998        std::default::Default::default()
7999    }
8000
8001    /// Sets the value of [content][crate::model::PreviewArtifacts::content].
8002    ///
8003    /// # Example
8004    /// ```ignore,no_run
8005    /// # use google_cloud_config_v1::model::PreviewArtifacts;
8006    /// let x = PreviewArtifacts::new().set_content("example");
8007    /// ```
8008    pub fn set_content<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8009        self.content = v.into();
8010        self
8011    }
8012
8013    /// Sets the value of [artifacts][crate::model::PreviewArtifacts::artifacts].
8014    ///
8015    /// # Example
8016    /// ```ignore,no_run
8017    /// # use google_cloud_config_v1::model::PreviewArtifacts;
8018    /// let x = PreviewArtifacts::new().set_artifacts("example");
8019    /// ```
8020    pub fn set_artifacts<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8021        self.artifacts = v.into();
8022        self
8023    }
8024}
8025
8026impl wkt::message::Message for PreviewArtifacts {
8027    fn typename() -> &'static str {
8028        "type.googleapis.com/google.cloud.config.v1.PreviewArtifacts"
8029    }
8030}
8031
8032/// A request to create a preview.
8033#[derive(Clone, Default, PartialEq)]
8034#[non_exhaustive]
8035pub struct CreatePreviewRequest {
8036    /// Required. The parent in whose context the Preview is created. The parent
8037    /// value is in the format: 'projects/{project_id}/locations/{location}'.
8038    pub parent: std::string::String,
8039
8040    /// Optional. The preview ID.
8041    pub preview_id: std::string::String,
8042
8043    /// Required. [Preview][google.cloud.config.v1.Preview] resource to be created.
8044    ///
8045    /// [google.cloud.config.v1.Preview]: crate::model::Preview
8046    pub preview: std::option::Option<crate::model::Preview>,
8047
8048    /// Optional. An optional request ID to identify requests. Specify a unique
8049    /// request ID so that if you must retry your request, the server will know to
8050    /// ignore the request if it has already been completed. The server will
8051    /// guarantee that for at least 60 minutes since the first request.
8052    ///
8053    /// For example, consider a situation where you make an initial request and the
8054    /// request times out. If you make the request again with the same request ID,
8055    /// the server can check if original operation with the same request ID was
8056    /// received, and if so, will ignore the second request. This prevents clients
8057    /// from accidentally creating duplicate commitments.
8058    ///
8059    /// The request ID must be a valid UUID with the exception that zero UUID is
8060    /// not supported (00000000-0000-0000-0000-000000000000).
8061    pub request_id: std::string::String,
8062
8063    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8064}
8065
8066impl CreatePreviewRequest {
8067    /// Creates a new default instance.
8068    pub fn new() -> Self {
8069        std::default::Default::default()
8070    }
8071
8072    /// Sets the value of [parent][crate::model::CreatePreviewRequest::parent].
8073    ///
8074    /// # Example
8075    /// ```ignore,no_run
8076    /// # use google_cloud_config_v1::model::CreatePreviewRequest;
8077    /// let x = CreatePreviewRequest::new().set_parent("example");
8078    /// ```
8079    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8080        self.parent = v.into();
8081        self
8082    }
8083
8084    /// Sets the value of [preview_id][crate::model::CreatePreviewRequest::preview_id].
8085    ///
8086    /// # Example
8087    /// ```ignore,no_run
8088    /// # use google_cloud_config_v1::model::CreatePreviewRequest;
8089    /// let x = CreatePreviewRequest::new().set_preview_id("example");
8090    /// ```
8091    pub fn set_preview_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8092        self.preview_id = v.into();
8093        self
8094    }
8095
8096    /// Sets the value of [preview][crate::model::CreatePreviewRequest::preview].
8097    ///
8098    /// # Example
8099    /// ```ignore,no_run
8100    /// # use google_cloud_config_v1::model::CreatePreviewRequest;
8101    /// use google_cloud_config_v1::model::Preview;
8102    /// let x = CreatePreviewRequest::new().set_preview(Preview::default()/* use setters */);
8103    /// ```
8104    pub fn set_preview<T>(mut self, v: T) -> Self
8105    where
8106        T: std::convert::Into<crate::model::Preview>,
8107    {
8108        self.preview = std::option::Option::Some(v.into());
8109        self
8110    }
8111
8112    /// Sets or clears the value of [preview][crate::model::CreatePreviewRequest::preview].
8113    ///
8114    /// # Example
8115    /// ```ignore,no_run
8116    /// # use google_cloud_config_v1::model::CreatePreviewRequest;
8117    /// use google_cloud_config_v1::model::Preview;
8118    /// let x = CreatePreviewRequest::new().set_or_clear_preview(Some(Preview::default()/* use setters */));
8119    /// let x = CreatePreviewRequest::new().set_or_clear_preview(None::<Preview>);
8120    /// ```
8121    pub fn set_or_clear_preview<T>(mut self, v: std::option::Option<T>) -> Self
8122    where
8123        T: std::convert::Into<crate::model::Preview>,
8124    {
8125        self.preview = v.map(|x| x.into());
8126        self
8127    }
8128
8129    /// Sets the value of [request_id][crate::model::CreatePreviewRequest::request_id].
8130    ///
8131    /// # Example
8132    /// ```ignore,no_run
8133    /// # use google_cloud_config_v1::model::CreatePreviewRequest;
8134    /// let x = CreatePreviewRequest::new().set_request_id("example");
8135    /// ```
8136    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8137        self.request_id = v.into();
8138        self
8139    }
8140}
8141
8142impl wkt::message::Message for CreatePreviewRequest {
8143    fn typename() -> &'static str {
8144        "type.googleapis.com/google.cloud.config.v1.CreatePreviewRequest"
8145    }
8146}
8147
8148/// A request to get details about a preview.
8149#[derive(Clone, Default, PartialEq)]
8150#[non_exhaustive]
8151pub struct GetPreviewRequest {
8152    /// Required. The name of the preview. Format:
8153    /// 'projects/{project_id}/locations/{location}/previews/{preview}'.
8154    pub name: std::string::String,
8155
8156    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8157}
8158
8159impl GetPreviewRequest {
8160    /// Creates a new default instance.
8161    pub fn new() -> Self {
8162        std::default::Default::default()
8163    }
8164
8165    /// Sets the value of [name][crate::model::GetPreviewRequest::name].
8166    ///
8167    /// # Example
8168    /// ```ignore,no_run
8169    /// # use google_cloud_config_v1::model::GetPreviewRequest;
8170    /// # let project_id = "project_id";
8171    /// # let location_id = "location_id";
8172    /// # let preview_id = "preview_id";
8173    /// let x = GetPreviewRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/previews/{preview_id}"));
8174    /// ```
8175    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8176        self.name = v.into();
8177        self
8178    }
8179}
8180
8181impl wkt::message::Message for GetPreviewRequest {
8182    fn typename() -> &'static str {
8183        "type.googleapis.com/google.cloud.config.v1.GetPreviewRequest"
8184    }
8185}
8186
8187/// A request to list all previews for a given project and location.
8188#[derive(Clone, Default, PartialEq)]
8189#[non_exhaustive]
8190pub struct ListPreviewsRequest {
8191    /// Required. The parent in whose context the Previews are listed. The parent
8192    /// value is in the format: 'projects/{project_id}/locations/{location}'.
8193    pub parent: std::string::String,
8194
8195    /// Optional. When requesting a page of resources, 'page_size' specifies number
8196    /// of resources to return. If unspecified, at most 500 will be returned. The
8197    /// maximum value is 1000.
8198    pub page_size: i32,
8199
8200    /// Optional. Token returned by previous call to 'ListDeployments' which
8201    /// specifies the position in the list from where to continue listing the
8202    /// resources.
8203    pub page_token: std::string::String,
8204
8205    /// Optional. Lists the Deployments that match the filter expression. A filter
8206    /// expression filters the resources listed in the response. The expression
8207    /// must be of the form '{field} {operator} {value}' where operators: '<', '>',
8208    /// '<=', '>=', '!=', '=', ':' are supported (colon ':' represents a HAS
8209    /// operator which is roughly synonymous with equality). {field} can refer to a
8210    /// proto or JSON field, or a synthetic field. Field names can be camelCase or
8211    /// snake_case.
8212    ///
8213    /// Examples:
8214    ///
8215    /// - Filter by name:
8216    ///   name = "projects/foo/locations/us-central1/deployments/bar
8217    ///
8218    /// - Filter by labels:
8219    ///
8220    ///   - Resources that have a key called 'foo'
8221    ///     labels.foo:*
8222    ///   - Resources that have a key called 'foo' whose value is 'bar'
8223    ///     labels.foo = bar
8224    /// - Filter by state:
8225    ///
8226    ///   - Deployments in CREATING state.
8227    ///     state=CREATING
8228    pub filter: std::string::String,
8229
8230    /// Optional. Field to use to sort the list.
8231    pub order_by: std::string::String,
8232
8233    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8234}
8235
8236impl ListPreviewsRequest {
8237    /// Creates a new default instance.
8238    pub fn new() -> Self {
8239        std::default::Default::default()
8240    }
8241
8242    /// Sets the value of [parent][crate::model::ListPreviewsRequest::parent].
8243    ///
8244    /// # Example
8245    /// ```ignore,no_run
8246    /// # use google_cloud_config_v1::model::ListPreviewsRequest;
8247    /// let x = ListPreviewsRequest::new().set_parent("example");
8248    /// ```
8249    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8250        self.parent = v.into();
8251        self
8252    }
8253
8254    /// Sets the value of [page_size][crate::model::ListPreviewsRequest::page_size].
8255    ///
8256    /// # Example
8257    /// ```ignore,no_run
8258    /// # use google_cloud_config_v1::model::ListPreviewsRequest;
8259    /// let x = ListPreviewsRequest::new().set_page_size(42);
8260    /// ```
8261    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8262        self.page_size = v.into();
8263        self
8264    }
8265
8266    /// Sets the value of [page_token][crate::model::ListPreviewsRequest::page_token].
8267    ///
8268    /// # Example
8269    /// ```ignore,no_run
8270    /// # use google_cloud_config_v1::model::ListPreviewsRequest;
8271    /// let x = ListPreviewsRequest::new().set_page_token("example");
8272    /// ```
8273    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8274        self.page_token = v.into();
8275        self
8276    }
8277
8278    /// Sets the value of [filter][crate::model::ListPreviewsRequest::filter].
8279    ///
8280    /// # Example
8281    /// ```ignore,no_run
8282    /// # use google_cloud_config_v1::model::ListPreviewsRequest;
8283    /// let x = ListPreviewsRequest::new().set_filter("example");
8284    /// ```
8285    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8286        self.filter = v.into();
8287        self
8288    }
8289
8290    /// Sets the value of [order_by][crate::model::ListPreviewsRequest::order_by].
8291    ///
8292    /// # Example
8293    /// ```ignore,no_run
8294    /// # use google_cloud_config_v1::model::ListPreviewsRequest;
8295    /// let x = ListPreviewsRequest::new().set_order_by("example");
8296    /// ```
8297    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8298        self.order_by = v.into();
8299        self
8300    }
8301}
8302
8303impl wkt::message::Message for ListPreviewsRequest {
8304    fn typename() -> &'static str {
8305        "type.googleapis.com/google.cloud.config.v1.ListPreviewsRequest"
8306    }
8307}
8308
8309/// A response to a `ListPreviews` call. Contains a list of Previews.
8310#[derive(Clone, Default, PartialEq)]
8311#[non_exhaustive]
8312pub struct ListPreviewsResponse {
8313    /// List of [Previews][google.cloud.config.v1.Preview].
8314    ///
8315    /// [google.cloud.config.v1.Preview]: crate::model::Preview
8316    pub previews: std::vec::Vec<crate::model::Preview>,
8317
8318    /// Token to be supplied to the next ListPreviews request via `page_token`
8319    /// to obtain the next set of results.
8320    pub next_page_token: std::string::String,
8321
8322    /// Locations that could not be reached.
8323    pub unreachable: std::vec::Vec<std::string::String>,
8324
8325    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8326}
8327
8328impl ListPreviewsResponse {
8329    /// Creates a new default instance.
8330    pub fn new() -> Self {
8331        std::default::Default::default()
8332    }
8333
8334    /// Sets the value of [previews][crate::model::ListPreviewsResponse::previews].
8335    ///
8336    /// # Example
8337    /// ```ignore,no_run
8338    /// # use google_cloud_config_v1::model::ListPreviewsResponse;
8339    /// use google_cloud_config_v1::model::Preview;
8340    /// let x = ListPreviewsResponse::new()
8341    ///     .set_previews([
8342    ///         Preview::default()/* use setters */,
8343    ///         Preview::default()/* use (different) setters */,
8344    ///     ]);
8345    /// ```
8346    pub fn set_previews<T, V>(mut self, v: T) -> Self
8347    where
8348        T: std::iter::IntoIterator<Item = V>,
8349        V: std::convert::Into<crate::model::Preview>,
8350    {
8351        use std::iter::Iterator;
8352        self.previews = v.into_iter().map(|i| i.into()).collect();
8353        self
8354    }
8355
8356    /// Sets the value of [next_page_token][crate::model::ListPreviewsResponse::next_page_token].
8357    ///
8358    /// # Example
8359    /// ```ignore,no_run
8360    /// # use google_cloud_config_v1::model::ListPreviewsResponse;
8361    /// let x = ListPreviewsResponse::new().set_next_page_token("example");
8362    /// ```
8363    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8364        self.next_page_token = v.into();
8365        self
8366    }
8367
8368    /// Sets the value of [unreachable][crate::model::ListPreviewsResponse::unreachable].
8369    ///
8370    /// # Example
8371    /// ```ignore,no_run
8372    /// # use google_cloud_config_v1::model::ListPreviewsResponse;
8373    /// let x = ListPreviewsResponse::new().set_unreachable(["a", "b", "c"]);
8374    /// ```
8375    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
8376    where
8377        T: std::iter::IntoIterator<Item = V>,
8378        V: std::convert::Into<std::string::String>,
8379    {
8380        use std::iter::Iterator;
8381        self.unreachable = v.into_iter().map(|i| i.into()).collect();
8382        self
8383    }
8384}
8385
8386impl wkt::message::Message for ListPreviewsResponse {
8387    fn typename() -> &'static str {
8388        "type.googleapis.com/google.cloud.config.v1.ListPreviewsResponse"
8389    }
8390}
8391
8392#[doc(hidden)]
8393impl google_cloud_gax::paginator::internal::PageableResponse for ListPreviewsResponse {
8394    type PageItem = crate::model::Preview;
8395
8396    fn items(self) -> std::vec::Vec<Self::PageItem> {
8397        self.previews
8398    }
8399
8400    fn next_page_token(&self) -> std::string::String {
8401        use std::clone::Clone;
8402        self.next_page_token.clone()
8403    }
8404}
8405
8406/// A request to delete a preview.
8407#[derive(Clone, Default, PartialEq)]
8408#[non_exhaustive]
8409pub struct DeletePreviewRequest {
8410    /// Required. The name of the Preview in the format:
8411    /// 'projects/{project_id}/locations/{location}/previews/{preview}'.
8412    pub name: std::string::String,
8413
8414    /// Optional. An optional request ID to identify requests. Specify a unique
8415    /// request ID so that if you must retry your request, the server will know to
8416    /// ignore the request if it has already been completed. The server will
8417    /// guarantee that for at least 60 minutes after the first request.
8418    ///
8419    /// For example, consider a situation where you make an initial request and the
8420    /// request times out. If you make the request again with the same request ID,
8421    /// the server can check if original operation with the same request ID was
8422    /// received, and if so, will ignore the second request. This prevents clients
8423    /// from accidentally creating duplicate commitments.
8424    ///
8425    /// The request ID must be a valid UUID with the exception that zero UUID is
8426    /// not supported (00000000-0000-0000-0000-000000000000).
8427    pub request_id: std::string::String,
8428
8429    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8430}
8431
8432impl DeletePreviewRequest {
8433    /// Creates a new default instance.
8434    pub fn new() -> Self {
8435        std::default::Default::default()
8436    }
8437
8438    /// Sets the value of [name][crate::model::DeletePreviewRequest::name].
8439    ///
8440    /// # Example
8441    /// ```ignore,no_run
8442    /// # use google_cloud_config_v1::model::DeletePreviewRequest;
8443    /// # let project_id = "project_id";
8444    /// # let location_id = "location_id";
8445    /// # let preview_id = "preview_id";
8446    /// let x = DeletePreviewRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/previews/{preview_id}"));
8447    /// ```
8448    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8449        self.name = v.into();
8450        self
8451    }
8452
8453    /// Sets the value of [request_id][crate::model::DeletePreviewRequest::request_id].
8454    ///
8455    /// # Example
8456    /// ```ignore,no_run
8457    /// # use google_cloud_config_v1::model::DeletePreviewRequest;
8458    /// let x = DeletePreviewRequest::new().set_request_id("example");
8459    /// ```
8460    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8461        self.request_id = v.into();
8462        self
8463    }
8464}
8465
8466impl wkt::message::Message for DeletePreviewRequest {
8467    fn typename() -> &'static str {
8468        "type.googleapis.com/google.cloud.config.v1.DeletePreviewRequest"
8469    }
8470}
8471
8472/// A request to export preview results.
8473#[derive(Clone, Default, PartialEq)]
8474#[non_exhaustive]
8475pub struct ExportPreviewResultRequest {
8476    /// Required. The preview whose results should be exported. The preview value
8477    /// is in the format:
8478    /// 'projects/{project_id}/locations/{location}/previews/{preview}'.
8479    pub parent: std::string::String,
8480
8481    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8482}
8483
8484impl ExportPreviewResultRequest {
8485    /// Creates a new default instance.
8486    pub fn new() -> Self {
8487        std::default::Default::default()
8488    }
8489
8490    /// Sets the value of [parent][crate::model::ExportPreviewResultRequest::parent].
8491    ///
8492    /// # Example
8493    /// ```ignore,no_run
8494    /// # use google_cloud_config_v1::model::ExportPreviewResultRequest;
8495    /// # let project_id = "project_id";
8496    /// # let location_id = "location_id";
8497    /// # let preview_id = "preview_id";
8498    /// let x = ExportPreviewResultRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/previews/{preview_id}"));
8499    /// ```
8500    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8501        self.parent = v.into();
8502        self
8503    }
8504}
8505
8506impl wkt::message::Message for ExportPreviewResultRequest {
8507    fn typename() -> &'static str {
8508        "type.googleapis.com/google.cloud.config.v1.ExportPreviewResultRequest"
8509    }
8510}
8511
8512/// A response to `ExportPreviewResult` call. Contains preview results.
8513#[derive(Clone, Default, PartialEq)]
8514#[non_exhaustive]
8515pub struct ExportPreviewResultResponse {
8516    /// Output only. Signed URLs for accessing the plan files.
8517    pub result: std::option::Option<crate::model::PreviewResult>,
8518
8519    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8520}
8521
8522impl ExportPreviewResultResponse {
8523    /// Creates a new default instance.
8524    pub fn new() -> Self {
8525        std::default::Default::default()
8526    }
8527
8528    /// Sets the value of [result][crate::model::ExportPreviewResultResponse::result].
8529    ///
8530    /// # Example
8531    /// ```ignore,no_run
8532    /// # use google_cloud_config_v1::model::ExportPreviewResultResponse;
8533    /// use google_cloud_config_v1::model::PreviewResult;
8534    /// let x = ExportPreviewResultResponse::new().set_result(PreviewResult::default()/* use setters */);
8535    /// ```
8536    pub fn set_result<T>(mut self, v: T) -> Self
8537    where
8538        T: std::convert::Into<crate::model::PreviewResult>,
8539    {
8540        self.result = std::option::Option::Some(v.into());
8541        self
8542    }
8543
8544    /// Sets or clears the value of [result][crate::model::ExportPreviewResultResponse::result].
8545    ///
8546    /// # Example
8547    /// ```ignore,no_run
8548    /// # use google_cloud_config_v1::model::ExportPreviewResultResponse;
8549    /// use google_cloud_config_v1::model::PreviewResult;
8550    /// let x = ExportPreviewResultResponse::new().set_or_clear_result(Some(PreviewResult::default()/* use setters */));
8551    /// let x = ExportPreviewResultResponse::new().set_or_clear_result(None::<PreviewResult>);
8552    /// ```
8553    pub fn set_or_clear_result<T>(mut self, v: std::option::Option<T>) -> Self
8554    where
8555        T: std::convert::Into<crate::model::PreviewResult>,
8556    {
8557        self.result = v.map(|x| x.into());
8558        self
8559    }
8560}
8561
8562impl wkt::message::Message for ExportPreviewResultResponse {
8563    fn typename() -> &'static str {
8564        "type.googleapis.com/google.cloud.config.v1.ExportPreviewResultResponse"
8565    }
8566}
8567
8568/// Contains a signed Cloud Storage URLs.
8569#[derive(Clone, Default, PartialEq)]
8570#[non_exhaustive]
8571pub struct PreviewResult {
8572    /// Output only. Plan binary signed URL
8573    pub binary_signed_uri: std::string::String,
8574
8575    /// Output only. Plan JSON signed URL
8576    pub json_signed_uri: std::string::String,
8577
8578    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8579}
8580
8581impl PreviewResult {
8582    /// Creates a new default instance.
8583    pub fn new() -> Self {
8584        std::default::Default::default()
8585    }
8586
8587    /// Sets the value of [binary_signed_uri][crate::model::PreviewResult::binary_signed_uri].
8588    ///
8589    /// # Example
8590    /// ```ignore,no_run
8591    /// # use google_cloud_config_v1::model::PreviewResult;
8592    /// let x = PreviewResult::new().set_binary_signed_uri("example");
8593    /// ```
8594    pub fn set_binary_signed_uri<T: std::convert::Into<std::string::String>>(
8595        mut self,
8596        v: T,
8597    ) -> Self {
8598        self.binary_signed_uri = v.into();
8599        self
8600    }
8601
8602    /// Sets the value of [json_signed_uri][crate::model::PreviewResult::json_signed_uri].
8603    ///
8604    /// # Example
8605    /// ```ignore,no_run
8606    /// # use google_cloud_config_v1::model::PreviewResult;
8607    /// let x = PreviewResult::new().set_json_signed_uri("example");
8608    /// ```
8609    pub fn set_json_signed_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8610        self.json_signed_uri = v.into();
8611        self
8612    }
8613}
8614
8615impl wkt::message::Message for PreviewResult {
8616    fn typename() -> &'static str {
8617        "type.googleapis.com/google.cloud.config.v1.PreviewResult"
8618    }
8619}
8620
8621/// The request message for the GetTerraformVersion method.
8622#[derive(Clone, Default, PartialEq)]
8623#[non_exhaustive]
8624pub struct GetTerraformVersionRequest {
8625    /// Required. The name of the TerraformVersion. Format:
8626    /// 'projects/{project_id}/locations/{location}/terraformVersions/{terraform_version}'
8627    pub name: std::string::String,
8628
8629    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8630}
8631
8632impl GetTerraformVersionRequest {
8633    /// Creates a new default instance.
8634    pub fn new() -> Self {
8635        std::default::Default::default()
8636    }
8637
8638    /// Sets the value of [name][crate::model::GetTerraformVersionRequest::name].
8639    ///
8640    /// # Example
8641    /// ```ignore,no_run
8642    /// # use google_cloud_config_v1::model::GetTerraformVersionRequest;
8643    /// # let project_id = "project_id";
8644    /// # let location_id = "location_id";
8645    /// # let terraform_version_id = "terraform_version_id";
8646    /// let x = GetTerraformVersionRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/terraformVersions/{terraform_version_id}"));
8647    /// ```
8648    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8649        self.name = v.into();
8650        self
8651    }
8652}
8653
8654impl wkt::message::Message for GetTerraformVersionRequest {
8655    fn typename() -> &'static str {
8656        "type.googleapis.com/google.cloud.config.v1.GetTerraformVersionRequest"
8657    }
8658}
8659
8660/// The request message for the ListTerraformVersions method.
8661#[derive(Clone, Default, PartialEq)]
8662#[non_exhaustive]
8663pub struct ListTerraformVersionsRequest {
8664    /// Required. The parent in whose context the TerraformVersions are listed. The
8665    /// parent value is in the format:
8666    /// 'projects/{project_id}/locations/{location}'.
8667    pub parent: std::string::String,
8668
8669    /// Optional. When requesting a page of terraform versions, 'page_size'
8670    /// specifies number of terraform versions to return. If unspecified, at most
8671    /// 500 will be returned. The maximum value is 1000.
8672    pub page_size: i32,
8673
8674    /// Optional. Token returned by previous call to 'ListTerraformVersions' which
8675    /// specifies the position in the list from where to continue listing the
8676    /// terraform versions.
8677    pub page_token: std::string::String,
8678
8679    /// Optional. Lists the TerraformVersions that match the filter expression. A
8680    /// filter expression filters the resources listed in the response. The
8681    /// expression must be of the form '{field} {operator} {value}' where
8682    /// operators: '<', '>',
8683    /// '<=', '>=', '!=', '=', ':' are supported (colon ':' represents a HAS
8684    /// operator which is roughly synonymous with equality). {field} can refer to a
8685    /// proto or JSON field, or a synthetic field. Field names can be camelCase or
8686    /// snake_case.
8687    pub filter: std::string::String,
8688
8689    /// Optional. Field to use to sort the list.
8690    pub order_by: std::string::String,
8691
8692    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8693}
8694
8695impl ListTerraformVersionsRequest {
8696    /// Creates a new default instance.
8697    pub fn new() -> Self {
8698        std::default::Default::default()
8699    }
8700
8701    /// Sets the value of [parent][crate::model::ListTerraformVersionsRequest::parent].
8702    ///
8703    /// # Example
8704    /// ```ignore,no_run
8705    /// # use google_cloud_config_v1::model::ListTerraformVersionsRequest;
8706    /// let x = ListTerraformVersionsRequest::new().set_parent("example");
8707    /// ```
8708    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8709        self.parent = v.into();
8710        self
8711    }
8712
8713    /// Sets the value of [page_size][crate::model::ListTerraformVersionsRequest::page_size].
8714    ///
8715    /// # Example
8716    /// ```ignore,no_run
8717    /// # use google_cloud_config_v1::model::ListTerraformVersionsRequest;
8718    /// let x = ListTerraformVersionsRequest::new().set_page_size(42);
8719    /// ```
8720    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8721        self.page_size = v.into();
8722        self
8723    }
8724
8725    /// Sets the value of [page_token][crate::model::ListTerraformVersionsRequest::page_token].
8726    ///
8727    /// # Example
8728    /// ```ignore,no_run
8729    /// # use google_cloud_config_v1::model::ListTerraformVersionsRequest;
8730    /// let x = ListTerraformVersionsRequest::new().set_page_token("example");
8731    /// ```
8732    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8733        self.page_token = v.into();
8734        self
8735    }
8736
8737    /// Sets the value of [filter][crate::model::ListTerraformVersionsRequest::filter].
8738    ///
8739    /// # Example
8740    /// ```ignore,no_run
8741    /// # use google_cloud_config_v1::model::ListTerraformVersionsRequest;
8742    /// let x = ListTerraformVersionsRequest::new().set_filter("example");
8743    /// ```
8744    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8745        self.filter = v.into();
8746        self
8747    }
8748
8749    /// Sets the value of [order_by][crate::model::ListTerraformVersionsRequest::order_by].
8750    ///
8751    /// # Example
8752    /// ```ignore,no_run
8753    /// # use google_cloud_config_v1::model::ListTerraformVersionsRequest;
8754    /// let x = ListTerraformVersionsRequest::new().set_order_by("example");
8755    /// ```
8756    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8757        self.order_by = v.into();
8758        self
8759    }
8760}
8761
8762impl wkt::message::Message for ListTerraformVersionsRequest {
8763    fn typename() -> &'static str {
8764        "type.googleapis.com/google.cloud.config.v1.ListTerraformVersionsRequest"
8765    }
8766}
8767
8768/// The response message for the `ListTerraformVersions` method.
8769#[derive(Clone, Default, PartialEq)]
8770#[non_exhaustive]
8771pub struct ListTerraformVersionsResponse {
8772    /// List of [TerraformVersion][google.cloud.config.v1.TerraformVersion]s.
8773    ///
8774    /// [google.cloud.config.v1.TerraformVersion]: crate::model::TerraformVersion
8775    pub terraform_versions: std::vec::Vec<crate::model::TerraformVersion>,
8776
8777    /// Token to be supplied to the next ListTerraformVersions request via
8778    /// `page_token` to obtain the next set of results.
8779    pub next_page_token: std::string::String,
8780
8781    /// Unreachable resources, if any.
8782    pub unreachable: std::vec::Vec<std::string::String>,
8783
8784    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8785}
8786
8787impl ListTerraformVersionsResponse {
8788    /// Creates a new default instance.
8789    pub fn new() -> Self {
8790        std::default::Default::default()
8791    }
8792
8793    /// Sets the value of [terraform_versions][crate::model::ListTerraformVersionsResponse::terraform_versions].
8794    ///
8795    /// # Example
8796    /// ```ignore,no_run
8797    /// # use google_cloud_config_v1::model::ListTerraformVersionsResponse;
8798    /// use google_cloud_config_v1::model::TerraformVersion;
8799    /// let x = ListTerraformVersionsResponse::new()
8800    ///     .set_terraform_versions([
8801    ///         TerraformVersion::default()/* use setters */,
8802    ///         TerraformVersion::default()/* use (different) setters */,
8803    ///     ]);
8804    /// ```
8805    pub fn set_terraform_versions<T, V>(mut self, v: T) -> Self
8806    where
8807        T: std::iter::IntoIterator<Item = V>,
8808        V: std::convert::Into<crate::model::TerraformVersion>,
8809    {
8810        use std::iter::Iterator;
8811        self.terraform_versions = v.into_iter().map(|i| i.into()).collect();
8812        self
8813    }
8814
8815    /// Sets the value of [next_page_token][crate::model::ListTerraformVersionsResponse::next_page_token].
8816    ///
8817    /// # Example
8818    /// ```ignore,no_run
8819    /// # use google_cloud_config_v1::model::ListTerraformVersionsResponse;
8820    /// let x = ListTerraformVersionsResponse::new().set_next_page_token("example");
8821    /// ```
8822    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8823        self.next_page_token = v.into();
8824        self
8825    }
8826
8827    /// Sets the value of [unreachable][crate::model::ListTerraformVersionsResponse::unreachable].
8828    ///
8829    /// # Example
8830    /// ```ignore,no_run
8831    /// # use google_cloud_config_v1::model::ListTerraformVersionsResponse;
8832    /// let x = ListTerraformVersionsResponse::new().set_unreachable(["a", "b", "c"]);
8833    /// ```
8834    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
8835    where
8836        T: std::iter::IntoIterator<Item = V>,
8837        V: std::convert::Into<std::string::String>,
8838    {
8839        use std::iter::Iterator;
8840        self.unreachable = v.into_iter().map(|i| i.into()).collect();
8841        self
8842    }
8843}
8844
8845impl wkt::message::Message for ListTerraformVersionsResponse {
8846    fn typename() -> &'static str {
8847        "type.googleapis.com/google.cloud.config.v1.ListTerraformVersionsResponse"
8848    }
8849}
8850
8851#[doc(hidden)]
8852impl google_cloud_gax::paginator::internal::PageableResponse for ListTerraformVersionsResponse {
8853    type PageItem = crate::model::TerraformVersion;
8854
8855    fn items(self) -> std::vec::Vec<Self::PageItem> {
8856        self.terraform_versions
8857    }
8858
8859    fn next_page_token(&self) -> std::string::String {
8860        use std::clone::Clone;
8861        self.next_page_token.clone()
8862    }
8863}
8864
8865/// A TerraformVersion represents the support state the corresponding
8866/// Terraform version.
8867#[derive(Clone, Default, PartialEq)]
8868#[non_exhaustive]
8869pub struct TerraformVersion {
8870    /// Identifier. The version name is in the format:
8871    /// 'projects/{project_id}/locations/{location}/terraformVersions/{terraform_version}'.
8872    pub name: std::string::String,
8873
8874    /// Output only. The state of the version, ACTIVE, DEPRECATED or OBSOLETE.
8875    pub state: crate::model::terraform_version::State,
8876
8877    /// Output only. When the version is supported.
8878    pub support_time: std::option::Option<wkt::Timestamp>,
8879
8880    /// Output only. When the version is deprecated.
8881    pub deprecate_time: std::option::Option<wkt::Timestamp>,
8882
8883    /// Output only. When the version is obsolete.
8884    pub obsolete_time: std::option::Option<wkt::Timestamp>,
8885
8886    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8887}
8888
8889impl TerraformVersion {
8890    /// Creates a new default instance.
8891    pub fn new() -> Self {
8892        std::default::Default::default()
8893    }
8894
8895    /// Sets the value of [name][crate::model::TerraformVersion::name].
8896    ///
8897    /// # Example
8898    /// ```ignore,no_run
8899    /// # use google_cloud_config_v1::model::TerraformVersion;
8900    /// # let project_id = "project_id";
8901    /// # let location_id = "location_id";
8902    /// # let terraform_version_id = "terraform_version_id";
8903    /// let x = TerraformVersion::new().set_name(format!("projects/{project_id}/locations/{location_id}/terraformVersions/{terraform_version_id}"));
8904    /// ```
8905    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8906        self.name = v.into();
8907        self
8908    }
8909
8910    /// Sets the value of [state][crate::model::TerraformVersion::state].
8911    ///
8912    /// # Example
8913    /// ```ignore,no_run
8914    /// # use google_cloud_config_v1::model::TerraformVersion;
8915    /// use google_cloud_config_v1::model::terraform_version::State;
8916    /// let x0 = TerraformVersion::new().set_state(State::Active);
8917    /// let x1 = TerraformVersion::new().set_state(State::Deprecated);
8918    /// let x2 = TerraformVersion::new().set_state(State::Obsolete);
8919    /// ```
8920    pub fn set_state<T: std::convert::Into<crate::model::terraform_version::State>>(
8921        mut self,
8922        v: T,
8923    ) -> Self {
8924        self.state = v.into();
8925        self
8926    }
8927
8928    /// Sets the value of [support_time][crate::model::TerraformVersion::support_time].
8929    ///
8930    /// # Example
8931    /// ```ignore,no_run
8932    /// # use google_cloud_config_v1::model::TerraformVersion;
8933    /// use wkt::Timestamp;
8934    /// let x = TerraformVersion::new().set_support_time(Timestamp::default()/* use setters */);
8935    /// ```
8936    pub fn set_support_time<T>(mut self, v: T) -> Self
8937    where
8938        T: std::convert::Into<wkt::Timestamp>,
8939    {
8940        self.support_time = std::option::Option::Some(v.into());
8941        self
8942    }
8943
8944    /// Sets or clears the value of [support_time][crate::model::TerraformVersion::support_time].
8945    ///
8946    /// # Example
8947    /// ```ignore,no_run
8948    /// # use google_cloud_config_v1::model::TerraformVersion;
8949    /// use wkt::Timestamp;
8950    /// let x = TerraformVersion::new().set_or_clear_support_time(Some(Timestamp::default()/* use setters */));
8951    /// let x = TerraformVersion::new().set_or_clear_support_time(None::<Timestamp>);
8952    /// ```
8953    pub fn set_or_clear_support_time<T>(mut self, v: std::option::Option<T>) -> Self
8954    where
8955        T: std::convert::Into<wkt::Timestamp>,
8956    {
8957        self.support_time = v.map(|x| x.into());
8958        self
8959    }
8960
8961    /// Sets the value of [deprecate_time][crate::model::TerraformVersion::deprecate_time].
8962    ///
8963    /// # Example
8964    /// ```ignore,no_run
8965    /// # use google_cloud_config_v1::model::TerraformVersion;
8966    /// use wkt::Timestamp;
8967    /// let x = TerraformVersion::new().set_deprecate_time(Timestamp::default()/* use setters */);
8968    /// ```
8969    pub fn set_deprecate_time<T>(mut self, v: T) -> Self
8970    where
8971        T: std::convert::Into<wkt::Timestamp>,
8972    {
8973        self.deprecate_time = std::option::Option::Some(v.into());
8974        self
8975    }
8976
8977    /// Sets or clears the value of [deprecate_time][crate::model::TerraformVersion::deprecate_time].
8978    ///
8979    /// # Example
8980    /// ```ignore,no_run
8981    /// # use google_cloud_config_v1::model::TerraformVersion;
8982    /// use wkt::Timestamp;
8983    /// let x = TerraformVersion::new().set_or_clear_deprecate_time(Some(Timestamp::default()/* use setters */));
8984    /// let x = TerraformVersion::new().set_or_clear_deprecate_time(None::<Timestamp>);
8985    /// ```
8986    pub fn set_or_clear_deprecate_time<T>(mut self, v: std::option::Option<T>) -> Self
8987    where
8988        T: std::convert::Into<wkt::Timestamp>,
8989    {
8990        self.deprecate_time = v.map(|x| x.into());
8991        self
8992    }
8993
8994    /// Sets the value of [obsolete_time][crate::model::TerraformVersion::obsolete_time].
8995    ///
8996    /// # Example
8997    /// ```ignore,no_run
8998    /// # use google_cloud_config_v1::model::TerraformVersion;
8999    /// use wkt::Timestamp;
9000    /// let x = TerraformVersion::new().set_obsolete_time(Timestamp::default()/* use setters */);
9001    /// ```
9002    pub fn set_obsolete_time<T>(mut self, v: T) -> Self
9003    where
9004        T: std::convert::Into<wkt::Timestamp>,
9005    {
9006        self.obsolete_time = std::option::Option::Some(v.into());
9007        self
9008    }
9009
9010    /// Sets or clears the value of [obsolete_time][crate::model::TerraformVersion::obsolete_time].
9011    ///
9012    /// # Example
9013    /// ```ignore,no_run
9014    /// # use google_cloud_config_v1::model::TerraformVersion;
9015    /// use wkt::Timestamp;
9016    /// let x = TerraformVersion::new().set_or_clear_obsolete_time(Some(Timestamp::default()/* use setters */));
9017    /// let x = TerraformVersion::new().set_or_clear_obsolete_time(None::<Timestamp>);
9018    /// ```
9019    pub fn set_or_clear_obsolete_time<T>(mut self, v: std::option::Option<T>) -> Self
9020    where
9021        T: std::convert::Into<wkt::Timestamp>,
9022    {
9023        self.obsolete_time = v.map(|x| x.into());
9024        self
9025    }
9026}
9027
9028impl wkt::message::Message for TerraformVersion {
9029    fn typename() -> &'static str {
9030        "type.googleapis.com/google.cloud.config.v1.TerraformVersion"
9031    }
9032}
9033
9034/// Defines additional types related to [TerraformVersion].
9035pub mod terraform_version {
9036    #[allow(unused_imports)]
9037    use super::*;
9038
9039    /// Possible states of a TerraformVersion.
9040    ///
9041    /// # Working with unknown values
9042    ///
9043    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9044    /// additional enum variants at any time. Adding new variants is not considered
9045    /// a breaking change. Applications should write their code in anticipation of:
9046    ///
9047    /// - New values appearing in future releases of the client library, **and**
9048    /// - New values received dynamically, without application changes.
9049    ///
9050    /// Please consult the [Working with enums] section in the user guide for some
9051    /// guidelines.
9052    ///
9053    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
9054    #[derive(Clone, Debug, PartialEq)]
9055    #[non_exhaustive]
9056    pub enum State {
9057        /// The default value. This value is used if the state is omitted.
9058        Unspecified,
9059        /// The version is actively supported.
9060        Active,
9061        /// The version is deprecated.
9062        Deprecated,
9063        /// The version is obsolete.
9064        Obsolete,
9065        /// If set, the enum was initialized with an unknown value.
9066        ///
9067        /// Applications can examine the value using [State::value] or
9068        /// [State::name].
9069        UnknownValue(state::UnknownValue),
9070    }
9071
9072    #[doc(hidden)]
9073    pub mod state {
9074        #[allow(unused_imports)]
9075        use super::*;
9076        #[derive(Clone, Debug, PartialEq)]
9077        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9078    }
9079
9080    impl State {
9081        /// Gets the enum value.
9082        ///
9083        /// Returns `None` if the enum contains an unknown value deserialized from
9084        /// the string representation of enums.
9085        pub fn value(&self) -> std::option::Option<i32> {
9086            match self {
9087                Self::Unspecified => std::option::Option::Some(0),
9088                Self::Active => std::option::Option::Some(1),
9089                Self::Deprecated => std::option::Option::Some(2),
9090                Self::Obsolete => std::option::Option::Some(3),
9091                Self::UnknownValue(u) => u.0.value(),
9092            }
9093        }
9094
9095        /// Gets the enum value as a string.
9096        ///
9097        /// Returns `None` if the enum contains an unknown value deserialized from
9098        /// the integer representation of enums.
9099        pub fn name(&self) -> std::option::Option<&str> {
9100            match self {
9101                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
9102                Self::Active => std::option::Option::Some("ACTIVE"),
9103                Self::Deprecated => std::option::Option::Some("DEPRECATED"),
9104                Self::Obsolete => std::option::Option::Some("OBSOLETE"),
9105                Self::UnknownValue(u) => u.0.name(),
9106            }
9107        }
9108    }
9109
9110    impl std::default::Default for State {
9111        fn default() -> Self {
9112            use std::convert::From;
9113            Self::from(0)
9114        }
9115    }
9116
9117    impl std::fmt::Display for State {
9118        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9119            wkt::internal::display_enum(f, self.name(), self.value())
9120        }
9121    }
9122
9123    impl std::convert::From<i32> for State {
9124        fn from(value: i32) -> Self {
9125            match value {
9126                0 => Self::Unspecified,
9127                1 => Self::Active,
9128                2 => Self::Deprecated,
9129                3 => Self::Obsolete,
9130                _ => Self::UnknownValue(state::UnknownValue(
9131                    wkt::internal::UnknownEnumValue::Integer(value),
9132                )),
9133            }
9134        }
9135    }
9136
9137    impl std::convert::From<&str> for State {
9138        fn from(value: &str) -> Self {
9139            use std::string::ToString;
9140            match value {
9141                "STATE_UNSPECIFIED" => Self::Unspecified,
9142                "ACTIVE" => Self::Active,
9143                "DEPRECATED" => Self::Deprecated,
9144                "OBSOLETE" => Self::Obsolete,
9145                _ => Self::UnknownValue(state::UnknownValue(
9146                    wkt::internal::UnknownEnumValue::String(value.to_string()),
9147                )),
9148            }
9149        }
9150    }
9151
9152    impl serde::ser::Serialize for State {
9153        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9154        where
9155            S: serde::Serializer,
9156        {
9157            match self {
9158                Self::Unspecified => serializer.serialize_i32(0),
9159                Self::Active => serializer.serialize_i32(1),
9160                Self::Deprecated => serializer.serialize_i32(2),
9161                Self::Obsolete => serializer.serialize_i32(3),
9162                Self::UnknownValue(u) => u.0.serialize(serializer),
9163            }
9164        }
9165    }
9166
9167    impl<'de> serde::de::Deserialize<'de> for State {
9168        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9169        where
9170            D: serde::Deserializer<'de>,
9171        {
9172            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
9173                ".google.cloud.config.v1.TerraformVersion.State",
9174            ))
9175        }
9176    }
9177}
9178
9179/// Terraform info of a ResourceChange.
9180#[derive(Clone, Default, PartialEq)]
9181#[non_exhaustive]
9182pub struct ResourceChangeTerraformInfo {
9183    /// Output only. TF resource address that uniquely identifies the resource.
9184    pub address: std::string::String,
9185
9186    /// Output only. TF resource type.
9187    pub r#type: std::string::String,
9188
9189    /// Output only. TF resource name.
9190    pub resource_name: std::string::String,
9191
9192    /// Output only. TF resource provider.
9193    pub provider: std::string::String,
9194
9195    /// Output only. TF resource actions.
9196    pub actions: std::vec::Vec<std::string::String>,
9197
9198    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9199}
9200
9201impl ResourceChangeTerraformInfo {
9202    /// Creates a new default instance.
9203    pub fn new() -> Self {
9204        std::default::Default::default()
9205    }
9206
9207    /// Sets the value of [address][crate::model::ResourceChangeTerraformInfo::address].
9208    ///
9209    /// # Example
9210    /// ```ignore,no_run
9211    /// # use google_cloud_config_v1::model::ResourceChangeTerraformInfo;
9212    /// let x = ResourceChangeTerraformInfo::new().set_address("example");
9213    /// ```
9214    pub fn set_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9215        self.address = v.into();
9216        self
9217    }
9218
9219    /// Sets the value of [r#type][crate::model::ResourceChangeTerraformInfo::type].
9220    ///
9221    /// # Example
9222    /// ```ignore,no_run
9223    /// # use google_cloud_config_v1::model::ResourceChangeTerraformInfo;
9224    /// let x = ResourceChangeTerraformInfo::new().set_type("example");
9225    /// ```
9226    pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9227        self.r#type = v.into();
9228        self
9229    }
9230
9231    /// Sets the value of [resource_name][crate::model::ResourceChangeTerraformInfo::resource_name].
9232    ///
9233    /// # Example
9234    /// ```ignore,no_run
9235    /// # use google_cloud_config_v1::model::ResourceChangeTerraformInfo;
9236    /// let x = ResourceChangeTerraformInfo::new().set_resource_name("example");
9237    /// ```
9238    pub fn set_resource_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9239        self.resource_name = v.into();
9240        self
9241    }
9242
9243    /// Sets the value of [provider][crate::model::ResourceChangeTerraformInfo::provider].
9244    ///
9245    /// # Example
9246    /// ```ignore,no_run
9247    /// # use google_cloud_config_v1::model::ResourceChangeTerraformInfo;
9248    /// let x = ResourceChangeTerraformInfo::new().set_provider("example");
9249    /// ```
9250    pub fn set_provider<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9251        self.provider = v.into();
9252        self
9253    }
9254
9255    /// Sets the value of [actions][crate::model::ResourceChangeTerraformInfo::actions].
9256    ///
9257    /// # Example
9258    /// ```ignore,no_run
9259    /// # use google_cloud_config_v1::model::ResourceChangeTerraformInfo;
9260    /// let x = ResourceChangeTerraformInfo::new().set_actions(["a", "b", "c"]);
9261    /// ```
9262    pub fn set_actions<T, V>(mut self, v: T) -> Self
9263    where
9264        T: std::iter::IntoIterator<Item = V>,
9265        V: std::convert::Into<std::string::String>,
9266    {
9267        use std::iter::Iterator;
9268        self.actions = v.into_iter().map(|i| i.into()).collect();
9269        self
9270    }
9271}
9272
9273impl wkt::message::Message for ResourceChangeTerraformInfo {
9274    fn typename() -> &'static str {
9275        "type.googleapis.com/google.cloud.config.v1.ResourceChangeTerraformInfo"
9276    }
9277}
9278
9279/// A resource change represents a change to a resource in the state file.
9280#[derive(Clone, Default, PartialEq)]
9281#[non_exhaustive]
9282pub struct ResourceChange {
9283    /// Identifier. The name of the resource change.
9284    /// Format:
9285    /// 'projects/{project_id}/locations/{location}/previews/{preview}/resourceChanges/{resource_change}'.
9286    pub name: std::string::String,
9287
9288    /// Output only. Terraform info of the resource change.
9289    pub terraform_info: std::option::Option<crate::model::ResourceChangeTerraformInfo>,
9290
9291    /// Output only. The intent of the resource change.
9292    pub intent: crate::model::resource_change::Intent,
9293
9294    /// Output only. The property changes of the resource change.
9295    pub property_changes: std::vec::Vec<crate::model::PropertyChange>,
9296
9297    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9298}
9299
9300impl ResourceChange {
9301    /// Creates a new default instance.
9302    pub fn new() -> Self {
9303        std::default::Default::default()
9304    }
9305
9306    /// Sets the value of [name][crate::model::ResourceChange::name].
9307    ///
9308    /// # Example
9309    /// ```ignore,no_run
9310    /// # use google_cloud_config_v1::model::ResourceChange;
9311    /// # let project_id = "project_id";
9312    /// # let location_id = "location_id";
9313    /// # let preview_id = "preview_id";
9314    /// # let resource_change_id = "resource_change_id";
9315    /// let x = ResourceChange::new().set_name(format!("projects/{project_id}/locations/{location_id}/previews/{preview_id}/resourceChanges/{resource_change_id}"));
9316    /// ```
9317    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9318        self.name = v.into();
9319        self
9320    }
9321
9322    /// Sets the value of [terraform_info][crate::model::ResourceChange::terraform_info].
9323    ///
9324    /// # Example
9325    /// ```ignore,no_run
9326    /// # use google_cloud_config_v1::model::ResourceChange;
9327    /// use google_cloud_config_v1::model::ResourceChangeTerraformInfo;
9328    /// let x = ResourceChange::new().set_terraform_info(ResourceChangeTerraformInfo::default()/* use setters */);
9329    /// ```
9330    pub fn set_terraform_info<T>(mut self, v: T) -> Self
9331    where
9332        T: std::convert::Into<crate::model::ResourceChangeTerraformInfo>,
9333    {
9334        self.terraform_info = std::option::Option::Some(v.into());
9335        self
9336    }
9337
9338    /// Sets or clears the value of [terraform_info][crate::model::ResourceChange::terraform_info].
9339    ///
9340    /// # Example
9341    /// ```ignore,no_run
9342    /// # use google_cloud_config_v1::model::ResourceChange;
9343    /// use google_cloud_config_v1::model::ResourceChangeTerraformInfo;
9344    /// let x = ResourceChange::new().set_or_clear_terraform_info(Some(ResourceChangeTerraformInfo::default()/* use setters */));
9345    /// let x = ResourceChange::new().set_or_clear_terraform_info(None::<ResourceChangeTerraformInfo>);
9346    /// ```
9347    pub fn set_or_clear_terraform_info<T>(mut self, v: std::option::Option<T>) -> Self
9348    where
9349        T: std::convert::Into<crate::model::ResourceChangeTerraformInfo>,
9350    {
9351        self.terraform_info = v.map(|x| x.into());
9352        self
9353    }
9354
9355    /// Sets the value of [intent][crate::model::ResourceChange::intent].
9356    ///
9357    /// # Example
9358    /// ```ignore,no_run
9359    /// # use google_cloud_config_v1::model::ResourceChange;
9360    /// use google_cloud_config_v1::model::resource_change::Intent;
9361    /// let x0 = ResourceChange::new().set_intent(Intent::Create);
9362    /// let x1 = ResourceChange::new().set_intent(Intent::Update);
9363    /// let x2 = ResourceChange::new().set_intent(Intent::Delete);
9364    /// ```
9365    pub fn set_intent<T: std::convert::Into<crate::model::resource_change::Intent>>(
9366        mut self,
9367        v: T,
9368    ) -> Self {
9369        self.intent = v.into();
9370        self
9371    }
9372
9373    /// Sets the value of [property_changes][crate::model::ResourceChange::property_changes].
9374    ///
9375    /// # Example
9376    /// ```ignore,no_run
9377    /// # use google_cloud_config_v1::model::ResourceChange;
9378    /// use google_cloud_config_v1::model::PropertyChange;
9379    /// let x = ResourceChange::new()
9380    ///     .set_property_changes([
9381    ///         PropertyChange::default()/* use setters */,
9382    ///         PropertyChange::default()/* use (different) setters */,
9383    ///     ]);
9384    /// ```
9385    pub fn set_property_changes<T, V>(mut self, v: T) -> Self
9386    where
9387        T: std::iter::IntoIterator<Item = V>,
9388        V: std::convert::Into<crate::model::PropertyChange>,
9389    {
9390        use std::iter::Iterator;
9391        self.property_changes = v.into_iter().map(|i| i.into()).collect();
9392        self
9393    }
9394}
9395
9396impl wkt::message::Message for ResourceChange {
9397    fn typename() -> &'static str {
9398        "type.googleapis.com/google.cloud.config.v1.ResourceChange"
9399    }
9400}
9401
9402/// Defines additional types related to [ResourceChange].
9403pub mod resource_change {
9404    #[allow(unused_imports)]
9405    use super::*;
9406
9407    /// Possible intent of the resource change.
9408    ///
9409    /// # Working with unknown values
9410    ///
9411    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9412    /// additional enum variants at any time. Adding new variants is not considered
9413    /// a breaking change. Applications should write their code in anticipation of:
9414    ///
9415    /// - New values appearing in future releases of the client library, **and**
9416    /// - New values received dynamically, without application changes.
9417    ///
9418    /// Please consult the [Working with enums] section in the user guide for some
9419    /// guidelines.
9420    ///
9421    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
9422    #[derive(Clone, Debug, PartialEq)]
9423    #[non_exhaustive]
9424    pub enum Intent {
9425        /// The default value.
9426        Unspecified,
9427        /// The resource will be created.
9428        Create,
9429        /// The resource will be updated.
9430        Update,
9431        /// The resource will be deleted.
9432        Delete,
9433        /// The resource will be recreated.
9434        Recreate,
9435        /// The resource will be untouched.
9436        Unchanged,
9437        /// If set, the enum was initialized with an unknown value.
9438        ///
9439        /// Applications can examine the value using [Intent::value] or
9440        /// [Intent::name].
9441        UnknownValue(intent::UnknownValue),
9442    }
9443
9444    #[doc(hidden)]
9445    pub mod intent {
9446        #[allow(unused_imports)]
9447        use super::*;
9448        #[derive(Clone, Debug, PartialEq)]
9449        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9450    }
9451
9452    impl Intent {
9453        /// Gets the enum value.
9454        ///
9455        /// Returns `None` if the enum contains an unknown value deserialized from
9456        /// the string representation of enums.
9457        pub fn value(&self) -> std::option::Option<i32> {
9458            match self {
9459                Self::Unspecified => std::option::Option::Some(0),
9460                Self::Create => std::option::Option::Some(1),
9461                Self::Update => std::option::Option::Some(2),
9462                Self::Delete => std::option::Option::Some(3),
9463                Self::Recreate => std::option::Option::Some(4),
9464                Self::Unchanged => std::option::Option::Some(5),
9465                Self::UnknownValue(u) => u.0.value(),
9466            }
9467        }
9468
9469        /// Gets the enum value as a string.
9470        ///
9471        /// Returns `None` if the enum contains an unknown value deserialized from
9472        /// the integer representation of enums.
9473        pub fn name(&self) -> std::option::Option<&str> {
9474            match self {
9475                Self::Unspecified => std::option::Option::Some("INTENT_UNSPECIFIED"),
9476                Self::Create => std::option::Option::Some("CREATE"),
9477                Self::Update => std::option::Option::Some("UPDATE"),
9478                Self::Delete => std::option::Option::Some("DELETE"),
9479                Self::Recreate => std::option::Option::Some("RECREATE"),
9480                Self::Unchanged => std::option::Option::Some("UNCHANGED"),
9481                Self::UnknownValue(u) => u.0.name(),
9482            }
9483        }
9484    }
9485
9486    impl std::default::Default for Intent {
9487        fn default() -> Self {
9488            use std::convert::From;
9489            Self::from(0)
9490        }
9491    }
9492
9493    impl std::fmt::Display for Intent {
9494        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9495            wkt::internal::display_enum(f, self.name(), self.value())
9496        }
9497    }
9498
9499    impl std::convert::From<i32> for Intent {
9500        fn from(value: i32) -> Self {
9501            match value {
9502                0 => Self::Unspecified,
9503                1 => Self::Create,
9504                2 => Self::Update,
9505                3 => Self::Delete,
9506                4 => Self::Recreate,
9507                5 => Self::Unchanged,
9508                _ => Self::UnknownValue(intent::UnknownValue(
9509                    wkt::internal::UnknownEnumValue::Integer(value),
9510                )),
9511            }
9512        }
9513    }
9514
9515    impl std::convert::From<&str> for Intent {
9516        fn from(value: &str) -> Self {
9517            use std::string::ToString;
9518            match value {
9519                "INTENT_UNSPECIFIED" => Self::Unspecified,
9520                "CREATE" => Self::Create,
9521                "UPDATE" => Self::Update,
9522                "DELETE" => Self::Delete,
9523                "RECREATE" => Self::Recreate,
9524                "UNCHANGED" => Self::Unchanged,
9525                _ => Self::UnknownValue(intent::UnknownValue(
9526                    wkt::internal::UnknownEnumValue::String(value.to_string()),
9527                )),
9528            }
9529        }
9530    }
9531
9532    impl serde::ser::Serialize for Intent {
9533        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9534        where
9535            S: serde::Serializer,
9536        {
9537            match self {
9538                Self::Unspecified => serializer.serialize_i32(0),
9539                Self::Create => serializer.serialize_i32(1),
9540                Self::Update => serializer.serialize_i32(2),
9541                Self::Delete => serializer.serialize_i32(3),
9542                Self::Recreate => serializer.serialize_i32(4),
9543                Self::Unchanged => serializer.serialize_i32(5),
9544                Self::UnknownValue(u) => u.0.serialize(serializer),
9545            }
9546        }
9547    }
9548
9549    impl<'de> serde::de::Deserialize<'de> for Intent {
9550        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9551        where
9552            D: serde::Deserializer<'de>,
9553        {
9554            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Intent>::new(
9555                ".google.cloud.config.v1.ResourceChange.Intent",
9556            ))
9557        }
9558    }
9559}
9560
9561/// A property change represents a change to a property in the state file.
9562#[derive(Clone, Default, PartialEq)]
9563#[non_exhaustive]
9564pub struct PropertyChange {
9565    /// Output only. The path of the property change.
9566    pub path: std::string::String,
9567
9568    /// Output only. The paths of sensitive fields in `before`. Paths are relative
9569    /// to `path`.
9570    pub before_sensitive_paths: std::vec::Vec<std::string::String>,
9571
9572    /// Output only. Representations of the object value before the actions.
9573    pub before: std::option::Option<wkt::Value>,
9574
9575    /// Output only. The paths of sensitive fields in `after`. Paths are relative
9576    /// to `path`.
9577    pub after_sensitive_paths: std::vec::Vec<std::string::String>,
9578
9579    /// Output only. Representations of the object value after the actions.
9580    pub after: std::option::Option<wkt::Value>,
9581
9582    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9583}
9584
9585impl PropertyChange {
9586    /// Creates a new default instance.
9587    pub fn new() -> Self {
9588        std::default::Default::default()
9589    }
9590
9591    /// Sets the value of [path][crate::model::PropertyChange::path].
9592    ///
9593    /// # Example
9594    /// ```ignore,no_run
9595    /// # use google_cloud_config_v1::model::PropertyChange;
9596    /// let x = PropertyChange::new().set_path("example");
9597    /// ```
9598    pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9599        self.path = v.into();
9600        self
9601    }
9602
9603    /// Sets the value of [before_sensitive_paths][crate::model::PropertyChange::before_sensitive_paths].
9604    ///
9605    /// # Example
9606    /// ```ignore,no_run
9607    /// # use google_cloud_config_v1::model::PropertyChange;
9608    /// let x = PropertyChange::new().set_before_sensitive_paths(["a", "b", "c"]);
9609    /// ```
9610    pub fn set_before_sensitive_paths<T, V>(mut self, v: T) -> Self
9611    where
9612        T: std::iter::IntoIterator<Item = V>,
9613        V: std::convert::Into<std::string::String>,
9614    {
9615        use std::iter::Iterator;
9616        self.before_sensitive_paths = v.into_iter().map(|i| i.into()).collect();
9617        self
9618    }
9619
9620    /// Sets the value of [before][crate::model::PropertyChange::before].
9621    ///
9622    /// # Example
9623    /// ```ignore,no_run
9624    /// # use google_cloud_config_v1::model::PropertyChange;
9625    /// use wkt::Value;
9626    /// let x = PropertyChange::new().set_before(Value::default()/* use setters */);
9627    /// ```
9628    pub fn set_before<T>(mut self, v: T) -> Self
9629    where
9630        T: std::convert::Into<wkt::Value>,
9631    {
9632        self.before = std::option::Option::Some(v.into());
9633        self
9634    }
9635
9636    /// Sets or clears the value of [before][crate::model::PropertyChange::before].
9637    ///
9638    /// # Example
9639    /// ```ignore,no_run
9640    /// # use google_cloud_config_v1::model::PropertyChange;
9641    /// use wkt::Value;
9642    /// let x = PropertyChange::new().set_or_clear_before(Some(Value::default()/* use setters */));
9643    /// let x = PropertyChange::new().set_or_clear_before(None::<Value>);
9644    /// ```
9645    pub fn set_or_clear_before<T>(mut self, v: std::option::Option<T>) -> Self
9646    where
9647        T: std::convert::Into<wkt::Value>,
9648    {
9649        self.before = v.map(|x| x.into());
9650        self
9651    }
9652
9653    /// Sets the value of [after_sensitive_paths][crate::model::PropertyChange::after_sensitive_paths].
9654    ///
9655    /// # Example
9656    /// ```ignore,no_run
9657    /// # use google_cloud_config_v1::model::PropertyChange;
9658    /// let x = PropertyChange::new().set_after_sensitive_paths(["a", "b", "c"]);
9659    /// ```
9660    pub fn set_after_sensitive_paths<T, V>(mut self, v: T) -> Self
9661    where
9662        T: std::iter::IntoIterator<Item = V>,
9663        V: std::convert::Into<std::string::String>,
9664    {
9665        use std::iter::Iterator;
9666        self.after_sensitive_paths = v.into_iter().map(|i| i.into()).collect();
9667        self
9668    }
9669
9670    /// Sets the value of [after][crate::model::PropertyChange::after].
9671    ///
9672    /// # Example
9673    /// ```ignore,no_run
9674    /// # use google_cloud_config_v1::model::PropertyChange;
9675    /// use wkt::Value;
9676    /// let x = PropertyChange::new().set_after(Value::default()/* use setters */);
9677    /// ```
9678    pub fn set_after<T>(mut self, v: T) -> Self
9679    where
9680        T: std::convert::Into<wkt::Value>,
9681    {
9682        self.after = std::option::Option::Some(v.into());
9683        self
9684    }
9685
9686    /// Sets or clears the value of [after][crate::model::PropertyChange::after].
9687    ///
9688    /// # Example
9689    /// ```ignore,no_run
9690    /// # use google_cloud_config_v1::model::PropertyChange;
9691    /// use wkt::Value;
9692    /// let x = PropertyChange::new().set_or_clear_after(Some(Value::default()/* use setters */));
9693    /// let x = PropertyChange::new().set_or_clear_after(None::<Value>);
9694    /// ```
9695    pub fn set_or_clear_after<T>(mut self, v: std::option::Option<T>) -> Self
9696    where
9697        T: std::convert::Into<wkt::Value>,
9698    {
9699        self.after = v.map(|x| x.into());
9700        self
9701    }
9702}
9703
9704impl wkt::message::Message for PropertyChange {
9705    fn typename() -> &'static str {
9706        "type.googleapis.com/google.cloud.config.v1.PropertyChange"
9707    }
9708}
9709
9710/// The request message for the ListResourceChanges method.
9711#[derive(Clone, Default, PartialEq)]
9712#[non_exhaustive]
9713pub struct ListResourceChangesRequest {
9714    /// Required. The parent in whose context the ResourceChanges are listed. The
9715    /// parent value is in the format:
9716    /// 'projects/{project_id}/locations/{location}/previews/{preview}'.
9717    pub parent: std::string::String,
9718
9719    /// Optional. When requesting a page of resource changes, 'page_size' specifies
9720    /// number of resource changes to return. If unspecified, at most 500 will be
9721    /// returned. The maximum value is 1000.
9722    pub page_size: i32,
9723
9724    /// Optional. Token returned by previous call to 'ListResourceChanges' which
9725    /// specifies the position in the list from where to continue listing the
9726    /// resource changes.
9727    pub page_token: std::string::String,
9728
9729    /// Optional. Lists the resource changes that match the filter expression. A
9730    /// filter expression filters the resource changes listed in the response. The
9731    /// expression must be of the form '{field} {operator} {value}' where
9732    /// operators: '<', '>',
9733    /// '<=',
9734    /// '>=',
9735    /// '!=', '=', ':' are supported (colon ':' represents a HAS operator which is
9736    /// roughly synonymous with equality). {field} can refer to a proto or JSON
9737    /// field, or a synthetic field. Field names can be camelCase or snake_case.
9738    ///
9739    /// Examples:
9740    ///
9741    /// - Filter by name:
9742    ///   name =
9743    ///   "projects/foo/locations/us-central1/previews/dep/resourceChanges/baz
9744    pub filter: std::string::String,
9745
9746    /// Optional. Field to use to sort the list.
9747    pub order_by: std::string::String,
9748
9749    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9750}
9751
9752impl ListResourceChangesRequest {
9753    /// Creates a new default instance.
9754    pub fn new() -> Self {
9755        std::default::Default::default()
9756    }
9757
9758    /// Sets the value of [parent][crate::model::ListResourceChangesRequest::parent].
9759    ///
9760    /// # Example
9761    /// ```ignore,no_run
9762    /// # use google_cloud_config_v1::model::ListResourceChangesRequest;
9763    /// # let project_id = "project_id";
9764    /// # let location_id = "location_id";
9765    /// # let preview_id = "preview_id";
9766    /// let x = ListResourceChangesRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/previews/{preview_id}"));
9767    /// ```
9768    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9769        self.parent = v.into();
9770        self
9771    }
9772
9773    /// Sets the value of [page_size][crate::model::ListResourceChangesRequest::page_size].
9774    ///
9775    /// # Example
9776    /// ```ignore,no_run
9777    /// # use google_cloud_config_v1::model::ListResourceChangesRequest;
9778    /// let x = ListResourceChangesRequest::new().set_page_size(42);
9779    /// ```
9780    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9781        self.page_size = v.into();
9782        self
9783    }
9784
9785    /// Sets the value of [page_token][crate::model::ListResourceChangesRequest::page_token].
9786    ///
9787    /// # Example
9788    /// ```ignore,no_run
9789    /// # use google_cloud_config_v1::model::ListResourceChangesRequest;
9790    /// let x = ListResourceChangesRequest::new().set_page_token("example");
9791    /// ```
9792    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9793        self.page_token = v.into();
9794        self
9795    }
9796
9797    /// Sets the value of [filter][crate::model::ListResourceChangesRequest::filter].
9798    ///
9799    /// # Example
9800    /// ```ignore,no_run
9801    /// # use google_cloud_config_v1::model::ListResourceChangesRequest;
9802    /// let x = ListResourceChangesRequest::new().set_filter("example");
9803    /// ```
9804    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9805        self.filter = v.into();
9806        self
9807    }
9808
9809    /// Sets the value of [order_by][crate::model::ListResourceChangesRequest::order_by].
9810    ///
9811    /// # Example
9812    /// ```ignore,no_run
9813    /// # use google_cloud_config_v1::model::ListResourceChangesRequest;
9814    /// let x = ListResourceChangesRequest::new().set_order_by("example");
9815    /// ```
9816    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9817        self.order_by = v.into();
9818        self
9819    }
9820}
9821
9822impl wkt::message::Message for ListResourceChangesRequest {
9823    fn typename() -> &'static str {
9824        "type.googleapis.com/google.cloud.config.v1.ListResourceChangesRequest"
9825    }
9826}
9827
9828/// A response to a 'ListResourceChanges' call. Contains a list of
9829/// ResourceChanges.
9830#[derive(Clone, Default, PartialEq)]
9831#[non_exhaustive]
9832pub struct ListResourceChangesResponse {
9833    /// List of ResourceChanges.
9834    pub resource_changes: std::vec::Vec<crate::model::ResourceChange>,
9835
9836    /// A token to request the next page of resources from the
9837    /// 'ListResourceChanges' method. The value of an empty string means that
9838    /// there are no more resources to return.
9839    pub next_page_token: std::string::String,
9840
9841    /// Unreachable resources, if any.
9842    pub unreachable: std::vec::Vec<std::string::String>,
9843
9844    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9845}
9846
9847impl ListResourceChangesResponse {
9848    /// Creates a new default instance.
9849    pub fn new() -> Self {
9850        std::default::Default::default()
9851    }
9852
9853    /// Sets the value of [resource_changes][crate::model::ListResourceChangesResponse::resource_changes].
9854    ///
9855    /// # Example
9856    /// ```ignore,no_run
9857    /// # use google_cloud_config_v1::model::ListResourceChangesResponse;
9858    /// use google_cloud_config_v1::model::ResourceChange;
9859    /// let x = ListResourceChangesResponse::new()
9860    ///     .set_resource_changes([
9861    ///         ResourceChange::default()/* use setters */,
9862    ///         ResourceChange::default()/* use (different) setters */,
9863    ///     ]);
9864    /// ```
9865    pub fn set_resource_changes<T, V>(mut self, v: T) -> Self
9866    where
9867        T: std::iter::IntoIterator<Item = V>,
9868        V: std::convert::Into<crate::model::ResourceChange>,
9869    {
9870        use std::iter::Iterator;
9871        self.resource_changes = v.into_iter().map(|i| i.into()).collect();
9872        self
9873    }
9874
9875    /// Sets the value of [next_page_token][crate::model::ListResourceChangesResponse::next_page_token].
9876    ///
9877    /// # Example
9878    /// ```ignore,no_run
9879    /// # use google_cloud_config_v1::model::ListResourceChangesResponse;
9880    /// let x = ListResourceChangesResponse::new().set_next_page_token("example");
9881    /// ```
9882    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9883        self.next_page_token = v.into();
9884        self
9885    }
9886
9887    /// Sets the value of [unreachable][crate::model::ListResourceChangesResponse::unreachable].
9888    ///
9889    /// # Example
9890    /// ```ignore,no_run
9891    /// # use google_cloud_config_v1::model::ListResourceChangesResponse;
9892    /// let x = ListResourceChangesResponse::new().set_unreachable(["a", "b", "c"]);
9893    /// ```
9894    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
9895    where
9896        T: std::iter::IntoIterator<Item = V>,
9897        V: std::convert::Into<std::string::String>,
9898    {
9899        use std::iter::Iterator;
9900        self.unreachable = v.into_iter().map(|i| i.into()).collect();
9901        self
9902    }
9903}
9904
9905impl wkt::message::Message for ListResourceChangesResponse {
9906    fn typename() -> &'static str {
9907        "type.googleapis.com/google.cloud.config.v1.ListResourceChangesResponse"
9908    }
9909}
9910
9911#[doc(hidden)]
9912impl google_cloud_gax::paginator::internal::PageableResponse for ListResourceChangesResponse {
9913    type PageItem = crate::model::ResourceChange;
9914
9915    fn items(self) -> std::vec::Vec<Self::PageItem> {
9916        self.resource_changes
9917    }
9918
9919    fn next_page_token(&self) -> std::string::String {
9920        use std::clone::Clone;
9921        self.next_page_token.clone()
9922    }
9923}
9924
9925/// The request message for the GetResourceChange method.
9926#[derive(Clone, Default, PartialEq)]
9927#[non_exhaustive]
9928pub struct GetResourceChangeRequest {
9929    /// Required. The name of the resource change to retrieve.
9930    /// Format:
9931    /// 'projects/{project_id}/locations/{location}/previews/{preview}/resourceChanges/{resource_change}'.
9932    pub name: std::string::String,
9933
9934    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9935}
9936
9937impl GetResourceChangeRequest {
9938    /// Creates a new default instance.
9939    pub fn new() -> Self {
9940        std::default::Default::default()
9941    }
9942
9943    /// Sets the value of [name][crate::model::GetResourceChangeRequest::name].
9944    ///
9945    /// # Example
9946    /// ```ignore,no_run
9947    /// # use google_cloud_config_v1::model::GetResourceChangeRequest;
9948    /// # let project_id = "project_id";
9949    /// # let location_id = "location_id";
9950    /// # let preview_id = "preview_id";
9951    /// # let resource_change_id = "resource_change_id";
9952    /// let x = GetResourceChangeRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/previews/{preview_id}/resourceChanges/{resource_change_id}"));
9953    /// ```
9954    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9955        self.name = v.into();
9956        self
9957    }
9958}
9959
9960impl wkt::message::Message for GetResourceChangeRequest {
9961    fn typename() -> &'static str {
9962        "type.googleapis.com/google.cloud.config.v1.GetResourceChangeRequest"
9963    }
9964}
9965
9966/// Terraform info of a ResourceChange.
9967#[derive(Clone, Default, PartialEq)]
9968#[non_exhaustive]
9969pub struct ResourceDriftTerraformInfo {
9970    /// Output only. The address of the drifted resource.
9971    pub address: std::string::String,
9972
9973    /// Output only. The type of the drifted resource.
9974    pub r#type: std::string::String,
9975
9976    /// Output only. TF resource name.
9977    pub resource_name: std::string::String,
9978
9979    /// Output only. The provider of the drifted resource.
9980    pub provider: std::string::String,
9981
9982    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9983}
9984
9985impl ResourceDriftTerraformInfo {
9986    /// Creates a new default instance.
9987    pub fn new() -> Self {
9988        std::default::Default::default()
9989    }
9990
9991    /// Sets the value of [address][crate::model::ResourceDriftTerraformInfo::address].
9992    ///
9993    /// # Example
9994    /// ```ignore,no_run
9995    /// # use google_cloud_config_v1::model::ResourceDriftTerraformInfo;
9996    /// let x = ResourceDriftTerraformInfo::new().set_address("example");
9997    /// ```
9998    pub fn set_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9999        self.address = v.into();
10000        self
10001    }
10002
10003    /// Sets the value of [r#type][crate::model::ResourceDriftTerraformInfo::type].
10004    ///
10005    /// # Example
10006    /// ```ignore,no_run
10007    /// # use google_cloud_config_v1::model::ResourceDriftTerraformInfo;
10008    /// let x = ResourceDriftTerraformInfo::new().set_type("example");
10009    /// ```
10010    pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10011        self.r#type = v.into();
10012        self
10013    }
10014
10015    /// Sets the value of [resource_name][crate::model::ResourceDriftTerraformInfo::resource_name].
10016    ///
10017    /// # Example
10018    /// ```ignore,no_run
10019    /// # use google_cloud_config_v1::model::ResourceDriftTerraformInfo;
10020    /// let x = ResourceDriftTerraformInfo::new().set_resource_name("example");
10021    /// ```
10022    pub fn set_resource_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10023        self.resource_name = v.into();
10024        self
10025    }
10026
10027    /// Sets the value of [provider][crate::model::ResourceDriftTerraformInfo::provider].
10028    ///
10029    /// # Example
10030    /// ```ignore,no_run
10031    /// # use google_cloud_config_v1::model::ResourceDriftTerraformInfo;
10032    /// let x = ResourceDriftTerraformInfo::new().set_provider("example");
10033    /// ```
10034    pub fn set_provider<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10035        self.provider = v.into();
10036        self
10037    }
10038}
10039
10040impl wkt::message::Message for ResourceDriftTerraformInfo {
10041    fn typename() -> &'static str {
10042        "type.googleapis.com/google.cloud.config.v1.ResourceDriftTerraformInfo"
10043    }
10044}
10045
10046/// A resource drift represents a drift to a resource in the state file.
10047#[derive(Clone, Default, PartialEq)]
10048#[non_exhaustive]
10049pub struct ResourceDrift {
10050    /// Identifier. The name of the resource drift.
10051    /// Format:
10052    /// 'projects/{project_id}/locations/{location}/previews/{preview}/resourceDrifts/{resource_drift}'.
10053    pub name: std::string::String,
10054
10055    /// Output only. Terraform info of the resource drift.
10056    pub terraform_info: std::option::Option<crate::model::ResourceDriftTerraformInfo>,
10057
10058    /// Output only. The property drifts of the resource drift.
10059    pub property_drifts: std::vec::Vec<crate::model::PropertyDrift>,
10060
10061    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10062}
10063
10064impl ResourceDrift {
10065    /// Creates a new default instance.
10066    pub fn new() -> Self {
10067        std::default::Default::default()
10068    }
10069
10070    /// Sets the value of [name][crate::model::ResourceDrift::name].
10071    ///
10072    /// # Example
10073    /// ```ignore,no_run
10074    /// # use google_cloud_config_v1::model::ResourceDrift;
10075    /// # let project_id = "project_id";
10076    /// # let location_id = "location_id";
10077    /// # let preview_id = "preview_id";
10078    /// # let resource_drift_id = "resource_drift_id";
10079    /// let x = ResourceDrift::new().set_name(format!("projects/{project_id}/locations/{location_id}/previews/{preview_id}/resourceDrifts/{resource_drift_id}"));
10080    /// ```
10081    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10082        self.name = v.into();
10083        self
10084    }
10085
10086    /// Sets the value of [terraform_info][crate::model::ResourceDrift::terraform_info].
10087    ///
10088    /// # Example
10089    /// ```ignore,no_run
10090    /// # use google_cloud_config_v1::model::ResourceDrift;
10091    /// use google_cloud_config_v1::model::ResourceDriftTerraformInfo;
10092    /// let x = ResourceDrift::new().set_terraform_info(ResourceDriftTerraformInfo::default()/* use setters */);
10093    /// ```
10094    pub fn set_terraform_info<T>(mut self, v: T) -> Self
10095    where
10096        T: std::convert::Into<crate::model::ResourceDriftTerraformInfo>,
10097    {
10098        self.terraform_info = std::option::Option::Some(v.into());
10099        self
10100    }
10101
10102    /// Sets or clears the value of [terraform_info][crate::model::ResourceDrift::terraform_info].
10103    ///
10104    /// # Example
10105    /// ```ignore,no_run
10106    /// # use google_cloud_config_v1::model::ResourceDrift;
10107    /// use google_cloud_config_v1::model::ResourceDriftTerraformInfo;
10108    /// let x = ResourceDrift::new().set_or_clear_terraform_info(Some(ResourceDriftTerraformInfo::default()/* use setters */));
10109    /// let x = ResourceDrift::new().set_or_clear_terraform_info(None::<ResourceDriftTerraformInfo>);
10110    /// ```
10111    pub fn set_or_clear_terraform_info<T>(mut self, v: std::option::Option<T>) -> Self
10112    where
10113        T: std::convert::Into<crate::model::ResourceDriftTerraformInfo>,
10114    {
10115        self.terraform_info = v.map(|x| x.into());
10116        self
10117    }
10118
10119    /// Sets the value of [property_drifts][crate::model::ResourceDrift::property_drifts].
10120    ///
10121    /// # Example
10122    /// ```ignore,no_run
10123    /// # use google_cloud_config_v1::model::ResourceDrift;
10124    /// use google_cloud_config_v1::model::PropertyDrift;
10125    /// let x = ResourceDrift::new()
10126    ///     .set_property_drifts([
10127    ///         PropertyDrift::default()/* use setters */,
10128    ///         PropertyDrift::default()/* use (different) setters */,
10129    ///     ]);
10130    /// ```
10131    pub fn set_property_drifts<T, V>(mut self, v: T) -> Self
10132    where
10133        T: std::iter::IntoIterator<Item = V>,
10134        V: std::convert::Into<crate::model::PropertyDrift>,
10135    {
10136        use std::iter::Iterator;
10137        self.property_drifts = v.into_iter().map(|i| i.into()).collect();
10138        self
10139    }
10140}
10141
10142impl wkt::message::Message for ResourceDrift {
10143    fn typename() -> &'static str {
10144        "type.googleapis.com/google.cloud.config.v1.ResourceDrift"
10145    }
10146}
10147
10148/// A property drift represents a drift to a property in the state file.
10149#[derive(Clone, Default, PartialEq)]
10150#[non_exhaustive]
10151pub struct PropertyDrift {
10152    /// Output only. The path of the property drift.
10153    pub path: std::string::String,
10154
10155    /// Output only. The paths of sensitive fields in `before`. Paths are relative
10156    /// to `path`.
10157    pub before_sensitive_paths: std::vec::Vec<std::string::String>,
10158
10159    /// Output only. Representations of the object value before the actions.
10160    pub before: std::option::Option<wkt::Value>,
10161
10162    /// Output only. The paths of sensitive fields in `after`. Paths are relative
10163    /// to `path`.
10164    pub after_sensitive_paths: std::vec::Vec<std::string::String>,
10165
10166    /// Output only. Representations of the object value after the actions.
10167    pub after: std::option::Option<wkt::Value>,
10168
10169    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10170}
10171
10172impl PropertyDrift {
10173    /// Creates a new default instance.
10174    pub fn new() -> Self {
10175        std::default::Default::default()
10176    }
10177
10178    /// Sets the value of [path][crate::model::PropertyDrift::path].
10179    ///
10180    /// # Example
10181    /// ```ignore,no_run
10182    /// # use google_cloud_config_v1::model::PropertyDrift;
10183    /// let x = PropertyDrift::new().set_path("example");
10184    /// ```
10185    pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10186        self.path = v.into();
10187        self
10188    }
10189
10190    /// Sets the value of [before_sensitive_paths][crate::model::PropertyDrift::before_sensitive_paths].
10191    ///
10192    /// # Example
10193    /// ```ignore,no_run
10194    /// # use google_cloud_config_v1::model::PropertyDrift;
10195    /// let x = PropertyDrift::new().set_before_sensitive_paths(["a", "b", "c"]);
10196    /// ```
10197    pub fn set_before_sensitive_paths<T, V>(mut self, v: T) -> Self
10198    where
10199        T: std::iter::IntoIterator<Item = V>,
10200        V: std::convert::Into<std::string::String>,
10201    {
10202        use std::iter::Iterator;
10203        self.before_sensitive_paths = v.into_iter().map(|i| i.into()).collect();
10204        self
10205    }
10206
10207    /// Sets the value of [before][crate::model::PropertyDrift::before].
10208    ///
10209    /// # Example
10210    /// ```ignore,no_run
10211    /// # use google_cloud_config_v1::model::PropertyDrift;
10212    /// use wkt::Value;
10213    /// let x = PropertyDrift::new().set_before(Value::default()/* use setters */);
10214    /// ```
10215    pub fn set_before<T>(mut self, v: T) -> Self
10216    where
10217        T: std::convert::Into<wkt::Value>,
10218    {
10219        self.before = std::option::Option::Some(v.into());
10220        self
10221    }
10222
10223    /// Sets or clears the value of [before][crate::model::PropertyDrift::before].
10224    ///
10225    /// # Example
10226    /// ```ignore,no_run
10227    /// # use google_cloud_config_v1::model::PropertyDrift;
10228    /// use wkt::Value;
10229    /// let x = PropertyDrift::new().set_or_clear_before(Some(Value::default()/* use setters */));
10230    /// let x = PropertyDrift::new().set_or_clear_before(None::<Value>);
10231    /// ```
10232    pub fn set_or_clear_before<T>(mut self, v: std::option::Option<T>) -> Self
10233    where
10234        T: std::convert::Into<wkt::Value>,
10235    {
10236        self.before = v.map(|x| x.into());
10237        self
10238    }
10239
10240    /// Sets the value of [after_sensitive_paths][crate::model::PropertyDrift::after_sensitive_paths].
10241    ///
10242    /// # Example
10243    /// ```ignore,no_run
10244    /// # use google_cloud_config_v1::model::PropertyDrift;
10245    /// let x = PropertyDrift::new().set_after_sensitive_paths(["a", "b", "c"]);
10246    /// ```
10247    pub fn set_after_sensitive_paths<T, V>(mut self, v: T) -> Self
10248    where
10249        T: std::iter::IntoIterator<Item = V>,
10250        V: std::convert::Into<std::string::String>,
10251    {
10252        use std::iter::Iterator;
10253        self.after_sensitive_paths = v.into_iter().map(|i| i.into()).collect();
10254        self
10255    }
10256
10257    /// Sets the value of [after][crate::model::PropertyDrift::after].
10258    ///
10259    /// # Example
10260    /// ```ignore,no_run
10261    /// # use google_cloud_config_v1::model::PropertyDrift;
10262    /// use wkt::Value;
10263    /// let x = PropertyDrift::new().set_after(Value::default()/* use setters */);
10264    /// ```
10265    pub fn set_after<T>(mut self, v: T) -> Self
10266    where
10267        T: std::convert::Into<wkt::Value>,
10268    {
10269        self.after = std::option::Option::Some(v.into());
10270        self
10271    }
10272
10273    /// Sets or clears the value of [after][crate::model::PropertyDrift::after].
10274    ///
10275    /// # Example
10276    /// ```ignore,no_run
10277    /// # use google_cloud_config_v1::model::PropertyDrift;
10278    /// use wkt::Value;
10279    /// let x = PropertyDrift::new().set_or_clear_after(Some(Value::default()/* use setters */));
10280    /// let x = PropertyDrift::new().set_or_clear_after(None::<Value>);
10281    /// ```
10282    pub fn set_or_clear_after<T>(mut self, v: std::option::Option<T>) -> Self
10283    where
10284        T: std::convert::Into<wkt::Value>,
10285    {
10286        self.after = v.map(|x| x.into());
10287        self
10288    }
10289}
10290
10291impl wkt::message::Message for PropertyDrift {
10292    fn typename() -> &'static str {
10293        "type.googleapis.com/google.cloud.config.v1.PropertyDrift"
10294    }
10295}
10296
10297/// The request message for the ListResourceDrifts method.
10298#[derive(Clone, Default, PartialEq)]
10299#[non_exhaustive]
10300pub struct ListResourceDriftsRequest {
10301    /// Required. The parent in whose context the ResourceDrifts are listed. The
10302    /// parent value is in the format:
10303    /// 'projects/{project_id}/locations/{location}/previews/{preview}'.
10304    pub parent: std::string::String,
10305
10306    /// Optional. When requesting a page of resource drifts, 'page_size' specifies
10307    /// number of resource drifts to return. If unspecified, at most 500 will be
10308    /// returned. The maximum value is 1000.
10309    pub page_size: i32,
10310
10311    /// Optional. Token returned by previous call to 'ListResourceDrifts' which
10312    /// specifies the position in the list from where to continue listing the
10313    /// resource drifts.
10314    pub page_token: std::string::String,
10315
10316    /// Optional. Lists the resource drifts that match the filter expression. A
10317    /// filter expression filters the resource drifts listed in the response. The
10318    /// expression must be of the form '{field} {operator} {value}' where
10319    /// operators: '<', '>',
10320    /// '<=',
10321    /// '>=',
10322    /// '!=', '=', ':' are supported (colon ':' represents a HAS operator which is
10323    /// roughly synonymous with equality). {field} can refer to a proto or JSON
10324    /// field, or a synthetic field. Field names can be camelCase or snake_case.
10325    ///
10326    /// Examples:
10327    ///
10328    /// - Filter by name:
10329    ///   name =
10330    ///   "projects/foo/locations/us-central1/previews/dep/resourceDrifts/baz
10331    pub filter: std::string::String,
10332
10333    /// Optional. Field to use to sort the list.
10334    pub order_by: std::string::String,
10335
10336    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10337}
10338
10339impl ListResourceDriftsRequest {
10340    /// Creates a new default instance.
10341    pub fn new() -> Self {
10342        std::default::Default::default()
10343    }
10344
10345    /// Sets the value of [parent][crate::model::ListResourceDriftsRequest::parent].
10346    ///
10347    /// # Example
10348    /// ```ignore,no_run
10349    /// # use google_cloud_config_v1::model::ListResourceDriftsRequest;
10350    /// # let project_id = "project_id";
10351    /// # let location_id = "location_id";
10352    /// # let preview_id = "preview_id";
10353    /// let x = ListResourceDriftsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/previews/{preview_id}"));
10354    /// ```
10355    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10356        self.parent = v.into();
10357        self
10358    }
10359
10360    /// Sets the value of [page_size][crate::model::ListResourceDriftsRequest::page_size].
10361    ///
10362    /// # Example
10363    /// ```ignore,no_run
10364    /// # use google_cloud_config_v1::model::ListResourceDriftsRequest;
10365    /// let x = ListResourceDriftsRequest::new().set_page_size(42);
10366    /// ```
10367    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10368        self.page_size = v.into();
10369        self
10370    }
10371
10372    /// Sets the value of [page_token][crate::model::ListResourceDriftsRequest::page_token].
10373    ///
10374    /// # Example
10375    /// ```ignore,no_run
10376    /// # use google_cloud_config_v1::model::ListResourceDriftsRequest;
10377    /// let x = ListResourceDriftsRequest::new().set_page_token("example");
10378    /// ```
10379    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10380        self.page_token = v.into();
10381        self
10382    }
10383
10384    /// Sets the value of [filter][crate::model::ListResourceDriftsRequest::filter].
10385    ///
10386    /// # Example
10387    /// ```ignore,no_run
10388    /// # use google_cloud_config_v1::model::ListResourceDriftsRequest;
10389    /// let x = ListResourceDriftsRequest::new().set_filter("example");
10390    /// ```
10391    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10392        self.filter = v.into();
10393        self
10394    }
10395
10396    /// Sets the value of [order_by][crate::model::ListResourceDriftsRequest::order_by].
10397    ///
10398    /// # Example
10399    /// ```ignore,no_run
10400    /// # use google_cloud_config_v1::model::ListResourceDriftsRequest;
10401    /// let x = ListResourceDriftsRequest::new().set_order_by("example");
10402    /// ```
10403    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10404        self.order_by = v.into();
10405        self
10406    }
10407}
10408
10409impl wkt::message::Message for ListResourceDriftsRequest {
10410    fn typename() -> &'static str {
10411        "type.googleapis.com/google.cloud.config.v1.ListResourceDriftsRequest"
10412    }
10413}
10414
10415/// A response to a 'ListResourceDrifts' call. Contains a list of ResourceDrifts.
10416#[derive(Clone, Default, PartialEq)]
10417#[non_exhaustive]
10418pub struct ListResourceDriftsResponse {
10419    /// List of ResourceDrifts.
10420    pub resource_drifts: std::vec::Vec<crate::model::ResourceDrift>,
10421
10422    /// A token to request the next page of resources from the
10423    /// 'ListResourceDrifts' method. The value of an empty string means that
10424    /// there are no more resources to return.
10425    pub next_page_token: std::string::String,
10426
10427    /// Unreachable resources, if any.
10428    pub unreachable: std::vec::Vec<std::string::String>,
10429
10430    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10431}
10432
10433impl ListResourceDriftsResponse {
10434    /// Creates a new default instance.
10435    pub fn new() -> Self {
10436        std::default::Default::default()
10437    }
10438
10439    /// Sets the value of [resource_drifts][crate::model::ListResourceDriftsResponse::resource_drifts].
10440    ///
10441    /// # Example
10442    /// ```ignore,no_run
10443    /// # use google_cloud_config_v1::model::ListResourceDriftsResponse;
10444    /// use google_cloud_config_v1::model::ResourceDrift;
10445    /// let x = ListResourceDriftsResponse::new()
10446    ///     .set_resource_drifts([
10447    ///         ResourceDrift::default()/* use setters */,
10448    ///         ResourceDrift::default()/* use (different) setters */,
10449    ///     ]);
10450    /// ```
10451    pub fn set_resource_drifts<T, V>(mut self, v: T) -> Self
10452    where
10453        T: std::iter::IntoIterator<Item = V>,
10454        V: std::convert::Into<crate::model::ResourceDrift>,
10455    {
10456        use std::iter::Iterator;
10457        self.resource_drifts = v.into_iter().map(|i| i.into()).collect();
10458        self
10459    }
10460
10461    /// Sets the value of [next_page_token][crate::model::ListResourceDriftsResponse::next_page_token].
10462    ///
10463    /// # Example
10464    /// ```ignore,no_run
10465    /// # use google_cloud_config_v1::model::ListResourceDriftsResponse;
10466    /// let x = ListResourceDriftsResponse::new().set_next_page_token("example");
10467    /// ```
10468    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10469        self.next_page_token = v.into();
10470        self
10471    }
10472
10473    /// Sets the value of [unreachable][crate::model::ListResourceDriftsResponse::unreachable].
10474    ///
10475    /// # Example
10476    /// ```ignore,no_run
10477    /// # use google_cloud_config_v1::model::ListResourceDriftsResponse;
10478    /// let x = ListResourceDriftsResponse::new().set_unreachable(["a", "b", "c"]);
10479    /// ```
10480    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
10481    where
10482        T: std::iter::IntoIterator<Item = V>,
10483        V: std::convert::Into<std::string::String>,
10484    {
10485        use std::iter::Iterator;
10486        self.unreachable = v.into_iter().map(|i| i.into()).collect();
10487        self
10488    }
10489}
10490
10491impl wkt::message::Message for ListResourceDriftsResponse {
10492    fn typename() -> &'static str {
10493        "type.googleapis.com/google.cloud.config.v1.ListResourceDriftsResponse"
10494    }
10495}
10496
10497#[doc(hidden)]
10498impl google_cloud_gax::paginator::internal::PageableResponse for ListResourceDriftsResponse {
10499    type PageItem = crate::model::ResourceDrift;
10500
10501    fn items(self) -> std::vec::Vec<Self::PageItem> {
10502        self.resource_drifts
10503    }
10504
10505    fn next_page_token(&self) -> std::string::String {
10506        use std::clone::Clone;
10507        self.next_page_token.clone()
10508    }
10509}
10510
10511/// The request message for the GetResourceDrift method.
10512#[derive(Clone, Default, PartialEq)]
10513#[non_exhaustive]
10514pub struct GetResourceDriftRequest {
10515    /// Required. The name of the resource drift to retrieve.
10516    /// Format:
10517    /// 'projects/{project_id}/locations/{location}/previews/{preview}/resourceDrifts/{resource_drift}'.
10518    pub name: std::string::String,
10519
10520    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10521}
10522
10523impl GetResourceDriftRequest {
10524    /// Creates a new default instance.
10525    pub fn new() -> Self {
10526        std::default::Default::default()
10527    }
10528
10529    /// Sets the value of [name][crate::model::GetResourceDriftRequest::name].
10530    ///
10531    /// # Example
10532    /// ```ignore,no_run
10533    /// # use google_cloud_config_v1::model::GetResourceDriftRequest;
10534    /// # let project_id = "project_id";
10535    /// # let location_id = "location_id";
10536    /// # let preview_id = "preview_id";
10537    /// # let resource_drift_id = "resource_drift_id";
10538    /// let x = GetResourceDriftRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/previews/{preview_id}/resourceDrifts/{resource_drift_id}"));
10539    /// ```
10540    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10541        self.name = v.into();
10542        self
10543    }
10544}
10545
10546impl wkt::message::Message for GetResourceDriftRequest {
10547    fn typename() -> &'static str {
10548        "type.googleapis.com/google.cloud.config.v1.GetResourceDriftRequest"
10549    }
10550}
10551
10552/// ProviderConfig contains the provider configurations.
10553#[derive(Clone, Default, PartialEq)]
10554#[non_exhaustive]
10555pub struct ProviderConfig {
10556    /// Optional. ProviderSource specifies the source type of the provider.
10557    pub source_type: std::option::Option<crate::model::provider_config::ProviderSource>,
10558
10559    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10560}
10561
10562impl ProviderConfig {
10563    /// Creates a new default instance.
10564    pub fn new() -> Self {
10565        std::default::Default::default()
10566    }
10567
10568    /// Sets the value of [source_type][crate::model::ProviderConfig::source_type].
10569    ///
10570    /// # Example
10571    /// ```ignore,no_run
10572    /// # use google_cloud_config_v1::model::ProviderConfig;
10573    /// use google_cloud_config_v1::model::provider_config::ProviderSource;
10574    /// let x0 = ProviderConfig::new().set_source_type(ProviderSource::ServiceMaintained);
10575    /// ```
10576    pub fn set_source_type<T>(mut self, v: T) -> Self
10577    where
10578        T: std::convert::Into<crate::model::provider_config::ProviderSource>,
10579    {
10580        self.source_type = std::option::Option::Some(v.into());
10581        self
10582    }
10583
10584    /// Sets or clears the value of [source_type][crate::model::ProviderConfig::source_type].
10585    ///
10586    /// # Example
10587    /// ```ignore,no_run
10588    /// # use google_cloud_config_v1::model::ProviderConfig;
10589    /// use google_cloud_config_v1::model::provider_config::ProviderSource;
10590    /// let x0 = ProviderConfig::new().set_or_clear_source_type(Some(ProviderSource::ServiceMaintained));
10591    /// let x_none = ProviderConfig::new().set_or_clear_source_type(None::<ProviderSource>);
10592    /// ```
10593    pub fn set_or_clear_source_type<T>(mut self, v: std::option::Option<T>) -> Self
10594    where
10595        T: std::convert::Into<crate::model::provider_config::ProviderSource>,
10596    {
10597        self.source_type = v.map(|x| x.into());
10598        self
10599    }
10600}
10601
10602impl wkt::message::Message for ProviderConfig {
10603    fn typename() -> &'static str {
10604        "type.googleapis.com/google.cloud.config.v1.ProviderConfig"
10605    }
10606}
10607
10608/// Defines additional types related to [ProviderConfig].
10609pub mod provider_config {
10610    #[allow(unused_imports)]
10611    use super::*;
10612
10613    /// ProviderSource represents the source type of the provider.
10614    ///
10615    /// # Working with unknown values
10616    ///
10617    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10618    /// additional enum variants at any time. Adding new variants is not considered
10619    /// a breaking change. Applications should write their code in anticipation of:
10620    ///
10621    /// - New values appearing in future releases of the client library, **and**
10622    /// - New values received dynamically, without application changes.
10623    ///
10624    /// Please consult the [Working with enums] section in the user guide for some
10625    /// guidelines.
10626    ///
10627    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
10628    #[derive(Clone, Debug, PartialEq)]
10629    #[non_exhaustive]
10630    pub enum ProviderSource {
10631        /// Unspecified source type, default to public sources.
10632        Unspecified,
10633        /// Service maintained provider source type.
10634        ServiceMaintained,
10635        /// If set, the enum was initialized with an unknown value.
10636        ///
10637        /// Applications can examine the value using [ProviderSource::value] or
10638        /// [ProviderSource::name].
10639        UnknownValue(provider_source::UnknownValue),
10640    }
10641
10642    #[doc(hidden)]
10643    pub mod provider_source {
10644        #[allow(unused_imports)]
10645        use super::*;
10646        #[derive(Clone, Debug, PartialEq)]
10647        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10648    }
10649
10650    impl ProviderSource {
10651        /// Gets the enum value.
10652        ///
10653        /// Returns `None` if the enum contains an unknown value deserialized from
10654        /// the string representation of enums.
10655        pub fn value(&self) -> std::option::Option<i32> {
10656            match self {
10657                Self::Unspecified => std::option::Option::Some(0),
10658                Self::ServiceMaintained => std::option::Option::Some(1),
10659                Self::UnknownValue(u) => u.0.value(),
10660            }
10661        }
10662
10663        /// Gets the enum value as a string.
10664        ///
10665        /// Returns `None` if the enum contains an unknown value deserialized from
10666        /// the integer representation of enums.
10667        pub fn name(&self) -> std::option::Option<&str> {
10668            match self {
10669                Self::Unspecified => std::option::Option::Some("PROVIDER_SOURCE_UNSPECIFIED"),
10670                Self::ServiceMaintained => std::option::Option::Some("SERVICE_MAINTAINED"),
10671                Self::UnknownValue(u) => u.0.name(),
10672            }
10673        }
10674    }
10675
10676    impl std::default::Default for ProviderSource {
10677        fn default() -> Self {
10678            use std::convert::From;
10679            Self::from(0)
10680        }
10681    }
10682
10683    impl std::fmt::Display for ProviderSource {
10684        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10685            wkt::internal::display_enum(f, self.name(), self.value())
10686        }
10687    }
10688
10689    impl std::convert::From<i32> for ProviderSource {
10690        fn from(value: i32) -> Self {
10691            match value {
10692                0 => Self::Unspecified,
10693                1 => Self::ServiceMaintained,
10694                _ => Self::UnknownValue(provider_source::UnknownValue(
10695                    wkt::internal::UnknownEnumValue::Integer(value),
10696                )),
10697            }
10698        }
10699    }
10700
10701    impl std::convert::From<&str> for ProviderSource {
10702        fn from(value: &str) -> Self {
10703            use std::string::ToString;
10704            match value {
10705                "PROVIDER_SOURCE_UNSPECIFIED" => Self::Unspecified,
10706                "SERVICE_MAINTAINED" => Self::ServiceMaintained,
10707                _ => Self::UnknownValue(provider_source::UnknownValue(
10708                    wkt::internal::UnknownEnumValue::String(value.to_string()),
10709                )),
10710            }
10711        }
10712    }
10713
10714    impl serde::ser::Serialize for ProviderSource {
10715        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10716        where
10717            S: serde::Serializer,
10718        {
10719            match self {
10720                Self::Unspecified => serializer.serialize_i32(0),
10721                Self::ServiceMaintained => serializer.serialize_i32(1),
10722                Self::UnknownValue(u) => u.0.serialize(serializer),
10723            }
10724        }
10725    }
10726
10727    impl<'de> serde::de::Deserialize<'de> for ProviderSource {
10728        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10729        where
10730            D: serde::Deserializer<'de>,
10731        {
10732            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ProviderSource>::new(
10733                ".google.cloud.config.v1.ProviderConfig.ProviderSource",
10734            ))
10735        }
10736    }
10737}
10738
10739/// The request message for the GetAutoMigrationConfig method.
10740#[derive(Clone, Default, PartialEq)]
10741#[non_exhaustive]
10742pub struct GetAutoMigrationConfigRequest {
10743    /// Required. The name of the AutoMigrationConfig.
10744    /// Format:
10745    /// 'projects/{project_id}/locations/{location}/AutoMigrationConfig'.
10746    pub name: std::string::String,
10747
10748    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10749}
10750
10751impl GetAutoMigrationConfigRequest {
10752    /// Creates a new default instance.
10753    pub fn new() -> Self {
10754        std::default::Default::default()
10755    }
10756
10757    /// Sets the value of [name][crate::model::GetAutoMigrationConfigRequest::name].
10758    ///
10759    /// # Example
10760    /// ```ignore,no_run
10761    /// # use google_cloud_config_v1::model::GetAutoMigrationConfigRequest;
10762    /// # let project_id = "project_id";
10763    /// # let location_id = "location_id";
10764    /// let x = GetAutoMigrationConfigRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/autoMigrationConfig"));
10765    /// ```
10766    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10767        self.name = v.into();
10768        self
10769    }
10770}
10771
10772impl wkt::message::Message for GetAutoMigrationConfigRequest {
10773    fn typename() -> &'static str {
10774        "type.googleapis.com/google.cloud.config.v1.GetAutoMigrationConfigRequest"
10775    }
10776}
10777
10778/// AutoMigrationConfig contains the automigration configuration for a project.
10779#[derive(Clone, Default, PartialEq)]
10780#[non_exhaustive]
10781pub struct AutoMigrationConfig {
10782    /// Identifier. The name of the AutoMigrationConfig.
10783    /// Format:
10784    /// 'projects/{project_id}/locations/{location}/AutoMigrationConfig'.
10785    pub name: std::string::String,
10786
10787    /// Output only. Time the AutoMigrationConfig was last updated.
10788    pub update_time: std::option::Option<wkt::Timestamp>,
10789
10790    /// Optional. Whether the auto migration is enabled for the project.
10791    pub auto_migration_enabled: bool,
10792
10793    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10794}
10795
10796impl AutoMigrationConfig {
10797    /// Creates a new default instance.
10798    pub fn new() -> Self {
10799        std::default::Default::default()
10800    }
10801
10802    /// Sets the value of [name][crate::model::AutoMigrationConfig::name].
10803    ///
10804    /// # Example
10805    /// ```ignore,no_run
10806    /// # use google_cloud_config_v1::model::AutoMigrationConfig;
10807    /// # let project_id = "project_id";
10808    /// # let location_id = "location_id";
10809    /// let x = AutoMigrationConfig::new().set_name(format!("projects/{project_id}/locations/{location_id}/autoMigrationConfig"));
10810    /// ```
10811    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10812        self.name = v.into();
10813        self
10814    }
10815
10816    /// Sets the value of [update_time][crate::model::AutoMigrationConfig::update_time].
10817    ///
10818    /// # Example
10819    /// ```ignore,no_run
10820    /// # use google_cloud_config_v1::model::AutoMigrationConfig;
10821    /// use wkt::Timestamp;
10822    /// let x = AutoMigrationConfig::new().set_update_time(Timestamp::default()/* use setters */);
10823    /// ```
10824    pub fn set_update_time<T>(mut self, v: T) -> Self
10825    where
10826        T: std::convert::Into<wkt::Timestamp>,
10827    {
10828        self.update_time = std::option::Option::Some(v.into());
10829        self
10830    }
10831
10832    /// Sets or clears the value of [update_time][crate::model::AutoMigrationConfig::update_time].
10833    ///
10834    /// # Example
10835    /// ```ignore,no_run
10836    /// # use google_cloud_config_v1::model::AutoMigrationConfig;
10837    /// use wkt::Timestamp;
10838    /// let x = AutoMigrationConfig::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
10839    /// let x = AutoMigrationConfig::new().set_or_clear_update_time(None::<Timestamp>);
10840    /// ```
10841    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
10842    where
10843        T: std::convert::Into<wkt::Timestamp>,
10844    {
10845        self.update_time = v.map(|x| x.into());
10846        self
10847    }
10848
10849    /// Sets the value of [auto_migration_enabled][crate::model::AutoMigrationConfig::auto_migration_enabled].
10850    ///
10851    /// # Example
10852    /// ```ignore,no_run
10853    /// # use google_cloud_config_v1::model::AutoMigrationConfig;
10854    /// let x = AutoMigrationConfig::new().set_auto_migration_enabled(true);
10855    /// ```
10856    pub fn set_auto_migration_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10857        self.auto_migration_enabled = v.into();
10858        self
10859    }
10860}
10861
10862impl wkt::message::Message for AutoMigrationConfig {
10863    fn typename() -> &'static str {
10864        "type.googleapis.com/google.cloud.config.v1.AutoMigrationConfig"
10865    }
10866}
10867
10868/// The request message for the UpdateAutoMigrationConfig method.
10869#[derive(Clone, Default, PartialEq)]
10870#[non_exhaustive]
10871pub struct UpdateAutoMigrationConfigRequest {
10872    /// Optional. The update mask applies to the resource. See
10873    /// [google.protobuf.FieldMask][google.protobuf.FieldMask].
10874    ///
10875    /// [google.protobuf.FieldMask]: wkt::FieldMask
10876    pub update_mask: std::option::Option<wkt::FieldMask>,
10877
10878    /// Required. The AutoMigrationConfig to update.
10879    pub auto_migration_config: std::option::Option<crate::model::AutoMigrationConfig>,
10880
10881    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10882}
10883
10884impl UpdateAutoMigrationConfigRequest {
10885    /// Creates a new default instance.
10886    pub fn new() -> Self {
10887        std::default::Default::default()
10888    }
10889
10890    /// Sets the value of [update_mask][crate::model::UpdateAutoMigrationConfigRequest::update_mask].
10891    ///
10892    /// # Example
10893    /// ```ignore,no_run
10894    /// # use google_cloud_config_v1::model::UpdateAutoMigrationConfigRequest;
10895    /// use wkt::FieldMask;
10896    /// let x = UpdateAutoMigrationConfigRequest::new().set_update_mask(FieldMask::default()/* use setters */);
10897    /// ```
10898    pub fn set_update_mask<T>(mut self, v: T) -> Self
10899    where
10900        T: std::convert::Into<wkt::FieldMask>,
10901    {
10902        self.update_mask = std::option::Option::Some(v.into());
10903        self
10904    }
10905
10906    /// Sets or clears the value of [update_mask][crate::model::UpdateAutoMigrationConfigRequest::update_mask].
10907    ///
10908    /// # Example
10909    /// ```ignore,no_run
10910    /// # use google_cloud_config_v1::model::UpdateAutoMigrationConfigRequest;
10911    /// use wkt::FieldMask;
10912    /// let x = UpdateAutoMigrationConfigRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
10913    /// let x = UpdateAutoMigrationConfigRequest::new().set_or_clear_update_mask(None::<FieldMask>);
10914    /// ```
10915    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
10916    where
10917        T: std::convert::Into<wkt::FieldMask>,
10918    {
10919        self.update_mask = v.map(|x| x.into());
10920        self
10921    }
10922
10923    /// Sets the value of [auto_migration_config][crate::model::UpdateAutoMigrationConfigRequest::auto_migration_config].
10924    ///
10925    /// # Example
10926    /// ```ignore,no_run
10927    /// # use google_cloud_config_v1::model::UpdateAutoMigrationConfigRequest;
10928    /// use google_cloud_config_v1::model::AutoMigrationConfig;
10929    /// let x = UpdateAutoMigrationConfigRequest::new().set_auto_migration_config(AutoMigrationConfig::default()/* use setters */);
10930    /// ```
10931    pub fn set_auto_migration_config<T>(mut self, v: T) -> Self
10932    where
10933        T: std::convert::Into<crate::model::AutoMigrationConfig>,
10934    {
10935        self.auto_migration_config = std::option::Option::Some(v.into());
10936        self
10937    }
10938
10939    /// Sets or clears the value of [auto_migration_config][crate::model::UpdateAutoMigrationConfigRequest::auto_migration_config].
10940    ///
10941    /// # Example
10942    /// ```ignore,no_run
10943    /// # use google_cloud_config_v1::model::UpdateAutoMigrationConfigRequest;
10944    /// use google_cloud_config_v1::model::AutoMigrationConfig;
10945    /// let x = UpdateAutoMigrationConfigRequest::new().set_or_clear_auto_migration_config(Some(AutoMigrationConfig::default()/* use setters */));
10946    /// let x = UpdateAutoMigrationConfigRequest::new().set_or_clear_auto_migration_config(None::<AutoMigrationConfig>);
10947    /// ```
10948    pub fn set_or_clear_auto_migration_config<T>(mut self, v: std::option::Option<T>) -> Self
10949    where
10950        T: std::convert::Into<crate::model::AutoMigrationConfig>,
10951    {
10952        self.auto_migration_config = v.map(|x| x.into());
10953        self
10954    }
10955}
10956
10957impl wkt::message::Message for UpdateAutoMigrationConfigRequest {
10958    fn typename() -> &'static str {
10959        "type.googleapis.com/google.cloud.config.v1.UpdateAutoMigrationConfigRequest"
10960    }
10961}
10962
10963/// A DeploymentGroup is a collection of DeploymentUnits that in a DAG-like
10964/// structure.
10965#[derive(Clone, Default, PartialEq)]
10966#[non_exhaustive]
10967pub struct DeploymentGroup {
10968    /// Identifier. The name of the deployment group.
10969    /// Format:
10970    /// 'projects/{project_id}/locations/{location}/deploymentGroups/{deployment_group}'.
10971    pub name: std::string::String,
10972
10973    /// Output only. Time when the deployment group was created.
10974    pub create_time: std::option::Option<wkt::Timestamp>,
10975
10976    /// Output only. Time when the deployment group was last updated.
10977    pub update_time: std::option::Option<wkt::Timestamp>,
10978
10979    /// Optional. User-defined metadata for the deployment group.
10980    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
10981
10982    /// Optional. Arbitrary key-value metadata storage e.g. to help client tools
10983    /// identify deployment group during automation. See
10984    /// <https://google.aip.dev/148#annotations> for details on format and size
10985    /// limitations.
10986    pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
10987
10988    /// Output only. Current state of the deployment group.
10989    pub state: crate::model::deployment_group::State,
10990
10991    /// Output only. Additional information regarding the current state.
10992    pub state_description: std::string::String,
10993
10994    /// The deployment units of the deployment group in a DAG like structure.
10995    /// When a deployment group is being provisioned, the deployment units are
10996    /// deployed in a DAG order.
10997    /// The provided units must be in a DAG order, otherwise an error will be
10998    /// returned.
10999    pub deployment_units: std::vec::Vec<crate::model::DeploymentUnit>,
11000
11001    /// Output only. The provisioning state of the deployment group.
11002    pub provisioning_state: crate::model::deployment_group::ProvisioningState,
11003
11004    /// Output only. Additional information regarding the current provisioning
11005    /// state.
11006    pub provisioning_state_description: std::string::String,
11007
11008    /// Output only. The error status of the deployment group provisioning or
11009    /// deprovisioning.
11010    pub provisioning_error: std::option::Option<google_cloud_rpc::model::Status>,
11011
11012    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11013}
11014
11015impl DeploymentGroup {
11016    /// Creates a new default instance.
11017    pub fn new() -> Self {
11018        std::default::Default::default()
11019    }
11020
11021    /// Sets the value of [name][crate::model::DeploymentGroup::name].
11022    ///
11023    /// # Example
11024    /// ```ignore,no_run
11025    /// # use google_cloud_config_v1::model::DeploymentGroup;
11026    /// # let project_id = "project_id";
11027    /// # let location_id = "location_id";
11028    /// # let deployment_group_id = "deployment_group_id";
11029    /// let x = DeploymentGroup::new().set_name(format!("projects/{project_id}/locations/{location_id}/deploymentGroups/{deployment_group_id}"));
11030    /// ```
11031    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11032        self.name = v.into();
11033        self
11034    }
11035
11036    /// Sets the value of [create_time][crate::model::DeploymentGroup::create_time].
11037    ///
11038    /// # Example
11039    /// ```ignore,no_run
11040    /// # use google_cloud_config_v1::model::DeploymentGroup;
11041    /// use wkt::Timestamp;
11042    /// let x = DeploymentGroup::new().set_create_time(Timestamp::default()/* use setters */);
11043    /// ```
11044    pub fn set_create_time<T>(mut self, v: T) -> Self
11045    where
11046        T: std::convert::Into<wkt::Timestamp>,
11047    {
11048        self.create_time = std::option::Option::Some(v.into());
11049        self
11050    }
11051
11052    /// Sets or clears the value of [create_time][crate::model::DeploymentGroup::create_time].
11053    ///
11054    /// # Example
11055    /// ```ignore,no_run
11056    /// # use google_cloud_config_v1::model::DeploymentGroup;
11057    /// use wkt::Timestamp;
11058    /// let x = DeploymentGroup::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
11059    /// let x = DeploymentGroup::new().set_or_clear_create_time(None::<Timestamp>);
11060    /// ```
11061    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
11062    where
11063        T: std::convert::Into<wkt::Timestamp>,
11064    {
11065        self.create_time = v.map(|x| x.into());
11066        self
11067    }
11068
11069    /// Sets the value of [update_time][crate::model::DeploymentGroup::update_time].
11070    ///
11071    /// # Example
11072    /// ```ignore,no_run
11073    /// # use google_cloud_config_v1::model::DeploymentGroup;
11074    /// use wkt::Timestamp;
11075    /// let x = DeploymentGroup::new().set_update_time(Timestamp::default()/* use setters */);
11076    /// ```
11077    pub fn set_update_time<T>(mut self, v: T) -> Self
11078    where
11079        T: std::convert::Into<wkt::Timestamp>,
11080    {
11081        self.update_time = std::option::Option::Some(v.into());
11082        self
11083    }
11084
11085    /// Sets or clears the value of [update_time][crate::model::DeploymentGroup::update_time].
11086    ///
11087    /// # Example
11088    /// ```ignore,no_run
11089    /// # use google_cloud_config_v1::model::DeploymentGroup;
11090    /// use wkt::Timestamp;
11091    /// let x = DeploymentGroup::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
11092    /// let x = DeploymentGroup::new().set_or_clear_update_time(None::<Timestamp>);
11093    /// ```
11094    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
11095    where
11096        T: std::convert::Into<wkt::Timestamp>,
11097    {
11098        self.update_time = v.map(|x| x.into());
11099        self
11100    }
11101
11102    /// Sets the value of [labels][crate::model::DeploymentGroup::labels].
11103    ///
11104    /// # Example
11105    /// ```ignore,no_run
11106    /// # use google_cloud_config_v1::model::DeploymentGroup;
11107    /// let x = DeploymentGroup::new().set_labels([
11108    ///     ("key0", "abc"),
11109    ///     ("key1", "xyz"),
11110    /// ]);
11111    /// ```
11112    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
11113    where
11114        T: std::iter::IntoIterator<Item = (K, V)>,
11115        K: std::convert::Into<std::string::String>,
11116        V: std::convert::Into<std::string::String>,
11117    {
11118        use std::iter::Iterator;
11119        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
11120        self
11121    }
11122
11123    /// Sets the value of [annotations][crate::model::DeploymentGroup::annotations].
11124    ///
11125    /// # Example
11126    /// ```ignore,no_run
11127    /// # use google_cloud_config_v1::model::DeploymentGroup;
11128    /// let x = DeploymentGroup::new().set_annotations([
11129    ///     ("key0", "abc"),
11130    ///     ("key1", "xyz"),
11131    /// ]);
11132    /// ```
11133    pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
11134    where
11135        T: std::iter::IntoIterator<Item = (K, V)>,
11136        K: std::convert::Into<std::string::String>,
11137        V: std::convert::Into<std::string::String>,
11138    {
11139        use std::iter::Iterator;
11140        self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
11141        self
11142    }
11143
11144    /// Sets the value of [state][crate::model::DeploymentGroup::state].
11145    ///
11146    /// # Example
11147    /// ```ignore,no_run
11148    /// # use google_cloud_config_v1::model::DeploymentGroup;
11149    /// use google_cloud_config_v1::model::deployment_group::State;
11150    /// let x0 = DeploymentGroup::new().set_state(State::Creating);
11151    /// let x1 = DeploymentGroup::new().set_state(State::Active);
11152    /// let x2 = DeploymentGroup::new().set_state(State::Updating);
11153    /// ```
11154    pub fn set_state<T: std::convert::Into<crate::model::deployment_group::State>>(
11155        mut self,
11156        v: T,
11157    ) -> Self {
11158        self.state = v.into();
11159        self
11160    }
11161
11162    /// Sets the value of [state_description][crate::model::DeploymentGroup::state_description].
11163    ///
11164    /// # Example
11165    /// ```ignore,no_run
11166    /// # use google_cloud_config_v1::model::DeploymentGroup;
11167    /// let x = DeploymentGroup::new().set_state_description("example");
11168    /// ```
11169    pub fn set_state_description<T: std::convert::Into<std::string::String>>(
11170        mut self,
11171        v: T,
11172    ) -> Self {
11173        self.state_description = v.into();
11174        self
11175    }
11176
11177    /// Sets the value of [deployment_units][crate::model::DeploymentGroup::deployment_units].
11178    ///
11179    /// # Example
11180    /// ```ignore,no_run
11181    /// # use google_cloud_config_v1::model::DeploymentGroup;
11182    /// use google_cloud_config_v1::model::DeploymentUnit;
11183    /// let x = DeploymentGroup::new()
11184    ///     .set_deployment_units([
11185    ///         DeploymentUnit::default()/* use setters */,
11186    ///         DeploymentUnit::default()/* use (different) setters */,
11187    ///     ]);
11188    /// ```
11189    pub fn set_deployment_units<T, V>(mut self, v: T) -> Self
11190    where
11191        T: std::iter::IntoIterator<Item = V>,
11192        V: std::convert::Into<crate::model::DeploymentUnit>,
11193    {
11194        use std::iter::Iterator;
11195        self.deployment_units = v.into_iter().map(|i| i.into()).collect();
11196        self
11197    }
11198
11199    /// Sets the value of [provisioning_state][crate::model::DeploymentGroup::provisioning_state].
11200    ///
11201    /// # Example
11202    /// ```ignore,no_run
11203    /// # use google_cloud_config_v1::model::DeploymentGroup;
11204    /// use google_cloud_config_v1::model::deployment_group::ProvisioningState;
11205    /// let x0 = DeploymentGroup::new().set_provisioning_state(ProvisioningState::Provisioning);
11206    /// let x1 = DeploymentGroup::new().set_provisioning_state(ProvisioningState::Provisioned);
11207    /// let x2 = DeploymentGroup::new().set_provisioning_state(ProvisioningState::FailedToProvision);
11208    /// ```
11209    pub fn set_provisioning_state<
11210        T: std::convert::Into<crate::model::deployment_group::ProvisioningState>,
11211    >(
11212        mut self,
11213        v: T,
11214    ) -> Self {
11215        self.provisioning_state = v.into();
11216        self
11217    }
11218
11219    /// Sets the value of [provisioning_state_description][crate::model::DeploymentGroup::provisioning_state_description].
11220    ///
11221    /// # Example
11222    /// ```ignore,no_run
11223    /// # use google_cloud_config_v1::model::DeploymentGroup;
11224    /// let x = DeploymentGroup::new().set_provisioning_state_description("example");
11225    /// ```
11226    pub fn set_provisioning_state_description<T: std::convert::Into<std::string::String>>(
11227        mut self,
11228        v: T,
11229    ) -> Self {
11230        self.provisioning_state_description = v.into();
11231        self
11232    }
11233
11234    /// Sets the value of [provisioning_error][crate::model::DeploymentGroup::provisioning_error].
11235    ///
11236    /// # Example
11237    /// ```ignore,no_run
11238    /// # use google_cloud_config_v1::model::DeploymentGroup;
11239    /// use google_cloud_rpc::model::Status;
11240    /// let x = DeploymentGroup::new().set_provisioning_error(Status::default()/* use setters */);
11241    /// ```
11242    pub fn set_provisioning_error<T>(mut self, v: T) -> Self
11243    where
11244        T: std::convert::Into<google_cloud_rpc::model::Status>,
11245    {
11246        self.provisioning_error = std::option::Option::Some(v.into());
11247        self
11248    }
11249
11250    /// Sets or clears the value of [provisioning_error][crate::model::DeploymentGroup::provisioning_error].
11251    ///
11252    /// # Example
11253    /// ```ignore,no_run
11254    /// # use google_cloud_config_v1::model::DeploymentGroup;
11255    /// use google_cloud_rpc::model::Status;
11256    /// let x = DeploymentGroup::new().set_or_clear_provisioning_error(Some(Status::default()/* use setters */));
11257    /// let x = DeploymentGroup::new().set_or_clear_provisioning_error(None::<Status>);
11258    /// ```
11259    pub fn set_or_clear_provisioning_error<T>(mut self, v: std::option::Option<T>) -> Self
11260    where
11261        T: std::convert::Into<google_cloud_rpc::model::Status>,
11262    {
11263        self.provisioning_error = v.map(|x| x.into());
11264        self
11265    }
11266}
11267
11268impl wkt::message::Message for DeploymentGroup {
11269    fn typename() -> &'static str {
11270        "type.googleapis.com/google.cloud.config.v1.DeploymentGroup"
11271    }
11272}
11273
11274/// Defines additional types related to [DeploymentGroup].
11275pub mod deployment_group {
11276    #[allow(unused_imports)]
11277    use super::*;
11278
11279    /// Possible states of a deployment group.
11280    ///
11281    /// # Working with unknown values
11282    ///
11283    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11284    /// additional enum variants at any time. Adding new variants is not considered
11285    /// a breaking change. Applications should write their code in anticipation of:
11286    ///
11287    /// - New values appearing in future releases of the client library, **and**
11288    /// - New values received dynamically, without application changes.
11289    ///
11290    /// Please consult the [Working with enums] section in the user guide for some
11291    /// guidelines.
11292    ///
11293    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
11294    #[derive(Clone, Debug, PartialEq)]
11295    #[non_exhaustive]
11296    pub enum State {
11297        /// The default value. This value is used if the state is omitted.
11298        Unspecified,
11299        /// The deployment group is being created.
11300        Creating,
11301        /// The deployment group is healthy.
11302        Active,
11303        /// The deployment group is being updated.
11304        Updating,
11305        /// The deployment group is being deleted.
11306        Deleting,
11307        /// The deployment group has encountered an unexpected error.
11308        Failed,
11309        /// The deployment group is no longer being actively reconciled.
11310        /// This may be the result of recovering the project after deletion.
11311        Suspended,
11312        /// The deployment group has been deleted.
11313        Deleted,
11314        /// If set, the enum was initialized with an unknown value.
11315        ///
11316        /// Applications can examine the value using [State::value] or
11317        /// [State::name].
11318        UnknownValue(state::UnknownValue),
11319    }
11320
11321    #[doc(hidden)]
11322    pub mod state {
11323        #[allow(unused_imports)]
11324        use super::*;
11325        #[derive(Clone, Debug, PartialEq)]
11326        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11327    }
11328
11329    impl State {
11330        /// Gets the enum value.
11331        ///
11332        /// Returns `None` if the enum contains an unknown value deserialized from
11333        /// the string representation of enums.
11334        pub fn value(&self) -> std::option::Option<i32> {
11335            match self {
11336                Self::Unspecified => std::option::Option::Some(0),
11337                Self::Creating => std::option::Option::Some(1),
11338                Self::Active => std::option::Option::Some(2),
11339                Self::Updating => std::option::Option::Some(3),
11340                Self::Deleting => std::option::Option::Some(4),
11341                Self::Failed => std::option::Option::Some(5),
11342                Self::Suspended => std::option::Option::Some(6),
11343                Self::Deleted => std::option::Option::Some(7),
11344                Self::UnknownValue(u) => u.0.value(),
11345            }
11346        }
11347
11348        /// Gets the enum value as a string.
11349        ///
11350        /// Returns `None` if the enum contains an unknown value deserialized from
11351        /// the integer representation of enums.
11352        pub fn name(&self) -> std::option::Option<&str> {
11353            match self {
11354                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
11355                Self::Creating => std::option::Option::Some("CREATING"),
11356                Self::Active => std::option::Option::Some("ACTIVE"),
11357                Self::Updating => std::option::Option::Some("UPDATING"),
11358                Self::Deleting => std::option::Option::Some("DELETING"),
11359                Self::Failed => std::option::Option::Some("FAILED"),
11360                Self::Suspended => std::option::Option::Some("SUSPENDED"),
11361                Self::Deleted => std::option::Option::Some("DELETED"),
11362                Self::UnknownValue(u) => u.0.name(),
11363            }
11364        }
11365    }
11366
11367    impl std::default::Default for State {
11368        fn default() -> Self {
11369            use std::convert::From;
11370            Self::from(0)
11371        }
11372    }
11373
11374    impl std::fmt::Display for State {
11375        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11376            wkt::internal::display_enum(f, self.name(), self.value())
11377        }
11378    }
11379
11380    impl std::convert::From<i32> for State {
11381        fn from(value: i32) -> Self {
11382            match value {
11383                0 => Self::Unspecified,
11384                1 => Self::Creating,
11385                2 => Self::Active,
11386                3 => Self::Updating,
11387                4 => Self::Deleting,
11388                5 => Self::Failed,
11389                6 => Self::Suspended,
11390                7 => Self::Deleted,
11391                _ => Self::UnknownValue(state::UnknownValue(
11392                    wkt::internal::UnknownEnumValue::Integer(value),
11393                )),
11394            }
11395        }
11396    }
11397
11398    impl std::convert::From<&str> for State {
11399        fn from(value: &str) -> Self {
11400            use std::string::ToString;
11401            match value {
11402                "STATE_UNSPECIFIED" => Self::Unspecified,
11403                "CREATING" => Self::Creating,
11404                "ACTIVE" => Self::Active,
11405                "UPDATING" => Self::Updating,
11406                "DELETING" => Self::Deleting,
11407                "FAILED" => Self::Failed,
11408                "SUSPENDED" => Self::Suspended,
11409                "DELETED" => Self::Deleted,
11410                _ => Self::UnknownValue(state::UnknownValue(
11411                    wkt::internal::UnknownEnumValue::String(value.to_string()),
11412                )),
11413            }
11414        }
11415    }
11416
11417    impl serde::ser::Serialize for State {
11418        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11419        where
11420            S: serde::Serializer,
11421        {
11422            match self {
11423                Self::Unspecified => serializer.serialize_i32(0),
11424                Self::Creating => serializer.serialize_i32(1),
11425                Self::Active => serializer.serialize_i32(2),
11426                Self::Updating => serializer.serialize_i32(3),
11427                Self::Deleting => serializer.serialize_i32(4),
11428                Self::Failed => serializer.serialize_i32(5),
11429                Self::Suspended => serializer.serialize_i32(6),
11430                Self::Deleted => serializer.serialize_i32(7),
11431                Self::UnknownValue(u) => u.0.serialize(serializer),
11432            }
11433        }
11434    }
11435
11436    impl<'de> serde::de::Deserialize<'de> for State {
11437        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11438        where
11439            D: serde::Deserializer<'de>,
11440        {
11441            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
11442                ".google.cloud.config.v1.DeploymentGroup.State",
11443            ))
11444        }
11445    }
11446
11447    /// Possible provisioning states of a deployment group.
11448    ///
11449    /// # Working with unknown values
11450    ///
11451    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11452    /// additional enum variants at any time. Adding new variants is not considered
11453    /// a breaking change. Applications should write their code in anticipation of:
11454    ///
11455    /// - New values appearing in future releases of the client library, **and**
11456    /// - New values received dynamically, without application changes.
11457    ///
11458    /// Please consult the [Working with enums] section in the user guide for some
11459    /// guidelines.
11460    ///
11461    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
11462    #[derive(Clone, Debug, PartialEq)]
11463    #[non_exhaustive]
11464    pub enum ProvisioningState {
11465        /// Unspecified provisioning state.
11466        Unspecified,
11467        /// The deployment group is being provisioned.
11468        Provisioning,
11469        /// The deployment group is provisioned.
11470        Provisioned,
11471        /// The deployment group failed to be provisioned.
11472        FailedToProvision,
11473        /// The deployment group is being deprovisioned.
11474        Deprovisioning,
11475        /// The deployment group is deprovisioned.
11476        Deprovisioned,
11477        /// The deployment group failed to be deprovisioned.
11478        FailedToDeprovision,
11479        /// If set, the enum was initialized with an unknown value.
11480        ///
11481        /// Applications can examine the value using [ProvisioningState::value] or
11482        /// [ProvisioningState::name].
11483        UnknownValue(provisioning_state::UnknownValue),
11484    }
11485
11486    #[doc(hidden)]
11487    pub mod provisioning_state {
11488        #[allow(unused_imports)]
11489        use super::*;
11490        #[derive(Clone, Debug, PartialEq)]
11491        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11492    }
11493
11494    impl ProvisioningState {
11495        /// Gets the enum value.
11496        ///
11497        /// Returns `None` if the enum contains an unknown value deserialized from
11498        /// the string representation of enums.
11499        pub fn value(&self) -> std::option::Option<i32> {
11500            match self {
11501                Self::Unspecified => std::option::Option::Some(0),
11502                Self::Provisioning => std::option::Option::Some(1),
11503                Self::Provisioned => std::option::Option::Some(2),
11504                Self::FailedToProvision => std::option::Option::Some(3),
11505                Self::Deprovisioning => std::option::Option::Some(4),
11506                Self::Deprovisioned => std::option::Option::Some(5),
11507                Self::FailedToDeprovision => std::option::Option::Some(6),
11508                Self::UnknownValue(u) => u.0.value(),
11509            }
11510        }
11511
11512        /// Gets the enum value as a string.
11513        ///
11514        /// Returns `None` if the enum contains an unknown value deserialized from
11515        /// the integer representation of enums.
11516        pub fn name(&self) -> std::option::Option<&str> {
11517            match self {
11518                Self::Unspecified => std::option::Option::Some("PROVISIONING_STATE_UNSPECIFIED"),
11519                Self::Provisioning => std::option::Option::Some("PROVISIONING"),
11520                Self::Provisioned => std::option::Option::Some("PROVISIONED"),
11521                Self::FailedToProvision => std::option::Option::Some("FAILED_TO_PROVISION"),
11522                Self::Deprovisioning => std::option::Option::Some("DEPROVISIONING"),
11523                Self::Deprovisioned => std::option::Option::Some("DEPROVISIONED"),
11524                Self::FailedToDeprovision => std::option::Option::Some("FAILED_TO_DEPROVISION"),
11525                Self::UnknownValue(u) => u.0.name(),
11526            }
11527        }
11528    }
11529
11530    impl std::default::Default for ProvisioningState {
11531        fn default() -> Self {
11532            use std::convert::From;
11533            Self::from(0)
11534        }
11535    }
11536
11537    impl std::fmt::Display for ProvisioningState {
11538        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11539            wkt::internal::display_enum(f, self.name(), self.value())
11540        }
11541    }
11542
11543    impl std::convert::From<i32> for ProvisioningState {
11544        fn from(value: i32) -> Self {
11545            match value {
11546                0 => Self::Unspecified,
11547                1 => Self::Provisioning,
11548                2 => Self::Provisioned,
11549                3 => Self::FailedToProvision,
11550                4 => Self::Deprovisioning,
11551                5 => Self::Deprovisioned,
11552                6 => Self::FailedToDeprovision,
11553                _ => Self::UnknownValue(provisioning_state::UnknownValue(
11554                    wkt::internal::UnknownEnumValue::Integer(value),
11555                )),
11556            }
11557        }
11558    }
11559
11560    impl std::convert::From<&str> for ProvisioningState {
11561        fn from(value: &str) -> Self {
11562            use std::string::ToString;
11563            match value {
11564                "PROVISIONING_STATE_UNSPECIFIED" => Self::Unspecified,
11565                "PROVISIONING" => Self::Provisioning,
11566                "PROVISIONED" => Self::Provisioned,
11567                "FAILED_TO_PROVISION" => Self::FailedToProvision,
11568                "DEPROVISIONING" => Self::Deprovisioning,
11569                "DEPROVISIONED" => Self::Deprovisioned,
11570                "FAILED_TO_DEPROVISION" => Self::FailedToDeprovision,
11571                _ => Self::UnknownValue(provisioning_state::UnknownValue(
11572                    wkt::internal::UnknownEnumValue::String(value.to_string()),
11573                )),
11574            }
11575        }
11576    }
11577
11578    impl serde::ser::Serialize for ProvisioningState {
11579        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11580        where
11581            S: serde::Serializer,
11582        {
11583            match self {
11584                Self::Unspecified => serializer.serialize_i32(0),
11585                Self::Provisioning => serializer.serialize_i32(1),
11586                Self::Provisioned => serializer.serialize_i32(2),
11587                Self::FailedToProvision => serializer.serialize_i32(3),
11588                Self::Deprovisioning => serializer.serialize_i32(4),
11589                Self::Deprovisioned => serializer.serialize_i32(5),
11590                Self::FailedToDeprovision => serializer.serialize_i32(6),
11591                Self::UnknownValue(u) => u.0.serialize(serializer),
11592            }
11593        }
11594    }
11595
11596    impl<'de> serde::de::Deserialize<'de> for ProvisioningState {
11597        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11598        where
11599            D: serde::Deserializer<'de>,
11600        {
11601            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ProvisioningState>::new(
11602                ".google.cloud.config.v1.DeploymentGroup.ProvisioningState",
11603            ))
11604        }
11605    }
11606}
11607
11608/// A DeploymentUnit is a container for a deployment and its dependencies.
11609/// An existing deployment can be provided directly in the unit, or the unit
11610/// can act as a placeholder to define the DAG, with the deployment specs
11611/// supplied in a `provisionDeploymentRequest`.
11612#[derive(Clone, Default, PartialEq)]
11613#[non_exhaustive]
11614pub struct DeploymentUnit {
11615    /// The id of the deployment unit. Must be unique within the deployment group.
11616    pub id: std::string::String,
11617
11618    /// Optional. The name of the deployment to be provisioned.
11619    /// Format:
11620    /// 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
11621    pub deployment: std::option::Option<std::string::String>,
11622
11623    /// Required. The IDs of the deployment units within the deployment group that
11624    /// this unit depends on.
11625    pub dependencies: std::vec::Vec<std::string::String>,
11626
11627    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11628}
11629
11630impl DeploymentUnit {
11631    /// Creates a new default instance.
11632    pub fn new() -> Self {
11633        std::default::Default::default()
11634    }
11635
11636    /// Sets the value of [id][crate::model::DeploymentUnit::id].
11637    ///
11638    /// # Example
11639    /// ```ignore,no_run
11640    /// # use google_cloud_config_v1::model::DeploymentUnit;
11641    /// let x = DeploymentUnit::new().set_id("example");
11642    /// ```
11643    pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11644        self.id = v.into();
11645        self
11646    }
11647
11648    /// Sets the value of [deployment][crate::model::DeploymentUnit::deployment].
11649    ///
11650    /// # Example
11651    /// ```ignore,no_run
11652    /// # use google_cloud_config_v1::model::DeploymentUnit;
11653    /// # let project_id = "project_id";
11654    /// # let location_id = "location_id";
11655    /// # let deployment_id = "deployment_id";
11656    /// let x = DeploymentUnit::new().set_deployment(format!("projects/{project_id}/locations/{location_id}/deployments/{deployment_id}"));
11657    /// ```
11658    pub fn set_deployment<T>(mut self, v: T) -> Self
11659    where
11660        T: std::convert::Into<std::string::String>,
11661    {
11662        self.deployment = std::option::Option::Some(v.into());
11663        self
11664    }
11665
11666    /// Sets or clears the value of [deployment][crate::model::DeploymentUnit::deployment].
11667    ///
11668    /// # Example
11669    /// ```ignore,no_run
11670    /// # use google_cloud_config_v1::model::DeploymentUnit;
11671    /// # let project_id = "project_id";
11672    /// # let location_id = "location_id";
11673    /// # let deployment_id = "deployment_id";
11674    /// let x = DeploymentUnit::new().set_or_clear_deployment(Some(format!("projects/{project_id}/locations/{location_id}/deployments/{deployment_id}")));
11675    /// let x = DeploymentUnit::new().set_or_clear_deployment(None::<String>);
11676    /// ```
11677    pub fn set_or_clear_deployment<T>(mut self, v: std::option::Option<T>) -> Self
11678    where
11679        T: std::convert::Into<std::string::String>,
11680    {
11681        self.deployment = v.map(|x| x.into());
11682        self
11683    }
11684
11685    /// Sets the value of [dependencies][crate::model::DeploymentUnit::dependencies].
11686    ///
11687    /// # Example
11688    /// ```ignore,no_run
11689    /// # use google_cloud_config_v1::model::DeploymentUnit;
11690    /// let x = DeploymentUnit::new().set_dependencies(["a", "b", "c"]);
11691    /// ```
11692    pub fn set_dependencies<T, V>(mut self, v: T) -> Self
11693    where
11694        T: std::iter::IntoIterator<Item = V>,
11695        V: std::convert::Into<std::string::String>,
11696    {
11697        use std::iter::Iterator;
11698        self.dependencies = v.into_iter().map(|i| i.into()).collect();
11699        self
11700    }
11701}
11702
11703impl wkt::message::Message for DeploymentUnit {
11704    fn typename() -> &'static str {
11705        "type.googleapis.com/google.cloud.config.v1.DeploymentUnit"
11706    }
11707}
11708
11709/// Spec for a deployment to be created.
11710#[derive(Clone, Default, PartialEq)]
11711#[non_exhaustive]
11712pub struct DeploymentSpec {
11713    /// Required. The id of the deployment to be created which doesn't include the
11714    /// project id and location.
11715    pub deployment_id: std::string::String,
11716
11717    /// Required. The deployment to be created.
11718    pub deployment: std::option::Option<crate::model::Deployment>,
11719
11720    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11721}
11722
11723impl DeploymentSpec {
11724    /// Creates a new default instance.
11725    pub fn new() -> Self {
11726        std::default::Default::default()
11727    }
11728
11729    /// Sets the value of [deployment_id][crate::model::DeploymentSpec::deployment_id].
11730    ///
11731    /// # Example
11732    /// ```ignore,no_run
11733    /// # use google_cloud_config_v1::model::DeploymentSpec;
11734    /// let x = DeploymentSpec::new().set_deployment_id("example");
11735    /// ```
11736    pub fn set_deployment_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11737        self.deployment_id = v.into();
11738        self
11739    }
11740
11741    /// Sets the value of [deployment][crate::model::DeploymentSpec::deployment].
11742    ///
11743    /// # Example
11744    /// ```ignore,no_run
11745    /// # use google_cloud_config_v1::model::DeploymentSpec;
11746    /// use google_cloud_config_v1::model::Deployment;
11747    /// let x = DeploymentSpec::new().set_deployment(Deployment::default()/* use setters */);
11748    /// ```
11749    pub fn set_deployment<T>(mut self, v: T) -> Self
11750    where
11751        T: std::convert::Into<crate::model::Deployment>,
11752    {
11753        self.deployment = std::option::Option::Some(v.into());
11754        self
11755    }
11756
11757    /// Sets or clears the value of [deployment][crate::model::DeploymentSpec::deployment].
11758    ///
11759    /// # Example
11760    /// ```ignore,no_run
11761    /// # use google_cloud_config_v1::model::DeploymentSpec;
11762    /// use google_cloud_config_v1::model::Deployment;
11763    /// let x = DeploymentSpec::new().set_or_clear_deployment(Some(Deployment::default()/* use setters */));
11764    /// let x = DeploymentSpec::new().set_or_clear_deployment(None::<Deployment>);
11765    /// ```
11766    pub fn set_or_clear_deployment<T>(mut self, v: std::option::Option<T>) -> Self
11767    where
11768        T: std::convert::Into<crate::model::Deployment>,
11769    {
11770        self.deployment = v.map(|x| x.into());
11771        self
11772    }
11773}
11774
11775impl wkt::message::Message for DeploymentSpec {
11776    fn typename() -> &'static str {
11777        "type.googleapis.com/google.cloud.config.v1.DeploymentSpec"
11778    }
11779}
11780
11781/// The request message for the GetDeploymentGroup method.
11782#[derive(Clone, Default, PartialEq)]
11783#[non_exhaustive]
11784pub struct GetDeploymentGroupRequest {
11785    /// Required. The name of the deployment group to retrieve.
11786    /// Format:
11787    /// 'projects/{project_id}/locations/{location}/deploymentGroups/{deployment_group}'.
11788    pub name: std::string::String,
11789
11790    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11791}
11792
11793impl GetDeploymentGroupRequest {
11794    /// Creates a new default instance.
11795    pub fn new() -> Self {
11796        std::default::Default::default()
11797    }
11798
11799    /// Sets the value of [name][crate::model::GetDeploymentGroupRequest::name].
11800    ///
11801    /// # Example
11802    /// ```ignore,no_run
11803    /// # use google_cloud_config_v1::model::GetDeploymentGroupRequest;
11804    /// # let project_id = "project_id";
11805    /// # let location_id = "location_id";
11806    /// # let deployment_group_id = "deployment_group_id";
11807    /// let x = GetDeploymentGroupRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/deploymentGroups/{deployment_group_id}"));
11808    /// ```
11809    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11810        self.name = v.into();
11811        self
11812    }
11813}
11814
11815impl wkt::message::Message for GetDeploymentGroupRequest {
11816    fn typename() -> &'static str {
11817        "type.googleapis.com/google.cloud.config.v1.GetDeploymentGroupRequest"
11818    }
11819}
11820
11821/// The request message for the ListDeploymentGroups method.
11822#[derive(Clone, Default, PartialEq)]
11823#[non_exhaustive]
11824pub struct ListDeploymentGroupsRequest {
11825    /// Required. The parent, which owns this collection of deployment groups.
11826    /// Format: 'projects/{project_id}/locations/{location}'.
11827    pub parent: std::string::String,
11828
11829    /// Optional. When requesting a page of resources, 'page_size' specifies number
11830    /// of resources to return. If unspecified, at most 500 will be returned. The
11831    /// maximum value is 1000.
11832    pub page_size: i32,
11833
11834    /// Optional. Token returned by previous call to 'ListDeploymentGroups' which
11835    /// specifies the position in the list from where to continue listing the
11836    /// deployment groups.
11837    pub page_token: std::string::String,
11838
11839    /// Optional. Lists the DeploymentGroups that match the filter expression. A
11840    /// filter expression filters the deployment groups listed in the response. The
11841    /// expression must be of the form '{field} {operator} {value}' where
11842    /// operators: '<', '>',
11843    /// '<=', '>=', '!=', '=', ':' are supported (colon ':' represents a HAS
11844    /// operator which is roughly synonymous with equality). {field} can refer to a
11845    /// proto or JSON field, or a synthetic field. Field names can be camelCase or
11846    /// snake_case.
11847    ///
11848    /// Examples:
11849    ///
11850    /// - Filter by name:
11851    ///   name = "projects/foo/locations/us-central1/deploymentGroups/bar"
11852    ///
11853    /// - Filter by labels:
11854    ///
11855    ///   - Resources that have a key called 'foo'
11856    ///     labels.foo:*
11857    ///   - Resources that have a key called 'foo' whose value is 'bar'
11858    ///     labels.foo = bar
11859    /// - Filter by state:
11860    ///
11861    ///   - DeploymentGroups in CREATING state.
11862    ///     state=CREATING
11863    pub filter: std::string::String,
11864
11865    /// Optional. Field to use to sort the list.
11866    pub order_by: std::string::String,
11867
11868    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11869}
11870
11871impl ListDeploymentGroupsRequest {
11872    /// Creates a new default instance.
11873    pub fn new() -> Self {
11874        std::default::Default::default()
11875    }
11876
11877    /// Sets the value of [parent][crate::model::ListDeploymentGroupsRequest::parent].
11878    ///
11879    /// # Example
11880    /// ```ignore,no_run
11881    /// # use google_cloud_config_v1::model::ListDeploymentGroupsRequest;
11882    /// let x = ListDeploymentGroupsRequest::new().set_parent("example");
11883    /// ```
11884    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11885        self.parent = v.into();
11886        self
11887    }
11888
11889    /// Sets the value of [page_size][crate::model::ListDeploymentGroupsRequest::page_size].
11890    ///
11891    /// # Example
11892    /// ```ignore,no_run
11893    /// # use google_cloud_config_v1::model::ListDeploymentGroupsRequest;
11894    /// let x = ListDeploymentGroupsRequest::new().set_page_size(42);
11895    /// ```
11896    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11897        self.page_size = v.into();
11898        self
11899    }
11900
11901    /// Sets the value of [page_token][crate::model::ListDeploymentGroupsRequest::page_token].
11902    ///
11903    /// # Example
11904    /// ```ignore,no_run
11905    /// # use google_cloud_config_v1::model::ListDeploymentGroupsRequest;
11906    /// let x = ListDeploymentGroupsRequest::new().set_page_token("example");
11907    /// ```
11908    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11909        self.page_token = v.into();
11910        self
11911    }
11912
11913    /// Sets the value of [filter][crate::model::ListDeploymentGroupsRequest::filter].
11914    ///
11915    /// # Example
11916    /// ```ignore,no_run
11917    /// # use google_cloud_config_v1::model::ListDeploymentGroupsRequest;
11918    /// let x = ListDeploymentGroupsRequest::new().set_filter("example");
11919    /// ```
11920    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11921        self.filter = v.into();
11922        self
11923    }
11924
11925    /// Sets the value of [order_by][crate::model::ListDeploymentGroupsRequest::order_by].
11926    ///
11927    /// # Example
11928    /// ```ignore,no_run
11929    /// # use google_cloud_config_v1::model::ListDeploymentGroupsRequest;
11930    /// let x = ListDeploymentGroupsRequest::new().set_order_by("example");
11931    /// ```
11932    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11933        self.order_by = v.into();
11934        self
11935    }
11936}
11937
11938impl wkt::message::Message for ListDeploymentGroupsRequest {
11939    fn typename() -> &'static str {
11940        "type.googleapis.com/google.cloud.config.v1.ListDeploymentGroupsRequest"
11941    }
11942}
11943
11944/// The response message for the ListDeploymentGroups method.
11945#[derive(Clone, Default, PartialEq)]
11946#[non_exhaustive]
11947pub struct ListDeploymentGroupsResponse {
11948    /// The deployment groups from the specified collection.
11949    pub deployment_groups: std::vec::Vec<crate::model::DeploymentGroup>,
11950
11951    /// Token to be supplied to the next ListDeploymentGroups request via
11952    /// `page_token` to obtain the next set of results.
11953    pub next_page_token: std::string::String,
11954
11955    /// Locations that could not be reached.
11956    pub unreachable: std::vec::Vec<std::string::String>,
11957
11958    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11959}
11960
11961impl ListDeploymentGroupsResponse {
11962    /// Creates a new default instance.
11963    pub fn new() -> Self {
11964        std::default::Default::default()
11965    }
11966
11967    /// Sets the value of [deployment_groups][crate::model::ListDeploymentGroupsResponse::deployment_groups].
11968    ///
11969    /// # Example
11970    /// ```ignore,no_run
11971    /// # use google_cloud_config_v1::model::ListDeploymentGroupsResponse;
11972    /// use google_cloud_config_v1::model::DeploymentGroup;
11973    /// let x = ListDeploymentGroupsResponse::new()
11974    ///     .set_deployment_groups([
11975    ///         DeploymentGroup::default()/* use setters */,
11976    ///         DeploymentGroup::default()/* use (different) setters */,
11977    ///     ]);
11978    /// ```
11979    pub fn set_deployment_groups<T, V>(mut self, v: T) -> Self
11980    where
11981        T: std::iter::IntoIterator<Item = V>,
11982        V: std::convert::Into<crate::model::DeploymentGroup>,
11983    {
11984        use std::iter::Iterator;
11985        self.deployment_groups = v.into_iter().map(|i| i.into()).collect();
11986        self
11987    }
11988
11989    /// Sets the value of [next_page_token][crate::model::ListDeploymentGroupsResponse::next_page_token].
11990    ///
11991    /// # Example
11992    /// ```ignore,no_run
11993    /// # use google_cloud_config_v1::model::ListDeploymentGroupsResponse;
11994    /// let x = ListDeploymentGroupsResponse::new().set_next_page_token("example");
11995    /// ```
11996    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11997        self.next_page_token = v.into();
11998        self
11999    }
12000
12001    /// Sets the value of [unreachable][crate::model::ListDeploymentGroupsResponse::unreachable].
12002    ///
12003    /// # Example
12004    /// ```ignore,no_run
12005    /// # use google_cloud_config_v1::model::ListDeploymentGroupsResponse;
12006    /// let x = ListDeploymentGroupsResponse::new().set_unreachable(["a", "b", "c"]);
12007    /// ```
12008    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
12009    where
12010        T: std::iter::IntoIterator<Item = V>,
12011        V: std::convert::Into<std::string::String>,
12012    {
12013        use std::iter::Iterator;
12014        self.unreachable = v.into_iter().map(|i| i.into()).collect();
12015        self
12016    }
12017}
12018
12019impl wkt::message::Message for ListDeploymentGroupsResponse {
12020    fn typename() -> &'static str {
12021        "type.googleapis.com/google.cloud.config.v1.ListDeploymentGroupsResponse"
12022    }
12023}
12024
12025#[doc(hidden)]
12026impl google_cloud_gax::paginator::internal::PageableResponse for ListDeploymentGroupsResponse {
12027    type PageItem = crate::model::DeploymentGroup;
12028
12029    fn items(self) -> std::vec::Vec<Self::PageItem> {
12030        self.deployment_groups
12031    }
12032
12033    fn next_page_token(&self) -> std::string::String {
12034        use std::clone::Clone;
12035        self.next_page_token.clone()
12036    }
12037}
12038
12039/// The request message for the ProvisionDeploymentGroup method.
12040#[derive(Clone, Default, PartialEq)]
12041#[non_exhaustive]
12042pub struct ProvisionDeploymentGroupRequest {
12043    /// Required. The name of the deployment group to provision.
12044    /// Format:
12045    /// 'projects/{project_id}/locations/{location}/deploymentGroups/{deployment_group}'.
12046    pub name: std::string::String,
12047
12048    /// Optional. The deployment specs of the deployment units to be created within
12049    /// the same project and location of the deployment group. The key is the unit
12050    /// ID, and the value is the `DeploymentSpec`. Provisioning will fail if a
12051    /// `deployment_spec` has a `deployment_id` that matches an existing deployment
12052    /// in the same project and location. If an existing deployment was part of the
12053    /// last successful revision but is no longer in the current DeploymentGroup's
12054    /// `deployment_units`, it will be recreated if included in `deployment_specs`.
12055    pub deployment_specs:
12056        std::collections::HashMap<std::string::String, crate::model::DeploymentSpec>,
12057
12058    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12059}
12060
12061impl ProvisionDeploymentGroupRequest {
12062    /// Creates a new default instance.
12063    pub fn new() -> Self {
12064        std::default::Default::default()
12065    }
12066
12067    /// Sets the value of [name][crate::model::ProvisionDeploymentGroupRequest::name].
12068    ///
12069    /// # Example
12070    /// ```ignore,no_run
12071    /// # use google_cloud_config_v1::model::ProvisionDeploymentGroupRequest;
12072    /// # let project_id = "project_id";
12073    /// # let location_id = "location_id";
12074    /// # let deployment_group_id = "deployment_group_id";
12075    /// let x = ProvisionDeploymentGroupRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/deploymentGroups/{deployment_group_id}"));
12076    /// ```
12077    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12078        self.name = v.into();
12079        self
12080    }
12081
12082    /// Sets the value of [deployment_specs][crate::model::ProvisionDeploymentGroupRequest::deployment_specs].
12083    ///
12084    /// # Example
12085    /// ```ignore,no_run
12086    /// # use google_cloud_config_v1::model::ProvisionDeploymentGroupRequest;
12087    /// use google_cloud_config_v1::model::DeploymentSpec;
12088    /// let x = ProvisionDeploymentGroupRequest::new().set_deployment_specs([
12089    ///     ("key0", DeploymentSpec::default()/* use setters */),
12090    ///     ("key1", DeploymentSpec::default()/* use (different) setters */),
12091    /// ]);
12092    /// ```
12093    pub fn set_deployment_specs<T, K, V>(mut self, v: T) -> Self
12094    where
12095        T: std::iter::IntoIterator<Item = (K, V)>,
12096        K: std::convert::Into<std::string::String>,
12097        V: std::convert::Into<crate::model::DeploymentSpec>,
12098    {
12099        use std::iter::Iterator;
12100        self.deployment_specs = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
12101        self
12102    }
12103}
12104
12105impl wkt::message::Message for ProvisionDeploymentGroupRequest {
12106    fn typename() -> &'static str {
12107        "type.googleapis.com/google.cloud.config.v1.ProvisionDeploymentGroupRequest"
12108    }
12109}
12110
12111/// The request message for the DeprovisionDeploymentGroup method.
12112#[derive(Clone, Default, PartialEq)]
12113#[non_exhaustive]
12114pub struct DeprovisionDeploymentGroupRequest {
12115    /// Required. The name of the deployment group to deprovision.
12116    /// Format:
12117    /// 'projects/{project_id}/locations/{location}/deploymentGroups/{deployment_group}'.
12118    pub name: std::string::String,
12119
12120    /// Optional. If set to true, this option is propagated to the deletion of each
12121    /// deployment in the group. This corresponds to the 'force' field
12122    /// in DeleteDeploymentRequest.
12123    pub force: bool,
12124
12125    /// Optional. Policy on how resources within each deployment should be handled
12126    /// during deletion. This policy is applied globally to the deletion of all
12127    /// deployments in this group. This corresponds to the 'delete_policy' field
12128    /// in DeleteDeploymentRequest.
12129    pub delete_policy: crate::model::delete_deployment_request::DeletePolicy,
12130
12131    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12132}
12133
12134impl DeprovisionDeploymentGroupRequest {
12135    /// Creates a new default instance.
12136    pub fn new() -> Self {
12137        std::default::Default::default()
12138    }
12139
12140    /// Sets the value of [name][crate::model::DeprovisionDeploymentGroupRequest::name].
12141    ///
12142    /// # Example
12143    /// ```ignore,no_run
12144    /// # use google_cloud_config_v1::model::DeprovisionDeploymentGroupRequest;
12145    /// # let project_id = "project_id";
12146    /// # let location_id = "location_id";
12147    /// # let deployment_group_id = "deployment_group_id";
12148    /// let x = DeprovisionDeploymentGroupRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/deploymentGroups/{deployment_group_id}"));
12149    /// ```
12150    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12151        self.name = v.into();
12152        self
12153    }
12154
12155    /// Sets the value of [force][crate::model::DeprovisionDeploymentGroupRequest::force].
12156    ///
12157    /// # Example
12158    /// ```ignore,no_run
12159    /// # use google_cloud_config_v1::model::DeprovisionDeploymentGroupRequest;
12160    /// let x = DeprovisionDeploymentGroupRequest::new().set_force(true);
12161    /// ```
12162    pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
12163        self.force = v.into();
12164        self
12165    }
12166
12167    /// Sets the value of [delete_policy][crate::model::DeprovisionDeploymentGroupRequest::delete_policy].
12168    ///
12169    /// # Example
12170    /// ```ignore,no_run
12171    /// # use google_cloud_config_v1::model::DeprovisionDeploymentGroupRequest;
12172    /// use google_cloud_config_v1::model::delete_deployment_request::DeletePolicy;
12173    /// let x0 = DeprovisionDeploymentGroupRequest::new().set_delete_policy(DeletePolicy::Delete);
12174    /// let x1 = DeprovisionDeploymentGroupRequest::new().set_delete_policy(DeletePolicy::Abandon);
12175    /// ```
12176    pub fn set_delete_policy<
12177        T: std::convert::Into<crate::model::delete_deployment_request::DeletePolicy>,
12178    >(
12179        mut self,
12180        v: T,
12181    ) -> Self {
12182        self.delete_policy = v.into();
12183        self
12184    }
12185}
12186
12187impl wkt::message::Message for DeprovisionDeploymentGroupRequest {
12188    fn typename() -> &'static str {
12189        "type.googleapis.com/google.cloud.config.v1.DeprovisionDeploymentGroupRequest"
12190    }
12191}
12192
12193/// The summary of the deployment operation.
12194#[derive(Clone, Default, PartialEq)]
12195#[non_exhaustive]
12196pub struct DeploymentOperationSummary {
12197    /// Output only. The current step the deployment operation is running.
12198    pub deployment_step: crate::model::deployment_operation_metadata::DeploymentStep,
12199
12200    /// Output only. Cloud Build instance UUID associated with this operation.
12201    pub build: std::string::String,
12202
12203    /// Output only. Location of Deployment operations logs in
12204    /// `gs://{bucket}/{object}` format.
12205    pub logs: std::string::String,
12206
12207    /// Output only. Location of Deployment operations content in
12208    /// `gs://{bucket}/{object}` format.
12209    pub content: std::string::String,
12210
12211    /// Output only. Location of Deployment operations artifacts in
12212    /// `gs://{bucket}/{object}` format.
12213    pub artifacts: std::string::String,
12214
12215    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12216}
12217
12218impl DeploymentOperationSummary {
12219    /// Creates a new default instance.
12220    pub fn new() -> Self {
12221        std::default::Default::default()
12222    }
12223
12224    /// Sets the value of [deployment_step][crate::model::DeploymentOperationSummary::deployment_step].
12225    ///
12226    /// # Example
12227    /// ```ignore,no_run
12228    /// # use google_cloud_config_v1::model::DeploymentOperationSummary;
12229    /// use google_cloud_config_v1::model::deployment_operation_metadata::DeploymentStep;
12230    /// let x0 = DeploymentOperationSummary::new().set_deployment_step(DeploymentStep::PreparingStorageBucket);
12231    /// let x1 = DeploymentOperationSummary::new().set_deployment_step(DeploymentStep::DownloadingBlueprint);
12232    /// let x2 = DeploymentOperationSummary::new().set_deployment_step(DeploymentStep::RunningTfInit);
12233    /// ```
12234    pub fn set_deployment_step<
12235        T: std::convert::Into<crate::model::deployment_operation_metadata::DeploymentStep>,
12236    >(
12237        mut self,
12238        v: T,
12239    ) -> Self {
12240        self.deployment_step = v.into();
12241        self
12242    }
12243
12244    /// Sets the value of [build][crate::model::DeploymentOperationSummary::build].
12245    ///
12246    /// # Example
12247    /// ```ignore,no_run
12248    /// # use google_cloud_config_v1::model::DeploymentOperationSummary;
12249    /// let x = DeploymentOperationSummary::new().set_build("example");
12250    /// ```
12251    pub fn set_build<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12252        self.build = v.into();
12253        self
12254    }
12255
12256    /// Sets the value of [logs][crate::model::DeploymentOperationSummary::logs].
12257    ///
12258    /// # Example
12259    /// ```ignore,no_run
12260    /// # use google_cloud_config_v1::model::DeploymentOperationSummary;
12261    /// let x = DeploymentOperationSummary::new().set_logs("example");
12262    /// ```
12263    pub fn set_logs<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12264        self.logs = v.into();
12265        self
12266    }
12267
12268    /// Sets the value of [content][crate::model::DeploymentOperationSummary::content].
12269    ///
12270    /// # Example
12271    /// ```ignore,no_run
12272    /// # use google_cloud_config_v1::model::DeploymentOperationSummary;
12273    /// let x = DeploymentOperationSummary::new().set_content("example");
12274    /// ```
12275    pub fn set_content<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12276        self.content = v.into();
12277        self
12278    }
12279
12280    /// Sets the value of [artifacts][crate::model::DeploymentOperationSummary::artifacts].
12281    ///
12282    /// # Example
12283    /// ```ignore,no_run
12284    /// # use google_cloud_config_v1::model::DeploymentOperationSummary;
12285    /// let x = DeploymentOperationSummary::new().set_artifacts("example");
12286    /// ```
12287    pub fn set_artifacts<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12288        self.artifacts = v.into();
12289        self
12290    }
12291}
12292
12293impl wkt::message::Message for DeploymentOperationSummary {
12294    fn typename() -> &'static str {
12295        "type.googleapis.com/google.cloud.config.v1.DeploymentOperationSummary"
12296    }
12297}
12298
12299/// The progress of a deployment unit provisioning or deprovisioning.
12300#[derive(Clone, Default, PartialEq)]
12301#[non_exhaustive]
12302pub struct DeploymentUnitProgress {
12303    /// Output only. The unit id of the deployment unit to be provisioned.
12304    pub unit_id: std::string::String,
12305
12306    /// Output only. The name of the deployment to be provisioned.
12307    /// Format:
12308    /// 'projects/{project}/locations/{location}/deployments/{deployment}'.
12309    pub deployment: std::string::String,
12310
12311    /// Output only. The current step of the deployment unit provisioning.
12312    pub state: crate::model::deployment_unit_progress::State,
12313
12314    /// Output only. Additional information regarding the current state.
12315    pub state_description: std::string::String,
12316
12317    /// Output only. The summary of the deployment operation.
12318    pub deployment_operation_summary: std::option::Option<crate::model::DeploymentOperationSummary>,
12319
12320    /// Output only. Holds the error status of the deployment unit provisioning.
12321    pub error: std::option::Option<google_cloud_rpc::model::Status>,
12322
12323    /// Output only. The intent of the deployment unit.
12324    pub intent: crate::model::deployment_unit_progress::Intent,
12325
12326    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12327}
12328
12329impl DeploymentUnitProgress {
12330    /// Creates a new default instance.
12331    pub fn new() -> Self {
12332        std::default::Default::default()
12333    }
12334
12335    /// Sets the value of [unit_id][crate::model::DeploymentUnitProgress::unit_id].
12336    ///
12337    /// # Example
12338    /// ```ignore,no_run
12339    /// # use google_cloud_config_v1::model::DeploymentUnitProgress;
12340    /// let x = DeploymentUnitProgress::new().set_unit_id("example");
12341    /// ```
12342    pub fn set_unit_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12343        self.unit_id = v.into();
12344        self
12345    }
12346
12347    /// Sets the value of [deployment][crate::model::DeploymentUnitProgress::deployment].
12348    ///
12349    /// # Example
12350    /// ```ignore,no_run
12351    /// # use google_cloud_config_v1::model::DeploymentUnitProgress;
12352    /// # let project_id = "project_id";
12353    /// # let location_id = "location_id";
12354    /// # let deployment_id = "deployment_id";
12355    /// let x = DeploymentUnitProgress::new().set_deployment(format!("projects/{project_id}/locations/{location_id}/deployments/{deployment_id}"));
12356    /// ```
12357    pub fn set_deployment<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12358        self.deployment = v.into();
12359        self
12360    }
12361
12362    /// Sets the value of [state][crate::model::DeploymentUnitProgress::state].
12363    ///
12364    /// # Example
12365    /// ```ignore,no_run
12366    /// # use google_cloud_config_v1::model::DeploymentUnitProgress;
12367    /// use google_cloud_config_v1::model::deployment_unit_progress::State;
12368    /// let x0 = DeploymentUnitProgress::new().set_state(State::Queued);
12369    /// let x1 = DeploymentUnitProgress::new().set_state(State::ApplyingDeployment);
12370    /// let x2 = DeploymentUnitProgress::new().set_state(State::Succeeded);
12371    /// ```
12372    pub fn set_state<T: std::convert::Into<crate::model::deployment_unit_progress::State>>(
12373        mut self,
12374        v: T,
12375    ) -> Self {
12376        self.state = v.into();
12377        self
12378    }
12379
12380    /// Sets the value of [state_description][crate::model::DeploymentUnitProgress::state_description].
12381    ///
12382    /// # Example
12383    /// ```ignore,no_run
12384    /// # use google_cloud_config_v1::model::DeploymentUnitProgress;
12385    /// let x = DeploymentUnitProgress::new().set_state_description("example");
12386    /// ```
12387    pub fn set_state_description<T: std::convert::Into<std::string::String>>(
12388        mut self,
12389        v: T,
12390    ) -> Self {
12391        self.state_description = v.into();
12392        self
12393    }
12394
12395    /// Sets the value of [deployment_operation_summary][crate::model::DeploymentUnitProgress::deployment_operation_summary].
12396    ///
12397    /// # Example
12398    /// ```ignore,no_run
12399    /// # use google_cloud_config_v1::model::DeploymentUnitProgress;
12400    /// use google_cloud_config_v1::model::DeploymentOperationSummary;
12401    /// let x = DeploymentUnitProgress::new().set_deployment_operation_summary(DeploymentOperationSummary::default()/* use setters */);
12402    /// ```
12403    pub fn set_deployment_operation_summary<T>(mut self, v: T) -> Self
12404    where
12405        T: std::convert::Into<crate::model::DeploymentOperationSummary>,
12406    {
12407        self.deployment_operation_summary = std::option::Option::Some(v.into());
12408        self
12409    }
12410
12411    /// Sets or clears the value of [deployment_operation_summary][crate::model::DeploymentUnitProgress::deployment_operation_summary].
12412    ///
12413    /// # Example
12414    /// ```ignore,no_run
12415    /// # use google_cloud_config_v1::model::DeploymentUnitProgress;
12416    /// use google_cloud_config_v1::model::DeploymentOperationSummary;
12417    /// let x = DeploymentUnitProgress::new().set_or_clear_deployment_operation_summary(Some(DeploymentOperationSummary::default()/* use setters */));
12418    /// let x = DeploymentUnitProgress::new().set_or_clear_deployment_operation_summary(None::<DeploymentOperationSummary>);
12419    /// ```
12420    pub fn set_or_clear_deployment_operation_summary<T>(mut self, v: std::option::Option<T>) -> Self
12421    where
12422        T: std::convert::Into<crate::model::DeploymentOperationSummary>,
12423    {
12424        self.deployment_operation_summary = v.map(|x| x.into());
12425        self
12426    }
12427
12428    /// Sets the value of [error][crate::model::DeploymentUnitProgress::error].
12429    ///
12430    /// # Example
12431    /// ```ignore,no_run
12432    /// # use google_cloud_config_v1::model::DeploymentUnitProgress;
12433    /// use google_cloud_rpc::model::Status;
12434    /// let x = DeploymentUnitProgress::new().set_error(Status::default()/* use setters */);
12435    /// ```
12436    pub fn set_error<T>(mut self, v: T) -> Self
12437    where
12438        T: std::convert::Into<google_cloud_rpc::model::Status>,
12439    {
12440        self.error = std::option::Option::Some(v.into());
12441        self
12442    }
12443
12444    /// Sets or clears the value of [error][crate::model::DeploymentUnitProgress::error].
12445    ///
12446    /// # Example
12447    /// ```ignore,no_run
12448    /// # use google_cloud_config_v1::model::DeploymentUnitProgress;
12449    /// use google_cloud_rpc::model::Status;
12450    /// let x = DeploymentUnitProgress::new().set_or_clear_error(Some(Status::default()/* use setters */));
12451    /// let x = DeploymentUnitProgress::new().set_or_clear_error(None::<Status>);
12452    /// ```
12453    pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
12454    where
12455        T: std::convert::Into<google_cloud_rpc::model::Status>,
12456    {
12457        self.error = v.map(|x| x.into());
12458        self
12459    }
12460
12461    /// Sets the value of [intent][crate::model::DeploymentUnitProgress::intent].
12462    ///
12463    /// # Example
12464    /// ```ignore,no_run
12465    /// # use google_cloud_config_v1::model::DeploymentUnitProgress;
12466    /// use google_cloud_config_v1::model::deployment_unit_progress::Intent;
12467    /// let x0 = DeploymentUnitProgress::new().set_intent(Intent::CreateDeployment);
12468    /// let x1 = DeploymentUnitProgress::new().set_intent(Intent::UpdateDeployment);
12469    /// let x2 = DeploymentUnitProgress::new().set_intent(Intent::DeleteDeployment);
12470    /// ```
12471    pub fn set_intent<T: std::convert::Into<crate::model::deployment_unit_progress::Intent>>(
12472        mut self,
12473        v: T,
12474    ) -> Self {
12475        self.intent = v.into();
12476        self
12477    }
12478}
12479
12480impl wkt::message::Message for DeploymentUnitProgress {
12481    fn typename() -> &'static str {
12482        "type.googleapis.com/google.cloud.config.v1.DeploymentUnitProgress"
12483    }
12484}
12485
12486/// Defines additional types related to [DeploymentUnitProgress].
12487pub mod deployment_unit_progress {
12488    #[allow(unused_imports)]
12489    use super::*;
12490
12491    /// The possible steps a deployment unit provisioning may be running.
12492    ///
12493    /// # Working with unknown values
12494    ///
12495    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12496    /// additional enum variants at any time. Adding new variants is not considered
12497    /// a breaking change. Applications should write their code in anticipation of:
12498    ///
12499    /// - New values appearing in future releases of the client library, **and**
12500    /// - New values received dynamically, without application changes.
12501    ///
12502    /// Please consult the [Working with enums] section in the user guide for some
12503    /// guidelines.
12504    ///
12505    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
12506    #[derive(Clone, Debug, PartialEq)]
12507    #[non_exhaustive]
12508    pub enum State {
12509        /// The default value. This value is unused.
12510        Unspecified,
12511        /// The deployment unit is queued for deployment creation or update.
12512        Queued,
12513        /// The underlying deployment of the unit is being created or updated.
12514        ApplyingDeployment,
12515        /// The underlying deployment operation of the unit has succeeded.
12516        Succeeded,
12517        /// The underlying deployment operation of the unit has failed.
12518        Failed,
12519        /// The deployment unit was aborted, likely due to failures in other
12520        /// dependent deployment units.
12521        Aborted,
12522        /// The deployment unit was skipped because there were no changes to apply.
12523        Skipped,
12524        /// The deployment is being deleted.
12525        DeletingDeployment,
12526        /// The deployment is being previewed.
12527        PreviewingDeployment,
12528        /// If set, the enum was initialized with an unknown value.
12529        ///
12530        /// Applications can examine the value using [State::value] or
12531        /// [State::name].
12532        UnknownValue(state::UnknownValue),
12533    }
12534
12535    #[doc(hidden)]
12536    pub mod state {
12537        #[allow(unused_imports)]
12538        use super::*;
12539        #[derive(Clone, Debug, PartialEq)]
12540        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12541    }
12542
12543    impl State {
12544        /// Gets the enum value.
12545        ///
12546        /// Returns `None` if the enum contains an unknown value deserialized from
12547        /// the string representation of enums.
12548        pub fn value(&self) -> std::option::Option<i32> {
12549            match self {
12550                Self::Unspecified => std::option::Option::Some(0),
12551                Self::Queued => std::option::Option::Some(1),
12552                Self::ApplyingDeployment => std::option::Option::Some(2),
12553                Self::Succeeded => std::option::Option::Some(4),
12554                Self::Failed => std::option::Option::Some(5),
12555                Self::Aborted => std::option::Option::Some(6),
12556                Self::Skipped => std::option::Option::Some(7),
12557                Self::DeletingDeployment => std::option::Option::Some(8),
12558                Self::PreviewingDeployment => std::option::Option::Some(9),
12559                Self::UnknownValue(u) => u.0.value(),
12560            }
12561        }
12562
12563        /// Gets the enum value as a string.
12564        ///
12565        /// Returns `None` if the enum contains an unknown value deserialized from
12566        /// the integer representation of enums.
12567        pub fn name(&self) -> std::option::Option<&str> {
12568            match self {
12569                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
12570                Self::Queued => std::option::Option::Some("QUEUED"),
12571                Self::ApplyingDeployment => std::option::Option::Some("APPLYING_DEPLOYMENT"),
12572                Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
12573                Self::Failed => std::option::Option::Some("FAILED"),
12574                Self::Aborted => std::option::Option::Some("ABORTED"),
12575                Self::Skipped => std::option::Option::Some("SKIPPED"),
12576                Self::DeletingDeployment => std::option::Option::Some("DELETING_DEPLOYMENT"),
12577                Self::PreviewingDeployment => std::option::Option::Some("PREVIEWING_DEPLOYMENT"),
12578                Self::UnknownValue(u) => u.0.name(),
12579            }
12580        }
12581    }
12582
12583    impl std::default::Default for State {
12584        fn default() -> Self {
12585            use std::convert::From;
12586            Self::from(0)
12587        }
12588    }
12589
12590    impl std::fmt::Display for State {
12591        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12592            wkt::internal::display_enum(f, self.name(), self.value())
12593        }
12594    }
12595
12596    impl std::convert::From<i32> for State {
12597        fn from(value: i32) -> Self {
12598            match value {
12599                0 => Self::Unspecified,
12600                1 => Self::Queued,
12601                2 => Self::ApplyingDeployment,
12602                4 => Self::Succeeded,
12603                5 => Self::Failed,
12604                6 => Self::Aborted,
12605                7 => Self::Skipped,
12606                8 => Self::DeletingDeployment,
12607                9 => Self::PreviewingDeployment,
12608                _ => Self::UnknownValue(state::UnknownValue(
12609                    wkt::internal::UnknownEnumValue::Integer(value),
12610                )),
12611            }
12612        }
12613    }
12614
12615    impl std::convert::From<&str> for State {
12616        fn from(value: &str) -> Self {
12617            use std::string::ToString;
12618            match value {
12619                "STATE_UNSPECIFIED" => Self::Unspecified,
12620                "QUEUED" => Self::Queued,
12621                "APPLYING_DEPLOYMENT" => Self::ApplyingDeployment,
12622                "SUCCEEDED" => Self::Succeeded,
12623                "FAILED" => Self::Failed,
12624                "ABORTED" => Self::Aborted,
12625                "SKIPPED" => Self::Skipped,
12626                "DELETING_DEPLOYMENT" => Self::DeletingDeployment,
12627                "PREVIEWING_DEPLOYMENT" => Self::PreviewingDeployment,
12628                _ => Self::UnknownValue(state::UnknownValue(
12629                    wkt::internal::UnknownEnumValue::String(value.to_string()),
12630                )),
12631            }
12632        }
12633    }
12634
12635    impl serde::ser::Serialize for State {
12636        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12637        where
12638            S: serde::Serializer,
12639        {
12640            match self {
12641                Self::Unspecified => serializer.serialize_i32(0),
12642                Self::Queued => serializer.serialize_i32(1),
12643                Self::ApplyingDeployment => serializer.serialize_i32(2),
12644                Self::Succeeded => serializer.serialize_i32(4),
12645                Self::Failed => serializer.serialize_i32(5),
12646                Self::Aborted => serializer.serialize_i32(6),
12647                Self::Skipped => serializer.serialize_i32(7),
12648                Self::DeletingDeployment => serializer.serialize_i32(8),
12649                Self::PreviewingDeployment => serializer.serialize_i32(9),
12650                Self::UnknownValue(u) => u.0.serialize(serializer),
12651            }
12652        }
12653    }
12654
12655    impl<'de> serde::de::Deserialize<'de> for State {
12656        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12657        where
12658            D: serde::Deserializer<'de>,
12659        {
12660            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
12661                ".google.cloud.config.v1.DeploymentUnitProgress.State",
12662            ))
12663        }
12664    }
12665
12666    /// The possible intents of a deployment unit.
12667    ///
12668    /// # Working with unknown values
12669    ///
12670    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12671    /// additional enum variants at any time. Adding new variants is not considered
12672    /// a breaking change. Applications should write their code in anticipation of:
12673    ///
12674    /// - New values appearing in future releases of the client library, **and**
12675    /// - New values received dynamically, without application changes.
12676    ///
12677    /// Please consult the [Working with enums] section in the user guide for some
12678    /// guidelines.
12679    ///
12680    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
12681    #[derive(Clone, Debug, PartialEq)]
12682    #[non_exhaustive]
12683    pub enum Intent {
12684        /// Unspecified intent.
12685        Unspecified,
12686        /// Create deployment in the unit from the deployment spec.
12687        CreateDeployment,
12688        /// Update deployment in the unit.
12689        UpdateDeployment,
12690        /// Delete deployment in the unit.
12691        DeleteDeployment,
12692        /// Recreate deployment in the unit.
12693        RecreateDeployment,
12694        /// Delete deployment in latest successful revision while no longer
12695        /// referenced in any deployment unit in the current deployment group.
12696        CleanUp,
12697        /// Expected to be unchanged.
12698        Unchanged,
12699        /// If set, the enum was initialized with an unknown value.
12700        ///
12701        /// Applications can examine the value using [Intent::value] or
12702        /// [Intent::name].
12703        UnknownValue(intent::UnknownValue),
12704    }
12705
12706    #[doc(hidden)]
12707    pub mod intent {
12708        #[allow(unused_imports)]
12709        use super::*;
12710        #[derive(Clone, Debug, PartialEq)]
12711        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12712    }
12713
12714    impl Intent {
12715        /// Gets the enum value.
12716        ///
12717        /// Returns `None` if the enum contains an unknown value deserialized from
12718        /// the string representation of enums.
12719        pub fn value(&self) -> std::option::Option<i32> {
12720            match self {
12721                Self::Unspecified => std::option::Option::Some(0),
12722                Self::CreateDeployment => std::option::Option::Some(1),
12723                Self::UpdateDeployment => std::option::Option::Some(2),
12724                Self::DeleteDeployment => std::option::Option::Some(3),
12725                Self::RecreateDeployment => std::option::Option::Some(4),
12726                Self::CleanUp => std::option::Option::Some(5),
12727                Self::Unchanged => std::option::Option::Some(6),
12728                Self::UnknownValue(u) => u.0.value(),
12729            }
12730        }
12731
12732        /// Gets the enum value as a string.
12733        ///
12734        /// Returns `None` if the enum contains an unknown value deserialized from
12735        /// the integer representation of enums.
12736        pub fn name(&self) -> std::option::Option<&str> {
12737            match self {
12738                Self::Unspecified => std::option::Option::Some("INTENT_UNSPECIFIED"),
12739                Self::CreateDeployment => std::option::Option::Some("CREATE_DEPLOYMENT"),
12740                Self::UpdateDeployment => std::option::Option::Some("UPDATE_DEPLOYMENT"),
12741                Self::DeleteDeployment => std::option::Option::Some("DELETE_DEPLOYMENT"),
12742                Self::RecreateDeployment => std::option::Option::Some("RECREATE_DEPLOYMENT"),
12743                Self::CleanUp => std::option::Option::Some("CLEAN_UP"),
12744                Self::Unchanged => std::option::Option::Some("UNCHANGED"),
12745                Self::UnknownValue(u) => u.0.name(),
12746            }
12747        }
12748    }
12749
12750    impl std::default::Default for Intent {
12751        fn default() -> Self {
12752            use std::convert::From;
12753            Self::from(0)
12754        }
12755    }
12756
12757    impl std::fmt::Display for Intent {
12758        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12759            wkt::internal::display_enum(f, self.name(), self.value())
12760        }
12761    }
12762
12763    impl std::convert::From<i32> for Intent {
12764        fn from(value: i32) -> Self {
12765            match value {
12766                0 => Self::Unspecified,
12767                1 => Self::CreateDeployment,
12768                2 => Self::UpdateDeployment,
12769                3 => Self::DeleteDeployment,
12770                4 => Self::RecreateDeployment,
12771                5 => Self::CleanUp,
12772                6 => Self::Unchanged,
12773                _ => Self::UnknownValue(intent::UnknownValue(
12774                    wkt::internal::UnknownEnumValue::Integer(value),
12775                )),
12776            }
12777        }
12778    }
12779
12780    impl std::convert::From<&str> for Intent {
12781        fn from(value: &str) -> Self {
12782            use std::string::ToString;
12783            match value {
12784                "INTENT_UNSPECIFIED" => Self::Unspecified,
12785                "CREATE_DEPLOYMENT" => Self::CreateDeployment,
12786                "UPDATE_DEPLOYMENT" => Self::UpdateDeployment,
12787                "DELETE_DEPLOYMENT" => Self::DeleteDeployment,
12788                "RECREATE_DEPLOYMENT" => Self::RecreateDeployment,
12789                "CLEAN_UP" => Self::CleanUp,
12790                "UNCHANGED" => Self::Unchanged,
12791                _ => Self::UnknownValue(intent::UnknownValue(
12792                    wkt::internal::UnknownEnumValue::String(value.to_string()),
12793                )),
12794            }
12795        }
12796    }
12797
12798    impl serde::ser::Serialize for Intent {
12799        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12800        where
12801            S: serde::Serializer,
12802        {
12803            match self {
12804                Self::Unspecified => serializer.serialize_i32(0),
12805                Self::CreateDeployment => serializer.serialize_i32(1),
12806                Self::UpdateDeployment => serializer.serialize_i32(2),
12807                Self::DeleteDeployment => serializer.serialize_i32(3),
12808                Self::RecreateDeployment => serializer.serialize_i32(4),
12809                Self::CleanUp => serializer.serialize_i32(5),
12810                Self::Unchanged => serializer.serialize_i32(6),
12811                Self::UnknownValue(u) => u.0.serialize(serializer),
12812            }
12813        }
12814    }
12815
12816    impl<'de> serde::de::Deserialize<'de> for Intent {
12817        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12818        where
12819            D: serde::Deserializer<'de>,
12820        {
12821            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Intent>::new(
12822                ".google.cloud.config.v1.DeploymentUnitProgress.Intent",
12823            ))
12824        }
12825    }
12826}
12827
12828/// Operation metadata for `ProvisionDeploymentGroup` and
12829/// `DeprovisionDeploymentGroup` long-running operations.
12830#[derive(Clone, Default, PartialEq)]
12831#[non_exhaustive]
12832pub struct ProvisionDeploymentGroupOperationMetadata {
12833    /// Output only. The current step of the deployment group operation.
12834    pub step:
12835        crate::model::provision_deployment_group_operation_metadata::ProvisionDeploymentGroupStep,
12836
12837    /// Output only. Progress information for each deployment unit within the
12838    /// operation.
12839    pub deployment_unit_progresses: std::vec::Vec<crate::model::DeploymentUnitProgress>,
12840
12841    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12842}
12843
12844impl ProvisionDeploymentGroupOperationMetadata {
12845    /// Creates a new default instance.
12846    pub fn new() -> Self {
12847        std::default::Default::default()
12848    }
12849
12850    /// Sets the value of [step][crate::model::ProvisionDeploymentGroupOperationMetadata::step].
12851    ///
12852    /// # Example
12853    /// ```ignore,no_run
12854    /// # use google_cloud_config_v1::model::ProvisionDeploymentGroupOperationMetadata;
12855    /// use google_cloud_config_v1::model::provision_deployment_group_operation_metadata::ProvisionDeploymentGroupStep;
12856    /// let x0 = ProvisionDeploymentGroupOperationMetadata::new().set_step(ProvisionDeploymentGroupStep::ValidatingDeploymentGroup);
12857    /// let x1 = ProvisionDeploymentGroupOperationMetadata::new().set_step(ProvisionDeploymentGroupStep::AssociatingDeploymentsToDeploymentGroup);
12858    /// let x2 = ProvisionDeploymentGroupOperationMetadata::new().set_step(ProvisionDeploymentGroupStep::ProvisioningDeploymentUnits);
12859    /// ```
12860    pub fn set_step<T: std::convert::Into<crate::model::provision_deployment_group_operation_metadata::ProvisionDeploymentGroupStep>>(mut self, v: T) -> Self{
12861        self.step = v.into();
12862        self
12863    }
12864
12865    /// Sets the value of [deployment_unit_progresses][crate::model::ProvisionDeploymentGroupOperationMetadata::deployment_unit_progresses].
12866    ///
12867    /// # Example
12868    /// ```ignore,no_run
12869    /// # use google_cloud_config_v1::model::ProvisionDeploymentGroupOperationMetadata;
12870    /// use google_cloud_config_v1::model::DeploymentUnitProgress;
12871    /// let x = ProvisionDeploymentGroupOperationMetadata::new()
12872    ///     .set_deployment_unit_progresses([
12873    ///         DeploymentUnitProgress::default()/* use setters */,
12874    ///         DeploymentUnitProgress::default()/* use (different) setters */,
12875    ///     ]);
12876    /// ```
12877    pub fn set_deployment_unit_progresses<T, V>(mut self, v: T) -> Self
12878    where
12879        T: std::iter::IntoIterator<Item = V>,
12880        V: std::convert::Into<crate::model::DeploymentUnitProgress>,
12881    {
12882        use std::iter::Iterator;
12883        self.deployment_unit_progresses = v.into_iter().map(|i| i.into()).collect();
12884        self
12885    }
12886}
12887
12888impl wkt::message::Message for ProvisionDeploymentGroupOperationMetadata {
12889    fn typename() -> &'static str {
12890        "type.googleapis.com/google.cloud.config.v1.ProvisionDeploymentGroupOperationMetadata"
12891    }
12892}
12893
12894/// Defines additional types related to [ProvisionDeploymentGroupOperationMetadata].
12895pub mod provision_deployment_group_operation_metadata {
12896    #[allow(unused_imports)]
12897    use super::*;
12898
12899    /// Possible steps during a deployment group provisioning or deprovisioning
12900    /// operation.
12901    ///
12902    /// # Working with unknown values
12903    ///
12904    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12905    /// additional enum variants at any time. Adding new variants is not considered
12906    /// a breaking change. Applications should write their code in anticipation of:
12907    ///
12908    /// - New values appearing in future releases of the client library, **and**
12909    /// - New values received dynamically, without application changes.
12910    ///
12911    /// Please consult the [Working with enums] section in the user guide for some
12912    /// guidelines.
12913    ///
12914    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
12915    #[derive(Clone, Debug, PartialEq)]
12916    #[non_exhaustive]
12917    pub enum ProvisionDeploymentGroupStep {
12918        /// Unspecified step.
12919        Unspecified,
12920        /// Validating the deployment group.
12921        ValidatingDeploymentGroup,
12922        /// Locking the deployments to the deployment group for atomic actuation.
12923        AssociatingDeploymentsToDeploymentGroup,
12924        /// Provisioning the deployment units.
12925        ProvisioningDeploymentUnits,
12926        /// Unlocking the deployments from the deployment group after actuation.
12927        DisassociatingDeploymentsFromDeploymentGroup,
12928        /// The operation has succeeded.
12929        Succeeded,
12930        /// The operation has failed.
12931        Failed,
12932        /// Deprovisioning the deployment units.
12933        DeprovisioningDeploymentUnits,
12934        /// If set, the enum was initialized with an unknown value.
12935        ///
12936        /// Applications can examine the value using [ProvisionDeploymentGroupStep::value] or
12937        /// [ProvisionDeploymentGroupStep::name].
12938        UnknownValue(provision_deployment_group_step::UnknownValue),
12939    }
12940
12941    #[doc(hidden)]
12942    pub mod provision_deployment_group_step {
12943        #[allow(unused_imports)]
12944        use super::*;
12945        #[derive(Clone, Debug, PartialEq)]
12946        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12947    }
12948
12949    impl ProvisionDeploymentGroupStep {
12950        /// Gets the enum value.
12951        ///
12952        /// Returns `None` if the enum contains an unknown value deserialized from
12953        /// the string representation of enums.
12954        pub fn value(&self) -> std::option::Option<i32> {
12955            match self {
12956                Self::Unspecified => std::option::Option::Some(0),
12957                Self::ValidatingDeploymentGroup => std::option::Option::Some(1),
12958                Self::AssociatingDeploymentsToDeploymentGroup => std::option::Option::Some(2),
12959                Self::ProvisioningDeploymentUnits => std::option::Option::Some(3),
12960                Self::DisassociatingDeploymentsFromDeploymentGroup => std::option::Option::Some(4),
12961                Self::Succeeded => std::option::Option::Some(5),
12962                Self::Failed => std::option::Option::Some(6),
12963                Self::DeprovisioningDeploymentUnits => std::option::Option::Some(7),
12964                Self::UnknownValue(u) => u.0.value(),
12965            }
12966        }
12967
12968        /// Gets the enum value as a string.
12969        ///
12970        /// Returns `None` if the enum contains an unknown value deserialized from
12971        /// the integer representation of enums.
12972        pub fn name(&self) -> std::option::Option<&str> {
12973            match self {
12974                Self::Unspecified => {
12975                    std::option::Option::Some("PROVISION_DEPLOYMENT_GROUP_STEP_UNSPECIFIED")
12976                }
12977                Self::ValidatingDeploymentGroup => {
12978                    std::option::Option::Some("VALIDATING_DEPLOYMENT_GROUP")
12979                }
12980                Self::AssociatingDeploymentsToDeploymentGroup => {
12981                    std::option::Option::Some("ASSOCIATING_DEPLOYMENTS_TO_DEPLOYMENT_GROUP")
12982                }
12983                Self::ProvisioningDeploymentUnits => {
12984                    std::option::Option::Some("PROVISIONING_DEPLOYMENT_UNITS")
12985                }
12986                Self::DisassociatingDeploymentsFromDeploymentGroup => {
12987                    std::option::Option::Some("DISASSOCIATING_DEPLOYMENTS_FROM_DEPLOYMENT_GROUP")
12988                }
12989                Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
12990                Self::Failed => std::option::Option::Some("FAILED"),
12991                Self::DeprovisioningDeploymentUnits => {
12992                    std::option::Option::Some("DEPROVISIONING_DEPLOYMENT_UNITS")
12993                }
12994                Self::UnknownValue(u) => u.0.name(),
12995            }
12996        }
12997    }
12998
12999    impl std::default::Default for ProvisionDeploymentGroupStep {
13000        fn default() -> Self {
13001            use std::convert::From;
13002            Self::from(0)
13003        }
13004    }
13005
13006    impl std::fmt::Display for ProvisionDeploymentGroupStep {
13007        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13008            wkt::internal::display_enum(f, self.name(), self.value())
13009        }
13010    }
13011
13012    impl std::convert::From<i32> for ProvisionDeploymentGroupStep {
13013        fn from(value: i32) -> Self {
13014            match value {
13015                0 => Self::Unspecified,
13016                1 => Self::ValidatingDeploymentGroup,
13017                2 => Self::AssociatingDeploymentsToDeploymentGroup,
13018                3 => Self::ProvisioningDeploymentUnits,
13019                4 => Self::DisassociatingDeploymentsFromDeploymentGroup,
13020                5 => Self::Succeeded,
13021                6 => Self::Failed,
13022                7 => Self::DeprovisioningDeploymentUnits,
13023                _ => Self::UnknownValue(provision_deployment_group_step::UnknownValue(
13024                    wkt::internal::UnknownEnumValue::Integer(value),
13025                )),
13026            }
13027        }
13028    }
13029
13030    impl std::convert::From<&str> for ProvisionDeploymentGroupStep {
13031        fn from(value: &str) -> Self {
13032            use std::string::ToString;
13033            match value {
13034                "PROVISION_DEPLOYMENT_GROUP_STEP_UNSPECIFIED" => Self::Unspecified,
13035                "VALIDATING_DEPLOYMENT_GROUP" => Self::ValidatingDeploymentGroup,
13036                "ASSOCIATING_DEPLOYMENTS_TO_DEPLOYMENT_GROUP" => {
13037                    Self::AssociatingDeploymentsToDeploymentGroup
13038                }
13039                "PROVISIONING_DEPLOYMENT_UNITS" => Self::ProvisioningDeploymentUnits,
13040                "DISASSOCIATING_DEPLOYMENTS_FROM_DEPLOYMENT_GROUP" => {
13041                    Self::DisassociatingDeploymentsFromDeploymentGroup
13042                }
13043                "SUCCEEDED" => Self::Succeeded,
13044                "FAILED" => Self::Failed,
13045                "DEPROVISIONING_DEPLOYMENT_UNITS" => Self::DeprovisioningDeploymentUnits,
13046                _ => Self::UnknownValue(provision_deployment_group_step::UnknownValue(
13047                    wkt::internal::UnknownEnumValue::String(value.to_string()),
13048                )),
13049            }
13050        }
13051    }
13052
13053    impl serde::ser::Serialize for ProvisionDeploymentGroupStep {
13054        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13055        where
13056            S: serde::Serializer,
13057        {
13058            match self {
13059                Self::Unspecified => serializer.serialize_i32(0),
13060                Self::ValidatingDeploymentGroup => serializer.serialize_i32(1),
13061                Self::AssociatingDeploymentsToDeploymentGroup => serializer.serialize_i32(2),
13062                Self::ProvisioningDeploymentUnits => serializer.serialize_i32(3),
13063                Self::DisassociatingDeploymentsFromDeploymentGroup => serializer.serialize_i32(4),
13064                Self::Succeeded => serializer.serialize_i32(5),
13065                Self::Failed => serializer.serialize_i32(6),
13066                Self::DeprovisioningDeploymentUnits => serializer.serialize_i32(7),
13067                Self::UnknownValue(u) => u.0.serialize(serializer),
13068            }
13069        }
13070    }
13071
13072    impl<'de> serde::de::Deserialize<'de> for ProvisionDeploymentGroupStep {
13073        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13074        where
13075            D: serde::Deserializer<'de>,
13076        {
13077            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ProvisionDeploymentGroupStep>::new(
13078                ".google.cloud.config.v1.ProvisionDeploymentGroupOperationMetadata.ProvisionDeploymentGroupStep"))
13079        }
13080    }
13081}
13082
13083/// A DeploymentGroupRevision represents a snapshot of a
13084/// [DeploymentGroup][google.cloud.config.v1.DeploymentGroup] at a given point in
13085/// time, created when a DeploymentGroup is provisioned or deprovisioned.
13086///
13087/// [google.cloud.config.v1.DeploymentGroup]: crate::model::DeploymentGroup
13088#[derive(Clone, Default, PartialEq)]
13089#[non_exhaustive]
13090pub struct DeploymentGroupRevision {
13091    /// Identifier. The name of the deployment group revision.
13092    /// Format:
13093    /// 'projects/{project_id}/locations/{location}/deploymentGroups/{deployment_group}/revisions/{revision}'.
13094    pub name: std::string::String,
13095
13096    /// Output only. The snapshot of the deployment group at this revision.
13097    pub snapshot: std::option::Option<crate::model::DeploymentGroup>,
13098
13099    /// Output only. Time when the deployment group revision was created.
13100    pub create_time: std::option::Option<wkt::Timestamp>,
13101
13102    /// Output only. The alternative IDs of the deployment group revision.
13103    pub alternative_ids: std::vec::Vec<std::string::String>,
13104
13105    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13106}
13107
13108impl DeploymentGroupRevision {
13109    /// Creates a new default instance.
13110    pub fn new() -> Self {
13111        std::default::Default::default()
13112    }
13113
13114    /// Sets the value of [name][crate::model::DeploymentGroupRevision::name].
13115    ///
13116    /// # Example
13117    /// ```ignore,no_run
13118    /// # use google_cloud_config_v1::model::DeploymentGroupRevision;
13119    /// # let project_id = "project_id";
13120    /// # let location_id = "location_id";
13121    /// # let deployment_group_id = "deployment_group_id";
13122    /// # let revision_id = "revision_id";
13123    /// let x = DeploymentGroupRevision::new().set_name(format!("projects/{project_id}/locations/{location_id}/deploymentGroups/{deployment_group_id}/revisions/{revision_id}"));
13124    /// ```
13125    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13126        self.name = v.into();
13127        self
13128    }
13129
13130    /// Sets the value of [snapshot][crate::model::DeploymentGroupRevision::snapshot].
13131    ///
13132    /// # Example
13133    /// ```ignore,no_run
13134    /// # use google_cloud_config_v1::model::DeploymentGroupRevision;
13135    /// use google_cloud_config_v1::model::DeploymentGroup;
13136    /// let x = DeploymentGroupRevision::new().set_snapshot(DeploymentGroup::default()/* use setters */);
13137    /// ```
13138    pub fn set_snapshot<T>(mut self, v: T) -> Self
13139    where
13140        T: std::convert::Into<crate::model::DeploymentGroup>,
13141    {
13142        self.snapshot = std::option::Option::Some(v.into());
13143        self
13144    }
13145
13146    /// Sets or clears the value of [snapshot][crate::model::DeploymentGroupRevision::snapshot].
13147    ///
13148    /// # Example
13149    /// ```ignore,no_run
13150    /// # use google_cloud_config_v1::model::DeploymentGroupRevision;
13151    /// use google_cloud_config_v1::model::DeploymentGroup;
13152    /// let x = DeploymentGroupRevision::new().set_or_clear_snapshot(Some(DeploymentGroup::default()/* use setters */));
13153    /// let x = DeploymentGroupRevision::new().set_or_clear_snapshot(None::<DeploymentGroup>);
13154    /// ```
13155    pub fn set_or_clear_snapshot<T>(mut self, v: std::option::Option<T>) -> Self
13156    where
13157        T: std::convert::Into<crate::model::DeploymentGroup>,
13158    {
13159        self.snapshot = v.map(|x| x.into());
13160        self
13161    }
13162
13163    /// Sets the value of [create_time][crate::model::DeploymentGroupRevision::create_time].
13164    ///
13165    /// # Example
13166    /// ```ignore,no_run
13167    /// # use google_cloud_config_v1::model::DeploymentGroupRevision;
13168    /// use wkt::Timestamp;
13169    /// let x = DeploymentGroupRevision::new().set_create_time(Timestamp::default()/* use setters */);
13170    /// ```
13171    pub fn set_create_time<T>(mut self, v: T) -> Self
13172    where
13173        T: std::convert::Into<wkt::Timestamp>,
13174    {
13175        self.create_time = std::option::Option::Some(v.into());
13176        self
13177    }
13178
13179    /// Sets or clears the value of [create_time][crate::model::DeploymentGroupRevision::create_time].
13180    ///
13181    /// # Example
13182    /// ```ignore,no_run
13183    /// # use google_cloud_config_v1::model::DeploymentGroupRevision;
13184    /// use wkt::Timestamp;
13185    /// let x = DeploymentGroupRevision::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
13186    /// let x = DeploymentGroupRevision::new().set_or_clear_create_time(None::<Timestamp>);
13187    /// ```
13188    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
13189    where
13190        T: std::convert::Into<wkt::Timestamp>,
13191    {
13192        self.create_time = v.map(|x| x.into());
13193        self
13194    }
13195
13196    /// Sets the value of [alternative_ids][crate::model::DeploymentGroupRevision::alternative_ids].
13197    ///
13198    /// # Example
13199    /// ```ignore,no_run
13200    /// # use google_cloud_config_v1::model::DeploymentGroupRevision;
13201    /// let x = DeploymentGroupRevision::new().set_alternative_ids(["a", "b", "c"]);
13202    /// ```
13203    pub fn set_alternative_ids<T, V>(mut self, v: T) -> Self
13204    where
13205        T: std::iter::IntoIterator<Item = V>,
13206        V: std::convert::Into<std::string::String>,
13207    {
13208        use std::iter::Iterator;
13209        self.alternative_ids = v.into_iter().map(|i| i.into()).collect();
13210        self
13211    }
13212}
13213
13214impl wkt::message::Message for DeploymentGroupRevision {
13215    fn typename() -> &'static str {
13216        "type.googleapis.com/google.cloud.config.v1.DeploymentGroupRevision"
13217    }
13218}
13219
13220/// The request message for the GetDeploymentGroupRevision method.
13221#[derive(Clone, Default, PartialEq)]
13222#[non_exhaustive]
13223pub struct GetDeploymentGroupRevisionRequest {
13224    /// Required. The name of the deployment group revision to retrieve.
13225    /// Format:
13226    /// 'projects/{project_id}/locations/{location}/deploymentGroups/{deployment_group}/revisions/{revision}'.
13227    pub name: std::string::String,
13228
13229    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13230}
13231
13232impl GetDeploymentGroupRevisionRequest {
13233    /// Creates a new default instance.
13234    pub fn new() -> Self {
13235        std::default::Default::default()
13236    }
13237
13238    /// Sets the value of [name][crate::model::GetDeploymentGroupRevisionRequest::name].
13239    ///
13240    /// # Example
13241    /// ```ignore,no_run
13242    /// # use google_cloud_config_v1::model::GetDeploymentGroupRevisionRequest;
13243    /// # let project_id = "project_id";
13244    /// # let location_id = "location_id";
13245    /// # let deployment_group_id = "deployment_group_id";
13246    /// # let revision_id = "revision_id";
13247    /// let x = GetDeploymentGroupRevisionRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/deploymentGroups/{deployment_group_id}/revisions/{revision_id}"));
13248    /// ```
13249    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13250        self.name = v.into();
13251        self
13252    }
13253}
13254
13255impl wkt::message::Message for GetDeploymentGroupRevisionRequest {
13256    fn typename() -> &'static str {
13257        "type.googleapis.com/google.cloud.config.v1.GetDeploymentGroupRevisionRequest"
13258    }
13259}
13260
13261/// The request message for the ListDeploymentGroupRevisions method.
13262#[derive(Clone, Default, PartialEq)]
13263#[non_exhaustive]
13264pub struct ListDeploymentGroupRevisionsRequest {
13265    /// Required. The parent, which owns this collection of deployment group
13266    /// revisions. Format:
13267    /// 'projects/{project_id}/locations/{location}/deploymentGroups/{deployment_group}'.
13268    pub parent: std::string::String,
13269
13270    /// Optional. When requesting a page of resources, 'page_size' specifies number
13271    /// of resources to return. If unspecified, a sensible default will be used by
13272    /// the server. The maximum value is 1000; values above 1000 will be coerced to
13273    /// 1000.
13274    pub page_size: i32,
13275
13276    /// Optional. Token returned by previous call to 'ListDeploymentGroupRevisions'
13277    /// which specifies the position in the list from where to continue listing the
13278    /// deployment group revisions. All other parameters provided to
13279    /// `ListDeploymentGroupRevisions` must match the call that provided the page
13280    /// token.
13281    pub page_token: std::string::String,
13282
13283    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13284}
13285
13286impl ListDeploymentGroupRevisionsRequest {
13287    /// Creates a new default instance.
13288    pub fn new() -> Self {
13289        std::default::Default::default()
13290    }
13291
13292    /// Sets the value of [parent][crate::model::ListDeploymentGroupRevisionsRequest::parent].
13293    ///
13294    /// # Example
13295    /// ```ignore,no_run
13296    /// # use google_cloud_config_v1::model::ListDeploymentGroupRevisionsRequest;
13297    /// # let project_id = "project_id";
13298    /// # let location_id = "location_id";
13299    /// # let deployment_group_id = "deployment_group_id";
13300    /// let x = ListDeploymentGroupRevisionsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/deploymentGroups/{deployment_group_id}"));
13301    /// ```
13302    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13303        self.parent = v.into();
13304        self
13305    }
13306
13307    /// Sets the value of [page_size][crate::model::ListDeploymentGroupRevisionsRequest::page_size].
13308    ///
13309    /// # Example
13310    /// ```ignore,no_run
13311    /// # use google_cloud_config_v1::model::ListDeploymentGroupRevisionsRequest;
13312    /// let x = ListDeploymentGroupRevisionsRequest::new().set_page_size(42);
13313    /// ```
13314    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
13315        self.page_size = v.into();
13316        self
13317    }
13318
13319    /// Sets the value of [page_token][crate::model::ListDeploymentGroupRevisionsRequest::page_token].
13320    ///
13321    /// # Example
13322    /// ```ignore,no_run
13323    /// # use google_cloud_config_v1::model::ListDeploymentGroupRevisionsRequest;
13324    /// let x = ListDeploymentGroupRevisionsRequest::new().set_page_token("example");
13325    /// ```
13326    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13327        self.page_token = v.into();
13328        self
13329    }
13330}
13331
13332impl wkt::message::Message for ListDeploymentGroupRevisionsRequest {
13333    fn typename() -> &'static str {
13334        "type.googleapis.com/google.cloud.config.v1.ListDeploymentGroupRevisionsRequest"
13335    }
13336}
13337
13338/// The response message for the ListDeploymentGroupRevisions method.
13339#[derive(Clone, Default, PartialEq)]
13340#[non_exhaustive]
13341pub struct ListDeploymentGroupRevisionsResponse {
13342    /// The deployment group revisions from the specified collection.
13343    pub deployment_group_revisions: std::vec::Vec<crate::model::DeploymentGroupRevision>,
13344
13345    /// Token to be supplied to the next ListDeploymentGroupRevisions request via
13346    /// `page_token` to obtain the next set of results.
13347    pub next_page_token: std::string::String,
13348
13349    /// Unordered list. Locations that could not be reached.
13350    pub unreachable: std::vec::Vec<std::string::String>,
13351
13352    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13353}
13354
13355impl ListDeploymentGroupRevisionsResponse {
13356    /// Creates a new default instance.
13357    pub fn new() -> Self {
13358        std::default::Default::default()
13359    }
13360
13361    /// Sets the value of [deployment_group_revisions][crate::model::ListDeploymentGroupRevisionsResponse::deployment_group_revisions].
13362    ///
13363    /// # Example
13364    /// ```ignore,no_run
13365    /// # use google_cloud_config_v1::model::ListDeploymentGroupRevisionsResponse;
13366    /// use google_cloud_config_v1::model::DeploymentGroupRevision;
13367    /// let x = ListDeploymentGroupRevisionsResponse::new()
13368    ///     .set_deployment_group_revisions([
13369    ///         DeploymentGroupRevision::default()/* use setters */,
13370    ///         DeploymentGroupRevision::default()/* use (different) setters */,
13371    ///     ]);
13372    /// ```
13373    pub fn set_deployment_group_revisions<T, V>(mut self, v: T) -> Self
13374    where
13375        T: std::iter::IntoIterator<Item = V>,
13376        V: std::convert::Into<crate::model::DeploymentGroupRevision>,
13377    {
13378        use std::iter::Iterator;
13379        self.deployment_group_revisions = v.into_iter().map(|i| i.into()).collect();
13380        self
13381    }
13382
13383    /// Sets the value of [next_page_token][crate::model::ListDeploymentGroupRevisionsResponse::next_page_token].
13384    ///
13385    /// # Example
13386    /// ```ignore,no_run
13387    /// # use google_cloud_config_v1::model::ListDeploymentGroupRevisionsResponse;
13388    /// let x = ListDeploymentGroupRevisionsResponse::new().set_next_page_token("example");
13389    /// ```
13390    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13391        self.next_page_token = v.into();
13392        self
13393    }
13394
13395    /// Sets the value of [unreachable][crate::model::ListDeploymentGroupRevisionsResponse::unreachable].
13396    ///
13397    /// # Example
13398    /// ```ignore,no_run
13399    /// # use google_cloud_config_v1::model::ListDeploymentGroupRevisionsResponse;
13400    /// let x = ListDeploymentGroupRevisionsResponse::new().set_unreachable(["a", "b", "c"]);
13401    /// ```
13402    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
13403    where
13404        T: std::iter::IntoIterator<Item = V>,
13405        V: std::convert::Into<std::string::String>,
13406    {
13407        use std::iter::Iterator;
13408        self.unreachable = v.into_iter().map(|i| i.into()).collect();
13409        self
13410    }
13411}
13412
13413impl wkt::message::Message for ListDeploymentGroupRevisionsResponse {
13414    fn typename() -> &'static str {
13415        "type.googleapis.com/google.cloud.config.v1.ListDeploymentGroupRevisionsResponse"
13416    }
13417}
13418
13419#[doc(hidden)]
13420impl google_cloud_gax::paginator::internal::PageableResponse
13421    for ListDeploymentGroupRevisionsResponse
13422{
13423    type PageItem = crate::model::DeploymentGroupRevision;
13424
13425    fn items(self) -> std::vec::Vec<Self::PageItem> {
13426        self.deployment_group_revisions
13427    }
13428
13429    fn next_page_token(&self) -> std::string::String {
13430        use std::clone::Clone;
13431        self.next_page_token.clone()
13432    }
13433}
13434
13435/// Enum values to control quota checks for resources in terraform
13436/// configuration files.
13437///
13438/// # Working with unknown values
13439///
13440/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13441/// additional enum variants at any time. Adding new variants is not considered
13442/// a breaking change. Applications should write their code in anticipation of:
13443///
13444/// - New values appearing in future releases of the client library, **and**
13445/// - New values received dynamically, without application changes.
13446///
13447/// Please consult the [Working with enums] section in the user guide for some
13448/// guidelines.
13449///
13450/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
13451#[derive(Clone, Debug, PartialEq)]
13452#[non_exhaustive]
13453pub enum QuotaValidation {
13454    /// The default value.
13455    /// QuotaValidation on terraform configuration files will be disabled in
13456    /// this case.
13457    Unspecified,
13458    /// Enable computing quotas for resources in terraform configuration files to
13459    /// get visibility on resources with insufficient quotas.
13460    Enabled,
13461    /// Enforce quota checks so deployment fails if there isn't sufficient quotas
13462    /// available to deploy resources in terraform configuration files.
13463    Enforced,
13464    /// If set, the enum was initialized with an unknown value.
13465    ///
13466    /// Applications can examine the value using [QuotaValidation::value] or
13467    /// [QuotaValidation::name].
13468    UnknownValue(quota_validation::UnknownValue),
13469}
13470
13471#[doc(hidden)]
13472pub mod quota_validation {
13473    #[allow(unused_imports)]
13474    use super::*;
13475    #[derive(Clone, Debug, PartialEq)]
13476    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13477}
13478
13479impl QuotaValidation {
13480    /// Gets the enum value.
13481    ///
13482    /// Returns `None` if the enum contains an unknown value deserialized from
13483    /// the string representation of enums.
13484    pub fn value(&self) -> std::option::Option<i32> {
13485        match self {
13486            Self::Unspecified => std::option::Option::Some(0),
13487            Self::Enabled => std::option::Option::Some(1),
13488            Self::Enforced => std::option::Option::Some(2),
13489            Self::UnknownValue(u) => u.0.value(),
13490        }
13491    }
13492
13493    /// Gets the enum value as a string.
13494    ///
13495    /// Returns `None` if the enum contains an unknown value deserialized from
13496    /// the integer representation of enums.
13497    pub fn name(&self) -> std::option::Option<&str> {
13498        match self {
13499            Self::Unspecified => std::option::Option::Some("QUOTA_VALIDATION_UNSPECIFIED"),
13500            Self::Enabled => std::option::Option::Some("ENABLED"),
13501            Self::Enforced => std::option::Option::Some("ENFORCED"),
13502            Self::UnknownValue(u) => u.0.name(),
13503        }
13504    }
13505}
13506
13507impl std::default::Default for QuotaValidation {
13508    fn default() -> Self {
13509        use std::convert::From;
13510        Self::from(0)
13511    }
13512}
13513
13514impl std::fmt::Display for QuotaValidation {
13515    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13516        wkt::internal::display_enum(f, self.name(), self.value())
13517    }
13518}
13519
13520impl std::convert::From<i32> for QuotaValidation {
13521    fn from(value: i32) -> Self {
13522        match value {
13523            0 => Self::Unspecified,
13524            1 => Self::Enabled,
13525            2 => Self::Enforced,
13526            _ => Self::UnknownValue(quota_validation::UnknownValue(
13527                wkt::internal::UnknownEnumValue::Integer(value),
13528            )),
13529        }
13530    }
13531}
13532
13533impl std::convert::From<&str> for QuotaValidation {
13534    fn from(value: &str) -> Self {
13535        use std::string::ToString;
13536        match value {
13537            "QUOTA_VALIDATION_UNSPECIFIED" => Self::Unspecified,
13538            "ENABLED" => Self::Enabled,
13539            "ENFORCED" => Self::Enforced,
13540            _ => Self::UnknownValue(quota_validation::UnknownValue(
13541                wkt::internal::UnknownEnumValue::String(value.to_string()),
13542            )),
13543        }
13544    }
13545}
13546
13547impl serde::ser::Serialize for QuotaValidation {
13548    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13549    where
13550        S: serde::Serializer,
13551    {
13552        match self {
13553            Self::Unspecified => serializer.serialize_i32(0),
13554            Self::Enabled => serializer.serialize_i32(1),
13555            Self::Enforced => serializer.serialize_i32(2),
13556            Self::UnknownValue(u) => u.0.serialize(serializer),
13557        }
13558    }
13559}
13560
13561impl<'de> serde::de::Deserialize<'de> for QuotaValidation {
13562    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13563    where
13564        D: serde::Deserializer<'de>,
13565    {
13566        deserializer.deserialize_any(wkt::internal::EnumVisitor::<QuotaValidation>::new(
13567            ".google.cloud.config.v1.QuotaValidation",
13568        ))
13569    }
13570}