google_cloud_config_v1/model.rs
1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17#![allow(rustdoc::bare_urls)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![allow(rustdoc::invalid_html_tags)]
20#![allow(rustdoc::redundant_explicit_links)]
21#![no_implicit_prelude]
22extern crate async_trait;
23extern crate bytes;
24extern crate gaxi;
25extern crate google_cloud_gax;
26extern crate google_cloud_iam_v1;
27extern crate google_cloud_location;
28extern crate google_cloud_longrunning;
29extern crate google_cloud_lro;
30extern crate google_cloud_rpc;
31extern crate serde;
32extern crate serde_json;
33extern crate serde_with;
34extern crate std;
35extern crate tracing;
36extern crate wkt;
37
38mod debug;
39mod deserialize;
40mod serialize;
41
42/// A Deployment is a group of resources and configs managed and provisioned by
43/// Infra Manager.
44#[derive(Clone, Default, PartialEq)]
45#[non_exhaustive]
46pub struct Deployment {
47 /// Identifier. Resource name of the deployment.
48 /// Format: `projects/{project}/locations/{location}/deployments/{deployment}`
49 pub name: std::string::String,
50
51 /// Output only. Time when the deployment was created.
52 pub create_time: std::option::Option<wkt::Timestamp>,
53
54 /// Output only. Time when the deployment was last modified.
55 pub update_time: std::option::Option<wkt::Timestamp>,
56
57 /// Optional. User-defined metadata for the deployment.
58 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
59
60 /// Output only. Current state of the deployment.
61 pub state: crate::model::deployment::State,
62
63 /// Output only. Revision name that was most recently applied.
64 /// Format: `projects/{project}/locations/{location}/deployments/{deployment}/
65 /// revisions/{revision}`
66 pub latest_revision: std::string::String,
67
68 /// Output only. Additional information regarding the current state.
69 pub state_detail: std::string::String,
70
71 /// Output only. Error code describing errors that may have occurred.
72 pub error_code: crate::model::deployment::ErrorCode,
73
74 /// Output only. Location of artifacts from a DeleteDeployment operation.
75 pub delete_results: std::option::Option<crate::model::ApplyResults>,
76
77 /// Output only. Cloud Build instance UUID associated with deleting this
78 /// deployment.
79 pub delete_build: std::string::String,
80
81 /// Output only. Location of Cloud Build logs in Google Cloud Storage,
82 /// populated when deleting this deployment. Format: `gs://{bucket}/{object}`.
83 pub delete_logs: std::string::String,
84
85 /// Output only. Errors encountered when deleting this deployment.
86 /// Errors are truncated to 10 entries, see `delete_results` and `error_logs`
87 /// for full details.
88 pub tf_errors: std::vec::Vec<crate::model::TerraformError>,
89
90 /// Output only. Location of Terraform error logs in Google Cloud Storage.
91 /// Format: `gs://{bucket}/{object}`.
92 pub error_logs: std::string::String,
93
94 /// User-defined location of Cloud Build logs and artifacts in Google Cloud
95 /// 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 /// The user-specified Cloud Build worker pool resource in which the Cloud
121 /// 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 /// The user-specified Terraform version constraint.
131 /// Example: "=1.3.10".
132 pub tf_version_constraint: std::option::Option<std::string::String>,
133
134 /// Output only. The current Terraform version set on the deployment.
135 /// It is in the format of "Major.Minor.Patch", for example, "1.3.10".
136 pub tf_version: std::string::String,
137
138 /// Optional. Input to control quota checks for resources in terraform
139 /// configuration files. There are limited resources on which quota validation
140 /// applies.
141 pub quota_validation: crate::model::QuotaValidation,
142
143 /// Optional. Arbitrary key-value metadata storage e.g. to help client tools
144 /// identify deployments during automation. See
145 /// <https://google.aip.dev/148#annotations> for details on format and size
146 /// limitations.
147 pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
148
149 /// Optional. This field specifies the provider configurations.
150 pub provider_config: std::option::Option<crate::model::ProviderConfig>,
151
152 /// Blueprint to deploy.
153 pub blueprint: std::option::Option<crate::model::deployment::Blueprint>,
154
155 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
156}
157
158impl Deployment {
159 /// Creates a new default instance.
160 pub fn new() -> Self {
161 std::default::Default::default()
162 }
163
164 /// Sets the value of [name][crate::model::Deployment::name].
165 ///
166 /// # Example
167 /// ```ignore,no_run
168 /// # use google_cloud_config_v1::model::Deployment;
169 /// # let project_id = "project_id";
170 /// # let location_id = "location_id";
171 /// # let deployment_id = "deployment_id";
172 /// let x = Deployment::new().set_name(format!("projects/{project_id}/locations/{location_id}/deployments/{deployment_id}"));
173 /// ```
174 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
175 self.name = v.into();
176 self
177 }
178
179 /// Sets the value of [create_time][crate::model::Deployment::create_time].
180 ///
181 /// # Example
182 /// ```ignore,no_run
183 /// # use google_cloud_config_v1::model::Deployment;
184 /// use wkt::Timestamp;
185 /// let x = Deployment::new().set_create_time(Timestamp::default()/* use setters */);
186 /// ```
187 pub fn set_create_time<T>(mut self, v: T) -> Self
188 where
189 T: std::convert::Into<wkt::Timestamp>,
190 {
191 self.create_time = std::option::Option::Some(v.into());
192 self
193 }
194
195 /// Sets or clears the value of [create_time][crate::model::Deployment::create_time].
196 ///
197 /// # Example
198 /// ```ignore,no_run
199 /// # use google_cloud_config_v1::model::Deployment;
200 /// use wkt::Timestamp;
201 /// let x = Deployment::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
202 /// let x = Deployment::new().set_or_clear_create_time(None::<Timestamp>);
203 /// ```
204 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
205 where
206 T: std::convert::Into<wkt::Timestamp>,
207 {
208 self.create_time = v.map(|x| x.into());
209 self
210 }
211
212 /// Sets the value of [update_time][crate::model::Deployment::update_time].
213 ///
214 /// # Example
215 /// ```ignore,no_run
216 /// # use google_cloud_config_v1::model::Deployment;
217 /// use wkt::Timestamp;
218 /// let x = Deployment::new().set_update_time(Timestamp::default()/* use setters */);
219 /// ```
220 pub fn set_update_time<T>(mut self, v: T) -> Self
221 where
222 T: std::convert::Into<wkt::Timestamp>,
223 {
224 self.update_time = std::option::Option::Some(v.into());
225 self
226 }
227
228 /// Sets or clears the value of [update_time][crate::model::Deployment::update_time].
229 ///
230 /// # Example
231 /// ```ignore,no_run
232 /// # use google_cloud_config_v1::model::Deployment;
233 /// use wkt::Timestamp;
234 /// let x = Deployment::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
235 /// let x = Deployment::new().set_or_clear_update_time(None::<Timestamp>);
236 /// ```
237 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
238 where
239 T: std::convert::Into<wkt::Timestamp>,
240 {
241 self.update_time = v.map(|x| x.into());
242 self
243 }
244
245 /// Sets the value of [labels][crate::model::Deployment::labels].
246 ///
247 /// # Example
248 /// ```ignore,no_run
249 /// # use google_cloud_config_v1::model::Deployment;
250 /// let x = Deployment::new().set_labels([
251 /// ("key0", "abc"),
252 /// ("key1", "xyz"),
253 /// ]);
254 /// ```
255 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
256 where
257 T: std::iter::IntoIterator<Item = (K, V)>,
258 K: std::convert::Into<std::string::String>,
259 V: std::convert::Into<std::string::String>,
260 {
261 use std::iter::Iterator;
262 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
263 self
264 }
265
266 /// Sets the value of [state][crate::model::Deployment::state].
267 ///
268 /// # Example
269 /// ```ignore,no_run
270 /// # use google_cloud_config_v1::model::Deployment;
271 /// use google_cloud_config_v1::model::deployment::State;
272 /// let x0 = Deployment::new().set_state(State::Creating);
273 /// let x1 = Deployment::new().set_state(State::Active);
274 /// let x2 = Deployment::new().set_state(State::Updating);
275 /// ```
276 pub fn set_state<T: std::convert::Into<crate::model::deployment::State>>(
277 mut self,
278 v: T,
279 ) -> Self {
280 self.state = v.into();
281 self
282 }
283
284 /// Sets the value of [latest_revision][crate::model::Deployment::latest_revision].
285 ///
286 /// # Example
287 /// ```ignore,no_run
288 /// # use google_cloud_config_v1::model::Deployment;
289 /// let x = Deployment::new().set_latest_revision("example");
290 /// ```
291 pub fn set_latest_revision<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
292 self.latest_revision = v.into();
293 self
294 }
295
296 /// Sets the value of [state_detail][crate::model::Deployment::state_detail].
297 ///
298 /// # Example
299 /// ```ignore,no_run
300 /// # use google_cloud_config_v1::model::Deployment;
301 /// let x = Deployment::new().set_state_detail("example");
302 /// ```
303 pub fn set_state_detail<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
304 self.state_detail = v.into();
305 self
306 }
307
308 /// Sets the value of [error_code][crate::model::Deployment::error_code].
309 ///
310 /// # Example
311 /// ```ignore,no_run
312 /// # use google_cloud_config_v1::model::Deployment;
313 /// use google_cloud_config_v1::model::deployment::ErrorCode;
314 /// let x0 = Deployment::new().set_error_code(ErrorCode::RevisionFailed);
315 /// let x1 = Deployment::new().set_error_code(ErrorCode::CloudBuildPermissionDenied);
316 /// let x2 = Deployment::new().set_error_code(ErrorCode::DeleteBuildApiFailed);
317 /// ```
318 pub fn set_error_code<T: std::convert::Into<crate::model::deployment::ErrorCode>>(
319 mut self,
320 v: T,
321 ) -> Self {
322 self.error_code = v.into();
323 self
324 }
325
326 /// Sets the value of [delete_results][crate::model::Deployment::delete_results].
327 ///
328 /// # Example
329 /// ```ignore,no_run
330 /// # use google_cloud_config_v1::model::Deployment;
331 /// use google_cloud_config_v1::model::ApplyResults;
332 /// let x = Deployment::new().set_delete_results(ApplyResults::default()/* use setters */);
333 /// ```
334 pub fn set_delete_results<T>(mut self, v: T) -> Self
335 where
336 T: std::convert::Into<crate::model::ApplyResults>,
337 {
338 self.delete_results = std::option::Option::Some(v.into());
339 self
340 }
341
342 /// Sets or clears the value of [delete_results][crate::model::Deployment::delete_results].
343 ///
344 /// # Example
345 /// ```ignore,no_run
346 /// # use google_cloud_config_v1::model::Deployment;
347 /// use google_cloud_config_v1::model::ApplyResults;
348 /// let x = Deployment::new().set_or_clear_delete_results(Some(ApplyResults::default()/* use setters */));
349 /// let x = Deployment::new().set_or_clear_delete_results(None::<ApplyResults>);
350 /// ```
351 pub fn set_or_clear_delete_results<T>(mut self, v: std::option::Option<T>) -> Self
352 where
353 T: std::convert::Into<crate::model::ApplyResults>,
354 {
355 self.delete_results = v.map(|x| x.into());
356 self
357 }
358
359 /// Sets the value of [delete_build][crate::model::Deployment::delete_build].
360 ///
361 /// # Example
362 /// ```ignore,no_run
363 /// # use google_cloud_config_v1::model::Deployment;
364 /// let x = Deployment::new().set_delete_build("example");
365 /// ```
366 pub fn set_delete_build<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
367 self.delete_build = v.into();
368 self
369 }
370
371 /// Sets the value of [delete_logs][crate::model::Deployment::delete_logs].
372 ///
373 /// # Example
374 /// ```ignore,no_run
375 /// # use google_cloud_config_v1::model::Deployment;
376 /// let x = Deployment::new().set_delete_logs("example");
377 /// ```
378 pub fn set_delete_logs<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
379 self.delete_logs = v.into();
380 self
381 }
382
383 /// Sets the value of [tf_errors][crate::model::Deployment::tf_errors].
384 ///
385 /// # Example
386 /// ```ignore,no_run
387 /// # use google_cloud_config_v1::model::Deployment;
388 /// use google_cloud_config_v1::model::TerraformError;
389 /// let x = Deployment::new()
390 /// .set_tf_errors([
391 /// TerraformError::default()/* use setters */,
392 /// TerraformError::default()/* use (different) setters */,
393 /// ]);
394 /// ```
395 pub fn set_tf_errors<T, V>(mut self, v: T) -> Self
396 where
397 T: std::iter::IntoIterator<Item = V>,
398 V: std::convert::Into<crate::model::TerraformError>,
399 {
400 use std::iter::Iterator;
401 self.tf_errors = v.into_iter().map(|i| i.into()).collect();
402 self
403 }
404
405 /// Sets the value of [error_logs][crate::model::Deployment::error_logs].
406 ///
407 /// # Example
408 /// ```ignore,no_run
409 /// # use google_cloud_config_v1::model::Deployment;
410 /// let x = Deployment::new().set_error_logs("example");
411 /// ```
412 pub fn set_error_logs<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
413 self.error_logs = v.into();
414 self
415 }
416
417 /// Sets the value of [artifacts_gcs_bucket][crate::model::Deployment::artifacts_gcs_bucket].
418 ///
419 /// # Example
420 /// ```ignore,no_run
421 /// # use google_cloud_config_v1::model::Deployment;
422 /// let x = Deployment::new().set_artifacts_gcs_bucket("example");
423 /// ```
424 pub fn set_artifacts_gcs_bucket<T>(mut self, v: T) -> Self
425 where
426 T: std::convert::Into<std::string::String>,
427 {
428 self.artifacts_gcs_bucket = std::option::Option::Some(v.into());
429 self
430 }
431
432 /// Sets or clears the value of [artifacts_gcs_bucket][crate::model::Deployment::artifacts_gcs_bucket].
433 ///
434 /// # Example
435 /// ```ignore,no_run
436 /// # use google_cloud_config_v1::model::Deployment;
437 /// let x = Deployment::new().set_or_clear_artifacts_gcs_bucket(Some("example"));
438 /// let x = Deployment::new().set_or_clear_artifacts_gcs_bucket(None::<String>);
439 /// ```
440 pub fn set_or_clear_artifacts_gcs_bucket<T>(mut self, v: std::option::Option<T>) -> Self
441 where
442 T: std::convert::Into<std::string::String>,
443 {
444 self.artifacts_gcs_bucket = v.map(|x| x.into());
445 self
446 }
447
448 /// Sets the value of [service_account][crate::model::Deployment::service_account].
449 ///
450 /// # Example
451 /// ```ignore,no_run
452 /// # use google_cloud_config_v1::model::Deployment;
453 /// let x = Deployment::new().set_service_account("example");
454 /// ```
455 pub fn set_service_account<T>(mut self, v: T) -> Self
456 where
457 T: std::convert::Into<std::string::String>,
458 {
459 self.service_account = std::option::Option::Some(v.into());
460 self
461 }
462
463 /// Sets or clears the value of [service_account][crate::model::Deployment::service_account].
464 ///
465 /// # Example
466 /// ```ignore,no_run
467 /// # use google_cloud_config_v1::model::Deployment;
468 /// let x = Deployment::new().set_or_clear_service_account(Some("example"));
469 /// let x = Deployment::new().set_or_clear_service_account(None::<String>);
470 /// ```
471 pub fn set_or_clear_service_account<T>(mut self, v: std::option::Option<T>) -> Self
472 where
473 T: std::convert::Into<std::string::String>,
474 {
475 self.service_account = v.map(|x| x.into());
476 self
477 }
478
479 /// Sets the value of [import_existing_resources][crate::model::Deployment::import_existing_resources].
480 ///
481 /// # Example
482 /// ```ignore,no_run
483 /// # use google_cloud_config_v1::model::Deployment;
484 /// let x = Deployment::new().set_import_existing_resources(true);
485 /// ```
486 pub fn set_import_existing_resources<T>(mut self, v: T) -> Self
487 where
488 T: std::convert::Into<bool>,
489 {
490 self.import_existing_resources = std::option::Option::Some(v.into());
491 self
492 }
493
494 /// Sets or clears the value of [import_existing_resources][crate::model::Deployment::import_existing_resources].
495 ///
496 /// # Example
497 /// ```ignore,no_run
498 /// # use google_cloud_config_v1::model::Deployment;
499 /// let x = Deployment::new().set_or_clear_import_existing_resources(Some(false));
500 /// let x = Deployment::new().set_or_clear_import_existing_resources(None::<bool>);
501 /// ```
502 pub fn set_or_clear_import_existing_resources<T>(mut self, v: std::option::Option<T>) -> Self
503 where
504 T: std::convert::Into<bool>,
505 {
506 self.import_existing_resources = v.map(|x| x.into());
507 self
508 }
509
510 /// Sets the value of [worker_pool][crate::model::Deployment::worker_pool].
511 ///
512 /// # Example
513 /// ```ignore,no_run
514 /// # use google_cloud_config_v1::model::Deployment;
515 /// let x = Deployment::new().set_worker_pool("example");
516 /// ```
517 pub fn set_worker_pool<T>(mut self, v: T) -> Self
518 where
519 T: std::convert::Into<std::string::String>,
520 {
521 self.worker_pool = std::option::Option::Some(v.into());
522 self
523 }
524
525 /// Sets or clears the value of [worker_pool][crate::model::Deployment::worker_pool].
526 ///
527 /// # Example
528 /// ```ignore,no_run
529 /// # use google_cloud_config_v1::model::Deployment;
530 /// let x = Deployment::new().set_or_clear_worker_pool(Some("example"));
531 /// let x = Deployment::new().set_or_clear_worker_pool(None::<String>);
532 /// ```
533 pub fn set_or_clear_worker_pool<T>(mut self, v: std::option::Option<T>) -> Self
534 where
535 T: std::convert::Into<std::string::String>,
536 {
537 self.worker_pool = v.map(|x| x.into());
538 self
539 }
540
541 /// Sets the value of [lock_state][crate::model::Deployment::lock_state].
542 ///
543 /// # Example
544 /// ```ignore,no_run
545 /// # use google_cloud_config_v1::model::Deployment;
546 /// use google_cloud_config_v1::model::deployment::LockState;
547 /// let x0 = Deployment::new().set_lock_state(LockState::Locked);
548 /// let x1 = Deployment::new().set_lock_state(LockState::Unlocked);
549 /// let x2 = Deployment::new().set_lock_state(LockState::Locking);
550 /// ```
551 pub fn set_lock_state<T: std::convert::Into<crate::model::deployment::LockState>>(
552 mut self,
553 v: T,
554 ) -> Self {
555 self.lock_state = v.into();
556 self
557 }
558
559 /// Sets the value of [tf_version_constraint][crate::model::Deployment::tf_version_constraint].
560 ///
561 /// # Example
562 /// ```ignore,no_run
563 /// # use google_cloud_config_v1::model::Deployment;
564 /// let x = Deployment::new().set_tf_version_constraint("example");
565 /// ```
566 pub fn set_tf_version_constraint<T>(mut self, v: T) -> Self
567 where
568 T: std::convert::Into<std::string::String>,
569 {
570 self.tf_version_constraint = std::option::Option::Some(v.into());
571 self
572 }
573
574 /// Sets or clears the value of [tf_version_constraint][crate::model::Deployment::tf_version_constraint].
575 ///
576 /// # Example
577 /// ```ignore,no_run
578 /// # use google_cloud_config_v1::model::Deployment;
579 /// let x = Deployment::new().set_or_clear_tf_version_constraint(Some("example"));
580 /// let x = Deployment::new().set_or_clear_tf_version_constraint(None::<String>);
581 /// ```
582 pub fn set_or_clear_tf_version_constraint<T>(mut self, v: std::option::Option<T>) -> Self
583 where
584 T: std::convert::Into<std::string::String>,
585 {
586 self.tf_version_constraint = v.map(|x| x.into());
587 self
588 }
589
590 /// Sets the value of [tf_version][crate::model::Deployment::tf_version].
591 ///
592 /// # Example
593 /// ```ignore,no_run
594 /// # use google_cloud_config_v1::model::Deployment;
595 /// let x = Deployment::new().set_tf_version("example");
596 /// ```
597 pub fn set_tf_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
598 self.tf_version = v.into();
599 self
600 }
601
602 /// Sets the value of [quota_validation][crate::model::Deployment::quota_validation].
603 ///
604 /// # Example
605 /// ```ignore,no_run
606 /// # use google_cloud_config_v1::model::Deployment;
607 /// use google_cloud_config_v1::model::QuotaValidation;
608 /// let x0 = Deployment::new().set_quota_validation(QuotaValidation::Enabled);
609 /// let x1 = Deployment::new().set_quota_validation(QuotaValidation::Enforced);
610 /// ```
611 pub fn set_quota_validation<T: std::convert::Into<crate::model::QuotaValidation>>(
612 mut self,
613 v: T,
614 ) -> Self {
615 self.quota_validation = v.into();
616 self
617 }
618
619 /// Sets the value of [annotations][crate::model::Deployment::annotations].
620 ///
621 /// # Example
622 /// ```ignore,no_run
623 /// # use google_cloud_config_v1::model::Deployment;
624 /// let x = Deployment::new().set_annotations([
625 /// ("key0", "abc"),
626 /// ("key1", "xyz"),
627 /// ]);
628 /// ```
629 pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
630 where
631 T: std::iter::IntoIterator<Item = (K, V)>,
632 K: std::convert::Into<std::string::String>,
633 V: std::convert::Into<std::string::String>,
634 {
635 use std::iter::Iterator;
636 self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
637 self
638 }
639
640 /// Sets the value of [provider_config][crate::model::Deployment::provider_config].
641 ///
642 /// # Example
643 /// ```ignore,no_run
644 /// # use google_cloud_config_v1::model::Deployment;
645 /// use google_cloud_config_v1::model::ProviderConfig;
646 /// let x = Deployment::new().set_provider_config(ProviderConfig::default()/* use setters */);
647 /// ```
648 pub fn set_provider_config<T>(mut self, v: T) -> Self
649 where
650 T: std::convert::Into<crate::model::ProviderConfig>,
651 {
652 self.provider_config = std::option::Option::Some(v.into());
653 self
654 }
655
656 /// Sets or clears the value of [provider_config][crate::model::Deployment::provider_config].
657 ///
658 /// # Example
659 /// ```ignore,no_run
660 /// # use google_cloud_config_v1::model::Deployment;
661 /// use google_cloud_config_v1::model::ProviderConfig;
662 /// let x = Deployment::new().set_or_clear_provider_config(Some(ProviderConfig::default()/* use setters */));
663 /// let x = Deployment::new().set_or_clear_provider_config(None::<ProviderConfig>);
664 /// ```
665 pub fn set_or_clear_provider_config<T>(mut self, v: std::option::Option<T>) -> Self
666 where
667 T: std::convert::Into<crate::model::ProviderConfig>,
668 {
669 self.provider_config = v.map(|x| x.into());
670 self
671 }
672
673 /// Sets the value of [blueprint][crate::model::Deployment::blueprint].
674 ///
675 /// Note that all the setters affecting `blueprint` are mutually
676 /// exclusive.
677 ///
678 /// # Example
679 /// ```ignore,no_run
680 /// # use google_cloud_config_v1::model::Deployment;
681 /// use google_cloud_config_v1::model::TerraformBlueprint;
682 /// let x = Deployment::new().set_blueprint(Some(
683 /// google_cloud_config_v1::model::deployment::Blueprint::TerraformBlueprint(TerraformBlueprint::default().into())));
684 /// ```
685 pub fn set_blueprint<
686 T: std::convert::Into<std::option::Option<crate::model::deployment::Blueprint>>,
687 >(
688 mut self,
689 v: T,
690 ) -> Self {
691 self.blueprint = v.into();
692 self
693 }
694
695 /// The value of [blueprint][crate::model::Deployment::blueprint]
696 /// if it holds a `TerraformBlueprint`, `None` if the field is not set or
697 /// holds a different branch.
698 pub fn terraform_blueprint(
699 &self,
700 ) -> std::option::Option<&std::boxed::Box<crate::model::TerraformBlueprint>> {
701 #[allow(unreachable_patterns)]
702 self.blueprint.as_ref().and_then(|v| match v {
703 crate::model::deployment::Blueprint::TerraformBlueprint(v) => {
704 std::option::Option::Some(v)
705 }
706 _ => std::option::Option::None,
707 })
708 }
709
710 /// Sets the value of [blueprint][crate::model::Deployment::blueprint]
711 /// to hold a `TerraformBlueprint`.
712 ///
713 /// Note that all the setters affecting `blueprint` are
714 /// mutually exclusive.
715 ///
716 /// # Example
717 /// ```ignore,no_run
718 /// # use google_cloud_config_v1::model::Deployment;
719 /// use google_cloud_config_v1::model::TerraformBlueprint;
720 /// let x = Deployment::new().set_terraform_blueprint(TerraformBlueprint::default()/* use setters */);
721 /// assert!(x.terraform_blueprint().is_some());
722 /// ```
723 pub fn set_terraform_blueprint<
724 T: std::convert::Into<std::boxed::Box<crate::model::TerraformBlueprint>>,
725 >(
726 mut self,
727 v: T,
728 ) -> Self {
729 self.blueprint = std::option::Option::Some(
730 crate::model::deployment::Blueprint::TerraformBlueprint(v.into()),
731 );
732 self
733 }
734}
735
736impl wkt::message::Message for Deployment {
737 fn typename() -> &'static str {
738 "type.googleapis.com/google.cloud.config.v1.Deployment"
739 }
740}
741
742/// Defines additional types related to [Deployment].
743pub mod deployment {
744 #[allow(unused_imports)]
745 use super::*;
746
747 /// Possible states of a deployment.
748 ///
749 /// # Working with unknown values
750 ///
751 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
752 /// additional enum variants at any time. Adding new variants is not considered
753 /// a breaking change. Applications should write their code in anticipation of:
754 ///
755 /// - New values appearing in future releases of the client library, **and**
756 /// - New values received dynamically, without application changes.
757 ///
758 /// Please consult the [Working with enums] section in the user guide for some
759 /// guidelines.
760 ///
761 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
762 #[derive(Clone, Debug, PartialEq)]
763 #[non_exhaustive]
764 pub enum State {
765 /// The default value. This value is used if the state is omitted.
766 Unspecified,
767 /// The deployment is being created.
768 Creating,
769 /// The deployment is healthy.
770 Active,
771 /// The deployment is being updated.
772 Updating,
773 /// The deployment is being deleted.
774 Deleting,
775 /// The deployment has encountered an unexpected error.
776 Failed,
777 /// The deployment is no longer being actively reconciled.
778 /// This may be the result of recovering the project after deletion.
779 Suspended,
780 /// The deployment has been deleted.
781 Deleted,
782 /// If set, the enum was initialized with an unknown value.
783 ///
784 /// Applications can examine the value using [State::value] or
785 /// [State::name].
786 UnknownValue(state::UnknownValue),
787 }
788
789 #[doc(hidden)]
790 pub mod state {
791 #[allow(unused_imports)]
792 use super::*;
793 #[derive(Clone, Debug, PartialEq)]
794 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
795 }
796
797 impl State {
798 /// Gets the enum value.
799 ///
800 /// Returns `None` if the enum contains an unknown value deserialized from
801 /// the string representation of enums.
802 pub fn value(&self) -> std::option::Option<i32> {
803 match self {
804 Self::Unspecified => std::option::Option::Some(0),
805 Self::Creating => std::option::Option::Some(1),
806 Self::Active => std::option::Option::Some(2),
807 Self::Updating => std::option::Option::Some(3),
808 Self::Deleting => std::option::Option::Some(4),
809 Self::Failed => std::option::Option::Some(5),
810 Self::Suspended => std::option::Option::Some(6),
811 Self::Deleted => std::option::Option::Some(7),
812 Self::UnknownValue(u) => u.0.value(),
813 }
814 }
815
816 /// Gets the enum value as a string.
817 ///
818 /// Returns `None` if the enum contains an unknown value deserialized from
819 /// the integer representation of enums.
820 pub fn name(&self) -> std::option::Option<&str> {
821 match self {
822 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
823 Self::Creating => std::option::Option::Some("CREATING"),
824 Self::Active => std::option::Option::Some("ACTIVE"),
825 Self::Updating => std::option::Option::Some("UPDATING"),
826 Self::Deleting => std::option::Option::Some("DELETING"),
827 Self::Failed => std::option::Option::Some("FAILED"),
828 Self::Suspended => std::option::Option::Some("SUSPENDED"),
829 Self::Deleted => std::option::Option::Some("DELETED"),
830 Self::UnknownValue(u) => u.0.name(),
831 }
832 }
833 }
834
835 impl std::default::Default for State {
836 fn default() -> Self {
837 use std::convert::From;
838 Self::from(0)
839 }
840 }
841
842 impl std::fmt::Display for State {
843 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
844 wkt::internal::display_enum(f, self.name(), self.value())
845 }
846 }
847
848 impl std::convert::From<i32> for State {
849 fn from(value: i32) -> Self {
850 match value {
851 0 => Self::Unspecified,
852 1 => Self::Creating,
853 2 => Self::Active,
854 3 => Self::Updating,
855 4 => Self::Deleting,
856 5 => Self::Failed,
857 6 => Self::Suspended,
858 7 => Self::Deleted,
859 _ => Self::UnknownValue(state::UnknownValue(
860 wkt::internal::UnknownEnumValue::Integer(value),
861 )),
862 }
863 }
864 }
865
866 impl std::convert::From<&str> for State {
867 fn from(value: &str) -> Self {
868 use std::string::ToString;
869 match value {
870 "STATE_UNSPECIFIED" => Self::Unspecified,
871 "CREATING" => Self::Creating,
872 "ACTIVE" => Self::Active,
873 "UPDATING" => Self::Updating,
874 "DELETING" => Self::Deleting,
875 "FAILED" => Self::Failed,
876 "SUSPENDED" => Self::Suspended,
877 "DELETED" => Self::Deleted,
878 _ => Self::UnknownValue(state::UnknownValue(
879 wkt::internal::UnknownEnumValue::String(value.to_string()),
880 )),
881 }
882 }
883 }
884
885 impl serde::ser::Serialize for State {
886 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
887 where
888 S: serde::Serializer,
889 {
890 match self {
891 Self::Unspecified => serializer.serialize_i32(0),
892 Self::Creating => serializer.serialize_i32(1),
893 Self::Active => serializer.serialize_i32(2),
894 Self::Updating => serializer.serialize_i32(3),
895 Self::Deleting => serializer.serialize_i32(4),
896 Self::Failed => serializer.serialize_i32(5),
897 Self::Suspended => serializer.serialize_i32(6),
898 Self::Deleted => serializer.serialize_i32(7),
899 Self::UnknownValue(u) => u.0.serialize(serializer),
900 }
901 }
902 }
903
904 impl<'de> serde::de::Deserialize<'de> for State {
905 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
906 where
907 D: serde::Deserializer<'de>,
908 {
909 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
910 ".google.cloud.config.v1.Deployment.State",
911 ))
912 }
913 }
914
915 /// Possible errors that can occur with deployments.
916 ///
917 /// # Working with unknown values
918 ///
919 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
920 /// additional enum variants at any time. Adding new variants is not considered
921 /// a breaking change. Applications should write their code in anticipation of:
922 ///
923 /// - New values appearing in future releases of the client library, **and**
924 /// - New values received dynamically, without application changes.
925 ///
926 /// Please consult the [Working with enums] section in the user guide for some
927 /// guidelines.
928 ///
929 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
930 #[derive(Clone, Debug, PartialEq)]
931 #[non_exhaustive]
932 pub enum ErrorCode {
933 /// No error code was specified.
934 Unspecified,
935 /// The revision failed. See Revision for more details.
936 RevisionFailed,
937 /// Cloud Build failed due to a permission issue.
938 CloudBuildPermissionDenied,
939 /// Cloud Build job associated with a deployment deletion could not be
940 /// started.
941 DeleteBuildApiFailed,
942 /// Cloud Build job associated with a deployment deletion was started but
943 /// failed.
944 DeleteBuildRunFailed,
945 /// Cloud Storage bucket creation failed due to a permission issue.
946 BucketCreationPermissionDenied,
947 /// Cloud Storage bucket creation failed due to an issue unrelated to
948 /// permissions.
949 BucketCreationFailed,
950 /// Failed to import values from an external source.
951 ExternalValueSourceImportFailed,
952 /// If set, the enum was initialized with an unknown value.
953 ///
954 /// Applications can examine the value using [ErrorCode::value] or
955 /// [ErrorCode::name].
956 UnknownValue(error_code::UnknownValue),
957 }
958
959 #[doc(hidden)]
960 pub mod error_code {
961 #[allow(unused_imports)]
962 use super::*;
963 #[derive(Clone, Debug, PartialEq)]
964 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
965 }
966
967 impl ErrorCode {
968 /// Gets the enum value.
969 ///
970 /// Returns `None` if the enum contains an unknown value deserialized from
971 /// the string representation of enums.
972 pub fn value(&self) -> std::option::Option<i32> {
973 match self {
974 Self::Unspecified => std::option::Option::Some(0),
975 Self::RevisionFailed => std::option::Option::Some(1),
976 Self::CloudBuildPermissionDenied => std::option::Option::Some(3),
977 Self::DeleteBuildApiFailed => std::option::Option::Some(5),
978 Self::DeleteBuildRunFailed => std::option::Option::Some(6),
979 Self::BucketCreationPermissionDenied => std::option::Option::Some(7),
980 Self::BucketCreationFailed => std::option::Option::Some(8),
981 Self::ExternalValueSourceImportFailed => std::option::Option::Some(10),
982 Self::UnknownValue(u) => u.0.value(),
983 }
984 }
985
986 /// Gets the enum value as a string.
987 ///
988 /// Returns `None` if the enum contains an unknown value deserialized from
989 /// the integer representation of enums.
990 pub fn name(&self) -> std::option::Option<&str> {
991 match self {
992 Self::Unspecified => std::option::Option::Some("ERROR_CODE_UNSPECIFIED"),
993 Self::RevisionFailed => std::option::Option::Some("REVISION_FAILED"),
994 Self::CloudBuildPermissionDenied => {
995 std::option::Option::Some("CLOUD_BUILD_PERMISSION_DENIED")
996 }
997 Self::DeleteBuildApiFailed => std::option::Option::Some("DELETE_BUILD_API_FAILED"),
998 Self::DeleteBuildRunFailed => std::option::Option::Some("DELETE_BUILD_RUN_FAILED"),
999 Self::BucketCreationPermissionDenied => {
1000 std::option::Option::Some("BUCKET_CREATION_PERMISSION_DENIED")
1001 }
1002 Self::BucketCreationFailed => std::option::Option::Some("BUCKET_CREATION_FAILED"),
1003 Self::ExternalValueSourceImportFailed => {
1004 std::option::Option::Some("EXTERNAL_VALUE_SOURCE_IMPORT_FAILED")
1005 }
1006 Self::UnknownValue(u) => u.0.name(),
1007 }
1008 }
1009 }
1010
1011 impl std::default::Default for ErrorCode {
1012 fn default() -> Self {
1013 use std::convert::From;
1014 Self::from(0)
1015 }
1016 }
1017
1018 impl std::fmt::Display for ErrorCode {
1019 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1020 wkt::internal::display_enum(f, self.name(), self.value())
1021 }
1022 }
1023
1024 impl std::convert::From<i32> for ErrorCode {
1025 fn from(value: i32) -> Self {
1026 match value {
1027 0 => Self::Unspecified,
1028 1 => Self::RevisionFailed,
1029 3 => Self::CloudBuildPermissionDenied,
1030 5 => Self::DeleteBuildApiFailed,
1031 6 => Self::DeleteBuildRunFailed,
1032 7 => Self::BucketCreationPermissionDenied,
1033 8 => Self::BucketCreationFailed,
1034 10 => Self::ExternalValueSourceImportFailed,
1035 _ => Self::UnknownValue(error_code::UnknownValue(
1036 wkt::internal::UnknownEnumValue::Integer(value),
1037 )),
1038 }
1039 }
1040 }
1041
1042 impl std::convert::From<&str> for ErrorCode {
1043 fn from(value: &str) -> Self {
1044 use std::string::ToString;
1045 match value {
1046 "ERROR_CODE_UNSPECIFIED" => Self::Unspecified,
1047 "REVISION_FAILED" => Self::RevisionFailed,
1048 "CLOUD_BUILD_PERMISSION_DENIED" => Self::CloudBuildPermissionDenied,
1049 "DELETE_BUILD_API_FAILED" => Self::DeleteBuildApiFailed,
1050 "DELETE_BUILD_RUN_FAILED" => Self::DeleteBuildRunFailed,
1051 "BUCKET_CREATION_PERMISSION_DENIED" => Self::BucketCreationPermissionDenied,
1052 "BUCKET_CREATION_FAILED" => Self::BucketCreationFailed,
1053 "EXTERNAL_VALUE_SOURCE_IMPORT_FAILED" => Self::ExternalValueSourceImportFailed,
1054 _ => Self::UnknownValue(error_code::UnknownValue(
1055 wkt::internal::UnknownEnumValue::String(value.to_string()),
1056 )),
1057 }
1058 }
1059 }
1060
1061 impl serde::ser::Serialize for ErrorCode {
1062 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1063 where
1064 S: serde::Serializer,
1065 {
1066 match self {
1067 Self::Unspecified => serializer.serialize_i32(0),
1068 Self::RevisionFailed => serializer.serialize_i32(1),
1069 Self::CloudBuildPermissionDenied => serializer.serialize_i32(3),
1070 Self::DeleteBuildApiFailed => serializer.serialize_i32(5),
1071 Self::DeleteBuildRunFailed => serializer.serialize_i32(6),
1072 Self::BucketCreationPermissionDenied => serializer.serialize_i32(7),
1073 Self::BucketCreationFailed => serializer.serialize_i32(8),
1074 Self::ExternalValueSourceImportFailed => serializer.serialize_i32(10),
1075 Self::UnknownValue(u) => u.0.serialize(serializer),
1076 }
1077 }
1078 }
1079
1080 impl<'de> serde::de::Deserialize<'de> for ErrorCode {
1081 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1082 where
1083 D: serde::Deserializer<'de>,
1084 {
1085 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ErrorCode>::new(
1086 ".google.cloud.config.v1.Deployment.ErrorCode",
1087 ))
1088 }
1089 }
1090
1091 /// Possible lock states of a deployment.
1092 ///
1093 /// # Working with unknown values
1094 ///
1095 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1096 /// additional enum variants at any time. Adding new variants is not considered
1097 /// a breaking change. Applications should write their code in anticipation of:
1098 ///
1099 /// - New values appearing in future releases of the client library, **and**
1100 /// - New values received dynamically, without application changes.
1101 ///
1102 /// Please consult the [Working with enums] section in the user guide for some
1103 /// guidelines.
1104 ///
1105 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
1106 #[derive(Clone, Debug, PartialEq)]
1107 #[non_exhaustive]
1108 pub enum LockState {
1109 /// The default value. This value is used if the lock state is omitted.
1110 Unspecified,
1111 /// The deployment is locked.
1112 Locked,
1113 /// The deployment is unlocked.
1114 Unlocked,
1115 /// The deployment is being locked.
1116 Locking,
1117 /// The deployment is being unlocked.
1118 Unlocking,
1119 /// The deployment has failed to lock.
1120 LockFailed,
1121 /// The deployment has failed to unlock.
1122 UnlockFailed,
1123 /// If set, the enum was initialized with an unknown value.
1124 ///
1125 /// Applications can examine the value using [LockState::value] or
1126 /// [LockState::name].
1127 UnknownValue(lock_state::UnknownValue),
1128 }
1129
1130 #[doc(hidden)]
1131 pub mod lock_state {
1132 #[allow(unused_imports)]
1133 use super::*;
1134 #[derive(Clone, Debug, PartialEq)]
1135 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1136 }
1137
1138 impl LockState {
1139 /// Gets the enum value.
1140 ///
1141 /// Returns `None` if the enum contains an unknown value deserialized from
1142 /// the string representation of enums.
1143 pub fn value(&self) -> std::option::Option<i32> {
1144 match self {
1145 Self::Unspecified => std::option::Option::Some(0),
1146 Self::Locked => std::option::Option::Some(1),
1147 Self::Unlocked => std::option::Option::Some(2),
1148 Self::Locking => std::option::Option::Some(3),
1149 Self::Unlocking => std::option::Option::Some(4),
1150 Self::LockFailed => std::option::Option::Some(5),
1151 Self::UnlockFailed => std::option::Option::Some(6),
1152 Self::UnknownValue(u) => u.0.value(),
1153 }
1154 }
1155
1156 /// Gets the enum value as a string.
1157 ///
1158 /// Returns `None` if the enum contains an unknown value deserialized from
1159 /// the integer representation of enums.
1160 pub fn name(&self) -> std::option::Option<&str> {
1161 match self {
1162 Self::Unspecified => std::option::Option::Some("LOCK_STATE_UNSPECIFIED"),
1163 Self::Locked => std::option::Option::Some("LOCKED"),
1164 Self::Unlocked => std::option::Option::Some("UNLOCKED"),
1165 Self::Locking => std::option::Option::Some("LOCKING"),
1166 Self::Unlocking => std::option::Option::Some("UNLOCKING"),
1167 Self::LockFailed => std::option::Option::Some("LOCK_FAILED"),
1168 Self::UnlockFailed => std::option::Option::Some("UNLOCK_FAILED"),
1169 Self::UnknownValue(u) => u.0.name(),
1170 }
1171 }
1172 }
1173
1174 impl std::default::Default for LockState {
1175 fn default() -> Self {
1176 use std::convert::From;
1177 Self::from(0)
1178 }
1179 }
1180
1181 impl std::fmt::Display for LockState {
1182 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1183 wkt::internal::display_enum(f, self.name(), self.value())
1184 }
1185 }
1186
1187 impl std::convert::From<i32> for LockState {
1188 fn from(value: i32) -> Self {
1189 match value {
1190 0 => Self::Unspecified,
1191 1 => Self::Locked,
1192 2 => Self::Unlocked,
1193 3 => Self::Locking,
1194 4 => Self::Unlocking,
1195 5 => Self::LockFailed,
1196 6 => Self::UnlockFailed,
1197 _ => Self::UnknownValue(lock_state::UnknownValue(
1198 wkt::internal::UnknownEnumValue::Integer(value),
1199 )),
1200 }
1201 }
1202 }
1203
1204 impl std::convert::From<&str> for LockState {
1205 fn from(value: &str) -> Self {
1206 use std::string::ToString;
1207 match value {
1208 "LOCK_STATE_UNSPECIFIED" => Self::Unspecified,
1209 "LOCKED" => Self::Locked,
1210 "UNLOCKED" => Self::Unlocked,
1211 "LOCKING" => Self::Locking,
1212 "UNLOCKING" => Self::Unlocking,
1213 "LOCK_FAILED" => Self::LockFailed,
1214 "UNLOCK_FAILED" => Self::UnlockFailed,
1215 _ => Self::UnknownValue(lock_state::UnknownValue(
1216 wkt::internal::UnknownEnumValue::String(value.to_string()),
1217 )),
1218 }
1219 }
1220 }
1221
1222 impl serde::ser::Serialize for LockState {
1223 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1224 where
1225 S: serde::Serializer,
1226 {
1227 match self {
1228 Self::Unspecified => serializer.serialize_i32(0),
1229 Self::Locked => serializer.serialize_i32(1),
1230 Self::Unlocked => serializer.serialize_i32(2),
1231 Self::Locking => serializer.serialize_i32(3),
1232 Self::Unlocking => serializer.serialize_i32(4),
1233 Self::LockFailed => serializer.serialize_i32(5),
1234 Self::UnlockFailed => serializer.serialize_i32(6),
1235 Self::UnknownValue(u) => u.0.serialize(serializer),
1236 }
1237 }
1238 }
1239
1240 impl<'de> serde::de::Deserialize<'de> for LockState {
1241 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1242 where
1243 D: serde::Deserializer<'de>,
1244 {
1245 deserializer.deserialize_any(wkt::internal::EnumVisitor::<LockState>::new(
1246 ".google.cloud.config.v1.Deployment.LockState",
1247 ))
1248 }
1249 }
1250
1251 /// Blueprint to deploy.
1252 #[derive(Clone, Debug, PartialEq)]
1253 #[non_exhaustive]
1254 pub enum Blueprint {
1255 /// A blueprint described using Terraform's HashiCorp Configuration Language
1256 /// as a root module.
1257 TerraformBlueprint(std::boxed::Box<crate::model::TerraformBlueprint>),
1258 }
1259}
1260
1261/// TerraformBlueprint describes the source of a Terraform root module which
1262/// describes the resources and configs to be deployed.
1263#[derive(Clone, Default, PartialEq)]
1264#[non_exhaustive]
1265pub struct TerraformBlueprint {
1266 /// Optional. Input variable values for the Terraform blueprint.
1267 pub input_values:
1268 std::collections::HashMap<std::string::String, crate::model::TerraformVariable>,
1269
1270 /// Optional. Map of input variable names in this blueprint to configurations
1271 /// for importing values from external sources.
1272 pub external_values:
1273 std::collections::HashMap<std::string::String, crate::model::ExternalValueSource>,
1274
1275 /// Location of the source configs.
1276 /// Required.
1277 pub source: std::option::Option<crate::model::terraform_blueprint::Source>,
1278
1279 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1280}
1281
1282impl TerraformBlueprint {
1283 /// Creates a new default instance.
1284 pub fn new() -> Self {
1285 std::default::Default::default()
1286 }
1287
1288 /// Sets the value of [input_values][crate::model::TerraformBlueprint::input_values].
1289 ///
1290 /// # Example
1291 /// ```ignore,no_run
1292 /// # use google_cloud_config_v1::model::TerraformBlueprint;
1293 /// use google_cloud_config_v1::model::TerraformVariable;
1294 /// let x = TerraformBlueprint::new().set_input_values([
1295 /// ("key0", TerraformVariable::default()/* use setters */),
1296 /// ("key1", TerraformVariable::default()/* use (different) setters */),
1297 /// ]);
1298 /// ```
1299 pub fn set_input_values<T, K, V>(mut self, v: T) -> Self
1300 where
1301 T: std::iter::IntoIterator<Item = (K, V)>,
1302 K: std::convert::Into<std::string::String>,
1303 V: std::convert::Into<crate::model::TerraformVariable>,
1304 {
1305 use std::iter::Iterator;
1306 self.input_values = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1307 self
1308 }
1309
1310 /// Sets the value of [external_values][crate::model::TerraformBlueprint::external_values].
1311 ///
1312 /// # Example
1313 /// ```ignore,no_run
1314 /// # use google_cloud_config_v1::model::TerraformBlueprint;
1315 /// use google_cloud_config_v1::model::ExternalValueSource;
1316 /// let x = TerraformBlueprint::new().set_external_values([
1317 /// ("key0", ExternalValueSource::default()/* use setters */),
1318 /// ("key1", ExternalValueSource::default()/* use (different) setters */),
1319 /// ]);
1320 /// ```
1321 pub fn set_external_values<T, K, V>(mut self, v: T) -> Self
1322 where
1323 T: std::iter::IntoIterator<Item = (K, V)>,
1324 K: std::convert::Into<std::string::String>,
1325 V: std::convert::Into<crate::model::ExternalValueSource>,
1326 {
1327 use std::iter::Iterator;
1328 self.external_values = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1329 self
1330 }
1331
1332 /// Sets the value of [source][crate::model::TerraformBlueprint::source].
1333 ///
1334 /// Note that all the setters affecting `source` are mutually
1335 /// exclusive.
1336 ///
1337 /// # Example
1338 /// ```ignore,no_run
1339 /// # use google_cloud_config_v1::model::TerraformBlueprint;
1340 /// use google_cloud_config_v1::model::terraform_blueprint::Source;
1341 /// let x = TerraformBlueprint::new().set_source(Some(Source::GcsSource("example".to_string())));
1342 /// ```
1343 pub fn set_source<
1344 T: std::convert::Into<std::option::Option<crate::model::terraform_blueprint::Source>>,
1345 >(
1346 mut self,
1347 v: T,
1348 ) -> Self {
1349 self.source = v.into();
1350 self
1351 }
1352
1353 /// The value of [source][crate::model::TerraformBlueprint::source]
1354 /// if it holds a `GcsSource`, `None` if the field is not set or
1355 /// holds a different branch.
1356 pub fn gcs_source(&self) -> std::option::Option<&std::string::String> {
1357 #[allow(unreachable_patterns)]
1358 self.source.as_ref().and_then(|v| match v {
1359 crate::model::terraform_blueprint::Source::GcsSource(v) => std::option::Option::Some(v),
1360 _ => std::option::Option::None,
1361 })
1362 }
1363
1364 /// Sets the value of [source][crate::model::TerraformBlueprint::source]
1365 /// to hold a `GcsSource`.
1366 ///
1367 /// Note that all the setters affecting `source` are
1368 /// mutually exclusive.
1369 ///
1370 /// # Example
1371 /// ```ignore,no_run
1372 /// # use google_cloud_config_v1::model::TerraformBlueprint;
1373 /// let x = TerraformBlueprint::new().set_gcs_source("example");
1374 /// assert!(x.gcs_source().is_some());
1375 /// assert!(x.git_source().is_none());
1376 /// ```
1377 pub fn set_gcs_source<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1378 self.source = std::option::Option::Some(
1379 crate::model::terraform_blueprint::Source::GcsSource(v.into()),
1380 );
1381 self
1382 }
1383
1384 /// The value of [source][crate::model::TerraformBlueprint::source]
1385 /// if it holds a `GitSource`, `None` if the field is not set or
1386 /// holds a different branch.
1387 pub fn git_source(&self) -> std::option::Option<&std::boxed::Box<crate::model::GitSource>> {
1388 #[allow(unreachable_patterns)]
1389 self.source.as_ref().and_then(|v| match v {
1390 crate::model::terraform_blueprint::Source::GitSource(v) => std::option::Option::Some(v),
1391 _ => std::option::Option::None,
1392 })
1393 }
1394
1395 /// Sets the value of [source][crate::model::TerraformBlueprint::source]
1396 /// to hold a `GitSource`.
1397 ///
1398 /// Note that all the setters affecting `source` are
1399 /// mutually exclusive.
1400 ///
1401 /// # Example
1402 /// ```ignore,no_run
1403 /// # use google_cloud_config_v1::model::TerraformBlueprint;
1404 /// use google_cloud_config_v1::model::GitSource;
1405 /// let x = TerraformBlueprint::new().set_git_source(GitSource::default()/* use setters */);
1406 /// assert!(x.git_source().is_some());
1407 /// assert!(x.gcs_source().is_none());
1408 /// ```
1409 pub fn set_git_source<T: std::convert::Into<std::boxed::Box<crate::model::GitSource>>>(
1410 mut self,
1411 v: T,
1412 ) -> Self {
1413 self.source = std::option::Option::Some(
1414 crate::model::terraform_blueprint::Source::GitSource(v.into()),
1415 );
1416 self
1417 }
1418}
1419
1420impl wkt::message::Message for TerraformBlueprint {
1421 fn typename() -> &'static str {
1422 "type.googleapis.com/google.cloud.config.v1.TerraformBlueprint"
1423 }
1424}
1425
1426/// Defines additional types related to [TerraformBlueprint].
1427pub mod terraform_blueprint {
1428 #[allow(unused_imports)]
1429 use super::*;
1430
1431 /// Location of the source configs.
1432 /// Required.
1433 #[derive(Clone, Debug, PartialEq)]
1434 #[non_exhaustive]
1435 pub enum Source {
1436 /// URI of an object in Google Cloud Storage.
1437 /// Format: `gs://{bucket}/{object}`
1438 ///
1439 /// URI may also specify an object version for zipped objects.
1440 /// Format: `gs://{bucket}/{object}#{version}`
1441 GcsSource(std::string::String),
1442 /// URI of a public Git repo.
1443 GitSource(std::boxed::Box<crate::model::GitSource>),
1444 }
1445}
1446
1447/// A Terraform input variable.
1448#[derive(Clone, Default, PartialEq)]
1449#[non_exhaustive]
1450pub struct TerraformVariable {
1451 /// Optional. Input variable value.
1452 pub input_value: std::option::Option<wkt::Value>,
1453
1454 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1455}
1456
1457impl TerraformVariable {
1458 /// Creates a new default instance.
1459 pub fn new() -> Self {
1460 std::default::Default::default()
1461 }
1462
1463 /// Sets the value of [input_value][crate::model::TerraformVariable::input_value].
1464 ///
1465 /// # Example
1466 /// ```ignore,no_run
1467 /// # use google_cloud_config_v1::model::TerraformVariable;
1468 /// use wkt::Value;
1469 /// let x = TerraformVariable::new().set_input_value(Value::default()/* use setters */);
1470 /// ```
1471 pub fn set_input_value<T>(mut self, v: T) -> Self
1472 where
1473 T: std::convert::Into<wkt::Value>,
1474 {
1475 self.input_value = std::option::Option::Some(v.into());
1476 self
1477 }
1478
1479 /// Sets or clears the value of [input_value][crate::model::TerraformVariable::input_value].
1480 ///
1481 /// # Example
1482 /// ```ignore,no_run
1483 /// # use google_cloud_config_v1::model::TerraformVariable;
1484 /// use wkt::Value;
1485 /// let x = TerraformVariable::new().set_or_clear_input_value(Some(Value::default()/* use setters */));
1486 /// let x = TerraformVariable::new().set_or_clear_input_value(None::<Value>);
1487 /// ```
1488 pub fn set_or_clear_input_value<T>(mut self, v: std::option::Option<T>) -> Self
1489 where
1490 T: std::convert::Into<wkt::Value>,
1491 {
1492 self.input_value = v.map(|x| x.into());
1493 self
1494 }
1495}
1496
1497impl wkt::message::Message for TerraformVariable {
1498 fn typename() -> &'static str {
1499 "type.googleapis.com/google.cloud.config.v1.TerraformVariable"
1500 }
1501}
1502
1503/// Configuration for a source of an external value.
1504#[derive(Clone, Default, PartialEq)]
1505#[non_exhaustive]
1506pub struct ExternalValueSource {
1507 /// The source of the external value.
1508 pub source: std::option::Option<crate::model::external_value_source::Source>,
1509
1510 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1511}
1512
1513impl ExternalValueSource {
1514 /// Creates a new default instance.
1515 pub fn new() -> Self {
1516 std::default::Default::default()
1517 }
1518
1519 /// Sets the value of [source][crate::model::ExternalValueSource::source].
1520 ///
1521 /// Note that all the setters affecting `source` are mutually
1522 /// exclusive.
1523 ///
1524 /// # Example
1525 /// ```ignore,no_run
1526 /// # use google_cloud_config_v1::model::ExternalValueSource;
1527 /// use google_cloud_config_v1::model::DeploymentSource;
1528 /// let x = ExternalValueSource::new().set_source(Some(
1529 /// google_cloud_config_v1::model::external_value_source::Source::DeploymentSource(DeploymentSource::default().into())));
1530 /// ```
1531 pub fn set_source<
1532 T: std::convert::Into<std::option::Option<crate::model::external_value_source::Source>>,
1533 >(
1534 mut self,
1535 v: T,
1536 ) -> Self {
1537 self.source = v.into();
1538 self
1539 }
1540
1541 /// The value of [source][crate::model::ExternalValueSource::source]
1542 /// if it holds a `DeploymentSource`, `None` if the field is not set or
1543 /// holds a different branch.
1544 pub fn deployment_source(
1545 &self,
1546 ) -> std::option::Option<&std::boxed::Box<crate::model::DeploymentSource>> {
1547 #[allow(unreachable_patterns)]
1548 self.source.as_ref().and_then(|v| match v {
1549 crate::model::external_value_source::Source::DeploymentSource(v) => {
1550 std::option::Option::Some(v)
1551 }
1552 _ => std::option::Option::None,
1553 })
1554 }
1555
1556 /// Sets the value of [source][crate::model::ExternalValueSource::source]
1557 /// to hold a `DeploymentSource`.
1558 ///
1559 /// Note that all the setters affecting `source` are
1560 /// mutually exclusive.
1561 ///
1562 /// # Example
1563 /// ```ignore,no_run
1564 /// # use google_cloud_config_v1::model::ExternalValueSource;
1565 /// use google_cloud_config_v1::model::DeploymentSource;
1566 /// let x = ExternalValueSource::new().set_deployment_source(DeploymentSource::default()/* use setters */);
1567 /// assert!(x.deployment_source().is_some());
1568 /// ```
1569 pub fn set_deployment_source<
1570 T: std::convert::Into<std::boxed::Box<crate::model::DeploymentSource>>,
1571 >(
1572 mut self,
1573 v: T,
1574 ) -> Self {
1575 self.source = std::option::Option::Some(
1576 crate::model::external_value_source::Source::DeploymentSource(v.into()),
1577 );
1578 self
1579 }
1580}
1581
1582impl wkt::message::Message for ExternalValueSource {
1583 fn typename() -> &'static str {
1584 "type.googleapis.com/google.cloud.config.v1.ExternalValueSource"
1585 }
1586}
1587
1588/// Defines additional types related to [ExternalValueSource].
1589pub mod external_value_source {
1590 #[allow(unused_imports)]
1591 use super::*;
1592
1593 /// The source of the external value.
1594 #[derive(Clone, Debug, PartialEq)]
1595 #[non_exhaustive]
1596 pub enum Source {
1597 /// A source from a Deployment.
1598 DeploymentSource(std::boxed::Box<crate::model::DeploymentSource>),
1599 }
1600}
1601
1602/// Configuration for a value sourced from a Deployment.
1603#[derive(Clone, Default, PartialEq)]
1604#[non_exhaustive]
1605pub struct DeploymentSource {
1606 /// Required. The resource name of the source Deployment to import the output
1607 /// from. Format:
1608 /// projects/{project}/locations/{location}/deployments/{deployment} The source
1609 /// deployment must be in the same project and location.
1610 pub deployment: std::string::String,
1611
1612 /// Required. The name of the output variable in the source deployment's latest
1613 /// successfully applied revision.
1614 pub output_name: std::string::String,
1615
1616 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1617}
1618
1619impl DeploymentSource {
1620 /// Creates a new default instance.
1621 pub fn new() -> Self {
1622 std::default::Default::default()
1623 }
1624
1625 /// Sets the value of [deployment][crate::model::DeploymentSource::deployment].
1626 ///
1627 /// # Example
1628 /// ```ignore,no_run
1629 /// # use google_cloud_config_v1::model::DeploymentSource;
1630 /// # let project_id = "project_id";
1631 /// # let location_id = "location_id";
1632 /// # let deployment_id = "deployment_id";
1633 /// let x = DeploymentSource::new().set_deployment(format!("projects/{project_id}/locations/{location_id}/deployments/{deployment_id}"));
1634 /// ```
1635 pub fn set_deployment<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1636 self.deployment = v.into();
1637 self
1638 }
1639
1640 /// Sets the value of [output_name][crate::model::DeploymentSource::output_name].
1641 ///
1642 /// # Example
1643 /// ```ignore,no_run
1644 /// # use google_cloud_config_v1::model::DeploymentSource;
1645 /// let x = DeploymentSource::new().set_output_name("example");
1646 /// ```
1647 pub fn set_output_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1648 self.output_name = v.into();
1649 self
1650 }
1651}
1652
1653impl wkt::message::Message for DeploymentSource {
1654 fn typename() -> &'static str {
1655 "type.googleapis.com/google.cloud.config.v1.DeploymentSource"
1656 }
1657}
1658
1659/// Outputs and artifacts from applying a deployment.
1660#[derive(Clone, Default, PartialEq)]
1661#[non_exhaustive]
1662pub struct ApplyResults {
1663 /// Location of a blueprint copy and other manifests in Google Cloud Storage.
1664 /// Format: `gs://{bucket}/{object}`
1665 pub content: std::string::String,
1666
1667 /// Location of artifacts (e.g. logs) in Google Cloud Storage.
1668 /// Format: `gs://{bucket}/{object}`
1669 pub artifacts: std::string::String,
1670
1671 /// Map of output name to output info.
1672 pub outputs: std::collections::HashMap<std::string::String, crate::model::TerraformOutput>,
1673
1674 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1675}
1676
1677impl ApplyResults {
1678 /// Creates a new default instance.
1679 pub fn new() -> Self {
1680 std::default::Default::default()
1681 }
1682
1683 /// Sets the value of [content][crate::model::ApplyResults::content].
1684 ///
1685 /// # Example
1686 /// ```ignore,no_run
1687 /// # use google_cloud_config_v1::model::ApplyResults;
1688 /// let x = ApplyResults::new().set_content("example");
1689 /// ```
1690 pub fn set_content<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1691 self.content = v.into();
1692 self
1693 }
1694
1695 /// Sets the value of [artifacts][crate::model::ApplyResults::artifacts].
1696 ///
1697 /// # Example
1698 /// ```ignore,no_run
1699 /// # use google_cloud_config_v1::model::ApplyResults;
1700 /// let x = ApplyResults::new().set_artifacts("example");
1701 /// ```
1702 pub fn set_artifacts<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1703 self.artifacts = v.into();
1704 self
1705 }
1706
1707 /// Sets the value of [outputs][crate::model::ApplyResults::outputs].
1708 ///
1709 /// # Example
1710 /// ```ignore,no_run
1711 /// # use google_cloud_config_v1::model::ApplyResults;
1712 /// use google_cloud_config_v1::model::TerraformOutput;
1713 /// let x = ApplyResults::new().set_outputs([
1714 /// ("key0", TerraformOutput::default()/* use setters */),
1715 /// ("key1", TerraformOutput::default()/* use (different) setters */),
1716 /// ]);
1717 /// ```
1718 pub fn set_outputs<T, K, V>(mut self, v: T) -> Self
1719 where
1720 T: std::iter::IntoIterator<Item = (K, V)>,
1721 K: std::convert::Into<std::string::String>,
1722 V: std::convert::Into<crate::model::TerraformOutput>,
1723 {
1724 use std::iter::Iterator;
1725 self.outputs = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1726 self
1727 }
1728}
1729
1730impl wkt::message::Message for ApplyResults {
1731 fn typename() -> &'static str {
1732 "type.googleapis.com/google.cloud.config.v1.ApplyResults"
1733 }
1734}
1735
1736/// Describes a Terraform output.
1737#[derive(Clone, Default, PartialEq)]
1738#[non_exhaustive]
1739pub struct TerraformOutput {
1740 /// Identifies whether Terraform has set this output as a potential
1741 /// sensitive value.
1742 pub sensitive: bool,
1743
1744 /// Value of output.
1745 pub value: std::option::Option<wkt::Value>,
1746
1747 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1748}
1749
1750impl TerraformOutput {
1751 /// Creates a new default instance.
1752 pub fn new() -> Self {
1753 std::default::Default::default()
1754 }
1755
1756 /// Sets the value of [sensitive][crate::model::TerraformOutput::sensitive].
1757 ///
1758 /// # Example
1759 /// ```ignore,no_run
1760 /// # use google_cloud_config_v1::model::TerraformOutput;
1761 /// let x = TerraformOutput::new().set_sensitive(true);
1762 /// ```
1763 pub fn set_sensitive<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1764 self.sensitive = v.into();
1765 self
1766 }
1767
1768 /// Sets the value of [value][crate::model::TerraformOutput::value].
1769 ///
1770 /// # Example
1771 /// ```ignore,no_run
1772 /// # use google_cloud_config_v1::model::TerraformOutput;
1773 /// use wkt::Value;
1774 /// let x = TerraformOutput::new().set_value(Value::default()/* use setters */);
1775 /// ```
1776 pub fn set_value<T>(mut self, v: T) -> Self
1777 where
1778 T: std::convert::Into<wkt::Value>,
1779 {
1780 self.value = std::option::Option::Some(v.into());
1781 self
1782 }
1783
1784 /// Sets or clears the value of [value][crate::model::TerraformOutput::value].
1785 ///
1786 /// # Example
1787 /// ```ignore,no_run
1788 /// # use google_cloud_config_v1::model::TerraformOutput;
1789 /// use wkt::Value;
1790 /// let x = TerraformOutput::new().set_or_clear_value(Some(Value::default()/* use setters */));
1791 /// let x = TerraformOutput::new().set_or_clear_value(None::<Value>);
1792 /// ```
1793 pub fn set_or_clear_value<T>(mut self, v: std::option::Option<T>) -> Self
1794 where
1795 T: std::convert::Into<wkt::Value>,
1796 {
1797 self.value = v.map(|x| x.into());
1798 self
1799 }
1800}
1801
1802impl wkt::message::Message for TerraformOutput {
1803 fn typename() -> &'static str {
1804 "type.googleapis.com/google.cloud.config.v1.TerraformOutput"
1805 }
1806}
1807
1808#[allow(missing_docs)]
1809#[derive(Clone, Default, PartialEq)]
1810#[non_exhaustive]
1811pub struct ListDeploymentsRequest {
1812 /// Required. The parent in whose context the Deployments are listed. The
1813 /// parent value is in the format:
1814 /// 'projects/{project_id}/locations/{location}'.
1815 pub parent: std::string::String,
1816
1817 /// When requesting a page of resources, 'page_size' specifies number of
1818 /// resources to return. If unspecified, at most 500 will be returned. The
1819 /// maximum value is 1000.
1820 pub page_size: i32,
1821
1822 /// Token returned by previous call to 'ListDeployments' which specifies the
1823 /// position in the list from where to continue listing the resources.
1824 pub page_token: std::string::String,
1825
1826 /// Lists the Deployments that match the filter expression. A filter
1827 /// expression filters the resources listed in the response. The expression
1828 /// must be of the form '{field} {operator} {value}' where operators: '<', '>',
1829 /// '<=', '>=', '!=', '=', ':' are supported (colon ':' represents a HAS
1830 /// operator which is roughly synonymous with equality). {field} can refer to a
1831 /// proto or JSON field, or a synthetic field. Field names can be camelCase or
1832 /// snake_case.
1833 ///
1834 /// Examples:
1835 ///
1836 /// - Filter by name:
1837 /// name = "projects/foo/locations/us-central1/deployments/bar
1838 ///
1839 /// - Filter by labels:
1840 ///
1841 /// - Resources that have a key called 'foo'
1842 /// labels.foo:*
1843 /// - Resources that have a key called 'foo' whose value is 'bar'
1844 /// labels.foo = bar
1845 /// - Filter by state:
1846 ///
1847 /// - Deployments in CREATING state.
1848 /// state=CREATING
1849 pub filter: std::string::String,
1850
1851 /// Field to use to sort the list.
1852 pub order_by: std::string::String,
1853
1854 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1855}
1856
1857impl ListDeploymentsRequest {
1858 /// Creates a new default instance.
1859 pub fn new() -> Self {
1860 std::default::Default::default()
1861 }
1862
1863 /// Sets the value of [parent][crate::model::ListDeploymentsRequest::parent].
1864 ///
1865 /// # Example
1866 /// ```ignore,no_run
1867 /// # use google_cloud_config_v1::model::ListDeploymentsRequest;
1868 /// let x = ListDeploymentsRequest::new().set_parent("example");
1869 /// ```
1870 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1871 self.parent = v.into();
1872 self
1873 }
1874
1875 /// Sets the value of [page_size][crate::model::ListDeploymentsRequest::page_size].
1876 ///
1877 /// # Example
1878 /// ```ignore,no_run
1879 /// # use google_cloud_config_v1::model::ListDeploymentsRequest;
1880 /// let x = ListDeploymentsRequest::new().set_page_size(42);
1881 /// ```
1882 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1883 self.page_size = v.into();
1884 self
1885 }
1886
1887 /// Sets the value of [page_token][crate::model::ListDeploymentsRequest::page_token].
1888 ///
1889 /// # Example
1890 /// ```ignore,no_run
1891 /// # use google_cloud_config_v1::model::ListDeploymentsRequest;
1892 /// let x = ListDeploymentsRequest::new().set_page_token("example");
1893 /// ```
1894 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1895 self.page_token = v.into();
1896 self
1897 }
1898
1899 /// Sets the value of [filter][crate::model::ListDeploymentsRequest::filter].
1900 ///
1901 /// # Example
1902 /// ```ignore,no_run
1903 /// # use google_cloud_config_v1::model::ListDeploymentsRequest;
1904 /// let x = ListDeploymentsRequest::new().set_filter("example");
1905 /// ```
1906 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1907 self.filter = v.into();
1908 self
1909 }
1910
1911 /// Sets the value of [order_by][crate::model::ListDeploymentsRequest::order_by].
1912 ///
1913 /// # Example
1914 /// ```ignore,no_run
1915 /// # use google_cloud_config_v1::model::ListDeploymentsRequest;
1916 /// let x = ListDeploymentsRequest::new().set_order_by("example");
1917 /// ```
1918 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1919 self.order_by = v.into();
1920 self
1921 }
1922}
1923
1924impl wkt::message::Message for ListDeploymentsRequest {
1925 fn typename() -> &'static str {
1926 "type.googleapis.com/google.cloud.config.v1.ListDeploymentsRequest"
1927 }
1928}
1929
1930#[allow(missing_docs)]
1931#[derive(Clone, Default, PartialEq)]
1932#[non_exhaustive]
1933pub struct ListDeploymentsResponse {
1934 /// List of [Deployment][google.cloud.config.v1.Deployment]s.
1935 ///
1936 /// [google.cloud.config.v1.Deployment]: crate::model::Deployment
1937 pub deployments: std::vec::Vec<crate::model::Deployment>,
1938
1939 /// Token to be supplied to the next ListDeployments request via `page_token`
1940 /// to obtain the next set of results.
1941 pub next_page_token: std::string::String,
1942
1943 /// Locations that could not be reached.
1944 pub unreachable: std::vec::Vec<std::string::String>,
1945
1946 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1947}
1948
1949impl ListDeploymentsResponse {
1950 /// Creates a new default instance.
1951 pub fn new() -> Self {
1952 std::default::Default::default()
1953 }
1954
1955 /// Sets the value of [deployments][crate::model::ListDeploymentsResponse::deployments].
1956 ///
1957 /// # Example
1958 /// ```ignore,no_run
1959 /// # use google_cloud_config_v1::model::ListDeploymentsResponse;
1960 /// use google_cloud_config_v1::model::Deployment;
1961 /// let x = ListDeploymentsResponse::new()
1962 /// .set_deployments([
1963 /// Deployment::default()/* use setters */,
1964 /// Deployment::default()/* use (different) setters */,
1965 /// ]);
1966 /// ```
1967 pub fn set_deployments<T, V>(mut self, v: T) -> Self
1968 where
1969 T: std::iter::IntoIterator<Item = V>,
1970 V: std::convert::Into<crate::model::Deployment>,
1971 {
1972 use std::iter::Iterator;
1973 self.deployments = v.into_iter().map(|i| i.into()).collect();
1974 self
1975 }
1976
1977 /// Sets the value of [next_page_token][crate::model::ListDeploymentsResponse::next_page_token].
1978 ///
1979 /// # Example
1980 /// ```ignore,no_run
1981 /// # use google_cloud_config_v1::model::ListDeploymentsResponse;
1982 /// let x = ListDeploymentsResponse::new().set_next_page_token("example");
1983 /// ```
1984 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1985 self.next_page_token = v.into();
1986 self
1987 }
1988
1989 /// Sets the value of [unreachable][crate::model::ListDeploymentsResponse::unreachable].
1990 ///
1991 /// # Example
1992 /// ```ignore,no_run
1993 /// # use google_cloud_config_v1::model::ListDeploymentsResponse;
1994 /// let x = ListDeploymentsResponse::new().set_unreachable(["a", "b", "c"]);
1995 /// ```
1996 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
1997 where
1998 T: std::iter::IntoIterator<Item = V>,
1999 V: std::convert::Into<std::string::String>,
2000 {
2001 use std::iter::Iterator;
2002 self.unreachable = v.into_iter().map(|i| i.into()).collect();
2003 self
2004 }
2005}
2006
2007impl wkt::message::Message for ListDeploymentsResponse {
2008 fn typename() -> &'static str {
2009 "type.googleapis.com/google.cloud.config.v1.ListDeploymentsResponse"
2010 }
2011}
2012
2013#[doc(hidden)]
2014impl google_cloud_gax::paginator::internal::PageableResponse for ListDeploymentsResponse {
2015 type PageItem = crate::model::Deployment;
2016
2017 fn items(self) -> std::vec::Vec<Self::PageItem> {
2018 self.deployments
2019 }
2020
2021 fn next_page_token(&self) -> std::string::String {
2022 use std::clone::Clone;
2023 self.next_page_token.clone()
2024 }
2025}
2026
2027#[allow(missing_docs)]
2028#[derive(Clone, Default, PartialEq)]
2029#[non_exhaustive]
2030pub struct GetDeploymentRequest {
2031 /// Required. The name of the deployment. Format:
2032 /// 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
2033 pub name: std::string::String,
2034
2035 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2036}
2037
2038impl GetDeploymentRequest {
2039 /// Creates a new default instance.
2040 pub fn new() -> Self {
2041 std::default::Default::default()
2042 }
2043
2044 /// Sets the value of [name][crate::model::GetDeploymentRequest::name].
2045 ///
2046 /// # Example
2047 /// ```ignore,no_run
2048 /// # use google_cloud_config_v1::model::GetDeploymentRequest;
2049 /// # let project_id = "project_id";
2050 /// # let location_id = "location_id";
2051 /// # let deployment_id = "deployment_id";
2052 /// let x = GetDeploymentRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/deployments/{deployment_id}"));
2053 /// ```
2054 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2055 self.name = v.into();
2056 self
2057 }
2058}
2059
2060impl wkt::message::Message for GetDeploymentRequest {
2061 fn typename() -> &'static str {
2062 "type.googleapis.com/google.cloud.config.v1.GetDeploymentRequest"
2063 }
2064}
2065
2066/// A request to list Revisions passed to a 'ListRevisions' call.
2067#[derive(Clone, Default, PartialEq)]
2068#[non_exhaustive]
2069pub struct ListRevisionsRequest {
2070 /// Required. The parent in whose context the Revisions are listed. The parent
2071 /// value is in the format:
2072 /// 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
2073 pub parent: std::string::String,
2074
2075 /// When requesting a page of resources, `page_size` specifies number of
2076 /// resources to return. If unspecified, at most 500 will be returned. The
2077 /// maximum value is 1000.
2078 pub page_size: i32,
2079
2080 /// Token returned by previous call to 'ListRevisions' which specifies the
2081 /// position in the list from where to continue listing the resources.
2082 pub page_token: std::string::String,
2083
2084 /// Lists the Revisions that match the filter expression. A filter
2085 /// expression filters the resources listed in the response. The expression
2086 /// must be of the form '{field} {operator} {value}' where operators: '<', '>',
2087 /// '<=', '>=', '!=', '=', ':' are supported (colon ':' represents a HAS
2088 /// operator which is roughly synonymous with equality). {field} can refer to a
2089 /// proto or JSON field, or a synthetic field. Field names can be camelCase or
2090 /// snake_case.
2091 ///
2092 /// Examples:
2093 ///
2094 /// - Filter by name:
2095 /// name = "projects/foo/locations/us-central1/deployments/dep/revisions/bar
2096 ///
2097 /// - Filter by labels:
2098 ///
2099 /// - Resources that have a key called 'foo'
2100 /// labels.foo:*
2101 /// - Resources that have a key called 'foo' whose value is 'bar'
2102 /// labels.foo = bar
2103 /// - Filter by state:
2104 ///
2105 /// - Revisions in CREATING state.
2106 /// state=CREATING
2107 pub filter: std::string::String,
2108
2109 /// Field to use to sort the list.
2110 pub order_by: std::string::String,
2111
2112 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2113}
2114
2115impl ListRevisionsRequest {
2116 /// Creates a new default instance.
2117 pub fn new() -> Self {
2118 std::default::Default::default()
2119 }
2120
2121 /// Sets the value of [parent][crate::model::ListRevisionsRequest::parent].
2122 ///
2123 /// # Example
2124 /// ```ignore,no_run
2125 /// # use google_cloud_config_v1::model::ListRevisionsRequest;
2126 /// # let project_id = "project_id";
2127 /// # let location_id = "location_id";
2128 /// # let deployment_id = "deployment_id";
2129 /// let x = ListRevisionsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/deployments/{deployment_id}"));
2130 /// ```
2131 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2132 self.parent = v.into();
2133 self
2134 }
2135
2136 /// Sets the value of [page_size][crate::model::ListRevisionsRequest::page_size].
2137 ///
2138 /// # Example
2139 /// ```ignore,no_run
2140 /// # use google_cloud_config_v1::model::ListRevisionsRequest;
2141 /// let x = ListRevisionsRequest::new().set_page_size(42);
2142 /// ```
2143 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2144 self.page_size = v.into();
2145 self
2146 }
2147
2148 /// Sets the value of [page_token][crate::model::ListRevisionsRequest::page_token].
2149 ///
2150 /// # Example
2151 /// ```ignore,no_run
2152 /// # use google_cloud_config_v1::model::ListRevisionsRequest;
2153 /// let x = ListRevisionsRequest::new().set_page_token("example");
2154 /// ```
2155 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2156 self.page_token = v.into();
2157 self
2158 }
2159
2160 /// Sets the value of [filter][crate::model::ListRevisionsRequest::filter].
2161 ///
2162 /// # Example
2163 /// ```ignore,no_run
2164 /// # use google_cloud_config_v1::model::ListRevisionsRequest;
2165 /// let x = ListRevisionsRequest::new().set_filter("example");
2166 /// ```
2167 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2168 self.filter = v.into();
2169 self
2170 }
2171
2172 /// Sets the value of [order_by][crate::model::ListRevisionsRequest::order_by].
2173 ///
2174 /// # Example
2175 /// ```ignore,no_run
2176 /// # use google_cloud_config_v1::model::ListRevisionsRequest;
2177 /// let x = ListRevisionsRequest::new().set_order_by("example");
2178 /// ```
2179 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2180 self.order_by = v.into();
2181 self
2182 }
2183}
2184
2185impl wkt::message::Message for ListRevisionsRequest {
2186 fn typename() -> &'static str {
2187 "type.googleapis.com/google.cloud.config.v1.ListRevisionsRequest"
2188 }
2189}
2190
2191/// A response to a 'ListRevisions' call. Contains a list of Revisions.
2192#[derive(Clone, Default, PartialEq)]
2193#[non_exhaustive]
2194pub struct ListRevisionsResponse {
2195 /// List of [Revision][google.cloud.config.v1.Revision]s.
2196 ///
2197 /// [google.cloud.config.v1.Revision]: crate::model::Revision
2198 pub revisions: std::vec::Vec<crate::model::Revision>,
2199
2200 /// A token to request the next page of resources from the 'ListRevisions'
2201 /// method. The value of an empty string means that there are no more resources
2202 /// to return.
2203 pub next_page_token: std::string::String,
2204
2205 /// Locations that could not be reached.
2206 pub unreachable: std::vec::Vec<std::string::String>,
2207
2208 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2209}
2210
2211impl ListRevisionsResponse {
2212 /// Creates a new default instance.
2213 pub fn new() -> Self {
2214 std::default::Default::default()
2215 }
2216
2217 /// Sets the value of [revisions][crate::model::ListRevisionsResponse::revisions].
2218 ///
2219 /// # Example
2220 /// ```ignore,no_run
2221 /// # use google_cloud_config_v1::model::ListRevisionsResponse;
2222 /// use google_cloud_config_v1::model::Revision;
2223 /// let x = ListRevisionsResponse::new()
2224 /// .set_revisions([
2225 /// Revision::default()/* use setters */,
2226 /// Revision::default()/* use (different) setters */,
2227 /// ]);
2228 /// ```
2229 pub fn set_revisions<T, V>(mut self, v: T) -> Self
2230 where
2231 T: std::iter::IntoIterator<Item = V>,
2232 V: std::convert::Into<crate::model::Revision>,
2233 {
2234 use std::iter::Iterator;
2235 self.revisions = v.into_iter().map(|i| i.into()).collect();
2236 self
2237 }
2238
2239 /// Sets the value of [next_page_token][crate::model::ListRevisionsResponse::next_page_token].
2240 ///
2241 /// # Example
2242 /// ```ignore,no_run
2243 /// # use google_cloud_config_v1::model::ListRevisionsResponse;
2244 /// let x = ListRevisionsResponse::new().set_next_page_token("example");
2245 /// ```
2246 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2247 self.next_page_token = v.into();
2248 self
2249 }
2250
2251 /// Sets the value of [unreachable][crate::model::ListRevisionsResponse::unreachable].
2252 ///
2253 /// # Example
2254 /// ```ignore,no_run
2255 /// # use google_cloud_config_v1::model::ListRevisionsResponse;
2256 /// let x = ListRevisionsResponse::new().set_unreachable(["a", "b", "c"]);
2257 /// ```
2258 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
2259 where
2260 T: std::iter::IntoIterator<Item = V>,
2261 V: std::convert::Into<std::string::String>,
2262 {
2263 use std::iter::Iterator;
2264 self.unreachable = v.into_iter().map(|i| i.into()).collect();
2265 self
2266 }
2267}
2268
2269impl wkt::message::Message for ListRevisionsResponse {
2270 fn typename() -> &'static str {
2271 "type.googleapis.com/google.cloud.config.v1.ListRevisionsResponse"
2272 }
2273}
2274
2275#[doc(hidden)]
2276impl google_cloud_gax::paginator::internal::PageableResponse for ListRevisionsResponse {
2277 type PageItem = crate::model::Revision;
2278
2279 fn items(self) -> std::vec::Vec<Self::PageItem> {
2280 self.revisions
2281 }
2282
2283 fn next_page_token(&self) -> std::string::String {
2284 use std::clone::Clone;
2285 self.next_page_token.clone()
2286 }
2287}
2288
2289/// A request to get a Revision from a 'GetRevision' call.
2290#[derive(Clone, Default, PartialEq)]
2291#[non_exhaustive]
2292pub struct GetRevisionRequest {
2293 /// Required. The name of the Revision in the format:
2294 /// 'projects/{project_id}/locations/{location}/deployments/{deployment}/revisions/{revision}'.
2295 pub name: std::string::String,
2296
2297 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2298}
2299
2300impl GetRevisionRequest {
2301 /// Creates a new default instance.
2302 pub fn new() -> Self {
2303 std::default::Default::default()
2304 }
2305
2306 /// Sets the value of [name][crate::model::GetRevisionRequest::name].
2307 ///
2308 /// # Example
2309 /// ```ignore,no_run
2310 /// # use google_cloud_config_v1::model::GetRevisionRequest;
2311 /// # let project_id = "project_id";
2312 /// # let location_id = "location_id";
2313 /// # let deployment_id = "deployment_id";
2314 /// # let revision_id = "revision_id";
2315 /// let x = GetRevisionRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/deployments/{deployment_id}/revisions/{revision_id}"));
2316 /// ```
2317 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2318 self.name = v.into();
2319 self
2320 }
2321}
2322
2323impl wkt::message::Message for GetRevisionRequest {
2324 fn typename() -> &'static str {
2325 "type.googleapis.com/google.cloud.config.v1.GetRevisionRequest"
2326 }
2327}
2328
2329#[allow(missing_docs)]
2330#[derive(Clone, Default, PartialEq)]
2331#[non_exhaustive]
2332pub struct CreateDeploymentRequest {
2333 /// Required. The parent in whose context the Deployment is created. The parent
2334 /// value is in the format: 'projects/{project_id}/locations/{location}'.
2335 pub parent: std::string::String,
2336
2337 /// Required. The Deployment ID.
2338 pub deployment_id: std::string::String,
2339
2340 /// Required. [Deployment][google.cloud.config.v1.Deployment] resource to be
2341 /// created.
2342 ///
2343 /// [google.cloud.config.v1.Deployment]: crate::model::Deployment
2344 pub deployment: std::option::Option<crate::model::Deployment>,
2345
2346 /// Optional. An optional request ID to identify requests. Specify a unique
2347 /// request ID so that if you must retry your request, the server will know to
2348 /// ignore the request if it has already been completed. The server will
2349 /// guarantee that for at least 60 minutes since the first request.
2350 ///
2351 /// For example, consider a situation where you make an initial request and the
2352 /// request times out. If you make the request again with the same request ID,
2353 /// the server can check if original operation with the same request ID was
2354 /// received, and if so, will ignore the second request. This prevents clients
2355 /// from accidentally creating duplicate commitments.
2356 ///
2357 /// The request ID must be a valid UUID with the exception that zero UUID is
2358 /// not supported (00000000-0000-0000-0000-000000000000).
2359 pub request_id: std::string::String,
2360
2361 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2362}
2363
2364impl CreateDeploymentRequest {
2365 /// Creates a new default instance.
2366 pub fn new() -> Self {
2367 std::default::Default::default()
2368 }
2369
2370 /// Sets the value of [parent][crate::model::CreateDeploymentRequest::parent].
2371 ///
2372 /// # Example
2373 /// ```ignore,no_run
2374 /// # use google_cloud_config_v1::model::CreateDeploymentRequest;
2375 /// let x = CreateDeploymentRequest::new().set_parent("example");
2376 /// ```
2377 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2378 self.parent = v.into();
2379 self
2380 }
2381
2382 /// Sets the value of [deployment_id][crate::model::CreateDeploymentRequest::deployment_id].
2383 ///
2384 /// # Example
2385 /// ```ignore,no_run
2386 /// # use google_cloud_config_v1::model::CreateDeploymentRequest;
2387 /// let x = CreateDeploymentRequest::new().set_deployment_id("example");
2388 /// ```
2389 pub fn set_deployment_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2390 self.deployment_id = v.into();
2391 self
2392 }
2393
2394 /// Sets the value of [deployment][crate::model::CreateDeploymentRequest::deployment].
2395 ///
2396 /// # Example
2397 /// ```ignore,no_run
2398 /// # use google_cloud_config_v1::model::CreateDeploymentRequest;
2399 /// use google_cloud_config_v1::model::Deployment;
2400 /// let x = CreateDeploymentRequest::new().set_deployment(Deployment::default()/* use setters */);
2401 /// ```
2402 pub fn set_deployment<T>(mut self, v: T) -> Self
2403 where
2404 T: std::convert::Into<crate::model::Deployment>,
2405 {
2406 self.deployment = std::option::Option::Some(v.into());
2407 self
2408 }
2409
2410 /// Sets or clears the value of [deployment][crate::model::CreateDeploymentRequest::deployment].
2411 ///
2412 /// # Example
2413 /// ```ignore,no_run
2414 /// # use google_cloud_config_v1::model::CreateDeploymentRequest;
2415 /// use google_cloud_config_v1::model::Deployment;
2416 /// let x = CreateDeploymentRequest::new().set_or_clear_deployment(Some(Deployment::default()/* use setters */));
2417 /// let x = CreateDeploymentRequest::new().set_or_clear_deployment(None::<Deployment>);
2418 /// ```
2419 pub fn set_or_clear_deployment<T>(mut self, v: std::option::Option<T>) -> Self
2420 where
2421 T: std::convert::Into<crate::model::Deployment>,
2422 {
2423 self.deployment = v.map(|x| x.into());
2424 self
2425 }
2426
2427 /// Sets the value of [request_id][crate::model::CreateDeploymentRequest::request_id].
2428 ///
2429 /// # Example
2430 /// ```ignore,no_run
2431 /// # use google_cloud_config_v1::model::CreateDeploymentRequest;
2432 /// let x = CreateDeploymentRequest::new().set_request_id("example");
2433 /// ```
2434 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2435 self.request_id = v.into();
2436 self
2437 }
2438}
2439
2440impl wkt::message::Message for CreateDeploymentRequest {
2441 fn typename() -> &'static str {
2442 "type.googleapis.com/google.cloud.config.v1.CreateDeploymentRequest"
2443 }
2444}
2445
2446/// A request to create a deployment group
2447#[derive(Clone, Default, PartialEq)]
2448#[non_exhaustive]
2449pub struct CreateDeploymentGroupRequest {
2450 /// Required. The parent in whose context the Deployment Group is created. The
2451 /// parent value is in the format: 'projects/{project_id}/locations/{location}'
2452 pub parent: std::string::String,
2453
2454 /// Required. The deployment group ID.
2455 pub deployment_group_id: std::string::String,
2456
2457 /// Required. [Deployment Group][] resource to create
2458 pub deployment_group: std::option::Option<crate::model::DeploymentGroup>,
2459
2460 /// Optional. An optional request ID to identify requests. Specify a unique
2461 /// request ID so that if you must retry your request, the server will know to
2462 /// ignore the request if it has already been completed. The server will
2463 /// guarantee that for at least 60 minutes since the first request.
2464 ///
2465 /// For example, consider a situation where you make an initial request and the
2466 /// request times out. If you make the request again with the same request ID,
2467 /// the server can check if original operation with the same request ID was
2468 /// received, and if so, will ignore the second request. This prevents clients
2469 /// from accidentally creating duplicate commitments.
2470 ///
2471 /// The request ID must be a valid UUID with the exception that zero UUID is
2472 /// not supported (00000000-0000-0000-0000-000000000000).
2473 pub request_id: std::string::String,
2474
2475 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2476}
2477
2478impl CreateDeploymentGroupRequest {
2479 /// Creates a new default instance.
2480 pub fn new() -> Self {
2481 std::default::Default::default()
2482 }
2483
2484 /// Sets the value of [parent][crate::model::CreateDeploymentGroupRequest::parent].
2485 ///
2486 /// # Example
2487 /// ```ignore,no_run
2488 /// # use google_cloud_config_v1::model::CreateDeploymentGroupRequest;
2489 /// let x = CreateDeploymentGroupRequest::new().set_parent("example");
2490 /// ```
2491 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2492 self.parent = v.into();
2493 self
2494 }
2495
2496 /// Sets the value of [deployment_group_id][crate::model::CreateDeploymentGroupRequest::deployment_group_id].
2497 ///
2498 /// # Example
2499 /// ```ignore,no_run
2500 /// # use google_cloud_config_v1::model::CreateDeploymentGroupRequest;
2501 /// let x = CreateDeploymentGroupRequest::new().set_deployment_group_id("example");
2502 /// ```
2503 pub fn set_deployment_group_id<T: std::convert::Into<std::string::String>>(
2504 mut self,
2505 v: T,
2506 ) -> Self {
2507 self.deployment_group_id = v.into();
2508 self
2509 }
2510
2511 /// Sets the value of [deployment_group][crate::model::CreateDeploymentGroupRequest::deployment_group].
2512 ///
2513 /// # Example
2514 /// ```ignore,no_run
2515 /// # use google_cloud_config_v1::model::CreateDeploymentGroupRequest;
2516 /// use google_cloud_config_v1::model::DeploymentGroup;
2517 /// let x = CreateDeploymentGroupRequest::new().set_deployment_group(DeploymentGroup::default()/* use setters */);
2518 /// ```
2519 pub fn set_deployment_group<T>(mut self, v: T) -> Self
2520 where
2521 T: std::convert::Into<crate::model::DeploymentGroup>,
2522 {
2523 self.deployment_group = std::option::Option::Some(v.into());
2524 self
2525 }
2526
2527 /// Sets or clears the value of [deployment_group][crate::model::CreateDeploymentGroupRequest::deployment_group].
2528 ///
2529 /// # Example
2530 /// ```ignore,no_run
2531 /// # use google_cloud_config_v1::model::CreateDeploymentGroupRequest;
2532 /// use google_cloud_config_v1::model::DeploymentGroup;
2533 /// let x = CreateDeploymentGroupRequest::new().set_or_clear_deployment_group(Some(DeploymentGroup::default()/* use setters */));
2534 /// let x = CreateDeploymentGroupRequest::new().set_or_clear_deployment_group(None::<DeploymentGroup>);
2535 /// ```
2536 pub fn set_or_clear_deployment_group<T>(mut self, v: std::option::Option<T>) -> Self
2537 where
2538 T: std::convert::Into<crate::model::DeploymentGroup>,
2539 {
2540 self.deployment_group = v.map(|x| x.into());
2541 self
2542 }
2543
2544 /// Sets the value of [request_id][crate::model::CreateDeploymentGroupRequest::request_id].
2545 ///
2546 /// # Example
2547 /// ```ignore,no_run
2548 /// # use google_cloud_config_v1::model::CreateDeploymentGroupRequest;
2549 /// let x = CreateDeploymentGroupRequest::new().set_request_id("example");
2550 /// ```
2551 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2552 self.request_id = v.into();
2553 self
2554 }
2555}
2556
2557impl wkt::message::Message for CreateDeploymentGroupRequest {
2558 fn typename() -> &'static str {
2559 "type.googleapis.com/google.cloud.config.v1.CreateDeploymentGroupRequest"
2560 }
2561}
2562
2563/// A request message for updating a deployment group
2564#[derive(Clone, Default, PartialEq)]
2565#[non_exhaustive]
2566pub struct UpdateDeploymentGroupRequest {
2567 /// Optional. Field mask used to specify the fields to be overwritten in the
2568 /// Deployment Group resource by the update.
2569 ///
2570 /// The fields specified in the update_mask are relative to the resource, not
2571 /// the full request. A field will be overwritten if it is in the mask. If the
2572 /// user does not provide a mask then all fields will be overwritten.
2573 pub update_mask: std::option::Option<wkt::FieldMask>,
2574
2575 /// Required. [DeploymentGroup][google.cloud.config.v1.DeploymentGroup] to
2576 /// update.
2577 ///
2578 /// The deployment group's `name` field is used to identify the resource to be
2579 /// updated. Format:
2580 /// `projects/{project}/locations/{location}/deploymentGroups/{deployment_group_id}`
2581 ///
2582 /// [google.cloud.config.v1.DeploymentGroup]: crate::model::DeploymentGroup
2583 pub deployment_group: std::option::Option<crate::model::DeploymentGroup>,
2584
2585 /// Optional. An optional request ID to identify requests. Specify a unique
2586 /// request ID so that if you must retry your request, the server will know to
2587 /// ignore the request if it has already been completed. The server will
2588 /// guarantee that for at least 60 minutes since the first request.
2589 ///
2590 /// For example, consider a situation where you make an initial request and the
2591 /// request times out. If you make the request again with the same request ID,
2592 /// the server can check if original operation with the same request ID was
2593 /// received, and if so, will ignore the second request. This prevents clients
2594 /// from accidentally creating duplicate commitments.
2595 ///
2596 /// The request ID must be a valid UUID with the exception that zero UUID is
2597 /// not supported (00000000-0000-0000-0000-000000000000).
2598 pub request_id: std::string::String,
2599
2600 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2601}
2602
2603impl UpdateDeploymentGroupRequest {
2604 /// Creates a new default instance.
2605 pub fn new() -> Self {
2606 std::default::Default::default()
2607 }
2608
2609 /// Sets the value of [update_mask][crate::model::UpdateDeploymentGroupRequest::update_mask].
2610 ///
2611 /// # Example
2612 /// ```ignore,no_run
2613 /// # use google_cloud_config_v1::model::UpdateDeploymentGroupRequest;
2614 /// use wkt::FieldMask;
2615 /// let x = UpdateDeploymentGroupRequest::new().set_update_mask(FieldMask::default()/* use setters */);
2616 /// ```
2617 pub fn set_update_mask<T>(mut self, v: T) -> Self
2618 where
2619 T: std::convert::Into<wkt::FieldMask>,
2620 {
2621 self.update_mask = std::option::Option::Some(v.into());
2622 self
2623 }
2624
2625 /// Sets or clears the value of [update_mask][crate::model::UpdateDeploymentGroupRequest::update_mask].
2626 ///
2627 /// # Example
2628 /// ```ignore,no_run
2629 /// # use google_cloud_config_v1::model::UpdateDeploymentGroupRequest;
2630 /// use wkt::FieldMask;
2631 /// let x = UpdateDeploymentGroupRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
2632 /// let x = UpdateDeploymentGroupRequest::new().set_or_clear_update_mask(None::<FieldMask>);
2633 /// ```
2634 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2635 where
2636 T: std::convert::Into<wkt::FieldMask>,
2637 {
2638 self.update_mask = v.map(|x| x.into());
2639 self
2640 }
2641
2642 /// Sets the value of [deployment_group][crate::model::UpdateDeploymentGroupRequest::deployment_group].
2643 ///
2644 /// # Example
2645 /// ```ignore,no_run
2646 /// # use google_cloud_config_v1::model::UpdateDeploymentGroupRequest;
2647 /// use google_cloud_config_v1::model::DeploymentGroup;
2648 /// let x = UpdateDeploymentGroupRequest::new().set_deployment_group(DeploymentGroup::default()/* use setters */);
2649 /// ```
2650 pub fn set_deployment_group<T>(mut self, v: T) -> Self
2651 where
2652 T: std::convert::Into<crate::model::DeploymentGroup>,
2653 {
2654 self.deployment_group = std::option::Option::Some(v.into());
2655 self
2656 }
2657
2658 /// Sets or clears the value of [deployment_group][crate::model::UpdateDeploymentGroupRequest::deployment_group].
2659 ///
2660 /// # Example
2661 /// ```ignore,no_run
2662 /// # use google_cloud_config_v1::model::UpdateDeploymentGroupRequest;
2663 /// use google_cloud_config_v1::model::DeploymentGroup;
2664 /// let x = UpdateDeploymentGroupRequest::new().set_or_clear_deployment_group(Some(DeploymentGroup::default()/* use setters */));
2665 /// let x = UpdateDeploymentGroupRequest::new().set_or_clear_deployment_group(None::<DeploymentGroup>);
2666 /// ```
2667 pub fn set_or_clear_deployment_group<T>(mut self, v: std::option::Option<T>) -> Self
2668 where
2669 T: std::convert::Into<crate::model::DeploymentGroup>,
2670 {
2671 self.deployment_group = v.map(|x| x.into());
2672 self
2673 }
2674
2675 /// Sets the value of [request_id][crate::model::UpdateDeploymentGroupRequest::request_id].
2676 ///
2677 /// # Example
2678 /// ```ignore,no_run
2679 /// # use google_cloud_config_v1::model::UpdateDeploymentGroupRequest;
2680 /// let x = UpdateDeploymentGroupRequest::new().set_request_id("example");
2681 /// ```
2682 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2683 self.request_id = v.into();
2684 self
2685 }
2686}
2687
2688impl wkt::message::Message for UpdateDeploymentGroupRequest {
2689 fn typename() -> &'static str {
2690 "type.googleapis.com/google.cloud.config.v1.UpdateDeploymentGroupRequest"
2691 }
2692}
2693
2694/// Request message for Delete DeploymentGroup
2695#[derive(Clone, Default, PartialEq)]
2696#[non_exhaustive]
2697pub struct DeleteDeploymentGroupRequest {
2698 /// Required. The name of DeploymentGroup in the format
2699 /// projects/{project_id}/locations/{location_id}/deploymentGroups/{deploymentGroup}
2700 pub name: std::string::String,
2701
2702 /// Optional. An optional request ID to identify requests. Specify a unique
2703 /// request ID so that if you must retry your request, the server will know to
2704 /// ignore the request if it has already been completed. The server will
2705 /// guarantee that for at least 60 minutes after the first request.
2706 ///
2707 /// For example, consider a situation where you make an initial request and the
2708 /// request times out. If you make the request again with the same request ID,
2709 /// the server can check if original operation with the same request ID was
2710 /// received, and if so, will ignore the second request. This prevents clients
2711 /// from accidentally creating duplicate commitments.
2712 ///
2713 /// The request ID must be a valid UUID with the exception that zero UUID is
2714 /// not supported (00000000-0000-0000-0000-000000000000).
2715 pub request_id: std::string::String,
2716
2717 /// Optional. If set to true, any revisions for this deployment group will also
2718 /// be deleted. (Otherwise, the request will only work if the deployment group
2719 /// has no revisions.)
2720 pub force: bool,
2721
2722 /// Optional. Policy on how to handle referenced deployments when deleting the
2723 /// DeploymentGroup.
2724 /// If unspecified, the default behavior is to fail the deletion if any
2725 /// deployments currently referenced in the `deployment_units` of the
2726 /// DeploymentGroup or in the latest revision are not deleted.
2727 pub deployment_reference_policy:
2728 crate::model::delete_deployment_group_request::DeploymentReferencePolicy,
2729
2730 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2731}
2732
2733impl DeleteDeploymentGroupRequest {
2734 /// Creates a new default instance.
2735 pub fn new() -> Self {
2736 std::default::Default::default()
2737 }
2738
2739 /// Sets the value of [name][crate::model::DeleteDeploymentGroupRequest::name].
2740 ///
2741 /// # Example
2742 /// ```ignore,no_run
2743 /// # use google_cloud_config_v1::model::DeleteDeploymentGroupRequest;
2744 /// # let project_id = "project_id";
2745 /// # let location_id = "location_id";
2746 /// # let deployment_group_id = "deployment_group_id";
2747 /// let x = DeleteDeploymentGroupRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/deploymentGroups/{deployment_group_id}"));
2748 /// ```
2749 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2750 self.name = v.into();
2751 self
2752 }
2753
2754 /// Sets the value of [request_id][crate::model::DeleteDeploymentGroupRequest::request_id].
2755 ///
2756 /// # Example
2757 /// ```ignore,no_run
2758 /// # use google_cloud_config_v1::model::DeleteDeploymentGroupRequest;
2759 /// let x = DeleteDeploymentGroupRequest::new().set_request_id("example");
2760 /// ```
2761 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2762 self.request_id = v.into();
2763 self
2764 }
2765
2766 /// Sets the value of [force][crate::model::DeleteDeploymentGroupRequest::force].
2767 ///
2768 /// # Example
2769 /// ```ignore,no_run
2770 /// # use google_cloud_config_v1::model::DeleteDeploymentGroupRequest;
2771 /// let x = DeleteDeploymentGroupRequest::new().set_force(true);
2772 /// ```
2773 pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2774 self.force = v.into();
2775 self
2776 }
2777
2778 /// Sets the value of [deployment_reference_policy][crate::model::DeleteDeploymentGroupRequest::deployment_reference_policy].
2779 ///
2780 /// # Example
2781 /// ```ignore,no_run
2782 /// # use google_cloud_config_v1::model::DeleteDeploymentGroupRequest;
2783 /// use google_cloud_config_v1::model::delete_deployment_group_request::DeploymentReferencePolicy;
2784 /// let x0 = DeleteDeploymentGroupRequest::new().set_deployment_reference_policy(DeploymentReferencePolicy::FailIfAnyReferencesExist);
2785 /// let x1 = DeleteDeploymentGroupRequest::new().set_deployment_reference_policy(DeploymentReferencePolicy::FailIfMetadataReferencesExist);
2786 /// let x2 = DeleteDeploymentGroupRequest::new().set_deployment_reference_policy(DeploymentReferencePolicy::IgnoreDeploymentReferences);
2787 /// ```
2788 pub fn set_deployment_reference_policy<
2789 T: std::convert::Into<
2790 crate::model::delete_deployment_group_request::DeploymentReferencePolicy,
2791 >,
2792 >(
2793 mut self,
2794 v: T,
2795 ) -> Self {
2796 self.deployment_reference_policy = v.into();
2797 self
2798 }
2799}
2800
2801impl wkt::message::Message for DeleteDeploymentGroupRequest {
2802 fn typename() -> &'static str {
2803 "type.googleapis.com/google.cloud.config.v1.DeleteDeploymentGroupRequest"
2804 }
2805}
2806
2807/// Defines additional types related to [DeleteDeploymentGroupRequest].
2808pub mod delete_deployment_group_request {
2809 #[allow(unused_imports)]
2810 use super::*;
2811
2812 /// Policy on how to handle referenced deployments when deleting the
2813 /// DeploymentGroup.
2814 ///
2815 /// # Working with unknown values
2816 ///
2817 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2818 /// additional enum variants at any time. Adding new variants is not considered
2819 /// a breaking change. Applications should write their code in anticipation of:
2820 ///
2821 /// - New values appearing in future releases of the client library, **and**
2822 /// - New values received dynamically, without application changes.
2823 ///
2824 /// Please consult the [Working with enums] section in the user guide for some
2825 /// guidelines.
2826 ///
2827 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
2828 #[derive(Clone, Debug, PartialEq)]
2829 #[non_exhaustive]
2830 pub enum DeploymentReferencePolicy {
2831 /// The default behavior. If unspecified, the system will act as if
2832 /// `FAIL_IF_ANY_REFERENCES_EXIST` is specified.
2833 Unspecified,
2834 /// Fail the deletion if any deployments currently referenced in the
2835 /// `deployment_units` of the DeploymentGroup or in the latest revision
2836 /// are not deleted.
2837 FailIfAnyReferencesExist,
2838 /// Fail the deletion only if any deployments currently referenced in the
2839 /// `deployment_units` of the DeploymentGroup are not deleted.
2840 /// The deletion will proceed even if the deployments in the latest revision
2841 /// of the DeploymentGroup are not deleted.
2842 FailIfMetadataReferencesExist,
2843 /// Ignore any deployments currently referenced in the
2844 /// `deployment_units` of the DeploymentGroup or in the latest revision.
2845 IgnoreDeploymentReferences,
2846 /// If set, the enum was initialized with an unknown value.
2847 ///
2848 /// Applications can examine the value using [DeploymentReferencePolicy::value] or
2849 /// [DeploymentReferencePolicy::name].
2850 UnknownValue(deployment_reference_policy::UnknownValue),
2851 }
2852
2853 #[doc(hidden)]
2854 pub mod deployment_reference_policy {
2855 #[allow(unused_imports)]
2856 use super::*;
2857 #[derive(Clone, Debug, PartialEq)]
2858 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2859 }
2860
2861 impl DeploymentReferencePolicy {
2862 /// Gets the enum value.
2863 ///
2864 /// Returns `None` if the enum contains an unknown value deserialized from
2865 /// the string representation of enums.
2866 pub fn value(&self) -> std::option::Option<i32> {
2867 match self {
2868 Self::Unspecified => std::option::Option::Some(0),
2869 Self::FailIfAnyReferencesExist => std::option::Option::Some(1),
2870 Self::FailIfMetadataReferencesExist => std::option::Option::Some(2),
2871 Self::IgnoreDeploymentReferences => std::option::Option::Some(3),
2872 Self::UnknownValue(u) => u.0.value(),
2873 }
2874 }
2875
2876 /// Gets the enum value as a string.
2877 ///
2878 /// Returns `None` if the enum contains an unknown value deserialized from
2879 /// the integer representation of enums.
2880 pub fn name(&self) -> std::option::Option<&str> {
2881 match self {
2882 Self::Unspecified => {
2883 std::option::Option::Some("DEPLOYMENT_REFERENCE_POLICY_UNSPECIFIED")
2884 }
2885 Self::FailIfAnyReferencesExist => {
2886 std::option::Option::Some("FAIL_IF_ANY_REFERENCES_EXIST")
2887 }
2888 Self::FailIfMetadataReferencesExist => {
2889 std::option::Option::Some("FAIL_IF_METADATA_REFERENCES_EXIST")
2890 }
2891 Self::IgnoreDeploymentReferences => {
2892 std::option::Option::Some("IGNORE_DEPLOYMENT_REFERENCES")
2893 }
2894 Self::UnknownValue(u) => u.0.name(),
2895 }
2896 }
2897 }
2898
2899 impl std::default::Default for DeploymentReferencePolicy {
2900 fn default() -> Self {
2901 use std::convert::From;
2902 Self::from(0)
2903 }
2904 }
2905
2906 impl std::fmt::Display for DeploymentReferencePolicy {
2907 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2908 wkt::internal::display_enum(f, self.name(), self.value())
2909 }
2910 }
2911
2912 impl std::convert::From<i32> for DeploymentReferencePolicy {
2913 fn from(value: i32) -> Self {
2914 match value {
2915 0 => Self::Unspecified,
2916 1 => Self::FailIfAnyReferencesExist,
2917 2 => Self::FailIfMetadataReferencesExist,
2918 3 => Self::IgnoreDeploymentReferences,
2919 _ => Self::UnknownValue(deployment_reference_policy::UnknownValue(
2920 wkt::internal::UnknownEnumValue::Integer(value),
2921 )),
2922 }
2923 }
2924 }
2925
2926 impl std::convert::From<&str> for DeploymentReferencePolicy {
2927 fn from(value: &str) -> Self {
2928 use std::string::ToString;
2929 match value {
2930 "DEPLOYMENT_REFERENCE_POLICY_UNSPECIFIED" => Self::Unspecified,
2931 "FAIL_IF_ANY_REFERENCES_EXIST" => Self::FailIfAnyReferencesExist,
2932 "FAIL_IF_METADATA_REFERENCES_EXIST" => Self::FailIfMetadataReferencesExist,
2933 "IGNORE_DEPLOYMENT_REFERENCES" => Self::IgnoreDeploymentReferences,
2934 _ => Self::UnknownValue(deployment_reference_policy::UnknownValue(
2935 wkt::internal::UnknownEnumValue::String(value.to_string()),
2936 )),
2937 }
2938 }
2939 }
2940
2941 impl serde::ser::Serialize for DeploymentReferencePolicy {
2942 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2943 where
2944 S: serde::Serializer,
2945 {
2946 match self {
2947 Self::Unspecified => serializer.serialize_i32(0),
2948 Self::FailIfAnyReferencesExist => serializer.serialize_i32(1),
2949 Self::FailIfMetadataReferencesExist => serializer.serialize_i32(2),
2950 Self::IgnoreDeploymentReferences => serializer.serialize_i32(3),
2951 Self::UnknownValue(u) => u.0.serialize(serializer),
2952 }
2953 }
2954 }
2955
2956 impl<'de> serde::de::Deserialize<'de> for DeploymentReferencePolicy {
2957 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2958 where
2959 D: serde::Deserializer<'de>,
2960 {
2961 deserializer.deserialize_any(wkt::internal::EnumVisitor::<DeploymentReferencePolicy>::new(
2962 ".google.cloud.config.v1.DeleteDeploymentGroupRequest.DeploymentReferencePolicy"))
2963 }
2964 }
2965}
2966
2967#[allow(missing_docs)]
2968#[derive(Clone, Default, PartialEq)]
2969#[non_exhaustive]
2970pub struct UpdateDeploymentRequest {
2971 /// Optional. Field mask used to specify the fields to be overwritten in the
2972 /// Deployment resource by the update.
2973 ///
2974 /// The fields specified in the update_mask are relative to the resource, not
2975 /// the full request. A field will be overwritten if it is in the mask. If the
2976 /// user does not provide a mask then all fields will be overwritten.
2977 pub update_mask: std::option::Option<wkt::FieldMask>,
2978
2979 /// Required. [Deployment][google.cloud.config.v1.Deployment] to update.
2980 ///
2981 /// The deployment's `name` field is used to identify the resource to be
2982 /// updated. Format:
2983 /// `projects/{project}/locations/{location}/deployments/{deployment}`
2984 ///
2985 /// [google.cloud.config.v1.Deployment]: crate::model::Deployment
2986 pub deployment: std::option::Option<crate::model::Deployment>,
2987
2988 /// Optional. An optional request ID to identify requests. Specify a unique
2989 /// request ID so that if you must retry your request, the server will know to
2990 /// ignore the request if it has already been completed. The server will
2991 /// guarantee that for at least 60 minutes since the first request.
2992 ///
2993 /// For example, consider a situation where you make an initial request and the
2994 /// request times out. If you make the request again with the same request ID,
2995 /// the server can check if original operation with the same request ID was
2996 /// received, and if so, will ignore the second request. This prevents clients
2997 /// from accidentally creating duplicate commitments.
2998 ///
2999 /// The request ID must be a valid UUID with the exception that zero UUID is
3000 /// not supported (00000000-0000-0000-0000-000000000000).
3001 pub request_id: std::string::String,
3002
3003 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3004}
3005
3006impl UpdateDeploymentRequest {
3007 /// Creates a new default instance.
3008 pub fn new() -> Self {
3009 std::default::Default::default()
3010 }
3011
3012 /// Sets the value of [update_mask][crate::model::UpdateDeploymentRequest::update_mask].
3013 ///
3014 /// # Example
3015 /// ```ignore,no_run
3016 /// # use google_cloud_config_v1::model::UpdateDeploymentRequest;
3017 /// use wkt::FieldMask;
3018 /// let x = UpdateDeploymentRequest::new().set_update_mask(FieldMask::default()/* use setters */);
3019 /// ```
3020 pub fn set_update_mask<T>(mut self, v: T) -> Self
3021 where
3022 T: std::convert::Into<wkt::FieldMask>,
3023 {
3024 self.update_mask = std::option::Option::Some(v.into());
3025 self
3026 }
3027
3028 /// Sets or clears the value of [update_mask][crate::model::UpdateDeploymentRequest::update_mask].
3029 ///
3030 /// # Example
3031 /// ```ignore,no_run
3032 /// # use google_cloud_config_v1::model::UpdateDeploymentRequest;
3033 /// use wkt::FieldMask;
3034 /// let x = UpdateDeploymentRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
3035 /// let x = UpdateDeploymentRequest::new().set_or_clear_update_mask(None::<FieldMask>);
3036 /// ```
3037 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3038 where
3039 T: std::convert::Into<wkt::FieldMask>,
3040 {
3041 self.update_mask = v.map(|x| x.into());
3042 self
3043 }
3044
3045 /// Sets the value of [deployment][crate::model::UpdateDeploymentRequest::deployment].
3046 ///
3047 /// # Example
3048 /// ```ignore,no_run
3049 /// # use google_cloud_config_v1::model::UpdateDeploymentRequest;
3050 /// use google_cloud_config_v1::model::Deployment;
3051 /// let x = UpdateDeploymentRequest::new().set_deployment(Deployment::default()/* use setters */);
3052 /// ```
3053 pub fn set_deployment<T>(mut self, v: T) -> Self
3054 where
3055 T: std::convert::Into<crate::model::Deployment>,
3056 {
3057 self.deployment = std::option::Option::Some(v.into());
3058 self
3059 }
3060
3061 /// Sets or clears the value of [deployment][crate::model::UpdateDeploymentRequest::deployment].
3062 ///
3063 /// # Example
3064 /// ```ignore,no_run
3065 /// # use google_cloud_config_v1::model::UpdateDeploymentRequest;
3066 /// use google_cloud_config_v1::model::Deployment;
3067 /// let x = UpdateDeploymentRequest::new().set_or_clear_deployment(Some(Deployment::default()/* use setters */));
3068 /// let x = UpdateDeploymentRequest::new().set_or_clear_deployment(None::<Deployment>);
3069 /// ```
3070 pub fn set_or_clear_deployment<T>(mut self, v: std::option::Option<T>) -> Self
3071 where
3072 T: std::convert::Into<crate::model::Deployment>,
3073 {
3074 self.deployment = v.map(|x| x.into());
3075 self
3076 }
3077
3078 /// Sets the value of [request_id][crate::model::UpdateDeploymentRequest::request_id].
3079 ///
3080 /// # Example
3081 /// ```ignore,no_run
3082 /// # use google_cloud_config_v1::model::UpdateDeploymentRequest;
3083 /// let x = UpdateDeploymentRequest::new().set_request_id("example");
3084 /// ```
3085 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3086 self.request_id = v.into();
3087 self
3088 }
3089}
3090
3091impl wkt::message::Message for UpdateDeploymentRequest {
3092 fn typename() -> &'static str {
3093 "type.googleapis.com/google.cloud.config.v1.UpdateDeploymentRequest"
3094 }
3095}
3096
3097#[allow(missing_docs)]
3098#[derive(Clone, Default, PartialEq)]
3099#[non_exhaustive]
3100pub struct DeleteDeploymentRequest {
3101 /// Required. The name of the Deployment in the format:
3102 /// 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
3103 pub name: std::string::String,
3104
3105 /// Optional. An optional request ID to identify requests. Specify a unique
3106 /// request ID so that if you must retry your request, the server will know to
3107 /// ignore the request if it has already been completed. The server will
3108 /// guarantee that for at least 60 minutes after the first request.
3109 ///
3110 /// For example, consider a situation where you make an initial request and the
3111 /// request times out. If you make the request again with the same request ID,
3112 /// the server can check if original operation with the same request ID was
3113 /// received, and if so, will ignore the second request. This prevents clients
3114 /// from accidentally creating duplicate commitments.
3115 ///
3116 /// The request ID must be a valid UUID with the exception that zero UUID is
3117 /// not supported (00000000-0000-0000-0000-000000000000).
3118 pub request_id: std::string::String,
3119
3120 /// Optional. If set to true, any revisions for this deployment will also be
3121 /// deleted. (Otherwise, the request will only work if the deployment has no
3122 /// revisions.)
3123 pub force: bool,
3124
3125 /// Optional. Policy on how resources actuated by the deployment should be
3126 /// deleted. If unspecified, the default behavior is to delete the underlying
3127 /// resources.
3128 pub delete_policy: crate::model::delete_deployment_request::DeletePolicy,
3129
3130 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3131}
3132
3133impl DeleteDeploymentRequest {
3134 /// Creates a new default instance.
3135 pub fn new() -> Self {
3136 std::default::Default::default()
3137 }
3138
3139 /// Sets the value of [name][crate::model::DeleteDeploymentRequest::name].
3140 ///
3141 /// # Example
3142 /// ```ignore,no_run
3143 /// # use google_cloud_config_v1::model::DeleteDeploymentRequest;
3144 /// # let project_id = "project_id";
3145 /// # let location_id = "location_id";
3146 /// # let deployment_id = "deployment_id";
3147 /// let x = DeleteDeploymentRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/deployments/{deployment_id}"));
3148 /// ```
3149 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3150 self.name = v.into();
3151 self
3152 }
3153
3154 /// Sets the value of [request_id][crate::model::DeleteDeploymentRequest::request_id].
3155 ///
3156 /// # Example
3157 /// ```ignore,no_run
3158 /// # use google_cloud_config_v1::model::DeleteDeploymentRequest;
3159 /// let x = DeleteDeploymentRequest::new().set_request_id("example");
3160 /// ```
3161 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3162 self.request_id = v.into();
3163 self
3164 }
3165
3166 /// Sets the value of [force][crate::model::DeleteDeploymentRequest::force].
3167 ///
3168 /// # Example
3169 /// ```ignore,no_run
3170 /// # use google_cloud_config_v1::model::DeleteDeploymentRequest;
3171 /// let x = DeleteDeploymentRequest::new().set_force(true);
3172 /// ```
3173 pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3174 self.force = v.into();
3175 self
3176 }
3177
3178 /// Sets the value of [delete_policy][crate::model::DeleteDeploymentRequest::delete_policy].
3179 ///
3180 /// # Example
3181 /// ```ignore,no_run
3182 /// # use google_cloud_config_v1::model::DeleteDeploymentRequest;
3183 /// use google_cloud_config_v1::model::delete_deployment_request::DeletePolicy;
3184 /// let x0 = DeleteDeploymentRequest::new().set_delete_policy(DeletePolicy::Delete);
3185 /// let x1 = DeleteDeploymentRequest::new().set_delete_policy(DeletePolicy::Abandon);
3186 /// ```
3187 pub fn set_delete_policy<
3188 T: std::convert::Into<crate::model::delete_deployment_request::DeletePolicy>,
3189 >(
3190 mut self,
3191 v: T,
3192 ) -> Self {
3193 self.delete_policy = v.into();
3194 self
3195 }
3196}
3197
3198impl wkt::message::Message for DeleteDeploymentRequest {
3199 fn typename() -> &'static str {
3200 "type.googleapis.com/google.cloud.config.v1.DeleteDeploymentRequest"
3201 }
3202}
3203
3204/// Defines additional types related to [DeleteDeploymentRequest].
3205pub mod delete_deployment_request {
3206 #[allow(unused_imports)]
3207 use super::*;
3208
3209 /// Policy on how resources actuated by the deployment should be deleted.
3210 ///
3211 /// # Working with unknown values
3212 ///
3213 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3214 /// additional enum variants at any time. Adding new variants is not considered
3215 /// a breaking change. Applications should write their code in anticipation of:
3216 ///
3217 /// - New values appearing in future releases of the client library, **and**
3218 /// - New values received dynamically, without application changes.
3219 ///
3220 /// Please consult the [Working with enums] section in the user guide for some
3221 /// guidelines.
3222 ///
3223 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
3224 #[derive(Clone, Debug, PartialEq)]
3225 #[non_exhaustive]
3226 pub enum DeletePolicy {
3227 /// Unspecified policy, resources will be deleted.
3228 Unspecified,
3229 /// Deletes resources actuated by the deployment.
3230 Delete,
3231 /// Abandons resources and only deletes the deployment and its metadata.
3232 Abandon,
3233 /// If set, the enum was initialized with an unknown value.
3234 ///
3235 /// Applications can examine the value using [DeletePolicy::value] or
3236 /// [DeletePolicy::name].
3237 UnknownValue(delete_policy::UnknownValue),
3238 }
3239
3240 #[doc(hidden)]
3241 pub mod delete_policy {
3242 #[allow(unused_imports)]
3243 use super::*;
3244 #[derive(Clone, Debug, PartialEq)]
3245 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3246 }
3247
3248 impl DeletePolicy {
3249 /// Gets the enum value.
3250 ///
3251 /// Returns `None` if the enum contains an unknown value deserialized from
3252 /// the string representation of enums.
3253 pub fn value(&self) -> std::option::Option<i32> {
3254 match self {
3255 Self::Unspecified => std::option::Option::Some(0),
3256 Self::Delete => std::option::Option::Some(1),
3257 Self::Abandon => std::option::Option::Some(2),
3258 Self::UnknownValue(u) => u.0.value(),
3259 }
3260 }
3261
3262 /// Gets the enum value as a string.
3263 ///
3264 /// Returns `None` if the enum contains an unknown value deserialized from
3265 /// the integer representation of enums.
3266 pub fn name(&self) -> std::option::Option<&str> {
3267 match self {
3268 Self::Unspecified => std::option::Option::Some("DELETE_POLICY_UNSPECIFIED"),
3269 Self::Delete => std::option::Option::Some("DELETE"),
3270 Self::Abandon => std::option::Option::Some("ABANDON"),
3271 Self::UnknownValue(u) => u.0.name(),
3272 }
3273 }
3274 }
3275
3276 impl std::default::Default for DeletePolicy {
3277 fn default() -> Self {
3278 use std::convert::From;
3279 Self::from(0)
3280 }
3281 }
3282
3283 impl std::fmt::Display for DeletePolicy {
3284 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3285 wkt::internal::display_enum(f, self.name(), self.value())
3286 }
3287 }
3288
3289 impl std::convert::From<i32> for DeletePolicy {
3290 fn from(value: i32) -> Self {
3291 match value {
3292 0 => Self::Unspecified,
3293 1 => Self::Delete,
3294 2 => Self::Abandon,
3295 _ => Self::UnknownValue(delete_policy::UnknownValue(
3296 wkt::internal::UnknownEnumValue::Integer(value),
3297 )),
3298 }
3299 }
3300 }
3301
3302 impl std::convert::From<&str> for DeletePolicy {
3303 fn from(value: &str) -> Self {
3304 use std::string::ToString;
3305 match value {
3306 "DELETE_POLICY_UNSPECIFIED" => Self::Unspecified,
3307 "DELETE" => Self::Delete,
3308 "ABANDON" => Self::Abandon,
3309 _ => Self::UnknownValue(delete_policy::UnknownValue(
3310 wkt::internal::UnknownEnumValue::String(value.to_string()),
3311 )),
3312 }
3313 }
3314 }
3315
3316 impl serde::ser::Serialize for DeletePolicy {
3317 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3318 where
3319 S: serde::Serializer,
3320 {
3321 match self {
3322 Self::Unspecified => serializer.serialize_i32(0),
3323 Self::Delete => serializer.serialize_i32(1),
3324 Self::Abandon => serializer.serialize_i32(2),
3325 Self::UnknownValue(u) => u.0.serialize(serializer),
3326 }
3327 }
3328 }
3329
3330 impl<'de> serde::de::Deserialize<'de> for DeletePolicy {
3331 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3332 where
3333 D: serde::Deserializer<'de>,
3334 {
3335 deserializer.deserialize_any(wkt::internal::EnumVisitor::<DeletePolicy>::new(
3336 ".google.cloud.config.v1.DeleteDeploymentRequest.DeletePolicy",
3337 ))
3338 }
3339 }
3340}
3341
3342/// Represents the metadata of the long-running operation.
3343#[derive(Clone, Default, PartialEq)]
3344#[non_exhaustive]
3345pub struct OperationMetadata {
3346 /// Output only. Time when the operation was created.
3347 pub create_time: std::option::Option<wkt::Timestamp>,
3348
3349 /// Output only. Time when the operation finished running.
3350 pub end_time: std::option::Option<wkt::Timestamp>,
3351
3352 /// Output only. Server-defined resource path for the target of the operation.
3353 pub target: std::string::String,
3354
3355 /// Output only. Name of the verb executed by the operation.
3356 pub verb: std::string::String,
3357
3358 /// Output only. Human-readable status of the operation, if any.
3359 pub status_message: std::string::String,
3360
3361 /// Output only. Identifies whether the user has requested cancellation of the
3362 /// operation. Operations that have successfully been cancelled have
3363 /// [google.longrunning.Operation.error][google.longrunning.Operation.error]
3364 /// value with a [google.rpc.Status.code][google.rpc.Status.code] of `1`,
3365 /// corresponding to `Code.CANCELLED`.
3366 ///
3367 /// [google.longrunning.Operation.error]: google_cloud_longrunning::model::Operation::result
3368 /// [google.rpc.Status.code]: google_cloud_rpc::model::Status::code
3369 pub requested_cancellation: bool,
3370
3371 /// Output only. API version used to start the operation.
3372 pub api_version: std::string::String,
3373
3374 /// Ephemeral metadata about the state of an operation for a particular
3375 /// resource.
3376 pub resource_metadata: std::option::Option<crate::model::operation_metadata::ResourceMetadata>,
3377
3378 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3379}
3380
3381impl OperationMetadata {
3382 /// Creates a new default instance.
3383 pub fn new() -> Self {
3384 std::default::Default::default()
3385 }
3386
3387 /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
3388 ///
3389 /// # Example
3390 /// ```ignore,no_run
3391 /// # use google_cloud_config_v1::model::OperationMetadata;
3392 /// use wkt::Timestamp;
3393 /// let x = OperationMetadata::new().set_create_time(Timestamp::default()/* use setters */);
3394 /// ```
3395 pub fn set_create_time<T>(mut self, v: T) -> Self
3396 where
3397 T: std::convert::Into<wkt::Timestamp>,
3398 {
3399 self.create_time = std::option::Option::Some(v.into());
3400 self
3401 }
3402
3403 /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
3404 ///
3405 /// # Example
3406 /// ```ignore,no_run
3407 /// # use google_cloud_config_v1::model::OperationMetadata;
3408 /// use wkt::Timestamp;
3409 /// let x = OperationMetadata::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
3410 /// let x = OperationMetadata::new().set_or_clear_create_time(None::<Timestamp>);
3411 /// ```
3412 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
3413 where
3414 T: std::convert::Into<wkt::Timestamp>,
3415 {
3416 self.create_time = v.map(|x| x.into());
3417 self
3418 }
3419
3420 /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
3421 ///
3422 /// # Example
3423 /// ```ignore,no_run
3424 /// # use google_cloud_config_v1::model::OperationMetadata;
3425 /// use wkt::Timestamp;
3426 /// let x = OperationMetadata::new().set_end_time(Timestamp::default()/* use setters */);
3427 /// ```
3428 pub fn set_end_time<T>(mut self, v: T) -> Self
3429 where
3430 T: std::convert::Into<wkt::Timestamp>,
3431 {
3432 self.end_time = std::option::Option::Some(v.into());
3433 self
3434 }
3435
3436 /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
3437 ///
3438 /// # Example
3439 /// ```ignore,no_run
3440 /// # use google_cloud_config_v1::model::OperationMetadata;
3441 /// use wkt::Timestamp;
3442 /// let x = OperationMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
3443 /// let x = OperationMetadata::new().set_or_clear_end_time(None::<Timestamp>);
3444 /// ```
3445 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
3446 where
3447 T: std::convert::Into<wkt::Timestamp>,
3448 {
3449 self.end_time = v.map(|x| x.into());
3450 self
3451 }
3452
3453 /// Sets the value of [target][crate::model::OperationMetadata::target].
3454 ///
3455 /// # Example
3456 /// ```ignore,no_run
3457 /// # use google_cloud_config_v1::model::OperationMetadata;
3458 /// let x = OperationMetadata::new().set_target("example");
3459 /// ```
3460 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3461 self.target = v.into();
3462 self
3463 }
3464
3465 /// Sets the value of [verb][crate::model::OperationMetadata::verb].
3466 ///
3467 /// # Example
3468 /// ```ignore,no_run
3469 /// # use google_cloud_config_v1::model::OperationMetadata;
3470 /// let x = OperationMetadata::new().set_verb("example");
3471 /// ```
3472 pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3473 self.verb = v.into();
3474 self
3475 }
3476
3477 /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
3478 ///
3479 /// # Example
3480 /// ```ignore,no_run
3481 /// # use google_cloud_config_v1::model::OperationMetadata;
3482 /// let x = OperationMetadata::new().set_status_message("example");
3483 /// ```
3484 pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3485 self.status_message = v.into();
3486 self
3487 }
3488
3489 /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
3490 ///
3491 /// # Example
3492 /// ```ignore,no_run
3493 /// # use google_cloud_config_v1::model::OperationMetadata;
3494 /// let x = OperationMetadata::new().set_requested_cancellation(true);
3495 /// ```
3496 pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3497 self.requested_cancellation = v.into();
3498 self
3499 }
3500
3501 /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
3502 ///
3503 /// # Example
3504 /// ```ignore,no_run
3505 /// # use google_cloud_config_v1::model::OperationMetadata;
3506 /// let x = OperationMetadata::new().set_api_version("example");
3507 /// ```
3508 pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3509 self.api_version = v.into();
3510 self
3511 }
3512
3513 /// Sets the value of [resource_metadata][crate::model::OperationMetadata::resource_metadata].
3514 ///
3515 /// Note that all the setters affecting `resource_metadata` are mutually
3516 /// exclusive.
3517 ///
3518 /// # Example
3519 /// ```ignore,no_run
3520 /// # use google_cloud_config_v1::model::OperationMetadata;
3521 /// use google_cloud_config_v1::model::DeploymentOperationMetadata;
3522 /// let x = OperationMetadata::new().set_resource_metadata(Some(
3523 /// google_cloud_config_v1::model::operation_metadata::ResourceMetadata::DeploymentMetadata(DeploymentOperationMetadata::default().into())));
3524 /// ```
3525 pub fn set_resource_metadata<
3526 T: std::convert::Into<std::option::Option<crate::model::operation_metadata::ResourceMetadata>>,
3527 >(
3528 mut self,
3529 v: T,
3530 ) -> Self {
3531 self.resource_metadata = v.into();
3532 self
3533 }
3534
3535 /// The value of [resource_metadata][crate::model::OperationMetadata::resource_metadata]
3536 /// if it holds a `DeploymentMetadata`, `None` if the field is not set or
3537 /// holds a different branch.
3538 pub fn deployment_metadata(
3539 &self,
3540 ) -> std::option::Option<&std::boxed::Box<crate::model::DeploymentOperationMetadata>> {
3541 #[allow(unreachable_patterns)]
3542 self.resource_metadata.as_ref().and_then(|v| match v {
3543 crate::model::operation_metadata::ResourceMetadata::DeploymentMetadata(v) => {
3544 std::option::Option::Some(v)
3545 }
3546 _ => std::option::Option::None,
3547 })
3548 }
3549
3550 /// Sets the value of [resource_metadata][crate::model::OperationMetadata::resource_metadata]
3551 /// to hold a `DeploymentMetadata`.
3552 ///
3553 /// Note that all the setters affecting `resource_metadata` are
3554 /// mutually exclusive.
3555 ///
3556 /// # Example
3557 /// ```ignore,no_run
3558 /// # use google_cloud_config_v1::model::OperationMetadata;
3559 /// use google_cloud_config_v1::model::DeploymentOperationMetadata;
3560 /// let x = OperationMetadata::new().set_deployment_metadata(DeploymentOperationMetadata::default()/* use setters */);
3561 /// assert!(x.deployment_metadata().is_some());
3562 /// assert!(x.preview_metadata().is_none());
3563 /// assert!(x.provision_deployment_group_metadata().is_none());
3564 /// ```
3565 pub fn set_deployment_metadata<
3566 T: std::convert::Into<std::boxed::Box<crate::model::DeploymentOperationMetadata>>,
3567 >(
3568 mut self,
3569 v: T,
3570 ) -> Self {
3571 self.resource_metadata = std::option::Option::Some(
3572 crate::model::operation_metadata::ResourceMetadata::DeploymentMetadata(v.into()),
3573 );
3574 self
3575 }
3576
3577 /// The value of [resource_metadata][crate::model::OperationMetadata::resource_metadata]
3578 /// if it holds a `PreviewMetadata`, `None` if the field is not set or
3579 /// holds a different branch.
3580 pub fn preview_metadata(
3581 &self,
3582 ) -> std::option::Option<&std::boxed::Box<crate::model::PreviewOperationMetadata>> {
3583 #[allow(unreachable_patterns)]
3584 self.resource_metadata.as_ref().and_then(|v| match v {
3585 crate::model::operation_metadata::ResourceMetadata::PreviewMetadata(v) => {
3586 std::option::Option::Some(v)
3587 }
3588 _ => std::option::Option::None,
3589 })
3590 }
3591
3592 /// Sets the value of [resource_metadata][crate::model::OperationMetadata::resource_metadata]
3593 /// to hold a `PreviewMetadata`.
3594 ///
3595 /// Note that all the setters affecting `resource_metadata` are
3596 /// mutually exclusive.
3597 ///
3598 /// # Example
3599 /// ```ignore,no_run
3600 /// # use google_cloud_config_v1::model::OperationMetadata;
3601 /// use google_cloud_config_v1::model::PreviewOperationMetadata;
3602 /// let x = OperationMetadata::new().set_preview_metadata(PreviewOperationMetadata::default()/* use setters */);
3603 /// assert!(x.preview_metadata().is_some());
3604 /// assert!(x.deployment_metadata().is_none());
3605 /// assert!(x.provision_deployment_group_metadata().is_none());
3606 /// ```
3607 pub fn set_preview_metadata<
3608 T: std::convert::Into<std::boxed::Box<crate::model::PreviewOperationMetadata>>,
3609 >(
3610 mut self,
3611 v: T,
3612 ) -> Self {
3613 self.resource_metadata = std::option::Option::Some(
3614 crate::model::operation_metadata::ResourceMetadata::PreviewMetadata(v.into()),
3615 );
3616 self
3617 }
3618
3619 /// The value of [resource_metadata][crate::model::OperationMetadata::resource_metadata]
3620 /// if it holds a `ProvisionDeploymentGroupMetadata`, `None` if the field is not set or
3621 /// holds a different branch.
3622 pub fn provision_deployment_group_metadata(
3623 &self,
3624 ) -> std::option::Option<
3625 &std::boxed::Box<crate::model::ProvisionDeploymentGroupOperationMetadata>,
3626 > {
3627 #[allow(unreachable_patterns)]
3628 self.resource_metadata.as_ref().and_then(|v| match v {
3629 crate::model::operation_metadata::ResourceMetadata::ProvisionDeploymentGroupMetadata(v) => std::option::Option::Some(v),
3630 _ => std::option::Option::None,
3631 })
3632 }
3633
3634 /// Sets the value of [resource_metadata][crate::model::OperationMetadata::resource_metadata]
3635 /// to hold a `ProvisionDeploymentGroupMetadata`.
3636 ///
3637 /// Note that all the setters affecting `resource_metadata` are
3638 /// mutually exclusive.
3639 ///
3640 /// # Example
3641 /// ```ignore,no_run
3642 /// # use google_cloud_config_v1::model::OperationMetadata;
3643 /// use google_cloud_config_v1::model::ProvisionDeploymentGroupOperationMetadata;
3644 /// let x = OperationMetadata::new().set_provision_deployment_group_metadata(ProvisionDeploymentGroupOperationMetadata::default()/* use setters */);
3645 /// assert!(x.provision_deployment_group_metadata().is_some());
3646 /// assert!(x.deployment_metadata().is_none());
3647 /// assert!(x.preview_metadata().is_none());
3648 /// ```
3649 pub fn set_provision_deployment_group_metadata<
3650 T: std::convert::Into<
3651 std::boxed::Box<crate::model::ProvisionDeploymentGroupOperationMetadata>,
3652 >,
3653 >(
3654 mut self,
3655 v: T,
3656 ) -> Self {
3657 self.resource_metadata = std::option::Option::Some(
3658 crate::model::operation_metadata::ResourceMetadata::ProvisionDeploymentGroupMetadata(
3659 v.into(),
3660 ),
3661 );
3662 self
3663 }
3664}
3665
3666impl wkt::message::Message for OperationMetadata {
3667 fn typename() -> &'static str {
3668 "type.googleapis.com/google.cloud.config.v1.OperationMetadata"
3669 }
3670}
3671
3672/// Defines additional types related to [OperationMetadata].
3673pub mod operation_metadata {
3674 #[allow(unused_imports)]
3675 use super::*;
3676
3677 /// Ephemeral metadata about the state of an operation for a particular
3678 /// resource.
3679 #[derive(Clone, Debug, PartialEq)]
3680 #[non_exhaustive]
3681 pub enum ResourceMetadata {
3682 /// Output only. Metadata about the deployment operation state.
3683 DeploymentMetadata(std::boxed::Box<crate::model::DeploymentOperationMetadata>),
3684 /// Output only. Metadata about the preview operation state.
3685 PreviewMetadata(std::boxed::Box<crate::model::PreviewOperationMetadata>),
3686 /// Output only. Metadata about ProvisionDeploymentGroup operation state.
3687 ProvisionDeploymentGroupMetadata(
3688 std::boxed::Box<crate::model::ProvisionDeploymentGroupOperationMetadata>,
3689 ),
3690 }
3691}
3692
3693/// A child resource of a Deployment generated by a 'CreateDeployment' or
3694/// 'UpdateDeployment' call. Each Revision contains metadata pertaining to a
3695/// snapshot of a particular Deployment.
3696#[derive(Clone, Default, PartialEq)]
3697#[non_exhaustive]
3698pub struct Revision {
3699 /// Revision name. Format:
3700 /// `projects/{project}/locations/{location}/deployments/{deployment}/
3701 /// revisions/{revision}`
3702 pub name: std::string::String,
3703
3704 /// Output only. Time when the revision was created.
3705 pub create_time: std::option::Option<wkt::Timestamp>,
3706
3707 /// Output only. Time when the revision was last modified.
3708 pub update_time: std::option::Option<wkt::Timestamp>,
3709
3710 /// Output only. The action which created this revision
3711 pub action: crate::model::revision::Action,
3712
3713 /// Output only. Current state of the revision.
3714 pub state: crate::model::revision::State,
3715
3716 /// Output only. Outputs and artifacts from applying a deployment.
3717 pub apply_results: std::option::Option<crate::model::ApplyResults>,
3718
3719 /// Output only. Additional info regarding the current state.
3720 pub state_detail: std::string::String,
3721
3722 /// Output only. Code describing any errors that may have occurred.
3723 pub error_code: crate::model::revision::ErrorCode,
3724
3725 /// Output only. Cloud Build instance UUID associated with this revision.
3726 pub build: std::string::String,
3727
3728 /// Output only. Location of Revision operation logs in
3729 /// `gs://{bucket}/{object}` format.
3730 pub logs: std::string::String,
3731
3732 /// Output only. Errors encountered when creating or updating this deployment.
3733 /// Errors are truncated to 10 entries, see `delete_results` and `error_logs`
3734 /// for full details.
3735 pub tf_errors: std::vec::Vec<crate::model::TerraformError>,
3736
3737 /// Output only. Location of Terraform error logs in Google Cloud Storage.
3738 /// Format: `gs://{bucket}/{object}`.
3739 pub error_logs: std::string::String,
3740
3741 /// Output only. User-specified Service Account (SA) to be used as credential
3742 /// to manage resources. Format:
3743 /// `projects/{projectID}/serviceAccounts/{serviceAccount}`
3744 pub service_account: std::string::String,
3745
3746 /// Output only. By default, Infra Manager will return a failure when
3747 /// Terraform encounters a 409 code (resource conflict error) during actuation.
3748 /// If this flag is set to true, Infra Manager will instead
3749 /// attempt to automatically import the resource into the Terraform state (for
3750 /// supported resource types) and continue actuation.
3751 ///
3752 /// Not all resource types are supported, refer to documentation.
3753 pub import_existing_resources: bool,
3754
3755 /// Output only. The user-specified Cloud Build worker pool resource in which
3756 /// the Cloud Build job will execute. Format:
3757 /// `projects/{project}/locations/{location}/workerPools/{workerPoolId}`.
3758 /// If this field is unspecified, the default Cloud Build worker pool will be
3759 /// used.
3760 pub worker_pool: std::string::String,
3761
3762 /// Output only. The user-specified Terraform version constraint.
3763 /// Example: "=1.3.10".
3764 pub tf_version_constraint: std::string::String,
3765
3766 /// Output only. The version of Terraform used to create the Revision.
3767 /// It is in the format of "Major.Minor.Patch", for example, "1.3.10".
3768 pub tf_version: std::string::String,
3769
3770 /// Output only. Cloud Storage path containing quota validation results. This
3771 /// field is set when a user sets Deployment.quota_validation field to ENABLED
3772 /// or ENFORCED. Format: `gs://{bucket}/{object}`.
3773 pub quota_validation_results: std::string::String,
3774
3775 /// Optional. Input to control quota checks for resources in terraform
3776 /// configuration files. There are limited resources on which quota validation
3777 /// applies.
3778 pub quota_validation: crate::model::QuotaValidation,
3779
3780 /// Output only. This field specifies the provider configurations.
3781 pub provider_config: std::option::Option<crate::model::ProviderConfig>,
3782
3783 /// Blueprint that was deployed.
3784 pub blueprint: std::option::Option<crate::model::revision::Blueprint>,
3785
3786 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3787}
3788
3789impl Revision {
3790 /// Creates a new default instance.
3791 pub fn new() -> Self {
3792 std::default::Default::default()
3793 }
3794
3795 /// Sets the value of [name][crate::model::Revision::name].
3796 ///
3797 /// # Example
3798 /// ```ignore,no_run
3799 /// # use google_cloud_config_v1::model::Revision;
3800 /// # let project_id = "project_id";
3801 /// # let location_id = "location_id";
3802 /// # let deployment_id = "deployment_id";
3803 /// # let revision_id = "revision_id";
3804 /// let x = Revision::new().set_name(format!("projects/{project_id}/locations/{location_id}/deployments/{deployment_id}/revisions/{revision_id}"));
3805 /// ```
3806 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3807 self.name = v.into();
3808 self
3809 }
3810
3811 /// Sets the value of [create_time][crate::model::Revision::create_time].
3812 ///
3813 /// # Example
3814 /// ```ignore,no_run
3815 /// # use google_cloud_config_v1::model::Revision;
3816 /// use wkt::Timestamp;
3817 /// let x = Revision::new().set_create_time(Timestamp::default()/* use setters */);
3818 /// ```
3819 pub fn set_create_time<T>(mut self, v: T) -> Self
3820 where
3821 T: std::convert::Into<wkt::Timestamp>,
3822 {
3823 self.create_time = std::option::Option::Some(v.into());
3824 self
3825 }
3826
3827 /// Sets or clears the value of [create_time][crate::model::Revision::create_time].
3828 ///
3829 /// # Example
3830 /// ```ignore,no_run
3831 /// # use google_cloud_config_v1::model::Revision;
3832 /// use wkt::Timestamp;
3833 /// let x = Revision::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
3834 /// let x = Revision::new().set_or_clear_create_time(None::<Timestamp>);
3835 /// ```
3836 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
3837 where
3838 T: std::convert::Into<wkt::Timestamp>,
3839 {
3840 self.create_time = v.map(|x| x.into());
3841 self
3842 }
3843
3844 /// Sets the value of [update_time][crate::model::Revision::update_time].
3845 ///
3846 /// # Example
3847 /// ```ignore,no_run
3848 /// # use google_cloud_config_v1::model::Revision;
3849 /// use wkt::Timestamp;
3850 /// let x = Revision::new().set_update_time(Timestamp::default()/* use setters */);
3851 /// ```
3852 pub fn set_update_time<T>(mut self, v: T) -> Self
3853 where
3854 T: std::convert::Into<wkt::Timestamp>,
3855 {
3856 self.update_time = std::option::Option::Some(v.into());
3857 self
3858 }
3859
3860 /// Sets or clears the value of [update_time][crate::model::Revision::update_time].
3861 ///
3862 /// # Example
3863 /// ```ignore,no_run
3864 /// # use google_cloud_config_v1::model::Revision;
3865 /// use wkt::Timestamp;
3866 /// let x = Revision::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
3867 /// let x = Revision::new().set_or_clear_update_time(None::<Timestamp>);
3868 /// ```
3869 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
3870 where
3871 T: std::convert::Into<wkt::Timestamp>,
3872 {
3873 self.update_time = v.map(|x| x.into());
3874 self
3875 }
3876
3877 /// Sets the value of [action][crate::model::Revision::action].
3878 ///
3879 /// # Example
3880 /// ```ignore,no_run
3881 /// # use google_cloud_config_v1::model::Revision;
3882 /// use google_cloud_config_v1::model::revision::Action;
3883 /// let x0 = Revision::new().set_action(Action::Create);
3884 /// let x1 = Revision::new().set_action(Action::Update);
3885 /// let x2 = Revision::new().set_action(Action::Delete);
3886 /// ```
3887 pub fn set_action<T: std::convert::Into<crate::model::revision::Action>>(
3888 mut self,
3889 v: T,
3890 ) -> Self {
3891 self.action = v.into();
3892 self
3893 }
3894
3895 /// Sets the value of [state][crate::model::Revision::state].
3896 ///
3897 /// # Example
3898 /// ```ignore,no_run
3899 /// # use google_cloud_config_v1::model::Revision;
3900 /// use google_cloud_config_v1::model::revision::State;
3901 /// let x0 = Revision::new().set_state(State::Applying);
3902 /// let x1 = Revision::new().set_state(State::Applied);
3903 /// let x2 = Revision::new().set_state(State::Failed);
3904 /// ```
3905 pub fn set_state<T: std::convert::Into<crate::model::revision::State>>(mut self, v: T) -> Self {
3906 self.state = v.into();
3907 self
3908 }
3909
3910 /// Sets the value of [apply_results][crate::model::Revision::apply_results].
3911 ///
3912 /// # Example
3913 /// ```ignore,no_run
3914 /// # use google_cloud_config_v1::model::Revision;
3915 /// use google_cloud_config_v1::model::ApplyResults;
3916 /// let x = Revision::new().set_apply_results(ApplyResults::default()/* use setters */);
3917 /// ```
3918 pub fn set_apply_results<T>(mut self, v: T) -> Self
3919 where
3920 T: std::convert::Into<crate::model::ApplyResults>,
3921 {
3922 self.apply_results = std::option::Option::Some(v.into());
3923 self
3924 }
3925
3926 /// Sets or clears the value of [apply_results][crate::model::Revision::apply_results].
3927 ///
3928 /// # Example
3929 /// ```ignore,no_run
3930 /// # use google_cloud_config_v1::model::Revision;
3931 /// use google_cloud_config_v1::model::ApplyResults;
3932 /// let x = Revision::new().set_or_clear_apply_results(Some(ApplyResults::default()/* use setters */));
3933 /// let x = Revision::new().set_or_clear_apply_results(None::<ApplyResults>);
3934 /// ```
3935 pub fn set_or_clear_apply_results<T>(mut self, v: std::option::Option<T>) -> Self
3936 where
3937 T: std::convert::Into<crate::model::ApplyResults>,
3938 {
3939 self.apply_results = v.map(|x| x.into());
3940 self
3941 }
3942
3943 /// Sets the value of [state_detail][crate::model::Revision::state_detail].
3944 ///
3945 /// # Example
3946 /// ```ignore,no_run
3947 /// # use google_cloud_config_v1::model::Revision;
3948 /// let x = Revision::new().set_state_detail("example");
3949 /// ```
3950 pub fn set_state_detail<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3951 self.state_detail = v.into();
3952 self
3953 }
3954
3955 /// Sets the value of [error_code][crate::model::Revision::error_code].
3956 ///
3957 /// # Example
3958 /// ```ignore,no_run
3959 /// # use google_cloud_config_v1::model::Revision;
3960 /// use google_cloud_config_v1::model::revision::ErrorCode;
3961 /// let x0 = Revision::new().set_error_code(ErrorCode::CloudBuildPermissionDenied);
3962 /// let x1 = Revision::new().set_error_code(ErrorCode::ApplyBuildApiFailed);
3963 /// let x2 = Revision::new().set_error_code(ErrorCode::ApplyBuildRunFailed);
3964 /// ```
3965 pub fn set_error_code<T: std::convert::Into<crate::model::revision::ErrorCode>>(
3966 mut self,
3967 v: T,
3968 ) -> Self {
3969 self.error_code = v.into();
3970 self
3971 }
3972
3973 /// Sets the value of [build][crate::model::Revision::build].
3974 ///
3975 /// # Example
3976 /// ```ignore,no_run
3977 /// # use google_cloud_config_v1::model::Revision;
3978 /// let x = Revision::new().set_build("example");
3979 /// ```
3980 pub fn set_build<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3981 self.build = v.into();
3982 self
3983 }
3984
3985 /// Sets the value of [logs][crate::model::Revision::logs].
3986 ///
3987 /// # Example
3988 /// ```ignore,no_run
3989 /// # use google_cloud_config_v1::model::Revision;
3990 /// let x = Revision::new().set_logs("example");
3991 /// ```
3992 pub fn set_logs<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3993 self.logs = v.into();
3994 self
3995 }
3996
3997 /// Sets the value of [tf_errors][crate::model::Revision::tf_errors].
3998 ///
3999 /// # Example
4000 /// ```ignore,no_run
4001 /// # use google_cloud_config_v1::model::Revision;
4002 /// use google_cloud_config_v1::model::TerraformError;
4003 /// let x = Revision::new()
4004 /// .set_tf_errors([
4005 /// TerraformError::default()/* use setters */,
4006 /// TerraformError::default()/* use (different) setters */,
4007 /// ]);
4008 /// ```
4009 pub fn set_tf_errors<T, V>(mut self, v: T) -> Self
4010 where
4011 T: std::iter::IntoIterator<Item = V>,
4012 V: std::convert::Into<crate::model::TerraformError>,
4013 {
4014 use std::iter::Iterator;
4015 self.tf_errors = v.into_iter().map(|i| i.into()).collect();
4016 self
4017 }
4018
4019 /// Sets the value of [error_logs][crate::model::Revision::error_logs].
4020 ///
4021 /// # Example
4022 /// ```ignore,no_run
4023 /// # use google_cloud_config_v1::model::Revision;
4024 /// let x = Revision::new().set_error_logs("example");
4025 /// ```
4026 pub fn set_error_logs<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4027 self.error_logs = v.into();
4028 self
4029 }
4030
4031 /// Sets the value of [service_account][crate::model::Revision::service_account].
4032 ///
4033 /// # Example
4034 /// ```ignore,no_run
4035 /// # use google_cloud_config_v1::model::Revision;
4036 /// let x = Revision::new().set_service_account("example");
4037 /// ```
4038 pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4039 self.service_account = v.into();
4040 self
4041 }
4042
4043 /// Sets the value of [import_existing_resources][crate::model::Revision::import_existing_resources].
4044 ///
4045 /// # Example
4046 /// ```ignore,no_run
4047 /// # use google_cloud_config_v1::model::Revision;
4048 /// let x = Revision::new().set_import_existing_resources(true);
4049 /// ```
4050 pub fn set_import_existing_resources<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4051 self.import_existing_resources = v.into();
4052 self
4053 }
4054
4055 /// Sets the value of [worker_pool][crate::model::Revision::worker_pool].
4056 ///
4057 /// # Example
4058 /// ```ignore,no_run
4059 /// # use google_cloud_config_v1::model::Revision;
4060 /// let x = Revision::new().set_worker_pool("example");
4061 /// ```
4062 pub fn set_worker_pool<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4063 self.worker_pool = v.into();
4064 self
4065 }
4066
4067 /// Sets the value of [tf_version_constraint][crate::model::Revision::tf_version_constraint].
4068 ///
4069 /// # Example
4070 /// ```ignore,no_run
4071 /// # use google_cloud_config_v1::model::Revision;
4072 /// let x = Revision::new().set_tf_version_constraint("example");
4073 /// ```
4074 pub fn set_tf_version_constraint<T: std::convert::Into<std::string::String>>(
4075 mut self,
4076 v: T,
4077 ) -> Self {
4078 self.tf_version_constraint = v.into();
4079 self
4080 }
4081
4082 /// Sets the value of [tf_version][crate::model::Revision::tf_version].
4083 ///
4084 /// # Example
4085 /// ```ignore,no_run
4086 /// # use google_cloud_config_v1::model::Revision;
4087 /// let x = Revision::new().set_tf_version("example");
4088 /// ```
4089 pub fn set_tf_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4090 self.tf_version = v.into();
4091 self
4092 }
4093
4094 /// Sets the value of [quota_validation_results][crate::model::Revision::quota_validation_results].
4095 ///
4096 /// # Example
4097 /// ```ignore,no_run
4098 /// # use google_cloud_config_v1::model::Revision;
4099 /// let x = Revision::new().set_quota_validation_results("example");
4100 /// ```
4101 pub fn set_quota_validation_results<T: std::convert::Into<std::string::String>>(
4102 mut self,
4103 v: T,
4104 ) -> Self {
4105 self.quota_validation_results = v.into();
4106 self
4107 }
4108
4109 /// Sets the value of [quota_validation][crate::model::Revision::quota_validation].
4110 ///
4111 /// # Example
4112 /// ```ignore,no_run
4113 /// # use google_cloud_config_v1::model::Revision;
4114 /// use google_cloud_config_v1::model::QuotaValidation;
4115 /// let x0 = Revision::new().set_quota_validation(QuotaValidation::Enabled);
4116 /// let x1 = Revision::new().set_quota_validation(QuotaValidation::Enforced);
4117 /// ```
4118 pub fn set_quota_validation<T: std::convert::Into<crate::model::QuotaValidation>>(
4119 mut self,
4120 v: T,
4121 ) -> Self {
4122 self.quota_validation = v.into();
4123 self
4124 }
4125
4126 /// Sets the value of [provider_config][crate::model::Revision::provider_config].
4127 ///
4128 /// # Example
4129 /// ```ignore,no_run
4130 /// # use google_cloud_config_v1::model::Revision;
4131 /// use google_cloud_config_v1::model::ProviderConfig;
4132 /// let x = Revision::new().set_provider_config(ProviderConfig::default()/* use setters */);
4133 /// ```
4134 pub fn set_provider_config<T>(mut self, v: T) -> Self
4135 where
4136 T: std::convert::Into<crate::model::ProviderConfig>,
4137 {
4138 self.provider_config = std::option::Option::Some(v.into());
4139 self
4140 }
4141
4142 /// Sets or clears the value of [provider_config][crate::model::Revision::provider_config].
4143 ///
4144 /// # Example
4145 /// ```ignore,no_run
4146 /// # use google_cloud_config_v1::model::Revision;
4147 /// use google_cloud_config_v1::model::ProviderConfig;
4148 /// let x = Revision::new().set_or_clear_provider_config(Some(ProviderConfig::default()/* use setters */));
4149 /// let x = Revision::new().set_or_clear_provider_config(None::<ProviderConfig>);
4150 /// ```
4151 pub fn set_or_clear_provider_config<T>(mut self, v: std::option::Option<T>) -> Self
4152 where
4153 T: std::convert::Into<crate::model::ProviderConfig>,
4154 {
4155 self.provider_config = v.map(|x| x.into());
4156 self
4157 }
4158
4159 /// Sets the value of [blueprint][crate::model::Revision::blueprint].
4160 ///
4161 /// Note that all the setters affecting `blueprint` are mutually
4162 /// exclusive.
4163 ///
4164 /// # Example
4165 /// ```ignore,no_run
4166 /// # use google_cloud_config_v1::model::Revision;
4167 /// use google_cloud_config_v1::model::TerraformBlueprint;
4168 /// let x = Revision::new().set_blueprint(Some(
4169 /// google_cloud_config_v1::model::revision::Blueprint::TerraformBlueprint(TerraformBlueprint::default().into())));
4170 /// ```
4171 pub fn set_blueprint<
4172 T: std::convert::Into<std::option::Option<crate::model::revision::Blueprint>>,
4173 >(
4174 mut self,
4175 v: T,
4176 ) -> Self {
4177 self.blueprint = v.into();
4178 self
4179 }
4180
4181 /// The value of [blueprint][crate::model::Revision::blueprint]
4182 /// if it holds a `TerraformBlueprint`, `None` if the field is not set or
4183 /// holds a different branch.
4184 pub fn terraform_blueprint(
4185 &self,
4186 ) -> std::option::Option<&std::boxed::Box<crate::model::TerraformBlueprint>> {
4187 #[allow(unreachable_patterns)]
4188 self.blueprint.as_ref().and_then(|v| match v {
4189 crate::model::revision::Blueprint::TerraformBlueprint(v) => {
4190 std::option::Option::Some(v)
4191 }
4192 _ => std::option::Option::None,
4193 })
4194 }
4195
4196 /// Sets the value of [blueprint][crate::model::Revision::blueprint]
4197 /// to hold a `TerraformBlueprint`.
4198 ///
4199 /// Note that all the setters affecting `blueprint` are
4200 /// mutually exclusive.
4201 ///
4202 /// # Example
4203 /// ```ignore,no_run
4204 /// # use google_cloud_config_v1::model::Revision;
4205 /// use google_cloud_config_v1::model::TerraformBlueprint;
4206 /// let x = Revision::new().set_terraform_blueprint(TerraformBlueprint::default()/* use setters */);
4207 /// assert!(x.terraform_blueprint().is_some());
4208 /// ```
4209 pub fn set_terraform_blueprint<
4210 T: std::convert::Into<std::boxed::Box<crate::model::TerraformBlueprint>>,
4211 >(
4212 mut self,
4213 v: T,
4214 ) -> Self {
4215 self.blueprint = std::option::Option::Some(
4216 crate::model::revision::Blueprint::TerraformBlueprint(v.into()),
4217 );
4218 self
4219 }
4220}
4221
4222impl wkt::message::Message for Revision {
4223 fn typename() -> &'static str {
4224 "type.googleapis.com/google.cloud.config.v1.Revision"
4225 }
4226}
4227
4228/// Defines additional types related to [Revision].
4229pub mod revision {
4230 #[allow(unused_imports)]
4231 use super::*;
4232
4233 /// Actions that generate a revision.
4234 ///
4235 /// # Working with unknown values
4236 ///
4237 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4238 /// additional enum variants at any time. Adding new variants is not considered
4239 /// a breaking change. Applications should write their code in anticipation of:
4240 ///
4241 /// - New values appearing in future releases of the client library, **and**
4242 /// - New values received dynamically, without application changes.
4243 ///
4244 /// Please consult the [Working with enums] section in the user guide for some
4245 /// guidelines.
4246 ///
4247 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
4248 #[derive(Clone, Debug, PartialEq)]
4249 #[non_exhaustive]
4250 pub enum Action {
4251 /// The default value. This value is used if the action is omitted.
4252 Unspecified,
4253 /// The revision was generated by creating a deployment.
4254 Create,
4255 /// The revision was generated by updating a deployment.
4256 Update,
4257 /// The revision was deleted.
4258 Delete,
4259 /// If set, the enum was initialized with an unknown value.
4260 ///
4261 /// Applications can examine the value using [Action::value] or
4262 /// [Action::name].
4263 UnknownValue(action::UnknownValue),
4264 }
4265
4266 #[doc(hidden)]
4267 pub mod action {
4268 #[allow(unused_imports)]
4269 use super::*;
4270 #[derive(Clone, Debug, PartialEq)]
4271 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4272 }
4273
4274 impl Action {
4275 /// Gets the enum value.
4276 ///
4277 /// Returns `None` if the enum contains an unknown value deserialized from
4278 /// the string representation of enums.
4279 pub fn value(&self) -> std::option::Option<i32> {
4280 match self {
4281 Self::Unspecified => std::option::Option::Some(0),
4282 Self::Create => std::option::Option::Some(1),
4283 Self::Update => std::option::Option::Some(2),
4284 Self::Delete => std::option::Option::Some(3),
4285 Self::UnknownValue(u) => u.0.value(),
4286 }
4287 }
4288
4289 /// Gets the enum value as a string.
4290 ///
4291 /// Returns `None` if the enum contains an unknown value deserialized from
4292 /// the integer representation of enums.
4293 pub fn name(&self) -> std::option::Option<&str> {
4294 match self {
4295 Self::Unspecified => std::option::Option::Some("ACTION_UNSPECIFIED"),
4296 Self::Create => std::option::Option::Some("CREATE"),
4297 Self::Update => std::option::Option::Some("UPDATE"),
4298 Self::Delete => std::option::Option::Some("DELETE"),
4299 Self::UnknownValue(u) => u.0.name(),
4300 }
4301 }
4302 }
4303
4304 impl std::default::Default for Action {
4305 fn default() -> Self {
4306 use std::convert::From;
4307 Self::from(0)
4308 }
4309 }
4310
4311 impl std::fmt::Display for Action {
4312 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4313 wkt::internal::display_enum(f, self.name(), self.value())
4314 }
4315 }
4316
4317 impl std::convert::From<i32> for Action {
4318 fn from(value: i32) -> Self {
4319 match value {
4320 0 => Self::Unspecified,
4321 1 => Self::Create,
4322 2 => Self::Update,
4323 3 => Self::Delete,
4324 _ => Self::UnknownValue(action::UnknownValue(
4325 wkt::internal::UnknownEnumValue::Integer(value),
4326 )),
4327 }
4328 }
4329 }
4330
4331 impl std::convert::From<&str> for Action {
4332 fn from(value: &str) -> Self {
4333 use std::string::ToString;
4334 match value {
4335 "ACTION_UNSPECIFIED" => Self::Unspecified,
4336 "CREATE" => Self::Create,
4337 "UPDATE" => Self::Update,
4338 "DELETE" => Self::Delete,
4339 _ => Self::UnknownValue(action::UnknownValue(
4340 wkt::internal::UnknownEnumValue::String(value.to_string()),
4341 )),
4342 }
4343 }
4344 }
4345
4346 impl serde::ser::Serialize for Action {
4347 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4348 where
4349 S: serde::Serializer,
4350 {
4351 match self {
4352 Self::Unspecified => serializer.serialize_i32(0),
4353 Self::Create => serializer.serialize_i32(1),
4354 Self::Update => serializer.serialize_i32(2),
4355 Self::Delete => serializer.serialize_i32(3),
4356 Self::UnknownValue(u) => u.0.serialize(serializer),
4357 }
4358 }
4359 }
4360
4361 impl<'de> serde::de::Deserialize<'de> for Action {
4362 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4363 where
4364 D: serde::Deserializer<'de>,
4365 {
4366 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Action>::new(
4367 ".google.cloud.config.v1.Revision.Action",
4368 ))
4369 }
4370 }
4371
4372 /// Possible states of a revision.
4373 ///
4374 /// # Working with unknown values
4375 ///
4376 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4377 /// additional enum variants at any time. Adding new variants is not considered
4378 /// a breaking change. Applications should write their code in anticipation of:
4379 ///
4380 /// - New values appearing in future releases of the client library, **and**
4381 /// - New values received dynamically, without application changes.
4382 ///
4383 /// Please consult the [Working with enums] section in the user guide for some
4384 /// guidelines.
4385 ///
4386 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
4387 #[derive(Clone, Debug, PartialEq)]
4388 #[non_exhaustive]
4389 pub enum State {
4390 /// The default value. This value is used if the state is omitted.
4391 Unspecified,
4392 /// The revision is being applied.
4393 Applying,
4394 /// The revision was applied successfully.
4395 Applied,
4396 /// The revision could not be applied successfully.
4397 Failed,
4398 /// If set, the enum was initialized with an unknown value.
4399 ///
4400 /// Applications can examine the value using [State::value] or
4401 /// [State::name].
4402 UnknownValue(state::UnknownValue),
4403 }
4404
4405 #[doc(hidden)]
4406 pub mod state {
4407 #[allow(unused_imports)]
4408 use super::*;
4409 #[derive(Clone, Debug, PartialEq)]
4410 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4411 }
4412
4413 impl State {
4414 /// Gets the enum value.
4415 ///
4416 /// Returns `None` if the enum contains an unknown value deserialized from
4417 /// the string representation of enums.
4418 pub fn value(&self) -> std::option::Option<i32> {
4419 match self {
4420 Self::Unspecified => std::option::Option::Some(0),
4421 Self::Applying => std::option::Option::Some(1),
4422 Self::Applied => std::option::Option::Some(2),
4423 Self::Failed => std::option::Option::Some(3),
4424 Self::UnknownValue(u) => u.0.value(),
4425 }
4426 }
4427
4428 /// Gets the enum value as a string.
4429 ///
4430 /// Returns `None` if the enum contains an unknown value deserialized from
4431 /// the integer representation of enums.
4432 pub fn name(&self) -> std::option::Option<&str> {
4433 match self {
4434 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
4435 Self::Applying => std::option::Option::Some("APPLYING"),
4436 Self::Applied => std::option::Option::Some("APPLIED"),
4437 Self::Failed => std::option::Option::Some("FAILED"),
4438 Self::UnknownValue(u) => u.0.name(),
4439 }
4440 }
4441 }
4442
4443 impl std::default::Default for State {
4444 fn default() -> Self {
4445 use std::convert::From;
4446 Self::from(0)
4447 }
4448 }
4449
4450 impl std::fmt::Display for State {
4451 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4452 wkt::internal::display_enum(f, self.name(), self.value())
4453 }
4454 }
4455
4456 impl std::convert::From<i32> for State {
4457 fn from(value: i32) -> Self {
4458 match value {
4459 0 => Self::Unspecified,
4460 1 => Self::Applying,
4461 2 => Self::Applied,
4462 3 => Self::Failed,
4463 _ => Self::UnknownValue(state::UnknownValue(
4464 wkt::internal::UnknownEnumValue::Integer(value),
4465 )),
4466 }
4467 }
4468 }
4469
4470 impl std::convert::From<&str> for State {
4471 fn from(value: &str) -> Self {
4472 use std::string::ToString;
4473 match value {
4474 "STATE_UNSPECIFIED" => Self::Unspecified,
4475 "APPLYING" => Self::Applying,
4476 "APPLIED" => Self::Applied,
4477 "FAILED" => Self::Failed,
4478 _ => Self::UnknownValue(state::UnknownValue(
4479 wkt::internal::UnknownEnumValue::String(value.to_string()),
4480 )),
4481 }
4482 }
4483 }
4484
4485 impl serde::ser::Serialize for State {
4486 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4487 where
4488 S: serde::Serializer,
4489 {
4490 match self {
4491 Self::Unspecified => serializer.serialize_i32(0),
4492 Self::Applying => serializer.serialize_i32(1),
4493 Self::Applied => serializer.serialize_i32(2),
4494 Self::Failed => serializer.serialize_i32(3),
4495 Self::UnknownValue(u) => u.0.serialize(serializer),
4496 }
4497 }
4498 }
4499
4500 impl<'de> serde::de::Deserialize<'de> for State {
4501 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4502 where
4503 D: serde::Deserializer<'de>,
4504 {
4505 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
4506 ".google.cloud.config.v1.Revision.State",
4507 ))
4508 }
4509 }
4510
4511 /// Possible errors if Revision could not be created or updated successfully.
4512 ///
4513 /// # Working with unknown values
4514 ///
4515 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4516 /// additional enum variants at any time. Adding new variants is not considered
4517 /// a breaking change. Applications should write their code in anticipation of:
4518 ///
4519 /// - New values appearing in future releases of the client library, **and**
4520 /// - New values received dynamically, without application changes.
4521 ///
4522 /// Please consult the [Working with enums] section in the user guide for some
4523 /// guidelines.
4524 ///
4525 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
4526 #[derive(Clone, Debug, PartialEq)]
4527 #[non_exhaustive]
4528 pub enum ErrorCode {
4529 /// No error code was specified.
4530 Unspecified,
4531 /// Cloud Build failed due to a permission issue.
4532 CloudBuildPermissionDenied,
4533 /// Cloud Build job associated with creating or updating a deployment could
4534 /// not be started.
4535 ApplyBuildApiFailed,
4536 /// Cloud Build job associated with creating or updating a deployment was
4537 /// started but failed.
4538 ApplyBuildRunFailed,
4539 /// quota validation failed for one or more resources in terraform
4540 /// configuration files.
4541 QuotaValidationFailed,
4542 /// Failed to import values from an external source.
4543 ExternalValueSourceImportFailed,
4544 /// If set, the enum was initialized with an unknown value.
4545 ///
4546 /// Applications can examine the value using [ErrorCode::value] or
4547 /// [ErrorCode::name].
4548 UnknownValue(error_code::UnknownValue),
4549 }
4550
4551 #[doc(hidden)]
4552 pub mod error_code {
4553 #[allow(unused_imports)]
4554 use super::*;
4555 #[derive(Clone, Debug, PartialEq)]
4556 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4557 }
4558
4559 impl ErrorCode {
4560 /// Gets the enum value.
4561 ///
4562 /// Returns `None` if the enum contains an unknown value deserialized from
4563 /// the string representation of enums.
4564 pub fn value(&self) -> std::option::Option<i32> {
4565 match self {
4566 Self::Unspecified => std::option::Option::Some(0),
4567 Self::CloudBuildPermissionDenied => std::option::Option::Some(1),
4568 Self::ApplyBuildApiFailed => std::option::Option::Some(4),
4569 Self::ApplyBuildRunFailed => std::option::Option::Some(5),
4570 Self::QuotaValidationFailed => std::option::Option::Some(7),
4571 Self::ExternalValueSourceImportFailed => std::option::Option::Some(8),
4572 Self::UnknownValue(u) => u.0.value(),
4573 }
4574 }
4575
4576 /// Gets the enum value as a string.
4577 ///
4578 /// Returns `None` if the enum contains an unknown value deserialized from
4579 /// the integer representation of enums.
4580 pub fn name(&self) -> std::option::Option<&str> {
4581 match self {
4582 Self::Unspecified => std::option::Option::Some("ERROR_CODE_UNSPECIFIED"),
4583 Self::CloudBuildPermissionDenied => {
4584 std::option::Option::Some("CLOUD_BUILD_PERMISSION_DENIED")
4585 }
4586 Self::ApplyBuildApiFailed => std::option::Option::Some("APPLY_BUILD_API_FAILED"),
4587 Self::ApplyBuildRunFailed => std::option::Option::Some("APPLY_BUILD_RUN_FAILED"),
4588 Self::QuotaValidationFailed => std::option::Option::Some("QUOTA_VALIDATION_FAILED"),
4589 Self::ExternalValueSourceImportFailed => {
4590 std::option::Option::Some("EXTERNAL_VALUE_SOURCE_IMPORT_FAILED")
4591 }
4592 Self::UnknownValue(u) => u.0.name(),
4593 }
4594 }
4595 }
4596
4597 impl std::default::Default for ErrorCode {
4598 fn default() -> Self {
4599 use std::convert::From;
4600 Self::from(0)
4601 }
4602 }
4603
4604 impl std::fmt::Display for ErrorCode {
4605 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4606 wkt::internal::display_enum(f, self.name(), self.value())
4607 }
4608 }
4609
4610 impl std::convert::From<i32> for ErrorCode {
4611 fn from(value: i32) -> Self {
4612 match value {
4613 0 => Self::Unspecified,
4614 1 => Self::CloudBuildPermissionDenied,
4615 4 => Self::ApplyBuildApiFailed,
4616 5 => Self::ApplyBuildRunFailed,
4617 7 => Self::QuotaValidationFailed,
4618 8 => Self::ExternalValueSourceImportFailed,
4619 _ => Self::UnknownValue(error_code::UnknownValue(
4620 wkt::internal::UnknownEnumValue::Integer(value),
4621 )),
4622 }
4623 }
4624 }
4625
4626 impl std::convert::From<&str> for ErrorCode {
4627 fn from(value: &str) -> Self {
4628 use std::string::ToString;
4629 match value {
4630 "ERROR_CODE_UNSPECIFIED" => Self::Unspecified,
4631 "CLOUD_BUILD_PERMISSION_DENIED" => Self::CloudBuildPermissionDenied,
4632 "APPLY_BUILD_API_FAILED" => Self::ApplyBuildApiFailed,
4633 "APPLY_BUILD_RUN_FAILED" => Self::ApplyBuildRunFailed,
4634 "QUOTA_VALIDATION_FAILED" => Self::QuotaValidationFailed,
4635 "EXTERNAL_VALUE_SOURCE_IMPORT_FAILED" => Self::ExternalValueSourceImportFailed,
4636 _ => Self::UnknownValue(error_code::UnknownValue(
4637 wkt::internal::UnknownEnumValue::String(value.to_string()),
4638 )),
4639 }
4640 }
4641 }
4642
4643 impl serde::ser::Serialize for ErrorCode {
4644 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4645 where
4646 S: serde::Serializer,
4647 {
4648 match self {
4649 Self::Unspecified => serializer.serialize_i32(0),
4650 Self::CloudBuildPermissionDenied => serializer.serialize_i32(1),
4651 Self::ApplyBuildApiFailed => serializer.serialize_i32(4),
4652 Self::ApplyBuildRunFailed => serializer.serialize_i32(5),
4653 Self::QuotaValidationFailed => serializer.serialize_i32(7),
4654 Self::ExternalValueSourceImportFailed => serializer.serialize_i32(8),
4655 Self::UnknownValue(u) => u.0.serialize(serializer),
4656 }
4657 }
4658 }
4659
4660 impl<'de> serde::de::Deserialize<'de> for ErrorCode {
4661 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4662 where
4663 D: serde::Deserializer<'de>,
4664 {
4665 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ErrorCode>::new(
4666 ".google.cloud.config.v1.Revision.ErrorCode",
4667 ))
4668 }
4669 }
4670
4671 /// Blueprint that was deployed.
4672 #[derive(Clone, Debug, PartialEq)]
4673 #[non_exhaustive]
4674 pub enum Blueprint {
4675 /// Output only. A blueprint described using Terraform's HashiCorp
4676 /// Configuration Language as a root module.
4677 TerraformBlueprint(std::boxed::Box<crate::model::TerraformBlueprint>),
4678 }
4679}
4680
4681/// Errors encountered during actuation using Terraform
4682#[derive(Clone, Default, PartialEq)]
4683#[non_exhaustive]
4684pub struct TerraformError {
4685 /// Address of the resource associated with the error,
4686 /// e.g. `google_compute_network.vpc_network`.
4687 pub resource_address: std::string::String,
4688
4689 /// HTTP response code returned from Google Cloud Platform APIs when Terraform
4690 /// fails to provision the resource. If unset or 0, no HTTP response code was
4691 /// returned by Terraform.
4692 pub http_response_code: i32,
4693
4694 /// A human-readable error description.
4695 pub error_description: std::string::String,
4696
4697 /// Output only. Original error response from underlying Google API, if
4698 /// available.
4699 pub error: std::option::Option<google_cloud_rpc::model::Status>,
4700
4701 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4702}
4703
4704impl TerraformError {
4705 /// Creates a new default instance.
4706 pub fn new() -> Self {
4707 std::default::Default::default()
4708 }
4709
4710 /// Sets the value of [resource_address][crate::model::TerraformError::resource_address].
4711 ///
4712 /// # Example
4713 /// ```ignore,no_run
4714 /// # use google_cloud_config_v1::model::TerraformError;
4715 /// let x = TerraformError::new().set_resource_address("example");
4716 /// ```
4717 pub fn set_resource_address<T: std::convert::Into<std::string::String>>(
4718 mut self,
4719 v: T,
4720 ) -> Self {
4721 self.resource_address = v.into();
4722 self
4723 }
4724
4725 /// Sets the value of [http_response_code][crate::model::TerraformError::http_response_code].
4726 ///
4727 /// # Example
4728 /// ```ignore,no_run
4729 /// # use google_cloud_config_v1::model::TerraformError;
4730 /// let x = TerraformError::new().set_http_response_code(42);
4731 /// ```
4732 pub fn set_http_response_code<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4733 self.http_response_code = v.into();
4734 self
4735 }
4736
4737 /// Sets the value of [error_description][crate::model::TerraformError::error_description].
4738 ///
4739 /// # Example
4740 /// ```ignore,no_run
4741 /// # use google_cloud_config_v1::model::TerraformError;
4742 /// let x = TerraformError::new().set_error_description("example");
4743 /// ```
4744 pub fn set_error_description<T: std::convert::Into<std::string::String>>(
4745 mut self,
4746 v: T,
4747 ) -> Self {
4748 self.error_description = v.into();
4749 self
4750 }
4751
4752 /// Sets the value of [error][crate::model::TerraformError::error].
4753 ///
4754 /// # Example
4755 /// ```ignore,no_run
4756 /// # use google_cloud_config_v1::model::TerraformError;
4757 /// use google_cloud_rpc::model::Status;
4758 /// let x = TerraformError::new().set_error(Status::default()/* use setters */);
4759 /// ```
4760 pub fn set_error<T>(mut self, v: T) -> Self
4761 where
4762 T: std::convert::Into<google_cloud_rpc::model::Status>,
4763 {
4764 self.error = std::option::Option::Some(v.into());
4765 self
4766 }
4767
4768 /// Sets or clears the value of [error][crate::model::TerraformError::error].
4769 ///
4770 /// # Example
4771 /// ```ignore,no_run
4772 /// # use google_cloud_config_v1::model::TerraformError;
4773 /// use google_cloud_rpc::model::Status;
4774 /// let x = TerraformError::new().set_or_clear_error(Some(Status::default()/* use setters */));
4775 /// let x = TerraformError::new().set_or_clear_error(None::<Status>);
4776 /// ```
4777 pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
4778 where
4779 T: std::convert::Into<google_cloud_rpc::model::Status>,
4780 {
4781 self.error = v.map(|x| x.into());
4782 self
4783 }
4784}
4785
4786impl wkt::message::Message for TerraformError {
4787 fn typename() -> &'static str {
4788 "type.googleapis.com/google.cloud.config.v1.TerraformError"
4789 }
4790}
4791
4792/// A set of files in a Git repository.
4793#[derive(Clone, Default, PartialEq)]
4794#[non_exhaustive]
4795pub struct GitSource {
4796 /// Repository URL.
4797 /// Example: '<https://github.com/kubernetes/examples.git>'
4798 pub repo: std::option::Option<std::string::String>,
4799
4800 /// Subdirectory inside the repository.
4801 /// Example: 'staging/my-package'
4802 pub directory: std::option::Option<std::string::String>,
4803
4804 /// Git reference (e.g. branch or tag).
4805 pub r#ref: std::option::Option<std::string::String>,
4806
4807 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4808}
4809
4810impl GitSource {
4811 /// Creates a new default instance.
4812 pub fn new() -> Self {
4813 std::default::Default::default()
4814 }
4815
4816 /// Sets the value of [repo][crate::model::GitSource::repo].
4817 ///
4818 /// # Example
4819 /// ```ignore,no_run
4820 /// # use google_cloud_config_v1::model::GitSource;
4821 /// let x = GitSource::new().set_repo("example");
4822 /// ```
4823 pub fn set_repo<T>(mut self, v: T) -> Self
4824 where
4825 T: std::convert::Into<std::string::String>,
4826 {
4827 self.repo = std::option::Option::Some(v.into());
4828 self
4829 }
4830
4831 /// Sets or clears the value of [repo][crate::model::GitSource::repo].
4832 ///
4833 /// # Example
4834 /// ```ignore,no_run
4835 /// # use google_cloud_config_v1::model::GitSource;
4836 /// let x = GitSource::new().set_or_clear_repo(Some("example"));
4837 /// let x = GitSource::new().set_or_clear_repo(None::<String>);
4838 /// ```
4839 pub fn set_or_clear_repo<T>(mut self, v: std::option::Option<T>) -> Self
4840 where
4841 T: std::convert::Into<std::string::String>,
4842 {
4843 self.repo = v.map(|x| x.into());
4844 self
4845 }
4846
4847 /// Sets the value of [directory][crate::model::GitSource::directory].
4848 ///
4849 /// # Example
4850 /// ```ignore,no_run
4851 /// # use google_cloud_config_v1::model::GitSource;
4852 /// let x = GitSource::new().set_directory("example");
4853 /// ```
4854 pub fn set_directory<T>(mut self, v: T) -> Self
4855 where
4856 T: std::convert::Into<std::string::String>,
4857 {
4858 self.directory = std::option::Option::Some(v.into());
4859 self
4860 }
4861
4862 /// Sets or clears the value of [directory][crate::model::GitSource::directory].
4863 ///
4864 /// # Example
4865 /// ```ignore,no_run
4866 /// # use google_cloud_config_v1::model::GitSource;
4867 /// let x = GitSource::new().set_or_clear_directory(Some("example"));
4868 /// let x = GitSource::new().set_or_clear_directory(None::<String>);
4869 /// ```
4870 pub fn set_or_clear_directory<T>(mut self, v: std::option::Option<T>) -> Self
4871 where
4872 T: std::convert::Into<std::string::String>,
4873 {
4874 self.directory = v.map(|x| x.into());
4875 self
4876 }
4877
4878 /// Sets the value of [r#ref][crate::model::GitSource::ref].
4879 ///
4880 /// # Example
4881 /// ```ignore,no_run
4882 /// # use google_cloud_config_v1::model::GitSource;
4883 /// let x = GitSource::new().set_ref("example");
4884 /// ```
4885 pub fn set_ref<T>(mut self, v: T) -> Self
4886 where
4887 T: std::convert::Into<std::string::String>,
4888 {
4889 self.r#ref = std::option::Option::Some(v.into());
4890 self
4891 }
4892
4893 /// Sets or clears the value of [r#ref][crate::model::GitSource::ref].
4894 ///
4895 /// # Example
4896 /// ```ignore,no_run
4897 /// # use google_cloud_config_v1::model::GitSource;
4898 /// let x = GitSource::new().set_or_clear_ref(Some("example"));
4899 /// let x = GitSource::new().set_or_clear_ref(None::<String>);
4900 /// ```
4901 pub fn set_or_clear_ref<T>(mut self, v: std::option::Option<T>) -> Self
4902 where
4903 T: std::convert::Into<std::string::String>,
4904 {
4905 self.r#ref = v.map(|x| x.into());
4906 self
4907 }
4908}
4909
4910impl wkt::message::Message for GitSource {
4911 fn typename() -> &'static str {
4912 "type.googleapis.com/google.cloud.config.v1.GitSource"
4913 }
4914}
4915
4916/// Ephemeral metadata content describing the state of a deployment operation.
4917#[derive(Clone, Default, PartialEq)]
4918#[non_exhaustive]
4919pub struct DeploymentOperationMetadata {
4920 /// The current step the deployment operation is running.
4921 pub step: crate::model::deployment_operation_metadata::DeploymentStep,
4922
4923 /// Outputs and artifacts from applying a deployment.
4924 pub apply_results: std::option::Option<crate::model::ApplyResults>,
4925
4926 /// Output only. Cloud Build instance UUID associated with this operation.
4927 pub build: std::string::String,
4928
4929 /// Output only. Location of Deployment operations logs in
4930 /// `gs://{bucket}/{object}` format.
4931 pub logs: std::string::String,
4932
4933 /// Output only. Indicating if early apply results are available.
4934 pub apply_results_available: bool,
4935
4936 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4937}
4938
4939impl DeploymentOperationMetadata {
4940 /// Creates a new default instance.
4941 pub fn new() -> Self {
4942 std::default::Default::default()
4943 }
4944
4945 /// Sets the value of [step][crate::model::DeploymentOperationMetadata::step].
4946 ///
4947 /// # Example
4948 /// ```ignore,no_run
4949 /// # use google_cloud_config_v1::model::DeploymentOperationMetadata;
4950 /// use google_cloud_config_v1::model::deployment_operation_metadata::DeploymentStep;
4951 /// let x0 = DeploymentOperationMetadata::new().set_step(DeploymentStep::PreparingStorageBucket);
4952 /// let x1 = DeploymentOperationMetadata::new().set_step(DeploymentStep::DownloadingBlueprint);
4953 /// let x2 = DeploymentOperationMetadata::new().set_step(DeploymentStep::RunningTfInit);
4954 /// ```
4955 pub fn set_step<
4956 T: std::convert::Into<crate::model::deployment_operation_metadata::DeploymentStep>,
4957 >(
4958 mut self,
4959 v: T,
4960 ) -> Self {
4961 self.step = v.into();
4962 self
4963 }
4964
4965 /// Sets the value of [apply_results][crate::model::DeploymentOperationMetadata::apply_results].
4966 ///
4967 /// # Example
4968 /// ```ignore,no_run
4969 /// # use google_cloud_config_v1::model::DeploymentOperationMetadata;
4970 /// use google_cloud_config_v1::model::ApplyResults;
4971 /// let x = DeploymentOperationMetadata::new().set_apply_results(ApplyResults::default()/* use setters */);
4972 /// ```
4973 pub fn set_apply_results<T>(mut self, v: T) -> Self
4974 where
4975 T: std::convert::Into<crate::model::ApplyResults>,
4976 {
4977 self.apply_results = std::option::Option::Some(v.into());
4978 self
4979 }
4980
4981 /// Sets or clears the value of [apply_results][crate::model::DeploymentOperationMetadata::apply_results].
4982 ///
4983 /// # Example
4984 /// ```ignore,no_run
4985 /// # use google_cloud_config_v1::model::DeploymentOperationMetadata;
4986 /// use google_cloud_config_v1::model::ApplyResults;
4987 /// let x = DeploymentOperationMetadata::new().set_or_clear_apply_results(Some(ApplyResults::default()/* use setters */));
4988 /// let x = DeploymentOperationMetadata::new().set_or_clear_apply_results(None::<ApplyResults>);
4989 /// ```
4990 pub fn set_or_clear_apply_results<T>(mut self, v: std::option::Option<T>) -> Self
4991 where
4992 T: std::convert::Into<crate::model::ApplyResults>,
4993 {
4994 self.apply_results = v.map(|x| x.into());
4995 self
4996 }
4997
4998 /// Sets the value of [build][crate::model::DeploymentOperationMetadata::build].
4999 ///
5000 /// # Example
5001 /// ```ignore,no_run
5002 /// # use google_cloud_config_v1::model::DeploymentOperationMetadata;
5003 /// let x = DeploymentOperationMetadata::new().set_build("example");
5004 /// ```
5005 pub fn set_build<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5006 self.build = v.into();
5007 self
5008 }
5009
5010 /// Sets the value of [logs][crate::model::DeploymentOperationMetadata::logs].
5011 ///
5012 /// # Example
5013 /// ```ignore,no_run
5014 /// # use google_cloud_config_v1::model::DeploymentOperationMetadata;
5015 /// let x = DeploymentOperationMetadata::new().set_logs("example");
5016 /// ```
5017 pub fn set_logs<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5018 self.logs = v.into();
5019 self
5020 }
5021
5022 /// Sets the value of [apply_results_available][crate::model::DeploymentOperationMetadata::apply_results_available].
5023 ///
5024 /// # Example
5025 /// ```ignore,no_run
5026 /// # use google_cloud_config_v1::model::DeploymentOperationMetadata;
5027 /// let x = DeploymentOperationMetadata::new().set_apply_results_available(true);
5028 /// ```
5029 pub fn set_apply_results_available<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5030 self.apply_results_available = v.into();
5031 self
5032 }
5033}
5034
5035impl wkt::message::Message for DeploymentOperationMetadata {
5036 fn typename() -> &'static str {
5037 "type.googleapis.com/google.cloud.config.v1.DeploymentOperationMetadata"
5038 }
5039}
5040
5041/// Defines additional types related to [DeploymentOperationMetadata].
5042pub mod deployment_operation_metadata {
5043 #[allow(unused_imports)]
5044 use super::*;
5045
5046 /// The possible steps a deployment may be running.
5047 ///
5048 /// # Working with unknown values
5049 ///
5050 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5051 /// additional enum variants at any time. Adding new variants is not considered
5052 /// a breaking change. Applications should write their code in anticipation of:
5053 ///
5054 /// - New values appearing in future releases of the client library, **and**
5055 /// - New values received dynamically, without application changes.
5056 ///
5057 /// Please consult the [Working with enums] section in the user guide for some
5058 /// guidelines.
5059 ///
5060 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
5061 #[derive(Clone, Debug, PartialEq)]
5062 #[non_exhaustive]
5063 pub enum DeploymentStep {
5064 /// Unspecified deployment step
5065 Unspecified,
5066 /// Infra Manager is creating a Google Cloud Storage bucket to store
5067 /// artifacts and metadata about the deployment and revision
5068 PreparingStorageBucket,
5069 /// Downloading the blueprint onto the Google Cloud Storage bucket
5070 DownloadingBlueprint,
5071 /// Initializing Terraform using `terraform init`
5072 RunningTfInit,
5073 /// Running `terraform plan`
5074 RunningTfPlan,
5075 /// Actuating resources using Terraform using `terraform apply`
5076 RunningTfApply,
5077 /// Destroying resources using Terraform using `terraform destroy`
5078 RunningTfDestroy,
5079 /// Validating the uploaded TF state file when unlocking a deployment
5080 RunningTfValidate,
5081 /// Unlocking a deployment
5082 UnlockingDeployment,
5083 /// Operation was successful
5084 Succeeded,
5085 /// Operation failed
5086 Failed,
5087 /// Validating the provided repository.
5088 ValidatingRepository,
5089 /// Running quota validation
5090 RunningQuotaValidation,
5091 /// If set, the enum was initialized with an unknown value.
5092 ///
5093 /// Applications can examine the value using [DeploymentStep::value] or
5094 /// [DeploymentStep::name].
5095 UnknownValue(deployment_step::UnknownValue),
5096 }
5097
5098 #[doc(hidden)]
5099 pub mod deployment_step {
5100 #[allow(unused_imports)]
5101 use super::*;
5102 #[derive(Clone, Debug, PartialEq)]
5103 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5104 }
5105
5106 impl DeploymentStep {
5107 /// Gets the enum value.
5108 ///
5109 /// Returns `None` if the enum contains an unknown value deserialized from
5110 /// the string representation of enums.
5111 pub fn value(&self) -> std::option::Option<i32> {
5112 match self {
5113 Self::Unspecified => std::option::Option::Some(0),
5114 Self::PreparingStorageBucket => std::option::Option::Some(1),
5115 Self::DownloadingBlueprint => std::option::Option::Some(2),
5116 Self::RunningTfInit => std::option::Option::Some(3),
5117 Self::RunningTfPlan => std::option::Option::Some(4),
5118 Self::RunningTfApply => std::option::Option::Some(5),
5119 Self::RunningTfDestroy => std::option::Option::Some(6),
5120 Self::RunningTfValidate => std::option::Option::Some(7),
5121 Self::UnlockingDeployment => std::option::Option::Some(8),
5122 Self::Succeeded => std::option::Option::Some(9),
5123 Self::Failed => std::option::Option::Some(10),
5124 Self::ValidatingRepository => std::option::Option::Some(11),
5125 Self::RunningQuotaValidation => std::option::Option::Some(12),
5126 Self::UnknownValue(u) => u.0.value(),
5127 }
5128 }
5129
5130 /// Gets the enum value as a string.
5131 ///
5132 /// Returns `None` if the enum contains an unknown value deserialized from
5133 /// the integer representation of enums.
5134 pub fn name(&self) -> std::option::Option<&str> {
5135 match self {
5136 Self::Unspecified => std::option::Option::Some("DEPLOYMENT_STEP_UNSPECIFIED"),
5137 Self::PreparingStorageBucket => {
5138 std::option::Option::Some("PREPARING_STORAGE_BUCKET")
5139 }
5140 Self::DownloadingBlueprint => std::option::Option::Some("DOWNLOADING_BLUEPRINT"),
5141 Self::RunningTfInit => std::option::Option::Some("RUNNING_TF_INIT"),
5142 Self::RunningTfPlan => std::option::Option::Some("RUNNING_TF_PLAN"),
5143 Self::RunningTfApply => std::option::Option::Some("RUNNING_TF_APPLY"),
5144 Self::RunningTfDestroy => std::option::Option::Some("RUNNING_TF_DESTROY"),
5145 Self::RunningTfValidate => std::option::Option::Some("RUNNING_TF_VALIDATE"),
5146 Self::UnlockingDeployment => std::option::Option::Some("UNLOCKING_DEPLOYMENT"),
5147 Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
5148 Self::Failed => std::option::Option::Some("FAILED"),
5149 Self::ValidatingRepository => std::option::Option::Some("VALIDATING_REPOSITORY"),
5150 Self::RunningQuotaValidation => {
5151 std::option::Option::Some("RUNNING_QUOTA_VALIDATION")
5152 }
5153 Self::UnknownValue(u) => u.0.name(),
5154 }
5155 }
5156 }
5157
5158 impl std::default::Default for DeploymentStep {
5159 fn default() -> Self {
5160 use std::convert::From;
5161 Self::from(0)
5162 }
5163 }
5164
5165 impl std::fmt::Display for DeploymentStep {
5166 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5167 wkt::internal::display_enum(f, self.name(), self.value())
5168 }
5169 }
5170
5171 impl std::convert::From<i32> for DeploymentStep {
5172 fn from(value: i32) -> Self {
5173 match value {
5174 0 => Self::Unspecified,
5175 1 => Self::PreparingStorageBucket,
5176 2 => Self::DownloadingBlueprint,
5177 3 => Self::RunningTfInit,
5178 4 => Self::RunningTfPlan,
5179 5 => Self::RunningTfApply,
5180 6 => Self::RunningTfDestroy,
5181 7 => Self::RunningTfValidate,
5182 8 => Self::UnlockingDeployment,
5183 9 => Self::Succeeded,
5184 10 => Self::Failed,
5185 11 => Self::ValidatingRepository,
5186 12 => Self::RunningQuotaValidation,
5187 _ => Self::UnknownValue(deployment_step::UnknownValue(
5188 wkt::internal::UnknownEnumValue::Integer(value),
5189 )),
5190 }
5191 }
5192 }
5193
5194 impl std::convert::From<&str> for DeploymentStep {
5195 fn from(value: &str) -> Self {
5196 use std::string::ToString;
5197 match value {
5198 "DEPLOYMENT_STEP_UNSPECIFIED" => Self::Unspecified,
5199 "PREPARING_STORAGE_BUCKET" => Self::PreparingStorageBucket,
5200 "DOWNLOADING_BLUEPRINT" => Self::DownloadingBlueprint,
5201 "RUNNING_TF_INIT" => Self::RunningTfInit,
5202 "RUNNING_TF_PLAN" => Self::RunningTfPlan,
5203 "RUNNING_TF_APPLY" => Self::RunningTfApply,
5204 "RUNNING_TF_DESTROY" => Self::RunningTfDestroy,
5205 "RUNNING_TF_VALIDATE" => Self::RunningTfValidate,
5206 "UNLOCKING_DEPLOYMENT" => Self::UnlockingDeployment,
5207 "SUCCEEDED" => Self::Succeeded,
5208 "FAILED" => Self::Failed,
5209 "VALIDATING_REPOSITORY" => Self::ValidatingRepository,
5210 "RUNNING_QUOTA_VALIDATION" => Self::RunningQuotaValidation,
5211 _ => Self::UnknownValue(deployment_step::UnknownValue(
5212 wkt::internal::UnknownEnumValue::String(value.to_string()),
5213 )),
5214 }
5215 }
5216 }
5217
5218 impl serde::ser::Serialize for DeploymentStep {
5219 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5220 where
5221 S: serde::Serializer,
5222 {
5223 match self {
5224 Self::Unspecified => serializer.serialize_i32(0),
5225 Self::PreparingStorageBucket => serializer.serialize_i32(1),
5226 Self::DownloadingBlueprint => serializer.serialize_i32(2),
5227 Self::RunningTfInit => serializer.serialize_i32(3),
5228 Self::RunningTfPlan => serializer.serialize_i32(4),
5229 Self::RunningTfApply => serializer.serialize_i32(5),
5230 Self::RunningTfDestroy => serializer.serialize_i32(6),
5231 Self::RunningTfValidate => serializer.serialize_i32(7),
5232 Self::UnlockingDeployment => serializer.serialize_i32(8),
5233 Self::Succeeded => serializer.serialize_i32(9),
5234 Self::Failed => serializer.serialize_i32(10),
5235 Self::ValidatingRepository => serializer.serialize_i32(11),
5236 Self::RunningQuotaValidation => serializer.serialize_i32(12),
5237 Self::UnknownValue(u) => u.0.serialize(serializer),
5238 }
5239 }
5240 }
5241
5242 impl<'de> serde::de::Deserialize<'de> for DeploymentStep {
5243 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5244 where
5245 D: serde::Deserializer<'de>,
5246 {
5247 deserializer.deserialize_any(wkt::internal::EnumVisitor::<DeploymentStep>::new(
5248 ".google.cloud.config.v1.DeploymentOperationMetadata.DeploymentStep",
5249 ))
5250 }
5251 }
5252}
5253
5254/// Resource represents a Google Cloud Platform resource actuated by IM.
5255/// Resources are child resources of Revisions.
5256#[derive(Clone, Default, PartialEq)]
5257#[non_exhaustive]
5258pub struct Resource {
5259 /// Output only. Resource name.
5260 /// Format:
5261 /// `projects/{project}/locations/{location}/deployments/{deployment}/revisions/{revision}/resources/{resource}`
5262 pub name: std::string::String,
5263
5264 /// Output only. Terraform-specific info if this resource was created using
5265 /// Terraform.
5266 pub terraform_info: std::option::Option<crate::model::ResourceTerraformInfo>,
5267
5268 /// Output only. Map of Cloud Asset Inventory (CAI) type to CAI info (e.g. CAI
5269 /// ID). CAI type format follows
5270 /// <https://cloud.google.com/asset-inventory/docs/supported-asset-types>
5271 pub cai_assets: std::collections::HashMap<std::string::String, crate::model::ResourceCAIInfo>,
5272
5273 /// Output only. Intent of the resource.
5274 pub intent: crate::model::resource::Intent,
5275
5276 /// Output only. Current state of the resource.
5277 pub state: crate::model::resource::State,
5278
5279 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5280}
5281
5282impl Resource {
5283 /// Creates a new default instance.
5284 pub fn new() -> Self {
5285 std::default::Default::default()
5286 }
5287
5288 /// Sets the value of [name][crate::model::Resource::name].
5289 ///
5290 /// # Example
5291 /// ```ignore,no_run
5292 /// # use google_cloud_config_v1::model::Resource;
5293 /// # let project_id = "project_id";
5294 /// # let location_id = "location_id";
5295 /// # let deployment_id = "deployment_id";
5296 /// # let revision_id = "revision_id";
5297 /// # let resource_id = "resource_id";
5298 /// let x = Resource::new().set_name(format!("projects/{project_id}/locations/{location_id}/deployments/{deployment_id}/revisions/{revision_id}/resources/{resource_id}"));
5299 /// ```
5300 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5301 self.name = v.into();
5302 self
5303 }
5304
5305 /// Sets the value of [terraform_info][crate::model::Resource::terraform_info].
5306 ///
5307 /// # Example
5308 /// ```ignore,no_run
5309 /// # use google_cloud_config_v1::model::Resource;
5310 /// use google_cloud_config_v1::model::ResourceTerraformInfo;
5311 /// let x = Resource::new().set_terraform_info(ResourceTerraformInfo::default()/* use setters */);
5312 /// ```
5313 pub fn set_terraform_info<T>(mut self, v: T) -> Self
5314 where
5315 T: std::convert::Into<crate::model::ResourceTerraformInfo>,
5316 {
5317 self.terraform_info = std::option::Option::Some(v.into());
5318 self
5319 }
5320
5321 /// Sets or clears the value of [terraform_info][crate::model::Resource::terraform_info].
5322 ///
5323 /// # Example
5324 /// ```ignore,no_run
5325 /// # use google_cloud_config_v1::model::Resource;
5326 /// use google_cloud_config_v1::model::ResourceTerraformInfo;
5327 /// let x = Resource::new().set_or_clear_terraform_info(Some(ResourceTerraformInfo::default()/* use setters */));
5328 /// let x = Resource::new().set_or_clear_terraform_info(None::<ResourceTerraformInfo>);
5329 /// ```
5330 pub fn set_or_clear_terraform_info<T>(mut self, v: std::option::Option<T>) -> Self
5331 where
5332 T: std::convert::Into<crate::model::ResourceTerraformInfo>,
5333 {
5334 self.terraform_info = v.map(|x| x.into());
5335 self
5336 }
5337
5338 /// Sets the value of [cai_assets][crate::model::Resource::cai_assets].
5339 ///
5340 /// # Example
5341 /// ```ignore,no_run
5342 /// # use google_cloud_config_v1::model::Resource;
5343 /// use google_cloud_config_v1::model::ResourceCAIInfo;
5344 /// let x = Resource::new().set_cai_assets([
5345 /// ("key0", ResourceCAIInfo::default()/* use setters */),
5346 /// ("key1", ResourceCAIInfo::default()/* use (different) setters */),
5347 /// ]);
5348 /// ```
5349 pub fn set_cai_assets<T, K, V>(mut self, v: T) -> Self
5350 where
5351 T: std::iter::IntoIterator<Item = (K, V)>,
5352 K: std::convert::Into<std::string::String>,
5353 V: std::convert::Into<crate::model::ResourceCAIInfo>,
5354 {
5355 use std::iter::Iterator;
5356 self.cai_assets = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5357 self
5358 }
5359
5360 /// Sets the value of [intent][crate::model::Resource::intent].
5361 ///
5362 /// # Example
5363 /// ```ignore,no_run
5364 /// # use google_cloud_config_v1::model::Resource;
5365 /// use google_cloud_config_v1::model::resource::Intent;
5366 /// let x0 = Resource::new().set_intent(Intent::Create);
5367 /// let x1 = Resource::new().set_intent(Intent::Update);
5368 /// let x2 = Resource::new().set_intent(Intent::Delete);
5369 /// ```
5370 pub fn set_intent<T: std::convert::Into<crate::model::resource::Intent>>(
5371 mut self,
5372 v: T,
5373 ) -> Self {
5374 self.intent = v.into();
5375 self
5376 }
5377
5378 /// Sets the value of [state][crate::model::Resource::state].
5379 ///
5380 /// # Example
5381 /// ```ignore,no_run
5382 /// # use google_cloud_config_v1::model::Resource;
5383 /// use google_cloud_config_v1::model::resource::State;
5384 /// let x0 = Resource::new().set_state(State::Planned);
5385 /// let x1 = Resource::new().set_state(State::InProgress);
5386 /// let x2 = Resource::new().set_state(State::Reconciled);
5387 /// ```
5388 pub fn set_state<T: std::convert::Into<crate::model::resource::State>>(mut self, v: T) -> Self {
5389 self.state = v.into();
5390 self
5391 }
5392}
5393
5394impl wkt::message::Message for Resource {
5395 fn typename() -> &'static str {
5396 "type.googleapis.com/google.cloud.config.v1.Resource"
5397 }
5398}
5399
5400/// Defines additional types related to [Resource].
5401pub mod resource {
5402 #[allow(unused_imports)]
5403 use super::*;
5404
5405 /// Possible intent of the resource.
5406 ///
5407 /// # Working with unknown values
5408 ///
5409 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5410 /// additional enum variants at any time. Adding new variants is not considered
5411 /// a breaking change. Applications should write their code in anticipation of:
5412 ///
5413 /// - New values appearing in future releases of the client library, **and**
5414 /// - New values received dynamically, without application changes.
5415 ///
5416 /// Please consult the [Working with enums] section in the user guide for some
5417 /// guidelines.
5418 ///
5419 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
5420 #[derive(Clone, Debug, PartialEq)]
5421 #[non_exhaustive]
5422 pub enum Intent {
5423 /// The default value. This value is used if the intent is omitted.
5424 Unspecified,
5425 /// Infra Manager will create this Resource.
5426 Create,
5427 /// Infra Manager will update this Resource.
5428 Update,
5429 /// Infra Manager will delete this Resource.
5430 Delete,
5431 /// Infra Manager will destroy and recreate this Resource.
5432 Recreate,
5433 /// Infra Manager will leave this Resource untouched.
5434 Unchanged,
5435 /// If set, the enum was initialized with an unknown value.
5436 ///
5437 /// Applications can examine the value using [Intent::value] or
5438 /// [Intent::name].
5439 UnknownValue(intent::UnknownValue),
5440 }
5441
5442 #[doc(hidden)]
5443 pub mod intent {
5444 #[allow(unused_imports)]
5445 use super::*;
5446 #[derive(Clone, Debug, PartialEq)]
5447 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5448 }
5449
5450 impl Intent {
5451 /// Gets the enum value.
5452 ///
5453 /// Returns `None` if the enum contains an unknown value deserialized from
5454 /// the string representation of enums.
5455 pub fn value(&self) -> std::option::Option<i32> {
5456 match self {
5457 Self::Unspecified => std::option::Option::Some(0),
5458 Self::Create => std::option::Option::Some(1),
5459 Self::Update => std::option::Option::Some(2),
5460 Self::Delete => std::option::Option::Some(3),
5461 Self::Recreate => std::option::Option::Some(4),
5462 Self::Unchanged => std::option::Option::Some(5),
5463 Self::UnknownValue(u) => u.0.value(),
5464 }
5465 }
5466
5467 /// Gets the enum value as a string.
5468 ///
5469 /// Returns `None` if the enum contains an unknown value deserialized from
5470 /// the integer representation of enums.
5471 pub fn name(&self) -> std::option::Option<&str> {
5472 match self {
5473 Self::Unspecified => std::option::Option::Some("INTENT_UNSPECIFIED"),
5474 Self::Create => std::option::Option::Some("CREATE"),
5475 Self::Update => std::option::Option::Some("UPDATE"),
5476 Self::Delete => std::option::Option::Some("DELETE"),
5477 Self::Recreate => std::option::Option::Some("RECREATE"),
5478 Self::Unchanged => std::option::Option::Some("UNCHANGED"),
5479 Self::UnknownValue(u) => u.0.name(),
5480 }
5481 }
5482 }
5483
5484 impl std::default::Default for Intent {
5485 fn default() -> Self {
5486 use std::convert::From;
5487 Self::from(0)
5488 }
5489 }
5490
5491 impl std::fmt::Display for Intent {
5492 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5493 wkt::internal::display_enum(f, self.name(), self.value())
5494 }
5495 }
5496
5497 impl std::convert::From<i32> for Intent {
5498 fn from(value: i32) -> Self {
5499 match value {
5500 0 => Self::Unspecified,
5501 1 => Self::Create,
5502 2 => Self::Update,
5503 3 => Self::Delete,
5504 4 => Self::Recreate,
5505 5 => Self::Unchanged,
5506 _ => Self::UnknownValue(intent::UnknownValue(
5507 wkt::internal::UnknownEnumValue::Integer(value),
5508 )),
5509 }
5510 }
5511 }
5512
5513 impl std::convert::From<&str> for Intent {
5514 fn from(value: &str) -> Self {
5515 use std::string::ToString;
5516 match value {
5517 "INTENT_UNSPECIFIED" => Self::Unspecified,
5518 "CREATE" => Self::Create,
5519 "UPDATE" => Self::Update,
5520 "DELETE" => Self::Delete,
5521 "RECREATE" => Self::Recreate,
5522 "UNCHANGED" => Self::Unchanged,
5523 _ => Self::UnknownValue(intent::UnknownValue(
5524 wkt::internal::UnknownEnumValue::String(value.to_string()),
5525 )),
5526 }
5527 }
5528 }
5529
5530 impl serde::ser::Serialize for Intent {
5531 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5532 where
5533 S: serde::Serializer,
5534 {
5535 match self {
5536 Self::Unspecified => serializer.serialize_i32(0),
5537 Self::Create => serializer.serialize_i32(1),
5538 Self::Update => serializer.serialize_i32(2),
5539 Self::Delete => serializer.serialize_i32(3),
5540 Self::Recreate => serializer.serialize_i32(4),
5541 Self::Unchanged => serializer.serialize_i32(5),
5542 Self::UnknownValue(u) => u.0.serialize(serializer),
5543 }
5544 }
5545 }
5546
5547 impl<'de> serde::de::Deserialize<'de> for Intent {
5548 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5549 where
5550 D: serde::Deserializer<'de>,
5551 {
5552 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Intent>::new(
5553 ".google.cloud.config.v1.Resource.Intent",
5554 ))
5555 }
5556 }
5557
5558 /// Possible states of a resource.
5559 ///
5560 /// # Working with unknown values
5561 ///
5562 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5563 /// additional enum variants at any time. Adding new variants is not considered
5564 /// a breaking change. Applications should write their code in anticipation of:
5565 ///
5566 /// - New values appearing in future releases of the client library, **and**
5567 /// - New values received dynamically, without application changes.
5568 ///
5569 /// Please consult the [Working with enums] section in the user guide for some
5570 /// guidelines.
5571 ///
5572 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
5573 #[derive(Clone, Debug, PartialEq)]
5574 #[non_exhaustive]
5575 pub enum State {
5576 /// The default value. This value is used if the state is omitted.
5577 Unspecified,
5578 /// Resource has been planned for reconcile.
5579 Planned,
5580 /// Resource is actively reconciling into the intended state.
5581 InProgress,
5582 /// Resource has reconciled to intended state.
5583 Reconciled,
5584 /// Resource failed to reconcile.
5585 Failed,
5586 /// If set, the enum was initialized with an unknown value.
5587 ///
5588 /// Applications can examine the value using [State::value] or
5589 /// [State::name].
5590 UnknownValue(state::UnknownValue),
5591 }
5592
5593 #[doc(hidden)]
5594 pub mod state {
5595 #[allow(unused_imports)]
5596 use super::*;
5597 #[derive(Clone, Debug, PartialEq)]
5598 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5599 }
5600
5601 impl State {
5602 /// Gets the enum value.
5603 ///
5604 /// Returns `None` if the enum contains an unknown value deserialized from
5605 /// the string representation of enums.
5606 pub fn value(&self) -> std::option::Option<i32> {
5607 match self {
5608 Self::Unspecified => std::option::Option::Some(0),
5609 Self::Planned => std::option::Option::Some(1),
5610 Self::InProgress => std::option::Option::Some(2),
5611 Self::Reconciled => std::option::Option::Some(3),
5612 Self::Failed => std::option::Option::Some(4),
5613 Self::UnknownValue(u) => u.0.value(),
5614 }
5615 }
5616
5617 /// Gets the enum value as a string.
5618 ///
5619 /// Returns `None` if the enum contains an unknown value deserialized from
5620 /// the integer representation of enums.
5621 pub fn name(&self) -> std::option::Option<&str> {
5622 match self {
5623 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
5624 Self::Planned => std::option::Option::Some("PLANNED"),
5625 Self::InProgress => std::option::Option::Some("IN_PROGRESS"),
5626 Self::Reconciled => std::option::Option::Some("RECONCILED"),
5627 Self::Failed => std::option::Option::Some("FAILED"),
5628 Self::UnknownValue(u) => u.0.name(),
5629 }
5630 }
5631 }
5632
5633 impl std::default::Default for State {
5634 fn default() -> Self {
5635 use std::convert::From;
5636 Self::from(0)
5637 }
5638 }
5639
5640 impl std::fmt::Display for State {
5641 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5642 wkt::internal::display_enum(f, self.name(), self.value())
5643 }
5644 }
5645
5646 impl std::convert::From<i32> for State {
5647 fn from(value: i32) -> Self {
5648 match value {
5649 0 => Self::Unspecified,
5650 1 => Self::Planned,
5651 2 => Self::InProgress,
5652 3 => Self::Reconciled,
5653 4 => Self::Failed,
5654 _ => Self::UnknownValue(state::UnknownValue(
5655 wkt::internal::UnknownEnumValue::Integer(value),
5656 )),
5657 }
5658 }
5659 }
5660
5661 impl std::convert::From<&str> for State {
5662 fn from(value: &str) -> Self {
5663 use std::string::ToString;
5664 match value {
5665 "STATE_UNSPECIFIED" => Self::Unspecified,
5666 "PLANNED" => Self::Planned,
5667 "IN_PROGRESS" => Self::InProgress,
5668 "RECONCILED" => Self::Reconciled,
5669 "FAILED" => Self::Failed,
5670 _ => Self::UnknownValue(state::UnknownValue(
5671 wkt::internal::UnknownEnumValue::String(value.to_string()),
5672 )),
5673 }
5674 }
5675 }
5676
5677 impl serde::ser::Serialize for State {
5678 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5679 where
5680 S: serde::Serializer,
5681 {
5682 match self {
5683 Self::Unspecified => serializer.serialize_i32(0),
5684 Self::Planned => serializer.serialize_i32(1),
5685 Self::InProgress => serializer.serialize_i32(2),
5686 Self::Reconciled => serializer.serialize_i32(3),
5687 Self::Failed => serializer.serialize_i32(4),
5688 Self::UnknownValue(u) => u.0.serialize(serializer),
5689 }
5690 }
5691 }
5692
5693 impl<'de> serde::de::Deserialize<'de> for State {
5694 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5695 where
5696 D: serde::Deserializer<'de>,
5697 {
5698 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
5699 ".google.cloud.config.v1.Resource.State",
5700 ))
5701 }
5702 }
5703}
5704
5705/// Terraform info of a Resource.
5706#[derive(Clone, Default, PartialEq)]
5707#[non_exhaustive]
5708pub struct ResourceTerraformInfo {
5709 /// TF resource address that uniquely identifies this resource within this
5710 /// deployment.
5711 pub address: std::string::String,
5712
5713 /// TF resource type
5714 pub r#type: std::string::String,
5715
5716 /// ID attribute of the TF resource
5717 pub id: std::string::String,
5718
5719 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5720}
5721
5722impl ResourceTerraformInfo {
5723 /// Creates a new default instance.
5724 pub fn new() -> Self {
5725 std::default::Default::default()
5726 }
5727
5728 /// Sets the value of [address][crate::model::ResourceTerraformInfo::address].
5729 ///
5730 /// # Example
5731 /// ```ignore,no_run
5732 /// # use google_cloud_config_v1::model::ResourceTerraformInfo;
5733 /// let x = ResourceTerraformInfo::new().set_address("example");
5734 /// ```
5735 pub fn set_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5736 self.address = v.into();
5737 self
5738 }
5739
5740 /// Sets the value of [r#type][crate::model::ResourceTerraformInfo::type].
5741 ///
5742 /// # Example
5743 /// ```ignore,no_run
5744 /// # use google_cloud_config_v1::model::ResourceTerraformInfo;
5745 /// let x = ResourceTerraformInfo::new().set_type("example");
5746 /// ```
5747 pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5748 self.r#type = v.into();
5749 self
5750 }
5751
5752 /// Sets the value of [id][crate::model::ResourceTerraformInfo::id].
5753 ///
5754 /// # Example
5755 /// ```ignore,no_run
5756 /// # use google_cloud_config_v1::model::ResourceTerraformInfo;
5757 /// let x = ResourceTerraformInfo::new().set_id("example");
5758 /// ```
5759 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5760 self.id = v.into();
5761 self
5762 }
5763}
5764
5765impl wkt::message::Message for ResourceTerraformInfo {
5766 fn typename() -> &'static str {
5767 "type.googleapis.com/google.cloud.config.v1.ResourceTerraformInfo"
5768 }
5769}
5770
5771/// CAI info of a Resource.
5772#[derive(Clone, Default, PartialEq)]
5773#[non_exhaustive]
5774pub struct ResourceCAIInfo {
5775 /// CAI resource name in the format following
5776 /// <https://cloud.google.com/apis/design/resource_names#full_resource_name>
5777 pub full_resource_name: std::string::String,
5778
5779 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5780}
5781
5782impl ResourceCAIInfo {
5783 /// Creates a new default instance.
5784 pub fn new() -> Self {
5785 std::default::Default::default()
5786 }
5787
5788 /// Sets the value of [full_resource_name][crate::model::ResourceCAIInfo::full_resource_name].
5789 ///
5790 /// # Example
5791 /// ```ignore,no_run
5792 /// # use google_cloud_config_v1::model::ResourceCAIInfo;
5793 /// let x = ResourceCAIInfo::new().set_full_resource_name("example");
5794 /// ```
5795 pub fn set_full_resource_name<T: std::convert::Into<std::string::String>>(
5796 mut self,
5797 v: T,
5798 ) -> Self {
5799 self.full_resource_name = v.into();
5800 self
5801 }
5802}
5803
5804impl wkt::message::Message for ResourceCAIInfo {
5805 fn typename() -> &'static str {
5806 "type.googleapis.com/google.cloud.config.v1.ResourceCAIInfo"
5807 }
5808}
5809
5810/// A request to get a Resource from a 'GetResource' call.
5811#[derive(Clone, Default, PartialEq)]
5812#[non_exhaustive]
5813pub struct GetResourceRequest {
5814 /// Required. The name of the Resource in the format:
5815 /// 'projects/{project_id}/locations/{location}/deployments/{deployment}/revisions/{revision}/resource/{resource}'.
5816 pub name: std::string::String,
5817
5818 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5819}
5820
5821impl GetResourceRequest {
5822 /// Creates a new default instance.
5823 pub fn new() -> Self {
5824 std::default::Default::default()
5825 }
5826
5827 /// Sets the value of [name][crate::model::GetResourceRequest::name].
5828 ///
5829 /// # Example
5830 /// ```ignore,no_run
5831 /// # use google_cloud_config_v1::model::GetResourceRequest;
5832 /// # let project_id = "project_id";
5833 /// # let location_id = "location_id";
5834 /// # let deployment_id = "deployment_id";
5835 /// # let revision_id = "revision_id";
5836 /// # let resource_id = "resource_id";
5837 /// let x = GetResourceRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/deployments/{deployment_id}/revisions/{revision_id}/resources/{resource_id}"));
5838 /// ```
5839 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5840 self.name = v.into();
5841 self
5842 }
5843}
5844
5845impl wkt::message::Message for GetResourceRequest {
5846 fn typename() -> &'static str {
5847 "type.googleapis.com/google.cloud.config.v1.GetResourceRequest"
5848 }
5849}
5850
5851/// A request to list Resources passed to a 'ListResources' call.
5852#[derive(Clone, Default, PartialEq)]
5853#[non_exhaustive]
5854pub struct ListResourcesRequest {
5855 /// Required. The parent in whose context the Resources are listed. The parent
5856 /// value is in the format:
5857 /// 'projects/{project_id}/locations/{location}/deployments/{deployment}/revisions/{revision}'.
5858 pub parent: std::string::String,
5859
5860 /// When requesting a page of resources, 'page_size' specifies number of
5861 /// resources to return. If unspecified, at most 500 will be returned. The
5862 /// maximum value is 1000.
5863 pub page_size: i32,
5864
5865 /// Token returned by previous call to 'ListResources' which specifies the
5866 /// position in the list from where to continue listing the resources.
5867 pub page_token: std::string::String,
5868
5869 /// Lists the Resources that match the filter expression. A filter
5870 /// expression filters the resources listed in the response. The expression
5871 /// must be of the form '{field} {operator} {value}' where operators: '<', '>',
5872 /// '<=',
5873 /// '>=',
5874 /// '!=', '=', ':' are supported (colon ':' represents a HAS operator which is
5875 /// roughly synonymous with equality). {field} can refer to a proto or JSON
5876 /// field, or a synthetic field. Field names can be camelCase or snake_case.
5877 ///
5878 /// Examples:
5879 ///
5880 /// - Filter by name:
5881 /// name =
5882 /// "projects/foo/locations/us-central1/deployments/dep/revisions/bar/resources/baz
5883 pub filter: std::string::String,
5884
5885 /// Field to use to sort the list.
5886 pub order_by: std::string::String,
5887
5888 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5889}
5890
5891impl ListResourcesRequest {
5892 /// Creates a new default instance.
5893 pub fn new() -> Self {
5894 std::default::Default::default()
5895 }
5896
5897 /// Sets the value of [parent][crate::model::ListResourcesRequest::parent].
5898 ///
5899 /// # Example
5900 /// ```ignore,no_run
5901 /// # use google_cloud_config_v1::model::ListResourcesRequest;
5902 /// # let project_id = "project_id";
5903 /// # let location_id = "location_id";
5904 /// # let deployment_id = "deployment_id";
5905 /// # let revision_id = "revision_id";
5906 /// let x = ListResourcesRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/deployments/{deployment_id}/revisions/{revision_id}"));
5907 /// ```
5908 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5909 self.parent = v.into();
5910 self
5911 }
5912
5913 /// Sets the value of [page_size][crate::model::ListResourcesRequest::page_size].
5914 ///
5915 /// # Example
5916 /// ```ignore,no_run
5917 /// # use google_cloud_config_v1::model::ListResourcesRequest;
5918 /// let x = ListResourcesRequest::new().set_page_size(42);
5919 /// ```
5920 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5921 self.page_size = v.into();
5922 self
5923 }
5924
5925 /// Sets the value of [page_token][crate::model::ListResourcesRequest::page_token].
5926 ///
5927 /// # Example
5928 /// ```ignore,no_run
5929 /// # use google_cloud_config_v1::model::ListResourcesRequest;
5930 /// let x = ListResourcesRequest::new().set_page_token("example");
5931 /// ```
5932 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5933 self.page_token = v.into();
5934 self
5935 }
5936
5937 /// Sets the value of [filter][crate::model::ListResourcesRequest::filter].
5938 ///
5939 /// # Example
5940 /// ```ignore,no_run
5941 /// # use google_cloud_config_v1::model::ListResourcesRequest;
5942 /// let x = ListResourcesRequest::new().set_filter("example");
5943 /// ```
5944 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5945 self.filter = v.into();
5946 self
5947 }
5948
5949 /// Sets the value of [order_by][crate::model::ListResourcesRequest::order_by].
5950 ///
5951 /// # Example
5952 /// ```ignore,no_run
5953 /// # use google_cloud_config_v1::model::ListResourcesRequest;
5954 /// let x = ListResourcesRequest::new().set_order_by("example");
5955 /// ```
5956 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5957 self.order_by = v.into();
5958 self
5959 }
5960}
5961
5962impl wkt::message::Message for ListResourcesRequest {
5963 fn typename() -> &'static str {
5964 "type.googleapis.com/google.cloud.config.v1.ListResourcesRequest"
5965 }
5966}
5967
5968/// A response to a 'ListResources' call. Contains a list of Resources.
5969#[derive(Clone, Default, PartialEq)]
5970#[non_exhaustive]
5971pub struct ListResourcesResponse {
5972 /// List of [Resources][google.cloud.config.v1.Resource].
5973 ///
5974 /// [google.cloud.config.v1.Resource]: crate::model::Resource
5975 pub resources: std::vec::Vec<crate::model::Resource>,
5976
5977 /// A token to request the next page of resources from the 'ListResources'
5978 /// method. The value of an empty string means that there are no more resources
5979 /// to return.
5980 pub next_page_token: std::string::String,
5981
5982 /// Locations that could not be reached.
5983 pub unreachable: std::vec::Vec<std::string::String>,
5984
5985 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5986}
5987
5988impl ListResourcesResponse {
5989 /// Creates a new default instance.
5990 pub fn new() -> Self {
5991 std::default::Default::default()
5992 }
5993
5994 /// Sets the value of [resources][crate::model::ListResourcesResponse::resources].
5995 ///
5996 /// # Example
5997 /// ```ignore,no_run
5998 /// # use google_cloud_config_v1::model::ListResourcesResponse;
5999 /// use google_cloud_config_v1::model::Resource;
6000 /// let x = ListResourcesResponse::new()
6001 /// .set_resources([
6002 /// Resource::default()/* use setters */,
6003 /// Resource::default()/* use (different) setters */,
6004 /// ]);
6005 /// ```
6006 pub fn set_resources<T, V>(mut self, v: T) -> Self
6007 where
6008 T: std::iter::IntoIterator<Item = V>,
6009 V: std::convert::Into<crate::model::Resource>,
6010 {
6011 use std::iter::Iterator;
6012 self.resources = v.into_iter().map(|i| i.into()).collect();
6013 self
6014 }
6015
6016 /// Sets the value of [next_page_token][crate::model::ListResourcesResponse::next_page_token].
6017 ///
6018 /// # Example
6019 /// ```ignore,no_run
6020 /// # use google_cloud_config_v1::model::ListResourcesResponse;
6021 /// let x = ListResourcesResponse::new().set_next_page_token("example");
6022 /// ```
6023 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6024 self.next_page_token = v.into();
6025 self
6026 }
6027
6028 /// Sets the value of [unreachable][crate::model::ListResourcesResponse::unreachable].
6029 ///
6030 /// # Example
6031 /// ```ignore,no_run
6032 /// # use google_cloud_config_v1::model::ListResourcesResponse;
6033 /// let x = ListResourcesResponse::new().set_unreachable(["a", "b", "c"]);
6034 /// ```
6035 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
6036 where
6037 T: std::iter::IntoIterator<Item = V>,
6038 V: std::convert::Into<std::string::String>,
6039 {
6040 use std::iter::Iterator;
6041 self.unreachable = v.into_iter().map(|i| i.into()).collect();
6042 self
6043 }
6044}
6045
6046impl wkt::message::Message for ListResourcesResponse {
6047 fn typename() -> &'static str {
6048 "type.googleapis.com/google.cloud.config.v1.ListResourcesResponse"
6049 }
6050}
6051
6052#[doc(hidden)]
6053impl google_cloud_gax::paginator::internal::PageableResponse for ListResourcesResponse {
6054 type PageItem = crate::model::Resource;
6055
6056 fn items(self) -> std::vec::Vec<Self::PageItem> {
6057 self.resources
6058 }
6059
6060 fn next_page_token(&self) -> std::string::String {
6061 use std::clone::Clone;
6062 self.next_page_token.clone()
6063 }
6064}
6065
6066/// Contains info about a Terraform state file
6067#[derive(Clone, Default, PartialEq)]
6068#[non_exhaustive]
6069pub struct Statefile {
6070 /// Output only. Cloud Storage signed URI used for downloading or uploading the
6071 /// state file.
6072 pub signed_uri: std::string::String,
6073
6074 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6075}
6076
6077impl Statefile {
6078 /// Creates a new default instance.
6079 pub fn new() -> Self {
6080 std::default::Default::default()
6081 }
6082
6083 /// Sets the value of [signed_uri][crate::model::Statefile::signed_uri].
6084 ///
6085 /// # Example
6086 /// ```ignore,no_run
6087 /// # use google_cloud_config_v1::model::Statefile;
6088 /// let x = Statefile::new().set_signed_uri("example");
6089 /// ```
6090 pub fn set_signed_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6091 self.signed_uri = v.into();
6092 self
6093 }
6094}
6095
6096impl wkt::message::Message for Statefile {
6097 fn typename() -> &'static str {
6098 "type.googleapis.com/google.cloud.config.v1.Statefile"
6099 }
6100}
6101
6102/// A request to export a state file passed to a 'ExportDeploymentStatefile'
6103/// call.
6104#[derive(Clone, Default, PartialEq)]
6105#[non_exhaustive]
6106pub struct ExportDeploymentStatefileRequest {
6107 /// Required. The parent in whose context the statefile is listed. The parent
6108 /// value is in the format:
6109 /// 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
6110 pub parent: std::string::String,
6111
6112 /// Optional. If this flag is set to true, the exported deployment state file
6113 /// will be the draft state. This will enable the draft file to be validated
6114 /// before copying it over to the working state on unlock.
6115 pub draft: bool,
6116
6117 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6118}
6119
6120impl ExportDeploymentStatefileRequest {
6121 /// Creates a new default instance.
6122 pub fn new() -> Self {
6123 std::default::Default::default()
6124 }
6125
6126 /// Sets the value of [parent][crate::model::ExportDeploymentStatefileRequest::parent].
6127 ///
6128 /// # Example
6129 /// ```ignore,no_run
6130 /// # use google_cloud_config_v1::model::ExportDeploymentStatefileRequest;
6131 /// # let project_id = "project_id";
6132 /// # let location_id = "location_id";
6133 /// # let deployment_id = "deployment_id";
6134 /// let x = ExportDeploymentStatefileRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/deployments/{deployment_id}"));
6135 /// ```
6136 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6137 self.parent = v.into();
6138 self
6139 }
6140
6141 /// Sets the value of [draft][crate::model::ExportDeploymentStatefileRequest::draft].
6142 ///
6143 /// # Example
6144 /// ```ignore,no_run
6145 /// # use google_cloud_config_v1::model::ExportDeploymentStatefileRequest;
6146 /// let x = ExportDeploymentStatefileRequest::new().set_draft(true);
6147 /// ```
6148 pub fn set_draft<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6149 self.draft = v.into();
6150 self
6151 }
6152}
6153
6154impl wkt::message::Message for ExportDeploymentStatefileRequest {
6155 fn typename() -> &'static str {
6156 "type.googleapis.com/google.cloud.config.v1.ExportDeploymentStatefileRequest"
6157 }
6158}
6159
6160/// A request to export a state file passed to a 'ExportRevisionStatefile'
6161/// call.
6162#[derive(Clone, Default, PartialEq)]
6163#[non_exhaustive]
6164pub struct ExportRevisionStatefileRequest {
6165 /// Required. The parent in whose context the statefile is listed. The parent
6166 /// value is in the format:
6167 /// 'projects/{project_id}/locations/{location}/deployments/{deployment}/revisions/{revision}'.
6168 pub parent: std::string::String,
6169
6170 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6171}
6172
6173impl ExportRevisionStatefileRequest {
6174 /// Creates a new default instance.
6175 pub fn new() -> Self {
6176 std::default::Default::default()
6177 }
6178
6179 /// Sets the value of [parent][crate::model::ExportRevisionStatefileRequest::parent].
6180 ///
6181 /// # Example
6182 /// ```ignore,no_run
6183 /// # use google_cloud_config_v1::model::ExportRevisionStatefileRequest;
6184 /// # let project_id = "project_id";
6185 /// # let location_id = "location_id";
6186 /// # let deployment_id = "deployment_id";
6187 /// # let revision_id = "revision_id";
6188 /// let x = ExportRevisionStatefileRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/deployments/{deployment_id}/revisions/{revision_id}"));
6189 /// ```
6190 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6191 self.parent = v.into();
6192 self
6193 }
6194}
6195
6196impl wkt::message::Message for ExportRevisionStatefileRequest {
6197 fn typename() -> &'static str {
6198 "type.googleapis.com/google.cloud.config.v1.ExportRevisionStatefileRequest"
6199 }
6200}
6201
6202/// A request to import a state file passed to a 'ImportStatefile' call.
6203#[derive(Clone, Default, PartialEq)]
6204#[non_exhaustive]
6205pub struct ImportStatefileRequest {
6206 /// Required. The parent in whose context the statefile is listed. The parent
6207 /// value is in the format:
6208 /// 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
6209 pub parent: std::string::String,
6210
6211 /// Required. Lock ID of the lock file to verify that the user who is importing
6212 /// the state file previously locked the Deployment.
6213 pub lock_id: i64,
6214
6215 /// Optional.
6216 pub skip_draft: bool,
6217
6218 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6219}
6220
6221impl ImportStatefileRequest {
6222 /// Creates a new default instance.
6223 pub fn new() -> Self {
6224 std::default::Default::default()
6225 }
6226
6227 /// Sets the value of [parent][crate::model::ImportStatefileRequest::parent].
6228 ///
6229 /// # Example
6230 /// ```ignore,no_run
6231 /// # use google_cloud_config_v1::model::ImportStatefileRequest;
6232 /// # let project_id = "project_id";
6233 /// # let location_id = "location_id";
6234 /// # let deployment_id = "deployment_id";
6235 /// let x = ImportStatefileRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/deployments/{deployment_id}"));
6236 /// ```
6237 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6238 self.parent = v.into();
6239 self
6240 }
6241
6242 /// Sets the value of [lock_id][crate::model::ImportStatefileRequest::lock_id].
6243 ///
6244 /// # Example
6245 /// ```ignore,no_run
6246 /// # use google_cloud_config_v1::model::ImportStatefileRequest;
6247 /// let x = ImportStatefileRequest::new().set_lock_id(42);
6248 /// ```
6249 pub fn set_lock_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
6250 self.lock_id = v.into();
6251 self
6252 }
6253
6254 /// Sets the value of [skip_draft][crate::model::ImportStatefileRequest::skip_draft].
6255 ///
6256 /// # Example
6257 /// ```ignore,no_run
6258 /// # use google_cloud_config_v1::model::ImportStatefileRequest;
6259 /// let x = ImportStatefileRequest::new().set_skip_draft(true);
6260 /// ```
6261 pub fn set_skip_draft<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6262 self.skip_draft = v.into();
6263 self
6264 }
6265}
6266
6267impl wkt::message::Message for ImportStatefileRequest {
6268 fn typename() -> &'static str {
6269 "type.googleapis.com/google.cloud.config.v1.ImportStatefileRequest"
6270 }
6271}
6272
6273/// A request to delete a state file passed to a 'DeleteStatefile' call.
6274#[derive(Clone, Default, PartialEq)]
6275#[non_exhaustive]
6276pub struct DeleteStatefileRequest {
6277 /// Required. The name of the deployment in the format:
6278 /// 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
6279 pub name: std::string::String,
6280
6281 /// Required. Lock ID of the lock file to verify that the user who is deleting
6282 /// the state file previously locked the Deployment.
6283 pub lock_id: i64,
6284
6285 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6286}
6287
6288impl DeleteStatefileRequest {
6289 /// Creates a new default instance.
6290 pub fn new() -> Self {
6291 std::default::Default::default()
6292 }
6293
6294 /// Sets the value of [name][crate::model::DeleteStatefileRequest::name].
6295 ///
6296 /// # Example
6297 /// ```ignore,no_run
6298 /// # use google_cloud_config_v1::model::DeleteStatefileRequest;
6299 /// # let project_id = "project_id";
6300 /// # let location_id = "location_id";
6301 /// # let deployment_id = "deployment_id";
6302 /// let x = DeleteStatefileRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/deployments/{deployment_id}"));
6303 /// ```
6304 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6305 self.name = v.into();
6306 self
6307 }
6308
6309 /// Sets the value of [lock_id][crate::model::DeleteStatefileRequest::lock_id].
6310 ///
6311 /// # Example
6312 /// ```ignore,no_run
6313 /// # use google_cloud_config_v1::model::DeleteStatefileRequest;
6314 /// let x = DeleteStatefileRequest::new().set_lock_id(42);
6315 /// ```
6316 pub fn set_lock_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
6317 self.lock_id = v.into();
6318 self
6319 }
6320}
6321
6322impl wkt::message::Message for DeleteStatefileRequest {
6323 fn typename() -> &'static str {
6324 "type.googleapis.com/google.cloud.config.v1.DeleteStatefileRequest"
6325 }
6326}
6327
6328/// A request to lock a deployment passed to a 'LockDeployment' call.
6329#[derive(Clone, Default, PartialEq)]
6330#[non_exhaustive]
6331pub struct LockDeploymentRequest {
6332 /// Required. The name of the deployment in the format:
6333 /// 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
6334 pub name: std::string::String,
6335
6336 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6337}
6338
6339impl LockDeploymentRequest {
6340 /// Creates a new default instance.
6341 pub fn new() -> Self {
6342 std::default::Default::default()
6343 }
6344
6345 /// Sets the value of [name][crate::model::LockDeploymentRequest::name].
6346 ///
6347 /// # Example
6348 /// ```ignore,no_run
6349 /// # use google_cloud_config_v1::model::LockDeploymentRequest;
6350 /// # let project_id = "project_id";
6351 /// # let location_id = "location_id";
6352 /// # let deployment_id = "deployment_id";
6353 /// let x = LockDeploymentRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/deployments/{deployment_id}"));
6354 /// ```
6355 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6356 self.name = v.into();
6357 self
6358 }
6359}
6360
6361impl wkt::message::Message for LockDeploymentRequest {
6362 fn typename() -> &'static str {
6363 "type.googleapis.com/google.cloud.config.v1.LockDeploymentRequest"
6364 }
6365}
6366
6367/// A request to unlock a state file passed to a 'UnlockDeployment' call.
6368#[derive(Clone, Default, PartialEq)]
6369#[non_exhaustive]
6370pub struct UnlockDeploymentRequest {
6371 /// Required. The name of the deployment in the format:
6372 /// 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
6373 pub name: std::string::String,
6374
6375 /// Required. Lock ID of the lock file to be unlocked.
6376 pub lock_id: i64,
6377
6378 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6379}
6380
6381impl UnlockDeploymentRequest {
6382 /// Creates a new default instance.
6383 pub fn new() -> Self {
6384 std::default::Default::default()
6385 }
6386
6387 /// Sets the value of [name][crate::model::UnlockDeploymentRequest::name].
6388 ///
6389 /// # Example
6390 /// ```ignore,no_run
6391 /// # use google_cloud_config_v1::model::UnlockDeploymentRequest;
6392 /// # let project_id = "project_id";
6393 /// # let location_id = "location_id";
6394 /// # let deployment_id = "deployment_id";
6395 /// let x = UnlockDeploymentRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/deployments/{deployment_id}"));
6396 /// ```
6397 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6398 self.name = v.into();
6399 self
6400 }
6401
6402 /// Sets the value of [lock_id][crate::model::UnlockDeploymentRequest::lock_id].
6403 ///
6404 /// # Example
6405 /// ```ignore,no_run
6406 /// # use google_cloud_config_v1::model::UnlockDeploymentRequest;
6407 /// let x = UnlockDeploymentRequest::new().set_lock_id(42);
6408 /// ```
6409 pub fn set_lock_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
6410 self.lock_id = v.into();
6411 self
6412 }
6413}
6414
6415impl wkt::message::Message for UnlockDeploymentRequest {
6416 fn typename() -> &'static str {
6417 "type.googleapis.com/google.cloud.config.v1.UnlockDeploymentRequest"
6418 }
6419}
6420
6421/// A request to get a state file lock info passed to a 'ExportLockInfo' call.
6422#[derive(Clone, Default, PartialEq)]
6423#[non_exhaustive]
6424pub struct ExportLockInfoRequest {
6425 /// Required. The name of the deployment in the format:
6426 /// 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
6427 pub name: std::string::String,
6428
6429 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6430}
6431
6432impl ExportLockInfoRequest {
6433 /// Creates a new default instance.
6434 pub fn new() -> Self {
6435 std::default::Default::default()
6436 }
6437
6438 /// Sets the value of [name][crate::model::ExportLockInfoRequest::name].
6439 ///
6440 /// # Example
6441 /// ```ignore,no_run
6442 /// # use google_cloud_config_v1::model::ExportLockInfoRequest;
6443 /// # let project_id = "project_id";
6444 /// # let location_id = "location_id";
6445 /// # let deployment_id = "deployment_id";
6446 /// let x = ExportLockInfoRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/deployments/{deployment_id}"));
6447 /// ```
6448 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6449 self.name = v.into();
6450 self
6451 }
6452}
6453
6454impl wkt::message::Message for ExportLockInfoRequest {
6455 fn typename() -> &'static str {
6456 "type.googleapis.com/google.cloud.config.v1.ExportLockInfoRequest"
6457 }
6458}
6459
6460/// Details about the lock which locked the deployment.
6461#[derive(Clone, Default, PartialEq)]
6462#[non_exhaustive]
6463pub struct LockInfo {
6464 /// Unique ID for the lock to be overridden with generation ID in the backend.
6465 pub lock_id: i64,
6466
6467 /// Terraform operation, provided by the caller.
6468 pub operation: std::string::String,
6469
6470 /// Extra information to store with the lock, provided by the caller.
6471 pub info: std::string::String,
6472
6473 /// user@hostname when available
6474 pub who: std::string::String,
6475
6476 /// Terraform version
6477 pub version: std::string::String,
6478
6479 /// Time that the lock was taken.
6480 pub create_time: std::option::Option<wkt::Timestamp>,
6481
6482 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6483}
6484
6485impl LockInfo {
6486 /// Creates a new default instance.
6487 pub fn new() -> Self {
6488 std::default::Default::default()
6489 }
6490
6491 /// Sets the value of [lock_id][crate::model::LockInfo::lock_id].
6492 ///
6493 /// # Example
6494 /// ```ignore,no_run
6495 /// # use google_cloud_config_v1::model::LockInfo;
6496 /// let x = LockInfo::new().set_lock_id(42);
6497 /// ```
6498 pub fn set_lock_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
6499 self.lock_id = v.into();
6500 self
6501 }
6502
6503 /// Sets the value of [operation][crate::model::LockInfo::operation].
6504 ///
6505 /// # Example
6506 /// ```ignore,no_run
6507 /// # use google_cloud_config_v1::model::LockInfo;
6508 /// let x = LockInfo::new().set_operation("example");
6509 /// ```
6510 pub fn set_operation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6511 self.operation = v.into();
6512 self
6513 }
6514
6515 /// Sets the value of [info][crate::model::LockInfo::info].
6516 ///
6517 /// # Example
6518 /// ```ignore,no_run
6519 /// # use google_cloud_config_v1::model::LockInfo;
6520 /// let x = LockInfo::new().set_info("example");
6521 /// ```
6522 pub fn set_info<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6523 self.info = v.into();
6524 self
6525 }
6526
6527 /// Sets the value of [who][crate::model::LockInfo::who].
6528 ///
6529 /// # Example
6530 /// ```ignore,no_run
6531 /// # use google_cloud_config_v1::model::LockInfo;
6532 /// let x = LockInfo::new().set_who("example");
6533 /// ```
6534 pub fn set_who<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6535 self.who = v.into();
6536 self
6537 }
6538
6539 /// Sets the value of [version][crate::model::LockInfo::version].
6540 ///
6541 /// # Example
6542 /// ```ignore,no_run
6543 /// # use google_cloud_config_v1::model::LockInfo;
6544 /// let x = LockInfo::new().set_version("example");
6545 /// ```
6546 pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6547 self.version = v.into();
6548 self
6549 }
6550
6551 /// Sets the value of [create_time][crate::model::LockInfo::create_time].
6552 ///
6553 /// # Example
6554 /// ```ignore,no_run
6555 /// # use google_cloud_config_v1::model::LockInfo;
6556 /// use wkt::Timestamp;
6557 /// let x = LockInfo::new().set_create_time(Timestamp::default()/* use setters */);
6558 /// ```
6559 pub fn set_create_time<T>(mut self, v: T) -> Self
6560 where
6561 T: std::convert::Into<wkt::Timestamp>,
6562 {
6563 self.create_time = std::option::Option::Some(v.into());
6564 self
6565 }
6566
6567 /// Sets or clears the value of [create_time][crate::model::LockInfo::create_time].
6568 ///
6569 /// # Example
6570 /// ```ignore,no_run
6571 /// # use google_cloud_config_v1::model::LockInfo;
6572 /// use wkt::Timestamp;
6573 /// let x = LockInfo::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
6574 /// let x = LockInfo::new().set_or_clear_create_time(None::<Timestamp>);
6575 /// ```
6576 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
6577 where
6578 T: std::convert::Into<wkt::Timestamp>,
6579 {
6580 self.create_time = v.map(|x| x.into());
6581 self
6582 }
6583}
6584
6585impl wkt::message::Message for LockInfo {
6586 fn typename() -> &'static str {
6587 "type.googleapis.com/google.cloud.config.v1.LockInfo"
6588 }
6589}
6590
6591/// A preview represents a set of actions Infra Manager would perform
6592/// to move the resources towards the desired state as specified in the
6593/// configuration.
6594#[derive(Clone, Default, PartialEq)]
6595#[non_exhaustive]
6596pub struct Preview {
6597 /// Identifier. Resource name of the preview. Resource name can be user
6598 /// provided or server generated ID if unspecified. Format:
6599 /// `projects/{project}/locations/{location}/previews/{preview}`
6600 pub name: std::string::String,
6601
6602 /// Output only. Time the preview was created.
6603 pub create_time: std::option::Option<wkt::Timestamp>,
6604
6605 /// Optional. User-defined labels for the preview.
6606 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
6607
6608 /// Output only. Current state of the preview.
6609 pub state: crate::model::preview::State,
6610
6611 /// Optional. Deployment reference. If specified, the preview will be performed
6612 /// using the provided deployment's current state and use any relevant fields
6613 /// from the deployment unless explicitly specified in the preview create
6614 /// request.
6615 pub deployment: std::string::String,
6616
6617 /// Optional. Current mode of preview.
6618 pub preview_mode: crate::model::preview::PreviewMode,
6619
6620 /// Required. User-specified Service Account (SA) credentials to be used when
6621 /// previewing resources.
6622 /// Format: `projects/{projectID}/serviceAccounts/{serviceAccount}`
6623 pub service_account: std::string::String,
6624
6625 /// User-defined location of Cloud Build logs, artifacts, and
6626 /// in Google Cloud Storage.
6627 /// Format: `gs://{bucket}/{folder}`
6628 /// A default bucket will be bootstrapped if the field is not set or empty
6629 /// Default Bucket Format: `gs://<project number>-<region>-blueprint-config`
6630 /// Constraints:
6631 ///
6632 /// - The bucket needs to be in the same project as the deployment
6633 /// - The path cannot be within the path of `gcs_source`
6634 /// If omitted and deployment resource ref provided has artifacts_gcs_bucket
6635 /// defined, that artifact bucket is used.
6636 pub artifacts_gcs_bucket: std::option::Option<std::string::String>,
6637
6638 /// The user-specified Worker Pool resource in which the Cloud Build job will
6639 /// execute.
6640 /// Format projects/{project}/locations/{location}/workerPools/{workerPoolId}
6641 /// If this field is unspecified, the default Cloud Build worker pool will be
6642 /// used. If omitted and deployment resource ref provided has worker_pool
6643 /// defined, that worker pool is used.
6644 pub worker_pool: std::option::Option<std::string::String>,
6645
6646 /// Output only. Code describing any errors that may have occurred.
6647 pub error_code: crate::model::preview::ErrorCode,
6648
6649 /// Output only. Additional information regarding the current state.
6650 pub error_status: std::option::Option<google_cloud_rpc::model::Status>,
6651
6652 /// Output only. Cloud Build instance UUID associated with this preview.
6653 pub build: std::string::String,
6654
6655 /// Output only. Summary of errors encountered during Terraform preview.
6656 /// It has a size limit of 10, i.e. only top 10 errors will be summarized here.
6657 pub tf_errors: std::vec::Vec<crate::model::TerraformError>,
6658
6659 /// Output only. Link to tf-error.ndjson file, which contains the full list of
6660 /// the errors encountered during a Terraform preview.
6661 /// Format: `gs://{bucket}/{object}`.
6662 pub error_logs: std::string::String,
6663
6664 /// Output only. Artifacts from preview.
6665 pub preview_artifacts: std::option::Option<crate::model::PreviewArtifacts>,
6666
6667 /// Output only. Location of preview logs in `gs://{bucket}/{object}` format.
6668 pub logs: std::string::String,
6669
6670 /// Output only. The current Terraform version set on the preview.
6671 /// It is in the format of "Major.Minor.Patch", for example, "1.3.10".
6672 pub tf_version: std::string::String,
6673
6674 /// The user-specified Terraform version constraint.
6675 /// Example: "=1.3.10".
6676 pub tf_version_constraint: std::option::Option<std::string::String>,
6677
6678 /// Optional. Arbitrary key-value metadata storage e.g. to help client tools
6679 /// identify preview during automation. See
6680 /// <https://google.aip.dev/148#annotations> for details on format and size
6681 /// limitations.
6682 pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
6683
6684 /// Optional. This field specifies the provider configurations.
6685 pub provider_config: std::option::Option<crate::model::ProviderConfig>,
6686
6687 /// Blueprint to preview.
6688 pub blueprint: std::option::Option<crate::model::preview::Blueprint>,
6689
6690 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6691}
6692
6693impl Preview {
6694 /// Creates a new default instance.
6695 pub fn new() -> Self {
6696 std::default::Default::default()
6697 }
6698
6699 /// Sets the value of [name][crate::model::Preview::name].
6700 ///
6701 /// # Example
6702 /// ```ignore,no_run
6703 /// # use google_cloud_config_v1::model::Preview;
6704 /// # let project_id = "project_id";
6705 /// # let location_id = "location_id";
6706 /// # let preview_id = "preview_id";
6707 /// let x = Preview::new().set_name(format!("projects/{project_id}/locations/{location_id}/previews/{preview_id}"));
6708 /// ```
6709 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6710 self.name = v.into();
6711 self
6712 }
6713
6714 /// Sets the value of [create_time][crate::model::Preview::create_time].
6715 ///
6716 /// # Example
6717 /// ```ignore,no_run
6718 /// # use google_cloud_config_v1::model::Preview;
6719 /// use wkt::Timestamp;
6720 /// let x = Preview::new().set_create_time(Timestamp::default()/* use setters */);
6721 /// ```
6722 pub fn set_create_time<T>(mut self, v: T) -> Self
6723 where
6724 T: std::convert::Into<wkt::Timestamp>,
6725 {
6726 self.create_time = std::option::Option::Some(v.into());
6727 self
6728 }
6729
6730 /// Sets or clears the value of [create_time][crate::model::Preview::create_time].
6731 ///
6732 /// # Example
6733 /// ```ignore,no_run
6734 /// # use google_cloud_config_v1::model::Preview;
6735 /// use wkt::Timestamp;
6736 /// let x = Preview::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
6737 /// let x = Preview::new().set_or_clear_create_time(None::<Timestamp>);
6738 /// ```
6739 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
6740 where
6741 T: std::convert::Into<wkt::Timestamp>,
6742 {
6743 self.create_time = v.map(|x| x.into());
6744 self
6745 }
6746
6747 /// Sets the value of [labels][crate::model::Preview::labels].
6748 ///
6749 /// # Example
6750 /// ```ignore,no_run
6751 /// # use google_cloud_config_v1::model::Preview;
6752 /// let x = Preview::new().set_labels([
6753 /// ("key0", "abc"),
6754 /// ("key1", "xyz"),
6755 /// ]);
6756 /// ```
6757 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
6758 where
6759 T: std::iter::IntoIterator<Item = (K, V)>,
6760 K: std::convert::Into<std::string::String>,
6761 V: std::convert::Into<std::string::String>,
6762 {
6763 use std::iter::Iterator;
6764 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
6765 self
6766 }
6767
6768 /// Sets the value of [state][crate::model::Preview::state].
6769 ///
6770 /// # Example
6771 /// ```ignore,no_run
6772 /// # use google_cloud_config_v1::model::Preview;
6773 /// use google_cloud_config_v1::model::preview::State;
6774 /// let x0 = Preview::new().set_state(State::Creating);
6775 /// let x1 = Preview::new().set_state(State::Succeeded);
6776 /// let x2 = Preview::new().set_state(State::Applying);
6777 /// ```
6778 pub fn set_state<T: std::convert::Into<crate::model::preview::State>>(mut self, v: T) -> Self {
6779 self.state = v.into();
6780 self
6781 }
6782
6783 /// Sets the value of [deployment][crate::model::Preview::deployment].
6784 ///
6785 /// # Example
6786 /// ```ignore,no_run
6787 /// # use google_cloud_config_v1::model::Preview;
6788 /// # let project_id = "project_id";
6789 /// # let location_id = "location_id";
6790 /// # let deployment_id = "deployment_id";
6791 /// let x = Preview::new().set_deployment(format!("projects/{project_id}/locations/{location_id}/deployments/{deployment_id}"));
6792 /// ```
6793 pub fn set_deployment<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6794 self.deployment = v.into();
6795 self
6796 }
6797
6798 /// Sets the value of [preview_mode][crate::model::Preview::preview_mode].
6799 ///
6800 /// # Example
6801 /// ```ignore,no_run
6802 /// # use google_cloud_config_v1::model::Preview;
6803 /// use google_cloud_config_v1::model::preview::PreviewMode;
6804 /// let x0 = Preview::new().set_preview_mode(PreviewMode::Default);
6805 /// let x1 = Preview::new().set_preview_mode(PreviewMode::Delete);
6806 /// ```
6807 pub fn set_preview_mode<T: std::convert::Into<crate::model::preview::PreviewMode>>(
6808 mut self,
6809 v: T,
6810 ) -> Self {
6811 self.preview_mode = v.into();
6812 self
6813 }
6814
6815 /// Sets the value of [service_account][crate::model::Preview::service_account].
6816 ///
6817 /// # Example
6818 /// ```ignore,no_run
6819 /// # use google_cloud_config_v1::model::Preview;
6820 /// let x = Preview::new().set_service_account("example");
6821 /// ```
6822 pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6823 self.service_account = v.into();
6824 self
6825 }
6826
6827 /// Sets the value of [artifacts_gcs_bucket][crate::model::Preview::artifacts_gcs_bucket].
6828 ///
6829 /// # Example
6830 /// ```ignore,no_run
6831 /// # use google_cloud_config_v1::model::Preview;
6832 /// let x = Preview::new().set_artifacts_gcs_bucket("example");
6833 /// ```
6834 pub fn set_artifacts_gcs_bucket<T>(mut self, v: T) -> Self
6835 where
6836 T: std::convert::Into<std::string::String>,
6837 {
6838 self.artifacts_gcs_bucket = std::option::Option::Some(v.into());
6839 self
6840 }
6841
6842 /// Sets or clears the value of [artifacts_gcs_bucket][crate::model::Preview::artifacts_gcs_bucket].
6843 ///
6844 /// # Example
6845 /// ```ignore,no_run
6846 /// # use google_cloud_config_v1::model::Preview;
6847 /// let x = Preview::new().set_or_clear_artifacts_gcs_bucket(Some("example"));
6848 /// let x = Preview::new().set_or_clear_artifacts_gcs_bucket(None::<String>);
6849 /// ```
6850 pub fn set_or_clear_artifacts_gcs_bucket<T>(mut self, v: std::option::Option<T>) -> Self
6851 where
6852 T: std::convert::Into<std::string::String>,
6853 {
6854 self.artifacts_gcs_bucket = v.map(|x| x.into());
6855 self
6856 }
6857
6858 /// Sets the value of [worker_pool][crate::model::Preview::worker_pool].
6859 ///
6860 /// # Example
6861 /// ```ignore,no_run
6862 /// # use google_cloud_config_v1::model::Preview;
6863 /// let x = Preview::new().set_worker_pool("example");
6864 /// ```
6865 pub fn set_worker_pool<T>(mut self, v: T) -> Self
6866 where
6867 T: std::convert::Into<std::string::String>,
6868 {
6869 self.worker_pool = std::option::Option::Some(v.into());
6870 self
6871 }
6872
6873 /// Sets or clears the value of [worker_pool][crate::model::Preview::worker_pool].
6874 ///
6875 /// # Example
6876 /// ```ignore,no_run
6877 /// # use google_cloud_config_v1::model::Preview;
6878 /// let x = Preview::new().set_or_clear_worker_pool(Some("example"));
6879 /// let x = Preview::new().set_or_clear_worker_pool(None::<String>);
6880 /// ```
6881 pub fn set_or_clear_worker_pool<T>(mut self, v: std::option::Option<T>) -> Self
6882 where
6883 T: std::convert::Into<std::string::String>,
6884 {
6885 self.worker_pool = v.map(|x| x.into());
6886 self
6887 }
6888
6889 /// Sets the value of [error_code][crate::model::Preview::error_code].
6890 ///
6891 /// # Example
6892 /// ```ignore,no_run
6893 /// # use google_cloud_config_v1::model::Preview;
6894 /// use google_cloud_config_v1::model::preview::ErrorCode;
6895 /// let x0 = Preview::new().set_error_code(ErrorCode::CloudBuildPermissionDenied);
6896 /// let x1 = Preview::new().set_error_code(ErrorCode::BucketCreationPermissionDenied);
6897 /// let x2 = Preview::new().set_error_code(ErrorCode::BucketCreationFailed);
6898 /// ```
6899 pub fn set_error_code<T: std::convert::Into<crate::model::preview::ErrorCode>>(
6900 mut self,
6901 v: T,
6902 ) -> Self {
6903 self.error_code = v.into();
6904 self
6905 }
6906
6907 /// Sets the value of [error_status][crate::model::Preview::error_status].
6908 ///
6909 /// # Example
6910 /// ```ignore,no_run
6911 /// # use google_cloud_config_v1::model::Preview;
6912 /// use google_cloud_rpc::model::Status;
6913 /// let x = Preview::new().set_error_status(Status::default()/* use setters */);
6914 /// ```
6915 pub fn set_error_status<T>(mut self, v: T) -> Self
6916 where
6917 T: std::convert::Into<google_cloud_rpc::model::Status>,
6918 {
6919 self.error_status = std::option::Option::Some(v.into());
6920 self
6921 }
6922
6923 /// Sets or clears the value of [error_status][crate::model::Preview::error_status].
6924 ///
6925 /// # Example
6926 /// ```ignore,no_run
6927 /// # use google_cloud_config_v1::model::Preview;
6928 /// use google_cloud_rpc::model::Status;
6929 /// let x = Preview::new().set_or_clear_error_status(Some(Status::default()/* use setters */));
6930 /// let x = Preview::new().set_or_clear_error_status(None::<Status>);
6931 /// ```
6932 pub fn set_or_clear_error_status<T>(mut self, v: std::option::Option<T>) -> Self
6933 where
6934 T: std::convert::Into<google_cloud_rpc::model::Status>,
6935 {
6936 self.error_status = v.map(|x| x.into());
6937 self
6938 }
6939
6940 /// Sets the value of [build][crate::model::Preview::build].
6941 ///
6942 /// # Example
6943 /// ```ignore,no_run
6944 /// # use google_cloud_config_v1::model::Preview;
6945 /// let x = Preview::new().set_build("example");
6946 /// ```
6947 pub fn set_build<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6948 self.build = v.into();
6949 self
6950 }
6951
6952 /// Sets the value of [tf_errors][crate::model::Preview::tf_errors].
6953 ///
6954 /// # Example
6955 /// ```ignore,no_run
6956 /// # use google_cloud_config_v1::model::Preview;
6957 /// use google_cloud_config_v1::model::TerraformError;
6958 /// let x = Preview::new()
6959 /// .set_tf_errors([
6960 /// TerraformError::default()/* use setters */,
6961 /// TerraformError::default()/* use (different) setters */,
6962 /// ]);
6963 /// ```
6964 pub fn set_tf_errors<T, V>(mut self, v: T) -> Self
6965 where
6966 T: std::iter::IntoIterator<Item = V>,
6967 V: std::convert::Into<crate::model::TerraformError>,
6968 {
6969 use std::iter::Iterator;
6970 self.tf_errors = v.into_iter().map(|i| i.into()).collect();
6971 self
6972 }
6973
6974 /// Sets the value of [error_logs][crate::model::Preview::error_logs].
6975 ///
6976 /// # Example
6977 /// ```ignore,no_run
6978 /// # use google_cloud_config_v1::model::Preview;
6979 /// let x = Preview::new().set_error_logs("example");
6980 /// ```
6981 pub fn set_error_logs<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6982 self.error_logs = v.into();
6983 self
6984 }
6985
6986 /// Sets the value of [preview_artifacts][crate::model::Preview::preview_artifacts].
6987 ///
6988 /// # Example
6989 /// ```ignore,no_run
6990 /// # use google_cloud_config_v1::model::Preview;
6991 /// use google_cloud_config_v1::model::PreviewArtifacts;
6992 /// let x = Preview::new().set_preview_artifacts(PreviewArtifacts::default()/* use setters */);
6993 /// ```
6994 pub fn set_preview_artifacts<T>(mut self, v: T) -> Self
6995 where
6996 T: std::convert::Into<crate::model::PreviewArtifacts>,
6997 {
6998 self.preview_artifacts = std::option::Option::Some(v.into());
6999 self
7000 }
7001
7002 /// Sets or clears the value of [preview_artifacts][crate::model::Preview::preview_artifacts].
7003 ///
7004 /// # Example
7005 /// ```ignore,no_run
7006 /// # use google_cloud_config_v1::model::Preview;
7007 /// use google_cloud_config_v1::model::PreviewArtifacts;
7008 /// let x = Preview::new().set_or_clear_preview_artifacts(Some(PreviewArtifacts::default()/* use setters */));
7009 /// let x = Preview::new().set_or_clear_preview_artifacts(None::<PreviewArtifacts>);
7010 /// ```
7011 pub fn set_or_clear_preview_artifacts<T>(mut self, v: std::option::Option<T>) -> Self
7012 where
7013 T: std::convert::Into<crate::model::PreviewArtifacts>,
7014 {
7015 self.preview_artifacts = v.map(|x| x.into());
7016 self
7017 }
7018
7019 /// Sets the value of [logs][crate::model::Preview::logs].
7020 ///
7021 /// # Example
7022 /// ```ignore,no_run
7023 /// # use google_cloud_config_v1::model::Preview;
7024 /// let x = Preview::new().set_logs("example");
7025 /// ```
7026 pub fn set_logs<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7027 self.logs = v.into();
7028 self
7029 }
7030
7031 /// Sets the value of [tf_version][crate::model::Preview::tf_version].
7032 ///
7033 /// # Example
7034 /// ```ignore,no_run
7035 /// # use google_cloud_config_v1::model::Preview;
7036 /// let x = Preview::new().set_tf_version("example");
7037 /// ```
7038 pub fn set_tf_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7039 self.tf_version = v.into();
7040 self
7041 }
7042
7043 /// Sets the value of [tf_version_constraint][crate::model::Preview::tf_version_constraint].
7044 ///
7045 /// # Example
7046 /// ```ignore,no_run
7047 /// # use google_cloud_config_v1::model::Preview;
7048 /// let x = Preview::new().set_tf_version_constraint("example");
7049 /// ```
7050 pub fn set_tf_version_constraint<T>(mut self, v: T) -> Self
7051 where
7052 T: std::convert::Into<std::string::String>,
7053 {
7054 self.tf_version_constraint = std::option::Option::Some(v.into());
7055 self
7056 }
7057
7058 /// Sets or clears the value of [tf_version_constraint][crate::model::Preview::tf_version_constraint].
7059 ///
7060 /// # Example
7061 /// ```ignore,no_run
7062 /// # use google_cloud_config_v1::model::Preview;
7063 /// let x = Preview::new().set_or_clear_tf_version_constraint(Some("example"));
7064 /// let x = Preview::new().set_or_clear_tf_version_constraint(None::<String>);
7065 /// ```
7066 pub fn set_or_clear_tf_version_constraint<T>(mut self, v: std::option::Option<T>) -> Self
7067 where
7068 T: std::convert::Into<std::string::String>,
7069 {
7070 self.tf_version_constraint = v.map(|x| x.into());
7071 self
7072 }
7073
7074 /// Sets the value of [annotations][crate::model::Preview::annotations].
7075 ///
7076 /// # Example
7077 /// ```ignore,no_run
7078 /// # use google_cloud_config_v1::model::Preview;
7079 /// let x = Preview::new().set_annotations([
7080 /// ("key0", "abc"),
7081 /// ("key1", "xyz"),
7082 /// ]);
7083 /// ```
7084 pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
7085 where
7086 T: std::iter::IntoIterator<Item = (K, V)>,
7087 K: std::convert::Into<std::string::String>,
7088 V: std::convert::Into<std::string::String>,
7089 {
7090 use std::iter::Iterator;
7091 self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7092 self
7093 }
7094
7095 /// Sets the value of [provider_config][crate::model::Preview::provider_config].
7096 ///
7097 /// # Example
7098 /// ```ignore,no_run
7099 /// # use google_cloud_config_v1::model::Preview;
7100 /// use google_cloud_config_v1::model::ProviderConfig;
7101 /// let x = Preview::new().set_provider_config(ProviderConfig::default()/* use setters */);
7102 /// ```
7103 pub fn set_provider_config<T>(mut self, v: T) -> Self
7104 where
7105 T: std::convert::Into<crate::model::ProviderConfig>,
7106 {
7107 self.provider_config = std::option::Option::Some(v.into());
7108 self
7109 }
7110
7111 /// Sets or clears the value of [provider_config][crate::model::Preview::provider_config].
7112 ///
7113 /// # Example
7114 /// ```ignore,no_run
7115 /// # use google_cloud_config_v1::model::Preview;
7116 /// use google_cloud_config_v1::model::ProviderConfig;
7117 /// let x = Preview::new().set_or_clear_provider_config(Some(ProviderConfig::default()/* use setters */));
7118 /// let x = Preview::new().set_or_clear_provider_config(None::<ProviderConfig>);
7119 /// ```
7120 pub fn set_or_clear_provider_config<T>(mut self, v: std::option::Option<T>) -> Self
7121 where
7122 T: std::convert::Into<crate::model::ProviderConfig>,
7123 {
7124 self.provider_config = v.map(|x| x.into());
7125 self
7126 }
7127
7128 /// Sets the value of [blueprint][crate::model::Preview::blueprint].
7129 ///
7130 /// Note that all the setters affecting `blueprint` are mutually
7131 /// exclusive.
7132 ///
7133 /// # Example
7134 /// ```ignore,no_run
7135 /// # use google_cloud_config_v1::model::Preview;
7136 /// use google_cloud_config_v1::model::TerraformBlueprint;
7137 /// let x = Preview::new().set_blueprint(Some(
7138 /// google_cloud_config_v1::model::preview::Blueprint::TerraformBlueprint(TerraformBlueprint::default().into())));
7139 /// ```
7140 pub fn set_blueprint<
7141 T: std::convert::Into<std::option::Option<crate::model::preview::Blueprint>>,
7142 >(
7143 mut self,
7144 v: T,
7145 ) -> Self {
7146 self.blueprint = v.into();
7147 self
7148 }
7149
7150 /// The value of [blueprint][crate::model::Preview::blueprint]
7151 /// if it holds a `TerraformBlueprint`, `None` if the field is not set or
7152 /// holds a different branch.
7153 pub fn terraform_blueprint(
7154 &self,
7155 ) -> std::option::Option<&std::boxed::Box<crate::model::TerraformBlueprint>> {
7156 #[allow(unreachable_patterns)]
7157 self.blueprint.as_ref().and_then(|v| match v {
7158 crate::model::preview::Blueprint::TerraformBlueprint(v) => std::option::Option::Some(v),
7159 _ => std::option::Option::None,
7160 })
7161 }
7162
7163 /// Sets the value of [blueprint][crate::model::Preview::blueprint]
7164 /// to hold a `TerraformBlueprint`.
7165 ///
7166 /// Note that all the setters affecting `blueprint` are
7167 /// mutually exclusive.
7168 ///
7169 /// # Example
7170 /// ```ignore,no_run
7171 /// # use google_cloud_config_v1::model::Preview;
7172 /// use google_cloud_config_v1::model::TerraformBlueprint;
7173 /// let x = Preview::new().set_terraform_blueprint(TerraformBlueprint::default()/* use setters */);
7174 /// assert!(x.terraform_blueprint().is_some());
7175 /// ```
7176 pub fn set_terraform_blueprint<
7177 T: std::convert::Into<std::boxed::Box<crate::model::TerraformBlueprint>>,
7178 >(
7179 mut self,
7180 v: T,
7181 ) -> Self {
7182 self.blueprint = std::option::Option::Some(
7183 crate::model::preview::Blueprint::TerraformBlueprint(v.into()),
7184 );
7185 self
7186 }
7187}
7188
7189impl wkt::message::Message for Preview {
7190 fn typename() -> &'static str {
7191 "type.googleapis.com/google.cloud.config.v1.Preview"
7192 }
7193}
7194
7195/// Defines additional types related to [Preview].
7196pub mod preview {
7197 #[allow(unused_imports)]
7198 use super::*;
7199
7200 /// Possible states of a preview.
7201 ///
7202 /// # Working with unknown values
7203 ///
7204 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7205 /// additional enum variants at any time. Adding new variants is not considered
7206 /// a breaking change. Applications should write their code in anticipation of:
7207 ///
7208 /// - New values appearing in future releases of the client library, **and**
7209 /// - New values received dynamically, without application changes.
7210 ///
7211 /// Please consult the [Working with enums] section in the user guide for some
7212 /// guidelines.
7213 ///
7214 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
7215 #[derive(Clone, Debug, PartialEq)]
7216 #[non_exhaustive]
7217 pub enum State {
7218 /// The default value. This value is used if the state is unknown.
7219 Unspecified,
7220 /// The preview is being created.
7221 Creating,
7222 /// The preview has succeeded.
7223 Succeeded,
7224 /// The preview is being applied.
7225 Applying,
7226 /// The preview is stale. A preview can become stale if a revision has been
7227 /// applied after this preview was created.
7228 Stale,
7229 /// The preview is being deleted.
7230 Deleting,
7231 /// The preview has encountered an unexpected error.
7232 Failed,
7233 /// The preview has been deleted.
7234 Deleted,
7235 /// If set, the enum was initialized with an unknown value.
7236 ///
7237 /// Applications can examine the value using [State::value] or
7238 /// [State::name].
7239 UnknownValue(state::UnknownValue),
7240 }
7241
7242 #[doc(hidden)]
7243 pub mod state {
7244 #[allow(unused_imports)]
7245 use super::*;
7246 #[derive(Clone, Debug, PartialEq)]
7247 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7248 }
7249
7250 impl State {
7251 /// Gets the enum value.
7252 ///
7253 /// Returns `None` if the enum contains an unknown value deserialized from
7254 /// the string representation of enums.
7255 pub fn value(&self) -> std::option::Option<i32> {
7256 match self {
7257 Self::Unspecified => std::option::Option::Some(0),
7258 Self::Creating => std::option::Option::Some(1),
7259 Self::Succeeded => std::option::Option::Some(2),
7260 Self::Applying => std::option::Option::Some(3),
7261 Self::Stale => std::option::Option::Some(4),
7262 Self::Deleting => std::option::Option::Some(5),
7263 Self::Failed => std::option::Option::Some(6),
7264 Self::Deleted => std::option::Option::Some(7),
7265 Self::UnknownValue(u) => u.0.value(),
7266 }
7267 }
7268
7269 /// Gets the enum value as a string.
7270 ///
7271 /// Returns `None` if the enum contains an unknown value deserialized from
7272 /// the integer representation of enums.
7273 pub fn name(&self) -> std::option::Option<&str> {
7274 match self {
7275 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
7276 Self::Creating => std::option::Option::Some("CREATING"),
7277 Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
7278 Self::Applying => std::option::Option::Some("APPLYING"),
7279 Self::Stale => std::option::Option::Some("STALE"),
7280 Self::Deleting => std::option::Option::Some("DELETING"),
7281 Self::Failed => std::option::Option::Some("FAILED"),
7282 Self::Deleted => std::option::Option::Some("DELETED"),
7283 Self::UnknownValue(u) => u.0.name(),
7284 }
7285 }
7286 }
7287
7288 impl std::default::Default for State {
7289 fn default() -> Self {
7290 use std::convert::From;
7291 Self::from(0)
7292 }
7293 }
7294
7295 impl std::fmt::Display for State {
7296 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7297 wkt::internal::display_enum(f, self.name(), self.value())
7298 }
7299 }
7300
7301 impl std::convert::From<i32> for State {
7302 fn from(value: i32) -> Self {
7303 match value {
7304 0 => Self::Unspecified,
7305 1 => Self::Creating,
7306 2 => Self::Succeeded,
7307 3 => Self::Applying,
7308 4 => Self::Stale,
7309 5 => Self::Deleting,
7310 6 => Self::Failed,
7311 7 => Self::Deleted,
7312 _ => Self::UnknownValue(state::UnknownValue(
7313 wkt::internal::UnknownEnumValue::Integer(value),
7314 )),
7315 }
7316 }
7317 }
7318
7319 impl std::convert::From<&str> for State {
7320 fn from(value: &str) -> Self {
7321 use std::string::ToString;
7322 match value {
7323 "STATE_UNSPECIFIED" => Self::Unspecified,
7324 "CREATING" => Self::Creating,
7325 "SUCCEEDED" => Self::Succeeded,
7326 "APPLYING" => Self::Applying,
7327 "STALE" => Self::Stale,
7328 "DELETING" => Self::Deleting,
7329 "FAILED" => Self::Failed,
7330 "DELETED" => Self::Deleted,
7331 _ => Self::UnknownValue(state::UnknownValue(
7332 wkt::internal::UnknownEnumValue::String(value.to_string()),
7333 )),
7334 }
7335 }
7336 }
7337
7338 impl serde::ser::Serialize for State {
7339 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7340 where
7341 S: serde::Serializer,
7342 {
7343 match self {
7344 Self::Unspecified => serializer.serialize_i32(0),
7345 Self::Creating => serializer.serialize_i32(1),
7346 Self::Succeeded => serializer.serialize_i32(2),
7347 Self::Applying => serializer.serialize_i32(3),
7348 Self::Stale => serializer.serialize_i32(4),
7349 Self::Deleting => serializer.serialize_i32(5),
7350 Self::Failed => serializer.serialize_i32(6),
7351 Self::Deleted => serializer.serialize_i32(7),
7352 Self::UnknownValue(u) => u.0.serialize(serializer),
7353 }
7354 }
7355 }
7356
7357 impl<'de> serde::de::Deserialize<'de> for State {
7358 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7359 where
7360 D: serde::Deserializer<'de>,
7361 {
7362 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
7363 ".google.cloud.config.v1.Preview.State",
7364 ))
7365 }
7366 }
7367
7368 /// Preview mode provides options for customizing preview operations.
7369 ///
7370 /// # Working with unknown values
7371 ///
7372 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7373 /// additional enum variants at any time. Adding new variants is not considered
7374 /// a breaking change. Applications should write their code in anticipation of:
7375 ///
7376 /// - New values appearing in future releases of the client library, **and**
7377 /// - New values received dynamically, without application changes.
7378 ///
7379 /// Please consult the [Working with enums] section in the user guide for some
7380 /// guidelines.
7381 ///
7382 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
7383 #[derive(Clone, Debug, PartialEq)]
7384 #[non_exhaustive]
7385 pub enum PreviewMode {
7386 /// Unspecified policy, default mode will be used.
7387 Unspecified,
7388 /// DEFAULT mode generates an execution plan for reconciling current resource
7389 /// state into expected resource state.
7390 Default,
7391 /// DELETE mode generates as execution plan for destroying current resources.
7392 Delete,
7393 /// If set, the enum was initialized with an unknown value.
7394 ///
7395 /// Applications can examine the value using [PreviewMode::value] or
7396 /// [PreviewMode::name].
7397 UnknownValue(preview_mode::UnknownValue),
7398 }
7399
7400 #[doc(hidden)]
7401 pub mod preview_mode {
7402 #[allow(unused_imports)]
7403 use super::*;
7404 #[derive(Clone, Debug, PartialEq)]
7405 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7406 }
7407
7408 impl PreviewMode {
7409 /// Gets the enum value.
7410 ///
7411 /// Returns `None` if the enum contains an unknown value deserialized from
7412 /// the string representation of enums.
7413 pub fn value(&self) -> std::option::Option<i32> {
7414 match self {
7415 Self::Unspecified => std::option::Option::Some(0),
7416 Self::Default => std::option::Option::Some(1),
7417 Self::Delete => std::option::Option::Some(2),
7418 Self::UnknownValue(u) => u.0.value(),
7419 }
7420 }
7421
7422 /// Gets the enum value as a string.
7423 ///
7424 /// Returns `None` if the enum contains an unknown value deserialized from
7425 /// the integer representation of enums.
7426 pub fn name(&self) -> std::option::Option<&str> {
7427 match self {
7428 Self::Unspecified => std::option::Option::Some("PREVIEW_MODE_UNSPECIFIED"),
7429 Self::Default => std::option::Option::Some("DEFAULT"),
7430 Self::Delete => std::option::Option::Some("DELETE"),
7431 Self::UnknownValue(u) => u.0.name(),
7432 }
7433 }
7434 }
7435
7436 impl std::default::Default for PreviewMode {
7437 fn default() -> Self {
7438 use std::convert::From;
7439 Self::from(0)
7440 }
7441 }
7442
7443 impl std::fmt::Display for PreviewMode {
7444 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7445 wkt::internal::display_enum(f, self.name(), self.value())
7446 }
7447 }
7448
7449 impl std::convert::From<i32> for PreviewMode {
7450 fn from(value: i32) -> Self {
7451 match value {
7452 0 => Self::Unspecified,
7453 1 => Self::Default,
7454 2 => Self::Delete,
7455 _ => Self::UnknownValue(preview_mode::UnknownValue(
7456 wkt::internal::UnknownEnumValue::Integer(value),
7457 )),
7458 }
7459 }
7460 }
7461
7462 impl std::convert::From<&str> for PreviewMode {
7463 fn from(value: &str) -> Self {
7464 use std::string::ToString;
7465 match value {
7466 "PREVIEW_MODE_UNSPECIFIED" => Self::Unspecified,
7467 "DEFAULT" => Self::Default,
7468 "DELETE" => Self::Delete,
7469 _ => Self::UnknownValue(preview_mode::UnknownValue(
7470 wkt::internal::UnknownEnumValue::String(value.to_string()),
7471 )),
7472 }
7473 }
7474 }
7475
7476 impl serde::ser::Serialize for PreviewMode {
7477 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7478 where
7479 S: serde::Serializer,
7480 {
7481 match self {
7482 Self::Unspecified => serializer.serialize_i32(0),
7483 Self::Default => serializer.serialize_i32(1),
7484 Self::Delete => serializer.serialize_i32(2),
7485 Self::UnknownValue(u) => u.0.serialize(serializer),
7486 }
7487 }
7488 }
7489
7490 impl<'de> serde::de::Deserialize<'de> for PreviewMode {
7491 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7492 where
7493 D: serde::Deserializer<'de>,
7494 {
7495 deserializer.deserialize_any(wkt::internal::EnumVisitor::<PreviewMode>::new(
7496 ".google.cloud.config.v1.Preview.PreviewMode",
7497 ))
7498 }
7499 }
7500
7501 /// Possible errors that can occur with previews.
7502 ///
7503 /// # Working with unknown values
7504 ///
7505 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7506 /// additional enum variants at any time. Adding new variants is not considered
7507 /// a breaking change. Applications should write their code in anticipation of:
7508 ///
7509 /// - New values appearing in future releases of the client library, **and**
7510 /// - New values received dynamically, without application changes.
7511 ///
7512 /// Please consult the [Working with enums] section in the user guide for some
7513 /// guidelines.
7514 ///
7515 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
7516 #[derive(Clone, Debug, PartialEq)]
7517 #[non_exhaustive]
7518 pub enum ErrorCode {
7519 /// No error code was specified.
7520 Unspecified,
7521 /// Cloud Build failed due to a permissions issue.
7522 CloudBuildPermissionDenied,
7523 /// Cloud Storage bucket failed to create due to a permissions issue.
7524 BucketCreationPermissionDenied,
7525 /// Cloud Storage bucket failed for a non-permissions-related issue.
7526 BucketCreationFailed,
7527 /// Acquiring lock on provided deployment reference failed.
7528 DeploymentLockAcquireFailed,
7529 /// Preview encountered an error when trying to access Cloud Build API.
7530 PreviewBuildApiFailed,
7531 /// Preview created a build but build failed and logs were generated.
7532 PreviewBuildRunFailed,
7533 /// Failed to import values from an external source.
7534 ExternalValueSourceImportFailed,
7535 /// If set, the enum was initialized with an unknown value.
7536 ///
7537 /// Applications can examine the value using [ErrorCode::value] or
7538 /// [ErrorCode::name].
7539 UnknownValue(error_code::UnknownValue),
7540 }
7541
7542 #[doc(hidden)]
7543 pub mod error_code {
7544 #[allow(unused_imports)]
7545 use super::*;
7546 #[derive(Clone, Debug, PartialEq)]
7547 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7548 }
7549
7550 impl ErrorCode {
7551 /// Gets the enum value.
7552 ///
7553 /// Returns `None` if the enum contains an unknown value deserialized from
7554 /// the string representation of enums.
7555 pub fn value(&self) -> std::option::Option<i32> {
7556 match self {
7557 Self::Unspecified => std::option::Option::Some(0),
7558 Self::CloudBuildPermissionDenied => std::option::Option::Some(1),
7559 Self::BucketCreationPermissionDenied => std::option::Option::Some(2),
7560 Self::BucketCreationFailed => std::option::Option::Some(3),
7561 Self::DeploymentLockAcquireFailed => std::option::Option::Some(4),
7562 Self::PreviewBuildApiFailed => std::option::Option::Some(5),
7563 Self::PreviewBuildRunFailed => std::option::Option::Some(6),
7564 Self::ExternalValueSourceImportFailed => std::option::Option::Some(7),
7565 Self::UnknownValue(u) => u.0.value(),
7566 }
7567 }
7568
7569 /// Gets the enum value as a string.
7570 ///
7571 /// Returns `None` if the enum contains an unknown value deserialized from
7572 /// the integer representation of enums.
7573 pub fn name(&self) -> std::option::Option<&str> {
7574 match self {
7575 Self::Unspecified => std::option::Option::Some("ERROR_CODE_UNSPECIFIED"),
7576 Self::CloudBuildPermissionDenied => {
7577 std::option::Option::Some("CLOUD_BUILD_PERMISSION_DENIED")
7578 }
7579 Self::BucketCreationPermissionDenied => {
7580 std::option::Option::Some("BUCKET_CREATION_PERMISSION_DENIED")
7581 }
7582 Self::BucketCreationFailed => std::option::Option::Some("BUCKET_CREATION_FAILED"),
7583 Self::DeploymentLockAcquireFailed => {
7584 std::option::Option::Some("DEPLOYMENT_LOCK_ACQUIRE_FAILED")
7585 }
7586 Self::PreviewBuildApiFailed => {
7587 std::option::Option::Some("PREVIEW_BUILD_API_FAILED")
7588 }
7589 Self::PreviewBuildRunFailed => {
7590 std::option::Option::Some("PREVIEW_BUILD_RUN_FAILED")
7591 }
7592 Self::ExternalValueSourceImportFailed => {
7593 std::option::Option::Some("EXTERNAL_VALUE_SOURCE_IMPORT_FAILED")
7594 }
7595 Self::UnknownValue(u) => u.0.name(),
7596 }
7597 }
7598 }
7599
7600 impl std::default::Default for ErrorCode {
7601 fn default() -> Self {
7602 use std::convert::From;
7603 Self::from(0)
7604 }
7605 }
7606
7607 impl std::fmt::Display for ErrorCode {
7608 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7609 wkt::internal::display_enum(f, self.name(), self.value())
7610 }
7611 }
7612
7613 impl std::convert::From<i32> for ErrorCode {
7614 fn from(value: i32) -> Self {
7615 match value {
7616 0 => Self::Unspecified,
7617 1 => Self::CloudBuildPermissionDenied,
7618 2 => Self::BucketCreationPermissionDenied,
7619 3 => Self::BucketCreationFailed,
7620 4 => Self::DeploymentLockAcquireFailed,
7621 5 => Self::PreviewBuildApiFailed,
7622 6 => Self::PreviewBuildRunFailed,
7623 7 => Self::ExternalValueSourceImportFailed,
7624 _ => Self::UnknownValue(error_code::UnknownValue(
7625 wkt::internal::UnknownEnumValue::Integer(value),
7626 )),
7627 }
7628 }
7629 }
7630
7631 impl std::convert::From<&str> for ErrorCode {
7632 fn from(value: &str) -> Self {
7633 use std::string::ToString;
7634 match value {
7635 "ERROR_CODE_UNSPECIFIED" => Self::Unspecified,
7636 "CLOUD_BUILD_PERMISSION_DENIED" => Self::CloudBuildPermissionDenied,
7637 "BUCKET_CREATION_PERMISSION_DENIED" => Self::BucketCreationPermissionDenied,
7638 "BUCKET_CREATION_FAILED" => Self::BucketCreationFailed,
7639 "DEPLOYMENT_LOCK_ACQUIRE_FAILED" => Self::DeploymentLockAcquireFailed,
7640 "PREVIEW_BUILD_API_FAILED" => Self::PreviewBuildApiFailed,
7641 "PREVIEW_BUILD_RUN_FAILED" => Self::PreviewBuildRunFailed,
7642 "EXTERNAL_VALUE_SOURCE_IMPORT_FAILED" => Self::ExternalValueSourceImportFailed,
7643 _ => Self::UnknownValue(error_code::UnknownValue(
7644 wkt::internal::UnknownEnumValue::String(value.to_string()),
7645 )),
7646 }
7647 }
7648 }
7649
7650 impl serde::ser::Serialize for ErrorCode {
7651 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7652 where
7653 S: serde::Serializer,
7654 {
7655 match self {
7656 Self::Unspecified => serializer.serialize_i32(0),
7657 Self::CloudBuildPermissionDenied => serializer.serialize_i32(1),
7658 Self::BucketCreationPermissionDenied => serializer.serialize_i32(2),
7659 Self::BucketCreationFailed => serializer.serialize_i32(3),
7660 Self::DeploymentLockAcquireFailed => serializer.serialize_i32(4),
7661 Self::PreviewBuildApiFailed => serializer.serialize_i32(5),
7662 Self::PreviewBuildRunFailed => serializer.serialize_i32(6),
7663 Self::ExternalValueSourceImportFailed => serializer.serialize_i32(7),
7664 Self::UnknownValue(u) => u.0.serialize(serializer),
7665 }
7666 }
7667 }
7668
7669 impl<'de> serde::de::Deserialize<'de> for ErrorCode {
7670 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7671 where
7672 D: serde::Deserializer<'de>,
7673 {
7674 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ErrorCode>::new(
7675 ".google.cloud.config.v1.Preview.ErrorCode",
7676 ))
7677 }
7678 }
7679
7680 /// Blueprint to preview.
7681 #[derive(Clone, Debug, PartialEq)]
7682 #[non_exhaustive]
7683 pub enum Blueprint {
7684 /// The terraform blueprint to preview.
7685 TerraformBlueprint(std::boxed::Box<crate::model::TerraformBlueprint>),
7686 }
7687}
7688
7689/// Ephemeral metadata content describing the state of a preview operation.
7690#[derive(Clone, Default, PartialEq)]
7691#[non_exhaustive]
7692pub struct PreviewOperationMetadata {
7693 /// The current step the preview operation is running.
7694 pub step: crate::model::preview_operation_metadata::PreviewStep,
7695
7696 /// Artifacts from preview.
7697 pub preview_artifacts: std::option::Option<crate::model::PreviewArtifacts>,
7698
7699 /// Output only. Location of preview logs in `gs://{bucket}/{object}` format.
7700 pub logs: std::string::String,
7701
7702 /// Output only. Cloud Build instance UUID associated with this preview.
7703 pub build: std::string::String,
7704
7705 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7706}
7707
7708impl PreviewOperationMetadata {
7709 /// Creates a new default instance.
7710 pub fn new() -> Self {
7711 std::default::Default::default()
7712 }
7713
7714 /// Sets the value of [step][crate::model::PreviewOperationMetadata::step].
7715 ///
7716 /// # Example
7717 /// ```ignore,no_run
7718 /// # use google_cloud_config_v1::model::PreviewOperationMetadata;
7719 /// use google_cloud_config_v1::model::preview_operation_metadata::PreviewStep;
7720 /// let x0 = PreviewOperationMetadata::new().set_step(PreviewStep::PreparingStorageBucket);
7721 /// let x1 = PreviewOperationMetadata::new().set_step(PreviewStep::DownloadingBlueprint);
7722 /// let x2 = PreviewOperationMetadata::new().set_step(PreviewStep::RunningTfInit);
7723 /// ```
7724 pub fn set_step<
7725 T: std::convert::Into<crate::model::preview_operation_metadata::PreviewStep>,
7726 >(
7727 mut self,
7728 v: T,
7729 ) -> Self {
7730 self.step = v.into();
7731 self
7732 }
7733
7734 /// Sets the value of [preview_artifacts][crate::model::PreviewOperationMetadata::preview_artifacts].
7735 ///
7736 /// # Example
7737 /// ```ignore,no_run
7738 /// # use google_cloud_config_v1::model::PreviewOperationMetadata;
7739 /// use google_cloud_config_v1::model::PreviewArtifacts;
7740 /// let x = PreviewOperationMetadata::new().set_preview_artifacts(PreviewArtifacts::default()/* use setters */);
7741 /// ```
7742 pub fn set_preview_artifacts<T>(mut self, v: T) -> Self
7743 where
7744 T: std::convert::Into<crate::model::PreviewArtifacts>,
7745 {
7746 self.preview_artifacts = std::option::Option::Some(v.into());
7747 self
7748 }
7749
7750 /// Sets or clears the value of [preview_artifacts][crate::model::PreviewOperationMetadata::preview_artifacts].
7751 ///
7752 /// # Example
7753 /// ```ignore,no_run
7754 /// # use google_cloud_config_v1::model::PreviewOperationMetadata;
7755 /// use google_cloud_config_v1::model::PreviewArtifacts;
7756 /// let x = PreviewOperationMetadata::new().set_or_clear_preview_artifacts(Some(PreviewArtifacts::default()/* use setters */));
7757 /// let x = PreviewOperationMetadata::new().set_or_clear_preview_artifacts(None::<PreviewArtifacts>);
7758 /// ```
7759 pub fn set_or_clear_preview_artifacts<T>(mut self, v: std::option::Option<T>) -> Self
7760 where
7761 T: std::convert::Into<crate::model::PreviewArtifacts>,
7762 {
7763 self.preview_artifacts = v.map(|x| x.into());
7764 self
7765 }
7766
7767 /// Sets the value of [logs][crate::model::PreviewOperationMetadata::logs].
7768 ///
7769 /// # Example
7770 /// ```ignore,no_run
7771 /// # use google_cloud_config_v1::model::PreviewOperationMetadata;
7772 /// let x = PreviewOperationMetadata::new().set_logs("example");
7773 /// ```
7774 pub fn set_logs<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7775 self.logs = v.into();
7776 self
7777 }
7778
7779 /// Sets the value of [build][crate::model::PreviewOperationMetadata::build].
7780 ///
7781 /// # Example
7782 /// ```ignore,no_run
7783 /// # use google_cloud_config_v1::model::PreviewOperationMetadata;
7784 /// let x = PreviewOperationMetadata::new().set_build("example");
7785 /// ```
7786 pub fn set_build<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7787 self.build = v.into();
7788 self
7789 }
7790}
7791
7792impl wkt::message::Message for PreviewOperationMetadata {
7793 fn typename() -> &'static str {
7794 "type.googleapis.com/google.cloud.config.v1.PreviewOperationMetadata"
7795 }
7796}
7797
7798/// Defines additional types related to [PreviewOperationMetadata].
7799pub mod preview_operation_metadata {
7800 #[allow(unused_imports)]
7801 use super::*;
7802
7803 /// The possible steps a preview may be running.
7804 ///
7805 /// # Working with unknown values
7806 ///
7807 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7808 /// additional enum variants at any time. Adding new variants is not considered
7809 /// a breaking change. Applications should write their code in anticipation of:
7810 ///
7811 /// - New values appearing in future releases of the client library, **and**
7812 /// - New values received dynamically, without application changes.
7813 ///
7814 /// Please consult the [Working with enums] section in the user guide for some
7815 /// guidelines.
7816 ///
7817 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
7818 #[derive(Clone, Debug, PartialEq)]
7819 #[non_exhaustive]
7820 pub enum PreviewStep {
7821 /// Unspecified preview step.
7822 Unspecified,
7823 /// Infra Manager is creating a Google Cloud Storage bucket to store
7824 /// artifacts and metadata about the preview.
7825 PreparingStorageBucket,
7826 /// Downloading the blueprint onto the Google Cloud Storage bucket.
7827 DownloadingBlueprint,
7828 /// Initializing Terraform using `terraform init`.
7829 RunningTfInit,
7830 /// Running `terraform plan`.
7831 RunningTfPlan,
7832 /// Fetching a deployment.
7833 FetchingDeployment,
7834 /// Locking a deployment.
7835 LockingDeployment,
7836 /// Unlocking a deployment.
7837 UnlockingDeployment,
7838 /// Operation was successful.
7839 Succeeded,
7840 /// Operation failed.
7841 Failed,
7842 /// Validating the provided repository.
7843 ValidatingRepository,
7844 /// If set, the enum was initialized with an unknown value.
7845 ///
7846 /// Applications can examine the value using [PreviewStep::value] or
7847 /// [PreviewStep::name].
7848 UnknownValue(preview_step::UnknownValue),
7849 }
7850
7851 #[doc(hidden)]
7852 pub mod preview_step {
7853 #[allow(unused_imports)]
7854 use super::*;
7855 #[derive(Clone, Debug, PartialEq)]
7856 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7857 }
7858
7859 impl PreviewStep {
7860 /// Gets the enum value.
7861 ///
7862 /// Returns `None` if the enum contains an unknown value deserialized from
7863 /// the string representation of enums.
7864 pub fn value(&self) -> std::option::Option<i32> {
7865 match self {
7866 Self::Unspecified => std::option::Option::Some(0),
7867 Self::PreparingStorageBucket => std::option::Option::Some(1),
7868 Self::DownloadingBlueprint => std::option::Option::Some(2),
7869 Self::RunningTfInit => std::option::Option::Some(3),
7870 Self::RunningTfPlan => std::option::Option::Some(4),
7871 Self::FetchingDeployment => std::option::Option::Some(5),
7872 Self::LockingDeployment => std::option::Option::Some(6),
7873 Self::UnlockingDeployment => std::option::Option::Some(7),
7874 Self::Succeeded => std::option::Option::Some(8),
7875 Self::Failed => std::option::Option::Some(9),
7876 Self::ValidatingRepository => std::option::Option::Some(10),
7877 Self::UnknownValue(u) => u.0.value(),
7878 }
7879 }
7880
7881 /// Gets the enum value as a string.
7882 ///
7883 /// Returns `None` if the enum contains an unknown value deserialized from
7884 /// the integer representation of enums.
7885 pub fn name(&self) -> std::option::Option<&str> {
7886 match self {
7887 Self::Unspecified => std::option::Option::Some("PREVIEW_STEP_UNSPECIFIED"),
7888 Self::PreparingStorageBucket => {
7889 std::option::Option::Some("PREPARING_STORAGE_BUCKET")
7890 }
7891 Self::DownloadingBlueprint => std::option::Option::Some("DOWNLOADING_BLUEPRINT"),
7892 Self::RunningTfInit => std::option::Option::Some("RUNNING_TF_INIT"),
7893 Self::RunningTfPlan => std::option::Option::Some("RUNNING_TF_PLAN"),
7894 Self::FetchingDeployment => std::option::Option::Some("FETCHING_DEPLOYMENT"),
7895 Self::LockingDeployment => std::option::Option::Some("LOCKING_DEPLOYMENT"),
7896 Self::UnlockingDeployment => std::option::Option::Some("UNLOCKING_DEPLOYMENT"),
7897 Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
7898 Self::Failed => std::option::Option::Some("FAILED"),
7899 Self::ValidatingRepository => std::option::Option::Some("VALIDATING_REPOSITORY"),
7900 Self::UnknownValue(u) => u.0.name(),
7901 }
7902 }
7903 }
7904
7905 impl std::default::Default for PreviewStep {
7906 fn default() -> Self {
7907 use std::convert::From;
7908 Self::from(0)
7909 }
7910 }
7911
7912 impl std::fmt::Display for PreviewStep {
7913 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7914 wkt::internal::display_enum(f, self.name(), self.value())
7915 }
7916 }
7917
7918 impl std::convert::From<i32> for PreviewStep {
7919 fn from(value: i32) -> Self {
7920 match value {
7921 0 => Self::Unspecified,
7922 1 => Self::PreparingStorageBucket,
7923 2 => Self::DownloadingBlueprint,
7924 3 => Self::RunningTfInit,
7925 4 => Self::RunningTfPlan,
7926 5 => Self::FetchingDeployment,
7927 6 => Self::LockingDeployment,
7928 7 => Self::UnlockingDeployment,
7929 8 => Self::Succeeded,
7930 9 => Self::Failed,
7931 10 => Self::ValidatingRepository,
7932 _ => Self::UnknownValue(preview_step::UnknownValue(
7933 wkt::internal::UnknownEnumValue::Integer(value),
7934 )),
7935 }
7936 }
7937 }
7938
7939 impl std::convert::From<&str> for PreviewStep {
7940 fn from(value: &str) -> Self {
7941 use std::string::ToString;
7942 match value {
7943 "PREVIEW_STEP_UNSPECIFIED" => Self::Unspecified,
7944 "PREPARING_STORAGE_BUCKET" => Self::PreparingStorageBucket,
7945 "DOWNLOADING_BLUEPRINT" => Self::DownloadingBlueprint,
7946 "RUNNING_TF_INIT" => Self::RunningTfInit,
7947 "RUNNING_TF_PLAN" => Self::RunningTfPlan,
7948 "FETCHING_DEPLOYMENT" => Self::FetchingDeployment,
7949 "LOCKING_DEPLOYMENT" => Self::LockingDeployment,
7950 "UNLOCKING_DEPLOYMENT" => Self::UnlockingDeployment,
7951 "SUCCEEDED" => Self::Succeeded,
7952 "FAILED" => Self::Failed,
7953 "VALIDATING_REPOSITORY" => Self::ValidatingRepository,
7954 _ => Self::UnknownValue(preview_step::UnknownValue(
7955 wkt::internal::UnknownEnumValue::String(value.to_string()),
7956 )),
7957 }
7958 }
7959 }
7960
7961 impl serde::ser::Serialize for PreviewStep {
7962 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7963 where
7964 S: serde::Serializer,
7965 {
7966 match self {
7967 Self::Unspecified => serializer.serialize_i32(0),
7968 Self::PreparingStorageBucket => serializer.serialize_i32(1),
7969 Self::DownloadingBlueprint => serializer.serialize_i32(2),
7970 Self::RunningTfInit => serializer.serialize_i32(3),
7971 Self::RunningTfPlan => serializer.serialize_i32(4),
7972 Self::FetchingDeployment => serializer.serialize_i32(5),
7973 Self::LockingDeployment => serializer.serialize_i32(6),
7974 Self::UnlockingDeployment => serializer.serialize_i32(7),
7975 Self::Succeeded => serializer.serialize_i32(8),
7976 Self::Failed => serializer.serialize_i32(9),
7977 Self::ValidatingRepository => serializer.serialize_i32(10),
7978 Self::UnknownValue(u) => u.0.serialize(serializer),
7979 }
7980 }
7981 }
7982
7983 impl<'de> serde::de::Deserialize<'de> for PreviewStep {
7984 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7985 where
7986 D: serde::Deserializer<'de>,
7987 {
7988 deserializer.deserialize_any(wkt::internal::EnumVisitor::<PreviewStep>::new(
7989 ".google.cloud.config.v1.PreviewOperationMetadata.PreviewStep",
7990 ))
7991 }
7992 }
7993}
7994
7995/// Artifacts created by preview.
7996#[derive(Clone, Default, PartialEq)]
7997#[non_exhaustive]
7998pub struct PreviewArtifacts {
7999 /// Output only. Location of a blueprint copy and other content in Google Cloud
8000 /// Storage. Format: `gs://{bucket}/{object}`
8001 pub content: std::string::String,
8002
8003 /// Output only. Location of artifacts in Google Cloud Storage.
8004 /// Format: `gs://{bucket}/{object}`
8005 pub artifacts: std::string::String,
8006
8007 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8008}
8009
8010impl PreviewArtifacts {
8011 /// Creates a new default instance.
8012 pub fn new() -> Self {
8013 std::default::Default::default()
8014 }
8015
8016 /// Sets the value of [content][crate::model::PreviewArtifacts::content].
8017 ///
8018 /// # Example
8019 /// ```ignore,no_run
8020 /// # use google_cloud_config_v1::model::PreviewArtifacts;
8021 /// let x = PreviewArtifacts::new().set_content("example");
8022 /// ```
8023 pub fn set_content<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8024 self.content = v.into();
8025 self
8026 }
8027
8028 /// Sets the value of [artifacts][crate::model::PreviewArtifacts::artifacts].
8029 ///
8030 /// # Example
8031 /// ```ignore,no_run
8032 /// # use google_cloud_config_v1::model::PreviewArtifacts;
8033 /// let x = PreviewArtifacts::new().set_artifacts("example");
8034 /// ```
8035 pub fn set_artifacts<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8036 self.artifacts = v.into();
8037 self
8038 }
8039}
8040
8041impl wkt::message::Message for PreviewArtifacts {
8042 fn typename() -> &'static str {
8043 "type.googleapis.com/google.cloud.config.v1.PreviewArtifacts"
8044 }
8045}
8046
8047/// A request to create a preview.
8048#[derive(Clone, Default, PartialEq)]
8049#[non_exhaustive]
8050pub struct CreatePreviewRequest {
8051 /// Required. The parent in whose context the Preview is created. The parent
8052 /// value is in the format: 'projects/{project_id}/locations/{location}'.
8053 pub parent: std::string::String,
8054
8055 /// Optional. The preview ID.
8056 pub preview_id: std::string::String,
8057
8058 /// Required. [Preview][google.cloud.config.v1.Preview] resource to be created.
8059 ///
8060 /// [google.cloud.config.v1.Preview]: crate::model::Preview
8061 pub preview: std::option::Option<crate::model::Preview>,
8062
8063 /// Optional. An optional request ID to identify requests. Specify a unique
8064 /// request ID so that if you must retry your request, the server will know to
8065 /// ignore the request if it has already been completed. The server will
8066 /// guarantee that for at least 60 minutes since the first request.
8067 ///
8068 /// For example, consider a situation where you make an initial request and the
8069 /// request times out. If you make the request again with the same request ID,
8070 /// the server can check if original operation with the same request ID was
8071 /// received, and if so, will ignore the second request. This prevents clients
8072 /// from accidentally creating duplicate commitments.
8073 ///
8074 /// The request ID must be a valid UUID with the exception that zero UUID is
8075 /// not supported (00000000-0000-0000-0000-000000000000).
8076 pub request_id: std::string::String,
8077
8078 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8079}
8080
8081impl CreatePreviewRequest {
8082 /// Creates a new default instance.
8083 pub fn new() -> Self {
8084 std::default::Default::default()
8085 }
8086
8087 /// Sets the value of [parent][crate::model::CreatePreviewRequest::parent].
8088 ///
8089 /// # Example
8090 /// ```ignore,no_run
8091 /// # use google_cloud_config_v1::model::CreatePreviewRequest;
8092 /// let x = CreatePreviewRequest::new().set_parent("example");
8093 /// ```
8094 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8095 self.parent = v.into();
8096 self
8097 }
8098
8099 /// Sets the value of [preview_id][crate::model::CreatePreviewRequest::preview_id].
8100 ///
8101 /// # Example
8102 /// ```ignore,no_run
8103 /// # use google_cloud_config_v1::model::CreatePreviewRequest;
8104 /// let x = CreatePreviewRequest::new().set_preview_id("example");
8105 /// ```
8106 pub fn set_preview_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8107 self.preview_id = v.into();
8108 self
8109 }
8110
8111 /// Sets the value of [preview][crate::model::CreatePreviewRequest::preview].
8112 ///
8113 /// # Example
8114 /// ```ignore,no_run
8115 /// # use google_cloud_config_v1::model::CreatePreviewRequest;
8116 /// use google_cloud_config_v1::model::Preview;
8117 /// let x = CreatePreviewRequest::new().set_preview(Preview::default()/* use setters */);
8118 /// ```
8119 pub fn set_preview<T>(mut self, v: T) -> Self
8120 where
8121 T: std::convert::Into<crate::model::Preview>,
8122 {
8123 self.preview = std::option::Option::Some(v.into());
8124 self
8125 }
8126
8127 /// Sets or clears the value of [preview][crate::model::CreatePreviewRequest::preview].
8128 ///
8129 /// # Example
8130 /// ```ignore,no_run
8131 /// # use google_cloud_config_v1::model::CreatePreviewRequest;
8132 /// use google_cloud_config_v1::model::Preview;
8133 /// let x = CreatePreviewRequest::new().set_or_clear_preview(Some(Preview::default()/* use setters */));
8134 /// let x = CreatePreviewRequest::new().set_or_clear_preview(None::<Preview>);
8135 /// ```
8136 pub fn set_or_clear_preview<T>(mut self, v: std::option::Option<T>) -> Self
8137 where
8138 T: std::convert::Into<crate::model::Preview>,
8139 {
8140 self.preview = v.map(|x| x.into());
8141 self
8142 }
8143
8144 /// Sets the value of [request_id][crate::model::CreatePreviewRequest::request_id].
8145 ///
8146 /// # Example
8147 /// ```ignore,no_run
8148 /// # use google_cloud_config_v1::model::CreatePreviewRequest;
8149 /// let x = CreatePreviewRequest::new().set_request_id("example");
8150 /// ```
8151 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8152 self.request_id = v.into();
8153 self
8154 }
8155}
8156
8157impl wkt::message::Message for CreatePreviewRequest {
8158 fn typename() -> &'static str {
8159 "type.googleapis.com/google.cloud.config.v1.CreatePreviewRequest"
8160 }
8161}
8162
8163/// A request to get details about a preview.
8164#[derive(Clone, Default, PartialEq)]
8165#[non_exhaustive]
8166pub struct GetPreviewRequest {
8167 /// Required. The name of the preview. Format:
8168 /// 'projects/{project_id}/locations/{location}/previews/{preview}'.
8169 pub name: std::string::String,
8170
8171 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8172}
8173
8174impl GetPreviewRequest {
8175 /// Creates a new default instance.
8176 pub fn new() -> Self {
8177 std::default::Default::default()
8178 }
8179
8180 /// Sets the value of [name][crate::model::GetPreviewRequest::name].
8181 ///
8182 /// # Example
8183 /// ```ignore,no_run
8184 /// # use google_cloud_config_v1::model::GetPreviewRequest;
8185 /// # let project_id = "project_id";
8186 /// # let location_id = "location_id";
8187 /// # let preview_id = "preview_id";
8188 /// let x = GetPreviewRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/previews/{preview_id}"));
8189 /// ```
8190 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8191 self.name = v.into();
8192 self
8193 }
8194}
8195
8196impl wkt::message::Message for GetPreviewRequest {
8197 fn typename() -> &'static str {
8198 "type.googleapis.com/google.cloud.config.v1.GetPreviewRequest"
8199 }
8200}
8201
8202/// A request to list all previews for a given project and location.
8203#[derive(Clone, Default, PartialEq)]
8204#[non_exhaustive]
8205pub struct ListPreviewsRequest {
8206 /// Required. The parent in whose context the Previews are listed. The parent
8207 /// value is in the format: 'projects/{project_id}/locations/{location}'.
8208 pub parent: std::string::String,
8209
8210 /// Optional. When requesting a page of resources, 'page_size' specifies number
8211 /// of resources to return. If unspecified, at most 500 will be returned. The
8212 /// maximum value is 1000.
8213 pub page_size: i32,
8214
8215 /// Optional. Token returned by previous call to 'ListDeployments' which
8216 /// specifies the position in the list from where to continue listing the
8217 /// resources.
8218 pub page_token: std::string::String,
8219
8220 /// Optional. Lists the Deployments that match the filter expression. A filter
8221 /// expression filters the resources listed in the response. The expression
8222 /// must be of the form '{field} {operator} {value}' where operators: '<', '>',
8223 /// '<=', '>=', '!=', '=', ':' are supported (colon ':' represents a HAS
8224 /// operator which is roughly synonymous with equality). {field} can refer to a
8225 /// proto or JSON field, or a synthetic field. Field names can be camelCase or
8226 /// snake_case.
8227 ///
8228 /// Examples:
8229 ///
8230 /// - Filter by name:
8231 /// name = "projects/foo/locations/us-central1/deployments/bar
8232 ///
8233 /// - Filter by labels:
8234 ///
8235 /// - Resources that have a key called 'foo'
8236 /// labels.foo:*
8237 /// - Resources that have a key called 'foo' whose value is 'bar'
8238 /// labels.foo = bar
8239 /// - Filter by state:
8240 ///
8241 /// - Deployments in CREATING state.
8242 /// state=CREATING
8243 pub filter: std::string::String,
8244
8245 /// Optional. Field to use to sort the list.
8246 pub order_by: std::string::String,
8247
8248 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8249}
8250
8251impl ListPreviewsRequest {
8252 /// Creates a new default instance.
8253 pub fn new() -> Self {
8254 std::default::Default::default()
8255 }
8256
8257 /// Sets the value of [parent][crate::model::ListPreviewsRequest::parent].
8258 ///
8259 /// # Example
8260 /// ```ignore,no_run
8261 /// # use google_cloud_config_v1::model::ListPreviewsRequest;
8262 /// let x = ListPreviewsRequest::new().set_parent("example");
8263 /// ```
8264 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8265 self.parent = v.into();
8266 self
8267 }
8268
8269 /// Sets the value of [page_size][crate::model::ListPreviewsRequest::page_size].
8270 ///
8271 /// # Example
8272 /// ```ignore,no_run
8273 /// # use google_cloud_config_v1::model::ListPreviewsRequest;
8274 /// let x = ListPreviewsRequest::new().set_page_size(42);
8275 /// ```
8276 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8277 self.page_size = v.into();
8278 self
8279 }
8280
8281 /// Sets the value of [page_token][crate::model::ListPreviewsRequest::page_token].
8282 ///
8283 /// # Example
8284 /// ```ignore,no_run
8285 /// # use google_cloud_config_v1::model::ListPreviewsRequest;
8286 /// let x = ListPreviewsRequest::new().set_page_token("example");
8287 /// ```
8288 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8289 self.page_token = v.into();
8290 self
8291 }
8292
8293 /// Sets the value of [filter][crate::model::ListPreviewsRequest::filter].
8294 ///
8295 /// # Example
8296 /// ```ignore,no_run
8297 /// # use google_cloud_config_v1::model::ListPreviewsRequest;
8298 /// let x = ListPreviewsRequest::new().set_filter("example");
8299 /// ```
8300 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8301 self.filter = v.into();
8302 self
8303 }
8304
8305 /// Sets the value of [order_by][crate::model::ListPreviewsRequest::order_by].
8306 ///
8307 /// # Example
8308 /// ```ignore,no_run
8309 /// # use google_cloud_config_v1::model::ListPreviewsRequest;
8310 /// let x = ListPreviewsRequest::new().set_order_by("example");
8311 /// ```
8312 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8313 self.order_by = v.into();
8314 self
8315 }
8316}
8317
8318impl wkt::message::Message for ListPreviewsRequest {
8319 fn typename() -> &'static str {
8320 "type.googleapis.com/google.cloud.config.v1.ListPreviewsRequest"
8321 }
8322}
8323
8324/// A response to a `ListPreviews` call. Contains a list of Previews.
8325#[derive(Clone, Default, PartialEq)]
8326#[non_exhaustive]
8327pub struct ListPreviewsResponse {
8328 /// List of [Previews][google.cloud.config.v1.Preview].
8329 ///
8330 /// [google.cloud.config.v1.Preview]: crate::model::Preview
8331 pub previews: std::vec::Vec<crate::model::Preview>,
8332
8333 /// Token to be supplied to the next ListPreviews request via `page_token`
8334 /// to obtain the next set of results.
8335 pub next_page_token: std::string::String,
8336
8337 /// Locations that could not be reached.
8338 pub unreachable: std::vec::Vec<std::string::String>,
8339
8340 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8341}
8342
8343impl ListPreviewsResponse {
8344 /// Creates a new default instance.
8345 pub fn new() -> Self {
8346 std::default::Default::default()
8347 }
8348
8349 /// Sets the value of [previews][crate::model::ListPreviewsResponse::previews].
8350 ///
8351 /// # Example
8352 /// ```ignore,no_run
8353 /// # use google_cloud_config_v1::model::ListPreviewsResponse;
8354 /// use google_cloud_config_v1::model::Preview;
8355 /// let x = ListPreviewsResponse::new()
8356 /// .set_previews([
8357 /// Preview::default()/* use setters */,
8358 /// Preview::default()/* use (different) setters */,
8359 /// ]);
8360 /// ```
8361 pub fn set_previews<T, V>(mut self, v: T) -> Self
8362 where
8363 T: std::iter::IntoIterator<Item = V>,
8364 V: std::convert::Into<crate::model::Preview>,
8365 {
8366 use std::iter::Iterator;
8367 self.previews = v.into_iter().map(|i| i.into()).collect();
8368 self
8369 }
8370
8371 /// Sets the value of [next_page_token][crate::model::ListPreviewsResponse::next_page_token].
8372 ///
8373 /// # Example
8374 /// ```ignore,no_run
8375 /// # use google_cloud_config_v1::model::ListPreviewsResponse;
8376 /// let x = ListPreviewsResponse::new().set_next_page_token("example");
8377 /// ```
8378 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8379 self.next_page_token = v.into();
8380 self
8381 }
8382
8383 /// Sets the value of [unreachable][crate::model::ListPreviewsResponse::unreachable].
8384 ///
8385 /// # Example
8386 /// ```ignore,no_run
8387 /// # use google_cloud_config_v1::model::ListPreviewsResponse;
8388 /// let x = ListPreviewsResponse::new().set_unreachable(["a", "b", "c"]);
8389 /// ```
8390 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
8391 where
8392 T: std::iter::IntoIterator<Item = V>,
8393 V: std::convert::Into<std::string::String>,
8394 {
8395 use std::iter::Iterator;
8396 self.unreachable = v.into_iter().map(|i| i.into()).collect();
8397 self
8398 }
8399}
8400
8401impl wkt::message::Message for ListPreviewsResponse {
8402 fn typename() -> &'static str {
8403 "type.googleapis.com/google.cloud.config.v1.ListPreviewsResponse"
8404 }
8405}
8406
8407#[doc(hidden)]
8408impl google_cloud_gax::paginator::internal::PageableResponse for ListPreviewsResponse {
8409 type PageItem = crate::model::Preview;
8410
8411 fn items(self) -> std::vec::Vec<Self::PageItem> {
8412 self.previews
8413 }
8414
8415 fn next_page_token(&self) -> std::string::String {
8416 use std::clone::Clone;
8417 self.next_page_token.clone()
8418 }
8419}
8420
8421/// A request to delete a preview.
8422#[derive(Clone, Default, PartialEq)]
8423#[non_exhaustive]
8424pub struct DeletePreviewRequest {
8425 /// Required. The name of the Preview in the format:
8426 /// 'projects/{project_id}/locations/{location}/previews/{preview}'.
8427 pub name: std::string::String,
8428
8429 /// Optional. An optional request ID to identify requests. Specify a unique
8430 /// request ID so that if you must retry your request, the server will know to
8431 /// ignore the request if it has already been completed. The server will
8432 /// guarantee that for at least 60 minutes after the first request.
8433 ///
8434 /// For example, consider a situation where you make an initial request and the
8435 /// request times out. If you make the request again with the same request ID,
8436 /// the server can check if original operation with the same request ID was
8437 /// received, and if so, will ignore the second request. This prevents clients
8438 /// from accidentally creating duplicate commitments.
8439 ///
8440 /// The request ID must be a valid UUID with the exception that zero UUID is
8441 /// not supported (00000000-0000-0000-0000-000000000000).
8442 pub request_id: std::string::String,
8443
8444 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8445}
8446
8447impl DeletePreviewRequest {
8448 /// Creates a new default instance.
8449 pub fn new() -> Self {
8450 std::default::Default::default()
8451 }
8452
8453 /// Sets the value of [name][crate::model::DeletePreviewRequest::name].
8454 ///
8455 /// # Example
8456 /// ```ignore,no_run
8457 /// # use google_cloud_config_v1::model::DeletePreviewRequest;
8458 /// # let project_id = "project_id";
8459 /// # let location_id = "location_id";
8460 /// # let preview_id = "preview_id";
8461 /// let x = DeletePreviewRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/previews/{preview_id}"));
8462 /// ```
8463 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8464 self.name = v.into();
8465 self
8466 }
8467
8468 /// Sets the value of [request_id][crate::model::DeletePreviewRequest::request_id].
8469 ///
8470 /// # Example
8471 /// ```ignore,no_run
8472 /// # use google_cloud_config_v1::model::DeletePreviewRequest;
8473 /// let x = DeletePreviewRequest::new().set_request_id("example");
8474 /// ```
8475 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8476 self.request_id = v.into();
8477 self
8478 }
8479}
8480
8481impl wkt::message::Message for DeletePreviewRequest {
8482 fn typename() -> &'static str {
8483 "type.googleapis.com/google.cloud.config.v1.DeletePreviewRequest"
8484 }
8485}
8486
8487/// A request to export preview results.
8488#[derive(Clone, Default, PartialEq)]
8489#[non_exhaustive]
8490pub struct ExportPreviewResultRequest {
8491 /// Required. The preview whose results should be exported. The preview value
8492 /// is in the format:
8493 /// 'projects/{project_id}/locations/{location}/previews/{preview}'.
8494 pub parent: std::string::String,
8495
8496 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8497}
8498
8499impl ExportPreviewResultRequest {
8500 /// Creates a new default instance.
8501 pub fn new() -> Self {
8502 std::default::Default::default()
8503 }
8504
8505 /// Sets the value of [parent][crate::model::ExportPreviewResultRequest::parent].
8506 ///
8507 /// # Example
8508 /// ```ignore,no_run
8509 /// # use google_cloud_config_v1::model::ExportPreviewResultRequest;
8510 /// # let project_id = "project_id";
8511 /// # let location_id = "location_id";
8512 /// # let preview_id = "preview_id";
8513 /// let x = ExportPreviewResultRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/previews/{preview_id}"));
8514 /// ```
8515 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8516 self.parent = v.into();
8517 self
8518 }
8519}
8520
8521impl wkt::message::Message for ExportPreviewResultRequest {
8522 fn typename() -> &'static str {
8523 "type.googleapis.com/google.cloud.config.v1.ExportPreviewResultRequest"
8524 }
8525}
8526
8527/// A response to `ExportPreviewResult` call. Contains preview results.
8528#[derive(Clone, Default, PartialEq)]
8529#[non_exhaustive]
8530pub struct ExportPreviewResultResponse {
8531 /// Output only. Signed URLs for accessing the plan files.
8532 pub result: std::option::Option<crate::model::PreviewResult>,
8533
8534 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8535}
8536
8537impl ExportPreviewResultResponse {
8538 /// Creates a new default instance.
8539 pub fn new() -> Self {
8540 std::default::Default::default()
8541 }
8542
8543 /// Sets the value of [result][crate::model::ExportPreviewResultResponse::result].
8544 ///
8545 /// # Example
8546 /// ```ignore,no_run
8547 /// # use google_cloud_config_v1::model::ExportPreviewResultResponse;
8548 /// use google_cloud_config_v1::model::PreviewResult;
8549 /// let x = ExportPreviewResultResponse::new().set_result(PreviewResult::default()/* use setters */);
8550 /// ```
8551 pub fn set_result<T>(mut self, v: T) -> Self
8552 where
8553 T: std::convert::Into<crate::model::PreviewResult>,
8554 {
8555 self.result = std::option::Option::Some(v.into());
8556 self
8557 }
8558
8559 /// Sets or clears the value of [result][crate::model::ExportPreviewResultResponse::result].
8560 ///
8561 /// # Example
8562 /// ```ignore,no_run
8563 /// # use google_cloud_config_v1::model::ExportPreviewResultResponse;
8564 /// use google_cloud_config_v1::model::PreviewResult;
8565 /// let x = ExportPreviewResultResponse::new().set_or_clear_result(Some(PreviewResult::default()/* use setters */));
8566 /// let x = ExportPreviewResultResponse::new().set_or_clear_result(None::<PreviewResult>);
8567 /// ```
8568 pub fn set_or_clear_result<T>(mut self, v: std::option::Option<T>) -> Self
8569 where
8570 T: std::convert::Into<crate::model::PreviewResult>,
8571 {
8572 self.result = v.map(|x| x.into());
8573 self
8574 }
8575}
8576
8577impl wkt::message::Message for ExportPreviewResultResponse {
8578 fn typename() -> &'static str {
8579 "type.googleapis.com/google.cloud.config.v1.ExportPreviewResultResponse"
8580 }
8581}
8582
8583/// Contains a signed Cloud Storage URLs.
8584#[derive(Clone, Default, PartialEq)]
8585#[non_exhaustive]
8586pub struct PreviewResult {
8587 /// Output only. Plan binary signed URL
8588 pub binary_signed_uri: std::string::String,
8589
8590 /// Output only. Plan JSON signed URL
8591 pub json_signed_uri: std::string::String,
8592
8593 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8594}
8595
8596impl PreviewResult {
8597 /// Creates a new default instance.
8598 pub fn new() -> Self {
8599 std::default::Default::default()
8600 }
8601
8602 /// Sets the value of [binary_signed_uri][crate::model::PreviewResult::binary_signed_uri].
8603 ///
8604 /// # Example
8605 /// ```ignore,no_run
8606 /// # use google_cloud_config_v1::model::PreviewResult;
8607 /// let x = PreviewResult::new().set_binary_signed_uri("example");
8608 /// ```
8609 pub fn set_binary_signed_uri<T: std::convert::Into<std::string::String>>(
8610 mut self,
8611 v: T,
8612 ) -> Self {
8613 self.binary_signed_uri = v.into();
8614 self
8615 }
8616
8617 /// Sets the value of [json_signed_uri][crate::model::PreviewResult::json_signed_uri].
8618 ///
8619 /// # Example
8620 /// ```ignore,no_run
8621 /// # use google_cloud_config_v1::model::PreviewResult;
8622 /// let x = PreviewResult::new().set_json_signed_uri("example");
8623 /// ```
8624 pub fn set_json_signed_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8625 self.json_signed_uri = v.into();
8626 self
8627 }
8628}
8629
8630impl wkt::message::Message for PreviewResult {
8631 fn typename() -> &'static str {
8632 "type.googleapis.com/google.cloud.config.v1.PreviewResult"
8633 }
8634}
8635
8636/// The request message for the GetTerraformVersion method.
8637#[derive(Clone, Default, PartialEq)]
8638#[non_exhaustive]
8639pub struct GetTerraformVersionRequest {
8640 /// Required. The name of the TerraformVersion. Format:
8641 /// 'projects/{project_id}/locations/{location}/terraformVersions/{terraform_version}'
8642 pub name: std::string::String,
8643
8644 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8645}
8646
8647impl GetTerraformVersionRequest {
8648 /// Creates a new default instance.
8649 pub fn new() -> Self {
8650 std::default::Default::default()
8651 }
8652
8653 /// Sets the value of [name][crate::model::GetTerraformVersionRequest::name].
8654 ///
8655 /// # Example
8656 /// ```ignore,no_run
8657 /// # use google_cloud_config_v1::model::GetTerraformVersionRequest;
8658 /// # let project_id = "project_id";
8659 /// # let location_id = "location_id";
8660 /// # let terraform_version_id = "terraform_version_id";
8661 /// let x = GetTerraformVersionRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/terraformVersions/{terraform_version_id}"));
8662 /// ```
8663 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8664 self.name = v.into();
8665 self
8666 }
8667}
8668
8669impl wkt::message::Message for GetTerraformVersionRequest {
8670 fn typename() -> &'static str {
8671 "type.googleapis.com/google.cloud.config.v1.GetTerraformVersionRequest"
8672 }
8673}
8674
8675/// The request message for the ListTerraformVersions method.
8676#[derive(Clone, Default, PartialEq)]
8677#[non_exhaustive]
8678pub struct ListTerraformVersionsRequest {
8679 /// Required. The parent in whose context the TerraformVersions are listed. The
8680 /// parent value is in the format:
8681 /// 'projects/{project_id}/locations/{location}'.
8682 pub parent: std::string::String,
8683
8684 /// Optional. When requesting a page of terraform versions, 'page_size'
8685 /// specifies number of terraform versions to return. If unspecified, at most
8686 /// 500 will be returned. The maximum value is 1000.
8687 pub page_size: i32,
8688
8689 /// Optional. Token returned by previous call to 'ListTerraformVersions' which
8690 /// specifies the position in the list from where to continue listing the
8691 /// terraform versions.
8692 pub page_token: std::string::String,
8693
8694 /// Optional. Lists the TerraformVersions that match the filter expression. A
8695 /// filter expression filters the resources listed in the response. The
8696 /// expression must be of the form '{field} {operator} {value}' where
8697 /// operators: '<', '>',
8698 /// '<=', '>=', '!=', '=', ':' are supported (colon ':' represents a HAS
8699 /// operator which is roughly synonymous with equality). {field} can refer to a
8700 /// proto or JSON field, or a synthetic field. Field names can be camelCase or
8701 /// snake_case.
8702 pub filter: std::string::String,
8703
8704 /// Optional. Field to use to sort the list.
8705 pub order_by: std::string::String,
8706
8707 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8708}
8709
8710impl ListTerraformVersionsRequest {
8711 /// Creates a new default instance.
8712 pub fn new() -> Self {
8713 std::default::Default::default()
8714 }
8715
8716 /// Sets the value of [parent][crate::model::ListTerraformVersionsRequest::parent].
8717 ///
8718 /// # Example
8719 /// ```ignore,no_run
8720 /// # use google_cloud_config_v1::model::ListTerraformVersionsRequest;
8721 /// let x = ListTerraformVersionsRequest::new().set_parent("example");
8722 /// ```
8723 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8724 self.parent = v.into();
8725 self
8726 }
8727
8728 /// Sets the value of [page_size][crate::model::ListTerraformVersionsRequest::page_size].
8729 ///
8730 /// # Example
8731 /// ```ignore,no_run
8732 /// # use google_cloud_config_v1::model::ListTerraformVersionsRequest;
8733 /// let x = ListTerraformVersionsRequest::new().set_page_size(42);
8734 /// ```
8735 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8736 self.page_size = v.into();
8737 self
8738 }
8739
8740 /// Sets the value of [page_token][crate::model::ListTerraformVersionsRequest::page_token].
8741 ///
8742 /// # Example
8743 /// ```ignore,no_run
8744 /// # use google_cloud_config_v1::model::ListTerraformVersionsRequest;
8745 /// let x = ListTerraformVersionsRequest::new().set_page_token("example");
8746 /// ```
8747 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8748 self.page_token = v.into();
8749 self
8750 }
8751
8752 /// Sets the value of [filter][crate::model::ListTerraformVersionsRequest::filter].
8753 ///
8754 /// # Example
8755 /// ```ignore,no_run
8756 /// # use google_cloud_config_v1::model::ListTerraformVersionsRequest;
8757 /// let x = ListTerraformVersionsRequest::new().set_filter("example");
8758 /// ```
8759 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8760 self.filter = v.into();
8761 self
8762 }
8763
8764 /// Sets the value of [order_by][crate::model::ListTerraformVersionsRequest::order_by].
8765 ///
8766 /// # Example
8767 /// ```ignore,no_run
8768 /// # use google_cloud_config_v1::model::ListTerraformVersionsRequest;
8769 /// let x = ListTerraformVersionsRequest::new().set_order_by("example");
8770 /// ```
8771 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8772 self.order_by = v.into();
8773 self
8774 }
8775}
8776
8777impl wkt::message::Message for ListTerraformVersionsRequest {
8778 fn typename() -> &'static str {
8779 "type.googleapis.com/google.cloud.config.v1.ListTerraformVersionsRequest"
8780 }
8781}
8782
8783/// The response message for the `ListTerraformVersions` method.
8784#[derive(Clone, Default, PartialEq)]
8785#[non_exhaustive]
8786pub struct ListTerraformVersionsResponse {
8787 /// List of [TerraformVersion][google.cloud.config.v1.TerraformVersion]s.
8788 ///
8789 /// [google.cloud.config.v1.TerraformVersion]: crate::model::TerraformVersion
8790 pub terraform_versions: std::vec::Vec<crate::model::TerraformVersion>,
8791
8792 /// Token to be supplied to the next ListTerraformVersions request via
8793 /// `page_token` to obtain the next set of results.
8794 pub next_page_token: std::string::String,
8795
8796 /// Unreachable resources, if any.
8797 pub unreachable: std::vec::Vec<std::string::String>,
8798
8799 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8800}
8801
8802impl ListTerraformVersionsResponse {
8803 /// Creates a new default instance.
8804 pub fn new() -> Self {
8805 std::default::Default::default()
8806 }
8807
8808 /// Sets the value of [terraform_versions][crate::model::ListTerraformVersionsResponse::terraform_versions].
8809 ///
8810 /// # Example
8811 /// ```ignore,no_run
8812 /// # use google_cloud_config_v1::model::ListTerraformVersionsResponse;
8813 /// use google_cloud_config_v1::model::TerraformVersion;
8814 /// let x = ListTerraformVersionsResponse::new()
8815 /// .set_terraform_versions([
8816 /// TerraformVersion::default()/* use setters */,
8817 /// TerraformVersion::default()/* use (different) setters */,
8818 /// ]);
8819 /// ```
8820 pub fn set_terraform_versions<T, V>(mut self, v: T) -> Self
8821 where
8822 T: std::iter::IntoIterator<Item = V>,
8823 V: std::convert::Into<crate::model::TerraformVersion>,
8824 {
8825 use std::iter::Iterator;
8826 self.terraform_versions = v.into_iter().map(|i| i.into()).collect();
8827 self
8828 }
8829
8830 /// Sets the value of [next_page_token][crate::model::ListTerraformVersionsResponse::next_page_token].
8831 ///
8832 /// # Example
8833 /// ```ignore,no_run
8834 /// # use google_cloud_config_v1::model::ListTerraformVersionsResponse;
8835 /// let x = ListTerraformVersionsResponse::new().set_next_page_token("example");
8836 /// ```
8837 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8838 self.next_page_token = v.into();
8839 self
8840 }
8841
8842 /// Sets the value of [unreachable][crate::model::ListTerraformVersionsResponse::unreachable].
8843 ///
8844 /// # Example
8845 /// ```ignore,no_run
8846 /// # use google_cloud_config_v1::model::ListTerraformVersionsResponse;
8847 /// let x = ListTerraformVersionsResponse::new().set_unreachable(["a", "b", "c"]);
8848 /// ```
8849 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
8850 where
8851 T: std::iter::IntoIterator<Item = V>,
8852 V: std::convert::Into<std::string::String>,
8853 {
8854 use std::iter::Iterator;
8855 self.unreachable = v.into_iter().map(|i| i.into()).collect();
8856 self
8857 }
8858}
8859
8860impl wkt::message::Message for ListTerraformVersionsResponse {
8861 fn typename() -> &'static str {
8862 "type.googleapis.com/google.cloud.config.v1.ListTerraformVersionsResponse"
8863 }
8864}
8865
8866#[doc(hidden)]
8867impl google_cloud_gax::paginator::internal::PageableResponse for ListTerraformVersionsResponse {
8868 type PageItem = crate::model::TerraformVersion;
8869
8870 fn items(self) -> std::vec::Vec<Self::PageItem> {
8871 self.terraform_versions
8872 }
8873
8874 fn next_page_token(&self) -> std::string::String {
8875 use std::clone::Clone;
8876 self.next_page_token.clone()
8877 }
8878}
8879
8880/// A TerraformVersion represents the support state the corresponding
8881/// Terraform version.
8882#[derive(Clone, Default, PartialEq)]
8883#[non_exhaustive]
8884pub struct TerraformVersion {
8885 /// Identifier. The version name is in the format:
8886 /// 'projects/{project_id}/locations/{location}/terraformVersions/{terraform_version}'.
8887 pub name: std::string::String,
8888
8889 /// Output only. The state of the version, ACTIVE, DEPRECATED or OBSOLETE.
8890 pub state: crate::model::terraform_version::State,
8891
8892 /// Output only. When the version is supported.
8893 pub support_time: std::option::Option<wkt::Timestamp>,
8894
8895 /// Output only. When the version is deprecated.
8896 pub deprecate_time: std::option::Option<wkt::Timestamp>,
8897
8898 /// Output only. When the version is obsolete.
8899 pub obsolete_time: std::option::Option<wkt::Timestamp>,
8900
8901 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8902}
8903
8904impl TerraformVersion {
8905 /// Creates a new default instance.
8906 pub fn new() -> Self {
8907 std::default::Default::default()
8908 }
8909
8910 /// Sets the value of [name][crate::model::TerraformVersion::name].
8911 ///
8912 /// # Example
8913 /// ```ignore,no_run
8914 /// # use google_cloud_config_v1::model::TerraformVersion;
8915 /// # let project_id = "project_id";
8916 /// # let location_id = "location_id";
8917 /// # let terraform_version_id = "terraform_version_id";
8918 /// let x = TerraformVersion::new().set_name(format!("projects/{project_id}/locations/{location_id}/terraformVersions/{terraform_version_id}"));
8919 /// ```
8920 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8921 self.name = v.into();
8922 self
8923 }
8924
8925 /// Sets the value of [state][crate::model::TerraformVersion::state].
8926 ///
8927 /// # Example
8928 /// ```ignore,no_run
8929 /// # use google_cloud_config_v1::model::TerraformVersion;
8930 /// use google_cloud_config_v1::model::terraform_version::State;
8931 /// let x0 = TerraformVersion::new().set_state(State::Active);
8932 /// let x1 = TerraformVersion::new().set_state(State::Deprecated);
8933 /// let x2 = TerraformVersion::new().set_state(State::Obsolete);
8934 /// ```
8935 pub fn set_state<T: std::convert::Into<crate::model::terraform_version::State>>(
8936 mut self,
8937 v: T,
8938 ) -> Self {
8939 self.state = v.into();
8940 self
8941 }
8942
8943 /// Sets the value of [support_time][crate::model::TerraformVersion::support_time].
8944 ///
8945 /// # Example
8946 /// ```ignore,no_run
8947 /// # use google_cloud_config_v1::model::TerraformVersion;
8948 /// use wkt::Timestamp;
8949 /// let x = TerraformVersion::new().set_support_time(Timestamp::default()/* use setters */);
8950 /// ```
8951 pub fn set_support_time<T>(mut self, v: T) -> Self
8952 where
8953 T: std::convert::Into<wkt::Timestamp>,
8954 {
8955 self.support_time = std::option::Option::Some(v.into());
8956 self
8957 }
8958
8959 /// Sets or clears the value of [support_time][crate::model::TerraformVersion::support_time].
8960 ///
8961 /// # Example
8962 /// ```ignore,no_run
8963 /// # use google_cloud_config_v1::model::TerraformVersion;
8964 /// use wkt::Timestamp;
8965 /// let x = TerraformVersion::new().set_or_clear_support_time(Some(Timestamp::default()/* use setters */));
8966 /// let x = TerraformVersion::new().set_or_clear_support_time(None::<Timestamp>);
8967 /// ```
8968 pub fn set_or_clear_support_time<T>(mut self, v: std::option::Option<T>) -> Self
8969 where
8970 T: std::convert::Into<wkt::Timestamp>,
8971 {
8972 self.support_time = v.map(|x| x.into());
8973 self
8974 }
8975
8976 /// Sets the value of [deprecate_time][crate::model::TerraformVersion::deprecate_time].
8977 ///
8978 /// # Example
8979 /// ```ignore,no_run
8980 /// # use google_cloud_config_v1::model::TerraformVersion;
8981 /// use wkt::Timestamp;
8982 /// let x = TerraformVersion::new().set_deprecate_time(Timestamp::default()/* use setters */);
8983 /// ```
8984 pub fn set_deprecate_time<T>(mut self, v: T) -> Self
8985 where
8986 T: std::convert::Into<wkt::Timestamp>,
8987 {
8988 self.deprecate_time = std::option::Option::Some(v.into());
8989 self
8990 }
8991
8992 /// Sets or clears the value of [deprecate_time][crate::model::TerraformVersion::deprecate_time].
8993 ///
8994 /// # Example
8995 /// ```ignore,no_run
8996 /// # use google_cloud_config_v1::model::TerraformVersion;
8997 /// use wkt::Timestamp;
8998 /// let x = TerraformVersion::new().set_or_clear_deprecate_time(Some(Timestamp::default()/* use setters */));
8999 /// let x = TerraformVersion::new().set_or_clear_deprecate_time(None::<Timestamp>);
9000 /// ```
9001 pub fn set_or_clear_deprecate_time<T>(mut self, v: std::option::Option<T>) -> Self
9002 where
9003 T: std::convert::Into<wkt::Timestamp>,
9004 {
9005 self.deprecate_time = v.map(|x| x.into());
9006 self
9007 }
9008
9009 /// Sets the value of [obsolete_time][crate::model::TerraformVersion::obsolete_time].
9010 ///
9011 /// # Example
9012 /// ```ignore,no_run
9013 /// # use google_cloud_config_v1::model::TerraformVersion;
9014 /// use wkt::Timestamp;
9015 /// let x = TerraformVersion::new().set_obsolete_time(Timestamp::default()/* use setters */);
9016 /// ```
9017 pub fn set_obsolete_time<T>(mut self, v: T) -> Self
9018 where
9019 T: std::convert::Into<wkt::Timestamp>,
9020 {
9021 self.obsolete_time = std::option::Option::Some(v.into());
9022 self
9023 }
9024
9025 /// Sets or clears the value of [obsolete_time][crate::model::TerraformVersion::obsolete_time].
9026 ///
9027 /// # Example
9028 /// ```ignore,no_run
9029 /// # use google_cloud_config_v1::model::TerraformVersion;
9030 /// use wkt::Timestamp;
9031 /// let x = TerraformVersion::new().set_or_clear_obsolete_time(Some(Timestamp::default()/* use setters */));
9032 /// let x = TerraformVersion::new().set_or_clear_obsolete_time(None::<Timestamp>);
9033 /// ```
9034 pub fn set_or_clear_obsolete_time<T>(mut self, v: std::option::Option<T>) -> Self
9035 where
9036 T: std::convert::Into<wkt::Timestamp>,
9037 {
9038 self.obsolete_time = v.map(|x| x.into());
9039 self
9040 }
9041}
9042
9043impl wkt::message::Message for TerraformVersion {
9044 fn typename() -> &'static str {
9045 "type.googleapis.com/google.cloud.config.v1.TerraformVersion"
9046 }
9047}
9048
9049/// Defines additional types related to [TerraformVersion].
9050pub mod terraform_version {
9051 #[allow(unused_imports)]
9052 use super::*;
9053
9054 /// Possible states of a TerraformVersion.
9055 ///
9056 /// # Working with unknown values
9057 ///
9058 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9059 /// additional enum variants at any time. Adding new variants is not considered
9060 /// a breaking change. Applications should write their code in anticipation of:
9061 ///
9062 /// - New values appearing in future releases of the client library, **and**
9063 /// - New values received dynamically, without application changes.
9064 ///
9065 /// Please consult the [Working with enums] section in the user guide for some
9066 /// guidelines.
9067 ///
9068 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
9069 #[derive(Clone, Debug, PartialEq)]
9070 #[non_exhaustive]
9071 pub enum State {
9072 /// The default value. This value is used if the state is omitted.
9073 Unspecified,
9074 /// The version is actively supported.
9075 Active,
9076 /// The version is deprecated.
9077 Deprecated,
9078 /// The version is obsolete.
9079 Obsolete,
9080 /// If set, the enum was initialized with an unknown value.
9081 ///
9082 /// Applications can examine the value using [State::value] or
9083 /// [State::name].
9084 UnknownValue(state::UnknownValue),
9085 }
9086
9087 #[doc(hidden)]
9088 pub mod state {
9089 #[allow(unused_imports)]
9090 use super::*;
9091 #[derive(Clone, Debug, PartialEq)]
9092 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9093 }
9094
9095 impl State {
9096 /// Gets the enum value.
9097 ///
9098 /// Returns `None` if the enum contains an unknown value deserialized from
9099 /// the string representation of enums.
9100 pub fn value(&self) -> std::option::Option<i32> {
9101 match self {
9102 Self::Unspecified => std::option::Option::Some(0),
9103 Self::Active => std::option::Option::Some(1),
9104 Self::Deprecated => std::option::Option::Some(2),
9105 Self::Obsolete => std::option::Option::Some(3),
9106 Self::UnknownValue(u) => u.0.value(),
9107 }
9108 }
9109
9110 /// Gets the enum value as a string.
9111 ///
9112 /// Returns `None` if the enum contains an unknown value deserialized from
9113 /// the integer representation of enums.
9114 pub fn name(&self) -> std::option::Option<&str> {
9115 match self {
9116 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
9117 Self::Active => std::option::Option::Some("ACTIVE"),
9118 Self::Deprecated => std::option::Option::Some("DEPRECATED"),
9119 Self::Obsolete => std::option::Option::Some("OBSOLETE"),
9120 Self::UnknownValue(u) => u.0.name(),
9121 }
9122 }
9123 }
9124
9125 impl std::default::Default for State {
9126 fn default() -> Self {
9127 use std::convert::From;
9128 Self::from(0)
9129 }
9130 }
9131
9132 impl std::fmt::Display for State {
9133 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9134 wkt::internal::display_enum(f, self.name(), self.value())
9135 }
9136 }
9137
9138 impl std::convert::From<i32> for State {
9139 fn from(value: i32) -> Self {
9140 match value {
9141 0 => Self::Unspecified,
9142 1 => Self::Active,
9143 2 => Self::Deprecated,
9144 3 => Self::Obsolete,
9145 _ => Self::UnknownValue(state::UnknownValue(
9146 wkt::internal::UnknownEnumValue::Integer(value),
9147 )),
9148 }
9149 }
9150 }
9151
9152 impl std::convert::From<&str> for State {
9153 fn from(value: &str) -> Self {
9154 use std::string::ToString;
9155 match value {
9156 "STATE_UNSPECIFIED" => Self::Unspecified,
9157 "ACTIVE" => Self::Active,
9158 "DEPRECATED" => Self::Deprecated,
9159 "OBSOLETE" => Self::Obsolete,
9160 _ => Self::UnknownValue(state::UnknownValue(
9161 wkt::internal::UnknownEnumValue::String(value.to_string()),
9162 )),
9163 }
9164 }
9165 }
9166
9167 impl serde::ser::Serialize for State {
9168 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9169 where
9170 S: serde::Serializer,
9171 {
9172 match self {
9173 Self::Unspecified => serializer.serialize_i32(0),
9174 Self::Active => serializer.serialize_i32(1),
9175 Self::Deprecated => serializer.serialize_i32(2),
9176 Self::Obsolete => serializer.serialize_i32(3),
9177 Self::UnknownValue(u) => u.0.serialize(serializer),
9178 }
9179 }
9180 }
9181
9182 impl<'de> serde::de::Deserialize<'de> for State {
9183 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9184 where
9185 D: serde::Deserializer<'de>,
9186 {
9187 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
9188 ".google.cloud.config.v1.TerraformVersion.State",
9189 ))
9190 }
9191 }
9192}
9193
9194/// Terraform info of a ResourceChange.
9195#[derive(Clone, Default, PartialEq)]
9196#[non_exhaustive]
9197pub struct ResourceChangeTerraformInfo {
9198 /// Output only. TF resource address that uniquely identifies the resource.
9199 pub address: std::string::String,
9200
9201 /// Output only. TF resource type.
9202 pub r#type: std::string::String,
9203
9204 /// Output only. TF resource name.
9205 pub resource_name: std::string::String,
9206
9207 /// Output only. TF resource provider.
9208 pub provider: std::string::String,
9209
9210 /// Output only. TF resource actions.
9211 pub actions: std::vec::Vec<std::string::String>,
9212
9213 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9214}
9215
9216impl ResourceChangeTerraformInfo {
9217 /// Creates a new default instance.
9218 pub fn new() -> Self {
9219 std::default::Default::default()
9220 }
9221
9222 /// Sets the value of [address][crate::model::ResourceChangeTerraformInfo::address].
9223 ///
9224 /// # Example
9225 /// ```ignore,no_run
9226 /// # use google_cloud_config_v1::model::ResourceChangeTerraformInfo;
9227 /// let x = ResourceChangeTerraformInfo::new().set_address("example");
9228 /// ```
9229 pub fn set_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9230 self.address = v.into();
9231 self
9232 }
9233
9234 /// Sets the value of [r#type][crate::model::ResourceChangeTerraformInfo::type].
9235 ///
9236 /// # Example
9237 /// ```ignore,no_run
9238 /// # use google_cloud_config_v1::model::ResourceChangeTerraformInfo;
9239 /// let x = ResourceChangeTerraformInfo::new().set_type("example");
9240 /// ```
9241 pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9242 self.r#type = v.into();
9243 self
9244 }
9245
9246 /// Sets the value of [resource_name][crate::model::ResourceChangeTerraformInfo::resource_name].
9247 ///
9248 /// # Example
9249 /// ```ignore,no_run
9250 /// # use google_cloud_config_v1::model::ResourceChangeTerraformInfo;
9251 /// let x = ResourceChangeTerraformInfo::new().set_resource_name("example");
9252 /// ```
9253 pub fn set_resource_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9254 self.resource_name = v.into();
9255 self
9256 }
9257
9258 /// Sets the value of [provider][crate::model::ResourceChangeTerraformInfo::provider].
9259 ///
9260 /// # Example
9261 /// ```ignore,no_run
9262 /// # use google_cloud_config_v1::model::ResourceChangeTerraformInfo;
9263 /// let x = ResourceChangeTerraformInfo::new().set_provider("example");
9264 /// ```
9265 pub fn set_provider<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9266 self.provider = v.into();
9267 self
9268 }
9269
9270 /// Sets the value of [actions][crate::model::ResourceChangeTerraformInfo::actions].
9271 ///
9272 /// # Example
9273 /// ```ignore,no_run
9274 /// # use google_cloud_config_v1::model::ResourceChangeTerraformInfo;
9275 /// let x = ResourceChangeTerraformInfo::new().set_actions(["a", "b", "c"]);
9276 /// ```
9277 pub fn set_actions<T, V>(mut self, v: T) -> Self
9278 where
9279 T: std::iter::IntoIterator<Item = V>,
9280 V: std::convert::Into<std::string::String>,
9281 {
9282 use std::iter::Iterator;
9283 self.actions = v.into_iter().map(|i| i.into()).collect();
9284 self
9285 }
9286}
9287
9288impl wkt::message::Message for ResourceChangeTerraformInfo {
9289 fn typename() -> &'static str {
9290 "type.googleapis.com/google.cloud.config.v1.ResourceChangeTerraformInfo"
9291 }
9292}
9293
9294/// A resource change represents a change to a resource in the state file.
9295#[derive(Clone, Default, PartialEq)]
9296#[non_exhaustive]
9297pub struct ResourceChange {
9298 /// Identifier. The name of the resource change.
9299 /// Format:
9300 /// 'projects/{project_id}/locations/{location}/previews/{preview}/resourceChanges/{resource_change}'.
9301 pub name: std::string::String,
9302
9303 /// Output only. Terraform info of the resource change.
9304 pub terraform_info: std::option::Option<crate::model::ResourceChangeTerraformInfo>,
9305
9306 /// Output only. The intent of the resource change.
9307 pub intent: crate::model::resource_change::Intent,
9308
9309 /// Output only. The property changes of the resource change.
9310 pub property_changes: std::vec::Vec<crate::model::PropertyChange>,
9311
9312 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9313}
9314
9315impl ResourceChange {
9316 /// Creates a new default instance.
9317 pub fn new() -> Self {
9318 std::default::Default::default()
9319 }
9320
9321 /// Sets the value of [name][crate::model::ResourceChange::name].
9322 ///
9323 /// # Example
9324 /// ```ignore,no_run
9325 /// # use google_cloud_config_v1::model::ResourceChange;
9326 /// # let project_id = "project_id";
9327 /// # let location_id = "location_id";
9328 /// # let preview_id = "preview_id";
9329 /// # let resource_change_id = "resource_change_id";
9330 /// let x = ResourceChange::new().set_name(format!("projects/{project_id}/locations/{location_id}/previews/{preview_id}/resourceChanges/{resource_change_id}"));
9331 /// ```
9332 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9333 self.name = v.into();
9334 self
9335 }
9336
9337 /// Sets the value of [terraform_info][crate::model::ResourceChange::terraform_info].
9338 ///
9339 /// # Example
9340 /// ```ignore,no_run
9341 /// # use google_cloud_config_v1::model::ResourceChange;
9342 /// use google_cloud_config_v1::model::ResourceChangeTerraformInfo;
9343 /// let x = ResourceChange::new().set_terraform_info(ResourceChangeTerraformInfo::default()/* use setters */);
9344 /// ```
9345 pub fn set_terraform_info<T>(mut self, v: T) -> Self
9346 where
9347 T: std::convert::Into<crate::model::ResourceChangeTerraformInfo>,
9348 {
9349 self.terraform_info = std::option::Option::Some(v.into());
9350 self
9351 }
9352
9353 /// Sets or clears the value of [terraform_info][crate::model::ResourceChange::terraform_info].
9354 ///
9355 /// # Example
9356 /// ```ignore,no_run
9357 /// # use google_cloud_config_v1::model::ResourceChange;
9358 /// use google_cloud_config_v1::model::ResourceChangeTerraformInfo;
9359 /// let x = ResourceChange::new().set_or_clear_terraform_info(Some(ResourceChangeTerraformInfo::default()/* use setters */));
9360 /// let x = ResourceChange::new().set_or_clear_terraform_info(None::<ResourceChangeTerraformInfo>);
9361 /// ```
9362 pub fn set_or_clear_terraform_info<T>(mut self, v: std::option::Option<T>) -> Self
9363 where
9364 T: std::convert::Into<crate::model::ResourceChangeTerraformInfo>,
9365 {
9366 self.terraform_info = v.map(|x| x.into());
9367 self
9368 }
9369
9370 /// Sets the value of [intent][crate::model::ResourceChange::intent].
9371 ///
9372 /// # Example
9373 /// ```ignore,no_run
9374 /// # use google_cloud_config_v1::model::ResourceChange;
9375 /// use google_cloud_config_v1::model::resource_change::Intent;
9376 /// let x0 = ResourceChange::new().set_intent(Intent::Create);
9377 /// let x1 = ResourceChange::new().set_intent(Intent::Update);
9378 /// let x2 = ResourceChange::new().set_intent(Intent::Delete);
9379 /// ```
9380 pub fn set_intent<T: std::convert::Into<crate::model::resource_change::Intent>>(
9381 mut self,
9382 v: T,
9383 ) -> Self {
9384 self.intent = v.into();
9385 self
9386 }
9387
9388 /// Sets the value of [property_changes][crate::model::ResourceChange::property_changes].
9389 ///
9390 /// # Example
9391 /// ```ignore,no_run
9392 /// # use google_cloud_config_v1::model::ResourceChange;
9393 /// use google_cloud_config_v1::model::PropertyChange;
9394 /// let x = ResourceChange::new()
9395 /// .set_property_changes([
9396 /// PropertyChange::default()/* use setters */,
9397 /// PropertyChange::default()/* use (different) setters */,
9398 /// ]);
9399 /// ```
9400 pub fn set_property_changes<T, V>(mut self, v: T) -> Self
9401 where
9402 T: std::iter::IntoIterator<Item = V>,
9403 V: std::convert::Into<crate::model::PropertyChange>,
9404 {
9405 use std::iter::Iterator;
9406 self.property_changes = v.into_iter().map(|i| i.into()).collect();
9407 self
9408 }
9409}
9410
9411impl wkt::message::Message for ResourceChange {
9412 fn typename() -> &'static str {
9413 "type.googleapis.com/google.cloud.config.v1.ResourceChange"
9414 }
9415}
9416
9417/// Defines additional types related to [ResourceChange].
9418pub mod resource_change {
9419 #[allow(unused_imports)]
9420 use super::*;
9421
9422 /// Possible intent of the resource change.
9423 ///
9424 /// # Working with unknown values
9425 ///
9426 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9427 /// additional enum variants at any time. Adding new variants is not considered
9428 /// a breaking change. Applications should write their code in anticipation of:
9429 ///
9430 /// - New values appearing in future releases of the client library, **and**
9431 /// - New values received dynamically, without application changes.
9432 ///
9433 /// Please consult the [Working with enums] section in the user guide for some
9434 /// guidelines.
9435 ///
9436 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
9437 #[derive(Clone, Debug, PartialEq)]
9438 #[non_exhaustive]
9439 pub enum Intent {
9440 /// The default value.
9441 Unspecified,
9442 /// The resource will be created.
9443 Create,
9444 /// The resource will be updated.
9445 Update,
9446 /// The resource will be deleted.
9447 Delete,
9448 /// The resource will be recreated.
9449 Recreate,
9450 /// The resource will be untouched.
9451 Unchanged,
9452 /// If set, the enum was initialized with an unknown value.
9453 ///
9454 /// Applications can examine the value using [Intent::value] or
9455 /// [Intent::name].
9456 UnknownValue(intent::UnknownValue),
9457 }
9458
9459 #[doc(hidden)]
9460 pub mod intent {
9461 #[allow(unused_imports)]
9462 use super::*;
9463 #[derive(Clone, Debug, PartialEq)]
9464 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9465 }
9466
9467 impl Intent {
9468 /// Gets the enum value.
9469 ///
9470 /// Returns `None` if the enum contains an unknown value deserialized from
9471 /// the string representation of enums.
9472 pub fn value(&self) -> std::option::Option<i32> {
9473 match self {
9474 Self::Unspecified => std::option::Option::Some(0),
9475 Self::Create => std::option::Option::Some(1),
9476 Self::Update => std::option::Option::Some(2),
9477 Self::Delete => std::option::Option::Some(3),
9478 Self::Recreate => std::option::Option::Some(4),
9479 Self::Unchanged => std::option::Option::Some(5),
9480 Self::UnknownValue(u) => u.0.value(),
9481 }
9482 }
9483
9484 /// Gets the enum value as a string.
9485 ///
9486 /// Returns `None` if the enum contains an unknown value deserialized from
9487 /// the integer representation of enums.
9488 pub fn name(&self) -> std::option::Option<&str> {
9489 match self {
9490 Self::Unspecified => std::option::Option::Some("INTENT_UNSPECIFIED"),
9491 Self::Create => std::option::Option::Some("CREATE"),
9492 Self::Update => std::option::Option::Some("UPDATE"),
9493 Self::Delete => std::option::Option::Some("DELETE"),
9494 Self::Recreate => std::option::Option::Some("RECREATE"),
9495 Self::Unchanged => std::option::Option::Some("UNCHANGED"),
9496 Self::UnknownValue(u) => u.0.name(),
9497 }
9498 }
9499 }
9500
9501 impl std::default::Default for Intent {
9502 fn default() -> Self {
9503 use std::convert::From;
9504 Self::from(0)
9505 }
9506 }
9507
9508 impl std::fmt::Display for Intent {
9509 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9510 wkt::internal::display_enum(f, self.name(), self.value())
9511 }
9512 }
9513
9514 impl std::convert::From<i32> for Intent {
9515 fn from(value: i32) -> Self {
9516 match value {
9517 0 => Self::Unspecified,
9518 1 => Self::Create,
9519 2 => Self::Update,
9520 3 => Self::Delete,
9521 4 => Self::Recreate,
9522 5 => Self::Unchanged,
9523 _ => Self::UnknownValue(intent::UnknownValue(
9524 wkt::internal::UnknownEnumValue::Integer(value),
9525 )),
9526 }
9527 }
9528 }
9529
9530 impl std::convert::From<&str> for Intent {
9531 fn from(value: &str) -> Self {
9532 use std::string::ToString;
9533 match value {
9534 "INTENT_UNSPECIFIED" => Self::Unspecified,
9535 "CREATE" => Self::Create,
9536 "UPDATE" => Self::Update,
9537 "DELETE" => Self::Delete,
9538 "RECREATE" => Self::Recreate,
9539 "UNCHANGED" => Self::Unchanged,
9540 _ => Self::UnknownValue(intent::UnknownValue(
9541 wkt::internal::UnknownEnumValue::String(value.to_string()),
9542 )),
9543 }
9544 }
9545 }
9546
9547 impl serde::ser::Serialize for Intent {
9548 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9549 where
9550 S: serde::Serializer,
9551 {
9552 match self {
9553 Self::Unspecified => serializer.serialize_i32(0),
9554 Self::Create => serializer.serialize_i32(1),
9555 Self::Update => serializer.serialize_i32(2),
9556 Self::Delete => serializer.serialize_i32(3),
9557 Self::Recreate => serializer.serialize_i32(4),
9558 Self::Unchanged => serializer.serialize_i32(5),
9559 Self::UnknownValue(u) => u.0.serialize(serializer),
9560 }
9561 }
9562 }
9563
9564 impl<'de> serde::de::Deserialize<'de> for Intent {
9565 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9566 where
9567 D: serde::Deserializer<'de>,
9568 {
9569 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Intent>::new(
9570 ".google.cloud.config.v1.ResourceChange.Intent",
9571 ))
9572 }
9573 }
9574}
9575
9576/// A property change represents a change to a property in the state file.
9577#[derive(Clone, Default, PartialEq)]
9578#[non_exhaustive]
9579pub struct PropertyChange {
9580 /// Output only. The path of the property change.
9581 pub path: std::string::String,
9582
9583 /// Output only. The paths of sensitive fields in `before`. Paths are relative
9584 /// to `path`.
9585 pub before_sensitive_paths: std::vec::Vec<std::string::String>,
9586
9587 /// Output only. Representations of the object value before the actions.
9588 pub before: std::option::Option<wkt::Value>,
9589
9590 /// Output only. The paths of sensitive fields in `after`. Paths are relative
9591 /// to `path`.
9592 pub after_sensitive_paths: std::vec::Vec<std::string::String>,
9593
9594 /// Output only. Representations of the object value after the actions.
9595 pub after: std::option::Option<wkt::Value>,
9596
9597 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9598}
9599
9600impl PropertyChange {
9601 /// Creates a new default instance.
9602 pub fn new() -> Self {
9603 std::default::Default::default()
9604 }
9605
9606 /// Sets the value of [path][crate::model::PropertyChange::path].
9607 ///
9608 /// # Example
9609 /// ```ignore,no_run
9610 /// # use google_cloud_config_v1::model::PropertyChange;
9611 /// let x = PropertyChange::new().set_path("example");
9612 /// ```
9613 pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9614 self.path = v.into();
9615 self
9616 }
9617
9618 /// Sets the value of [before_sensitive_paths][crate::model::PropertyChange::before_sensitive_paths].
9619 ///
9620 /// # Example
9621 /// ```ignore,no_run
9622 /// # use google_cloud_config_v1::model::PropertyChange;
9623 /// let x = PropertyChange::new().set_before_sensitive_paths(["a", "b", "c"]);
9624 /// ```
9625 pub fn set_before_sensitive_paths<T, V>(mut self, v: T) -> Self
9626 where
9627 T: std::iter::IntoIterator<Item = V>,
9628 V: std::convert::Into<std::string::String>,
9629 {
9630 use std::iter::Iterator;
9631 self.before_sensitive_paths = v.into_iter().map(|i| i.into()).collect();
9632 self
9633 }
9634
9635 /// Sets the value of [before][crate::model::PropertyChange::before].
9636 ///
9637 /// # Example
9638 /// ```ignore,no_run
9639 /// # use google_cloud_config_v1::model::PropertyChange;
9640 /// use wkt::Value;
9641 /// let x = PropertyChange::new().set_before(Value::default()/* use setters */);
9642 /// ```
9643 pub fn set_before<T>(mut self, v: T) -> Self
9644 where
9645 T: std::convert::Into<wkt::Value>,
9646 {
9647 self.before = std::option::Option::Some(v.into());
9648 self
9649 }
9650
9651 /// Sets or clears the value of [before][crate::model::PropertyChange::before].
9652 ///
9653 /// # Example
9654 /// ```ignore,no_run
9655 /// # use google_cloud_config_v1::model::PropertyChange;
9656 /// use wkt::Value;
9657 /// let x = PropertyChange::new().set_or_clear_before(Some(Value::default()/* use setters */));
9658 /// let x = PropertyChange::new().set_or_clear_before(None::<Value>);
9659 /// ```
9660 pub fn set_or_clear_before<T>(mut self, v: std::option::Option<T>) -> Self
9661 where
9662 T: std::convert::Into<wkt::Value>,
9663 {
9664 self.before = v.map(|x| x.into());
9665 self
9666 }
9667
9668 /// Sets the value of [after_sensitive_paths][crate::model::PropertyChange::after_sensitive_paths].
9669 ///
9670 /// # Example
9671 /// ```ignore,no_run
9672 /// # use google_cloud_config_v1::model::PropertyChange;
9673 /// let x = PropertyChange::new().set_after_sensitive_paths(["a", "b", "c"]);
9674 /// ```
9675 pub fn set_after_sensitive_paths<T, V>(mut self, v: T) -> Self
9676 where
9677 T: std::iter::IntoIterator<Item = V>,
9678 V: std::convert::Into<std::string::String>,
9679 {
9680 use std::iter::Iterator;
9681 self.after_sensitive_paths = v.into_iter().map(|i| i.into()).collect();
9682 self
9683 }
9684
9685 /// Sets the value of [after][crate::model::PropertyChange::after].
9686 ///
9687 /// # Example
9688 /// ```ignore,no_run
9689 /// # use google_cloud_config_v1::model::PropertyChange;
9690 /// use wkt::Value;
9691 /// let x = PropertyChange::new().set_after(Value::default()/* use setters */);
9692 /// ```
9693 pub fn set_after<T>(mut self, v: T) -> Self
9694 where
9695 T: std::convert::Into<wkt::Value>,
9696 {
9697 self.after = std::option::Option::Some(v.into());
9698 self
9699 }
9700
9701 /// Sets or clears the value of [after][crate::model::PropertyChange::after].
9702 ///
9703 /// # Example
9704 /// ```ignore,no_run
9705 /// # use google_cloud_config_v1::model::PropertyChange;
9706 /// use wkt::Value;
9707 /// let x = PropertyChange::new().set_or_clear_after(Some(Value::default()/* use setters */));
9708 /// let x = PropertyChange::new().set_or_clear_after(None::<Value>);
9709 /// ```
9710 pub fn set_or_clear_after<T>(mut self, v: std::option::Option<T>) -> Self
9711 where
9712 T: std::convert::Into<wkt::Value>,
9713 {
9714 self.after = v.map(|x| x.into());
9715 self
9716 }
9717}
9718
9719impl wkt::message::Message for PropertyChange {
9720 fn typename() -> &'static str {
9721 "type.googleapis.com/google.cloud.config.v1.PropertyChange"
9722 }
9723}
9724
9725/// The request message for the ListResourceChanges method.
9726#[derive(Clone, Default, PartialEq)]
9727#[non_exhaustive]
9728pub struct ListResourceChangesRequest {
9729 /// Required. The parent in whose context the ResourceChanges are listed. The
9730 /// parent value is in the format:
9731 /// 'projects/{project_id}/locations/{location}/previews/{preview}'.
9732 pub parent: std::string::String,
9733
9734 /// Optional. When requesting a page of resource changes, 'page_size' specifies
9735 /// number of resource changes to return. If unspecified, at most 500 will be
9736 /// returned. The maximum value is 1000.
9737 pub page_size: i32,
9738
9739 /// Optional. Token returned by previous call to 'ListResourceChanges' which
9740 /// specifies the position in the list from where to continue listing the
9741 /// resource changes.
9742 pub page_token: std::string::String,
9743
9744 /// Optional. Lists the resource changes that match the filter expression. A
9745 /// filter expression filters the resource changes listed in the response. The
9746 /// expression must be of the form '{field} {operator} {value}' where
9747 /// operators: '<', '>',
9748 /// '<=',
9749 /// '>=',
9750 /// '!=', '=', ':' are supported (colon ':' represents a HAS operator which is
9751 /// roughly synonymous with equality). {field} can refer to a proto or JSON
9752 /// field, or a synthetic field. Field names can be camelCase or snake_case.
9753 ///
9754 /// Examples:
9755 ///
9756 /// - Filter by name:
9757 /// name =
9758 /// "projects/foo/locations/us-central1/previews/dep/resourceChanges/baz
9759 pub filter: std::string::String,
9760
9761 /// Optional. Field to use to sort the list.
9762 pub order_by: std::string::String,
9763
9764 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9765}
9766
9767impl ListResourceChangesRequest {
9768 /// Creates a new default instance.
9769 pub fn new() -> Self {
9770 std::default::Default::default()
9771 }
9772
9773 /// Sets the value of [parent][crate::model::ListResourceChangesRequest::parent].
9774 ///
9775 /// # Example
9776 /// ```ignore,no_run
9777 /// # use google_cloud_config_v1::model::ListResourceChangesRequest;
9778 /// # let project_id = "project_id";
9779 /// # let location_id = "location_id";
9780 /// # let preview_id = "preview_id";
9781 /// let x = ListResourceChangesRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/previews/{preview_id}"));
9782 /// ```
9783 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9784 self.parent = v.into();
9785 self
9786 }
9787
9788 /// Sets the value of [page_size][crate::model::ListResourceChangesRequest::page_size].
9789 ///
9790 /// # Example
9791 /// ```ignore,no_run
9792 /// # use google_cloud_config_v1::model::ListResourceChangesRequest;
9793 /// let x = ListResourceChangesRequest::new().set_page_size(42);
9794 /// ```
9795 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9796 self.page_size = v.into();
9797 self
9798 }
9799
9800 /// Sets the value of [page_token][crate::model::ListResourceChangesRequest::page_token].
9801 ///
9802 /// # Example
9803 /// ```ignore,no_run
9804 /// # use google_cloud_config_v1::model::ListResourceChangesRequest;
9805 /// let x = ListResourceChangesRequest::new().set_page_token("example");
9806 /// ```
9807 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9808 self.page_token = v.into();
9809 self
9810 }
9811
9812 /// Sets the value of [filter][crate::model::ListResourceChangesRequest::filter].
9813 ///
9814 /// # Example
9815 /// ```ignore,no_run
9816 /// # use google_cloud_config_v1::model::ListResourceChangesRequest;
9817 /// let x = ListResourceChangesRequest::new().set_filter("example");
9818 /// ```
9819 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9820 self.filter = v.into();
9821 self
9822 }
9823
9824 /// Sets the value of [order_by][crate::model::ListResourceChangesRequest::order_by].
9825 ///
9826 /// # Example
9827 /// ```ignore,no_run
9828 /// # use google_cloud_config_v1::model::ListResourceChangesRequest;
9829 /// let x = ListResourceChangesRequest::new().set_order_by("example");
9830 /// ```
9831 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9832 self.order_by = v.into();
9833 self
9834 }
9835}
9836
9837impl wkt::message::Message for ListResourceChangesRequest {
9838 fn typename() -> &'static str {
9839 "type.googleapis.com/google.cloud.config.v1.ListResourceChangesRequest"
9840 }
9841}
9842
9843/// A response to a 'ListResourceChanges' call. Contains a list of
9844/// ResourceChanges.
9845#[derive(Clone, Default, PartialEq)]
9846#[non_exhaustive]
9847pub struct ListResourceChangesResponse {
9848 /// List of ResourceChanges.
9849 pub resource_changes: std::vec::Vec<crate::model::ResourceChange>,
9850
9851 /// A token to request the next page of resources from the
9852 /// 'ListResourceChanges' method. The value of an empty string means that
9853 /// there are no more resources to return.
9854 pub next_page_token: std::string::String,
9855
9856 /// Unreachable resources, if any.
9857 pub unreachable: std::vec::Vec<std::string::String>,
9858
9859 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9860}
9861
9862impl ListResourceChangesResponse {
9863 /// Creates a new default instance.
9864 pub fn new() -> Self {
9865 std::default::Default::default()
9866 }
9867
9868 /// Sets the value of [resource_changes][crate::model::ListResourceChangesResponse::resource_changes].
9869 ///
9870 /// # Example
9871 /// ```ignore,no_run
9872 /// # use google_cloud_config_v1::model::ListResourceChangesResponse;
9873 /// use google_cloud_config_v1::model::ResourceChange;
9874 /// let x = ListResourceChangesResponse::new()
9875 /// .set_resource_changes([
9876 /// ResourceChange::default()/* use setters */,
9877 /// ResourceChange::default()/* use (different) setters */,
9878 /// ]);
9879 /// ```
9880 pub fn set_resource_changes<T, V>(mut self, v: T) -> Self
9881 where
9882 T: std::iter::IntoIterator<Item = V>,
9883 V: std::convert::Into<crate::model::ResourceChange>,
9884 {
9885 use std::iter::Iterator;
9886 self.resource_changes = v.into_iter().map(|i| i.into()).collect();
9887 self
9888 }
9889
9890 /// Sets the value of [next_page_token][crate::model::ListResourceChangesResponse::next_page_token].
9891 ///
9892 /// # Example
9893 /// ```ignore,no_run
9894 /// # use google_cloud_config_v1::model::ListResourceChangesResponse;
9895 /// let x = ListResourceChangesResponse::new().set_next_page_token("example");
9896 /// ```
9897 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9898 self.next_page_token = v.into();
9899 self
9900 }
9901
9902 /// Sets the value of [unreachable][crate::model::ListResourceChangesResponse::unreachable].
9903 ///
9904 /// # Example
9905 /// ```ignore,no_run
9906 /// # use google_cloud_config_v1::model::ListResourceChangesResponse;
9907 /// let x = ListResourceChangesResponse::new().set_unreachable(["a", "b", "c"]);
9908 /// ```
9909 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
9910 where
9911 T: std::iter::IntoIterator<Item = V>,
9912 V: std::convert::Into<std::string::String>,
9913 {
9914 use std::iter::Iterator;
9915 self.unreachable = v.into_iter().map(|i| i.into()).collect();
9916 self
9917 }
9918}
9919
9920impl wkt::message::Message for ListResourceChangesResponse {
9921 fn typename() -> &'static str {
9922 "type.googleapis.com/google.cloud.config.v1.ListResourceChangesResponse"
9923 }
9924}
9925
9926#[doc(hidden)]
9927impl google_cloud_gax::paginator::internal::PageableResponse for ListResourceChangesResponse {
9928 type PageItem = crate::model::ResourceChange;
9929
9930 fn items(self) -> std::vec::Vec<Self::PageItem> {
9931 self.resource_changes
9932 }
9933
9934 fn next_page_token(&self) -> std::string::String {
9935 use std::clone::Clone;
9936 self.next_page_token.clone()
9937 }
9938}
9939
9940/// The request message for the GetResourceChange method.
9941#[derive(Clone, Default, PartialEq)]
9942#[non_exhaustive]
9943pub struct GetResourceChangeRequest {
9944 /// Required. The name of the resource change to retrieve.
9945 /// Format:
9946 /// 'projects/{project_id}/locations/{location}/previews/{preview}/resourceChanges/{resource_change}'.
9947 pub name: std::string::String,
9948
9949 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9950}
9951
9952impl GetResourceChangeRequest {
9953 /// Creates a new default instance.
9954 pub fn new() -> Self {
9955 std::default::Default::default()
9956 }
9957
9958 /// Sets the value of [name][crate::model::GetResourceChangeRequest::name].
9959 ///
9960 /// # Example
9961 /// ```ignore,no_run
9962 /// # use google_cloud_config_v1::model::GetResourceChangeRequest;
9963 /// # let project_id = "project_id";
9964 /// # let location_id = "location_id";
9965 /// # let preview_id = "preview_id";
9966 /// # let resource_change_id = "resource_change_id";
9967 /// let x = GetResourceChangeRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/previews/{preview_id}/resourceChanges/{resource_change_id}"));
9968 /// ```
9969 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9970 self.name = v.into();
9971 self
9972 }
9973}
9974
9975impl wkt::message::Message for GetResourceChangeRequest {
9976 fn typename() -> &'static str {
9977 "type.googleapis.com/google.cloud.config.v1.GetResourceChangeRequest"
9978 }
9979}
9980
9981/// Terraform info of a ResourceChange.
9982#[derive(Clone, Default, PartialEq)]
9983#[non_exhaustive]
9984pub struct ResourceDriftTerraformInfo {
9985 /// Output only. The address of the drifted resource.
9986 pub address: std::string::String,
9987
9988 /// Output only. The type of the drifted resource.
9989 pub r#type: std::string::String,
9990
9991 /// Output only. TF resource name.
9992 pub resource_name: std::string::String,
9993
9994 /// Output only. The provider of the drifted resource.
9995 pub provider: std::string::String,
9996
9997 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9998}
9999
10000impl ResourceDriftTerraformInfo {
10001 /// Creates a new default instance.
10002 pub fn new() -> Self {
10003 std::default::Default::default()
10004 }
10005
10006 /// Sets the value of [address][crate::model::ResourceDriftTerraformInfo::address].
10007 ///
10008 /// # Example
10009 /// ```ignore,no_run
10010 /// # use google_cloud_config_v1::model::ResourceDriftTerraformInfo;
10011 /// let x = ResourceDriftTerraformInfo::new().set_address("example");
10012 /// ```
10013 pub fn set_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10014 self.address = v.into();
10015 self
10016 }
10017
10018 /// Sets the value of [r#type][crate::model::ResourceDriftTerraformInfo::type].
10019 ///
10020 /// # Example
10021 /// ```ignore,no_run
10022 /// # use google_cloud_config_v1::model::ResourceDriftTerraformInfo;
10023 /// let x = ResourceDriftTerraformInfo::new().set_type("example");
10024 /// ```
10025 pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10026 self.r#type = v.into();
10027 self
10028 }
10029
10030 /// Sets the value of [resource_name][crate::model::ResourceDriftTerraformInfo::resource_name].
10031 ///
10032 /// # Example
10033 /// ```ignore,no_run
10034 /// # use google_cloud_config_v1::model::ResourceDriftTerraformInfo;
10035 /// let x = ResourceDriftTerraformInfo::new().set_resource_name("example");
10036 /// ```
10037 pub fn set_resource_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10038 self.resource_name = v.into();
10039 self
10040 }
10041
10042 /// Sets the value of [provider][crate::model::ResourceDriftTerraformInfo::provider].
10043 ///
10044 /// # Example
10045 /// ```ignore,no_run
10046 /// # use google_cloud_config_v1::model::ResourceDriftTerraformInfo;
10047 /// let x = ResourceDriftTerraformInfo::new().set_provider("example");
10048 /// ```
10049 pub fn set_provider<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10050 self.provider = v.into();
10051 self
10052 }
10053}
10054
10055impl wkt::message::Message for ResourceDriftTerraformInfo {
10056 fn typename() -> &'static str {
10057 "type.googleapis.com/google.cloud.config.v1.ResourceDriftTerraformInfo"
10058 }
10059}
10060
10061/// A resource drift represents a drift to a resource in the state file.
10062#[derive(Clone, Default, PartialEq)]
10063#[non_exhaustive]
10064pub struct ResourceDrift {
10065 /// Identifier. The name of the resource drift.
10066 /// Format:
10067 /// 'projects/{project_id}/locations/{location}/previews/{preview}/resourceDrifts/{resource_drift}'.
10068 pub name: std::string::String,
10069
10070 /// Output only. Terraform info of the resource drift.
10071 pub terraform_info: std::option::Option<crate::model::ResourceDriftTerraformInfo>,
10072
10073 /// Output only. The property drifts of the resource drift.
10074 pub property_drifts: std::vec::Vec<crate::model::PropertyDrift>,
10075
10076 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10077}
10078
10079impl ResourceDrift {
10080 /// Creates a new default instance.
10081 pub fn new() -> Self {
10082 std::default::Default::default()
10083 }
10084
10085 /// Sets the value of [name][crate::model::ResourceDrift::name].
10086 ///
10087 /// # Example
10088 /// ```ignore,no_run
10089 /// # use google_cloud_config_v1::model::ResourceDrift;
10090 /// # let project_id = "project_id";
10091 /// # let location_id = "location_id";
10092 /// # let preview_id = "preview_id";
10093 /// # let resource_drift_id = "resource_drift_id";
10094 /// let x = ResourceDrift::new().set_name(format!("projects/{project_id}/locations/{location_id}/previews/{preview_id}/resourceDrifts/{resource_drift_id}"));
10095 /// ```
10096 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10097 self.name = v.into();
10098 self
10099 }
10100
10101 /// Sets the value of [terraform_info][crate::model::ResourceDrift::terraform_info].
10102 ///
10103 /// # Example
10104 /// ```ignore,no_run
10105 /// # use google_cloud_config_v1::model::ResourceDrift;
10106 /// use google_cloud_config_v1::model::ResourceDriftTerraformInfo;
10107 /// let x = ResourceDrift::new().set_terraform_info(ResourceDriftTerraformInfo::default()/* use setters */);
10108 /// ```
10109 pub fn set_terraform_info<T>(mut self, v: T) -> Self
10110 where
10111 T: std::convert::Into<crate::model::ResourceDriftTerraformInfo>,
10112 {
10113 self.terraform_info = std::option::Option::Some(v.into());
10114 self
10115 }
10116
10117 /// Sets or clears the value of [terraform_info][crate::model::ResourceDrift::terraform_info].
10118 ///
10119 /// # Example
10120 /// ```ignore,no_run
10121 /// # use google_cloud_config_v1::model::ResourceDrift;
10122 /// use google_cloud_config_v1::model::ResourceDriftTerraformInfo;
10123 /// let x = ResourceDrift::new().set_or_clear_terraform_info(Some(ResourceDriftTerraformInfo::default()/* use setters */));
10124 /// let x = ResourceDrift::new().set_or_clear_terraform_info(None::<ResourceDriftTerraformInfo>);
10125 /// ```
10126 pub fn set_or_clear_terraform_info<T>(mut self, v: std::option::Option<T>) -> Self
10127 where
10128 T: std::convert::Into<crate::model::ResourceDriftTerraformInfo>,
10129 {
10130 self.terraform_info = v.map(|x| x.into());
10131 self
10132 }
10133
10134 /// Sets the value of [property_drifts][crate::model::ResourceDrift::property_drifts].
10135 ///
10136 /// # Example
10137 /// ```ignore,no_run
10138 /// # use google_cloud_config_v1::model::ResourceDrift;
10139 /// use google_cloud_config_v1::model::PropertyDrift;
10140 /// let x = ResourceDrift::new()
10141 /// .set_property_drifts([
10142 /// PropertyDrift::default()/* use setters */,
10143 /// PropertyDrift::default()/* use (different) setters */,
10144 /// ]);
10145 /// ```
10146 pub fn set_property_drifts<T, V>(mut self, v: T) -> Self
10147 where
10148 T: std::iter::IntoIterator<Item = V>,
10149 V: std::convert::Into<crate::model::PropertyDrift>,
10150 {
10151 use std::iter::Iterator;
10152 self.property_drifts = v.into_iter().map(|i| i.into()).collect();
10153 self
10154 }
10155}
10156
10157impl wkt::message::Message for ResourceDrift {
10158 fn typename() -> &'static str {
10159 "type.googleapis.com/google.cloud.config.v1.ResourceDrift"
10160 }
10161}
10162
10163/// A property drift represents a drift to a property in the state file.
10164#[derive(Clone, Default, PartialEq)]
10165#[non_exhaustive]
10166pub struct PropertyDrift {
10167 /// Output only. The path of the property drift.
10168 pub path: std::string::String,
10169
10170 /// Output only. The paths of sensitive fields in `before`. Paths are relative
10171 /// to `path`.
10172 pub before_sensitive_paths: std::vec::Vec<std::string::String>,
10173
10174 /// Output only. Representations of the object value before the actions.
10175 pub before: std::option::Option<wkt::Value>,
10176
10177 /// Output only. The paths of sensitive fields in `after`. Paths are relative
10178 /// to `path`.
10179 pub after_sensitive_paths: std::vec::Vec<std::string::String>,
10180
10181 /// Output only. Representations of the object value after the actions.
10182 pub after: std::option::Option<wkt::Value>,
10183
10184 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10185}
10186
10187impl PropertyDrift {
10188 /// Creates a new default instance.
10189 pub fn new() -> Self {
10190 std::default::Default::default()
10191 }
10192
10193 /// Sets the value of [path][crate::model::PropertyDrift::path].
10194 ///
10195 /// # Example
10196 /// ```ignore,no_run
10197 /// # use google_cloud_config_v1::model::PropertyDrift;
10198 /// let x = PropertyDrift::new().set_path("example");
10199 /// ```
10200 pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10201 self.path = v.into();
10202 self
10203 }
10204
10205 /// Sets the value of [before_sensitive_paths][crate::model::PropertyDrift::before_sensitive_paths].
10206 ///
10207 /// # Example
10208 /// ```ignore,no_run
10209 /// # use google_cloud_config_v1::model::PropertyDrift;
10210 /// let x = PropertyDrift::new().set_before_sensitive_paths(["a", "b", "c"]);
10211 /// ```
10212 pub fn set_before_sensitive_paths<T, V>(mut self, v: T) -> Self
10213 where
10214 T: std::iter::IntoIterator<Item = V>,
10215 V: std::convert::Into<std::string::String>,
10216 {
10217 use std::iter::Iterator;
10218 self.before_sensitive_paths = v.into_iter().map(|i| i.into()).collect();
10219 self
10220 }
10221
10222 /// Sets the value of [before][crate::model::PropertyDrift::before].
10223 ///
10224 /// # Example
10225 /// ```ignore,no_run
10226 /// # use google_cloud_config_v1::model::PropertyDrift;
10227 /// use wkt::Value;
10228 /// let x = PropertyDrift::new().set_before(Value::default()/* use setters */);
10229 /// ```
10230 pub fn set_before<T>(mut self, v: T) -> Self
10231 where
10232 T: std::convert::Into<wkt::Value>,
10233 {
10234 self.before = std::option::Option::Some(v.into());
10235 self
10236 }
10237
10238 /// Sets or clears the value of [before][crate::model::PropertyDrift::before].
10239 ///
10240 /// # Example
10241 /// ```ignore,no_run
10242 /// # use google_cloud_config_v1::model::PropertyDrift;
10243 /// use wkt::Value;
10244 /// let x = PropertyDrift::new().set_or_clear_before(Some(Value::default()/* use setters */));
10245 /// let x = PropertyDrift::new().set_or_clear_before(None::<Value>);
10246 /// ```
10247 pub fn set_or_clear_before<T>(mut self, v: std::option::Option<T>) -> Self
10248 where
10249 T: std::convert::Into<wkt::Value>,
10250 {
10251 self.before = v.map(|x| x.into());
10252 self
10253 }
10254
10255 /// Sets the value of [after_sensitive_paths][crate::model::PropertyDrift::after_sensitive_paths].
10256 ///
10257 /// # Example
10258 /// ```ignore,no_run
10259 /// # use google_cloud_config_v1::model::PropertyDrift;
10260 /// let x = PropertyDrift::new().set_after_sensitive_paths(["a", "b", "c"]);
10261 /// ```
10262 pub fn set_after_sensitive_paths<T, V>(mut self, v: T) -> Self
10263 where
10264 T: std::iter::IntoIterator<Item = V>,
10265 V: std::convert::Into<std::string::String>,
10266 {
10267 use std::iter::Iterator;
10268 self.after_sensitive_paths = v.into_iter().map(|i| i.into()).collect();
10269 self
10270 }
10271
10272 /// Sets the value of [after][crate::model::PropertyDrift::after].
10273 ///
10274 /// # Example
10275 /// ```ignore,no_run
10276 /// # use google_cloud_config_v1::model::PropertyDrift;
10277 /// use wkt::Value;
10278 /// let x = PropertyDrift::new().set_after(Value::default()/* use setters */);
10279 /// ```
10280 pub fn set_after<T>(mut self, v: T) -> Self
10281 where
10282 T: std::convert::Into<wkt::Value>,
10283 {
10284 self.after = std::option::Option::Some(v.into());
10285 self
10286 }
10287
10288 /// Sets or clears the value of [after][crate::model::PropertyDrift::after].
10289 ///
10290 /// # Example
10291 /// ```ignore,no_run
10292 /// # use google_cloud_config_v1::model::PropertyDrift;
10293 /// use wkt::Value;
10294 /// let x = PropertyDrift::new().set_or_clear_after(Some(Value::default()/* use setters */));
10295 /// let x = PropertyDrift::new().set_or_clear_after(None::<Value>);
10296 /// ```
10297 pub fn set_or_clear_after<T>(mut self, v: std::option::Option<T>) -> Self
10298 where
10299 T: std::convert::Into<wkt::Value>,
10300 {
10301 self.after = v.map(|x| x.into());
10302 self
10303 }
10304}
10305
10306impl wkt::message::Message for PropertyDrift {
10307 fn typename() -> &'static str {
10308 "type.googleapis.com/google.cloud.config.v1.PropertyDrift"
10309 }
10310}
10311
10312/// The request message for the ListResourceDrifts method.
10313#[derive(Clone, Default, PartialEq)]
10314#[non_exhaustive]
10315pub struct ListResourceDriftsRequest {
10316 /// Required. The parent in whose context the ResourceDrifts are listed. The
10317 /// parent value is in the format:
10318 /// 'projects/{project_id}/locations/{location}/previews/{preview}'.
10319 pub parent: std::string::String,
10320
10321 /// Optional. When requesting a page of resource drifts, 'page_size' specifies
10322 /// number of resource drifts to return. If unspecified, at most 500 will be
10323 /// returned. The maximum value is 1000.
10324 pub page_size: i32,
10325
10326 /// Optional. Token returned by previous call to 'ListResourceDrifts' which
10327 /// specifies the position in the list from where to continue listing the
10328 /// resource drifts.
10329 pub page_token: std::string::String,
10330
10331 /// Optional. Lists the resource drifts that match the filter expression. A
10332 /// filter expression filters the resource drifts listed in the response. The
10333 /// expression must be of the form '{field} {operator} {value}' where
10334 /// operators: '<', '>',
10335 /// '<=',
10336 /// '>=',
10337 /// '!=', '=', ':' are supported (colon ':' represents a HAS operator which is
10338 /// roughly synonymous with equality). {field} can refer to a proto or JSON
10339 /// field, or a synthetic field. Field names can be camelCase or snake_case.
10340 ///
10341 /// Examples:
10342 ///
10343 /// - Filter by name:
10344 /// name =
10345 /// "projects/foo/locations/us-central1/previews/dep/resourceDrifts/baz
10346 pub filter: std::string::String,
10347
10348 /// Optional. Field to use to sort the list.
10349 pub order_by: std::string::String,
10350
10351 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10352}
10353
10354impl ListResourceDriftsRequest {
10355 /// Creates a new default instance.
10356 pub fn new() -> Self {
10357 std::default::Default::default()
10358 }
10359
10360 /// Sets the value of [parent][crate::model::ListResourceDriftsRequest::parent].
10361 ///
10362 /// # Example
10363 /// ```ignore,no_run
10364 /// # use google_cloud_config_v1::model::ListResourceDriftsRequest;
10365 /// # let project_id = "project_id";
10366 /// # let location_id = "location_id";
10367 /// # let preview_id = "preview_id";
10368 /// let x = ListResourceDriftsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/previews/{preview_id}"));
10369 /// ```
10370 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10371 self.parent = v.into();
10372 self
10373 }
10374
10375 /// Sets the value of [page_size][crate::model::ListResourceDriftsRequest::page_size].
10376 ///
10377 /// # Example
10378 /// ```ignore,no_run
10379 /// # use google_cloud_config_v1::model::ListResourceDriftsRequest;
10380 /// let x = ListResourceDriftsRequest::new().set_page_size(42);
10381 /// ```
10382 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10383 self.page_size = v.into();
10384 self
10385 }
10386
10387 /// Sets the value of [page_token][crate::model::ListResourceDriftsRequest::page_token].
10388 ///
10389 /// # Example
10390 /// ```ignore,no_run
10391 /// # use google_cloud_config_v1::model::ListResourceDriftsRequest;
10392 /// let x = ListResourceDriftsRequest::new().set_page_token("example");
10393 /// ```
10394 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10395 self.page_token = v.into();
10396 self
10397 }
10398
10399 /// Sets the value of [filter][crate::model::ListResourceDriftsRequest::filter].
10400 ///
10401 /// # Example
10402 /// ```ignore,no_run
10403 /// # use google_cloud_config_v1::model::ListResourceDriftsRequest;
10404 /// let x = ListResourceDriftsRequest::new().set_filter("example");
10405 /// ```
10406 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10407 self.filter = v.into();
10408 self
10409 }
10410
10411 /// Sets the value of [order_by][crate::model::ListResourceDriftsRequest::order_by].
10412 ///
10413 /// # Example
10414 /// ```ignore,no_run
10415 /// # use google_cloud_config_v1::model::ListResourceDriftsRequest;
10416 /// let x = ListResourceDriftsRequest::new().set_order_by("example");
10417 /// ```
10418 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10419 self.order_by = v.into();
10420 self
10421 }
10422}
10423
10424impl wkt::message::Message for ListResourceDriftsRequest {
10425 fn typename() -> &'static str {
10426 "type.googleapis.com/google.cloud.config.v1.ListResourceDriftsRequest"
10427 }
10428}
10429
10430/// A response to a 'ListResourceDrifts' call. Contains a list of ResourceDrifts.
10431#[derive(Clone, Default, PartialEq)]
10432#[non_exhaustive]
10433pub struct ListResourceDriftsResponse {
10434 /// List of ResourceDrifts.
10435 pub resource_drifts: std::vec::Vec<crate::model::ResourceDrift>,
10436
10437 /// A token to request the next page of resources from the
10438 /// 'ListResourceDrifts' method. The value of an empty string means that
10439 /// there are no more resources to return.
10440 pub next_page_token: std::string::String,
10441
10442 /// Unreachable resources, if any.
10443 pub unreachable: std::vec::Vec<std::string::String>,
10444
10445 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10446}
10447
10448impl ListResourceDriftsResponse {
10449 /// Creates a new default instance.
10450 pub fn new() -> Self {
10451 std::default::Default::default()
10452 }
10453
10454 /// Sets the value of [resource_drifts][crate::model::ListResourceDriftsResponse::resource_drifts].
10455 ///
10456 /// # Example
10457 /// ```ignore,no_run
10458 /// # use google_cloud_config_v1::model::ListResourceDriftsResponse;
10459 /// use google_cloud_config_v1::model::ResourceDrift;
10460 /// let x = ListResourceDriftsResponse::new()
10461 /// .set_resource_drifts([
10462 /// ResourceDrift::default()/* use setters */,
10463 /// ResourceDrift::default()/* use (different) setters */,
10464 /// ]);
10465 /// ```
10466 pub fn set_resource_drifts<T, V>(mut self, v: T) -> Self
10467 where
10468 T: std::iter::IntoIterator<Item = V>,
10469 V: std::convert::Into<crate::model::ResourceDrift>,
10470 {
10471 use std::iter::Iterator;
10472 self.resource_drifts = v.into_iter().map(|i| i.into()).collect();
10473 self
10474 }
10475
10476 /// Sets the value of [next_page_token][crate::model::ListResourceDriftsResponse::next_page_token].
10477 ///
10478 /// # Example
10479 /// ```ignore,no_run
10480 /// # use google_cloud_config_v1::model::ListResourceDriftsResponse;
10481 /// let x = ListResourceDriftsResponse::new().set_next_page_token("example");
10482 /// ```
10483 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10484 self.next_page_token = v.into();
10485 self
10486 }
10487
10488 /// Sets the value of [unreachable][crate::model::ListResourceDriftsResponse::unreachable].
10489 ///
10490 /// # Example
10491 /// ```ignore,no_run
10492 /// # use google_cloud_config_v1::model::ListResourceDriftsResponse;
10493 /// let x = ListResourceDriftsResponse::new().set_unreachable(["a", "b", "c"]);
10494 /// ```
10495 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
10496 where
10497 T: std::iter::IntoIterator<Item = V>,
10498 V: std::convert::Into<std::string::String>,
10499 {
10500 use std::iter::Iterator;
10501 self.unreachable = v.into_iter().map(|i| i.into()).collect();
10502 self
10503 }
10504}
10505
10506impl wkt::message::Message for ListResourceDriftsResponse {
10507 fn typename() -> &'static str {
10508 "type.googleapis.com/google.cloud.config.v1.ListResourceDriftsResponse"
10509 }
10510}
10511
10512#[doc(hidden)]
10513impl google_cloud_gax::paginator::internal::PageableResponse for ListResourceDriftsResponse {
10514 type PageItem = crate::model::ResourceDrift;
10515
10516 fn items(self) -> std::vec::Vec<Self::PageItem> {
10517 self.resource_drifts
10518 }
10519
10520 fn next_page_token(&self) -> std::string::String {
10521 use std::clone::Clone;
10522 self.next_page_token.clone()
10523 }
10524}
10525
10526/// The request message for the GetResourceDrift method.
10527#[derive(Clone, Default, PartialEq)]
10528#[non_exhaustive]
10529pub struct GetResourceDriftRequest {
10530 /// Required. The name of the resource drift to retrieve.
10531 /// Format:
10532 /// 'projects/{project_id}/locations/{location}/previews/{preview}/resourceDrifts/{resource_drift}'.
10533 pub name: std::string::String,
10534
10535 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10536}
10537
10538impl GetResourceDriftRequest {
10539 /// Creates a new default instance.
10540 pub fn new() -> Self {
10541 std::default::Default::default()
10542 }
10543
10544 /// Sets the value of [name][crate::model::GetResourceDriftRequest::name].
10545 ///
10546 /// # Example
10547 /// ```ignore,no_run
10548 /// # use google_cloud_config_v1::model::GetResourceDriftRequest;
10549 /// # let project_id = "project_id";
10550 /// # let location_id = "location_id";
10551 /// # let preview_id = "preview_id";
10552 /// # let resource_drift_id = "resource_drift_id";
10553 /// let x = GetResourceDriftRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/previews/{preview_id}/resourceDrifts/{resource_drift_id}"));
10554 /// ```
10555 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10556 self.name = v.into();
10557 self
10558 }
10559}
10560
10561impl wkt::message::Message for GetResourceDriftRequest {
10562 fn typename() -> &'static str {
10563 "type.googleapis.com/google.cloud.config.v1.GetResourceDriftRequest"
10564 }
10565}
10566
10567/// ProviderConfig contains the provider configurations.
10568#[derive(Clone, Default, PartialEq)]
10569#[non_exhaustive]
10570pub struct ProviderConfig {
10571 /// Optional. ProviderSource specifies the source type of the provider.
10572 pub source_type: std::option::Option<crate::model::provider_config::ProviderSource>,
10573
10574 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10575}
10576
10577impl ProviderConfig {
10578 /// Creates a new default instance.
10579 pub fn new() -> Self {
10580 std::default::Default::default()
10581 }
10582
10583 /// Sets the value of [source_type][crate::model::ProviderConfig::source_type].
10584 ///
10585 /// # Example
10586 /// ```ignore,no_run
10587 /// # use google_cloud_config_v1::model::ProviderConfig;
10588 /// use google_cloud_config_v1::model::provider_config::ProviderSource;
10589 /// let x0 = ProviderConfig::new().set_source_type(ProviderSource::ServiceMaintained);
10590 /// ```
10591 pub fn set_source_type<T>(mut self, v: T) -> Self
10592 where
10593 T: std::convert::Into<crate::model::provider_config::ProviderSource>,
10594 {
10595 self.source_type = std::option::Option::Some(v.into());
10596 self
10597 }
10598
10599 /// Sets or clears the value of [source_type][crate::model::ProviderConfig::source_type].
10600 ///
10601 /// # Example
10602 /// ```ignore,no_run
10603 /// # use google_cloud_config_v1::model::ProviderConfig;
10604 /// use google_cloud_config_v1::model::provider_config::ProviderSource;
10605 /// let x0 = ProviderConfig::new().set_or_clear_source_type(Some(ProviderSource::ServiceMaintained));
10606 /// let x_none = ProviderConfig::new().set_or_clear_source_type(None::<ProviderSource>);
10607 /// ```
10608 pub fn set_or_clear_source_type<T>(mut self, v: std::option::Option<T>) -> Self
10609 where
10610 T: std::convert::Into<crate::model::provider_config::ProviderSource>,
10611 {
10612 self.source_type = v.map(|x| x.into());
10613 self
10614 }
10615}
10616
10617impl wkt::message::Message for ProviderConfig {
10618 fn typename() -> &'static str {
10619 "type.googleapis.com/google.cloud.config.v1.ProviderConfig"
10620 }
10621}
10622
10623/// Defines additional types related to [ProviderConfig].
10624pub mod provider_config {
10625 #[allow(unused_imports)]
10626 use super::*;
10627
10628 /// ProviderSource represents the source type of the provider.
10629 ///
10630 /// # Working with unknown values
10631 ///
10632 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10633 /// additional enum variants at any time. Adding new variants is not considered
10634 /// a breaking change. Applications should write their code in anticipation of:
10635 ///
10636 /// - New values appearing in future releases of the client library, **and**
10637 /// - New values received dynamically, without application changes.
10638 ///
10639 /// Please consult the [Working with enums] section in the user guide for some
10640 /// guidelines.
10641 ///
10642 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
10643 #[derive(Clone, Debug, PartialEq)]
10644 #[non_exhaustive]
10645 pub enum ProviderSource {
10646 /// Unspecified source type, default to public sources.
10647 Unspecified,
10648 /// Service maintained provider source type.
10649 ServiceMaintained,
10650 /// If set, the enum was initialized with an unknown value.
10651 ///
10652 /// Applications can examine the value using [ProviderSource::value] or
10653 /// [ProviderSource::name].
10654 UnknownValue(provider_source::UnknownValue),
10655 }
10656
10657 #[doc(hidden)]
10658 pub mod provider_source {
10659 #[allow(unused_imports)]
10660 use super::*;
10661 #[derive(Clone, Debug, PartialEq)]
10662 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10663 }
10664
10665 impl ProviderSource {
10666 /// Gets the enum value.
10667 ///
10668 /// Returns `None` if the enum contains an unknown value deserialized from
10669 /// the string representation of enums.
10670 pub fn value(&self) -> std::option::Option<i32> {
10671 match self {
10672 Self::Unspecified => std::option::Option::Some(0),
10673 Self::ServiceMaintained => std::option::Option::Some(1),
10674 Self::UnknownValue(u) => u.0.value(),
10675 }
10676 }
10677
10678 /// Gets the enum value as a string.
10679 ///
10680 /// Returns `None` if the enum contains an unknown value deserialized from
10681 /// the integer representation of enums.
10682 pub fn name(&self) -> std::option::Option<&str> {
10683 match self {
10684 Self::Unspecified => std::option::Option::Some("PROVIDER_SOURCE_UNSPECIFIED"),
10685 Self::ServiceMaintained => std::option::Option::Some("SERVICE_MAINTAINED"),
10686 Self::UnknownValue(u) => u.0.name(),
10687 }
10688 }
10689 }
10690
10691 impl std::default::Default for ProviderSource {
10692 fn default() -> Self {
10693 use std::convert::From;
10694 Self::from(0)
10695 }
10696 }
10697
10698 impl std::fmt::Display for ProviderSource {
10699 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10700 wkt::internal::display_enum(f, self.name(), self.value())
10701 }
10702 }
10703
10704 impl std::convert::From<i32> for ProviderSource {
10705 fn from(value: i32) -> Self {
10706 match value {
10707 0 => Self::Unspecified,
10708 1 => Self::ServiceMaintained,
10709 _ => Self::UnknownValue(provider_source::UnknownValue(
10710 wkt::internal::UnknownEnumValue::Integer(value),
10711 )),
10712 }
10713 }
10714 }
10715
10716 impl std::convert::From<&str> for ProviderSource {
10717 fn from(value: &str) -> Self {
10718 use std::string::ToString;
10719 match value {
10720 "PROVIDER_SOURCE_UNSPECIFIED" => Self::Unspecified,
10721 "SERVICE_MAINTAINED" => Self::ServiceMaintained,
10722 _ => Self::UnknownValue(provider_source::UnknownValue(
10723 wkt::internal::UnknownEnumValue::String(value.to_string()),
10724 )),
10725 }
10726 }
10727 }
10728
10729 impl serde::ser::Serialize for ProviderSource {
10730 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10731 where
10732 S: serde::Serializer,
10733 {
10734 match self {
10735 Self::Unspecified => serializer.serialize_i32(0),
10736 Self::ServiceMaintained => serializer.serialize_i32(1),
10737 Self::UnknownValue(u) => u.0.serialize(serializer),
10738 }
10739 }
10740 }
10741
10742 impl<'de> serde::de::Deserialize<'de> for ProviderSource {
10743 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10744 where
10745 D: serde::Deserializer<'de>,
10746 {
10747 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ProviderSource>::new(
10748 ".google.cloud.config.v1.ProviderConfig.ProviderSource",
10749 ))
10750 }
10751 }
10752}
10753
10754/// The request message for the GetAutoMigrationConfig method.
10755#[derive(Clone, Default, PartialEq)]
10756#[non_exhaustive]
10757pub struct GetAutoMigrationConfigRequest {
10758 /// Required. The name of the AutoMigrationConfig.
10759 /// Format:
10760 /// 'projects/{project_id}/locations/{location}/AutoMigrationConfig'.
10761 pub name: std::string::String,
10762
10763 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10764}
10765
10766impl GetAutoMigrationConfigRequest {
10767 /// Creates a new default instance.
10768 pub fn new() -> Self {
10769 std::default::Default::default()
10770 }
10771
10772 /// Sets the value of [name][crate::model::GetAutoMigrationConfigRequest::name].
10773 ///
10774 /// # Example
10775 /// ```ignore,no_run
10776 /// # use google_cloud_config_v1::model::GetAutoMigrationConfigRequest;
10777 /// # let project_id = "project_id";
10778 /// # let location_id = "location_id";
10779 /// let x = GetAutoMigrationConfigRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/autoMigrationConfig"));
10780 /// ```
10781 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10782 self.name = v.into();
10783 self
10784 }
10785}
10786
10787impl wkt::message::Message for GetAutoMigrationConfigRequest {
10788 fn typename() -> &'static str {
10789 "type.googleapis.com/google.cloud.config.v1.GetAutoMigrationConfigRequest"
10790 }
10791}
10792
10793/// AutoMigrationConfig contains the automigration configuration for a project.
10794#[derive(Clone, Default, PartialEq)]
10795#[non_exhaustive]
10796pub struct AutoMigrationConfig {
10797 /// Identifier. The name of the AutoMigrationConfig.
10798 /// Format:
10799 /// 'projects/{project_id}/locations/{location}/AutoMigrationConfig'.
10800 pub name: std::string::String,
10801
10802 /// Output only. Time the AutoMigrationConfig was last updated.
10803 pub update_time: std::option::Option<wkt::Timestamp>,
10804
10805 /// Optional. Whether the auto migration is enabled for the project.
10806 pub auto_migration_enabled: bool,
10807
10808 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10809}
10810
10811impl AutoMigrationConfig {
10812 /// Creates a new default instance.
10813 pub fn new() -> Self {
10814 std::default::Default::default()
10815 }
10816
10817 /// Sets the value of [name][crate::model::AutoMigrationConfig::name].
10818 ///
10819 /// # Example
10820 /// ```ignore,no_run
10821 /// # use google_cloud_config_v1::model::AutoMigrationConfig;
10822 /// # let project_id = "project_id";
10823 /// # let location_id = "location_id";
10824 /// let x = AutoMigrationConfig::new().set_name(format!("projects/{project_id}/locations/{location_id}/autoMigrationConfig"));
10825 /// ```
10826 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10827 self.name = v.into();
10828 self
10829 }
10830
10831 /// Sets the value of [update_time][crate::model::AutoMigrationConfig::update_time].
10832 ///
10833 /// # Example
10834 /// ```ignore,no_run
10835 /// # use google_cloud_config_v1::model::AutoMigrationConfig;
10836 /// use wkt::Timestamp;
10837 /// let x = AutoMigrationConfig::new().set_update_time(Timestamp::default()/* use setters */);
10838 /// ```
10839 pub fn set_update_time<T>(mut self, v: T) -> Self
10840 where
10841 T: std::convert::Into<wkt::Timestamp>,
10842 {
10843 self.update_time = std::option::Option::Some(v.into());
10844 self
10845 }
10846
10847 /// Sets or clears the value of [update_time][crate::model::AutoMigrationConfig::update_time].
10848 ///
10849 /// # Example
10850 /// ```ignore,no_run
10851 /// # use google_cloud_config_v1::model::AutoMigrationConfig;
10852 /// use wkt::Timestamp;
10853 /// let x = AutoMigrationConfig::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
10854 /// let x = AutoMigrationConfig::new().set_or_clear_update_time(None::<Timestamp>);
10855 /// ```
10856 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
10857 where
10858 T: std::convert::Into<wkt::Timestamp>,
10859 {
10860 self.update_time = v.map(|x| x.into());
10861 self
10862 }
10863
10864 /// Sets the value of [auto_migration_enabled][crate::model::AutoMigrationConfig::auto_migration_enabled].
10865 ///
10866 /// # Example
10867 /// ```ignore,no_run
10868 /// # use google_cloud_config_v1::model::AutoMigrationConfig;
10869 /// let x = AutoMigrationConfig::new().set_auto_migration_enabled(true);
10870 /// ```
10871 pub fn set_auto_migration_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10872 self.auto_migration_enabled = v.into();
10873 self
10874 }
10875}
10876
10877impl wkt::message::Message for AutoMigrationConfig {
10878 fn typename() -> &'static str {
10879 "type.googleapis.com/google.cloud.config.v1.AutoMigrationConfig"
10880 }
10881}
10882
10883/// The request message for the UpdateAutoMigrationConfig method.
10884#[derive(Clone, Default, PartialEq)]
10885#[non_exhaustive]
10886pub struct UpdateAutoMigrationConfigRequest {
10887 /// Optional. The update mask applies to the resource. See
10888 /// [google.protobuf.FieldMask][google.protobuf.FieldMask].
10889 ///
10890 /// [google.protobuf.FieldMask]: wkt::FieldMask
10891 pub update_mask: std::option::Option<wkt::FieldMask>,
10892
10893 /// Required. The AutoMigrationConfig to update.
10894 pub auto_migration_config: std::option::Option<crate::model::AutoMigrationConfig>,
10895
10896 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10897}
10898
10899impl UpdateAutoMigrationConfigRequest {
10900 /// Creates a new default instance.
10901 pub fn new() -> Self {
10902 std::default::Default::default()
10903 }
10904
10905 /// Sets the value of [update_mask][crate::model::UpdateAutoMigrationConfigRequest::update_mask].
10906 ///
10907 /// # Example
10908 /// ```ignore,no_run
10909 /// # use google_cloud_config_v1::model::UpdateAutoMigrationConfigRequest;
10910 /// use wkt::FieldMask;
10911 /// let x = UpdateAutoMigrationConfigRequest::new().set_update_mask(FieldMask::default()/* use setters */);
10912 /// ```
10913 pub fn set_update_mask<T>(mut self, v: T) -> Self
10914 where
10915 T: std::convert::Into<wkt::FieldMask>,
10916 {
10917 self.update_mask = std::option::Option::Some(v.into());
10918 self
10919 }
10920
10921 /// Sets or clears the value of [update_mask][crate::model::UpdateAutoMigrationConfigRequest::update_mask].
10922 ///
10923 /// # Example
10924 /// ```ignore,no_run
10925 /// # use google_cloud_config_v1::model::UpdateAutoMigrationConfigRequest;
10926 /// use wkt::FieldMask;
10927 /// let x = UpdateAutoMigrationConfigRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
10928 /// let x = UpdateAutoMigrationConfigRequest::new().set_or_clear_update_mask(None::<FieldMask>);
10929 /// ```
10930 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
10931 where
10932 T: std::convert::Into<wkt::FieldMask>,
10933 {
10934 self.update_mask = v.map(|x| x.into());
10935 self
10936 }
10937
10938 /// Sets the value of [auto_migration_config][crate::model::UpdateAutoMigrationConfigRequest::auto_migration_config].
10939 ///
10940 /// # Example
10941 /// ```ignore,no_run
10942 /// # use google_cloud_config_v1::model::UpdateAutoMigrationConfigRequest;
10943 /// use google_cloud_config_v1::model::AutoMigrationConfig;
10944 /// let x = UpdateAutoMigrationConfigRequest::new().set_auto_migration_config(AutoMigrationConfig::default()/* use setters */);
10945 /// ```
10946 pub fn set_auto_migration_config<T>(mut self, v: T) -> Self
10947 where
10948 T: std::convert::Into<crate::model::AutoMigrationConfig>,
10949 {
10950 self.auto_migration_config = std::option::Option::Some(v.into());
10951 self
10952 }
10953
10954 /// Sets or clears the value of [auto_migration_config][crate::model::UpdateAutoMigrationConfigRequest::auto_migration_config].
10955 ///
10956 /// # Example
10957 /// ```ignore,no_run
10958 /// # use google_cloud_config_v1::model::UpdateAutoMigrationConfigRequest;
10959 /// use google_cloud_config_v1::model::AutoMigrationConfig;
10960 /// let x = UpdateAutoMigrationConfigRequest::new().set_or_clear_auto_migration_config(Some(AutoMigrationConfig::default()/* use setters */));
10961 /// let x = UpdateAutoMigrationConfigRequest::new().set_or_clear_auto_migration_config(None::<AutoMigrationConfig>);
10962 /// ```
10963 pub fn set_or_clear_auto_migration_config<T>(mut self, v: std::option::Option<T>) -> Self
10964 where
10965 T: std::convert::Into<crate::model::AutoMigrationConfig>,
10966 {
10967 self.auto_migration_config = v.map(|x| x.into());
10968 self
10969 }
10970}
10971
10972impl wkt::message::Message for UpdateAutoMigrationConfigRequest {
10973 fn typename() -> &'static str {
10974 "type.googleapis.com/google.cloud.config.v1.UpdateAutoMigrationConfigRequest"
10975 }
10976}
10977
10978/// A DeploymentGroup is a collection of DeploymentUnits that in a DAG-like
10979/// structure.
10980#[derive(Clone, Default, PartialEq)]
10981#[non_exhaustive]
10982pub struct DeploymentGroup {
10983 /// Identifier. The name of the deployment group.
10984 /// Format:
10985 /// 'projects/{project_id}/locations/{location}/deploymentGroups/{deployment_group}'.
10986 pub name: std::string::String,
10987
10988 /// Output only. Time when the deployment group was created.
10989 pub create_time: std::option::Option<wkt::Timestamp>,
10990
10991 /// Output only. Time when the deployment group was last updated.
10992 pub update_time: std::option::Option<wkt::Timestamp>,
10993
10994 /// Optional. User-defined metadata for the deployment group.
10995 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
10996
10997 /// Optional. Arbitrary key-value metadata storage e.g. to help client tools
10998 /// identify deployment group during automation. See
10999 /// <https://google.aip.dev/148#annotations> for details on format and size
11000 /// limitations.
11001 pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
11002
11003 /// Output only. Current state of the deployment group.
11004 pub state: crate::model::deployment_group::State,
11005
11006 /// Output only. Additional information regarding the current state.
11007 pub state_description: std::string::String,
11008
11009 /// The deployment units of the deployment group in a DAG like structure.
11010 /// When a deployment group is being provisioned, the deployment units are
11011 /// deployed in a DAG order.
11012 /// The provided units must be in a DAG order, otherwise an error will be
11013 /// returned.
11014 pub deployment_units: std::vec::Vec<crate::model::DeploymentUnit>,
11015
11016 /// Output only. The provisioning state of the deployment group.
11017 pub provisioning_state: crate::model::deployment_group::ProvisioningState,
11018
11019 /// Output only. Additional information regarding the current provisioning
11020 /// state.
11021 pub provisioning_state_description: std::string::String,
11022
11023 /// Output only. The error status of the deployment group provisioning or
11024 /// deprovisioning.
11025 pub provisioning_error: std::option::Option<google_cloud_rpc::model::Status>,
11026
11027 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11028}
11029
11030impl DeploymentGroup {
11031 /// Creates a new default instance.
11032 pub fn new() -> Self {
11033 std::default::Default::default()
11034 }
11035
11036 /// Sets the value of [name][crate::model::DeploymentGroup::name].
11037 ///
11038 /// # Example
11039 /// ```ignore,no_run
11040 /// # use google_cloud_config_v1::model::DeploymentGroup;
11041 /// # let project_id = "project_id";
11042 /// # let location_id = "location_id";
11043 /// # let deployment_group_id = "deployment_group_id";
11044 /// let x = DeploymentGroup::new().set_name(format!("projects/{project_id}/locations/{location_id}/deploymentGroups/{deployment_group_id}"));
11045 /// ```
11046 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11047 self.name = v.into();
11048 self
11049 }
11050
11051 /// Sets the value of [create_time][crate::model::DeploymentGroup::create_time].
11052 ///
11053 /// # Example
11054 /// ```ignore,no_run
11055 /// # use google_cloud_config_v1::model::DeploymentGroup;
11056 /// use wkt::Timestamp;
11057 /// let x = DeploymentGroup::new().set_create_time(Timestamp::default()/* use setters */);
11058 /// ```
11059 pub fn set_create_time<T>(mut self, v: T) -> Self
11060 where
11061 T: std::convert::Into<wkt::Timestamp>,
11062 {
11063 self.create_time = std::option::Option::Some(v.into());
11064 self
11065 }
11066
11067 /// Sets or clears the value of [create_time][crate::model::DeploymentGroup::create_time].
11068 ///
11069 /// # Example
11070 /// ```ignore,no_run
11071 /// # use google_cloud_config_v1::model::DeploymentGroup;
11072 /// use wkt::Timestamp;
11073 /// let x = DeploymentGroup::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
11074 /// let x = DeploymentGroup::new().set_or_clear_create_time(None::<Timestamp>);
11075 /// ```
11076 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
11077 where
11078 T: std::convert::Into<wkt::Timestamp>,
11079 {
11080 self.create_time = v.map(|x| x.into());
11081 self
11082 }
11083
11084 /// Sets the value of [update_time][crate::model::DeploymentGroup::update_time].
11085 ///
11086 /// # Example
11087 /// ```ignore,no_run
11088 /// # use google_cloud_config_v1::model::DeploymentGroup;
11089 /// use wkt::Timestamp;
11090 /// let x = DeploymentGroup::new().set_update_time(Timestamp::default()/* use setters */);
11091 /// ```
11092 pub fn set_update_time<T>(mut self, v: T) -> Self
11093 where
11094 T: std::convert::Into<wkt::Timestamp>,
11095 {
11096 self.update_time = std::option::Option::Some(v.into());
11097 self
11098 }
11099
11100 /// Sets or clears the value of [update_time][crate::model::DeploymentGroup::update_time].
11101 ///
11102 /// # Example
11103 /// ```ignore,no_run
11104 /// # use google_cloud_config_v1::model::DeploymentGroup;
11105 /// use wkt::Timestamp;
11106 /// let x = DeploymentGroup::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
11107 /// let x = DeploymentGroup::new().set_or_clear_update_time(None::<Timestamp>);
11108 /// ```
11109 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
11110 where
11111 T: std::convert::Into<wkt::Timestamp>,
11112 {
11113 self.update_time = v.map(|x| x.into());
11114 self
11115 }
11116
11117 /// Sets the value of [labels][crate::model::DeploymentGroup::labels].
11118 ///
11119 /// # Example
11120 /// ```ignore,no_run
11121 /// # use google_cloud_config_v1::model::DeploymentGroup;
11122 /// let x = DeploymentGroup::new().set_labels([
11123 /// ("key0", "abc"),
11124 /// ("key1", "xyz"),
11125 /// ]);
11126 /// ```
11127 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
11128 where
11129 T: std::iter::IntoIterator<Item = (K, V)>,
11130 K: std::convert::Into<std::string::String>,
11131 V: std::convert::Into<std::string::String>,
11132 {
11133 use std::iter::Iterator;
11134 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
11135 self
11136 }
11137
11138 /// Sets the value of [annotations][crate::model::DeploymentGroup::annotations].
11139 ///
11140 /// # Example
11141 /// ```ignore,no_run
11142 /// # use google_cloud_config_v1::model::DeploymentGroup;
11143 /// let x = DeploymentGroup::new().set_annotations([
11144 /// ("key0", "abc"),
11145 /// ("key1", "xyz"),
11146 /// ]);
11147 /// ```
11148 pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
11149 where
11150 T: std::iter::IntoIterator<Item = (K, V)>,
11151 K: std::convert::Into<std::string::String>,
11152 V: std::convert::Into<std::string::String>,
11153 {
11154 use std::iter::Iterator;
11155 self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
11156 self
11157 }
11158
11159 /// Sets the value of [state][crate::model::DeploymentGroup::state].
11160 ///
11161 /// # Example
11162 /// ```ignore,no_run
11163 /// # use google_cloud_config_v1::model::DeploymentGroup;
11164 /// use google_cloud_config_v1::model::deployment_group::State;
11165 /// let x0 = DeploymentGroup::new().set_state(State::Creating);
11166 /// let x1 = DeploymentGroup::new().set_state(State::Active);
11167 /// let x2 = DeploymentGroup::new().set_state(State::Updating);
11168 /// ```
11169 pub fn set_state<T: std::convert::Into<crate::model::deployment_group::State>>(
11170 mut self,
11171 v: T,
11172 ) -> Self {
11173 self.state = v.into();
11174 self
11175 }
11176
11177 /// Sets the value of [state_description][crate::model::DeploymentGroup::state_description].
11178 ///
11179 /// # Example
11180 /// ```ignore,no_run
11181 /// # use google_cloud_config_v1::model::DeploymentGroup;
11182 /// let x = DeploymentGroup::new().set_state_description("example");
11183 /// ```
11184 pub fn set_state_description<T: std::convert::Into<std::string::String>>(
11185 mut self,
11186 v: T,
11187 ) -> Self {
11188 self.state_description = v.into();
11189 self
11190 }
11191
11192 /// Sets the value of [deployment_units][crate::model::DeploymentGroup::deployment_units].
11193 ///
11194 /// # Example
11195 /// ```ignore,no_run
11196 /// # use google_cloud_config_v1::model::DeploymentGroup;
11197 /// use google_cloud_config_v1::model::DeploymentUnit;
11198 /// let x = DeploymentGroup::new()
11199 /// .set_deployment_units([
11200 /// DeploymentUnit::default()/* use setters */,
11201 /// DeploymentUnit::default()/* use (different) setters */,
11202 /// ]);
11203 /// ```
11204 pub fn set_deployment_units<T, V>(mut self, v: T) -> Self
11205 where
11206 T: std::iter::IntoIterator<Item = V>,
11207 V: std::convert::Into<crate::model::DeploymentUnit>,
11208 {
11209 use std::iter::Iterator;
11210 self.deployment_units = v.into_iter().map(|i| i.into()).collect();
11211 self
11212 }
11213
11214 /// Sets the value of [provisioning_state][crate::model::DeploymentGroup::provisioning_state].
11215 ///
11216 /// # Example
11217 /// ```ignore,no_run
11218 /// # use google_cloud_config_v1::model::DeploymentGroup;
11219 /// use google_cloud_config_v1::model::deployment_group::ProvisioningState;
11220 /// let x0 = DeploymentGroup::new().set_provisioning_state(ProvisioningState::Provisioning);
11221 /// let x1 = DeploymentGroup::new().set_provisioning_state(ProvisioningState::Provisioned);
11222 /// let x2 = DeploymentGroup::new().set_provisioning_state(ProvisioningState::FailedToProvision);
11223 /// ```
11224 pub fn set_provisioning_state<
11225 T: std::convert::Into<crate::model::deployment_group::ProvisioningState>,
11226 >(
11227 mut self,
11228 v: T,
11229 ) -> Self {
11230 self.provisioning_state = v.into();
11231 self
11232 }
11233
11234 /// Sets the value of [provisioning_state_description][crate::model::DeploymentGroup::provisioning_state_description].
11235 ///
11236 /// # Example
11237 /// ```ignore,no_run
11238 /// # use google_cloud_config_v1::model::DeploymentGroup;
11239 /// let x = DeploymentGroup::new().set_provisioning_state_description("example");
11240 /// ```
11241 pub fn set_provisioning_state_description<T: std::convert::Into<std::string::String>>(
11242 mut self,
11243 v: T,
11244 ) -> Self {
11245 self.provisioning_state_description = v.into();
11246 self
11247 }
11248
11249 /// Sets the value of [provisioning_error][crate::model::DeploymentGroup::provisioning_error].
11250 ///
11251 /// # Example
11252 /// ```ignore,no_run
11253 /// # use google_cloud_config_v1::model::DeploymentGroup;
11254 /// use google_cloud_rpc::model::Status;
11255 /// let x = DeploymentGroup::new().set_provisioning_error(Status::default()/* use setters */);
11256 /// ```
11257 pub fn set_provisioning_error<T>(mut self, v: T) -> Self
11258 where
11259 T: std::convert::Into<google_cloud_rpc::model::Status>,
11260 {
11261 self.provisioning_error = std::option::Option::Some(v.into());
11262 self
11263 }
11264
11265 /// Sets or clears the value of [provisioning_error][crate::model::DeploymentGroup::provisioning_error].
11266 ///
11267 /// # Example
11268 /// ```ignore,no_run
11269 /// # use google_cloud_config_v1::model::DeploymentGroup;
11270 /// use google_cloud_rpc::model::Status;
11271 /// let x = DeploymentGroup::new().set_or_clear_provisioning_error(Some(Status::default()/* use setters */));
11272 /// let x = DeploymentGroup::new().set_or_clear_provisioning_error(None::<Status>);
11273 /// ```
11274 pub fn set_or_clear_provisioning_error<T>(mut self, v: std::option::Option<T>) -> Self
11275 where
11276 T: std::convert::Into<google_cloud_rpc::model::Status>,
11277 {
11278 self.provisioning_error = v.map(|x| x.into());
11279 self
11280 }
11281}
11282
11283impl wkt::message::Message for DeploymentGroup {
11284 fn typename() -> &'static str {
11285 "type.googleapis.com/google.cloud.config.v1.DeploymentGroup"
11286 }
11287}
11288
11289/// Defines additional types related to [DeploymentGroup].
11290pub mod deployment_group {
11291 #[allow(unused_imports)]
11292 use super::*;
11293
11294 /// Possible states of a deployment group.
11295 ///
11296 /// # Working with unknown values
11297 ///
11298 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11299 /// additional enum variants at any time. Adding new variants is not considered
11300 /// a breaking change. Applications should write their code in anticipation of:
11301 ///
11302 /// - New values appearing in future releases of the client library, **and**
11303 /// - New values received dynamically, without application changes.
11304 ///
11305 /// Please consult the [Working with enums] section in the user guide for some
11306 /// guidelines.
11307 ///
11308 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
11309 #[derive(Clone, Debug, PartialEq)]
11310 #[non_exhaustive]
11311 pub enum State {
11312 /// The default value. This value is used if the state is omitted.
11313 Unspecified,
11314 /// The deployment group is being created.
11315 Creating,
11316 /// The deployment group is healthy.
11317 Active,
11318 /// The deployment group is being updated.
11319 Updating,
11320 /// The deployment group is being deleted.
11321 Deleting,
11322 /// The deployment group has encountered an unexpected error.
11323 Failed,
11324 /// The deployment group is no longer being actively reconciled.
11325 /// This may be the result of recovering the project after deletion.
11326 Suspended,
11327 /// The deployment group has been deleted.
11328 Deleted,
11329 /// If set, the enum was initialized with an unknown value.
11330 ///
11331 /// Applications can examine the value using [State::value] or
11332 /// [State::name].
11333 UnknownValue(state::UnknownValue),
11334 }
11335
11336 #[doc(hidden)]
11337 pub mod state {
11338 #[allow(unused_imports)]
11339 use super::*;
11340 #[derive(Clone, Debug, PartialEq)]
11341 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11342 }
11343
11344 impl State {
11345 /// Gets the enum value.
11346 ///
11347 /// Returns `None` if the enum contains an unknown value deserialized from
11348 /// the string representation of enums.
11349 pub fn value(&self) -> std::option::Option<i32> {
11350 match self {
11351 Self::Unspecified => std::option::Option::Some(0),
11352 Self::Creating => std::option::Option::Some(1),
11353 Self::Active => std::option::Option::Some(2),
11354 Self::Updating => std::option::Option::Some(3),
11355 Self::Deleting => std::option::Option::Some(4),
11356 Self::Failed => std::option::Option::Some(5),
11357 Self::Suspended => std::option::Option::Some(6),
11358 Self::Deleted => std::option::Option::Some(7),
11359 Self::UnknownValue(u) => u.0.value(),
11360 }
11361 }
11362
11363 /// Gets the enum value as a string.
11364 ///
11365 /// Returns `None` if the enum contains an unknown value deserialized from
11366 /// the integer representation of enums.
11367 pub fn name(&self) -> std::option::Option<&str> {
11368 match self {
11369 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
11370 Self::Creating => std::option::Option::Some("CREATING"),
11371 Self::Active => std::option::Option::Some("ACTIVE"),
11372 Self::Updating => std::option::Option::Some("UPDATING"),
11373 Self::Deleting => std::option::Option::Some("DELETING"),
11374 Self::Failed => std::option::Option::Some("FAILED"),
11375 Self::Suspended => std::option::Option::Some("SUSPENDED"),
11376 Self::Deleted => std::option::Option::Some("DELETED"),
11377 Self::UnknownValue(u) => u.0.name(),
11378 }
11379 }
11380 }
11381
11382 impl std::default::Default for State {
11383 fn default() -> Self {
11384 use std::convert::From;
11385 Self::from(0)
11386 }
11387 }
11388
11389 impl std::fmt::Display for State {
11390 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11391 wkt::internal::display_enum(f, self.name(), self.value())
11392 }
11393 }
11394
11395 impl std::convert::From<i32> for State {
11396 fn from(value: i32) -> Self {
11397 match value {
11398 0 => Self::Unspecified,
11399 1 => Self::Creating,
11400 2 => Self::Active,
11401 3 => Self::Updating,
11402 4 => Self::Deleting,
11403 5 => Self::Failed,
11404 6 => Self::Suspended,
11405 7 => Self::Deleted,
11406 _ => Self::UnknownValue(state::UnknownValue(
11407 wkt::internal::UnknownEnumValue::Integer(value),
11408 )),
11409 }
11410 }
11411 }
11412
11413 impl std::convert::From<&str> for State {
11414 fn from(value: &str) -> Self {
11415 use std::string::ToString;
11416 match value {
11417 "STATE_UNSPECIFIED" => Self::Unspecified,
11418 "CREATING" => Self::Creating,
11419 "ACTIVE" => Self::Active,
11420 "UPDATING" => Self::Updating,
11421 "DELETING" => Self::Deleting,
11422 "FAILED" => Self::Failed,
11423 "SUSPENDED" => Self::Suspended,
11424 "DELETED" => Self::Deleted,
11425 _ => Self::UnknownValue(state::UnknownValue(
11426 wkt::internal::UnknownEnumValue::String(value.to_string()),
11427 )),
11428 }
11429 }
11430 }
11431
11432 impl serde::ser::Serialize for State {
11433 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11434 where
11435 S: serde::Serializer,
11436 {
11437 match self {
11438 Self::Unspecified => serializer.serialize_i32(0),
11439 Self::Creating => serializer.serialize_i32(1),
11440 Self::Active => serializer.serialize_i32(2),
11441 Self::Updating => serializer.serialize_i32(3),
11442 Self::Deleting => serializer.serialize_i32(4),
11443 Self::Failed => serializer.serialize_i32(5),
11444 Self::Suspended => serializer.serialize_i32(6),
11445 Self::Deleted => serializer.serialize_i32(7),
11446 Self::UnknownValue(u) => u.0.serialize(serializer),
11447 }
11448 }
11449 }
11450
11451 impl<'de> serde::de::Deserialize<'de> for State {
11452 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11453 where
11454 D: serde::Deserializer<'de>,
11455 {
11456 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
11457 ".google.cloud.config.v1.DeploymentGroup.State",
11458 ))
11459 }
11460 }
11461
11462 /// Possible provisioning states of a deployment group.
11463 ///
11464 /// # Working with unknown values
11465 ///
11466 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11467 /// additional enum variants at any time. Adding new variants is not considered
11468 /// a breaking change. Applications should write their code in anticipation of:
11469 ///
11470 /// - New values appearing in future releases of the client library, **and**
11471 /// - New values received dynamically, without application changes.
11472 ///
11473 /// Please consult the [Working with enums] section in the user guide for some
11474 /// guidelines.
11475 ///
11476 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
11477 #[derive(Clone, Debug, PartialEq)]
11478 #[non_exhaustive]
11479 pub enum ProvisioningState {
11480 /// Unspecified provisioning state.
11481 Unspecified,
11482 /// The deployment group is being provisioned.
11483 Provisioning,
11484 /// The deployment group is provisioned.
11485 Provisioned,
11486 /// The deployment group failed to be provisioned.
11487 FailedToProvision,
11488 /// The deployment group is being deprovisioned.
11489 Deprovisioning,
11490 /// The deployment group is deprovisioned.
11491 Deprovisioned,
11492 /// The deployment group failed to be deprovisioned.
11493 FailedToDeprovision,
11494 /// If set, the enum was initialized with an unknown value.
11495 ///
11496 /// Applications can examine the value using [ProvisioningState::value] or
11497 /// [ProvisioningState::name].
11498 UnknownValue(provisioning_state::UnknownValue),
11499 }
11500
11501 #[doc(hidden)]
11502 pub mod provisioning_state {
11503 #[allow(unused_imports)]
11504 use super::*;
11505 #[derive(Clone, Debug, PartialEq)]
11506 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11507 }
11508
11509 impl ProvisioningState {
11510 /// Gets the enum value.
11511 ///
11512 /// Returns `None` if the enum contains an unknown value deserialized from
11513 /// the string representation of enums.
11514 pub fn value(&self) -> std::option::Option<i32> {
11515 match self {
11516 Self::Unspecified => std::option::Option::Some(0),
11517 Self::Provisioning => std::option::Option::Some(1),
11518 Self::Provisioned => std::option::Option::Some(2),
11519 Self::FailedToProvision => std::option::Option::Some(3),
11520 Self::Deprovisioning => std::option::Option::Some(4),
11521 Self::Deprovisioned => std::option::Option::Some(5),
11522 Self::FailedToDeprovision => std::option::Option::Some(6),
11523 Self::UnknownValue(u) => u.0.value(),
11524 }
11525 }
11526
11527 /// Gets the enum value as a string.
11528 ///
11529 /// Returns `None` if the enum contains an unknown value deserialized from
11530 /// the integer representation of enums.
11531 pub fn name(&self) -> std::option::Option<&str> {
11532 match self {
11533 Self::Unspecified => std::option::Option::Some("PROVISIONING_STATE_UNSPECIFIED"),
11534 Self::Provisioning => std::option::Option::Some("PROVISIONING"),
11535 Self::Provisioned => std::option::Option::Some("PROVISIONED"),
11536 Self::FailedToProvision => std::option::Option::Some("FAILED_TO_PROVISION"),
11537 Self::Deprovisioning => std::option::Option::Some("DEPROVISIONING"),
11538 Self::Deprovisioned => std::option::Option::Some("DEPROVISIONED"),
11539 Self::FailedToDeprovision => std::option::Option::Some("FAILED_TO_DEPROVISION"),
11540 Self::UnknownValue(u) => u.0.name(),
11541 }
11542 }
11543 }
11544
11545 impl std::default::Default for ProvisioningState {
11546 fn default() -> Self {
11547 use std::convert::From;
11548 Self::from(0)
11549 }
11550 }
11551
11552 impl std::fmt::Display for ProvisioningState {
11553 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11554 wkt::internal::display_enum(f, self.name(), self.value())
11555 }
11556 }
11557
11558 impl std::convert::From<i32> for ProvisioningState {
11559 fn from(value: i32) -> Self {
11560 match value {
11561 0 => Self::Unspecified,
11562 1 => Self::Provisioning,
11563 2 => Self::Provisioned,
11564 3 => Self::FailedToProvision,
11565 4 => Self::Deprovisioning,
11566 5 => Self::Deprovisioned,
11567 6 => Self::FailedToDeprovision,
11568 _ => Self::UnknownValue(provisioning_state::UnknownValue(
11569 wkt::internal::UnknownEnumValue::Integer(value),
11570 )),
11571 }
11572 }
11573 }
11574
11575 impl std::convert::From<&str> for ProvisioningState {
11576 fn from(value: &str) -> Self {
11577 use std::string::ToString;
11578 match value {
11579 "PROVISIONING_STATE_UNSPECIFIED" => Self::Unspecified,
11580 "PROVISIONING" => Self::Provisioning,
11581 "PROVISIONED" => Self::Provisioned,
11582 "FAILED_TO_PROVISION" => Self::FailedToProvision,
11583 "DEPROVISIONING" => Self::Deprovisioning,
11584 "DEPROVISIONED" => Self::Deprovisioned,
11585 "FAILED_TO_DEPROVISION" => Self::FailedToDeprovision,
11586 _ => Self::UnknownValue(provisioning_state::UnknownValue(
11587 wkt::internal::UnknownEnumValue::String(value.to_string()),
11588 )),
11589 }
11590 }
11591 }
11592
11593 impl serde::ser::Serialize for ProvisioningState {
11594 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11595 where
11596 S: serde::Serializer,
11597 {
11598 match self {
11599 Self::Unspecified => serializer.serialize_i32(0),
11600 Self::Provisioning => serializer.serialize_i32(1),
11601 Self::Provisioned => serializer.serialize_i32(2),
11602 Self::FailedToProvision => serializer.serialize_i32(3),
11603 Self::Deprovisioning => serializer.serialize_i32(4),
11604 Self::Deprovisioned => serializer.serialize_i32(5),
11605 Self::FailedToDeprovision => serializer.serialize_i32(6),
11606 Self::UnknownValue(u) => u.0.serialize(serializer),
11607 }
11608 }
11609 }
11610
11611 impl<'de> serde::de::Deserialize<'de> for ProvisioningState {
11612 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11613 where
11614 D: serde::Deserializer<'de>,
11615 {
11616 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ProvisioningState>::new(
11617 ".google.cloud.config.v1.DeploymentGroup.ProvisioningState",
11618 ))
11619 }
11620 }
11621}
11622
11623/// A DeploymentUnit is a container for a deployment and its dependencies.
11624/// An existing deployment can be provided directly in the unit, or the unit
11625/// can act as a placeholder to define the DAG, with the deployment specs
11626/// supplied in a `provisionDeploymentRequest`.
11627#[derive(Clone, Default, PartialEq)]
11628#[non_exhaustive]
11629pub struct DeploymentUnit {
11630 /// The id of the deployment unit. Must be unique within the deployment group.
11631 pub id: std::string::String,
11632
11633 /// Optional. The name of the deployment to be provisioned.
11634 /// Format:
11635 /// 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
11636 pub deployment: std::option::Option<std::string::String>,
11637
11638 /// Required. The IDs of the deployment units within the deployment group that
11639 /// this unit depends on.
11640 pub dependencies: std::vec::Vec<std::string::String>,
11641
11642 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11643}
11644
11645impl DeploymentUnit {
11646 /// Creates a new default instance.
11647 pub fn new() -> Self {
11648 std::default::Default::default()
11649 }
11650
11651 /// Sets the value of [id][crate::model::DeploymentUnit::id].
11652 ///
11653 /// # Example
11654 /// ```ignore,no_run
11655 /// # use google_cloud_config_v1::model::DeploymentUnit;
11656 /// let x = DeploymentUnit::new().set_id("example");
11657 /// ```
11658 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11659 self.id = v.into();
11660 self
11661 }
11662
11663 /// Sets the value of [deployment][crate::model::DeploymentUnit::deployment].
11664 ///
11665 /// # Example
11666 /// ```ignore,no_run
11667 /// # use google_cloud_config_v1::model::DeploymentUnit;
11668 /// # let project_id = "project_id";
11669 /// # let location_id = "location_id";
11670 /// # let deployment_id = "deployment_id";
11671 /// let x = DeploymentUnit::new().set_deployment(format!("projects/{project_id}/locations/{location_id}/deployments/{deployment_id}"));
11672 /// ```
11673 pub fn set_deployment<T>(mut self, v: T) -> Self
11674 where
11675 T: std::convert::Into<std::string::String>,
11676 {
11677 self.deployment = std::option::Option::Some(v.into());
11678 self
11679 }
11680
11681 /// Sets or clears the value of [deployment][crate::model::DeploymentUnit::deployment].
11682 ///
11683 /// # Example
11684 /// ```ignore,no_run
11685 /// # use google_cloud_config_v1::model::DeploymentUnit;
11686 /// # let project_id = "project_id";
11687 /// # let location_id = "location_id";
11688 /// # let deployment_id = "deployment_id";
11689 /// let x = DeploymentUnit::new().set_or_clear_deployment(Some(format!("projects/{project_id}/locations/{location_id}/deployments/{deployment_id}")));
11690 /// let x = DeploymentUnit::new().set_or_clear_deployment(None::<String>);
11691 /// ```
11692 pub fn set_or_clear_deployment<T>(mut self, v: std::option::Option<T>) -> Self
11693 where
11694 T: std::convert::Into<std::string::String>,
11695 {
11696 self.deployment = v.map(|x| x.into());
11697 self
11698 }
11699
11700 /// Sets the value of [dependencies][crate::model::DeploymentUnit::dependencies].
11701 ///
11702 /// # Example
11703 /// ```ignore,no_run
11704 /// # use google_cloud_config_v1::model::DeploymentUnit;
11705 /// let x = DeploymentUnit::new().set_dependencies(["a", "b", "c"]);
11706 /// ```
11707 pub fn set_dependencies<T, V>(mut self, v: T) -> Self
11708 where
11709 T: std::iter::IntoIterator<Item = V>,
11710 V: std::convert::Into<std::string::String>,
11711 {
11712 use std::iter::Iterator;
11713 self.dependencies = v.into_iter().map(|i| i.into()).collect();
11714 self
11715 }
11716}
11717
11718impl wkt::message::Message for DeploymentUnit {
11719 fn typename() -> &'static str {
11720 "type.googleapis.com/google.cloud.config.v1.DeploymentUnit"
11721 }
11722}
11723
11724/// Spec for a deployment to be created.
11725#[derive(Clone, Default, PartialEq)]
11726#[non_exhaustive]
11727pub struct DeploymentSpec {
11728 /// Required. The id of the deployment to be created which doesn't include the
11729 /// project id and location.
11730 pub deployment_id: std::string::String,
11731
11732 /// Required. The deployment to be created.
11733 pub deployment: std::option::Option<crate::model::Deployment>,
11734
11735 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11736}
11737
11738impl DeploymentSpec {
11739 /// Creates a new default instance.
11740 pub fn new() -> Self {
11741 std::default::Default::default()
11742 }
11743
11744 /// Sets the value of [deployment_id][crate::model::DeploymentSpec::deployment_id].
11745 ///
11746 /// # Example
11747 /// ```ignore,no_run
11748 /// # use google_cloud_config_v1::model::DeploymentSpec;
11749 /// let x = DeploymentSpec::new().set_deployment_id("example");
11750 /// ```
11751 pub fn set_deployment_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11752 self.deployment_id = v.into();
11753 self
11754 }
11755
11756 /// Sets the value of [deployment][crate::model::DeploymentSpec::deployment].
11757 ///
11758 /// # Example
11759 /// ```ignore,no_run
11760 /// # use google_cloud_config_v1::model::DeploymentSpec;
11761 /// use google_cloud_config_v1::model::Deployment;
11762 /// let x = DeploymentSpec::new().set_deployment(Deployment::default()/* use setters */);
11763 /// ```
11764 pub fn set_deployment<T>(mut self, v: T) -> Self
11765 where
11766 T: std::convert::Into<crate::model::Deployment>,
11767 {
11768 self.deployment = std::option::Option::Some(v.into());
11769 self
11770 }
11771
11772 /// Sets or clears the value of [deployment][crate::model::DeploymentSpec::deployment].
11773 ///
11774 /// # Example
11775 /// ```ignore,no_run
11776 /// # use google_cloud_config_v1::model::DeploymentSpec;
11777 /// use google_cloud_config_v1::model::Deployment;
11778 /// let x = DeploymentSpec::new().set_or_clear_deployment(Some(Deployment::default()/* use setters */));
11779 /// let x = DeploymentSpec::new().set_or_clear_deployment(None::<Deployment>);
11780 /// ```
11781 pub fn set_or_clear_deployment<T>(mut self, v: std::option::Option<T>) -> Self
11782 where
11783 T: std::convert::Into<crate::model::Deployment>,
11784 {
11785 self.deployment = v.map(|x| x.into());
11786 self
11787 }
11788}
11789
11790impl wkt::message::Message for DeploymentSpec {
11791 fn typename() -> &'static str {
11792 "type.googleapis.com/google.cloud.config.v1.DeploymentSpec"
11793 }
11794}
11795
11796/// The request message for the GetDeploymentGroup method.
11797#[derive(Clone, Default, PartialEq)]
11798#[non_exhaustive]
11799pub struct GetDeploymentGroupRequest {
11800 /// Required. The name of the deployment group to retrieve.
11801 /// Format:
11802 /// 'projects/{project_id}/locations/{location}/deploymentGroups/{deployment_group}'.
11803 pub name: std::string::String,
11804
11805 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11806}
11807
11808impl GetDeploymentGroupRequest {
11809 /// Creates a new default instance.
11810 pub fn new() -> Self {
11811 std::default::Default::default()
11812 }
11813
11814 /// Sets the value of [name][crate::model::GetDeploymentGroupRequest::name].
11815 ///
11816 /// # Example
11817 /// ```ignore,no_run
11818 /// # use google_cloud_config_v1::model::GetDeploymentGroupRequest;
11819 /// # let project_id = "project_id";
11820 /// # let location_id = "location_id";
11821 /// # let deployment_group_id = "deployment_group_id";
11822 /// let x = GetDeploymentGroupRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/deploymentGroups/{deployment_group_id}"));
11823 /// ```
11824 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11825 self.name = v.into();
11826 self
11827 }
11828}
11829
11830impl wkt::message::Message for GetDeploymentGroupRequest {
11831 fn typename() -> &'static str {
11832 "type.googleapis.com/google.cloud.config.v1.GetDeploymentGroupRequest"
11833 }
11834}
11835
11836/// The request message for the ListDeploymentGroups method.
11837#[derive(Clone, Default, PartialEq)]
11838#[non_exhaustive]
11839pub struct ListDeploymentGroupsRequest {
11840 /// Required. The parent, which owns this collection of deployment groups.
11841 /// Format: 'projects/{project_id}/locations/{location}'.
11842 pub parent: std::string::String,
11843
11844 /// Optional. When requesting a page of resources, 'page_size' specifies number
11845 /// of resources to return. If unspecified, at most 500 will be returned. The
11846 /// maximum value is 1000.
11847 pub page_size: i32,
11848
11849 /// Optional. Token returned by previous call to 'ListDeploymentGroups' which
11850 /// specifies the position in the list from where to continue listing the
11851 /// deployment groups.
11852 pub page_token: std::string::String,
11853
11854 /// Optional. Lists the DeploymentGroups that match the filter expression. A
11855 /// filter expression filters the deployment groups listed in the response. The
11856 /// expression must be of the form '{field} {operator} {value}' where
11857 /// operators: '<', '>',
11858 /// '<=', '>=', '!=', '=', ':' are supported (colon ':' represents a HAS
11859 /// operator which is roughly synonymous with equality). {field} can refer to a
11860 /// proto or JSON field, or a synthetic field. Field names can be camelCase or
11861 /// snake_case.
11862 ///
11863 /// Examples:
11864 ///
11865 /// - Filter by name:
11866 /// name = "projects/foo/locations/us-central1/deploymentGroups/bar"
11867 ///
11868 /// - Filter by labels:
11869 ///
11870 /// - Resources that have a key called 'foo'
11871 /// labels.foo:*
11872 /// - Resources that have a key called 'foo' whose value is 'bar'
11873 /// labels.foo = bar
11874 /// - Filter by state:
11875 ///
11876 /// - DeploymentGroups in CREATING state.
11877 /// state=CREATING
11878 pub filter: std::string::String,
11879
11880 /// Optional. Field to use to sort the list.
11881 pub order_by: std::string::String,
11882
11883 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11884}
11885
11886impl ListDeploymentGroupsRequest {
11887 /// Creates a new default instance.
11888 pub fn new() -> Self {
11889 std::default::Default::default()
11890 }
11891
11892 /// Sets the value of [parent][crate::model::ListDeploymentGroupsRequest::parent].
11893 ///
11894 /// # Example
11895 /// ```ignore,no_run
11896 /// # use google_cloud_config_v1::model::ListDeploymentGroupsRequest;
11897 /// let x = ListDeploymentGroupsRequest::new().set_parent("example");
11898 /// ```
11899 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11900 self.parent = v.into();
11901 self
11902 }
11903
11904 /// Sets the value of [page_size][crate::model::ListDeploymentGroupsRequest::page_size].
11905 ///
11906 /// # Example
11907 /// ```ignore,no_run
11908 /// # use google_cloud_config_v1::model::ListDeploymentGroupsRequest;
11909 /// let x = ListDeploymentGroupsRequest::new().set_page_size(42);
11910 /// ```
11911 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11912 self.page_size = v.into();
11913 self
11914 }
11915
11916 /// Sets the value of [page_token][crate::model::ListDeploymentGroupsRequest::page_token].
11917 ///
11918 /// # Example
11919 /// ```ignore,no_run
11920 /// # use google_cloud_config_v1::model::ListDeploymentGroupsRequest;
11921 /// let x = ListDeploymentGroupsRequest::new().set_page_token("example");
11922 /// ```
11923 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11924 self.page_token = v.into();
11925 self
11926 }
11927
11928 /// Sets the value of [filter][crate::model::ListDeploymentGroupsRequest::filter].
11929 ///
11930 /// # Example
11931 /// ```ignore,no_run
11932 /// # use google_cloud_config_v1::model::ListDeploymentGroupsRequest;
11933 /// let x = ListDeploymentGroupsRequest::new().set_filter("example");
11934 /// ```
11935 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11936 self.filter = v.into();
11937 self
11938 }
11939
11940 /// Sets the value of [order_by][crate::model::ListDeploymentGroupsRequest::order_by].
11941 ///
11942 /// # Example
11943 /// ```ignore,no_run
11944 /// # use google_cloud_config_v1::model::ListDeploymentGroupsRequest;
11945 /// let x = ListDeploymentGroupsRequest::new().set_order_by("example");
11946 /// ```
11947 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11948 self.order_by = v.into();
11949 self
11950 }
11951}
11952
11953impl wkt::message::Message for ListDeploymentGroupsRequest {
11954 fn typename() -> &'static str {
11955 "type.googleapis.com/google.cloud.config.v1.ListDeploymentGroupsRequest"
11956 }
11957}
11958
11959/// The response message for the ListDeploymentGroups method.
11960#[derive(Clone, Default, PartialEq)]
11961#[non_exhaustive]
11962pub struct ListDeploymentGroupsResponse {
11963 /// The deployment groups from the specified collection.
11964 pub deployment_groups: std::vec::Vec<crate::model::DeploymentGroup>,
11965
11966 /// Token to be supplied to the next ListDeploymentGroups request via
11967 /// `page_token` to obtain the next set of results.
11968 pub next_page_token: std::string::String,
11969
11970 /// Locations that could not be reached.
11971 pub unreachable: std::vec::Vec<std::string::String>,
11972
11973 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11974}
11975
11976impl ListDeploymentGroupsResponse {
11977 /// Creates a new default instance.
11978 pub fn new() -> Self {
11979 std::default::Default::default()
11980 }
11981
11982 /// Sets the value of [deployment_groups][crate::model::ListDeploymentGroupsResponse::deployment_groups].
11983 ///
11984 /// # Example
11985 /// ```ignore,no_run
11986 /// # use google_cloud_config_v1::model::ListDeploymentGroupsResponse;
11987 /// use google_cloud_config_v1::model::DeploymentGroup;
11988 /// let x = ListDeploymentGroupsResponse::new()
11989 /// .set_deployment_groups([
11990 /// DeploymentGroup::default()/* use setters */,
11991 /// DeploymentGroup::default()/* use (different) setters */,
11992 /// ]);
11993 /// ```
11994 pub fn set_deployment_groups<T, V>(mut self, v: T) -> Self
11995 where
11996 T: std::iter::IntoIterator<Item = V>,
11997 V: std::convert::Into<crate::model::DeploymentGroup>,
11998 {
11999 use std::iter::Iterator;
12000 self.deployment_groups = v.into_iter().map(|i| i.into()).collect();
12001 self
12002 }
12003
12004 /// Sets the value of [next_page_token][crate::model::ListDeploymentGroupsResponse::next_page_token].
12005 ///
12006 /// # Example
12007 /// ```ignore,no_run
12008 /// # use google_cloud_config_v1::model::ListDeploymentGroupsResponse;
12009 /// let x = ListDeploymentGroupsResponse::new().set_next_page_token("example");
12010 /// ```
12011 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12012 self.next_page_token = v.into();
12013 self
12014 }
12015
12016 /// Sets the value of [unreachable][crate::model::ListDeploymentGroupsResponse::unreachable].
12017 ///
12018 /// # Example
12019 /// ```ignore,no_run
12020 /// # use google_cloud_config_v1::model::ListDeploymentGroupsResponse;
12021 /// let x = ListDeploymentGroupsResponse::new().set_unreachable(["a", "b", "c"]);
12022 /// ```
12023 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
12024 where
12025 T: std::iter::IntoIterator<Item = V>,
12026 V: std::convert::Into<std::string::String>,
12027 {
12028 use std::iter::Iterator;
12029 self.unreachable = v.into_iter().map(|i| i.into()).collect();
12030 self
12031 }
12032}
12033
12034impl wkt::message::Message for ListDeploymentGroupsResponse {
12035 fn typename() -> &'static str {
12036 "type.googleapis.com/google.cloud.config.v1.ListDeploymentGroupsResponse"
12037 }
12038}
12039
12040#[doc(hidden)]
12041impl google_cloud_gax::paginator::internal::PageableResponse for ListDeploymentGroupsResponse {
12042 type PageItem = crate::model::DeploymentGroup;
12043
12044 fn items(self) -> std::vec::Vec<Self::PageItem> {
12045 self.deployment_groups
12046 }
12047
12048 fn next_page_token(&self) -> std::string::String {
12049 use std::clone::Clone;
12050 self.next_page_token.clone()
12051 }
12052}
12053
12054/// The request message for the ProvisionDeploymentGroup method.
12055#[derive(Clone, Default, PartialEq)]
12056#[non_exhaustive]
12057pub struct ProvisionDeploymentGroupRequest {
12058 /// Required. The name of the deployment group to provision.
12059 /// Format:
12060 /// 'projects/{project_id}/locations/{location}/deploymentGroups/{deployment_group}'.
12061 pub name: std::string::String,
12062
12063 /// Optional. The deployment specs of the deployment units to be created within
12064 /// the same project and location of the deployment group. The key is the unit
12065 /// ID, and the value is the `DeploymentSpec`. Provisioning will fail if a
12066 /// `deployment_spec` has a `deployment_id` that matches an existing deployment
12067 /// in the same project and location. If an existing deployment was part of the
12068 /// last successful revision but is no longer in the current DeploymentGroup's
12069 /// `deployment_units`, it will be recreated if included in `deployment_specs`.
12070 pub deployment_specs:
12071 std::collections::HashMap<std::string::String, crate::model::DeploymentSpec>,
12072
12073 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12074}
12075
12076impl ProvisionDeploymentGroupRequest {
12077 /// Creates a new default instance.
12078 pub fn new() -> Self {
12079 std::default::Default::default()
12080 }
12081
12082 /// Sets the value of [name][crate::model::ProvisionDeploymentGroupRequest::name].
12083 ///
12084 /// # Example
12085 /// ```ignore,no_run
12086 /// # use google_cloud_config_v1::model::ProvisionDeploymentGroupRequest;
12087 /// # let project_id = "project_id";
12088 /// # let location_id = "location_id";
12089 /// # let deployment_group_id = "deployment_group_id";
12090 /// let x = ProvisionDeploymentGroupRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/deploymentGroups/{deployment_group_id}"));
12091 /// ```
12092 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12093 self.name = v.into();
12094 self
12095 }
12096
12097 /// Sets the value of [deployment_specs][crate::model::ProvisionDeploymentGroupRequest::deployment_specs].
12098 ///
12099 /// # Example
12100 /// ```ignore,no_run
12101 /// # use google_cloud_config_v1::model::ProvisionDeploymentGroupRequest;
12102 /// use google_cloud_config_v1::model::DeploymentSpec;
12103 /// let x = ProvisionDeploymentGroupRequest::new().set_deployment_specs([
12104 /// ("key0", DeploymentSpec::default()/* use setters */),
12105 /// ("key1", DeploymentSpec::default()/* use (different) setters */),
12106 /// ]);
12107 /// ```
12108 pub fn set_deployment_specs<T, K, V>(mut self, v: T) -> Self
12109 where
12110 T: std::iter::IntoIterator<Item = (K, V)>,
12111 K: std::convert::Into<std::string::String>,
12112 V: std::convert::Into<crate::model::DeploymentSpec>,
12113 {
12114 use std::iter::Iterator;
12115 self.deployment_specs = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
12116 self
12117 }
12118}
12119
12120impl wkt::message::Message for ProvisionDeploymentGroupRequest {
12121 fn typename() -> &'static str {
12122 "type.googleapis.com/google.cloud.config.v1.ProvisionDeploymentGroupRequest"
12123 }
12124}
12125
12126/// The request message for the DeprovisionDeploymentGroup method.
12127#[derive(Clone, Default, PartialEq)]
12128#[non_exhaustive]
12129pub struct DeprovisionDeploymentGroupRequest {
12130 /// Required. The name of the deployment group to deprovision.
12131 /// Format:
12132 /// 'projects/{project_id}/locations/{location}/deploymentGroups/{deployment_group}'.
12133 pub name: std::string::String,
12134
12135 /// Optional. If set to true, this option is propagated to the deletion of each
12136 /// deployment in the group. This corresponds to the 'force' field
12137 /// in DeleteDeploymentRequest.
12138 pub force: bool,
12139
12140 /// Optional. Policy on how resources within each deployment should be handled
12141 /// during deletion. This policy is applied globally to the deletion of all
12142 /// deployments in this group. This corresponds to the 'delete_policy' field
12143 /// in DeleteDeploymentRequest.
12144 pub delete_policy: crate::model::delete_deployment_request::DeletePolicy,
12145
12146 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12147}
12148
12149impl DeprovisionDeploymentGroupRequest {
12150 /// Creates a new default instance.
12151 pub fn new() -> Self {
12152 std::default::Default::default()
12153 }
12154
12155 /// Sets the value of [name][crate::model::DeprovisionDeploymentGroupRequest::name].
12156 ///
12157 /// # Example
12158 /// ```ignore,no_run
12159 /// # use google_cloud_config_v1::model::DeprovisionDeploymentGroupRequest;
12160 /// # let project_id = "project_id";
12161 /// # let location_id = "location_id";
12162 /// # let deployment_group_id = "deployment_group_id";
12163 /// let x = DeprovisionDeploymentGroupRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/deploymentGroups/{deployment_group_id}"));
12164 /// ```
12165 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12166 self.name = v.into();
12167 self
12168 }
12169
12170 /// Sets the value of [force][crate::model::DeprovisionDeploymentGroupRequest::force].
12171 ///
12172 /// # Example
12173 /// ```ignore,no_run
12174 /// # use google_cloud_config_v1::model::DeprovisionDeploymentGroupRequest;
12175 /// let x = DeprovisionDeploymentGroupRequest::new().set_force(true);
12176 /// ```
12177 pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
12178 self.force = v.into();
12179 self
12180 }
12181
12182 /// Sets the value of [delete_policy][crate::model::DeprovisionDeploymentGroupRequest::delete_policy].
12183 ///
12184 /// # Example
12185 /// ```ignore,no_run
12186 /// # use google_cloud_config_v1::model::DeprovisionDeploymentGroupRequest;
12187 /// use google_cloud_config_v1::model::delete_deployment_request::DeletePolicy;
12188 /// let x0 = DeprovisionDeploymentGroupRequest::new().set_delete_policy(DeletePolicy::Delete);
12189 /// let x1 = DeprovisionDeploymentGroupRequest::new().set_delete_policy(DeletePolicy::Abandon);
12190 /// ```
12191 pub fn set_delete_policy<
12192 T: std::convert::Into<crate::model::delete_deployment_request::DeletePolicy>,
12193 >(
12194 mut self,
12195 v: T,
12196 ) -> Self {
12197 self.delete_policy = v.into();
12198 self
12199 }
12200}
12201
12202impl wkt::message::Message for DeprovisionDeploymentGroupRequest {
12203 fn typename() -> &'static str {
12204 "type.googleapis.com/google.cloud.config.v1.DeprovisionDeploymentGroupRequest"
12205 }
12206}
12207
12208/// The summary of the deployment operation.
12209#[derive(Clone, Default, PartialEq)]
12210#[non_exhaustive]
12211pub struct DeploymentOperationSummary {
12212 /// Output only. The current step the deployment operation is running.
12213 pub deployment_step: crate::model::deployment_operation_metadata::DeploymentStep,
12214
12215 /// Output only. Cloud Build instance UUID associated with this operation.
12216 pub build: std::string::String,
12217
12218 /// Output only. Location of Deployment operations logs in
12219 /// `gs://{bucket}/{object}` format.
12220 pub logs: std::string::String,
12221
12222 /// Output only. Location of Deployment operations content in
12223 /// `gs://{bucket}/{object}` format.
12224 pub content: std::string::String,
12225
12226 /// Output only. Location of Deployment operations artifacts in
12227 /// `gs://{bucket}/{object}` format.
12228 pub artifacts: std::string::String,
12229
12230 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12231}
12232
12233impl DeploymentOperationSummary {
12234 /// Creates a new default instance.
12235 pub fn new() -> Self {
12236 std::default::Default::default()
12237 }
12238
12239 /// Sets the value of [deployment_step][crate::model::DeploymentOperationSummary::deployment_step].
12240 ///
12241 /// # Example
12242 /// ```ignore,no_run
12243 /// # use google_cloud_config_v1::model::DeploymentOperationSummary;
12244 /// use google_cloud_config_v1::model::deployment_operation_metadata::DeploymentStep;
12245 /// let x0 = DeploymentOperationSummary::new().set_deployment_step(DeploymentStep::PreparingStorageBucket);
12246 /// let x1 = DeploymentOperationSummary::new().set_deployment_step(DeploymentStep::DownloadingBlueprint);
12247 /// let x2 = DeploymentOperationSummary::new().set_deployment_step(DeploymentStep::RunningTfInit);
12248 /// ```
12249 pub fn set_deployment_step<
12250 T: std::convert::Into<crate::model::deployment_operation_metadata::DeploymentStep>,
12251 >(
12252 mut self,
12253 v: T,
12254 ) -> Self {
12255 self.deployment_step = v.into();
12256 self
12257 }
12258
12259 /// Sets the value of [build][crate::model::DeploymentOperationSummary::build].
12260 ///
12261 /// # Example
12262 /// ```ignore,no_run
12263 /// # use google_cloud_config_v1::model::DeploymentOperationSummary;
12264 /// let x = DeploymentOperationSummary::new().set_build("example");
12265 /// ```
12266 pub fn set_build<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12267 self.build = v.into();
12268 self
12269 }
12270
12271 /// Sets the value of [logs][crate::model::DeploymentOperationSummary::logs].
12272 ///
12273 /// # Example
12274 /// ```ignore,no_run
12275 /// # use google_cloud_config_v1::model::DeploymentOperationSummary;
12276 /// let x = DeploymentOperationSummary::new().set_logs("example");
12277 /// ```
12278 pub fn set_logs<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12279 self.logs = v.into();
12280 self
12281 }
12282
12283 /// Sets the value of [content][crate::model::DeploymentOperationSummary::content].
12284 ///
12285 /// # Example
12286 /// ```ignore,no_run
12287 /// # use google_cloud_config_v1::model::DeploymentOperationSummary;
12288 /// let x = DeploymentOperationSummary::new().set_content("example");
12289 /// ```
12290 pub fn set_content<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12291 self.content = v.into();
12292 self
12293 }
12294
12295 /// Sets the value of [artifacts][crate::model::DeploymentOperationSummary::artifacts].
12296 ///
12297 /// # Example
12298 /// ```ignore,no_run
12299 /// # use google_cloud_config_v1::model::DeploymentOperationSummary;
12300 /// let x = DeploymentOperationSummary::new().set_artifacts("example");
12301 /// ```
12302 pub fn set_artifacts<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12303 self.artifacts = v.into();
12304 self
12305 }
12306}
12307
12308impl wkt::message::Message for DeploymentOperationSummary {
12309 fn typename() -> &'static str {
12310 "type.googleapis.com/google.cloud.config.v1.DeploymentOperationSummary"
12311 }
12312}
12313
12314/// The progress of a deployment unit provisioning or deprovisioning.
12315#[derive(Clone, Default, PartialEq)]
12316#[non_exhaustive]
12317pub struct DeploymentUnitProgress {
12318 /// Output only. The unit id of the deployment unit to be provisioned.
12319 pub unit_id: std::string::String,
12320
12321 /// Output only. The name of the deployment to be provisioned.
12322 /// Format:
12323 /// 'projects/{project}/locations/{location}/deployments/{deployment}'.
12324 pub deployment: std::string::String,
12325
12326 /// Output only. The current step of the deployment unit provisioning.
12327 pub state: crate::model::deployment_unit_progress::State,
12328
12329 /// Output only. Additional information regarding the current state.
12330 pub state_description: std::string::String,
12331
12332 /// Output only. The summary of the deployment operation.
12333 pub deployment_operation_summary: std::option::Option<crate::model::DeploymentOperationSummary>,
12334
12335 /// Output only. Holds the error status of the deployment unit provisioning.
12336 pub error: std::option::Option<google_cloud_rpc::model::Status>,
12337
12338 /// Output only. The intent of the deployment unit.
12339 pub intent: crate::model::deployment_unit_progress::Intent,
12340
12341 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12342}
12343
12344impl DeploymentUnitProgress {
12345 /// Creates a new default instance.
12346 pub fn new() -> Self {
12347 std::default::Default::default()
12348 }
12349
12350 /// Sets the value of [unit_id][crate::model::DeploymentUnitProgress::unit_id].
12351 ///
12352 /// # Example
12353 /// ```ignore,no_run
12354 /// # use google_cloud_config_v1::model::DeploymentUnitProgress;
12355 /// let x = DeploymentUnitProgress::new().set_unit_id("example");
12356 /// ```
12357 pub fn set_unit_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12358 self.unit_id = v.into();
12359 self
12360 }
12361
12362 /// Sets the value of [deployment][crate::model::DeploymentUnitProgress::deployment].
12363 ///
12364 /// # Example
12365 /// ```ignore,no_run
12366 /// # use google_cloud_config_v1::model::DeploymentUnitProgress;
12367 /// # let project_id = "project_id";
12368 /// # let location_id = "location_id";
12369 /// # let deployment_id = "deployment_id";
12370 /// let x = DeploymentUnitProgress::new().set_deployment(format!("projects/{project_id}/locations/{location_id}/deployments/{deployment_id}"));
12371 /// ```
12372 pub fn set_deployment<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12373 self.deployment = v.into();
12374 self
12375 }
12376
12377 /// Sets the value of [state][crate::model::DeploymentUnitProgress::state].
12378 ///
12379 /// # Example
12380 /// ```ignore,no_run
12381 /// # use google_cloud_config_v1::model::DeploymentUnitProgress;
12382 /// use google_cloud_config_v1::model::deployment_unit_progress::State;
12383 /// let x0 = DeploymentUnitProgress::new().set_state(State::Queued);
12384 /// let x1 = DeploymentUnitProgress::new().set_state(State::ApplyingDeployment);
12385 /// let x2 = DeploymentUnitProgress::new().set_state(State::Succeeded);
12386 /// ```
12387 pub fn set_state<T: std::convert::Into<crate::model::deployment_unit_progress::State>>(
12388 mut self,
12389 v: T,
12390 ) -> Self {
12391 self.state = v.into();
12392 self
12393 }
12394
12395 /// Sets the value of [state_description][crate::model::DeploymentUnitProgress::state_description].
12396 ///
12397 /// # Example
12398 /// ```ignore,no_run
12399 /// # use google_cloud_config_v1::model::DeploymentUnitProgress;
12400 /// let x = DeploymentUnitProgress::new().set_state_description("example");
12401 /// ```
12402 pub fn set_state_description<T: std::convert::Into<std::string::String>>(
12403 mut self,
12404 v: T,
12405 ) -> Self {
12406 self.state_description = v.into();
12407 self
12408 }
12409
12410 /// Sets the value of [deployment_operation_summary][crate::model::DeploymentUnitProgress::deployment_operation_summary].
12411 ///
12412 /// # Example
12413 /// ```ignore,no_run
12414 /// # use google_cloud_config_v1::model::DeploymentUnitProgress;
12415 /// use google_cloud_config_v1::model::DeploymentOperationSummary;
12416 /// let x = DeploymentUnitProgress::new().set_deployment_operation_summary(DeploymentOperationSummary::default()/* use setters */);
12417 /// ```
12418 pub fn set_deployment_operation_summary<T>(mut self, v: T) -> Self
12419 where
12420 T: std::convert::Into<crate::model::DeploymentOperationSummary>,
12421 {
12422 self.deployment_operation_summary = std::option::Option::Some(v.into());
12423 self
12424 }
12425
12426 /// Sets or clears the value of [deployment_operation_summary][crate::model::DeploymentUnitProgress::deployment_operation_summary].
12427 ///
12428 /// # Example
12429 /// ```ignore,no_run
12430 /// # use google_cloud_config_v1::model::DeploymentUnitProgress;
12431 /// use google_cloud_config_v1::model::DeploymentOperationSummary;
12432 /// let x = DeploymentUnitProgress::new().set_or_clear_deployment_operation_summary(Some(DeploymentOperationSummary::default()/* use setters */));
12433 /// let x = DeploymentUnitProgress::new().set_or_clear_deployment_operation_summary(None::<DeploymentOperationSummary>);
12434 /// ```
12435 pub fn set_or_clear_deployment_operation_summary<T>(mut self, v: std::option::Option<T>) -> Self
12436 where
12437 T: std::convert::Into<crate::model::DeploymentOperationSummary>,
12438 {
12439 self.deployment_operation_summary = v.map(|x| x.into());
12440 self
12441 }
12442
12443 /// Sets the value of [error][crate::model::DeploymentUnitProgress::error].
12444 ///
12445 /// # Example
12446 /// ```ignore,no_run
12447 /// # use google_cloud_config_v1::model::DeploymentUnitProgress;
12448 /// use google_cloud_rpc::model::Status;
12449 /// let x = DeploymentUnitProgress::new().set_error(Status::default()/* use setters */);
12450 /// ```
12451 pub fn set_error<T>(mut self, v: T) -> Self
12452 where
12453 T: std::convert::Into<google_cloud_rpc::model::Status>,
12454 {
12455 self.error = std::option::Option::Some(v.into());
12456 self
12457 }
12458
12459 /// Sets or clears the value of [error][crate::model::DeploymentUnitProgress::error].
12460 ///
12461 /// # Example
12462 /// ```ignore,no_run
12463 /// # use google_cloud_config_v1::model::DeploymentUnitProgress;
12464 /// use google_cloud_rpc::model::Status;
12465 /// let x = DeploymentUnitProgress::new().set_or_clear_error(Some(Status::default()/* use setters */));
12466 /// let x = DeploymentUnitProgress::new().set_or_clear_error(None::<Status>);
12467 /// ```
12468 pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
12469 where
12470 T: std::convert::Into<google_cloud_rpc::model::Status>,
12471 {
12472 self.error = v.map(|x| x.into());
12473 self
12474 }
12475
12476 /// Sets the value of [intent][crate::model::DeploymentUnitProgress::intent].
12477 ///
12478 /// # Example
12479 /// ```ignore,no_run
12480 /// # use google_cloud_config_v1::model::DeploymentUnitProgress;
12481 /// use google_cloud_config_v1::model::deployment_unit_progress::Intent;
12482 /// let x0 = DeploymentUnitProgress::new().set_intent(Intent::CreateDeployment);
12483 /// let x1 = DeploymentUnitProgress::new().set_intent(Intent::UpdateDeployment);
12484 /// let x2 = DeploymentUnitProgress::new().set_intent(Intent::DeleteDeployment);
12485 /// ```
12486 pub fn set_intent<T: std::convert::Into<crate::model::deployment_unit_progress::Intent>>(
12487 mut self,
12488 v: T,
12489 ) -> Self {
12490 self.intent = v.into();
12491 self
12492 }
12493}
12494
12495impl wkt::message::Message for DeploymentUnitProgress {
12496 fn typename() -> &'static str {
12497 "type.googleapis.com/google.cloud.config.v1.DeploymentUnitProgress"
12498 }
12499}
12500
12501/// Defines additional types related to [DeploymentUnitProgress].
12502pub mod deployment_unit_progress {
12503 #[allow(unused_imports)]
12504 use super::*;
12505
12506 /// The possible steps a deployment unit provisioning may be running.
12507 ///
12508 /// # Working with unknown values
12509 ///
12510 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12511 /// additional enum variants at any time. Adding new variants is not considered
12512 /// a breaking change. Applications should write their code in anticipation of:
12513 ///
12514 /// - New values appearing in future releases of the client library, **and**
12515 /// - New values received dynamically, without application changes.
12516 ///
12517 /// Please consult the [Working with enums] section in the user guide for some
12518 /// guidelines.
12519 ///
12520 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
12521 #[derive(Clone, Debug, PartialEq)]
12522 #[non_exhaustive]
12523 pub enum State {
12524 /// The default value. This value is unused.
12525 Unspecified,
12526 /// The deployment unit is queued for deployment creation or update.
12527 Queued,
12528 /// The underlying deployment of the unit is being created or updated.
12529 ApplyingDeployment,
12530 /// The underlying deployment operation of the unit has succeeded.
12531 Succeeded,
12532 /// The underlying deployment operation of the unit has failed.
12533 Failed,
12534 /// The deployment unit was aborted, likely due to failures in other
12535 /// dependent deployment units.
12536 Aborted,
12537 /// The deployment unit was skipped because there were no changes to apply.
12538 Skipped,
12539 /// The deployment is being deleted.
12540 DeletingDeployment,
12541 /// The deployment is being previewed.
12542 PreviewingDeployment,
12543 /// If set, the enum was initialized with an unknown value.
12544 ///
12545 /// Applications can examine the value using [State::value] or
12546 /// [State::name].
12547 UnknownValue(state::UnknownValue),
12548 }
12549
12550 #[doc(hidden)]
12551 pub mod state {
12552 #[allow(unused_imports)]
12553 use super::*;
12554 #[derive(Clone, Debug, PartialEq)]
12555 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12556 }
12557
12558 impl State {
12559 /// Gets the enum value.
12560 ///
12561 /// Returns `None` if the enum contains an unknown value deserialized from
12562 /// the string representation of enums.
12563 pub fn value(&self) -> std::option::Option<i32> {
12564 match self {
12565 Self::Unspecified => std::option::Option::Some(0),
12566 Self::Queued => std::option::Option::Some(1),
12567 Self::ApplyingDeployment => std::option::Option::Some(2),
12568 Self::Succeeded => std::option::Option::Some(4),
12569 Self::Failed => std::option::Option::Some(5),
12570 Self::Aborted => std::option::Option::Some(6),
12571 Self::Skipped => std::option::Option::Some(7),
12572 Self::DeletingDeployment => std::option::Option::Some(8),
12573 Self::PreviewingDeployment => std::option::Option::Some(9),
12574 Self::UnknownValue(u) => u.0.value(),
12575 }
12576 }
12577
12578 /// Gets the enum value as a string.
12579 ///
12580 /// Returns `None` if the enum contains an unknown value deserialized from
12581 /// the integer representation of enums.
12582 pub fn name(&self) -> std::option::Option<&str> {
12583 match self {
12584 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
12585 Self::Queued => std::option::Option::Some("QUEUED"),
12586 Self::ApplyingDeployment => std::option::Option::Some("APPLYING_DEPLOYMENT"),
12587 Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
12588 Self::Failed => std::option::Option::Some("FAILED"),
12589 Self::Aborted => std::option::Option::Some("ABORTED"),
12590 Self::Skipped => std::option::Option::Some("SKIPPED"),
12591 Self::DeletingDeployment => std::option::Option::Some("DELETING_DEPLOYMENT"),
12592 Self::PreviewingDeployment => std::option::Option::Some("PREVIEWING_DEPLOYMENT"),
12593 Self::UnknownValue(u) => u.0.name(),
12594 }
12595 }
12596 }
12597
12598 impl std::default::Default for State {
12599 fn default() -> Self {
12600 use std::convert::From;
12601 Self::from(0)
12602 }
12603 }
12604
12605 impl std::fmt::Display for State {
12606 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12607 wkt::internal::display_enum(f, self.name(), self.value())
12608 }
12609 }
12610
12611 impl std::convert::From<i32> for State {
12612 fn from(value: i32) -> Self {
12613 match value {
12614 0 => Self::Unspecified,
12615 1 => Self::Queued,
12616 2 => Self::ApplyingDeployment,
12617 4 => Self::Succeeded,
12618 5 => Self::Failed,
12619 6 => Self::Aborted,
12620 7 => Self::Skipped,
12621 8 => Self::DeletingDeployment,
12622 9 => Self::PreviewingDeployment,
12623 _ => Self::UnknownValue(state::UnknownValue(
12624 wkt::internal::UnknownEnumValue::Integer(value),
12625 )),
12626 }
12627 }
12628 }
12629
12630 impl std::convert::From<&str> for State {
12631 fn from(value: &str) -> Self {
12632 use std::string::ToString;
12633 match value {
12634 "STATE_UNSPECIFIED" => Self::Unspecified,
12635 "QUEUED" => Self::Queued,
12636 "APPLYING_DEPLOYMENT" => Self::ApplyingDeployment,
12637 "SUCCEEDED" => Self::Succeeded,
12638 "FAILED" => Self::Failed,
12639 "ABORTED" => Self::Aborted,
12640 "SKIPPED" => Self::Skipped,
12641 "DELETING_DEPLOYMENT" => Self::DeletingDeployment,
12642 "PREVIEWING_DEPLOYMENT" => Self::PreviewingDeployment,
12643 _ => Self::UnknownValue(state::UnknownValue(
12644 wkt::internal::UnknownEnumValue::String(value.to_string()),
12645 )),
12646 }
12647 }
12648 }
12649
12650 impl serde::ser::Serialize for State {
12651 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12652 where
12653 S: serde::Serializer,
12654 {
12655 match self {
12656 Self::Unspecified => serializer.serialize_i32(0),
12657 Self::Queued => serializer.serialize_i32(1),
12658 Self::ApplyingDeployment => serializer.serialize_i32(2),
12659 Self::Succeeded => serializer.serialize_i32(4),
12660 Self::Failed => serializer.serialize_i32(5),
12661 Self::Aborted => serializer.serialize_i32(6),
12662 Self::Skipped => serializer.serialize_i32(7),
12663 Self::DeletingDeployment => serializer.serialize_i32(8),
12664 Self::PreviewingDeployment => serializer.serialize_i32(9),
12665 Self::UnknownValue(u) => u.0.serialize(serializer),
12666 }
12667 }
12668 }
12669
12670 impl<'de> serde::de::Deserialize<'de> for State {
12671 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12672 where
12673 D: serde::Deserializer<'de>,
12674 {
12675 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
12676 ".google.cloud.config.v1.DeploymentUnitProgress.State",
12677 ))
12678 }
12679 }
12680
12681 /// The possible intents of a deployment unit.
12682 ///
12683 /// # Working with unknown values
12684 ///
12685 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12686 /// additional enum variants at any time. Adding new variants is not considered
12687 /// a breaking change. Applications should write their code in anticipation of:
12688 ///
12689 /// - New values appearing in future releases of the client library, **and**
12690 /// - New values received dynamically, without application changes.
12691 ///
12692 /// Please consult the [Working with enums] section in the user guide for some
12693 /// guidelines.
12694 ///
12695 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
12696 #[derive(Clone, Debug, PartialEq)]
12697 #[non_exhaustive]
12698 pub enum Intent {
12699 /// Unspecified intent.
12700 Unspecified,
12701 /// Create deployment in the unit from the deployment spec.
12702 CreateDeployment,
12703 /// Update deployment in the unit.
12704 UpdateDeployment,
12705 /// Delete deployment in the unit.
12706 DeleteDeployment,
12707 /// Recreate deployment in the unit.
12708 RecreateDeployment,
12709 /// Delete deployment in latest successful revision while no longer
12710 /// referenced in any deployment unit in the current deployment group.
12711 CleanUp,
12712 /// Expected to be unchanged.
12713 Unchanged,
12714 /// If set, the enum was initialized with an unknown value.
12715 ///
12716 /// Applications can examine the value using [Intent::value] or
12717 /// [Intent::name].
12718 UnknownValue(intent::UnknownValue),
12719 }
12720
12721 #[doc(hidden)]
12722 pub mod intent {
12723 #[allow(unused_imports)]
12724 use super::*;
12725 #[derive(Clone, Debug, PartialEq)]
12726 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12727 }
12728
12729 impl Intent {
12730 /// Gets the enum value.
12731 ///
12732 /// Returns `None` if the enum contains an unknown value deserialized from
12733 /// the string representation of enums.
12734 pub fn value(&self) -> std::option::Option<i32> {
12735 match self {
12736 Self::Unspecified => std::option::Option::Some(0),
12737 Self::CreateDeployment => std::option::Option::Some(1),
12738 Self::UpdateDeployment => std::option::Option::Some(2),
12739 Self::DeleteDeployment => std::option::Option::Some(3),
12740 Self::RecreateDeployment => std::option::Option::Some(4),
12741 Self::CleanUp => std::option::Option::Some(5),
12742 Self::Unchanged => std::option::Option::Some(6),
12743 Self::UnknownValue(u) => u.0.value(),
12744 }
12745 }
12746
12747 /// Gets the enum value as a string.
12748 ///
12749 /// Returns `None` if the enum contains an unknown value deserialized from
12750 /// the integer representation of enums.
12751 pub fn name(&self) -> std::option::Option<&str> {
12752 match self {
12753 Self::Unspecified => std::option::Option::Some("INTENT_UNSPECIFIED"),
12754 Self::CreateDeployment => std::option::Option::Some("CREATE_DEPLOYMENT"),
12755 Self::UpdateDeployment => std::option::Option::Some("UPDATE_DEPLOYMENT"),
12756 Self::DeleteDeployment => std::option::Option::Some("DELETE_DEPLOYMENT"),
12757 Self::RecreateDeployment => std::option::Option::Some("RECREATE_DEPLOYMENT"),
12758 Self::CleanUp => std::option::Option::Some("CLEAN_UP"),
12759 Self::Unchanged => std::option::Option::Some("UNCHANGED"),
12760 Self::UnknownValue(u) => u.0.name(),
12761 }
12762 }
12763 }
12764
12765 impl std::default::Default for Intent {
12766 fn default() -> Self {
12767 use std::convert::From;
12768 Self::from(0)
12769 }
12770 }
12771
12772 impl std::fmt::Display for Intent {
12773 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12774 wkt::internal::display_enum(f, self.name(), self.value())
12775 }
12776 }
12777
12778 impl std::convert::From<i32> for Intent {
12779 fn from(value: i32) -> Self {
12780 match value {
12781 0 => Self::Unspecified,
12782 1 => Self::CreateDeployment,
12783 2 => Self::UpdateDeployment,
12784 3 => Self::DeleteDeployment,
12785 4 => Self::RecreateDeployment,
12786 5 => Self::CleanUp,
12787 6 => Self::Unchanged,
12788 _ => Self::UnknownValue(intent::UnknownValue(
12789 wkt::internal::UnknownEnumValue::Integer(value),
12790 )),
12791 }
12792 }
12793 }
12794
12795 impl std::convert::From<&str> for Intent {
12796 fn from(value: &str) -> Self {
12797 use std::string::ToString;
12798 match value {
12799 "INTENT_UNSPECIFIED" => Self::Unspecified,
12800 "CREATE_DEPLOYMENT" => Self::CreateDeployment,
12801 "UPDATE_DEPLOYMENT" => Self::UpdateDeployment,
12802 "DELETE_DEPLOYMENT" => Self::DeleteDeployment,
12803 "RECREATE_DEPLOYMENT" => Self::RecreateDeployment,
12804 "CLEAN_UP" => Self::CleanUp,
12805 "UNCHANGED" => Self::Unchanged,
12806 _ => Self::UnknownValue(intent::UnknownValue(
12807 wkt::internal::UnknownEnumValue::String(value.to_string()),
12808 )),
12809 }
12810 }
12811 }
12812
12813 impl serde::ser::Serialize for Intent {
12814 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12815 where
12816 S: serde::Serializer,
12817 {
12818 match self {
12819 Self::Unspecified => serializer.serialize_i32(0),
12820 Self::CreateDeployment => serializer.serialize_i32(1),
12821 Self::UpdateDeployment => serializer.serialize_i32(2),
12822 Self::DeleteDeployment => serializer.serialize_i32(3),
12823 Self::RecreateDeployment => serializer.serialize_i32(4),
12824 Self::CleanUp => serializer.serialize_i32(5),
12825 Self::Unchanged => serializer.serialize_i32(6),
12826 Self::UnknownValue(u) => u.0.serialize(serializer),
12827 }
12828 }
12829 }
12830
12831 impl<'de> serde::de::Deserialize<'de> for Intent {
12832 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12833 where
12834 D: serde::Deserializer<'de>,
12835 {
12836 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Intent>::new(
12837 ".google.cloud.config.v1.DeploymentUnitProgress.Intent",
12838 ))
12839 }
12840 }
12841}
12842
12843/// Operation metadata for `ProvisionDeploymentGroup` and
12844/// `DeprovisionDeploymentGroup` long-running operations.
12845#[derive(Clone, Default, PartialEq)]
12846#[non_exhaustive]
12847pub struct ProvisionDeploymentGroupOperationMetadata {
12848 /// Output only. The current step of the deployment group operation.
12849 pub step:
12850 crate::model::provision_deployment_group_operation_metadata::ProvisionDeploymentGroupStep,
12851
12852 /// Output only. Progress information for each deployment unit within the
12853 /// operation.
12854 pub deployment_unit_progresses: std::vec::Vec<crate::model::DeploymentUnitProgress>,
12855
12856 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12857}
12858
12859impl ProvisionDeploymentGroupOperationMetadata {
12860 /// Creates a new default instance.
12861 pub fn new() -> Self {
12862 std::default::Default::default()
12863 }
12864
12865 /// Sets the value of [step][crate::model::ProvisionDeploymentGroupOperationMetadata::step].
12866 ///
12867 /// # Example
12868 /// ```ignore,no_run
12869 /// # use google_cloud_config_v1::model::ProvisionDeploymentGroupOperationMetadata;
12870 /// use google_cloud_config_v1::model::provision_deployment_group_operation_metadata::ProvisionDeploymentGroupStep;
12871 /// let x0 = ProvisionDeploymentGroupOperationMetadata::new().set_step(ProvisionDeploymentGroupStep::ValidatingDeploymentGroup);
12872 /// let x1 = ProvisionDeploymentGroupOperationMetadata::new().set_step(ProvisionDeploymentGroupStep::AssociatingDeploymentsToDeploymentGroup);
12873 /// let x2 = ProvisionDeploymentGroupOperationMetadata::new().set_step(ProvisionDeploymentGroupStep::ProvisioningDeploymentUnits);
12874 /// ```
12875 pub fn set_step<T: std::convert::Into<crate::model::provision_deployment_group_operation_metadata::ProvisionDeploymentGroupStep>>(mut self, v: T) -> Self{
12876 self.step = v.into();
12877 self
12878 }
12879
12880 /// Sets the value of [deployment_unit_progresses][crate::model::ProvisionDeploymentGroupOperationMetadata::deployment_unit_progresses].
12881 ///
12882 /// # Example
12883 /// ```ignore,no_run
12884 /// # use google_cloud_config_v1::model::ProvisionDeploymentGroupOperationMetadata;
12885 /// use google_cloud_config_v1::model::DeploymentUnitProgress;
12886 /// let x = ProvisionDeploymentGroupOperationMetadata::new()
12887 /// .set_deployment_unit_progresses([
12888 /// DeploymentUnitProgress::default()/* use setters */,
12889 /// DeploymentUnitProgress::default()/* use (different) setters */,
12890 /// ]);
12891 /// ```
12892 pub fn set_deployment_unit_progresses<T, V>(mut self, v: T) -> Self
12893 where
12894 T: std::iter::IntoIterator<Item = V>,
12895 V: std::convert::Into<crate::model::DeploymentUnitProgress>,
12896 {
12897 use std::iter::Iterator;
12898 self.deployment_unit_progresses = v.into_iter().map(|i| i.into()).collect();
12899 self
12900 }
12901}
12902
12903impl wkt::message::Message for ProvisionDeploymentGroupOperationMetadata {
12904 fn typename() -> &'static str {
12905 "type.googleapis.com/google.cloud.config.v1.ProvisionDeploymentGroupOperationMetadata"
12906 }
12907}
12908
12909/// Defines additional types related to [ProvisionDeploymentGroupOperationMetadata].
12910pub mod provision_deployment_group_operation_metadata {
12911 #[allow(unused_imports)]
12912 use super::*;
12913
12914 /// Possible steps during a deployment group provisioning or deprovisioning
12915 /// operation.
12916 ///
12917 /// # Working with unknown values
12918 ///
12919 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12920 /// additional enum variants at any time. Adding new variants is not considered
12921 /// a breaking change. Applications should write their code in anticipation of:
12922 ///
12923 /// - New values appearing in future releases of the client library, **and**
12924 /// - New values received dynamically, without application changes.
12925 ///
12926 /// Please consult the [Working with enums] section in the user guide for some
12927 /// guidelines.
12928 ///
12929 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
12930 #[derive(Clone, Debug, PartialEq)]
12931 #[non_exhaustive]
12932 pub enum ProvisionDeploymentGroupStep {
12933 /// Unspecified step.
12934 Unspecified,
12935 /// Validating the deployment group.
12936 ValidatingDeploymentGroup,
12937 /// Locking the deployments to the deployment group for atomic actuation.
12938 AssociatingDeploymentsToDeploymentGroup,
12939 /// Provisioning the deployment units.
12940 ProvisioningDeploymentUnits,
12941 /// Unlocking the deployments from the deployment group after actuation.
12942 DisassociatingDeploymentsFromDeploymentGroup,
12943 /// The operation has succeeded.
12944 Succeeded,
12945 /// The operation has failed.
12946 Failed,
12947 /// Deprovisioning the deployment units.
12948 DeprovisioningDeploymentUnits,
12949 /// If set, the enum was initialized with an unknown value.
12950 ///
12951 /// Applications can examine the value using [ProvisionDeploymentGroupStep::value] or
12952 /// [ProvisionDeploymentGroupStep::name].
12953 UnknownValue(provision_deployment_group_step::UnknownValue),
12954 }
12955
12956 #[doc(hidden)]
12957 pub mod provision_deployment_group_step {
12958 #[allow(unused_imports)]
12959 use super::*;
12960 #[derive(Clone, Debug, PartialEq)]
12961 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12962 }
12963
12964 impl ProvisionDeploymentGroupStep {
12965 /// Gets the enum value.
12966 ///
12967 /// Returns `None` if the enum contains an unknown value deserialized from
12968 /// the string representation of enums.
12969 pub fn value(&self) -> std::option::Option<i32> {
12970 match self {
12971 Self::Unspecified => std::option::Option::Some(0),
12972 Self::ValidatingDeploymentGroup => std::option::Option::Some(1),
12973 Self::AssociatingDeploymentsToDeploymentGroup => std::option::Option::Some(2),
12974 Self::ProvisioningDeploymentUnits => std::option::Option::Some(3),
12975 Self::DisassociatingDeploymentsFromDeploymentGroup => std::option::Option::Some(4),
12976 Self::Succeeded => std::option::Option::Some(5),
12977 Self::Failed => std::option::Option::Some(6),
12978 Self::DeprovisioningDeploymentUnits => std::option::Option::Some(7),
12979 Self::UnknownValue(u) => u.0.value(),
12980 }
12981 }
12982
12983 /// Gets the enum value as a string.
12984 ///
12985 /// Returns `None` if the enum contains an unknown value deserialized from
12986 /// the integer representation of enums.
12987 pub fn name(&self) -> std::option::Option<&str> {
12988 match self {
12989 Self::Unspecified => {
12990 std::option::Option::Some("PROVISION_DEPLOYMENT_GROUP_STEP_UNSPECIFIED")
12991 }
12992 Self::ValidatingDeploymentGroup => {
12993 std::option::Option::Some("VALIDATING_DEPLOYMENT_GROUP")
12994 }
12995 Self::AssociatingDeploymentsToDeploymentGroup => {
12996 std::option::Option::Some("ASSOCIATING_DEPLOYMENTS_TO_DEPLOYMENT_GROUP")
12997 }
12998 Self::ProvisioningDeploymentUnits => {
12999 std::option::Option::Some("PROVISIONING_DEPLOYMENT_UNITS")
13000 }
13001 Self::DisassociatingDeploymentsFromDeploymentGroup => {
13002 std::option::Option::Some("DISASSOCIATING_DEPLOYMENTS_FROM_DEPLOYMENT_GROUP")
13003 }
13004 Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
13005 Self::Failed => std::option::Option::Some("FAILED"),
13006 Self::DeprovisioningDeploymentUnits => {
13007 std::option::Option::Some("DEPROVISIONING_DEPLOYMENT_UNITS")
13008 }
13009 Self::UnknownValue(u) => u.0.name(),
13010 }
13011 }
13012 }
13013
13014 impl std::default::Default for ProvisionDeploymentGroupStep {
13015 fn default() -> Self {
13016 use std::convert::From;
13017 Self::from(0)
13018 }
13019 }
13020
13021 impl std::fmt::Display for ProvisionDeploymentGroupStep {
13022 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13023 wkt::internal::display_enum(f, self.name(), self.value())
13024 }
13025 }
13026
13027 impl std::convert::From<i32> for ProvisionDeploymentGroupStep {
13028 fn from(value: i32) -> Self {
13029 match value {
13030 0 => Self::Unspecified,
13031 1 => Self::ValidatingDeploymentGroup,
13032 2 => Self::AssociatingDeploymentsToDeploymentGroup,
13033 3 => Self::ProvisioningDeploymentUnits,
13034 4 => Self::DisassociatingDeploymentsFromDeploymentGroup,
13035 5 => Self::Succeeded,
13036 6 => Self::Failed,
13037 7 => Self::DeprovisioningDeploymentUnits,
13038 _ => Self::UnknownValue(provision_deployment_group_step::UnknownValue(
13039 wkt::internal::UnknownEnumValue::Integer(value),
13040 )),
13041 }
13042 }
13043 }
13044
13045 impl std::convert::From<&str> for ProvisionDeploymentGroupStep {
13046 fn from(value: &str) -> Self {
13047 use std::string::ToString;
13048 match value {
13049 "PROVISION_DEPLOYMENT_GROUP_STEP_UNSPECIFIED" => Self::Unspecified,
13050 "VALIDATING_DEPLOYMENT_GROUP" => Self::ValidatingDeploymentGroup,
13051 "ASSOCIATING_DEPLOYMENTS_TO_DEPLOYMENT_GROUP" => {
13052 Self::AssociatingDeploymentsToDeploymentGroup
13053 }
13054 "PROVISIONING_DEPLOYMENT_UNITS" => Self::ProvisioningDeploymentUnits,
13055 "DISASSOCIATING_DEPLOYMENTS_FROM_DEPLOYMENT_GROUP" => {
13056 Self::DisassociatingDeploymentsFromDeploymentGroup
13057 }
13058 "SUCCEEDED" => Self::Succeeded,
13059 "FAILED" => Self::Failed,
13060 "DEPROVISIONING_DEPLOYMENT_UNITS" => Self::DeprovisioningDeploymentUnits,
13061 _ => Self::UnknownValue(provision_deployment_group_step::UnknownValue(
13062 wkt::internal::UnknownEnumValue::String(value.to_string()),
13063 )),
13064 }
13065 }
13066 }
13067
13068 impl serde::ser::Serialize for ProvisionDeploymentGroupStep {
13069 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13070 where
13071 S: serde::Serializer,
13072 {
13073 match self {
13074 Self::Unspecified => serializer.serialize_i32(0),
13075 Self::ValidatingDeploymentGroup => serializer.serialize_i32(1),
13076 Self::AssociatingDeploymentsToDeploymentGroup => serializer.serialize_i32(2),
13077 Self::ProvisioningDeploymentUnits => serializer.serialize_i32(3),
13078 Self::DisassociatingDeploymentsFromDeploymentGroup => serializer.serialize_i32(4),
13079 Self::Succeeded => serializer.serialize_i32(5),
13080 Self::Failed => serializer.serialize_i32(6),
13081 Self::DeprovisioningDeploymentUnits => serializer.serialize_i32(7),
13082 Self::UnknownValue(u) => u.0.serialize(serializer),
13083 }
13084 }
13085 }
13086
13087 impl<'de> serde::de::Deserialize<'de> for ProvisionDeploymentGroupStep {
13088 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13089 where
13090 D: serde::Deserializer<'de>,
13091 {
13092 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ProvisionDeploymentGroupStep>::new(
13093 ".google.cloud.config.v1.ProvisionDeploymentGroupOperationMetadata.ProvisionDeploymentGroupStep"))
13094 }
13095 }
13096}
13097
13098/// A DeploymentGroupRevision represents a snapshot of a
13099/// [DeploymentGroup][google.cloud.config.v1.DeploymentGroup] at a given point in
13100/// time, created when a DeploymentGroup is provisioned or deprovisioned.
13101///
13102/// [google.cloud.config.v1.DeploymentGroup]: crate::model::DeploymentGroup
13103#[derive(Clone, Default, PartialEq)]
13104#[non_exhaustive]
13105pub struct DeploymentGroupRevision {
13106 /// Identifier. The name of the deployment group revision.
13107 /// Format:
13108 /// 'projects/{project_id}/locations/{location}/deploymentGroups/{deployment_group}/revisions/{revision}'.
13109 pub name: std::string::String,
13110
13111 /// Output only. The snapshot of the deployment group at this revision.
13112 pub snapshot: std::option::Option<crate::model::DeploymentGroup>,
13113
13114 /// Output only. Time when the deployment group revision was created.
13115 pub create_time: std::option::Option<wkt::Timestamp>,
13116
13117 /// Output only. The alternative IDs of the deployment group revision.
13118 pub alternative_ids: std::vec::Vec<std::string::String>,
13119
13120 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13121}
13122
13123impl DeploymentGroupRevision {
13124 /// Creates a new default instance.
13125 pub fn new() -> Self {
13126 std::default::Default::default()
13127 }
13128
13129 /// Sets the value of [name][crate::model::DeploymentGroupRevision::name].
13130 ///
13131 /// # Example
13132 /// ```ignore,no_run
13133 /// # use google_cloud_config_v1::model::DeploymentGroupRevision;
13134 /// # let project_id = "project_id";
13135 /// # let location_id = "location_id";
13136 /// # let deployment_group_id = "deployment_group_id";
13137 /// # let revision_id = "revision_id";
13138 /// let x = DeploymentGroupRevision::new().set_name(format!("projects/{project_id}/locations/{location_id}/deploymentGroups/{deployment_group_id}/revisions/{revision_id}"));
13139 /// ```
13140 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13141 self.name = v.into();
13142 self
13143 }
13144
13145 /// Sets the value of [snapshot][crate::model::DeploymentGroupRevision::snapshot].
13146 ///
13147 /// # Example
13148 /// ```ignore,no_run
13149 /// # use google_cloud_config_v1::model::DeploymentGroupRevision;
13150 /// use google_cloud_config_v1::model::DeploymentGroup;
13151 /// let x = DeploymentGroupRevision::new().set_snapshot(DeploymentGroup::default()/* use setters */);
13152 /// ```
13153 pub fn set_snapshot<T>(mut self, v: T) -> Self
13154 where
13155 T: std::convert::Into<crate::model::DeploymentGroup>,
13156 {
13157 self.snapshot = std::option::Option::Some(v.into());
13158 self
13159 }
13160
13161 /// Sets or clears the value of [snapshot][crate::model::DeploymentGroupRevision::snapshot].
13162 ///
13163 /// # Example
13164 /// ```ignore,no_run
13165 /// # use google_cloud_config_v1::model::DeploymentGroupRevision;
13166 /// use google_cloud_config_v1::model::DeploymentGroup;
13167 /// let x = DeploymentGroupRevision::new().set_or_clear_snapshot(Some(DeploymentGroup::default()/* use setters */));
13168 /// let x = DeploymentGroupRevision::new().set_or_clear_snapshot(None::<DeploymentGroup>);
13169 /// ```
13170 pub fn set_or_clear_snapshot<T>(mut self, v: std::option::Option<T>) -> Self
13171 where
13172 T: std::convert::Into<crate::model::DeploymentGroup>,
13173 {
13174 self.snapshot = v.map(|x| x.into());
13175 self
13176 }
13177
13178 /// Sets the value of [create_time][crate::model::DeploymentGroupRevision::create_time].
13179 ///
13180 /// # Example
13181 /// ```ignore,no_run
13182 /// # use google_cloud_config_v1::model::DeploymentGroupRevision;
13183 /// use wkt::Timestamp;
13184 /// let x = DeploymentGroupRevision::new().set_create_time(Timestamp::default()/* use setters */);
13185 /// ```
13186 pub fn set_create_time<T>(mut self, v: T) -> Self
13187 where
13188 T: std::convert::Into<wkt::Timestamp>,
13189 {
13190 self.create_time = std::option::Option::Some(v.into());
13191 self
13192 }
13193
13194 /// Sets or clears the value of [create_time][crate::model::DeploymentGroupRevision::create_time].
13195 ///
13196 /// # Example
13197 /// ```ignore,no_run
13198 /// # use google_cloud_config_v1::model::DeploymentGroupRevision;
13199 /// use wkt::Timestamp;
13200 /// let x = DeploymentGroupRevision::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
13201 /// let x = DeploymentGroupRevision::new().set_or_clear_create_time(None::<Timestamp>);
13202 /// ```
13203 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
13204 where
13205 T: std::convert::Into<wkt::Timestamp>,
13206 {
13207 self.create_time = v.map(|x| x.into());
13208 self
13209 }
13210
13211 /// Sets the value of [alternative_ids][crate::model::DeploymentGroupRevision::alternative_ids].
13212 ///
13213 /// # Example
13214 /// ```ignore,no_run
13215 /// # use google_cloud_config_v1::model::DeploymentGroupRevision;
13216 /// let x = DeploymentGroupRevision::new().set_alternative_ids(["a", "b", "c"]);
13217 /// ```
13218 pub fn set_alternative_ids<T, V>(mut self, v: T) -> Self
13219 where
13220 T: std::iter::IntoIterator<Item = V>,
13221 V: std::convert::Into<std::string::String>,
13222 {
13223 use std::iter::Iterator;
13224 self.alternative_ids = v.into_iter().map(|i| i.into()).collect();
13225 self
13226 }
13227}
13228
13229impl wkt::message::Message for DeploymentGroupRevision {
13230 fn typename() -> &'static str {
13231 "type.googleapis.com/google.cloud.config.v1.DeploymentGroupRevision"
13232 }
13233}
13234
13235/// The request message for the GetDeploymentGroupRevision method.
13236#[derive(Clone, Default, PartialEq)]
13237#[non_exhaustive]
13238pub struct GetDeploymentGroupRevisionRequest {
13239 /// Required. The name of the deployment group revision to retrieve.
13240 /// Format:
13241 /// 'projects/{project_id}/locations/{location}/deploymentGroups/{deployment_group}/revisions/{revision}'.
13242 pub name: std::string::String,
13243
13244 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13245}
13246
13247impl GetDeploymentGroupRevisionRequest {
13248 /// Creates a new default instance.
13249 pub fn new() -> Self {
13250 std::default::Default::default()
13251 }
13252
13253 /// Sets the value of [name][crate::model::GetDeploymentGroupRevisionRequest::name].
13254 ///
13255 /// # Example
13256 /// ```ignore,no_run
13257 /// # use google_cloud_config_v1::model::GetDeploymentGroupRevisionRequest;
13258 /// # let project_id = "project_id";
13259 /// # let location_id = "location_id";
13260 /// # let deployment_group_id = "deployment_group_id";
13261 /// # let revision_id = "revision_id";
13262 /// let x = GetDeploymentGroupRevisionRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/deploymentGroups/{deployment_group_id}/revisions/{revision_id}"));
13263 /// ```
13264 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13265 self.name = v.into();
13266 self
13267 }
13268}
13269
13270impl wkt::message::Message for GetDeploymentGroupRevisionRequest {
13271 fn typename() -> &'static str {
13272 "type.googleapis.com/google.cloud.config.v1.GetDeploymentGroupRevisionRequest"
13273 }
13274}
13275
13276/// The request message for the ListDeploymentGroupRevisions method.
13277#[derive(Clone, Default, PartialEq)]
13278#[non_exhaustive]
13279pub struct ListDeploymentGroupRevisionsRequest {
13280 /// Required. The parent, which owns this collection of deployment group
13281 /// revisions. Format:
13282 /// 'projects/{project_id}/locations/{location}/deploymentGroups/{deployment_group}'.
13283 pub parent: std::string::String,
13284
13285 /// Optional. When requesting a page of resources, 'page_size' specifies number
13286 /// of resources to return. If unspecified, a sensible default will be used by
13287 /// the server. The maximum value is 1000; values above 1000 will be coerced to
13288 /// 1000.
13289 pub page_size: i32,
13290
13291 /// Optional. Token returned by previous call to 'ListDeploymentGroupRevisions'
13292 /// which specifies the position in the list from where to continue listing the
13293 /// deployment group revisions. All other parameters provided to
13294 /// `ListDeploymentGroupRevisions` must match the call that provided the page
13295 /// token.
13296 pub page_token: std::string::String,
13297
13298 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13299}
13300
13301impl ListDeploymentGroupRevisionsRequest {
13302 /// Creates a new default instance.
13303 pub fn new() -> Self {
13304 std::default::Default::default()
13305 }
13306
13307 /// Sets the value of [parent][crate::model::ListDeploymentGroupRevisionsRequest::parent].
13308 ///
13309 /// # Example
13310 /// ```ignore,no_run
13311 /// # use google_cloud_config_v1::model::ListDeploymentGroupRevisionsRequest;
13312 /// # let project_id = "project_id";
13313 /// # let location_id = "location_id";
13314 /// # let deployment_group_id = "deployment_group_id";
13315 /// let x = ListDeploymentGroupRevisionsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/deploymentGroups/{deployment_group_id}"));
13316 /// ```
13317 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13318 self.parent = v.into();
13319 self
13320 }
13321
13322 /// Sets the value of [page_size][crate::model::ListDeploymentGroupRevisionsRequest::page_size].
13323 ///
13324 /// # Example
13325 /// ```ignore,no_run
13326 /// # use google_cloud_config_v1::model::ListDeploymentGroupRevisionsRequest;
13327 /// let x = ListDeploymentGroupRevisionsRequest::new().set_page_size(42);
13328 /// ```
13329 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
13330 self.page_size = v.into();
13331 self
13332 }
13333
13334 /// Sets the value of [page_token][crate::model::ListDeploymentGroupRevisionsRequest::page_token].
13335 ///
13336 /// # Example
13337 /// ```ignore,no_run
13338 /// # use google_cloud_config_v1::model::ListDeploymentGroupRevisionsRequest;
13339 /// let x = ListDeploymentGroupRevisionsRequest::new().set_page_token("example");
13340 /// ```
13341 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13342 self.page_token = v.into();
13343 self
13344 }
13345}
13346
13347impl wkt::message::Message for ListDeploymentGroupRevisionsRequest {
13348 fn typename() -> &'static str {
13349 "type.googleapis.com/google.cloud.config.v1.ListDeploymentGroupRevisionsRequest"
13350 }
13351}
13352
13353/// The response message for the ListDeploymentGroupRevisions method.
13354#[derive(Clone, Default, PartialEq)]
13355#[non_exhaustive]
13356pub struct ListDeploymentGroupRevisionsResponse {
13357 /// The deployment group revisions from the specified collection.
13358 pub deployment_group_revisions: std::vec::Vec<crate::model::DeploymentGroupRevision>,
13359
13360 /// Token to be supplied to the next ListDeploymentGroupRevisions request via
13361 /// `page_token` to obtain the next set of results.
13362 pub next_page_token: std::string::String,
13363
13364 /// Unordered list. Locations that could not be reached.
13365 pub unreachable: std::vec::Vec<std::string::String>,
13366
13367 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13368}
13369
13370impl ListDeploymentGroupRevisionsResponse {
13371 /// Creates a new default instance.
13372 pub fn new() -> Self {
13373 std::default::Default::default()
13374 }
13375
13376 /// Sets the value of [deployment_group_revisions][crate::model::ListDeploymentGroupRevisionsResponse::deployment_group_revisions].
13377 ///
13378 /// # Example
13379 /// ```ignore,no_run
13380 /// # use google_cloud_config_v1::model::ListDeploymentGroupRevisionsResponse;
13381 /// use google_cloud_config_v1::model::DeploymentGroupRevision;
13382 /// let x = ListDeploymentGroupRevisionsResponse::new()
13383 /// .set_deployment_group_revisions([
13384 /// DeploymentGroupRevision::default()/* use setters */,
13385 /// DeploymentGroupRevision::default()/* use (different) setters */,
13386 /// ]);
13387 /// ```
13388 pub fn set_deployment_group_revisions<T, V>(mut self, v: T) -> Self
13389 where
13390 T: std::iter::IntoIterator<Item = V>,
13391 V: std::convert::Into<crate::model::DeploymentGroupRevision>,
13392 {
13393 use std::iter::Iterator;
13394 self.deployment_group_revisions = v.into_iter().map(|i| i.into()).collect();
13395 self
13396 }
13397
13398 /// Sets the value of [next_page_token][crate::model::ListDeploymentGroupRevisionsResponse::next_page_token].
13399 ///
13400 /// # Example
13401 /// ```ignore,no_run
13402 /// # use google_cloud_config_v1::model::ListDeploymentGroupRevisionsResponse;
13403 /// let x = ListDeploymentGroupRevisionsResponse::new().set_next_page_token("example");
13404 /// ```
13405 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13406 self.next_page_token = v.into();
13407 self
13408 }
13409
13410 /// Sets the value of [unreachable][crate::model::ListDeploymentGroupRevisionsResponse::unreachable].
13411 ///
13412 /// # Example
13413 /// ```ignore,no_run
13414 /// # use google_cloud_config_v1::model::ListDeploymentGroupRevisionsResponse;
13415 /// let x = ListDeploymentGroupRevisionsResponse::new().set_unreachable(["a", "b", "c"]);
13416 /// ```
13417 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
13418 where
13419 T: std::iter::IntoIterator<Item = V>,
13420 V: std::convert::Into<std::string::String>,
13421 {
13422 use std::iter::Iterator;
13423 self.unreachable = v.into_iter().map(|i| i.into()).collect();
13424 self
13425 }
13426}
13427
13428impl wkt::message::Message for ListDeploymentGroupRevisionsResponse {
13429 fn typename() -> &'static str {
13430 "type.googleapis.com/google.cloud.config.v1.ListDeploymentGroupRevisionsResponse"
13431 }
13432}
13433
13434#[doc(hidden)]
13435impl google_cloud_gax::paginator::internal::PageableResponse
13436 for ListDeploymentGroupRevisionsResponse
13437{
13438 type PageItem = crate::model::DeploymentGroupRevision;
13439
13440 fn items(self) -> std::vec::Vec<Self::PageItem> {
13441 self.deployment_group_revisions
13442 }
13443
13444 fn next_page_token(&self) -> std::string::String {
13445 use std::clone::Clone;
13446 self.next_page_token.clone()
13447 }
13448}
13449
13450/// Enum values to control quota checks for resources in terraform
13451/// configuration files.
13452///
13453/// # Working with unknown values
13454///
13455/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13456/// additional enum variants at any time. Adding new variants is not considered
13457/// a breaking change. Applications should write their code in anticipation of:
13458///
13459/// - New values appearing in future releases of the client library, **and**
13460/// - New values received dynamically, without application changes.
13461///
13462/// Please consult the [Working with enums] section in the user guide for some
13463/// guidelines.
13464///
13465/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
13466#[derive(Clone, Debug, PartialEq)]
13467#[non_exhaustive]
13468pub enum QuotaValidation {
13469 /// The default value.
13470 /// QuotaValidation on terraform configuration files will be disabled in
13471 /// this case.
13472 Unspecified,
13473 /// Enable computing quotas for resources in terraform configuration files to
13474 /// get visibility on resources with insufficient quotas.
13475 Enabled,
13476 /// Enforce quota checks so deployment fails if there isn't sufficient quotas
13477 /// available to deploy resources in terraform configuration files.
13478 Enforced,
13479 /// If set, the enum was initialized with an unknown value.
13480 ///
13481 /// Applications can examine the value using [QuotaValidation::value] or
13482 /// [QuotaValidation::name].
13483 UnknownValue(quota_validation::UnknownValue),
13484}
13485
13486#[doc(hidden)]
13487pub mod quota_validation {
13488 #[allow(unused_imports)]
13489 use super::*;
13490 #[derive(Clone, Debug, PartialEq)]
13491 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13492}
13493
13494impl QuotaValidation {
13495 /// Gets the enum value.
13496 ///
13497 /// Returns `None` if the enum contains an unknown value deserialized from
13498 /// the string representation of enums.
13499 pub fn value(&self) -> std::option::Option<i32> {
13500 match self {
13501 Self::Unspecified => std::option::Option::Some(0),
13502 Self::Enabled => std::option::Option::Some(1),
13503 Self::Enforced => std::option::Option::Some(2),
13504 Self::UnknownValue(u) => u.0.value(),
13505 }
13506 }
13507
13508 /// Gets the enum value as a string.
13509 ///
13510 /// Returns `None` if the enum contains an unknown value deserialized from
13511 /// the integer representation of enums.
13512 pub fn name(&self) -> std::option::Option<&str> {
13513 match self {
13514 Self::Unspecified => std::option::Option::Some("QUOTA_VALIDATION_UNSPECIFIED"),
13515 Self::Enabled => std::option::Option::Some("ENABLED"),
13516 Self::Enforced => std::option::Option::Some("ENFORCED"),
13517 Self::UnknownValue(u) => u.0.name(),
13518 }
13519 }
13520}
13521
13522impl std::default::Default for QuotaValidation {
13523 fn default() -> Self {
13524 use std::convert::From;
13525 Self::from(0)
13526 }
13527}
13528
13529impl std::fmt::Display for QuotaValidation {
13530 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13531 wkt::internal::display_enum(f, self.name(), self.value())
13532 }
13533}
13534
13535impl std::convert::From<i32> for QuotaValidation {
13536 fn from(value: i32) -> Self {
13537 match value {
13538 0 => Self::Unspecified,
13539 1 => Self::Enabled,
13540 2 => Self::Enforced,
13541 _ => Self::UnknownValue(quota_validation::UnknownValue(
13542 wkt::internal::UnknownEnumValue::Integer(value),
13543 )),
13544 }
13545 }
13546}
13547
13548impl std::convert::From<&str> for QuotaValidation {
13549 fn from(value: &str) -> Self {
13550 use std::string::ToString;
13551 match value {
13552 "QUOTA_VALIDATION_UNSPECIFIED" => Self::Unspecified,
13553 "ENABLED" => Self::Enabled,
13554 "ENFORCED" => Self::Enforced,
13555 _ => Self::UnknownValue(quota_validation::UnknownValue(
13556 wkt::internal::UnknownEnumValue::String(value.to_string()),
13557 )),
13558 }
13559 }
13560}
13561
13562impl serde::ser::Serialize for QuotaValidation {
13563 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13564 where
13565 S: serde::Serializer,
13566 {
13567 match self {
13568 Self::Unspecified => serializer.serialize_i32(0),
13569 Self::Enabled => serializer.serialize_i32(1),
13570 Self::Enforced => serializer.serialize_i32(2),
13571 Self::UnknownValue(u) => u.0.serialize(serializer),
13572 }
13573 }
13574}
13575
13576impl<'de> serde::de::Deserialize<'de> for QuotaValidation {
13577 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13578 where
13579 D: serde::Deserializer<'de>,
13580 {
13581 deserializer.deserialize_any(wkt::internal::EnumVisitor::<QuotaValidation>::new(
13582 ".google.cloud.config.v1.QuotaValidation",
13583 ))
13584 }
13585}