google_cloud_config_v1/model.rs
1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17#![allow(rustdoc::redundant_explicit_links)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![no_implicit_prelude]
20extern crate async_trait;
21extern crate bytes;
22extern crate gax;
23extern crate gaxi;
24extern crate iam_v1;
25extern crate lazy_static;
26extern crate location;
27extern crate longrunning;
28extern crate lro;
29extern crate reqwest;
30extern crate rpc;
31extern crate serde;
32extern crate serde_json;
33extern crate serde_with;
34extern crate std;
35extern crate tracing;
36extern crate wkt;
37
38mod debug;
39mod deserialize;
40mod serialize;
41
42/// A Deployment is a group of resources and configs managed and provisioned by
43/// Infra Manager.
44#[derive(Clone, Default, PartialEq)]
45#[non_exhaustive]
46pub struct Deployment {
47 /// Identifier. Resource name of the deployment.
48 /// Format: `projects/{project}/locations/{location}/deployments/{deployment}`
49 pub name: std::string::String,
50
51 /// Output only. Time when the deployment was created.
52 pub create_time: std::option::Option<wkt::Timestamp>,
53
54 /// Output only. Time when the deployment was last modified.
55 pub update_time: std::option::Option<wkt::Timestamp>,
56
57 /// Optional. User-defined metadata for the deployment.
58 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
59
60 /// Output only. Current state of the deployment.
61 pub state: crate::model::deployment::State,
62
63 /// Output only. Revision name that was most recently applied.
64 /// Format: `projects/{project}/locations/{location}/deployments/{deployment}/
65 /// revisions/{revision}`
66 pub latest_revision: std::string::String,
67
68 /// Output only. Additional information regarding the current state.
69 pub state_detail: std::string::String,
70
71 /// Output only. Error code describing errors that may have occurred.
72 pub error_code: crate::model::deployment::ErrorCode,
73
74 /// Output only. Location of artifacts from a DeleteDeployment operation.
75 pub delete_results: std::option::Option<crate::model::ApplyResults>,
76
77 /// Output only. Cloud Build instance UUID associated with deleting this
78 /// deployment.
79 pub delete_build: std::string::String,
80
81 /// Output only. Location of Cloud Build logs in Google Cloud Storage,
82 /// populated when deleting this deployment. Format: `gs://{bucket}/{object}`.
83 pub delete_logs: std::string::String,
84
85 /// Output only. Errors encountered when deleting this deployment.
86 /// Errors are truncated to 10 entries, see `delete_results` and `error_logs`
87 /// for full details.
88 pub tf_errors: std::vec::Vec<crate::model::TerraformError>,
89
90 /// Output only. Location of Terraform error logs in Google Cloud Storage.
91 /// Format: `gs://{bucket}/{object}`.
92 pub error_logs: std::string::String,
93
94 /// Optional. User-defined location of Cloud Build logs and artifacts in Google
95 /// Cloud Storage. Format: `gs://{bucket}/{folder}`
96 ///
97 /// A default bucket will be bootstrapped if the field is not set or empty.
98 /// Default bucket format: `gs://<project number>-<region>-blueprint-config`
99 /// Constraints:
100 ///
101 /// - The bucket needs to be in the same project as the deployment
102 /// - The path cannot be within the path of `gcs_source`
103 /// - The field cannot be updated, including changing its presence
104 pub artifacts_gcs_bucket: std::option::Option<std::string::String>,
105
106 /// Required. User-specified Service Account (SA) credentials to be used when
107 /// actuating resources.
108 /// Format: `projects/{projectID}/serviceAccounts/{serviceAccount}`
109 pub service_account: std::option::Option<std::string::String>,
110
111 /// By default, Infra Manager will return a failure when
112 /// Terraform encounters a 409 code (resource conflict error) during actuation.
113 /// If this flag is set to true, Infra Manager will instead
114 /// attempt to automatically import the resource into the Terraform state (for
115 /// supported resource types) and continue actuation.
116 ///
117 /// Not all resource types are supported, refer to documentation.
118 pub import_existing_resources: std::option::Option<bool>,
119
120 /// Optional. The user-specified Cloud Build worker pool resource in which the
121 /// Cloud Build job will execute. Format:
122 /// `projects/{project}/locations/{location}/workerPools/{workerPoolId}`.
123 /// If this field is unspecified, the default Cloud Build worker pool will be
124 /// used.
125 pub worker_pool: std::option::Option<std::string::String>,
126
127 /// Output only. Current lock state of the deployment.
128 pub lock_state: crate::model::deployment::LockState,
129
130 /// Optional. The user-specified Terraform version constraint.
131 /// Example: "=1.3.10".
132 pub tf_version_constraint: std::option::Option<std::string::String>,
133
134 /// Output only. The current Terraform version set on the deployment.
135 /// It is in the format of "Major.Minor.Patch", for example, "1.3.10".
136 pub tf_version: std::string::String,
137
138 /// Optional. Input to control quota checks for resources in terraform
139 /// configuration files. There are limited resources on which quota validation
140 /// applies.
141 pub quota_validation: crate::model::QuotaValidation,
142
143 /// Optional. Arbitrary key-value metadata storage e.g. to help client tools
144 /// identify deployments during automation. See
145 /// <https://google.aip.dev/148#annotations> for details on format and size
146 /// limitations.
147 pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
148
149 /// Optional. This field specifies the provider configurations.
150 pub provider_config: std::option::Option<crate::model::ProviderConfig>,
151
152 /// Blueprint to deploy.
153 pub blueprint: std::option::Option<crate::model::deployment::Blueprint>,
154
155 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
156}
157
158impl Deployment {
159 pub fn new() -> Self {
160 std::default::Default::default()
161 }
162
163 /// Sets the value of [name][crate::model::Deployment::name].
164 ///
165 /// # Example
166 /// ```ignore,no_run
167 /// # use google_cloud_config_v1::model::Deployment;
168 /// let x = Deployment::new().set_name("example");
169 /// ```
170 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
171 self.name = v.into();
172 self
173 }
174
175 /// Sets the value of [create_time][crate::model::Deployment::create_time].
176 ///
177 /// # Example
178 /// ```ignore,no_run
179 /// # use google_cloud_config_v1::model::Deployment;
180 /// use wkt::Timestamp;
181 /// let x = Deployment::new().set_create_time(Timestamp::default()/* use setters */);
182 /// ```
183 pub fn set_create_time<T>(mut self, v: T) -> Self
184 where
185 T: std::convert::Into<wkt::Timestamp>,
186 {
187 self.create_time = std::option::Option::Some(v.into());
188 self
189 }
190
191 /// Sets or clears the value of [create_time][crate::model::Deployment::create_time].
192 ///
193 /// # Example
194 /// ```ignore,no_run
195 /// # use google_cloud_config_v1::model::Deployment;
196 /// use wkt::Timestamp;
197 /// let x = Deployment::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
198 /// let x = Deployment::new().set_or_clear_create_time(None::<Timestamp>);
199 /// ```
200 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
201 where
202 T: std::convert::Into<wkt::Timestamp>,
203 {
204 self.create_time = v.map(|x| x.into());
205 self
206 }
207
208 /// Sets the value of [update_time][crate::model::Deployment::update_time].
209 ///
210 /// # Example
211 /// ```ignore,no_run
212 /// # use google_cloud_config_v1::model::Deployment;
213 /// use wkt::Timestamp;
214 /// let x = Deployment::new().set_update_time(Timestamp::default()/* use setters */);
215 /// ```
216 pub fn set_update_time<T>(mut self, v: T) -> Self
217 where
218 T: std::convert::Into<wkt::Timestamp>,
219 {
220 self.update_time = std::option::Option::Some(v.into());
221 self
222 }
223
224 /// Sets or clears the value of [update_time][crate::model::Deployment::update_time].
225 ///
226 /// # Example
227 /// ```ignore,no_run
228 /// # use google_cloud_config_v1::model::Deployment;
229 /// use wkt::Timestamp;
230 /// let x = Deployment::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
231 /// let x = Deployment::new().set_or_clear_update_time(None::<Timestamp>);
232 /// ```
233 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
234 where
235 T: std::convert::Into<wkt::Timestamp>,
236 {
237 self.update_time = v.map(|x| x.into());
238 self
239 }
240
241 /// Sets the value of [labels][crate::model::Deployment::labels].
242 ///
243 /// # Example
244 /// ```ignore,no_run
245 /// # use google_cloud_config_v1::model::Deployment;
246 /// let x = Deployment::new().set_labels([
247 /// ("key0", "abc"),
248 /// ("key1", "xyz"),
249 /// ]);
250 /// ```
251 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
252 where
253 T: std::iter::IntoIterator<Item = (K, V)>,
254 K: std::convert::Into<std::string::String>,
255 V: std::convert::Into<std::string::String>,
256 {
257 use std::iter::Iterator;
258 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
259 self
260 }
261
262 /// Sets the value of [state][crate::model::Deployment::state].
263 ///
264 /// # Example
265 /// ```ignore,no_run
266 /// # use google_cloud_config_v1::model::Deployment;
267 /// use google_cloud_config_v1::model::deployment::State;
268 /// let x0 = Deployment::new().set_state(State::Creating);
269 /// let x1 = Deployment::new().set_state(State::Active);
270 /// let x2 = Deployment::new().set_state(State::Updating);
271 /// ```
272 pub fn set_state<T: std::convert::Into<crate::model::deployment::State>>(
273 mut self,
274 v: T,
275 ) -> Self {
276 self.state = v.into();
277 self
278 }
279
280 /// Sets the value of [latest_revision][crate::model::Deployment::latest_revision].
281 ///
282 /// # Example
283 /// ```ignore,no_run
284 /// # use google_cloud_config_v1::model::Deployment;
285 /// let x = Deployment::new().set_latest_revision("example");
286 /// ```
287 pub fn set_latest_revision<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
288 self.latest_revision = v.into();
289 self
290 }
291
292 /// Sets the value of [state_detail][crate::model::Deployment::state_detail].
293 ///
294 /// # Example
295 /// ```ignore,no_run
296 /// # use google_cloud_config_v1::model::Deployment;
297 /// let x = Deployment::new().set_state_detail("example");
298 /// ```
299 pub fn set_state_detail<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
300 self.state_detail = v.into();
301 self
302 }
303
304 /// Sets the value of [error_code][crate::model::Deployment::error_code].
305 ///
306 /// # Example
307 /// ```ignore,no_run
308 /// # use google_cloud_config_v1::model::Deployment;
309 /// use google_cloud_config_v1::model::deployment::ErrorCode;
310 /// let x0 = Deployment::new().set_error_code(ErrorCode::RevisionFailed);
311 /// let x1 = Deployment::new().set_error_code(ErrorCode::CloudBuildPermissionDenied);
312 /// let x2 = Deployment::new().set_error_code(ErrorCode::DeleteBuildApiFailed);
313 /// ```
314 pub fn set_error_code<T: std::convert::Into<crate::model::deployment::ErrorCode>>(
315 mut self,
316 v: T,
317 ) -> Self {
318 self.error_code = v.into();
319 self
320 }
321
322 /// Sets the value of [delete_results][crate::model::Deployment::delete_results].
323 ///
324 /// # Example
325 /// ```ignore,no_run
326 /// # use google_cloud_config_v1::model::Deployment;
327 /// use google_cloud_config_v1::model::ApplyResults;
328 /// let x = Deployment::new().set_delete_results(ApplyResults::default()/* use setters */);
329 /// ```
330 pub fn set_delete_results<T>(mut self, v: T) -> Self
331 where
332 T: std::convert::Into<crate::model::ApplyResults>,
333 {
334 self.delete_results = std::option::Option::Some(v.into());
335 self
336 }
337
338 /// Sets or clears the value of [delete_results][crate::model::Deployment::delete_results].
339 ///
340 /// # Example
341 /// ```ignore,no_run
342 /// # use google_cloud_config_v1::model::Deployment;
343 /// use google_cloud_config_v1::model::ApplyResults;
344 /// let x = Deployment::new().set_or_clear_delete_results(Some(ApplyResults::default()/* use setters */));
345 /// let x = Deployment::new().set_or_clear_delete_results(None::<ApplyResults>);
346 /// ```
347 pub fn set_or_clear_delete_results<T>(mut self, v: std::option::Option<T>) -> Self
348 where
349 T: std::convert::Into<crate::model::ApplyResults>,
350 {
351 self.delete_results = v.map(|x| x.into());
352 self
353 }
354
355 /// Sets the value of [delete_build][crate::model::Deployment::delete_build].
356 ///
357 /// # Example
358 /// ```ignore,no_run
359 /// # use google_cloud_config_v1::model::Deployment;
360 /// let x = Deployment::new().set_delete_build("example");
361 /// ```
362 pub fn set_delete_build<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
363 self.delete_build = v.into();
364 self
365 }
366
367 /// Sets the value of [delete_logs][crate::model::Deployment::delete_logs].
368 ///
369 /// # Example
370 /// ```ignore,no_run
371 /// # use google_cloud_config_v1::model::Deployment;
372 /// let x = Deployment::new().set_delete_logs("example");
373 /// ```
374 pub fn set_delete_logs<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
375 self.delete_logs = v.into();
376 self
377 }
378
379 /// Sets the value of [tf_errors][crate::model::Deployment::tf_errors].
380 ///
381 /// # Example
382 /// ```ignore,no_run
383 /// # use google_cloud_config_v1::model::Deployment;
384 /// use google_cloud_config_v1::model::TerraformError;
385 /// let x = Deployment::new()
386 /// .set_tf_errors([
387 /// TerraformError::default()/* use setters */,
388 /// TerraformError::default()/* use (different) setters */,
389 /// ]);
390 /// ```
391 pub fn set_tf_errors<T, V>(mut self, v: T) -> Self
392 where
393 T: std::iter::IntoIterator<Item = V>,
394 V: std::convert::Into<crate::model::TerraformError>,
395 {
396 use std::iter::Iterator;
397 self.tf_errors = v.into_iter().map(|i| i.into()).collect();
398 self
399 }
400
401 /// Sets the value of [error_logs][crate::model::Deployment::error_logs].
402 ///
403 /// # Example
404 /// ```ignore,no_run
405 /// # use google_cloud_config_v1::model::Deployment;
406 /// let x = Deployment::new().set_error_logs("example");
407 /// ```
408 pub fn set_error_logs<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
409 self.error_logs = v.into();
410 self
411 }
412
413 /// Sets the value of [artifacts_gcs_bucket][crate::model::Deployment::artifacts_gcs_bucket].
414 ///
415 /// # Example
416 /// ```ignore,no_run
417 /// # use google_cloud_config_v1::model::Deployment;
418 /// let x = Deployment::new().set_artifacts_gcs_bucket("example");
419 /// ```
420 pub fn set_artifacts_gcs_bucket<T>(mut self, v: T) -> Self
421 where
422 T: std::convert::Into<std::string::String>,
423 {
424 self.artifacts_gcs_bucket = std::option::Option::Some(v.into());
425 self
426 }
427
428 /// Sets or clears the value of [artifacts_gcs_bucket][crate::model::Deployment::artifacts_gcs_bucket].
429 ///
430 /// # Example
431 /// ```ignore,no_run
432 /// # use google_cloud_config_v1::model::Deployment;
433 /// let x = Deployment::new().set_or_clear_artifacts_gcs_bucket(Some("example"));
434 /// let x = Deployment::new().set_or_clear_artifacts_gcs_bucket(None::<String>);
435 /// ```
436 pub fn set_or_clear_artifacts_gcs_bucket<T>(mut self, v: std::option::Option<T>) -> Self
437 where
438 T: std::convert::Into<std::string::String>,
439 {
440 self.artifacts_gcs_bucket = v.map(|x| x.into());
441 self
442 }
443
444 /// Sets the value of [service_account][crate::model::Deployment::service_account].
445 ///
446 /// # Example
447 /// ```ignore,no_run
448 /// # use google_cloud_config_v1::model::Deployment;
449 /// let x = Deployment::new().set_service_account("example");
450 /// ```
451 pub fn set_service_account<T>(mut self, v: T) -> Self
452 where
453 T: std::convert::Into<std::string::String>,
454 {
455 self.service_account = std::option::Option::Some(v.into());
456 self
457 }
458
459 /// Sets or clears the value of [service_account][crate::model::Deployment::service_account].
460 ///
461 /// # Example
462 /// ```ignore,no_run
463 /// # use google_cloud_config_v1::model::Deployment;
464 /// let x = Deployment::new().set_or_clear_service_account(Some("example"));
465 /// let x = Deployment::new().set_or_clear_service_account(None::<String>);
466 /// ```
467 pub fn set_or_clear_service_account<T>(mut self, v: std::option::Option<T>) -> Self
468 where
469 T: std::convert::Into<std::string::String>,
470 {
471 self.service_account = v.map(|x| x.into());
472 self
473 }
474
475 /// Sets the value of [import_existing_resources][crate::model::Deployment::import_existing_resources].
476 ///
477 /// # Example
478 /// ```ignore,no_run
479 /// # use google_cloud_config_v1::model::Deployment;
480 /// let x = Deployment::new().set_import_existing_resources(true);
481 /// ```
482 pub fn set_import_existing_resources<T>(mut self, v: T) -> Self
483 where
484 T: std::convert::Into<bool>,
485 {
486 self.import_existing_resources = std::option::Option::Some(v.into());
487 self
488 }
489
490 /// Sets or clears the value of [import_existing_resources][crate::model::Deployment::import_existing_resources].
491 ///
492 /// # Example
493 /// ```ignore,no_run
494 /// # use google_cloud_config_v1::model::Deployment;
495 /// let x = Deployment::new().set_or_clear_import_existing_resources(Some(false));
496 /// let x = Deployment::new().set_or_clear_import_existing_resources(None::<bool>);
497 /// ```
498 pub fn set_or_clear_import_existing_resources<T>(mut self, v: std::option::Option<T>) -> Self
499 where
500 T: std::convert::Into<bool>,
501 {
502 self.import_existing_resources = v.map(|x| x.into());
503 self
504 }
505
506 /// Sets the value of [worker_pool][crate::model::Deployment::worker_pool].
507 ///
508 /// # Example
509 /// ```ignore,no_run
510 /// # use google_cloud_config_v1::model::Deployment;
511 /// let x = Deployment::new().set_worker_pool("example");
512 /// ```
513 pub fn set_worker_pool<T>(mut self, v: T) -> Self
514 where
515 T: std::convert::Into<std::string::String>,
516 {
517 self.worker_pool = std::option::Option::Some(v.into());
518 self
519 }
520
521 /// Sets or clears the value of [worker_pool][crate::model::Deployment::worker_pool].
522 ///
523 /// # Example
524 /// ```ignore,no_run
525 /// # use google_cloud_config_v1::model::Deployment;
526 /// let x = Deployment::new().set_or_clear_worker_pool(Some("example"));
527 /// let x = Deployment::new().set_or_clear_worker_pool(None::<String>);
528 /// ```
529 pub fn set_or_clear_worker_pool<T>(mut self, v: std::option::Option<T>) -> Self
530 where
531 T: std::convert::Into<std::string::String>,
532 {
533 self.worker_pool = v.map(|x| x.into());
534 self
535 }
536
537 /// Sets the value of [lock_state][crate::model::Deployment::lock_state].
538 ///
539 /// # Example
540 /// ```ignore,no_run
541 /// # use google_cloud_config_v1::model::Deployment;
542 /// use google_cloud_config_v1::model::deployment::LockState;
543 /// let x0 = Deployment::new().set_lock_state(LockState::Locked);
544 /// let x1 = Deployment::new().set_lock_state(LockState::Unlocked);
545 /// let x2 = Deployment::new().set_lock_state(LockState::Locking);
546 /// ```
547 pub fn set_lock_state<T: std::convert::Into<crate::model::deployment::LockState>>(
548 mut self,
549 v: T,
550 ) -> Self {
551 self.lock_state = v.into();
552 self
553 }
554
555 /// Sets the value of [tf_version_constraint][crate::model::Deployment::tf_version_constraint].
556 ///
557 /// # Example
558 /// ```ignore,no_run
559 /// # use google_cloud_config_v1::model::Deployment;
560 /// let x = Deployment::new().set_tf_version_constraint("example");
561 /// ```
562 pub fn set_tf_version_constraint<T>(mut self, v: T) -> Self
563 where
564 T: std::convert::Into<std::string::String>,
565 {
566 self.tf_version_constraint = std::option::Option::Some(v.into());
567 self
568 }
569
570 /// Sets or clears the value of [tf_version_constraint][crate::model::Deployment::tf_version_constraint].
571 ///
572 /// # Example
573 /// ```ignore,no_run
574 /// # use google_cloud_config_v1::model::Deployment;
575 /// let x = Deployment::new().set_or_clear_tf_version_constraint(Some("example"));
576 /// let x = Deployment::new().set_or_clear_tf_version_constraint(None::<String>);
577 /// ```
578 pub fn set_or_clear_tf_version_constraint<T>(mut self, v: std::option::Option<T>) -> Self
579 where
580 T: std::convert::Into<std::string::String>,
581 {
582 self.tf_version_constraint = v.map(|x| x.into());
583 self
584 }
585
586 /// Sets the value of [tf_version][crate::model::Deployment::tf_version].
587 ///
588 /// # Example
589 /// ```ignore,no_run
590 /// # use google_cloud_config_v1::model::Deployment;
591 /// let x = Deployment::new().set_tf_version("example");
592 /// ```
593 pub fn set_tf_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
594 self.tf_version = v.into();
595 self
596 }
597
598 /// Sets the value of [quota_validation][crate::model::Deployment::quota_validation].
599 ///
600 /// # Example
601 /// ```ignore,no_run
602 /// # use google_cloud_config_v1::model::Deployment;
603 /// use google_cloud_config_v1::model::QuotaValidation;
604 /// let x0 = Deployment::new().set_quota_validation(QuotaValidation::Enabled);
605 /// let x1 = Deployment::new().set_quota_validation(QuotaValidation::Enforced);
606 /// ```
607 pub fn set_quota_validation<T: std::convert::Into<crate::model::QuotaValidation>>(
608 mut self,
609 v: T,
610 ) -> Self {
611 self.quota_validation = v.into();
612 self
613 }
614
615 /// Sets the value of [annotations][crate::model::Deployment::annotations].
616 ///
617 /// # Example
618 /// ```ignore,no_run
619 /// # use google_cloud_config_v1::model::Deployment;
620 /// let x = Deployment::new().set_annotations([
621 /// ("key0", "abc"),
622 /// ("key1", "xyz"),
623 /// ]);
624 /// ```
625 pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
626 where
627 T: std::iter::IntoIterator<Item = (K, V)>,
628 K: std::convert::Into<std::string::String>,
629 V: std::convert::Into<std::string::String>,
630 {
631 use std::iter::Iterator;
632 self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
633 self
634 }
635
636 /// Sets the value of [provider_config][crate::model::Deployment::provider_config].
637 ///
638 /// # Example
639 /// ```ignore,no_run
640 /// # use google_cloud_config_v1::model::Deployment;
641 /// use google_cloud_config_v1::model::ProviderConfig;
642 /// let x = Deployment::new().set_provider_config(ProviderConfig::default()/* use setters */);
643 /// ```
644 pub fn set_provider_config<T>(mut self, v: T) -> Self
645 where
646 T: std::convert::Into<crate::model::ProviderConfig>,
647 {
648 self.provider_config = std::option::Option::Some(v.into());
649 self
650 }
651
652 /// Sets or clears the value of [provider_config][crate::model::Deployment::provider_config].
653 ///
654 /// # Example
655 /// ```ignore,no_run
656 /// # use google_cloud_config_v1::model::Deployment;
657 /// use google_cloud_config_v1::model::ProviderConfig;
658 /// let x = Deployment::new().set_or_clear_provider_config(Some(ProviderConfig::default()/* use setters */));
659 /// let x = Deployment::new().set_or_clear_provider_config(None::<ProviderConfig>);
660 /// ```
661 pub fn set_or_clear_provider_config<T>(mut self, v: std::option::Option<T>) -> Self
662 where
663 T: std::convert::Into<crate::model::ProviderConfig>,
664 {
665 self.provider_config = v.map(|x| x.into());
666 self
667 }
668
669 /// Sets the value of [blueprint][crate::model::Deployment::blueprint].
670 ///
671 /// Note that all the setters affecting `blueprint` are mutually
672 /// exclusive.
673 ///
674 /// # Example
675 /// ```ignore,no_run
676 /// # use google_cloud_config_v1::model::Deployment;
677 /// use google_cloud_config_v1::model::TerraformBlueprint;
678 /// let x = Deployment::new().set_blueprint(Some(
679 /// google_cloud_config_v1::model::deployment::Blueprint::TerraformBlueprint(TerraformBlueprint::default().into())));
680 /// ```
681 pub fn set_blueprint<
682 T: std::convert::Into<std::option::Option<crate::model::deployment::Blueprint>>,
683 >(
684 mut self,
685 v: T,
686 ) -> Self {
687 self.blueprint = v.into();
688 self
689 }
690
691 /// The value of [blueprint][crate::model::Deployment::blueprint]
692 /// if it holds a `TerraformBlueprint`, `None` if the field is not set or
693 /// holds a different branch.
694 pub fn terraform_blueprint(
695 &self,
696 ) -> std::option::Option<&std::boxed::Box<crate::model::TerraformBlueprint>> {
697 #[allow(unreachable_patterns)]
698 self.blueprint.as_ref().and_then(|v| match v {
699 crate::model::deployment::Blueprint::TerraformBlueprint(v) => {
700 std::option::Option::Some(v)
701 }
702 _ => std::option::Option::None,
703 })
704 }
705
706 /// Sets the value of [blueprint][crate::model::Deployment::blueprint]
707 /// to hold a `TerraformBlueprint`.
708 ///
709 /// Note that all the setters affecting `blueprint` are
710 /// mutually exclusive.
711 ///
712 /// # Example
713 /// ```ignore,no_run
714 /// # use google_cloud_config_v1::model::Deployment;
715 /// use google_cloud_config_v1::model::TerraformBlueprint;
716 /// let x = Deployment::new().set_terraform_blueprint(TerraformBlueprint::default()/* use setters */);
717 /// assert!(x.terraform_blueprint().is_some());
718 /// ```
719 pub fn set_terraform_blueprint<
720 T: std::convert::Into<std::boxed::Box<crate::model::TerraformBlueprint>>,
721 >(
722 mut self,
723 v: T,
724 ) -> Self {
725 self.blueprint = std::option::Option::Some(
726 crate::model::deployment::Blueprint::TerraformBlueprint(v.into()),
727 );
728 self
729 }
730}
731
732impl wkt::message::Message for Deployment {
733 fn typename() -> &'static str {
734 "type.googleapis.com/google.cloud.config.v1.Deployment"
735 }
736}
737
738/// Defines additional types related to [Deployment].
739pub mod deployment {
740 #[allow(unused_imports)]
741 use super::*;
742
743 /// Possible states of a deployment.
744 ///
745 /// # Working with unknown values
746 ///
747 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
748 /// additional enum variants at any time. Adding new variants is not considered
749 /// a breaking change. Applications should write their code in anticipation of:
750 ///
751 /// - New values appearing in future releases of the client library, **and**
752 /// - New values received dynamically, without application changes.
753 ///
754 /// Please consult the [Working with enums] section in the user guide for some
755 /// guidelines.
756 ///
757 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
758 #[derive(Clone, Debug, PartialEq)]
759 #[non_exhaustive]
760 pub enum State {
761 /// The default value. This value is used if the state is omitted.
762 Unspecified,
763 /// The deployment is being created.
764 Creating,
765 /// The deployment is healthy.
766 Active,
767 /// The deployment is being updated.
768 Updating,
769 /// The deployment is being deleted.
770 Deleting,
771 /// The deployment has encountered an unexpected error.
772 Failed,
773 /// The deployment is no longer being actively reconciled.
774 /// This may be the result of recovering the project after deletion.
775 Suspended,
776 /// The deployment has been deleted.
777 Deleted,
778 /// If set, the enum was initialized with an unknown value.
779 ///
780 /// Applications can examine the value using [State::value] or
781 /// [State::name].
782 UnknownValue(state::UnknownValue),
783 }
784
785 #[doc(hidden)]
786 pub mod state {
787 #[allow(unused_imports)]
788 use super::*;
789 #[derive(Clone, Debug, PartialEq)]
790 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
791 }
792
793 impl State {
794 /// Gets the enum value.
795 ///
796 /// Returns `None` if the enum contains an unknown value deserialized from
797 /// the string representation of enums.
798 pub fn value(&self) -> std::option::Option<i32> {
799 match self {
800 Self::Unspecified => std::option::Option::Some(0),
801 Self::Creating => std::option::Option::Some(1),
802 Self::Active => std::option::Option::Some(2),
803 Self::Updating => std::option::Option::Some(3),
804 Self::Deleting => std::option::Option::Some(4),
805 Self::Failed => std::option::Option::Some(5),
806 Self::Suspended => std::option::Option::Some(6),
807 Self::Deleted => std::option::Option::Some(7),
808 Self::UnknownValue(u) => u.0.value(),
809 }
810 }
811
812 /// Gets the enum value as a string.
813 ///
814 /// Returns `None` if the enum contains an unknown value deserialized from
815 /// the integer representation of enums.
816 pub fn name(&self) -> std::option::Option<&str> {
817 match self {
818 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
819 Self::Creating => std::option::Option::Some("CREATING"),
820 Self::Active => std::option::Option::Some("ACTIVE"),
821 Self::Updating => std::option::Option::Some("UPDATING"),
822 Self::Deleting => std::option::Option::Some("DELETING"),
823 Self::Failed => std::option::Option::Some("FAILED"),
824 Self::Suspended => std::option::Option::Some("SUSPENDED"),
825 Self::Deleted => std::option::Option::Some("DELETED"),
826 Self::UnknownValue(u) => u.0.name(),
827 }
828 }
829 }
830
831 impl std::default::Default for State {
832 fn default() -> Self {
833 use std::convert::From;
834 Self::from(0)
835 }
836 }
837
838 impl std::fmt::Display for State {
839 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
840 wkt::internal::display_enum(f, self.name(), self.value())
841 }
842 }
843
844 impl std::convert::From<i32> for State {
845 fn from(value: i32) -> Self {
846 match value {
847 0 => Self::Unspecified,
848 1 => Self::Creating,
849 2 => Self::Active,
850 3 => Self::Updating,
851 4 => Self::Deleting,
852 5 => Self::Failed,
853 6 => Self::Suspended,
854 7 => Self::Deleted,
855 _ => Self::UnknownValue(state::UnknownValue(
856 wkt::internal::UnknownEnumValue::Integer(value),
857 )),
858 }
859 }
860 }
861
862 impl std::convert::From<&str> for State {
863 fn from(value: &str) -> Self {
864 use std::string::ToString;
865 match value {
866 "STATE_UNSPECIFIED" => Self::Unspecified,
867 "CREATING" => Self::Creating,
868 "ACTIVE" => Self::Active,
869 "UPDATING" => Self::Updating,
870 "DELETING" => Self::Deleting,
871 "FAILED" => Self::Failed,
872 "SUSPENDED" => Self::Suspended,
873 "DELETED" => Self::Deleted,
874 _ => Self::UnknownValue(state::UnknownValue(
875 wkt::internal::UnknownEnumValue::String(value.to_string()),
876 )),
877 }
878 }
879 }
880
881 impl serde::ser::Serialize for State {
882 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
883 where
884 S: serde::Serializer,
885 {
886 match self {
887 Self::Unspecified => serializer.serialize_i32(0),
888 Self::Creating => serializer.serialize_i32(1),
889 Self::Active => serializer.serialize_i32(2),
890 Self::Updating => serializer.serialize_i32(3),
891 Self::Deleting => serializer.serialize_i32(4),
892 Self::Failed => serializer.serialize_i32(5),
893 Self::Suspended => serializer.serialize_i32(6),
894 Self::Deleted => serializer.serialize_i32(7),
895 Self::UnknownValue(u) => u.0.serialize(serializer),
896 }
897 }
898 }
899
900 impl<'de> serde::de::Deserialize<'de> for State {
901 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
902 where
903 D: serde::Deserializer<'de>,
904 {
905 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
906 ".google.cloud.config.v1.Deployment.State",
907 ))
908 }
909 }
910
911 /// Possible errors that can occur with deployments.
912 ///
913 /// # Working with unknown values
914 ///
915 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
916 /// additional enum variants at any time. Adding new variants is not considered
917 /// a breaking change. Applications should write their code in anticipation of:
918 ///
919 /// - New values appearing in future releases of the client library, **and**
920 /// - New values received dynamically, without application changes.
921 ///
922 /// Please consult the [Working with enums] section in the user guide for some
923 /// guidelines.
924 ///
925 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
926 #[derive(Clone, Debug, PartialEq)]
927 #[non_exhaustive]
928 pub enum ErrorCode {
929 /// No error code was specified.
930 Unspecified,
931 /// The revision failed. See Revision for more details.
932 RevisionFailed,
933 /// Cloud Build failed due to a permission issue.
934 CloudBuildPermissionDenied,
935 /// Cloud Build job associated with a deployment deletion could not be
936 /// started.
937 DeleteBuildApiFailed,
938 /// Cloud Build job associated with a deployment deletion was started but
939 /// failed.
940 DeleteBuildRunFailed,
941 /// Cloud Storage bucket creation failed due to a permission issue.
942 BucketCreationPermissionDenied,
943 /// Cloud Storage bucket creation failed due to an issue unrelated to
944 /// permissions.
945 BucketCreationFailed,
946 /// Failed to import values from an external source.
947 ExternalValueSourceImportFailed,
948 /// If set, the enum was initialized with an unknown value.
949 ///
950 /// Applications can examine the value using [ErrorCode::value] or
951 /// [ErrorCode::name].
952 UnknownValue(error_code::UnknownValue),
953 }
954
955 #[doc(hidden)]
956 pub mod error_code {
957 #[allow(unused_imports)]
958 use super::*;
959 #[derive(Clone, Debug, PartialEq)]
960 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
961 }
962
963 impl ErrorCode {
964 /// Gets the enum value.
965 ///
966 /// Returns `None` if the enum contains an unknown value deserialized from
967 /// the string representation of enums.
968 pub fn value(&self) -> std::option::Option<i32> {
969 match self {
970 Self::Unspecified => std::option::Option::Some(0),
971 Self::RevisionFailed => std::option::Option::Some(1),
972 Self::CloudBuildPermissionDenied => std::option::Option::Some(3),
973 Self::DeleteBuildApiFailed => std::option::Option::Some(5),
974 Self::DeleteBuildRunFailed => std::option::Option::Some(6),
975 Self::BucketCreationPermissionDenied => std::option::Option::Some(7),
976 Self::BucketCreationFailed => std::option::Option::Some(8),
977 Self::ExternalValueSourceImportFailed => std::option::Option::Some(10),
978 Self::UnknownValue(u) => u.0.value(),
979 }
980 }
981
982 /// Gets the enum value as a string.
983 ///
984 /// Returns `None` if the enum contains an unknown value deserialized from
985 /// the integer representation of enums.
986 pub fn name(&self) -> std::option::Option<&str> {
987 match self {
988 Self::Unspecified => std::option::Option::Some("ERROR_CODE_UNSPECIFIED"),
989 Self::RevisionFailed => std::option::Option::Some("REVISION_FAILED"),
990 Self::CloudBuildPermissionDenied => {
991 std::option::Option::Some("CLOUD_BUILD_PERMISSION_DENIED")
992 }
993 Self::DeleteBuildApiFailed => std::option::Option::Some("DELETE_BUILD_API_FAILED"),
994 Self::DeleteBuildRunFailed => std::option::Option::Some("DELETE_BUILD_RUN_FAILED"),
995 Self::BucketCreationPermissionDenied => {
996 std::option::Option::Some("BUCKET_CREATION_PERMISSION_DENIED")
997 }
998 Self::BucketCreationFailed => std::option::Option::Some("BUCKET_CREATION_FAILED"),
999 Self::ExternalValueSourceImportFailed => {
1000 std::option::Option::Some("EXTERNAL_VALUE_SOURCE_IMPORT_FAILED")
1001 }
1002 Self::UnknownValue(u) => u.0.name(),
1003 }
1004 }
1005 }
1006
1007 impl std::default::Default for ErrorCode {
1008 fn default() -> Self {
1009 use std::convert::From;
1010 Self::from(0)
1011 }
1012 }
1013
1014 impl std::fmt::Display for ErrorCode {
1015 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1016 wkt::internal::display_enum(f, self.name(), self.value())
1017 }
1018 }
1019
1020 impl std::convert::From<i32> for ErrorCode {
1021 fn from(value: i32) -> Self {
1022 match value {
1023 0 => Self::Unspecified,
1024 1 => Self::RevisionFailed,
1025 3 => Self::CloudBuildPermissionDenied,
1026 5 => Self::DeleteBuildApiFailed,
1027 6 => Self::DeleteBuildRunFailed,
1028 7 => Self::BucketCreationPermissionDenied,
1029 8 => Self::BucketCreationFailed,
1030 10 => Self::ExternalValueSourceImportFailed,
1031 _ => Self::UnknownValue(error_code::UnknownValue(
1032 wkt::internal::UnknownEnumValue::Integer(value),
1033 )),
1034 }
1035 }
1036 }
1037
1038 impl std::convert::From<&str> for ErrorCode {
1039 fn from(value: &str) -> Self {
1040 use std::string::ToString;
1041 match value {
1042 "ERROR_CODE_UNSPECIFIED" => Self::Unspecified,
1043 "REVISION_FAILED" => Self::RevisionFailed,
1044 "CLOUD_BUILD_PERMISSION_DENIED" => Self::CloudBuildPermissionDenied,
1045 "DELETE_BUILD_API_FAILED" => Self::DeleteBuildApiFailed,
1046 "DELETE_BUILD_RUN_FAILED" => Self::DeleteBuildRunFailed,
1047 "BUCKET_CREATION_PERMISSION_DENIED" => Self::BucketCreationPermissionDenied,
1048 "BUCKET_CREATION_FAILED" => Self::BucketCreationFailed,
1049 "EXTERNAL_VALUE_SOURCE_IMPORT_FAILED" => Self::ExternalValueSourceImportFailed,
1050 _ => Self::UnknownValue(error_code::UnknownValue(
1051 wkt::internal::UnknownEnumValue::String(value.to_string()),
1052 )),
1053 }
1054 }
1055 }
1056
1057 impl serde::ser::Serialize for ErrorCode {
1058 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1059 where
1060 S: serde::Serializer,
1061 {
1062 match self {
1063 Self::Unspecified => serializer.serialize_i32(0),
1064 Self::RevisionFailed => serializer.serialize_i32(1),
1065 Self::CloudBuildPermissionDenied => serializer.serialize_i32(3),
1066 Self::DeleteBuildApiFailed => serializer.serialize_i32(5),
1067 Self::DeleteBuildRunFailed => serializer.serialize_i32(6),
1068 Self::BucketCreationPermissionDenied => serializer.serialize_i32(7),
1069 Self::BucketCreationFailed => serializer.serialize_i32(8),
1070 Self::ExternalValueSourceImportFailed => serializer.serialize_i32(10),
1071 Self::UnknownValue(u) => u.0.serialize(serializer),
1072 }
1073 }
1074 }
1075
1076 impl<'de> serde::de::Deserialize<'de> for ErrorCode {
1077 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1078 where
1079 D: serde::Deserializer<'de>,
1080 {
1081 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ErrorCode>::new(
1082 ".google.cloud.config.v1.Deployment.ErrorCode",
1083 ))
1084 }
1085 }
1086
1087 /// Possible lock states of a deployment.
1088 ///
1089 /// # Working with unknown values
1090 ///
1091 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1092 /// additional enum variants at any time. Adding new variants is not considered
1093 /// a breaking change. Applications should write their code in anticipation of:
1094 ///
1095 /// - New values appearing in future releases of the client library, **and**
1096 /// - New values received dynamically, without application changes.
1097 ///
1098 /// Please consult the [Working with enums] section in the user guide for some
1099 /// guidelines.
1100 ///
1101 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
1102 #[derive(Clone, Debug, PartialEq)]
1103 #[non_exhaustive]
1104 pub enum LockState {
1105 /// The default value. This value is used if the lock state is omitted.
1106 Unspecified,
1107 /// The deployment is locked.
1108 Locked,
1109 /// The deployment is unlocked.
1110 Unlocked,
1111 /// The deployment is being locked.
1112 Locking,
1113 /// The deployment is being unlocked.
1114 Unlocking,
1115 /// The deployment has failed to lock.
1116 LockFailed,
1117 /// The deployment has failed to unlock.
1118 UnlockFailed,
1119 /// If set, the enum was initialized with an unknown value.
1120 ///
1121 /// Applications can examine the value using [LockState::value] or
1122 /// [LockState::name].
1123 UnknownValue(lock_state::UnknownValue),
1124 }
1125
1126 #[doc(hidden)]
1127 pub mod lock_state {
1128 #[allow(unused_imports)]
1129 use super::*;
1130 #[derive(Clone, Debug, PartialEq)]
1131 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1132 }
1133
1134 impl LockState {
1135 /// Gets the enum value.
1136 ///
1137 /// Returns `None` if the enum contains an unknown value deserialized from
1138 /// the string representation of enums.
1139 pub fn value(&self) -> std::option::Option<i32> {
1140 match self {
1141 Self::Unspecified => std::option::Option::Some(0),
1142 Self::Locked => std::option::Option::Some(1),
1143 Self::Unlocked => std::option::Option::Some(2),
1144 Self::Locking => std::option::Option::Some(3),
1145 Self::Unlocking => std::option::Option::Some(4),
1146 Self::LockFailed => std::option::Option::Some(5),
1147 Self::UnlockFailed => std::option::Option::Some(6),
1148 Self::UnknownValue(u) => u.0.value(),
1149 }
1150 }
1151
1152 /// Gets the enum value as a string.
1153 ///
1154 /// Returns `None` if the enum contains an unknown value deserialized from
1155 /// the integer representation of enums.
1156 pub fn name(&self) -> std::option::Option<&str> {
1157 match self {
1158 Self::Unspecified => std::option::Option::Some("LOCK_STATE_UNSPECIFIED"),
1159 Self::Locked => std::option::Option::Some("LOCKED"),
1160 Self::Unlocked => std::option::Option::Some("UNLOCKED"),
1161 Self::Locking => std::option::Option::Some("LOCKING"),
1162 Self::Unlocking => std::option::Option::Some("UNLOCKING"),
1163 Self::LockFailed => std::option::Option::Some("LOCK_FAILED"),
1164 Self::UnlockFailed => std::option::Option::Some("UNLOCK_FAILED"),
1165 Self::UnknownValue(u) => u.0.name(),
1166 }
1167 }
1168 }
1169
1170 impl std::default::Default for LockState {
1171 fn default() -> Self {
1172 use std::convert::From;
1173 Self::from(0)
1174 }
1175 }
1176
1177 impl std::fmt::Display for LockState {
1178 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1179 wkt::internal::display_enum(f, self.name(), self.value())
1180 }
1181 }
1182
1183 impl std::convert::From<i32> for LockState {
1184 fn from(value: i32) -> Self {
1185 match value {
1186 0 => Self::Unspecified,
1187 1 => Self::Locked,
1188 2 => Self::Unlocked,
1189 3 => Self::Locking,
1190 4 => Self::Unlocking,
1191 5 => Self::LockFailed,
1192 6 => Self::UnlockFailed,
1193 _ => Self::UnknownValue(lock_state::UnknownValue(
1194 wkt::internal::UnknownEnumValue::Integer(value),
1195 )),
1196 }
1197 }
1198 }
1199
1200 impl std::convert::From<&str> for LockState {
1201 fn from(value: &str) -> Self {
1202 use std::string::ToString;
1203 match value {
1204 "LOCK_STATE_UNSPECIFIED" => Self::Unspecified,
1205 "LOCKED" => Self::Locked,
1206 "UNLOCKED" => Self::Unlocked,
1207 "LOCKING" => Self::Locking,
1208 "UNLOCKING" => Self::Unlocking,
1209 "LOCK_FAILED" => Self::LockFailed,
1210 "UNLOCK_FAILED" => Self::UnlockFailed,
1211 _ => Self::UnknownValue(lock_state::UnknownValue(
1212 wkt::internal::UnknownEnumValue::String(value.to_string()),
1213 )),
1214 }
1215 }
1216 }
1217
1218 impl serde::ser::Serialize for LockState {
1219 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1220 where
1221 S: serde::Serializer,
1222 {
1223 match self {
1224 Self::Unspecified => serializer.serialize_i32(0),
1225 Self::Locked => serializer.serialize_i32(1),
1226 Self::Unlocked => serializer.serialize_i32(2),
1227 Self::Locking => serializer.serialize_i32(3),
1228 Self::Unlocking => serializer.serialize_i32(4),
1229 Self::LockFailed => serializer.serialize_i32(5),
1230 Self::UnlockFailed => serializer.serialize_i32(6),
1231 Self::UnknownValue(u) => u.0.serialize(serializer),
1232 }
1233 }
1234 }
1235
1236 impl<'de> serde::de::Deserialize<'de> for LockState {
1237 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1238 where
1239 D: serde::Deserializer<'de>,
1240 {
1241 deserializer.deserialize_any(wkt::internal::EnumVisitor::<LockState>::new(
1242 ".google.cloud.config.v1.Deployment.LockState",
1243 ))
1244 }
1245 }
1246
1247 /// Blueprint to deploy.
1248 #[derive(Clone, Debug, PartialEq)]
1249 #[non_exhaustive]
1250 pub enum Blueprint {
1251 /// A blueprint described using Terraform's HashiCorp Configuration Language
1252 /// as a root module.
1253 TerraformBlueprint(std::boxed::Box<crate::model::TerraformBlueprint>),
1254 }
1255}
1256
1257/// TerraformBlueprint describes the source of a Terraform root module which
1258/// describes the resources and configs to be deployed.
1259#[derive(Clone, Default, PartialEq)]
1260#[non_exhaustive]
1261pub struct TerraformBlueprint {
1262 /// Optional. Input variable values for the Terraform blueprint.
1263 pub input_values:
1264 std::collections::HashMap<std::string::String, crate::model::TerraformVariable>,
1265
1266 /// Location of the source configs.
1267 /// Required.
1268 pub source: std::option::Option<crate::model::terraform_blueprint::Source>,
1269
1270 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1271}
1272
1273impl TerraformBlueprint {
1274 pub fn new() -> Self {
1275 std::default::Default::default()
1276 }
1277
1278 /// Sets the value of [input_values][crate::model::TerraformBlueprint::input_values].
1279 ///
1280 /// # Example
1281 /// ```ignore,no_run
1282 /// # use google_cloud_config_v1::model::TerraformBlueprint;
1283 /// use google_cloud_config_v1::model::TerraformVariable;
1284 /// let x = TerraformBlueprint::new().set_input_values([
1285 /// ("key0", TerraformVariable::default()/* use setters */),
1286 /// ("key1", TerraformVariable::default()/* use (different) setters */),
1287 /// ]);
1288 /// ```
1289 pub fn set_input_values<T, K, V>(mut self, v: T) -> Self
1290 where
1291 T: std::iter::IntoIterator<Item = (K, V)>,
1292 K: std::convert::Into<std::string::String>,
1293 V: std::convert::Into<crate::model::TerraformVariable>,
1294 {
1295 use std::iter::Iterator;
1296 self.input_values = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1297 self
1298 }
1299
1300 /// Sets the value of [source][crate::model::TerraformBlueprint::source].
1301 ///
1302 /// Note that all the setters affecting `source` are mutually
1303 /// exclusive.
1304 ///
1305 /// # Example
1306 /// ```ignore,no_run
1307 /// # use google_cloud_config_v1::model::TerraformBlueprint;
1308 /// use google_cloud_config_v1::model::terraform_blueprint::Source;
1309 /// let x = TerraformBlueprint::new().set_source(Some(Source::GcsSource("example".to_string())));
1310 /// ```
1311 pub fn set_source<
1312 T: std::convert::Into<std::option::Option<crate::model::terraform_blueprint::Source>>,
1313 >(
1314 mut self,
1315 v: T,
1316 ) -> Self {
1317 self.source = v.into();
1318 self
1319 }
1320
1321 /// The value of [source][crate::model::TerraformBlueprint::source]
1322 /// if it holds a `GcsSource`, `None` if the field is not set or
1323 /// holds a different branch.
1324 pub fn gcs_source(&self) -> std::option::Option<&std::string::String> {
1325 #[allow(unreachable_patterns)]
1326 self.source.as_ref().and_then(|v| match v {
1327 crate::model::terraform_blueprint::Source::GcsSource(v) => std::option::Option::Some(v),
1328 _ => std::option::Option::None,
1329 })
1330 }
1331
1332 /// Sets the value of [source][crate::model::TerraformBlueprint::source]
1333 /// to hold a `GcsSource`.
1334 ///
1335 /// Note that all the setters affecting `source` are
1336 /// mutually exclusive.
1337 ///
1338 /// # Example
1339 /// ```ignore,no_run
1340 /// # use google_cloud_config_v1::model::TerraformBlueprint;
1341 /// let x = TerraformBlueprint::new().set_gcs_source("example");
1342 /// assert!(x.gcs_source().is_some());
1343 /// assert!(x.git_source().is_none());
1344 /// ```
1345 pub fn set_gcs_source<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1346 self.source = std::option::Option::Some(
1347 crate::model::terraform_blueprint::Source::GcsSource(v.into()),
1348 );
1349 self
1350 }
1351
1352 /// The value of [source][crate::model::TerraformBlueprint::source]
1353 /// if it holds a `GitSource`, `None` if the field is not set or
1354 /// holds a different branch.
1355 pub fn git_source(&self) -> std::option::Option<&std::boxed::Box<crate::model::GitSource>> {
1356 #[allow(unreachable_patterns)]
1357 self.source.as_ref().and_then(|v| match v {
1358 crate::model::terraform_blueprint::Source::GitSource(v) => std::option::Option::Some(v),
1359 _ => std::option::Option::None,
1360 })
1361 }
1362
1363 /// Sets the value of [source][crate::model::TerraformBlueprint::source]
1364 /// to hold a `GitSource`.
1365 ///
1366 /// Note that all the setters affecting `source` are
1367 /// mutually exclusive.
1368 ///
1369 /// # Example
1370 /// ```ignore,no_run
1371 /// # use google_cloud_config_v1::model::TerraformBlueprint;
1372 /// use google_cloud_config_v1::model::GitSource;
1373 /// let x = TerraformBlueprint::new().set_git_source(GitSource::default()/* use setters */);
1374 /// assert!(x.git_source().is_some());
1375 /// assert!(x.gcs_source().is_none());
1376 /// ```
1377 pub fn set_git_source<T: std::convert::Into<std::boxed::Box<crate::model::GitSource>>>(
1378 mut self,
1379 v: T,
1380 ) -> Self {
1381 self.source = std::option::Option::Some(
1382 crate::model::terraform_blueprint::Source::GitSource(v.into()),
1383 );
1384 self
1385 }
1386}
1387
1388impl wkt::message::Message for TerraformBlueprint {
1389 fn typename() -> &'static str {
1390 "type.googleapis.com/google.cloud.config.v1.TerraformBlueprint"
1391 }
1392}
1393
1394/// Defines additional types related to [TerraformBlueprint].
1395pub mod terraform_blueprint {
1396 #[allow(unused_imports)]
1397 use super::*;
1398
1399 /// Location of the source configs.
1400 /// Required.
1401 #[derive(Clone, Debug, PartialEq)]
1402 #[non_exhaustive]
1403 pub enum Source {
1404 /// URI of an object in Google Cloud Storage.
1405 /// Format: `gs://{bucket}/{object}`
1406 ///
1407 /// URI may also specify an object version for zipped objects.
1408 /// Format: `gs://{bucket}/{object}#{version}`
1409 GcsSource(std::string::String),
1410 /// URI of a public Git repo.
1411 GitSource(std::boxed::Box<crate::model::GitSource>),
1412 }
1413}
1414
1415/// A Terraform input variable.
1416#[derive(Clone, Default, PartialEq)]
1417#[non_exhaustive]
1418pub struct TerraformVariable {
1419 /// Optional. Input variable value.
1420 pub input_value: std::option::Option<wkt::Value>,
1421
1422 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1423}
1424
1425impl TerraformVariable {
1426 pub fn new() -> Self {
1427 std::default::Default::default()
1428 }
1429
1430 /// Sets the value of [input_value][crate::model::TerraformVariable::input_value].
1431 ///
1432 /// # Example
1433 /// ```ignore,no_run
1434 /// # use google_cloud_config_v1::model::TerraformVariable;
1435 /// use wkt::Value;
1436 /// let x = TerraformVariable::new().set_input_value(Value::default()/* use setters */);
1437 /// ```
1438 pub fn set_input_value<T>(mut self, v: T) -> Self
1439 where
1440 T: std::convert::Into<wkt::Value>,
1441 {
1442 self.input_value = std::option::Option::Some(v.into());
1443 self
1444 }
1445
1446 /// Sets or clears the value of [input_value][crate::model::TerraformVariable::input_value].
1447 ///
1448 /// # Example
1449 /// ```ignore,no_run
1450 /// # use google_cloud_config_v1::model::TerraformVariable;
1451 /// use wkt::Value;
1452 /// let x = TerraformVariable::new().set_or_clear_input_value(Some(Value::default()/* use setters */));
1453 /// let x = TerraformVariable::new().set_or_clear_input_value(None::<Value>);
1454 /// ```
1455 pub fn set_or_clear_input_value<T>(mut self, v: std::option::Option<T>) -> Self
1456 where
1457 T: std::convert::Into<wkt::Value>,
1458 {
1459 self.input_value = v.map(|x| x.into());
1460 self
1461 }
1462}
1463
1464impl wkt::message::Message for TerraformVariable {
1465 fn typename() -> &'static str {
1466 "type.googleapis.com/google.cloud.config.v1.TerraformVariable"
1467 }
1468}
1469
1470/// Outputs and artifacts from applying a deployment.
1471#[derive(Clone, Default, PartialEq)]
1472#[non_exhaustive]
1473pub struct ApplyResults {
1474 /// Location of a blueprint copy and other manifests in Google Cloud Storage.
1475 /// Format: `gs://{bucket}/{object}`
1476 pub content: std::string::String,
1477
1478 /// Location of artifacts (e.g. logs) in Google Cloud Storage.
1479 /// Format: `gs://{bucket}/{object}`
1480 pub artifacts: std::string::String,
1481
1482 /// Map of output name to output info.
1483 pub outputs: std::collections::HashMap<std::string::String, crate::model::TerraformOutput>,
1484
1485 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1486}
1487
1488impl ApplyResults {
1489 pub fn new() -> Self {
1490 std::default::Default::default()
1491 }
1492
1493 /// Sets the value of [content][crate::model::ApplyResults::content].
1494 ///
1495 /// # Example
1496 /// ```ignore,no_run
1497 /// # use google_cloud_config_v1::model::ApplyResults;
1498 /// let x = ApplyResults::new().set_content("example");
1499 /// ```
1500 pub fn set_content<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1501 self.content = v.into();
1502 self
1503 }
1504
1505 /// Sets the value of [artifacts][crate::model::ApplyResults::artifacts].
1506 ///
1507 /// # Example
1508 /// ```ignore,no_run
1509 /// # use google_cloud_config_v1::model::ApplyResults;
1510 /// let x = ApplyResults::new().set_artifacts("example");
1511 /// ```
1512 pub fn set_artifacts<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1513 self.artifacts = v.into();
1514 self
1515 }
1516
1517 /// Sets the value of [outputs][crate::model::ApplyResults::outputs].
1518 ///
1519 /// # Example
1520 /// ```ignore,no_run
1521 /// # use google_cloud_config_v1::model::ApplyResults;
1522 /// use google_cloud_config_v1::model::TerraformOutput;
1523 /// let x = ApplyResults::new().set_outputs([
1524 /// ("key0", TerraformOutput::default()/* use setters */),
1525 /// ("key1", TerraformOutput::default()/* use (different) setters */),
1526 /// ]);
1527 /// ```
1528 pub fn set_outputs<T, K, V>(mut self, v: T) -> Self
1529 where
1530 T: std::iter::IntoIterator<Item = (K, V)>,
1531 K: std::convert::Into<std::string::String>,
1532 V: std::convert::Into<crate::model::TerraformOutput>,
1533 {
1534 use std::iter::Iterator;
1535 self.outputs = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1536 self
1537 }
1538}
1539
1540impl wkt::message::Message for ApplyResults {
1541 fn typename() -> &'static str {
1542 "type.googleapis.com/google.cloud.config.v1.ApplyResults"
1543 }
1544}
1545
1546/// Describes a Terraform output.
1547#[derive(Clone, Default, PartialEq)]
1548#[non_exhaustive]
1549pub struct TerraformOutput {
1550 /// Identifies whether Terraform has set this output as a potential
1551 /// sensitive value.
1552 pub sensitive: bool,
1553
1554 /// Value of output.
1555 pub value: std::option::Option<wkt::Value>,
1556
1557 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1558}
1559
1560impl TerraformOutput {
1561 pub fn new() -> Self {
1562 std::default::Default::default()
1563 }
1564
1565 /// Sets the value of [sensitive][crate::model::TerraformOutput::sensitive].
1566 ///
1567 /// # Example
1568 /// ```ignore,no_run
1569 /// # use google_cloud_config_v1::model::TerraformOutput;
1570 /// let x = TerraformOutput::new().set_sensitive(true);
1571 /// ```
1572 pub fn set_sensitive<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1573 self.sensitive = v.into();
1574 self
1575 }
1576
1577 /// Sets the value of [value][crate::model::TerraformOutput::value].
1578 ///
1579 /// # Example
1580 /// ```ignore,no_run
1581 /// # use google_cloud_config_v1::model::TerraformOutput;
1582 /// use wkt::Value;
1583 /// let x = TerraformOutput::new().set_value(Value::default()/* use setters */);
1584 /// ```
1585 pub fn set_value<T>(mut self, v: T) -> Self
1586 where
1587 T: std::convert::Into<wkt::Value>,
1588 {
1589 self.value = std::option::Option::Some(v.into());
1590 self
1591 }
1592
1593 /// Sets or clears the value of [value][crate::model::TerraformOutput::value].
1594 ///
1595 /// # Example
1596 /// ```ignore,no_run
1597 /// # use google_cloud_config_v1::model::TerraformOutput;
1598 /// use wkt::Value;
1599 /// let x = TerraformOutput::new().set_or_clear_value(Some(Value::default()/* use setters */));
1600 /// let x = TerraformOutput::new().set_or_clear_value(None::<Value>);
1601 /// ```
1602 pub fn set_or_clear_value<T>(mut self, v: std::option::Option<T>) -> Self
1603 where
1604 T: std::convert::Into<wkt::Value>,
1605 {
1606 self.value = v.map(|x| x.into());
1607 self
1608 }
1609}
1610
1611impl wkt::message::Message for TerraformOutput {
1612 fn typename() -> &'static str {
1613 "type.googleapis.com/google.cloud.config.v1.TerraformOutput"
1614 }
1615}
1616
1617#[derive(Clone, Default, PartialEq)]
1618#[non_exhaustive]
1619pub struct ListDeploymentsRequest {
1620 /// Required. The parent in whose context the Deployments are listed. The
1621 /// parent value is in the format:
1622 /// 'projects/{project_id}/locations/{location}'.
1623 pub parent: std::string::String,
1624
1625 /// When requesting a page of resources, 'page_size' specifies number of
1626 /// resources to return. If unspecified, at most 500 will be returned. The
1627 /// maximum value is 1000.
1628 pub page_size: i32,
1629
1630 /// Token returned by previous call to 'ListDeployments' which specifies the
1631 /// position in the list from where to continue listing the resources.
1632 pub page_token: std::string::String,
1633
1634 /// Lists the Deployments that match the filter expression. A filter
1635 /// expression filters the resources listed in the response. The expression
1636 /// must be of the form '{field} {operator} {value}' where operators: '<', '>',
1637 /// '<=', '>=', '!=', '=', ':' are supported (colon ':' represents a HAS
1638 /// operator which is roughly synonymous with equality). {field} can refer to a
1639 /// proto or JSON field, or a synthetic field. Field names can be camelCase or
1640 /// snake_case.
1641 ///
1642 /// Examples:
1643 ///
1644 /// - Filter by name:
1645 /// name = "projects/foo/locations/us-central1/deployments/bar
1646 ///
1647 /// - Filter by labels:
1648 ///
1649 /// - Resources that have a key called 'foo'
1650 /// labels.foo:*
1651 /// - Resources that have a key called 'foo' whose value is 'bar'
1652 /// labels.foo = bar
1653 /// - Filter by state:
1654 ///
1655 /// - Deployments in CREATING state.
1656 /// state=CREATING
1657 pub filter: std::string::String,
1658
1659 /// Field to use to sort the list.
1660 pub order_by: std::string::String,
1661
1662 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1663}
1664
1665impl ListDeploymentsRequest {
1666 pub fn new() -> Self {
1667 std::default::Default::default()
1668 }
1669
1670 /// Sets the value of [parent][crate::model::ListDeploymentsRequest::parent].
1671 ///
1672 /// # Example
1673 /// ```ignore,no_run
1674 /// # use google_cloud_config_v1::model::ListDeploymentsRequest;
1675 /// let x = ListDeploymentsRequest::new().set_parent("example");
1676 /// ```
1677 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1678 self.parent = v.into();
1679 self
1680 }
1681
1682 /// Sets the value of [page_size][crate::model::ListDeploymentsRequest::page_size].
1683 ///
1684 /// # Example
1685 /// ```ignore,no_run
1686 /// # use google_cloud_config_v1::model::ListDeploymentsRequest;
1687 /// let x = ListDeploymentsRequest::new().set_page_size(42);
1688 /// ```
1689 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1690 self.page_size = v.into();
1691 self
1692 }
1693
1694 /// Sets the value of [page_token][crate::model::ListDeploymentsRequest::page_token].
1695 ///
1696 /// # Example
1697 /// ```ignore,no_run
1698 /// # use google_cloud_config_v1::model::ListDeploymentsRequest;
1699 /// let x = ListDeploymentsRequest::new().set_page_token("example");
1700 /// ```
1701 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1702 self.page_token = v.into();
1703 self
1704 }
1705
1706 /// Sets the value of [filter][crate::model::ListDeploymentsRequest::filter].
1707 ///
1708 /// # Example
1709 /// ```ignore,no_run
1710 /// # use google_cloud_config_v1::model::ListDeploymentsRequest;
1711 /// let x = ListDeploymentsRequest::new().set_filter("example");
1712 /// ```
1713 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1714 self.filter = v.into();
1715 self
1716 }
1717
1718 /// Sets the value of [order_by][crate::model::ListDeploymentsRequest::order_by].
1719 ///
1720 /// # Example
1721 /// ```ignore,no_run
1722 /// # use google_cloud_config_v1::model::ListDeploymentsRequest;
1723 /// let x = ListDeploymentsRequest::new().set_order_by("example");
1724 /// ```
1725 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1726 self.order_by = v.into();
1727 self
1728 }
1729}
1730
1731impl wkt::message::Message for ListDeploymentsRequest {
1732 fn typename() -> &'static str {
1733 "type.googleapis.com/google.cloud.config.v1.ListDeploymentsRequest"
1734 }
1735}
1736
1737#[derive(Clone, Default, PartialEq)]
1738#[non_exhaustive]
1739pub struct ListDeploymentsResponse {
1740 /// List of [Deployment][google.cloud.config.v1.Deployment]s.
1741 ///
1742 /// [google.cloud.config.v1.Deployment]: crate::model::Deployment
1743 pub deployments: std::vec::Vec<crate::model::Deployment>,
1744
1745 /// Token to be supplied to the next ListDeployments request via `page_token`
1746 /// to obtain the next set of results.
1747 pub next_page_token: std::string::String,
1748
1749 /// Locations that could not be reached.
1750 pub unreachable: std::vec::Vec<std::string::String>,
1751
1752 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1753}
1754
1755impl ListDeploymentsResponse {
1756 pub fn new() -> Self {
1757 std::default::Default::default()
1758 }
1759
1760 /// Sets the value of [deployments][crate::model::ListDeploymentsResponse::deployments].
1761 ///
1762 /// # Example
1763 /// ```ignore,no_run
1764 /// # use google_cloud_config_v1::model::ListDeploymentsResponse;
1765 /// use google_cloud_config_v1::model::Deployment;
1766 /// let x = ListDeploymentsResponse::new()
1767 /// .set_deployments([
1768 /// Deployment::default()/* use setters */,
1769 /// Deployment::default()/* use (different) setters */,
1770 /// ]);
1771 /// ```
1772 pub fn set_deployments<T, V>(mut self, v: T) -> Self
1773 where
1774 T: std::iter::IntoIterator<Item = V>,
1775 V: std::convert::Into<crate::model::Deployment>,
1776 {
1777 use std::iter::Iterator;
1778 self.deployments = v.into_iter().map(|i| i.into()).collect();
1779 self
1780 }
1781
1782 /// Sets the value of [next_page_token][crate::model::ListDeploymentsResponse::next_page_token].
1783 ///
1784 /// # Example
1785 /// ```ignore,no_run
1786 /// # use google_cloud_config_v1::model::ListDeploymentsResponse;
1787 /// let x = ListDeploymentsResponse::new().set_next_page_token("example");
1788 /// ```
1789 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1790 self.next_page_token = v.into();
1791 self
1792 }
1793
1794 /// Sets the value of [unreachable][crate::model::ListDeploymentsResponse::unreachable].
1795 ///
1796 /// # Example
1797 /// ```ignore,no_run
1798 /// # use google_cloud_config_v1::model::ListDeploymentsResponse;
1799 /// let x = ListDeploymentsResponse::new().set_unreachable(["a", "b", "c"]);
1800 /// ```
1801 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
1802 where
1803 T: std::iter::IntoIterator<Item = V>,
1804 V: std::convert::Into<std::string::String>,
1805 {
1806 use std::iter::Iterator;
1807 self.unreachable = v.into_iter().map(|i| i.into()).collect();
1808 self
1809 }
1810}
1811
1812impl wkt::message::Message for ListDeploymentsResponse {
1813 fn typename() -> &'static str {
1814 "type.googleapis.com/google.cloud.config.v1.ListDeploymentsResponse"
1815 }
1816}
1817
1818#[doc(hidden)]
1819impl gax::paginator::internal::PageableResponse for ListDeploymentsResponse {
1820 type PageItem = crate::model::Deployment;
1821
1822 fn items(self) -> std::vec::Vec<Self::PageItem> {
1823 self.deployments
1824 }
1825
1826 fn next_page_token(&self) -> std::string::String {
1827 use std::clone::Clone;
1828 self.next_page_token.clone()
1829 }
1830}
1831
1832#[derive(Clone, Default, PartialEq)]
1833#[non_exhaustive]
1834pub struct GetDeploymentRequest {
1835 /// Required. The name of the deployment. Format:
1836 /// 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
1837 pub name: std::string::String,
1838
1839 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1840}
1841
1842impl GetDeploymentRequest {
1843 pub fn new() -> Self {
1844 std::default::Default::default()
1845 }
1846
1847 /// Sets the value of [name][crate::model::GetDeploymentRequest::name].
1848 ///
1849 /// # Example
1850 /// ```ignore,no_run
1851 /// # use google_cloud_config_v1::model::GetDeploymentRequest;
1852 /// let x = GetDeploymentRequest::new().set_name("example");
1853 /// ```
1854 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1855 self.name = v.into();
1856 self
1857 }
1858}
1859
1860impl wkt::message::Message for GetDeploymentRequest {
1861 fn typename() -> &'static str {
1862 "type.googleapis.com/google.cloud.config.v1.GetDeploymentRequest"
1863 }
1864}
1865
1866/// A request to list Revisions passed to a 'ListRevisions' call.
1867#[derive(Clone, Default, PartialEq)]
1868#[non_exhaustive]
1869pub struct ListRevisionsRequest {
1870 /// Required. The parent in whose context the Revisions are listed. The parent
1871 /// value is in the format:
1872 /// 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
1873 pub parent: std::string::String,
1874
1875 /// When requesting a page of resources, `page_size` specifies number of
1876 /// resources to return. If unspecified, at most 500 will be returned. The
1877 /// maximum value is 1000.
1878 pub page_size: i32,
1879
1880 /// Token returned by previous call to 'ListRevisions' which specifies the
1881 /// position in the list from where to continue listing the resources.
1882 pub page_token: std::string::String,
1883
1884 /// Lists the Revisions that match the filter expression. A filter
1885 /// expression filters the resources listed in the response. The expression
1886 /// must be of the form '{field} {operator} {value}' where operators: '<', '>',
1887 /// '<=', '>=', '!=', '=', ':' are supported (colon ':' represents a HAS
1888 /// operator which is roughly synonymous with equality). {field} can refer to a
1889 /// proto or JSON field, or a synthetic field. Field names can be camelCase or
1890 /// snake_case.
1891 ///
1892 /// Examples:
1893 ///
1894 /// - Filter by name:
1895 /// name = "projects/foo/locations/us-central1/deployments/dep/revisions/bar
1896 ///
1897 /// - Filter by labels:
1898 ///
1899 /// - Resources that have a key called 'foo'
1900 /// labels.foo:*
1901 /// - Resources that have a key called 'foo' whose value is 'bar'
1902 /// labels.foo = bar
1903 /// - Filter by state:
1904 ///
1905 /// - Revisions in CREATING state.
1906 /// state=CREATING
1907 pub filter: std::string::String,
1908
1909 /// Field to use to sort the list.
1910 pub order_by: std::string::String,
1911
1912 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1913}
1914
1915impl ListRevisionsRequest {
1916 pub fn new() -> Self {
1917 std::default::Default::default()
1918 }
1919
1920 /// Sets the value of [parent][crate::model::ListRevisionsRequest::parent].
1921 ///
1922 /// # Example
1923 /// ```ignore,no_run
1924 /// # use google_cloud_config_v1::model::ListRevisionsRequest;
1925 /// let x = ListRevisionsRequest::new().set_parent("example");
1926 /// ```
1927 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1928 self.parent = v.into();
1929 self
1930 }
1931
1932 /// Sets the value of [page_size][crate::model::ListRevisionsRequest::page_size].
1933 ///
1934 /// # Example
1935 /// ```ignore,no_run
1936 /// # use google_cloud_config_v1::model::ListRevisionsRequest;
1937 /// let x = ListRevisionsRequest::new().set_page_size(42);
1938 /// ```
1939 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1940 self.page_size = v.into();
1941 self
1942 }
1943
1944 /// Sets the value of [page_token][crate::model::ListRevisionsRequest::page_token].
1945 ///
1946 /// # Example
1947 /// ```ignore,no_run
1948 /// # use google_cloud_config_v1::model::ListRevisionsRequest;
1949 /// let x = ListRevisionsRequest::new().set_page_token("example");
1950 /// ```
1951 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1952 self.page_token = v.into();
1953 self
1954 }
1955
1956 /// Sets the value of [filter][crate::model::ListRevisionsRequest::filter].
1957 ///
1958 /// # Example
1959 /// ```ignore,no_run
1960 /// # use google_cloud_config_v1::model::ListRevisionsRequest;
1961 /// let x = ListRevisionsRequest::new().set_filter("example");
1962 /// ```
1963 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1964 self.filter = v.into();
1965 self
1966 }
1967
1968 /// Sets the value of [order_by][crate::model::ListRevisionsRequest::order_by].
1969 ///
1970 /// # Example
1971 /// ```ignore,no_run
1972 /// # use google_cloud_config_v1::model::ListRevisionsRequest;
1973 /// let x = ListRevisionsRequest::new().set_order_by("example");
1974 /// ```
1975 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1976 self.order_by = v.into();
1977 self
1978 }
1979}
1980
1981impl wkt::message::Message for ListRevisionsRequest {
1982 fn typename() -> &'static str {
1983 "type.googleapis.com/google.cloud.config.v1.ListRevisionsRequest"
1984 }
1985}
1986
1987/// A response to a 'ListRevisions' call. Contains a list of Revisions.
1988#[derive(Clone, Default, PartialEq)]
1989#[non_exhaustive]
1990pub struct ListRevisionsResponse {
1991 /// List of [Revision][google.cloud.config.v1.Revision]s.
1992 ///
1993 /// [google.cloud.config.v1.Revision]: crate::model::Revision
1994 pub revisions: std::vec::Vec<crate::model::Revision>,
1995
1996 /// A token to request the next page of resources from the 'ListRevisions'
1997 /// method. The value of an empty string means that there are no more resources
1998 /// to return.
1999 pub next_page_token: std::string::String,
2000
2001 /// Locations that could not be reached.
2002 pub unreachable: std::vec::Vec<std::string::String>,
2003
2004 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2005}
2006
2007impl ListRevisionsResponse {
2008 pub fn new() -> Self {
2009 std::default::Default::default()
2010 }
2011
2012 /// Sets the value of [revisions][crate::model::ListRevisionsResponse::revisions].
2013 ///
2014 /// # Example
2015 /// ```ignore,no_run
2016 /// # use google_cloud_config_v1::model::ListRevisionsResponse;
2017 /// use google_cloud_config_v1::model::Revision;
2018 /// let x = ListRevisionsResponse::new()
2019 /// .set_revisions([
2020 /// Revision::default()/* use setters */,
2021 /// Revision::default()/* use (different) setters */,
2022 /// ]);
2023 /// ```
2024 pub fn set_revisions<T, V>(mut self, v: T) -> Self
2025 where
2026 T: std::iter::IntoIterator<Item = V>,
2027 V: std::convert::Into<crate::model::Revision>,
2028 {
2029 use std::iter::Iterator;
2030 self.revisions = v.into_iter().map(|i| i.into()).collect();
2031 self
2032 }
2033
2034 /// Sets the value of [next_page_token][crate::model::ListRevisionsResponse::next_page_token].
2035 ///
2036 /// # Example
2037 /// ```ignore,no_run
2038 /// # use google_cloud_config_v1::model::ListRevisionsResponse;
2039 /// let x = ListRevisionsResponse::new().set_next_page_token("example");
2040 /// ```
2041 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2042 self.next_page_token = v.into();
2043 self
2044 }
2045
2046 /// Sets the value of [unreachable][crate::model::ListRevisionsResponse::unreachable].
2047 ///
2048 /// # Example
2049 /// ```ignore,no_run
2050 /// # use google_cloud_config_v1::model::ListRevisionsResponse;
2051 /// let x = ListRevisionsResponse::new().set_unreachable(["a", "b", "c"]);
2052 /// ```
2053 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
2054 where
2055 T: std::iter::IntoIterator<Item = V>,
2056 V: std::convert::Into<std::string::String>,
2057 {
2058 use std::iter::Iterator;
2059 self.unreachable = v.into_iter().map(|i| i.into()).collect();
2060 self
2061 }
2062}
2063
2064impl wkt::message::Message for ListRevisionsResponse {
2065 fn typename() -> &'static str {
2066 "type.googleapis.com/google.cloud.config.v1.ListRevisionsResponse"
2067 }
2068}
2069
2070#[doc(hidden)]
2071impl gax::paginator::internal::PageableResponse for ListRevisionsResponse {
2072 type PageItem = crate::model::Revision;
2073
2074 fn items(self) -> std::vec::Vec<Self::PageItem> {
2075 self.revisions
2076 }
2077
2078 fn next_page_token(&self) -> std::string::String {
2079 use std::clone::Clone;
2080 self.next_page_token.clone()
2081 }
2082}
2083
2084/// A request to get a Revision from a 'GetRevision' call.
2085#[derive(Clone, Default, PartialEq)]
2086#[non_exhaustive]
2087pub struct GetRevisionRequest {
2088 /// Required. The name of the Revision in the format:
2089 /// 'projects/{project_id}/locations/{location}/deployments/{deployment}/revisions/{revision}'.
2090 pub name: std::string::String,
2091
2092 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2093}
2094
2095impl GetRevisionRequest {
2096 pub fn new() -> Self {
2097 std::default::Default::default()
2098 }
2099
2100 /// Sets the value of [name][crate::model::GetRevisionRequest::name].
2101 ///
2102 /// # Example
2103 /// ```ignore,no_run
2104 /// # use google_cloud_config_v1::model::GetRevisionRequest;
2105 /// let x = GetRevisionRequest::new().set_name("example");
2106 /// ```
2107 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2108 self.name = v.into();
2109 self
2110 }
2111}
2112
2113impl wkt::message::Message for GetRevisionRequest {
2114 fn typename() -> &'static str {
2115 "type.googleapis.com/google.cloud.config.v1.GetRevisionRequest"
2116 }
2117}
2118
2119#[derive(Clone, Default, PartialEq)]
2120#[non_exhaustive]
2121pub struct CreateDeploymentRequest {
2122 /// Required. The parent in whose context the Deployment is created. The parent
2123 /// value is in the format: 'projects/{project_id}/locations/{location}'.
2124 pub parent: std::string::String,
2125
2126 /// Required. The Deployment ID.
2127 pub deployment_id: std::string::String,
2128
2129 /// Required. [Deployment][google.cloud.config.v1.Deployment] resource to be
2130 /// created.
2131 ///
2132 /// [google.cloud.config.v1.Deployment]: crate::model::Deployment
2133 pub deployment: std::option::Option<crate::model::Deployment>,
2134
2135 /// Optional. An optional request ID to identify requests. Specify a unique
2136 /// request ID so that if you must retry your request, the server will know to
2137 /// ignore the request if it has already been completed. The server will
2138 /// guarantee that for at least 60 minutes since the first request.
2139 ///
2140 /// For example, consider a situation where you make an initial request and the
2141 /// request times out. If you make the request again with the same request ID,
2142 /// the server can check if original operation with the same request ID was
2143 /// received, and if so, will ignore the second request. This prevents clients
2144 /// from accidentally creating duplicate commitments.
2145 ///
2146 /// The request ID must be a valid UUID with the exception that zero UUID is
2147 /// not supported (00000000-0000-0000-0000-000000000000).
2148 pub request_id: std::string::String,
2149
2150 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2151}
2152
2153impl CreateDeploymentRequest {
2154 pub fn new() -> Self {
2155 std::default::Default::default()
2156 }
2157
2158 /// Sets the value of [parent][crate::model::CreateDeploymentRequest::parent].
2159 ///
2160 /// # Example
2161 /// ```ignore,no_run
2162 /// # use google_cloud_config_v1::model::CreateDeploymentRequest;
2163 /// let x = CreateDeploymentRequest::new().set_parent("example");
2164 /// ```
2165 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2166 self.parent = v.into();
2167 self
2168 }
2169
2170 /// Sets the value of [deployment_id][crate::model::CreateDeploymentRequest::deployment_id].
2171 ///
2172 /// # Example
2173 /// ```ignore,no_run
2174 /// # use google_cloud_config_v1::model::CreateDeploymentRequest;
2175 /// let x = CreateDeploymentRequest::new().set_deployment_id("example");
2176 /// ```
2177 pub fn set_deployment_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2178 self.deployment_id = v.into();
2179 self
2180 }
2181
2182 /// Sets the value of [deployment][crate::model::CreateDeploymentRequest::deployment].
2183 ///
2184 /// # Example
2185 /// ```ignore,no_run
2186 /// # use google_cloud_config_v1::model::CreateDeploymentRequest;
2187 /// use google_cloud_config_v1::model::Deployment;
2188 /// let x = CreateDeploymentRequest::new().set_deployment(Deployment::default()/* use setters */);
2189 /// ```
2190 pub fn set_deployment<T>(mut self, v: T) -> Self
2191 where
2192 T: std::convert::Into<crate::model::Deployment>,
2193 {
2194 self.deployment = std::option::Option::Some(v.into());
2195 self
2196 }
2197
2198 /// Sets or clears the value of [deployment][crate::model::CreateDeploymentRequest::deployment].
2199 ///
2200 /// # Example
2201 /// ```ignore,no_run
2202 /// # use google_cloud_config_v1::model::CreateDeploymentRequest;
2203 /// use google_cloud_config_v1::model::Deployment;
2204 /// let x = CreateDeploymentRequest::new().set_or_clear_deployment(Some(Deployment::default()/* use setters */));
2205 /// let x = CreateDeploymentRequest::new().set_or_clear_deployment(None::<Deployment>);
2206 /// ```
2207 pub fn set_or_clear_deployment<T>(mut self, v: std::option::Option<T>) -> Self
2208 where
2209 T: std::convert::Into<crate::model::Deployment>,
2210 {
2211 self.deployment = v.map(|x| x.into());
2212 self
2213 }
2214
2215 /// Sets the value of [request_id][crate::model::CreateDeploymentRequest::request_id].
2216 ///
2217 /// # Example
2218 /// ```ignore,no_run
2219 /// # use google_cloud_config_v1::model::CreateDeploymentRequest;
2220 /// let x = CreateDeploymentRequest::new().set_request_id("example");
2221 /// ```
2222 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2223 self.request_id = v.into();
2224 self
2225 }
2226}
2227
2228impl wkt::message::Message for CreateDeploymentRequest {
2229 fn typename() -> &'static str {
2230 "type.googleapis.com/google.cloud.config.v1.CreateDeploymentRequest"
2231 }
2232}
2233
2234#[derive(Clone, Default, PartialEq)]
2235#[non_exhaustive]
2236pub struct UpdateDeploymentRequest {
2237 /// Optional. Field mask used to specify the fields to be overwritten in the
2238 /// Deployment resource by the update.
2239 ///
2240 /// The fields specified in the update_mask are relative to the resource, not
2241 /// the full request. A field will be overwritten if it is in the mask. If the
2242 /// user does not provide a mask then all fields will be overwritten.
2243 pub update_mask: std::option::Option<wkt::FieldMask>,
2244
2245 /// Required. [Deployment][google.cloud.config.v1.Deployment] to update.
2246 ///
2247 /// The deployment's `name` field is used to identify the resource to be
2248 /// updated. Format:
2249 /// `projects/{project}/locations/{location}/deployments/{deployment}`
2250 ///
2251 /// [google.cloud.config.v1.Deployment]: crate::model::Deployment
2252 pub deployment: std::option::Option<crate::model::Deployment>,
2253
2254 /// Optional. An optional request ID to identify requests. Specify a unique
2255 /// request ID so that if you must retry your request, the server will know to
2256 /// ignore the request if it has already been completed. The server will
2257 /// guarantee that for at least 60 minutes since the first request.
2258 ///
2259 /// For example, consider a situation where you make an initial request and the
2260 /// request times out. If you make the request again with the same request ID,
2261 /// the server can check if original operation with the same request ID was
2262 /// received, and if so, will ignore the second request. This prevents clients
2263 /// from accidentally creating duplicate commitments.
2264 ///
2265 /// The request ID must be a valid UUID with the exception that zero UUID is
2266 /// not supported (00000000-0000-0000-0000-000000000000).
2267 pub request_id: std::string::String,
2268
2269 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2270}
2271
2272impl UpdateDeploymentRequest {
2273 pub fn new() -> Self {
2274 std::default::Default::default()
2275 }
2276
2277 /// Sets the value of [update_mask][crate::model::UpdateDeploymentRequest::update_mask].
2278 ///
2279 /// # Example
2280 /// ```ignore,no_run
2281 /// # use google_cloud_config_v1::model::UpdateDeploymentRequest;
2282 /// use wkt::FieldMask;
2283 /// let x = UpdateDeploymentRequest::new().set_update_mask(FieldMask::default()/* use setters */);
2284 /// ```
2285 pub fn set_update_mask<T>(mut self, v: T) -> Self
2286 where
2287 T: std::convert::Into<wkt::FieldMask>,
2288 {
2289 self.update_mask = std::option::Option::Some(v.into());
2290 self
2291 }
2292
2293 /// Sets or clears the value of [update_mask][crate::model::UpdateDeploymentRequest::update_mask].
2294 ///
2295 /// # Example
2296 /// ```ignore,no_run
2297 /// # use google_cloud_config_v1::model::UpdateDeploymentRequest;
2298 /// use wkt::FieldMask;
2299 /// let x = UpdateDeploymentRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
2300 /// let x = UpdateDeploymentRequest::new().set_or_clear_update_mask(None::<FieldMask>);
2301 /// ```
2302 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2303 where
2304 T: std::convert::Into<wkt::FieldMask>,
2305 {
2306 self.update_mask = v.map(|x| x.into());
2307 self
2308 }
2309
2310 /// Sets the value of [deployment][crate::model::UpdateDeploymentRequest::deployment].
2311 ///
2312 /// # Example
2313 /// ```ignore,no_run
2314 /// # use google_cloud_config_v1::model::UpdateDeploymentRequest;
2315 /// use google_cloud_config_v1::model::Deployment;
2316 /// let x = UpdateDeploymentRequest::new().set_deployment(Deployment::default()/* use setters */);
2317 /// ```
2318 pub fn set_deployment<T>(mut self, v: T) -> Self
2319 where
2320 T: std::convert::Into<crate::model::Deployment>,
2321 {
2322 self.deployment = std::option::Option::Some(v.into());
2323 self
2324 }
2325
2326 /// Sets or clears the value of [deployment][crate::model::UpdateDeploymentRequest::deployment].
2327 ///
2328 /// # Example
2329 /// ```ignore,no_run
2330 /// # use google_cloud_config_v1::model::UpdateDeploymentRequest;
2331 /// use google_cloud_config_v1::model::Deployment;
2332 /// let x = UpdateDeploymentRequest::new().set_or_clear_deployment(Some(Deployment::default()/* use setters */));
2333 /// let x = UpdateDeploymentRequest::new().set_or_clear_deployment(None::<Deployment>);
2334 /// ```
2335 pub fn set_or_clear_deployment<T>(mut self, v: std::option::Option<T>) -> Self
2336 where
2337 T: std::convert::Into<crate::model::Deployment>,
2338 {
2339 self.deployment = v.map(|x| x.into());
2340 self
2341 }
2342
2343 /// Sets the value of [request_id][crate::model::UpdateDeploymentRequest::request_id].
2344 ///
2345 /// # Example
2346 /// ```ignore,no_run
2347 /// # use google_cloud_config_v1::model::UpdateDeploymentRequest;
2348 /// let x = UpdateDeploymentRequest::new().set_request_id("example");
2349 /// ```
2350 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2351 self.request_id = v.into();
2352 self
2353 }
2354}
2355
2356impl wkt::message::Message for UpdateDeploymentRequest {
2357 fn typename() -> &'static str {
2358 "type.googleapis.com/google.cloud.config.v1.UpdateDeploymentRequest"
2359 }
2360}
2361
2362#[derive(Clone, Default, PartialEq)]
2363#[non_exhaustive]
2364pub struct DeleteDeploymentRequest {
2365 /// Required. The name of the Deployment in the format:
2366 /// 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
2367 pub name: std::string::String,
2368
2369 /// Optional. An optional request ID to identify requests. Specify a unique
2370 /// request ID so that if you must retry your request, the server will know to
2371 /// ignore the request if it has already been completed. The server will
2372 /// guarantee that for at least 60 minutes after the first request.
2373 ///
2374 /// For example, consider a situation where you make an initial request and the
2375 /// request times out. If you make the request again with the same request ID,
2376 /// the server can check if original operation with the same request ID was
2377 /// received, and if so, will ignore the second request. This prevents clients
2378 /// from accidentally creating duplicate commitments.
2379 ///
2380 /// The request ID must be a valid UUID with the exception that zero UUID is
2381 /// not supported (00000000-0000-0000-0000-000000000000).
2382 pub request_id: std::string::String,
2383
2384 /// Optional. If set to true, any revisions for this deployment will also be
2385 /// deleted. (Otherwise, the request will only work if the deployment has no
2386 /// revisions.)
2387 pub force: bool,
2388
2389 /// Optional. Policy on how resources actuated by the deployment should be
2390 /// deleted. If unspecified, the default behavior is to delete the underlying
2391 /// resources.
2392 pub delete_policy: crate::model::delete_deployment_request::DeletePolicy,
2393
2394 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2395}
2396
2397impl DeleteDeploymentRequest {
2398 pub fn new() -> Self {
2399 std::default::Default::default()
2400 }
2401
2402 /// Sets the value of [name][crate::model::DeleteDeploymentRequest::name].
2403 ///
2404 /// # Example
2405 /// ```ignore,no_run
2406 /// # use google_cloud_config_v1::model::DeleteDeploymentRequest;
2407 /// let x = DeleteDeploymentRequest::new().set_name("example");
2408 /// ```
2409 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2410 self.name = v.into();
2411 self
2412 }
2413
2414 /// Sets the value of [request_id][crate::model::DeleteDeploymentRequest::request_id].
2415 ///
2416 /// # Example
2417 /// ```ignore,no_run
2418 /// # use google_cloud_config_v1::model::DeleteDeploymentRequest;
2419 /// let x = DeleteDeploymentRequest::new().set_request_id("example");
2420 /// ```
2421 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2422 self.request_id = v.into();
2423 self
2424 }
2425
2426 /// Sets the value of [force][crate::model::DeleteDeploymentRequest::force].
2427 ///
2428 /// # Example
2429 /// ```ignore,no_run
2430 /// # use google_cloud_config_v1::model::DeleteDeploymentRequest;
2431 /// let x = DeleteDeploymentRequest::new().set_force(true);
2432 /// ```
2433 pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2434 self.force = v.into();
2435 self
2436 }
2437
2438 /// Sets the value of [delete_policy][crate::model::DeleteDeploymentRequest::delete_policy].
2439 ///
2440 /// # Example
2441 /// ```ignore,no_run
2442 /// # use google_cloud_config_v1::model::DeleteDeploymentRequest;
2443 /// use google_cloud_config_v1::model::delete_deployment_request::DeletePolicy;
2444 /// let x0 = DeleteDeploymentRequest::new().set_delete_policy(DeletePolicy::Delete);
2445 /// let x1 = DeleteDeploymentRequest::new().set_delete_policy(DeletePolicy::Abandon);
2446 /// ```
2447 pub fn set_delete_policy<
2448 T: std::convert::Into<crate::model::delete_deployment_request::DeletePolicy>,
2449 >(
2450 mut self,
2451 v: T,
2452 ) -> Self {
2453 self.delete_policy = v.into();
2454 self
2455 }
2456}
2457
2458impl wkt::message::Message for DeleteDeploymentRequest {
2459 fn typename() -> &'static str {
2460 "type.googleapis.com/google.cloud.config.v1.DeleteDeploymentRequest"
2461 }
2462}
2463
2464/// Defines additional types related to [DeleteDeploymentRequest].
2465pub mod delete_deployment_request {
2466 #[allow(unused_imports)]
2467 use super::*;
2468
2469 /// Policy on how resources actuated by the deployment should be deleted.
2470 ///
2471 /// # Working with unknown values
2472 ///
2473 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2474 /// additional enum variants at any time. Adding new variants is not considered
2475 /// a breaking change. Applications should write their code in anticipation of:
2476 ///
2477 /// - New values appearing in future releases of the client library, **and**
2478 /// - New values received dynamically, without application changes.
2479 ///
2480 /// Please consult the [Working with enums] section in the user guide for some
2481 /// guidelines.
2482 ///
2483 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
2484 #[derive(Clone, Debug, PartialEq)]
2485 #[non_exhaustive]
2486 pub enum DeletePolicy {
2487 /// Unspecified policy, resources will be deleted.
2488 Unspecified,
2489 /// Deletes resources actuated by the deployment.
2490 Delete,
2491 /// Abandons resources and only deletes the deployment and its metadata.
2492 Abandon,
2493 /// If set, the enum was initialized with an unknown value.
2494 ///
2495 /// Applications can examine the value using [DeletePolicy::value] or
2496 /// [DeletePolicy::name].
2497 UnknownValue(delete_policy::UnknownValue),
2498 }
2499
2500 #[doc(hidden)]
2501 pub mod delete_policy {
2502 #[allow(unused_imports)]
2503 use super::*;
2504 #[derive(Clone, Debug, PartialEq)]
2505 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2506 }
2507
2508 impl DeletePolicy {
2509 /// Gets the enum value.
2510 ///
2511 /// Returns `None` if the enum contains an unknown value deserialized from
2512 /// the string representation of enums.
2513 pub fn value(&self) -> std::option::Option<i32> {
2514 match self {
2515 Self::Unspecified => std::option::Option::Some(0),
2516 Self::Delete => std::option::Option::Some(1),
2517 Self::Abandon => std::option::Option::Some(2),
2518 Self::UnknownValue(u) => u.0.value(),
2519 }
2520 }
2521
2522 /// Gets the enum value as a string.
2523 ///
2524 /// Returns `None` if the enum contains an unknown value deserialized from
2525 /// the integer representation of enums.
2526 pub fn name(&self) -> std::option::Option<&str> {
2527 match self {
2528 Self::Unspecified => std::option::Option::Some("DELETE_POLICY_UNSPECIFIED"),
2529 Self::Delete => std::option::Option::Some("DELETE"),
2530 Self::Abandon => std::option::Option::Some("ABANDON"),
2531 Self::UnknownValue(u) => u.0.name(),
2532 }
2533 }
2534 }
2535
2536 impl std::default::Default for DeletePolicy {
2537 fn default() -> Self {
2538 use std::convert::From;
2539 Self::from(0)
2540 }
2541 }
2542
2543 impl std::fmt::Display for DeletePolicy {
2544 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2545 wkt::internal::display_enum(f, self.name(), self.value())
2546 }
2547 }
2548
2549 impl std::convert::From<i32> for DeletePolicy {
2550 fn from(value: i32) -> Self {
2551 match value {
2552 0 => Self::Unspecified,
2553 1 => Self::Delete,
2554 2 => Self::Abandon,
2555 _ => Self::UnknownValue(delete_policy::UnknownValue(
2556 wkt::internal::UnknownEnumValue::Integer(value),
2557 )),
2558 }
2559 }
2560 }
2561
2562 impl std::convert::From<&str> for DeletePolicy {
2563 fn from(value: &str) -> Self {
2564 use std::string::ToString;
2565 match value {
2566 "DELETE_POLICY_UNSPECIFIED" => Self::Unspecified,
2567 "DELETE" => Self::Delete,
2568 "ABANDON" => Self::Abandon,
2569 _ => Self::UnknownValue(delete_policy::UnknownValue(
2570 wkt::internal::UnknownEnumValue::String(value.to_string()),
2571 )),
2572 }
2573 }
2574 }
2575
2576 impl serde::ser::Serialize for DeletePolicy {
2577 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2578 where
2579 S: serde::Serializer,
2580 {
2581 match self {
2582 Self::Unspecified => serializer.serialize_i32(0),
2583 Self::Delete => serializer.serialize_i32(1),
2584 Self::Abandon => serializer.serialize_i32(2),
2585 Self::UnknownValue(u) => u.0.serialize(serializer),
2586 }
2587 }
2588 }
2589
2590 impl<'de> serde::de::Deserialize<'de> for DeletePolicy {
2591 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2592 where
2593 D: serde::Deserializer<'de>,
2594 {
2595 deserializer.deserialize_any(wkt::internal::EnumVisitor::<DeletePolicy>::new(
2596 ".google.cloud.config.v1.DeleteDeploymentRequest.DeletePolicy",
2597 ))
2598 }
2599 }
2600}
2601
2602/// Represents the metadata of the long-running operation.
2603#[derive(Clone, Default, PartialEq)]
2604#[non_exhaustive]
2605pub struct OperationMetadata {
2606 /// Output only. Time when the operation was created.
2607 pub create_time: std::option::Option<wkt::Timestamp>,
2608
2609 /// Output only. Time when the operation finished running.
2610 pub end_time: std::option::Option<wkt::Timestamp>,
2611
2612 /// Output only. Server-defined resource path for the target of the operation.
2613 pub target: std::string::String,
2614
2615 /// Output only. Name of the verb executed by the operation.
2616 pub verb: std::string::String,
2617
2618 /// Output only. Human-readable status of the operation, if any.
2619 pub status_message: std::string::String,
2620
2621 /// Output only. Identifies whether the user has requested cancellation of the
2622 /// operation. Operations that have successfully been cancelled have
2623 /// [google.longrunning.Operation.error][google.longrunning.Operation.error]
2624 /// value with a [google.rpc.Status.code][google.rpc.Status.code] of `1`,
2625 /// corresponding to `Code.CANCELLED`.
2626 ///
2627 /// [google.longrunning.Operation.error]: longrunning::model::Operation::result
2628 /// [google.rpc.Status.code]: rpc::model::Status::code
2629 pub requested_cancellation: bool,
2630
2631 /// Output only. API version used to start the operation.
2632 pub api_version: std::string::String,
2633
2634 /// Ephemeral metadata about the state of an operation for a particular
2635 /// resource.
2636 pub resource_metadata: std::option::Option<crate::model::operation_metadata::ResourceMetadata>,
2637
2638 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2639}
2640
2641impl OperationMetadata {
2642 pub fn new() -> Self {
2643 std::default::Default::default()
2644 }
2645
2646 /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
2647 ///
2648 /// # Example
2649 /// ```ignore,no_run
2650 /// # use google_cloud_config_v1::model::OperationMetadata;
2651 /// use wkt::Timestamp;
2652 /// let x = OperationMetadata::new().set_create_time(Timestamp::default()/* use setters */);
2653 /// ```
2654 pub fn set_create_time<T>(mut self, v: T) -> Self
2655 where
2656 T: std::convert::Into<wkt::Timestamp>,
2657 {
2658 self.create_time = std::option::Option::Some(v.into());
2659 self
2660 }
2661
2662 /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
2663 ///
2664 /// # Example
2665 /// ```ignore,no_run
2666 /// # use google_cloud_config_v1::model::OperationMetadata;
2667 /// use wkt::Timestamp;
2668 /// let x = OperationMetadata::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
2669 /// let x = OperationMetadata::new().set_or_clear_create_time(None::<Timestamp>);
2670 /// ```
2671 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
2672 where
2673 T: std::convert::Into<wkt::Timestamp>,
2674 {
2675 self.create_time = v.map(|x| x.into());
2676 self
2677 }
2678
2679 /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
2680 ///
2681 /// # Example
2682 /// ```ignore,no_run
2683 /// # use google_cloud_config_v1::model::OperationMetadata;
2684 /// use wkt::Timestamp;
2685 /// let x = OperationMetadata::new().set_end_time(Timestamp::default()/* use setters */);
2686 /// ```
2687 pub fn set_end_time<T>(mut self, v: T) -> Self
2688 where
2689 T: std::convert::Into<wkt::Timestamp>,
2690 {
2691 self.end_time = std::option::Option::Some(v.into());
2692 self
2693 }
2694
2695 /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
2696 ///
2697 /// # Example
2698 /// ```ignore,no_run
2699 /// # use google_cloud_config_v1::model::OperationMetadata;
2700 /// use wkt::Timestamp;
2701 /// let x = OperationMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
2702 /// let x = OperationMetadata::new().set_or_clear_end_time(None::<Timestamp>);
2703 /// ```
2704 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
2705 where
2706 T: std::convert::Into<wkt::Timestamp>,
2707 {
2708 self.end_time = v.map(|x| x.into());
2709 self
2710 }
2711
2712 /// Sets the value of [target][crate::model::OperationMetadata::target].
2713 ///
2714 /// # Example
2715 /// ```ignore,no_run
2716 /// # use google_cloud_config_v1::model::OperationMetadata;
2717 /// let x = OperationMetadata::new().set_target("example");
2718 /// ```
2719 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2720 self.target = v.into();
2721 self
2722 }
2723
2724 /// Sets the value of [verb][crate::model::OperationMetadata::verb].
2725 ///
2726 /// # Example
2727 /// ```ignore,no_run
2728 /// # use google_cloud_config_v1::model::OperationMetadata;
2729 /// let x = OperationMetadata::new().set_verb("example");
2730 /// ```
2731 pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2732 self.verb = v.into();
2733 self
2734 }
2735
2736 /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
2737 ///
2738 /// # Example
2739 /// ```ignore,no_run
2740 /// # use google_cloud_config_v1::model::OperationMetadata;
2741 /// let x = OperationMetadata::new().set_status_message("example");
2742 /// ```
2743 pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2744 self.status_message = v.into();
2745 self
2746 }
2747
2748 /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
2749 ///
2750 /// # Example
2751 /// ```ignore,no_run
2752 /// # use google_cloud_config_v1::model::OperationMetadata;
2753 /// let x = OperationMetadata::new().set_requested_cancellation(true);
2754 /// ```
2755 pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2756 self.requested_cancellation = v.into();
2757 self
2758 }
2759
2760 /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
2761 ///
2762 /// # Example
2763 /// ```ignore,no_run
2764 /// # use google_cloud_config_v1::model::OperationMetadata;
2765 /// let x = OperationMetadata::new().set_api_version("example");
2766 /// ```
2767 pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2768 self.api_version = v.into();
2769 self
2770 }
2771
2772 /// Sets the value of [resource_metadata][crate::model::OperationMetadata::resource_metadata].
2773 ///
2774 /// Note that all the setters affecting `resource_metadata` are mutually
2775 /// exclusive.
2776 ///
2777 /// # Example
2778 /// ```ignore,no_run
2779 /// # use google_cloud_config_v1::model::OperationMetadata;
2780 /// use google_cloud_config_v1::model::DeploymentOperationMetadata;
2781 /// let x = OperationMetadata::new().set_resource_metadata(Some(
2782 /// google_cloud_config_v1::model::operation_metadata::ResourceMetadata::DeploymentMetadata(DeploymentOperationMetadata::default().into())));
2783 /// ```
2784 pub fn set_resource_metadata<
2785 T: std::convert::Into<std::option::Option<crate::model::operation_metadata::ResourceMetadata>>,
2786 >(
2787 mut self,
2788 v: T,
2789 ) -> Self {
2790 self.resource_metadata = v.into();
2791 self
2792 }
2793
2794 /// The value of [resource_metadata][crate::model::OperationMetadata::resource_metadata]
2795 /// if it holds a `DeploymentMetadata`, `None` if the field is not set or
2796 /// holds a different branch.
2797 pub fn deployment_metadata(
2798 &self,
2799 ) -> std::option::Option<&std::boxed::Box<crate::model::DeploymentOperationMetadata>> {
2800 #[allow(unreachable_patterns)]
2801 self.resource_metadata.as_ref().and_then(|v| match v {
2802 crate::model::operation_metadata::ResourceMetadata::DeploymentMetadata(v) => {
2803 std::option::Option::Some(v)
2804 }
2805 _ => std::option::Option::None,
2806 })
2807 }
2808
2809 /// Sets the value of [resource_metadata][crate::model::OperationMetadata::resource_metadata]
2810 /// to hold a `DeploymentMetadata`.
2811 ///
2812 /// Note that all the setters affecting `resource_metadata` are
2813 /// mutually exclusive.
2814 ///
2815 /// # Example
2816 /// ```ignore,no_run
2817 /// # use google_cloud_config_v1::model::OperationMetadata;
2818 /// use google_cloud_config_v1::model::DeploymentOperationMetadata;
2819 /// let x = OperationMetadata::new().set_deployment_metadata(DeploymentOperationMetadata::default()/* use setters */);
2820 /// assert!(x.deployment_metadata().is_some());
2821 /// assert!(x.preview_metadata().is_none());
2822 /// ```
2823 pub fn set_deployment_metadata<
2824 T: std::convert::Into<std::boxed::Box<crate::model::DeploymentOperationMetadata>>,
2825 >(
2826 mut self,
2827 v: T,
2828 ) -> Self {
2829 self.resource_metadata = std::option::Option::Some(
2830 crate::model::operation_metadata::ResourceMetadata::DeploymentMetadata(v.into()),
2831 );
2832 self
2833 }
2834
2835 /// The value of [resource_metadata][crate::model::OperationMetadata::resource_metadata]
2836 /// if it holds a `PreviewMetadata`, `None` if the field is not set or
2837 /// holds a different branch.
2838 pub fn preview_metadata(
2839 &self,
2840 ) -> std::option::Option<&std::boxed::Box<crate::model::PreviewOperationMetadata>> {
2841 #[allow(unreachable_patterns)]
2842 self.resource_metadata.as_ref().and_then(|v| match v {
2843 crate::model::operation_metadata::ResourceMetadata::PreviewMetadata(v) => {
2844 std::option::Option::Some(v)
2845 }
2846 _ => std::option::Option::None,
2847 })
2848 }
2849
2850 /// Sets the value of [resource_metadata][crate::model::OperationMetadata::resource_metadata]
2851 /// to hold a `PreviewMetadata`.
2852 ///
2853 /// Note that all the setters affecting `resource_metadata` are
2854 /// mutually exclusive.
2855 ///
2856 /// # Example
2857 /// ```ignore,no_run
2858 /// # use google_cloud_config_v1::model::OperationMetadata;
2859 /// use google_cloud_config_v1::model::PreviewOperationMetadata;
2860 /// let x = OperationMetadata::new().set_preview_metadata(PreviewOperationMetadata::default()/* use setters */);
2861 /// assert!(x.preview_metadata().is_some());
2862 /// assert!(x.deployment_metadata().is_none());
2863 /// ```
2864 pub fn set_preview_metadata<
2865 T: std::convert::Into<std::boxed::Box<crate::model::PreviewOperationMetadata>>,
2866 >(
2867 mut self,
2868 v: T,
2869 ) -> Self {
2870 self.resource_metadata = std::option::Option::Some(
2871 crate::model::operation_metadata::ResourceMetadata::PreviewMetadata(v.into()),
2872 );
2873 self
2874 }
2875}
2876
2877impl wkt::message::Message for OperationMetadata {
2878 fn typename() -> &'static str {
2879 "type.googleapis.com/google.cloud.config.v1.OperationMetadata"
2880 }
2881}
2882
2883/// Defines additional types related to [OperationMetadata].
2884pub mod operation_metadata {
2885 #[allow(unused_imports)]
2886 use super::*;
2887
2888 /// Ephemeral metadata about the state of an operation for a particular
2889 /// resource.
2890 #[derive(Clone, Debug, PartialEq)]
2891 #[non_exhaustive]
2892 pub enum ResourceMetadata {
2893 /// Output only. Metadata about the deployment operation state.
2894 DeploymentMetadata(std::boxed::Box<crate::model::DeploymentOperationMetadata>),
2895 /// Output only. Metadata about the preview operation state.
2896 PreviewMetadata(std::boxed::Box<crate::model::PreviewOperationMetadata>),
2897 }
2898}
2899
2900/// A child resource of a Deployment generated by a 'CreateDeployment' or
2901/// 'UpdateDeployment' call. Each Revision contains metadata pertaining to a
2902/// snapshot of a particular Deployment.
2903#[derive(Clone, Default, PartialEq)]
2904#[non_exhaustive]
2905pub struct Revision {
2906 /// Revision name. Format:
2907 /// `projects/{project}/locations/{location}/deployments/{deployment}/
2908 /// revisions/{revision}`
2909 pub name: std::string::String,
2910
2911 /// Output only. Time when the revision was created.
2912 pub create_time: std::option::Option<wkt::Timestamp>,
2913
2914 /// Output only. Time when the revision was last modified.
2915 pub update_time: std::option::Option<wkt::Timestamp>,
2916
2917 /// Output only. The action which created this revision
2918 pub action: crate::model::revision::Action,
2919
2920 /// Output only. Current state of the revision.
2921 pub state: crate::model::revision::State,
2922
2923 /// Output only. Outputs and artifacts from applying a deployment.
2924 pub apply_results: std::option::Option<crate::model::ApplyResults>,
2925
2926 /// Output only. Additional info regarding the current state.
2927 pub state_detail: std::string::String,
2928
2929 /// Output only. Code describing any errors that may have occurred.
2930 pub error_code: crate::model::revision::ErrorCode,
2931
2932 /// Output only. Cloud Build instance UUID associated with this revision.
2933 pub build: std::string::String,
2934
2935 /// Output only. Location of Revision operation logs in
2936 /// `gs://{bucket}/{object}` format.
2937 pub logs: std::string::String,
2938
2939 /// Output only. Errors encountered when creating or updating this deployment.
2940 /// Errors are truncated to 10 entries, see `delete_results` and `error_logs`
2941 /// for full details.
2942 pub tf_errors: std::vec::Vec<crate::model::TerraformError>,
2943
2944 /// Output only. Location of Terraform error logs in Google Cloud Storage.
2945 /// Format: `gs://{bucket}/{object}`.
2946 pub error_logs: std::string::String,
2947
2948 /// Output only. User-specified Service Account (SA) to be used as credential
2949 /// to manage resources. Format:
2950 /// `projects/{projectID}/serviceAccounts/{serviceAccount}`
2951 pub service_account: std::string::String,
2952
2953 /// Output only. By default, Infra Manager will return a failure when
2954 /// Terraform encounters a 409 code (resource conflict error) during actuation.
2955 /// If this flag is set to true, Infra Manager will instead
2956 /// attempt to automatically import the resource into the Terraform state (for
2957 /// supported resource types) and continue actuation.
2958 ///
2959 /// Not all resource types are supported, refer to documentation.
2960 pub import_existing_resources: bool,
2961
2962 /// Output only. The user-specified Cloud Build worker pool resource in which
2963 /// the Cloud Build job will execute. Format:
2964 /// `projects/{project}/locations/{location}/workerPools/{workerPoolId}`.
2965 /// If this field is unspecified, the default Cloud Build worker pool will be
2966 /// used.
2967 pub worker_pool: std::string::String,
2968
2969 /// Output only. The user-specified Terraform version constraint.
2970 /// Example: "=1.3.10".
2971 pub tf_version_constraint: std::string::String,
2972
2973 /// Output only. The version of Terraform used to create the Revision.
2974 /// It is in the format of "Major.Minor.Patch", for example, "1.3.10".
2975 pub tf_version: std::string::String,
2976
2977 /// Output only. Cloud Storage path containing quota validation results. This
2978 /// field is set when a user sets Deployment.quota_validation field to ENABLED
2979 /// or ENFORCED. Format: `gs://{bucket}/{object}`.
2980 pub quota_validation_results: std::string::String,
2981
2982 /// Optional. Input to control quota checks for resources in terraform
2983 /// configuration files. There are limited resources on which quota validation
2984 /// applies.
2985 pub quota_validation: crate::model::QuotaValidation,
2986
2987 /// Output only. This field specifies the provider configurations.
2988 pub provider_config: std::option::Option<crate::model::ProviderConfig>,
2989
2990 /// Blueprint that was deployed.
2991 pub blueprint: std::option::Option<crate::model::revision::Blueprint>,
2992
2993 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2994}
2995
2996impl Revision {
2997 pub fn new() -> Self {
2998 std::default::Default::default()
2999 }
3000
3001 /// Sets the value of [name][crate::model::Revision::name].
3002 ///
3003 /// # Example
3004 /// ```ignore,no_run
3005 /// # use google_cloud_config_v1::model::Revision;
3006 /// let x = Revision::new().set_name("example");
3007 /// ```
3008 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3009 self.name = v.into();
3010 self
3011 }
3012
3013 /// Sets the value of [create_time][crate::model::Revision::create_time].
3014 ///
3015 /// # Example
3016 /// ```ignore,no_run
3017 /// # use google_cloud_config_v1::model::Revision;
3018 /// use wkt::Timestamp;
3019 /// let x = Revision::new().set_create_time(Timestamp::default()/* use setters */);
3020 /// ```
3021 pub fn set_create_time<T>(mut self, v: T) -> Self
3022 where
3023 T: std::convert::Into<wkt::Timestamp>,
3024 {
3025 self.create_time = std::option::Option::Some(v.into());
3026 self
3027 }
3028
3029 /// Sets or clears the value of [create_time][crate::model::Revision::create_time].
3030 ///
3031 /// # Example
3032 /// ```ignore,no_run
3033 /// # use google_cloud_config_v1::model::Revision;
3034 /// use wkt::Timestamp;
3035 /// let x = Revision::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
3036 /// let x = Revision::new().set_or_clear_create_time(None::<Timestamp>);
3037 /// ```
3038 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
3039 where
3040 T: std::convert::Into<wkt::Timestamp>,
3041 {
3042 self.create_time = v.map(|x| x.into());
3043 self
3044 }
3045
3046 /// Sets the value of [update_time][crate::model::Revision::update_time].
3047 ///
3048 /// # Example
3049 /// ```ignore,no_run
3050 /// # use google_cloud_config_v1::model::Revision;
3051 /// use wkt::Timestamp;
3052 /// let x = Revision::new().set_update_time(Timestamp::default()/* use setters */);
3053 /// ```
3054 pub fn set_update_time<T>(mut self, v: T) -> Self
3055 where
3056 T: std::convert::Into<wkt::Timestamp>,
3057 {
3058 self.update_time = std::option::Option::Some(v.into());
3059 self
3060 }
3061
3062 /// Sets or clears the value of [update_time][crate::model::Revision::update_time].
3063 ///
3064 /// # Example
3065 /// ```ignore,no_run
3066 /// # use google_cloud_config_v1::model::Revision;
3067 /// use wkt::Timestamp;
3068 /// let x = Revision::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
3069 /// let x = Revision::new().set_or_clear_update_time(None::<Timestamp>);
3070 /// ```
3071 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
3072 where
3073 T: std::convert::Into<wkt::Timestamp>,
3074 {
3075 self.update_time = v.map(|x| x.into());
3076 self
3077 }
3078
3079 /// Sets the value of [action][crate::model::Revision::action].
3080 ///
3081 /// # Example
3082 /// ```ignore,no_run
3083 /// # use google_cloud_config_v1::model::Revision;
3084 /// use google_cloud_config_v1::model::revision::Action;
3085 /// let x0 = Revision::new().set_action(Action::Create);
3086 /// let x1 = Revision::new().set_action(Action::Update);
3087 /// let x2 = Revision::new().set_action(Action::Delete);
3088 /// ```
3089 pub fn set_action<T: std::convert::Into<crate::model::revision::Action>>(
3090 mut self,
3091 v: T,
3092 ) -> Self {
3093 self.action = v.into();
3094 self
3095 }
3096
3097 /// Sets the value of [state][crate::model::Revision::state].
3098 ///
3099 /// # Example
3100 /// ```ignore,no_run
3101 /// # use google_cloud_config_v1::model::Revision;
3102 /// use google_cloud_config_v1::model::revision::State;
3103 /// let x0 = Revision::new().set_state(State::Applying);
3104 /// let x1 = Revision::new().set_state(State::Applied);
3105 /// let x2 = Revision::new().set_state(State::Failed);
3106 /// ```
3107 pub fn set_state<T: std::convert::Into<crate::model::revision::State>>(mut self, v: T) -> Self {
3108 self.state = v.into();
3109 self
3110 }
3111
3112 /// Sets the value of [apply_results][crate::model::Revision::apply_results].
3113 ///
3114 /// # Example
3115 /// ```ignore,no_run
3116 /// # use google_cloud_config_v1::model::Revision;
3117 /// use google_cloud_config_v1::model::ApplyResults;
3118 /// let x = Revision::new().set_apply_results(ApplyResults::default()/* use setters */);
3119 /// ```
3120 pub fn set_apply_results<T>(mut self, v: T) -> Self
3121 where
3122 T: std::convert::Into<crate::model::ApplyResults>,
3123 {
3124 self.apply_results = std::option::Option::Some(v.into());
3125 self
3126 }
3127
3128 /// Sets or clears the value of [apply_results][crate::model::Revision::apply_results].
3129 ///
3130 /// # Example
3131 /// ```ignore,no_run
3132 /// # use google_cloud_config_v1::model::Revision;
3133 /// use google_cloud_config_v1::model::ApplyResults;
3134 /// let x = Revision::new().set_or_clear_apply_results(Some(ApplyResults::default()/* use setters */));
3135 /// let x = Revision::new().set_or_clear_apply_results(None::<ApplyResults>);
3136 /// ```
3137 pub fn set_or_clear_apply_results<T>(mut self, v: std::option::Option<T>) -> Self
3138 where
3139 T: std::convert::Into<crate::model::ApplyResults>,
3140 {
3141 self.apply_results = v.map(|x| x.into());
3142 self
3143 }
3144
3145 /// Sets the value of [state_detail][crate::model::Revision::state_detail].
3146 ///
3147 /// # Example
3148 /// ```ignore,no_run
3149 /// # use google_cloud_config_v1::model::Revision;
3150 /// let x = Revision::new().set_state_detail("example");
3151 /// ```
3152 pub fn set_state_detail<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3153 self.state_detail = v.into();
3154 self
3155 }
3156
3157 /// Sets the value of [error_code][crate::model::Revision::error_code].
3158 ///
3159 /// # Example
3160 /// ```ignore,no_run
3161 /// # use google_cloud_config_v1::model::Revision;
3162 /// use google_cloud_config_v1::model::revision::ErrorCode;
3163 /// let x0 = Revision::new().set_error_code(ErrorCode::CloudBuildPermissionDenied);
3164 /// let x1 = Revision::new().set_error_code(ErrorCode::ApplyBuildApiFailed);
3165 /// let x2 = Revision::new().set_error_code(ErrorCode::ApplyBuildRunFailed);
3166 /// ```
3167 pub fn set_error_code<T: std::convert::Into<crate::model::revision::ErrorCode>>(
3168 mut self,
3169 v: T,
3170 ) -> Self {
3171 self.error_code = v.into();
3172 self
3173 }
3174
3175 /// Sets the value of [build][crate::model::Revision::build].
3176 ///
3177 /// # Example
3178 /// ```ignore,no_run
3179 /// # use google_cloud_config_v1::model::Revision;
3180 /// let x = Revision::new().set_build("example");
3181 /// ```
3182 pub fn set_build<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3183 self.build = v.into();
3184 self
3185 }
3186
3187 /// Sets the value of [logs][crate::model::Revision::logs].
3188 ///
3189 /// # Example
3190 /// ```ignore,no_run
3191 /// # use google_cloud_config_v1::model::Revision;
3192 /// let x = Revision::new().set_logs("example");
3193 /// ```
3194 pub fn set_logs<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3195 self.logs = v.into();
3196 self
3197 }
3198
3199 /// Sets the value of [tf_errors][crate::model::Revision::tf_errors].
3200 ///
3201 /// # Example
3202 /// ```ignore,no_run
3203 /// # use google_cloud_config_v1::model::Revision;
3204 /// use google_cloud_config_v1::model::TerraformError;
3205 /// let x = Revision::new()
3206 /// .set_tf_errors([
3207 /// TerraformError::default()/* use setters */,
3208 /// TerraformError::default()/* use (different) setters */,
3209 /// ]);
3210 /// ```
3211 pub fn set_tf_errors<T, V>(mut self, v: T) -> Self
3212 where
3213 T: std::iter::IntoIterator<Item = V>,
3214 V: std::convert::Into<crate::model::TerraformError>,
3215 {
3216 use std::iter::Iterator;
3217 self.tf_errors = v.into_iter().map(|i| i.into()).collect();
3218 self
3219 }
3220
3221 /// Sets the value of [error_logs][crate::model::Revision::error_logs].
3222 ///
3223 /// # Example
3224 /// ```ignore,no_run
3225 /// # use google_cloud_config_v1::model::Revision;
3226 /// let x = Revision::new().set_error_logs("example");
3227 /// ```
3228 pub fn set_error_logs<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3229 self.error_logs = v.into();
3230 self
3231 }
3232
3233 /// Sets the value of [service_account][crate::model::Revision::service_account].
3234 ///
3235 /// # Example
3236 /// ```ignore,no_run
3237 /// # use google_cloud_config_v1::model::Revision;
3238 /// let x = Revision::new().set_service_account("example");
3239 /// ```
3240 pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3241 self.service_account = v.into();
3242 self
3243 }
3244
3245 /// Sets the value of [import_existing_resources][crate::model::Revision::import_existing_resources].
3246 ///
3247 /// # Example
3248 /// ```ignore,no_run
3249 /// # use google_cloud_config_v1::model::Revision;
3250 /// let x = Revision::new().set_import_existing_resources(true);
3251 /// ```
3252 pub fn set_import_existing_resources<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3253 self.import_existing_resources = v.into();
3254 self
3255 }
3256
3257 /// Sets the value of [worker_pool][crate::model::Revision::worker_pool].
3258 ///
3259 /// # Example
3260 /// ```ignore,no_run
3261 /// # use google_cloud_config_v1::model::Revision;
3262 /// let x = Revision::new().set_worker_pool("example");
3263 /// ```
3264 pub fn set_worker_pool<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3265 self.worker_pool = v.into();
3266 self
3267 }
3268
3269 /// Sets the value of [tf_version_constraint][crate::model::Revision::tf_version_constraint].
3270 ///
3271 /// # Example
3272 /// ```ignore,no_run
3273 /// # use google_cloud_config_v1::model::Revision;
3274 /// let x = Revision::new().set_tf_version_constraint("example");
3275 /// ```
3276 pub fn set_tf_version_constraint<T: std::convert::Into<std::string::String>>(
3277 mut self,
3278 v: T,
3279 ) -> Self {
3280 self.tf_version_constraint = v.into();
3281 self
3282 }
3283
3284 /// Sets the value of [tf_version][crate::model::Revision::tf_version].
3285 ///
3286 /// # Example
3287 /// ```ignore,no_run
3288 /// # use google_cloud_config_v1::model::Revision;
3289 /// let x = Revision::new().set_tf_version("example");
3290 /// ```
3291 pub fn set_tf_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3292 self.tf_version = v.into();
3293 self
3294 }
3295
3296 /// Sets the value of [quota_validation_results][crate::model::Revision::quota_validation_results].
3297 ///
3298 /// # Example
3299 /// ```ignore,no_run
3300 /// # use google_cloud_config_v1::model::Revision;
3301 /// let x = Revision::new().set_quota_validation_results("example");
3302 /// ```
3303 pub fn set_quota_validation_results<T: std::convert::Into<std::string::String>>(
3304 mut self,
3305 v: T,
3306 ) -> Self {
3307 self.quota_validation_results = v.into();
3308 self
3309 }
3310
3311 /// Sets the value of [quota_validation][crate::model::Revision::quota_validation].
3312 ///
3313 /// # Example
3314 /// ```ignore,no_run
3315 /// # use google_cloud_config_v1::model::Revision;
3316 /// use google_cloud_config_v1::model::QuotaValidation;
3317 /// let x0 = Revision::new().set_quota_validation(QuotaValidation::Enabled);
3318 /// let x1 = Revision::new().set_quota_validation(QuotaValidation::Enforced);
3319 /// ```
3320 pub fn set_quota_validation<T: std::convert::Into<crate::model::QuotaValidation>>(
3321 mut self,
3322 v: T,
3323 ) -> Self {
3324 self.quota_validation = v.into();
3325 self
3326 }
3327
3328 /// Sets the value of [provider_config][crate::model::Revision::provider_config].
3329 ///
3330 /// # Example
3331 /// ```ignore,no_run
3332 /// # use google_cloud_config_v1::model::Revision;
3333 /// use google_cloud_config_v1::model::ProviderConfig;
3334 /// let x = Revision::new().set_provider_config(ProviderConfig::default()/* use setters */);
3335 /// ```
3336 pub fn set_provider_config<T>(mut self, v: T) -> Self
3337 where
3338 T: std::convert::Into<crate::model::ProviderConfig>,
3339 {
3340 self.provider_config = std::option::Option::Some(v.into());
3341 self
3342 }
3343
3344 /// Sets or clears the value of [provider_config][crate::model::Revision::provider_config].
3345 ///
3346 /// # Example
3347 /// ```ignore,no_run
3348 /// # use google_cloud_config_v1::model::Revision;
3349 /// use google_cloud_config_v1::model::ProviderConfig;
3350 /// let x = Revision::new().set_or_clear_provider_config(Some(ProviderConfig::default()/* use setters */));
3351 /// let x = Revision::new().set_or_clear_provider_config(None::<ProviderConfig>);
3352 /// ```
3353 pub fn set_or_clear_provider_config<T>(mut self, v: std::option::Option<T>) -> Self
3354 where
3355 T: std::convert::Into<crate::model::ProviderConfig>,
3356 {
3357 self.provider_config = v.map(|x| x.into());
3358 self
3359 }
3360
3361 /// Sets the value of [blueprint][crate::model::Revision::blueprint].
3362 ///
3363 /// Note that all the setters affecting `blueprint` are mutually
3364 /// exclusive.
3365 ///
3366 /// # Example
3367 /// ```ignore,no_run
3368 /// # use google_cloud_config_v1::model::Revision;
3369 /// use google_cloud_config_v1::model::TerraformBlueprint;
3370 /// let x = Revision::new().set_blueprint(Some(
3371 /// google_cloud_config_v1::model::revision::Blueprint::TerraformBlueprint(TerraformBlueprint::default().into())));
3372 /// ```
3373 pub fn set_blueprint<
3374 T: std::convert::Into<std::option::Option<crate::model::revision::Blueprint>>,
3375 >(
3376 mut self,
3377 v: T,
3378 ) -> Self {
3379 self.blueprint = v.into();
3380 self
3381 }
3382
3383 /// The value of [blueprint][crate::model::Revision::blueprint]
3384 /// if it holds a `TerraformBlueprint`, `None` if the field is not set or
3385 /// holds a different branch.
3386 pub fn terraform_blueprint(
3387 &self,
3388 ) -> std::option::Option<&std::boxed::Box<crate::model::TerraformBlueprint>> {
3389 #[allow(unreachable_patterns)]
3390 self.blueprint.as_ref().and_then(|v| match v {
3391 crate::model::revision::Blueprint::TerraformBlueprint(v) => {
3392 std::option::Option::Some(v)
3393 }
3394 _ => std::option::Option::None,
3395 })
3396 }
3397
3398 /// Sets the value of [blueprint][crate::model::Revision::blueprint]
3399 /// to hold a `TerraformBlueprint`.
3400 ///
3401 /// Note that all the setters affecting `blueprint` are
3402 /// mutually exclusive.
3403 ///
3404 /// # Example
3405 /// ```ignore,no_run
3406 /// # use google_cloud_config_v1::model::Revision;
3407 /// use google_cloud_config_v1::model::TerraformBlueprint;
3408 /// let x = Revision::new().set_terraform_blueprint(TerraformBlueprint::default()/* use setters */);
3409 /// assert!(x.terraform_blueprint().is_some());
3410 /// ```
3411 pub fn set_terraform_blueprint<
3412 T: std::convert::Into<std::boxed::Box<crate::model::TerraformBlueprint>>,
3413 >(
3414 mut self,
3415 v: T,
3416 ) -> Self {
3417 self.blueprint = std::option::Option::Some(
3418 crate::model::revision::Blueprint::TerraformBlueprint(v.into()),
3419 );
3420 self
3421 }
3422}
3423
3424impl wkt::message::Message for Revision {
3425 fn typename() -> &'static str {
3426 "type.googleapis.com/google.cloud.config.v1.Revision"
3427 }
3428}
3429
3430/// Defines additional types related to [Revision].
3431pub mod revision {
3432 #[allow(unused_imports)]
3433 use super::*;
3434
3435 /// Actions that generate a revision.
3436 ///
3437 /// # Working with unknown values
3438 ///
3439 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3440 /// additional enum variants at any time. Adding new variants is not considered
3441 /// a breaking change. Applications should write their code in anticipation of:
3442 ///
3443 /// - New values appearing in future releases of the client library, **and**
3444 /// - New values received dynamically, without application changes.
3445 ///
3446 /// Please consult the [Working with enums] section in the user guide for some
3447 /// guidelines.
3448 ///
3449 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
3450 #[derive(Clone, Debug, PartialEq)]
3451 #[non_exhaustive]
3452 pub enum Action {
3453 /// The default value. This value is used if the action is omitted.
3454 Unspecified,
3455 /// The revision was generated by creating a deployment.
3456 Create,
3457 /// The revision was generated by updating a deployment.
3458 Update,
3459 /// The revision was deleted.
3460 Delete,
3461 /// If set, the enum was initialized with an unknown value.
3462 ///
3463 /// Applications can examine the value using [Action::value] or
3464 /// [Action::name].
3465 UnknownValue(action::UnknownValue),
3466 }
3467
3468 #[doc(hidden)]
3469 pub mod action {
3470 #[allow(unused_imports)]
3471 use super::*;
3472 #[derive(Clone, Debug, PartialEq)]
3473 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3474 }
3475
3476 impl Action {
3477 /// Gets the enum value.
3478 ///
3479 /// Returns `None` if the enum contains an unknown value deserialized from
3480 /// the string representation of enums.
3481 pub fn value(&self) -> std::option::Option<i32> {
3482 match self {
3483 Self::Unspecified => std::option::Option::Some(0),
3484 Self::Create => std::option::Option::Some(1),
3485 Self::Update => std::option::Option::Some(2),
3486 Self::Delete => std::option::Option::Some(3),
3487 Self::UnknownValue(u) => u.0.value(),
3488 }
3489 }
3490
3491 /// Gets the enum value as a string.
3492 ///
3493 /// Returns `None` if the enum contains an unknown value deserialized from
3494 /// the integer representation of enums.
3495 pub fn name(&self) -> std::option::Option<&str> {
3496 match self {
3497 Self::Unspecified => std::option::Option::Some("ACTION_UNSPECIFIED"),
3498 Self::Create => std::option::Option::Some("CREATE"),
3499 Self::Update => std::option::Option::Some("UPDATE"),
3500 Self::Delete => std::option::Option::Some("DELETE"),
3501 Self::UnknownValue(u) => u.0.name(),
3502 }
3503 }
3504 }
3505
3506 impl std::default::Default for Action {
3507 fn default() -> Self {
3508 use std::convert::From;
3509 Self::from(0)
3510 }
3511 }
3512
3513 impl std::fmt::Display for Action {
3514 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3515 wkt::internal::display_enum(f, self.name(), self.value())
3516 }
3517 }
3518
3519 impl std::convert::From<i32> for Action {
3520 fn from(value: i32) -> Self {
3521 match value {
3522 0 => Self::Unspecified,
3523 1 => Self::Create,
3524 2 => Self::Update,
3525 3 => Self::Delete,
3526 _ => Self::UnknownValue(action::UnknownValue(
3527 wkt::internal::UnknownEnumValue::Integer(value),
3528 )),
3529 }
3530 }
3531 }
3532
3533 impl std::convert::From<&str> for Action {
3534 fn from(value: &str) -> Self {
3535 use std::string::ToString;
3536 match value {
3537 "ACTION_UNSPECIFIED" => Self::Unspecified,
3538 "CREATE" => Self::Create,
3539 "UPDATE" => Self::Update,
3540 "DELETE" => Self::Delete,
3541 _ => Self::UnknownValue(action::UnknownValue(
3542 wkt::internal::UnknownEnumValue::String(value.to_string()),
3543 )),
3544 }
3545 }
3546 }
3547
3548 impl serde::ser::Serialize for Action {
3549 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3550 where
3551 S: serde::Serializer,
3552 {
3553 match self {
3554 Self::Unspecified => serializer.serialize_i32(0),
3555 Self::Create => serializer.serialize_i32(1),
3556 Self::Update => serializer.serialize_i32(2),
3557 Self::Delete => serializer.serialize_i32(3),
3558 Self::UnknownValue(u) => u.0.serialize(serializer),
3559 }
3560 }
3561 }
3562
3563 impl<'de> serde::de::Deserialize<'de> for Action {
3564 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3565 where
3566 D: serde::Deserializer<'de>,
3567 {
3568 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Action>::new(
3569 ".google.cloud.config.v1.Revision.Action",
3570 ))
3571 }
3572 }
3573
3574 /// Possible states of a revision.
3575 ///
3576 /// # Working with unknown values
3577 ///
3578 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3579 /// additional enum variants at any time. Adding new variants is not considered
3580 /// a breaking change. Applications should write their code in anticipation of:
3581 ///
3582 /// - New values appearing in future releases of the client library, **and**
3583 /// - New values received dynamically, without application changes.
3584 ///
3585 /// Please consult the [Working with enums] section in the user guide for some
3586 /// guidelines.
3587 ///
3588 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
3589 #[derive(Clone, Debug, PartialEq)]
3590 #[non_exhaustive]
3591 pub enum State {
3592 /// The default value. This value is used if the state is omitted.
3593 Unspecified,
3594 /// The revision is being applied.
3595 Applying,
3596 /// The revision was applied successfully.
3597 Applied,
3598 /// The revision could not be applied successfully.
3599 Failed,
3600 /// If set, the enum was initialized with an unknown value.
3601 ///
3602 /// Applications can examine the value using [State::value] or
3603 /// [State::name].
3604 UnknownValue(state::UnknownValue),
3605 }
3606
3607 #[doc(hidden)]
3608 pub mod state {
3609 #[allow(unused_imports)]
3610 use super::*;
3611 #[derive(Clone, Debug, PartialEq)]
3612 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3613 }
3614
3615 impl State {
3616 /// Gets the enum value.
3617 ///
3618 /// Returns `None` if the enum contains an unknown value deserialized from
3619 /// the string representation of enums.
3620 pub fn value(&self) -> std::option::Option<i32> {
3621 match self {
3622 Self::Unspecified => std::option::Option::Some(0),
3623 Self::Applying => std::option::Option::Some(1),
3624 Self::Applied => std::option::Option::Some(2),
3625 Self::Failed => std::option::Option::Some(3),
3626 Self::UnknownValue(u) => u.0.value(),
3627 }
3628 }
3629
3630 /// Gets the enum value as a string.
3631 ///
3632 /// Returns `None` if the enum contains an unknown value deserialized from
3633 /// the integer representation of enums.
3634 pub fn name(&self) -> std::option::Option<&str> {
3635 match self {
3636 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
3637 Self::Applying => std::option::Option::Some("APPLYING"),
3638 Self::Applied => std::option::Option::Some("APPLIED"),
3639 Self::Failed => std::option::Option::Some("FAILED"),
3640 Self::UnknownValue(u) => u.0.name(),
3641 }
3642 }
3643 }
3644
3645 impl std::default::Default for State {
3646 fn default() -> Self {
3647 use std::convert::From;
3648 Self::from(0)
3649 }
3650 }
3651
3652 impl std::fmt::Display for State {
3653 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3654 wkt::internal::display_enum(f, self.name(), self.value())
3655 }
3656 }
3657
3658 impl std::convert::From<i32> for State {
3659 fn from(value: i32) -> Self {
3660 match value {
3661 0 => Self::Unspecified,
3662 1 => Self::Applying,
3663 2 => Self::Applied,
3664 3 => Self::Failed,
3665 _ => Self::UnknownValue(state::UnknownValue(
3666 wkt::internal::UnknownEnumValue::Integer(value),
3667 )),
3668 }
3669 }
3670 }
3671
3672 impl std::convert::From<&str> for State {
3673 fn from(value: &str) -> Self {
3674 use std::string::ToString;
3675 match value {
3676 "STATE_UNSPECIFIED" => Self::Unspecified,
3677 "APPLYING" => Self::Applying,
3678 "APPLIED" => Self::Applied,
3679 "FAILED" => Self::Failed,
3680 _ => Self::UnknownValue(state::UnknownValue(
3681 wkt::internal::UnknownEnumValue::String(value.to_string()),
3682 )),
3683 }
3684 }
3685 }
3686
3687 impl serde::ser::Serialize for State {
3688 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3689 where
3690 S: serde::Serializer,
3691 {
3692 match self {
3693 Self::Unspecified => serializer.serialize_i32(0),
3694 Self::Applying => serializer.serialize_i32(1),
3695 Self::Applied => serializer.serialize_i32(2),
3696 Self::Failed => serializer.serialize_i32(3),
3697 Self::UnknownValue(u) => u.0.serialize(serializer),
3698 }
3699 }
3700 }
3701
3702 impl<'de> serde::de::Deserialize<'de> for State {
3703 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3704 where
3705 D: serde::Deserializer<'de>,
3706 {
3707 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
3708 ".google.cloud.config.v1.Revision.State",
3709 ))
3710 }
3711 }
3712
3713 /// Possible errors if Revision could not be created or updated successfully.
3714 ///
3715 /// # Working with unknown values
3716 ///
3717 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3718 /// additional enum variants at any time. Adding new variants is not considered
3719 /// a breaking change. Applications should write their code in anticipation of:
3720 ///
3721 /// - New values appearing in future releases of the client library, **and**
3722 /// - New values received dynamically, without application changes.
3723 ///
3724 /// Please consult the [Working with enums] section in the user guide for some
3725 /// guidelines.
3726 ///
3727 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
3728 #[derive(Clone, Debug, PartialEq)]
3729 #[non_exhaustive]
3730 pub enum ErrorCode {
3731 /// No error code was specified.
3732 Unspecified,
3733 /// Cloud Build failed due to a permission issue.
3734 CloudBuildPermissionDenied,
3735 /// Cloud Build job associated with creating or updating a deployment could
3736 /// not be started.
3737 ApplyBuildApiFailed,
3738 /// Cloud Build job associated with creating or updating a deployment was
3739 /// started but failed.
3740 ApplyBuildRunFailed,
3741 /// quota validation failed for one or more resources in terraform
3742 /// configuration files.
3743 QuotaValidationFailed,
3744 /// Failed to import values from an external source.
3745 ExternalValueSourceImportFailed,
3746 /// If set, the enum was initialized with an unknown value.
3747 ///
3748 /// Applications can examine the value using [ErrorCode::value] or
3749 /// [ErrorCode::name].
3750 UnknownValue(error_code::UnknownValue),
3751 }
3752
3753 #[doc(hidden)]
3754 pub mod error_code {
3755 #[allow(unused_imports)]
3756 use super::*;
3757 #[derive(Clone, Debug, PartialEq)]
3758 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3759 }
3760
3761 impl ErrorCode {
3762 /// Gets the enum value.
3763 ///
3764 /// Returns `None` if the enum contains an unknown value deserialized from
3765 /// the string representation of enums.
3766 pub fn value(&self) -> std::option::Option<i32> {
3767 match self {
3768 Self::Unspecified => std::option::Option::Some(0),
3769 Self::CloudBuildPermissionDenied => std::option::Option::Some(1),
3770 Self::ApplyBuildApiFailed => std::option::Option::Some(4),
3771 Self::ApplyBuildRunFailed => std::option::Option::Some(5),
3772 Self::QuotaValidationFailed => std::option::Option::Some(7),
3773 Self::ExternalValueSourceImportFailed => std::option::Option::Some(8),
3774 Self::UnknownValue(u) => u.0.value(),
3775 }
3776 }
3777
3778 /// Gets the enum value as a string.
3779 ///
3780 /// Returns `None` if the enum contains an unknown value deserialized from
3781 /// the integer representation of enums.
3782 pub fn name(&self) -> std::option::Option<&str> {
3783 match self {
3784 Self::Unspecified => std::option::Option::Some("ERROR_CODE_UNSPECIFIED"),
3785 Self::CloudBuildPermissionDenied => {
3786 std::option::Option::Some("CLOUD_BUILD_PERMISSION_DENIED")
3787 }
3788 Self::ApplyBuildApiFailed => std::option::Option::Some("APPLY_BUILD_API_FAILED"),
3789 Self::ApplyBuildRunFailed => std::option::Option::Some("APPLY_BUILD_RUN_FAILED"),
3790 Self::QuotaValidationFailed => std::option::Option::Some("QUOTA_VALIDATION_FAILED"),
3791 Self::ExternalValueSourceImportFailed => {
3792 std::option::Option::Some("EXTERNAL_VALUE_SOURCE_IMPORT_FAILED")
3793 }
3794 Self::UnknownValue(u) => u.0.name(),
3795 }
3796 }
3797 }
3798
3799 impl std::default::Default for ErrorCode {
3800 fn default() -> Self {
3801 use std::convert::From;
3802 Self::from(0)
3803 }
3804 }
3805
3806 impl std::fmt::Display for ErrorCode {
3807 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3808 wkt::internal::display_enum(f, self.name(), self.value())
3809 }
3810 }
3811
3812 impl std::convert::From<i32> for ErrorCode {
3813 fn from(value: i32) -> Self {
3814 match value {
3815 0 => Self::Unspecified,
3816 1 => Self::CloudBuildPermissionDenied,
3817 4 => Self::ApplyBuildApiFailed,
3818 5 => Self::ApplyBuildRunFailed,
3819 7 => Self::QuotaValidationFailed,
3820 8 => Self::ExternalValueSourceImportFailed,
3821 _ => Self::UnknownValue(error_code::UnknownValue(
3822 wkt::internal::UnknownEnumValue::Integer(value),
3823 )),
3824 }
3825 }
3826 }
3827
3828 impl std::convert::From<&str> for ErrorCode {
3829 fn from(value: &str) -> Self {
3830 use std::string::ToString;
3831 match value {
3832 "ERROR_CODE_UNSPECIFIED" => Self::Unspecified,
3833 "CLOUD_BUILD_PERMISSION_DENIED" => Self::CloudBuildPermissionDenied,
3834 "APPLY_BUILD_API_FAILED" => Self::ApplyBuildApiFailed,
3835 "APPLY_BUILD_RUN_FAILED" => Self::ApplyBuildRunFailed,
3836 "QUOTA_VALIDATION_FAILED" => Self::QuotaValidationFailed,
3837 "EXTERNAL_VALUE_SOURCE_IMPORT_FAILED" => Self::ExternalValueSourceImportFailed,
3838 _ => Self::UnknownValue(error_code::UnknownValue(
3839 wkt::internal::UnknownEnumValue::String(value.to_string()),
3840 )),
3841 }
3842 }
3843 }
3844
3845 impl serde::ser::Serialize for ErrorCode {
3846 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3847 where
3848 S: serde::Serializer,
3849 {
3850 match self {
3851 Self::Unspecified => serializer.serialize_i32(0),
3852 Self::CloudBuildPermissionDenied => serializer.serialize_i32(1),
3853 Self::ApplyBuildApiFailed => serializer.serialize_i32(4),
3854 Self::ApplyBuildRunFailed => serializer.serialize_i32(5),
3855 Self::QuotaValidationFailed => serializer.serialize_i32(7),
3856 Self::ExternalValueSourceImportFailed => serializer.serialize_i32(8),
3857 Self::UnknownValue(u) => u.0.serialize(serializer),
3858 }
3859 }
3860 }
3861
3862 impl<'de> serde::de::Deserialize<'de> for ErrorCode {
3863 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3864 where
3865 D: serde::Deserializer<'de>,
3866 {
3867 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ErrorCode>::new(
3868 ".google.cloud.config.v1.Revision.ErrorCode",
3869 ))
3870 }
3871 }
3872
3873 /// Blueprint that was deployed.
3874 #[derive(Clone, Debug, PartialEq)]
3875 #[non_exhaustive]
3876 pub enum Blueprint {
3877 /// Output only. A blueprint described using Terraform's HashiCorp
3878 /// Configuration Language as a root module.
3879 TerraformBlueprint(std::boxed::Box<crate::model::TerraformBlueprint>),
3880 }
3881}
3882
3883/// Errors encountered during actuation using Terraform
3884#[derive(Clone, Default, PartialEq)]
3885#[non_exhaustive]
3886pub struct TerraformError {
3887 /// Address of the resource associated with the error,
3888 /// e.g. `google_compute_network.vpc_network`.
3889 pub resource_address: std::string::String,
3890
3891 /// HTTP response code returned from Google Cloud Platform APIs when Terraform
3892 /// fails to provision the resource. If unset or 0, no HTTP response code was
3893 /// returned by Terraform.
3894 pub http_response_code: i32,
3895
3896 /// A human-readable error description.
3897 pub error_description: std::string::String,
3898
3899 /// Output only. Original error response from underlying Google API, if
3900 /// available.
3901 pub error: std::option::Option<rpc::model::Status>,
3902
3903 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3904}
3905
3906impl TerraformError {
3907 pub fn new() -> Self {
3908 std::default::Default::default()
3909 }
3910
3911 /// Sets the value of [resource_address][crate::model::TerraformError::resource_address].
3912 ///
3913 /// # Example
3914 /// ```ignore,no_run
3915 /// # use google_cloud_config_v1::model::TerraformError;
3916 /// let x = TerraformError::new().set_resource_address("example");
3917 /// ```
3918 pub fn set_resource_address<T: std::convert::Into<std::string::String>>(
3919 mut self,
3920 v: T,
3921 ) -> Self {
3922 self.resource_address = v.into();
3923 self
3924 }
3925
3926 /// Sets the value of [http_response_code][crate::model::TerraformError::http_response_code].
3927 ///
3928 /// # Example
3929 /// ```ignore,no_run
3930 /// # use google_cloud_config_v1::model::TerraformError;
3931 /// let x = TerraformError::new().set_http_response_code(42);
3932 /// ```
3933 pub fn set_http_response_code<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3934 self.http_response_code = v.into();
3935 self
3936 }
3937
3938 /// Sets the value of [error_description][crate::model::TerraformError::error_description].
3939 ///
3940 /// # Example
3941 /// ```ignore,no_run
3942 /// # use google_cloud_config_v1::model::TerraformError;
3943 /// let x = TerraformError::new().set_error_description("example");
3944 /// ```
3945 pub fn set_error_description<T: std::convert::Into<std::string::String>>(
3946 mut self,
3947 v: T,
3948 ) -> Self {
3949 self.error_description = v.into();
3950 self
3951 }
3952
3953 /// Sets the value of [error][crate::model::TerraformError::error].
3954 ///
3955 /// # Example
3956 /// ```ignore,no_run
3957 /// # use google_cloud_config_v1::model::TerraformError;
3958 /// use rpc::model::Status;
3959 /// let x = TerraformError::new().set_error(Status::default()/* use setters */);
3960 /// ```
3961 pub fn set_error<T>(mut self, v: T) -> Self
3962 where
3963 T: std::convert::Into<rpc::model::Status>,
3964 {
3965 self.error = std::option::Option::Some(v.into());
3966 self
3967 }
3968
3969 /// Sets or clears the value of [error][crate::model::TerraformError::error].
3970 ///
3971 /// # Example
3972 /// ```ignore,no_run
3973 /// # use google_cloud_config_v1::model::TerraformError;
3974 /// use rpc::model::Status;
3975 /// let x = TerraformError::new().set_or_clear_error(Some(Status::default()/* use setters */));
3976 /// let x = TerraformError::new().set_or_clear_error(None::<Status>);
3977 /// ```
3978 pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
3979 where
3980 T: std::convert::Into<rpc::model::Status>,
3981 {
3982 self.error = v.map(|x| x.into());
3983 self
3984 }
3985}
3986
3987impl wkt::message::Message for TerraformError {
3988 fn typename() -> &'static str {
3989 "type.googleapis.com/google.cloud.config.v1.TerraformError"
3990 }
3991}
3992
3993/// A set of files in a Git repository.
3994#[derive(Clone, Default, PartialEq)]
3995#[non_exhaustive]
3996pub struct GitSource {
3997 /// Optional. Repository URL.
3998 /// Example: '<https://github.com/kubernetes/examples.git>'
3999 pub repo: std::option::Option<std::string::String>,
4000
4001 /// Optional. Subdirectory inside the repository.
4002 /// Example: 'staging/my-package'
4003 pub directory: std::option::Option<std::string::String>,
4004
4005 /// Optional. Git reference (e.g. branch or tag).
4006 pub r#ref: std::option::Option<std::string::String>,
4007
4008 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4009}
4010
4011impl GitSource {
4012 pub fn new() -> Self {
4013 std::default::Default::default()
4014 }
4015
4016 /// Sets the value of [repo][crate::model::GitSource::repo].
4017 ///
4018 /// # Example
4019 /// ```ignore,no_run
4020 /// # use google_cloud_config_v1::model::GitSource;
4021 /// let x = GitSource::new().set_repo("example");
4022 /// ```
4023 pub fn set_repo<T>(mut self, v: T) -> Self
4024 where
4025 T: std::convert::Into<std::string::String>,
4026 {
4027 self.repo = std::option::Option::Some(v.into());
4028 self
4029 }
4030
4031 /// Sets or clears the value of [repo][crate::model::GitSource::repo].
4032 ///
4033 /// # Example
4034 /// ```ignore,no_run
4035 /// # use google_cloud_config_v1::model::GitSource;
4036 /// let x = GitSource::new().set_or_clear_repo(Some("example"));
4037 /// let x = GitSource::new().set_or_clear_repo(None::<String>);
4038 /// ```
4039 pub fn set_or_clear_repo<T>(mut self, v: std::option::Option<T>) -> Self
4040 where
4041 T: std::convert::Into<std::string::String>,
4042 {
4043 self.repo = v.map(|x| x.into());
4044 self
4045 }
4046
4047 /// Sets the value of [directory][crate::model::GitSource::directory].
4048 ///
4049 /// # Example
4050 /// ```ignore,no_run
4051 /// # use google_cloud_config_v1::model::GitSource;
4052 /// let x = GitSource::new().set_directory("example");
4053 /// ```
4054 pub fn set_directory<T>(mut self, v: T) -> Self
4055 where
4056 T: std::convert::Into<std::string::String>,
4057 {
4058 self.directory = std::option::Option::Some(v.into());
4059 self
4060 }
4061
4062 /// Sets or clears the value of [directory][crate::model::GitSource::directory].
4063 ///
4064 /// # Example
4065 /// ```ignore,no_run
4066 /// # use google_cloud_config_v1::model::GitSource;
4067 /// let x = GitSource::new().set_or_clear_directory(Some("example"));
4068 /// let x = GitSource::new().set_or_clear_directory(None::<String>);
4069 /// ```
4070 pub fn set_or_clear_directory<T>(mut self, v: std::option::Option<T>) -> Self
4071 where
4072 T: std::convert::Into<std::string::String>,
4073 {
4074 self.directory = v.map(|x| x.into());
4075 self
4076 }
4077
4078 /// Sets the value of [r#ref][crate::model::GitSource::ref].
4079 ///
4080 /// # Example
4081 /// ```ignore,no_run
4082 /// # use google_cloud_config_v1::model::GitSource;
4083 /// let x = GitSource::new().set_ref("example");
4084 /// ```
4085 pub fn set_ref<T>(mut self, v: T) -> Self
4086 where
4087 T: std::convert::Into<std::string::String>,
4088 {
4089 self.r#ref = std::option::Option::Some(v.into());
4090 self
4091 }
4092
4093 /// Sets or clears the value of [r#ref][crate::model::GitSource::ref].
4094 ///
4095 /// # Example
4096 /// ```ignore,no_run
4097 /// # use google_cloud_config_v1::model::GitSource;
4098 /// let x = GitSource::new().set_or_clear_ref(Some("example"));
4099 /// let x = GitSource::new().set_or_clear_ref(None::<String>);
4100 /// ```
4101 pub fn set_or_clear_ref<T>(mut self, v: std::option::Option<T>) -> Self
4102 where
4103 T: std::convert::Into<std::string::String>,
4104 {
4105 self.r#ref = v.map(|x| x.into());
4106 self
4107 }
4108}
4109
4110impl wkt::message::Message for GitSource {
4111 fn typename() -> &'static str {
4112 "type.googleapis.com/google.cloud.config.v1.GitSource"
4113 }
4114}
4115
4116/// Ephemeral metadata content describing the state of a deployment operation.
4117#[derive(Clone, Default, PartialEq)]
4118#[non_exhaustive]
4119pub struct DeploymentOperationMetadata {
4120 /// The current step the deployment operation is running.
4121 pub step: crate::model::deployment_operation_metadata::DeploymentStep,
4122
4123 /// Outputs and artifacts from applying a deployment.
4124 pub apply_results: std::option::Option<crate::model::ApplyResults>,
4125
4126 /// Output only. Cloud Build instance UUID associated with this operation.
4127 pub build: std::string::String,
4128
4129 /// Output only. Location of Deployment operations logs in
4130 /// `gs://{bucket}/{object}` format.
4131 pub logs: std::string::String,
4132
4133 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4134}
4135
4136impl DeploymentOperationMetadata {
4137 pub fn new() -> Self {
4138 std::default::Default::default()
4139 }
4140
4141 /// Sets the value of [step][crate::model::DeploymentOperationMetadata::step].
4142 ///
4143 /// # Example
4144 /// ```ignore,no_run
4145 /// # use google_cloud_config_v1::model::DeploymentOperationMetadata;
4146 /// use google_cloud_config_v1::model::deployment_operation_metadata::DeploymentStep;
4147 /// let x0 = DeploymentOperationMetadata::new().set_step(DeploymentStep::PreparingStorageBucket);
4148 /// let x1 = DeploymentOperationMetadata::new().set_step(DeploymentStep::DownloadingBlueprint);
4149 /// let x2 = DeploymentOperationMetadata::new().set_step(DeploymentStep::RunningTfInit);
4150 /// ```
4151 pub fn set_step<
4152 T: std::convert::Into<crate::model::deployment_operation_metadata::DeploymentStep>,
4153 >(
4154 mut self,
4155 v: T,
4156 ) -> Self {
4157 self.step = v.into();
4158 self
4159 }
4160
4161 /// Sets the value of [apply_results][crate::model::DeploymentOperationMetadata::apply_results].
4162 ///
4163 /// # Example
4164 /// ```ignore,no_run
4165 /// # use google_cloud_config_v1::model::DeploymentOperationMetadata;
4166 /// use google_cloud_config_v1::model::ApplyResults;
4167 /// let x = DeploymentOperationMetadata::new().set_apply_results(ApplyResults::default()/* use setters */);
4168 /// ```
4169 pub fn set_apply_results<T>(mut self, v: T) -> Self
4170 where
4171 T: std::convert::Into<crate::model::ApplyResults>,
4172 {
4173 self.apply_results = std::option::Option::Some(v.into());
4174 self
4175 }
4176
4177 /// Sets or clears the value of [apply_results][crate::model::DeploymentOperationMetadata::apply_results].
4178 ///
4179 /// # Example
4180 /// ```ignore,no_run
4181 /// # use google_cloud_config_v1::model::DeploymentOperationMetadata;
4182 /// use google_cloud_config_v1::model::ApplyResults;
4183 /// let x = DeploymentOperationMetadata::new().set_or_clear_apply_results(Some(ApplyResults::default()/* use setters */));
4184 /// let x = DeploymentOperationMetadata::new().set_or_clear_apply_results(None::<ApplyResults>);
4185 /// ```
4186 pub fn set_or_clear_apply_results<T>(mut self, v: std::option::Option<T>) -> Self
4187 where
4188 T: std::convert::Into<crate::model::ApplyResults>,
4189 {
4190 self.apply_results = v.map(|x| x.into());
4191 self
4192 }
4193
4194 /// Sets the value of [build][crate::model::DeploymentOperationMetadata::build].
4195 ///
4196 /// # Example
4197 /// ```ignore,no_run
4198 /// # use google_cloud_config_v1::model::DeploymentOperationMetadata;
4199 /// let x = DeploymentOperationMetadata::new().set_build("example");
4200 /// ```
4201 pub fn set_build<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4202 self.build = v.into();
4203 self
4204 }
4205
4206 /// Sets the value of [logs][crate::model::DeploymentOperationMetadata::logs].
4207 ///
4208 /// # Example
4209 /// ```ignore,no_run
4210 /// # use google_cloud_config_v1::model::DeploymentOperationMetadata;
4211 /// let x = DeploymentOperationMetadata::new().set_logs("example");
4212 /// ```
4213 pub fn set_logs<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4214 self.logs = v.into();
4215 self
4216 }
4217}
4218
4219impl wkt::message::Message for DeploymentOperationMetadata {
4220 fn typename() -> &'static str {
4221 "type.googleapis.com/google.cloud.config.v1.DeploymentOperationMetadata"
4222 }
4223}
4224
4225/// Defines additional types related to [DeploymentOperationMetadata].
4226pub mod deployment_operation_metadata {
4227 #[allow(unused_imports)]
4228 use super::*;
4229
4230 /// The possible steps a deployment may be running.
4231 ///
4232 /// # Working with unknown values
4233 ///
4234 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4235 /// additional enum variants at any time. Adding new variants is not considered
4236 /// a breaking change. Applications should write their code in anticipation of:
4237 ///
4238 /// - New values appearing in future releases of the client library, **and**
4239 /// - New values received dynamically, without application changes.
4240 ///
4241 /// Please consult the [Working with enums] section in the user guide for some
4242 /// guidelines.
4243 ///
4244 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
4245 #[derive(Clone, Debug, PartialEq)]
4246 #[non_exhaustive]
4247 pub enum DeploymentStep {
4248 /// Unspecified deployment step
4249 Unspecified,
4250 /// Infra Manager is creating a Google Cloud Storage bucket to store
4251 /// artifacts and metadata about the deployment and revision
4252 PreparingStorageBucket,
4253 /// Downloading the blueprint onto the Google Cloud Storage bucket
4254 DownloadingBlueprint,
4255 /// Initializing Terraform using `terraform init`
4256 RunningTfInit,
4257 /// Running `terraform plan`
4258 RunningTfPlan,
4259 /// Actuating resources using Terraform using `terraform apply`
4260 RunningTfApply,
4261 /// Destroying resources using Terraform using `terraform destroy`
4262 RunningTfDestroy,
4263 /// Validating the uploaded TF state file when unlocking a deployment
4264 RunningTfValidate,
4265 /// Unlocking a deployment
4266 UnlockingDeployment,
4267 /// Operation was successful
4268 Succeeded,
4269 /// Operation failed
4270 Failed,
4271 /// Validating the provided repository.
4272 ValidatingRepository,
4273 /// Running quota validation
4274 RunningQuotaValidation,
4275 /// If set, the enum was initialized with an unknown value.
4276 ///
4277 /// Applications can examine the value using [DeploymentStep::value] or
4278 /// [DeploymentStep::name].
4279 UnknownValue(deployment_step::UnknownValue),
4280 }
4281
4282 #[doc(hidden)]
4283 pub mod deployment_step {
4284 #[allow(unused_imports)]
4285 use super::*;
4286 #[derive(Clone, Debug, PartialEq)]
4287 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4288 }
4289
4290 impl DeploymentStep {
4291 /// Gets the enum value.
4292 ///
4293 /// Returns `None` if the enum contains an unknown value deserialized from
4294 /// the string representation of enums.
4295 pub fn value(&self) -> std::option::Option<i32> {
4296 match self {
4297 Self::Unspecified => std::option::Option::Some(0),
4298 Self::PreparingStorageBucket => std::option::Option::Some(1),
4299 Self::DownloadingBlueprint => std::option::Option::Some(2),
4300 Self::RunningTfInit => std::option::Option::Some(3),
4301 Self::RunningTfPlan => std::option::Option::Some(4),
4302 Self::RunningTfApply => std::option::Option::Some(5),
4303 Self::RunningTfDestroy => std::option::Option::Some(6),
4304 Self::RunningTfValidate => std::option::Option::Some(7),
4305 Self::UnlockingDeployment => std::option::Option::Some(8),
4306 Self::Succeeded => std::option::Option::Some(9),
4307 Self::Failed => std::option::Option::Some(10),
4308 Self::ValidatingRepository => std::option::Option::Some(11),
4309 Self::RunningQuotaValidation => std::option::Option::Some(12),
4310 Self::UnknownValue(u) => u.0.value(),
4311 }
4312 }
4313
4314 /// Gets the enum value as a string.
4315 ///
4316 /// Returns `None` if the enum contains an unknown value deserialized from
4317 /// the integer representation of enums.
4318 pub fn name(&self) -> std::option::Option<&str> {
4319 match self {
4320 Self::Unspecified => std::option::Option::Some("DEPLOYMENT_STEP_UNSPECIFIED"),
4321 Self::PreparingStorageBucket => {
4322 std::option::Option::Some("PREPARING_STORAGE_BUCKET")
4323 }
4324 Self::DownloadingBlueprint => std::option::Option::Some("DOWNLOADING_BLUEPRINT"),
4325 Self::RunningTfInit => std::option::Option::Some("RUNNING_TF_INIT"),
4326 Self::RunningTfPlan => std::option::Option::Some("RUNNING_TF_PLAN"),
4327 Self::RunningTfApply => std::option::Option::Some("RUNNING_TF_APPLY"),
4328 Self::RunningTfDestroy => std::option::Option::Some("RUNNING_TF_DESTROY"),
4329 Self::RunningTfValidate => std::option::Option::Some("RUNNING_TF_VALIDATE"),
4330 Self::UnlockingDeployment => std::option::Option::Some("UNLOCKING_DEPLOYMENT"),
4331 Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
4332 Self::Failed => std::option::Option::Some("FAILED"),
4333 Self::ValidatingRepository => std::option::Option::Some("VALIDATING_REPOSITORY"),
4334 Self::RunningQuotaValidation => {
4335 std::option::Option::Some("RUNNING_QUOTA_VALIDATION")
4336 }
4337 Self::UnknownValue(u) => u.0.name(),
4338 }
4339 }
4340 }
4341
4342 impl std::default::Default for DeploymentStep {
4343 fn default() -> Self {
4344 use std::convert::From;
4345 Self::from(0)
4346 }
4347 }
4348
4349 impl std::fmt::Display for DeploymentStep {
4350 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4351 wkt::internal::display_enum(f, self.name(), self.value())
4352 }
4353 }
4354
4355 impl std::convert::From<i32> for DeploymentStep {
4356 fn from(value: i32) -> Self {
4357 match value {
4358 0 => Self::Unspecified,
4359 1 => Self::PreparingStorageBucket,
4360 2 => Self::DownloadingBlueprint,
4361 3 => Self::RunningTfInit,
4362 4 => Self::RunningTfPlan,
4363 5 => Self::RunningTfApply,
4364 6 => Self::RunningTfDestroy,
4365 7 => Self::RunningTfValidate,
4366 8 => Self::UnlockingDeployment,
4367 9 => Self::Succeeded,
4368 10 => Self::Failed,
4369 11 => Self::ValidatingRepository,
4370 12 => Self::RunningQuotaValidation,
4371 _ => Self::UnknownValue(deployment_step::UnknownValue(
4372 wkt::internal::UnknownEnumValue::Integer(value),
4373 )),
4374 }
4375 }
4376 }
4377
4378 impl std::convert::From<&str> for DeploymentStep {
4379 fn from(value: &str) -> Self {
4380 use std::string::ToString;
4381 match value {
4382 "DEPLOYMENT_STEP_UNSPECIFIED" => Self::Unspecified,
4383 "PREPARING_STORAGE_BUCKET" => Self::PreparingStorageBucket,
4384 "DOWNLOADING_BLUEPRINT" => Self::DownloadingBlueprint,
4385 "RUNNING_TF_INIT" => Self::RunningTfInit,
4386 "RUNNING_TF_PLAN" => Self::RunningTfPlan,
4387 "RUNNING_TF_APPLY" => Self::RunningTfApply,
4388 "RUNNING_TF_DESTROY" => Self::RunningTfDestroy,
4389 "RUNNING_TF_VALIDATE" => Self::RunningTfValidate,
4390 "UNLOCKING_DEPLOYMENT" => Self::UnlockingDeployment,
4391 "SUCCEEDED" => Self::Succeeded,
4392 "FAILED" => Self::Failed,
4393 "VALIDATING_REPOSITORY" => Self::ValidatingRepository,
4394 "RUNNING_QUOTA_VALIDATION" => Self::RunningQuotaValidation,
4395 _ => Self::UnknownValue(deployment_step::UnknownValue(
4396 wkt::internal::UnknownEnumValue::String(value.to_string()),
4397 )),
4398 }
4399 }
4400 }
4401
4402 impl serde::ser::Serialize for DeploymentStep {
4403 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4404 where
4405 S: serde::Serializer,
4406 {
4407 match self {
4408 Self::Unspecified => serializer.serialize_i32(0),
4409 Self::PreparingStorageBucket => serializer.serialize_i32(1),
4410 Self::DownloadingBlueprint => serializer.serialize_i32(2),
4411 Self::RunningTfInit => serializer.serialize_i32(3),
4412 Self::RunningTfPlan => serializer.serialize_i32(4),
4413 Self::RunningTfApply => serializer.serialize_i32(5),
4414 Self::RunningTfDestroy => serializer.serialize_i32(6),
4415 Self::RunningTfValidate => serializer.serialize_i32(7),
4416 Self::UnlockingDeployment => serializer.serialize_i32(8),
4417 Self::Succeeded => serializer.serialize_i32(9),
4418 Self::Failed => serializer.serialize_i32(10),
4419 Self::ValidatingRepository => serializer.serialize_i32(11),
4420 Self::RunningQuotaValidation => serializer.serialize_i32(12),
4421 Self::UnknownValue(u) => u.0.serialize(serializer),
4422 }
4423 }
4424 }
4425
4426 impl<'de> serde::de::Deserialize<'de> for DeploymentStep {
4427 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4428 where
4429 D: serde::Deserializer<'de>,
4430 {
4431 deserializer.deserialize_any(wkt::internal::EnumVisitor::<DeploymentStep>::new(
4432 ".google.cloud.config.v1.DeploymentOperationMetadata.DeploymentStep",
4433 ))
4434 }
4435 }
4436}
4437
4438/// Resource represents a Google Cloud Platform resource actuated by IM.
4439/// Resources are child resources of Revisions.
4440#[derive(Clone, Default, PartialEq)]
4441#[non_exhaustive]
4442pub struct Resource {
4443 /// Output only. Resource name.
4444 /// Format:
4445 /// `projects/{project}/locations/{location}/deployments/{deployment}/revisions/{revision}/resources/{resource}`
4446 pub name: std::string::String,
4447
4448 /// Output only. Terraform-specific info if this resource was created using
4449 /// Terraform.
4450 pub terraform_info: std::option::Option<crate::model::ResourceTerraformInfo>,
4451
4452 /// Output only. Map of Cloud Asset Inventory (CAI) type to CAI info (e.g. CAI
4453 /// ID). CAI type format follows
4454 /// <https://cloud.google.com/asset-inventory/docs/supported-asset-types>
4455 pub cai_assets: std::collections::HashMap<std::string::String, crate::model::ResourceCAIInfo>,
4456
4457 /// Output only. Intent of the resource.
4458 pub intent: crate::model::resource::Intent,
4459
4460 /// Output only. Current state of the resource.
4461 pub state: crate::model::resource::State,
4462
4463 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4464}
4465
4466impl Resource {
4467 pub fn new() -> Self {
4468 std::default::Default::default()
4469 }
4470
4471 /// Sets the value of [name][crate::model::Resource::name].
4472 ///
4473 /// # Example
4474 /// ```ignore,no_run
4475 /// # use google_cloud_config_v1::model::Resource;
4476 /// let x = Resource::new().set_name("example");
4477 /// ```
4478 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4479 self.name = v.into();
4480 self
4481 }
4482
4483 /// Sets the value of [terraform_info][crate::model::Resource::terraform_info].
4484 ///
4485 /// # Example
4486 /// ```ignore,no_run
4487 /// # use google_cloud_config_v1::model::Resource;
4488 /// use google_cloud_config_v1::model::ResourceTerraformInfo;
4489 /// let x = Resource::new().set_terraform_info(ResourceTerraformInfo::default()/* use setters */);
4490 /// ```
4491 pub fn set_terraform_info<T>(mut self, v: T) -> Self
4492 where
4493 T: std::convert::Into<crate::model::ResourceTerraformInfo>,
4494 {
4495 self.terraform_info = std::option::Option::Some(v.into());
4496 self
4497 }
4498
4499 /// Sets or clears the value of [terraform_info][crate::model::Resource::terraform_info].
4500 ///
4501 /// # Example
4502 /// ```ignore,no_run
4503 /// # use google_cloud_config_v1::model::Resource;
4504 /// use google_cloud_config_v1::model::ResourceTerraformInfo;
4505 /// let x = Resource::new().set_or_clear_terraform_info(Some(ResourceTerraformInfo::default()/* use setters */));
4506 /// let x = Resource::new().set_or_clear_terraform_info(None::<ResourceTerraformInfo>);
4507 /// ```
4508 pub fn set_or_clear_terraform_info<T>(mut self, v: std::option::Option<T>) -> Self
4509 where
4510 T: std::convert::Into<crate::model::ResourceTerraformInfo>,
4511 {
4512 self.terraform_info = v.map(|x| x.into());
4513 self
4514 }
4515
4516 /// Sets the value of [cai_assets][crate::model::Resource::cai_assets].
4517 ///
4518 /// # Example
4519 /// ```ignore,no_run
4520 /// # use google_cloud_config_v1::model::Resource;
4521 /// use google_cloud_config_v1::model::ResourceCAIInfo;
4522 /// let x = Resource::new().set_cai_assets([
4523 /// ("key0", ResourceCAIInfo::default()/* use setters */),
4524 /// ("key1", ResourceCAIInfo::default()/* use (different) setters */),
4525 /// ]);
4526 /// ```
4527 pub fn set_cai_assets<T, K, V>(mut self, v: T) -> Self
4528 where
4529 T: std::iter::IntoIterator<Item = (K, V)>,
4530 K: std::convert::Into<std::string::String>,
4531 V: std::convert::Into<crate::model::ResourceCAIInfo>,
4532 {
4533 use std::iter::Iterator;
4534 self.cai_assets = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
4535 self
4536 }
4537
4538 /// Sets the value of [intent][crate::model::Resource::intent].
4539 ///
4540 /// # Example
4541 /// ```ignore,no_run
4542 /// # use google_cloud_config_v1::model::Resource;
4543 /// use google_cloud_config_v1::model::resource::Intent;
4544 /// let x0 = Resource::new().set_intent(Intent::Create);
4545 /// let x1 = Resource::new().set_intent(Intent::Update);
4546 /// let x2 = Resource::new().set_intent(Intent::Delete);
4547 /// ```
4548 pub fn set_intent<T: std::convert::Into<crate::model::resource::Intent>>(
4549 mut self,
4550 v: T,
4551 ) -> Self {
4552 self.intent = v.into();
4553 self
4554 }
4555
4556 /// Sets the value of [state][crate::model::Resource::state].
4557 ///
4558 /// # Example
4559 /// ```ignore,no_run
4560 /// # use google_cloud_config_v1::model::Resource;
4561 /// use google_cloud_config_v1::model::resource::State;
4562 /// let x0 = Resource::new().set_state(State::Planned);
4563 /// let x1 = Resource::new().set_state(State::InProgress);
4564 /// let x2 = Resource::new().set_state(State::Reconciled);
4565 /// ```
4566 pub fn set_state<T: std::convert::Into<crate::model::resource::State>>(mut self, v: T) -> Self {
4567 self.state = v.into();
4568 self
4569 }
4570}
4571
4572impl wkt::message::Message for Resource {
4573 fn typename() -> &'static str {
4574 "type.googleapis.com/google.cloud.config.v1.Resource"
4575 }
4576}
4577
4578/// Defines additional types related to [Resource].
4579pub mod resource {
4580 #[allow(unused_imports)]
4581 use super::*;
4582
4583 /// Possible intent of the resource.
4584 ///
4585 /// # Working with unknown values
4586 ///
4587 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4588 /// additional enum variants at any time. Adding new variants is not considered
4589 /// a breaking change. Applications should write their code in anticipation of:
4590 ///
4591 /// - New values appearing in future releases of the client library, **and**
4592 /// - New values received dynamically, without application changes.
4593 ///
4594 /// Please consult the [Working with enums] section in the user guide for some
4595 /// guidelines.
4596 ///
4597 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
4598 #[derive(Clone, Debug, PartialEq)]
4599 #[non_exhaustive]
4600 pub enum Intent {
4601 /// The default value. This value is used if the intent is omitted.
4602 Unspecified,
4603 /// Infra Manager will create this Resource.
4604 Create,
4605 /// Infra Manager will update this Resource.
4606 Update,
4607 /// Infra Manager will delete this Resource.
4608 Delete,
4609 /// Infra Manager will destroy and recreate this Resource.
4610 Recreate,
4611 /// Infra Manager will leave this Resource untouched.
4612 Unchanged,
4613 /// If set, the enum was initialized with an unknown value.
4614 ///
4615 /// Applications can examine the value using [Intent::value] or
4616 /// [Intent::name].
4617 UnknownValue(intent::UnknownValue),
4618 }
4619
4620 #[doc(hidden)]
4621 pub mod intent {
4622 #[allow(unused_imports)]
4623 use super::*;
4624 #[derive(Clone, Debug, PartialEq)]
4625 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4626 }
4627
4628 impl Intent {
4629 /// Gets the enum value.
4630 ///
4631 /// Returns `None` if the enum contains an unknown value deserialized from
4632 /// the string representation of enums.
4633 pub fn value(&self) -> std::option::Option<i32> {
4634 match self {
4635 Self::Unspecified => std::option::Option::Some(0),
4636 Self::Create => std::option::Option::Some(1),
4637 Self::Update => std::option::Option::Some(2),
4638 Self::Delete => std::option::Option::Some(3),
4639 Self::Recreate => std::option::Option::Some(4),
4640 Self::Unchanged => std::option::Option::Some(5),
4641 Self::UnknownValue(u) => u.0.value(),
4642 }
4643 }
4644
4645 /// Gets the enum value as a string.
4646 ///
4647 /// Returns `None` if the enum contains an unknown value deserialized from
4648 /// the integer representation of enums.
4649 pub fn name(&self) -> std::option::Option<&str> {
4650 match self {
4651 Self::Unspecified => std::option::Option::Some("INTENT_UNSPECIFIED"),
4652 Self::Create => std::option::Option::Some("CREATE"),
4653 Self::Update => std::option::Option::Some("UPDATE"),
4654 Self::Delete => std::option::Option::Some("DELETE"),
4655 Self::Recreate => std::option::Option::Some("RECREATE"),
4656 Self::Unchanged => std::option::Option::Some("UNCHANGED"),
4657 Self::UnknownValue(u) => u.0.name(),
4658 }
4659 }
4660 }
4661
4662 impl std::default::Default for Intent {
4663 fn default() -> Self {
4664 use std::convert::From;
4665 Self::from(0)
4666 }
4667 }
4668
4669 impl std::fmt::Display for Intent {
4670 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4671 wkt::internal::display_enum(f, self.name(), self.value())
4672 }
4673 }
4674
4675 impl std::convert::From<i32> for Intent {
4676 fn from(value: i32) -> Self {
4677 match value {
4678 0 => Self::Unspecified,
4679 1 => Self::Create,
4680 2 => Self::Update,
4681 3 => Self::Delete,
4682 4 => Self::Recreate,
4683 5 => Self::Unchanged,
4684 _ => Self::UnknownValue(intent::UnknownValue(
4685 wkt::internal::UnknownEnumValue::Integer(value),
4686 )),
4687 }
4688 }
4689 }
4690
4691 impl std::convert::From<&str> for Intent {
4692 fn from(value: &str) -> Self {
4693 use std::string::ToString;
4694 match value {
4695 "INTENT_UNSPECIFIED" => Self::Unspecified,
4696 "CREATE" => Self::Create,
4697 "UPDATE" => Self::Update,
4698 "DELETE" => Self::Delete,
4699 "RECREATE" => Self::Recreate,
4700 "UNCHANGED" => Self::Unchanged,
4701 _ => Self::UnknownValue(intent::UnknownValue(
4702 wkt::internal::UnknownEnumValue::String(value.to_string()),
4703 )),
4704 }
4705 }
4706 }
4707
4708 impl serde::ser::Serialize for Intent {
4709 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4710 where
4711 S: serde::Serializer,
4712 {
4713 match self {
4714 Self::Unspecified => serializer.serialize_i32(0),
4715 Self::Create => serializer.serialize_i32(1),
4716 Self::Update => serializer.serialize_i32(2),
4717 Self::Delete => serializer.serialize_i32(3),
4718 Self::Recreate => serializer.serialize_i32(4),
4719 Self::Unchanged => serializer.serialize_i32(5),
4720 Self::UnknownValue(u) => u.0.serialize(serializer),
4721 }
4722 }
4723 }
4724
4725 impl<'de> serde::de::Deserialize<'de> for Intent {
4726 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4727 where
4728 D: serde::Deserializer<'de>,
4729 {
4730 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Intent>::new(
4731 ".google.cloud.config.v1.Resource.Intent",
4732 ))
4733 }
4734 }
4735
4736 /// Possible states of a resource.
4737 ///
4738 /// # Working with unknown values
4739 ///
4740 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4741 /// additional enum variants at any time. Adding new variants is not considered
4742 /// a breaking change. Applications should write their code in anticipation of:
4743 ///
4744 /// - New values appearing in future releases of the client library, **and**
4745 /// - New values received dynamically, without application changes.
4746 ///
4747 /// Please consult the [Working with enums] section in the user guide for some
4748 /// guidelines.
4749 ///
4750 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
4751 #[derive(Clone, Debug, PartialEq)]
4752 #[non_exhaustive]
4753 pub enum State {
4754 /// The default value. This value is used if the state is omitted.
4755 Unspecified,
4756 /// Resource has been planned for reconcile.
4757 Planned,
4758 /// Resource is actively reconciling into the intended state.
4759 InProgress,
4760 /// Resource has reconciled to intended state.
4761 Reconciled,
4762 /// Resource failed to reconcile.
4763 Failed,
4764 /// If set, the enum was initialized with an unknown value.
4765 ///
4766 /// Applications can examine the value using [State::value] or
4767 /// [State::name].
4768 UnknownValue(state::UnknownValue),
4769 }
4770
4771 #[doc(hidden)]
4772 pub mod state {
4773 #[allow(unused_imports)]
4774 use super::*;
4775 #[derive(Clone, Debug, PartialEq)]
4776 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4777 }
4778
4779 impl State {
4780 /// Gets the enum value.
4781 ///
4782 /// Returns `None` if the enum contains an unknown value deserialized from
4783 /// the string representation of enums.
4784 pub fn value(&self) -> std::option::Option<i32> {
4785 match self {
4786 Self::Unspecified => std::option::Option::Some(0),
4787 Self::Planned => std::option::Option::Some(1),
4788 Self::InProgress => std::option::Option::Some(2),
4789 Self::Reconciled => std::option::Option::Some(3),
4790 Self::Failed => std::option::Option::Some(4),
4791 Self::UnknownValue(u) => u.0.value(),
4792 }
4793 }
4794
4795 /// Gets the enum value as a string.
4796 ///
4797 /// Returns `None` if the enum contains an unknown value deserialized from
4798 /// the integer representation of enums.
4799 pub fn name(&self) -> std::option::Option<&str> {
4800 match self {
4801 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
4802 Self::Planned => std::option::Option::Some("PLANNED"),
4803 Self::InProgress => std::option::Option::Some("IN_PROGRESS"),
4804 Self::Reconciled => std::option::Option::Some("RECONCILED"),
4805 Self::Failed => std::option::Option::Some("FAILED"),
4806 Self::UnknownValue(u) => u.0.name(),
4807 }
4808 }
4809 }
4810
4811 impl std::default::Default for State {
4812 fn default() -> Self {
4813 use std::convert::From;
4814 Self::from(0)
4815 }
4816 }
4817
4818 impl std::fmt::Display for State {
4819 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4820 wkt::internal::display_enum(f, self.name(), self.value())
4821 }
4822 }
4823
4824 impl std::convert::From<i32> for State {
4825 fn from(value: i32) -> Self {
4826 match value {
4827 0 => Self::Unspecified,
4828 1 => Self::Planned,
4829 2 => Self::InProgress,
4830 3 => Self::Reconciled,
4831 4 => Self::Failed,
4832 _ => Self::UnknownValue(state::UnknownValue(
4833 wkt::internal::UnknownEnumValue::Integer(value),
4834 )),
4835 }
4836 }
4837 }
4838
4839 impl std::convert::From<&str> for State {
4840 fn from(value: &str) -> Self {
4841 use std::string::ToString;
4842 match value {
4843 "STATE_UNSPECIFIED" => Self::Unspecified,
4844 "PLANNED" => Self::Planned,
4845 "IN_PROGRESS" => Self::InProgress,
4846 "RECONCILED" => Self::Reconciled,
4847 "FAILED" => Self::Failed,
4848 _ => Self::UnknownValue(state::UnknownValue(
4849 wkt::internal::UnknownEnumValue::String(value.to_string()),
4850 )),
4851 }
4852 }
4853 }
4854
4855 impl serde::ser::Serialize for State {
4856 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4857 where
4858 S: serde::Serializer,
4859 {
4860 match self {
4861 Self::Unspecified => serializer.serialize_i32(0),
4862 Self::Planned => serializer.serialize_i32(1),
4863 Self::InProgress => serializer.serialize_i32(2),
4864 Self::Reconciled => serializer.serialize_i32(3),
4865 Self::Failed => serializer.serialize_i32(4),
4866 Self::UnknownValue(u) => u.0.serialize(serializer),
4867 }
4868 }
4869 }
4870
4871 impl<'de> serde::de::Deserialize<'de> for State {
4872 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4873 where
4874 D: serde::Deserializer<'de>,
4875 {
4876 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
4877 ".google.cloud.config.v1.Resource.State",
4878 ))
4879 }
4880 }
4881}
4882
4883/// Terraform info of a Resource.
4884#[derive(Clone, Default, PartialEq)]
4885#[non_exhaustive]
4886pub struct ResourceTerraformInfo {
4887 /// TF resource address that uniquely identifies this resource within this
4888 /// deployment.
4889 pub address: std::string::String,
4890
4891 /// TF resource type
4892 pub r#type: std::string::String,
4893
4894 /// ID attribute of the TF resource
4895 pub id: std::string::String,
4896
4897 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4898}
4899
4900impl ResourceTerraformInfo {
4901 pub fn new() -> Self {
4902 std::default::Default::default()
4903 }
4904
4905 /// Sets the value of [address][crate::model::ResourceTerraformInfo::address].
4906 ///
4907 /// # Example
4908 /// ```ignore,no_run
4909 /// # use google_cloud_config_v1::model::ResourceTerraformInfo;
4910 /// let x = ResourceTerraformInfo::new().set_address("example");
4911 /// ```
4912 pub fn set_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4913 self.address = v.into();
4914 self
4915 }
4916
4917 /// Sets the value of [r#type][crate::model::ResourceTerraformInfo::type].
4918 ///
4919 /// # Example
4920 /// ```ignore,no_run
4921 /// # use google_cloud_config_v1::model::ResourceTerraformInfo;
4922 /// let x = ResourceTerraformInfo::new().set_type("example");
4923 /// ```
4924 pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4925 self.r#type = v.into();
4926 self
4927 }
4928
4929 /// Sets the value of [id][crate::model::ResourceTerraformInfo::id].
4930 ///
4931 /// # Example
4932 /// ```ignore,no_run
4933 /// # use google_cloud_config_v1::model::ResourceTerraformInfo;
4934 /// let x = ResourceTerraformInfo::new().set_id("example");
4935 /// ```
4936 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4937 self.id = v.into();
4938 self
4939 }
4940}
4941
4942impl wkt::message::Message for ResourceTerraformInfo {
4943 fn typename() -> &'static str {
4944 "type.googleapis.com/google.cloud.config.v1.ResourceTerraformInfo"
4945 }
4946}
4947
4948/// CAI info of a Resource.
4949#[derive(Clone, Default, PartialEq)]
4950#[non_exhaustive]
4951pub struct ResourceCAIInfo {
4952 /// CAI resource name in the format following
4953 /// <https://cloud.google.com/apis/design/resource_names#full_resource_name>
4954 pub full_resource_name: std::string::String,
4955
4956 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4957}
4958
4959impl ResourceCAIInfo {
4960 pub fn new() -> Self {
4961 std::default::Default::default()
4962 }
4963
4964 /// Sets the value of [full_resource_name][crate::model::ResourceCAIInfo::full_resource_name].
4965 ///
4966 /// # Example
4967 /// ```ignore,no_run
4968 /// # use google_cloud_config_v1::model::ResourceCAIInfo;
4969 /// let x = ResourceCAIInfo::new().set_full_resource_name("example");
4970 /// ```
4971 pub fn set_full_resource_name<T: std::convert::Into<std::string::String>>(
4972 mut self,
4973 v: T,
4974 ) -> Self {
4975 self.full_resource_name = v.into();
4976 self
4977 }
4978}
4979
4980impl wkt::message::Message for ResourceCAIInfo {
4981 fn typename() -> &'static str {
4982 "type.googleapis.com/google.cloud.config.v1.ResourceCAIInfo"
4983 }
4984}
4985
4986/// A request to get a Resource from a 'GetResource' call.
4987#[derive(Clone, Default, PartialEq)]
4988#[non_exhaustive]
4989pub struct GetResourceRequest {
4990 /// Required. The name of the Resource in the format:
4991 /// 'projects/{project_id}/locations/{location}/deployments/{deployment}/revisions/{revision}/resource/{resource}'.
4992 pub name: std::string::String,
4993
4994 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4995}
4996
4997impl GetResourceRequest {
4998 pub fn new() -> Self {
4999 std::default::Default::default()
5000 }
5001
5002 /// Sets the value of [name][crate::model::GetResourceRequest::name].
5003 ///
5004 /// # Example
5005 /// ```ignore,no_run
5006 /// # use google_cloud_config_v1::model::GetResourceRequest;
5007 /// let x = GetResourceRequest::new().set_name("example");
5008 /// ```
5009 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5010 self.name = v.into();
5011 self
5012 }
5013}
5014
5015impl wkt::message::Message for GetResourceRequest {
5016 fn typename() -> &'static str {
5017 "type.googleapis.com/google.cloud.config.v1.GetResourceRequest"
5018 }
5019}
5020
5021/// A request to list Resources passed to a 'ListResources' call.
5022#[derive(Clone, Default, PartialEq)]
5023#[non_exhaustive]
5024pub struct ListResourcesRequest {
5025 /// Required. The parent in whose context the Resources are listed. The parent
5026 /// value is in the format:
5027 /// 'projects/{project_id}/locations/{location}/deployments/{deployment}/revisions/{revision}'.
5028 pub parent: std::string::String,
5029
5030 /// When requesting a page of resources, 'page_size' specifies number of
5031 /// resources to return. If unspecified, at most 500 will be returned. The
5032 /// maximum value is 1000.
5033 pub page_size: i32,
5034
5035 /// Token returned by previous call to 'ListResources' which specifies the
5036 /// position in the list from where to continue listing the resources.
5037 pub page_token: std::string::String,
5038
5039 /// Lists the Resources that match the filter expression. A filter
5040 /// expression filters the resources listed in the response. The expression
5041 /// must be of the form '{field} {operator} {value}' where operators: '<', '>',
5042 /// '<=',
5043 /// '>=',
5044 /// '!=', '=', ':' are supported (colon ':' represents a HAS operator which is
5045 /// roughly synonymous with equality). {field} can refer to a proto or JSON
5046 /// field, or a synthetic field. Field names can be camelCase or snake_case.
5047 ///
5048 /// Examples:
5049 ///
5050 /// - Filter by name:
5051 /// name =
5052 /// "projects/foo/locations/us-central1/deployments/dep/revisions/bar/resources/baz
5053 pub filter: std::string::String,
5054
5055 /// Field to use to sort the list.
5056 pub order_by: std::string::String,
5057
5058 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5059}
5060
5061impl ListResourcesRequest {
5062 pub fn new() -> Self {
5063 std::default::Default::default()
5064 }
5065
5066 /// Sets the value of [parent][crate::model::ListResourcesRequest::parent].
5067 ///
5068 /// # Example
5069 /// ```ignore,no_run
5070 /// # use google_cloud_config_v1::model::ListResourcesRequest;
5071 /// let x = ListResourcesRequest::new().set_parent("example");
5072 /// ```
5073 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5074 self.parent = v.into();
5075 self
5076 }
5077
5078 /// Sets the value of [page_size][crate::model::ListResourcesRequest::page_size].
5079 ///
5080 /// # Example
5081 /// ```ignore,no_run
5082 /// # use google_cloud_config_v1::model::ListResourcesRequest;
5083 /// let x = ListResourcesRequest::new().set_page_size(42);
5084 /// ```
5085 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5086 self.page_size = v.into();
5087 self
5088 }
5089
5090 /// Sets the value of [page_token][crate::model::ListResourcesRequest::page_token].
5091 ///
5092 /// # Example
5093 /// ```ignore,no_run
5094 /// # use google_cloud_config_v1::model::ListResourcesRequest;
5095 /// let x = ListResourcesRequest::new().set_page_token("example");
5096 /// ```
5097 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5098 self.page_token = v.into();
5099 self
5100 }
5101
5102 /// Sets the value of [filter][crate::model::ListResourcesRequest::filter].
5103 ///
5104 /// # Example
5105 /// ```ignore,no_run
5106 /// # use google_cloud_config_v1::model::ListResourcesRequest;
5107 /// let x = ListResourcesRequest::new().set_filter("example");
5108 /// ```
5109 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5110 self.filter = v.into();
5111 self
5112 }
5113
5114 /// Sets the value of [order_by][crate::model::ListResourcesRequest::order_by].
5115 ///
5116 /// # Example
5117 /// ```ignore,no_run
5118 /// # use google_cloud_config_v1::model::ListResourcesRequest;
5119 /// let x = ListResourcesRequest::new().set_order_by("example");
5120 /// ```
5121 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5122 self.order_by = v.into();
5123 self
5124 }
5125}
5126
5127impl wkt::message::Message for ListResourcesRequest {
5128 fn typename() -> &'static str {
5129 "type.googleapis.com/google.cloud.config.v1.ListResourcesRequest"
5130 }
5131}
5132
5133/// A response to a 'ListResources' call. Contains a list of Resources.
5134#[derive(Clone, Default, PartialEq)]
5135#[non_exhaustive]
5136pub struct ListResourcesResponse {
5137 /// List of [Resources][google.cloud.config.v1.Resource].
5138 ///
5139 /// [google.cloud.config.v1.Resource]: crate::model::Resource
5140 pub resources: std::vec::Vec<crate::model::Resource>,
5141
5142 /// A token to request the next page of resources from the 'ListResources'
5143 /// method. The value of an empty string means that there are no more resources
5144 /// to return.
5145 pub next_page_token: std::string::String,
5146
5147 /// Locations that could not be reached.
5148 pub unreachable: std::vec::Vec<std::string::String>,
5149
5150 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5151}
5152
5153impl ListResourcesResponse {
5154 pub fn new() -> Self {
5155 std::default::Default::default()
5156 }
5157
5158 /// Sets the value of [resources][crate::model::ListResourcesResponse::resources].
5159 ///
5160 /// # Example
5161 /// ```ignore,no_run
5162 /// # use google_cloud_config_v1::model::ListResourcesResponse;
5163 /// use google_cloud_config_v1::model::Resource;
5164 /// let x = ListResourcesResponse::new()
5165 /// .set_resources([
5166 /// Resource::default()/* use setters */,
5167 /// Resource::default()/* use (different) setters */,
5168 /// ]);
5169 /// ```
5170 pub fn set_resources<T, V>(mut self, v: T) -> Self
5171 where
5172 T: std::iter::IntoIterator<Item = V>,
5173 V: std::convert::Into<crate::model::Resource>,
5174 {
5175 use std::iter::Iterator;
5176 self.resources = v.into_iter().map(|i| i.into()).collect();
5177 self
5178 }
5179
5180 /// Sets the value of [next_page_token][crate::model::ListResourcesResponse::next_page_token].
5181 ///
5182 /// # Example
5183 /// ```ignore,no_run
5184 /// # use google_cloud_config_v1::model::ListResourcesResponse;
5185 /// let x = ListResourcesResponse::new().set_next_page_token("example");
5186 /// ```
5187 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5188 self.next_page_token = v.into();
5189 self
5190 }
5191
5192 /// Sets the value of [unreachable][crate::model::ListResourcesResponse::unreachable].
5193 ///
5194 /// # Example
5195 /// ```ignore,no_run
5196 /// # use google_cloud_config_v1::model::ListResourcesResponse;
5197 /// let x = ListResourcesResponse::new().set_unreachable(["a", "b", "c"]);
5198 /// ```
5199 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
5200 where
5201 T: std::iter::IntoIterator<Item = V>,
5202 V: std::convert::Into<std::string::String>,
5203 {
5204 use std::iter::Iterator;
5205 self.unreachable = v.into_iter().map(|i| i.into()).collect();
5206 self
5207 }
5208}
5209
5210impl wkt::message::Message for ListResourcesResponse {
5211 fn typename() -> &'static str {
5212 "type.googleapis.com/google.cloud.config.v1.ListResourcesResponse"
5213 }
5214}
5215
5216#[doc(hidden)]
5217impl gax::paginator::internal::PageableResponse for ListResourcesResponse {
5218 type PageItem = crate::model::Resource;
5219
5220 fn items(self) -> std::vec::Vec<Self::PageItem> {
5221 self.resources
5222 }
5223
5224 fn next_page_token(&self) -> std::string::String {
5225 use std::clone::Clone;
5226 self.next_page_token.clone()
5227 }
5228}
5229
5230/// Contains info about a Terraform state file
5231#[derive(Clone, Default, PartialEq)]
5232#[non_exhaustive]
5233pub struct Statefile {
5234 /// Output only. Cloud Storage signed URI used for downloading or uploading the
5235 /// state file.
5236 pub signed_uri: std::string::String,
5237
5238 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5239}
5240
5241impl Statefile {
5242 pub fn new() -> Self {
5243 std::default::Default::default()
5244 }
5245
5246 /// Sets the value of [signed_uri][crate::model::Statefile::signed_uri].
5247 ///
5248 /// # Example
5249 /// ```ignore,no_run
5250 /// # use google_cloud_config_v1::model::Statefile;
5251 /// let x = Statefile::new().set_signed_uri("example");
5252 /// ```
5253 pub fn set_signed_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5254 self.signed_uri = v.into();
5255 self
5256 }
5257}
5258
5259impl wkt::message::Message for Statefile {
5260 fn typename() -> &'static str {
5261 "type.googleapis.com/google.cloud.config.v1.Statefile"
5262 }
5263}
5264
5265/// A request to export a state file passed to a 'ExportDeploymentStatefile'
5266/// call.
5267#[derive(Clone, Default, PartialEq)]
5268#[non_exhaustive]
5269pub struct ExportDeploymentStatefileRequest {
5270 /// Required. The parent in whose context the statefile is listed. The parent
5271 /// value is in the format:
5272 /// 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
5273 pub parent: std::string::String,
5274
5275 /// Optional. If this flag is set to true, the exported deployment state file
5276 /// will be the draft state. This will enable the draft file to be validated
5277 /// before copying it over to the working state on unlock.
5278 pub draft: bool,
5279
5280 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5281}
5282
5283impl ExportDeploymentStatefileRequest {
5284 pub fn new() -> Self {
5285 std::default::Default::default()
5286 }
5287
5288 /// Sets the value of [parent][crate::model::ExportDeploymentStatefileRequest::parent].
5289 ///
5290 /// # Example
5291 /// ```ignore,no_run
5292 /// # use google_cloud_config_v1::model::ExportDeploymentStatefileRequest;
5293 /// let x = ExportDeploymentStatefileRequest::new().set_parent("example");
5294 /// ```
5295 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5296 self.parent = v.into();
5297 self
5298 }
5299
5300 /// Sets the value of [draft][crate::model::ExportDeploymentStatefileRequest::draft].
5301 ///
5302 /// # Example
5303 /// ```ignore,no_run
5304 /// # use google_cloud_config_v1::model::ExportDeploymentStatefileRequest;
5305 /// let x = ExportDeploymentStatefileRequest::new().set_draft(true);
5306 /// ```
5307 pub fn set_draft<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5308 self.draft = v.into();
5309 self
5310 }
5311}
5312
5313impl wkt::message::Message for ExportDeploymentStatefileRequest {
5314 fn typename() -> &'static str {
5315 "type.googleapis.com/google.cloud.config.v1.ExportDeploymentStatefileRequest"
5316 }
5317}
5318
5319/// A request to export a state file passed to a 'ExportRevisionStatefile'
5320/// call.
5321#[derive(Clone, Default, PartialEq)]
5322#[non_exhaustive]
5323pub struct ExportRevisionStatefileRequest {
5324 /// Required. The parent in whose context the statefile is listed. The parent
5325 /// value is in the format:
5326 /// 'projects/{project_id}/locations/{location}/deployments/{deployment}/revisions/{revision}'.
5327 pub parent: std::string::String,
5328
5329 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5330}
5331
5332impl ExportRevisionStatefileRequest {
5333 pub fn new() -> Self {
5334 std::default::Default::default()
5335 }
5336
5337 /// Sets the value of [parent][crate::model::ExportRevisionStatefileRequest::parent].
5338 ///
5339 /// # Example
5340 /// ```ignore,no_run
5341 /// # use google_cloud_config_v1::model::ExportRevisionStatefileRequest;
5342 /// let x = ExportRevisionStatefileRequest::new().set_parent("example");
5343 /// ```
5344 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5345 self.parent = v.into();
5346 self
5347 }
5348}
5349
5350impl wkt::message::Message for ExportRevisionStatefileRequest {
5351 fn typename() -> &'static str {
5352 "type.googleapis.com/google.cloud.config.v1.ExportRevisionStatefileRequest"
5353 }
5354}
5355
5356/// A request to import a state file passed to a 'ImportStatefile' call.
5357#[derive(Clone, Default, PartialEq)]
5358#[non_exhaustive]
5359pub struct ImportStatefileRequest {
5360 /// Required. The parent in whose context the statefile is listed. The parent
5361 /// value is in the format:
5362 /// 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
5363 pub parent: std::string::String,
5364
5365 /// Required. Lock ID of the lock file to verify that the user who is importing
5366 /// the state file previously locked the Deployment.
5367 pub lock_id: i64,
5368
5369 /// Optional.
5370 pub skip_draft: bool,
5371
5372 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5373}
5374
5375impl ImportStatefileRequest {
5376 pub fn new() -> Self {
5377 std::default::Default::default()
5378 }
5379
5380 /// Sets the value of [parent][crate::model::ImportStatefileRequest::parent].
5381 ///
5382 /// # Example
5383 /// ```ignore,no_run
5384 /// # use google_cloud_config_v1::model::ImportStatefileRequest;
5385 /// let x = ImportStatefileRequest::new().set_parent("example");
5386 /// ```
5387 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5388 self.parent = v.into();
5389 self
5390 }
5391
5392 /// Sets the value of [lock_id][crate::model::ImportStatefileRequest::lock_id].
5393 ///
5394 /// # Example
5395 /// ```ignore,no_run
5396 /// # use google_cloud_config_v1::model::ImportStatefileRequest;
5397 /// let x = ImportStatefileRequest::new().set_lock_id(42);
5398 /// ```
5399 pub fn set_lock_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
5400 self.lock_id = v.into();
5401 self
5402 }
5403
5404 /// Sets the value of [skip_draft][crate::model::ImportStatefileRequest::skip_draft].
5405 ///
5406 /// # Example
5407 /// ```ignore,no_run
5408 /// # use google_cloud_config_v1::model::ImportStatefileRequest;
5409 /// let x = ImportStatefileRequest::new().set_skip_draft(true);
5410 /// ```
5411 pub fn set_skip_draft<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5412 self.skip_draft = v.into();
5413 self
5414 }
5415}
5416
5417impl wkt::message::Message for ImportStatefileRequest {
5418 fn typename() -> &'static str {
5419 "type.googleapis.com/google.cloud.config.v1.ImportStatefileRequest"
5420 }
5421}
5422
5423/// A request to delete a state file passed to a 'DeleteStatefile' call.
5424#[derive(Clone, Default, PartialEq)]
5425#[non_exhaustive]
5426pub struct DeleteStatefileRequest {
5427 /// Required. The name of the deployment in the format:
5428 /// 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
5429 pub name: std::string::String,
5430
5431 /// Required. Lock ID of the lock file to verify that the user who is deleting
5432 /// the state file previously locked the Deployment.
5433 pub lock_id: i64,
5434
5435 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5436}
5437
5438impl DeleteStatefileRequest {
5439 pub fn new() -> Self {
5440 std::default::Default::default()
5441 }
5442
5443 /// Sets the value of [name][crate::model::DeleteStatefileRequest::name].
5444 ///
5445 /// # Example
5446 /// ```ignore,no_run
5447 /// # use google_cloud_config_v1::model::DeleteStatefileRequest;
5448 /// let x = DeleteStatefileRequest::new().set_name("example");
5449 /// ```
5450 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5451 self.name = v.into();
5452 self
5453 }
5454
5455 /// Sets the value of [lock_id][crate::model::DeleteStatefileRequest::lock_id].
5456 ///
5457 /// # Example
5458 /// ```ignore,no_run
5459 /// # use google_cloud_config_v1::model::DeleteStatefileRequest;
5460 /// let x = DeleteStatefileRequest::new().set_lock_id(42);
5461 /// ```
5462 pub fn set_lock_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
5463 self.lock_id = v.into();
5464 self
5465 }
5466}
5467
5468impl wkt::message::Message for DeleteStatefileRequest {
5469 fn typename() -> &'static str {
5470 "type.googleapis.com/google.cloud.config.v1.DeleteStatefileRequest"
5471 }
5472}
5473
5474/// A request to lock a deployment passed to a 'LockDeployment' call.
5475#[derive(Clone, Default, PartialEq)]
5476#[non_exhaustive]
5477pub struct LockDeploymentRequest {
5478 /// Required. The name of the deployment in the format:
5479 /// 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
5480 pub name: std::string::String,
5481
5482 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5483}
5484
5485impl LockDeploymentRequest {
5486 pub fn new() -> Self {
5487 std::default::Default::default()
5488 }
5489
5490 /// Sets the value of [name][crate::model::LockDeploymentRequest::name].
5491 ///
5492 /// # Example
5493 /// ```ignore,no_run
5494 /// # use google_cloud_config_v1::model::LockDeploymentRequest;
5495 /// let x = LockDeploymentRequest::new().set_name("example");
5496 /// ```
5497 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5498 self.name = v.into();
5499 self
5500 }
5501}
5502
5503impl wkt::message::Message for LockDeploymentRequest {
5504 fn typename() -> &'static str {
5505 "type.googleapis.com/google.cloud.config.v1.LockDeploymentRequest"
5506 }
5507}
5508
5509/// A request to unlock a state file passed to a 'UnlockDeployment' call.
5510#[derive(Clone, Default, PartialEq)]
5511#[non_exhaustive]
5512pub struct UnlockDeploymentRequest {
5513 /// Required. The name of the deployment in the format:
5514 /// 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
5515 pub name: std::string::String,
5516
5517 /// Required. Lock ID of the lock file to be unlocked.
5518 pub lock_id: i64,
5519
5520 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5521}
5522
5523impl UnlockDeploymentRequest {
5524 pub fn new() -> Self {
5525 std::default::Default::default()
5526 }
5527
5528 /// Sets the value of [name][crate::model::UnlockDeploymentRequest::name].
5529 ///
5530 /// # Example
5531 /// ```ignore,no_run
5532 /// # use google_cloud_config_v1::model::UnlockDeploymentRequest;
5533 /// let x = UnlockDeploymentRequest::new().set_name("example");
5534 /// ```
5535 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5536 self.name = v.into();
5537 self
5538 }
5539
5540 /// Sets the value of [lock_id][crate::model::UnlockDeploymentRequest::lock_id].
5541 ///
5542 /// # Example
5543 /// ```ignore,no_run
5544 /// # use google_cloud_config_v1::model::UnlockDeploymentRequest;
5545 /// let x = UnlockDeploymentRequest::new().set_lock_id(42);
5546 /// ```
5547 pub fn set_lock_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
5548 self.lock_id = v.into();
5549 self
5550 }
5551}
5552
5553impl wkt::message::Message for UnlockDeploymentRequest {
5554 fn typename() -> &'static str {
5555 "type.googleapis.com/google.cloud.config.v1.UnlockDeploymentRequest"
5556 }
5557}
5558
5559/// A request to get a state file lock info passed to a 'ExportLockInfo' call.
5560#[derive(Clone, Default, PartialEq)]
5561#[non_exhaustive]
5562pub struct ExportLockInfoRequest {
5563 /// Required. The name of the deployment in the format:
5564 /// 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
5565 pub name: std::string::String,
5566
5567 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5568}
5569
5570impl ExportLockInfoRequest {
5571 pub fn new() -> Self {
5572 std::default::Default::default()
5573 }
5574
5575 /// Sets the value of [name][crate::model::ExportLockInfoRequest::name].
5576 ///
5577 /// # Example
5578 /// ```ignore,no_run
5579 /// # use google_cloud_config_v1::model::ExportLockInfoRequest;
5580 /// let x = ExportLockInfoRequest::new().set_name("example");
5581 /// ```
5582 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5583 self.name = v.into();
5584 self
5585 }
5586}
5587
5588impl wkt::message::Message for ExportLockInfoRequest {
5589 fn typename() -> &'static str {
5590 "type.googleapis.com/google.cloud.config.v1.ExportLockInfoRequest"
5591 }
5592}
5593
5594/// Details about the lock which locked the deployment.
5595#[derive(Clone, Default, PartialEq)]
5596#[non_exhaustive]
5597pub struct LockInfo {
5598 /// Unique ID for the lock to be overridden with generation ID in the backend.
5599 pub lock_id: i64,
5600
5601 /// Terraform operation, provided by the caller.
5602 pub operation: std::string::String,
5603
5604 /// Extra information to store with the lock, provided by the caller.
5605 pub info: std::string::String,
5606
5607 /// user@hostname when available
5608 pub who: std::string::String,
5609
5610 /// Terraform version
5611 pub version: std::string::String,
5612
5613 /// Time that the lock was taken.
5614 pub create_time: std::option::Option<wkt::Timestamp>,
5615
5616 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5617}
5618
5619impl LockInfo {
5620 pub fn new() -> Self {
5621 std::default::Default::default()
5622 }
5623
5624 /// Sets the value of [lock_id][crate::model::LockInfo::lock_id].
5625 ///
5626 /// # Example
5627 /// ```ignore,no_run
5628 /// # use google_cloud_config_v1::model::LockInfo;
5629 /// let x = LockInfo::new().set_lock_id(42);
5630 /// ```
5631 pub fn set_lock_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
5632 self.lock_id = v.into();
5633 self
5634 }
5635
5636 /// Sets the value of [operation][crate::model::LockInfo::operation].
5637 ///
5638 /// # Example
5639 /// ```ignore,no_run
5640 /// # use google_cloud_config_v1::model::LockInfo;
5641 /// let x = LockInfo::new().set_operation("example");
5642 /// ```
5643 pub fn set_operation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5644 self.operation = v.into();
5645 self
5646 }
5647
5648 /// Sets the value of [info][crate::model::LockInfo::info].
5649 ///
5650 /// # Example
5651 /// ```ignore,no_run
5652 /// # use google_cloud_config_v1::model::LockInfo;
5653 /// let x = LockInfo::new().set_info("example");
5654 /// ```
5655 pub fn set_info<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5656 self.info = v.into();
5657 self
5658 }
5659
5660 /// Sets the value of [who][crate::model::LockInfo::who].
5661 ///
5662 /// # Example
5663 /// ```ignore,no_run
5664 /// # use google_cloud_config_v1::model::LockInfo;
5665 /// let x = LockInfo::new().set_who("example");
5666 /// ```
5667 pub fn set_who<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5668 self.who = v.into();
5669 self
5670 }
5671
5672 /// Sets the value of [version][crate::model::LockInfo::version].
5673 ///
5674 /// # Example
5675 /// ```ignore,no_run
5676 /// # use google_cloud_config_v1::model::LockInfo;
5677 /// let x = LockInfo::new().set_version("example");
5678 /// ```
5679 pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5680 self.version = v.into();
5681 self
5682 }
5683
5684 /// Sets the value of [create_time][crate::model::LockInfo::create_time].
5685 ///
5686 /// # Example
5687 /// ```ignore,no_run
5688 /// # use google_cloud_config_v1::model::LockInfo;
5689 /// use wkt::Timestamp;
5690 /// let x = LockInfo::new().set_create_time(Timestamp::default()/* use setters */);
5691 /// ```
5692 pub fn set_create_time<T>(mut self, v: T) -> Self
5693 where
5694 T: std::convert::Into<wkt::Timestamp>,
5695 {
5696 self.create_time = std::option::Option::Some(v.into());
5697 self
5698 }
5699
5700 /// Sets or clears the value of [create_time][crate::model::LockInfo::create_time].
5701 ///
5702 /// # Example
5703 /// ```ignore,no_run
5704 /// # use google_cloud_config_v1::model::LockInfo;
5705 /// use wkt::Timestamp;
5706 /// let x = LockInfo::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
5707 /// let x = LockInfo::new().set_or_clear_create_time(None::<Timestamp>);
5708 /// ```
5709 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
5710 where
5711 T: std::convert::Into<wkt::Timestamp>,
5712 {
5713 self.create_time = v.map(|x| x.into());
5714 self
5715 }
5716}
5717
5718impl wkt::message::Message for LockInfo {
5719 fn typename() -> &'static str {
5720 "type.googleapis.com/google.cloud.config.v1.LockInfo"
5721 }
5722}
5723
5724/// A preview represents a set of actions Infra Manager would perform
5725/// to move the resources towards the desired state as specified in the
5726/// configuration.
5727#[derive(Clone, Default, PartialEq)]
5728#[non_exhaustive]
5729pub struct Preview {
5730 /// Identifier. Resource name of the preview. Resource name can be user
5731 /// provided or server generated ID if unspecified. Format:
5732 /// `projects/{project}/locations/{location}/previews/{preview}`
5733 pub name: std::string::String,
5734
5735 /// Output only. Time the preview was created.
5736 pub create_time: std::option::Option<wkt::Timestamp>,
5737
5738 /// Optional. User-defined labels for the preview.
5739 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
5740
5741 /// Output only. Current state of the preview.
5742 pub state: crate::model::preview::State,
5743
5744 /// Optional. Optional deployment reference. If specified, the preview will be
5745 /// performed using the provided deployment's current state and use any
5746 /// relevant fields from the deployment unless explicitly specified in the
5747 /// preview create request.
5748 pub deployment: std::string::String,
5749
5750 /// Optional. Current mode of preview.
5751 pub preview_mode: crate::model::preview::PreviewMode,
5752
5753 /// Required. User-specified Service Account (SA) credentials to be used when
5754 /// previewing resources.
5755 /// Format: `projects/{projectID}/serviceAccounts/{serviceAccount}`
5756 pub service_account: std::string::String,
5757
5758 /// Optional. User-defined location of Cloud Build logs, artifacts, and
5759 /// in Google Cloud Storage.
5760 /// Format: `gs://{bucket}/{folder}`
5761 /// A default bucket will be bootstrapped if the field is not set or empty
5762 /// Default Bucket Format: `gs://<project number>-<region>-blueprint-config`
5763 /// Constraints:
5764 ///
5765 /// - The bucket needs to be in the same project as the deployment
5766 /// - The path cannot be within the path of `gcs_source`
5767 /// If omitted and deployment resource ref provided has artifacts_gcs_bucket
5768 /// defined, that artifact bucket is used.
5769 pub artifacts_gcs_bucket: std::option::Option<std::string::String>,
5770
5771 /// Optional. The user-specified Worker Pool resource in which the Cloud Build
5772 /// job will execute. Format
5773 /// projects/{project}/locations/{location}/workerPools/{workerPoolId} If this
5774 /// field is unspecified, the default Cloud Build worker pool will be used. If
5775 /// omitted and deployment resource ref provided has worker_pool defined, that
5776 /// worker pool is used.
5777 pub worker_pool: std::option::Option<std::string::String>,
5778
5779 /// Output only. Code describing any errors that may have occurred.
5780 pub error_code: crate::model::preview::ErrorCode,
5781
5782 /// Output only. Additional information regarding the current state.
5783 pub error_status: std::option::Option<rpc::model::Status>,
5784
5785 /// Output only. Cloud Build instance UUID associated with this preview.
5786 pub build: std::string::String,
5787
5788 /// Output only. Summary of errors encountered during Terraform preview.
5789 /// It has a size limit of 10, i.e. only top 10 errors will be summarized here.
5790 pub tf_errors: std::vec::Vec<crate::model::TerraformError>,
5791
5792 /// Output only. Link to tf-error.ndjson file, which contains the full list of
5793 /// the errors encountered during a Terraform preview.
5794 /// Format: `gs://{bucket}/{object}`.
5795 pub error_logs: std::string::String,
5796
5797 /// Output only. Artifacts from preview.
5798 pub preview_artifacts: std::option::Option<crate::model::PreviewArtifacts>,
5799
5800 /// Output only. Location of preview logs in `gs://{bucket}/{object}` format.
5801 pub logs: std::string::String,
5802
5803 /// Output only. The current Terraform version set on the preview.
5804 /// It is in the format of "Major.Minor.Patch", for example, "1.3.10".
5805 pub tf_version: std::string::String,
5806
5807 /// Optional. The user-specified Terraform version constraint.
5808 /// Example: "=1.3.10".
5809 pub tf_version_constraint: std::option::Option<std::string::String>,
5810
5811 /// Optional. Arbitrary key-value metadata storage e.g. to help client tools
5812 /// identify preview during automation. See
5813 /// <https://google.aip.dev/148#annotations> for details on format and size
5814 /// limitations.
5815 pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
5816
5817 /// Optional. This field specifies the provider configurations.
5818 pub provider_config: std::option::Option<crate::model::ProviderConfig>,
5819
5820 /// Blueprint to preview.
5821 pub blueprint: std::option::Option<crate::model::preview::Blueprint>,
5822
5823 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5824}
5825
5826impl Preview {
5827 pub fn new() -> Self {
5828 std::default::Default::default()
5829 }
5830
5831 /// Sets the value of [name][crate::model::Preview::name].
5832 ///
5833 /// # Example
5834 /// ```ignore,no_run
5835 /// # use google_cloud_config_v1::model::Preview;
5836 /// let x = Preview::new().set_name("example");
5837 /// ```
5838 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5839 self.name = v.into();
5840 self
5841 }
5842
5843 /// Sets the value of [create_time][crate::model::Preview::create_time].
5844 ///
5845 /// # Example
5846 /// ```ignore,no_run
5847 /// # use google_cloud_config_v1::model::Preview;
5848 /// use wkt::Timestamp;
5849 /// let x = Preview::new().set_create_time(Timestamp::default()/* use setters */);
5850 /// ```
5851 pub fn set_create_time<T>(mut self, v: T) -> Self
5852 where
5853 T: std::convert::Into<wkt::Timestamp>,
5854 {
5855 self.create_time = std::option::Option::Some(v.into());
5856 self
5857 }
5858
5859 /// Sets or clears the value of [create_time][crate::model::Preview::create_time].
5860 ///
5861 /// # Example
5862 /// ```ignore,no_run
5863 /// # use google_cloud_config_v1::model::Preview;
5864 /// use wkt::Timestamp;
5865 /// let x = Preview::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
5866 /// let x = Preview::new().set_or_clear_create_time(None::<Timestamp>);
5867 /// ```
5868 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
5869 where
5870 T: std::convert::Into<wkt::Timestamp>,
5871 {
5872 self.create_time = v.map(|x| x.into());
5873 self
5874 }
5875
5876 /// Sets the value of [labels][crate::model::Preview::labels].
5877 ///
5878 /// # Example
5879 /// ```ignore,no_run
5880 /// # use google_cloud_config_v1::model::Preview;
5881 /// let x = Preview::new().set_labels([
5882 /// ("key0", "abc"),
5883 /// ("key1", "xyz"),
5884 /// ]);
5885 /// ```
5886 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
5887 where
5888 T: std::iter::IntoIterator<Item = (K, V)>,
5889 K: std::convert::Into<std::string::String>,
5890 V: std::convert::Into<std::string::String>,
5891 {
5892 use std::iter::Iterator;
5893 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5894 self
5895 }
5896
5897 /// Sets the value of [state][crate::model::Preview::state].
5898 ///
5899 /// # Example
5900 /// ```ignore,no_run
5901 /// # use google_cloud_config_v1::model::Preview;
5902 /// use google_cloud_config_v1::model::preview::State;
5903 /// let x0 = Preview::new().set_state(State::Creating);
5904 /// let x1 = Preview::new().set_state(State::Succeeded);
5905 /// let x2 = Preview::new().set_state(State::Applying);
5906 /// ```
5907 pub fn set_state<T: std::convert::Into<crate::model::preview::State>>(mut self, v: T) -> Self {
5908 self.state = v.into();
5909 self
5910 }
5911
5912 /// Sets the value of [deployment][crate::model::Preview::deployment].
5913 ///
5914 /// # Example
5915 /// ```ignore,no_run
5916 /// # use google_cloud_config_v1::model::Preview;
5917 /// let x = Preview::new().set_deployment("example");
5918 /// ```
5919 pub fn set_deployment<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5920 self.deployment = v.into();
5921 self
5922 }
5923
5924 /// Sets the value of [preview_mode][crate::model::Preview::preview_mode].
5925 ///
5926 /// # Example
5927 /// ```ignore,no_run
5928 /// # use google_cloud_config_v1::model::Preview;
5929 /// use google_cloud_config_v1::model::preview::PreviewMode;
5930 /// let x0 = Preview::new().set_preview_mode(PreviewMode::Default);
5931 /// let x1 = Preview::new().set_preview_mode(PreviewMode::Delete);
5932 /// ```
5933 pub fn set_preview_mode<T: std::convert::Into<crate::model::preview::PreviewMode>>(
5934 mut self,
5935 v: T,
5936 ) -> Self {
5937 self.preview_mode = v.into();
5938 self
5939 }
5940
5941 /// Sets the value of [service_account][crate::model::Preview::service_account].
5942 ///
5943 /// # Example
5944 /// ```ignore,no_run
5945 /// # use google_cloud_config_v1::model::Preview;
5946 /// let x = Preview::new().set_service_account("example");
5947 /// ```
5948 pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5949 self.service_account = v.into();
5950 self
5951 }
5952
5953 /// Sets the value of [artifacts_gcs_bucket][crate::model::Preview::artifacts_gcs_bucket].
5954 ///
5955 /// # Example
5956 /// ```ignore,no_run
5957 /// # use google_cloud_config_v1::model::Preview;
5958 /// let x = Preview::new().set_artifacts_gcs_bucket("example");
5959 /// ```
5960 pub fn set_artifacts_gcs_bucket<T>(mut self, v: T) -> Self
5961 where
5962 T: std::convert::Into<std::string::String>,
5963 {
5964 self.artifacts_gcs_bucket = std::option::Option::Some(v.into());
5965 self
5966 }
5967
5968 /// Sets or clears the value of [artifacts_gcs_bucket][crate::model::Preview::artifacts_gcs_bucket].
5969 ///
5970 /// # Example
5971 /// ```ignore,no_run
5972 /// # use google_cloud_config_v1::model::Preview;
5973 /// let x = Preview::new().set_or_clear_artifacts_gcs_bucket(Some("example"));
5974 /// let x = Preview::new().set_or_clear_artifacts_gcs_bucket(None::<String>);
5975 /// ```
5976 pub fn set_or_clear_artifacts_gcs_bucket<T>(mut self, v: std::option::Option<T>) -> Self
5977 where
5978 T: std::convert::Into<std::string::String>,
5979 {
5980 self.artifacts_gcs_bucket = v.map(|x| x.into());
5981 self
5982 }
5983
5984 /// Sets the value of [worker_pool][crate::model::Preview::worker_pool].
5985 ///
5986 /// # Example
5987 /// ```ignore,no_run
5988 /// # use google_cloud_config_v1::model::Preview;
5989 /// let x = Preview::new().set_worker_pool("example");
5990 /// ```
5991 pub fn set_worker_pool<T>(mut self, v: T) -> Self
5992 where
5993 T: std::convert::Into<std::string::String>,
5994 {
5995 self.worker_pool = std::option::Option::Some(v.into());
5996 self
5997 }
5998
5999 /// Sets or clears the value of [worker_pool][crate::model::Preview::worker_pool].
6000 ///
6001 /// # Example
6002 /// ```ignore,no_run
6003 /// # use google_cloud_config_v1::model::Preview;
6004 /// let x = Preview::new().set_or_clear_worker_pool(Some("example"));
6005 /// let x = Preview::new().set_or_clear_worker_pool(None::<String>);
6006 /// ```
6007 pub fn set_or_clear_worker_pool<T>(mut self, v: std::option::Option<T>) -> Self
6008 where
6009 T: std::convert::Into<std::string::String>,
6010 {
6011 self.worker_pool = v.map(|x| x.into());
6012 self
6013 }
6014
6015 /// Sets the value of [error_code][crate::model::Preview::error_code].
6016 ///
6017 /// # Example
6018 /// ```ignore,no_run
6019 /// # use google_cloud_config_v1::model::Preview;
6020 /// use google_cloud_config_v1::model::preview::ErrorCode;
6021 /// let x0 = Preview::new().set_error_code(ErrorCode::CloudBuildPermissionDenied);
6022 /// let x1 = Preview::new().set_error_code(ErrorCode::BucketCreationPermissionDenied);
6023 /// let x2 = Preview::new().set_error_code(ErrorCode::BucketCreationFailed);
6024 /// ```
6025 pub fn set_error_code<T: std::convert::Into<crate::model::preview::ErrorCode>>(
6026 mut self,
6027 v: T,
6028 ) -> Self {
6029 self.error_code = v.into();
6030 self
6031 }
6032
6033 /// Sets the value of [error_status][crate::model::Preview::error_status].
6034 ///
6035 /// # Example
6036 /// ```ignore,no_run
6037 /// # use google_cloud_config_v1::model::Preview;
6038 /// use rpc::model::Status;
6039 /// let x = Preview::new().set_error_status(Status::default()/* use setters */);
6040 /// ```
6041 pub fn set_error_status<T>(mut self, v: T) -> Self
6042 where
6043 T: std::convert::Into<rpc::model::Status>,
6044 {
6045 self.error_status = std::option::Option::Some(v.into());
6046 self
6047 }
6048
6049 /// Sets or clears the value of [error_status][crate::model::Preview::error_status].
6050 ///
6051 /// # Example
6052 /// ```ignore,no_run
6053 /// # use google_cloud_config_v1::model::Preview;
6054 /// use rpc::model::Status;
6055 /// let x = Preview::new().set_or_clear_error_status(Some(Status::default()/* use setters */));
6056 /// let x = Preview::new().set_or_clear_error_status(None::<Status>);
6057 /// ```
6058 pub fn set_or_clear_error_status<T>(mut self, v: std::option::Option<T>) -> Self
6059 where
6060 T: std::convert::Into<rpc::model::Status>,
6061 {
6062 self.error_status = v.map(|x| x.into());
6063 self
6064 }
6065
6066 /// Sets the value of [build][crate::model::Preview::build].
6067 ///
6068 /// # Example
6069 /// ```ignore,no_run
6070 /// # use google_cloud_config_v1::model::Preview;
6071 /// let x = Preview::new().set_build("example");
6072 /// ```
6073 pub fn set_build<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6074 self.build = v.into();
6075 self
6076 }
6077
6078 /// Sets the value of [tf_errors][crate::model::Preview::tf_errors].
6079 ///
6080 /// # Example
6081 /// ```ignore,no_run
6082 /// # use google_cloud_config_v1::model::Preview;
6083 /// use google_cloud_config_v1::model::TerraformError;
6084 /// let x = Preview::new()
6085 /// .set_tf_errors([
6086 /// TerraformError::default()/* use setters */,
6087 /// TerraformError::default()/* use (different) setters */,
6088 /// ]);
6089 /// ```
6090 pub fn set_tf_errors<T, V>(mut self, v: T) -> Self
6091 where
6092 T: std::iter::IntoIterator<Item = V>,
6093 V: std::convert::Into<crate::model::TerraformError>,
6094 {
6095 use std::iter::Iterator;
6096 self.tf_errors = v.into_iter().map(|i| i.into()).collect();
6097 self
6098 }
6099
6100 /// Sets the value of [error_logs][crate::model::Preview::error_logs].
6101 ///
6102 /// # Example
6103 /// ```ignore,no_run
6104 /// # use google_cloud_config_v1::model::Preview;
6105 /// let x = Preview::new().set_error_logs("example");
6106 /// ```
6107 pub fn set_error_logs<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6108 self.error_logs = v.into();
6109 self
6110 }
6111
6112 /// Sets the value of [preview_artifacts][crate::model::Preview::preview_artifacts].
6113 ///
6114 /// # Example
6115 /// ```ignore,no_run
6116 /// # use google_cloud_config_v1::model::Preview;
6117 /// use google_cloud_config_v1::model::PreviewArtifacts;
6118 /// let x = Preview::new().set_preview_artifacts(PreviewArtifacts::default()/* use setters */);
6119 /// ```
6120 pub fn set_preview_artifacts<T>(mut self, v: T) -> Self
6121 where
6122 T: std::convert::Into<crate::model::PreviewArtifacts>,
6123 {
6124 self.preview_artifacts = std::option::Option::Some(v.into());
6125 self
6126 }
6127
6128 /// Sets or clears the value of [preview_artifacts][crate::model::Preview::preview_artifacts].
6129 ///
6130 /// # Example
6131 /// ```ignore,no_run
6132 /// # use google_cloud_config_v1::model::Preview;
6133 /// use google_cloud_config_v1::model::PreviewArtifacts;
6134 /// let x = Preview::new().set_or_clear_preview_artifacts(Some(PreviewArtifacts::default()/* use setters */));
6135 /// let x = Preview::new().set_or_clear_preview_artifacts(None::<PreviewArtifacts>);
6136 /// ```
6137 pub fn set_or_clear_preview_artifacts<T>(mut self, v: std::option::Option<T>) -> Self
6138 where
6139 T: std::convert::Into<crate::model::PreviewArtifacts>,
6140 {
6141 self.preview_artifacts = v.map(|x| x.into());
6142 self
6143 }
6144
6145 /// Sets the value of [logs][crate::model::Preview::logs].
6146 ///
6147 /// # Example
6148 /// ```ignore,no_run
6149 /// # use google_cloud_config_v1::model::Preview;
6150 /// let x = Preview::new().set_logs("example");
6151 /// ```
6152 pub fn set_logs<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6153 self.logs = v.into();
6154 self
6155 }
6156
6157 /// Sets the value of [tf_version][crate::model::Preview::tf_version].
6158 ///
6159 /// # Example
6160 /// ```ignore,no_run
6161 /// # use google_cloud_config_v1::model::Preview;
6162 /// let x = Preview::new().set_tf_version("example");
6163 /// ```
6164 pub fn set_tf_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6165 self.tf_version = v.into();
6166 self
6167 }
6168
6169 /// Sets the value of [tf_version_constraint][crate::model::Preview::tf_version_constraint].
6170 ///
6171 /// # Example
6172 /// ```ignore,no_run
6173 /// # use google_cloud_config_v1::model::Preview;
6174 /// let x = Preview::new().set_tf_version_constraint("example");
6175 /// ```
6176 pub fn set_tf_version_constraint<T>(mut self, v: T) -> Self
6177 where
6178 T: std::convert::Into<std::string::String>,
6179 {
6180 self.tf_version_constraint = std::option::Option::Some(v.into());
6181 self
6182 }
6183
6184 /// Sets or clears the value of [tf_version_constraint][crate::model::Preview::tf_version_constraint].
6185 ///
6186 /// # Example
6187 /// ```ignore,no_run
6188 /// # use google_cloud_config_v1::model::Preview;
6189 /// let x = Preview::new().set_or_clear_tf_version_constraint(Some("example"));
6190 /// let x = Preview::new().set_or_clear_tf_version_constraint(None::<String>);
6191 /// ```
6192 pub fn set_or_clear_tf_version_constraint<T>(mut self, v: std::option::Option<T>) -> Self
6193 where
6194 T: std::convert::Into<std::string::String>,
6195 {
6196 self.tf_version_constraint = v.map(|x| x.into());
6197 self
6198 }
6199
6200 /// Sets the value of [annotations][crate::model::Preview::annotations].
6201 ///
6202 /// # Example
6203 /// ```ignore,no_run
6204 /// # use google_cloud_config_v1::model::Preview;
6205 /// let x = Preview::new().set_annotations([
6206 /// ("key0", "abc"),
6207 /// ("key1", "xyz"),
6208 /// ]);
6209 /// ```
6210 pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
6211 where
6212 T: std::iter::IntoIterator<Item = (K, V)>,
6213 K: std::convert::Into<std::string::String>,
6214 V: std::convert::Into<std::string::String>,
6215 {
6216 use std::iter::Iterator;
6217 self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
6218 self
6219 }
6220
6221 /// Sets the value of [provider_config][crate::model::Preview::provider_config].
6222 ///
6223 /// # Example
6224 /// ```ignore,no_run
6225 /// # use google_cloud_config_v1::model::Preview;
6226 /// use google_cloud_config_v1::model::ProviderConfig;
6227 /// let x = Preview::new().set_provider_config(ProviderConfig::default()/* use setters */);
6228 /// ```
6229 pub fn set_provider_config<T>(mut self, v: T) -> Self
6230 where
6231 T: std::convert::Into<crate::model::ProviderConfig>,
6232 {
6233 self.provider_config = std::option::Option::Some(v.into());
6234 self
6235 }
6236
6237 /// Sets or clears the value of [provider_config][crate::model::Preview::provider_config].
6238 ///
6239 /// # Example
6240 /// ```ignore,no_run
6241 /// # use google_cloud_config_v1::model::Preview;
6242 /// use google_cloud_config_v1::model::ProviderConfig;
6243 /// let x = Preview::new().set_or_clear_provider_config(Some(ProviderConfig::default()/* use setters */));
6244 /// let x = Preview::new().set_or_clear_provider_config(None::<ProviderConfig>);
6245 /// ```
6246 pub fn set_or_clear_provider_config<T>(mut self, v: std::option::Option<T>) -> Self
6247 where
6248 T: std::convert::Into<crate::model::ProviderConfig>,
6249 {
6250 self.provider_config = v.map(|x| x.into());
6251 self
6252 }
6253
6254 /// Sets the value of [blueprint][crate::model::Preview::blueprint].
6255 ///
6256 /// Note that all the setters affecting `blueprint` are mutually
6257 /// exclusive.
6258 ///
6259 /// # Example
6260 /// ```ignore,no_run
6261 /// # use google_cloud_config_v1::model::Preview;
6262 /// use google_cloud_config_v1::model::TerraformBlueprint;
6263 /// let x = Preview::new().set_blueprint(Some(
6264 /// google_cloud_config_v1::model::preview::Blueprint::TerraformBlueprint(TerraformBlueprint::default().into())));
6265 /// ```
6266 pub fn set_blueprint<
6267 T: std::convert::Into<std::option::Option<crate::model::preview::Blueprint>>,
6268 >(
6269 mut self,
6270 v: T,
6271 ) -> Self {
6272 self.blueprint = v.into();
6273 self
6274 }
6275
6276 /// The value of [blueprint][crate::model::Preview::blueprint]
6277 /// if it holds a `TerraformBlueprint`, `None` if the field is not set or
6278 /// holds a different branch.
6279 pub fn terraform_blueprint(
6280 &self,
6281 ) -> std::option::Option<&std::boxed::Box<crate::model::TerraformBlueprint>> {
6282 #[allow(unreachable_patterns)]
6283 self.blueprint.as_ref().and_then(|v| match v {
6284 crate::model::preview::Blueprint::TerraformBlueprint(v) => std::option::Option::Some(v),
6285 _ => std::option::Option::None,
6286 })
6287 }
6288
6289 /// Sets the value of [blueprint][crate::model::Preview::blueprint]
6290 /// to hold a `TerraformBlueprint`.
6291 ///
6292 /// Note that all the setters affecting `blueprint` are
6293 /// mutually exclusive.
6294 ///
6295 /// # Example
6296 /// ```ignore,no_run
6297 /// # use google_cloud_config_v1::model::Preview;
6298 /// use google_cloud_config_v1::model::TerraformBlueprint;
6299 /// let x = Preview::new().set_terraform_blueprint(TerraformBlueprint::default()/* use setters */);
6300 /// assert!(x.terraform_blueprint().is_some());
6301 /// ```
6302 pub fn set_terraform_blueprint<
6303 T: std::convert::Into<std::boxed::Box<crate::model::TerraformBlueprint>>,
6304 >(
6305 mut self,
6306 v: T,
6307 ) -> Self {
6308 self.blueprint = std::option::Option::Some(
6309 crate::model::preview::Blueprint::TerraformBlueprint(v.into()),
6310 );
6311 self
6312 }
6313}
6314
6315impl wkt::message::Message for Preview {
6316 fn typename() -> &'static str {
6317 "type.googleapis.com/google.cloud.config.v1.Preview"
6318 }
6319}
6320
6321/// Defines additional types related to [Preview].
6322pub mod preview {
6323 #[allow(unused_imports)]
6324 use super::*;
6325
6326 /// Possible states of a preview.
6327 ///
6328 /// # Working with unknown values
6329 ///
6330 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6331 /// additional enum variants at any time. Adding new variants is not considered
6332 /// a breaking change. Applications should write their code in anticipation of:
6333 ///
6334 /// - New values appearing in future releases of the client library, **and**
6335 /// - New values received dynamically, without application changes.
6336 ///
6337 /// Please consult the [Working with enums] section in the user guide for some
6338 /// guidelines.
6339 ///
6340 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
6341 #[derive(Clone, Debug, PartialEq)]
6342 #[non_exhaustive]
6343 pub enum State {
6344 /// The default value. This value is used if the state is unknown.
6345 Unspecified,
6346 /// The preview is being created.
6347 Creating,
6348 /// The preview has succeeded.
6349 Succeeded,
6350 /// The preview is being applied.
6351 Applying,
6352 /// The preview is stale. A preview can become stale if a revision has been
6353 /// applied after this preview was created.
6354 Stale,
6355 /// The preview is being deleted.
6356 Deleting,
6357 /// The preview has encountered an unexpected error.
6358 Failed,
6359 /// The preview has been deleted.
6360 Deleted,
6361 /// If set, the enum was initialized with an unknown value.
6362 ///
6363 /// Applications can examine the value using [State::value] or
6364 /// [State::name].
6365 UnknownValue(state::UnknownValue),
6366 }
6367
6368 #[doc(hidden)]
6369 pub mod state {
6370 #[allow(unused_imports)]
6371 use super::*;
6372 #[derive(Clone, Debug, PartialEq)]
6373 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6374 }
6375
6376 impl State {
6377 /// Gets the enum value.
6378 ///
6379 /// Returns `None` if the enum contains an unknown value deserialized from
6380 /// the string representation of enums.
6381 pub fn value(&self) -> std::option::Option<i32> {
6382 match self {
6383 Self::Unspecified => std::option::Option::Some(0),
6384 Self::Creating => std::option::Option::Some(1),
6385 Self::Succeeded => std::option::Option::Some(2),
6386 Self::Applying => std::option::Option::Some(3),
6387 Self::Stale => std::option::Option::Some(4),
6388 Self::Deleting => std::option::Option::Some(5),
6389 Self::Failed => std::option::Option::Some(6),
6390 Self::Deleted => std::option::Option::Some(7),
6391 Self::UnknownValue(u) => u.0.value(),
6392 }
6393 }
6394
6395 /// Gets the enum value as a string.
6396 ///
6397 /// Returns `None` if the enum contains an unknown value deserialized from
6398 /// the integer representation of enums.
6399 pub fn name(&self) -> std::option::Option<&str> {
6400 match self {
6401 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
6402 Self::Creating => std::option::Option::Some("CREATING"),
6403 Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
6404 Self::Applying => std::option::Option::Some("APPLYING"),
6405 Self::Stale => std::option::Option::Some("STALE"),
6406 Self::Deleting => std::option::Option::Some("DELETING"),
6407 Self::Failed => std::option::Option::Some("FAILED"),
6408 Self::Deleted => std::option::Option::Some("DELETED"),
6409 Self::UnknownValue(u) => u.0.name(),
6410 }
6411 }
6412 }
6413
6414 impl std::default::Default for State {
6415 fn default() -> Self {
6416 use std::convert::From;
6417 Self::from(0)
6418 }
6419 }
6420
6421 impl std::fmt::Display for State {
6422 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6423 wkt::internal::display_enum(f, self.name(), self.value())
6424 }
6425 }
6426
6427 impl std::convert::From<i32> for State {
6428 fn from(value: i32) -> Self {
6429 match value {
6430 0 => Self::Unspecified,
6431 1 => Self::Creating,
6432 2 => Self::Succeeded,
6433 3 => Self::Applying,
6434 4 => Self::Stale,
6435 5 => Self::Deleting,
6436 6 => Self::Failed,
6437 7 => Self::Deleted,
6438 _ => Self::UnknownValue(state::UnknownValue(
6439 wkt::internal::UnknownEnumValue::Integer(value),
6440 )),
6441 }
6442 }
6443 }
6444
6445 impl std::convert::From<&str> for State {
6446 fn from(value: &str) -> Self {
6447 use std::string::ToString;
6448 match value {
6449 "STATE_UNSPECIFIED" => Self::Unspecified,
6450 "CREATING" => Self::Creating,
6451 "SUCCEEDED" => Self::Succeeded,
6452 "APPLYING" => Self::Applying,
6453 "STALE" => Self::Stale,
6454 "DELETING" => Self::Deleting,
6455 "FAILED" => Self::Failed,
6456 "DELETED" => Self::Deleted,
6457 _ => Self::UnknownValue(state::UnknownValue(
6458 wkt::internal::UnknownEnumValue::String(value.to_string()),
6459 )),
6460 }
6461 }
6462 }
6463
6464 impl serde::ser::Serialize for State {
6465 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6466 where
6467 S: serde::Serializer,
6468 {
6469 match self {
6470 Self::Unspecified => serializer.serialize_i32(0),
6471 Self::Creating => serializer.serialize_i32(1),
6472 Self::Succeeded => serializer.serialize_i32(2),
6473 Self::Applying => serializer.serialize_i32(3),
6474 Self::Stale => serializer.serialize_i32(4),
6475 Self::Deleting => serializer.serialize_i32(5),
6476 Self::Failed => serializer.serialize_i32(6),
6477 Self::Deleted => serializer.serialize_i32(7),
6478 Self::UnknownValue(u) => u.0.serialize(serializer),
6479 }
6480 }
6481 }
6482
6483 impl<'de> serde::de::Deserialize<'de> for State {
6484 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6485 where
6486 D: serde::Deserializer<'de>,
6487 {
6488 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
6489 ".google.cloud.config.v1.Preview.State",
6490 ))
6491 }
6492 }
6493
6494 /// Preview mode provides options for customizing preview operations.
6495 ///
6496 /// # Working with unknown values
6497 ///
6498 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6499 /// additional enum variants at any time. Adding new variants is not considered
6500 /// a breaking change. Applications should write their code in anticipation of:
6501 ///
6502 /// - New values appearing in future releases of the client library, **and**
6503 /// - New values received dynamically, without application changes.
6504 ///
6505 /// Please consult the [Working with enums] section in the user guide for some
6506 /// guidelines.
6507 ///
6508 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
6509 #[derive(Clone, Debug, PartialEq)]
6510 #[non_exhaustive]
6511 pub enum PreviewMode {
6512 /// Unspecified policy, default mode will be used.
6513 Unspecified,
6514 /// DEFAULT mode generates an execution plan for reconciling current resource
6515 /// state into expected resource state.
6516 Default,
6517 /// DELETE mode generates as execution plan for destroying current resources.
6518 Delete,
6519 /// If set, the enum was initialized with an unknown value.
6520 ///
6521 /// Applications can examine the value using [PreviewMode::value] or
6522 /// [PreviewMode::name].
6523 UnknownValue(preview_mode::UnknownValue),
6524 }
6525
6526 #[doc(hidden)]
6527 pub mod preview_mode {
6528 #[allow(unused_imports)]
6529 use super::*;
6530 #[derive(Clone, Debug, PartialEq)]
6531 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6532 }
6533
6534 impl PreviewMode {
6535 /// Gets the enum value.
6536 ///
6537 /// Returns `None` if the enum contains an unknown value deserialized from
6538 /// the string representation of enums.
6539 pub fn value(&self) -> std::option::Option<i32> {
6540 match self {
6541 Self::Unspecified => std::option::Option::Some(0),
6542 Self::Default => std::option::Option::Some(1),
6543 Self::Delete => std::option::Option::Some(2),
6544 Self::UnknownValue(u) => u.0.value(),
6545 }
6546 }
6547
6548 /// Gets the enum value as a string.
6549 ///
6550 /// Returns `None` if the enum contains an unknown value deserialized from
6551 /// the integer representation of enums.
6552 pub fn name(&self) -> std::option::Option<&str> {
6553 match self {
6554 Self::Unspecified => std::option::Option::Some("PREVIEW_MODE_UNSPECIFIED"),
6555 Self::Default => std::option::Option::Some("DEFAULT"),
6556 Self::Delete => std::option::Option::Some("DELETE"),
6557 Self::UnknownValue(u) => u.0.name(),
6558 }
6559 }
6560 }
6561
6562 impl std::default::Default for PreviewMode {
6563 fn default() -> Self {
6564 use std::convert::From;
6565 Self::from(0)
6566 }
6567 }
6568
6569 impl std::fmt::Display for PreviewMode {
6570 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6571 wkt::internal::display_enum(f, self.name(), self.value())
6572 }
6573 }
6574
6575 impl std::convert::From<i32> for PreviewMode {
6576 fn from(value: i32) -> Self {
6577 match value {
6578 0 => Self::Unspecified,
6579 1 => Self::Default,
6580 2 => Self::Delete,
6581 _ => Self::UnknownValue(preview_mode::UnknownValue(
6582 wkt::internal::UnknownEnumValue::Integer(value),
6583 )),
6584 }
6585 }
6586 }
6587
6588 impl std::convert::From<&str> for PreviewMode {
6589 fn from(value: &str) -> Self {
6590 use std::string::ToString;
6591 match value {
6592 "PREVIEW_MODE_UNSPECIFIED" => Self::Unspecified,
6593 "DEFAULT" => Self::Default,
6594 "DELETE" => Self::Delete,
6595 _ => Self::UnknownValue(preview_mode::UnknownValue(
6596 wkt::internal::UnknownEnumValue::String(value.to_string()),
6597 )),
6598 }
6599 }
6600 }
6601
6602 impl serde::ser::Serialize for PreviewMode {
6603 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6604 where
6605 S: serde::Serializer,
6606 {
6607 match self {
6608 Self::Unspecified => serializer.serialize_i32(0),
6609 Self::Default => serializer.serialize_i32(1),
6610 Self::Delete => serializer.serialize_i32(2),
6611 Self::UnknownValue(u) => u.0.serialize(serializer),
6612 }
6613 }
6614 }
6615
6616 impl<'de> serde::de::Deserialize<'de> for PreviewMode {
6617 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6618 where
6619 D: serde::Deserializer<'de>,
6620 {
6621 deserializer.deserialize_any(wkt::internal::EnumVisitor::<PreviewMode>::new(
6622 ".google.cloud.config.v1.Preview.PreviewMode",
6623 ))
6624 }
6625 }
6626
6627 /// Possible errors that can occur with previews.
6628 ///
6629 /// # Working with unknown values
6630 ///
6631 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6632 /// additional enum variants at any time. Adding new variants is not considered
6633 /// a breaking change. Applications should write their code in anticipation of:
6634 ///
6635 /// - New values appearing in future releases of the client library, **and**
6636 /// - New values received dynamically, without application changes.
6637 ///
6638 /// Please consult the [Working with enums] section in the user guide for some
6639 /// guidelines.
6640 ///
6641 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
6642 #[derive(Clone, Debug, PartialEq)]
6643 #[non_exhaustive]
6644 pub enum ErrorCode {
6645 /// No error code was specified.
6646 Unspecified,
6647 /// Cloud Build failed due to a permissions issue.
6648 CloudBuildPermissionDenied,
6649 /// Cloud Storage bucket failed to create due to a permissions issue.
6650 BucketCreationPermissionDenied,
6651 /// Cloud Storage bucket failed for a non-permissions-related issue.
6652 BucketCreationFailed,
6653 /// Acquiring lock on provided deployment reference failed.
6654 DeploymentLockAcquireFailed,
6655 /// Preview encountered an error when trying to access Cloud Build API.
6656 PreviewBuildApiFailed,
6657 /// Preview created a build but build failed and logs were generated.
6658 PreviewBuildRunFailed,
6659 /// Failed to import values from an external source.
6660 ExternalValueSourceImportFailed,
6661 /// If set, the enum was initialized with an unknown value.
6662 ///
6663 /// Applications can examine the value using [ErrorCode::value] or
6664 /// [ErrorCode::name].
6665 UnknownValue(error_code::UnknownValue),
6666 }
6667
6668 #[doc(hidden)]
6669 pub mod error_code {
6670 #[allow(unused_imports)]
6671 use super::*;
6672 #[derive(Clone, Debug, PartialEq)]
6673 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6674 }
6675
6676 impl ErrorCode {
6677 /// Gets the enum value.
6678 ///
6679 /// Returns `None` if the enum contains an unknown value deserialized from
6680 /// the string representation of enums.
6681 pub fn value(&self) -> std::option::Option<i32> {
6682 match self {
6683 Self::Unspecified => std::option::Option::Some(0),
6684 Self::CloudBuildPermissionDenied => std::option::Option::Some(1),
6685 Self::BucketCreationPermissionDenied => std::option::Option::Some(2),
6686 Self::BucketCreationFailed => std::option::Option::Some(3),
6687 Self::DeploymentLockAcquireFailed => std::option::Option::Some(4),
6688 Self::PreviewBuildApiFailed => std::option::Option::Some(5),
6689 Self::PreviewBuildRunFailed => std::option::Option::Some(6),
6690 Self::ExternalValueSourceImportFailed => std::option::Option::Some(7),
6691 Self::UnknownValue(u) => u.0.value(),
6692 }
6693 }
6694
6695 /// Gets the enum value as a string.
6696 ///
6697 /// Returns `None` if the enum contains an unknown value deserialized from
6698 /// the integer representation of enums.
6699 pub fn name(&self) -> std::option::Option<&str> {
6700 match self {
6701 Self::Unspecified => std::option::Option::Some("ERROR_CODE_UNSPECIFIED"),
6702 Self::CloudBuildPermissionDenied => {
6703 std::option::Option::Some("CLOUD_BUILD_PERMISSION_DENIED")
6704 }
6705 Self::BucketCreationPermissionDenied => {
6706 std::option::Option::Some("BUCKET_CREATION_PERMISSION_DENIED")
6707 }
6708 Self::BucketCreationFailed => std::option::Option::Some("BUCKET_CREATION_FAILED"),
6709 Self::DeploymentLockAcquireFailed => {
6710 std::option::Option::Some("DEPLOYMENT_LOCK_ACQUIRE_FAILED")
6711 }
6712 Self::PreviewBuildApiFailed => {
6713 std::option::Option::Some("PREVIEW_BUILD_API_FAILED")
6714 }
6715 Self::PreviewBuildRunFailed => {
6716 std::option::Option::Some("PREVIEW_BUILD_RUN_FAILED")
6717 }
6718 Self::ExternalValueSourceImportFailed => {
6719 std::option::Option::Some("EXTERNAL_VALUE_SOURCE_IMPORT_FAILED")
6720 }
6721 Self::UnknownValue(u) => u.0.name(),
6722 }
6723 }
6724 }
6725
6726 impl std::default::Default for ErrorCode {
6727 fn default() -> Self {
6728 use std::convert::From;
6729 Self::from(0)
6730 }
6731 }
6732
6733 impl std::fmt::Display for ErrorCode {
6734 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6735 wkt::internal::display_enum(f, self.name(), self.value())
6736 }
6737 }
6738
6739 impl std::convert::From<i32> for ErrorCode {
6740 fn from(value: i32) -> Self {
6741 match value {
6742 0 => Self::Unspecified,
6743 1 => Self::CloudBuildPermissionDenied,
6744 2 => Self::BucketCreationPermissionDenied,
6745 3 => Self::BucketCreationFailed,
6746 4 => Self::DeploymentLockAcquireFailed,
6747 5 => Self::PreviewBuildApiFailed,
6748 6 => Self::PreviewBuildRunFailed,
6749 7 => Self::ExternalValueSourceImportFailed,
6750 _ => Self::UnknownValue(error_code::UnknownValue(
6751 wkt::internal::UnknownEnumValue::Integer(value),
6752 )),
6753 }
6754 }
6755 }
6756
6757 impl std::convert::From<&str> for ErrorCode {
6758 fn from(value: &str) -> Self {
6759 use std::string::ToString;
6760 match value {
6761 "ERROR_CODE_UNSPECIFIED" => Self::Unspecified,
6762 "CLOUD_BUILD_PERMISSION_DENIED" => Self::CloudBuildPermissionDenied,
6763 "BUCKET_CREATION_PERMISSION_DENIED" => Self::BucketCreationPermissionDenied,
6764 "BUCKET_CREATION_FAILED" => Self::BucketCreationFailed,
6765 "DEPLOYMENT_LOCK_ACQUIRE_FAILED" => Self::DeploymentLockAcquireFailed,
6766 "PREVIEW_BUILD_API_FAILED" => Self::PreviewBuildApiFailed,
6767 "PREVIEW_BUILD_RUN_FAILED" => Self::PreviewBuildRunFailed,
6768 "EXTERNAL_VALUE_SOURCE_IMPORT_FAILED" => Self::ExternalValueSourceImportFailed,
6769 _ => Self::UnknownValue(error_code::UnknownValue(
6770 wkt::internal::UnknownEnumValue::String(value.to_string()),
6771 )),
6772 }
6773 }
6774 }
6775
6776 impl serde::ser::Serialize for ErrorCode {
6777 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6778 where
6779 S: serde::Serializer,
6780 {
6781 match self {
6782 Self::Unspecified => serializer.serialize_i32(0),
6783 Self::CloudBuildPermissionDenied => serializer.serialize_i32(1),
6784 Self::BucketCreationPermissionDenied => serializer.serialize_i32(2),
6785 Self::BucketCreationFailed => serializer.serialize_i32(3),
6786 Self::DeploymentLockAcquireFailed => serializer.serialize_i32(4),
6787 Self::PreviewBuildApiFailed => serializer.serialize_i32(5),
6788 Self::PreviewBuildRunFailed => serializer.serialize_i32(6),
6789 Self::ExternalValueSourceImportFailed => serializer.serialize_i32(7),
6790 Self::UnknownValue(u) => u.0.serialize(serializer),
6791 }
6792 }
6793 }
6794
6795 impl<'de> serde::de::Deserialize<'de> for ErrorCode {
6796 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6797 where
6798 D: serde::Deserializer<'de>,
6799 {
6800 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ErrorCode>::new(
6801 ".google.cloud.config.v1.Preview.ErrorCode",
6802 ))
6803 }
6804 }
6805
6806 /// Blueprint to preview.
6807 #[derive(Clone, Debug, PartialEq)]
6808 #[non_exhaustive]
6809 pub enum Blueprint {
6810 /// The terraform blueprint to preview.
6811 TerraformBlueprint(std::boxed::Box<crate::model::TerraformBlueprint>),
6812 }
6813}
6814
6815/// Ephemeral metadata content describing the state of a preview operation.
6816#[derive(Clone, Default, PartialEq)]
6817#[non_exhaustive]
6818pub struct PreviewOperationMetadata {
6819 /// The current step the preview operation is running.
6820 pub step: crate::model::preview_operation_metadata::PreviewStep,
6821
6822 /// Artifacts from preview.
6823 pub preview_artifacts: std::option::Option<crate::model::PreviewArtifacts>,
6824
6825 /// Output only. Location of preview logs in `gs://{bucket}/{object}` format.
6826 pub logs: std::string::String,
6827
6828 /// Output only. Cloud Build instance UUID associated with this preview.
6829 pub build: std::string::String,
6830
6831 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6832}
6833
6834impl PreviewOperationMetadata {
6835 pub fn new() -> Self {
6836 std::default::Default::default()
6837 }
6838
6839 /// Sets the value of [step][crate::model::PreviewOperationMetadata::step].
6840 ///
6841 /// # Example
6842 /// ```ignore,no_run
6843 /// # use google_cloud_config_v1::model::PreviewOperationMetadata;
6844 /// use google_cloud_config_v1::model::preview_operation_metadata::PreviewStep;
6845 /// let x0 = PreviewOperationMetadata::new().set_step(PreviewStep::PreparingStorageBucket);
6846 /// let x1 = PreviewOperationMetadata::new().set_step(PreviewStep::DownloadingBlueprint);
6847 /// let x2 = PreviewOperationMetadata::new().set_step(PreviewStep::RunningTfInit);
6848 /// ```
6849 pub fn set_step<
6850 T: std::convert::Into<crate::model::preview_operation_metadata::PreviewStep>,
6851 >(
6852 mut self,
6853 v: T,
6854 ) -> Self {
6855 self.step = v.into();
6856 self
6857 }
6858
6859 /// Sets the value of [preview_artifacts][crate::model::PreviewOperationMetadata::preview_artifacts].
6860 ///
6861 /// # Example
6862 /// ```ignore,no_run
6863 /// # use google_cloud_config_v1::model::PreviewOperationMetadata;
6864 /// use google_cloud_config_v1::model::PreviewArtifacts;
6865 /// let x = PreviewOperationMetadata::new().set_preview_artifacts(PreviewArtifacts::default()/* use setters */);
6866 /// ```
6867 pub fn set_preview_artifacts<T>(mut self, v: T) -> Self
6868 where
6869 T: std::convert::Into<crate::model::PreviewArtifacts>,
6870 {
6871 self.preview_artifacts = std::option::Option::Some(v.into());
6872 self
6873 }
6874
6875 /// Sets or clears the value of [preview_artifacts][crate::model::PreviewOperationMetadata::preview_artifacts].
6876 ///
6877 /// # Example
6878 /// ```ignore,no_run
6879 /// # use google_cloud_config_v1::model::PreviewOperationMetadata;
6880 /// use google_cloud_config_v1::model::PreviewArtifacts;
6881 /// let x = PreviewOperationMetadata::new().set_or_clear_preview_artifacts(Some(PreviewArtifacts::default()/* use setters */));
6882 /// let x = PreviewOperationMetadata::new().set_or_clear_preview_artifacts(None::<PreviewArtifacts>);
6883 /// ```
6884 pub fn set_or_clear_preview_artifacts<T>(mut self, v: std::option::Option<T>) -> Self
6885 where
6886 T: std::convert::Into<crate::model::PreviewArtifacts>,
6887 {
6888 self.preview_artifacts = v.map(|x| x.into());
6889 self
6890 }
6891
6892 /// Sets the value of [logs][crate::model::PreviewOperationMetadata::logs].
6893 ///
6894 /// # Example
6895 /// ```ignore,no_run
6896 /// # use google_cloud_config_v1::model::PreviewOperationMetadata;
6897 /// let x = PreviewOperationMetadata::new().set_logs("example");
6898 /// ```
6899 pub fn set_logs<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6900 self.logs = v.into();
6901 self
6902 }
6903
6904 /// Sets the value of [build][crate::model::PreviewOperationMetadata::build].
6905 ///
6906 /// # Example
6907 /// ```ignore,no_run
6908 /// # use google_cloud_config_v1::model::PreviewOperationMetadata;
6909 /// let x = PreviewOperationMetadata::new().set_build("example");
6910 /// ```
6911 pub fn set_build<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6912 self.build = v.into();
6913 self
6914 }
6915}
6916
6917impl wkt::message::Message for PreviewOperationMetadata {
6918 fn typename() -> &'static str {
6919 "type.googleapis.com/google.cloud.config.v1.PreviewOperationMetadata"
6920 }
6921}
6922
6923/// Defines additional types related to [PreviewOperationMetadata].
6924pub mod preview_operation_metadata {
6925 #[allow(unused_imports)]
6926 use super::*;
6927
6928 /// The possible steps a preview may be running.
6929 ///
6930 /// # Working with unknown values
6931 ///
6932 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6933 /// additional enum variants at any time. Adding new variants is not considered
6934 /// a breaking change. Applications should write their code in anticipation of:
6935 ///
6936 /// - New values appearing in future releases of the client library, **and**
6937 /// - New values received dynamically, without application changes.
6938 ///
6939 /// Please consult the [Working with enums] section in the user guide for some
6940 /// guidelines.
6941 ///
6942 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
6943 #[derive(Clone, Debug, PartialEq)]
6944 #[non_exhaustive]
6945 pub enum PreviewStep {
6946 /// Unspecified preview step.
6947 Unspecified,
6948 /// Infra Manager is creating a Google Cloud Storage bucket to store
6949 /// artifacts and metadata about the preview.
6950 PreparingStorageBucket,
6951 /// Downloading the blueprint onto the Google Cloud Storage bucket.
6952 DownloadingBlueprint,
6953 /// Initializing Terraform using `terraform init`.
6954 RunningTfInit,
6955 /// Running `terraform plan`.
6956 RunningTfPlan,
6957 /// Fetching a deployment.
6958 FetchingDeployment,
6959 /// Locking a deployment.
6960 LockingDeployment,
6961 /// Unlocking a deployment.
6962 UnlockingDeployment,
6963 /// Operation was successful.
6964 Succeeded,
6965 /// Operation failed.
6966 Failed,
6967 /// Validating the provided repository.
6968 ValidatingRepository,
6969 /// If set, the enum was initialized with an unknown value.
6970 ///
6971 /// Applications can examine the value using [PreviewStep::value] or
6972 /// [PreviewStep::name].
6973 UnknownValue(preview_step::UnknownValue),
6974 }
6975
6976 #[doc(hidden)]
6977 pub mod preview_step {
6978 #[allow(unused_imports)]
6979 use super::*;
6980 #[derive(Clone, Debug, PartialEq)]
6981 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6982 }
6983
6984 impl PreviewStep {
6985 /// Gets the enum value.
6986 ///
6987 /// Returns `None` if the enum contains an unknown value deserialized from
6988 /// the string representation of enums.
6989 pub fn value(&self) -> std::option::Option<i32> {
6990 match self {
6991 Self::Unspecified => std::option::Option::Some(0),
6992 Self::PreparingStorageBucket => std::option::Option::Some(1),
6993 Self::DownloadingBlueprint => std::option::Option::Some(2),
6994 Self::RunningTfInit => std::option::Option::Some(3),
6995 Self::RunningTfPlan => std::option::Option::Some(4),
6996 Self::FetchingDeployment => std::option::Option::Some(5),
6997 Self::LockingDeployment => std::option::Option::Some(6),
6998 Self::UnlockingDeployment => std::option::Option::Some(7),
6999 Self::Succeeded => std::option::Option::Some(8),
7000 Self::Failed => std::option::Option::Some(9),
7001 Self::ValidatingRepository => std::option::Option::Some(10),
7002 Self::UnknownValue(u) => u.0.value(),
7003 }
7004 }
7005
7006 /// Gets the enum value as a string.
7007 ///
7008 /// Returns `None` if the enum contains an unknown value deserialized from
7009 /// the integer representation of enums.
7010 pub fn name(&self) -> std::option::Option<&str> {
7011 match self {
7012 Self::Unspecified => std::option::Option::Some("PREVIEW_STEP_UNSPECIFIED"),
7013 Self::PreparingStorageBucket => {
7014 std::option::Option::Some("PREPARING_STORAGE_BUCKET")
7015 }
7016 Self::DownloadingBlueprint => std::option::Option::Some("DOWNLOADING_BLUEPRINT"),
7017 Self::RunningTfInit => std::option::Option::Some("RUNNING_TF_INIT"),
7018 Self::RunningTfPlan => std::option::Option::Some("RUNNING_TF_PLAN"),
7019 Self::FetchingDeployment => std::option::Option::Some("FETCHING_DEPLOYMENT"),
7020 Self::LockingDeployment => std::option::Option::Some("LOCKING_DEPLOYMENT"),
7021 Self::UnlockingDeployment => std::option::Option::Some("UNLOCKING_DEPLOYMENT"),
7022 Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
7023 Self::Failed => std::option::Option::Some("FAILED"),
7024 Self::ValidatingRepository => std::option::Option::Some("VALIDATING_REPOSITORY"),
7025 Self::UnknownValue(u) => u.0.name(),
7026 }
7027 }
7028 }
7029
7030 impl std::default::Default for PreviewStep {
7031 fn default() -> Self {
7032 use std::convert::From;
7033 Self::from(0)
7034 }
7035 }
7036
7037 impl std::fmt::Display for PreviewStep {
7038 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7039 wkt::internal::display_enum(f, self.name(), self.value())
7040 }
7041 }
7042
7043 impl std::convert::From<i32> for PreviewStep {
7044 fn from(value: i32) -> Self {
7045 match value {
7046 0 => Self::Unspecified,
7047 1 => Self::PreparingStorageBucket,
7048 2 => Self::DownloadingBlueprint,
7049 3 => Self::RunningTfInit,
7050 4 => Self::RunningTfPlan,
7051 5 => Self::FetchingDeployment,
7052 6 => Self::LockingDeployment,
7053 7 => Self::UnlockingDeployment,
7054 8 => Self::Succeeded,
7055 9 => Self::Failed,
7056 10 => Self::ValidatingRepository,
7057 _ => Self::UnknownValue(preview_step::UnknownValue(
7058 wkt::internal::UnknownEnumValue::Integer(value),
7059 )),
7060 }
7061 }
7062 }
7063
7064 impl std::convert::From<&str> for PreviewStep {
7065 fn from(value: &str) -> Self {
7066 use std::string::ToString;
7067 match value {
7068 "PREVIEW_STEP_UNSPECIFIED" => Self::Unspecified,
7069 "PREPARING_STORAGE_BUCKET" => Self::PreparingStorageBucket,
7070 "DOWNLOADING_BLUEPRINT" => Self::DownloadingBlueprint,
7071 "RUNNING_TF_INIT" => Self::RunningTfInit,
7072 "RUNNING_TF_PLAN" => Self::RunningTfPlan,
7073 "FETCHING_DEPLOYMENT" => Self::FetchingDeployment,
7074 "LOCKING_DEPLOYMENT" => Self::LockingDeployment,
7075 "UNLOCKING_DEPLOYMENT" => Self::UnlockingDeployment,
7076 "SUCCEEDED" => Self::Succeeded,
7077 "FAILED" => Self::Failed,
7078 "VALIDATING_REPOSITORY" => Self::ValidatingRepository,
7079 _ => Self::UnknownValue(preview_step::UnknownValue(
7080 wkt::internal::UnknownEnumValue::String(value.to_string()),
7081 )),
7082 }
7083 }
7084 }
7085
7086 impl serde::ser::Serialize for PreviewStep {
7087 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7088 where
7089 S: serde::Serializer,
7090 {
7091 match self {
7092 Self::Unspecified => serializer.serialize_i32(0),
7093 Self::PreparingStorageBucket => serializer.serialize_i32(1),
7094 Self::DownloadingBlueprint => serializer.serialize_i32(2),
7095 Self::RunningTfInit => serializer.serialize_i32(3),
7096 Self::RunningTfPlan => serializer.serialize_i32(4),
7097 Self::FetchingDeployment => serializer.serialize_i32(5),
7098 Self::LockingDeployment => serializer.serialize_i32(6),
7099 Self::UnlockingDeployment => serializer.serialize_i32(7),
7100 Self::Succeeded => serializer.serialize_i32(8),
7101 Self::Failed => serializer.serialize_i32(9),
7102 Self::ValidatingRepository => serializer.serialize_i32(10),
7103 Self::UnknownValue(u) => u.0.serialize(serializer),
7104 }
7105 }
7106 }
7107
7108 impl<'de> serde::de::Deserialize<'de> for PreviewStep {
7109 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7110 where
7111 D: serde::Deserializer<'de>,
7112 {
7113 deserializer.deserialize_any(wkt::internal::EnumVisitor::<PreviewStep>::new(
7114 ".google.cloud.config.v1.PreviewOperationMetadata.PreviewStep",
7115 ))
7116 }
7117 }
7118}
7119
7120/// Artifacts created by preview.
7121#[derive(Clone, Default, PartialEq)]
7122#[non_exhaustive]
7123pub struct PreviewArtifacts {
7124 /// Output only. Location of a blueprint copy and other content in Google Cloud
7125 /// Storage. Format: `gs://{bucket}/{object}`
7126 pub content: std::string::String,
7127
7128 /// Output only. Location of artifacts in Google Cloud Storage.
7129 /// Format: `gs://{bucket}/{object}`
7130 pub artifacts: std::string::String,
7131
7132 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7133}
7134
7135impl PreviewArtifacts {
7136 pub fn new() -> Self {
7137 std::default::Default::default()
7138 }
7139
7140 /// Sets the value of [content][crate::model::PreviewArtifacts::content].
7141 ///
7142 /// # Example
7143 /// ```ignore,no_run
7144 /// # use google_cloud_config_v1::model::PreviewArtifacts;
7145 /// let x = PreviewArtifacts::new().set_content("example");
7146 /// ```
7147 pub fn set_content<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7148 self.content = v.into();
7149 self
7150 }
7151
7152 /// Sets the value of [artifacts][crate::model::PreviewArtifacts::artifacts].
7153 ///
7154 /// # Example
7155 /// ```ignore,no_run
7156 /// # use google_cloud_config_v1::model::PreviewArtifacts;
7157 /// let x = PreviewArtifacts::new().set_artifacts("example");
7158 /// ```
7159 pub fn set_artifacts<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7160 self.artifacts = v.into();
7161 self
7162 }
7163}
7164
7165impl wkt::message::Message for PreviewArtifacts {
7166 fn typename() -> &'static str {
7167 "type.googleapis.com/google.cloud.config.v1.PreviewArtifacts"
7168 }
7169}
7170
7171/// A request to create a preview.
7172#[derive(Clone, Default, PartialEq)]
7173#[non_exhaustive]
7174pub struct CreatePreviewRequest {
7175 /// Required. The parent in whose context the Preview is created. The parent
7176 /// value is in the format: 'projects/{project_id}/locations/{location}'.
7177 pub parent: std::string::String,
7178
7179 /// Optional. The preview ID.
7180 pub preview_id: std::string::String,
7181
7182 /// Required. [Preview][google.cloud.config.v1.Preview] resource to be created.
7183 ///
7184 /// [google.cloud.config.v1.Preview]: crate::model::Preview
7185 pub preview: std::option::Option<crate::model::Preview>,
7186
7187 /// Optional. An optional request ID to identify requests. Specify a unique
7188 /// request ID so that if you must retry your request, the server will know to
7189 /// ignore the request if it has already been completed. The server will
7190 /// guarantee that for at least 60 minutes since the first request.
7191 ///
7192 /// For example, consider a situation where you make an initial request and the
7193 /// request times out. If you make the request again with the same request ID,
7194 /// the server can check if original operation with the same request ID was
7195 /// received, and if so, will ignore the second request. This prevents clients
7196 /// from accidentally creating duplicate commitments.
7197 ///
7198 /// The request ID must be a valid UUID with the exception that zero UUID is
7199 /// not supported (00000000-0000-0000-0000-000000000000).
7200 pub request_id: std::string::String,
7201
7202 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7203}
7204
7205impl CreatePreviewRequest {
7206 pub fn new() -> Self {
7207 std::default::Default::default()
7208 }
7209
7210 /// Sets the value of [parent][crate::model::CreatePreviewRequest::parent].
7211 ///
7212 /// # Example
7213 /// ```ignore,no_run
7214 /// # use google_cloud_config_v1::model::CreatePreviewRequest;
7215 /// let x = CreatePreviewRequest::new().set_parent("example");
7216 /// ```
7217 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7218 self.parent = v.into();
7219 self
7220 }
7221
7222 /// Sets the value of [preview_id][crate::model::CreatePreviewRequest::preview_id].
7223 ///
7224 /// # Example
7225 /// ```ignore,no_run
7226 /// # use google_cloud_config_v1::model::CreatePreviewRequest;
7227 /// let x = CreatePreviewRequest::new().set_preview_id("example");
7228 /// ```
7229 pub fn set_preview_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7230 self.preview_id = v.into();
7231 self
7232 }
7233
7234 /// Sets the value of [preview][crate::model::CreatePreviewRequest::preview].
7235 ///
7236 /// # Example
7237 /// ```ignore,no_run
7238 /// # use google_cloud_config_v1::model::CreatePreviewRequest;
7239 /// use google_cloud_config_v1::model::Preview;
7240 /// let x = CreatePreviewRequest::new().set_preview(Preview::default()/* use setters */);
7241 /// ```
7242 pub fn set_preview<T>(mut self, v: T) -> Self
7243 where
7244 T: std::convert::Into<crate::model::Preview>,
7245 {
7246 self.preview = std::option::Option::Some(v.into());
7247 self
7248 }
7249
7250 /// Sets or clears the value of [preview][crate::model::CreatePreviewRequest::preview].
7251 ///
7252 /// # Example
7253 /// ```ignore,no_run
7254 /// # use google_cloud_config_v1::model::CreatePreviewRequest;
7255 /// use google_cloud_config_v1::model::Preview;
7256 /// let x = CreatePreviewRequest::new().set_or_clear_preview(Some(Preview::default()/* use setters */));
7257 /// let x = CreatePreviewRequest::new().set_or_clear_preview(None::<Preview>);
7258 /// ```
7259 pub fn set_or_clear_preview<T>(mut self, v: std::option::Option<T>) -> Self
7260 where
7261 T: std::convert::Into<crate::model::Preview>,
7262 {
7263 self.preview = v.map(|x| x.into());
7264 self
7265 }
7266
7267 /// Sets the value of [request_id][crate::model::CreatePreviewRequest::request_id].
7268 ///
7269 /// # Example
7270 /// ```ignore,no_run
7271 /// # use google_cloud_config_v1::model::CreatePreviewRequest;
7272 /// let x = CreatePreviewRequest::new().set_request_id("example");
7273 /// ```
7274 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7275 self.request_id = v.into();
7276 self
7277 }
7278}
7279
7280impl wkt::message::Message for CreatePreviewRequest {
7281 fn typename() -> &'static str {
7282 "type.googleapis.com/google.cloud.config.v1.CreatePreviewRequest"
7283 }
7284}
7285
7286/// A request to get details about a preview.
7287#[derive(Clone, Default, PartialEq)]
7288#[non_exhaustive]
7289pub struct GetPreviewRequest {
7290 /// Required. The name of the preview. Format:
7291 /// 'projects/{project_id}/locations/{location}/previews/{preview}'.
7292 pub name: std::string::String,
7293
7294 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7295}
7296
7297impl GetPreviewRequest {
7298 pub fn new() -> Self {
7299 std::default::Default::default()
7300 }
7301
7302 /// Sets the value of [name][crate::model::GetPreviewRequest::name].
7303 ///
7304 /// # Example
7305 /// ```ignore,no_run
7306 /// # use google_cloud_config_v1::model::GetPreviewRequest;
7307 /// let x = GetPreviewRequest::new().set_name("example");
7308 /// ```
7309 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7310 self.name = v.into();
7311 self
7312 }
7313}
7314
7315impl wkt::message::Message for GetPreviewRequest {
7316 fn typename() -> &'static str {
7317 "type.googleapis.com/google.cloud.config.v1.GetPreviewRequest"
7318 }
7319}
7320
7321/// A request to list all previews for a given project and location.
7322#[derive(Clone, Default, PartialEq)]
7323#[non_exhaustive]
7324pub struct ListPreviewsRequest {
7325 /// Required. The parent in whose context the Previews are listed. The parent
7326 /// value is in the format: 'projects/{project_id}/locations/{location}'.
7327 pub parent: std::string::String,
7328
7329 /// Optional. When requesting a page of resources, 'page_size' specifies number
7330 /// of resources to return. If unspecified, at most 500 will be returned. The
7331 /// maximum value is 1000.
7332 pub page_size: i32,
7333
7334 /// Optional. Token returned by previous call to 'ListDeployments' which
7335 /// specifies the position in the list from where to continue listing the
7336 /// resources.
7337 pub page_token: std::string::String,
7338
7339 /// Optional. Lists the Deployments that match the filter expression. A filter
7340 /// expression filters the resources listed in the response. The expression
7341 /// must be of the form '{field} {operator} {value}' where operators: '<', '>',
7342 /// '<=', '>=', '!=', '=', ':' are supported (colon ':' represents a HAS
7343 /// operator which is roughly synonymous with equality). {field} can refer to a
7344 /// proto or JSON field, or a synthetic field. Field names can be camelCase or
7345 /// snake_case.
7346 ///
7347 /// Examples:
7348 ///
7349 /// - Filter by name:
7350 /// name = "projects/foo/locations/us-central1/deployments/bar
7351 ///
7352 /// - Filter by labels:
7353 ///
7354 /// - Resources that have a key called 'foo'
7355 /// labels.foo:*
7356 /// - Resources that have a key called 'foo' whose value is 'bar'
7357 /// labels.foo = bar
7358 /// - Filter by state:
7359 ///
7360 /// - Deployments in CREATING state.
7361 /// state=CREATING
7362 pub filter: std::string::String,
7363
7364 /// Optional. Field to use to sort the list.
7365 pub order_by: std::string::String,
7366
7367 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7368}
7369
7370impl ListPreviewsRequest {
7371 pub fn new() -> Self {
7372 std::default::Default::default()
7373 }
7374
7375 /// Sets the value of [parent][crate::model::ListPreviewsRequest::parent].
7376 ///
7377 /// # Example
7378 /// ```ignore,no_run
7379 /// # use google_cloud_config_v1::model::ListPreviewsRequest;
7380 /// let x = ListPreviewsRequest::new().set_parent("example");
7381 /// ```
7382 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7383 self.parent = v.into();
7384 self
7385 }
7386
7387 /// Sets the value of [page_size][crate::model::ListPreviewsRequest::page_size].
7388 ///
7389 /// # Example
7390 /// ```ignore,no_run
7391 /// # use google_cloud_config_v1::model::ListPreviewsRequest;
7392 /// let x = ListPreviewsRequest::new().set_page_size(42);
7393 /// ```
7394 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7395 self.page_size = v.into();
7396 self
7397 }
7398
7399 /// Sets the value of [page_token][crate::model::ListPreviewsRequest::page_token].
7400 ///
7401 /// # Example
7402 /// ```ignore,no_run
7403 /// # use google_cloud_config_v1::model::ListPreviewsRequest;
7404 /// let x = ListPreviewsRequest::new().set_page_token("example");
7405 /// ```
7406 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7407 self.page_token = v.into();
7408 self
7409 }
7410
7411 /// Sets the value of [filter][crate::model::ListPreviewsRequest::filter].
7412 ///
7413 /// # Example
7414 /// ```ignore,no_run
7415 /// # use google_cloud_config_v1::model::ListPreviewsRequest;
7416 /// let x = ListPreviewsRequest::new().set_filter("example");
7417 /// ```
7418 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7419 self.filter = v.into();
7420 self
7421 }
7422
7423 /// Sets the value of [order_by][crate::model::ListPreviewsRequest::order_by].
7424 ///
7425 /// # Example
7426 /// ```ignore,no_run
7427 /// # use google_cloud_config_v1::model::ListPreviewsRequest;
7428 /// let x = ListPreviewsRequest::new().set_order_by("example");
7429 /// ```
7430 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7431 self.order_by = v.into();
7432 self
7433 }
7434}
7435
7436impl wkt::message::Message for ListPreviewsRequest {
7437 fn typename() -> &'static str {
7438 "type.googleapis.com/google.cloud.config.v1.ListPreviewsRequest"
7439 }
7440}
7441
7442/// A response to a `ListPreviews` call. Contains a list of Previews.
7443#[derive(Clone, Default, PartialEq)]
7444#[non_exhaustive]
7445pub struct ListPreviewsResponse {
7446 /// List of [Previews][google.cloud.config.v1.Preview].
7447 ///
7448 /// [google.cloud.config.v1.Preview]: crate::model::Preview
7449 pub previews: std::vec::Vec<crate::model::Preview>,
7450
7451 /// Token to be supplied to the next ListPreviews request via `page_token`
7452 /// to obtain the next set of results.
7453 pub next_page_token: std::string::String,
7454
7455 /// Locations that could not be reached.
7456 pub unreachable: std::vec::Vec<std::string::String>,
7457
7458 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7459}
7460
7461impl ListPreviewsResponse {
7462 pub fn new() -> Self {
7463 std::default::Default::default()
7464 }
7465
7466 /// Sets the value of [previews][crate::model::ListPreviewsResponse::previews].
7467 ///
7468 /// # Example
7469 /// ```ignore,no_run
7470 /// # use google_cloud_config_v1::model::ListPreviewsResponse;
7471 /// use google_cloud_config_v1::model::Preview;
7472 /// let x = ListPreviewsResponse::new()
7473 /// .set_previews([
7474 /// Preview::default()/* use setters */,
7475 /// Preview::default()/* use (different) setters */,
7476 /// ]);
7477 /// ```
7478 pub fn set_previews<T, V>(mut self, v: T) -> Self
7479 where
7480 T: std::iter::IntoIterator<Item = V>,
7481 V: std::convert::Into<crate::model::Preview>,
7482 {
7483 use std::iter::Iterator;
7484 self.previews = v.into_iter().map(|i| i.into()).collect();
7485 self
7486 }
7487
7488 /// Sets the value of [next_page_token][crate::model::ListPreviewsResponse::next_page_token].
7489 ///
7490 /// # Example
7491 /// ```ignore,no_run
7492 /// # use google_cloud_config_v1::model::ListPreviewsResponse;
7493 /// let x = ListPreviewsResponse::new().set_next_page_token("example");
7494 /// ```
7495 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7496 self.next_page_token = v.into();
7497 self
7498 }
7499
7500 /// Sets the value of [unreachable][crate::model::ListPreviewsResponse::unreachable].
7501 ///
7502 /// # Example
7503 /// ```ignore,no_run
7504 /// # use google_cloud_config_v1::model::ListPreviewsResponse;
7505 /// let x = ListPreviewsResponse::new().set_unreachable(["a", "b", "c"]);
7506 /// ```
7507 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
7508 where
7509 T: std::iter::IntoIterator<Item = V>,
7510 V: std::convert::Into<std::string::String>,
7511 {
7512 use std::iter::Iterator;
7513 self.unreachable = v.into_iter().map(|i| i.into()).collect();
7514 self
7515 }
7516}
7517
7518impl wkt::message::Message for ListPreviewsResponse {
7519 fn typename() -> &'static str {
7520 "type.googleapis.com/google.cloud.config.v1.ListPreviewsResponse"
7521 }
7522}
7523
7524#[doc(hidden)]
7525impl gax::paginator::internal::PageableResponse for ListPreviewsResponse {
7526 type PageItem = crate::model::Preview;
7527
7528 fn items(self) -> std::vec::Vec<Self::PageItem> {
7529 self.previews
7530 }
7531
7532 fn next_page_token(&self) -> std::string::String {
7533 use std::clone::Clone;
7534 self.next_page_token.clone()
7535 }
7536}
7537
7538/// A request to delete a preview.
7539#[derive(Clone, Default, PartialEq)]
7540#[non_exhaustive]
7541pub struct DeletePreviewRequest {
7542 /// Required. The name of the Preview in the format:
7543 /// 'projects/{project_id}/locations/{location}/previews/{preview}'.
7544 pub name: std::string::String,
7545
7546 /// Optional. An optional request ID to identify requests. Specify a unique
7547 /// request ID so that if you must retry your request, the server will know to
7548 /// ignore the request if it has already been completed. The server will
7549 /// guarantee that for at least 60 minutes after the first request.
7550 ///
7551 /// For example, consider a situation where you make an initial request and the
7552 /// request times out. If you make the request again with the same request ID,
7553 /// the server can check if original operation with the same request ID was
7554 /// received, and if so, will ignore the second request. This prevents clients
7555 /// from accidentally creating duplicate commitments.
7556 ///
7557 /// The request ID must be a valid UUID with the exception that zero UUID is
7558 /// not supported (00000000-0000-0000-0000-000000000000).
7559 pub request_id: std::string::String,
7560
7561 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7562}
7563
7564impl DeletePreviewRequest {
7565 pub fn new() -> Self {
7566 std::default::Default::default()
7567 }
7568
7569 /// Sets the value of [name][crate::model::DeletePreviewRequest::name].
7570 ///
7571 /// # Example
7572 /// ```ignore,no_run
7573 /// # use google_cloud_config_v1::model::DeletePreviewRequest;
7574 /// let x = DeletePreviewRequest::new().set_name("example");
7575 /// ```
7576 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7577 self.name = v.into();
7578 self
7579 }
7580
7581 /// Sets the value of [request_id][crate::model::DeletePreviewRequest::request_id].
7582 ///
7583 /// # Example
7584 /// ```ignore,no_run
7585 /// # use google_cloud_config_v1::model::DeletePreviewRequest;
7586 /// let x = DeletePreviewRequest::new().set_request_id("example");
7587 /// ```
7588 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7589 self.request_id = v.into();
7590 self
7591 }
7592}
7593
7594impl wkt::message::Message for DeletePreviewRequest {
7595 fn typename() -> &'static str {
7596 "type.googleapis.com/google.cloud.config.v1.DeletePreviewRequest"
7597 }
7598}
7599
7600/// A request to export preview results.
7601#[derive(Clone, Default, PartialEq)]
7602#[non_exhaustive]
7603pub struct ExportPreviewResultRequest {
7604 /// Required. The preview whose results should be exported. The preview value
7605 /// is in the format:
7606 /// 'projects/{project_id}/locations/{location}/previews/{preview}'.
7607 pub parent: std::string::String,
7608
7609 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7610}
7611
7612impl ExportPreviewResultRequest {
7613 pub fn new() -> Self {
7614 std::default::Default::default()
7615 }
7616
7617 /// Sets the value of [parent][crate::model::ExportPreviewResultRequest::parent].
7618 ///
7619 /// # Example
7620 /// ```ignore,no_run
7621 /// # use google_cloud_config_v1::model::ExportPreviewResultRequest;
7622 /// let x = ExportPreviewResultRequest::new().set_parent("example");
7623 /// ```
7624 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7625 self.parent = v.into();
7626 self
7627 }
7628}
7629
7630impl wkt::message::Message for ExportPreviewResultRequest {
7631 fn typename() -> &'static str {
7632 "type.googleapis.com/google.cloud.config.v1.ExportPreviewResultRequest"
7633 }
7634}
7635
7636/// A response to `ExportPreviewResult` call. Contains preview results.
7637#[derive(Clone, Default, PartialEq)]
7638#[non_exhaustive]
7639pub struct ExportPreviewResultResponse {
7640 /// Output only. Signed URLs for accessing the plan files.
7641 pub result: std::option::Option<crate::model::PreviewResult>,
7642
7643 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7644}
7645
7646impl ExportPreviewResultResponse {
7647 pub fn new() -> Self {
7648 std::default::Default::default()
7649 }
7650
7651 /// Sets the value of [result][crate::model::ExportPreviewResultResponse::result].
7652 ///
7653 /// # Example
7654 /// ```ignore,no_run
7655 /// # use google_cloud_config_v1::model::ExportPreviewResultResponse;
7656 /// use google_cloud_config_v1::model::PreviewResult;
7657 /// let x = ExportPreviewResultResponse::new().set_result(PreviewResult::default()/* use setters */);
7658 /// ```
7659 pub fn set_result<T>(mut self, v: T) -> Self
7660 where
7661 T: std::convert::Into<crate::model::PreviewResult>,
7662 {
7663 self.result = std::option::Option::Some(v.into());
7664 self
7665 }
7666
7667 /// Sets or clears the value of [result][crate::model::ExportPreviewResultResponse::result].
7668 ///
7669 /// # Example
7670 /// ```ignore,no_run
7671 /// # use google_cloud_config_v1::model::ExportPreviewResultResponse;
7672 /// use google_cloud_config_v1::model::PreviewResult;
7673 /// let x = ExportPreviewResultResponse::new().set_or_clear_result(Some(PreviewResult::default()/* use setters */));
7674 /// let x = ExportPreviewResultResponse::new().set_or_clear_result(None::<PreviewResult>);
7675 /// ```
7676 pub fn set_or_clear_result<T>(mut self, v: std::option::Option<T>) -> Self
7677 where
7678 T: std::convert::Into<crate::model::PreviewResult>,
7679 {
7680 self.result = v.map(|x| x.into());
7681 self
7682 }
7683}
7684
7685impl wkt::message::Message for ExportPreviewResultResponse {
7686 fn typename() -> &'static str {
7687 "type.googleapis.com/google.cloud.config.v1.ExportPreviewResultResponse"
7688 }
7689}
7690
7691/// Contains a signed Cloud Storage URLs.
7692#[derive(Clone, Default, PartialEq)]
7693#[non_exhaustive]
7694pub struct PreviewResult {
7695 /// Output only. Plan binary signed URL
7696 pub binary_signed_uri: std::string::String,
7697
7698 /// Output only. Plan JSON signed URL
7699 pub json_signed_uri: std::string::String,
7700
7701 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7702}
7703
7704impl PreviewResult {
7705 pub fn new() -> Self {
7706 std::default::Default::default()
7707 }
7708
7709 /// Sets the value of [binary_signed_uri][crate::model::PreviewResult::binary_signed_uri].
7710 ///
7711 /// # Example
7712 /// ```ignore,no_run
7713 /// # use google_cloud_config_v1::model::PreviewResult;
7714 /// let x = PreviewResult::new().set_binary_signed_uri("example");
7715 /// ```
7716 pub fn set_binary_signed_uri<T: std::convert::Into<std::string::String>>(
7717 mut self,
7718 v: T,
7719 ) -> Self {
7720 self.binary_signed_uri = v.into();
7721 self
7722 }
7723
7724 /// Sets the value of [json_signed_uri][crate::model::PreviewResult::json_signed_uri].
7725 ///
7726 /// # Example
7727 /// ```ignore,no_run
7728 /// # use google_cloud_config_v1::model::PreviewResult;
7729 /// let x = PreviewResult::new().set_json_signed_uri("example");
7730 /// ```
7731 pub fn set_json_signed_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7732 self.json_signed_uri = v.into();
7733 self
7734 }
7735}
7736
7737impl wkt::message::Message for PreviewResult {
7738 fn typename() -> &'static str {
7739 "type.googleapis.com/google.cloud.config.v1.PreviewResult"
7740 }
7741}
7742
7743/// The request message for the GetTerraformVersion method.
7744#[derive(Clone, Default, PartialEq)]
7745#[non_exhaustive]
7746pub struct GetTerraformVersionRequest {
7747 /// Required. The name of the TerraformVersion. Format:
7748 /// 'projects/{project_id}/locations/{location}/terraformVersions/{terraform_version}'
7749 pub name: std::string::String,
7750
7751 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7752}
7753
7754impl GetTerraformVersionRequest {
7755 pub fn new() -> Self {
7756 std::default::Default::default()
7757 }
7758
7759 /// Sets the value of [name][crate::model::GetTerraformVersionRequest::name].
7760 ///
7761 /// # Example
7762 /// ```ignore,no_run
7763 /// # use google_cloud_config_v1::model::GetTerraformVersionRequest;
7764 /// let x = GetTerraformVersionRequest::new().set_name("example");
7765 /// ```
7766 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7767 self.name = v.into();
7768 self
7769 }
7770}
7771
7772impl wkt::message::Message for GetTerraformVersionRequest {
7773 fn typename() -> &'static str {
7774 "type.googleapis.com/google.cloud.config.v1.GetTerraformVersionRequest"
7775 }
7776}
7777
7778/// The request message for the ListTerraformVersions method.
7779#[derive(Clone, Default, PartialEq)]
7780#[non_exhaustive]
7781pub struct ListTerraformVersionsRequest {
7782 /// Required. The parent in whose context the TerraformVersions are listed. The
7783 /// parent value is in the format:
7784 /// 'projects/{project_id}/locations/{location}'.
7785 pub parent: std::string::String,
7786
7787 /// Optional. When requesting a page of terraform versions, 'page_size'
7788 /// specifies number of terraform versions to return. If unspecified, at most
7789 /// 500 will be returned. The maximum value is 1000.
7790 pub page_size: i32,
7791
7792 /// Optional. Token returned by previous call to 'ListTerraformVersions' which
7793 /// specifies the position in the list from where to continue listing the
7794 /// terraform versions.
7795 pub page_token: std::string::String,
7796
7797 /// Optional. Lists the TerraformVersions that match the filter expression. A
7798 /// filter expression filters the resources listed in the response. The
7799 /// expression must be of the form '{field} {operator} {value}' where
7800 /// operators: '<', '>',
7801 /// '<=', '>=', '!=', '=', ':' are supported (colon ':' represents a HAS
7802 /// operator which is roughly synonymous with equality). {field} can refer to a
7803 /// proto or JSON field, or a synthetic field. Field names can be camelCase or
7804 /// snake_case.
7805 pub filter: std::string::String,
7806
7807 /// Optional. Field to use to sort the list.
7808 pub order_by: std::string::String,
7809
7810 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7811}
7812
7813impl ListTerraformVersionsRequest {
7814 pub fn new() -> Self {
7815 std::default::Default::default()
7816 }
7817
7818 /// Sets the value of [parent][crate::model::ListTerraformVersionsRequest::parent].
7819 ///
7820 /// # Example
7821 /// ```ignore,no_run
7822 /// # use google_cloud_config_v1::model::ListTerraformVersionsRequest;
7823 /// let x = ListTerraformVersionsRequest::new().set_parent("example");
7824 /// ```
7825 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7826 self.parent = v.into();
7827 self
7828 }
7829
7830 /// Sets the value of [page_size][crate::model::ListTerraformVersionsRequest::page_size].
7831 ///
7832 /// # Example
7833 /// ```ignore,no_run
7834 /// # use google_cloud_config_v1::model::ListTerraformVersionsRequest;
7835 /// let x = ListTerraformVersionsRequest::new().set_page_size(42);
7836 /// ```
7837 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7838 self.page_size = v.into();
7839 self
7840 }
7841
7842 /// Sets the value of [page_token][crate::model::ListTerraformVersionsRequest::page_token].
7843 ///
7844 /// # Example
7845 /// ```ignore,no_run
7846 /// # use google_cloud_config_v1::model::ListTerraformVersionsRequest;
7847 /// let x = ListTerraformVersionsRequest::new().set_page_token("example");
7848 /// ```
7849 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7850 self.page_token = v.into();
7851 self
7852 }
7853
7854 /// Sets the value of [filter][crate::model::ListTerraformVersionsRequest::filter].
7855 ///
7856 /// # Example
7857 /// ```ignore,no_run
7858 /// # use google_cloud_config_v1::model::ListTerraformVersionsRequest;
7859 /// let x = ListTerraformVersionsRequest::new().set_filter("example");
7860 /// ```
7861 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7862 self.filter = v.into();
7863 self
7864 }
7865
7866 /// Sets the value of [order_by][crate::model::ListTerraformVersionsRequest::order_by].
7867 ///
7868 /// # Example
7869 /// ```ignore,no_run
7870 /// # use google_cloud_config_v1::model::ListTerraformVersionsRequest;
7871 /// let x = ListTerraformVersionsRequest::new().set_order_by("example");
7872 /// ```
7873 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7874 self.order_by = v.into();
7875 self
7876 }
7877}
7878
7879impl wkt::message::Message for ListTerraformVersionsRequest {
7880 fn typename() -> &'static str {
7881 "type.googleapis.com/google.cloud.config.v1.ListTerraformVersionsRequest"
7882 }
7883}
7884
7885/// The response message for the `ListTerraformVersions` method.
7886#[derive(Clone, Default, PartialEq)]
7887#[non_exhaustive]
7888pub struct ListTerraformVersionsResponse {
7889 /// List of [TerraformVersion][google.cloud.config.v1.TerraformVersion]s.
7890 ///
7891 /// [google.cloud.config.v1.TerraformVersion]: crate::model::TerraformVersion
7892 pub terraform_versions: std::vec::Vec<crate::model::TerraformVersion>,
7893
7894 /// Token to be supplied to the next ListTerraformVersions request via
7895 /// `page_token` to obtain the next set of results.
7896 pub next_page_token: std::string::String,
7897
7898 /// Unreachable resources, if any.
7899 pub unreachable: std::vec::Vec<std::string::String>,
7900
7901 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7902}
7903
7904impl ListTerraformVersionsResponse {
7905 pub fn new() -> Self {
7906 std::default::Default::default()
7907 }
7908
7909 /// Sets the value of [terraform_versions][crate::model::ListTerraformVersionsResponse::terraform_versions].
7910 ///
7911 /// # Example
7912 /// ```ignore,no_run
7913 /// # use google_cloud_config_v1::model::ListTerraformVersionsResponse;
7914 /// use google_cloud_config_v1::model::TerraformVersion;
7915 /// let x = ListTerraformVersionsResponse::new()
7916 /// .set_terraform_versions([
7917 /// TerraformVersion::default()/* use setters */,
7918 /// TerraformVersion::default()/* use (different) setters */,
7919 /// ]);
7920 /// ```
7921 pub fn set_terraform_versions<T, V>(mut self, v: T) -> Self
7922 where
7923 T: std::iter::IntoIterator<Item = V>,
7924 V: std::convert::Into<crate::model::TerraformVersion>,
7925 {
7926 use std::iter::Iterator;
7927 self.terraform_versions = v.into_iter().map(|i| i.into()).collect();
7928 self
7929 }
7930
7931 /// Sets the value of [next_page_token][crate::model::ListTerraformVersionsResponse::next_page_token].
7932 ///
7933 /// # Example
7934 /// ```ignore,no_run
7935 /// # use google_cloud_config_v1::model::ListTerraformVersionsResponse;
7936 /// let x = ListTerraformVersionsResponse::new().set_next_page_token("example");
7937 /// ```
7938 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7939 self.next_page_token = v.into();
7940 self
7941 }
7942
7943 /// Sets the value of [unreachable][crate::model::ListTerraformVersionsResponse::unreachable].
7944 ///
7945 /// # Example
7946 /// ```ignore,no_run
7947 /// # use google_cloud_config_v1::model::ListTerraformVersionsResponse;
7948 /// let x = ListTerraformVersionsResponse::new().set_unreachable(["a", "b", "c"]);
7949 /// ```
7950 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
7951 where
7952 T: std::iter::IntoIterator<Item = V>,
7953 V: std::convert::Into<std::string::String>,
7954 {
7955 use std::iter::Iterator;
7956 self.unreachable = v.into_iter().map(|i| i.into()).collect();
7957 self
7958 }
7959}
7960
7961impl wkt::message::Message for ListTerraformVersionsResponse {
7962 fn typename() -> &'static str {
7963 "type.googleapis.com/google.cloud.config.v1.ListTerraformVersionsResponse"
7964 }
7965}
7966
7967#[doc(hidden)]
7968impl gax::paginator::internal::PageableResponse for ListTerraformVersionsResponse {
7969 type PageItem = crate::model::TerraformVersion;
7970
7971 fn items(self) -> std::vec::Vec<Self::PageItem> {
7972 self.terraform_versions
7973 }
7974
7975 fn next_page_token(&self) -> std::string::String {
7976 use std::clone::Clone;
7977 self.next_page_token.clone()
7978 }
7979}
7980
7981/// A TerraformVersion represents the support state the corresponding
7982/// Terraform version.
7983#[derive(Clone, Default, PartialEq)]
7984#[non_exhaustive]
7985pub struct TerraformVersion {
7986 /// Identifier. The version name is in the format:
7987 /// 'projects/{project_id}/locations/{location}/terraformVersions/{terraform_version}'.
7988 pub name: std::string::String,
7989
7990 /// Output only. The state of the version, ACTIVE, DEPRECATED or OBSOLETE.
7991 pub state: crate::model::terraform_version::State,
7992
7993 /// Output only. When the version is supported.
7994 pub support_time: std::option::Option<wkt::Timestamp>,
7995
7996 /// Output only. When the version is deprecated.
7997 pub deprecate_time: std::option::Option<wkt::Timestamp>,
7998
7999 /// Output only. When the version is obsolete.
8000 pub obsolete_time: std::option::Option<wkt::Timestamp>,
8001
8002 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8003}
8004
8005impl TerraformVersion {
8006 pub fn new() -> Self {
8007 std::default::Default::default()
8008 }
8009
8010 /// Sets the value of [name][crate::model::TerraformVersion::name].
8011 ///
8012 /// # Example
8013 /// ```ignore,no_run
8014 /// # use google_cloud_config_v1::model::TerraformVersion;
8015 /// let x = TerraformVersion::new().set_name("example");
8016 /// ```
8017 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8018 self.name = v.into();
8019 self
8020 }
8021
8022 /// Sets the value of [state][crate::model::TerraformVersion::state].
8023 ///
8024 /// # Example
8025 /// ```ignore,no_run
8026 /// # use google_cloud_config_v1::model::TerraformVersion;
8027 /// use google_cloud_config_v1::model::terraform_version::State;
8028 /// let x0 = TerraformVersion::new().set_state(State::Active);
8029 /// let x1 = TerraformVersion::new().set_state(State::Deprecated);
8030 /// let x2 = TerraformVersion::new().set_state(State::Obsolete);
8031 /// ```
8032 pub fn set_state<T: std::convert::Into<crate::model::terraform_version::State>>(
8033 mut self,
8034 v: T,
8035 ) -> Self {
8036 self.state = v.into();
8037 self
8038 }
8039
8040 /// Sets the value of [support_time][crate::model::TerraformVersion::support_time].
8041 ///
8042 /// # Example
8043 /// ```ignore,no_run
8044 /// # use google_cloud_config_v1::model::TerraformVersion;
8045 /// use wkt::Timestamp;
8046 /// let x = TerraformVersion::new().set_support_time(Timestamp::default()/* use setters */);
8047 /// ```
8048 pub fn set_support_time<T>(mut self, v: T) -> Self
8049 where
8050 T: std::convert::Into<wkt::Timestamp>,
8051 {
8052 self.support_time = std::option::Option::Some(v.into());
8053 self
8054 }
8055
8056 /// Sets or clears the value of [support_time][crate::model::TerraformVersion::support_time].
8057 ///
8058 /// # Example
8059 /// ```ignore,no_run
8060 /// # use google_cloud_config_v1::model::TerraformVersion;
8061 /// use wkt::Timestamp;
8062 /// let x = TerraformVersion::new().set_or_clear_support_time(Some(Timestamp::default()/* use setters */));
8063 /// let x = TerraformVersion::new().set_or_clear_support_time(None::<Timestamp>);
8064 /// ```
8065 pub fn set_or_clear_support_time<T>(mut self, v: std::option::Option<T>) -> Self
8066 where
8067 T: std::convert::Into<wkt::Timestamp>,
8068 {
8069 self.support_time = v.map(|x| x.into());
8070 self
8071 }
8072
8073 /// Sets the value of [deprecate_time][crate::model::TerraformVersion::deprecate_time].
8074 ///
8075 /// # Example
8076 /// ```ignore,no_run
8077 /// # use google_cloud_config_v1::model::TerraformVersion;
8078 /// use wkt::Timestamp;
8079 /// let x = TerraformVersion::new().set_deprecate_time(Timestamp::default()/* use setters */);
8080 /// ```
8081 pub fn set_deprecate_time<T>(mut self, v: T) -> Self
8082 where
8083 T: std::convert::Into<wkt::Timestamp>,
8084 {
8085 self.deprecate_time = std::option::Option::Some(v.into());
8086 self
8087 }
8088
8089 /// Sets or clears the value of [deprecate_time][crate::model::TerraformVersion::deprecate_time].
8090 ///
8091 /// # Example
8092 /// ```ignore,no_run
8093 /// # use google_cloud_config_v1::model::TerraformVersion;
8094 /// use wkt::Timestamp;
8095 /// let x = TerraformVersion::new().set_or_clear_deprecate_time(Some(Timestamp::default()/* use setters */));
8096 /// let x = TerraformVersion::new().set_or_clear_deprecate_time(None::<Timestamp>);
8097 /// ```
8098 pub fn set_or_clear_deprecate_time<T>(mut self, v: std::option::Option<T>) -> Self
8099 where
8100 T: std::convert::Into<wkt::Timestamp>,
8101 {
8102 self.deprecate_time = v.map(|x| x.into());
8103 self
8104 }
8105
8106 /// Sets the value of [obsolete_time][crate::model::TerraformVersion::obsolete_time].
8107 ///
8108 /// # Example
8109 /// ```ignore,no_run
8110 /// # use google_cloud_config_v1::model::TerraformVersion;
8111 /// use wkt::Timestamp;
8112 /// let x = TerraformVersion::new().set_obsolete_time(Timestamp::default()/* use setters */);
8113 /// ```
8114 pub fn set_obsolete_time<T>(mut self, v: T) -> Self
8115 where
8116 T: std::convert::Into<wkt::Timestamp>,
8117 {
8118 self.obsolete_time = std::option::Option::Some(v.into());
8119 self
8120 }
8121
8122 /// Sets or clears the value of [obsolete_time][crate::model::TerraformVersion::obsolete_time].
8123 ///
8124 /// # Example
8125 /// ```ignore,no_run
8126 /// # use google_cloud_config_v1::model::TerraformVersion;
8127 /// use wkt::Timestamp;
8128 /// let x = TerraformVersion::new().set_or_clear_obsolete_time(Some(Timestamp::default()/* use setters */));
8129 /// let x = TerraformVersion::new().set_or_clear_obsolete_time(None::<Timestamp>);
8130 /// ```
8131 pub fn set_or_clear_obsolete_time<T>(mut self, v: std::option::Option<T>) -> Self
8132 where
8133 T: std::convert::Into<wkt::Timestamp>,
8134 {
8135 self.obsolete_time = v.map(|x| x.into());
8136 self
8137 }
8138}
8139
8140impl wkt::message::Message for TerraformVersion {
8141 fn typename() -> &'static str {
8142 "type.googleapis.com/google.cloud.config.v1.TerraformVersion"
8143 }
8144}
8145
8146/// Defines additional types related to [TerraformVersion].
8147pub mod terraform_version {
8148 #[allow(unused_imports)]
8149 use super::*;
8150
8151 /// Possible states of a TerraformVersion.
8152 ///
8153 /// # Working with unknown values
8154 ///
8155 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8156 /// additional enum variants at any time. Adding new variants is not considered
8157 /// a breaking change. Applications should write their code in anticipation of:
8158 ///
8159 /// - New values appearing in future releases of the client library, **and**
8160 /// - New values received dynamically, without application changes.
8161 ///
8162 /// Please consult the [Working with enums] section in the user guide for some
8163 /// guidelines.
8164 ///
8165 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
8166 #[derive(Clone, Debug, PartialEq)]
8167 #[non_exhaustive]
8168 pub enum State {
8169 /// The default value. This value is used if the state is omitted.
8170 Unspecified,
8171 /// The version is actively supported.
8172 Active,
8173 /// The version is deprecated.
8174 Deprecated,
8175 /// The version is obsolete.
8176 Obsolete,
8177 /// If set, the enum was initialized with an unknown value.
8178 ///
8179 /// Applications can examine the value using [State::value] or
8180 /// [State::name].
8181 UnknownValue(state::UnknownValue),
8182 }
8183
8184 #[doc(hidden)]
8185 pub mod state {
8186 #[allow(unused_imports)]
8187 use super::*;
8188 #[derive(Clone, Debug, PartialEq)]
8189 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8190 }
8191
8192 impl State {
8193 /// Gets the enum value.
8194 ///
8195 /// Returns `None` if the enum contains an unknown value deserialized from
8196 /// the string representation of enums.
8197 pub fn value(&self) -> std::option::Option<i32> {
8198 match self {
8199 Self::Unspecified => std::option::Option::Some(0),
8200 Self::Active => std::option::Option::Some(1),
8201 Self::Deprecated => std::option::Option::Some(2),
8202 Self::Obsolete => std::option::Option::Some(3),
8203 Self::UnknownValue(u) => u.0.value(),
8204 }
8205 }
8206
8207 /// Gets the enum value as a string.
8208 ///
8209 /// Returns `None` if the enum contains an unknown value deserialized from
8210 /// the integer representation of enums.
8211 pub fn name(&self) -> std::option::Option<&str> {
8212 match self {
8213 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
8214 Self::Active => std::option::Option::Some("ACTIVE"),
8215 Self::Deprecated => std::option::Option::Some("DEPRECATED"),
8216 Self::Obsolete => std::option::Option::Some("OBSOLETE"),
8217 Self::UnknownValue(u) => u.0.name(),
8218 }
8219 }
8220 }
8221
8222 impl std::default::Default for State {
8223 fn default() -> Self {
8224 use std::convert::From;
8225 Self::from(0)
8226 }
8227 }
8228
8229 impl std::fmt::Display for State {
8230 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8231 wkt::internal::display_enum(f, self.name(), self.value())
8232 }
8233 }
8234
8235 impl std::convert::From<i32> for State {
8236 fn from(value: i32) -> Self {
8237 match value {
8238 0 => Self::Unspecified,
8239 1 => Self::Active,
8240 2 => Self::Deprecated,
8241 3 => Self::Obsolete,
8242 _ => Self::UnknownValue(state::UnknownValue(
8243 wkt::internal::UnknownEnumValue::Integer(value),
8244 )),
8245 }
8246 }
8247 }
8248
8249 impl std::convert::From<&str> for State {
8250 fn from(value: &str) -> Self {
8251 use std::string::ToString;
8252 match value {
8253 "STATE_UNSPECIFIED" => Self::Unspecified,
8254 "ACTIVE" => Self::Active,
8255 "DEPRECATED" => Self::Deprecated,
8256 "OBSOLETE" => Self::Obsolete,
8257 _ => Self::UnknownValue(state::UnknownValue(
8258 wkt::internal::UnknownEnumValue::String(value.to_string()),
8259 )),
8260 }
8261 }
8262 }
8263
8264 impl serde::ser::Serialize for State {
8265 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8266 where
8267 S: serde::Serializer,
8268 {
8269 match self {
8270 Self::Unspecified => serializer.serialize_i32(0),
8271 Self::Active => serializer.serialize_i32(1),
8272 Self::Deprecated => serializer.serialize_i32(2),
8273 Self::Obsolete => serializer.serialize_i32(3),
8274 Self::UnknownValue(u) => u.0.serialize(serializer),
8275 }
8276 }
8277 }
8278
8279 impl<'de> serde::de::Deserialize<'de> for State {
8280 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8281 where
8282 D: serde::Deserializer<'de>,
8283 {
8284 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
8285 ".google.cloud.config.v1.TerraformVersion.State",
8286 ))
8287 }
8288 }
8289}
8290
8291/// Terraform info of a ResourceChange.
8292#[derive(Clone, Default, PartialEq)]
8293#[non_exhaustive]
8294pub struct ResourceChangeTerraformInfo {
8295 /// Output only. TF resource address that uniquely identifies the resource.
8296 pub address: std::string::String,
8297
8298 /// Output only. TF resource type.
8299 pub r#type: std::string::String,
8300
8301 /// Output only. TF resource name.
8302 pub resource_name: std::string::String,
8303
8304 /// Output only. TF resource provider.
8305 pub provider: std::string::String,
8306
8307 /// Output only. TF resource actions.
8308 pub actions: std::vec::Vec<std::string::String>,
8309
8310 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8311}
8312
8313impl ResourceChangeTerraformInfo {
8314 pub fn new() -> Self {
8315 std::default::Default::default()
8316 }
8317
8318 /// Sets the value of [address][crate::model::ResourceChangeTerraformInfo::address].
8319 ///
8320 /// # Example
8321 /// ```ignore,no_run
8322 /// # use google_cloud_config_v1::model::ResourceChangeTerraformInfo;
8323 /// let x = ResourceChangeTerraformInfo::new().set_address("example");
8324 /// ```
8325 pub fn set_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8326 self.address = v.into();
8327 self
8328 }
8329
8330 /// Sets the value of [r#type][crate::model::ResourceChangeTerraformInfo::type].
8331 ///
8332 /// # Example
8333 /// ```ignore,no_run
8334 /// # use google_cloud_config_v1::model::ResourceChangeTerraformInfo;
8335 /// let x = ResourceChangeTerraformInfo::new().set_type("example");
8336 /// ```
8337 pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8338 self.r#type = v.into();
8339 self
8340 }
8341
8342 /// Sets the value of [resource_name][crate::model::ResourceChangeTerraformInfo::resource_name].
8343 ///
8344 /// # Example
8345 /// ```ignore,no_run
8346 /// # use google_cloud_config_v1::model::ResourceChangeTerraformInfo;
8347 /// let x = ResourceChangeTerraformInfo::new().set_resource_name("example");
8348 /// ```
8349 pub fn set_resource_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8350 self.resource_name = v.into();
8351 self
8352 }
8353
8354 /// Sets the value of [provider][crate::model::ResourceChangeTerraformInfo::provider].
8355 ///
8356 /// # Example
8357 /// ```ignore,no_run
8358 /// # use google_cloud_config_v1::model::ResourceChangeTerraformInfo;
8359 /// let x = ResourceChangeTerraformInfo::new().set_provider("example");
8360 /// ```
8361 pub fn set_provider<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8362 self.provider = v.into();
8363 self
8364 }
8365
8366 /// Sets the value of [actions][crate::model::ResourceChangeTerraformInfo::actions].
8367 ///
8368 /// # Example
8369 /// ```ignore,no_run
8370 /// # use google_cloud_config_v1::model::ResourceChangeTerraformInfo;
8371 /// let x = ResourceChangeTerraformInfo::new().set_actions(["a", "b", "c"]);
8372 /// ```
8373 pub fn set_actions<T, V>(mut self, v: T) -> Self
8374 where
8375 T: std::iter::IntoIterator<Item = V>,
8376 V: std::convert::Into<std::string::String>,
8377 {
8378 use std::iter::Iterator;
8379 self.actions = v.into_iter().map(|i| i.into()).collect();
8380 self
8381 }
8382}
8383
8384impl wkt::message::Message for ResourceChangeTerraformInfo {
8385 fn typename() -> &'static str {
8386 "type.googleapis.com/google.cloud.config.v1.ResourceChangeTerraformInfo"
8387 }
8388}
8389
8390/// A resource change represents a change to a resource in the state file.
8391#[derive(Clone, Default, PartialEq)]
8392#[non_exhaustive]
8393pub struct ResourceChange {
8394 /// Identifier. The name of the resource change.
8395 /// Format:
8396 /// 'projects/{project_id}/locations/{location}/previews/{preview}/resourceChanges/{resource_change}'.
8397 pub name: std::string::String,
8398
8399 /// Output only. Terraform info of the resource change.
8400 pub terraform_info: std::option::Option<crate::model::ResourceChangeTerraformInfo>,
8401
8402 /// Output only. The intent of the resource change.
8403 pub intent: crate::model::resource_change::Intent,
8404
8405 /// Output only. The property changes of the resource change.
8406 pub property_changes: std::vec::Vec<crate::model::PropertyChange>,
8407
8408 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8409}
8410
8411impl ResourceChange {
8412 pub fn new() -> Self {
8413 std::default::Default::default()
8414 }
8415
8416 /// Sets the value of [name][crate::model::ResourceChange::name].
8417 ///
8418 /// # Example
8419 /// ```ignore,no_run
8420 /// # use google_cloud_config_v1::model::ResourceChange;
8421 /// let x = ResourceChange::new().set_name("example");
8422 /// ```
8423 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8424 self.name = v.into();
8425 self
8426 }
8427
8428 /// Sets the value of [terraform_info][crate::model::ResourceChange::terraform_info].
8429 ///
8430 /// # Example
8431 /// ```ignore,no_run
8432 /// # use google_cloud_config_v1::model::ResourceChange;
8433 /// use google_cloud_config_v1::model::ResourceChangeTerraformInfo;
8434 /// let x = ResourceChange::new().set_terraform_info(ResourceChangeTerraformInfo::default()/* use setters */);
8435 /// ```
8436 pub fn set_terraform_info<T>(mut self, v: T) -> Self
8437 where
8438 T: std::convert::Into<crate::model::ResourceChangeTerraformInfo>,
8439 {
8440 self.terraform_info = std::option::Option::Some(v.into());
8441 self
8442 }
8443
8444 /// Sets or clears the value of [terraform_info][crate::model::ResourceChange::terraform_info].
8445 ///
8446 /// # Example
8447 /// ```ignore,no_run
8448 /// # use google_cloud_config_v1::model::ResourceChange;
8449 /// use google_cloud_config_v1::model::ResourceChangeTerraformInfo;
8450 /// let x = ResourceChange::new().set_or_clear_terraform_info(Some(ResourceChangeTerraformInfo::default()/* use setters */));
8451 /// let x = ResourceChange::new().set_or_clear_terraform_info(None::<ResourceChangeTerraformInfo>);
8452 /// ```
8453 pub fn set_or_clear_terraform_info<T>(mut self, v: std::option::Option<T>) -> Self
8454 where
8455 T: std::convert::Into<crate::model::ResourceChangeTerraformInfo>,
8456 {
8457 self.terraform_info = v.map(|x| x.into());
8458 self
8459 }
8460
8461 /// Sets the value of [intent][crate::model::ResourceChange::intent].
8462 ///
8463 /// # Example
8464 /// ```ignore,no_run
8465 /// # use google_cloud_config_v1::model::ResourceChange;
8466 /// use google_cloud_config_v1::model::resource_change::Intent;
8467 /// let x0 = ResourceChange::new().set_intent(Intent::Create);
8468 /// let x1 = ResourceChange::new().set_intent(Intent::Update);
8469 /// let x2 = ResourceChange::new().set_intent(Intent::Delete);
8470 /// ```
8471 pub fn set_intent<T: std::convert::Into<crate::model::resource_change::Intent>>(
8472 mut self,
8473 v: T,
8474 ) -> Self {
8475 self.intent = v.into();
8476 self
8477 }
8478
8479 /// Sets the value of [property_changes][crate::model::ResourceChange::property_changes].
8480 ///
8481 /// # Example
8482 /// ```ignore,no_run
8483 /// # use google_cloud_config_v1::model::ResourceChange;
8484 /// use google_cloud_config_v1::model::PropertyChange;
8485 /// let x = ResourceChange::new()
8486 /// .set_property_changes([
8487 /// PropertyChange::default()/* use setters */,
8488 /// PropertyChange::default()/* use (different) setters */,
8489 /// ]);
8490 /// ```
8491 pub fn set_property_changes<T, V>(mut self, v: T) -> Self
8492 where
8493 T: std::iter::IntoIterator<Item = V>,
8494 V: std::convert::Into<crate::model::PropertyChange>,
8495 {
8496 use std::iter::Iterator;
8497 self.property_changes = v.into_iter().map(|i| i.into()).collect();
8498 self
8499 }
8500}
8501
8502impl wkt::message::Message for ResourceChange {
8503 fn typename() -> &'static str {
8504 "type.googleapis.com/google.cloud.config.v1.ResourceChange"
8505 }
8506}
8507
8508/// Defines additional types related to [ResourceChange].
8509pub mod resource_change {
8510 #[allow(unused_imports)]
8511 use super::*;
8512
8513 /// Possible intent of the resource change.
8514 ///
8515 /// # Working with unknown values
8516 ///
8517 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8518 /// additional enum variants at any time. Adding new variants is not considered
8519 /// a breaking change. Applications should write their code in anticipation of:
8520 ///
8521 /// - New values appearing in future releases of the client library, **and**
8522 /// - New values received dynamically, without application changes.
8523 ///
8524 /// Please consult the [Working with enums] section in the user guide for some
8525 /// guidelines.
8526 ///
8527 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
8528 #[derive(Clone, Debug, PartialEq)]
8529 #[non_exhaustive]
8530 pub enum Intent {
8531 /// The default value.
8532 Unspecified,
8533 /// The resource will be created.
8534 Create,
8535 /// The resource will be updated.
8536 Update,
8537 /// The resource will be deleted.
8538 Delete,
8539 /// The resource will be recreated.
8540 Recreate,
8541 /// The resource will be untouched.
8542 Unchanged,
8543 /// If set, the enum was initialized with an unknown value.
8544 ///
8545 /// Applications can examine the value using [Intent::value] or
8546 /// [Intent::name].
8547 UnknownValue(intent::UnknownValue),
8548 }
8549
8550 #[doc(hidden)]
8551 pub mod intent {
8552 #[allow(unused_imports)]
8553 use super::*;
8554 #[derive(Clone, Debug, PartialEq)]
8555 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8556 }
8557
8558 impl Intent {
8559 /// Gets the enum value.
8560 ///
8561 /// Returns `None` if the enum contains an unknown value deserialized from
8562 /// the string representation of enums.
8563 pub fn value(&self) -> std::option::Option<i32> {
8564 match self {
8565 Self::Unspecified => std::option::Option::Some(0),
8566 Self::Create => std::option::Option::Some(1),
8567 Self::Update => std::option::Option::Some(2),
8568 Self::Delete => std::option::Option::Some(3),
8569 Self::Recreate => std::option::Option::Some(4),
8570 Self::Unchanged => std::option::Option::Some(5),
8571 Self::UnknownValue(u) => u.0.value(),
8572 }
8573 }
8574
8575 /// Gets the enum value as a string.
8576 ///
8577 /// Returns `None` if the enum contains an unknown value deserialized from
8578 /// the integer representation of enums.
8579 pub fn name(&self) -> std::option::Option<&str> {
8580 match self {
8581 Self::Unspecified => std::option::Option::Some("INTENT_UNSPECIFIED"),
8582 Self::Create => std::option::Option::Some("CREATE"),
8583 Self::Update => std::option::Option::Some("UPDATE"),
8584 Self::Delete => std::option::Option::Some("DELETE"),
8585 Self::Recreate => std::option::Option::Some("RECREATE"),
8586 Self::Unchanged => std::option::Option::Some("UNCHANGED"),
8587 Self::UnknownValue(u) => u.0.name(),
8588 }
8589 }
8590 }
8591
8592 impl std::default::Default for Intent {
8593 fn default() -> Self {
8594 use std::convert::From;
8595 Self::from(0)
8596 }
8597 }
8598
8599 impl std::fmt::Display for Intent {
8600 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8601 wkt::internal::display_enum(f, self.name(), self.value())
8602 }
8603 }
8604
8605 impl std::convert::From<i32> for Intent {
8606 fn from(value: i32) -> Self {
8607 match value {
8608 0 => Self::Unspecified,
8609 1 => Self::Create,
8610 2 => Self::Update,
8611 3 => Self::Delete,
8612 4 => Self::Recreate,
8613 5 => Self::Unchanged,
8614 _ => Self::UnknownValue(intent::UnknownValue(
8615 wkt::internal::UnknownEnumValue::Integer(value),
8616 )),
8617 }
8618 }
8619 }
8620
8621 impl std::convert::From<&str> for Intent {
8622 fn from(value: &str) -> Self {
8623 use std::string::ToString;
8624 match value {
8625 "INTENT_UNSPECIFIED" => Self::Unspecified,
8626 "CREATE" => Self::Create,
8627 "UPDATE" => Self::Update,
8628 "DELETE" => Self::Delete,
8629 "RECREATE" => Self::Recreate,
8630 "UNCHANGED" => Self::Unchanged,
8631 _ => Self::UnknownValue(intent::UnknownValue(
8632 wkt::internal::UnknownEnumValue::String(value.to_string()),
8633 )),
8634 }
8635 }
8636 }
8637
8638 impl serde::ser::Serialize for Intent {
8639 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8640 where
8641 S: serde::Serializer,
8642 {
8643 match self {
8644 Self::Unspecified => serializer.serialize_i32(0),
8645 Self::Create => serializer.serialize_i32(1),
8646 Self::Update => serializer.serialize_i32(2),
8647 Self::Delete => serializer.serialize_i32(3),
8648 Self::Recreate => serializer.serialize_i32(4),
8649 Self::Unchanged => serializer.serialize_i32(5),
8650 Self::UnknownValue(u) => u.0.serialize(serializer),
8651 }
8652 }
8653 }
8654
8655 impl<'de> serde::de::Deserialize<'de> for Intent {
8656 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8657 where
8658 D: serde::Deserializer<'de>,
8659 {
8660 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Intent>::new(
8661 ".google.cloud.config.v1.ResourceChange.Intent",
8662 ))
8663 }
8664 }
8665}
8666
8667/// A property change represents a change to a property in the state file.
8668#[derive(Clone, Default, PartialEq)]
8669#[non_exhaustive]
8670pub struct PropertyChange {
8671 /// Output only. The path of the property change.
8672 pub path: std::string::String,
8673
8674 /// Output only. The paths of sensitive fields in `before`. Paths are relative
8675 /// to `path`.
8676 pub before_sensitive_paths: std::vec::Vec<std::string::String>,
8677
8678 /// Output only. Representations of the object value before the actions.
8679 pub before: std::option::Option<wkt::Value>,
8680
8681 /// Output only. The paths of sensitive fields in `after`. Paths are relative
8682 /// to `path`.
8683 pub after_sensitive_paths: std::vec::Vec<std::string::String>,
8684
8685 /// Output only. Representations of the object value after the actions.
8686 pub after: std::option::Option<wkt::Value>,
8687
8688 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8689}
8690
8691impl PropertyChange {
8692 pub fn new() -> Self {
8693 std::default::Default::default()
8694 }
8695
8696 /// Sets the value of [path][crate::model::PropertyChange::path].
8697 ///
8698 /// # Example
8699 /// ```ignore,no_run
8700 /// # use google_cloud_config_v1::model::PropertyChange;
8701 /// let x = PropertyChange::new().set_path("example");
8702 /// ```
8703 pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8704 self.path = v.into();
8705 self
8706 }
8707
8708 /// Sets the value of [before_sensitive_paths][crate::model::PropertyChange::before_sensitive_paths].
8709 ///
8710 /// # Example
8711 /// ```ignore,no_run
8712 /// # use google_cloud_config_v1::model::PropertyChange;
8713 /// let x = PropertyChange::new().set_before_sensitive_paths(["a", "b", "c"]);
8714 /// ```
8715 pub fn set_before_sensitive_paths<T, V>(mut self, v: T) -> Self
8716 where
8717 T: std::iter::IntoIterator<Item = V>,
8718 V: std::convert::Into<std::string::String>,
8719 {
8720 use std::iter::Iterator;
8721 self.before_sensitive_paths = v.into_iter().map(|i| i.into()).collect();
8722 self
8723 }
8724
8725 /// Sets the value of [before][crate::model::PropertyChange::before].
8726 ///
8727 /// # Example
8728 /// ```ignore,no_run
8729 /// # use google_cloud_config_v1::model::PropertyChange;
8730 /// use wkt::Value;
8731 /// let x = PropertyChange::new().set_before(Value::default()/* use setters */);
8732 /// ```
8733 pub fn set_before<T>(mut self, v: T) -> Self
8734 where
8735 T: std::convert::Into<wkt::Value>,
8736 {
8737 self.before = std::option::Option::Some(v.into());
8738 self
8739 }
8740
8741 /// Sets or clears the value of [before][crate::model::PropertyChange::before].
8742 ///
8743 /// # Example
8744 /// ```ignore,no_run
8745 /// # use google_cloud_config_v1::model::PropertyChange;
8746 /// use wkt::Value;
8747 /// let x = PropertyChange::new().set_or_clear_before(Some(Value::default()/* use setters */));
8748 /// let x = PropertyChange::new().set_or_clear_before(None::<Value>);
8749 /// ```
8750 pub fn set_or_clear_before<T>(mut self, v: std::option::Option<T>) -> Self
8751 where
8752 T: std::convert::Into<wkt::Value>,
8753 {
8754 self.before = v.map(|x| x.into());
8755 self
8756 }
8757
8758 /// Sets the value of [after_sensitive_paths][crate::model::PropertyChange::after_sensitive_paths].
8759 ///
8760 /// # Example
8761 /// ```ignore,no_run
8762 /// # use google_cloud_config_v1::model::PropertyChange;
8763 /// let x = PropertyChange::new().set_after_sensitive_paths(["a", "b", "c"]);
8764 /// ```
8765 pub fn set_after_sensitive_paths<T, V>(mut self, v: T) -> Self
8766 where
8767 T: std::iter::IntoIterator<Item = V>,
8768 V: std::convert::Into<std::string::String>,
8769 {
8770 use std::iter::Iterator;
8771 self.after_sensitive_paths = v.into_iter().map(|i| i.into()).collect();
8772 self
8773 }
8774
8775 /// Sets the value of [after][crate::model::PropertyChange::after].
8776 ///
8777 /// # Example
8778 /// ```ignore,no_run
8779 /// # use google_cloud_config_v1::model::PropertyChange;
8780 /// use wkt::Value;
8781 /// let x = PropertyChange::new().set_after(Value::default()/* use setters */);
8782 /// ```
8783 pub fn set_after<T>(mut self, v: T) -> Self
8784 where
8785 T: std::convert::Into<wkt::Value>,
8786 {
8787 self.after = std::option::Option::Some(v.into());
8788 self
8789 }
8790
8791 /// Sets or clears the value of [after][crate::model::PropertyChange::after].
8792 ///
8793 /// # Example
8794 /// ```ignore,no_run
8795 /// # use google_cloud_config_v1::model::PropertyChange;
8796 /// use wkt::Value;
8797 /// let x = PropertyChange::new().set_or_clear_after(Some(Value::default()/* use setters */));
8798 /// let x = PropertyChange::new().set_or_clear_after(None::<Value>);
8799 /// ```
8800 pub fn set_or_clear_after<T>(mut self, v: std::option::Option<T>) -> Self
8801 where
8802 T: std::convert::Into<wkt::Value>,
8803 {
8804 self.after = v.map(|x| x.into());
8805 self
8806 }
8807}
8808
8809impl wkt::message::Message for PropertyChange {
8810 fn typename() -> &'static str {
8811 "type.googleapis.com/google.cloud.config.v1.PropertyChange"
8812 }
8813}
8814
8815/// The request message for the ListResourceChanges method.
8816#[derive(Clone, Default, PartialEq)]
8817#[non_exhaustive]
8818pub struct ListResourceChangesRequest {
8819 /// Required. The parent in whose context the ResourceChanges are listed. The
8820 /// parent value is in the format:
8821 /// 'projects/{project_id}/locations/{location}/previews/{preview}'.
8822 pub parent: std::string::String,
8823
8824 /// Optional. When requesting a page of resource changes, 'page_size' specifies
8825 /// number of resource changes to return. If unspecified, at most 500 will be
8826 /// returned. The maximum value is 1000.
8827 pub page_size: i32,
8828
8829 /// Optional. Token returned by previous call to 'ListResourceChanges' which
8830 /// specifies the position in the list from where to continue listing the
8831 /// resource changes.
8832 pub page_token: std::string::String,
8833
8834 /// Optional. Lists the resource changes that match the filter expression. A
8835 /// filter expression filters the resource changes listed in the response. The
8836 /// expression must be of the form '{field} {operator} {value}' where
8837 /// operators: '<', '>',
8838 /// '<=',
8839 /// '>=',
8840 /// '!=', '=', ':' are supported (colon ':' represents a HAS operator which is
8841 /// roughly synonymous with equality). {field} can refer to a proto or JSON
8842 /// field, or a synthetic field. Field names can be camelCase or snake_case.
8843 ///
8844 /// Examples:
8845 ///
8846 /// - Filter by name:
8847 /// name =
8848 /// "projects/foo/locations/us-central1/previews/dep/resourceChanges/baz
8849 pub filter: std::string::String,
8850
8851 /// Optional. Field to use to sort the list.
8852 pub order_by: std::string::String,
8853
8854 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8855}
8856
8857impl ListResourceChangesRequest {
8858 pub fn new() -> Self {
8859 std::default::Default::default()
8860 }
8861
8862 /// Sets the value of [parent][crate::model::ListResourceChangesRequest::parent].
8863 ///
8864 /// # Example
8865 /// ```ignore,no_run
8866 /// # use google_cloud_config_v1::model::ListResourceChangesRequest;
8867 /// let x = ListResourceChangesRequest::new().set_parent("example");
8868 /// ```
8869 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8870 self.parent = v.into();
8871 self
8872 }
8873
8874 /// Sets the value of [page_size][crate::model::ListResourceChangesRequest::page_size].
8875 ///
8876 /// # Example
8877 /// ```ignore,no_run
8878 /// # use google_cloud_config_v1::model::ListResourceChangesRequest;
8879 /// let x = ListResourceChangesRequest::new().set_page_size(42);
8880 /// ```
8881 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8882 self.page_size = v.into();
8883 self
8884 }
8885
8886 /// Sets the value of [page_token][crate::model::ListResourceChangesRequest::page_token].
8887 ///
8888 /// # Example
8889 /// ```ignore,no_run
8890 /// # use google_cloud_config_v1::model::ListResourceChangesRequest;
8891 /// let x = ListResourceChangesRequest::new().set_page_token("example");
8892 /// ```
8893 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8894 self.page_token = v.into();
8895 self
8896 }
8897
8898 /// Sets the value of [filter][crate::model::ListResourceChangesRequest::filter].
8899 ///
8900 /// # Example
8901 /// ```ignore,no_run
8902 /// # use google_cloud_config_v1::model::ListResourceChangesRequest;
8903 /// let x = ListResourceChangesRequest::new().set_filter("example");
8904 /// ```
8905 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8906 self.filter = v.into();
8907 self
8908 }
8909
8910 /// Sets the value of [order_by][crate::model::ListResourceChangesRequest::order_by].
8911 ///
8912 /// # Example
8913 /// ```ignore,no_run
8914 /// # use google_cloud_config_v1::model::ListResourceChangesRequest;
8915 /// let x = ListResourceChangesRequest::new().set_order_by("example");
8916 /// ```
8917 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8918 self.order_by = v.into();
8919 self
8920 }
8921}
8922
8923impl wkt::message::Message for ListResourceChangesRequest {
8924 fn typename() -> &'static str {
8925 "type.googleapis.com/google.cloud.config.v1.ListResourceChangesRequest"
8926 }
8927}
8928
8929/// A response to a 'ListResourceChanges' call. Contains a list of
8930/// ResourceChanges.
8931#[derive(Clone, Default, PartialEq)]
8932#[non_exhaustive]
8933pub struct ListResourceChangesResponse {
8934 /// List of ResourceChanges.
8935 pub resource_changes: std::vec::Vec<crate::model::ResourceChange>,
8936
8937 /// A token to request the next page of resources from the
8938 /// 'ListResourceChanges' method. The value of an empty string means that
8939 /// there are no more resources to return.
8940 pub next_page_token: std::string::String,
8941
8942 /// Unreachable resources, if any.
8943 pub unreachable: std::vec::Vec<std::string::String>,
8944
8945 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8946}
8947
8948impl ListResourceChangesResponse {
8949 pub fn new() -> Self {
8950 std::default::Default::default()
8951 }
8952
8953 /// Sets the value of [resource_changes][crate::model::ListResourceChangesResponse::resource_changes].
8954 ///
8955 /// # Example
8956 /// ```ignore,no_run
8957 /// # use google_cloud_config_v1::model::ListResourceChangesResponse;
8958 /// use google_cloud_config_v1::model::ResourceChange;
8959 /// let x = ListResourceChangesResponse::new()
8960 /// .set_resource_changes([
8961 /// ResourceChange::default()/* use setters */,
8962 /// ResourceChange::default()/* use (different) setters */,
8963 /// ]);
8964 /// ```
8965 pub fn set_resource_changes<T, V>(mut self, v: T) -> Self
8966 where
8967 T: std::iter::IntoIterator<Item = V>,
8968 V: std::convert::Into<crate::model::ResourceChange>,
8969 {
8970 use std::iter::Iterator;
8971 self.resource_changes = v.into_iter().map(|i| i.into()).collect();
8972 self
8973 }
8974
8975 /// Sets the value of [next_page_token][crate::model::ListResourceChangesResponse::next_page_token].
8976 ///
8977 /// # Example
8978 /// ```ignore,no_run
8979 /// # use google_cloud_config_v1::model::ListResourceChangesResponse;
8980 /// let x = ListResourceChangesResponse::new().set_next_page_token("example");
8981 /// ```
8982 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8983 self.next_page_token = v.into();
8984 self
8985 }
8986
8987 /// Sets the value of [unreachable][crate::model::ListResourceChangesResponse::unreachable].
8988 ///
8989 /// # Example
8990 /// ```ignore,no_run
8991 /// # use google_cloud_config_v1::model::ListResourceChangesResponse;
8992 /// let x = ListResourceChangesResponse::new().set_unreachable(["a", "b", "c"]);
8993 /// ```
8994 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
8995 where
8996 T: std::iter::IntoIterator<Item = V>,
8997 V: std::convert::Into<std::string::String>,
8998 {
8999 use std::iter::Iterator;
9000 self.unreachable = v.into_iter().map(|i| i.into()).collect();
9001 self
9002 }
9003}
9004
9005impl wkt::message::Message for ListResourceChangesResponse {
9006 fn typename() -> &'static str {
9007 "type.googleapis.com/google.cloud.config.v1.ListResourceChangesResponse"
9008 }
9009}
9010
9011#[doc(hidden)]
9012impl gax::paginator::internal::PageableResponse for ListResourceChangesResponse {
9013 type PageItem = crate::model::ResourceChange;
9014
9015 fn items(self) -> std::vec::Vec<Self::PageItem> {
9016 self.resource_changes
9017 }
9018
9019 fn next_page_token(&self) -> std::string::String {
9020 use std::clone::Clone;
9021 self.next_page_token.clone()
9022 }
9023}
9024
9025/// The request message for the GetResourceChange method.
9026#[derive(Clone, Default, PartialEq)]
9027#[non_exhaustive]
9028pub struct GetResourceChangeRequest {
9029 /// Required. The name of the resource change to retrieve.
9030 /// Format:
9031 /// 'projects/{project_id}/locations/{location}/previews/{preview}/resourceChanges/{resource_change}'.
9032 pub name: std::string::String,
9033
9034 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9035}
9036
9037impl GetResourceChangeRequest {
9038 pub fn new() -> Self {
9039 std::default::Default::default()
9040 }
9041
9042 /// Sets the value of [name][crate::model::GetResourceChangeRequest::name].
9043 ///
9044 /// # Example
9045 /// ```ignore,no_run
9046 /// # use google_cloud_config_v1::model::GetResourceChangeRequest;
9047 /// let x = GetResourceChangeRequest::new().set_name("example");
9048 /// ```
9049 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9050 self.name = v.into();
9051 self
9052 }
9053}
9054
9055impl wkt::message::Message for GetResourceChangeRequest {
9056 fn typename() -> &'static str {
9057 "type.googleapis.com/google.cloud.config.v1.GetResourceChangeRequest"
9058 }
9059}
9060
9061/// Terraform info of a ResourceChange.
9062#[derive(Clone, Default, PartialEq)]
9063#[non_exhaustive]
9064pub struct ResourceDriftTerraformInfo {
9065 /// Output only. The address of the drifted resource.
9066 pub address: std::string::String,
9067
9068 /// Output only. The type of the drifted resource.
9069 pub r#type: std::string::String,
9070
9071 /// Output only. TF resource name.
9072 pub resource_name: std::string::String,
9073
9074 /// Output only. The provider of the drifted resource.
9075 pub provider: std::string::String,
9076
9077 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9078}
9079
9080impl ResourceDriftTerraformInfo {
9081 pub fn new() -> Self {
9082 std::default::Default::default()
9083 }
9084
9085 /// Sets the value of [address][crate::model::ResourceDriftTerraformInfo::address].
9086 ///
9087 /// # Example
9088 /// ```ignore,no_run
9089 /// # use google_cloud_config_v1::model::ResourceDriftTerraformInfo;
9090 /// let x = ResourceDriftTerraformInfo::new().set_address("example");
9091 /// ```
9092 pub fn set_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9093 self.address = v.into();
9094 self
9095 }
9096
9097 /// Sets the value of [r#type][crate::model::ResourceDriftTerraformInfo::type].
9098 ///
9099 /// # Example
9100 /// ```ignore,no_run
9101 /// # use google_cloud_config_v1::model::ResourceDriftTerraformInfo;
9102 /// let x = ResourceDriftTerraformInfo::new().set_type("example");
9103 /// ```
9104 pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9105 self.r#type = v.into();
9106 self
9107 }
9108
9109 /// Sets the value of [resource_name][crate::model::ResourceDriftTerraformInfo::resource_name].
9110 ///
9111 /// # Example
9112 /// ```ignore,no_run
9113 /// # use google_cloud_config_v1::model::ResourceDriftTerraformInfo;
9114 /// let x = ResourceDriftTerraformInfo::new().set_resource_name("example");
9115 /// ```
9116 pub fn set_resource_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9117 self.resource_name = v.into();
9118 self
9119 }
9120
9121 /// Sets the value of [provider][crate::model::ResourceDriftTerraformInfo::provider].
9122 ///
9123 /// # Example
9124 /// ```ignore,no_run
9125 /// # use google_cloud_config_v1::model::ResourceDriftTerraformInfo;
9126 /// let x = ResourceDriftTerraformInfo::new().set_provider("example");
9127 /// ```
9128 pub fn set_provider<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9129 self.provider = v.into();
9130 self
9131 }
9132}
9133
9134impl wkt::message::Message for ResourceDriftTerraformInfo {
9135 fn typename() -> &'static str {
9136 "type.googleapis.com/google.cloud.config.v1.ResourceDriftTerraformInfo"
9137 }
9138}
9139
9140/// A resource drift represents a drift to a resource in the state file.
9141#[derive(Clone, Default, PartialEq)]
9142#[non_exhaustive]
9143pub struct ResourceDrift {
9144 /// Identifier. The name of the resource drift.
9145 /// Format:
9146 /// 'projects/{project_id}/locations/{location}/previews/{preview}/resourceDrifts/{resource_drift}'.
9147 pub name: std::string::String,
9148
9149 /// Output only. Terraform info of the resource drift.
9150 pub terraform_info: std::option::Option<crate::model::ResourceDriftTerraformInfo>,
9151
9152 /// Output only. The property drifts of the resource drift.
9153 pub property_drifts: std::vec::Vec<crate::model::PropertyDrift>,
9154
9155 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9156}
9157
9158impl ResourceDrift {
9159 pub fn new() -> Self {
9160 std::default::Default::default()
9161 }
9162
9163 /// Sets the value of [name][crate::model::ResourceDrift::name].
9164 ///
9165 /// # Example
9166 /// ```ignore,no_run
9167 /// # use google_cloud_config_v1::model::ResourceDrift;
9168 /// let x = ResourceDrift::new().set_name("example");
9169 /// ```
9170 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9171 self.name = v.into();
9172 self
9173 }
9174
9175 /// Sets the value of [terraform_info][crate::model::ResourceDrift::terraform_info].
9176 ///
9177 /// # Example
9178 /// ```ignore,no_run
9179 /// # use google_cloud_config_v1::model::ResourceDrift;
9180 /// use google_cloud_config_v1::model::ResourceDriftTerraformInfo;
9181 /// let x = ResourceDrift::new().set_terraform_info(ResourceDriftTerraformInfo::default()/* use setters */);
9182 /// ```
9183 pub fn set_terraform_info<T>(mut self, v: T) -> Self
9184 where
9185 T: std::convert::Into<crate::model::ResourceDriftTerraformInfo>,
9186 {
9187 self.terraform_info = std::option::Option::Some(v.into());
9188 self
9189 }
9190
9191 /// Sets or clears the value of [terraform_info][crate::model::ResourceDrift::terraform_info].
9192 ///
9193 /// # Example
9194 /// ```ignore,no_run
9195 /// # use google_cloud_config_v1::model::ResourceDrift;
9196 /// use google_cloud_config_v1::model::ResourceDriftTerraformInfo;
9197 /// let x = ResourceDrift::new().set_or_clear_terraform_info(Some(ResourceDriftTerraformInfo::default()/* use setters */));
9198 /// let x = ResourceDrift::new().set_or_clear_terraform_info(None::<ResourceDriftTerraformInfo>);
9199 /// ```
9200 pub fn set_or_clear_terraform_info<T>(mut self, v: std::option::Option<T>) -> Self
9201 where
9202 T: std::convert::Into<crate::model::ResourceDriftTerraformInfo>,
9203 {
9204 self.terraform_info = v.map(|x| x.into());
9205 self
9206 }
9207
9208 /// Sets the value of [property_drifts][crate::model::ResourceDrift::property_drifts].
9209 ///
9210 /// # Example
9211 /// ```ignore,no_run
9212 /// # use google_cloud_config_v1::model::ResourceDrift;
9213 /// use google_cloud_config_v1::model::PropertyDrift;
9214 /// let x = ResourceDrift::new()
9215 /// .set_property_drifts([
9216 /// PropertyDrift::default()/* use setters */,
9217 /// PropertyDrift::default()/* use (different) setters */,
9218 /// ]);
9219 /// ```
9220 pub fn set_property_drifts<T, V>(mut self, v: T) -> Self
9221 where
9222 T: std::iter::IntoIterator<Item = V>,
9223 V: std::convert::Into<crate::model::PropertyDrift>,
9224 {
9225 use std::iter::Iterator;
9226 self.property_drifts = v.into_iter().map(|i| i.into()).collect();
9227 self
9228 }
9229}
9230
9231impl wkt::message::Message for ResourceDrift {
9232 fn typename() -> &'static str {
9233 "type.googleapis.com/google.cloud.config.v1.ResourceDrift"
9234 }
9235}
9236
9237/// A property drift represents a drift to a property in the state file.
9238#[derive(Clone, Default, PartialEq)]
9239#[non_exhaustive]
9240pub struct PropertyDrift {
9241 /// Output only. The path of the property drift.
9242 pub path: std::string::String,
9243
9244 /// Output only. The paths of sensitive fields in `before`. Paths are relative
9245 /// to `path`.
9246 pub before_sensitive_paths: std::vec::Vec<std::string::String>,
9247
9248 /// Output only. Representations of the object value before the actions.
9249 pub before: std::option::Option<wkt::Value>,
9250
9251 /// Output only. The paths of sensitive fields in `after`. Paths are relative
9252 /// to `path`.
9253 pub after_sensitive_paths: std::vec::Vec<std::string::String>,
9254
9255 /// Output only. Representations of the object value after the actions.
9256 pub after: std::option::Option<wkt::Value>,
9257
9258 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9259}
9260
9261impl PropertyDrift {
9262 pub fn new() -> Self {
9263 std::default::Default::default()
9264 }
9265
9266 /// Sets the value of [path][crate::model::PropertyDrift::path].
9267 ///
9268 /// # Example
9269 /// ```ignore,no_run
9270 /// # use google_cloud_config_v1::model::PropertyDrift;
9271 /// let x = PropertyDrift::new().set_path("example");
9272 /// ```
9273 pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9274 self.path = v.into();
9275 self
9276 }
9277
9278 /// Sets the value of [before_sensitive_paths][crate::model::PropertyDrift::before_sensitive_paths].
9279 ///
9280 /// # Example
9281 /// ```ignore,no_run
9282 /// # use google_cloud_config_v1::model::PropertyDrift;
9283 /// let x = PropertyDrift::new().set_before_sensitive_paths(["a", "b", "c"]);
9284 /// ```
9285 pub fn set_before_sensitive_paths<T, V>(mut self, v: T) -> Self
9286 where
9287 T: std::iter::IntoIterator<Item = V>,
9288 V: std::convert::Into<std::string::String>,
9289 {
9290 use std::iter::Iterator;
9291 self.before_sensitive_paths = v.into_iter().map(|i| i.into()).collect();
9292 self
9293 }
9294
9295 /// Sets the value of [before][crate::model::PropertyDrift::before].
9296 ///
9297 /// # Example
9298 /// ```ignore,no_run
9299 /// # use google_cloud_config_v1::model::PropertyDrift;
9300 /// use wkt::Value;
9301 /// let x = PropertyDrift::new().set_before(Value::default()/* use setters */);
9302 /// ```
9303 pub fn set_before<T>(mut self, v: T) -> Self
9304 where
9305 T: std::convert::Into<wkt::Value>,
9306 {
9307 self.before = std::option::Option::Some(v.into());
9308 self
9309 }
9310
9311 /// Sets or clears the value of [before][crate::model::PropertyDrift::before].
9312 ///
9313 /// # Example
9314 /// ```ignore,no_run
9315 /// # use google_cloud_config_v1::model::PropertyDrift;
9316 /// use wkt::Value;
9317 /// let x = PropertyDrift::new().set_or_clear_before(Some(Value::default()/* use setters */));
9318 /// let x = PropertyDrift::new().set_or_clear_before(None::<Value>);
9319 /// ```
9320 pub fn set_or_clear_before<T>(mut self, v: std::option::Option<T>) -> Self
9321 where
9322 T: std::convert::Into<wkt::Value>,
9323 {
9324 self.before = v.map(|x| x.into());
9325 self
9326 }
9327
9328 /// Sets the value of [after_sensitive_paths][crate::model::PropertyDrift::after_sensitive_paths].
9329 ///
9330 /// # Example
9331 /// ```ignore,no_run
9332 /// # use google_cloud_config_v1::model::PropertyDrift;
9333 /// let x = PropertyDrift::new().set_after_sensitive_paths(["a", "b", "c"]);
9334 /// ```
9335 pub fn set_after_sensitive_paths<T, V>(mut self, v: T) -> Self
9336 where
9337 T: std::iter::IntoIterator<Item = V>,
9338 V: std::convert::Into<std::string::String>,
9339 {
9340 use std::iter::Iterator;
9341 self.after_sensitive_paths = v.into_iter().map(|i| i.into()).collect();
9342 self
9343 }
9344
9345 /// Sets the value of [after][crate::model::PropertyDrift::after].
9346 ///
9347 /// # Example
9348 /// ```ignore,no_run
9349 /// # use google_cloud_config_v1::model::PropertyDrift;
9350 /// use wkt::Value;
9351 /// let x = PropertyDrift::new().set_after(Value::default()/* use setters */);
9352 /// ```
9353 pub fn set_after<T>(mut self, v: T) -> Self
9354 where
9355 T: std::convert::Into<wkt::Value>,
9356 {
9357 self.after = std::option::Option::Some(v.into());
9358 self
9359 }
9360
9361 /// Sets or clears the value of [after][crate::model::PropertyDrift::after].
9362 ///
9363 /// # Example
9364 /// ```ignore,no_run
9365 /// # use google_cloud_config_v1::model::PropertyDrift;
9366 /// use wkt::Value;
9367 /// let x = PropertyDrift::new().set_or_clear_after(Some(Value::default()/* use setters */));
9368 /// let x = PropertyDrift::new().set_or_clear_after(None::<Value>);
9369 /// ```
9370 pub fn set_or_clear_after<T>(mut self, v: std::option::Option<T>) -> Self
9371 where
9372 T: std::convert::Into<wkt::Value>,
9373 {
9374 self.after = v.map(|x| x.into());
9375 self
9376 }
9377}
9378
9379impl wkt::message::Message for PropertyDrift {
9380 fn typename() -> &'static str {
9381 "type.googleapis.com/google.cloud.config.v1.PropertyDrift"
9382 }
9383}
9384
9385/// The request message for the ListResourceDrifts method.
9386#[derive(Clone, Default, PartialEq)]
9387#[non_exhaustive]
9388pub struct ListResourceDriftsRequest {
9389 /// Required. The parent in whose context the ResourceDrifts are listed. The
9390 /// parent value is in the format:
9391 /// 'projects/{project_id}/locations/{location}/previews/{preview}'.
9392 pub parent: std::string::String,
9393
9394 /// Optional. When requesting a page of resource drifts, 'page_size' specifies
9395 /// number of resource drifts to return. If unspecified, at most 500 will be
9396 /// returned. The maximum value is 1000.
9397 pub page_size: i32,
9398
9399 /// Optional. Token returned by previous call to 'ListResourceDrifts' which
9400 /// specifies the position in the list from where to continue listing the
9401 /// resource drifts.
9402 pub page_token: std::string::String,
9403
9404 /// Optional. Lists the resource drifts that match the filter expression. A
9405 /// filter expression filters the resource drifts listed in the response. The
9406 /// expression must be of the form '{field} {operator} {value}' where
9407 /// operators: '<', '>',
9408 /// '<=',
9409 /// '>=',
9410 /// '!=', '=', ':' are supported (colon ':' represents a HAS operator which is
9411 /// roughly synonymous with equality). {field} can refer to a proto or JSON
9412 /// field, or a synthetic field. Field names can be camelCase or snake_case.
9413 ///
9414 /// Examples:
9415 ///
9416 /// - Filter by name:
9417 /// name =
9418 /// "projects/foo/locations/us-central1/previews/dep/resourceDrifts/baz
9419 pub filter: std::string::String,
9420
9421 /// Optional. Field to use to sort the list.
9422 pub order_by: std::string::String,
9423
9424 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9425}
9426
9427impl ListResourceDriftsRequest {
9428 pub fn new() -> Self {
9429 std::default::Default::default()
9430 }
9431
9432 /// Sets the value of [parent][crate::model::ListResourceDriftsRequest::parent].
9433 ///
9434 /// # Example
9435 /// ```ignore,no_run
9436 /// # use google_cloud_config_v1::model::ListResourceDriftsRequest;
9437 /// let x = ListResourceDriftsRequest::new().set_parent("example");
9438 /// ```
9439 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9440 self.parent = v.into();
9441 self
9442 }
9443
9444 /// Sets the value of [page_size][crate::model::ListResourceDriftsRequest::page_size].
9445 ///
9446 /// # Example
9447 /// ```ignore,no_run
9448 /// # use google_cloud_config_v1::model::ListResourceDriftsRequest;
9449 /// let x = ListResourceDriftsRequest::new().set_page_size(42);
9450 /// ```
9451 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9452 self.page_size = v.into();
9453 self
9454 }
9455
9456 /// Sets the value of [page_token][crate::model::ListResourceDriftsRequest::page_token].
9457 ///
9458 /// # Example
9459 /// ```ignore,no_run
9460 /// # use google_cloud_config_v1::model::ListResourceDriftsRequest;
9461 /// let x = ListResourceDriftsRequest::new().set_page_token("example");
9462 /// ```
9463 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9464 self.page_token = v.into();
9465 self
9466 }
9467
9468 /// Sets the value of [filter][crate::model::ListResourceDriftsRequest::filter].
9469 ///
9470 /// # Example
9471 /// ```ignore,no_run
9472 /// # use google_cloud_config_v1::model::ListResourceDriftsRequest;
9473 /// let x = ListResourceDriftsRequest::new().set_filter("example");
9474 /// ```
9475 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9476 self.filter = v.into();
9477 self
9478 }
9479
9480 /// Sets the value of [order_by][crate::model::ListResourceDriftsRequest::order_by].
9481 ///
9482 /// # Example
9483 /// ```ignore,no_run
9484 /// # use google_cloud_config_v1::model::ListResourceDriftsRequest;
9485 /// let x = ListResourceDriftsRequest::new().set_order_by("example");
9486 /// ```
9487 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9488 self.order_by = v.into();
9489 self
9490 }
9491}
9492
9493impl wkt::message::Message for ListResourceDriftsRequest {
9494 fn typename() -> &'static str {
9495 "type.googleapis.com/google.cloud.config.v1.ListResourceDriftsRequest"
9496 }
9497}
9498
9499/// A response to a 'ListResourceDrifts' call. Contains a list of ResourceDrifts.
9500#[derive(Clone, Default, PartialEq)]
9501#[non_exhaustive]
9502pub struct ListResourceDriftsResponse {
9503 /// List of ResourceDrifts.
9504 pub resource_drifts: std::vec::Vec<crate::model::ResourceDrift>,
9505
9506 /// A token to request the next page of resources from the
9507 /// 'ListResourceDrifts' method. The value of an empty string means that
9508 /// there are no more resources to return.
9509 pub next_page_token: std::string::String,
9510
9511 /// Unreachable resources, if any.
9512 pub unreachable: std::vec::Vec<std::string::String>,
9513
9514 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9515}
9516
9517impl ListResourceDriftsResponse {
9518 pub fn new() -> Self {
9519 std::default::Default::default()
9520 }
9521
9522 /// Sets the value of [resource_drifts][crate::model::ListResourceDriftsResponse::resource_drifts].
9523 ///
9524 /// # Example
9525 /// ```ignore,no_run
9526 /// # use google_cloud_config_v1::model::ListResourceDriftsResponse;
9527 /// use google_cloud_config_v1::model::ResourceDrift;
9528 /// let x = ListResourceDriftsResponse::new()
9529 /// .set_resource_drifts([
9530 /// ResourceDrift::default()/* use setters */,
9531 /// ResourceDrift::default()/* use (different) setters */,
9532 /// ]);
9533 /// ```
9534 pub fn set_resource_drifts<T, V>(mut self, v: T) -> Self
9535 where
9536 T: std::iter::IntoIterator<Item = V>,
9537 V: std::convert::Into<crate::model::ResourceDrift>,
9538 {
9539 use std::iter::Iterator;
9540 self.resource_drifts = v.into_iter().map(|i| i.into()).collect();
9541 self
9542 }
9543
9544 /// Sets the value of [next_page_token][crate::model::ListResourceDriftsResponse::next_page_token].
9545 ///
9546 /// # Example
9547 /// ```ignore,no_run
9548 /// # use google_cloud_config_v1::model::ListResourceDriftsResponse;
9549 /// let x = ListResourceDriftsResponse::new().set_next_page_token("example");
9550 /// ```
9551 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9552 self.next_page_token = v.into();
9553 self
9554 }
9555
9556 /// Sets the value of [unreachable][crate::model::ListResourceDriftsResponse::unreachable].
9557 ///
9558 /// # Example
9559 /// ```ignore,no_run
9560 /// # use google_cloud_config_v1::model::ListResourceDriftsResponse;
9561 /// let x = ListResourceDriftsResponse::new().set_unreachable(["a", "b", "c"]);
9562 /// ```
9563 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
9564 where
9565 T: std::iter::IntoIterator<Item = V>,
9566 V: std::convert::Into<std::string::String>,
9567 {
9568 use std::iter::Iterator;
9569 self.unreachable = v.into_iter().map(|i| i.into()).collect();
9570 self
9571 }
9572}
9573
9574impl wkt::message::Message for ListResourceDriftsResponse {
9575 fn typename() -> &'static str {
9576 "type.googleapis.com/google.cloud.config.v1.ListResourceDriftsResponse"
9577 }
9578}
9579
9580#[doc(hidden)]
9581impl gax::paginator::internal::PageableResponse for ListResourceDriftsResponse {
9582 type PageItem = crate::model::ResourceDrift;
9583
9584 fn items(self) -> std::vec::Vec<Self::PageItem> {
9585 self.resource_drifts
9586 }
9587
9588 fn next_page_token(&self) -> std::string::String {
9589 use std::clone::Clone;
9590 self.next_page_token.clone()
9591 }
9592}
9593
9594/// The request message for the GetResourceDrift method.
9595#[derive(Clone, Default, PartialEq)]
9596#[non_exhaustive]
9597pub struct GetResourceDriftRequest {
9598 /// Required. The name of the resource drift to retrieve.
9599 /// Format:
9600 /// 'projects/{project_id}/locations/{location}/previews/{preview}/resourceDrifts/{resource_drift}'.
9601 pub name: std::string::String,
9602
9603 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9604}
9605
9606impl GetResourceDriftRequest {
9607 pub fn new() -> Self {
9608 std::default::Default::default()
9609 }
9610
9611 /// Sets the value of [name][crate::model::GetResourceDriftRequest::name].
9612 ///
9613 /// # Example
9614 /// ```ignore,no_run
9615 /// # use google_cloud_config_v1::model::GetResourceDriftRequest;
9616 /// let x = GetResourceDriftRequest::new().set_name("example");
9617 /// ```
9618 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9619 self.name = v.into();
9620 self
9621 }
9622}
9623
9624impl wkt::message::Message for GetResourceDriftRequest {
9625 fn typename() -> &'static str {
9626 "type.googleapis.com/google.cloud.config.v1.GetResourceDriftRequest"
9627 }
9628}
9629
9630/// ProviderConfig contains the provider configurations.
9631#[derive(Clone, Default, PartialEq)]
9632#[non_exhaustive]
9633pub struct ProviderConfig {
9634 /// Optional. ProviderSource specifies the source type of the provider.
9635 pub source_type: std::option::Option<crate::model::provider_config::ProviderSource>,
9636
9637 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9638}
9639
9640impl ProviderConfig {
9641 pub fn new() -> Self {
9642 std::default::Default::default()
9643 }
9644
9645 /// Sets the value of [source_type][crate::model::ProviderConfig::source_type].
9646 ///
9647 /// # Example
9648 /// ```ignore,no_run
9649 /// # use google_cloud_config_v1::model::ProviderConfig;
9650 /// use google_cloud_config_v1::model::provider_config::ProviderSource;
9651 /// let x0 = ProviderConfig::new().set_source_type(ProviderSource::ServiceMaintained);
9652 /// ```
9653 pub fn set_source_type<T>(mut self, v: T) -> Self
9654 where
9655 T: std::convert::Into<crate::model::provider_config::ProviderSource>,
9656 {
9657 self.source_type = std::option::Option::Some(v.into());
9658 self
9659 }
9660
9661 /// Sets or clears the value of [source_type][crate::model::ProviderConfig::source_type].
9662 ///
9663 /// # Example
9664 /// ```ignore,no_run
9665 /// # use google_cloud_config_v1::model::ProviderConfig;
9666 /// use google_cloud_config_v1::model::provider_config::ProviderSource;
9667 /// let x0 = ProviderConfig::new().set_or_clear_source_type(Some(ProviderSource::ServiceMaintained));
9668 /// let x_none = ProviderConfig::new().set_or_clear_source_type(None::<ProviderSource>);
9669 /// ```
9670 pub fn set_or_clear_source_type<T>(mut self, v: std::option::Option<T>) -> Self
9671 where
9672 T: std::convert::Into<crate::model::provider_config::ProviderSource>,
9673 {
9674 self.source_type = v.map(|x| x.into());
9675 self
9676 }
9677}
9678
9679impl wkt::message::Message for ProviderConfig {
9680 fn typename() -> &'static str {
9681 "type.googleapis.com/google.cloud.config.v1.ProviderConfig"
9682 }
9683}
9684
9685/// Defines additional types related to [ProviderConfig].
9686pub mod provider_config {
9687 #[allow(unused_imports)]
9688 use super::*;
9689
9690 /// ProviderSource represents the source type of the provider.
9691 ///
9692 /// # Working with unknown values
9693 ///
9694 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9695 /// additional enum variants at any time. Adding new variants is not considered
9696 /// a breaking change. Applications should write their code in anticipation of:
9697 ///
9698 /// - New values appearing in future releases of the client library, **and**
9699 /// - New values received dynamically, without application changes.
9700 ///
9701 /// Please consult the [Working with enums] section in the user guide for some
9702 /// guidelines.
9703 ///
9704 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
9705 #[derive(Clone, Debug, PartialEq)]
9706 #[non_exhaustive]
9707 pub enum ProviderSource {
9708 /// Unspecified source type, default to public sources.
9709 Unspecified,
9710 /// Service maintained provider source type.
9711 ServiceMaintained,
9712 /// If set, the enum was initialized with an unknown value.
9713 ///
9714 /// Applications can examine the value using [ProviderSource::value] or
9715 /// [ProviderSource::name].
9716 UnknownValue(provider_source::UnknownValue),
9717 }
9718
9719 #[doc(hidden)]
9720 pub mod provider_source {
9721 #[allow(unused_imports)]
9722 use super::*;
9723 #[derive(Clone, Debug, PartialEq)]
9724 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9725 }
9726
9727 impl ProviderSource {
9728 /// Gets the enum value.
9729 ///
9730 /// Returns `None` if the enum contains an unknown value deserialized from
9731 /// the string representation of enums.
9732 pub fn value(&self) -> std::option::Option<i32> {
9733 match self {
9734 Self::Unspecified => std::option::Option::Some(0),
9735 Self::ServiceMaintained => std::option::Option::Some(1),
9736 Self::UnknownValue(u) => u.0.value(),
9737 }
9738 }
9739
9740 /// Gets the enum value as a string.
9741 ///
9742 /// Returns `None` if the enum contains an unknown value deserialized from
9743 /// the integer representation of enums.
9744 pub fn name(&self) -> std::option::Option<&str> {
9745 match self {
9746 Self::Unspecified => std::option::Option::Some("PROVIDER_SOURCE_UNSPECIFIED"),
9747 Self::ServiceMaintained => std::option::Option::Some("SERVICE_MAINTAINED"),
9748 Self::UnknownValue(u) => u.0.name(),
9749 }
9750 }
9751 }
9752
9753 impl std::default::Default for ProviderSource {
9754 fn default() -> Self {
9755 use std::convert::From;
9756 Self::from(0)
9757 }
9758 }
9759
9760 impl std::fmt::Display for ProviderSource {
9761 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9762 wkt::internal::display_enum(f, self.name(), self.value())
9763 }
9764 }
9765
9766 impl std::convert::From<i32> for ProviderSource {
9767 fn from(value: i32) -> Self {
9768 match value {
9769 0 => Self::Unspecified,
9770 1 => Self::ServiceMaintained,
9771 _ => Self::UnknownValue(provider_source::UnknownValue(
9772 wkt::internal::UnknownEnumValue::Integer(value),
9773 )),
9774 }
9775 }
9776 }
9777
9778 impl std::convert::From<&str> for ProviderSource {
9779 fn from(value: &str) -> Self {
9780 use std::string::ToString;
9781 match value {
9782 "PROVIDER_SOURCE_UNSPECIFIED" => Self::Unspecified,
9783 "SERVICE_MAINTAINED" => Self::ServiceMaintained,
9784 _ => Self::UnknownValue(provider_source::UnknownValue(
9785 wkt::internal::UnknownEnumValue::String(value.to_string()),
9786 )),
9787 }
9788 }
9789 }
9790
9791 impl serde::ser::Serialize for ProviderSource {
9792 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9793 where
9794 S: serde::Serializer,
9795 {
9796 match self {
9797 Self::Unspecified => serializer.serialize_i32(0),
9798 Self::ServiceMaintained => serializer.serialize_i32(1),
9799 Self::UnknownValue(u) => u.0.serialize(serializer),
9800 }
9801 }
9802 }
9803
9804 impl<'de> serde::de::Deserialize<'de> for ProviderSource {
9805 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9806 where
9807 D: serde::Deserializer<'de>,
9808 {
9809 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ProviderSource>::new(
9810 ".google.cloud.config.v1.ProviderConfig.ProviderSource",
9811 ))
9812 }
9813 }
9814}
9815
9816/// The request message for the GetAutoMigrationConfig method.
9817#[derive(Clone, Default, PartialEq)]
9818#[non_exhaustive]
9819pub struct GetAutoMigrationConfigRequest {
9820 /// Required. The name of the AutoMigrationConfig.
9821 /// Format:
9822 /// 'projects/{project_id}/locations/{location}/AutoMigrationConfig'.
9823 pub name: std::string::String,
9824
9825 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9826}
9827
9828impl GetAutoMigrationConfigRequest {
9829 pub fn new() -> Self {
9830 std::default::Default::default()
9831 }
9832
9833 /// Sets the value of [name][crate::model::GetAutoMigrationConfigRequest::name].
9834 ///
9835 /// # Example
9836 /// ```ignore,no_run
9837 /// # use google_cloud_config_v1::model::GetAutoMigrationConfigRequest;
9838 /// let x = GetAutoMigrationConfigRequest::new().set_name("example");
9839 /// ```
9840 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9841 self.name = v.into();
9842 self
9843 }
9844}
9845
9846impl wkt::message::Message for GetAutoMigrationConfigRequest {
9847 fn typename() -> &'static str {
9848 "type.googleapis.com/google.cloud.config.v1.GetAutoMigrationConfigRequest"
9849 }
9850}
9851
9852/// AutoMigrationConfig contains the automigration configuration for a project.
9853#[derive(Clone, Default, PartialEq)]
9854#[non_exhaustive]
9855pub struct AutoMigrationConfig {
9856 /// Identifier. The name of the AutoMigrationConfig.
9857 /// Format:
9858 /// 'projects/{project_id}/locations/{location}/AutoMigrationConfig'.
9859 pub name: std::string::String,
9860
9861 /// Output only. Time the AutoMigrationConfig was last updated.
9862 pub update_time: std::option::Option<wkt::Timestamp>,
9863
9864 /// Optional. Whether the auto migration is enabled for the project.
9865 pub auto_migration_enabled: bool,
9866
9867 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9868}
9869
9870impl AutoMigrationConfig {
9871 pub fn new() -> Self {
9872 std::default::Default::default()
9873 }
9874
9875 /// Sets the value of [name][crate::model::AutoMigrationConfig::name].
9876 ///
9877 /// # Example
9878 /// ```ignore,no_run
9879 /// # use google_cloud_config_v1::model::AutoMigrationConfig;
9880 /// let x = AutoMigrationConfig::new().set_name("example");
9881 /// ```
9882 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9883 self.name = v.into();
9884 self
9885 }
9886
9887 /// Sets the value of [update_time][crate::model::AutoMigrationConfig::update_time].
9888 ///
9889 /// # Example
9890 /// ```ignore,no_run
9891 /// # use google_cloud_config_v1::model::AutoMigrationConfig;
9892 /// use wkt::Timestamp;
9893 /// let x = AutoMigrationConfig::new().set_update_time(Timestamp::default()/* use setters */);
9894 /// ```
9895 pub fn set_update_time<T>(mut self, v: T) -> Self
9896 where
9897 T: std::convert::Into<wkt::Timestamp>,
9898 {
9899 self.update_time = std::option::Option::Some(v.into());
9900 self
9901 }
9902
9903 /// Sets or clears the value of [update_time][crate::model::AutoMigrationConfig::update_time].
9904 ///
9905 /// # Example
9906 /// ```ignore,no_run
9907 /// # use google_cloud_config_v1::model::AutoMigrationConfig;
9908 /// use wkt::Timestamp;
9909 /// let x = AutoMigrationConfig::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
9910 /// let x = AutoMigrationConfig::new().set_or_clear_update_time(None::<Timestamp>);
9911 /// ```
9912 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
9913 where
9914 T: std::convert::Into<wkt::Timestamp>,
9915 {
9916 self.update_time = v.map(|x| x.into());
9917 self
9918 }
9919
9920 /// Sets the value of [auto_migration_enabled][crate::model::AutoMigrationConfig::auto_migration_enabled].
9921 ///
9922 /// # Example
9923 /// ```ignore,no_run
9924 /// # use google_cloud_config_v1::model::AutoMigrationConfig;
9925 /// let x = AutoMigrationConfig::new().set_auto_migration_enabled(true);
9926 /// ```
9927 pub fn set_auto_migration_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9928 self.auto_migration_enabled = v.into();
9929 self
9930 }
9931}
9932
9933impl wkt::message::Message for AutoMigrationConfig {
9934 fn typename() -> &'static str {
9935 "type.googleapis.com/google.cloud.config.v1.AutoMigrationConfig"
9936 }
9937}
9938
9939/// The request message for the UpdateAutoMigrationConfig method.
9940#[derive(Clone, Default, PartialEq)]
9941#[non_exhaustive]
9942pub struct UpdateAutoMigrationConfigRequest {
9943 /// Optional. The update mask applies to the resource. See
9944 /// [google.protobuf.FieldMask][google.protobuf.FieldMask].
9945 ///
9946 /// [google.protobuf.FieldMask]: wkt::FieldMask
9947 pub update_mask: std::option::Option<wkt::FieldMask>,
9948
9949 /// Required. The AutoMigrationConfig to update.
9950 pub auto_migration_config: std::option::Option<crate::model::AutoMigrationConfig>,
9951
9952 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9953}
9954
9955impl UpdateAutoMigrationConfigRequest {
9956 pub fn new() -> Self {
9957 std::default::Default::default()
9958 }
9959
9960 /// Sets the value of [update_mask][crate::model::UpdateAutoMigrationConfigRequest::update_mask].
9961 ///
9962 /// # Example
9963 /// ```ignore,no_run
9964 /// # use google_cloud_config_v1::model::UpdateAutoMigrationConfigRequest;
9965 /// use wkt::FieldMask;
9966 /// let x = UpdateAutoMigrationConfigRequest::new().set_update_mask(FieldMask::default()/* use setters */);
9967 /// ```
9968 pub fn set_update_mask<T>(mut self, v: T) -> Self
9969 where
9970 T: std::convert::Into<wkt::FieldMask>,
9971 {
9972 self.update_mask = std::option::Option::Some(v.into());
9973 self
9974 }
9975
9976 /// Sets or clears the value of [update_mask][crate::model::UpdateAutoMigrationConfigRequest::update_mask].
9977 ///
9978 /// # Example
9979 /// ```ignore,no_run
9980 /// # use google_cloud_config_v1::model::UpdateAutoMigrationConfigRequest;
9981 /// use wkt::FieldMask;
9982 /// let x = UpdateAutoMigrationConfigRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
9983 /// let x = UpdateAutoMigrationConfigRequest::new().set_or_clear_update_mask(None::<FieldMask>);
9984 /// ```
9985 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
9986 where
9987 T: std::convert::Into<wkt::FieldMask>,
9988 {
9989 self.update_mask = v.map(|x| x.into());
9990 self
9991 }
9992
9993 /// Sets the value of [auto_migration_config][crate::model::UpdateAutoMigrationConfigRequest::auto_migration_config].
9994 ///
9995 /// # Example
9996 /// ```ignore,no_run
9997 /// # use google_cloud_config_v1::model::UpdateAutoMigrationConfigRequest;
9998 /// use google_cloud_config_v1::model::AutoMigrationConfig;
9999 /// let x = UpdateAutoMigrationConfigRequest::new().set_auto_migration_config(AutoMigrationConfig::default()/* use setters */);
10000 /// ```
10001 pub fn set_auto_migration_config<T>(mut self, v: T) -> Self
10002 where
10003 T: std::convert::Into<crate::model::AutoMigrationConfig>,
10004 {
10005 self.auto_migration_config = std::option::Option::Some(v.into());
10006 self
10007 }
10008
10009 /// Sets or clears the value of [auto_migration_config][crate::model::UpdateAutoMigrationConfigRequest::auto_migration_config].
10010 ///
10011 /// # Example
10012 /// ```ignore,no_run
10013 /// # use google_cloud_config_v1::model::UpdateAutoMigrationConfigRequest;
10014 /// use google_cloud_config_v1::model::AutoMigrationConfig;
10015 /// let x = UpdateAutoMigrationConfigRequest::new().set_or_clear_auto_migration_config(Some(AutoMigrationConfig::default()/* use setters */));
10016 /// let x = UpdateAutoMigrationConfigRequest::new().set_or_clear_auto_migration_config(None::<AutoMigrationConfig>);
10017 /// ```
10018 pub fn set_or_clear_auto_migration_config<T>(mut self, v: std::option::Option<T>) -> Self
10019 where
10020 T: std::convert::Into<crate::model::AutoMigrationConfig>,
10021 {
10022 self.auto_migration_config = v.map(|x| x.into());
10023 self
10024 }
10025}
10026
10027impl wkt::message::Message for UpdateAutoMigrationConfigRequest {
10028 fn typename() -> &'static str {
10029 "type.googleapis.com/google.cloud.config.v1.UpdateAutoMigrationConfigRequest"
10030 }
10031}
10032
10033/// Enum values to control quota checks for resources in terraform
10034/// configuration files.
10035///
10036/// # Working with unknown values
10037///
10038/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10039/// additional enum variants at any time. Adding new variants is not considered
10040/// a breaking change. Applications should write their code in anticipation of:
10041///
10042/// - New values appearing in future releases of the client library, **and**
10043/// - New values received dynamically, without application changes.
10044///
10045/// Please consult the [Working with enums] section in the user guide for some
10046/// guidelines.
10047///
10048/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
10049#[derive(Clone, Debug, PartialEq)]
10050#[non_exhaustive]
10051pub enum QuotaValidation {
10052 /// The default value.
10053 /// QuotaValidation on terraform configuration files will be disabled in
10054 /// this case.
10055 Unspecified,
10056 /// Enable computing quotas for resources in terraform configuration files to
10057 /// get visibility on resources with insufficient quotas.
10058 Enabled,
10059 /// Enforce quota checks so deployment fails if there isn't sufficient quotas
10060 /// available to deploy resources in terraform configuration files.
10061 Enforced,
10062 /// If set, the enum was initialized with an unknown value.
10063 ///
10064 /// Applications can examine the value using [QuotaValidation::value] or
10065 /// [QuotaValidation::name].
10066 UnknownValue(quota_validation::UnknownValue),
10067}
10068
10069#[doc(hidden)]
10070pub mod quota_validation {
10071 #[allow(unused_imports)]
10072 use super::*;
10073 #[derive(Clone, Debug, PartialEq)]
10074 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10075}
10076
10077impl QuotaValidation {
10078 /// Gets the enum value.
10079 ///
10080 /// Returns `None` if the enum contains an unknown value deserialized from
10081 /// the string representation of enums.
10082 pub fn value(&self) -> std::option::Option<i32> {
10083 match self {
10084 Self::Unspecified => std::option::Option::Some(0),
10085 Self::Enabled => std::option::Option::Some(1),
10086 Self::Enforced => std::option::Option::Some(2),
10087 Self::UnknownValue(u) => u.0.value(),
10088 }
10089 }
10090
10091 /// Gets the enum value as a string.
10092 ///
10093 /// Returns `None` if the enum contains an unknown value deserialized from
10094 /// the integer representation of enums.
10095 pub fn name(&self) -> std::option::Option<&str> {
10096 match self {
10097 Self::Unspecified => std::option::Option::Some("QUOTA_VALIDATION_UNSPECIFIED"),
10098 Self::Enabled => std::option::Option::Some("ENABLED"),
10099 Self::Enforced => std::option::Option::Some("ENFORCED"),
10100 Self::UnknownValue(u) => u.0.name(),
10101 }
10102 }
10103}
10104
10105impl std::default::Default for QuotaValidation {
10106 fn default() -> Self {
10107 use std::convert::From;
10108 Self::from(0)
10109 }
10110}
10111
10112impl std::fmt::Display for QuotaValidation {
10113 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10114 wkt::internal::display_enum(f, self.name(), self.value())
10115 }
10116}
10117
10118impl std::convert::From<i32> for QuotaValidation {
10119 fn from(value: i32) -> Self {
10120 match value {
10121 0 => Self::Unspecified,
10122 1 => Self::Enabled,
10123 2 => Self::Enforced,
10124 _ => Self::UnknownValue(quota_validation::UnknownValue(
10125 wkt::internal::UnknownEnumValue::Integer(value),
10126 )),
10127 }
10128 }
10129}
10130
10131impl std::convert::From<&str> for QuotaValidation {
10132 fn from(value: &str) -> Self {
10133 use std::string::ToString;
10134 match value {
10135 "QUOTA_VALIDATION_UNSPECIFIED" => Self::Unspecified,
10136 "ENABLED" => Self::Enabled,
10137 "ENFORCED" => Self::Enforced,
10138 _ => Self::UnknownValue(quota_validation::UnknownValue(
10139 wkt::internal::UnknownEnumValue::String(value.to_string()),
10140 )),
10141 }
10142 }
10143}
10144
10145impl serde::ser::Serialize for QuotaValidation {
10146 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10147 where
10148 S: serde::Serializer,
10149 {
10150 match self {
10151 Self::Unspecified => serializer.serialize_i32(0),
10152 Self::Enabled => serializer.serialize_i32(1),
10153 Self::Enforced => serializer.serialize_i32(2),
10154 Self::UnknownValue(u) => u.0.serialize(serializer),
10155 }
10156 }
10157}
10158
10159impl<'de> serde::de::Deserialize<'de> for QuotaValidation {
10160 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10161 where
10162 D: serde::Deserializer<'de>,
10163 {
10164 deserializer.deserialize_any(wkt::internal::EnumVisitor::<QuotaValidation>::new(
10165 ".google.cloud.config.v1.QuotaValidation",
10166 ))
10167 }
10168}