google_cloud_config_v1/model.rs
1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17#![allow(rustdoc::redundant_explicit_links)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![no_implicit_prelude]
20extern crate async_trait;
21extern crate bytes;
22extern crate gaxi;
23extern crate google_cloud_gax;
24extern crate google_cloud_iam_v1;
25extern crate google_cloud_location;
26extern crate google_cloud_longrunning;
27extern crate google_cloud_lro;
28extern crate google_cloud_rpc;
29extern crate serde;
30extern crate serde_json;
31extern crate serde_with;
32extern crate std;
33extern crate tracing;
34extern crate wkt;
35
36mod debug;
37mod deserialize;
38mod serialize;
39
40/// A Deployment is a group of resources and configs managed and provisioned by
41/// Infra Manager.
42#[derive(Clone, Default, PartialEq)]
43#[non_exhaustive]
44pub struct Deployment {
45 /// Identifier. Resource name of the deployment.
46 /// Format: `projects/{project}/locations/{location}/deployments/{deployment}`
47 pub name: std::string::String,
48
49 /// Output only. Time when the deployment was created.
50 pub create_time: std::option::Option<wkt::Timestamp>,
51
52 /// Output only. Time when the deployment was last modified.
53 pub update_time: std::option::Option<wkt::Timestamp>,
54
55 /// Optional. User-defined metadata for the deployment.
56 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
57
58 /// Output only. Current state of the deployment.
59 pub state: crate::model::deployment::State,
60
61 /// Output only. Revision name that was most recently applied.
62 /// Format: `projects/{project}/locations/{location}/deployments/{deployment}/
63 /// revisions/{revision}`
64 pub latest_revision: std::string::String,
65
66 /// Output only. Additional information regarding the current state.
67 pub state_detail: std::string::String,
68
69 /// Output only. Error code describing errors that may have occurred.
70 pub error_code: crate::model::deployment::ErrorCode,
71
72 /// Output only. Location of artifacts from a DeleteDeployment operation.
73 pub delete_results: std::option::Option<crate::model::ApplyResults>,
74
75 /// Output only. Cloud Build instance UUID associated with deleting this
76 /// deployment.
77 pub delete_build: std::string::String,
78
79 /// Output only. Location of Cloud Build logs in Google Cloud Storage,
80 /// populated when deleting this deployment. Format: `gs://{bucket}/{object}`.
81 pub delete_logs: std::string::String,
82
83 /// Output only. Errors encountered when deleting this deployment.
84 /// Errors are truncated to 10 entries, see `delete_results` and `error_logs`
85 /// for full details.
86 pub tf_errors: std::vec::Vec<crate::model::TerraformError>,
87
88 /// Output only. Location of Terraform error logs in Google Cloud Storage.
89 /// Format: `gs://{bucket}/{object}`.
90 pub error_logs: std::string::String,
91
92 /// Optional. User-defined location of Cloud Build logs and artifacts in Google
93 /// Cloud Storage. Format: `gs://{bucket}/{folder}`
94 ///
95 /// A default bucket will be bootstrapped if the field is not set or empty.
96 /// Default bucket format: `gs://<project number>-<region>-blueprint-config`
97 /// Constraints:
98 ///
99 /// - The bucket needs to be in the same project as the deployment
100 /// - The path cannot be within the path of `gcs_source`
101 /// - The field cannot be updated, including changing its presence
102 pub artifacts_gcs_bucket: std::option::Option<std::string::String>,
103
104 /// Required. User-specified Service Account (SA) credentials to be used when
105 /// actuating resources.
106 /// Format: `projects/{projectID}/serviceAccounts/{serviceAccount}`
107 pub service_account: std::option::Option<std::string::String>,
108
109 /// By default, Infra Manager will return a failure when
110 /// Terraform encounters a 409 code (resource conflict error) during actuation.
111 /// If this flag is set to true, Infra Manager will instead
112 /// attempt to automatically import the resource into the Terraform state (for
113 /// supported resource types) and continue actuation.
114 ///
115 /// Not all resource types are supported, refer to documentation.
116 pub import_existing_resources: std::option::Option<bool>,
117
118 /// Optional. The user-specified Cloud Build worker pool resource in which the
119 /// Cloud Build job will execute. Format:
120 /// `projects/{project}/locations/{location}/workerPools/{workerPoolId}`.
121 /// If this field is unspecified, the default Cloud Build worker pool will be
122 /// used.
123 pub worker_pool: std::option::Option<std::string::String>,
124
125 /// Output only. Current lock state of the deployment.
126 pub lock_state: crate::model::deployment::LockState,
127
128 /// Optional. The user-specified Terraform version constraint.
129 /// Example: "=1.3.10".
130 pub tf_version_constraint: std::option::Option<std::string::String>,
131
132 /// Output only. The current Terraform version set on the deployment.
133 /// It is in the format of "Major.Minor.Patch", for example, "1.3.10".
134 pub tf_version: std::string::String,
135
136 /// Optional. Input to control quota checks for resources in terraform
137 /// configuration files. There are limited resources on which quota validation
138 /// applies.
139 pub quota_validation: crate::model::QuotaValidation,
140
141 /// Optional. Arbitrary key-value metadata storage e.g. to help client tools
142 /// identify deployments during automation. See
143 /// <https://google.aip.dev/148#annotations> for details on format and size
144 /// limitations.
145 pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
146
147 /// Optional. This field specifies the provider configurations.
148 pub provider_config: std::option::Option<crate::model::ProviderConfig>,
149
150 /// Blueprint to deploy.
151 pub blueprint: std::option::Option<crate::model::deployment::Blueprint>,
152
153 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
154}
155
156impl Deployment {
157 pub fn new() -> Self {
158 std::default::Default::default()
159 }
160
161 /// Sets the value of [name][crate::model::Deployment::name].
162 ///
163 /// # Example
164 /// ```ignore,no_run
165 /// # use google_cloud_config_v1::model::Deployment;
166 /// let x = Deployment::new().set_name("example");
167 /// ```
168 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
169 self.name = v.into();
170 self
171 }
172
173 /// Sets the value of [create_time][crate::model::Deployment::create_time].
174 ///
175 /// # Example
176 /// ```ignore,no_run
177 /// # use google_cloud_config_v1::model::Deployment;
178 /// use wkt::Timestamp;
179 /// let x = Deployment::new().set_create_time(Timestamp::default()/* use setters */);
180 /// ```
181 pub fn set_create_time<T>(mut self, v: T) -> Self
182 where
183 T: std::convert::Into<wkt::Timestamp>,
184 {
185 self.create_time = std::option::Option::Some(v.into());
186 self
187 }
188
189 /// Sets or clears the value of [create_time][crate::model::Deployment::create_time].
190 ///
191 /// # Example
192 /// ```ignore,no_run
193 /// # use google_cloud_config_v1::model::Deployment;
194 /// use wkt::Timestamp;
195 /// let x = Deployment::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
196 /// let x = Deployment::new().set_or_clear_create_time(None::<Timestamp>);
197 /// ```
198 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
199 where
200 T: std::convert::Into<wkt::Timestamp>,
201 {
202 self.create_time = v.map(|x| x.into());
203 self
204 }
205
206 /// Sets the value of [update_time][crate::model::Deployment::update_time].
207 ///
208 /// # Example
209 /// ```ignore,no_run
210 /// # use google_cloud_config_v1::model::Deployment;
211 /// use wkt::Timestamp;
212 /// let x = Deployment::new().set_update_time(Timestamp::default()/* use setters */);
213 /// ```
214 pub fn set_update_time<T>(mut self, v: T) -> Self
215 where
216 T: std::convert::Into<wkt::Timestamp>,
217 {
218 self.update_time = std::option::Option::Some(v.into());
219 self
220 }
221
222 /// Sets or clears the value of [update_time][crate::model::Deployment::update_time].
223 ///
224 /// # Example
225 /// ```ignore,no_run
226 /// # use google_cloud_config_v1::model::Deployment;
227 /// use wkt::Timestamp;
228 /// let x = Deployment::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
229 /// let x = Deployment::new().set_or_clear_update_time(None::<Timestamp>);
230 /// ```
231 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
232 where
233 T: std::convert::Into<wkt::Timestamp>,
234 {
235 self.update_time = v.map(|x| x.into());
236 self
237 }
238
239 /// Sets the value of [labels][crate::model::Deployment::labels].
240 ///
241 /// # Example
242 /// ```ignore,no_run
243 /// # use google_cloud_config_v1::model::Deployment;
244 /// let x = Deployment::new().set_labels([
245 /// ("key0", "abc"),
246 /// ("key1", "xyz"),
247 /// ]);
248 /// ```
249 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
250 where
251 T: std::iter::IntoIterator<Item = (K, V)>,
252 K: std::convert::Into<std::string::String>,
253 V: std::convert::Into<std::string::String>,
254 {
255 use std::iter::Iterator;
256 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
257 self
258 }
259
260 /// Sets the value of [state][crate::model::Deployment::state].
261 ///
262 /// # Example
263 /// ```ignore,no_run
264 /// # use google_cloud_config_v1::model::Deployment;
265 /// use google_cloud_config_v1::model::deployment::State;
266 /// let x0 = Deployment::new().set_state(State::Creating);
267 /// let x1 = Deployment::new().set_state(State::Active);
268 /// let x2 = Deployment::new().set_state(State::Updating);
269 /// ```
270 pub fn set_state<T: std::convert::Into<crate::model::deployment::State>>(
271 mut self,
272 v: T,
273 ) -> Self {
274 self.state = v.into();
275 self
276 }
277
278 /// Sets the value of [latest_revision][crate::model::Deployment::latest_revision].
279 ///
280 /// # Example
281 /// ```ignore,no_run
282 /// # use google_cloud_config_v1::model::Deployment;
283 /// let x = Deployment::new().set_latest_revision("example");
284 /// ```
285 pub fn set_latest_revision<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
286 self.latest_revision = v.into();
287 self
288 }
289
290 /// Sets the value of [state_detail][crate::model::Deployment::state_detail].
291 ///
292 /// # Example
293 /// ```ignore,no_run
294 /// # use google_cloud_config_v1::model::Deployment;
295 /// let x = Deployment::new().set_state_detail("example");
296 /// ```
297 pub fn set_state_detail<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
298 self.state_detail = v.into();
299 self
300 }
301
302 /// Sets the value of [error_code][crate::model::Deployment::error_code].
303 ///
304 /// # Example
305 /// ```ignore,no_run
306 /// # use google_cloud_config_v1::model::Deployment;
307 /// use google_cloud_config_v1::model::deployment::ErrorCode;
308 /// let x0 = Deployment::new().set_error_code(ErrorCode::RevisionFailed);
309 /// let x1 = Deployment::new().set_error_code(ErrorCode::CloudBuildPermissionDenied);
310 /// let x2 = Deployment::new().set_error_code(ErrorCode::DeleteBuildApiFailed);
311 /// ```
312 pub fn set_error_code<T: std::convert::Into<crate::model::deployment::ErrorCode>>(
313 mut self,
314 v: T,
315 ) -> Self {
316 self.error_code = v.into();
317 self
318 }
319
320 /// Sets the value of [delete_results][crate::model::Deployment::delete_results].
321 ///
322 /// # Example
323 /// ```ignore,no_run
324 /// # use google_cloud_config_v1::model::Deployment;
325 /// use google_cloud_config_v1::model::ApplyResults;
326 /// let x = Deployment::new().set_delete_results(ApplyResults::default()/* use setters */);
327 /// ```
328 pub fn set_delete_results<T>(mut self, v: T) -> Self
329 where
330 T: std::convert::Into<crate::model::ApplyResults>,
331 {
332 self.delete_results = std::option::Option::Some(v.into());
333 self
334 }
335
336 /// Sets or clears the value of [delete_results][crate::model::Deployment::delete_results].
337 ///
338 /// # Example
339 /// ```ignore,no_run
340 /// # use google_cloud_config_v1::model::Deployment;
341 /// use google_cloud_config_v1::model::ApplyResults;
342 /// let x = Deployment::new().set_or_clear_delete_results(Some(ApplyResults::default()/* use setters */));
343 /// let x = Deployment::new().set_or_clear_delete_results(None::<ApplyResults>);
344 /// ```
345 pub fn set_or_clear_delete_results<T>(mut self, v: std::option::Option<T>) -> Self
346 where
347 T: std::convert::Into<crate::model::ApplyResults>,
348 {
349 self.delete_results = v.map(|x| x.into());
350 self
351 }
352
353 /// Sets the value of [delete_build][crate::model::Deployment::delete_build].
354 ///
355 /// # Example
356 /// ```ignore,no_run
357 /// # use google_cloud_config_v1::model::Deployment;
358 /// let x = Deployment::new().set_delete_build("example");
359 /// ```
360 pub fn set_delete_build<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
361 self.delete_build = v.into();
362 self
363 }
364
365 /// Sets the value of [delete_logs][crate::model::Deployment::delete_logs].
366 ///
367 /// # Example
368 /// ```ignore,no_run
369 /// # use google_cloud_config_v1::model::Deployment;
370 /// let x = Deployment::new().set_delete_logs("example");
371 /// ```
372 pub fn set_delete_logs<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
373 self.delete_logs = v.into();
374 self
375 }
376
377 /// Sets the value of [tf_errors][crate::model::Deployment::tf_errors].
378 ///
379 /// # Example
380 /// ```ignore,no_run
381 /// # use google_cloud_config_v1::model::Deployment;
382 /// use google_cloud_config_v1::model::TerraformError;
383 /// let x = Deployment::new()
384 /// .set_tf_errors([
385 /// TerraformError::default()/* use setters */,
386 /// TerraformError::default()/* use (different) setters */,
387 /// ]);
388 /// ```
389 pub fn set_tf_errors<T, V>(mut self, v: T) -> Self
390 where
391 T: std::iter::IntoIterator<Item = V>,
392 V: std::convert::Into<crate::model::TerraformError>,
393 {
394 use std::iter::Iterator;
395 self.tf_errors = v.into_iter().map(|i| i.into()).collect();
396 self
397 }
398
399 /// Sets the value of [error_logs][crate::model::Deployment::error_logs].
400 ///
401 /// # Example
402 /// ```ignore,no_run
403 /// # use google_cloud_config_v1::model::Deployment;
404 /// let x = Deployment::new().set_error_logs("example");
405 /// ```
406 pub fn set_error_logs<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
407 self.error_logs = v.into();
408 self
409 }
410
411 /// Sets the value of [artifacts_gcs_bucket][crate::model::Deployment::artifacts_gcs_bucket].
412 ///
413 /// # Example
414 /// ```ignore,no_run
415 /// # use google_cloud_config_v1::model::Deployment;
416 /// let x = Deployment::new().set_artifacts_gcs_bucket("example");
417 /// ```
418 pub fn set_artifacts_gcs_bucket<T>(mut self, v: T) -> Self
419 where
420 T: std::convert::Into<std::string::String>,
421 {
422 self.artifacts_gcs_bucket = std::option::Option::Some(v.into());
423 self
424 }
425
426 /// Sets or clears the value of [artifacts_gcs_bucket][crate::model::Deployment::artifacts_gcs_bucket].
427 ///
428 /// # Example
429 /// ```ignore,no_run
430 /// # use google_cloud_config_v1::model::Deployment;
431 /// let x = Deployment::new().set_or_clear_artifacts_gcs_bucket(Some("example"));
432 /// let x = Deployment::new().set_or_clear_artifacts_gcs_bucket(None::<String>);
433 /// ```
434 pub fn set_or_clear_artifacts_gcs_bucket<T>(mut self, v: std::option::Option<T>) -> Self
435 where
436 T: std::convert::Into<std::string::String>,
437 {
438 self.artifacts_gcs_bucket = v.map(|x| x.into());
439 self
440 }
441
442 /// Sets the value of [service_account][crate::model::Deployment::service_account].
443 ///
444 /// # Example
445 /// ```ignore,no_run
446 /// # use google_cloud_config_v1::model::Deployment;
447 /// let x = Deployment::new().set_service_account("example");
448 /// ```
449 pub fn set_service_account<T>(mut self, v: T) -> Self
450 where
451 T: std::convert::Into<std::string::String>,
452 {
453 self.service_account = std::option::Option::Some(v.into());
454 self
455 }
456
457 /// Sets or clears the value of [service_account][crate::model::Deployment::service_account].
458 ///
459 /// # Example
460 /// ```ignore,no_run
461 /// # use google_cloud_config_v1::model::Deployment;
462 /// let x = Deployment::new().set_or_clear_service_account(Some("example"));
463 /// let x = Deployment::new().set_or_clear_service_account(None::<String>);
464 /// ```
465 pub fn set_or_clear_service_account<T>(mut self, v: std::option::Option<T>) -> Self
466 where
467 T: std::convert::Into<std::string::String>,
468 {
469 self.service_account = v.map(|x| x.into());
470 self
471 }
472
473 /// Sets the value of [import_existing_resources][crate::model::Deployment::import_existing_resources].
474 ///
475 /// # Example
476 /// ```ignore,no_run
477 /// # use google_cloud_config_v1::model::Deployment;
478 /// let x = Deployment::new().set_import_existing_resources(true);
479 /// ```
480 pub fn set_import_existing_resources<T>(mut self, v: T) -> Self
481 where
482 T: std::convert::Into<bool>,
483 {
484 self.import_existing_resources = std::option::Option::Some(v.into());
485 self
486 }
487
488 /// Sets or clears the value of [import_existing_resources][crate::model::Deployment::import_existing_resources].
489 ///
490 /// # Example
491 /// ```ignore,no_run
492 /// # use google_cloud_config_v1::model::Deployment;
493 /// let x = Deployment::new().set_or_clear_import_existing_resources(Some(false));
494 /// let x = Deployment::new().set_or_clear_import_existing_resources(None::<bool>);
495 /// ```
496 pub fn set_or_clear_import_existing_resources<T>(mut self, v: std::option::Option<T>) -> Self
497 where
498 T: std::convert::Into<bool>,
499 {
500 self.import_existing_resources = v.map(|x| x.into());
501 self
502 }
503
504 /// Sets the value of [worker_pool][crate::model::Deployment::worker_pool].
505 ///
506 /// # Example
507 /// ```ignore,no_run
508 /// # use google_cloud_config_v1::model::Deployment;
509 /// let x = Deployment::new().set_worker_pool("example");
510 /// ```
511 pub fn set_worker_pool<T>(mut self, v: T) -> Self
512 where
513 T: std::convert::Into<std::string::String>,
514 {
515 self.worker_pool = std::option::Option::Some(v.into());
516 self
517 }
518
519 /// Sets or clears the value of [worker_pool][crate::model::Deployment::worker_pool].
520 ///
521 /// # Example
522 /// ```ignore,no_run
523 /// # use google_cloud_config_v1::model::Deployment;
524 /// let x = Deployment::new().set_or_clear_worker_pool(Some("example"));
525 /// let x = Deployment::new().set_or_clear_worker_pool(None::<String>);
526 /// ```
527 pub fn set_or_clear_worker_pool<T>(mut self, v: std::option::Option<T>) -> Self
528 where
529 T: std::convert::Into<std::string::String>,
530 {
531 self.worker_pool = v.map(|x| x.into());
532 self
533 }
534
535 /// Sets the value of [lock_state][crate::model::Deployment::lock_state].
536 ///
537 /// # Example
538 /// ```ignore,no_run
539 /// # use google_cloud_config_v1::model::Deployment;
540 /// use google_cloud_config_v1::model::deployment::LockState;
541 /// let x0 = Deployment::new().set_lock_state(LockState::Locked);
542 /// let x1 = Deployment::new().set_lock_state(LockState::Unlocked);
543 /// let x2 = Deployment::new().set_lock_state(LockState::Locking);
544 /// ```
545 pub fn set_lock_state<T: std::convert::Into<crate::model::deployment::LockState>>(
546 mut self,
547 v: T,
548 ) -> Self {
549 self.lock_state = v.into();
550 self
551 }
552
553 /// Sets the value of [tf_version_constraint][crate::model::Deployment::tf_version_constraint].
554 ///
555 /// # Example
556 /// ```ignore,no_run
557 /// # use google_cloud_config_v1::model::Deployment;
558 /// let x = Deployment::new().set_tf_version_constraint("example");
559 /// ```
560 pub fn set_tf_version_constraint<T>(mut self, v: T) -> Self
561 where
562 T: std::convert::Into<std::string::String>,
563 {
564 self.tf_version_constraint = std::option::Option::Some(v.into());
565 self
566 }
567
568 /// Sets or clears the value of [tf_version_constraint][crate::model::Deployment::tf_version_constraint].
569 ///
570 /// # Example
571 /// ```ignore,no_run
572 /// # use google_cloud_config_v1::model::Deployment;
573 /// let x = Deployment::new().set_or_clear_tf_version_constraint(Some("example"));
574 /// let x = Deployment::new().set_or_clear_tf_version_constraint(None::<String>);
575 /// ```
576 pub fn set_or_clear_tf_version_constraint<T>(mut self, v: std::option::Option<T>) -> Self
577 where
578 T: std::convert::Into<std::string::String>,
579 {
580 self.tf_version_constraint = v.map(|x| x.into());
581 self
582 }
583
584 /// Sets the value of [tf_version][crate::model::Deployment::tf_version].
585 ///
586 /// # Example
587 /// ```ignore,no_run
588 /// # use google_cloud_config_v1::model::Deployment;
589 /// let x = Deployment::new().set_tf_version("example");
590 /// ```
591 pub fn set_tf_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
592 self.tf_version = v.into();
593 self
594 }
595
596 /// Sets the value of [quota_validation][crate::model::Deployment::quota_validation].
597 ///
598 /// # Example
599 /// ```ignore,no_run
600 /// # use google_cloud_config_v1::model::Deployment;
601 /// use google_cloud_config_v1::model::QuotaValidation;
602 /// let x0 = Deployment::new().set_quota_validation(QuotaValidation::Enabled);
603 /// let x1 = Deployment::new().set_quota_validation(QuotaValidation::Enforced);
604 /// ```
605 pub fn set_quota_validation<T: std::convert::Into<crate::model::QuotaValidation>>(
606 mut self,
607 v: T,
608 ) -> Self {
609 self.quota_validation = v.into();
610 self
611 }
612
613 /// Sets the value of [annotations][crate::model::Deployment::annotations].
614 ///
615 /// # Example
616 /// ```ignore,no_run
617 /// # use google_cloud_config_v1::model::Deployment;
618 /// let x = Deployment::new().set_annotations([
619 /// ("key0", "abc"),
620 /// ("key1", "xyz"),
621 /// ]);
622 /// ```
623 pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
624 where
625 T: std::iter::IntoIterator<Item = (K, V)>,
626 K: std::convert::Into<std::string::String>,
627 V: std::convert::Into<std::string::String>,
628 {
629 use std::iter::Iterator;
630 self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
631 self
632 }
633
634 /// Sets the value of [provider_config][crate::model::Deployment::provider_config].
635 ///
636 /// # Example
637 /// ```ignore,no_run
638 /// # use google_cloud_config_v1::model::Deployment;
639 /// use google_cloud_config_v1::model::ProviderConfig;
640 /// let x = Deployment::new().set_provider_config(ProviderConfig::default()/* use setters */);
641 /// ```
642 pub fn set_provider_config<T>(mut self, v: T) -> Self
643 where
644 T: std::convert::Into<crate::model::ProviderConfig>,
645 {
646 self.provider_config = std::option::Option::Some(v.into());
647 self
648 }
649
650 /// Sets or clears the value of [provider_config][crate::model::Deployment::provider_config].
651 ///
652 /// # Example
653 /// ```ignore,no_run
654 /// # use google_cloud_config_v1::model::Deployment;
655 /// use google_cloud_config_v1::model::ProviderConfig;
656 /// let x = Deployment::new().set_or_clear_provider_config(Some(ProviderConfig::default()/* use setters */));
657 /// let x = Deployment::new().set_or_clear_provider_config(None::<ProviderConfig>);
658 /// ```
659 pub fn set_or_clear_provider_config<T>(mut self, v: std::option::Option<T>) -> Self
660 where
661 T: std::convert::Into<crate::model::ProviderConfig>,
662 {
663 self.provider_config = v.map(|x| x.into());
664 self
665 }
666
667 /// Sets the value of [blueprint][crate::model::Deployment::blueprint].
668 ///
669 /// Note that all the setters affecting `blueprint` are mutually
670 /// exclusive.
671 ///
672 /// # Example
673 /// ```ignore,no_run
674 /// # use google_cloud_config_v1::model::Deployment;
675 /// use google_cloud_config_v1::model::TerraformBlueprint;
676 /// let x = Deployment::new().set_blueprint(Some(
677 /// google_cloud_config_v1::model::deployment::Blueprint::TerraformBlueprint(TerraformBlueprint::default().into())));
678 /// ```
679 pub fn set_blueprint<
680 T: std::convert::Into<std::option::Option<crate::model::deployment::Blueprint>>,
681 >(
682 mut self,
683 v: T,
684 ) -> Self {
685 self.blueprint = v.into();
686 self
687 }
688
689 /// The value of [blueprint][crate::model::Deployment::blueprint]
690 /// if it holds a `TerraformBlueprint`, `None` if the field is not set or
691 /// holds a different branch.
692 pub fn terraform_blueprint(
693 &self,
694 ) -> std::option::Option<&std::boxed::Box<crate::model::TerraformBlueprint>> {
695 #[allow(unreachable_patterns)]
696 self.blueprint.as_ref().and_then(|v| match v {
697 crate::model::deployment::Blueprint::TerraformBlueprint(v) => {
698 std::option::Option::Some(v)
699 }
700 _ => std::option::Option::None,
701 })
702 }
703
704 /// Sets the value of [blueprint][crate::model::Deployment::blueprint]
705 /// to hold a `TerraformBlueprint`.
706 ///
707 /// Note that all the setters affecting `blueprint` are
708 /// mutually exclusive.
709 ///
710 /// # Example
711 /// ```ignore,no_run
712 /// # use google_cloud_config_v1::model::Deployment;
713 /// use google_cloud_config_v1::model::TerraformBlueprint;
714 /// let x = Deployment::new().set_terraform_blueprint(TerraformBlueprint::default()/* use setters */);
715 /// assert!(x.terraform_blueprint().is_some());
716 /// ```
717 pub fn set_terraform_blueprint<
718 T: std::convert::Into<std::boxed::Box<crate::model::TerraformBlueprint>>,
719 >(
720 mut self,
721 v: T,
722 ) -> Self {
723 self.blueprint = std::option::Option::Some(
724 crate::model::deployment::Blueprint::TerraformBlueprint(v.into()),
725 );
726 self
727 }
728}
729
730impl wkt::message::Message for Deployment {
731 fn typename() -> &'static str {
732 "type.googleapis.com/google.cloud.config.v1.Deployment"
733 }
734}
735
736/// Defines additional types related to [Deployment].
737pub mod deployment {
738 #[allow(unused_imports)]
739 use super::*;
740
741 /// Possible states of a deployment.
742 ///
743 /// # Working with unknown values
744 ///
745 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
746 /// additional enum variants at any time. Adding new variants is not considered
747 /// a breaking change. Applications should write their code in anticipation of:
748 ///
749 /// - New values appearing in future releases of the client library, **and**
750 /// - New values received dynamically, without application changes.
751 ///
752 /// Please consult the [Working with enums] section in the user guide for some
753 /// guidelines.
754 ///
755 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
756 #[derive(Clone, Debug, PartialEq)]
757 #[non_exhaustive]
758 pub enum State {
759 /// The default value. This value is used if the state is omitted.
760 Unspecified,
761 /// The deployment is being created.
762 Creating,
763 /// The deployment is healthy.
764 Active,
765 /// The deployment is being updated.
766 Updating,
767 /// The deployment is being deleted.
768 Deleting,
769 /// The deployment has encountered an unexpected error.
770 Failed,
771 /// The deployment is no longer being actively reconciled.
772 /// This may be the result of recovering the project after deletion.
773 Suspended,
774 /// The deployment has been deleted.
775 Deleted,
776 /// If set, the enum was initialized with an unknown value.
777 ///
778 /// Applications can examine the value using [State::value] or
779 /// [State::name].
780 UnknownValue(state::UnknownValue),
781 }
782
783 #[doc(hidden)]
784 pub mod state {
785 #[allow(unused_imports)]
786 use super::*;
787 #[derive(Clone, Debug, PartialEq)]
788 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
789 }
790
791 impl State {
792 /// Gets the enum value.
793 ///
794 /// Returns `None` if the enum contains an unknown value deserialized from
795 /// the string representation of enums.
796 pub fn value(&self) -> std::option::Option<i32> {
797 match self {
798 Self::Unspecified => std::option::Option::Some(0),
799 Self::Creating => std::option::Option::Some(1),
800 Self::Active => std::option::Option::Some(2),
801 Self::Updating => std::option::Option::Some(3),
802 Self::Deleting => std::option::Option::Some(4),
803 Self::Failed => std::option::Option::Some(5),
804 Self::Suspended => std::option::Option::Some(6),
805 Self::Deleted => std::option::Option::Some(7),
806 Self::UnknownValue(u) => u.0.value(),
807 }
808 }
809
810 /// Gets the enum value as a string.
811 ///
812 /// Returns `None` if the enum contains an unknown value deserialized from
813 /// the integer representation of enums.
814 pub fn name(&self) -> std::option::Option<&str> {
815 match self {
816 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
817 Self::Creating => std::option::Option::Some("CREATING"),
818 Self::Active => std::option::Option::Some("ACTIVE"),
819 Self::Updating => std::option::Option::Some("UPDATING"),
820 Self::Deleting => std::option::Option::Some("DELETING"),
821 Self::Failed => std::option::Option::Some("FAILED"),
822 Self::Suspended => std::option::Option::Some("SUSPENDED"),
823 Self::Deleted => std::option::Option::Some("DELETED"),
824 Self::UnknownValue(u) => u.0.name(),
825 }
826 }
827 }
828
829 impl std::default::Default for State {
830 fn default() -> Self {
831 use std::convert::From;
832 Self::from(0)
833 }
834 }
835
836 impl std::fmt::Display for State {
837 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
838 wkt::internal::display_enum(f, self.name(), self.value())
839 }
840 }
841
842 impl std::convert::From<i32> for State {
843 fn from(value: i32) -> Self {
844 match value {
845 0 => Self::Unspecified,
846 1 => Self::Creating,
847 2 => Self::Active,
848 3 => Self::Updating,
849 4 => Self::Deleting,
850 5 => Self::Failed,
851 6 => Self::Suspended,
852 7 => Self::Deleted,
853 _ => Self::UnknownValue(state::UnknownValue(
854 wkt::internal::UnknownEnumValue::Integer(value),
855 )),
856 }
857 }
858 }
859
860 impl std::convert::From<&str> for State {
861 fn from(value: &str) -> Self {
862 use std::string::ToString;
863 match value {
864 "STATE_UNSPECIFIED" => Self::Unspecified,
865 "CREATING" => Self::Creating,
866 "ACTIVE" => Self::Active,
867 "UPDATING" => Self::Updating,
868 "DELETING" => Self::Deleting,
869 "FAILED" => Self::Failed,
870 "SUSPENDED" => Self::Suspended,
871 "DELETED" => Self::Deleted,
872 _ => Self::UnknownValue(state::UnknownValue(
873 wkt::internal::UnknownEnumValue::String(value.to_string()),
874 )),
875 }
876 }
877 }
878
879 impl serde::ser::Serialize for State {
880 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
881 where
882 S: serde::Serializer,
883 {
884 match self {
885 Self::Unspecified => serializer.serialize_i32(0),
886 Self::Creating => serializer.serialize_i32(1),
887 Self::Active => serializer.serialize_i32(2),
888 Self::Updating => serializer.serialize_i32(3),
889 Self::Deleting => serializer.serialize_i32(4),
890 Self::Failed => serializer.serialize_i32(5),
891 Self::Suspended => serializer.serialize_i32(6),
892 Self::Deleted => serializer.serialize_i32(7),
893 Self::UnknownValue(u) => u.0.serialize(serializer),
894 }
895 }
896 }
897
898 impl<'de> serde::de::Deserialize<'de> for State {
899 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
900 where
901 D: serde::Deserializer<'de>,
902 {
903 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
904 ".google.cloud.config.v1.Deployment.State",
905 ))
906 }
907 }
908
909 /// Possible errors that can occur with deployments.
910 ///
911 /// # Working with unknown values
912 ///
913 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
914 /// additional enum variants at any time. Adding new variants is not considered
915 /// a breaking change. Applications should write their code in anticipation of:
916 ///
917 /// - New values appearing in future releases of the client library, **and**
918 /// - New values received dynamically, without application changes.
919 ///
920 /// Please consult the [Working with enums] section in the user guide for some
921 /// guidelines.
922 ///
923 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
924 #[derive(Clone, Debug, PartialEq)]
925 #[non_exhaustive]
926 pub enum ErrorCode {
927 /// No error code was specified.
928 Unspecified,
929 /// The revision failed. See Revision for more details.
930 RevisionFailed,
931 /// Cloud Build failed due to a permission issue.
932 CloudBuildPermissionDenied,
933 /// Cloud Build job associated with a deployment deletion could not be
934 /// started.
935 DeleteBuildApiFailed,
936 /// Cloud Build job associated with a deployment deletion was started but
937 /// failed.
938 DeleteBuildRunFailed,
939 /// Cloud Storage bucket creation failed due to a permission issue.
940 BucketCreationPermissionDenied,
941 /// Cloud Storage bucket creation failed due to an issue unrelated to
942 /// permissions.
943 BucketCreationFailed,
944 /// Failed to import values from an external source.
945 ExternalValueSourceImportFailed,
946 /// If set, the enum was initialized with an unknown value.
947 ///
948 /// Applications can examine the value using [ErrorCode::value] or
949 /// [ErrorCode::name].
950 UnknownValue(error_code::UnknownValue),
951 }
952
953 #[doc(hidden)]
954 pub mod error_code {
955 #[allow(unused_imports)]
956 use super::*;
957 #[derive(Clone, Debug, PartialEq)]
958 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
959 }
960
961 impl ErrorCode {
962 /// Gets the enum value.
963 ///
964 /// Returns `None` if the enum contains an unknown value deserialized from
965 /// the string representation of enums.
966 pub fn value(&self) -> std::option::Option<i32> {
967 match self {
968 Self::Unspecified => std::option::Option::Some(0),
969 Self::RevisionFailed => std::option::Option::Some(1),
970 Self::CloudBuildPermissionDenied => std::option::Option::Some(3),
971 Self::DeleteBuildApiFailed => std::option::Option::Some(5),
972 Self::DeleteBuildRunFailed => std::option::Option::Some(6),
973 Self::BucketCreationPermissionDenied => std::option::Option::Some(7),
974 Self::BucketCreationFailed => std::option::Option::Some(8),
975 Self::ExternalValueSourceImportFailed => std::option::Option::Some(10),
976 Self::UnknownValue(u) => u.0.value(),
977 }
978 }
979
980 /// Gets the enum value as a string.
981 ///
982 /// Returns `None` if the enum contains an unknown value deserialized from
983 /// the integer representation of enums.
984 pub fn name(&self) -> std::option::Option<&str> {
985 match self {
986 Self::Unspecified => std::option::Option::Some("ERROR_CODE_UNSPECIFIED"),
987 Self::RevisionFailed => std::option::Option::Some("REVISION_FAILED"),
988 Self::CloudBuildPermissionDenied => {
989 std::option::Option::Some("CLOUD_BUILD_PERMISSION_DENIED")
990 }
991 Self::DeleteBuildApiFailed => std::option::Option::Some("DELETE_BUILD_API_FAILED"),
992 Self::DeleteBuildRunFailed => std::option::Option::Some("DELETE_BUILD_RUN_FAILED"),
993 Self::BucketCreationPermissionDenied => {
994 std::option::Option::Some("BUCKET_CREATION_PERMISSION_DENIED")
995 }
996 Self::BucketCreationFailed => std::option::Option::Some("BUCKET_CREATION_FAILED"),
997 Self::ExternalValueSourceImportFailed => {
998 std::option::Option::Some("EXTERNAL_VALUE_SOURCE_IMPORT_FAILED")
999 }
1000 Self::UnknownValue(u) => u.0.name(),
1001 }
1002 }
1003 }
1004
1005 impl std::default::Default for ErrorCode {
1006 fn default() -> Self {
1007 use std::convert::From;
1008 Self::from(0)
1009 }
1010 }
1011
1012 impl std::fmt::Display for ErrorCode {
1013 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1014 wkt::internal::display_enum(f, self.name(), self.value())
1015 }
1016 }
1017
1018 impl std::convert::From<i32> for ErrorCode {
1019 fn from(value: i32) -> Self {
1020 match value {
1021 0 => Self::Unspecified,
1022 1 => Self::RevisionFailed,
1023 3 => Self::CloudBuildPermissionDenied,
1024 5 => Self::DeleteBuildApiFailed,
1025 6 => Self::DeleteBuildRunFailed,
1026 7 => Self::BucketCreationPermissionDenied,
1027 8 => Self::BucketCreationFailed,
1028 10 => Self::ExternalValueSourceImportFailed,
1029 _ => Self::UnknownValue(error_code::UnknownValue(
1030 wkt::internal::UnknownEnumValue::Integer(value),
1031 )),
1032 }
1033 }
1034 }
1035
1036 impl std::convert::From<&str> for ErrorCode {
1037 fn from(value: &str) -> Self {
1038 use std::string::ToString;
1039 match value {
1040 "ERROR_CODE_UNSPECIFIED" => Self::Unspecified,
1041 "REVISION_FAILED" => Self::RevisionFailed,
1042 "CLOUD_BUILD_PERMISSION_DENIED" => Self::CloudBuildPermissionDenied,
1043 "DELETE_BUILD_API_FAILED" => Self::DeleteBuildApiFailed,
1044 "DELETE_BUILD_RUN_FAILED" => Self::DeleteBuildRunFailed,
1045 "BUCKET_CREATION_PERMISSION_DENIED" => Self::BucketCreationPermissionDenied,
1046 "BUCKET_CREATION_FAILED" => Self::BucketCreationFailed,
1047 "EXTERNAL_VALUE_SOURCE_IMPORT_FAILED" => Self::ExternalValueSourceImportFailed,
1048 _ => Self::UnknownValue(error_code::UnknownValue(
1049 wkt::internal::UnknownEnumValue::String(value.to_string()),
1050 )),
1051 }
1052 }
1053 }
1054
1055 impl serde::ser::Serialize for ErrorCode {
1056 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1057 where
1058 S: serde::Serializer,
1059 {
1060 match self {
1061 Self::Unspecified => serializer.serialize_i32(0),
1062 Self::RevisionFailed => serializer.serialize_i32(1),
1063 Self::CloudBuildPermissionDenied => serializer.serialize_i32(3),
1064 Self::DeleteBuildApiFailed => serializer.serialize_i32(5),
1065 Self::DeleteBuildRunFailed => serializer.serialize_i32(6),
1066 Self::BucketCreationPermissionDenied => serializer.serialize_i32(7),
1067 Self::BucketCreationFailed => serializer.serialize_i32(8),
1068 Self::ExternalValueSourceImportFailed => serializer.serialize_i32(10),
1069 Self::UnknownValue(u) => u.0.serialize(serializer),
1070 }
1071 }
1072 }
1073
1074 impl<'de> serde::de::Deserialize<'de> for ErrorCode {
1075 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1076 where
1077 D: serde::Deserializer<'de>,
1078 {
1079 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ErrorCode>::new(
1080 ".google.cloud.config.v1.Deployment.ErrorCode",
1081 ))
1082 }
1083 }
1084
1085 /// Possible lock states of a deployment.
1086 ///
1087 /// # Working with unknown values
1088 ///
1089 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1090 /// additional enum variants at any time. Adding new variants is not considered
1091 /// a breaking change. Applications should write their code in anticipation of:
1092 ///
1093 /// - New values appearing in future releases of the client library, **and**
1094 /// - New values received dynamically, without application changes.
1095 ///
1096 /// Please consult the [Working with enums] section in the user guide for some
1097 /// guidelines.
1098 ///
1099 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
1100 #[derive(Clone, Debug, PartialEq)]
1101 #[non_exhaustive]
1102 pub enum LockState {
1103 /// The default value. This value is used if the lock state is omitted.
1104 Unspecified,
1105 /// The deployment is locked.
1106 Locked,
1107 /// The deployment is unlocked.
1108 Unlocked,
1109 /// The deployment is being locked.
1110 Locking,
1111 /// The deployment is being unlocked.
1112 Unlocking,
1113 /// The deployment has failed to lock.
1114 LockFailed,
1115 /// The deployment has failed to unlock.
1116 UnlockFailed,
1117 /// If set, the enum was initialized with an unknown value.
1118 ///
1119 /// Applications can examine the value using [LockState::value] or
1120 /// [LockState::name].
1121 UnknownValue(lock_state::UnknownValue),
1122 }
1123
1124 #[doc(hidden)]
1125 pub mod lock_state {
1126 #[allow(unused_imports)]
1127 use super::*;
1128 #[derive(Clone, Debug, PartialEq)]
1129 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1130 }
1131
1132 impl LockState {
1133 /// Gets the enum value.
1134 ///
1135 /// Returns `None` if the enum contains an unknown value deserialized from
1136 /// the string representation of enums.
1137 pub fn value(&self) -> std::option::Option<i32> {
1138 match self {
1139 Self::Unspecified => std::option::Option::Some(0),
1140 Self::Locked => std::option::Option::Some(1),
1141 Self::Unlocked => std::option::Option::Some(2),
1142 Self::Locking => std::option::Option::Some(3),
1143 Self::Unlocking => std::option::Option::Some(4),
1144 Self::LockFailed => std::option::Option::Some(5),
1145 Self::UnlockFailed => std::option::Option::Some(6),
1146 Self::UnknownValue(u) => u.0.value(),
1147 }
1148 }
1149
1150 /// Gets the enum value as a string.
1151 ///
1152 /// Returns `None` if the enum contains an unknown value deserialized from
1153 /// the integer representation of enums.
1154 pub fn name(&self) -> std::option::Option<&str> {
1155 match self {
1156 Self::Unspecified => std::option::Option::Some("LOCK_STATE_UNSPECIFIED"),
1157 Self::Locked => std::option::Option::Some("LOCKED"),
1158 Self::Unlocked => std::option::Option::Some("UNLOCKED"),
1159 Self::Locking => std::option::Option::Some("LOCKING"),
1160 Self::Unlocking => std::option::Option::Some("UNLOCKING"),
1161 Self::LockFailed => std::option::Option::Some("LOCK_FAILED"),
1162 Self::UnlockFailed => std::option::Option::Some("UNLOCK_FAILED"),
1163 Self::UnknownValue(u) => u.0.name(),
1164 }
1165 }
1166 }
1167
1168 impl std::default::Default for LockState {
1169 fn default() -> Self {
1170 use std::convert::From;
1171 Self::from(0)
1172 }
1173 }
1174
1175 impl std::fmt::Display for LockState {
1176 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1177 wkt::internal::display_enum(f, self.name(), self.value())
1178 }
1179 }
1180
1181 impl std::convert::From<i32> for LockState {
1182 fn from(value: i32) -> Self {
1183 match value {
1184 0 => Self::Unspecified,
1185 1 => Self::Locked,
1186 2 => Self::Unlocked,
1187 3 => Self::Locking,
1188 4 => Self::Unlocking,
1189 5 => Self::LockFailed,
1190 6 => Self::UnlockFailed,
1191 _ => Self::UnknownValue(lock_state::UnknownValue(
1192 wkt::internal::UnknownEnumValue::Integer(value),
1193 )),
1194 }
1195 }
1196 }
1197
1198 impl std::convert::From<&str> for LockState {
1199 fn from(value: &str) -> Self {
1200 use std::string::ToString;
1201 match value {
1202 "LOCK_STATE_UNSPECIFIED" => Self::Unspecified,
1203 "LOCKED" => Self::Locked,
1204 "UNLOCKED" => Self::Unlocked,
1205 "LOCKING" => Self::Locking,
1206 "UNLOCKING" => Self::Unlocking,
1207 "LOCK_FAILED" => Self::LockFailed,
1208 "UNLOCK_FAILED" => Self::UnlockFailed,
1209 _ => Self::UnknownValue(lock_state::UnknownValue(
1210 wkt::internal::UnknownEnumValue::String(value.to_string()),
1211 )),
1212 }
1213 }
1214 }
1215
1216 impl serde::ser::Serialize for LockState {
1217 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1218 where
1219 S: serde::Serializer,
1220 {
1221 match self {
1222 Self::Unspecified => serializer.serialize_i32(0),
1223 Self::Locked => serializer.serialize_i32(1),
1224 Self::Unlocked => serializer.serialize_i32(2),
1225 Self::Locking => serializer.serialize_i32(3),
1226 Self::Unlocking => serializer.serialize_i32(4),
1227 Self::LockFailed => serializer.serialize_i32(5),
1228 Self::UnlockFailed => serializer.serialize_i32(6),
1229 Self::UnknownValue(u) => u.0.serialize(serializer),
1230 }
1231 }
1232 }
1233
1234 impl<'de> serde::de::Deserialize<'de> for LockState {
1235 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1236 where
1237 D: serde::Deserializer<'de>,
1238 {
1239 deserializer.deserialize_any(wkt::internal::EnumVisitor::<LockState>::new(
1240 ".google.cloud.config.v1.Deployment.LockState",
1241 ))
1242 }
1243 }
1244
1245 /// Blueprint to deploy.
1246 #[derive(Clone, Debug, PartialEq)]
1247 #[non_exhaustive]
1248 pub enum Blueprint {
1249 /// A blueprint described using Terraform's HashiCorp Configuration Language
1250 /// as a root module.
1251 TerraformBlueprint(std::boxed::Box<crate::model::TerraformBlueprint>),
1252 }
1253}
1254
1255/// TerraformBlueprint describes the source of a Terraform root module which
1256/// describes the resources and configs to be deployed.
1257#[derive(Clone, Default, PartialEq)]
1258#[non_exhaustive]
1259pub struct TerraformBlueprint {
1260 /// Optional. Input variable values for the Terraform blueprint.
1261 pub input_values:
1262 std::collections::HashMap<std::string::String, crate::model::TerraformVariable>,
1263
1264 /// Location of the source configs.
1265 /// Required.
1266 pub source: std::option::Option<crate::model::terraform_blueprint::Source>,
1267
1268 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1269}
1270
1271impl TerraformBlueprint {
1272 pub fn new() -> Self {
1273 std::default::Default::default()
1274 }
1275
1276 /// Sets the value of [input_values][crate::model::TerraformBlueprint::input_values].
1277 ///
1278 /// # Example
1279 /// ```ignore,no_run
1280 /// # use google_cloud_config_v1::model::TerraformBlueprint;
1281 /// use google_cloud_config_v1::model::TerraformVariable;
1282 /// let x = TerraformBlueprint::new().set_input_values([
1283 /// ("key0", TerraformVariable::default()/* use setters */),
1284 /// ("key1", TerraformVariable::default()/* use (different) setters */),
1285 /// ]);
1286 /// ```
1287 pub fn set_input_values<T, K, V>(mut self, v: T) -> Self
1288 where
1289 T: std::iter::IntoIterator<Item = (K, V)>,
1290 K: std::convert::Into<std::string::String>,
1291 V: std::convert::Into<crate::model::TerraformVariable>,
1292 {
1293 use std::iter::Iterator;
1294 self.input_values = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1295 self
1296 }
1297
1298 /// Sets the value of [source][crate::model::TerraformBlueprint::source].
1299 ///
1300 /// Note that all the setters affecting `source` are mutually
1301 /// exclusive.
1302 ///
1303 /// # Example
1304 /// ```ignore,no_run
1305 /// # use google_cloud_config_v1::model::TerraformBlueprint;
1306 /// use google_cloud_config_v1::model::terraform_blueprint::Source;
1307 /// let x = TerraformBlueprint::new().set_source(Some(Source::GcsSource("example".to_string())));
1308 /// ```
1309 pub fn set_source<
1310 T: std::convert::Into<std::option::Option<crate::model::terraform_blueprint::Source>>,
1311 >(
1312 mut self,
1313 v: T,
1314 ) -> Self {
1315 self.source = v.into();
1316 self
1317 }
1318
1319 /// The value of [source][crate::model::TerraformBlueprint::source]
1320 /// if it holds a `GcsSource`, `None` if the field is not set or
1321 /// holds a different branch.
1322 pub fn gcs_source(&self) -> std::option::Option<&std::string::String> {
1323 #[allow(unreachable_patterns)]
1324 self.source.as_ref().and_then(|v| match v {
1325 crate::model::terraform_blueprint::Source::GcsSource(v) => std::option::Option::Some(v),
1326 _ => std::option::Option::None,
1327 })
1328 }
1329
1330 /// Sets the value of [source][crate::model::TerraformBlueprint::source]
1331 /// to hold a `GcsSource`.
1332 ///
1333 /// Note that all the setters affecting `source` are
1334 /// mutually exclusive.
1335 ///
1336 /// # Example
1337 /// ```ignore,no_run
1338 /// # use google_cloud_config_v1::model::TerraformBlueprint;
1339 /// let x = TerraformBlueprint::new().set_gcs_source("example");
1340 /// assert!(x.gcs_source().is_some());
1341 /// assert!(x.git_source().is_none());
1342 /// ```
1343 pub fn set_gcs_source<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1344 self.source = std::option::Option::Some(
1345 crate::model::terraform_blueprint::Source::GcsSource(v.into()),
1346 );
1347 self
1348 }
1349
1350 /// The value of [source][crate::model::TerraformBlueprint::source]
1351 /// if it holds a `GitSource`, `None` if the field is not set or
1352 /// holds a different branch.
1353 pub fn git_source(&self) -> std::option::Option<&std::boxed::Box<crate::model::GitSource>> {
1354 #[allow(unreachable_patterns)]
1355 self.source.as_ref().and_then(|v| match v {
1356 crate::model::terraform_blueprint::Source::GitSource(v) => std::option::Option::Some(v),
1357 _ => std::option::Option::None,
1358 })
1359 }
1360
1361 /// Sets the value of [source][crate::model::TerraformBlueprint::source]
1362 /// to hold a `GitSource`.
1363 ///
1364 /// Note that all the setters affecting `source` are
1365 /// mutually exclusive.
1366 ///
1367 /// # Example
1368 /// ```ignore,no_run
1369 /// # use google_cloud_config_v1::model::TerraformBlueprint;
1370 /// use google_cloud_config_v1::model::GitSource;
1371 /// let x = TerraformBlueprint::new().set_git_source(GitSource::default()/* use setters */);
1372 /// assert!(x.git_source().is_some());
1373 /// assert!(x.gcs_source().is_none());
1374 /// ```
1375 pub fn set_git_source<T: std::convert::Into<std::boxed::Box<crate::model::GitSource>>>(
1376 mut self,
1377 v: T,
1378 ) -> Self {
1379 self.source = std::option::Option::Some(
1380 crate::model::terraform_blueprint::Source::GitSource(v.into()),
1381 );
1382 self
1383 }
1384}
1385
1386impl wkt::message::Message for TerraformBlueprint {
1387 fn typename() -> &'static str {
1388 "type.googleapis.com/google.cloud.config.v1.TerraformBlueprint"
1389 }
1390}
1391
1392/// Defines additional types related to [TerraformBlueprint].
1393pub mod terraform_blueprint {
1394 #[allow(unused_imports)]
1395 use super::*;
1396
1397 /// Location of the source configs.
1398 /// Required.
1399 #[derive(Clone, Debug, PartialEq)]
1400 #[non_exhaustive]
1401 pub enum Source {
1402 /// URI of an object in Google Cloud Storage.
1403 /// Format: `gs://{bucket}/{object}`
1404 ///
1405 /// URI may also specify an object version for zipped objects.
1406 /// Format: `gs://{bucket}/{object}#{version}`
1407 GcsSource(std::string::String),
1408 /// URI of a public Git repo.
1409 GitSource(std::boxed::Box<crate::model::GitSource>),
1410 }
1411}
1412
1413/// A Terraform input variable.
1414#[derive(Clone, Default, PartialEq)]
1415#[non_exhaustive]
1416pub struct TerraformVariable {
1417 /// Optional. Input variable value.
1418 pub input_value: std::option::Option<wkt::Value>,
1419
1420 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1421}
1422
1423impl TerraformVariable {
1424 pub fn new() -> Self {
1425 std::default::Default::default()
1426 }
1427
1428 /// Sets the value of [input_value][crate::model::TerraformVariable::input_value].
1429 ///
1430 /// # Example
1431 /// ```ignore,no_run
1432 /// # use google_cloud_config_v1::model::TerraformVariable;
1433 /// use wkt::Value;
1434 /// let x = TerraformVariable::new().set_input_value(Value::default()/* use setters */);
1435 /// ```
1436 pub fn set_input_value<T>(mut self, v: T) -> Self
1437 where
1438 T: std::convert::Into<wkt::Value>,
1439 {
1440 self.input_value = std::option::Option::Some(v.into());
1441 self
1442 }
1443
1444 /// Sets or clears the value of [input_value][crate::model::TerraformVariable::input_value].
1445 ///
1446 /// # Example
1447 /// ```ignore,no_run
1448 /// # use google_cloud_config_v1::model::TerraformVariable;
1449 /// use wkt::Value;
1450 /// let x = TerraformVariable::new().set_or_clear_input_value(Some(Value::default()/* use setters */));
1451 /// let x = TerraformVariable::new().set_or_clear_input_value(None::<Value>);
1452 /// ```
1453 pub fn set_or_clear_input_value<T>(mut self, v: std::option::Option<T>) -> Self
1454 where
1455 T: std::convert::Into<wkt::Value>,
1456 {
1457 self.input_value = v.map(|x| x.into());
1458 self
1459 }
1460}
1461
1462impl wkt::message::Message for TerraformVariable {
1463 fn typename() -> &'static str {
1464 "type.googleapis.com/google.cloud.config.v1.TerraformVariable"
1465 }
1466}
1467
1468/// Outputs and artifacts from applying a deployment.
1469#[derive(Clone, Default, PartialEq)]
1470#[non_exhaustive]
1471pub struct ApplyResults {
1472 /// Location of a blueprint copy and other manifests in Google Cloud Storage.
1473 /// Format: `gs://{bucket}/{object}`
1474 pub content: std::string::String,
1475
1476 /// Location of artifacts (e.g. logs) in Google Cloud Storage.
1477 /// Format: `gs://{bucket}/{object}`
1478 pub artifacts: std::string::String,
1479
1480 /// Map of output name to output info.
1481 pub outputs: std::collections::HashMap<std::string::String, crate::model::TerraformOutput>,
1482
1483 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1484}
1485
1486impl ApplyResults {
1487 pub fn new() -> Self {
1488 std::default::Default::default()
1489 }
1490
1491 /// Sets the value of [content][crate::model::ApplyResults::content].
1492 ///
1493 /// # Example
1494 /// ```ignore,no_run
1495 /// # use google_cloud_config_v1::model::ApplyResults;
1496 /// let x = ApplyResults::new().set_content("example");
1497 /// ```
1498 pub fn set_content<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1499 self.content = v.into();
1500 self
1501 }
1502
1503 /// Sets the value of [artifacts][crate::model::ApplyResults::artifacts].
1504 ///
1505 /// # Example
1506 /// ```ignore,no_run
1507 /// # use google_cloud_config_v1::model::ApplyResults;
1508 /// let x = ApplyResults::new().set_artifacts("example");
1509 /// ```
1510 pub fn set_artifacts<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1511 self.artifacts = v.into();
1512 self
1513 }
1514
1515 /// Sets the value of [outputs][crate::model::ApplyResults::outputs].
1516 ///
1517 /// # Example
1518 /// ```ignore,no_run
1519 /// # use google_cloud_config_v1::model::ApplyResults;
1520 /// use google_cloud_config_v1::model::TerraformOutput;
1521 /// let x = ApplyResults::new().set_outputs([
1522 /// ("key0", TerraformOutput::default()/* use setters */),
1523 /// ("key1", TerraformOutput::default()/* use (different) setters */),
1524 /// ]);
1525 /// ```
1526 pub fn set_outputs<T, K, V>(mut self, v: T) -> Self
1527 where
1528 T: std::iter::IntoIterator<Item = (K, V)>,
1529 K: std::convert::Into<std::string::String>,
1530 V: std::convert::Into<crate::model::TerraformOutput>,
1531 {
1532 use std::iter::Iterator;
1533 self.outputs = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1534 self
1535 }
1536}
1537
1538impl wkt::message::Message for ApplyResults {
1539 fn typename() -> &'static str {
1540 "type.googleapis.com/google.cloud.config.v1.ApplyResults"
1541 }
1542}
1543
1544/// Describes a Terraform output.
1545#[derive(Clone, Default, PartialEq)]
1546#[non_exhaustive]
1547pub struct TerraformOutput {
1548 /// Identifies whether Terraform has set this output as a potential
1549 /// sensitive value.
1550 pub sensitive: bool,
1551
1552 /// Value of output.
1553 pub value: std::option::Option<wkt::Value>,
1554
1555 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1556}
1557
1558impl TerraformOutput {
1559 pub fn new() -> Self {
1560 std::default::Default::default()
1561 }
1562
1563 /// Sets the value of [sensitive][crate::model::TerraformOutput::sensitive].
1564 ///
1565 /// # Example
1566 /// ```ignore,no_run
1567 /// # use google_cloud_config_v1::model::TerraformOutput;
1568 /// let x = TerraformOutput::new().set_sensitive(true);
1569 /// ```
1570 pub fn set_sensitive<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1571 self.sensitive = v.into();
1572 self
1573 }
1574
1575 /// Sets the value of [value][crate::model::TerraformOutput::value].
1576 ///
1577 /// # Example
1578 /// ```ignore,no_run
1579 /// # use google_cloud_config_v1::model::TerraformOutput;
1580 /// use wkt::Value;
1581 /// let x = TerraformOutput::new().set_value(Value::default()/* use setters */);
1582 /// ```
1583 pub fn set_value<T>(mut self, v: T) -> Self
1584 where
1585 T: std::convert::Into<wkt::Value>,
1586 {
1587 self.value = std::option::Option::Some(v.into());
1588 self
1589 }
1590
1591 /// Sets or clears the value of [value][crate::model::TerraformOutput::value].
1592 ///
1593 /// # Example
1594 /// ```ignore,no_run
1595 /// # use google_cloud_config_v1::model::TerraformOutput;
1596 /// use wkt::Value;
1597 /// let x = TerraformOutput::new().set_or_clear_value(Some(Value::default()/* use setters */));
1598 /// let x = TerraformOutput::new().set_or_clear_value(None::<Value>);
1599 /// ```
1600 pub fn set_or_clear_value<T>(mut self, v: std::option::Option<T>) -> Self
1601 where
1602 T: std::convert::Into<wkt::Value>,
1603 {
1604 self.value = v.map(|x| x.into());
1605 self
1606 }
1607}
1608
1609impl wkt::message::Message for TerraformOutput {
1610 fn typename() -> &'static str {
1611 "type.googleapis.com/google.cloud.config.v1.TerraformOutput"
1612 }
1613}
1614
1615#[derive(Clone, Default, PartialEq)]
1616#[non_exhaustive]
1617pub struct ListDeploymentsRequest {
1618 /// Required. The parent in whose context the Deployments are listed. The
1619 /// parent value is in the format:
1620 /// 'projects/{project_id}/locations/{location}'.
1621 pub parent: std::string::String,
1622
1623 /// When requesting a page of resources, 'page_size' specifies number of
1624 /// resources to return. If unspecified, at most 500 will be returned. The
1625 /// maximum value is 1000.
1626 pub page_size: i32,
1627
1628 /// Token returned by previous call to 'ListDeployments' which specifies the
1629 /// position in the list from where to continue listing the resources.
1630 pub page_token: std::string::String,
1631
1632 /// Lists the Deployments that match the filter expression. A filter
1633 /// expression filters the resources listed in the response. The expression
1634 /// must be of the form '{field} {operator} {value}' where operators: '<', '>',
1635 /// '<=', '>=', '!=', '=', ':' are supported (colon ':' represents a HAS
1636 /// operator which is roughly synonymous with equality). {field} can refer to a
1637 /// proto or JSON field, or a synthetic field. Field names can be camelCase or
1638 /// snake_case.
1639 ///
1640 /// Examples:
1641 ///
1642 /// - Filter by name:
1643 /// name = "projects/foo/locations/us-central1/deployments/bar
1644 ///
1645 /// - Filter by labels:
1646 ///
1647 /// - Resources that have a key called 'foo'
1648 /// labels.foo:*
1649 /// - Resources that have a key called 'foo' whose value is 'bar'
1650 /// labels.foo = bar
1651 /// - Filter by state:
1652 ///
1653 /// - Deployments in CREATING state.
1654 /// state=CREATING
1655 pub filter: std::string::String,
1656
1657 /// Field to use to sort the list.
1658 pub order_by: std::string::String,
1659
1660 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1661}
1662
1663impl ListDeploymentsRequest {
1664 pub fn new() -> Self {
1665 std::default::Default::default()
1666 }
1667
1668 /// Sets the value of [parent][crate::model::ListDeploymentsRequest::parent].
1669 ///
1670 /// # Example
1671 /// ```ignore,no_run
1672 /// # use google_cloud_config_v1::model::ListDeploymentsRequest;
1673 /// let x = ListDeploymentsRequest::new().set_parent("example");
1674 /// ```
1675 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1676 self.parent = v.into();
1677 self
1678 }
1679
1680 /// Sets the value of [page_size][crate::model::ListDeploymentsRequest::page_size].
1681 ///
1682 /// # Example
1683 /// ```ignore,no_run
1684 /// # use google_cloud_config_v1::model::ListDeploymentsRequest;
1685 /// let x = ListDeploymentsRequest::new().set_page_size(42);
1686 /// ```
1687 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1688 self.page_size = v.into();
1689 self
1690 }
1691
1692 /// Sets the value of [page_token][crate::model::ListDeploymentsRequest::page_token].
1693 ///
1694 /// # Example
1695 /// ```ignore,no_run
1696 /// # use google_cloud_config_v1::model::ListDeploymentsRequest;
1697 /// let x = ListDeploymentsRequest::new().set_page_token("example");
1698 /// ```
1699 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1700 self.page_token = v.into();
1701 self
1702 }
1703
1704 /// Sets the value of [filter][crate::model::ListDeploymentsRequest::filter].
1705 ///
1706 /// # Example
1707 /// ```ignore,no_run
1708 /// # use google_cloud_config_v1::model::ListDeploymentsRequest;
1709 /// let x = ListDeploymentsRequest::new().set_filter("example");
1710 /// ```
1711 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1712 self.filter = v.into();
1713 self
1714 }
1715
1716 /// Sets the value of [order_by][crate::model::ListDeploymentsRequest::order_by].
1717 ///
1718 /// # Example
1719 /// ```ignore,no_run
1720 /// # use google_cloud_config_v1::model::ListDeploymentsRequest;
1721 /// let x = ListDeploymentsRequest::new().set_order_by("example");
1722 /// ```
1723 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1724 self.order_by = v.into();
1725 self
1726 }
1727}
1728
1729impl wkt::message::Message for ListDeploymentsRequest {
1730 fn typename() -> &'static str {
1731 "type.googleapis.com/google.cloud.config.v1.ListDeploymentsRequest"
1732 }
1733}
1734
1735#[derive(Clone, Default, PartialEq)]
1736#[non_exhaustive]
1737pub struct ListDeploymentsResponse {
1738 /// List of [Deployment][google.cloud.config.v1.Deployment]s.
1739 ///
1740 /// [google.cloud.config.v1.Deployment]: crate::model::Deployment
1741 pub deployments: std::vec::Vec<crate::model::Deployment>,
1742
1743 /// Token to be supplied to the next ListDeployments request via `page_token`
1744 /// to obtain the next set of results.
1745 pub next_page_token: std::string::String,
1746
1747 /// Locations that could not be reached.
1748 pub unreachable: std::vec::Vec<std::string::String>,
1749
1750 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1751}
1752
1753impl ListDeploymentsResponse {
1754 pub fn new() -> Self {
1755 std::default::Default::default()
1756 }
1757
1758 /// Sets the value of [deployments][crate::model::ListDeploymentsResponse::deployments].
1759 ///
1760 /// # Example
1761 /// ```ignore,no_run
1762 /// # use google_cloud_config_v1::model::ListDeploymentsResponse;
1763 /// use google_cloud_config_v1::model::Deployment;
1764 /// let x = ListDeploymentsResponse::new()
1765 /// .set_deployments([
1766 /// Deployment::default()/* use setters */,
1767 /// Deployment::default()/* use (different) setters */,
1768 /// ]);
1769 /// ```
1770 pub fn set_deployments<T, V>(mut self, v: T) -> Self
1771 where
1772 T: std::iter::IntoIterator<Item = V>,
1773 V: std::convert::Into<crate::model::Deployment>,
1774 {
1775 use std::iter::Iterator;
1776 self.deployments = v.into_iter().map(|i| i.into()).collect();
1777 self
1778 }
1779
1780 /// Sets the value of [next_page_token][crate::model::ListDeploymentsResponse::next_page_token].
1781 ///
1782 /// # Example
1783 /// ```ignore,no_run
1784 /// # use google_cloud_config_v1::model::ListDeploymentsResponse;
1785 /// let x = ListDeploymentsResponse::new().set_next_page_token("example");
1786 /// ```
1787 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1788 self.next_page_token = v.into();
1789 self
1790 }
1791
1792 /// Sets the value of [unreachable][crate::model::ListDeploymentsResponse::unreachable].
1793 ///
1794 /// # Example
1795 /// ```ignore,no_run
1796 /// # use google_cloud_config_v1::model::ListDeploymentsResponse;
1797 /// let x = ListDeploymentsResponse::new().set_unreachable(["a", "b", "c"]);
1798 /// ```
1799 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
1800 where
1801 T: std::iter::IntoIterator<Item = V>,
1802 V: std::convert::Into<std::string::String>,
1803 {
1804 use std::iter::Iterator;
1805 self.unreachable = v.into_iter().map(|i| i.into()).collect();
1806 self
1807 }
1808}
1809
1810impl wkt::message::Message for ListDeploymentsResponse {
1811 fn typename() -> &'static str {
1812 "type.googleapis.com/google.cloud.config.v1.ListDeploymentsResponse"
1813 }
1814}
1815
1816#[doc(hidden)]
1817impl google_cloud_gax::paginator::internal::PageableResponse for ListDeploymentsResponse {
1818 type PageItem = crate::model::Deployment;
1819
1820 fn items(self) -> std::vec::Vec<Self::PageItem> {
1821 self.deployments
1822 }
1823
1824 fn next_page_token(&self) -> std::string::String {
1825 use std::clone::Clone;
1826 self.next_page_token.clone()
1827 }
1828}
1829
1830#[derive(Clone, Default, PartialEq)]
1831#[non_exhaustive]
1832pub struct GetDeploymentRequest {
1833 /// Required. The name of the deployment. Format:
1834 /// 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
1835 pub name: std::string::String,
1836
1837 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1838}
1839
1840impl GetDeploymentRequest {
1841 pub fn new() -> Self {
1842 std::default::Default::default()
1843 }
1844
1845 /// Sets the value of [name][crate::model::GetDeploymentRequest::name].
1846 ///
1847 /// # Example
1848 /// ```ignore,no_run
1849 /// # use google_cloud_config_v1::model::GetDeploymentRequest;
1850 /// let x = GetDeploymentRequest::new().set_name("example");
1851 /// ```
1852 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1853 self.name = v.into();
1854 self
1855 }
1856}
1857
1858impl wkt::message::Message for GetDeploymentRequest {
1859 fn typename() -> &'static str {
1860 "type.googleapis.com/google.cloud.config.v1.GetDeploymentRequest"
1861 }
1862}
1863
1864/// A request to list Revisions passed to a 'ListRevisions' call.
1865#[derive(Clone, Default, PartialEq)]
1866#[non_exhaustive]
1867pub struct ListRevisionsRequest {
1868 /// Required. The parent in whose context the Revisions are listed. The parent
1869 /// value is in the format:
1870 /// 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
1871 pub parent: std::string::String,
1872
1873 /// When requesting a page of resources, `page_size` specifies number of
1874 /// resources to return. If unspecified, at most 500 will be returned. The
1875 /// maximum value is 1000.
1876 pub page_size: i32,
1877
1878 /// Token returned by previous call to 'ListRevisions' which specifies the
1879 /// position in the list from where to continue listing the resources.
1880 pub page_token: std::string::String,
1881
1882 /// Lists the Revisions that match the filter expression. A filter
1883 /// expression filters the resources listed in the response. The expression
1884 /// must be of the form '{field} {operator} {value}' where operators: '<', '>',
1885 /// '<=', '>=', '!=', '=', ':' are supported (colon ':' represents a HAS
1886 /// operator which is roughly synonymous with equality). {field} can refer to a
1887 /// proto or JSON field, or a synthetic field. Field names can be camelCase or
1888 /// snake_case.
1889 ///
1890 /// Examples:
1891 ///
1892 /// - Filter by name:
1893 /// name = "projects/foo/locations/us-central1/deployments/dep/revisions/bar
1894 ///
1895 /// - Filter by labels:
1896 ///
1897 /// - Resources that have a key called 'foo'
1898 /// labels.foo:*
1899 /// - Resources that have a key called 'foo' whose value is 'bar'
1900 /// labels.foo = bar
1901 /// - Filter by state:
1902 ///
1903 /// - Revisions in CREATING state.
1904 /// state=CREATING
1905 pub filter: std::string::String,
1906
1907 /// Field to use to sort the list.
1908 pub order_by: std::string::String,
1909
1910 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1911}
1912
1913impl ListRevisionsRequest {
1914 pub fn new() -> Self {
1915 std::default::Default::default()
1916 }
1917
1918 /// Sets the value of [parent][crate::model::ListRevisionsRequest::parent].
1919 ///
1920 /// # Example
1921 /// ```ignore,no_run
1922 /// # use google_cloud_config_v1::model::ListRevisionsRequest;
1923 /// let x = ListRevisionsRequest::new().set_parent("example");
1924 /// ```
1925 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1926 self.parent = v.into();
1927 self
1928 }
1929
1930 /// Sets the value of [page_size][crate::model::ListRevisionsRequest::page_size].
1931 ///
1932 /// # Example
1933 /// ```ignore,no_run
1934 /// # use google_cloud_config_v1::model::ListRevisionsRequest;
1935 /// let x = ListRevisionsRequest::new().set_page_size(42);
1936 /// ```
1937 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1938 self.page_size = v.into();
1939 self
1940 }
1941
1942 /// Sets the value of [page_token][crate::model::ListRevisionsRequest::page_token].
1943 ///
1944 /// # Example
1945 /// ```ignore,no_run
1946 /// # use google_cloud_config_v1::model::ListRevisionsRequest;
1947 /// let x = ListRevisionsRequest::new().set_page_token("example");
1948 /// ```
1949 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1950 self.page_token = v.into();
1951 self
1952 }
1953
1954 /// Sets the value of [filter][crate::model::ListRevisionsRequest::filter].
1955 ///
1956 /// # Example
1957 /// ```ignore,no_run
1958 /// # use google_cloud_config_v1::model::ListRevisionsRequest;
1959 /// let x = ListRevisionsRequest::new().set_filter("example");
1960 /// ```
1961 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1962 self.filter = v.into();
1963 self
1964 }
1965
1966 /// Sets the value of [order_by][crate::model::ListRevisionsRequest::order_by].
1967 ///
1968 /// # Example
1969 /// ```ignore,no_run
1970 /// # use google_cloud_config_v1::model::ListRevisionsRequest;
1971 /// let x = ListRevisionsRequest::new().set_order_by("example");
1972 /// ```
1973 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1974 self.order_by = v.into();
1975 self
1976 }
1977}
1978
1979impl wkt::message::Message for ListRevisionsRequest {
1980 fn typename() -> &'static str {
1981 "type.googleapis.com/google.cloud.config.v1.ListRevisionsRequest"
1982 }
1983}
1984
1985/// A response to a 'ListRevisions' call. Contains a list of Revisions.
1986#[derive(Clone, Default, PartialEq)]
1987#[non_exhaustive]
1988pub struct ListRevisionsResponse {
1989 /// List of [Revision][google.cloud.config.v1.Revision]s.
1990 ///
1991 /// [google.cloud.config.v1.Revision]: crate::model::Revision
1992 pub revisions: std::vec::Vec<crate::model::Revision>,
1993
1994 /// A token to request the next page of resources from the 'ListRevisions'
1995 /// method. The value of an empty string means that there are no more resources
1996 /// to return.
1997 pub next_page_token: std::string::String,
1998
1999 /// Locations that could not be reached.
2000 pub unreachable: std::vec::Vec<std::string::String>,
2001
2002 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2003}
2004
2005impl ListRevisionsResponse {
2006 pub fn new() -> Self {
2007 std::default::Default::default()
2008 }
2009
2010 /// Sets the value of [revisions][crate::model::ListRevisionsResponse::revisions].
2011 ///
2012 /// # Example
2013 /// ```ignore,no_run
2014 /// # use google_cloud_config_v1::model::ListRevisionsResponse;
2015 /// use google_cloud_config_v1::model::Revision;
2016 /// let x = ListRevisionsResponse::new()
2017 /// .set_revisions([
2018 /// Revision::default()/* use setters */,
2019 /// Revision::default()/* use (different) setters */,
2020 /// ]);
2021 /// ```
2022 pub fn set_revisions<T, V>(mut self, v: T) -> Self
2023 where
2024 T: std::iter::IntoIterator<Item = V>,
2025 V: std::convert::Into<crate::model::Revision>,
2026 {
2027 use std::iter::Iterator;
2028 self.revisions = v.into_iter().map(|i| i.into()).collect();
2029 self
2030 }
2031
2032 /// Sets the value of [next_page_token][crate::model::ListRevisionsResponse::next_page_token].
2033 ///
2034 /// # Example
2035 /// ```ignore,no_run
2036 /// # use google_cloud_config_v1::model::ListRevisionsResponse;
2037 /// let x = ListRevisionsResponse::new().set_next_page_token("example");
2038 /// ```
2039 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2040 self.next_page_token = v.into();
2041 self
2042 }
2043
2044 /// Sets the value of [unreachable][crate::model::ListRevisionsResponse::unreachable].
2045 ///
2046 /// # Example
2047 /// ```ignore,no_run
2048 /// # use google_cloud_config_v1::model::ListRevisionsResponse;
2049 /// let x = ListRevisionsResponse::new().set_unreachable(["a", "b", "c"]);
2050 /// ```
2051 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
2052 where
2053 T: std::iter::IntoIterator<Item = V>,
2054 V: std::convert::Into<std::string::String>,
2055 {
2056 use std::iter::Iterator;
2057 self.unreachable = v.into_iter().map(|i| i.into()).collect();
2058 self
2059 }
2060}
2061
2062impl wkt::message::Message for ListRevisionsResponse {
2063 fn typename() -> &'static str {
2064 "type.googleapis.com/google.cloud.config.v1.ListRevisionsResponse"
2065 }
2066}
2067
2068#[doc(hidden)]
2069impl google_cloud_gax::paginator::internal::PageableResponse for ListRevisionsResponse {
2070 type PageItem = crate::model::Revision;
2071
2072 fn items(self) -> std::vec::Vec<Self::PageItem> {
2073 self.revisions
2074 }
2075
2076 fn next_page_token(&self) -> std::string::String {
2077 use std::clone::Clone;
2078 self.next_page_token.clone()
2079 }
2080}
2081
2082/// A request to get a Revision from a 'GetRevision' call.
2083#[derive(Clone, Default, PartialEq)]
2084#[non_exhaustive]
2085pub struct GetRevisionRequest {
2086 /// Required. The name of the Revision in the format:
2087 /// 'projects/{project_id}/locations/{location}/deployments/{deployment}/revisions/{revision}'.
2088 pub name: std::string::String,
2089
2090 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2091}
2092
2093impl GetRevisionRequest {
2094 pub fn new() -> Self {
2095 std::default::Default::default()
2096 }
2097
2098 /// Sets the value of [name][crate::model::GetRevisionRequest::name].
2099 ///
2100 /// # Example
2101 /// ```ignore,no_run
2102 /// # use google_cloud_config_v1::model::GetRevisionRequest;
2103 /// let x = GetRevisionRequest::new().set_name("example");
2104 /// ```
2105 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2106 self.name = v.into();
2107 self
2108 }
2109}
2110
2111impl wkt::message::Message for GetRevisionRequest {
2112 fn typename() -> &'static str {
2113 "type.googleapis.com/google.cloud.config.v1.GetRevisionRequest"
2114 }
2115}
2116
2117#[derive(Clone, Default, PartialEq)]
2118#[non_exhaustive]
2119pub struct CreateDeploymentRequest {
2120 /// Required. The parent in whose context the Deployment is created. The parent
2121 /// value is in the format: 'projects/{project_id}/locations/{location}'.
2122 pub parent: std::string::String,
2123
2124 /// Required. The Deployment ID.
2125 pub deployment_id: std::string::String,
2126
2127 /// Required. [Deployment][google.cloud.config.v1.Deployment] resource to be
2128 /// created.
2129 ///
2130 /// [google.cloud.config.v1.Deployment]: crate::model::Deployment
2131 pub deployment: std::option::Option<crate::model::Deployment>,
2132
2133 /// Optional. An optional request ID to identify requests. Specify a unique
2134 /// request ID so that if you must retry your request, the server will know to
2135 /// ignore the request if it has already been completed. The server will
2136 /// guarantee that for at least 60 minutes since the first request.
2137 ///
2138 /// For example, consider a situation where you make an initial request and the
2139 /// request times out. If you make the request again with the same request ID,
2140 /// the server can check if original operation with the same request ID was
2141 /// received, and if so, will ignore the second request. This prevents clients
2142 /// from accidentally creating duplicate commitments.
2143 ///
2144 /// The request ID must be a valid UUID with the exception that zero UUID is
2145 /// not supported (00000000-0000-0000-0000-000000000000).
2146 pub request_id: std::string::String,
2147
2148 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2149}
2150
2151impl CreateDeploymentRequest {
2152 pub fn new() -> Self {
2153 std::default::Default::default()
2154 }
2155
2156 /// Sets the value of [parent][crate::model::CreateDeploymentRequest::parent].
2157 ///
2158 /// # Example
2159 /// ```ignore,no_run
2160 /// # use google_cloud_config_v1::model::CreateDeploymentRequest;
2161 /// let x = CreateDeploymentRequest::new().set_parent("example");
2162 /// ```
2163 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2164 self.parent = v.into();
2165 self
2166 }
2167
2168 /// Sets the value of [deployment_id][crate::model::CreateDeploymentRequest::deployment_id].
2169 ///
2170 /// # Example
2171 /// ```ignore,no_run
2172 /// # use google_cloud_config_v1::model::CreateDeploymentRequest;
2173 /// let x = CreateDeploymentRequest::new().set_deployment_id("example");
2174 /// ```
2175 pub fn set_deployment_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2176 self.deployment_id = v.into();
2177 self
2178 }
2179
2180 /// Sets the value of [deployment][crate::model::CreateDeploymentRequest::deployment].
2181 ///
2182 /// # Example
2183 /// ```ignore,no_run
2184 /// # use google_cloud_config_v1::model::CreateDeploymentRequest;
2185 /// use google_cloud_config_v1::model::Deployment;
2186 /// let x = CreateDeploymentRequest::new().set_deployment(Deployment::default()/* use setters */);
2187 /// ```
2188 pub fn set_deployment<T>(mut self, v: T) -> Self
2189 where
2190 T: std::convert::Into<crate::model::Deployment>,
2191 {
2192 self.deployment = std::option::Option::Some(v.into());
2193 self
2194 }
2195
2196 /// Sets or clears the value of [deployment][crate::model::CreateDeploymentRequest::deployment].
2197 ///
2198 /// # Example
2199 /// ```ignore,no_run
2200 /// # use google_cloud_config_v1::model::CreateDeploymentRequest;
2201 /// use google_cloud_config_v1::model::Deployment;
2202 /// let x = CreateDeploymentRequest::new().set_or_clear_deployment(Some(Deployment::default()/* use setters */));
2203 /// let x = CreateDeploymentRequest::new().set_or_clear_deployment(None::<Deployment>);
2204 /// ```
2205 pub fn set_or_clear_deployment<T>(mut self, v: std::option::Option<T>) -> Self
2206 where
2207 T: std::convert::Into<crate::model::Deployment>,
2208 {
2209 self.deployment = v.map(|x| x.into());
2210 self
2211 }
2212
2213 /// Sets the value of [request_id][crate::model::CreateDeploymentRequest::request_id].
2214 ///
2215 /// # Example
2216 /// ```ignore,no_run
2217 /// # use google_cloud_config_v1::model::CreateDeploymentRequest;
2218 /// let x = CreateDeploymentRequest::new().set_request_id("example");
2219 /// ```
2220 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2221 self.request_id = v.into();
2222 self
2223 }
2224}
2225
2226impl wkt::message::Message for CreateDeploymentRequest {
2227 fn typename() -> &'static str {
2228 "type.googleapis.com/google.cloud.config.v1.CreateDeploymentRequest"
2229 }
2230}
2231
2232#[derive(Clone, Default, PartialEq)]
2233#[non_exhaustive]
2234pub struct UpdateDeploymentRequest {
2235 /// Optional. Field mask used to specify the fields to be overwritten in the
2236 /// Deployment resource by the update.
2237 ///
2238 /// The fields specified in the update_mask are relative to the resource, not
2239 /// the full request. A field will be overwritten if it is in the mask. If the
2240 /// user does not provide a mask then all fields will be overwritten.
2241 pub update_mask: std::option::Option<wkt::FieldMask>,
2242
2243 /// Required. [Deployment][google.cloud.config.v1.Deployment] to update.
2244 ///
2245 /// The deployment's `name` field is used to identify the resource to be
2246 /// updated. Format:
2247 /// `projects/{project}/locations/{location}/deployments/{deployment}`
2248 ///
2249 /// [google.cloud.config.v1.Deployment]: crate::model::Deployment
2250 pub deployment: std::option::Option<crate::model::Deployment>,
2251
2252 /// Optional. An optional request ID to identify requests. Specify a unique
2253 /// request ID so that if you must retry your request, the server will know to
2254 /// ignore the request if it has already been completed. The server will
2255 /// guarantee that for at least 60 minutes since the first request.
2256 ///
2257 /// For example, consider a situation where you make an initial request and the
2258 /// request times out. If you make the request again with the same request ID,
2259 /// the server can check if original operation with the same request ID was
2260 /// received, and if so, will ignore the second request. This prevents clients
2261 /// from accidentally creating duplicate commitments.
2262 ///
2263 /// The request ID must be a valid UUID with the exception that zero UUID is
2264 /// not supported (00000000-0000-0000-0000-000000000000).
2265 pub request_id: std::string::String,
2266
2267 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2268}
2269
2270impl UpdateDeploymentRequest {
2271 pub fn new() -> Self {
2272 std::default::Default::default()
2273 }
2274
2275 /// Sets the value of [update_mask][crate::model::UpdateDeploymentRequest::update_mask].
2276 ///
2277 /// # Example
2278 /// ```ignore,no_run
2279 /// # use google_cloud_config_v1::model::UpdateDeploymentRequest;
2280 /// use wkt::FieldMask;
2281 /// let x = UpdateDeploymentRequest::new().set_update_mask(FieldMask::default()/* use setters */);
2282 /// ```
2283 pub fn set_update_mask<T>(mut self, v: T) -> Self
2284 where
2285 T: std::convert::Into<wkt::FieldMask>,
2286 {
2287 self.update_mask = std::option::Option::Some(v.into());
2288 self
2289 }
2290
2291 /// Sets or clears the value of [update_mask][crate::model::UpdateDeploymentRequest::update_mask].
2292 ///
2293 /// # Example
2294 /// ```ignore,no_run
2295 /// # use google_cloud_config_v1::model::UpdateDeploymentRequest;
2296 /// use wkt::FieldMask;
2297 /// let x = UpdateDeploymentRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
2298 /// let x = UpdateDeploymentRequest::new().set_or_clear_update_mask(None::<FieldMask>);
2299 /// ```
2300 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2301 where
2302 T: std::convert::Into<wkt::FieldMask>,
2303 {
2304 self.update_mask = v.map(|x| x.into());
2305 self
2306 }
2307
2308 /// Sets the value of [deployment][crate::model::UpdateDeploymentRequest::deployment].
2309 ///
2310 /// # Example
2311 /// ```ignore,no_run
2312 /// # use google_cloud_config_v1::model::UpdateDeploymentRequest;
2313 /// use google_cloud_config_v1::model::Deployment;
2314 /// let x = UpdateDeploymentRequest::new().set_deployment(Deployment::default()/* use setters */);
2315 /// ```
2316 pub fn set_deployment<T>(mut self, v: T) -> Self
2317 where
2318 T: std::convert::Into<crate::model::Deployment>,
2319 {
2320 self.deployment = std::option::Option::Some(v.into());
2321 self
2322 }
2323
2324 /// Sets or clears the value of [deployment][crate::model::UpdateDeploymentRequest::deployment].
2325 ///
2326 /// # Example
2327 /// ```ignore,no_run
2328 /// # use google_cloud_config_v1::model::UpdateDeploymentRequest;
2329 /// use google_cloud_config_v1::model::Deployment;
2330 /// let x = UpdateDeploymentRequest::new().set_or_clear_deployment(Some(Deployment::default()/* use setters */));
2331 /// let x = UpdateDeploymentRequest::new().set_or_clear_deployment(None::<Deployment>);
2332 /// ```
2333 pub fn set_or_clear_deployment<T>(mut self, v: std::option::Option<T>) -> Self
2334 where
2335 T: std::convert::Into<crate::model::Deployment>,
2336 {
2337 self.deployment = v.map(|x| x.into());
2338 self
2339 }
2340
2341 /// Sets the value of [request_id][crate::model::UpdateDeploymentRequest::request_id].
2342 ///
2343 /// # Example
2344 /// ```ignore,no_run
2345 /// # use google_cloud_config_v1::model::UpdateDeploymentRequest;
2346 /// let x = UpdateDeploymentRequest::new().set_request_id("example");
2347 /// ```
2348 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2349 self.request_id = v.into();
2350 self
2351 }
2352}
2353
2354impl wkt::message::Message for UpdateDeploymentRequest {
2355 fn typename() -> &'static str {
2356 "type.googleapis.com/google.cloud.config.v1.UpdateDeploymentRequest"
2357 }
2358}
2359
2360#[derive(Clone, Default, PartialEq)]
2361#[non_exhaustive]
2362pub struct DeleteDeploymentRequest {
2363 /// Required. The name of the Deployment in the format:
2364 /// 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
2365 pub name: std::string::String,
2366
2367 /// Optional. An optional request ID to identify requests. Specify a unique
2368 /// request ID so that if you must retry your request, the server will know to
2369 /// ignore the request if it has already been completed. The server will
2370 /// guarantee that for at least 60 minutes after the first request.
2371 ///
2372 /// For example, consider a situation where you make an initial request and the
2373 /// request times out. If you make the request again with the same request ID,
2374 /// the server can check if original operation with the same request ID was
2375 /// received, and if so, will ignore the second request. This prevents clients
2376 /// from accidentally creating duplicate commitments.
2377 ///
2378 /// The request ID must be a valid UUID with the exception that zero UUID is
2379 /// not supported (00000000-0000-0000-0000-000000000000).
2380 pub request_id: std::string::String,
2381
2382 /// Optional. If set to true, any revisions for this deployment will also be
2383 /// deleted. (Otherwise, the request will only work if the deployment has no
2384 /// revisions.)
2385 pub force: bool,
2386
2387 /// Optional. Policy on how resources actuated by the deployment should be
2388 /// deleted. If unspecified, the default behavior is to delete the underlying
2389 /// resources.
2390 pub delete_policy: crate::model::delete_deployment_request::DeletePolicy,
2391
2392 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2393}
2394
2395impl DeleteDeploymentRequest {
2396 pub fn new() -> Self {
2397 std::default::Default::default()
2398 }
2399
2400 /// Sets the value of [name][crate::model::DeleteDeploymentRequest::name].
2401 ///
2402 /// # Example
2403 /// ```ignore,no_run
2404 /// # use google_cloud_config_v1::model::DeleteDeploymentRequest;
2405 /// let x = DeleteDeploymentRequest::new().set_name("example");
2406 /// ```
2407 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2408 self.name = v.into();
2409 self
2410 }
2411
2412 /// Sets the value of [request_id][crate::model::DeleteDeploymentRequest::request_id].
2413 ///
2414 /// # Example
2415 /// ```ignore,no_run
2416 /// # use google_cloud_config_v1::model::DeleteDeploymentRequest;
2417 /// let x = DeleteDeploymentRequest::new().set_request_id("example");
2418 /// ```
2419 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2420 self.request_id = v.into();
2421 self
2422 }
2423
2424 /// Sets the value of [force][crate::model::DeleteDeploymentRequest::force].
2425 ///
2426 /// # Example
2427 /// ```ignore,no_run
2428 /// # use google_cloud_config_v1::model::DeleteDeploymentRequest;
2429 /// let x = DeleteDeploymentRequest::new().set_force(true);
2430 /// ```
2431 pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2432 self.force = v.into();
2433 self
2434 }
2435
2436 /// Sets the value of [delete_policy][crate::model::DeleteDeploymentRequest::delete_policy].
2437 ///
2438 /// # Example
2439 /// ```ignore,no_run
2440 /// # use google_cloud_config_v1::model::DeleteDeploymentRequest;
2441 /// use google_cloud_config_v1::model::delete_deployment_request::DeletePolicy;
2442 /// let x0 = DeleteDeploymentRequest::new().set_delete_policy(DeletePolicy::Delete);
2443 /// let x1 = DeleteDeploymentRequest::new().set_delete_policy(DeletePolicy::Abandon);
2444 /// ```
2445 pub fn set_delete_policy<
2446 T: std::convert::Into<crate::model::delete_deployment_request::DeletePolicy>,
2447 >(
2448 mut self,
2449 v: T,
2450 ) -> Self {
2451 self.delete_policy = v.into();
2452 self
2453 }
2454}
2455
2456impl wkt::message::Message for DeleteDeploymentRequest {
2457 fn typename() -> &'static str {
2458 "type.googleapis.com/google.cloud.config.v1.DeleteDeploymentRequest"
2459 }
2460}
2461
2462/// Defines additional types related to [DeleteDeploymentRequest].
2463pub mod delete_deployment_request {
2464 #[allow(unused_imports)]
2465 use super::*;
2466
2467 /// Policy on how resources actuated by the deployment should be deleted.
2468 ///
2469 /// # Working with unknown values
2470 ///
2471 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2472 /// additional enum variants at any time. Adding new variants is not considered
2473 /// a breaking change. Applications should write their code in anticipation of:
2474 ///
2475 /// - New values appearing in future releases of the client library, **and**
2476 /// - New values received dynamically, without application changes.
2477 ///
2478 /// Please consult the [Working with enums] section in the user guide for some
2479 /// guidelines.
2480 ///
2481 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
2482 #[derive(Clone, Debug, PartialEq)]
2483 #[non_exhaustive]
2484 pub enum DeletePolicy {
2485 /// Unspecified policy, resources will be deleted.
2486 Unspecified,
2487 /// Deletes resources actuated by the deployment.
2488 Delete,
2489 /// Abandons resources and only deletes the deployment and its metadata.
2490 Abandon,
2491 /// If set, the enum was initialized with an unknown value.
2492 ///
2493 /// Applications can examine the value using [DeletePolicy::value] or
2494 /// [DeletePolicy::name].
2495 UnknownValue(delete_policy::UnknownValue),
2496 }
2497
2498 #[doc(hidden)]
2499 pub mod delete_policy {
2500 #[allow(unused_imports)]
2501 use super::*;
2502 #[derive(Clone, Debug, PartialEq)]
2503 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2504 }
2505
2506 impl DeletePolicy {
2507 /// Gets the enum value.
2508 ///
2509 /// Returns `None` if the enum contains an unknown value deserialized from
2510 /// the string representation of enums.
2511 pub fn value(&self) -> std::option::Option<i32> {
2512 match self {
2513 Self::Unspecified => std::option::Option::Some(0),
2514 Self::Delete => std::option::Option::Some(1),
2515 Self::Abandon => std::option::Option::Some(2),
2516 Self::UnknownValue(u) => u.0.value(),
2517 }
2518 }
2519
2520 /// Gets the enum value as a string.
2521 ///
2522 /// Returns `None` if the enum contains an unknown value deserialized from
2523 /// the integer representation of enums.
2524 pub fn name(&self) -> std::option::Option<&str> {
2525 match self {
2526 Self::Unspecified => std::option::Option::Some("DELETE_POLICY_UNSPECIFIED"),
2527 Self::Delete => std::option::Option::Some("DELETE"),
2528 Self::Abandon => std::option::Option::Some("ABANDON"),
2529 Self::UnknownValue(u) => u.0.name(),
2530 }
2531 }
2532 }
2533
2534 impl std::default::Default for DeletePolicy {
2535 fn default() -> Self {
2536 use std::convert::From;
2537 Self::from(0)
2538 }
2539 }
2540
2541 impl std::fmt::Display for DeletePolicy {
2542 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2543 wkt::internal::display_enum(f, self.name(), self.value())
2544 }
2545 }
2546
2547 impl std::convert::From<i32> for DeletePolicy {
2548 fn from(value: i32) -> Self {
2549 match value {
2550 0 => Self::Unspecified,
2551 1 => Self::Delete,
2552 2 => Self::Abandon,
2553 _ => Self::UnknownValue(delete_policy::UnknownValue(
2554 wkt::internal::UnknownEnumValue::Integer(value),
2555 )),
2556 }
2557 }
2558 }
2559
2560 impl std::convert::From<&str> for DeletePolicy {
2561 fn from(value: &str) -> Self {
2562 use std::string::ToString;
2563 match value {
2564 "DELETE_POLICY_UNSPECIFIED" => Self::Unspecified,
2565 "DELETE" => Self::Delete,
2566 "ABANDON" => Self::Abandon,
2567 _ => Self::UnknownValue(delete_policy::UnknownValue(
2568 wkt::internal::UnknownEnumValue::String(value.to_string()),
2569 )),
2570 }
2571 }
2572 }
2573
2574 impl serde::ser::Serialize for DeletePolicy {
2575 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2576 where
2577 S: serde::Serializer,
2578 {
2579 match self {
2580 Self::Unspecified => serializer.serialize_i32(0),
2581 Self::Delete => serializer.serialize_i32(1),
2582 Self::Abandon => serializer.serialize_i32(2),
2583 Self::UnknownValue(u) => u.0.serialize(serializer),
2584 }
2585 }
2586 }
2587
2588 impl<'de> serde::de::Deserialize<'de> for DeletePolicy {
2589 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2590 where
2591 D: serde::Deserializer<'de>,
2592 {
2593 deserializer.deserialize_any(wkt::internal::EnumVisitor::<DeletePolicy>::new(
2594 ".google.cloud.config.v1.DeleteDeploymentRequest.DeletePolicy",
2595 ))
2596 }
2597 }
2598}
2599
2600/// Represents the metadata of the long-running operation.
2601#[derive(Clone, Default, PartialEq)]
2602#[non_exhaustive]
2603pub struct OperationMetadata {
2604 /// Output only. Time when the operation was created.
2605 pub create_time: std::option::Option<wkt::Timestamp>,
2606
2607 /// Output only. Time when the operation finished running.
2608 pub end_time: std::option::Option<wkt::Timestamp>,
2609
2610 /// Output only. Server-defined resource path for the target of the operation.
2611 pub target: std::string::String,
2612
2613 /// Output only. Name of the verb executed by the operation.
2614 pub verb: std::string::String,
2615
2616 /// Output only. Human-readable status of the operation, if any.
2617 pub status_message: std::string::String,
2618
2619 /// Output only. Identifies whether the user has requested cancellation of the
2620 /// operation. Operations that have successfully been cancelled have
2621 /// [google.longrunning.Operation.error][google.longrunning.Operation.error]
2622 /// value with a [google.rpc.Status.code][google.rpc.Status.code] of `1`,
2623 /// corresponding to `Code.CANCELLED`.
2624 ///
2625 /// [google.longrunning.Operation.error]: google_cloud_longrunning::model::Operation::result
2626 /// [google.rpc.Status.code]: google_cloud_rpc::model::Status::code
2627 pub requested_cancellation: bool,
2628
2629 /// Output only. API version used to start the operation.
2630 pub api_version: std::string::String,
2631
2632 /// Ephemeral metadata about the state of an operation for a particular
2633 /// resource.
2634 pub resource_metadata: std::option::Option<crate::model::operation_metadata::ResourceMetadata>,
2635
2636 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2637}
2638
2639impl OperationMetadata {
2640 pub fn new() -> Self {
2641 std::default::Default::default()
2642 }
2643
2644 /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
2645 ///
2646 /// # Example
2647 /// ```ignore,no_run
2648 /// # use google_cloud_config_v1::model::OperationMetadata;
2649 /// use wkt::Timestamp;
2650 /// let x = OperationMetadata::new().set_create_time(Timestamp::default()/* use setters */);
2651 /// ```
2652 pub fn set_create_time<T>(mut self, v: T) -> Self
2653 where
2654 T: std::convert::Into<wkt::Timestamp>,
2655 {
2656 self.create_time = std::option::Option::Some(v.into());
2657 self
2658 }
2659
2660 /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
2661 ///
2662 /// # Example
2663 /// ```ignore,no_run
2664 /// # use google_cloud_config_v1::model::OperationMetadata;
2665 /// use wkt::Timestamp;
2666 /// let x = OperationMetadata::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
2667 /// let x = OperationMetadata::new().set_or_clear_create_time(None::<Timestamp>);
2668 /// ```
2669 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
2670 where
2671 T: std::convert::Into<wkt::Timestamp>,
2672 {
2673 self.create_time = v.map(|x| x.into());
2674 self
2675 }
2676
2677 /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
2678 ///
2679 /// # Example
2680 /// ```ignore,no_run
2681 /// # use google_cloud_config_v1::model::OperationMetadata;
2682 /// use wkt::Timestamp;
2683 /// let x = OperationMetadata::new().set_end_time(Timestamp::default()/* use setters */);
2684 /// ```
2685 pub fn set_end_time<T>(mut self, v: T) -> Self
2686 where
2687 T: std::convert::Into<wkt::Timestamp>,
2688 {
2689 self.end_time = std::option::Option::Some(v.into());
2690 self
2691 }
2692
2693 /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
2694 ///
2695 /// # Example
2696 /// ```ignore,no_run
2697 /// # use google_cloud_config_v1::model::OperationMetadata;
2698 /// use wkt::Timestamp;
2699 /// let x = OperationMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
2700 /// let x = OperationMetadata::new().set_or_clear_end_time(None::<Timestamp>);
2701 /// ```
2702 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
2703 where
2704 T: std::convert::Into<wkt::Timestamp>,
2705 {
2706 self.end_time = v.map(|x| x.into());
2707 self
2708 }
2709
2710 /// Sets the value of [target][crate::model::OperationMetadata::target].
2711 ///
2712 /// # Example
2713 /// ```ignore,no_run
2714 /// # use google_cloud_config_v1::model::OperationMetadata;
2715 /// let x = OperationMetadata::new().set_target("example");
2716 /// ```
2717 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2718 self.target = v.into();
2719 self
2720 }
2721
2722 /// Sets the value of [verb][crate::model::OperationMetadata::verb].
2723 ///
2724 /// # Example
2725 /// ```ignore,no_run
2726 /// # use google_cloud_config_v1::model::OperationMetadata;
2727 /// let x = OperationMetadata::new().set_verb("example");
2728 /// ```
2729 pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2730 self.verb = v.into();
2731 self
2732 }
2733
2734 /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
2735 ///
2736 /// # Example
2737 /// ```ignore,no_run
2738 /// # use google_cloud_config_v1::model::OperationMetadata;
2739 /// let x = OperationMetadata::new().set_status_message("example");
2740 /// ```
2741 pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2742 self.status_message = v.into();
2743 self
2744 }
2745
2746 /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
2747 ///
2748 /// # Example
2749 /// ```ignore,no_run
2750 /// # use google_cloud_config_v1::model::OperationMetadata;
2751 /// let x = OperationMetadata::new().set_requested_cancellation(true);
2752 /// ```
2753 pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2754 self.requested_cancellation = v.into();
2755 self
2756 }
2757
2758 /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
2759 ///
2760 /// # Example
2761 /// ```ignore,no_run
2762 /// # use google_cloud_config_v1::model::OperationMetadata;
2763 /// let x = OperationMetadata::new().set_api_version("example");
2764 /// ```
2765 pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2766 self.api_version = v.into();
2767 self
2768 }
2769
2770 /// Sets the value of [resource_metadata][crate::model::OperationMetadata::resource_metadata].
2771 ///
2772 /// Note that all the setters affecting `resource_metadata` are mutually
2773 /// exclusive.
2774 ///
2775 /// # Example
2776 /// ```ignore,no_run
2777 /// # use google_cloud_config_v1::model::OperationMetadata;
2778 /// use google_cloud_config_v1::model::DeploymentOperationMetadata;
2779 /// let x = OperationMetadata::new().set_resource_metadata(Some(
2780 /// google_cloud_config_v1::model::operation_metadata::ResourceMetadata::DeploymentMetadata(DeploymentOperationMetadata::default().into())));
2781 /// ```
2782 pub fn set_resource_metadata<
2783 T: std::convert::Into<std::option::Option<crate::model::operation_metadata::ResourceMetadata>>,
2784 >(
2785 mut self,
2786 v: T,
2787 ) -> Self {
2788 self.resource_metadata = v.into();
2789 self
2790 }
2791
2792 /// The value of [resource_metadata][crate::model::OperationMetadata::resource_metadata]
2793 /// if it holds a `DeploymentMetadata`, `None` if the field is not set or
2794 /// holds a different branch.
2795 pub fn deployment_metadata(
2796 &self,
2797 ) -> std::option::Option<&std::boxed::Box<crate::model::DeploymentOperationMetadata>> {
2798 #[allow(unreachable_patterns)]
2799 self.resource_metadata.as_ref().and_then(|v| match v {
2800 crate::model::operation_metadata::ResourceMetadata::DeploymentMetadata(v) => {
2801 std::option::Option::Some(v)
2802 }
2803 _ => std::option::Option::None,
2804 })
2805 }
2806
2807 /// Sets the value of [resource_metadata][crate::model::OperationMetadata::resource_metadata]
2808 /// to hold a `DeploymentMetadata`.
2809 ///
2810 /// Note that all the setters affecting `resource_metadata` are
2811 /// mutually exclusive.
2812 ///
2813 /// # Example
2814 /// ```ignore,no_run
2815 /// # use google_cloud_config_v1::model::OperationMetadata;
2816 /// use google_cloud_config_v1::model::DeploymentOperationMetadata;
2817 /// let x = OperationMetadata::new().set_deployment_metadata(DeploymentOperationMetadata::default()/* use setters */);
2818 /// assert!(x.deployment_metadata().is_some());
2819 /// assert!(x.preview_metadata().is_none());
2820 /// ```
2821 pub fn set_deployment_metadata<
2822 T: std::convert::Into<std::boxed::Box<crate::model::DeploymentOperationMetadata>>,
2823 >(
2824 mut self,
2825 v: T,
2826 ) -> Self {
2827 self.resource_metadata = std::option::Option::Some(
2828 crate::model::operation_metadata::ResourceMetadata::DeploymentMetadata(v.into()),
2829 );
2830 self
2831 }
2832
2833 /// The value of [resource_metadata][crate::model::OperationMetadata::resource_metadata]
2834 /// if it holds a `PreviewMetadata`, `None` if the field is not set or
2835 /// holds a different branch.
2836 pub fn preview_metadata(
2837 &self,
2838 ) -> std::option::Option<&std::boxed::Box<crate::model::PreviewOperationMetadata>> {
2839 #[allow(unreachable_patterns)]
2840 self.resource_metadata.as_ref().and_then(|v| match v {
2841 crate::model::operation_metadata::ResourceMetadata::PreviewMetadata(v) => {
2842 std::option::Option::Some(v)
2843 }
2844 _ => std::option::Option::None,
2845 })
2846 }
2847
2848 /// Sets the value of [resource_metadata][crate::model::OperationMetadata::resource_metadata]
2849 /// to hold a `PreviewMetadata`.
2850 ///
2851 /// Note that all the setters affecting `resource_metadata` are
2852 /// mutually exclusive.
2853 ///
2854 /// # Example
2855 /// ```ignore,no_run
2856 /// # use google_cloud_config_v1::model::OperationMetadata;
2857 /// use google_cloud_config_v1::model::PreviewOperationMetadata;
2858 /// let x = OperationMetadata::new().set_preview_metadata(PreviewOperationMetadata::default()/* use setters */);
2859 /// assert!(x.preview_metadata().is_some());
2860 /// assert!(x.deployment_metadata().is_none());
2861 /// ```
2862 pub fn set_preview_metadata<
2863 T: std::convert::Into<std::boxed::Box<crate::model::PreviewOperationMetadata>>,
2864 >(
2865 mut self,
2866 v: T,
2867 ) -> Self {
2868 self.resource_metadata = std::option::Option::Some(
2869 crate::model::operation_metadata::ResourceMetadata::PreviewMetadata(v.into()),
2870 );
2871 self
2872 }
2873}
2874
2875impl wkt::message::Message for OperationMetadata {
2876 fn typename() -> &'static str {
2877 "type.googleapis.com/google.cloud.config.v1.OperationMetadata"
2878 }
2879}
2880
2881/// Defines additional types related to [OperationMetadata].
2882pub mod operation_metadata {
2883 #[allow(unused_imports)]
2884 use super::*;
2885
2886 /// Ephemeral metadata about the state of an operation for a particular
2887 /// resource.
2888 #[derive(Clone, Debug, PartialEq)]
2889 #[non_exhaustive]
2890 pub enum ResourceMetadata {
2891 /// Output only. Metadata about the deployment operation state.
2892 DeploymentMetadata(std::boxed::Box<crate::model::DeploymentOperationMetadata>),
2893 /// Output only. Metadata about the preview operation state.
2894 PreviewMetadata(std::boxed::Box<crate::model::PreviewOperationMetadata>),
2895 }
2896}
2897
2898/// A child resource of a Deployment generated by a 'CreateDeployment' or
2899/// 'UpdateDeployment' call. Each Revision contains metadata pertaining to a
2900/// snapshot of a particular Deployment.
2901#[derive(Clone, Default, PartialEq)]
2902#[non_exhaustive]
2903pub struct Revision {
2904 /// Revision name. Format:
2905 /// `projects/{project}/locations/{location}/deployments/{deployment}/
2906 /// revisions/{revision}`
2907 pub name: std::string::String,
2908
2909 /// Output only. Time when the revision was created.
2910 pub create_time: std::option::Option<wkt::Timestamp>,
2911
2912 /// Output only. Time when the revision was last modified.
2913 pub update_time: std::option::Option<wkt::Timestamp>,
2914
2915 /// Output only. The action which created this revision
2916 pub action: crate::model::revision::Action,
2917
2918 /// Output only. Current state of the revision.
2919 pub state: crate::model::revision::State,
2920
2921 /// Output only. Outputs and artifacts from applying a deployment.
2922 pub apply_results: std::option::Option<crate::model::ApplyResults>,
2923
2924 /// Output only. Additional info regarding the current state.
2925 pub state_detail: std::string::String,
2926
2927 /// Output only. Code describing any errors that may have occurred.
2928 pub error_code: crate::model::revision::ErrorCode,
2929
2930 /// Output only. Cloud Build instance UUID associated with this revision.
2931 pub build: std::string::String,
2932
2933 /// Output only. Location of Revision operation logs in
2934 /// `gs://{bucket}/{object}` format.
2935 pub logs: std::string::String,
2936
2937 /// Output only. Errors encountered when creating or updating this deployment.
2938 /// Errors are truncated to 10 entries, see `delete_results` and `error_logs`
2939 /// for full details.
2940 pub tf_errors: std::vec::Vec<crate::model::TerraformError>,
2941
2942 /// Output only. Location of Terraform error logs in Google Cloud Storage.
2943 /// Format: `gs://{bucket}/{object}`.
2944 pub error_logs: std::string::String,
2945
2946 /// Output only. User-specified Service Account (SA) to be used as credential
2947 /// to manage resources. Format:
2948 /// `projects/{projectID}/serviceAccounts/{serviceAccount}`
2949 pub service_account: std::string::String,
2950
2951 /// Output only. By default, Infra Manager will return a failure when
2952 /// Terraform encounters a 409 code (resource conflict error) during actuation.
2953 /// If this flag is set to true, Infra Manager will instead
2954 /// attempt to automatically import the resource into the Terraform state (for
2955 /// supported resource types) and continue actuation.
2956 ///
2957 /// Not all resource types are supported, refer to documentation.
2958 pub import_existing_resources: bool,
2959
2960 /// Output only. The user-specified Cloud Build worker pool resource in which
2961 /// the Cloud Build job will execute. Format:
2962 /// `projects/{project}/locations/{location}/workerPools/{workerPoolId}`.
2963 /// If this field is unspecified, the default Cloud Build worker pool will be
2964 /// used.
2965 pub worker_pool: std::string::String,
2966
2967 /// Output only. The user-specified Terraform version constraint.
2968 /// Example: "=1.3.10".
2969 pub tf_version_constraint: std::string::String,
2970
2971 /// Output only. The version of Terraform used to create the Revision.
2972 /// It is in the format of "Major.Minor.Patch", for example, "1.3.10".
2973 pub tf_version: std::string::String,
2974
2975 /// Output only. Cloud Storage path containing quota validation results. This
2976 /// field is set when a user sets Deployment.quota_validation field to ENABLED
2977 /// or ENFORCED. Format: `gs://{bucket}/{object}`.
2978 pub quota_validation_results: std::string::String,
2979
2980 /// Optional. Input to control quota checks for resources in terraform
2981 /// configuration files. There are limited resources on which quota validation
2982 /// applies.
2983 pub quota_validation: crate::model::QuotaValidation,
2984
2985 /// Output only. This field specifies the provider configurations.
2986 pub provider_config: std::option::Option<crate::model::ProviderConfig>,
2987
2988 /// Blueprint that was deployed.
2989 pub blueprint: std::option::Option<crate::model::revision::Blueprint>,
2990
2991 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2992}
2993
2994impl Revision {
2995 pub fn new() -> Self {
2996 std::default::Default::default()
2997 }
2998
2999 /// Sets the value of [name][crate::model::Revision::name].
3000 ///
3001 /// # Example
3002 /// ```ignore,no_run
3003 /// # use google_cloud_config_v1::model::Revision;
3004 /// let x = Revision::new().set_name("example");
3005 /// ```
3006 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3007 self.name = v.into();
3008 self
3009 }
3010
3011 /// Sets the value of [create_time][crate::model::Revision::create_time].
3012 ///
3013 /// # Example
3014 /// ```ignore,no_run
3015 /// # use google_cloud_config_v1::model::Revision;
3016 /// use wkt::Timestamp;
3017 /// let x = Revision::new().set_create_time(Timestamp::default()/* use setters */);
3018 /// ```
3019 pub fn set_create_time<T>(mut self, v: T) -> Self
3020 where
3021 T: std::convert::Into<wkt::Timestamp>,
3022 {
3023 self.create_time = std::option::Option::Some(v.into());
3024 self
3025 }
3026
3027 /// Sets or clears the value of [create_time][crate::model::Revision::create_time].
3028 ///
3029 /// # Example
3030 /// ```ignore,no_run
3031 /// # use google_cloud_config_v1::model::Revision;
3032 /// use wkt::Timestamp;
3033 /// let x = Revision::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
3034 /// let x = Revision::new().set_or_clear_create_time(None::<Timestamp>);
3035 /// ```
3036 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
3037 where
3038 T: std::convert::Into<wkt::Timestamp>,
3039 {
3040 self.create_time = v.map(|x| x.into());
3041 self
3042 }
3043
3044 /// Sets the value of [update_time][crate::model::Revision::update_time].
3045 ///
3046 /// # Example
3047 /// ```ignore,no_run
3048 /// # use google_cloud_config_v1::model::Revision;
3049 /// use wkt::Timestamp;
3050 /// let x = Revision::new().set_update_time(Timestamp::default()/* use setters */);
3051 /// ```
3052 pub fn set_update_time<T>(mut self, v: T) -> Self
3053 where
3054 T: std::convert::Into<wkt::Timestamp>,
3055 {
3056 self.update_time = std::option::Option::Some(v.into());
3057 self
3058 }
3059
3060 /// Sets or clears the value of [update_time][crate::model::Revision::update_time].
3061 ///
3062 /// # Example
3063 /// ```ignore,no_run
3064 /// # use google_cloud_config_v1::model::Revision;
3065 /// use wkt::Timestamp;
3066 /// let x = Revision::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
3067 /// let x = Revision::new().set_or_clear_update_time(None::<Timestamp>);
3068 /// ```
3069 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
3070 where
3071 T: std::convert::Into<wkt::Timestamp>,
3072 {
3073 self.update_time = v.map(|x| x.into());
3074 self
3075 }
3076
3077 /// Sets the value of [action][crate::model::Revision::action].
3078 ///
3079 /// # Example
3080 /// ```ignore,no_run
3081 /// # use google_cloud_config_v1::model::Revision;
3082 /// use google_cloud_config_v1::model::revision::Action;
3083 /// let x0 = Revision::new().set_action(Action::Create);
3084 /// let x1 = Revision::new().set_action(Action::Update);
3085 /// let x2 = Revision::new().set_action(Action::Delete);
3086 /// ```
3087 pub fn set_action<T: std::convert::Into<crate::model::revision::Action>>(
3088 mut self,
3089 v: T,
3090 ) -> Self {
3091 self.action = v.into();
3092 self
3093 }
3094
3095 /// Sets the value of [state][crate::model::Revision::state].
3096 ///
3097 /// # Example
3098 /// ```ignore,no_run
3099 /// # use google_cloud_config_v1::model::Revision;
3100 /// use google_cloud_config_v1::model::revision::State;
3101 /// let x0 = Revision::new().set_state(State::Applying);
3102 /// let x1 = Revision::new().set_state(State::Applied);
3103 /// let x2 = Revision::new().set_state(State::Failed);
3104 /// ```
3105 pub fn set_state<T: std::convert::Into<crate::model::revision::State>>(mut self, v: T) -> Self {
3106 self.state = v.into();
3107 self
3108 }
3109
3110 /// Sets the value of [apply_results][crate::model::Revision::apply_results].
3111 ///
3112 /// # Example
3113 /// ```ignore,no_run
3114 /// # use google_cloud_config_v1::model::Revision;
3115 /// use google_cloud_config_v1::model::ApplyResults;
3116 /// let x = Revision::new().set_apply_results(ApplyResults::default()/* use setters */);
3117 /// ```
3118 pub fn set_apply_results<T>(mut self, v: T) -> Self
3119 where
3120 T: std::convert::Into<crate::model::ApplyResults>,
3121 {
3122 self.apply_results = std::option::Option::Some(v.into());
3123 self
3124 }
3125
3126 /// Sets or clears the value of [apply_results][crate::model::Revision::apply_results].
3127 ///
3128 /// # Example
3129 /// ```ignore,no_run
3130 /// # use google_cloud_config_v1::model::Revision;
3131 /// use google_cloud_config_v1::model::ApplyResults;
3132 /// let x = Revision::new().set_or_clear_apply_results(Some(ApplyResults::default()/* use setters */));
3133 /// let x = Revision::new().set_or_clear_apply_results(None::<ApplyResults>);
3134 /// ```
3135 pub fn set_or_clear_apply_results<T>(mut self, v: std::option::Option<T>) -> Self
3136 where
3137 T: std::convert::Into<crate::model::ApplyResults>,
3138 {
3139 self.apply_results = v.map(|x| x.into());
3140 self
3141 }
3142
3143 /// Sets the value of [state_detail][crate::model::Revision::state_detail].
3144 ///
3145 /// # Example
3146 /// ```ignore,no_run
3147 /// # use google_cloud_config_v1::model::Revision;
3148 /// let x = Revision::new().set_state_detail("example");
3149 /// ```
3150 pub fn set_state_detail<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3151 self.state_detail = v.into();
3152 self
3153 }
3154
3155 /// Sets the value of [error_code][crate::model::Revision::error_code].
3156 ///
3157 /// # Example
3158 /// ```ignore,no_run
3159 /// # use google_cloud_config_v1::model::Revision;
3160 /// use google_cloud_config_v1::model::revision::ErrorCode;
3161 /// let x0 = Revision::new().set_error_code(ErrorCode::CloudBuildPermissionDenied);
3162 /// let x1 = Revision::new().set_error_code(ErrorCode::ApplyBuildApiFailed);
3163 /// let x2 = Revision::new().set_error_code(ErrorCode::ApplyBuildRunFailed);
3164 /// ```
3165 pub fn set_error_code<T: std::convert::Into<crate::model::revision::ErrorCode>>(
3166 mut self,
3167 v: T,
3168 ) -> Self {
3169 self.error_code = v.into();
3170 self
3171 }
3172
3173 /// Sets the value of [build][crate::model::Revision::build].
3174 ///
3175 /// # Example
3176 /// ```ignore,no_run
3177 /// # use google_cloud_config_v1::model::Revision;
3178 /// let x = Revision::new().set_build("example");
3179 /// ```
3180 pub fn set_build<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3181 self.build = v.into();
3182 self
3183 }
3184
3185 /// Sets the value of [logs][crate::model::Revision::logs].
3186 ///
3187 /// # Example
3188 /// ```ignore,no_run
3189 /// # use google_cloud_config_v1::model::Revision;
3190 /// let x = Revision::new().set_logs("example");
3191 /// ```
3192 pub fn set_logs<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3193 self.logs = v.into();
3194 self
3195 }
3196
3197 /// Sets the value of [tf_errors][crate::model::Revision::tf_errors].
3198 ///
3199 /// # Example
3200 /// ```ignore,no_run
3201 /// # use google_cloud_config_v1::model::Revision;
3202 /// use google_cloud_config_v1::model::TerraformError;
3203 /// let x = Revision::new()
3204 /// .set_tf_errors([
3205 /// TerraformError::default()/* use setters */,
3206 /// TerraformError::default()/* use (different) setters */,
3207 /// ]);
3208 /// ```
3209 pub fn set_tf_errors<T, V>(mut self, v: T) -> Self
3210 where
3211 T: std::iter::IntoIterator<Item = V>,
3212 V: std::convert::Into<crate::model::TerraformError>,
3213 {
3214 use std::iter::Iterator;
3215 self.tf_errors = v.into_iter().map(|i| i.into()).collect();
3216 self
3217 }
3218
3219 /// Sets the value of [error_logs][crate::model::Revision::error_logs].
3220 ///
3221 /// # Example
3222 /// ```ignore,no_run
3223 /// # use google_cloud_config_v1::model::Revision;
3224 /// let x = Revision::new().set_error_logs("example");
3225 /// ```
3226 pub fn set_error_logs<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3227 self.error_logs = v.into();
3228 self
3229 }
3230
3231 /// Sets the value of [service_account][crate::model::Revision::service_account].
3232 ///
3233 /// # Example
3234 /// ```ignore,no_run
3235 /// # use google_cloud_config_v1::model::Revision;
3236 /// let x = Revision::new().set_service_account("example");
3237 /// ```
3238 pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3239 self.service_account = v.into();
3240 self
3241 }
3242
3243 /// Sets the value of [import_existing_resources][crate::model::Revision::import_existing_resources].
3244 ///
3245 /// # Example
3246 /// ```ignore,no_run
3247 /// # use google_cloud_config_v1::model::Revision;
3248 /// let x = Revision::new().set_import_existing_resources(true);
3249 /// ```
3250 pub fn set_import_existing_resources<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3251 self.import_existing_resources = v.into();
3252 self
3253 }
3254
3255 /// Sets the value of [worker_pool][crate::model::Revision::worker_pool].
3256 ///
3257 /// # Example
3258 /// ```ignore,no_run
3259 /// # use google_cloud_config_v1::model::Revision;
3260 /// let x = Revision::new().set_worker_pool("example");
3261 /// ```
3262 pub fn set_worker_pool<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3263 self.worker_pool = v.into();
3264 self
3265 }
3266
3267 /// Sets the value of [tf_version_constraint][crate::model::Revision::tf_version_constraint].
3268 ///
3269 /// # Example
3270 /// ```ignore,no_run
3271 /// # use google_cloud_config_v1::model::Revision;
3272 /// let x = Revision::new().set_tf_version_constraint("example");
3273 /// ```
3274 pub fn set_tf_version_constraint<T: std::convert::Into<std::string::String>>(
3275 mut self,
3276 v: T,
3277 ) -> Self {
3278 self.tf_version_constraint = v.into();
3279 self
3280 }
3281
3282 /// Sets the value of [tf_version][crate::model::Revision::tf_version].
3283 ///
3284 /// # Example
3285 /// ```ignore,no_run
3286 /// # use google_cloud_config_v1::model::Revision;
3287 /// let x = Revision::new().set_tf_version("example");
3288 /// ```
3289 pub fn set_tf_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3290 self.tf_version = v.into();
3291 self
3292 }
3293
3294 /// Sets the value of [quota_validation_results][crate::model::Revision::quota_validation_results].
3295 ///
3296 /// # Example
3297 /// ```ignore,no_run
3298 /// # use google_cloud_config_v1::model::Revision;
3299 /// let x = Revision::new().set_quota_validation_results("example");
3300 /// ```
3301 pub fn set_quota_validation_results<T: std::convert::Into<std::string::String>>(
3302 mut self,
3303 v: T,
3304 ) -> Self {
3305 self.quota_validation_results = v.into();
3306 self
3307 }
3308
3309 /// Sets the value of [quota_validation][crate::model::Revision::quota_validation].
3310 ///
3311 /// # Example
3312 /// ```ignore,no_run
3313 /// # use google_cloud_config_v1::model::Revision;
3314 /// use google_cloud_config_v1::model::QuotaValidation;
3315 /// let x0 = Revision::new().set_quota_validation(QuotaValidation::Enabled);
3316 /// let x1 = Revision::new().set_quota_validation(QuotaValidation::Enforced);
3317 /// ```
3318 pub fn set_quota_validation<T: std::convert::Into<crate::model::QuotaValidation>>(
3319 mut self,
3320 v: T,
3321 ) -> Self {
3322 self.quota_validation = v.into();
3323 self
3324 }
3325
3326 /// Sets the value of [provider_config][crate::model::Revision::provider_config].
3327 ///
3328 /// # Example
3329 /// ```ignore,no_run
3330 /// # use google_cloud_config_v1::model::Revision;
3331 /// use google_cloud_config_v1::model::ProviderConfig;
3332 /// let x = Revision::new().set_provider_config(ProviderConfig::default()/* use setters */);
3333 /// ```
3334 pub fn set_provider_config<T>(mut self, v: T) -> Self
3335 where
3336 T: std::convert::Into<crate::model::ProviderConfig>,
3337 {
3338 self.provider_config = std::option::Option::Some(v.into());
3339 self
3340 }
3341
3342 /// Sets or clears the value of [provider_config][crate::model::Revision::provider_config].
3343 ///
3344 /// # Example
3345 /// ```ignore,no_run
3346 /// # use google_cloud_config_v1::model::Revision;
3347 /// use google_cloud_config_v1::model::ProviderConfig;
3348 /// let x = Revision::new().set_or_clear_provider_config(Some(ProviderConfig::default()/* use setters */));
3349 /// let x = Revision::new().set_or_clear_provider_config(None::<ProviderConfig>);
3350 /// ```
3351 pub fn set_or_clear_provider_config<T>(mut self, v: std::option::Option<T>) -> Self
3352 where
3353 T: std::convert::Into<crate::model::ProviderConfig>,
3354 {
3355 self.provider_config = v.map(|x| x.into());
3356 self
3357 }
3358
3359 /// Sets the value of [blueprint][crate::model::Revision::blueprint].
3360 ///
3361 /// Note that all the setters affecting `blueprint` are mutually
3362 /// exclusive.
3363 ///
3364 /// # Example
3365 /// ```ignore,no_run
3366 /// # use google_cloud_config_v1::model::Revision;
3367 /// use google_cloud_config_v1::model::TerraformBlueprint;
3368 /// let x = Revision::new().set_blueprint(Some(
3369 /// google_cloud_config_v1::model::revision::Blueprint::TerraformBlueprint(TerraformBlueprint::default().into())));
3370 /// ```
3371 pub fn set_blueprint<
3372 T: std::convert::Into<std::option::Option<crate::model::revision::Blueprint>>,
3373 >(
3374 mut self,
3375 v: T,
3376 ) -> Self {
3377 self.blueprint = v.into();
3378 self
3379 }
3380
3381 /// The value of [blueprint][crate::model::Revision::blueprint]
3382 /// if it holds a `TerraformBlueprint`, `None` if the field is not set or
3383 /// holds a different branch.
3384 pub fn terraform_blueprint(
3385 &self,
3386 ) -> std::option::Option<&std::boxed::Box<crate::model::TerraformBlueprint>> {
3387 #[allow(unreachable_patterns)]
3388 self.blueprint.as_ref().and_then(|v| match v {
3389 crate::model::revision::Blueprint::TerraformBlueprint(v) => {
3390 std::option::Option::Some(v)
3391 }
3392 _ => std::option::Option::None,
3393 })
3394 }
3395
3396 /// Sets the value of [blueprint][crate::model::Revision::blueprint]
3397 /// to hold a `TerraformBlueprint`.
3398 ///
3399 /// Note that all the setters affecting `blueprint` are
3400 /// mutually exclusive.
3401 ///
3402 /// # Example
3403 /// ```ignore,no_run
3404 /// # use google_cloud_config_v1::model::Revision;
3405 /// use google_cloud_config_v1::model::TerraformBlueprint;
3406 /// let x = Revision::new().set_terraform_blueprint(TerraformBlueprint::default()/* use setters */);
3407 /// assert!(x.terraform_blueprint().is_some());
3408 /// ```
3409 pub fn set_terraform_blueprint<
3410 T: std::convert::Into<std::boxed::Box<crate::model::TerraformBlueprint>>,
3411 >(
3412 mut self,
3413 v: T,
3414 ) -> Self {
3415 self.blueprint = std::option::Option::Some(
3416 crate::model::revision::Blueprint::TerraformBlueprint(v.into()),
3417 );
3418 self
3419 }
3420}
3421
3422impl wkt::message::Message for Revision {
3423 fn typename() -> &'static str {
3424 "type.googleapis.com/google.cloud.config.v1.Revision"
3425 }
3426}
3427
3428/// Defines additional types related to [Revision].
3429pub mod revision {
3430 #[allow(unused_imports)]
3431 use super::*;
3432
3433 /// Actions that generate a revision.
3434 ///
3435 /// # Working with unknown values
3436 ///
3437 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3438 /// additional enum variants at any time. Adding new variants is not considered
3439 /// a breaking change. Applications should write their code in anticipation of:
3440 ///
3441 /// - New values appearing in future releases of the client library, **and**
3442 /// - New values received dynamically, without application changes.
3443 ///
3444 /// Please consult the [Working with enums] section in the user guide for some
3445 /// guidelines.
3446 ///
3447 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
3448 #[derive(Clone, Debug, PartialEq)]
3449 #[non_exhaustive]
3450 pub enum Action {
3451 /// The default value. This value is used if the action is omitted.
3452 Unspecified,
3453 /// The revision was generated by creating a deployment.
3454 Create,
3455 /// The revision was generated by updating a deployment.
3456 Update,
3457 /// The revision was deleted.
3458 Delete,
3459 /// If set, the enum was initialized with an unknown value.
3460 ///
3461 /// Applications can examine the value using [Action::value] or
3462 /// [Action::name].
3463 UnknownValue(action::UnknownValue),
3464 }
3465
3466 #[doc(hidden)]
3467 pub mod action {
3468 #[allow(unused_imports)]
3469 use super::*;
3470 #[derive(Clone, Debug, PartialEq)]
3471 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3472 }
3473
3474 impl Action {
3475 /// Gets the enum value.
3476 ///
3477 /// Returns `None` if the enum contains an unknown value deserialized from
3478 /// the string representation of enums.
3479 pub fn value(&self) -> std::option::Option<i32> {
3480 match self {
3481 Self::Unspecified => std::option::Option::Some(0),
3482 Self::Create => std::option::Option::Some(1),
3483 Self::Update => std::option::Option::Some(2),
3484 Self::Delete => std::option::Option::Some(3),
3485 Self::UnknownValue(u) => u.0.value(),
3486 }
3487 }
3488
3489 /// Gets the enum value as a string.
3490 ///
3491 /// Returns `None` if the enum contains an unknown value deserialized from
3492 /// the integer representation of enums.
3493 pub fn name(&self) -> std::option::Option<&str> {
3494 match self {
3495 Self::Unspecified => std::option::Option::Some("ACTION_UNSPECIFIED"),
3496 Self::Create => std::option::Option::Some("CREATE"),
3497 Self::Update => std::option::Option::Some("UPDATE"),
3498 Self::Delete => std::option::Option::Some("DELETE"),
3499 Self::UnknownValue(u) => u.0.name(),
3500 }
3501 }
3502 }
3503
3504 impl std::default::Default for Action {
3505 fn default() -> Self {
3506 use std::convert::From;
3507 Self::from(0)
3508 }
3509 }
3510
3511 impl std::fmt::Display for Action {
3512 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3513 wkt::internal::display_enum(f, self.name(), self.value())
3514 }
3515 }
3516
3517 impl std::convert::From<i32> for Action {
3518 fn from(value: i32) -> Self {
3519 match value {
3520 0 => Self::Unspecified,
3521 1 => Self::Create,
3522 2 => Self::Update,
3523 3 => Self::Delete,
3524 _ => Self::UnknownValue(action::UnknownValue(
3525 wkt::internal::UnknownEnumValue::Integer(value),
3526 )),
3527 }
3528 }
3529 }
3530
3531 impl std::convert::From<&str> for Action {
3532 fn from(value: &str) -> Self {
3533 use std::string::ToString;
3534 match value {
3535 "ACTION_UNSPECIFIED" => Self::Unspecified,
3536 "CREATE" => Self::Create,
3537 "UPDATE" => Self::Update,
3538 "DELETE" => Self::Delete,
3539 _ => Self::UnknownValue(action::UnknownValue(
3540 wkt::internal::UnknownEnumValue::String(value.to_string()),
3541 )),
3542 }
3543 }
3544 }
3545
3546 impl serde::ser::Serialize for Action {
3547 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3548 where
3549 S: serde::Serializer,
3550 {
3551 match self {
3552 Self::Unspecified => serializer.serialize_i32(0),
3553 Self::Create => serializer.serialize_i32(1),
3554 Self::Update => serializer.serialize_i32(2),
3555 Self::Delete => serializer.serialize_i32(3),
3556 Self::UnknownValue(u) => u.0.serialize(serializer),
3557 }
3558 }
3559 }
3560
3561 impl<'de> serde::de::Deserialize<'de> for Action {
3562 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3563 where
3564 D: serde::Deserializer<'de>,
3565 {
3566 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Action>::new(
3567 ".google.cloud.config.v1.Revision.Action",
3568 ))
3569 }
3570 }
3571
3572 /// Possible states of a revision.
3573 ///
3574 /// # Working with unknown values
3575 ///
3576 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3577 /// additional enum variants at any time. Adding new variants is not considered
3578 /// a breaking change. Applications should write their code in anticipation of:
3579 ///
3580 /// - New values appearing in future releases of the client library, **and**
3581 /// - New values received dynamically, without application changes.
3582 ///
3583 /// Please consult the [Working with enums] section in the user guide for some
3584 /// guidelines.
3585 ///
3586 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
3587 #[derive(Clone, Debug, PartialEq)]
3588 #[non_exhaustive]
3589 pub enum State {
3590 /// The default value. This value is used if the state is omitted.
3591 Unspecified,
3592 /// The revision is being applied.
3593 Applying,
3594 /// The revision was applied successfully.
3595 Applied,
3596 /// The revision could not be applied successfully.
3597 Failed,
3598 /// If set, the enum was initialized with an unknown value.
3599 ///
3600 /// Applications can examine the value using [State::value] or
3601 /// [State::name].
3602 UnknownValue(state::UnknownValue),
3603 }
3604
3605 #[doc(hidden)]
3606 pub mod state {
3607 #[allow(unused_imports)]
3608 use super::*;
3609 #[derive(Clone, Debug, PartialEq)]
3610 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3611 }
3612
3613 impl State {
3614 /// Gets the enum value.
3615 ///
3616 /// Returns `None` if the enum contains an unknown value deserialized from
3617 /// the string representation of enums.
3618 pub fn value(&self) -> std::option::Option<i32> {
3619 match self {
3620 Self::Unspecified => std::option::Option::Some(0),
3621 Self::Applying => std::option::Option::Some(1),
3622 Self::Applied => std::option::Option::Some(2),
3623 Self::Failed => std::option::Option::Some(3),
3624 Self::UnknownValue(u) => u.0.value(),
3625 }
3626 }
3627
3628 /// Gets the enum value as a string.
3629 ///
3630 /// Returns `None` if the enum contains an unknown value deserialized from
3631 /// the integer representation of enums.
3632 pub fn name(&self) -> std::option::Option<&str> {
3633 match self {
3634 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
3635 Self::Applying => std::option::Option::Some("APPLYING"),
3636 Self::Applied => std::option::Option::Some("APPLIED"),
3637 Self::Failed => std::option::Option::Some("FAILED"),
3638 Self::UnknownValue(u) => u.0.name(),
3639 }
3640 }
3641 }
3642
3643 impl std::default::Default for State {
3644 fn default() -> Self {
3645 use std::convert::From;
3646 Self::from(0)
3647 }
3648 }
3649
3650 impl std::fmt::Display for State {
3651 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3652 wkt::internal::display_enum(f, self.name(), self.value())
3653 }
3654 }
3655
3656 impl std::convert::From<i32> for State {
3657 fn from(value: i32) -> Self {
3658 match value {
3659 0 => Self::Unspecified,
3660 1 => Self::Applying,
3661 2 => Self::Applied,
3662 3 => Self::Failed,
3663 _ => Self::UnknownValue(state::UnknownValue(
3664 wkt::internal::UnknownEnumValue::Integer(value),
3665 )),
3666 }
3667 }
3668 }
3669
3670 impl std::convert::From<&str> for State {
3671 fn from(value: &str) -> Self {
3672 use std::string::ToString;
3673 match value {
3674 "STATE_UNSPECIFIED" => Self::Unspecified,
3675 "APPLYING" => Self::Applying,
3676 "APPLIED" => Self::Applied,
3677 "FAILED" => Self::Failed,
3678 _ => Self::UnknownValue(state::UnknownValue(
3679 wkt::internal::UnknownEnumValue::String(value.to_string()),
3680 )),
3681 }
3682 }
3683 }
3684
3685 impl serde::ser::Serialize for State {
3686 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3687 where
3688 S: serde::Serializer,
3689 {
3690 match self {
3691 Self::Unspecified => serializer.serialize_i32(0),
3692 Self::Applying => serializer.serialize_i32(1),
3693 Self::Applied => serializer.serialize_i32(2),
3694 Self::Failed => serializer.serialize_i32(3),
3695 Self::UnknownValue(u) => u.0.serialize(serializer),
3696 }
3697 }
3698 }
3699
3700 impl<'de> serde::de::Deserialize<'de> for State {
3701 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3702 where
3703 D: serde::Deserializer<'de>,
3704 {
3705 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
3706 ".google.cloud.config.v1.Revision.State",
3707 ))
3708 }
3709 }
3710
3711 /// Possible errors if Revision could not be created or updated successfully.
3712 ///
3713 /// # Working with unknown values
3714 ///
3715 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3716 /// additional enum variants at any time. Adding new variants is not considered
3717 /// a breaking change. Applications should write their code in anticipation of:
3718 ///
3719 /// - New values appearing in future releases of the client library, **and**
3720 /// - New values received dynamically, without application changes.
3721 ///
3722 /// Please consult the [Working with enums] section in the user guide for some
3723 /// guidelines.
3724 ///
3725 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
3726 #[derive(Clone, Debug, PartialEq)]
3727 #[non_exhaustive]
3728 pub enum ErrorCode {
3729 /// No error code was specified.
3730 Unspecified,
3731 /// Cloud Build failed due to a permission issue.
3732 CloudBuildPermissionDenied,
3733 /// Cloud Build job associated with creating or updating a deployment could
3734 /// not be started.
3735 ApplyBuildApiFailed,
3736 /// Cloud Build job associated with creating or updating a deployment was
3737 /// started but failed.
3738 ApplyBuildRunFailed,
3739 /// quota validation failed for one or more resources in terraform
3740 /// configuration files.
3741 QuotaValidationFailed,
3742 /// Failed to import values from an external source.
3743 ExternalValueSourceImportFailed,
3744 /// If set, the enum was initialized with an unknown value.
3745 ///
3746 /// Applications can examine the value using [ErrorCode::value] or
3747 /// [ErrorCode::name].
3748 UnknownValue(error_code::UnknownValue),
3749 }
3750
3751 #[doc(hidden)]
3752 pub mod error_code {
3753 #[allow(unused_imports)]
3754 use super::*;
3755 #[derive(Clone, Debug, PartialEq)]
3756 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3757 }
3758
3759 impl ErrorCode {
3760 /// Gets the enum value.
3761 ///
3762 /// Returns `None` if the enum contains an unknown value deserialized from
3763 /// the string representation of enums.
3764 pub fn value(&self) -> std::option::Option<i32> {
3765 match self {
3766 Self::Unspecified => std::option::Option::Some(0),
3767 Self::CloudBuildPermissionDenied => std::option::Option::Some(1),
3768 Self::ApplyBuildApiFailed => std::option::Option::Some(4),
3769 Self::ApplyBuildRunFailed => std::option::Option::Some(5),
3770 Self::QuotaValidationFailed => std::option::Option::Some(7),
3771 Self::ExternalValueSourceImportFailed => std::option::Option::Some(8),
3772 Self::UnknownValue(u) => u.0.value(),
3773 }
3774 }
3775
3776 /// Gets the enum value as a string.
3777 ///
3778 /// Returns `None` if the enum contains an unknown value deserialized from
3779 /// the integer representation of enums.
3780 pub fn name(&self) -> std::option::Option<&str> {
3781 match self {
3782 Self::Unspecified => std::option::Option::Some("ERROR_CODE_UNSPECIFIED"),
3783 Self::CloudBuildPermissionDenied => {
3784 std::option::Option::Some("CLOUD_BUILD_PERMISSION_DENIED")
3785 }
3786 Self::ApplyBuildApiFailed => std::option::Option::Some("APPLY_BUILD_API_FAILED"),
3787 Self::ApplyBuildRunFailed => std::option::Option::Some("APPLY_BUILD_RUN_FAILED"),
3788 Self::QuotaValidationFailed => std::option::Option::Some("QUOTA_VALIDATION_FAILED"),
3789 Self::ExternalValueSourceImportFailed => {
3790 std::option::Option::Some("EXTERNAL_VALUE_SOURCE_IMPORT_FAILED")
3791 }
3792 Self::UnknownValue(u) => u.0.name(),
3793 }
3794 }
3795 }
3796
3797 impl std::default::Default for ErrorCode {
3798 fn default() -> Self {
3799 use std::convert::From;
3800 Self::from(0)
3801 }
3802 }
3803
3804 impl std::fmt::Display for ErrorCode {
3805 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3806 wkt::internal::display_enum(f, self.name(), self.value())
3807 }
3808 }
3809
3810 impl std::convert::From<i32> for ErrorCode {
3811 fn from(value: i32) -> Self {
3812 match value {
3813 0 => Self::Unspecified,
3814 1 => Self::CloudBuildPermissionDenied,
3815 4 => Self::ApplyBuildApiFailed,
3816 5 => Self::ApplyBuildRunFailed,
3817 7 => Self::QuotaValidationFailed,
3818 8 => Self::ExternalValueSourceImportFailed,
3819 _ => Self::UnknownValue(error_code::UnknownValue(
3820 wkt::internal::UnknownEnumValue::Integer(value),
3821 )),
3822 }
3823 }
3824 }
3825
3826 impl std::convert::From<&str> for ErrorCode {
3827 fn from(value: &str) -> Self {
3828 use std::string::ToString;
3829 match value {
3830 "ERROR_CODE_UNSPECIFIED" => Self::Unspecified,
3831 "CLOUD_BUILD_PERMISSION_DENIED" => Self::CloudBuildPermissionDenied,
3832 "APPLY_BUILD_API_FAILED" => Self::ApplyBuildApiFailed,
3833 "APPLY_BUILD_RUN_FAILED" => Self::ApplyBuildRunFailed,
3834 "QUOTA_VALIDATION_FAILED" => Self::QuotaValidationFailed,
3835 "EXTERNAL_VALUE_SOURCE_IMPORT_FAILED" => Self::ExternalValueSourceImportFailed,
3836 _ => Self::UnknownValue(error_code::UnknownValue(
3837 wkt::internal::UnknownEnumValue::String(value.to_string()),
3838 )),
3839 }
3840 }
3841 }
3842
3843 impl serde::ser::Serialize for ErrorCode {
3844 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3845 where
3846 S: serde::Serializer,
3847 {
3848 match self {
3849 Self::Unspecified => serializer.serialize_i32(0),
3850 Self::CloudBuildPermissionDenied => serializer.serialize_i32(1),
3851 Self::ApplyBuildApiFailed => serializer.serialize_i32(4),
3852 Self::ApplyBuildRunFailed => serializer.serialize_i32(5),
3853 Self::QuotaValidationFailed => serializer.serialize_i32(7),
3854 Self::ExternalValueSourceImportFailed => serializer.serialize_i32(8),
3855 Self::UnknownValue(u) => u.0.serialize(serializer),
3856 }
3857 }
3858 }
3859
3860 impl<'de> serde::de::Deserialize<'de> for ErrorCode {
3861 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3862 where
3863 D: serde::Deserializer<'de>,
3864 {
3865 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ErrorCode>::new(
3866 ".google.cloud.config.v1.Revision.ErrorCode",
3867 ))
3868 }
3869 }
3870
3871 /// Blueprint that was deployed.
3872 #[derive(Clone, Debug, PartialEq)]
3873 #[non_exhaustive]
3874 pub enum Blueprint {
3875 /// Output only. A blueprint described using Terraform's HashiCorp
3876 /// Configuration Language as a root module.
3877 TerraformBlueprint(std::boxed::Box<crate::model::TerraformBlueprint>),
3878 }
3879}
3880
3881/// Errors encountered during actuation using Terraform
3882#[derive(Clone, Default, PartialEq)]
3883#[non_exhaustive]
3884pub struct TerraformError {
3885 /// Address of the resource associated with the error,
3886 /// e.g. `google_compute_network.vpc_network`.
3887 pub resource_address: std::string::String,
3888
3889 /// HTTP response code returned from Google Cloud Platform APIs when Terraform
3890 /// fails to provision the resource. If unset or 0, no HTTP response code was
3891 /// returned by Terraform.
3892 pub http_response_code: i32,
3893
3894 /// A human-readable error description.
3895 pub error_description: std::string::String,
3896
3897 /// Output only. Original error response from underlying Google API, if
3898 /// available.
3899 pub error: std::option::Option<google_cloud_rpc::model::Status>,
3900
3901 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3902}
3903
3904impl TerraformError {
3905 pub fn new() -> Self {
3906 std::default::Default::default()
3907 }
3908
3909 /// Sets the value of [resource_address][crate::model::TerraformError::resource_address].
3910 ///
3911 /// # Example
3912 /// ```ignore,no_run
3913 /// # use google_cloud_config_v1::model::TerraformError;
3914 /// let x = TerraformError::new().set_resource_address("example");
3915 /// ```
3916 pub fn set_resource_address<T: std::convert::Into<std::string::String>>(
3917 mut self,
3918 v: T,
3919 ) -> Self {
3920 self.resource_address = v.into();
3921 self
3922 }
3923
3924 /// Sets the value of [http_response_code][crate::model::TerraformError::http_response_code].
3925 ///
3926 /// # Example
3927 /// ```ignore,no_run
3928 /// # use google_cloud_config_v1::model::TerraformError;
3929 /// let x = TerraformError::new().set_http_response_code(42);
3930 /// ```
3931 pub fn set_http_response_code<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3932 self.http_response_code = v.into();
3933 self
3934 }
3935
3936 /// Sets the value of [error_description][crate::model::TerraformError::error_description].
3937 ///
3938 /// # Example
3939 /// ```ignore,no_run
3940 /// # use google_cloud_config_v1::model::TerraformError;
3941 /// let x = TerraformError::new().set_error_description("example");
3942 /// ```
3943 pub fn set_error_description<T: std::convert::Into<std::string::String>>(
3944 mut self,
3945 v: T,
3946 ) -> Self {
3947 self.error_description = v.into();
3948 self
3949 }
3950
3951 /// Sets the value of [error][crate::model::TerraformError::error].
3952 ///
3953 /// # Example
3954 /// ```ignore,no_run
3955 /// # use google_cloud_config_v1::model::TerraformError;
3956 /// use google_cloud_rpc::model::Status;
3957 /// let x = TerraformError::new().set_error(Status::default()/* use setters */);
3958 /// ```
3959 pub fn set_error<T>(mut self, v: T) -> Self
3960 where
3961 T: std::convert::Into<google_cloud_rpc::model::Status>,
3962 {
3963 self.error = std::option::Option::Some(v.into());
3964 self
3965 }
3966
3967 /// Sets or clears the value of [error][crate::model::TerraformError::error].
3968 ///
3969 /// # Example
3970 /// ```ignore,no_run
3971 /// # use google_cloud_config_v1::model::TerraformError;
3972 /// use google_cloud_rpc::model::Status;
3973 /// let x = TerraformError::new().set_or_clear_error(Some(Status::default()/* use setters */));
3974 /// let x = TerraformError::new().set_or_clear_error(None::<Status>);
3975 /// ```
3976 pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
3977 where
3978 T: std::convert::Into<google_cloud_rpc::model::Status>,
3979 {
3980 self.error = v.map(|x| x.into());
3981 self
3982 }
3983}
3984
3985impl wkt::message::Message for TerraformError {
3986 fn typename() -> &'static str {
3987 "type.googleapis.com/google.cloud.config.v1.TerraformError"
3988 }
3989}
3990
3991/// A set of files in a Git repository.
3992#[derive(Clone, Default, PartialEq)]
3993#[non_exhaustive]
3994pub struct GitSource {
3995 /// Optional. Repository URL.
3996 /// Example: '<https://github.com/kubernetes/examples.git>'
3997 pub repo: std::option::Option<std::string::String>,
3998
3999 /// Optional. Subdirectory inside the repository.
4000 /// Example: 'staging/my-package'
4001 pub directory: std::option::Option<std::string::String>,
4002
4003 /// Optional. Git reference (e.g. branch or tag).
4004 pub r#ref: std::option::Option<std::string::String>,
4005
4006 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4007}
4008
4009impl GitSource {
4010 pub fn new() -> Self {
4011 std::default::Default::default()
4012 }
4013
4014 /// Sets the value of [repo][crate::model::GitSource::repo].
4015 ///
4016 /// # Example
4017 /// ```ignore,no_run
4018 /// # use google_cloud_config_v1::model::GitSource;
4019 /// let x = GitSource::new().set_repo("example");
4020 /// ```
4021 pub fn set_repo<T>(mut self, v: T) -> Self
4022 where
4023 T: std::convert::Into<std::string::String>,
4024 {
4025 self.repo = std::option::Option::Some(v.into());
4026 self
4027 }
4028
4029 /// Sets or clears the value of [repo][crate::model::GitSource::repo].
4030 ///
4031 /// # Example
4032 /// ```ignore,no_run
4033 /// # use google_cloud_config_v1::model::GitSource;
4034 /// let x = GitSource::new().set_or_clear_repo(Some("example"));
4035 /// let x = GitSource::new().set_or_clear_repo(None::<String>);
4036 /// ```
4037 pub fn set_or_clear_repo<T>(mut self, v: std::option::Option<T>) -> Self
4038 where
4039 T: std::convert::Into<std::string::String>,
4040 {
4041 self.repo = v.map(|x| x.into());
4042 self
4043 }
4044
4045 /// Sets the value of [directory][crate::model::GitSource::directory].
4046 ///
4047 /// # Example
4048 /// ```ignore,no_run
4049 /// # use google_cloud_config_v1::model::GitSource;
4050 /// let x = GitSource::new().set_directory("example");
4051 /// ```
4052 pub fn set_directory<T>(mut self, v: T) -> Self
4053 where
4054 T: std::convert::Into<std::string::String>,
4055 {
4056 self.directory = std::option::Option::Some(v.into());
4057 self
4058 }
4059
4060 /// Sets or clears the value of [directory][crate::model::GitSource::directory].
4061 ///
4062 /// # Example
4063 /// ```ignore,no_run
4064 /// # use google_cloud_config_v1::model::GitSource;
4065 /// let x = GitSource::new().set_or_clear_directory(Some("example"));
4066 /// let x = GitSource::new().set_or_clear_directory(None::<String>);
4067 /// ```
4068 pub fn set_or_clear_directory<T>(mut self, v: std::option::Option<T>) -> Self
4069 where
4070 T: std::convert::Into<std::string::String>,
4071 {
4072 self.directory = v.map(|x| x.into());
4073 self
4074 }
4075
4076 /// Sets the value of [r#ref][crate::model::GitSource::ref].
4077 ///
4078 /// # Example
4079 /// ```ignore,no_run
4080 /// # use google_cloud_config_v1::model::GitSource;
4081 /// let x = GitSource::new().set_ref("example");
4082 /// ```
4083 pub fn set_ref<T>(mut self, v: T) -> Self
4084 where
4085 T: std::convert::Into<std::string::String>,
4086 {
4087 self.r#ref = std::option::Option::Some(v.into());
4088 self
4089 }
4090
4091 /// Sets or clears the value of [r#ref][crate::model::GitSource::ref].
4092 ///
4093 /// # Example
4094 /// ```ignore,no_run
4095 /// # use google_cloud_config_v1::model::GitSource;
4096 /// let x = GitSource::new().set_or_clear_ref(Some("example"));
4097 /// let x = GitSource::new().set_or_clear_ref(None::<String>);
4098 /// ```
4099 pub fn set_or_clear_ref<T>(mut self, v: std::option::Option<T>) -> Self
4100 where
4101 T: std::convert::Into<std::string::String>,
4102 {
4103 self.r#ref = v.map(|x| x.into());
4104 self
4105 }
4106}
4107
4108impl wkt::message::Message for GitSource {
4109 fn typename() -> &'static str {
4110 "type.googleapis.com/google.cloud.config.v1.GitSource"
4111 }
4112}
4113
4114/// Ephemeral metadata content describing the state of a deployment operation.
4115#[derive(Clone, Default, PartialEq)]
4116#[non_exhaustive]
4117pub struct DeploymentOperationMetadata {
4118 /// The current step the deployment operation is running.
4119 pub step: crate::model::deployment_operation_metadata::DeploymentStep,
4120
4121 /// Outputs and artifacts from applying a deployment.
4122 pub apply_results: std::option::Option<crate::model::ApplyResults>,
4123
4124 /// Output only. Cloud Build instance UUID associated with this operation.
4125 pub build: std::string::String,
4126
4127 /// Output only. Location of Deployment operations logs in
4128 /// `gs://{bucket}/{object}` format.
4129 pub logs: std::string::String,
4130
4131 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4132}
4133
4134impl DeploymentOperationMetadata {
4135 pub fn new() -> Self {
4136 std::default::Default::default()
4137 }
4138
4139 /// Sets the value of [step][crate::model::DeploymentOperationMetadata::step].
4140 ///
4141 /// # Example
4142 /// ```ignore,no_run
4143 /// # use google_cloud_config_v1::model::DeploymentOperationMetadata;
4144 /// use google_cloud_config_v1::model::deployment_operation_metadata::DeploymentStep;
4145 /// let x0 = DeploymentOperationMetadata::new().set_step(DeploymentStep::PreparingStorageBucket);
4146 /// let x1 = DeploymentOperationMetadata::new().set_step(DeploymentStep::DownloadingBlueprint);
4147 /// let x2 = DeploymentOperationMetadata::new().set_step(DeploymentStep::RunningTfInit);
4148 /// ```
4149 pub fn set_step<
4150 T: std::convert::Into<crate::model::deployment_operation_metadata::DeploymentStep>,
4151 >(
4152 mut self,
4153 v: T,
4154 ) -> Self {
4155 self.step = v.into();
4156 self
4157 }
4158
4159 /// Sets the value of [apply_results][crate::model::DeploymentOperationMetadata::apply_results].
4160 ///
4161 /// # Example
4162 /// ```ignore,no_run
4163 /// # use google_cloud_config_v1::model::DeploymentOperationMetadata;
4164 /// use google_cloud_config_v1::model::ApplyResults;
4165 /// let x = DeploymentOperationMetadata::new().set_apply_results(ApplyResults::default()/* use setters */);
4166 /// ```
4167 pub fn set_apply_results<T>(mut self, v: T) -> Self
4168 where
4169 T: std::convert::Into<crate::model::ApplyResults>,
4170 {
4171 self.apply_results = std::option::Option::Some(v.into());
4172 self
4173 }
4174
4175 /// Sets or clears the value of [apply_results][crate::model::DeploymentOperationMetadata::apply_results].
4176 ///
4177 /// # Example
4178 /// ```ignore,no_run
4179 /// # use google_cloud_config_v1::model::DeploymentOperationMetadata;
4180 /// use google_cloud_config_v1::model::ApplyResults;
4181 /// let x = DeploymentOperationMetadata::new().set_or_clear_apply_results(Some(ApplyResults::default()/* use setters */));
4182 /// let x = DeploymentOperationMetadata::new().set_or_clear_apply_results(None::<ApplyResults>);
4183 /// ```
4184 pub fn set_or_clear_apply_results<T>(mut self, v: std::option::Option<T>) -> Self
4185 where
4186 T: std::convert::Into<crate::model::ApplyResults>,
4187 {
4188 self.apply_results = v.map(|x| x.into());
4189 self
4190 }
4191
4192 /// Sets the value of [build][crate::model::DeploymentOperationMetadata::build].
4193 ///
4194 /// # Example
4195 /// ```ignore,no_run
4196 /// # use google_cloud_config_v1::model::DeploymentOperationMetadata;
4197 /// let x = DeploymentOperationMetadata::new().set_build("example");
4198 /// ```
4199 pub fn set_build<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4200 self.build = v.into();
4201 self
4202 }
4203
4204 /// Sets the value of [logs][crate::model::DeploymentOperationMetadata::logs].
4205 ///
4206 /// # Example
4207 /// ```ignore,no_run
4208 /// # use google_cloud_config_v1::model::DeploymentOperationMetadata;
4209 /// let x = DeploymentOperationMetadata::new().set_logs("example");
4210 /// ```
4211 pub fn set_logs<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4212 self.logs = v.into();
4213 self
4214 }
4215}
4216
4217impl wkt::message::Message for DeploymentOperationMetadata {
4218 fn typename() -> &'static str {
4219 "type.googleapis.com/google.cloud.config.v1.DeploymentOperationMetadata"
4220 }
4221}
4222
4223/// Defines additional types related to [DeploymentOperationMetadata].
4224pub mod deployment_operation_metadata {
4225 #[allow(unused_imports)]
4226 use super::*;
4227
4228 /// The possible steps a deployment may be running.
4229 ///
4230 /// # Working with unknown values
4231 ///
4232 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4233 /// additional enum variants at any time. Adding new variants is not considered
4234 /// a breaking change. Applications should write their code in anticipation of:
4235 ///
4236 /// - New values appearing in future releases of the client library, **and**
4237 /// - New values received dynamically, without application changes.
4238 ///
4239 /// Please consult the [Working with enums] section in the user guide for some
4240 /// guidelines.
4241 ///
4242 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
4243 #[derive(Clone, Debug, PartialEq)]
4244 #[non_exhaustive]
4245 pub enum DeploymentStep {
4246 /// Unspecified deployment step
4247 Unspecified,
4248 /// Infra Manager is creating a Google Cloud Storage bucket to store
4249 /// artifacts and metadata about the deployment and revision
4250 PreparingStorageBucket,
4251 /// Downloading the blueprint onto the Google Cloud Storage bucket
4252 DownloadingBlueprint,
4253 /// Initializing Terraform using `terraform init`
4254 RunningTfInit,
4255 /// Running `terraform plan`
4256 RunningTfPlan,
4257 /// Actuating resources using Terraform using `terraform apply`
4258 RunningTfApply,
4259 /// Destroying resources using Terraform using `terraform destroy`
4260 RunningTfDestroy,
4261 /// Validating the uploaded TF state file when unlocking a deployment
4262 RunningTfValidate,
4263 /// Unlocking a deployment
4264 UnlockingDeployment,
4265 /// Operation was successful
4266 Succeeded,
4267 /// Operation failed
4268 Failed,
4269 /// Validating the provided repository.
4270 ValidatingRepository,
4271 /// Running quota validation
4272 RunningQuotaValidation,
4273 /// If set, the enum was initialized with an unknown value.
4274 ///
4275 /// Applications can examine the value using [DeploymentStep::value] or
4276 /// [DeploymentStep::name].
4277 UnknownValue(deployment_step::UnknownValue),
4278 }
4279
4280 #[doc(hidden)]
4281 pub mod deployment_step {
4282 #[allow(unused_imports)]
4283 use super::*;
4284 #[derive(Clone, Debug, PartialEq)]
4285 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4286 }
4287
4288 impl DeploymentStep {
4289 /// Gets the enum value.
4290 ///
4291 /// Returns `None` if the enum contains an unknown value deserialized from
4292 /// the string representation of enums.
4293 pub fn value(&self) -> std::option::Option<i32> {
4294 match self {
4295 Self::Unspecified => std::option::Option::Some(0),
4296 Self::PreparingStorageBucket => std::option::Option::Some(1),
4297 Self::DownloadingBlueprint => std::option::Option::Some(2),
4298 Self::RunningTfInit => std::option::Option::Some(3),
4299 Self::RunningTfPlan => std::option::Option::Some(4),
4300 Self::RunningTfApply => std::option::Option::Some(5),
4301 Self::RunningTfDestroy => std::option::Option::Some(6),
4302 Self::RunningTfValidate => std::option::Option::Some(7),
4303 Self::UnlockingDeployment => std::option::Option::Some(8),
4304 Self::Succeeded => std::option::Option::Some(9),
4305 Self::Failed => std::option::Option::Some(10),
4306 Self::ValidatingRepository => std::option::Option::Some(11),
4307 Self::RunningQuotaValidation => std::option::Option::Some(12),
4308 Self::UnknownValue(u) => u.0.value(),
4309 }
4310 }
4311
4312 /// Gets the enum value as a string.
4313 ///
4314 /// Returns `None` if the enum contains an unknown value deserialized from
4315 /// the integer representation of enums.
4316 pub fn name(&self) -> std::option::Option<&str> {
4317 match self {
4318 Self::Unspecified => std::option::Option::Some("DEPLOYMENT_STEP_UNSPECIFIED"),
4319 Self::PreparingStorageBucket => {
4320 std::option::Option::Some("PREPARING_STORAGE_BUCKET")
4321 }
4322 Self::DownloadingBlueprint => std::option::Option::Some("DOWNLOADING_BLUEPRINT"),
4323 Self::RunningTfInit => std::option::Option::Some("RUNNING_TF_INIT"),
4324 Self::RunningTfPlan => std::option::Option::Some("RUNNING_TF_PLAN"),
4325 Self::RunningTfApply => std::option::Option::Some("RUNNING_TF_APPLY"),
4326 Self::RunningTfDestroy => std::option::Option::Some("RUNNING_TF_DESTROY"),
4327 Self::RunningTfValidate => std::option::Option::Some("RUNNING_TF_VALIDATE"),
4328 Self::UnlockingDeployment => std::option::Option::Some("UNLOCKING_DEPLOYMENT"),
4329 Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
4330 Self::Failed => std::option::Option::Some("FAILED"),
4331 Self::ValidatingRepository => std::option::Option::Some("VALIDATING_REPOSITORY"),
4332 Self::RunningQuotaValidation => {
4333 std::option::Option::Some("RUNNING_QUOTA_VALIDATION")
4334 }
4335 Self::UnknownValue(u) => u.0.name(),
4336 }
4337 }
4338 }
4339
4340 impl std::default::Default for DeploymentStep {
4341 fn default() -> Self {
4342 use std::convert::From;
4343 Self::from(0)
4344 }
4345 }
4346
4347 impl std::fmt::Display for DeploymentStep {
4348 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4349 wkt::internal::display_enum(f, self.name(), self.value())
4350 }
4351 }
4352
4353 impl std::convert::From<i32> for DeploymentStep {
4354 fn from(value: i32) -> Self {
4355 match value {
4356 0 => Self::Unspecified,
4357 1 => Self::PreparingStorageBucket,
4358 2 => Self::DownloadingBlueprint,
4359 3 => Self::RunningTfInit,
4360 4 => Self::RunningTfPlan,
4361 5 => Self::RunningTfApply,
4362 6 => Self::RunningTfDestroy,
4363 7 => Self::RunningTfValidate,
4364 8 => Self::UnlockingDeployment,
4365 9 => Self::Succeeded,
4366 10 => Self::Failed,
4367 11 => Self::ValidatingRepository,
4368 12 => Self::RunningQuotaValidation,
4369 _ => Self::UnknownValue(deployment_step::UnknownValue(
4370 wkt::internal::UnknownEnumValue::Integer(value),
4371 )),
4372 }
4373 }
4374 }
4375
4376 impl std::convert::From<&str> for DeploymentStep {
4377 fn from(value: &str) -> Self {
4378 use std::string::ToString;
4379 match value {
4380 "DEPLOYMENT_STEP_UNSPECIFIED" => Self::Unspecified,
4381 "PREPARING_STORAGE_BUCKET" => Self::PreparingStorageBucket,
4382 "DOWNLOADING_BLUEPRINT" => Self::DownloadingBlueprint,
4383 "RUNNING_TF_INIT" => Self::RunningTfInit,
4384 "RUNNING_TF_PLAN" => Self::RunningTfPlan,
4385 "RUNNING_TF_APPLY" => Self::RunningTfApply,
4386 "RUNNING_TF_DESTROY" => Self::RunningTfDestroy,
4387 "RUNNING_TF_VALIDATE" => Self::RunningTfValidate,
4388 "UNLOCKING_DEPLOYMENT" => Self::UnlockingDeployment,
4389 "SUCCEEDED" => Self::Succeeded,
4390 "FAILED" => Self::Failed,
4391 "VALIDATING_REPOSITORY" => Self::ValidatingRepository,
4392 "RUNNING_QUOTA_VALIDATION" => Self::RunningQuotaValidation,
4393 _ => Self::UnknownValue(deployment_step::UnknownValue(
4394 wkt::internal::UnknownEnumValue::String(value.to_string()),
4395 )),
4396 }
4397 }
4398 }
4399
4400 impl serde::ser::Serialize for DeploymentStep {
4401 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4402 where
4403 S: serde::Serializer,
4404 {
4405 match self {
4406 Self::Unspecified => serializer.serialize_i32(0),
4407 Self::PreparingStorageBucket => serializer.serialize_i32(1),
4408 Self::DownloadingBlueprint => serializer.serialize_i32(2),
4409 Self::RunningTfInit => serializer.serialize_i32(3),
4410 Self::RunningTfPlan => serializer.serialize_i32(4),
4411 Self::RunningTfApply => serializer.serialize_i32(5),
4412 Self::RunningTfDestroy => serializer.serialize_i32(6),
4413 Self::RunningTfValidate => serializer.serialize_i32(7),
4414 Self::UnlockingDeployment => serializer.serialize_i32(8),
4415 Self::Succeeded => serializer.serialize_i32(9),
4416 Self::Failed => serializer.serialize_i32(10),
4417 Self::ValidatingRepository => serializer.serialize_i32(11),
4418 Self::RunningQuotaValidation => serializer.serialize_i32(12),
4419 Self::UnknownValue(u) => u.0.serialize(serializer),
4420 }
4421 }
4422 }
4423
4424 impl<'de> serde::de::Deserialize<'de> for DeploymentStep {
4425 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4426 where
4427 D: serde::Deserializer<'de>,
4428 {
4429 deserializer.deserialize_any(wkt::internal::EnumVisitor::<DeploymentStep>::new(
4430 ".google.cloud.config.v1.DeploymentOperationMetadata.DeploymentStep",
4431 ))
4432 }
4433 }
4434}
4435
4436/// Resource represents a Google Cloud Platform resource actuated by IM.
4437/// Resources are child resources of Revisions.
4438#[derive(Clone, Default, PartialEq)]
4439#[non_exhaustive]
4440pub struct Resource {
4441 /// Output only. Resource name.
4442 /// Format:
4443 /// `projects/{project}/locations/{location}/deployments/{deployment}/revisions/{revision}/resources/{resource}`
4444 pub name: std::string::String,
4445
4446 /// Output only. Terraform-specific info if this resource was created using
4447 /// Terraform.
4448 pub terraform_info: std::option::Option<crate::model::ResourceTerraformInfo>,
4449
4450 /// Output only. Map of Cloud Asset Inventory (CAI) type to CAI info (e.g. CAI
4451 /// ID). CAI type format follows
4452 /// <https://cloud.google.com/asset-inventory/docs/supported-asset-types>
4453 pub cai_assets: std::collections::HashMap<std::string::String, crate::model::ResourceCAIInfo>,
4454
4455 /// Output only. Intent of the resource.
4456 pub intent: crate::model::resource::Intent,
4457
4458 /// Output only. Current state of the resource.
4459 pub state: crate::model::resource::State,
4460
4461 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4462}
4463
4464impl Resource {
4465 pub fn new() -> Self {
4466 std::default::Default::default()
4467 }
4468
4469 /// Sets the value of [name][crate::model::Resource::name].
4470 ///
4471 /// # Example
4472 /// ```ignore,no_run
4473 /// # use google_cloud_config_v1::model::Resource;
4474 /// let x = Resource::new().set_name("example");
4475 /// ```
4476 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4477 self.name = v.into();
4478 self
4479 }
4480
4481 /// Sets the value of [terraform_info][crate::model::Resource::terraform_info].
4482 ///
4483 /// # Example
4484 /// ```ignore,no_run
4485 /// # use google_cloud_config_v1::model::Resource;
4486 /// use google_cloud_config_v1::model::ResourceTerraformInfo;
4487 /// let x = Resource::new().set_terraform_info(ResourceTerraformInfo::default()/* use setters */);
4488 /// ```
4489 pub fn set_terraform_info<T>(mut self, v: T) -> Self
4490 where
4491 T: std::convert::Into<crate::model::ResourceTerraformInfo>,
4492 {
4493 self.terraform_info = std::option::Option::Some(v.into());
4494 self
4495 }
4496
4497 /// Sets or clears the value of [terraform_info][crate::model::Resource::terraform_info].
4498 ///
4499 /// # Example
4500 /// ```ignore,no_run
4501 /// # use google_cloud_config_v1::model::Resource;
4502 /// use google_cloud_config_v1::model::ResourceTerraformInfo;
4503 /// let x = Resource::new().set_or_clear_terraform_info(Some(ResourceTerraformInfo::default()/* use setters */));
4504 /// let x = Resource::new().set_or_clear_terraform_info(None::<ResourceTerraformInfo>);
4505 /// ```
4506 pub fn set_or_clear_terraform_info<T>(mut self, v: std::option::Option<T>) -> Self
4507 where
4508 T: std::convert::Into<crate::model::ResourceTerraformInfo>,
4509 {
4510 self.terraform_info = v.map(|x| x.into());
4511 self
4512 }
4513
4514 /// Sets the value of [cai_assets][crate::model::Resource::cai_assets].
4515 ///
4516 /// # Example
4517 /// ```ignore,no_run
4518 /// # use google_cloud_config_v1::model::Resource;
4519 /// use google_cloud_config_v1::model::ResourceCAIInfo;
4520 /// let x = Resource::new().set_cai_assets([
4521 /// ("key0", ResourceCAIInfo::default()/* use setters */),
4522 /// ("key1", ResourceCAIInfo::default()/* use (different) setters */),
4523 /// ]);
4524 /// ```
4525 pub fn set_cai_assets<T, K, V>(mut self, v: T) -> Self
4526 where
4527 T: std::iter::IntoIterator<Item = (K, V)>,
4528 K: std::convert::Into<std::string::String>,
4529 V: std::convert::Into<crate::model::ResourceCAIInfo>,
4530 {
4531 use std::iter::Iterator;
4532 self.cai_assets = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
4533 self
4534 }
4535
4536 /// Sets the value of [intent][crate::model::Resource::intent].
4537 ///
4538 /// # Example
4539 /// ```ignore,no_run
4540 /// # use google_cloud_config_v1::model::Resource;
4541 /// use google_cloud_config_v1::model::resource::Intent;
4542 /// let x0 = Resource::new().set_intent(Intent::Create);
4543 /// let x1 = Resource::new().set_intent(Intent::Update);
4544 /// let x2 = Resource::new().set_intent(Intent::Delete);
4545 /// ```
4546 pub fn set_intent<T: std::convert::Into<crate::model::resource::Intent>>(
4547 mut self,
4548 v: T,
4549 ) -> Self {
4550 self.intent = v.into();
4551 self
4552 }
4553
4554 /// Sets the value of [state][crate::model::Resource::state].
4555 ///
4556 /// # Example
4557 /// ```ignore,no_run
4558 /// # use google_cloud_config_v1::model::Resource;
4559 /// use google_cloud_config_v1::model::resource::State;
4560 /// let x0 = Resource::new().set_state(State::Planned);
4561 /// let x1 = Resource::new().set_state(State::InProgress);
4562 /// let x2 = Resource::new().set_state(State::Reconciled);
4563 /// ```
4564 pub fn set_state<T: std::convert::Into<crate::model::resource::State>>(mut self, v: T) -> Self {
4565 self.state = v.into();
4566 self
4567 }
4568}
4569
4570impl wkt::message::Message for Resource {
4571 fn typename() -> &'static str {
4572 "type.googleapis.com/google.cloud.config.v1.Resource"
4573 }
4574}
4575
4576/// Defines additional types related to [Resource].
4577pub mod resource {
4578 #[allow(unused_imports)]
4579 use super::*;
4580
4581 /// Possible intent of the resource.
4582 ///
4583 /// # Working with unknown values
4584 ///
4585 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4586 /// additional enum variants at any time. Adding new variants is not considered
4587 /// a breaking change. Applications should write their code in anticipation of:
4588 ///
4589 /// - New values appearing in future releases of the client library, **and**
4590 /// - New values received dynamically, without application changes.
4591 ///
4592 /// Please consult the [Working with enums] section in the user guide for some
4593 /// guidelines.
4594 ///
4595 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
4596 #[derive(Clone, Debug, PartialEq)]
4597 #[non_exhaustive]
4598 pub enum Intent {
4599 /// The default value. This value is used if the intent is omitted.
4600 Unspecified,
4601 /// Infra Manager will create this Resource.
4602 Create,
4603 /// Infra Manager will update this Resource.
4604 Update,
4605 /// Infra Manager will delete this Resource.
4606 Delete,
4607 /// Infra Manager will destroy and recreate this Resource.
4608 Recreate,
4609 /// Infra Manager will leave this Resource untouched.
4610 Unchanged,
4611 /// If set, the enum was initialized with an unknown value.
4612 ///
4613 /// Applications can examine the value using [Intent::value] or
4614 /// [Intent::name].
4615 UnknownValue(intent::UnknownValue),
4616 }
4617
4618 #[doc(hidden)]
4619 pub mod intent {
4620 #[allow(unused_imports)]
4621 use super::*;
4622 #[derive(Clone, Debug, PartialEq)]
4623 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4624 }
4625
4626 impl Intent {
4627 /// Gets the enum value.
4628 ///
4629 /// Returns `None` if the enum contains an unknown value deserialized from
4630 /// the string representation of enums.
4631 pub fn value(&self) -> std::option::Option<i32> {
4632 match self {
4633 Self::Unspecified => std::option::Option::Some(0),
4634 Self::Create => std::option::Option::Some(1),
4635 Self::Update => std::option::Option::Some(2),
4636 Self::Delete => std::option::Option::Some(3),
4637 Self::Recreate => std::option::Option::Some(4),
4638 Self::Unchanged => std::option::Option::Some(5),
4639 Self::UnknownValue(u) => u.0.value(),
4640 }
4641 }
4642
4643 /// Gets the enum value as a string.
4644 ///
4645 /// Returns `None` if the enum contains an unknown value deserialized from
4646 /// the integer representation of enums.
4647 pub fn name(&self) -> std::option::Option<&str> {
4648 match self {
4649 Self::Unspecified => std::option::Option::Some("INTENT_UNSPECIFIED"),
4650 Self::Create => std::option::Option::Some("CREATE"),
4651 Self::Update => std::option::Option::Some("UPDATE"),
4652 Self::Delete => std::option::Option::Some("DELETE"),
4653 Self::Recreate => std::option::Option::Some("RECREATE"),
4654 Self::Unchanged => std::option::Option::Some("UNCHANGED"),
4655 Self::UnknownValue(u) => u.0.name(),
4656 }
4657 }
4658 }
4659
4660 impl std::default::Default for Intent {
4661 fn default() -> Self {
4662 use std::convert::From;
4663 Self::from(0)
4664 }
4665 }
4666
4667 impl std::fmt::Display for Intent {
4668 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4669 wkt::internal::display_enum(f, self.name(), self.value())
4670 }
4671 }
4672
4673 impl std::convert::From<i32> for Intent {
4674 fn from(value: i32) -> Self {
4675 match value {
4676 0 => Self::Unspecified,
4677 1 => Self::Create,
4678 2 => Self::Update,
4679 3 => Self::Delete,
4680 4 => Self::Recreate,
4681 5 => Self::Unchanged,
4682 _ => Self::UnknownValue(intent::UnknownValue(
4683 wkt::internal::UnknownEnumValue::Integer(value),
4684 )),
4685 }
4686 }
4687 }
4688
4689 impl std::convert::From<&str> for Intent {
4690 fn from(value: &str) -> Self {
4691 use std::string::ToString;
4692 match value {
4693 "INTENT_UNSPECIFIED" => Self::Unspecified,
4694 "CREATE" => Self::Create,
4695 "UPDATE" => Self::Update,
4696 "DELETE" => Self::Delete,
4697 "RECREATE" => Self::Recreate,
4698 "UNCHANGED" => Self::Unchanged,
4699 _ => Self::UnknownValue(intent::UnknownValue(
4700 wkt::internal::UnknownEnumValue::String(value.to_string()),
4701 )),
4702 }
4703 }
4704 }
4705
4706 impl serde::ser::Serialize for Intent {
4707 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4708 where
4709 S: serde::Serializer,
4710 {
4711 match self {
4712 Self::Unspecified => serializer.serialize_i32(0),
4713 Self::Create => serializer.serialize_i32(1),
4714 Self::Update => serializer.serialize_i32(2),
4715 Self::Delete => serializer.serialize_i32(3),
4716 Self::Recreate => serializer.serialize_i32(4),
4717 Self::Unchanged => serializer.serialize_i32(5),
4718 Self::UnknownValue(u) => u.0.serialize(serializer),
4719 }
4720 }
4721 }
4722
4723 impl<'de> serde::de::Deserialize<'de> for Intent {
4724 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4725 where
4726 D: serde::Deserializer<'de>,
4727 {
4728 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Intent>::new(
4729 ".google.cloud.config.v1.Resource.Intent",
4730 ))
4731 }
4732 }
4733
4734 /// Possible states of a resource.
4735 ///
4736 /// # Working with unknown values
4737 ///
4738 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4739 /// additional enum variants at any time. Adding new variants is not considered
4740 /// a breaking change. Applications should write their code in anticipation of:
4741 ///
4742 /// - New values appearing in future releases of the client library, **and**
4743 /// - New values received dynamically, without application changes.
4744 ///
4745 /// Please consult the [Working with enums] section in the user guide for some
4746 /// guidelines.
4747 ///
4748 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
4749 #[derive(Clone, Debug, PartialEq)]
4750 #[non_exhaustive]
4751 pub enum State {
4752 /// The default value. This value is used if the state is omitted.
4753 Unspecified,
4754 /// Resource has been planned for reconcile.
4755 Planned,
4756 /// Resource is actively reconciling into the intended state.
4757 InProgress,
4758 /// Resource has reconciled to intended state.
4759 Reconciled,
4760 /// Resource failed to reconcile.
4761 Failed,
4762 /// If set, the enum was initialized with an unknown value.
4763 ///
4764 /// Applications can examine the value using [State::value] or
4765 /// [State::name].
4766 UnknownValue(state::UnknownValue),
4767 }
4768
4769 #[doc(hidden)]
4770 pub mod state {
4771 #[allow(unused_imports)]
4772 use super::*;
4773 #[derive(Clone, Debug, PartialEq)]
4774 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4775 }
4776
4777 impl State {
4778 /// Gets the enum value.
4779 ///
4780 /// Returns `None` if the enum contains an unknown value deserialized from
4781 /// the string representation of enums.
4782 pub fn value(&self) -> std::option::Option<i32> {
4783 match self {
4784 Self::Unspecified => std::option::Option::Some(0),
4785 Self::Planned => std::option::Option::Some(1),
4786 Self::InProgress => std::option::Option::Some(2),
4787 Self::Reconciled => std::option::Option::Some(3),
4788 Self::Failed => std::option::Option::Some(4),
4789 Self::UnknownValue(u) => u.0.value(),
4790 }
4791 }
4792
4793 /// Gets the enum value as a string.
4794 ///
4795 /// Returns `None` if the enum contains an unknown value deserialized from
4796 /// the integer representation of enums.
4797 pub fn name(&self) -> std::option::Option<&str> {
4798 match self {
4799 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
4800 Self::Planned => std::option::Option::Some("PLANNED"),
4801 Self::InProgress => std::option::Option::Some("IN_PROGRESS"),
4802 Self::Reconciled => std::option::Option::Some("RECONCILED"),
4803 Self::Failed => std::option::Option::Some("FAILED"),
4804 Self::UnknownValue(u) => u.0.name(),
4805 }
4806 }
4807 }
4808
4809 impl std::default::Default for State {
4810 fn default() -> Self {
4811 use std::convert::From;
4812 Self::from(0)
4813 }
4814 }
4815
4816 impl std::fmt::Display for State {
4817 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4818 wkt::internal::display_enum(f, self.name(), self.value())
4819 }
4820 }
4821
4822 impl std::convert::From<i32> for State {
4823 fn from(value: i32) -> Self {
4824 match value {
4825 0 => Self::Unspecified,
4826 1 => Self::Planned,
4827 2 => Self::InProgress,
4828 3 => Self::Reconciled,
4829 4 => Self::Failed,
4830 _ => Self::UnknownValue(state::UnknownValue(
4831 wkt::internal::UnknownEnumValue::Integer(value),
4832 )),
4833 }
4834 }
4835 }
4836
4837 impl std::convert::From<&str> for State {
4838 fn from(value: &str) -> Self {
4839 use std::string::ToString;
4840 match value {
4841 "STATE_UNSPECIFIED" => Self::Unspecified,
4842 "PLANNED" => Self::Planned,
4843 "IN_PROGRESS" => Self::InProgress,
4844 "RECONCILED" => Self::Reconciled,
4845 "FAILED" => Self::Failed,
4846 _ => Self::UnknownValue(state::UnknownValue(
4847 wkt::internal::UnknownEnumValue::String(value.to_string()),
4848 )),
4849 }
4850 }
4851 }
4852
4853 impl serde::ser::Serialize for State {
4854 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4855 where
4856 S: serde::Serializer,
4857 {
4858 match self {
4859 Self::Unspecified => serializer.serialize_i32(0),
4860 Self::Planned => serializer.serialize_i32(1),
4861 Self::InProgress => serializer.serialize_i32(2),
4862 Self::Reconciled => serializer.serialize_i32(3),
4863 Self::Failed => serializer.serialize_i32(4),
4864 Self::UnknownValue(u) => u.0.serialize(serializer),
4865 }
4866 }
4867 }
4868
4869 impl<'de> serde::de::Deserialize<'de> for State {
4870 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4871 where
4872 D: serde::Deserializer<'de>,
4873 {
4874 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
4875 ".google.cloud.config.v1.Resource.State",
4876 ))
4877 }
4878 }
4879}
4880
4881/// Terraform info of a Resource.
4882#[derive(Clone, Default, PartialEq)]
4883#[non_exhaustive]
4884pub struct ResourceTerraformInfo {
4885 /// TF resource address that uniquely identifies this resource within this
4886 /// deployment.
4887 pub address: std::string::String,
4888
4889 /// TF resource type
4890 pub r#type: std::string::String,
4891
4892 /// ID attribute of the TF resource
4893 pub id: std::string::String,
4894
4895 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4896}
4897
4898impl ResourceTerraformInfo {
4899 pub fn new() -> Self {
4900 std::default::Default::default()
4901 }
4902
4903 /// Sets the value of [address][crate::model::ResourceTerraformInfo::address].
4904 ///
4905 /// # Example
4906 /// ```ignore,no_run
4907 /// # use google_cloud_config_v1::model::ResourceTerraformInfo;
4908 /// let x = ResourceTerraformInfo::new().set_address("example");
4909 /// ```
4910 pub fn set_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4911 self.address = v.into();
4912 self
4913 }
4914
4915 /// Sets the value of [r#type][crate::model::ResourceTerraformInfo::type].
4916 ///
4917 /// # Example
4918 /// ```ignore,no_run
4919 /// # use google_cloud_config_v1::model::ResourceTerraformInfo;
4920 /// let x = ResourceTerraformInfo::new().set_type("example");
4921 /// ```
4922 pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4923 self.r#type = v.into();
4924 self
4925 }
4926
4927 /// Sets the value of [id][crate::model::ResourceTerraformInfo::id].
4928 ///
4929 /// # Example
4930 /// ```ignore,no_run
4931 /// # use google_cloud_config_v1::model::ResourceTerraformInfo;
4932 /// let x = ResourceTerraformInfo::new().set_id("example");
4933 /// ```
4934 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4935 self.id = v.into();
4936 self
4937 }
4938}
4939
4940impl wkt::message::Message for ResourceTerraformInfo {
4941 fn typename() -> &'static str {
4942 "type.googleapis.com/google.cloud.config.v1.ResourceTerraformInfo"
4943 }
4944}
4945
4946/// CAI info of a Resource.
4947#[derive(Clone, Default, PartialEq)]
4948#[non_exhaustive]
4949pub struct ResourceCAIInfo {
4950 /// CAI resource name in the format following
4951 /// <https://cloud.google.com/apis/design/resource_names#full_resource_name>
4952 pub full_resource_name: std::string::String,
4953
4954 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4955}
4956
4957impl ResourceCAIInfo {
4958 pub fn new() -> Self {
4959 std::default::Default::default()
4960 }
4961
4962 /// Sets the value of [full_resource_name][crate::model::ResourceCAIInfo::full_resource_name].
4963 ///
4964 /// # Example
4965 /// ```ignore,no_run
4966 /// # use google_cloud_config_v1::model::ResourceCAIInfo;
4967 /// let x = ResourceCAIInfo::new().set_full_resource_name("example");
4968 /// ```
4969 pub fn set_full_resource_name<T: std::convert::Into<std::string::String>>(
4970 mut self,
4971 v: T,
4972 ) -> Self {
4973 self.full_resource_name = v.into();
4974 self
4975 }
4976}
4977
4978impl wkt::message::Message for ResourceCAIInfo {
4979 fn typename() -> &'static str {
4980 "type.googleapis.com/google.cloud.config.v1.ResourceCAIInfo"
4981 }
4982}
4983
4984/// A request to get a Resource from a 'GetResource' call.
4985#[derive(Clone, Default, PartialEq)]
4986#[non_exhaustive]
4987pub struct GetResourceRequest {
4988 /// Required. The name of the Resource in the format:
4989 /// 'projects/{project_id}/locations/{location}/deployments/{deployment}/revisions/{revision}/resource/{resource}'.
4990 pub name: std::string::String,
4991
4992 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4993}
4994
4995impl GetResourceRequest {
4996 pub fn new() -> Self {
4997 std::default::Default::default()
4998 }
4999
5000 /// Sets the value of [name][crate::model::GetResourceRequest::name].
5001 ///
5002 /// # Example
5003 /// ```ignore,no_run
5004 /// # use google_cloud_config_v1::model::GetResourceRequest;
5005 /// let x = GetResourceRequest::new().set_name("example");
5006 /// ```
5007 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5008 self.name = v.into();
5009 self
5010 }
5011}
5012
5013impl wkt::message::Message for GetResourceRequest {
5014 fn typename() -> &'static str {
5015 "type.googleapis.com/google.cloud.config.v1.GetResourceRequest"
5016 }
5017}
5018
5019/// A request to list Resources passed to a 'ListResources' call.
5020#[derive(Clone, Default, PartialEq)]
5021#[non_exhaustive]
5022pub struct ListResourcesRequest {
5023 /// Required. The parent in whose context the Resources are listed. The parent
5024 /// value is in the format:
5025 /// 'projects/{project_id}/locations/{location}/deployments/{deployment}/revisions/{revision}'.
5026 pub parent: std::string::String,
5027
5028 /// When requesting a page of resources, 'page_size' specifies number of
5029 /// resources to return. If unspecified, at most 500 will be returned. The
5030 /// maximum value is 1000.
5031 pub page_size: i32,
5032
5033 /// Token returned by previous call to 'ListResources' which specifies the
5034 /// position in the list from where to continue listing the resources.
5035 pub page_token: std::string::String,
5036
5037 /// Lists the Resources that match the filter expression. A filter
5038 /// expression filters the resources listed in the response. The expression
5039 /// must be of the form '{field} {operator} {value}' where operators: '<', '>',
5040 /// '<=',
5041 /// '>=',
5042 /// '!=', '=', ':' are supported (colon ':' represents a HAS operator which is
5043 /// roughly synonymous with equality). {field} can refer to a proto or JSON
5044 /// field, or a synthetic field. Field names can be camelCase or snake_case.
5045 ///
5046 /// Examples:
5047 ///
5048 /// - Filter by name:
5049 /// name =
5050 /// "projects/foo/locations/us-central1/deployments/dep/revisions/bar/resources/baz
5051 pub filter: std::string::String,
5052
5053 /// Field to use to sort the list.
5054 pub order_by: std::string::String,
5055
5056 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5057}
5058
5059impl ListResourcesRequest {
5060 pub fn new() -> Self {
5061 std::default::Default::default()
5062 }
5063
5064 /// Sets the value of [parent][crate::model::ListResourcesRequest::parent].
5065 ///
5066 /// # Example
5067 /// ```ignore,no_run
5068 /// # use google_cloud_config_v1::model::ListResourcesRequest;
5069 /// let x = ListResourcesRequest::new().set_parent("example");
5070 /// ```
5071 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5072 self.parent = v.into();
5073 self
5074 }
5075
5076 /// Sets the value of [page_size][crate::model::ListResourcesRequest::page_size].
5077 ///
5078 /// # Example
5079 /// ```ignore,no_run
5080 /// # use google_cloud_config_v1::model::ListResourcesRequest;
5081 /// let x = ListResourcesRequest::new().set_page_size(42);
5082 /// ```
5083 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5084 self.page_size = v.into();
5085 self
5086 }
5087
5088 /// Sets the value of [page_token][crate::model::ListResourcesRequest::page_token].
5089 ///
5090 /// # Example
5091 /// ```ignore,no_run
5092 /// # use google_cloud_config_v1::model::ListResourcesRequest;
5093 /// let x = ListResourcesRequest::new().set_page_token("example");
5094 /// ```
5095 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5096 self.page_token = v.into();
5097 self
5098 }
5099
5100 /// Sets the value of [filter][crate::model::ListResourcesRequest::filter].
5101 ///
5102 /// # Example
5103 /// ```ignore,no_run
5104 /// # use google_cloud_config_v1::model::ListResourcesRequest;
5105 /// let x = ListResourcesRequest::new().set_filter("example");
5106 /// ```
5107 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5108 self.filter = v.into();
5109 self
5110 }
5111
5112 /// Sets the value of [order_by][crate::model::ListResourcesRequest::order_by].
5113 ///
5114 /// # Example
5115 /// ```ignore,no_run
5116 /// # use google_cloud_config_v1::model::ListResourcesRequest;
5117 /// let x = ListResourcesRequest::new().set_order_by("example");
5118 /// ```
5119 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5120 self.order_by = v.into();
5121 self
5122 }
5123}
5124
5125impl wkt::message::Message for ListResourcesRequest {
5126 fn typename() -> &'static str {
5127 "type.googleapis.com/google.cloud.config.v1.ListResourcesRequest"
5128 }
5129}
5130
5131/// A response to a 'ListResources' call. Contains a list of Resources.
5132#[derive(Clone, Default, PartialEq)]
5133#[non_exhaustive]
5134pub struct ListResourcesResponse {
5135 /// List of [Resources][google.cloud.config.v1.Resource].
5136 ///
5137 /// [google.cloud.config.v1.Resource]: crate::model::Resource
5138 pub resources: std::vec::Vec<crate::model::Resource>,
5139
5140 /// A token to request the next page of resources from the 'ListResources'
5141 /// method. The value of an empty string means that there are no more resources
5142 /// to return.
5143 pub next_page_token: std::string::String,
5144
5145 /// Locations that could not be reached.
5146 pub unreachable: std::vec::Vec<std::string::String>,
5147
5148 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5149}
5150
5151impl ListResourcesResponse {
5152 pub fn new() -> Self {
5153 std::default::Default::default()
5154 }
5155
5156 /// Sets the value of [resources][crate::model::ListResourcesResponse::resources].
5157 ///
5158 /// # Example
5159 /// ```ignore,no_run
5160 /// # use google_cloud_config_v1::model::ListResourcesResponse;
5161 /// use google_cloud_config_v1::model::Resource;
5162 /// let x = ListResourcesResponse::new()
5163 /// .set_resources([
5164 /// Resource::default()/* use setters */,
5165 /// Resource::default()/* use (different) setters */,
5166 /// ]);
5167 /// ```
5168 pub fn set_resources<T, V>(mut self, v: T) -> Self
5169 where
5170 T: std::iter::IntoIterator<Item = V>,
5171 V: std::convert::Into<crate::model::Resource>,
5172 {
5173 use std::iter::Iterator;
5174 self.resources = v.into_iter().map(|i| i.into()).collect();
5175 self
5176 }
5177
5178 /// Sets the value of [next_page_token][crate::model::ListResourcesResponse::next_page_token].
5179 ///
5180 /// # Example
5181 /// ```ignore,no_run
5182 /// # use google_cloud_config_v1::model::ListResourcesResponse;
5183 /// let x = ListResourcesResponse::new().set_next_page_token("example");
5184 /// ```
5185 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5186 self.next_page_token = v.into();
5187 self
5188 }
5189
5190 /// Sets the value of [unreachable][crate::model::ListResourcesResponse::unreachable].
5191 ///
5192 /// # Example
5193 /// ```ignore,no_run
5194 /// # use google_cloud_config_v1::model::ListResourcesResponse;
5195 /// let x = ListResourcesResponse::new().set_unreachable(["a", "b", "c"]);
5196 /// ```
5197 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
5198 where
5199 T: std::iter::IntoIterator<Item = V>,
5200 V: std::convert::Into<std::string::String>,
5201 {
5202 use std::iter::Iterator;
5203 self.unreachable = v.into_iter().map(|i| i.into()).collect();
5204 self
5205 }
5206}
5207
5208impl wkt::message::Message for ListResourcesResponse {
5209 fn typename() -> &'static str {
5210 "type.googleapis.com/google.cloud.config.v1.ListResourcesResponse"
5211 }
5212}
5213
5214#[doc(hidden)]
5215impl google_cloud_gax::paginator::internal::PageableResponse for ListResourcesResponse {
5216 type PageItem = crate::model::Resource;
5217
5218 fn items(self) -> std::vec::Vec<Self::PageItem> {
5219 self.resources
5220 }
5221
5222 fn next_page_token(&self) -> std::string::String {
5223 use std::clone::Clone;
5224 self.next_page_token.clone()
5225 }
5226}
5227
5228/// Contains info about a Terraform state file
5229#[derive(Clone, Default, PartialEq)]
5230#[non_exhaustive]
5231pub struct Statefile {
5232 /// Output only. Cloud Storage signed URI used for downloading or uploading the
5233 /// state file.
5234 pub signed_uri: std::string::String,
5235
5236 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5237}
5238
5239impl Statefile {
5240 pub fn new() -> Self {
5241 std::default::Default::default()
5242 }
5243
5244 /// Sets the value of [signed_uri][crate::model::Statefile::signed_uri].
5245 ///
5246 /// # Example
5247 /// ```ignore,no_run
5248 /// # use google_cloud_config_v1::model::Statefile;
5249 /// let x = Statefile::new().set_signed_uri("example");
5250 /// ```
5251 pub fn set_signed_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5252 self.signed_uri = v.into();
5253 self
5254 }
5255}
5256
5257impl wkt::message::Message for Statefile {
5258 fn typename() -> &'static str {
5259 "type.googleapis.com/google.cloud.config.v1.Statefile"
5260 }
5261}
5262
5263/// A request to export a state file passed to a 'ExportDeploymentStatefile'
5264/// call.
5265#[derive(Clone, Default, PartialEq)]
5266#[non_exhaustive]
5267pub struct ExportDeploymentStatefileRequest {
5268 /// Required. The parent in whose context the statefile is listed. The parent
5269 /// value is in the format:
5270 /// 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
5271 pub parent: std::string::String,
5272
5273 /// Optional. If this flag is set to true, the exported deployment state file
5274 /// will be the draft state. This will enable the draft file to be validated
5275 /// before copying it over to the working state on unlock.
5276 pub draft: bool,
5277
5278 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5279}
5280
5281impl ExportDeploymentStatefileRequest {
5282 pub fn new() -> Self {
5283 std::default::Default::default()
5284 }
5285
5286 /// Sets the value of [parent][crate::model::ExportDeploymentStatefileRequest::parent].
5287 ///
5288 /// # Example
5289 /// ```ignore,no_run
5290 /// # use google_cloud_config_v1::model::ExportDeploymentStatefileRequest;
5291 /// let x = ExportDeploymentStatefileRequest::new().set_parent("example");
5292 /// ```
5293 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5294 self.parent = v.into();
5295 self
5296 }
5297
5298 /// Sets the value of [draft][crate::model::ExportDeploymentStatefileRequest::draft].
5299 ///
5300 /// # Example
5301 /// ```ignore,no_run
5302 /// # use google_cloud_config_v1::model::ExportDeploymentStatefileRequest;
5303 /// let x = ExportDeploymentStatefileRequest::new().set_draft(true);
5304 /// ```
5305 pub fn set_draft<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5306 self.draft = v.into();
5307 self
5308 }
5309}
5310
5311impl wkt::message::Message for ExportDeploymentStatefileRequest {
5312 fn typename() -> &'static str {
5313 "type.googleapis.com/google.cloud.config.v1.ExportDeploymentStatefileRequest"
5314 }
5315}
5316
5317/// A request to export a state file passed to a 'ExportRevisionStatefile'
5318/// call.
5319#[derive(Clone, Default, PartialEq)]
5320#[non_exhaustive]
5321pub struct ExportRevisionStatefileRequest {
5322 /// Required. The parent in whose context the statefile is listed. The parent
5323 /// value is in the format:
5324 /// 'projects/{project_id}/locations/{location}/deployments/{deployment}/revisions/{revision}'.
5325 pub parent: std::string::String,
5326
5327 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5328}
5329
5330impl ExportRevisionStatefileRequest {
5331 pub fn new() -> Self {
5332 std::default::Default::default()
5333 }
5334
5335 /// Sets the value of [parent][crate::model::ExportRevisionStatefileRequest::parent].
5336 ///
5337 /// # Example
5338 /// ```ignore,no_run
5339 /// # use google_cloud_config_v1::model::ExportRevisionStatefileRequest;
5340 /// let x = ExportRevisionStatefileRequest::new().set_parent("example");
5341 /// ```
5342 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5343 self.parent = v.into();
5344 self
5345 }
5346}
5347
5348impl wkt::message::Message for ExportRevisionStatefileRequest {
5349 fn typename() -> &'static str {
5350 "type.googleapis.com/google.cloud.config.v1.ExportRevisionStatefileRequest"
5351 }
5352}
5353
5354/// A request to import a state file passed to a 'ImportStatefile' call.
5355#[derive(Clone, Default, PartialEq)]
5356#[non_exhaustive]
5357pub struct ImportStatefileRequest {
5358 /// Required. The parent in whose context the statefile is listed. The parent
5359 /// value is in the format:
5360 /// 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
5361 pub parent: std::string::String,
5362
5363 /// Required. Lock ID of the lock file to verify that the user who is importing
5364 /// the state file previously locked the Deployment.
5365 pub lock_id: i64,
5366
5367 /// Optional.
5368 pub skip_draft: bool,
5369
5370 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5371}
5372
5373impl ImportStatefileRequest {
5374 pub fn new() -> Self {
5375 std::default::Default::default()
5376 }
5377
5378 /// Sets the value of [parent][crate::model::ImportStatefileRequest::parent].
5379 ///
5380 /// # Example
5381 /// ```ignore,no_run
5382 /// # use google_cloud_config_v1::model::ImportStatefileRequest;
5383 /// let x = ImportStatefileRequest::new().set_parent("example");
5384 /// ```
5385 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5386 self.parent = v.into();
5387 self
5388 }
5389
5390 /// Sets the value of [lock_id][crate::model::ImportStatefileRequest::lock_id].
5391 ///
5392 /// # Example
5393 /// ```ignore,no_run
5394 /// # use google_cloud_config_v1::model::ImportStatefileRequest;
5395 /// let x = ImportStatefileRequest::new().set_lock_id(42);
5396 /// ```
5397 pub fn set_lock_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
5398 self.lock_id = v.into();
5399 self
5400 }
5401
5402 /// Sets the value of [skip_draft][crate::model::ImportStatefileRequest::skip_draft].
5403 ///
5404 /// # Example
5405 /// ```ignore,no_run
5406 /// # use google_cloud_config_v1::model::ImportStatefileRequest;
5407 /// let x = ImportStatefileRequest::new().set_skip_draft(true);
5408 /// ```
5409 pub fn set_skip_draft<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5410 self.skip_draft = v.into();
5411 self
5412 }
5413}
5414
5415impl wkt::message::Message for ImportStatefileRequest {
5416 fn typename() -> &'static str {
5417 "type.googleapis.com/google.cloud.config.v1.ImportStatefileRequest"
5418 }
5419}
5420
5421/// A request to delete a state file passed to a 'DeleteStatefile' call.
5422#[derive(Clone, Default, PartialEq)]
5423#[non_exhaustive]
5424pub struct DeleteStatefileRequest {
5425 /// Required. The name of the deployment in the format:
5426 /// 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
5427 pub name: std::string::String,
5428
5429 /// Required. Lock ID of the lock file to verify that the user who is deleting
5430 /// the state file previously locked the Deployment.
5431 pub lock_id: i64,
5432
5433 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5434}
5435
5436impl DeleteStatefileRequest {
5437 pub fn new() -> Self {
5438 std::default::Default::default()
5439 }
5440
5441 /// Sets the value of [name][crate::model::DeleteStatefileRequest::name].
5442 ///
5443 /// # Example
5444 /// ```ignore,no_run
5445 /// # use google_cloud_config_v1::model::DeleteStatefileRequest;
5446 /// let x = DeleteStatefileRequest::new().set_name("example");
5447 /// ```
5448 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5449 self.name = v.into();
5450 self
5451 }
5452
5453 /// Sets the value of [lock_id][crate::model::DeleteStatefileRequest::lock_id].
5454 ///
5455 /// # Example
5456 /// ```ignore,no_run
5457 /// # use google_cloud_config_v1::model::DeleteStatefileRequest;
5458 /// let x = DeleteStatefileRequest::new().set_lock_id(42);
5459 /// ```
5460 pub fn set_lock_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
5461 self.lock_id = v.into();
5462 self
5463 }
5464}
5465
5466impl wkt::message::Message for DeleteStatefileRequest {
5467 fn typename() -> &'static str {
5468 "type.googleapis.com/google.cloud.config.v1.DeleteStatefileRequest"
5469 }
5470}
5471
5472/// A request to lock a deployment passed to a 'LockDeployment' call.
5473#[derive(Clone, Default, PartialEq)]
5474#[non_exhaustive]
5475pub struct LockDeploymentRequest {
5476 /// Required. The name of the deployment in the format:
5477 /// 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
5478 pub name: std::string::String,
5479
5480 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5481}
5482
5483impl LockDeploymentRequest {
5484 pub fn new() -> Self {
5485 std::default::Default::default()
5486 }
5487
5488 /// Sets the value of [name][crate::model::LockDeploymentRequest::name].
5489 ///
5490 /// # Example
5491 /// ```ignore,no_run
5492 /// # use google_cloud_config_v1::model::LockDeploymentRequest;
5493 /// let x = LockDeploymentRequest::new().set_name("example");
5494 /// ```
5495 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5496 self.name = v.into();
5497 self
5498 }
5499}
5500
5501impl wkt::message::Message for LockDeploymentRequest {
5502 fn typename() -> &'static str {
5503 "type.googleapis.com/google.cloud.config.v1.LockDeploymentRequest"
5504 }
5505}
5506
5507/// A request to unlock a state file passed to a 'UnlockDeployment' call.
5508#[derive(Clone, Default, PartialEq)]
5509#[non_exhaustive]
5510pub struct UnlockDeploymentRequest {
5511 /// Required. The name of the deployment in the format:
5512 /// 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
5513 pub name: std::string::String,
5514
5515 /// Required. Lock ID of the lock file to be unlocked.
5516 pub lock_id: i64,
5517
5518 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5519}
5520
5521impl UnlockDeploymentRequest {
5522 pub fn new() -> Self {
5523 std::default::Default::default()
5524 }
5525
5526 /// Sets the value of [name][crate::model::UnlockDeploymentRequest::name].
5527 ///
5528 /// # Example
5529 /// ```ignore,no_run
5530 /// # use google_cloud_config_v1::model::UnlockDeploymentRequest;
5531 /// let x = UnlockDeploymentRequest::new().set_name("example");
5532 /// ```
5533 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5534 self.name = v.into();
5535 self
5536 }
5537
5538 /// Sets the value of [lock_id][crate::model::UnlockDeploymentRequest::lock_id].
5539 ///
5540 /// # Example
5541 /// ```ignore,no_run
5542 /// # use google_cloud_config_v1::model::UnlockDeploymentRequest;
5543 /// let x = UnlockDeploymentRequest::new().set_lock_id(42);
5544 /// ```
5545 pub fn set_lock_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
5546 self.lock_id = v.into();
5547 self
5548 }
5549}
5550
5551impl wkt::message::Message for UnlockDeploymentRequest {
5552 fn typename() -> &'static str {
5553 "type.googleapis.com/google.cloud.config.v1.UnlockDeploymentRequest"
5554 }
5555}
5556
5557/// A request to get a state file lock info passed to a 'ExportLockInfo' call.
5558#[derive(Clone, Default, PartialEq)]
5559#[non_exhaustive]
5560pub struct ExportLockInfoRequest {
5561 /// Required. The name of the deployment in the format:
5562 /// 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
5563 pub name: std::string::String,
5564
5565 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5566}
5567
5568impl ExportLockInfoRequest {
5569 pub fn new() -> Self {
5570 std::default::Default::default()
5571 }
5572
5573 /// Sets the value of [name][crate::model::ExportLockInfoRequest::name].
5574 ///
5575 /// # Example
5576 /// ```ignore,no_run
5577 /// # use google_cloud_config_v1::model::ExportLockInfoRequest;
5578 /// let x = ExportLockInfoRequest::new().set_name("example");
5579 /// ```
5580 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5581 self.name = v.into();
5582 self
5583 }
5584}
5585
5586impl wkt::message::Message for ExportLockInfoRequest {
5587 fn typename() -> &'static str {
5588 "type.googleapis.com/google.cloud.config.v1.ExportLockInfoRequest"
5589 }
5590}
5591
5592/// Details about the lock which locked the deployment.
5593#[derive(Clone, Default, PartialEq)]
5594#[non_exhaustive]
5595pub struct LockInfo {
5596 /// Unique ID for the lock to be overridden with generation ID in the backend.
5597 pub lock_id: i64,
5598
5599 /// Terraform operation, provided by the caller.
5600 pub operation: std::string::String,
5601
5602 /// Extra information to store with the lock, provided by the caller.
5603 pub info: std::string::String,
5604
5605 /// user@hostname when available
5606 pub who: std::string::String,
5607
5608 /// Terraform version
5609 pub version: std::string::String,
5610
5611 /// Time that the lock was taken.
5612 pub create_time: std::option::Option<wkt::Timestamp>,
5613
5614 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5615}
5616
5617impl LockInfo {
5618 pub fn new() -> Self {
5619 std::default::Default::default()
5620 }
5621
5622 /// Sets the value of [lock_id][crate::model::LockInfo::lock_id].
5623 ///
5624 /// # Example
5625 /// ```ignore,no_run
5626 /// # use google_cloud_config_v1::model::LockInfo;
5627 /// let x = LockInfo::new().set_lock_id(42);
5628 /// ```
5629 pub fn set_lock_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
5630 self.lock_id = v.into();
5631 self
5632 }
5633
5634 /// Sets the value of [operation][crate::model::LockInfo::operation].
5635 ///
5636 /// # Example
5637 /// ```ignore,no_run
5638 /// # use google_cloud_config_v1::model::LockInfo;
5639 /// let x = LockInfo::new().set_operation("example");
5640 /// ```
5641 pub fn set_operation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5642 self.operation = v.into();
5643 self
5644 }
5645
5646 /// Sets the value of [info][crate::model::LockInfo::info].
5647 ///
5648 /// # Example
5649 /// ```ignore,no_run
5650 /// # use google_cloud_config_v1::model::LockInfo;
5651 /// let x = LockInfo::new().set_info("example");
5652 /// ```
5653 pub fn set_info<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5654 self.info = v.into();
5655 self
5656 }
5657
5658 /// Sets the value of [who][crate::model::LockInfo::who].
5659 ///
5660 /// # Example
5661 /// ```ignore,no_run
5662 /// # use google_cloud_config_v1::model::LockInfo;
5663 /// let x = LockInfo::new().set_who("example");
5664 /// ```
5665 pub fn set_who<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5666 self.who = v.into();
5667 self
5668 }
5669
5670 /// Sets the value of [version][crate::model::LockInfo::version].
5671 ///
5672 /// # Example
5673 /// ```ignore,no_run
5674 /// # use google_cloud_config_v1::model::LockInfo;
5675 /// let x = LockInfo::new().set_version("example");
5676 /// ```
5677 pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5678 self.version = v.into();
5679 self
5680 }
5681
5682 /// Sets the value of [create_time][crate::model::LockInfo::create_time].
5683 ///
5684 /// # Example
5685 /// ```ignore,no_run
5686 /// # use google_cloud_config_v1::model::LockInfo;
5687 /// use wkt::Timestamp;
5688 /// let x = LockInfo::new().set_create_time(Timestamp::default()/* use setters */);
5689 /// ```
5690 pub fn set_create_time<T>(mut self, v: T) -> Self
5691 where
5692 T: std::convert::Into<wkt::Timestamp>,
5693 {
5694 self.create_time = std::option::Option::Some(v.into());
5695 self
5696 }
5697
5698 /// Sets or clears the value of [create_time][crate::model::LockInfo::create_time].
5699 ///
5700 /// # Example
5701 /// ```ignore,no_run
5702 /// # use google_cloud_config_v1::model::LockInfo;
5703 /// use wkt::Timestamp;
5704 /// let x = LockInfo::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
5705 /// let x = LockInfo::new().set_or_clear_create_time(None::<Timestamp>);
5706 /// ```
5707 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
5708 where
5709 T: std::convert::Into<wkt::Timestamp>,
5710 {
5711 self.create_time = v.map(|x| x.into());
5712 self
5713 }
5714}
5715
5716impl wkt::message::Message for LockInfo {
5717 fn typename() -> &'static str {
5718 "type.googleapis.com/google.cloud.config.v1.LockInfo"
5719 }
5720}
5721
5722/// A preview represents a set of actions Infra Manager would perform
5723/// to move the resources towards the desired state as specified in the
5724/// configuration.
5725#[derive(Clone, Default, PartialEq)]
5726#[non_exhaustive]
5727pub struct Preview {
5728 /// Identifier. Resource name of the preview. Resource name can be user
5729 /// provided or server generated ID if unspecified. Format:
5730 /// `projects/{project}/locations/{location}/previews/{preview}`
5731 pub name: std::string::String,
5732
5733 /// Output only. Time the preview was created.
5734 pub create_time: std::option::Option<wkt::Timestamp>,
5735
5736 /// Optional. User-defined labels for the preview.
5737 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
5738
5739 /// Output only. Current state of the preview.
5740 pub state: crate::model::preview::State,
5741
5742 /// Optional. Optional deployment reference. If specified, the preview will be
5743 /// performed using the provided deployment's current state and use any
5744 /// relevant fields from the deployment unless explicitly specified in the
5745 /// preview create request.
5746 pub deployment: std::string::String,
5747
5748 /// Optional. Current mode of preview.
5749 pub preview_mode: crate::model::preview::PreviewMode,
5750
5751 /// Required. User-specified Service Account (SA) credentials to be used when
5752 /// previewing resources.
5753 /// Format: `projects/{projectID}/serviceAccounts/{serviceAccount}`
5754 pub service_account: std::string::String,
5755
5756 /// Optional. User-defined location of Cloud Build logs, artifacts, and
5757 /// in Google Cloud Storage.
5758 /// Format: `gs://{bucket}/{folder}`
5759 /// A default bucket will be bootstrapped if the field is not set or empty
5760 /// Default Bucket Format: `gs://<project number>-<region>-blueprint-config`
5761 /// Constraints:
5762 ///
5763 /// - The bucket needs to be in the same project as the deployment
5764 /// - The path cannot be within the path of `gcs_source`
5765 /// If omitted and deployment resource ref provided has artifacts_gcs_bucket
5766 /// defined, that artifact bucket is used.
5767 pub artifacts_gcs_bucket: std::option::Option<std::string::String>,
5768
5769 /// Optional. The user-specified Worker Pool resource in which the Cloud Build
5770 /// job will execute. Format
5771 /// projects/{project}/locations/{location}/workerPools/{workerPoolId} If this
5772 /// field is unspecified, the default Cloud Build worker pool will be used. If
5773 /// omitted and deployment resource ref provided has worker_pool defined, that
5774 /// worker pool is used.
5775 pub worker_pool: std::option::Option<std::string::String>,
5776
5777 /// Output only. Code describing any errors that may have occurred.
5778 pub error_code: crate::model::preview::ErrorCode,
5779
5780 /// Output only. Additional information regarding the current state.
5781 pub error_status: std::option::Option<google_cloud_rpc::model::Status>,
5782
5783 /// Output only. Cloud Build instance UUID associated with this preview.
5784 pub build: std::string::String,
5785
5786 /// Output only. Summary of errors encountered during Terraform preview.
5787 /// It has a size limit of 10, i.e. only top 10 errors will be summarized here.
5788 pub tf_errors: std::vec::Vec<crate::model::TerraformError>,
5789
5790 /// Output only. Link to tf-error.ndjson file, which contains the full list of
5791 /// the errors encountered during a Terraform preview.
5792 /// Format: `gs://{bucket}/{object}`.
5793 pub error_logs: std::string::String,
5794
5795 /// Output only. Artifacts from preview.
5796 pub preview_artifacts: std::option::Option<crate::model::PreviewArtifacts>,
5797
5798 /// Output only. Location of preview logs in `gs://{bucket}/{object}` format.
5799 pub logs: std::string::String,
5800
5801 /// Output only. The current Terraform version set on the preview.
5802 /// It is in the format of "Major.Minor.Patch", for example, "1.3.10".
5803 pub tf_version: std::string::String,
5804
5805 /// Optional. The user-specified Terraform version constraint.
5806 /// Example: "=1.3.10".
5807 pub tf_version_constraint: std::option::Option<std::string::String>,
5808
5809 /// Optional. Arbitrary key-value metadata storage e.g. to help client tools
5810 /// identify preview during automation. See
5811 /// <https://google.aip.dev/148#annotations> for details on format and size
5812 /// limitations.
5813 pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
5814
5815 /// Optional. This field specifies the provider configurations.
5816 pub provider_config: std::option::Option<crate::model::ProviderConfig>,
5817
5818 /// Blueprint to preview.
5819 pub blueprint: std::option::Option<crate::model::preview::Blueprint>,
5820
5821 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5822}
5823
5824impl Preview {
5825 pub fn new() -> Self {
5826 std::default::Default::default()
5827 }
5828
5829 /// Sets the value of [name][crate::model::Preview::name].
5830 ///
5831 /// # Example
5832 /// ```ignore,no_run
5833 /// # use google_cloud_config_v1::model::Preview;
5834 /// let x = Preview::new().set_name("example");
5835 /// ```
5836 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5837 self.name = v.into();
5838 self
5839 }
5840
5841 /// Sets the value of [create_time][crate::model::Preview::create_time].
5842 ///
5843 /// # Example
5844 /// ```ignore,no_run
5845 /// # use google_cloud_config_v1::model::Preview;
5846 /// use wkt::Timestamp;
5847 /// let x = Preview::new().set_create_time(Timestamp::default()/* use setters */);
5848 /// ```
5849 pub fn set_create_time<T>(mut self, v: T) -> Self
5850 where
5851 T: std::convert::Into<wkt::Timestamp>,
5852 {
5853 self.create_time = std::option::Option::Some(v.into());
5854 self
5855 }
5856
5857 /// Sets or clears the value of [create_time][crate::model::Preview::create_time].
5858 ///
5859 /// # Example
5860 /// ```ignore,no_run
5861 /// # use google_cloud_config_v1::model::Preview;
5862 /// use wkt::Timestamp;
5863 /// let x = Preview::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
5864 /// let x = Preview::new().set_or_clear_create_time(None::<Timestamp>);
5865 /// ```
5866 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
5867 where
5868 T: std::convert::Into<wkt::Timestamp>,
5869 {
5870 self.create_time = v.map(|x| x.into());
5871 self
5872 }
5873
5874 /// Sets the value of [labels][crate::model::Preview::labels].
5875 ///
5876 /// # Example
5877 /// ```ignore,no_run
5878 /// # use google_cloud_config_v1::model::Preview;
5879 /// let x = Preview::new().set_labels([
5880 /// ("key0", "abc"),
5881 /// ("key1", "xyz"),
5882 /// ]);
5883 /// ```
5884 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
5885 where
5886 T: std::iter::IntoIterator<Item = (K, V)>,
5887 K: std::convert::Into<std::string::String>,
5888 V: std::convert::Into<std::string::String>,
5889 {
5890 use std::iter::Iterator;
5891 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5892 self
5893 }
5894
5895 /// Sets the value of [state][crate::model::Preview::state].
5896 ///
5897 /// # Example
5898 /// ```ignore,no_run
5899 /// # use google_cloud_config_v1::model::Preview;
5900 /// use google_cloud_config_v1::model::preview::State;
5901 /// let x0 = Preview::new().set_state(State::Creating);
5902 /// let x1 = Preview::new().set_state(State::Succeeded);
5903 /// let x2 = Preview::new().set_state(State::Applying);
5904 /// ```
5905 pub fn set_state<T: std::convert::Into<crate::model::preview::State>>(mut self, v: T) -> Self {
5906 self.state = v.into();
5907 self
5908 }
5909
5910 /// Sets the value of [deployment][crate::model::Preview::deployment].
5911 ///
5912 /// # Example
5913 /// ```ignore,no_run
5914 /// # use google_cloud_config_v1::model::Preview;
5915 /// let x = Preview::new().set_deployment("example");
5916 /// ```
5917 pub fn set_deployment<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5918 self.deployment = v.into();
5919 self
5920 }
5921
5922 /// Sets the value of [preview_mode][crate::model::Preview::preview_mode].
5923 ///
5924 /// # Example
5925 /// ```ignore,no_run
5926 /// # use google_cloud_config_v1::model::Preview;
5927 /// use google_cloud_config_v1::model::preview::PreviewMode;
5928 /// let x0 = Preview::new().set_preview_mode(PreviewMode::Default);
5929 /// let x1 = Preview::new().set_preview_mode(PreviewMode::Delete);
5930 /// ```
5931 pub fn set_preview_mode<T: std::convert::Into<crate::model::preview::PreviewMode>>(
5932 mut self,
5933 v: T,
5934 ) -> Self {
5935 self.preview_mode = v.into();
5936 self
5937 }
5938
5939 /// Sets the value of [service_account][crate::model::Preview::service_account].
5940 ///
5941 /// # Example
5942 /// ```ignore,no_run
5943 /// # use google_cloud_config_v1::model::Preview;
5944 /// let x = Preview::new().set_service_account("example");
5945 /// ```
5946 pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5947 self.service_account = v.into();
5948 self
5949 }
5950
5951 /// Sets the value of [artifacts_gcs_bucket][crate::model::Preview::artifacts_gcs_bucket].
5952 ///
5953 /// # Example
5954 /// ```ignore,no_run
5955 /// # use google_cloud_config_v1::model::Preview;
5956 /// let x = Preview::new().set_artifacts_gcs_bucket("example");
5957 /// ```
5958 pub fn set_artifacts_gcs_bucket<T>(mut self, v: T) -> Self
5959 where
5960 T: std::convert::Into<std::string::String>,
5961 {
5962 self.artifacts_gcs_bucket = std::option::Option::Some(v.into());
5963 self
5964 }
5965
5966 /// Sets or clears the value of [artifacts_gcs_bucket][crate::model::Preview::artifacts_gcs_bucket].
5967 ///
5968 /// # Example
5969 /// ```ignore,no_run
5970 /// # use google_cloud_config_v1::model::Preview;
5971 /// let x = Preview::new().set_or_clear_artifacts_gcs_bucket(Some("example"));
5972 /// let x = Preview::new().set_or_clear_artifacts_gcs_bucket(None::<String>);
5973 /// ```
5974 pub fn set_or_clear_artifacts_gcs_bucket<T>(mut self, v: std::option::Option<T>) -> Self
5975 where
5976 T: std::convert::Into<std::string::String>,
5977 {
5978 self.artifacts_gcs_bucket = v.map(|x| x.into());
5979 self
5980 }
5981
5982 /// Sets the value of [worker_pool][crate::model::Preview::worker_pool].
5983 ///
5984 /// # Example
5985 /// ```ignore,no_run
5986 /// # use google_cloud_config_v1::model::Preview;
5987 /// let x = Preview::new().set_worker_pool("example");
5988 /// ```
5989 pub fn set_worker_pool<T>(mut self, v: T) -> Self
5990 where
5991 T: std::convert::Into<std::string::String>,
5992 {
5993 self.worker_pool = std::option::Option::Some(v.into());
5994 self
5995 }
5996
5997 /// Sets or clears the value of [worker_pool][crate::model::Preview::worker_pool].
5998 ///
5999 /// # Example
6000 /// ```ignore,no_run
6001 /// # use google_cloud_config_v1::model::Preview;
6002 /// let x = Preview::new().set_or_clear_worker_pool(Some("example"));
6003 /// let x = Preview::new().set_or_clear_worker_pool(None::<String>);
6004 /// ```
6005 pub fn set_or_clear_worker_pool<T>(mut self, v: std::option::Option<T>) -> Self
6006 where
6007 T: std::convert::Into<std::string::String>,
6008 {
6009 self.worker_pool = v.map(|x| x.into());
6010 self
6011 }
6012
6013 /// Sets the value of [error_code][crate::model::Preview::error_code].
6014 ///
6015 /// # Example
6016 /// ```ignore,no_run
6017 /// # use google_cloud_config_v1::model::Preview;
6018 /// use google_cloud_config_v1::model::preview::ErrorCode;
6019 /// let x0 = Preview::new().set_error_code(ErrorCode::CloudBuildPermissionDenied);
6020 /// let x1 = Preview::new().set_error_code(ErrorCode::BucketCreationPermissionDenied);
6021 /// let x2 = Preview::new().set_error_code(ErrorCode::BucketCreationFailed);
6022 /// ```
6023 pub fn set_error_code<T: std::convert::Into<crate::model::preview::ErrorCode>>(
6024 mut self,
6025 v: T,
6026 ) -> Self {
6027 self.error_code = v.into();
6028 self
6029 }
6030
6031 /// Sets the value of [error_status][crate::model::Preview::error_status].
6032 ///
6033 /// # Example
6034 /// ```ignore,no_run
6035 /// # use google_cloud_config_v1::model::Preview;
6036 /// use google_cloud_rpc::model::Status;
6037 /// let x = Preview::new().set_error_status(Status::default()/* use setters */);
6038 /// ```
6039 pub fn set_error_status<T>(mut self, v: T) -> Self
6040 where
6041 T: std::convert::Into<google_cloud_rpc::model::Status>,
6042 {
6043 self.error_status = std::option::Option::Some(v.into());
6044 self
6045 }
6046
6047 /// Sets or clears the value of [error_status][crate::model::Preview::error_status].
6048 ///
6049 /// # Example
6050 /// ```ignore,no_run
6051 /// # use google_cloud_config_v1::model::Preview;
6052 /// use google_cloud_rpc::model::Status;
6053 /// let x = Preview::new().set_or_clear_error_status(Some(Status::default()/* use setters */));
6054 /// let x = Preview::new().set_or_clear_error_status(None::<Status>);
6055 /// ```
6056 pub fn set_or_clear_error_status<T>(mut self, v: std::option::Option<T>) -> Self
6057 where
6058 T: std::convert::Into<google_cloud_rpc::model::Status>,
6059 {
6060 self.error_status = v.map(|x| x.into());
6061 self
6062 }
6063
6064 /// Sets the value of [build][crate::model::Preview::build].
6065 ///
6066 /// # Example
6067 /// ```ignore,no_run
6068 /// # use google_cloud_config_v1::model::Preview;
6069 /// let x = Preview::new().set_build("example");
6070 /// ```
6071 pub fn set_build<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6072 self.build = v.into();
6073 self
6074 }
6075
6076 /// Sets the value of [tf_errors][crate::model::Preview::tf_errors].
6077 ///
6078 /// # Example
6079 /// ```ignore,no_run
6080 /// # use google_cloud_config_v1::model::Preview;
6081 /// use google_cloud_config_v1::model::TerraformError;
6082 /// let x = Preview::new()
6083 /// .set_tf_errors([
6084 /// TerraformError::default()/* use setters */,
6085 /// TerraformError::default()/* use (different) setters */,
6086 /// ]);
6087 /// ```
6088 pub fn set_tf_errors<T, V>(mut self, v: T) -> Self
6089 where
6090 T: std::iter::IntoIterator<Item = V>,
6091 V: std::convert::Into<crate::model::TerraformError>,
6092 {
6093 use std::iter::Iterator;
6094 self.tf_errors = v.into_iter().map(|i| i.into()).collect();
6095 self
6096 }
6097
6098 /// Sets the value of [error_logs][crate::model::Preview::error_logs].
6099 ///
6100 /// # Example
6101 /// ```ignore,no_run
6102 /// # use google_cloud_config_v1::model::Preview;
6103 /// let x = Preview::new().set_error_logs("example");
6104 /// ```
6105 pub fn set_error_logs<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6106 self.error_logs = v.into();
6107 self
6108 }
6109
6110 /// Sets the value of [preview_artifacts][crate::model::Preview::preview_artifacts].
6111 ///
6112 /// # Example
6113 /// ```ignore,no_run
6114 /// # use google_cloud_config_v1::model::Preview;
6115 /// use google_cloud_config_v1::model::PreviewArtifacts;
6116 /// let x = Preview::new().set_preview_artifacts(PreviewArtifacts::default()/* use setters */);
6117 /// ```
6118 pub fn set_preview_artifacts<T>(mut self, v: T) -> Self
6119 where
6120 T: std::convert::Into<crate::model::PreviewArtifacts>,
6121 {
6122 self.preview_artifacts = std::option::Option::Some(v.into());
6123 self
6124 }
6125
6126 /// Sets or clears the value of [preview_artifacts][crate::model::Preview::preview_artifacts].
6127 ///
6128 /// # Example
6129 /// ```ignore,no_run
6130 /// # use google_cloud_config_v1::model::Preview;
6131 /// use google_cloud_config_v1::model::PreviewArtifacts;
6132 /// let x = Preview::new().set_or_clear_preview_artifacts(Some(PreviewArtifacts::default()/* use setters */));
6133 /// let x = Preview::new().set_or_clear_preview_artifacts(None::<PreviewArtifacts>);
6134 /// ```
6135 pub fn set_or_clear_preview_artifacts<T>(mut self, v: std::option::Option<T>) -> Self
6136 where
6137 T: std::convert::Into<crate::model::PreviewArtifacts>,
6138 {
6139 self.preview_artifacts = v.map(|x| x.into());
6140 self
6141 }
6142
6143 /// Sets the value of [logs][crate::model::Preview::logs].
6144 ///
6145 /// # Example
6146 /// ```ignore,no_run
6147 /// # use google_cloud_config_v1::model::Preview;
6148 /// let x = Preview::new().set_logs("example");
6149 /// ```
6150 pub fn set_logs<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6151 self.logs = v.into();
6152 self
6153 }
6154
6155 /// Sets the value of [tf_version][crate::model::Preview::tf_version].
6156 ///
6157 /// # Example
6158 /// ```ignore,no_run
6159 /// # use google_cloud_config_v1::model::Preview;
6160 /// let x = Preview::new().set_tf_version("example");
6161 /// ```
6162 pub fn set_tf_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6163 self.tf_version = v.into();
6164 self
6165 }
6166
6167 /// Sets the value of [tf_version_constraint][crate::model::Preview::tf_version_constraint].
6168 ///
6169 /// # Example
6170 /// ```ignore,no_run
6171 /// # use google_cloud_config_v1::model::Preview;
6172 /// let x = Preview::new().set_tf_version_constraint("example");
6173 /// ```
6174 pub fn set_tf_version_constraint<T>(mut self, v: T) -> Self
6175 where
6176 T: std::convert::Into<std::string::String>,
6177 {
6178 self.tf_version_constraint = std::option::Option::Some(v.into());
6179 self
6180 }
6181
6182 /// Sets or clears the value of [tf_version_constraint][crate::model::Preview::tf_version_constraint].
6183 ///
6184 /// # Example
6185 /// ```ignore,no_run
6186 /// # use google_cloud_config_v1::model::Preview;
6187 /// let x = Preview::new().set_or_clear_tf_version_constraint(Some("example"));
6188 /// let x = Preview::new().set_or_clear_tf_version_constraint(None::<String>);
6189 /// ```
6190 pub fn set_or_clear_tf_version_constraint<T>(mut self, v: std::option::Option<T>) -> Self
6191 where
6192 T: std::convert::Into<std::string::String>,
6193 {
6194 self.tf_version_constraint = v.map(|x| x.into());
6195 self
6196 }
6197
6198 /// Sets the value of [annotations][crate::model::Preview::annotations].
6199 ///
6200 /// # Example
6201 /// ```ignore,no_run
6202 /// # use google_cloud_config_v1::model::Preview;
6203 /// let x = Preview::new().set_annotations([
6204 /// ("key0", "abc"),
6205 /// ("key1", "xyz"),
6206 /// ]);
6207 /// ```
6208 pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
6209 where
6210 T: std::iter::IntoIterator<Item = (K, V)>,
6211 K: std::convert::Into<std::string::String>,
6212 V: std::convert::Into<std::string::String>,
6213 {
6214 use std::iter::Iterator;
6215 self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
6216 self
6217 }
6218
6219 /// Sets the value of [provider_config][crate::model::Preview::provider_config].
6220 ///
6221 /// # Example
6222 /// ```ignore,no_run
6223 /// # use google_cloud_config_v1::model::Preview;
6224 /// use google_cloud_config_v1::model::ProviderConfig;
6225 /// let x = Preview::new().set_provider_config(ProviderConfig::default()/* use setters */);
6226 /// ```
6227 pub fn set_provider_config<T>(mut self, v: T) -> Self
6228 where
6229 T: std::convert::Into<crate::model::ProviderConfig>,
6230 {
6231 self.provider_config = std::option::Option::Some(v.into());
6232 self
6233 }
6234
6235 /// Sets or clears the value of [provider_config][crate::model::Preview::provider_config].
6236 ///
6237 /// # Example
6238 /// ```ignore,no_run
6239 /// # use google_cloud_config_v1::model::Preview;
6240 /// use google_cloud_config_v1::model::ProviderConfig;
6241 /// let x = Preview::new().set_or_clear_provider_config(Some(ProviderConfig::default()/* use setters */));
6242 /// let x = Preview::new().set_or_clear_provider_config(None::<ProviderConfig>);
6243 /// ```
6244 pub fn set_or_clear_provider_config<T>(mut self, v: std::option::Option<T>) -> Self
6245 where
6246 T: std::convert::Into<crate::model::ProviderConfig>,
6247 {
6248 self.provider_config = v.map(|x| x.into());
6249 self
6250 }
6251
6252 /// Sets the value of [blueprint][crate::model::Preview::blueprint].
6253 ///
6254 /// Note that all the setters affecting `blueprint` are mutually
6255 /// exclusive.
6256 ///
6257 /// # Example
6258 /// ```ignore,no_run
6259 /// # use google_cloud_config_v1::model::Preview;
6260 /// use google_cloud_config_v1::model::TerraformBlueprint;
6261 /// let x = Preview::new().set_blueprint(Some(
6262 /// google_cloud_config_v1::model::preview::Blueprint::TerraformBlueprint(TerraformBlueprint::default().into())));
6263 /// ```
6264 pub fn set_blueprint<
6265 T: std::convert::Into<std::option::Option<crate::model::preview::Blueprint>>,
6266 >(
6267 mut self,
6268 v: T,
6269 ) -> Self {
6270 self.blueprint = v.into();
6271 self
6272 }
6273
6274 /// The value of [blueprint][crate::model::Preview::blueprint]
6275 /// if it holds a `TerraformBlueprint`, `None` if the field is not set or
6276 /// holds a different branch.
6277 pub fn terraform_blueprint(
6278 &self,
6279 ) -> std::option::Option<&std::boxed::Box<crate::model::TerraformBlueprint>> {
6280 #[allow(unreachable_patterns)]
6281 self.blueprint.as_ref().and_then(|v| match v {
6282 crate::model::preview::Blueprint::TerraformBlueprint(v) => std::option::Option::Some(v),
6283 _ => std::option::Option::None,
6284 })
6285 }
6286
6287 /// Sets the value of [blueprint][crate::model::Preview::blueprint]
6288 /// to hold a `TerraformBlueprint`.
6289 ///
6290 /// Note that all the setters affecting `blueprint` are
6291 /// mutually exclusive.
6292 ///
6293 /// # Example
6294 /// ```ignore,no_run
6295 /// # use google_cloud_config_v1::model::Preview;
6296 /// use google_cloud_config_v1::model::TerraformBlueprint;
6297 /// let x = Preview::new().set_terraform_blueprint(TerraformBlueprint::default()/* use setters */);
6298 /// assert!(x.terraform_blueprint().is_some());
6299 /// ```
6300 pub fn set_terraform_blueprint<
6301 T: std::convert::Into<std::boxed::Box<crate::model::TerraformBlueprint>>,
6302 >(
6303 mut self,
6304 v: T,
6305 ) -> Self {
6306 self.blueprint = std::option::Option::Some(
6307 crate::model::preview::Blueprint::TerraformBlueprint(v.into()),
6308 );
6309 self
6310 }
6311}
6312
6313impl wkt::message::Message for Preview {
6314 fn typename() -> &'static str {
6315 "type.googleapis.com/google.cloud.config.v1.Preview"
6316 }
6317}
6318
6319/// Defines additional types related to [Preview].
6320pub mod preview {
6321 #[allow(unused_imports)]
6322 use super::*;
6323
6324 /// Possible states of a preview.
6325 ///
6326 /// # Working with unknown values
6327 ///
6328 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6329 /// additional enum variants at any time. Adding new variants is not considered
6330 /// a breaking change. Applications should write their code in anticipation of:
6331 ///
6332 /// - New values appearing in future releases of the client library, **and**
6333 /// - New values received dynamically, without application changes.
6334 ///
6335 /// Please consult the [Working with enums] section in the user guide for some
6336 /// guidelines.
6337 ///
6338 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
6339 #[derive(Clone, Debug, PartialEq)]
6340 #[non_exhaustive]
6341 pub enum State {
6342 /// The default value. This value is used if the state is unknown.
6343 Unspecified,
6344 /// The preview is being created.
6345 Creating,
6346 /// The preview has succeeded.
6347 Succeeded,
6348 /// The preview is being applied.
6349 Applying,
6350 /// The preview is stale. A preview can become stale if a revision has been
6351 /// applied after this preview was created.
6352 Stale,
6353 /// The preview is being deleted.
6354 Deleting,
6355 /// The preview has encountered an unexpected error.
6356 Failed,
6357 /// The preview has been deleted.
6358 Deleted,
6359 /// If set, the enum was initialized with an unknown value.
6360 ///
6361 /// Applications can examine the value using [State::value] or
6362 /// [State::name].
6363 UnknownValue(state::UnknownValue),
6364 }
6365
6366 #[doc(hidden)]
6367 pub mod state {
6368 #[allow(unused_imports)]
6369 use super::*;
6370 #[derive(Clone, Debug, PartialEq)]
6371 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6372 }
6373
6374 impl State {
6375 /// Gets the enum value.
6376 ///
6377 /// Returns `None` if the enum contains an unknown value deserialized from
6378 /// the string representation of enums.
6379 pub fn value(&self) -> std::option::Option<i32> {
6380 match self {
6381 Self::Unspecified => std::option::Option::Some(0),
6382 Self::Creating => std::option::Option::Some(1),
6383 Self::Succeeded => std::option::Option::Some(2),
6384 Self::Applying => std::option::Option::Some(3),
6385 Self::Stale => std::option::Option::Some(4),
6386 Self::Deleting => std::option::Option::Some(5),
6387 Self::Failed => std::option::Option::Some(6),
6388 Self::Deleted => std::option::Option::Some(7),
6389 Self::UnknownValue(u) => u.0.value(),
6390 }
6391 }
6392
6393 /// Gets the enum value as a string.
6394 ///
6395 /// Returns `None` if the enum contains an unknown value deserialized from
6396 /// the integer representation of enums.
6397 pub fn name(&self) -> std::option::Option<&str> {
6398 match self {
6399 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
6400 Self::Creating => std::option::Option::Some("CREATING"),
6401 Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
6402 Self::Applying => std::option::Option::Some("APPLYING"),
6403 Self::Stale => std::option::Option::Some("STALE"),
6404 Self::Deleting => std::option::Option::Some("DELETING"),
6405 Self::Failed => std::option::Option::Some("FAILED"),
6406 Self::Deleted => std::option::Option::Some("DELETED"),
6407 Self::UnknownValue(u) => u.0.name(),
6408 }
6409 }
6410 }
6411
6412 impl std::default::Default for State {
6413 fn default() -> Self {
6414 use std::convert::From;
6415 Self::from(0)
6416 }
6417 }
6418
6419 impl std::fmt::Display for State {
6420 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6421 wkt::internal::display_enum(f, self.name(), self.value())
6422 }
6423 }
6424
6425 impl std::convert::From<i32> for State {
6426 fn from(value: i32) -> Self {
6427 match value {
6428 0 => Self::Unspecified,
6429 1 => Self::Creating,
6430 2 => Self::Succeeded,
6431 3 => Self::Applying,
6432 4 => Self::Stale,
6433 5 => Self::Deleting,
6434 6 => Self::Failed,
6435 7 => Self::Deleted,
6436 _ => Self::UnknownValue(state::UnknownValue(
6437 wkt::internal::UnknownEnumValue::Integer(value),
6438 )),
6439 }
6440 }
6441 }
6442
6443 impl std::convert::From<&str> for State {
6444 fn from(value: &str) -> Self {
6445 use std::string::ToString;
6446 match value {
6447 "STATE_UNSPECIFIED" => Self::Unspecified,
6448 "CREATING" => Self::Creating,
6449 "SUCCEEDED" => Self::Succeeded,
6450 "APPLYING" => Self::Applying,
6451 "STALE" => Self::Stale,
6452 "DELETING" => Self::Deleting,
6453 "FAILED" => Self::Failed,
6454 "DELETED" => Self::Deleted,
6455 _ => Self::UnknownValue(state::UnknownValue(
6456 wkt::internal::UnknownEnumValue::String(value.to_string()),
6457 )),
6458 }
6459 }
6460 }
6461
6462 impl serde::ser::Serialize for State {
6463 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6464 where
6465 S: serde::Serializer,
6466 {
6467 match self {
6468 Self::Unspecified => serializer.serialize_i32(0),
6469 Self::Creating => serializer.serialize_i32(1),
6470 Self::Succeeded => serializer.serialize_i32(2),
6471 Self::Applying => serializer.serialize_i32(3),
6472 Self::Stale => serializer.serialize_i32(4),
6473 Self::Deleting => serializer.serialize_i32(5),
6474 Self::Failed => serializer.serialize_i32(6),
6475 Self::Deleted => serializer.serialize_i32(7),
6476 Self::UnknownValue(u) => u.0.serialize(serializer),
6477 }
6478 }
6479 }
6480
6481 impl<'de> serde::de::Deserialize<'de> for State {
6482 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6483 where
6484 D: serde::Deserializer<'de>,
6485 {
6486 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
6487 ".google.cloud.config.v1.Preview.State",
6488 ))
6489 }
6490 }
6491
6492 /// Preview mode provides options for customizing preview operations.
6493 ///
6494 /// # Working with unknown values
6495 ///
6496 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6497 /// additional enum variants at any time. Adding new variants is not considered
6498 /// a breaking change. Applications should write their code in anticipation of:
6499 ///
6500 /// - New values appearing in future releases of the client library, **and**
6501 /// - New values received dynamically, without application changes.
6502 ///
6503 /// Please consult the [Working with enums] section in the user guide for some
6504 /// guidelines.
6505 ///
6506 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
6507 #[derive(Clone, Debug, PartialEq)]
6508 #[non_exhaustive]
6509 pub enum PreviewMode {
6510 /// Unspecified policy, default mode will be used.
6511 Unspecified,
6512 /// DEFAULT mode generates an execution plan for reconciling current resource
6513 /// state into expected resource state.
6514 Default,
6515 /// DELETE mode generates as execution plan for destroying current resources.
6516 Delete,
6517 /// If set, the enum was initialized with an unknown value.
6518 ///
6519 /// Applications can examine the value using [PreviewMode::value] or
6520 /// [PreviewMode::name].
6521 UnknownValue(preview_mode::UnknownValue),
6522 }
6523
6524 #[doc(hidden)]
6525 pub mod preview_mode {
6526 #[allow(unused_imports)]
6527 use super::*;
6528 #[derive(Clone, Debug, PartialEq)]
6529 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6530 }
6531
6532 impl PreviewMode {
6533 /// Gets the enum value.
6534 ///
6535 /// Returns `None` if the enum contains an unknown value deserialized from
6536 /// the string representation of enums.
6537 pub fn value(&self) -> std::option::Option<i32> {
6538 match self {
6539 Self::Unspecified => std::option::Option::Some(0),
6540 Self::Default => std::option::Option::Some(1),
6541 Self::Delete => std::option::Option::Some(2),
6542 Self::UnknownValue(u) => u.0.value(),
6543 }
6544 }
6545
6546 /// Gets the enum value as a string.
6547 ///
6548 /// Returns `None` if the enum contains an unknown value deserialized from
6549 /// the integer representation of enums.
6550 pub fn name(&self) -> std::option::Option<&str> {
6551 match self {
6552 Self::Unspecified => std::option::Option::Some("PREVIEW_MODE_UNSPECIFIED"),
6553 Self::Default => std::option::Option::Some("DEFAULT"),
6554 Self::Delete => std::option::Option::Some("DELETE"),
6555 Self::UnknownValue(u) => u.0.name(),
6556 }
6557 }
6558 }
6559
6560 impl std::default::Default for PreviewMode {
6561 fn default() -> Self {
6562 use std::convert::From;
6563 Self::from(0)
6564 }
6565 }
6566
6567 impl std::fmt::Display for PreviewMode {
6568 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6569 wkt::internal::display_enum(f, self.name(), self.value())
6570 }
6571 }
6572
6573 impl std::convert::From<i32> for PreviewMode {
6574 fn from(value: i32) -> Self {
6575 match value {
6576 0 => Self::Unspecified,
6577 1 => Self::Default,
6578 2 => Self::Delete,
6579 _ => Self::UnknownValue(preview_mode::UnknownValue(
6580 wkt::internal::UnknownEnumValue::Integer(value),
6581 )),
6582 }
6583 }
6584 }
6585
6586 impl std::convert::From<&str> for PreviewMode {
6587 fn from(value: &str) -> Self {
6588 use std::string::ToString;
6589 match value {
6590 "PREVIEW_MODE_UNSPECIFIED" => Self::Unspecified,
6591 "DEFAULT" => Self::Default,
6592 "DELETE" => Self::Delete,
6593 _ => Self::UnknownValue(preview_mode::UnknownValue(
6594 wkt::internal::UnknownEnumValue::String(value.to_string()),
6595 )),
6596 }
6597 }
6598 }
6599
6600 impl serde::ser::Serialize for PreviewMode {
6601 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6602 where
6603 S: serde::Serializer,
6604 {
6605 match self {
6606 Self::Unspecified => serializer.serialize_i32(0),
6607 Self::Default => serializer.serialize_i32(1),
6608 Self::Delete => serializer.serialize_i32(2),
6609 Self::UnknownValue(u) => u.0.serialize(serializer),
6610 }
6611 }
6612 }
6613
6614 impl<'de> serde::de::Deserialize<'de> for PreviewMode {
6615 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6616 where
6617 D: serde::Deserializer<'de>,
6618 {
6619 deserializer.deserialize_any(wkt::internal::EnumVisitor::<PreviewMode>::new(
6620 ".google.cloud.config.v1.Preview.PreviewMode",
6621 ))
6622 }
6623 }
6624
6625 /// Possible errors that can occur with previews.
6626 ///
6627 /// # Working with unknown values
6628 ///
6629 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6630 /// additional enum variants at any time. Adding new variants is not considered
6631 /// a breaking change. Applications should write their code in anticipation of:
6632 ///
6633 /// - New values appearing in future releases of the client library, **and**
6634 /// - New values received dynamically, without application changes.
6635 ///
6636 /// Please consult the [Working with enums] section in the user guide for some
6637 /// guidelines.
6638 ///
6639 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
6640 #[derive(Clone, Debug, PartialEq)]
6641 #[non_exhaustive]
6642 pub enum ErrorCode {
6643 /// No error code was specified.
6644 Unspecified,
6645 /// Cloud Build failed due to a permissions issue.
6646 CloudBuildPermissionDenied,
6647 /// Cloud Storage bucket failed to create due to a permissions issue.
6648 BucketCreationPermissionDenied,
6649 /// Cloud Storage bucket failed for a non-permissions-related issue.
6650 BucketCreationFailed,
6651 /// Acquiring lock on provided deployment reference failed.
6652 DeploymentLockAcquireFailed,
6653 /// Preview encountered an error when trying to access Cloud Build API.
6654 PreviewBuildApiFailed,
6655 /// Preview created a build but build failed and logs were generated.
6656 PreviewBuildRunFailed,
6657 /// Failed to import values from an external source.
6658 ExternalValueSourceImportFailed,
6659 /// If set, the enum was initialized with an unknown value.
6660 ///
6661 /// Applications can examine the value using [ErrorCode::value] or
6662 /// [ErrorCode::name].
6663 UnknownValue(error_code::UnknownValue),
6664 }
6665
6666 #[doc(hidden)]
6667 pub mod error_code {
6668 #[allow(unused_imports)]
6669 use super::*;
6670 #[derive(Clone, Debug, PartialEq)]
6671 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6672 }
6673
6674 impl ErrorCode {
6675 /// Gets the enum value.
6676 ///
6677 /// Returns `None` if the enum contains an unknown value deserialized from
6678 /// the string representation of enums.
6679 pub fn value(&self) -> std::option::Option<i32> {
6680 match self {
6681 Self::Unspecified => std::option::Option::Some(0),
6682 Self::CloudBuildPermissionDenied => std::option::Option::Some(1),
6683 Self::BucketCreationPermissionDenied => std::option::Option::Some(2),
6684 Self::BucketCreationFailed => std::option::Option::Some(3),
6685 Self::DeploymentLockAcquireFailed => std::option::Option::Some(4),
6686 Self::PreviewBuildApiFailed => std::option::Option::Some(5),
6687 Self::PreviewBuildRunFailed => std::option::Option::Some(6),
6688 Self::ExternalValueSourceImportFailed => std::option::Option::Some(7),
6689 Self::UnknownValue(u) => u.0.value(),
6690 }
6691 }
6692
6693 /// Gets the enum value as a string.
6694 ///
6695 /// Returns `None` if the enum contains an unknown value deserialized from
6696 /// the integer representation of enums.
6697 pub fn name(&self) -> std::option::Option<&str> {
6698 match self {
6699 Self::Unspecified => std::option::Option::Some("ERROR_CODE_UNSPECIFIED"),
6700 Self::CloudBuildPermissionDenied => {
6701 std::option::Option::Some("CLOUD_BUILD_PERMISSION_DENIED")
6702 }
6703 Self::BucketCreationPermissionDenied => {
6704 std::option::Option::Some("BUCKET_CREATION_PERMISSION_DENIED")
6705 }
6706 Self::BucketCreationFailed => std::option::Option::Some("BUCKET_CREATION_FAILED"),
6707 Self::DeploymentLockAcquireFailed => {
6708 std::option::Option::Some("DEPLOYMENT_LOCK_ACQUIRE_FAILED")
6709 }
6710 Self::PreviewBuildApiFailed => {
6711 std::option::Option::Some("PREVIEW_BUILD_API_FAILED")
6712 }
6713 Self::PreviewBuildRunFailed => {
6714 std::option::Option::Some("PREVIEW_BUILD_RUN_FAILED")
6715 }
6716 Self::ExternalValueSourceImportFailed => {
6717 std::option::Option::Some("EXTERNAL_VALUE_SOURCE_IMPORT_FAILED")
6718 }
6719 Self::UnknownValue(u) => u.0.name(),
6720 }
6721 }
6722 }
6723
6724 impl std::default::Default for ErrorCode {
6725 fn default() -> Self {
6726 use std::convert::From;
6727 Self::from(0)
6728 }
6729 }
6730
6731 impl std::fmt::Display for ErrorCode {
6732 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6733 wkt::internal::display_enum(f, self.name(), self.value())
6734 }
6735 }
6736
6737 impl std::convert::From<i32> for ErrorCode {
6738 fn from(value: i32) -> Self {
6739 match value {
6740 0 => Self::Unspecified,
6741 1 => Self::CloudBuildPermissionDenied,
6742 2 => Self::BucketCreationPermissionDenied,
6743 3 => Self::BucketCreationFailed,
6744 4 => Self::DeploymentLockAcquireFailed,
6745 5 => Self::PreviewBuildApiFailed,
6746 6 => Self::PreviewBuildRunFailed,
6747 7 => Self::ExternalValueSourceImportFailed,
6748 _ => Self::UnknownValue(error_code::UnknownValue(
6749 wkt::internal::UnknownEnumValue::Integer(value),
6750 )),
6751 }
6752 }
6753 }
6754
6755 impl std::convert::From<&str> for ErrorCode {
6756 fn from(value: &str) -> Self {
6757 use std::string::ToString;
6758 match value {
6759 "ERROR_CODE_UNSPECIFIED" => Self::Unspecified,
6760 "CLOUD_BUILD_PERMISSION_DENIED" => Self::CloudBuildPermissionDenied,
6761 "BUCKET_CREATION_PERMISSION_DENIED" => Self::BucketCreationPermissionDenied,
6762 "BUCKET_CREATION_FAILED" => Self::BucketCreationFailed,
6763 "DEPLOYMENT_LOCK_ACQUIRE_FAILED" => Self::DeploymentLockAcquireFailed,
6764 "PREVIEW_BUILD_API_FAILED" => Self::PreviewBuildApiFailed,
6765 "PREVIEW_BUILD_RUN_FAILED" => Self::PreviewBuildRunFailed,
6766 "EXTERNAL_VALUE_SOURCE_IMPORT_FAILED" => Self::ExternalValueSourceImportFailed,
6767 _ => Self::UnknownValue(error_code::UnknownValue(
6768 wkt::internal::UnknownEnumValue::String(value.to_string()),
6769 )),
6770 }
6771 }
6772 }
6773
6774 impl serde::ser::Serialize for ErrorCode {
6775 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6776 where
6777 S: serde::Serializer,
6778 {
6779 match self {
6780 Self::Unspecified => serializer.serialize_i32(0),
6781 Self::CloudBuildPermissionDenied => serializer.serialize_i32(1),
6782 Self::BucketCreationPermissionDenied => serializer.serialize_i32(2),
6783 Self::BucketCreationFailed => serializer.serialize_i32(3),
6784 Self::DeploymentLockAcquireFailed => serializer.serialize_i32(4),
6785 Self::PreviewBuildApiFailed => serializer.serialize_i32(5),
6786 Self::PreviewBuildRunFailed => serializer.serialize_i32(6),
6787 Self::ExternalValueSourceImportFailed => serializer.serialize_i32(7),
6788 Self::UnknownValue(u) => u.0.serialize(serializer),
6789 }
6790 }
6791 }
6792
6793 impl<'de> serde::de::Deserialize<'de> for ErrorCode {
6794 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6795 where
6796 D: serde::Deserializer<'de>,
6797 {
6798 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ErrorCode>::new(
6799 ".google.cloud.config.v1.Preview.ErrorCode",
6800 ))
6801 }
6802 }
6803
6804 /// Blueprint to preview.
6805 #[derive(Clone, Debug, PartialEq)]
6806 #[non_exhaustive]
6807 pub enum Blueprint {
6808 /// The terraform blueprint to preview.
6809 TerraformBlueprint(std::boxed::Box<crate::model::TerraformBlueprint>),
6810 }
6811}
6812
6813/// Ephemeral metadata content describing the state of a preview operation.
6814#[derive(Clone, Default, PartialEq)]
6815#[non_exhaustive]
6816pub struct PreviewOperationMetadata {
6817 /// The current step the preview operation is running.
6818 pub step: crate::model::preview_operation_metadata::PreviewStep,
6819
6820 /// Artifacts from preview.
6821 pub preview_artifacts: std::option::Option<crate::model::PreviewArtifacts>,
6822
6823 /// Output only. Location of preview logs in `gs://{bucket}/{object}` format.
6824 pub logs: std::string::String,
6825
6826 /// Output only. Cloud Build instance UUID associated with this preview.
6827 pub build: std::string::String,
6828
6829 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6830}
6831
6832impl PreviewOperationMetadata {
6833 pub fn new() -> Self {
6834 std::default::Default::default()
6835 }
6836
6837 /// Sets the value of [step][crate::model::PreviewOperationMetadata::step].
6838 ///
6839 /// # Example
6840 /// ```ignore,no_run
6841 /// # use google_cloud_config_v1::model::PreviewOperationMetadata;
6842 /// use google_cloud_config_v1::model::preview_operation_metadata::PreviewStep;
6843 /// let x0 = PreviewOperationMetadata::new().set_step(PreviewStep::PreparingStorageBucket);
6844 /// let x1 = PreviewOperationMetadata::new().set_step(PreviewStep::DownloadingBlueprint);
6845 /// let x2 = PreviewOperationMetadata::new().set_step(PreviewStep::RunningTfInit);
6846 /// ```
6847 pub fn set_step<
6848 T: std::convert::Into<crate::model::preview_operation_metadata::PreviewStep>,
6849 >(
6850 mut self,
6851 v: T,
6852 ) -> Self {
6853 self.step = v.into();
6854 self
6855 }
6856
6857 /// Sets the value of [preview_artifacts][crate::model::PreviewOperationMetadata::preview_artifacts].
6858 ///
6859 /// # Example
6860 /// ```ignore,no_run
6861 /// # use google_cloud_config_v1::model::PreviewOperationMetadata;
6862 /// use google_cloud_config_v1::model::PreviewArtifacts;
6863 /// let x = PreviewOperationMetadata::new().set_preview_artifacts(PreviewArtifacts::default()/* use setters */);
6864 /// ```
6865 pub fn set_preview_artifacts<T>(mut self, v: T) -> Self
6866 where
6867 T: std::convert::Into<crate::model::PreviewArtifacts>,
6868 {
6869 self.preview_artifacts = std::option::Option::Some(v.into());
6870 self
6871 }
6872
6873 /// Sets or clears the value of [preview_artifacts][crate::model::PreviewOperationMetadata::preview_artifacts].
6874 ///
6875 /// # Example
6876 /// ```ignore,no_run
6877 /// # use google_cloud_config_v1::model::PreviewOperationMetadata;
6878 /// use google_cloud_config_v1::model::PreviewArtifacts;
6879 /// let x = PreviewOperationMetadata::new().set_or_clear_preview_artifacts(Some(PreviewArtifacts::default()/* use setters */));
6880 /// let x = PreviewOperationMetadata::new().set_or_clear_preview_artifacts(None::<PreviewArtifacts>);
6881 /// ```
6882 pub fn set_or_clear_preview_artifacts<T>(mut self, v: std::option::Option<T>) -> Self
6883 where
6884 T: std::convert::Into<crate::model::PreviewArtifacts>,
6885 {
6886 self.preview_artifacts = v.map(|x| x.into());
6887 self
6888 }
6889
6890 /// Sets the value of [logs][crate::model::PreviewOperationMetadata::logs].
6891 ///
6892 /// # Example
6893 /// ```ignore,no_run
6894 /// # use google_cloud_config_v1::model::PreviewOperationMetadata;
6895 /// let x = PreviewOperationMetadata::new().set_logs("example");
6896 /// ```
6897 pub fn set_logs<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6898 self.logs = v.into();
6899 self
6900 }
6901
6902 /// Sets the value of [build][crate::model::PreviewOperationMetadata::build].
6903 ///
6904 /// # Example
6905 /// ```ignore,no_run
6906 /// # use google_cloud_config_v1::model::PreviewOperationMetadata;
6907 /// let x = PreviewOperationMetadata::new().set_build("example");
6908 /// ```
6909 pub fn set_build<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6910 self.build = v.into();
6911 self
6912 }
6913}
6914
6915impl wkt::message::Message for PreviewOperationMetadata {
6916 fn typename() -> &'static str {
6917 "type.googleapis.com/google.cloud.config.v1.PreviewOperationMetadata"
6918 }
6919}
6920
6921/// Defines additional types related to [PreviewOperationMetadata].
6922pub mod preview_operation_metadata {
6923 #[allow(unused_imports)]
6924 use super::*;
6925
6926 /// The possible steps a preview may be running.
6927 ///
6928 /// # Working with unknown values
6929 ///
6930 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6931 /// additional enum variants at any time. Adding new variants is not considered
6932 /// a breaking change. Applications should write their code in anticipation of:
6933 ///
6934 /// - New values appearing in future releases of the client library, **and**
6935 /// - New values received dynamically, without application changes.
6936 ///
6937 /// Please consult the [Working with enums] section in the user guide for some
6938 /// guidelines.
6939 ///
6940 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
6941 #[derive(Clone, Debug, PartialEq)]
6942 #[non_exhaustive]
6943 pub enum PreviewStep {
6944 /// Unspecified preview step.
6945 Unspecified,
6946 /// Infra Manager is creating a Google Cloud Storage bucket to store
6947 /// artifacts and metadata about the preview.
6948 PreparingStorageBucket,
6949 /// Downloading the blueprint onto the Google Cloud Storage bucket.
6950 DownloadingBlueprint,
6951 /// Initializing Terraform using `terraform init`.
6952 RunningTfInit,
6953 /// Running `terraform plan`.
6954 RunningTfPlan,
6955 /// Fetching a deployment.
6956 FetchingDeployment,
6957 /// Locking a deployment.
6958 LockingDeployment,
6959 /// Unlocking a deployment.
6960 UnlockingDeployment,
6961 /// Operation was successful.
6962 Succeeded,
6963 /// Operation failed.
6964 Failed,
6965 /// Validating the provided repository.
6966 ValidatingRepository,
6967 /// If set, the enum was initialized with an unknown value.
6968 ///
6969 /// Applications can examine the value using [PreviewStep::value] or
6970 /// [PreviewStep::name].
6971 UnknownValue(preview_step::UnknownValue),
6972 }
6973
6974 #[doc(hidden)]
6975 pub mod preview_step {
6976 #[allow(unused_imports)]
6977 use super::*;
6978 #[derive(Clone, Debug, PartialEq)]
6979 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6980 }
6981
6982 impl PreviewStep {
6983 /// Gets the enum value.
6984 ///
6985 /// Returns `None` if the enum contains an unknown value deserialized from
6986 /// the string representation of enums.
6987 pub fn value(&self) -> std::option::Option<i32> {
6988 match self {
6989 Self::Unspecified => std::option::Option::Some(0),
6990 Self::PreparingStorageBucket => std::option::Option::Some(1),
6991 Self::DownloadingBlueprint => std::option::Option::Some(2),
6992 Self::RunningTfInit => std::option::Option::Some(3),
6993 Self::RunningTfPlan => std::option::Option::Some(4),
6994 Self::FetchingDeployment => std::option::Option::Some(5),
6995 Self::LockingDeployment => std::option::Option::Some(6),
6996 Self::UnlockingDeployment => std::option::Option::Some(7),
6997 Self::Succeeded => std::option::Option::Some(8),
6998 Self::Failed => std::option::Option::Some(9),
6999 Self::ValidatingRepository => std::option::Option::Some(10),
7000 Self::UnknownValue(u) => u.0.value(),
7001 }
7002 }
7003
7004 /// Gets the enum value as a string.
7005 ///
7006 /// Returns `None` if the enum contains an unknown value deserialized from
7007 /// the integer representation of enums.
7008 pub fn name(&self) -> std::option::Option<&str> {
7009 match self {
7010 Self::Unspecified => std::option::Option::Some("PREVIEW_STEP_UNSPECIFIED"),
7011 Self::PreparingStorageBucket => {
7012 std::option::Option::Some("PREPARING_STORAGE_BUCKET")
7013 }
7014 Self::DownloadingBlueprint => std::option::Option::Some("DOWNLOADING_BLUEPRINT"),
7015 Self::RunningTfInit => std::option::Option::Some("RUNNING_TF_INIT"),
7016 Self::RunningTfPlan => std::option::Option::Some("RUNNING_TF_PLAN"),
7017 Self::FetchingDeployment => std::option::Option::Some("FETCHING_DEPLOYMENT"),
7018 Self::LockingDeployment => std::option::Option::Some("LOCKING_DEPLOYMENT"),
7019 Self::UnlockingDeployment => std::option::Option::Some("UNLOCKING_DEPLOYMENT"),
7020 Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
7021 Self::Failed => std::option::Option::Some("FAILED"),
7022 Self::ValidatingRepository => std::option::Option::Some("VALIDATING_REPOSITORY"),
7023 Self::UnknownValue(u) => u.0.name(),
7024 }
7025 }
7026 }
7027
7028 impl std::default::Default for PreviewStep {
7029 fn default() -> Self {
7030 use std::convert::From;
7031 Self::from(0)
7032 }
7033 }
7034
7035 impl std::fmt::Display for PreviewStep {
7036 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7037 wkt::internal::display_enum(f, self.name(), self.value())
7038 }
7039 }
7040
7041 impl std::convert::From<i32> for PreviewStep {
7042 fn from(value: i32) -> Self {
7043 match value {
7044 0 => Self::Unspecified,
7045 1 => Self::PreparingStorageBucket,
7046 2 => Self::DownloadingBlueprint,
7047 3 => Self::RunningTfInit,
7048 4 => Self::RunningTfPlan,
7049 5 => Self::FetchingDeployment,
7050 6 => Self::LockingDeployment,
7051 7 => Self::UnlockingDeployment,
7052 8 => Self::Succeeded,
7053 9 => Self::Failed,
7054 10 => Self::ValidatingRepository,
7055 _ => Self::UnknownValue(preview_step::UnknownValue(
7056 wkt::internal::UnknownEnumValue::Integer(value),
7057 )),
7058 }
7059 }
7060 }
7061
7062 impl std::convert::From<&str> for PreviewStep {
7063 fn from(value: &str) -> Self {
7064 use std::string::ToString;
7065 match value {
7066 "PREVIEW_STEP_UNSPECIFIED" => Self::Unspecified,
7067 "PREPARING_STORAGE_BUCKET" => Self::PreparingStorageBucket,
7068 "DOWNLOADING_BLUEPRINT" => Self::DownloadingBlueprint,
7069 "RUNNING_TF_INIT" => Self::RunningTfInit,
7070 "RUNNING_TF_PLAN" => Self::RunningTfPlan,
7071 "FETCHING_DEPLOYMENT" => Self::FetchingDeployment,
7072 "LOCKING_DEPLOYMENT" => Self::LockingDeployment,
7073 "UNLOCKING_DEPLOYMENT" => Self::UnlockingDeployment,
7074 "SUCCEEDED" => Self::Succeeded,
7075 "FAILED" => Self::Failed,
7076 "VALIDATING_REPOSITORY" => Self::ValidatingRepository,
7077 _ => Self::UnknownValue(preview_step::UnknownValue(
7078 wkt::internal::UnknownEnumValue::String(value.to_string()),
7079 )),
7080 }
7081 }
7082 }
7083
7084 impl serde::ser::Serialize for PreviewStep {
7085 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7086 where
7087 S: serde::Serializer,
7088 {
7089 match self {
7090 Self::Unspecified => serializer.serialize_i32(0),
7091 Self::PreparingStorageBucket => serializer.serialize_i32(1),
7092 Self::DownloadingBlueprint => serializer.serialize_i32(2),
7093 Self::RunningTfInit => serializer.serialize_i32(3),
7094 Self::RunningTfPlan => serializer.serialize_i32(4),
7095 Self::FetchingDeployment => serializer.serialize_i32(5),
7096 Self::LockingDeployment => serializer.serialize_i32(6),
7097 Self::UnlockingDeployment => serializer.serialize_i32(7),
7098 Self::Succeeded => serializer.serialize_i32(8),
7099 Self::Failed => serializer.serialize_i32(9),
7100 Self::ValidatingRepository => serializer.serialize_i32(10),
7101 Self::UnknownValue(u) => u.0.serialize(serializer),
7102 }
7103 }
7104 }
7105
7106 impl<'de> serde::de::Deserialize<'de> for PreviewStep {
7107 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7108 where
7109 D: serde::Deserializer<'de>,
7110 {
7111 deserializer.deserialize_any(wkt::internal::EnumVisitor::<PreviewStep>::new(
7112 ".google.cloud.config.v1.PreviewOperationMetadata.PreviewStep",
7113 ))
7114 }
7115 }
7116}
7117
7118/// Artifacts created by preview.
7119#[derive(Clone, Default, PartialEq)]
7120#[non_exhaustive]
7121pub struct PreviewArtifacts {
7122 /// Output only. Location of a blueprint copy and other content in Google Cloud
7123 /// Storage. Format: `gs://{bucket}/{object}`
7124 pub content: std::string::String,
7125
7126 /// Output only. Location of artifacts in Google Cloud Storage.
7127 /// Format: `gs://{bucket}/{object}`
7128 pub artifacts: std::string::String,
7129
7130 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7131}
7132
7133impl PreviewArtifacts {
7134 pub fn new() -> Self {
7135 std::default::Default::default()
7136 }
7137
7138 /// Sets the value of [content][crate::model::PreviewArtifacts::content].
7139 ///
7140 /// # Example
7141 /// ```ignore,no_run
7142 /// # use google_cloud_config_v1::model::PreviewArtifacts;
7143 /// let x = PreviewArtifacts::new().set_content("example");
7144 /// ```
7145 pub fn set_content<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7146 self.content = v.into();
7147 self
7148 }
7149
7150 /// Sets the value of [artifacts][crate::model::PreviewArtifacts::artifacts].
7151 ///
7152 /// # Example
7153 /// ```ignore,no_run
7154 /// # use google_cloud_config_v1::model::PreviewArtifacts;
7155 /// let x = PreviewArtifacts::new().set_artifacts("example");
7156 /// ```
7157 pub fn set_artifacts<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7158 self.artifacts = v.into();
7159 self
7160 }
7161}
7162
7163impl wkt::message::Message for PreviewArtifacts {
7164 fn typename() -> &'static str {
7165 "type.googleapis.com/google.cloud.config.v1.PreviewArtifacts"
7166 }
7167}
7168
7169/// A request to create a preview.
7170#[derive(Clone, Default, PartialEq)]
7171#[non_exhaustive]
7172pub struct CreatePreviewRequest {
7173 /// Required. The parent in whose context the Preview is created. The parent
7174 /// value is in the format: 'projects/{project_id}/locations/{location}'.
7175 pub parent: std::string::String,
7176
7177 /// Optional. The preview ID.
7178 pub preview_id: std::string::String,
7179
7180 /// Required. [Preview][google.cloud.config.v1.Preview] resource to be created.
7181 ///
7182 /// [google.cloud.config.v1.Preview]: crate::model::Preview
7183 pub preview: std::option::Option<crate::model::Preview>,
7184
7185 /// Optional. An optional request ID to identify requests. Specify a unique
7186 /// request ID so that if you must retry your request, the server will know to
7187 /// ignore the request if it has already been completed. The server will
7188 /// guarantee that for at least 60 minutes since the first request.
7189 ///
7190 /// For example, consider a situation where you make an initial request and the
7191 /// request times out. If you make the request again with the same request ID,
7192 /// the server can check if original operation with the same request ID was
7193 /// received, and if so, will ignore the second request. This prevents clients
7194 /// from accidentally creating duplicate commitments.
7195 ///
7196 /// The request ID must be a valid UUID with the exception that zero UUID is
7197 /// not supported (00000000-0000-0000-0000-000000000000).
7198 pub request_id: std::string::String,
7199
7200 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7201}
7202
7203impl CreatePreviewRequest {
7204 pub fn new() -> Self {
7205 std::default::Default::default()
7206 }
7207
7208 /// Sets the value of [parent][crate::model::CreatePreviewRequest::parent].
7209 ///
7210 /// # Example
7211 /// ```ignore,no_run
7212 /// # use google_cloud_config_v1::model::CreatePreviewRequest;
7213 /// let x = CreatePreviewRequest::new().set_parent("example");
7214 /// ```
7215 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7216 self.parent = v.into();
7217 self
7218 }
7219
7220 /// Sets the value of [preview_id][crate::model::CreatePreviewRequest::preview_id].
7221 ///
7222 /// # Example
7223 /// ```ignore,no_run
7224 /// # use google_cloud_config_v1::model::CreatePreviewRequest;
7225 /// let x = CreatePreviewRequest::new().set_preview_id("example");
7226 /// ```
7227 pub fn set_preview_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7228 self.preview_id = v.into();
7229 self
7230 }
7231
7232 /// Sets the value of [preview][crate::model::CreatePreviewRequest::preview].
7233 ///
7234 /// # Example
7235 /// ```ignore,no_run
7236 /// # use google_cloud_config_v1::model::CreatePreviewRequest;
7237 /// use google_cloud_config_v1::model::Preview;
7238 /// let x = CreatePreviewRequest::new().set_preview(Preview::default()/* use setters */);
7239 /// ```
7240 pub fn set_preview<T>(mut self, v: T) -> Self
7241 where
7242 T: std::convert::Into<crate::model::Preview>,
7243 {
7244 self.preview = std::option::Option::Some(v.into());
7245 self
7246 }
7247
7248 /// Sets or clears the value of [preview][crate::model::CreatePreviewRequest::preview].
7249 ///
7250 /// # Example
7251 /// ```ignore,no_run
7252 /// # use google_cloud_config_v1::model::CreatePreviewRequest;
7253 /// use google_cloud_config_v1::model::Preview;
7254 /// let x = CreatePreviewRequest::new().set_or_clear_preview(Some(Preview::default()/* use setters */));
7255 /// let x = CreatePreviewRequest::new().set_or_clear_preview(None::<Preview>);
7256 /// ```
7257 pub fn set_or_clear_preview<T>(mut self, v: std::option::Option<T>) -> Self
7258 where
7259 T: std::convert::Into<crate::model::Preview>,
7260 {
7261 self.preview = v.map(|x| x.into());
7262 self
7263 }
7264
7265 /// Sets the value of [request_id][crate::model::CreatePreviewRequest::request_id].
7266 ///
7267 /// # Example
7268 /// ```ignore,no_run
7269 /// # use google_cloud_config_v1::model::CreatePreviewRequest;
7270 /// let x = CreatePreviewRequest::new().set_request_id("example");
7271 /// ```
7272 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7273 self.request_id = v.into();
7274 self
7275 }
7276}
7277
7278impl wkt::message::Message for CreatePreviewRequest {
7279 fn typename() -> &'static str {
7280 "type.googleapis.com/google.cloud.config.v1.CreatePreviewRequest"
7281 }
7282}
7283
7284/// A request to get details about a preview.
7285#[derive(Clone, Default, PartialEq)]
7286#[non_exhaustive]
7287pub struct GetPreviewRequest {
7288 /// Required. The name of the preview. Format:
7289 /// 'projects/{project_id}/locations/{location}/previews/{preview}'.
7290 pub name: std::string::String,
7291
7292 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7293}
7294
7295impl GetPreviewRequest {
7296 pub fn new() -> Self {
7297 std::default::Default::default()
7298 }
7299
7300 /// Sets the value of [name][crate::model::GetPreviewRequest::name].
7301 ///
7302 /// # Example
7303 /// ```ignore,no_run
7304 /// # use google_cloud_config_v1::model::GetPreviewRequest;
7305 /// let x = GetPreviewRequest::new().set_name("example");
7306 /// ```
7307 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7308 self.name = v.into();
7309 self
7310 }
7311}
7312
7313impl wkt::message::Message for GetPreviewRequest {
7314 fn typename() -> &'static str {
7315 "type.googleapis.com/google.cloud.config.v1.GetPreviewRequest"
7316 }
7317}
7318
7319/// A request to list all previews for a given project and location.
7320#[derive(Clone, Default, PartialEq)]
7321#[non_exhaustive]
7322pub struct ListPreviewsRequest {
7323 /// Required. The parent in whose context the Previews are listed. The parent
7324 /// value is in the format: 'projects/{project_id}/locations/{location}'.
7325 pub parent: std::string::String,
7326
7327 /// Optional. When requesting a page of resources, 'page_size' specifies number
7328 /// of resources to return. If unspecified, at most 500 will be returned. The
7329 /// maximum value is 1000.
7330 pub page_size: i32,
7331
7332 /// Optional. Token returned by previous call to 'ListDeployments' which
7333 /// specifies the position in the list from where to continue listing the
7334 /// resources.
7335 pub page_token: std::string::String,
7336
7337 /// Optional. Lists the Deployments that match the filter expression. A filter
7338 /// expression filters the resources listed in the response. The expression
7339 /// must be of the form '{field} {operator} {value}' where operators: '<', '>',
7340 /// '<=', '>=', '!=', '=', ':' are supported (colon ':' represents a HAS
7341 /// operator which is roughly synonymous with equality). {field} can refer to a
7342 /// proto or JSON field, or a synthetic field. Field names can be camelCase or
7343 /// snake_case.
7344 ///
7345 /// Examples:
7346 ///
7347 /// - Filter by name:
7348 /// name = "projects/foo/locations/us-central1/deployments/bar
7349 ///
7350 /// - Filter by labels:
7351 ///
7352 /// - Resources that have a key called 'foo'
7353 /// labels.foo:*
7354 /// - Resources that have a key called 'foo' whose value is 'bar'
7355 /// labels.foo = bar
7356 /// - Filter by state:
7357 ///
7358 /// - Deployments in CREATING state.
7359 /// state=CREATING
7360 pub filter: std::string::String,
7361
7362 /// Optional. Field to use to sort the list.
7363 pub order_by: std::string::String,
7364
7365 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7366}
7367
7368impl ListPreviewsRequest {
7369 pub fn new() -> Self {
7370 std::default::Default::default()
7371 }
7372
7373 /// Sets the value of [parent][crate::model::ListPreviewsRequest::parent].
7374 ///
7375 /// # Example
7376 /// ```ignore,no_run
7377 /// # use google_cloud_config_v1::model::ListPreviewsRequest;
7378 /// let x = ListPreviewsRequest::new().set_parent("example");
7379 /// ```
7380 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7381 self.parent = v.into();
7382 self
7383 }
7384
7385 /// Sets the value of [page_size][crate::model::ListPreviewsRequest::page_size].
7386 ///
7387 /// # Example
7388 /// ```ignore,no_run
7389 /// # use google_cloud_config_v1::model::ListPreviewsRequest;
7390 /// let x = ListPreviewsRequest::new().set_page_size(42);
7391 /// ```
7392 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7393 self.page_size = v.into();
7394 self
7395 }
7396
7397 /// Sets the value of [page_token][crate::model::ListPreviewsRequest::page_token].
7398 ///
7399 /// # Example
7400 /// ```ignore,no_run
7401 /// # use google_cloud_config_v1::model::ListPreviewsRequest;
7402 /// let x = ListPreviewsRequest::new().set_page_token("example");
7403 /// ```
7404 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7405 self.page_token = v.into();
7406 self
7407 }
7408
7409 /// Sets the value of [filter][crate::model::ListPreviewsRequest::filter].
7410 ///
7411 /// # Example
7412 /// ```ignore,no_run
7413 /// # use google_cloud_config_v1::model::ListPreviewsRequest;
7414 /// let x = ListPreviewsRequest::new().set_filter("example");
7415 /// ```
7416 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7417 self.filter = v.into();
7418 self
7419 }
7420
7421 /// Sets the value of [order_by][crate::model::ListPreviewsRequest::order_by].
7422 ///
7423 /// # Example
7424 /// ```ignore,no_run
7425 /// # use google_cloud_config_v1::model::ListPreviewsRequest;
7426 /// let x = ListPreviewsRequest::new().set_order_by("example");
7427 /// ```
7428 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7429 self.order_by = v.into();
7430 self
7431 }
7432}
7433
7434impl wkt::message::Message for ListPreviewsRequest {
7435 fn typename() -> &'static str {
7436 "type.googleapis.com/google.cloud.config.v1.ListPreviewsRequest"
7437 }
7438}
7439
7440/// A response to a `ListPreviews` call. Contains a list of Previews.
7441#[derive(Clone, Default, PartialEq)]
7442#[non_exhaustive]
7443pub struct ListPreviewsResponse {
7444 /// List of [Previews][google.cloud.config.v1.Preview].
7445 ///
7446 /// [google.cloud.config.v1.Preview]: crate::model::Preview
7447 pub previews: std::vec::Vec<crate::model::Preview>,
7448
7449 /// Token to be supplied to the next ListPreviews request via `page_token`
7450 /// to obtain the next set of results.
7451 pub next_page_token: std::string::String,
7452
7453 /// Locations that could not be reached.
7454 pub unreachable: std::vec::Vec<std::string::String>,
7455
7456 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7457}
7458
7459impl ListPreviewsResponse {
7460 pub fn new() -> Self {
7461 std::default::Default::default()
7462 }
7463
7464 /// Sets the value of [previews][crate::model::ListPreviewsResponse::previews].
7465 ///
7466 /// # Example
7467 /// ```ignore,no_run
7468 /// # use google_cloud_config_v1::model::ListPreviewsResponse;
7469 /// use google_cloud_config_v1::model::Preview;
7470 /// let x = ListPreviewsResponse::new()
7471 /// .set_previews([
7472 /// Preview::default()/* use setters */,
7473 /// Preview::default()/* use (different) setters */,
7474 /// ]);
7475 /// ```
7476 pub fn set_previews<T, V>(mut self, v: T) -> Self
7477 where
7478 T: std::iter::IntoIterator<Item = V>,
7479 V: std::convert::Into<crate::model::Preview>,
7480 {
7481 use std::iter::Iterator;
7482 self.previews = v.into_iter().map(|i| i.into()).collect();
7483 self
7484 }
7485
7486 /// Sets the value of [next_page_token][crate::model::ListPreviewsResponse::next_page_token].
7487 ///
7488 /// # Example
7489 /// ```ignore,no_run
7490 /// # use google_cloud_config_v1::model::ListPreviewsResponse;
7491 /// let x = ListPreviewsResponse::new().set_next_page_token("example");
7492 /// ```
7493 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7494 self.next_page_token = v.into();
7495 self
7496 }
7497
7498 /// Sets the value of [unreachable][crate::model::ListPreviewsResponse::unreachable].
7499 ///
7500 /// # Example
7501 /// ```ignore,no_run
7502 /// # use google_cloud_config_v1::model::ListPreviewsResponse;
7503 /// let x = ListPreviewsResponse::new().set_unreachable(["a", "b", "c"]);
7504 /// ```
7505 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
7506 where
7507 T: std::iter::IntoIterator<Item = V>,
7508 V: std::convert::Into<std::string::String>,
7509 {
7510 use std::iter::Iterator;
7511 self.unreachable = v.into_iter().map(|i| i.into()).collect();
7512 self
7513 }
7514}
7515
7516impl wkt::message::Message for ListPreviewsResponse {
7517 fn typename() -> &'static str {
7518 "type.googleapis.com/google.cloud.config.v1.ListPreviewsResponse"
7519 }
7520}
7521
7522#[doc(hidden)]
7523impl google_cloud_gax::paginator::internal::PageableResponse for ListPreviewsResponse {
7524 type PageItem = crate::model::Preview;
7525
7526 fn items(self) -> std::vec::Vec<Self::PageItem> {
7527 self.previews
7528 }
7529
7530 fn next_page_token(&self) -> std::string::String {
7531 use std::clone::Clone;
7532 self.next_page_token.clone()
7533 }
7534}
7535
7536/// A request to delete a preview.
7537#[derive(Clone, Default, PartialEq)]
7538#[non_exhaustive]
7539pub struct DeletePreviewRequest {
7540 /// Required. The name of the Preview in the format:
7541 /// 'projects/{project_id}/locations/{location}/previews/{preview}'.
7542 pub name: std::string::String,
7543
7544 /// Optional. An optional request ID to identify requests. Specify a unique
7545 /// request ID so that if you must retry your request, the server will know to
7546 /// ignore the request if it has already been completed. The server will
7547 /// guarantee that for at least 60 minutes after the first request.
7548 ///
7549 /// For example, consider a situation where you make an initial request and the
7550 /// request times out. If you make the request again with the same request ID,
7551 /// the server can check if original operation with the same request ID was
7552 /// received, and if so, will ignore the second request. This prevents clients
7553 /// from accidentally creating duplicate commitments.
7554 ///
7555 /// The request ID must be a valid UUID with the exception that zero UUID is
7556 /// not supported (00000000-0000-0000-0000-000000000000).
7557 pub request_id: std::string::String,
7558
7559 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7560}
7561
7562impl DeletePreviewRequest {
7563 pub fn new() -> Self {
7564 std::default::Default::default()
7565 }
7566
7567 /// Sets the value of [name][crate::model::DeletePreviewRequest::name].
7568 ///
7569 /// # Example
7570 /// ```ignore,no_run
7571 /// # use google_cloud_config_v1::model::DeletePreviewRequest;
7572 /// let x = DeletePreviewRequest::new().set_name("example");
7573 /// ```
7574 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7575 self.name = v.into();
7576 self
7577 }
7578
7579 /// Sets the value of [request_id][crate::model::DeletePreviewRequest::request_id].
7580 ///
7581 /// # Example
7582 /// ```ignore,no_run
7583 /// # use google_cloud_config_v1::model::DeletePreviewRequest;
7584 /// let x = DeletePreviewRequest::new().set_request_id("example");
7585 /// ```
7586 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7587 self.request_id = v.into();
7588 self
7589 }
7590}
7591
7592impl wkt::message::Message for DeletePreviewRequest {
7593 fn typename() -> &'static str {
7594 "type.googleapis.com/google.cloud.config.v1.DeletePreviewRequest"
7595 }
7596}
7597
7598/// A request to export preview results.
7599#[derive(Clone, Default, PartialEq)]
7600#[non_exhaustive]
7601pub struct ExportPreviewResultRequest {
7602 /// Required. The preview whose results should be exported. The preview value
7603 /// is in the format:
7604 /// 'projects/{project_id}/locations/{location}/previews/{preview}'.
7605 pub parent: std::string::String,
7606
7607 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7608}
7609
7610impl ExportPreviewResultRequest {
7611 pub fn new() -> Self {
7612 std::default::Default::default()
7613 }
7614
7615 /// Sets the value of [parent][crate::model::ExportPreviewResultRequest::parent].
7616 ///
7617 /// # Example
7618 /// ```ignore,no_run
7619 /// # use google_cloud_config_v1::model::ExportPreviewResultRequest;
7620 /// let x = ExportPreviewResultRequest::new().set_parent("example");
7621 /// ```
7622 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7623 self.parent = v.into();
7624 self
7625 }
7626}
7627
7628impl wkt::message::Message for ExportPreviewResultRequest {
7629 fn typename() -> &'static str {
7630 "type.googleapis.com/google.cloud.config.v1.ExportPreviewResultRequest"
7631 }
7632}
7633
7634/// A response to `ExportPreviewResult` call. Contains preview results.
7635#[derive(Clone, Default, PartialEq)]
7636#[non_exhaustive]
7637pub struct ExportPreviewResultResponse {
7638 /// Output only. Signed URLs for accessing the plan files.
7639 pub result: std::option::Option<crate::model::PreviewResult>,
7640
7641 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7642}
7643
7644impl ExportPreviewResultResponse {
7645 pub fn new() -> Self {
7646 std::default::Default::default()
7647 }
7648
7649 /// Sets the value of [result][crate::model::ExportPreviewResultResponse::result].
7650 ///
7651 /// # Example
7652 /// ```ignore,no_run
7653 /// # use google_cloud_config_v1::model::ExportPreviewResultResponse;
7654 /// use google_cloud_config_v1::model::PreviewResult;
7655 /// let x = ExportPreviewResultResponse::new().set_result(PreviewResult::default()/* use setters */);
7656 /// ```
7657 pub fn set_result<T>(mut self, v: T) -> Self
7658 where
7659 T: std::convert::Into<crate::model::PreviewResult>,
7660 {
7661 self.result = std::option::Option::Some(v.into());
7662 self
7663 }
7664
7665 /// Sets or clears the value of [result][crate::model::ExportPreviewResultResponse::result].
7666 ///
7667 /// # Example
7668 /// ```ignore,no_run
7669 /// # use google_cloud_config_v1::model::ExportPreviewResultResponse;
7670 /// use google_cloud_config_v1::model::PreviewResult;
7671 /// let x = ExportPreviewResultResponse::new().set_or_clear_result(Some(PreviewResult::default()/* use setters */));
7672 /// let x = ExportPreviewResultResponse::new().set_or_clear_result(None::<PreviewResult>);
7673 /// ```
7674 pub fn set_or_clear_result<T>(mut self, v: std::option::Option<T>) -> Self
7675 where
7676 T: std::convert::Into<crate::model::PreviewResult>,
7677 {
7678 self.result = v.map(|x| x.into());
7679 self
7680 }
7681}
7682
7683impl wkt::message::Message for ExportPreviewResultResponse {
7684 fn typename() -> &'static str {
7685 "type.googleapis.com/google.cloud.config.v1.ExportPreviewResultResponse"
7686 }
7687}
7688
7689/// Contains a signed Cloud Storage URLs.
7690#[derive(Clone, Default, PartialEq)]
7691#[non_exhaustive]
7692pub struct PreviewResult {
7693 /// Output only. Plan binary signed URL
7694 pub binary_signed_uri: std::string::String,
7695
7696 /// Output only. Plan JSON signed URL
7697 pub json_signed_uri: std::string::String,
7698
7699 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7700}
7701
7702impl PreviewResult {
7703 pub fn new() -> Self {
7704 std::default::Default::default()
7705 }
7706
7707 /// Sets the value of [binary_signed_uri][crate::model::PreviewResult::binary_signed_uri].
7708 ///
7709 /// # Example
7710 /// ```ignore,no_run
7711 /// # use google_cloud_config_v1::model::PreviewResult;
7712 /// let x = PreviewResult::new().set_binary_signed_uri("example");
7713 /// ```
7714 pub fn set_binary_signed_uri<T: std::convert::Into<std::string::String>>(
7715 mut self,
7716 v: T,
7717 ) -> Self {
7718 self.binary_signed_uri = v.into();
7719 self
7720 }
7721
7722 /// Sets the value of [json_signed_uri][crate::model::PreviewResult::json_signed_uri].
7723 ///
7724 /// # Example
7725 /// ```ignore,no_run
7726 /// # use google_cloud_config_v1::model::PreviewResult;
7727 /// let x = PreviewResult::new().set_json_signed_uri("example");
7728 /// ```
7729 pub fn set_json_signed_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7730 self.json_signed_uri = v.into();
7731 self
7732 }
7733}
7734
7735impl wkt::message::Message for PreviewResult {
7736 fn typename() -> &'static str {
7737 "type.googleapis.com/google.cloud.config.v1.PreviewResult"
7738 }
7739}
7740
7741/// The request message for the GetTerraformVersion method.
7742#[derive(Clone, Default, PartialEq)]
7743#[non_exhaustive]
7744pub struct GetTerraformVersionRequest {
7745 /// Required. The name of the TerraformVersion. Format:
7746 /// 'projects/{project_id}/locations/{location}/terraformVersions/{terraform_version}'
7747 pub name: std::string::String,
7748
7749 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7750}
7751
7752impl GetTerraformVersionRequest {
7753 pub fn new() -> Self {
7754 std::default::Default::default()
7755 }
7756
7757 /// Sets the value of [name][crate::model::GetTerraformVersionRequest::name].
7758 ///
7759 /// # Example
7760 /// ```ignore,no_run
7761 /// # use google_cloud_config_v1::model::GetTerraformVersionRequest;
7762 /// let x = GetTerraformVersionRequest::new().set_name("example");
7763 /// ```
7764 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7765 self.name = v.into();
7766 self
7767 }
7768}
7769
7770impl wkt::message::Message for GetTerraformVersionRequest {
7771 fn typename() -> &'static str {
7772 "type.googleapis.com/google.cloud.config.v1.GetTerraformVersionRequest"
7773 }
7774}
7775
7776/// The request message for the ListTerraformVersions method.
7777#[derive(Clone, Default, PartialEq)]
7778#[non_exhaustive]
7779pub struct ListTerraformVersionsRequest {
7780 /// Required. The parent in whose context the TerraformVersions are listed. The
7781 /// parent value is in the format:
7782 /// 'projects/{project_id}/locations/{location}'.
7783 pub parent: std::string::String,
7784
7785 /// Optional. When requesting a page of terraform versions, 'page_size'
7786 /// specifies number of terraform versions to return. If unspecified, at most
7787 /// 500 will be returned. The maximum value is 1000.
7788 pub page_size: i32,
7789
7790 /// Optional. Token returned by previous call to 'ListTerraformVersions' which
7791 /// specifies the position in the list from where to continue listing the
7792 /// terraform versions.
7793 pub page_token: std::string::String,
7794
7795 /// Optional. Lists the TerraformVersions that match the filter expression. A
7796 /// filter expression filters the resources listed in the response. The
7797 /// expression must be of the form '{field} {operator} {value}' where
7798 /// operators: '<', '>',
7799 /// '<=', '>=', '!=', '=', ':' are supported (colon ':' represents a HAS
7800 /// operator which is roughly synonymous with equality). {field} can refer to a
7801 /// proto or JSON field, or a synthetic field. Field names can be camelCase or
7802 /// snake_case.
7803 pub filter: std::string::String,
7804
7805 /// Optional. Field to use to sort the list.
7806 pub order_by: std::string::String,
7807
7808 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7809}
7810
7811impl ListTerraformVersionsRequest {
7812 pub fn new() -> Self {
7813 std::default::Default::default()
7814 }
7815
7816 /// Sets the value of [parent][crate::model::ListTerraformVersionsRequest::parent].
7817 ///
7818 /// # Example
7819 /// ```ignore,no_run
7820 /// # use google_cloud_config_v1::model::ListTerraformVersionsRequest;
7821 /// let x = ListTerraformVersionsRequest::new().set_parent("example");
7822 /// ```
7823 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7824 self.parent = v.into();
7825 self
7826 }
7827
7828 /// Sets the value of [page_size][crate::model::ListTerraformVersionsRequest::page_size].
7829 ///
7830 /// # Example
7831 /// ```ignore,no_run
7832 /// # use google_cloud_config_v1::model::ListTerraformVersionsRequest;
7833 /// let x = ListTerraformVersionsRequest::new().set_page_size(42);
7834 /// ```
7835 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7836 self.page_size = v.into();
7837 self
7838 }
7839
7840 /// Sets the value of [page_token][crate::model::ListTerraformVersionsRequest::page_token].
7841 ///
7842 /// # Example
7843 /// ```ignore,no_run
7844 /// # use google_cloud_config_v1::model::ListTerraformVersionsRequest;
7845 /// let x = ListTerraformVersionsRequest::new().set_page_token("example");
7846 /// ```
7847 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7848 self.page_token = v.into();
7849 self
7850 }
7851
7852 /// Sets the value of [filter][crate::model::ListTerraformVersionsRequest::filter].
7853 ///
7854 /// # Example
7855 /// ```ignore,no_run
7856 /// # use google_cloud_config_v1::model::ListTerraformVersionsRequest;
7857 /// let x = ListTerraformVersionsRequest::new().set_filter("example");
7858 /// ```
7859 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7860 self.filter = v.into();
7861 self
7862 }
7863
7864 /// Sets the value of [order_by][crate::model::ListTerraformVersionsRequest::order_by].
7865 ///
7866 /// # Example
7867 /// ```ignore,no_run
7868 /// # use google_cloud_config_v1::model::ListTerraformVersionsRequest;
7869 /// let x = ListTerraformVersionsRequest::new().set_order_by("example");
7870 /// ```
7871 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7872 self.order_by = v.into();
7873 self
7874 }
7875}
7876
7877impl wkt::message::Message for ListTerraformVersionsRequest {
7878 fn typename() -> &'static str {
7879 "type.googleapis.com/google.cloud.config.v1.ListTerraformVersionsRequest"
7880 }
7881}
7882
7883/// The response message for the `ListTerraformVersions` method.
7884#[derive(Clone, Default, PartialEq)]
7885#[non_exhaustive]
7886pub struct ListTerraformVersionsResponse {
7887 /// List of [TerraformVersion][google.cloud.config.v1.TerraformVersion]s.
7888 ///
7889 /// [google.cloud.config.v1.TerraformVersion]: crate::model::TerraformVersion
7890 pub terraform_versions: std::vec::Vec<crate::model::TerraformVersion>,
7891
7892 /// Token to be supplied to the next ListTerraformVersions request via
7893 /// `page_token` to obtain the next set of results.
7894 pub next_page_token: std::string::String,
7895
7896 /// Unreachable resources, if any.
7897 pub unreachable: std::vec::Vec<std::string::String>,
7898
7899 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7900}
7901
7902impl ListTerraformVersionsResponse {
7903 pub fn new() -> Self {
7904 std::default::Default::default()
7905 }
7906
7907 /// Sets the value of [terraform_versions][crate::model::ListTerraformVersionsResponse::terraform_versions].
7908 ///
7909 /// # Example
7910 /// ```ignore,no_run
7911 /// # use google_cloud_config_v1::model::ListTerraformVersionsResponse;
7912 /// use google_cloud_config_v1::model::TerraformVersion;
7913 /// let x = ListTerraformVersionsResponse::new()
7914 /// .set_terraform_versions([
7915 /// TerraformVersion::default()/* use setters */,
7916 /// TerraformVersion::default()/* use (different) setters */,
7917 /// ]);
7918 /// ```
7919 pub fn set_terraform_versions<T, V>(mut self, v: T) -> Self
7920 where
7921 T: std::iter::IntoIterator<Item = V>,
7922 V: std::convert::Into<crate::model::TerraformVersion>,
7923 {
7924 use std::iter::Iterator;
7925 self.terraform_versions = v.into_iter().map(|i| i.into()).collect();
7926 self
7927 }
7928
7929 /// Sets the value of [next_page_token][crate::model::ListTerraformVersionsResponse::next_page_token].
7930 ///
7931 /// # Example
7932 /// ```ignore,no_run
7933 /// # use google_cloud_config_v1::model::ListTerraformVersionsResponse;
7934 /// let x = ListTerraformVersionsResponse::new().set_next_page_token("example");
7935 /// ```
7936 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7937 self.next_page_token = v.into();
7938 self
7939 }
7940
7941 /// Sets the value of [unreachable][crate::model::ListTerraformVersionsResponse::unreachable].
7942 ///
7943 /// # Example
7944 /// ```ignore,no_run
7945 /// # use google_cloud_config_v1::model::ListTerraformVersionsResponse;
7946 /// let x = ListTerraformVersionsResponse::new().set_unreachable(["a", "b", "c"]);
7947 /// ```
7948 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
7949 where
7950 T: std::iter::IntoIterator<Item = V>,
7951 V: std::convert::Into<std::string::String>,
7952 {
7953 use std::iter::Iterator;
7954 self.unreachable = v.into_iter().map(|i| i.into()).collect();
7955 self
7956 }
7957}
7958
7959impl wkt::message::Message for ListTerraformVersionsResponse {
7960 fn typename() -> &'static str {
7961 "type.googleapis.com/google.cloud.config.v1.ListTerraformVersionsResponse"
7962 }
7963}
7964
7965#[doc(hidden)]
7966impl google_cloud_gax::paginator::internal::PageableResponse for ListTerraformVersionsResponse {
7967 type PageItem = crate::model::TerraformVersion;
7968
7969 fn items(self) -> std::vec::Vec<Self::PageItem> {
7970 self.terraform_versions
7971 }
7972
7973 fn next_page_token(&self) -> std::string::String {
7974 use std::clone::Clone;
7975 self.next_page_token.clone()
7976 }
7977}
7978
7979/// A TerraformVersion represents the support state the corresponding
7980/// Terraform version.
7981#[derive(Clone, Default, PartialEq)]
7982#[non_exhaustive]
7983pub struct TerraformVersion {
7984 /// Identifier. The version name is in the format:
7985 /// 'projects/{project_id}/locations/{location}/terraformVersions/{terraform_version}'.
7986 pub name: std::string::String,
7987
7988 /// Output only. The state of the version, ACTIVE, DEPRECATED or OBSOLETE.
7989 pub state: crate::model::terraform_version::State,
7990
7991 /// Output only. When the version is supported.
7992 pub support_time: std::option::Option<wkt::Timestamp>,
7993
7994 /// Output only. When the version is deprecated.
7995 pub deprecate_time: std::option::Option<wkt::Timestamp>,
7996
7997 /// Output only. When the version is obsolete.
7998 pub obsolete_time: std::option::Option<wkt::Timestamp>,
7999
8000 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8001}
8002
8003impl TerraformVersion {
8004 pub fn new() -> Self {
8005 std::default::Default::default()
8006 }
8007
8008 /// Sets the value of [name][crate::model::TerraformVersion::name].
8009 ///
8010 /// # Example
8011 /// ```ignore,no_run
8012 /// # use google_cloud_config_v1::model::TerraformVersion;
8013 /// let x = TerraformVersion::new().set_name("example");
8014 /// ```
8015 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8016 self.name = v.into();
8017 self
8018 }
8019
8020 /// Sets the value of [state][crate::model::TerraformVersion::state].
8021 ///
8022 /// # Example
8023 /// ```ignore,no_run
8024 /// # use google_cloud_config_v1::model::TerraformVersion;
8025 /// use google_cloud_config_v1::model::terraform_version::State;
8026 /// let x0 = TerraformVersion::new().set_state(State::Active);
8027 /// let x1 = TerraformVersion::new().set_state(State::Deprecated);
8028 /// let x2 = TerraformVersion::new().set_state(State::Obsolete);
8029 /// ```
8030 pub fn set_state<T: std::convert::Into<crate::model::terraform_version::State>>(
8031 mut self,
8032 v: T,
8033 ) -> Self {
8034 self.state = v.into();
8035 self
8036 }
8037
8038 /// Sets the value of [support_time][crate::model::TerraformVersion::support_time].
8039 ///
8040 /// # Example
8041 /// ```ignore,no_run
8042 /// # use google_cloud_config_v1::model::TerraformVersion;
8043 /// use wkt::Timestamp;
8044 /// let x = TerraformVersion::new().set_support_time(Timestamp::default()/* use setters */);
8045 /// ```
8046 pub fn set_support_time<T>(mut self, v: T) -> Self
8047 where
8048 T: std::convert::Into<wkt::Timestamp>,
8049 {
8050 self.support_time = std::option::Option::Some(v.into());
8051 self
8052 }
8053
8054 /// Sets or clears the value of [support_time][crate::model::TerraformVersion::support_time].
8055 ///
8056 /// # Example
8057 /// ```ignore,no_run
8058 /// # use google_cloud_config_v1::model::TerraformVersion;
8059 /// use wkt::Timestamp;
8060 /// let x = TerraformVersion::new().set_or_clear_support_time(Some(Timestamp::default()/* use setters */));
8061 /// let x = TerraformVersion::new().set_or_clear_support_time(None::<Timestamp>);
8062 /// ```
8063 pub fn set_or_clear_support_time<T>(mut self, v: std::option::Option<T>) -> Self
8064 where
8065 T: std::convert::Into<wkt::Timestamp>,
8066 {
8067 self.support_time = v.map(|x| x.into());
8068 self
8069 }
8070
8071 /// Sets the value of [deprecate_time][crate::model::TerraformVersion::deprecate_time].
8072 ///
8073 /// # Example
8074 /// ```ignore,no_run
8075 /// # use google_cloud_config_v1::model::TerraformVersion;
8076 /// use wkt::Timestamp;
8077 /// let x = TerraformVersion::new().set_deprecate_time(Timestamp::default()/* use setters */);
8078 /// ```
8079 pub fn set_deprecate_time<T>(mut self, v: T) -> Self
8080 where
8081 T: std::convert::Into<wkt::Timestamp>,
8082 {
8083 self.deprecate_time = std::option::Option::Some(v.into());
8084 self
8085 }
8086
8087 /// Sets or clears the value of [deprecate_time][crate::model::TerraformVersion::deprecate_time].
8088 ///
8089 /// # Example
8090 /// ```ignore,no_run
8091 /// # use google_cloud_config_v1::model::TerraformVersion;
8092 /// use wkt::Timestamp;
8093 /// let x = TerraformVersion::new().set_or_clear_deprecate_time(Some(Timestamp::default()/* use setters */));
8094 /// let x = TerraformVersion::new().set_or_clear_deprecate_time(None::<Timestamp>);
8095 /// ```
8096 pub fn set_or_clear_deprecate_time<T>(mut self, v: std::option::Option<T>) -> Self
8097 where
8098 T: std::convert::Into<wkt::Timestamp>,
8099 {
8100 self.deprecate_time = v.map(|x| x.into());
8101 self
8102 }
8103
8104 /// Sets the value of [obsolete_time][crate::model::TerraformVersion::obsolete_time].
8105 ///
8106 /// # Example
8107 /// ```ignore,no_run
8108 /// # use google_cloud_config_v1::model::TerraformVersion;
8109 /// use wkt::Timestamp;
8110 /// let x = TerraformVersion::new().set_obsolete_time(Timestamp::default()/* use setters */);
8111 /// ```
8112 pub fn set_obsolete_time<T>(mut self, v: T) -> Self
8113 where
8114 T: std::convert::Into<wkt::Timestamp>,
8115 {
8116 self.obsolete_time = std::option::Option::Some(v.into());
8117 self
8118 }
8119
8120 /// Sets or clears the value of [obsolete_time][crate::model::TerraformVersion::obsolete_time].
8121 ///
8122 /// # Example
8123 /// ```ignore,no_run
8124 /// # use google_cloud_config_v1::model::TerraformVersion;
8125 /// use wkt::Timestamp;
8126 /// let x = TerraformVersion::new().set_or_clear_obsolete_time(Some(Timestamp::default()/* use setters */));
8127 /// let x = TerraformVersion::new().set_or_clear_obsolete_time(None::<Timestamp>);
8128 /// ```
8129 pub fn set_or_clear_obsolete_time<T>(mut self, v: std::option::Option<T>) -> Self
8130 where
8131 T: std::convert::Into<wkt::Timestamp>,
8132 {
8133 self.obsolete_time = v.map(|x| x.into());
8134 self
8135 }
8136}
8137
8138impl wkt::message::Message for TerraformVersion {
8139 fn typename() -> &'static str {
8140 "type.googleapis.com/google.cloud.config.v1.TerraformVersion"
8141 }
8142}
8143
8144/// Defines additional types related to [TerraformVersion].
8145pub mod terraform_version {
8146 #[allow(unused_imports)]
8147 use super::*;
8148
8149 /// Possible states of a TerraformVersion.
8150 ///
8151 /// # Working with unknown values
8152 ///
8153 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8154 /// additional enum variants at any time. Adding new variants is not considered
8155 /// a breaking change. Applications should write their code in anticipation of:
8156 ///
8157 /// - New values appearing in future releases of the client library, **and**
8158 /// - New values received dynamically, without application changes.
8159 ///
8160 /// Please consult the [Working with enums] section in the user guide for some
8161 /// guidelines.
8162 ///
8163 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
8164 #[derive(Clone, Debug, PartialEq)]
8165 #[non_exhaustive]
8166 pub enum State {
8167 /// The default value. This value is used if the state is omitted.
8168 Unspecified,
8169 /// The version is actively supported.
8170 Active,
8171 /// The version is deprecated.
8172 Deprecated,
8173 /// The version is obsolete.
8174 Obsolete,
8175 /// If set, the enum was initialized with an unknown value.
8176 ///
8177 /// Applications can examine the value using [State::value] or
8178 /// [State::name].
8179 UnknownValue(state::UnknownValue),
8180 }
8181
8182 #[doc(hidden)]
8183 pub mod state {
8184 #[allow(unused_imports)]
8185 use super::*;
8186 #[derive(Clone, Debug, PartialEq)]
8187 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8188 }
8189
8190 impl State {
8191 /// Gets the enum value.
8192 ///
8193 /// Returns `None` if the enum contains an unknown value deserialized from
8194 /// the string representation of enums.
8195 pub fn value(&self) -> std::option::Option<i32> {
8196 match self {
8197 Self::Unspecified => std::option::Option::Some(0),
8198 Self::Active => std::option::Option::Some(1),
8199 Self::Deprecated => std::option::Option::Some(2),
8200 Self::Obsolete => std::option::Option::Some(3),
8201 Self::UnknownValue(u) => u.0.value(),
8202 }
8203 }
8204
8205 /// Gets the enum value as a string.
8206 ///
8207 /// Returns `None` if the enum contains an unknown value deserialized from
8208 /// the integer representation of enums.
8209 pub fn name(&self) -> std::option::Option<&str> {
8210 match self {
8211 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
8212 Self::Active => std::option::Option::Some("ACTIVE"),
8213 Self::Deprecated => std::option::Option::Some("DEPRECATED"),
8214 Self::Obsolete => std::option::Option::Some("OBSOLETE"),
8215 Self::UnknownValue(u) => u.0.name(),
8216 }
8217 }
8218 }
8219
8220 impl std::default::Default for State {
8221 fn default() -> Self {
8222 use std::convert::From;
8223 Self::from(0)
8224 }
8225 }
8226
8227 impl std::fmt::Display for State {
8228 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8229 wkt::internal::display_enum(f, self.name(), self.value())
8230 }
8231 }
8232
8233 impl std::convert::From<i32> for State {
8234 fn from(value: i32) -> Self {
8235 match value {
8236 0 => Self::Unspecified,
8237 1 => Self::Active,
8238 2 => Self::Deprecated,
8239 3 => Self::Obsolete,
8240 _ => Self::UnknownValue(state::UnknownValue(
8241 wkt::internal::UnknownEnumValue::Integer(value),
8242 )),
8243 }
8244 }
8245 }
8246
8247 impl std::convert::From<&str> for State {
8248 fn from(value: &str) -> Self {
8249 use std::string::ToString;
8250 match value {
8251 "STATE_UNSPECIFIED" => Self::Unspecified,
8252 "ACTIVE" => Self::Active,
8253 "DEPRECATED" => Self::Deprecated,
8254 "OBSOLETE" => Self::Obsolete,
8255 _ => Self::UnknownValue(state::UnknownValue(
8256 wkt::internal::UnknownEnumValue::String(value.to_string()),
8257 )),
8258 }
8259 }
8260 }
8261
8262 impl serde::ser::Serialize for State {
8263 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8264 where
8265 S: serde::Serializer,
8266 {
8267 match self {
8268 Self::Unspecified => serializer.serialize_i32(0),
8269 Self::Active => serializer.serialize_i32(1),
8270 Self::Deprecated => serializer.serialize_i32(2),
8271 Self::Obsolete => serializer.serialize_i32(3),
8272 Self::UnknownValue(u) => u.0.serialize(serializer),
8273 }
8274 }
8275 }
8276
8277 impl<'de> serde::de::Deserialize<'de> for State {
8278 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8279 where
8280 D: serde::Deserializer<'de>,
8281 {
8282 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
8283 ".google.cloud.config.v1.TerraformVersion.State",
8284 ))
8285 }
8286 }
8287}
8288
8289/// Terraform info of a ResourceChange.
8290#[derive(Clone, Default, PartialEq)]
8291#[non_exhaustive]
8292pub struct ResourceChangeTerraformInfo {
8293 /// Output only. TF resource address that uniquely identifies the resource.
8294 pub address: std::string::String,
8295
8296 /// Output only. TF resource type.
8297 pub r#type: std::string::String,
8298
8299 /// Output only. TF resource name.
8300 pub resource_name: std::string::String,
8301
8302 /// Output only. TF resource provider.
8303 pub provider: std::string::String,
8304
8305 /// Output only. TF resource actions.
8306 pub actions: std::vec::Vec<std::string::String>,
8307
8308 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8309}
8310
8311impl ResourceChangeTerraformInfo {
8312 pub fn new() -> Self {
8313 std::default::Default::default()
8314 }
8315
8316 /// Sets the value of [address][crate::model::ResourceChangeTerraformInfo::address].
8317 ///
8318 /// # Example
8319 /// ```ignore,no_run
8320 /// # use google_cloud_config_v1::model::ResourceChangeTerraformInfo;
8321 /// let x = ResourceChangeTerraformInfo::new().set_address("example");
8322 /// ```
8323 pub fn set_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8324 self.address = v.into();
8325 self
8326 }
8327
8328 /// Sets the value of [r#type][crate::model::ResourceChangeTerraformInfo::type].
8329 ///
8330 /// # Example
8331 /// ```ignore,no_run
8332 /// # use google_cloud_config_v1::model::ResourceChangeTerraformInfo;
8333 /// let x = ResourceChangeTerraformInfo::new().set_type("example");
8334 /// ```
8335 pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8336 self.r#type = v.into();
8337 self
8338 }
8339
8340 /// Sets the value of [resource_name][crate::model::ResourceChangeTerraformInfo::resource_name].
8341 ///
8342 /// # Example
8343 /// ```ignore,no_run
8344 /// # use google_cloud_config_v1::model::ResourceChangeTerraformInfo;
8345 /// let x = ResourceChangeTerraformInfo::new().set_resource_name("example");
8346 /// ```
8347 pub fn set_resource_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8348 self.resource_name = v.into();
8349 self
8350 }
8351
8352 /// Sets the value of [provider][crate::model::ResourceChangeTerraformInfo::provider].
8353 ///
8354 /// # Example
8355 /// ```ignore,no_run
8356 /// # use google_cloud_config_v1::model::ResourceChangeTerraformInfo;
8357 /// let x = ResourceChangeTerraformInfo::new().set_provider("example");
8358 /// ```
8359 pub fn set_provider<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8360 self.provider = v.into();
8361 self
8362 }
8363
8364 /// Sets the value of [actions][crate::model::ResourceChangeTerraformInfo::actions].
8365 ///
8366 /// # Example
8367 /// ```ignore,no_run
8368 /// # use google_cloud_config_v1::model::ResourceChangeTerraformInfo;
8369 /// let x = ResourceChangeTerraformInfo::new().set_actions(["a", "b", "c"]);
8370 /// ```
8371 pub fn set_actions<T, V>(mut self, v: T) -> Self
8372 where
8373 T: std::iter::IntoIterator<Item = V>,
8374 V: std::convert::Into<std::string::String>,
8375 {
8376 use std::iter::Iterator;
8377 self.actions = v.into_iter().map(|i| i.into()).collect();
8378 self
8379 }
8380}
8381
8382impl wkt::message::Message for ResourceChangeTerraformInfo {
8383 fn typename() -> &'static str {
8384 "type.googleapis.com/google.cloud.config.v1.ResourceChangeTerraformInfo"
8385 }
8386}
8387
8388/// A resource change represents a change to a resource in the state file.
8389#[derive(Clone, Default, PartialEq)]
8390#[non_exhaustive]
8391pub struct ResourceChange {
8392 /// Identifier. The name of the resource change.
8393 /// Format:
8394 /// 'projects/{project_id}/locations/{location}/previews/{preview}/resourceChanges/{resource_change}'.
8395 pub name: std::string::String,
8396
8397 /// Output only. Terraform info of the resource change.
8398 pub terraform_info: std::option::Option<crate::model::ResourceChangeTerraformInfo>,
8399
8400 /// Output only. The intent of the resource change.
8401 pub intent: crate::model::resource_change::Intent,
8402
8403 /// Output only. The property changes of the resource change.
8404 pub property_changes: std::vec::Vec<crate::model::PropertyChange>,
8405
8406 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8407}
8408
8409impl ResourceChange {
8410 pub fn new() -> Self {
8411 std::default::Default::default()
8412 }
8413
8414 /// Sets the value of [name][crate::model::ResourceChange::name].
8415 ///
8416 /// # Example
8417 /// ```ignore,no_run
8418 /// # use google_cloud_config_v1::model::ResourceChange;
8419 /// let x = ResourceChange::new().set_name("example");
8420 /// ```
8421 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8422 self.name = v.into();
8423 self
8424 }
8425
8426 /// Sets the value of [terraform_info][crate::model::ResourceChange::terraform_info].
8427 ///
8428 /// # Example
8429 /// ```ignore,no_run
8430 /// # use google_cloud_config_v1::model::ResourceChange;
8431 /// use google_cloud_config_v1::model::ResourceChangeTerraformInfo;
8432 /// let x = ResourceChange::new().set_terraform_info(ResourceChangeTerraformInfo::default()/* use setters */);
8433 /// ```
8434 pub fn set_terraform_info<T>(mut self, v: T) -> Self
8435 where
8436 T: std::convert::Into<crate::model::ResourceChangeTerraformInfo>,
8437 {
8438 self.terraform_info = std::option::Option::Some(v.into());
8439 self
8440 }
8441
8442 /// Sets or clears the value of [terraform_info][crate::model::ResourceChange::terraform_info].
8443 ///
8444 /// # Example
8445 /// ```ignore,no_run
8446 /// # use google_cloud_config_v1::model::ResourceChange;
8447 /// use google_cloud_config_v1::model::ResourceChangeTerraformInfo;
8448 /// let x = ResourceChange::new().set_or_clear_terraform_info(Some(ResourceChangeTerraformInfo::default()/* use setters */));
8449 /// let x = ResourceChange::new().set_or_clear_terraform_info(None::<ResourceChangeTerraformInfo>);
8450 /// ```
8451 pub fn set_or_clear_terraform_info<T>(mut self, v: std::option::Option<T>) -> Self
8452 where
8453 T: std::convert::Into<crate::model::ResourceChangeTerraformInfo>,
8454 {
8455 self.terraform_info = v.map(|x| x.into());
8456 self
8457 }
8458
8459 /// Sets the value of [intent][crate::model::ResourceChange::intent].
8460 ///
8461 /// # Example
8462 /// ```ignore,no_run
8463 /// # use google_cloud_config_v1::model::ResourceChange;
8464 /// use google_cloud_config_v1::model::resource_change::Intent;
8465 /// let x0 = ResourceChange::new().set_intent(Intent::Create);
8466 /// let x1 = ResourceChange::new().set_intent(Intent::Update);
8467 /// let x2 = ResourceChange::new().set_intent(Intent::Delete);
8468 /// ```
8469 pub fn set_intent<T: std::convert::Into<crate::model::resource_change::Intent>>(
8470 mut self,
8471 v: T,
8472 ) -> Self {
8473 self.intent = v.into();
8474 self
8475 }
8476
8477 /// Sets the value of [property_changes][crate::model::ResourceChange::property_changes].
8478 ///
8479 /// # Example
8480 /// ```ignore,no_run
8481 /// # use google_cloud_config_v1::model::ResourceChange;
8482 /// use google_cloud_config_v1::model::PropertyChange;
8483 /// let x = ResourceChange::new()
8484 /// .set_property_changes([
8485 /// PropertyChange::default()/* use setters */,
8486 /// PropertyChange::default()/* use (different) setters */,
8487 /// ]);
8488 /// ```
8489 pub fn set_property_changes<T, V>(mut self, v: T) -> Self
8490 where
8491 T: std::iter::IntoIterator<Item = V>,
8492 V: std::convert::Into<crate::model::PropertyChange>,
8493 {
8494 use std::iter::Iterator;
8495 self.property_changes = v.into_iter().map(|i| i.into()).collect();
8496 self
8497 }
8498}
8499
8500impl wkt::message::Message for ResourceChange {
8501 fn typename() -> &'static str {
8502 "type.googleapis.com/google.cloud.config.v1.ResourceChange"
8503 }
8504}
8505
8506/// Defines additional types related to [ResourceChange].
8507pub mod resource_change {
8508 #[allow(unused_imports)]
8509 use super::*;
8510
8511 /// Possible intent of the resource change.
8512 ///
8513 /// # Working with unknown values
8514 ///
8515 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8516 /// additional enum variants at any time. Adding new variants is not considered
8517 /// a breaking change. Applications should write their code in anticipation of:
8518 ///
8519 /// - New values appearing in future releases of the client library, **and**
8520 /// - New values received dynamically, without application changes.
8521 ///
8522 /// Please consult the [Working with enums] section in the user guide for some
8523 /// guidelines.
8524 ///
8525 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
8526 #[derive(Clone, Debug, PartialEq)]
8527 #[non_exhaustive]
8528 pub enum Intent {
8529 /// The default value.
8530 Unspecified,
8531 /// The resource will be created.
8532 Create,
8533 /// The resource will be updated.
8534 Update,
8535 /// The resource will be deleted.
8536 Delete,
8537 /// The resource will be recreated.
8538 Recreate,
8539 /// The resource will be untouched.
8540 Unchanged,
8541 /// If set, the enum was initialized with an unknown value.
8542 ///
8543 /// Applications can examine the value using [Intent::value] or
8544 /// [Intent::name].
8545 UnknownValue(intent::UnknownValue),
8546 }
8547
8548 #[doc(hidden)]
8549 pub mod intent {
8550 #[allow(unused_imports)]
8551 use super::*;
8552 #[derive(Clone, Debug, PartialEq)]
8553 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8554 }
8555
8556 impl Intent {
8557 /// Gets the enum value.
8558 ///
8559 /// Returns `None` if the enum contains an unknown value deserialized from
8560 /// the string representation of enums.
8561 pub fn value(&self) -> std::option::Option<i32> {
8562 match self {
8563 Self::Unspecified => std::option::Option::Some(0),
8564 Self::Create => std::option::Option::Some(1),
8565 Self::Update => std::option::Option::Some(2),
8566 Self::Delete => std::option::Option::Some(3),
8567 Self::Recreate => std::option::Option::Some(4),
8568 Self::Unchanged => std::option::Option::Some(5),
8569 Self::UnknownValue(u) => u.0.value(),
8570 }
8571 }
8572
8573 /// Gets the enum value as a string.
8574 ///
8575 /// Returns `None` if the enum contains an unknown value deserialized from
8576 /// the integer representation of enums.
8577 pub fn name(&self) -> std::option::Option<&str> {
8578 match self {
8579 Self::Unspecified => std::option::Option::Some("INTENT_UNSPECIFIED"),
8580 Self::Create => std::option::Option::Some("CREATE"),
8581 Self::Update => std::option::Option::Some("UPDATE"),
8582 Self::Delete => std::option::Option::Some("DELETE"),
8583 Self::Recreate => std::option::Option::Some("RECREATE"),
8584 Self::Unchanged => std::option::Option::Some("UNCHANGED"),
8585 Self::UnknownValue(u) => u.0.name(),
8586 }
8587 }
8588 }
8589
8590 impl std::default::Default for Intent {
8591 fn default() -> Self {
8592 use std::convert::From;
8593 Self::from(0)
8594 }
8595 }
8596
8597 impl std::fmt::Display for Intent {
8598 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8599 wkt::internal::display_enum(f, self.name(), self.value())
8600 }
8601 }
8602
8603 impl std::convert::From<i32> for Intent {
8604 fn from(value: i32) -> Self {
8605 match value {
8606 0 => Self::Unspecified,
8607 1 => Self::Create,
8608 2 => Self::Update,
8609 3 => Self::Delete,
8610 4 => Self::Recreate,
8611 5 => Self::Unchanged,
8612 _ => Self::UnknownValue(intent::UnknownValue(
8613 wkt::internal::UnknownEnumValue::Integer(value),
8614 )),
8615 }
8616 }
8617 }
8618
8619 impl std::convert::From<&str> for Intent {
8620 fn from(value: &str) -> Self {
8621 use std::string::ToString;
8622 match value {
8623 "INTENT_UNSPECIFIED" => Self::Unspecified,
8624 "CREATE" => Self::Create,
8625 "UPDATE" => Self::Update,
8626 "DELETE" => Self::Delete,
8627 "RECREATE" => Self::Recreate,
8628 "UNCHANGED" => Self::Unchanged,
8629 _ => Self::UnknownValue(intent::UnknownValue(
8630 wkt::internal::UnknownEnumValue::String(value.to_string()),
8631 )),
8632 }
8633 }
8634 }
8635
8636 impl serde::ser::Serialize for Intent {
8637 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8638 where
8639 S: serde::Serializer,
8640 {
8641 match self {
8642 Self::Unspecified => serializer.serialize_i32(0),
8643 Self::Create => serializer.serialize_i32(1),
8644 Self::Update => serializer.serialize_i32(2),
8645 Self::Delete => serializer.serialize_i32(3),
8646 Self::Recreate => serializer.serialize_i32(4),
8647 Self::Unchanged => serializer.serialize_i32(5),
8648 Self::UnknownValue(u) => u.0.serialize(serializer),
8649 }
8650 }
8651 }
8652
8653 impl<'de> serde::de::Deserialize<'de> for Intent {
8654 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8655 where
8656 D: serde::Deserializer<'de>,
8657 {
8658 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Intent>::new(
8659 ".google.cloud.config.v1.ResourceChange.Intent",
8660 ))
8661 }
8662 }
8663}
8664
8665/// A property change represents a change to a property in the state file.
8666#[derive(Clone, Default, PartialEq)]
8667#[non_exhaustive]
8668pub struct PropertyChange {
8669 /// Output only. The path of the property change.
8670 pub path: std::string::String,
8671
8672 /// Output only. The paths of sensitive fields in `before`. Paths are relative
8673 /// to `path`.
8674 pub before_sensitive_paths: std::vec::Vec<std::string::String>,
8675
8676 /// Output only. Representations of the object value before the actions.
8677 pub before: std::option::Option<wkt::Value>,
8678
8679 /// Output only. The paths of sensitive fields in `after`. Paths are relative
8680 /// to `path`.
8681 pub after_sensitive_paths: std::vec::Vec<std::string::String>,
8682
8683 /// Output only. Representations of the object value after the actions.
8684 pub after: std::option::Option<wkt::Value>,
8685
8686 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8687}
8688
8689impl PropertyChange {
8690 pub fn new() -> Self {
8691 std::default::Default::default()
8692 }
8693
8694 /// Sets the value of [path][crate::model::PropertyChange::path].
8695 ///
8696 /// # Example
8697 /// ```ignore,no_run
8698 /// # use google_cloud_config_v1::model::PropertyChange;
8699 /// let x = PropertyChange::new().set_path("example");
8700 /// ```
8701 pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8702 self.path = v.into();
8703 self
8704 }
8705
8706 /// Sets the value of [before_sensitive_paths][crate::model::PropertyChange::before_sensitive_paths].
8707 ///
8708 /// # Example
8709 /// ```ignore,no_run
8710 /// # use google_cloud_config_v1::model::PropertyChange;
8711 /// let x = PropertyChange::new().set_before_sensitive_paths(["a", "b", "c"]);
8712 /// ```
8713 pub fn set_before_sensitive_paths<T, V>(mut self, v: T) -> Self
8714 where
8715 T: std::iter::IntoIterator<Item = V>,
8716 V: std::convert::Into<std::string::String>,
8717 {
8718 use std::iter::Iterator;
8719 self.before_sensitive_paths = v.into_iter().map(|i| i.into()).collect();
8720 self
8721 }
8722
8723 /// Sets the value of [before][crate::model::PropertyChange::before].
8724 ///
8725 /// # Example
8726 /// ```ignore,no_run
8727 /// # use google_cloud_config_v1::model::PropertyChange;
8728 /// use wkt::Value;
8729 /// let x = PropertyChange::new().set_before(Value::default()/* use setters */);
8730 /// ```
8731 pub fn set_before<T>(mut self, v: T) -> Self
8732 where
8733 T: std::convert::Into<wkt::Value>,
8734 {
8735 self.before = std::option::Option::Some(v.into());
8736 self
8737 }
8738
8739 /// Sets or clears the value of [before][crate::model::PropertyChange::before].
8740 ///
8741 /// # Example
8742 /// ```ignore,no_run
8743 /// # use google_cloud_config_v1::model::PropertyChange;
8744 /// use wkt::Value;
8745 /// let x = PropertyChange::new().set_or_clear_before(Some(Value::default()/* use setters */));
8746 /// let x = PropertyChange::new().set_or_clear_before(None::<Value>);
8747 /// ```
8748 pub fn set_or_clear_before<T>(mut self, v: std::option::Option<T>) -> Self
8749 where
8750 T: std::convert::Into<wkt::Value>,
8751 {
8752 self.before = v.map(|x| x.into());
8753 self
8754 }
8755
8756 /// Sets the value of [after_sensitive_paths][crate::model::PropertyChange::after_sensitive_paths].
8757 ///
8758 /// # Example
8759 /// ```ignore,no_run
8760 /// # use google_cloud_config_v1::model::PropertyChange;
8761 /// let x = PropertyChange::new().set_after_sensitive_paths(["a", "b", "c"]);
8762 /// ```
8763 pub fn set_after_sensitive_paths<T, V>(mut self, v: T) -> Self
8764 where
8765 T: std::iter::IntoIterator<Item = V>,
8766 V: std::convert::Into<std::string::String>,
8767 {
8768 use std::iter::Iterator;
8769 self.after_sensitive_paths = v.into_iter().map(|i| i.into()).collect();
8770 self
8771 }
8772
8773 /// Sets the value of [after][crate::model::PropertyChange::after].
8774 ///
8775 /// # Example
8776 /// ```ignore,no_run
8777 /// # use google_cloud_config_v1::model::PropertyChange;
8778 /// use wkt::Value;
8779 /// let x = PropertyChange::new().set_after(Value::default()/* use setters */);
8780 /// ```
8781 pub fn set_after<T>(mut self, v: T) -> Self
8782 where
8783 T: std::convert::Into<wkt::Value>,
8784 {
8785 self.after = std::option::Option::Some(v.into());
8786 self
8787 }
8788
8789 /// Sets or clears the value of [after][crate::model::PropertyChange::after].
8790 ///
8791 /// # Example
8792 /// ```ignore,no_run
8793 /// # use google_cloud_config_v1::model::PropertyChange;
8794 /// use wkt::Value;
8795 /// let x = PropertyChange::new().set_or_clear_after(Some(Value::default()/* use setters */));
8796 /// let x = PropertyChange::new().set_or_clear_after(None::<Value>);
8797 /// ```
8798 pub fn set_or_clear_after<T>(mut self, v: std::option::Option<T>) -> Self
8799 where
8800 T: std::convert::Into<wkt::Value>,
8801 {
8802 self.after = v.map(|x| x.into());
8803 self
8804 }
8805}
8806
8807impl wkt::message::Message for PropertyChange {
8808 fn typename() -> &'static str {
8809 "type.googleapis.com/google.cloud.config.v1.PropertyChange"
8810 }
8811}
8812
8813/// The request message for the ListResourceChanges method.
8814#[derive(Clone, Default, PartialEq)]
8815#[non_exhaustive]
8816pub struct ListResourceChangesRequest {
8817 /// Required. The parent in whose context the ResourceChanges are listed. The
8818 /// parent value is in the format:
8819 /// 'projects/{project_id}/locations/{location}/previews/{preview}'.
8820 pub parent: std::string::String,
8821
8822 /// Optional. When requesting a page of resource changes, 'page_size' specifies
8823 /// number of resource changes to return. If unspecified, at most 500 will be
8824 /// returned. The maximum value is 1000.
8825 pub page_size: i32,
8826
8827 /// Optional. Token returned by previous call to 'ListResourceChanges' which
8828 /// specifies the position in the list from where to continue listing the
8829 /// resource changes.
8830 pub page_token: std::string::String,
8831
8832 /// Optional. Lists the resource changes that match the filter expression. A
8833 /// filter expression filters the resource changes listed in the response. The
8834 /// expression must be of the form '{field} {operator} {value}' where
8835 /// operators: '<', '>',
8836 /// '<=',
8837 /// '>=',
8838 /// '!=', '=', ':' are supported (colon ':' represents a HAS operator which is
8839 /// roughly synonymous with equality). {field} can refer to a proto or JSON
8840 /// field, or a synthetic field. Field names can be camelCase or snake_case.
8841 ///
8842 /// Examples:
8843 ///
8844 /// - Filter by name:
8845 /// name =
8846 /// "projects/foo/locations/us-central1/previews/dep/resourceChanges/baz
8847 pub filter: std::string::String,
8848
8849 /// Optional. Field to use to sort the list.
8850 pub order_by: std::string::String,
8851
8852 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8853}
8854
8855impl ListResourceChangesRequest {
8856 pub fn new() -> Self {
8857 std::default::Default::default()
8858 }
8859
8860 /// Sets the value of [parent][crate::model::ListResourceChangesRequest::parent].
8861 ///
8862 /// # Example
8863 /// ```ignore,no_run
8864 /// # use google_cloud_config_v1::model::ListResourceChangesRequest;
8865 /// let x = ListResourceChangesRequest::new().set_parent("example");
8866 /// ```
8867 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8868 self.parent = v.into();
8869 self
8870 }
8871
8872 /// Sets the value of [page_size][crate::model::ListResourceChangesRequest::page_size].
8873 ///
8874 /// # Example
8875 /// ```ignore,no_run
8876 /// # use google_cloud_config_v1::model::ListResourceChangesRequest;
8877 /// let x = ListResourceChangesRequest::new().set_page_size(42);
8878 /// ```
8879 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8880 self.page_size = v.into();
8881 self
8882 }
8883
8884 /// Sets the value of [page_token][crate::model::ListResourceChangesRequest::page_token].
8885 ///
8886 /// # Example
8887 /// ```ignore,no_run
8888 /// # use google_cloud_config_v1::model::ListResourceChangesRequest;
8889 /// let x = ListResourceChangesRequest::new().set_page_token("example");
8890 /// ```
8891 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8892 self.page_token = v.into();
8893 self
8894 }
8895
8896 /// Sets the value of [filter][crate::model::ListResourceChangesRequest::filter].
8897 ///
8898 /// # Example
8899 /// ```ignore,no_run
8900 /// # use google_cloud_config_v1::model::ListResourceChangesRequest;
8901 /// let x = ListResourceChangesRequest::new().set_filter("example");
8902 /// ```
8903 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8904 self.filter = v.into();
8905 self
8906 }
8907
8908 /// Sets the value of [order_by][crate::model::ListResourceChangesRequest::order_by].
8909 ///
8910 /// # Example
8911 /// ```ignore,no_run
8912 /// # use google_cloud_config_v1::model::ListResourceChangesRequest;
8913 /// let x = ListResourceChangesRequest::new().set_order_by("example");
8914 /// ```
8915 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8916 self.order_by = v.into();
8917 self
8918 }
8919}
8920
8921impl wkt::message::Message for ListResourceChangesRequest {
8922 fn typename() -> &'static str {
8923 "type.googleapis.com/google.cloud.config.v1.ListResourceChangesRequest"
8924 }
8925}
8926
8927/// A response to a 'ListResourceChanges' call. Contains a list of
8928/// ResourceChanges.
8929#[derive(Clone, Default, PartialEq)]
8930#[non_exhaustive]
8931pub struct ListResourceChangesResponse {
8932 /// List of ResourceChanges.
8933 pub resource_changes: std::vec::Vec<crate::model::ResourceChange>,
8934
8935 /// A token to request the next page of resources from the
8936 /// 'ListResourceChanges' method. The value of an empty string means that
8937 /// there are no more resources to return.
8938 pub next_page_token: std::string::String,
8939
8940 /// Unreachable resources, if any.
8941 pub unreachable: std::vec::Vec<std::string::String>,
8942
8943 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8944}
8945
8946impl ListResourceChangesResponse {
8947 pub fn new() -> Self {
8948 std::default::Default::default()
8949 }
8950
8951 /// Sets the value of [resource_changes][crate::model::ListResourceChangesResponse::resource_changes].
8952 ///
8953 /// # Example
8954 /// ```ignore,no_run
8955 /// # use google_cloud_config_v1::model::ListResourceChangesResponse;
8956 /// use google_cloud_config_v1::model::ResourceChange;
8957 /// let x = ListResourceChangesResponse::new()
8958 /// .set_resource_changes([
8959 /// ResourceChange::default()/* use setters */,
8960 /// ResourceChange::default()/* use (different) setters */,
8961 /// ]);
8962 /// ```
8963 pub fn set_resource_changes<T, V>(mut self, v: T) -> Self
8964 where
8965 T: std::iter::IntoIterator<Item = V>,
8966 V: std::convert::Into<crate::model::ResourceChange>,
8967 {
8968 use std::iter::Iterator;
8969 self.resource_changes = v.into_iter().map(|i| i.into()).collect();
8970 self
8971 }
8972
8973 /// Sets the value of [next_page_token][crate::model::ListResourceChangesResponse::next_page_token].
8974 ///
8975 /// # Example
8976 /// ```ignore,no_run
8977 /// # use google_cloud_config_v1::model::ListResourceChangesResponse;
8978 /// let x = ListResourceChangesResponse::new().set_next_page_token("example");
8979 /// ```
8980 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8981 self.next_page_token = v.into();
8982 self
8983 }
8984
8985 /// Sets the value of [unreachable][crate::model::ListResourceChangesResponse::unreachable].
8986 ///
8987 /// # Example
8988 /// ```ignore,no_run
8989 /// # use google_cloud_config_v1::model::ListResourceChangesResponse;
8990 /// let x = ListResourceChangesResponse::new().set_unreachable(["a", "b", "c"]);
8991 /// ```
8992 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
8993 where
8994 T: std::iter::IntoIterator<Item = V>,
8995 V: std::convert::Into<std::string::String>,
8996 {
8997 use std::iter::Iterator;
8998 self.unreachable = v.into_iter().map(|i| i.into()).collect();
8999 self
9000 }
9001}
9002
9003impl wkt::message::Message for ListResourceChangesResponse {
9004 fn typename() -> &'static str {
9005 "type.googleapis.com/google.cloud.config.v1.ListResourceChangesResponse"
9006 }
9007}
9008
9009#[doc(hidden)]
9010impl google_cloud_gax::paginator::internal::PageableResponse for ListResourceChangesResponse {
9011 type PageItem = crate::model::ResourceChange;
9012
9013 fn items(self) -> std::vec::Vec<Self::PageItem> {
9014 self.resource_changes
9015 }
9016
9017 fn next_page_token(&self) -> std::string::String {
9018 use std::clone::Clone;
9019 self.next_page_token.clone()
9020 }
9021}
9022
9023/// The request message for the GetResourceChange method.
9024#[derive(Clone, Default, PartialEq)]
9025#[non_exhaustive]
9026pub struct GetResourceChangeRequest {
9027 /// Required. The name of the resource change to retrieve.
9028 /// Format:
9029 /// 'projects/{project_id}/locations/{location}/previews/{preview}/resourceChanges/{resource_change}'.
9030 pub name: std::string::String,
9031
9032 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9033}
9034
9035impl GetResourceChangeRequest {
9036 pub fn new() -> Self {
9037 std::default::Default::default()
9038 }
9039
9040 /// Sets the value of [name][crate::model::GetResourceChangeRequest::name].
9041 ///
9042 /// # Example
9043 /// ```ignore,no_run
9044 /// # use google_cloud_config_v1::model::GetResourceChangeRequest;
9045 /// let x = GetResourceChangeRequest::new().set_name("example");
9046 /// ```
9047 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9048 self.name = v.into();
9049 self
9050 }
9051}
9052
9053impl wkt::message::Message for GetResourceChangeRequest {
9054 fn typename() -> &'static str {
9055 "type.googleapis.com/google.cloud.config.v1.GetResourceChangeRequest"
9056 }
9057}
9058
9059/// Terraform info of a ResourceChange.
9060#[derive(Clone, Default, PartialEq)]
9061#[non_exhaustive]
9062pub struct ResourceDriftTerraformInfo {
9063 /// Output only. The address of the drifted resource.
9064 pub address: std::string::String,
9065
9066 /// Output only. The type of the drifted resource.
9067 pub r#type: std::string::String,
9068
9069 /// Output only. TF resource name.
9070 pub resource_name: std::string::String,
9071
9072 /// Output only. The provider of the drifted resource.
9073 pub provider: std::string::String,
9074
9075 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9076}
9077
9078impl ResourceDriftTerraformInfo {
9079 pub fn new() -> Self {
9080 std::default::Default::default()
9081 }
9082
9083 /// Sets the value of [address][crate::model::ResourceDriftTerraformInfo::address].
9084 ///
9085 /// # Example
9086 /// ```ignore,no_run
9087 /// # use google_cloud_config_v1::model::ResourceDriftTerraformInfo;
9088 /// let x = ResourceDriftTerraformInfo::new().set_address("example");
9089 /// ```
9090 pub fn set_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9091 self.address = v.into();
9092 self
9093 }
9094
9095 /// Sets the value of [r#type][crate::model::ResourceDriftTerraformInfo::type].
9096 ///
9097 /// # Example
9098 /// ```ignore,no_run
9099 /// # use google_cloud_config_v1::model::ResourceDriftTerraformInfo;
9100 /// let x = ResourceDriftTerraformInfo::new().set_type("example");
9101 /// ```
9102 pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9103 self.r#type = v.into();
9104 self
9105 }
9106
9107 /// Sets the value of [resource_name][crate::model::ResourceDriftTerraformInfo::resource_name].
9108 ///
9109 /// # Example
9110 /// ```ignore,no_run
9111 /// # use google_cloud_config_v1::model::ResourceDriftTerraformInfo;
9112 /// let x = ResourceDriftTerraformInfo::new().set_resource_name("example");
9113 /// ```
9114 pub fn set_resource_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9115 self.resource_name = v.into();
9116 self
9117 }
9118
9119 /// Sets the value of [provider][crate::model::ResourceDriftTerraformInfo::provider].
9120 ///
9121 /// # Example
9122 /// ```ignore,no_run
9123 /// # use google_cloud_config_v1::model::ResourceDriftTerraformInfo;
9124 /// let x = ResourceDriftTerraformInfo::new().set_provider("example");
9125 /// ```
9126 pub fn set_provider<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9127 self.provider = v.into();
9128 self
9129 }
9130}
9131
9132impl wkt::message::Message for ResourceDriftTerraformInfo {
9133 fn typename() -> &'static str {
9134 "type.googleapis.com/google.cloud.config.v1.ResourceDriftTerraformInfo"
9135 }
9136}
9137
9138/// A resource drift represents a drift to a resource in the state file.
9139#[derive(Clone, Default, PartialEq)]
9140#[non_exhaustive]
9141pub struct ResourceDrift {
9142 /// Identifier. The name of the resource drift.
9143 /// Format:
9144 /// 'projects/{project_id}/locations/{location}/previews/{preview}/resourceDrifts/{resource_drift}'.
9145 pub name: std::string::String,
9146
9147 /// Output only. Terraform info of the resource drift.
9148 pub terraform_info: std::option::Option<crate::model::ResourceDriftTerraformInfo>,
9149
9150 /// Output only. The property drifts of the resource drift.
9151 pub property_drifts: std::vec::Vec<crate::model::PropertyDrift>,
9152
9153 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9154}
9155
9156impl ResourceDrift {
9157 pub fn new() -> Self {
9158 std::default::Default::default()
9159 }
9160
9161 /// Sets the value of [name][crate::model::ResourceDrift::name].
9162 ///
9163 /// # Example
9164 /// ```ignore,no_run
9165 /// # use google_cloud_config_v1::model::ResourceDrift;
9166 /// let x = ResourceDrift::new().set_name("example");
9167 /// ```
9168 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9169 self.name = v.into();
9170 self
9171 }
9172
9173 /// Sets the value of [terraform_info][crate::model::ResourceDrift::terraform_info].
9174 ///
9175 /// # Example
9176 /// ```ignore,no_run
9177 /// # use google_cloud_config_v1::model::ResourceDrift;
9178 /// use google_cloud_config_v1::model::ResourceDriftTerraformInfo;
9179 /// let x = ResourceDrift::new().set_terraform_info(ResourceDriftTerraformInfo::default()/* use setters */);
9180 /// ```
9181 pub fn set_terraform_info<T>(mut self, v: T) -> Self
9182 where
9183 T: std::convert::Into<crate::model::ResourceDriftTerraformInfo>,
9184 {
9185 self.terraform_info = std::option::Option::Some(v.into());
9186 self
9187 }
9188
9189 /// Sets or clears the value of [terraform_info][crate::model::ResourceDrift::terraform_info].
9190 ///
9191 /// # Example
9192 /// ```ignore,no_run
9193 /// # use google_cloud_config_v1::model::ResourceDrift;
9194 /// use google_cloud_config_v1::model::ResourceDriftTerraformInfo;
9195 /// let x = ResourceDrift::new().set_or_clear_terraform_info(Some(ResourceDriftTerraformInfo::default()/* use setters */));
9196 /// let x = ResourceDrift::new().set_or_clear_terraform_info(None::<ResourceDriftTerraformInfo>);
9197 /// ```
9198 pub fn set_or_clear_terraform_info<T>(mut self, v: std::option::Option<T>) -> Self
9199 where
9200 T: std::convert::Into<crate::model::ResourceDriftTerraformInfo>,
9201 {
9202 self.terraform_info = v.map(|x| x.into());
9203 self
9204 }
9205
9206 /// Sets the value of [property_drifts][crate::model::ResourceDrift::property_drifts].
9207 ///
9208 /// # Example
9209 /// ```ignore,no_run
9210 /// # use google_cloud_config_v1::model::ResourceDrift;
9211 /// use google_cloud_config_v1::model::PropertyDrift;
9212 /// let x = ResourceDrift::new()
9213 /// .set_property_drifts([
9214 /// PropertyDrift::default()/* use setters */,
9215 /// PropertyDrift::default()/* use (different) setters */,
9216 /// ]);
9217 /// ```
9218 pub fn set_property_drifts<T, V>(mut self, v: T) -> Self
9219 where
9220 T: std::iter::IntoIterator<Item = V>,
9221 V: std::convert::Into<crate::model::PropertyDrift>,
9222 {
9223 use std::iter::Iterator;
9224 self.property_drifts = v.into_iter().map(|i| i.into()).collect();
9225 self
9226 }
9227}
9228
9229impl wkt::message::Message for ResourceDrift {
9230 fn typename() -> &'static str {
9231 "type.googleapis.com/google.cloud.config.v1.ResourceDrift"
9232 }
9233}
9234
9235/// A property drift represents a drift to a property in the state file.
9236#[derive(Clone, Default, PartialEq)]
9237#[non_exhaustive]
9238pub struct PropertyDrift {
9239 /// Output only. The path of the property drift.
9240 pub path: std::string::String,
9241
9242 /// Output only. The paths of sensitive fields in `before`. Paths are relative
9243 /// to `path`.
9244 pub before_sensitive_paths: std::vec::Vec<std::string::String>,
9245
9246 /// Output only. Representations of the object value before the actions.
9247 pub before: std::option::Option<wkt::Value>,
9248
9249 /// Output only. The paths of sensitive fields in `after`. Paths are relative
9250 /// to `path`.
9251 pub after_sensitive_paths: std::vec::Vec<std::string::String>,
9252
9253 /// Output only. Representations of the object value after the actions.
9254 pub after: std::option::Option<wkt::Value>,
9255
9256 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9257}
9258
9259impl PropertyDrift {
9260 pub fn new() -> Self {
9261 std::default::Default::default()
9262 }
9263
9264 /// Sets the value of [path][crate::model::PropertyDrift::path].
9265 ///
9266 /// # Example
9267 /// ```ignore,no_run
9268 /// # use google_cloud_config_v1::model::PropertyDrift;
9269 /// let x = PropertyDrift::new().set_path("example");
9270 /// ```
9271 pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9272 self.path = v.into();
9273 self
9274 }
9275
9276 /// Sets the value of [before_sensitive_paths][crate::model::PropertyDrift::before_sensitive_paths].
9277 ///
9278 /// # Example
9279 /// ```ignore,no_run
9280 /// # use google_cloud_config_v1::model::PropertyDrift;
9281 /// let x = PropertyDrift::new().set_before_sensitive_paths(["a", "b", "c"]);
9282 /// ```
9283 pub fn set_before_sensitive_paths<T, V>(mut self, v: T) -> Self
9284 where
9285 T: std::iter::IntoIterator<Item = V>,
9286 V: std::convert::Into<std::string::String>,
9287 {
9288 use std::iter::Iterator;
9289 self.before_sensitive_paths = v.into_iter().map(|i| i.into()).collect();
9290 self
9291 }
9292
9293 /// Sets the value of [before][crate::model::PropertyDrift::before].
9294 ///
9295 /// # Example
9296 /// ```ignore,no_run
9297 /// # use google_cloud_config_v1::model::PropertyDrift;
9298 /// use wkt::Value;
9299 /// let x = PropertyDrift::new().set_before(Value::default()/* use setters */);
9300 /// ```
9301 pub fn set_before<T>(mut self, v: T) -> Self
9302 where
9303 T: std::convert::Into<wkt::Value>,
9304 {
9305 self.before = std::option::Option::Some(v.into());
9306 self
9307 }
9308
9309 /// Sets or clears the value of [before][crate::model::PropertyDrift::before].
9310 ///
9311 /// # Example
9312 /// ```ignore,no_run
9313 /// # use google_cloud_config_v1::model::PropertyDrift;
9314 /// use wkt::Value;
9315 /// let x = PropertyDrift::new().set_or_clear_before(Some(Value::default()/* use setters */));
9316 /// let x = PropertyDrift::new().set_or_clear_before(None::<Value>);
9317 /// ```
9318 pub fn set_or_clear_before<T>(mut self, v: std::option::Option<T>) -> Self
9319 where
9320 T: std::convert::Into<wkt::Value>,
9321 {
9322 self.before = v.map(|x| x.into());
9323 self
9324 }
9325
9326 /// Sets the value of [after_sensitive_paths][crate::model::PropertyDrift::after_sensitive_paths].
9327 ///
9328 /// # Example
9329 /// ```ignore,no_run
9330 /// # use google_cloud_config_v1::model::PropertyDrift;
9331 /// let x = PropertyDrift::new().set_after_sensitive_paths(["a", "b", "c"]);
9332 /// ```
9333 pub fn set_after_sensitive_paths<T, V>(mut self, v: T) -> Self
9334 where
9335 T: std::iter::IntoIterator<Item = V>,
9336 V: std::convert::Into<std::string::String>,
9337 {
9338 use std::iter::Iterator;
9339 self.after_sensitive_paths = v.into_iter().map(|i| i.into()).collect();
9340 self
9341 }
9342
9343 /// Sets the value of [after][crate::model::PropertyDrift::after].
9344 ///
9345 /// # Example
9346 /// ```ignore,no_run
9347 /// # use google_cloud_config_v1::model::PropertyDrift;
9348 /// use wkt::Value;
9349 /// let x = PropertyDrift::new().set_after(Value::default()/* use setters */);
9350 /// ```
9351 pub fn set_after<T>(mut self, v: T) -> Self
9352 where
9353 T: std::convert::Into<wkt::Value>,
9354 {
9355 self.after = std::option::Option::Some(v.into());
9356 self
9357 }
9358
9359 /// Sets or clears the value of [after][crate::model::PropertyDrift::after].
9360 ///
9361 /// # Example
9362 /// ```ignore,no_run
9363 /// # use google_cloud_config_v1::model::PropertyDrift;
9364 /// use wkt::Value;
9365 /// let x = PropertyDrift::new().set_or_clear_after(Some(Value::default()/* use setters */));
9366 /// let x = PropertyDrift::new().set_or_clear_after(None::<Value>);
9367 /// ```
9368 pub fn set_or_clear_after<T>(mut self, v: std::option::Option<T>) -> Self
9369 where
9370 T: std::convert::Into<wkt::Value>,
9371 {
9372 self.after = v.map(|x| x.into());
9373 self
9374 }
9375}
9376
9377impl wkt::message::Message for PropertyDrift {
9378 fn typename() -> &'static str {
9379 "type.googleapis.com/google.cloud.config.v1.PropertyDrift"
9380 }
9381}
9382
9383/// The request message for the ListResourceDrifts method.
9384#[derive(Clone, Default, PartialEq)]
9385#[non_exhaustive]
9386pub struct ListResourceDriftsRequest {
9387 /// Required. The parent in whose context the ResourceDrifts are listed. The
9388 /// parent value is in the format:
9389 /// 'projects/{project_id}/locations/{location}/previews/{preview}'.
9390 pub parent: std::string::String,
9391
9392 /// Optional. When requesting a page of resource drifts, 'page_size' specifies
9393 /// number of resource drifts to return. If unspecified, at most 500 will be
9394 /// returned. The maximum value is 1000.
9395 pub page_size: i32,
9396
9397 /// Optional. Token returned by previous call to 'ListResourceDrifts' which
9398 /// specifies the position in the list from where to continue listing the
9399 /// resource drifts.
9400 pub page_token: std::string::String,
9401
9402 /// Optional. Lists the resource drifts that match the filter expression. A
9403 /// filter expression filters the resource drifts listed in the response. The
9404 /// expression must be of the form '{field} {operator} {value}' where
9405 /// operators: '<', '>',
9406 /// '<=',
9407 /// '>=',
9408 /// '!=', '=', ':' are supported (colon ':' represents a HAS operator which is
9409 /// roughly synonymous with equality). {field} can refer to a proto or JSON
9410 /// field, or a synthetic field. Field names can be camelCase or snake_case.
9411 ///
9412 /// Examples:
9413 ///
9414 /// - Filter by name:
9415 /// name =
9416 /// "projects/foo/locations/us-central1/previews/dep/resourceDrifts/baz
9417 pub filter: std::string::String,
9418
9419 /// Optional. Field to use to sort the list.
9420 pub order_by: std::string::String,
9421
9422 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9423}
9424
9425impl ListResourceDriftsRequest {
9426 pub fn new() -> Self {
9427 std::default::Default::default()
9428 }
9429
9430 /// Sets the value of [parent][crate::model::ListResourceDriftsRequest::parent].
9431 ///
9432 /// # Example
9433 /// ```ignore,no_run
9434 /// # use google_cloud_config_v1::model::ListResourceDriftsRequest;
9435 /// let x = ListResourceDriftsRequest::new().set_parent("example");
9436 /// ```
9437 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9438 self.parent = v.into();
9439 self
9440 }
9441
9442 /// Sets the value of [page_size][crate::model::ListResourceDriftsRequest::page_size].
9443 ///
9444 /// # Example
9445 /// ```ignore,no_run
9446 /// # use google_cloud_config_v1::model::ListResourceDriftsRequest;
9447 /// let x = ListResourceDriftsRequest::new().set_page_size(42);
9448 /// ```
9449 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9450 self.page_size = v.into();
9451 self
9452 }
9453
9454 /// Sets the value of [page_token][crate::model::ListResourceDriftsRequest::page_token].
9455 ///
9456 /// # Example
9457 /// ```ignore,no_run
9458 /// # use google_cloud_config_v1::model::ListResourceDriftsRequest;
9459 /// let x = ListResourceDriftsRequest::new().set_page_token("example");
9460 /// ```
9461 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9462 self.page_token = v.into();
9463 self
9464 }
9465
9466 /// Sets the value of [filter][crate::model::ListResourceDriftsRequest::filter].
9467 ///
9468 /// # Example
9469 /// ```ignore,no_run
9470 /// # use google_cloud_config_v1::model::ListResourceDriftsRequest;
9471 /// let x = ListResourceDriftsRequest::new().set_filter("example");
9472 /// ```
9473 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9474 self.filter = v.into();
9475 self
9476 }
9477
9478 /// Sets the value of [order_by][crate::model::ListResourceDriftsRequest::order_by].
9479 ///
9480 /// # Example
9481 /// ```ignore,no_run
9482 /// # use google_cloud_config_v1::model::ListResourceDriftsRequest;
9483 /// let x = ListResourceDriftsRequest::new().set_order_by("example");
9484 /// ```
9485 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9486 self.order_by = v.into();
9487 self
9488 }
9489}
9490
9491impl wkt::message::Message for ListResourceDriftsRequest {
9492 fn typename() -> &'static str {
9493 "type.googleapis.com/google.cloud.config.v1.ListResourceDriftsRequest"
9494 }
9495}
9496
9497/// A response to a 'ListResourceDrifts' call. Contains a list of ResourceDrifts.
9498#[derive(Clone, Default, PartialEq)]
9499#[non_exhaustive]
9500pub struct ListResourceDriftsResponse {
9501 /// List of ResourceDrifts.
9502 pub resource_drifts: std::vec::Vec<crate::model::ResourceDrift>,
9503
9504 /// A token to request the next page of resources from the
9505 /// 'ListResourceDrifts' method. The value of an empty string means that
9506 /// there are no more resources to return.
9507 pub next_page_token: std::string::String,
9508
9509 /// Unreachable resources, if any.
9510 pub unreachable: std::vec::Vec<std::string::String>,
9511
9512 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9513}
9514
9515impl ListResourceDriftsResponse {
9516 pub fn new() -> Self {
9517 std::default::Default::default()
9518 }
9519
9520 /// Sets the value of [resource_drifts][crate::model::ListResourceDriftsResponse::resource_drifts].
9521 ///
9522 /// # Example
9523 /// ```ignore,no_run
9524 /// # use google_cloud_config_v1::model::ListResourceDriftsResponse;
9525 /// use google_cloud_config_v1::model::ResourceDrift;
9526 /// let x = ListResourceDriftsResponse::new()
9527 /// .set_resource_drifts([
9528 /// ResourceDrift::default()/* use setters */,
9529 /// ResourceDrift::default()/* use (different) setters */,
9530 /// ]);
9531 /// ```
9532 pub fn set_resource_drifts<T, V>(mut self, v: T) -> Self
9533 where
9534 T: std::iter::IntoIterator<Item = V>,
9535 V: std::convert::Into<crate::model::ResourceDrift>,
9536 {
9537 use std::iter::Iterator;
9538 self.resource_drifts = v.into_iter().map(|i| i.into()).collect();
9539 self
9540 }
9541
9542 /// Sets the value of [next_page_token][crate::model::ListResourceDriftsResponse::next_page_token].
9543 ///
9544 /// # Example
9545 /// ```ignore,no_run
9546 /// # use google_cloud_config_v1::model::ListResourceDriftsResponse;
9547 /// let x = ListResourceDriftsResponse::new().set_next_page_token("example");
9548 /// ```
9549 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9550 self.next_page_token = v.into();
9551 self
9552 }
9553
9554 /// Sets the value of [unreachable][crate::model::ListResourceDriftsResponse::unreachable].
9555 ///
9556 /// # Example
9557 /// ```ignore,no_run
9558 /// # use google_cloud_config_v1::model::ListResourceDriftsResponse;
9559 /// let x = ListResourceDriftsResponse::new().set_unreachable(["a", "b", "c"]);
9560 /// ```
9561 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
9562 where
9563 T: std::iter::IntoIterator<Item = V>,
9564 V: std::convert::Into<std::string::String>,
9565 {
9566 use std::iter::Iterator;
9567 self.unreachable = v.into_iter().map(|i| i.into()).collect();
9568 self
9569 }
9570}
9571
9572impl wkt::message::Message for ListResourceDriftsResponse {
9573 fn typename() -> &'static str {
9574 "type.googleapis.com/google.cloud.config.v1.ListResourceDriftsResponse"
9575 }
9576}
9577
9578#[doc(hidden)]
9579impl google_cloud_gax::paginator::internal::PageableResponse for ListResourceDriftsResponse {
9580 type PageItem = crate::model::ResourceDrift;
9581
9582 fn items(self) -> std::vec::Vec<Self::PageItem> {
9583 self.resource_drifts
9584 }
9585
9586 fn next_page_token(&self) -> std::string::String {
9587 use std::clone::Clone;
9588 self.next_page_token.clone()
9589 }
9590}
9591
9592/// The request message for the GetResourceDrift method.
9593#[derive(Clone, Default, PartialEq)]
9594#[non_exhaustive]
9595pub struct GetResourceDriftRequest {
9596 /// Required. The name of the resource drift to retrieve.
9597 /// Format:
9598 /// 'projects/{project_id}/locations/{location}/previews/{preview}/resourceDrifts/{resource_drift}'.
9599 pub name: std::string::String,
9600
9601 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9602}
9603
9604impl GetResourceDriftRequest {
9605 pub fn new() -> Self {
9606 std::default::Default::default()
9607 }
9608
9609 /// Sets the value of [name][crate::model::GetResourceDriftRequest::name].
9610 ///
9611 /// # Example
9612 /// ```ignore,no_run
9613 /// # use google_cloud_config_v1::model::GetResourceDriftRequest;
9614 /// let x = GetResourceDriftRequest::new().set_name("example");
9615 /// ```
9616 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9617 self.name = v.into();
9618 self
9619 }
9620}
9621
9622impl wkt::message::Message for GetResourceDriftRequest {
9623 fn typename() -> &'static str {
9624 "type.googleapis.com/google.cloud.config.v1.GetResourceDriftRequest"
9625 }
9626}
9627
9628/// ProviderConfig contains the provider configurations.
9629#[derive(Clone, Default, PartialEq)]
9630#[non_exhaustive]
9631pub struct ProviderConfig {
9632 /// Optional. ProviderSource specifies the source type of the provider.
9633 pub source_type: std::option::Option<crate::model::provider_config::ProviderSource>,
9634
9635 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9636}
9637
9638impl ProviderConfig {
9639 pub fn new() -> Self {
9640 std::default::Default::default()
9641 }
9642
9643 /// Sets the value of [source_type][crate::model::ProviderConfig::source_type].
9644 ///
9645 /// # Example
9646 /// ```ignore,no_run
9647 /// # use google_cloud_config_v1::model::ProviderConfig;
9648 /// use google_cloud_config_v1::model::provider_config::ProviderSource;
9649 /// let x0 = ProviderConfig::new().set_source_type(ProviderSource::ServiceMaintained);
9650 /// ```
9651 pub fn set_source_type<T>(mut self, v: T) -> Self
9652 where
9653 T: std::convert::Into<crate::model::provider_config::ProviderSource>,
9654 {
9655 self.source_type = std::option::Option::Some(v.into());
9656 self
9657 }
9658
9659 /// Sets or clears the value of [source_type][crate::model::ProviderConfig::source_type].
9660 ///
9661 /// # Example
9662 /// ```ignore,no_run
9663 /// # use google_cloud_config_v1::model::ProviderConfig;
9664 /// use google_cloud_config_v1::model::provider_config::ProviderSource;
9665 /// let x0 = ProviderConfig::new().set_or_clear_source_type(Some(ProviderSource::ServiceMaintained));
9666 /// let x_none = ProviderConfig::new().set_or_clear_source_type(None::<ProviderSource>);
9667 /// ```
9668 pub fn set_or_clear_source_type<T>(mut self, v: std::option::Option<T>) -> Self
9669 where
9670 T: std::convert::Into<crate::model::provider_config::ProviderSource>,
9671 {
9672 self.source_type = v.map(|x| x.into());
9673 self
9674 }
9675}
9676
9677impl wkt::message::Message for ProviderConfig {
9678 fn typename() -> &'static str {
9679 "type.googleapis.com/google.cloud.config.v1.ProviderConfig"
9680 }
9681}
9682
9683/// Defines additional types related to [ProviderConfig].
9684pub mod provider_config {
9685 #[allow(unused_imports)]
9686 use super::*;
9687
9688 /// ProviderSource represents the source type of the provider.
9689 ///
9690 /// # Working with unknown values
9691 ///
9692 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9693 /// additional enum variants at any time. Adding new variants is not considered
9694 /// a breaking change. Applications should write their code in anticipation of:
9695 ///
9696 /// - New values appearing in future releases of the client library, **and**
9697 /// - New values received dynamically, without application changes.
9698 ///
9699 /// Please consult the [Working with enums] section in the user guide for some
9700 /// guidelines.
9701 ///
9702 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
9703 #[derive(Clone, Debug, PartialEq)]
9704 #[non_exhaustive]
9705 pub enum ProviderSource {
9706 /// Unspecified source type, default to public sources.
9707 Unspecified,
9708 /// Service maintained provider source type.
9709 ServiceMaintained,
9710 /// If set, the enum was initialized with an unknown value.
9711 ///
9712 /// Applications can examine the value using [ProviderSource::value] or
9713 /// [ProviderSource::name].
9714 UnknownValue(provider_source::UnknownValue),
9715 }
9716
9717 #[doc(hidden)]
9718 pub mod provider_source {
9719 #[allow(unused_imports)]
9720 use super::*;
9721 #[derive(Clone, Debug, PartialEq)]
9722 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9723 }
9724
9725 impl ProviderSource {
9726 /// Gets the enum value.
9727 ///
9728 /// Returns `None` if the enum contains an unknown value deserialized from
9729 /// the string representation of enums.
9730 pub fn value(&self) -> std::option::Option<i32> {
9731 match self {
9732 Self::Unspecified => std::option::Option::Some(0),
9733 Self::ServiceMaintained => std::option::Option::Some(1),
9734 Self::UnknownValue(u) => u.0.value(),
9735 }
9736 }
9737
9738 /// Gets the enum value as a string.
9739 ///
9740 /// Returns `None` if the enum contains an unknown value deserialized from
9741 /// the integer representation of enums.
9742 pub fn name(&self) -> std::option::Option<&str> {
9743 match self {
9744 Self::Unspecified => std::option::Option::Some("PROVIDER_SOURCE_UNSPECIFIED"),
9745 Self::ServiceMaintained => std::option::Option::Some("SERVICE_MAINTAINED"),
9746 Self::UnknownValue(u) => u.0.name(),
9747 }
9748 }
9749 }
9750
9751 impl std::default::Default for ProviderSource {
9752 fn default() -> Self {
9753 use std::convert::From;
9754 Self::from(0)
9755 }
9756 }
9757
9758 impl std::fmt::Display for ProviderSource {
9759 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9760 wkt::internal::display_enum(f, self.name(), self.value())
9761 }
9762 }
9763
9764 impl std::convert::From<i32> for ProviderSource {
9765 fn from(value: i32) -> Self {
9766 match value {
9767 0 => Self::Unspecified,
9768 1 => Self::ServiceMaintained,
9769 _ => Self::UnknownValue(provider_source::UnknownValue(
9770 wkt::internal::UnknownEnumValue::Integer(value),
9771 )),
9772 }
9773 }
9774 }
9775
9776 impl std::convert::From<&str> for ProviderSource {
9777 fn from(value: &str) -> Self {
9778 use std::string::ToString;
9779 match value {
9780 "PROVIDER_SOURCE_UNSPECIFIED" => Self::Unspecified,
9781 "SERVICE_MAINTAINED" => Self::ServiceMaintained,
9782 _ => Self::UnknownValue(provider_source::UnknownValue(
9783 wkt::internal::UnknownEnumValue::String(value.to_string()),
9784 )),
9785 }
9786 }
9787 }
9788
9789 impl serde::ser::Serialize for ProviderSource {
9790 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9791 where
9792 S: serde::Serializer,
9793 {
9794 match self {
9795 Self::Unspecified => serializer.serialize_i32(0),
9796 Self::ServiceMaintained => serializer.serialize_i32(1),
9797 Self::UnknownValue(u) => u.0.serialize(serializer),
9798 }
9799 }
9800 }
9801
9802 impl<'de> serde::de::Deserialize<'de> for ProviderSource {
9803 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9804 where
9805 D: serde::Deserializer<'de>,
9806 {
9807 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ProviderSource>::new(
9808 ".google.cloud.config.v1.ProviderConfig.ProviderSource",
9809 ))
9810 }
9811 }
9812}
9813
9814/// The request message for the GetAutoMigrationConfig method.
9815#[derive(Clone, Default, PartialEq)]
9816#[non_exhaustive]
9817pub struct GetAutoMigrationConfigRequest {
9818 /// Required. The name of the AutoMigrationConfig.
9819 /// Format:
9820 /// 'projects/{project_id}/locations/{location}/AutoMigrationConfig'.
9821 pub name: std::string::String,
9822
9823 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9824}
9825
9826impl GetAutoMigrationConfigRequest {
9827 pub fn new() -> Self {
9828 std::default::Default::default()
9829 }
9830
9831 /// Sets the value of [name][crate::model::GetAutoMigrationConfigRequest::name].
9832 ///
9833 /// # Example
9834 /// ```ignore,no_run
9835 /// # use google_cloud_config_v1::model::GetAutoMigrationConfigRequest;
9836 /// let x = GetAutoMigrationConfigRequest::new().set_name("example");
9837 /// ```
9838 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9839 self.name = v.into();
9840 self
9841 }
9842}
9843
9844impl wkt::message::Message for GetAutoMigrationConfigRequest {
9845 fn typename() -> &'static str {
9846 "type.googleapis.com/google.cloud.config.v1.GetAutoMigrationConfigRequest"
9847 }
9848}
9849
9850/// AutoMigrationConfig contains the automigration configuration for a project.
9851#[derive(Clone, Default, PartialEq)]
9852#[non_exhaustive]
9853pub struct AutoMigrationConfig {
9854 /// Identifier. The name of the AutoMigrationConfig.
9855 /// Format:
9856 /// 'projects/{project_id}/locations/{location}/AutoMigrationConfig'.
9857 pub name: std::string::String,
9858
9859 /// Output only. Time the AutoMigrationConfig was last updated.
9860 pub update_time: std::option::Option<wkt::Timestamp>,
9861
9862 /// Optional. Whether the auto migration is enabled for the project.
9863 pub auto_migration_enabled: bool,
9864
9865 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9866}
9867
9868impl AutoMigrationConfig {
9869 pub fn new() -> Self {
9870 std::default::Default::default()
9871 }
9872
9873 /// Sets the value of [name][crate::model::AutoMigrationConfig::name].
9874 ///
9875 /// # Example
9876 /// ```ignore,no_run
9877 /// # use google_cloud_config_v1::model::AutoMigrationConfig;
9878 /// let x = AutoMigrationConfig::new().set_name("example");
9879 /// ```
9880 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9881 self.name = v.into();
9882 self
9883 }
9884
9885 /// Sets the value of [update_time][crate::model::AutoMigrationConfig::update_time].
9886 ///
9887 /// # Example
9888 /// ```ignore,no_run
9889 /// # use google_cloud_config_v1::model::AutoMigrationConfig;
9890 /// use wkt::Timestamp;
9891 /// let x = AutoMigrationConfig::new().set_update_time(Timestamp::default()/* use setters */);
9892 /// ```
9893 pub fn set_update_time<T>(mut self, v: T) -> Self
9894 where
9895 T: std::convert::Into<wkt::Timestamp>,
9896 {
9897 self.update_time = std::option::Option::Some(v.into());
9898 self
9899 }
9900
9901 /// Sets or clears the value of [update_time][crate::model::AutoMigrationConfig::update_time].
9902 ///
9903 /// # Example
9904 /// ```ignore,no_run
9905 /// # use google_cloud_config_v1::model::AutoMigrationConfig;
9906 /// use wkt::Timestamp;
9907 /// let x = AutoMigrationConfig::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
9908 /// let x = AutoMigrationConfig::new().set_or_clear_update_time(None::<Timestamp>);
9909 /// ```
9910 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
9911 where
9912 T: std::convert::Into<wkt::Timestamp>,
9913 {
9914 self.update_time = v.map(|x| x.into());
9915 self
9916 }
9917
9918 /// Sets the value of [auto_migration_enabled][crate::model::AutoMigrationConfig::auto_migration_enabled].
9919 ///
9920 /// # Example
9921 /// ```ignore,no_run
9922 /// # use google_cloud_config_v1::model::AutoMigrationConfig;
9923 /// let x = AutoMigrationConfig::new().set_auto_migration_enabled(true);
9924 /// ```
9925 pub fn set_auto_migration_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9926 self.auto_migration_enabled = v.into();
9927 self
9928 }
9929}
9930
9931impl wkt::message::Message for AutoMigrationConfig {
9932 fn typename() -> &'static str {
9933 "type.googleapis.com/google.cloud.config.v1.AutoMigrationConfig"
9934 }
9935}
9936
9937/// The request message for the UpdateAutoMigrationConfig method.
9938#[derive(Clone, Default, PartialEq)]
9939#[non_exhaustive]
9940pub struct UpdateAutoMigrationConfigRequest {
9941 /// Optional. The update mask applies to the resource. See
9942 /// [google.protobuf.FieldMask][google.protobuf.FieldMask].
9943 ///
9944 /// [google.protobuf.FieldMask]: wkt::FieldMask
9945 pub update_mask: std::option::Option<wkt::FieldMask>,
9946
9947 /// Required. The AutoMigrationConfig to update.
9948 pub auto_migration_config: std::option::Option<crate::model::AutoMigrationConfig>,
9949
9950 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9951}
9952
9953impl UpdateAutoMigrationConfigRequest {
9954 pub fn new() -> Self {
9955 std::default::Default::default()
9956 }
9957
9958 /// Sets the value of [update_mask][crate::model::UpdateAutoMigrationConfigRequest::update_mask].
9959 ///
9960 /// # Example
9961 /// ```ignore,no_run
9962 /// # use google_cloud_config_v1::model::UpdateAutoMigrationConfigRequest;
9963 /// use wkt::FieldMask;
9964 /// let x = UpdateAutoMigrationConfigRequest::new().set_update_mask(FieldMask::default()/* use setters */);
9965 /// ```
9966 pub fn set_update_mask<T>(mut self, v: T) -> Self
9967 where
9968 T: std::convert::Into<wkt::FieldMask>,
9969 {
9970 self.update_mask = std::option::Option::Some(v.into());
9971 self
9972 }
9973
9974 /// Sets or clears the value of [update_mask][crate::model::UpdateAutoMigrationConfigRequest::update_mask].
9975 ///
9976 /// # Example
9977 /// ```ignore,no_run
9978 /// # use google_cloud_config_v1::model::UpdateAutoMigrationConfigRequest;
9979 /// use wkt::FieldMask;
9980 /// let x = UpdateAutoMigrationConfigRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
9981 /// let x = UpdateAutoMigrationConfigRequest::new().set_or_clear_update_mask(None::<FieldMask>);
9982 /// ```
9983 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
9984 where
9985 T: std::convert::Into<wkt::FieldMask>,
9986 {
9987 self.update_mask = v.map(|x| x.into());
9988 self
9989 }
9990
9991 /// Sets the value of [auto_migration_config][crate::model::UpdateAutoMigrationConfigRequest::auto_migration_config].
9992 ///
9993 /// # Example
9994 /// ```ignore,no_run
9995 /// # use google_cloud_config_v1::model::UpdateAutoMigrationConfigRequest;
9996 /// use google_cloud_config_v1::model::AutoMigrationConfig;
9997 /// let x = UpdateAutoMigrationConfigRequest::new().set_auto_migration_config(AutoMigrationConfig::default()/* use setters */);
9998 /// ```
9999 pub fn set_auto_migration_config<T>(mut self, v: T) -> Self
10000 where
10001 T: std::convert::Into<crate::model::AutoMigrationConfig>,
10002 {
10003 self.auto_migration_config = std::option::Option::Some(v.into());
10004 self
10005 }
10006
10007 /// Sets or clears the value of [auto_migration_config][crate::model::UpdateAutoMigrationConfigRequest::auto_migration_config].
10008 ///
10009 /// # Example
10010 /// ```ignore,no_run
10011 /// # use google_cloud_config_v1::model::UpdateAutoMigrationConfigRequest;
10012 /// use google_cloud_config_v1::model::AutoMigrationConfig;
10013 /// let x = UpdateAutoMigrationConfigRequest::new().set_or_clear_auto_migration_config(Some(AutoMigrationConfig::default()/* use setters */));
10014 /// let x = UpdateAutoMigrationConfigRequest::new().set_or_clear_auto_migration_config(None::<AutoMigrationConfig>);
10015 /// ```
10016 pub fn set_or_clear_auto_migration_config<T>(mut self, v: std::option::Option<T>) -> Self
10017 where
10018 T: std::convert::Into<crate::model::AutoMigrationConfig>,
10019 {
10020 self.auto_migration_config = v.map(|x| x.into());
10021 self
10022 }
10023}
10024
10025impl wkt::message::Message for UpdateAutoMigrationConfigRequest {
10026 fn typename() -> &'static str {
10027 "type.googleapis.com/google.cloud.config.v1.UpdateAutoMigrationConfigRequest"
10028 }
10029}
10030
10031/// Enum values to control quota checks for resources in terraform
10032/// configuration files.
10033///
10034/// # Working with unknown values
10035///
10036/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10037/// additional enum variants at any time. Adding new variants is not considered
10038/// a breaking change. Applications should write their code in anticipation of:
10039///
10040/// - New values appearing in future releases of the client library, **and**
10041/// - New values received dynamically, without application changes.
10042///
10043/// Please consult the [Working with enums] section in the user guide for some
10044/// guidelines.
10045///
10046/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
10047#[derive(Clone, Debug, PartialEq)]
10048#[non_exhaustive]
10049pub enum QuotaValidation {
10050 /// The default value.
10051 /// QuotaValidation on terraform configuration files will be disabled in
10052 /// this case.
10053 Unspecified,
10054 /// Enable computing quotas for resources in terraform configuration files to
10055 /// get visibility on resources with insufficient quotas.
10056 Enabled,
10057 /// Enforce quota checks so deployment fails if there isn't sufficient quotas
10058 /// available to deploy resources in terraform configuration files.
10059 Enforced,
10060 /// If set, the enum was initialized with an unknown value.
10061 ///
10062 /// Applications can examine the value using [QuotaValidation::value] or
10063 /// [QuotaValidation::name].
10064 UnknownValue(quota_validation::UnknownValue),
10065}
10066
10067#[doc(hidden)]
10068pub mod quota_validation {
10069 #[allow(unused_imports)]
10070 use super::*;
10071 #[derive(Clone, Debug, PartialEq)]
10072 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10073}
10074
10075impl QuotaValidation {
10076 /// Gets the enum value.
10077 ///
10078 /// Returns `None` if the enum contains an unknown value deserialized from
10079 /// the string representation of enums.
10080 pub fn value(&self) -> std::option::Option<i32> {
10081 match self {
10082 Self::Unspecified => std::option::Option::Some(0),
10083 Self::Enabled => std::option::Option::Some(1),
10084 Self::Enforced => std::option::Option::Some(2),
10085 Self::UnknownValue(u) => u.0.value(),
10086 }
10087 }
10088
10089 /// Gets the enum value as a string.
10090 ///
10091 /// Returns `None` if the enum contains an unknown value deserialized from
10092 /// the integer representation of enums.
10093 pub fn name(&self) -> std::option::Option<&str> {
10094 match self {
10095 Self::Unspecified => std::option::Option::Some("QUOTA_VALIDATION_UNSPECIFIED"),
10096 Self::Enabled => std::option::Option::Some("ENABLED"),
10097 Self::Enforced => std::option::Option::Some("ENFORCED"),
10098 Self::UnknownValue(u) => u.0.name(),
10099 }
10100 }
10101}
10102
10103impl std::default::Default for QuotaValidation {
10104 fn default() -> Self {
10105 use std::convert::From;
10106 Self::from(0)
10107 }
10108}
10109
10110impl std::fmt::Display for QuotaValidation {
10111 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10112 wkt::internal::display_enum(f, self.name(), self.value())
10113 }
10114}
10115
10116impl std::convert::From<i32> for QuotaValidation {
10117 fn from(value: i32) -> Self {
10118 match value {
10119 0 => Self::Unspecified,
10120 1 => Self::Enabled,
10121 2 => Self::Enforced,
10122 _ => Self::UnknownValue(quota_validation::UnknownValue(
10123 wkt::internal::UnknownEnumValue::Integer(value),
10124 )),
10125 }
10126 }
10127}
10128
10129impl std::convert::From<&str> for QuotaValidation {
10130 fn from(value: &str) -> Self {
10131 use std::string::ToString;
10132 match value {
10133 "QUOTA_VALIDATION_UNSPECIFIED" => Self::Unspecified,
10134 "ENABLED" => Self::Enabled,
10135 "ENFORCED" => Self::Enforced,
10136 _ => Self::UnknownValue(quota_validation::UnknownValue(
10137 wkt::internal::UnknownEnumValue::String(value.to_string()),
10138 )),
10139 }
10140 }
10141}
10142
10143impl serde::ser::Serialize for QuotaValidation {
10144 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10145 where
10146 S: serde::Serializer,
10147 {
10148 match self {
10149 Self::Unspecified => serializer.serialize_i32(0),
10150 Self::Enabled => serializer.serialize_i32(1),
10151 Self::Enforced => serializer.serialize_i32(2),
10152 Self::UnknownValue(u) => u.0.serialize(serializer),
10153 }
10154 }
10155}
10156
10157impl<'de> serde::de::Deserialize<'de> for QuotaValidation {
10158 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10159 where
10160 D: serde::Deserializer<'de>,
10161 {
10162 deserializer.deserialize_any(wkt::internal::EnumVisitor::<QuotaValidation>::new(
10163 ".google.cloud.config.v1.QuotaValidation",
10164 ))
10165 }
10166}