Skip to main content

google_cloud_configdelivery_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_location;
27extern crate google_cloud_longrunning;
28extern crate google_cloud_lro;
29extern crate serde;
30extern crate serde_json;
31extern crate serde_with;
32extern crate std;
33extern crate tracing;
34extern crate wkt;
35
36mod debug;
37mod deserialize;
38mod serialize;
39
40/// ResourceBundle represent a collection of kubernetes configuration resources.
41#[derive(Clone, Default, PartialEq)]
42#[non_exhaustive]
43pub struct ResourceBundle {
44    /// Identifier. Name of the `ResourceBundle`. Format is
45    /// `projects/{project}/locations/{location}/resourceBundle
46    /// /[a-z][a-z0-9\-]{0,62}`.
47    pub name: std::string::String,
48
49    /// Output only. Time `ResourceBundle` was created.
50    pub create_time: std::option::Option<wkt::Timestamp>,
51
52    /// Output only. Time `ResourceBundle` was last updated.
53    pub update_time: std::option::Option<wkt::Timestamp>,
54
55    /// Optional. Labels as key value pairs.
56    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
57
58    /// Optional. Human readable description of the `ResourceBundle`.
59    pub description: std::string::String,
60
61    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
62}
63
64impl ResourceBundle {
65    /// Creates a new default instance.
66    pub fn new() -> Self {
67        std::default::Default::default()
68    }
69
70    /// Sets the value of [name][crate::model::ResourceBundle::name].
71    ///
72    /// # Example
73    /// ```ignore,no_run
74    /// # use google_cloud_configdelivery_v1::model::ResourceBundle;
75    /// # let project_id = "project_id";
76    /// # let location_id = "location_id";
77    /// # let resource_bundle_id = "resource_bundle_id";
78    /// let x = ResourceBundle::new().set_name(format!("projects/{project_id}/locations/{location_id}/resourceBundles/{resource_bundle_id}"));
79    /// ```
80    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
81        self.name = v.into();
82        self
83    }
84
85    /// Sets the value of [create_time][crate::model::ResourceBundle::create_time].
86    ///
87    /// # Example
88    /// ```ignore,no_run
89    /// # use google_cloud_configdelivery_v1::model::ResourceBundle;
90    /// use wkt::Timestamp;
91    /// let x = ResourceBundle::new().set_create_time(Timestamp::default()/* use setters */);
92    /// ```
93    pub fn set_create_time<T>(mut self, v: T) -> Self
94    where
95        T: std::convert::Into<wkt::Timestamp>,
96    {
97        self.create_time = std::option::Option::Some(v.into());
98        self
99    }
100
101    /// Sets or clears the value of [create_time][crate::model::ResourceBundle::create_time].
102    ///
103    /// # Example
104    /// ```ignore,no_run
105    /// # use google_cloud_configdelivery_v1::model::ResourceBundle;
106    /// use wkt::Timestamp;
107    /// let x = ResourceBundle::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
108    /// let x = ResourceBundle::new().set_or_clear_create_time(None::<Timestamp>);
109    /// ```
110    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
111    where
112        T: std::convert::Into<wkt::Timestamp>,
113    {
114        self.create_time = v.map(|x| x.into());
115        self
116    }
117
118    /// Sets the value of [update_time][crate::model::ResourceBundle::update_time].
119    ///
120    /// # Example
121    /// ```ignore,no_run
122    /// # use google_cloud_configdelivery_v1::model::ResourceBundle;
123    /// use wkt::Timestamp;
124    /// let x = ResourceBundle::new().set_update_time(Timestamp::default()/* use setters */);
125    /// ```
126    pub fn set_update_time<T>(mut self, v: T) -> Self
127    where
128        T: std::convert::Into<wkt::Timestamp>,
129    {
130        self.update_time = std::option::Option::Some(v.into());
131        self
132    }
133
134    /// Sets or clears the value of [update_time][crate::model::ResourceBundle::update_time].
135    ///
136    /// # Example
137    /// ```ignore,no_run
138    /// # use google_cloud_configdelivery_v1::model::ResourceBundle;
139    /// use wkt::Timestamp;
140    /// let x = ResourceBundle::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
141    /// let x = ResourceBundle::new().set_or_clear_update_time(None::<Timestamp>);
142    /// ```
143    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
144    where
145        T: std::convert::Into<wkt::Timestamp>,
146    {
147        self.update_time = v.map(|x| x.into());
148        self
149    }
150
151    /// Sets the value of [labels][crate::model::ResourceBundle::labels].
152    ///
153    /// # Example
154    /// ```ignore,no_run
155    /// # use google_cloud_configdelivery_v1::model::ResourceBundle;
156    /// let x = ResourceBundle::new().set_labels([
157    ///     ("key0", "abc"),
158    ///     ("key1", "xyz"),
159    /// ]);
160    /// ```
161    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
162    where
163        T: std::iter::IntoIterator<Item = (K, V)>,
164        K: std::convert::Into<std::string::String>,
165        V: std::convert::Into<std::string::String>,
166    {
167        use std::iter::Iterator;
168        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
169        self
170    }
171
172    /// Sets the value of [description][crate::model::ResourceBundle::description].
173    ///
174    /// # Example
175    /// ```ignore,no_run
176    /// # use google_cloud_configdelivery_v1::model::ResourceBundle;
177    /// let x = ResourceBundle::new().set_description("example");
178    /// ```
179    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
180        self.description = v.into();
181        self
182    }
183}
184
185impl wkt::message::Message for ResourceBundle {
186    fn typename() -> &'static str {
187        "type.googleapis.com/google.cloud.configdelivery.v1.ResourceBundle"
188    }
189}
190
191/// Message for requesting list of ResourceBundles.
192#[derive(Clone, Default, PartialEq)]
193#[non_exhaustive]
194pub struct ListResourceBundlesRequest {
195    /// Required. Parent value for ListResourceBundlesRequest.
196    pub parent: std::string::String,
197
198    /// Optional. Requested page size. Server may return fewer items than
199    /// requested. If unspecified, server will pick an appropriate default.
200    pub page_size: i32,
201
202    /// Optional. A token identifying a page of results the server should return.
203    pub page_token: std::string::String,
204
205    /// Optional. Filtering results.
206    pub filter: std::string::String,
207
208    /// Optional. Hint for how to order the results.
209    pub order_by: std::string::String,
210
211    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
212}
213
214impl ListResourceBundlesRequest {
215    /// Creates a new default instance.
216    pub fn new() -> Self {
217        std::default::Default::default()
218    }
219
220    /// Sets the value of [parent][crate::model::ListResourceBundlesRequest::parent].
221    ///
222    /// # Example
223    /// ```ignore,no_run
224    /// # use google_cloud_configdelivery_v1::model::ListResourceBundlesRequest;
225    /// # let project_id = "project_id";
226    /// # let location_id = "location_id";
227    /// let x = ListResourceBundlesRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
228    /// ```
229    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
230        self.parent = v.into();
231        self
232    }
233
234    /// Sets the value of [page_size][crate::model::ListResourceBundlesRequest::page_size].
235    ///
236    /// # Example
237    /// ```ignore,no_run
238    /// # use google_cloud_configdelivery_v1::model::ListResourceBundlesRequest;
239    /// let x = ListResourceBundlesRequest::new().set_page_size(42);
240    /// ```
241    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
242        self.page_size = v.into();
243        self
244    }
245
246    /// Sets the value of [page_token][crate::model::ListResourceBundlesRequest::page_token].
247    ///
248    /// # Example
249    /// ```ignore,no_run
250    /// # use google_cloud_configdelivery_v1::model::ListResourceBundlesRequest;
251    /// let x = ListResourceBundlesRequest::new().set_page_token("example");
252    /// ```
253    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
254        self.page_token = v.into();
255        self
256    }
257
258    /// Sets the value of [filter][crate::model::ListResourceBundlesRequest::filter].
259    ///
260    /// # Example
261    /// ```ignore,no_run
262    /// # use google_cloud_configdelivery_v1::model::ListResourceBundlesRequest;
263    /// let x = ListResourceBundlesRequest::new().set_filter("example");
264    /// ```
265    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
266        self.filter = v.into();
267        self
268    }
269
270    /// Sets the value of [order_by][crate::model::ListResourceBundlesRequest::order_by].
271    ///
272    /// # Example
273    /// ```ignore,no_run
274    /// # use google_cloud_configdelivery_v1::model::ListResourceBundlesRequest;
275    /// let x = ListResourceBundlesRequest::new().set_order_by("example");
276    /// ```
277    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
278        self.order_by = v.into();
279        self
280    }
281}
282
283impl wkt::message::Message for ListResourceBundlesRequest {
284    fn typename() -> &'static str {
285        "type.googleapis.com/google.cloud.configdelivery.v1.ListResourceBundlesRequest"
286    }
287}
288
289/// Message for response to listing ResourceBundles.
290#[derive(Clone, Default, PartialEq)]
291#[non_exhaustive]
292pub struct ListResourceBundlesResponse {
293    /// The list of ResourceBundle.
294    pub resource_bundles: std::vec::Vec<crate::model::ResourceBundle>,
295
296    /// A token identifying a page of results the server should return.
297    pub next_page_token: std::string::String,
298
299    /// Unordered list. Locations that could not be reached.
300    pub unreachable: std::vec::Vec<std::string::String>,
301
302    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
303}
304
305impl ListResourceBundlesResponse {
306    /// Creates a new default instance.
307    pub fn new() -> Self {
308        std::default::Default::default()
309    }
310
311    /// Sets the value of [resource_bundles][crate::model::ListResourceBundlesResponse::resource_bundles].
312    ///
313    /// # Example
314    /// ```ignore,no_run
315    /// # use google_cloud_configdelivery_v1::model::ListResourceBundlesResponse;
316    /// use google_cloud_configdelivery_v1::model::ResourceBundle;
317    /// let x = ListResourceBundlesResponse::new()
318    ///     .set_resource_bundles([
319    ///         ResourceBundle::default()/* use setters */,
320    ///         ResourceBundle::default()/* use (different) setters */,
321    ///     ]);
322    /// ```
323    pub fn set_resource_bundles<T, V>(mut self, v: T) -> Self
324    where
325        T: std::iter::IntoIterator<Item = V>,
326        V: std::convert::Into<crate::model::ResourceBundle>,
327    {
328        use std::iter::Iterator;
329        self.resource_bundles = v.into_iter().map(|i| i.into()).collect();
330        self
331    }
332
333    /// Sets the value of [next_page_token][crate::model::ListResourceBundlesResponse::next_page_token].
334    ///
335    /// # Example
336    /// ```ignore,no_run
337    /// # use google_cloud_configdelivery_v1::model::ListResourceBundlesResponse;
338    /// let x = ListResourceBundlesResponse::new().set_next_page_token("example");
339    /// ```
340    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
341        self.next_page_token = v.into();
342        self
343    }
344
345    /// Sets the value of [unreachable][crate::model::ListResourceBundlesResponse::unreachable].
346    ///
347    /// # Example
348    /// ```ignore,no_run
349    /// # use google_cloud_configdelivery_v1::model::ListResourceBundlesResponse;
350    /// let x = ListResourceBundlesResponse::new().set_unreachable(["a", "b", "c"]);
351    /// ```
352    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
353    where
354        T: std::iter::IntoIterator<Item = V>,
355        V: std::convert::Into<std::string::String>,
356    {
357        use std::iter::Iterator;
358        self.unreachable = v.into_iter().map(|i| i.into()).collect();
359        self
360    }
361}
362
363impl wkt::message::Message for ListResourceBundlesResponse {
364    fn typename() -> &'static str {
365        "type.googleapis.com/google.cloud.configdelivery.v1.ListResourceBundlesResponse"
366    }
367}
368
369#[doc(hidden)]
370impl google_cloud_gax::paginator::internal::PageableResponse for ListResourceBundlesResponse {
371    type PageItem = crate::model::ResourceBundle;
372
373    fn items(self) -> std::vec::Vec<Self::PageItem> {
374        self.resource_bundles
375    }
376
377    fn next_page_token(&self) -> std::string::String {
378        use std::clone::Clone;
379        self.next_page_token.clone()
380    }
381}
382
383/// Message for getting a ResourceBundle.
384#[derive(Clone, Default, PartialEq)]
385#[non_exhaustive]
386pub struct GetResourceBundleRequest {
387    /// Required. Name of the resource.
388    pub name: std::string::String,
389
390    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
391}
392
393impl GetResourceBundleRequest {
394    /// Creates a new default instance.
395    pub fn new() -> Self {
396        std::default::Default::default()
397    }
398
399    /// Sets the value of [name][crate::model::GetResourceBundleRequest::name].
400    ///
401    /// # Example
402    /// ```ignore,no_run
403    /// # use google_cloud_configdelivery_v1::model::GetResourceBundleRequest;
404    /// # let project_id = "project_id";
405    /// # let location_id = "location_id";
406    /// # let resource_bundle_id = "resource_bundle_id";
407    /// let x = GetResourceBundleRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/resourceBundles/{resource_bundle_id}"));
408    /// ```
409    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
410        self.name = v.into();
411        self
412    }
413}
414
415impl wkt::message::Message for GetResourceBundleRequest {
416    fn typename() -> &'static str {
417        "type.googleapis.com/google.cloud.configdelivery.v1.GetResourceBundleRequest"
418    }
419}
420
421/// Message for creating a ResourceBundle.
422#[derive(Clone, Default, PartialEq)]
423#[non_exhaustive]
424pub struct CreateResourceBundleRequest {
425    /// Required. Value for parent.
426    pub parent: std::string::String,
427
428    /// Required. Id of the requesting object
429    /// If auto-generating Id server-side, remove this field and
430    /// resource_bundle_id from the method_signature of Create RPC
431    pub resource_bundle_id: std::string::String,
432
433    /// Required. The resource being created
434    pub resource_bundle: std::option::Option<crate::model::ResourceBundle>,
435
436    /// Optional. An optional request ID to identify requests. Specify a unique
437    /// request ID so that if you must retry your request, the server will know to
438    /// ignore the request if it has already been completed. The server will
439    /// guarantee that for at least 60 minutes since the first request.
440    ///
441    /// For example, consider a situation where you make an initial request and the
442    /// request times out. If you make the request again with the same request
443    /// ID, the server can check if original operation with the same request ID
444    /// was received, and if so, will ignore the second request. This prevents
445    /// clients from accidentally creating duplicate commitments.
446    ///
447    /// The request ID must be a valid UUID with the exception that zero UUID is
448    /// not supported (00000000-0000-0000-0000-000000000000).
449    pub request_id: std::string::String,
450
451    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
452}
453
454impl CreateResourceBundleRequest {
455    /// Creates a new default instance.
456    pub fn new() -> Self {
457        std::default::Default::default()
458    }
459
460    /// Sets the value of [parent][crate::model::CreateResourceBundleRequest::parent].
461    ///
462    /// # Example
463    /// ```ignore,no_run
464    /// # use google_cloud_configdelivery_v1::model::CreateResourceBundleRequest;
465    /// # let project_id = "project_id";
466    /// # let location_id = "location_id";
467    /// let x = CreateResourceBundleRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
468    /// ```
469    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
470        self.parent = v.into();
471        self
472    }
473
474    /// Sets the value of [resource_bundle_id][crate::model::CreateResourceBundleRequest::resource_bundle_id].
475    ///
476    /// # Example
477    /// ```ignore,no_run
478    /// # use google_cloud_configdelivery_v1::model::CreateResourceBundleRequest;
479    /// let x = CreateResourceBundleRequest::new().set_resource_bundle_id("example");
480    /// ```
481    pub fn set_resource_bundle_id<T: std::convert::Into<std::string::String>>(
482        mut self,
483        v: T,
484    ) -> Self {
485        self.resource_bundle_id = v.into();
486        self
487    }
488
489    /// Sets the value of [resource_bundle][crate::model::CreateResourceBundleRequest::resource_bundle].
490    ///
491    /// # Example
492    /// ```ignore,no_run
493    /// # use google_cloud_configdelivery_v1::model::CreateResourceBundleRequest;
494    /// use google_cloud_configdelivery_v1::model::ResourceBundle;
495    /// let x = CreateResourceBundleRequest::new().set_resource_bundle(ResourceBundle::default()/* use setters */);
496    /// ```
497    pub fn set_resource_bundle<T>(mut self, v: T) -> Self
498    where
499        T: std::convert::Into<crate::model::ResourceBundle>,
500    {
501        self.resource_bundle = std::option::Option::Some(v.into());
502        self
503    }
504
505    /// Sets or clears the value of [resource_bundle][crate::model::CreateResourceBundleRequest::resource_bundle].
506    ///
507    /// # Example
508    /// ```ignore,no_run
509    /// # use google_cloud_configdelivery_v1::model::CreateResourceBundleRequest;
510    /// use google_cloud_configdelivery_v1::model::ResourceBundle;
511    /// let x = CreateResourceBundleRequest::new().set_or_clear_resource_bundle(Some(ResourceBundle::default()/* use setters */));
512    /// let x = CreateResourceBundleRequest::new().set_or_clear_resource_bundle(None::<ResourceBundle>);
513    /// ```
514    pub fn set_or_clear_resource_bundle<T>(mut self, v: std::option::Option<T>) -> Self
515    where
516        T: std::convert::Into<crate::model::ResourceBundle>,
517    {
518        self.resource_bundle = v.map(|x| x.into());
519        self
520    }
521
522    /// Sets the value of [request_id][crate::model::CreateResourceBundleRequest::request_id].
523    ///
524    /// # Example
525    /// ```ignore,no_run
526    /// # use google_cloud_configdelivery_v1::model::CreateResourceBundleRequest;
527    /// let x = CreateResourceBundleRequest::new().set_request_id("example");
528    /// ```
529    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
530        self.request_id = v.into();
531        self
532    }
533}
534
535impl wkt::message::Message for CreateResourceBundleRequest {
536    fn typename() -> &'static str {
537        "type.googleapis.com/google.cloud.configdelivery.v1.CreateResourceBundleRequest"
538    }
539}
540
541/// Message for updating a ResourceBundle
542#[derive(Clone, Default, PartialEq)]
543#[non_exhaustive]
544pub struct UpdateResourceBundleRequest {
545    /// Required. Field mask is used to specify the fields to be overwritten in the
546    /// ResourceBundle resource by the update.
547    /// The fields specified in the update_mask are relative to the resource, not
548    /// the full request. A field will be overwritten if it is in the mask. If the
549    /// user does not provide a mask then all fields will be overwritten.
550    pub update_mask: std::option::Option<wkt::FieldMask>,
551
552    /// Required. The resource being updated
553    pub resource_bundle: std::option::Option<crate::model::ResourceBundle>,
554
555    /// Optional. An optional request ID to identify requests. Specify a unique
556    /// request ID so that if you must retry your request, the server will know to
557    /// ignore the request if it has already been completed. The server will
558    /// guarantee that for at least 60 minutes since the first request.
559    ///
560    /// For example, consider a situation where you make an initial request and the
561    /// request times out. If you make the request again with the same request
562    /// ID, the server can check if original operation with the same request ID
563    /// was received, and if so, will ignore the second request. This prevents
564    /// clients from accidentally creating duplicate commitments.
565    ///
566    /// The request ID must be a valid UUID with the exception that zero UUID is
567    /// not supported (00000000-0000-0000-0000-000000000000).
568    pub request_id: std::string::String,
569
570    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
571}
572
573impl UpdateResourceBundleRequest {
574    /// Creates a new default instance.
575    pub fn new() -> Self {
576        std::default::Default::default()
577    }
578
579    /// Sets the value of [update_mask][crate::model::UpdateResourceBundleRequest::update_mask].
580    ///
581    /// # Example
582    /// ```ignore,no_run
583    /// # use google_cloud_configdelivery_v1::model::UpdateResourceBundleRequest;
584    /// use wkt::FieldMask;
585    /// let x = UpdateResourceBundleRequest::new().set_update_mask(FieldMask::default()/* use setters */);
586    /// ```
587    pub fn set_update_mask<T>(mut self, v: T) -> Self
588    where
589        T: std::convert::Into<wkt::FieldMask>,
590    {
591        self.update_mask = std::option::Option::Some(v.into());
592        self
593    }
594
595    /// Sets or clears the value of [update_mask][crate::model::UpdateResourceBundleRequest::update_mask].
596    ///
597    /// # Example
598    /// ```ignore,no_run
599    /// # use google_cloud_configdelivery_v1::model::UpdateResourceBundleRequest;
600    /// use wkt::FieldMask;
601    /// let x = UpdateResourceBundleRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
602    /// let x = UpdateResourceBundleRequest::new().set_or_clear_update_mask(None::<FieldMask>);
603    /// ```
604    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
605    where
606        T: std::convert::Into<wkt::FieldMask>,
607    {
608        self.update_mask = v.map(|x| x.into());
609        self
610    }
611
612    /// Sets the value of [resource_bundle][crate::model::UpdateResourceBundleRequest::resource_bundle].
613    ///
614    /// # Example
615    /// ```ignore,no_run
616    /// # use google_cloud_configdelivery_v1::model::UpdateResourceBundleRequest;
617    /// use google_cloud_configdelivery_v1::model::ResourceBundle;
618    /// let x = UpdateResourceBundleRequest::new().set_resource_bundle(ResourceBundle::default()/* use setters */);
619    /// ```
620    pub fn set_resource_bundle<T>(mut self, v: T) -> Self
621    where
622        T: std::convert::Into<crate::model::ResourceBundle>,
623    {
624        self.resource_bundle = std::option::Option::Some(v.into());
625        self
626    }
627
628    /// Sets or clears the value of [resource_bundle][crate::model::UpdateResourceBundleRequest::resource_bundle].
629    ///
630    /// # Example
631    /// ```ignore,no_run
632    /// # use google_cloud_configdelivery_v1::model::UpdateResourceBundleRequest;
633    /// use google_cloud_configdelivery_v1::model::ResourceBundle;
634    /// let x = UpdateResourceBundleRequest::new().set_or_clear_resource_bundle(Some(ResourceBundle::default()/* use setters */));
635    /// let x = UpdateResourceBundleRequest::new().set_or_clear_resource_bundle(None::<ResourceBundle>);
636    /// ```
637    pub fn set_or_clear_resource_bundle<T>(mut self, v: std::option::Option<T>) -> Self
638    where
639        T: std::convert::Into<crate::model::ResourceBundle>,
640    {
641        self.resource_bundle = v.map(|x| x.into());
642        self
643    }
644
645    /// Sets the value of [request_id][crate::model::UpdateResourceBundleRequest::request_id].
646    ///
647    /// # Example
648    /// ```ignore,no_run
649    /// # use google_cloud_configdelivery_v1::model::UpdateResourceBundleRequest;
650    /// let x = UpdateResourceBundleRequest::new().set_request_id("example");
651    /// ```
652    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
653        self.request_id = v.into();
654        self
655    }
656}
657
658impl wkt::message::Message for UpdateResourceBundleRequest {
659    fn typename() -> &'static str {
660        "type.googleapis.com/google.cloud.configdelivery.v1.UpdateResourceBundleRequest"
661    }
662}
663
664/// Message for deleting a ResourceBundle
665#[derive(Clone, Default, PartialEq)]
666#[non_exhaustive]
667pub struct DeleteResourceBundleRequest {
668    /// Required. Name of the resource
669    pub name: std::string::String,
670
671    /// Optional. An optional request ID to identify requests. Specify a unique
672    /// request ID so that if you must retry your request, the server will know to
673    /// ignore the request if it has already been completed. The server will
674    /// guarantee that for at least 60 minutes after the first request.
675    ///
676    /// For example, consider a situation where you make an initial request and the
677    /// request times out. If you make the request again with the same request
678    /// ID, the server can check if original operation with the same request ID
679    /// was received, and if so, will ignore the second request. This prevents
680    /// clients from accidentally creating duplicate commitments.
681    ///
682    /// The request ID must be a valid UUID with the exception that zero UUID is
683    /// not supported (00000000-0000-0000-0000-000000000000).
684    pub request_id: std::string::String,
685
686    /// Optional. If set to true, any releases of this resource bundle will also be
687    /// deleted. (Otherwise, the request will only work if the resource bundle has
688    /// no releases.)
689    pub force: bool,
690
691    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
692}
693
694impl DeleteResourceBundleRequest {
695    /// Creates a new default instance.
696    pub fn new() -> Self {
697        std::default::Default::default()
698    }
699
700    /// Sets the value of [name][crate::model::DeleteResourceBundleRequest::name].
701    ///
702    /// # Example
703    /// ```ignore,no_run
704    /// # use google_cloud_configdelivery_v1::model::DeleteResourceBundleRequest;
705    /// # let project_id = "project_id";
706    /// # let location_id = "location_id";
707    /// # let resource_bundle_id = "resource_bundle_id";
708    /// let x = DeleteResourceBundleRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/resourceBundles/{resource_bundle_id}"));
709    /// ```
710    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
711        self.name = v.into();
712        self
713    }
714
715    /// Sets the value of [request_id][crate::model::DeleteResourceBundleRequest::request_id].
716    ///
717    /// # Example
718    /// ```ignore,no_run
719    /// # use google_cloud_configdelivery_v1::model::DeleteResourceBundleRequest;
720    /// let x = DeleteResourceBundleRequest::new().set_request_id("example");
721    /// ```
722    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
723        self.request_id = v.into();
724        self
725    }
726
727    /// Sets the value of [force][crate::model::DeleteResourceBundleRequest::force].
728    ///
729    /// # Example
730    /// ```ignore,no_run
731    /// # use google_cloud_configdelivery_v1::model::DeleteResourceBundleRequest;
732    /// let x = DeleteResourceBundleRequest::new().set_force(true);
733    /// ```
734    pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
735        self.force = v.into();
736        self
737    }
738}
739
740impl wkt::message::Message for DeleteResourceBundleRequest {
741    fn typename() -> &'static str {
742        "type.googleapis.com/google.cloud.configdelivery.v1.DeleteResourceBundleRequest"
743    }
744}
745
746/// A `FleetPackage` resource in the Config Delivery API.
747///
748/// A `FleetPackage` defines a package through which kubernetes
749/// configuration is deployed to a fleet of kubernetes clusters.
750#[derive(Clone, Default, PartialEq)]
751#[non_exhaustive]
752pub struct FleetPackage {
753    /// Identifier. Name of the `FleetPackage`. Format is
754    /// `projects/{project}/locations/{location}/fleetPackages/{fleetPackage}`.
755    /// The `fleetPackage` component must match
756    /// `[a-z][a-z0-9\-]{0,62}`
757    pub name: std::string::String,
758
759    /// Output only. Time at which the `FleetPackage` was created.
760    pub create_time: std::option::Option<wkt::Timestamp>,
761
762    /// Output only. Most recent time at which the `FleetPackage` was updated.
763    pub update_time: std::option::Option<wkt::Timestamp>,
764
765    /// Optional. Labels are attributes that can be set and used by both the
766    /// user and by Config Delivery. Labels must meet the following constraints:
767    ///
768    /// * Keys and values can contain only lowercase letters, numeric characters,
769    ///   underscores, and dashes.
770    /// * All characters must use UTF-8 encoding, and international characters are
771    ///   allowed.
772    /// * Keys must start with a lowercase letter or international character.
773    /// * Each resource is limited to a maximum of 64 labels.
774    ///
775    /// Both keys and values are additionally constrained to be <= 128 bytes.
776    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
777
778    /// Required. Information specifying the source of kubernetes configuration to
779    /// deploy.
780    pub resource_bundle_selector:
781        std::option::Option<crate::model::fleet_package::ResourceBundleSelector>,
782
783    /// Optional. Configuration to select target clusters to deploy kubernetes
784    /// configuration to.
785    pub target: std::option::Option<crate::model::fleet_package::Target>,
786
787    /// Optional. The strategy to use to deploy kubernetes configuration to
788    /// clusters.
789    pub rollout_strategy: std::option::Option<crate::model::RolloutStrategy>,
790
791    /// Required. Information specifying how to map a `ResourceBundle` variant to a
792    /// target cluster.
793    pub variant_selector: std::option::Option<crate::model::fleet_package::VariantSelector>,
794
795    /// Output only. Information containing the rollout status of the
796    /// `FleetPackage` across all the target clusters.
797    pub info: std::option::Option<crate::model::FleetPackageInfo>,
798
799    /// Optional. Information around how to handle kubernetes resources at the
800    /// target clusters when the `FleetPackage` is deleted.
801    pub deletion_propagation_policy: crate::model::DeletionPropagationPolicy,
802
803    /// Optional. The desired state of the fleet package.
804    pub state: crate::model::fleet_package::State,
805
806    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
807}
808
809impl FleetPackage {
810    /// Creates a new default instance.
811    pub fn new() -> Self {
812        std::default::Default::default()
813    }
814
815    /// Sets the value of [name][crate::model::FleetPackage::name].
816    ///
817    /// # Example
818    /// ```ignore,no_run
819    /// # use google_cloud_configdelivery_v1::model::FleetPackage;
820    /// # let project_id = "project_id";
821    /// # let location_id = "location_id";
822    /// # let fleet_package_id = "fleet_package_id";
823    /// let x = FleetPackage::new().set_name(format!("projects/{project_id}/locations/{location_id}/fleetPackages/{fleet_package_id}"));
824    /// ```
825    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
826        self.name = v.into();
827        self
828    }
829
830    /// Sets the value of [create_time][crate::model::FleetPackage::create_time].
831    ///
832    /// # Example
833    /// ```ignore,no_run
834    /// # use google_cloud_configdelivery_v1::model::FleetPackage;
835    /// use wkt::Timestamp;
836    /// let x = FleetPackage::new().set_create_time(Timestamp::default()/* use setters */);
837    /// ```
838    pub fn set_create_time<T>(mut self, v: T) -> Self
839    where
840        T: std::convert::Into<wkt::Timestamp>,
841    {
842        self.create_time = std::option::Option::Some(v.into());
843        self
844    }
845
846    /// Sets or clears the value of [create_time][crate::model::FleetPackage::create_time].
847    ///
848    /// # Example
849    /// ```ignore,no_run
850    /// # use google_cloud_configdelivery_v1::model::FleetPackage;
851    /// use wkt::Timestamp;
852    /// let x = FleetPackage::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
853    /// let x = FleetPackage::new().set_or_clear_create_time(None::<Timestamp>);
854    /// ```
855    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
856    where
857        T: std::convert::Into<wkt::Timestamp>,
858    {
859        self.create_time = v.map(|x| x.into());
860        self
861    }
862
863    /// Sets the value of [update_time][crate::model::FleetPackage::update_time].
864    ///
865    /// # Example
866    /// ```ignore,no_run
867    /// # use google_cloud_configdelivery_v1::model::FleetPackage;
868    /// use wkt::Timestamp;
869    /// let x = FleetPackage::new().set_update_time(Timestamp::default()/* use setters */);
870    /// ```
871    pub fn set_update_time<T>(mut self, v: T) -> Self
872    where
873        T: std::convert::Into<wkt::Timestamp>,
874    {
875        self.update_time = std::option::Option::Some(v.into());
876        self
877    }
878
879    /// Sets or clears the value of [update_time][crate::model::FleetPackage::update_time].
880    ///
881    /// # Example
882    /// ```ignore,no_run
883    /// # use google_cloud_configdelivery_v1::model::FleetPackage;
884    /// use wkt::Timestamp;
885    /// let x = FleetPackage::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
886    /// let x = FleetPackage::new().set_or_clear_update_time(None::<Timestamp>);
887    /// ```
888    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
889    where
890        T: std::convert::Into<wkt::Timestamp>,
891    {
892        self.update_time = v.map(|x| x.into());
893        self
894    }
895
896    /// Sets the value of [labels][crate::model::FleetPackage::labels].
897    ///
898    /// # Example
899    /// ```ignore,no_run
900    /// # use google_cloud_configdelivery_v1::model::FleetPackage;
901    /// let x = FleetPackage::new().set_labels([
902    ///     ("key0", "abc"),
903    ///     ("key1", "xyz"),
904    /// ]);
905    /// ```
906    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
907    where
908        T: std::iter::IntoIterator<Item = (K, V)>,
909        K: std::convert::Into<std::string::String>,
910        V: std::convert::Into<std::string::String>,
911    {
912        use std::iter::Iterator;
913        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
914        self
915    }
916
917    /// Sets the value of [resource_bundle_selector][crate::model::FleetPackage::resource_bundle_selector].
918    ///
919    /// # Example
920    /// ```ignore,no_run
921    /// # use google_cloud_configdelivery_v1::model::FleetPackage;
922    /// use google_cloud_configdelivery_v1::model::fleet_package::ResourceBundleSelector;
923    /// let x = FleetPackage::new().set_resource_bundle_selector(ResourceBundleSelector::default()/* use setters */);
924    /// ```
925    pub fn set_resource_bundle_selector<T>(mut self, v: T) -> Self
926    where
927        T: std::convert::Into<crate::model::fleet_package::ResourceBundleSelector>,
928    {
929        self.resource_bundle_selector = std::option::Option::Some(v.into());
930        self
931    }
932
933    /// Sets or clears the value of [resource_bundle_selector][crate::model::FleetPackage::resource_bundle_selector].
934    ///
935    /// # Example
936    /// ```ignore,no_run
937    /// # use google_cloud_configdelivery_v1::model::FleetPackage;
938    /// use google_cloud_configdelivery_v1::model::fleet_package::ResourceBundleSelector;
939    /// let x = FleetPackage::new().set_or_clear_resource_bundle_selector(Some(ResourceBundleSelector::default()/* use setters */));
940    /// let x = FleetPackage::new().set_or_clear_resource_bundle_selector(None::<ResourceBundleSelector>);
941    /// ```
942    pub fn set_or_clear_resource_bundle_selector<T>(mut self, v: std::option::Option<T>) -> Self
943    where
944        T: std::convert::Into<crate::model::fleet_package::ResourceBundleSelector>,
945    {
946        self.resource_bundle_selector = v.map(|x| x.into());
947        self
948    }
949
950    /// Sets the value of [target][crate::model::FleetPackage::target].
951    ///
952    /// # Example
953    /// ```ignore,no_run
954    /// # use google_cloud_configdelivery_v1::model::FleetPackage;
955    /// use google_cloud_configdelivery_v1::model::fleet_package::Target;
956    /// let x = FleetPackage::new().set_target(Target::default()/* use setters */);
957    /// ```
958    pub fn set_target<T>(mut self, v: T) -> Self
959    where
960        T: std::convert::Into<crate::model::fleet_package::Target>,
961    {
962        self.target = std::option::Option::Some(v.into());
963        self
964    }
965
966    /// Sets or clears the value of [target][crate::model::FleetPackage::target].
967    ///
968    /// # Example
969    /// ```ignore,no_run
970    /// # use google_cloud_configdelivery_v1::model::FleetPackage;
971    /// use google_cloud_configdelivery_v1::model::fleet_package::Target;
972    /// let x = FleetPackage::new().set_or_clear_target(Some(Target::default()/* use setters */));
973    /// let x = FleetPackage::new().set_or_clear_target(None::<Target>);
974    /// ```
975    pub fn set_or_clear_target<T>(mut self, v: std::option::Option<T>) -> Self
976    where
977        T: std::convert::Into<crate::model::fleet_package::Target>,
978    {
979        self.target = v.map(|x| x.into());
980        self
981    }
982
983    /// Sets the value of [rollout_strategy][crate::model::FleetPackage::rollout_strategy].
984    ///
985    /// # Example
986    /// ```ignore,no_run
987    /// # use google_cloud_configdelivery_v1::model::FleetPackage;
988    /// use google_cloud_configdelivery_v1::model::RolloutStrategy;
989    /// let x = FleetPackage::new().set_rollout_strategy(RolloutStrategy::default()/* use setters */);
990    /// ```
991    pub fn set_rollout_strategy<T>(mut self, v: T) -> Self
992    where
993        T: std::convert::Into<crate::model::RolloutStrategy>,
994    {
995        self.rollout_strategy = std::option::Option::Some(v.into());
996        self
997    }
998
999    /// Sets or clears the value of [rollout_strategy][crate::model::FleetPackage::rollout_strategy].
1000    ///
1001    /// # Example
1002    /// ```ignore,no_run
1003    /// # use google_cloud_configdelivery_v1::model::FleetPackage;
1004    /// use google_cloud_configdelivery_v1::model::RolloutStrategy;
1005    /// let x = FleetPackage::new().set_or_clear_rollout_strategy(Some(RolloutStrategy::default()/* use setters */));
1006    /// let x = FleetPackage::new().set_or_clear_rollout_strategy(None::<RolloutStrategy>);
1007    /// ```
1008    pub fn set_or_clear_rollout_strategy<T>(mut self, v: std::option::Option<T>) -> Self
1009    where
1010        T: std::convert::Into<crate::model::RolloutStrategy>,
1011    {
1012        self.rollout_strategy = v.map(|x| x.into());
1013        self
1014    }
1015
1016    /// Sets the value of [variant_selector][crate::model::FleetPackage::variant_selector].
1017    ///
1018    /// # Example
1019    /// ```ignore,no_run
1020    /// # use google_cloud_configdelivery_v1::model::FleetPackage;
1021    /// use google_cloud_configdelivery_v1::model::fleet_package::VariantSelector;
1022    /// let x = FleetPackage::new().set_variant_selector(VariantSelector::default()/* use setters */);
1023    /// ```
1024    pub fn set_variant_selector<T>(mut self, v: T) -> Self
1025    where
1026        T: std::convert::Into<crate::model::fleet_package::VariantSelector>,
1027    {
1028        self.variant_selector = std::option::Option::Some(v.into());
1029        self
1030    }
1031
1032    /// Sets or clears the value of [variant_selector][crate::model::FleetPackage::variant_selector].
1033    ///
1034    /// # Example
1035    /// ```ignore,no_run
1036    /// # use google_cloud_configdelivery_v1::model::FleetPackage;
1037    /// use google_cloud_configdelivery_v1::model::fleet_package::VariantSelector;
1038    /// let x = FleetPackage::new().set_or_clear_variant_selector(Some(VariantSelector::default()/* use setters */));
1039    /// let x = FleetPackage::new().set_or_clear_variant_selector(None::<VariantSelector>);
1040    /// ```
1041    pub fn set_or_clear_variant_selector<T>(mut self, v: std::option::Option<T>) -> Self
1042    where
1043        T: std::convert::Into<crate::model::fleet_package::VariantSelector>,
1044    {
1045        self.variant_selector = v.map(|x| x.into());
1046        self
1047    }
1048
1049    /// Sets the value of [info][crate::model::FleetPackage::info].
1050    ///
1051    /// # Example
1052    /// ```ignore,no_run
1053    /// # use google_cloud_configdelivery_v1::model::FleetPackage;
1054    /// use google_cloud_configdelivery_v1::model::FleetPackageInfo;
1055    /// let x = FleetPackage::new().set_info(FleetPackageInfo::default()/* use setters */);
1056    /// ```
1057    pub fn set_info<T>(mut self, v: T) -> Self
1058    where
1059        T: std::convert::Into<crate::model::FleetPackageInfo>,
1060    {
1061        self.info = std::option::Option::Some(v.into());
1062        self
1063    }
1064
1065    /// Sets or clears the value of [info][crate::model::FleetPackage::info].
1066    ///
1067    /// # Example
1068    /// ```ignore,no_run
1069    /// # use google_cloud_configdelivery_v1::model::FleetPackage;
1070    /// use google_cloud_configdelivery_v1::model::FleetPackageInfo;
1071    /// let x = FleetPackage::new().set_or_clear_info(Some(FleetPackageInfo::default()/* use setters */));
1072    /// let x = FleetPackage::new().set_or_clear_info(None::<FleetPackageInfo>);
1073    /// ```
1074    pub fn set_or_clear_info<T>(mut self, v: std::option::Option<T>) -> Self
1075    where
1076        T: std::convert::Into<crate::model::FleetPackageInfo>,
1077    {
1078        self.info = v.map(|x| x.into());
1079        self
1080    }
1081
1082    /// Sets the value of [deletion_propagation_policy][crate::model::FleetPackage::deletion_propagation_policy].
1083    ///
1084    /// # Example
1085    /// ```ignore,no_run
1086    /// # use google_cloud_configdelivery_v1::model::FleetPackage;
1087    /// use google_cloud_configdelivery_v1::model::DeletionPropagationPolicy;
1088    /// let x0 = FleetPackage::new().set_deletion_propagation_policy(DeletionPropagationPolicy::Foreground);
1089    /// let x1 = FleetPackage::new().set_deletion_propagation_policy(DeletionPropagationPolicy::Orphan);
1090    /// ```
1091    pub fn set_deletion_propagation_policy<
1092        T: std::convert::Into<crate::model::DeletionPropagationPolicy>,
1093    >(
1094        mut self,
1095        v: T,
1096    ) -> Self {
1097        self.deletion_propagation_policy = v.into();
1098        self
1099    }
1100
1101    /// Sets the value of [state][crate::model::FleetPackage::state].
1102    ///
1103    /// # Example
1104    /// ```ignore,no_run
1105    /// # use google_cloud_configdelivery_v1::model::FleetPackage;
1106    /// use google_cloud_configdelivery_v1::model::fleet_package::State;
1107    /// let x0 = FleetPackage::new().set_state(State::Active);
1108    /// let x1 = FleetPackage::new().set_state(State::Suspended);
1109    /// ```
1110    pub fn set_state<T: std::convert::Into<crate::model::fleet_package::State>>(
1111        mut self,
1112        v: T,
1113    ) -> Self {
1114        self.state = v.into();
1115        self
1116    }
1117}
1118
1119impl wkt::message::Message for FleetPackage {
1120    fn typename() -> &'static str {
1121        "type.googleapis.com/google.cloud.configdelivery.v1.FleetPackage"
1122    }
1123}
1124
1125/// Defines additional types related to [FleetPackage].
1126pub mod fleet_package {
1127    #[allow(unused_imports)]
1128    use super::*;
1129
1130    /// Information specifying the source of kubernetes configuration to deploy.
1131    #[derive(Clone, Default, PartialEq)]
1132    #[non_exhaustive]
1133    pub struct ResourceBundleSelector {
1134        /// source can be a directly pushed `ResourceBundle` or
1135        /// `CloudBuildRepository` containing the kubernetes configuration.
1136        pub source:
1137            std::option::Option<crate::model::fleet_package::resource_bundle_selector::Source>,
1138
1139        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1140    }
1141
1142    impl ResourceBundleSelector {
1143        /// Creates a new default instance.
1144        pub fn new() -> Self {
1145            std::default::Default::default()
1146        }
1147
1148        /// Sets the value of [source][crate::model::fleet_package::ResourceBundleSelector::source].
1149        ///
1150        /// Note that all the setters affecting `source` are mutually
1151        /// exclusive.
1152        ///
1153        /// # Example
1154        /// ```ignore,no_run
1155        /// # use google_cloud_configdelivery_v1::model::fleet_package::ResourceBundleSelector;
1156        /// use google_cloud_configdelivery_v1::model::fleet_package::ResourceBundleTag;
1157        /// let x = ResourceBundleSelector::new().set_source(Some(
1158        ///     google_cloud_configdelivery_v1::model::fleet_package::resource_bundle_selector::Source::ResourceBundle(ResourceBundleTag::default().into())));
1159        /// ```
1160        pub fn set_source<
1161            T: std::convert::Into<
1162                    std::option::Option<
1163                        crate::model::fleet_package::resource_bundle_selector::Source,
1164                    >,
1165                >,
1166        >(
1167            mut self,
1168            v: T,
1169        ) -> Self {
1170            self.source = v.into();
1171            self
1172        }
1173
1174        /// The value of [source][crate::model::fleet_package::ResourceBundleSelector::source]
1175        /// if it holds a `ResourceBundle`, `None` if the field is not set or
1176        /// holds a different branch.
1177        pub fn resource_bundle(
1178            &self,
1179        ) -> std::option::Option<&std::boxed::Box<crate::model::fleet_package::ResourceBundleTag>>
1180        {
1181            #[allow(unreachable_patterns)]
1182            self.source.as_ref().and_then(|v| match v {
1183                crate::model::fleet_package::resource_bundle_selector::Source::ResourceBundle(
1184                    v,
1185                ) => std::option::Option::Some(v),
1186                _ => std::option::Option::None,
1187            })
1188        }
1189
1190        /// Sets the value of [source][crate::model::fleet_package::ResourceBundleSelector::source]
1191        /// to hold a `ResourceBundle`.
1192        ///
1193        /// Note that all the setters affecting `source` are
1194        /// mutually exclusive.
1195        ///
1196        /// # Example
1197        /// ```ignore,no_run
1198        /// # use google_cloud_configdelivery_v1::model::fleet_package::ResourceBundleSelector;
1199        /// use google_cloud_configdelivery_v1::model::fleet_package::ResourceBundleTag;
1200        /// let x = ResourceBundleSelector::new().set_resource_bundle(ResourceBundleTag::default()/* use setters */);
1201        /// assert!(x.resource_bundle().is_some());
1202        /// assert!(x.cloud_build_repository().is_none());
1203        /// ```
1204        pub fn set_resource_bundle<
1205            T: std::convert::Into<std::boxed::Box<crate::model::fleet_package::ResourceBundleTag>>,
1206        >(
1207            mut self,
1208            v: T,
1209        ) -> Self {
1210            self.source = std::option::Option::Some(
1211                crate::model::fleet_package::resource_bundle_selector::Source::ResourceBundle(
1212                    v.into(),
1213                ),
1214            );
1215            self
1216        }
1217
1218        /// The value of [source][crate::model::fleet_package::ResourceBundleSelector::source]
1219        /// if it holds a `CloudBuildRepository`, `None` if the field is not set or
1220        /// holds a different branch.
1221        pub fn cloud_build_repository(
1222            &self,
1223        ) -> std::option::Option<&std::boxed::Box<crate::model::fleet_package::CloudBuildRepository>>
1224        {
1225            #[allow(unreachable_patterns)]
1226            self.source.as_ref().and_then(|v| match v {
1227                crate::model::fleet_package::resource_bundle_selector::Source::CloudBuildRepository(v) => std::option::Option::Some(v),
1228                _ => std::option::Option::None,
1229            })
1230        }
1231
1232        /// Sets the value of [source][crate::model::fleet_package::ResourceBundleSelector::source]
1233        /// to hold a `CloudBuildRepository`.
1234        ///
1235        /// Note that all the setters affecting `source` are
1236        /// mutually exclusive.
1237        ///
1238        /// # Example
1239        /// ```ignore,no_run
1240        /// # use google_cloud_configdelivery_v1::model::fleet_package::ResourceBundleSelector;
1241        /// use google_cloud_configdelivery_v1::model::fleet_package::CloudBuildRepository;
1242        /// let x = ResourceBundleSelector::new().set_cloud_build_repository(CloudBuildRepository::default()/* use setters */);
1243        /// assert!(x.cloud_build_repository().is_some());
1244        /// assert!(x.resource_bundle().is_none());
1245        /// ```
1246        pub fn set_cloud_build_repository<
1247            T: std::convert::Into<std::boxed::Box<crate::model::fleet_package::CloudBuildRepository>>,
1248        >(
1249            mut self,
1250            v: T,
1251        ) -> Self {
1252            self.source = std::option::Option::Some(
1253                crate::model::fleet_package::resource_bundle_selector::Source::CloudBuildRepository(
1254                    v.into(),
1255                ),
1256            );
1257            self
1258        }
1259    }
1260
1261    impl wkt::message::Message for ResourceBundleSelector {
1262        fn typename() -> &'static str {
1263            "type.googleapis.com/google.cloud.configdelivery.v1.FleetPackage.ResourceBundleSelector"
1264        }
1265    }
1266
1267    /// Defines additional types related to [ResourceBundleSelector].
1268    pub mod resource_bundle_selector {
1269        #[allow(unused_imports)]
1270        use super::*;
1271
1272        /// source can be a directly pushed `ResourceBundle` or
1273        /// `CloudBuildRepository` containing the kubernetes configuration.
1274        #[derive(Clone, Debug, PartialEq)]
1275        #[non_exhaustive]
1276        pub enum Source {
1277            /// Information specifying `ResourceBundle`.
1278            ResourceBundle(std::boxed::Box<crate::model::fleet_package::ResourceBundleTag>),
1279            /// Information specifying `CloudBuildRepository`.
1280            CloudBuildRepository(
1281                std::boxed::Box<crate::model::fleet_package::CloudBuildRepository>,
1282            ),
1283        }
1284    }
1285
1286    /// ResourceBundleTag contains the information to refer to a release for a
1287    /// `ResourceBundle`.
1288    #[derive(Clone, Default, PartialEq)]
1289    #[non_exhaustive]
1290    pub struct ResourceBundleTag {
1291        /// Required. Name of the `ResourceBundle`.
1292        /// Format is projects/{p}/locations/{l}/resourceBundles/{r}.
1293        pub name: std::string::String,
1294
1295        /// Required. Tag refers to a version of the release in a `ResourceBundle`.
1296        /// This is a Git tag in the semantic version format `vX.Y.Z`.
1297        pub tag: std::string::String,
1298
1299        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1300    }
1301
1302    impl ResourceBundleTag {
1303        /// Creates a new default instance.
1304        pub fn new() -> Self {
1305            std::default::Default::default()
1306        }
1307
1308        /// Sets the value of [name][crate::model::fleet_package::ResourceBundleTag::name].
1309        ///
1310        /// # Example
1311        /// ```ignore,no_run
1312        /// # use google_cloud_configdelivery_v1::model::fleet_package::ResourceBundleTag;
1313        /// # let project_id = "project_id";
1314        /// # let location_id = "location_id";
1315        /// # let resource_bundle_id = "resource_bundle_id";
1316        /// let x = ResourceBundleTag::new().set_name(format!("projects/{project_id}/locations/{location_id}/resourceBundles/{resource_bundle_id}"));
1317        /// ```
1318        pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1319            self.name = v.into();
1320            self
1321        }
1322
1323        /// Sets the value of [tag][crate::model::fleet_package::ResourceBundleTag::tag].
1324        ///
1325        /// # Example
1326        /// ```ignore,no_run
1327        /// # use google_cloud_configdelivery_v1::model::fleet_package::ResourceBundleTag;
1328        /// let x = ResourceBundleTag::new().set_tag("example");
1329        /// ```
1330        pub fn set_tag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1331            self.tag = v.into();
1332            self
1333        }
1334    }
1335
1336    impl wkt::message::Message for ResourceBundleTag {
1337        fn typename() -> &'static str {
1338            "type.googleapis.com/google.cloud.configdelivery.v1.FleetPackage.ResourceBundleTag"
1339        }
1340    }
1341
1342    /// CloudBuildRepository contains information about fetching Kubernetes
1343    /// configuration from a `CloudBuildRepository`.
1344    #[derive(Clone, Default, PartialEq)]
1345    #[non_exhaustive]
1346    pub struct CloudBuildRepository {
1347        /// Required. Name of the cloud build repository.
1348        /// Format is projects/{p}/locations/{l}/connections/{c}/repositories/{r}.
1349        pub name: std::string::String,
1350
1351        /// Optional. path to the directory or file within the repository that
1352        /// contains the kubernetes configuration. If unspecified, path is assumed to
1353        /// the top level root directory of the repository.
1354        pub path: std::string::String,
1355
1356        /// Required. git tag of the underlying git repository.
1357        /// The git tag must be in the semantic version format `vX.Y.Z`.
1358        pub tag: std::string::String,
1359
1360        /// Required. Google service account to use in CloudBuild triggers to fetch
1361        /// and store kubernetes configuration.
1362        pub service_account: std::string::String,
1363
1364        /// variants_pattern is the configuration for how to read the repository
1365        /// to find variants.
1366        pub variants:
1367            std::option::Option<crate::model::fleet_package::cloud_build_repository::Variants>,
1368
1369        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1370    }
1371
1372    impl CloudBuildRepository {
1373        /// Creates a new default instance.
1374        pub fn new() -> Self {
1375            std::default::Default::default()
1376        }
1377
1378        /// Sets the value of [name][crate::model::fleet_package::CloudBuildRepository::name].
1379        ///
1380        /// # Example
1381        /// ```ignore,no_run
1382        /// # use google_cloud_configdelivery_v1::model::fleet_package::CloudBuildRepository;
1383        /// let x = CloudBuildRepository::new().set_name("example");
1384        /// ```
1385        pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1386            self.name = v.into();
1387            self
1388        }
1389
1390        /// Sets the value of [path][crate::model::fleet_package::CloudBuildRepository::path].
1391        ///
1392        /// # Example
1393        /// ```ignore,no_run
1394        /// # use google_cloud_configdelivery_v1::model::fleet_package::CloudBuildRepository;
1395        /// let x = CloudBuildRepository::new().set_path("example");
1396        /// ```
1397        pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1398            self.path = v.into();
1399            self
1400        }
1401
1402        /// Sets the value of [tag][crate::model::fleet_package::CloudBuildRepository::tag].
1403        ///
1404        /// # Example
1405        /// ```ignore,no_run
1406        /// # use google_cloud_configdelivery_v1::model::fleet_package::CloudBuildRepository;
1407        /// let x = CloudBuildRepository::new().set_tag("example");
1408        /// ```
1409        pub fn set_tag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1410            self.tag = v.into();
1411            self
1412        }
1413
1414        /// Sets the value of [service_account][crate::model::fleet_package::CloudBuildRepository::service_account].
1415        ///
1416        /// # Example
1417        /// ```ignore,no_run
1418        /// # use google_cloud_configdelivery_v1::model::fleet_package::CloudBuildRepository;
1419        /// let x = CloudBuildRepository::new().set_service_account("example");
1420        /// ```
1421        pub fn set_service_account<T: std::convert::Into<std::string::String>>(
1422            mut self,
1423            v: T,
1424        ) -> Self {
1425            self.service_account = v.into();
1426            self
1427        }
1428
1429        /// Sets the value of [variants][crate::model::fleet_package::CloudBuildRepository::variants].
1430        ///
1431        /// Note that all the setters affecting `variants` are mutually
1432        /// exclusive.
1433        ///
1434        /// # Example
1435        /// ```ignore,no_run
1436        /// # use google_cloud_configdelivery_v1::model::fleet_package::CloudBuildRepository;
1437        /// use google_cloud_configdelivery_v1::model::fleet_package::cloud_build_repository::Variants;
1438        /// let x = CloudBuildRepository::new().set_variants(Some(Variants::VariantsPattern("example".to_string())));
1439        /// ```
1440        pub fn set_variants<
1441            T: std::convert::Into<
1442                    std::option::Option<
1443                        crate::model::fleet_package::cloud_build_repository::Variants,
1444                    >,
1445                >,
1446        >(
1447            mut self,
1448            v: T,
1449        ) -> Self {
1450            self.variants = v.into();
1451            self
1452        }
1453
1454        /// The value of [variants][crate::model::fleet_package::CloudBuildRepository::variants]
1455        /// if it holds a `VariantsPattern`, `None` if the field is not set or
1456        /// holds a different branch.
1457        pub fn variants_pattern(&self) -> std::option::Option<&std::string::String> {
1458            #[allow(unreachable_patterns)]
1459            self.variants.as_ref().and_then(|v| match v {
1460                crate::model::fleet_package::cloud_build_repository::Variants::VariantsPattern(
1461                    v,
1462                ) => std::option::Option::Some(v),
1463                _ => std::option::Option::None,
1464            })
1465        }
1466
1467        /// Sets the value of [variants][crate::model::fleet_package::CloudBuildRepository::variants]
1468        /// to hold a `VariantsPattern`.
1469        ///
1470        /// Note that all the setters affecting `variants` are
1471        /// mutually exclusive.
1472        ///
1473        /// # Example
1474        /// ```ignore,no_run
1475        /// # use google_cloud_configdelivery_v1::model::fleet_package::CloudBuildRepository;
1476        /// let x = CloudBuildRepository::new().set_variants_pattern("example");
1477        /// assert!(x.variants_pattern().is_some());
1478        /// ```
1479        pub fn set_variants_pattern<T: std::convert::Into<std::string::String>>(
1480            mut self,
1481            v: T,
1482        ) -> Self {
1483            self.variants = std::option::Option::Some(
1484                crate::model::fleet_package::cloud_build_repository::Variants::VariantsPattern(
1485                    v.into(),
1486                ),
1487            );
1488            self
1489        }
1490    }
1491
1492    impl wkt::message::Message for CloudBuildRepository {
1493        fn typename() -> &'static str {
1494            "type.googleapis.com/google.cloud.configdelivery.v1.FleetPackage.CloudBuildRepository"
1495        }
1496    }
1497
1498    /// Defines additional types related to [CloudBuildRepository].
1499    pub mod cloud_build_repository {
1500        #[allow(unused_imports)]
1501        use super::*;
1502
1503        /// variants_pattern is the configuration for how to read the repository
1504        /// to find variants.
1505        #[derive(Clone, Debug, PartialEq)]
1506        #[non_exhaustive]
1507        pub enum Variants {
1508            /// Optional. variants_pattern is a glob pattern that will be used to find
1509            /// variants in the repository. Examples: `variants/*.yaml`, `us-*`
1510            VariantsPattern(std::string::String),
1511        }
1512    }
1513
1514    /// The target defines different ways to target set of kubernetes clusters.
1515    #[derive(Clone, Default, PartialEq)]
1516    #[non_exhaustive]
1517    pub struct Target {
1518        /// target for the fleet package.
1519        pub target: std::option::Option<crate::model::fleet_package::target::Target>,
1520
1521        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1522    }
1523
1524    impl Target {
1525        /// Creates a new default instance.
1526        pub fn new() -> Self {
1527            std::default::Default::default()
1528        }
1529
1530        /// Sets the value of [target][crate::model::fleet_package::Target::target].
1531        ///
1532        /// Note that all the setters affecting `target` are mutually
1533        /// exclusive.
1534        ///
1535        /// # Example
1536        /// ```ignore,no_run
1537        /// # use google_cloud_configdelivery_v1::model::fleet_package::Target;
1538        /// use google_cloud_configdelivery_v1::model::Fleet;
1539        /// let x = Target::new().set_target(Some(
1540        ///     google_cloud_configdelivery_v1::model::fleet_package::target::Target::Fleet(Fleet::default().into())));
1541        /// ```
1542        pub fn set_target<
1543            T: std::convert::Into<std::option::Option<crate::model::fleet_package::target::Target>>,
1544        >(
1545            mut self,
1546            v: T,
1547        ) -> Self {
1548            self.target = v.into();
1549            self
1550        }
1551
1552        /// The value of [target][crate::model::fleet_package::Target::target]
1553        /// if it holds a `Fleet`, `None` if the field is not set or
1554        /// holds a different branch.
1555        pub fn fleet(&self) -> std::option::Option<&std::boxed::Box<crate::model::Fleet>> {
1556            #[allow(unreachable_patterns)]
1557            self.target.as_ref().and_then(|v| match v {
1558                crate::model::fleet_package::target::Target::Fleet(v) => {
1559                    std::option::Option::Some(v)
1560                }
1561                _ => std::option::Option::None,
1562            })
1563        }
1564
1565        /// Sets the value of [target][crate::model::fleet_package::Target::target]
1566        /// to hold a `Fleet`.
1567        ///
1568        /// Note that all the setters affecting `target` are
1569        /// mutually exclusive.
1570        ///
1571        /// # Example
1572        /// ```ignore,no_run
1573        /// # use google_cloud_configdelivery_v1::model::fleet_package::Target;
1574        /// use google_cloud_configdelivery_v1::model::Fleet;
1575        /// let x = Target::new().set_fleet(Fleet::default()/* use setters */);
1576        /// assert!(x.fleet().is_some());
1577        /// ```
1578        pub fn set_fleet<T: std::convert::Into<std::boxed::Box<crate::model::Fleet>>>(
1579            mut self,
1580            v: T,
1581        ) -> Self {
1582            self.target = std::option::Option::Some(
1583                crate::model::fleet_package::target::Target::Fleet(v.into()),
1584            );
1585            self
1586        }
1587    }
1588
1589    impl wkt::message::Message for Target {
1590        fn typename() -> &'static str {
1591            "type.googleapis.com/google.cloud.configdelivery.v1.FleetPackage.Target"
1592        }
1593    }
1594
1595    /// Defines additional types related to [Target].
1596    pub mod target {
1597        #[allow(unused_imports)]
1598        use super::*;
1599
1600        /// target for the fleet package.
1601        #[derive(Clone, Debug, PartialEq)]
1602        #[non_exhaustive]
1603        pub enum Target {
1604            /// The GKE fleet information.
1605            Fleet(std::boxed::Box<crate::model::Fleet>),
1606        }
1607    }
1608
1609    /// VariantSelector contains information for selecting a variant in
1610    /// `ResourceBundle` to deploy to a target cluster.
1611    #[derive(Clone, Default, PartialEq)]
1612    #[non_exhaustive]
1613    pub struct VariantSelector {
1614        /// strategy for selecting a variant.
1615        pub strategy: std::option::Option<crate::model::fleet_package::variant_selector::Strategy>,
1616
1617        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1618    }
1619
1620    impl VariantSelector {
1621        /// Creates a new default instance.
1622        pub fn new() -> Self {
1623            std::default::Default::default()
1624        }
1625
1626        /// Sets the value of [strategy][crate::model::fleet_package::VariantSelector::strategy].
1627        ///
1628        /// Note that all the setters affecting `strategy` are mutually
1629        /// exclusive.
1630        ///
1631        /// # Example
1632        /// ```ignore,no_run
1633        /// # use google_cloud_configdelivery_v1::model::fleet_package::VariantSelector;
1634        /// use google_cloud_configdelivery_v1::model::fleet_package::variant_selector::Strategy;
1635        /// let x = VariantSelector::new().set_strategy(Some(Strategy::VariantNameTemplate("example".to_string())));
1636        /// ```
1637        pub fn set_strategy<
1638            T: std::convert::Into<
1639                    std::option::Option<crate::model::fleet_package::variant_selector::Strategy>,
1640                >,
1641        >(
1642            mut self,
1643            v: T,
1644        ) -> Self {
1645            self.strategy = v.into();
1646            self
1647        }
1648
1649        /// The value of [strategy][crate::model::fleet_package::VariantSelector::strategy]
1650        /// if it holds a `VariantNameTemplate`, `None` if the field is not set or
1651        /// holds a different branch.
1652        pub fn variant_name_template(&self) -> std::option::Option<&std::string::String> {
1653            #[allow(unreachable_patterns)]
1654            self.strategy.as_ref().and_then(|v| match v {
1655                crate::model::fleet_package::variant_selector::Strategy::VariantNameTemplate(v) => {
1656                    std::option::Option::Some(v)
1657                }
1658                _ => std::option::Option::None,
1659            })
1660        }
1661
1662        /// Sets the value of [strategy][crate::model::fleet_package::VariantSelector::strategy]
1663        /// to hold a `VariantNameTemplate`.
1664        ///
1665        /// Note that all the setters affecting `strategy` are
1666        /// mutually exclusive.
1667        ///
1668        /// # Example
1669        /// ```ignore,no_run
1670        /// # use google_cloud_configdelivery_v1::model::fleet_package::VariantSelector;
1671        /// let x = VariantSelector::new().set_variant_name_template("example");
1672        /// assert!(x.variant_name_template().is_some());
1673        /// ```
1674        pub fn set_variant_name_template<T: std::convert::Into<std::string::String>>(
1675            mut self,
1676            v: T,
1677        ) -> Self {
1678            self.strategy = std::option::Option::Some(
1679                crate::model::fleet_package::variant_selector::Strategy::VariantNameTemplate(
1680                    v.into(),
1681                ),
1682            );
1683            self
1684        }
1685    }
1686
1687    impl wkt::message::Message for VariantSelector {
1688        fn typename() -> &'static str {
1689            "type.googleapis.com/google.cloud.configdelivery.v1.FleetPackage.VariantSelector"
1690        }
1691    }
1692
1693    /// Defines additional types related to [VariantSelector].
1694    pub mod variant_selector {
1695        #[allow(unused_imports)]
1696        use super::*;
1697
1698        /// strategy for selecting a variant.
1699        #[derive(Clone, Debug, PartialEq)]
1700        #[non_exhaustive]
1701        pub enum Strategy {
1702            /// Required. variant_name_template is a template that can refer to
1703            /// variables containing cluster membership metadata such as location,
1704            /// name, and labels to generate the name of the variant for a target
1705            /// cluster. The variable syntax is similar to the unix shell variables.
1706            ///
1707            /// Available variables are `${membership.name}`, `${membership.location}`,
1708            /// `${membership.project}` and `${membership.labels['label_name']}`.
1709            ///
1710            /// If you want to deploy a specific variant, say "default" to all the
1711            /// clusters, you can use "default" (string without any variables) as
1712            /// the variant_name_template.
1713            VariantNameTemplate(std::string::String),
1714        }
1715    }
1716
1717    /// State indicates the desired state for the fleet package.
1718    /// Unspecified value is equivalent to `ACTIVE`. If state is set to
1719    /// `SUSPENDED`, active rollout (if any) will continue but no new rollouts will
1720    /// be scheduled.
1721    ///
1722    /// # Working with unknown values
1723    ///
1724    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1725    /// additional enum variants at any time. Adding new variants is not considered
1726    /// a breaking change. Applications should write their code in anticipation of:
1727    ///
1728    /// - New values appearing in future releases of the client library, **and**
1729    /// - New values received dynamically, without application changes.
1730    ///
1731    /// Please consult the [Working with enums] section in the user guide for some
1732    /// guidelines.
1733    ///
1734    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
1735    #[derive(Clone, Debug, PartialEq)]
1736    #[non_exhaustive]
1737    pub enum State {
1738        /// Unspecified state.
1739        Unspecified,
1740        /// `FleetPackage` is intended to be active.
1741        Active,
1742        /// `FleetPackage` is intended to be suspended.
1743        Suspended,
1744        /// If set, the enum was initialized with an unknown value.
1745        ///
1746        /// Applications can examine the value using [State::value] or
1747        /// [State::name].
1748        UnknownValue(state::UnknownValue),
1749    }
1750
1751    #[doc(hidden)]
1752    pub mod state {
1753        #[allow(unused_imports)]
1754        use super::*;
1755        #[derive(Clone, Debug, PartialEq)]
1756        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1757    }
1758
1759    impl State {
1760        /// Gets the enum value.
1761        ///
1762        /// Returns `None` if the enum contains an unknown value deserialized from
1763        /// the string representation of enums.
1764        pub fn value(&self) -> std::option::Option<i32> {
1765            match self {
1766                Self::Unspecified => std::option::Option::Some(0),
1767                Self::Active => std::option::Option::Some(1),
1768                Self::Suspended => std::option::Option::Some(2),
1769                Self::UnknownValue(u) => u.0.value(),
1770            }
1771        }
1772
1773        /// Gets the enum value as a string.
1774        ///
1775        /// Returns `None` if the enum contains an unknown value deserialized from
1776        /// the integer representation of enums.
1777        pub fn name(&self) -> std::option::Option<&str> {
1778            match self {
1779                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
1780                Self::Active => std::option::Option::Some("ACTIVE"),
1781                Self::Suspended => std::option::Option::Some("SUSPENDED"),
1782                Self::UnknownValue(u) => u.0.name(),
1783            }
1784        }
1785    }
1786
1787    impl std::default::Default for State {
1788        fn default() -> Self {
1789            use std::convert::From;
1790            Self::from(0)
1791        }
1792    }
1793
1794    impl std::fmt::Display for State {
1795        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1796            wkt::internal::display_enum(f, self.name(), self.value())
1797        }
1798    }
1799
1800    impl std::convert::From<i32> for State {
1801        fn from(value: i32) -> Self {
1802            match value {
1803                0 => Self::Unspecified,
1804                1 => Self::Active,
1805                2 => Self::Suspended,
1806                _ => Self::UnknownValue(state::UnknownValue(
1807                    wkt::internal::UnknownEnumValue::Integer(value),
1808                )),
1809            }
1810        }
1811    }
1812
1813    impl std::convert::From<&str> for State {
1814        fn from(value: &str) -> Self {
1815            use std::string::ToString;
1816            match value {
1817                "STATE_UNSPECIFIED" => Self::Unspecified,
1818                "ACTIVE" => Self::Active,
1819                "SUSPENDED" => Self::Suspended,
1820                _ => Self::UnknownValue(state::UnknownValue(
1821                    wkt::internal::UnknownEnumValue::String(value.to_string()),
1822                )),
1823            }
1824        }
1825    }
1826
1827    impl serde::ser::Serialize for State {
1828        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1829        where
1830            S: serde::Serializer,
1831        {
1832            match self {
1833                Self::Unspecified => serializer.serialize_i32(0),
1834                Self::Active => serializer.serialize_i32(1),
1835                Self::Suspended => serializer.serialize_i32(2),
1836                Self::UnknownValue(u) => u.0.serialize(serializer),
1837            }
1838        }
1839    }
1840
1841    impl<'de> serde::de::Deserialize<'de> for State {
1842        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1843        where
1844            D: serde::Deserializer<'de>,
1845        {
1846            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
1847                ".google.cloud.configdelivery.v1.FleetPackage.State",
1848            ))
1849        }
1850    }
1851}
1852
1853/// FleetPackageInfo represents the status of the `FleetPackage` across all the
1854/// target clusters.
1855#[derive(Clone, Default, PartialEq)]
1856#[non_exhaustive]
1857pub struct FleetPackageInfo {
1858    /// Optional. The active rollout, if any. Format is
1859    /// `projects/{project}/locations/{location}/fleetPackages/{fleet_package}/rollouts/{rollout}`.
1860    pub active_rollout: std::string::String,
1861
1862    /// Optional. The last completed rollout, if any. Format is
1863    /// `projects/{project}/locations/{location}/fleetPackages/{fleet_package}/rollouts/{rollout}`.
1864    pub last_completed_rollout: std::string::String,
1865
1866    /// Optional. Output only. The current state of the `FleetPackage`.
1867    pub state: crate::model::fleet_package_info::State,
1868
1869    /// Optional. Output only. Errors encountered during configuration deployment
1870    /// (if any).
1871    pub errors: std::vec::Vec<crate::model::FleetPackageError>,
1872
1873    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1874}
1875
1876impl FleetPackageInfo {
1877    /// Creates a new default instance.
1878    pub fn new() -> Self {
1879        std::default::Default::default()
1880    }
1881
1882    /// Sets the value of [active_rollout][crate::model::FleetPackageInfo::active_rollout].
1883    ///
1884    /// # Example
1885    /// ```ignore,no_run
1886    /// # use google_cloud_configdelivery_v1::model::FleetPackageInfo;
1887    /// # let project_id = "project_id";
1888    /// # let location_id = "location_id";
1889    /// # let fleet_package_id = "fleet_package_id";
1890    /// # let rollout_id = "rollout_id";
1891    /// let x = FleetPackageInfo::new().set_active_rollout(format!("projects/{project_id}/locations/{location_id}/fleetPackages/{fleet_package_id}/rollouts/{rollout_id}"));
1892    /// ```
1893    pub fn set_active_rollout<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1894        self.active_rollout = v.into();
1895        self
1896    }
1897
1898    /// Sets the value of [last_completed_rollout][crate::model::FleetPackageInfo::last_completed_rollout].
1899    ///
1900    /// # Example
1901    /// ```ignore,no_run
1902    /// # use google_cloud_configdelivery_v1::model::FleetPackageInfo;
1903    /// # let project_id = "project_id";
1904    /// # let location_id = "location_id";
1905    /// # let fleet_package_id = "fleet_package_id";
1906    /// # let rollout_id = "rollout_id";
1907    /// let x = FleetPackageInfo::new().set_last_completed_rollout(format!("projects/{project_id}/locations/{location_id}/fleetPackages/{fleet_package_id}/rollouts/{rollout_id}"));
1908    /// ```
1909    pub fn set_last_completed_rollout<T: std::convert::Into<std::string::String>>(
1910        mut self,
1911        v: T,
1912    ) -> Self {
1913        self.last_completed_rollout = v.into();
1914        self
1915    }
1916
1917    /// Sets the value of [state][crate::model::FleetPackageInfo::state].
1918    ///
1919    /// # Example
1920    /// ```ignore,no_run
1921    /// # use google_cloud_configdelivery_v1::model::FleetPackageInfo;
1922    /// use google_cloud_configdelivery_v1::model::fleet_package_info::State;
1923    /// let x0 = FleetPackageInfo::new().set_state(State::Active);
1924    /// let x1 = FleetPackageInfo::new().set_state(State::Suspended);
1925    /// let x2 = FleetPackageInfo::new().set_state(State::Failed);
1926    /// ```
1927    pub fn set_state<T: std::convert::Into<crate::model::fleet_package_info::State>>(
1928        mut self,
1929        v: T,
1930    ) -> Self {
1931        self.state = v.into();
1932        self
1933    }
1934
1935    /// Sets the value of [errors][crate::model::FleetPackageInfo::errors].
1936    ///
1937    /// # Example
1938    /// ```ignore,no_run
1939    /// # use google_cloud_configdelivery_v1::model::FleetPackageInfo;
1940    /// use google_cloud_configdelivery_v1::model::FleetPackageError;
1941    /// let x = FleetPackageInfo::new()
1942    ///     .set_errors([
1943    ///         FleetPackageError::default()/* use setters */,
1944    ///         FleetPackageError::default()/* use (different) setters */,
1945    ///     ]);
1946    /// ```
1947    pub fn set_errors<T, V>(mut self, v: T) -> Self
1948    where
1949        T: std::iter::IntoIterator<Item = V>,
1950        V: std::convert::Into<crate::model::FleetPackageError>,
1951    {
1952        use std::iter::Iterator;
1953        self.errors = v.into_iter().map(|i| i.into()).collect();
1954        self
1955    }
1956}
1957
1958impl wkt::message::Message for FleetPackageInfo {
1959    fn typename() -> &'static str {
1960        "type.googleapis.com/google.cloud.configdelivery.v1.FleetPackageInfo"
1961    }
1962}
1963
1964/// Defines additional types related to [FleetPackageInfo].
1965pub mod fleet_package_info {
1966    #[allow(unused_imports)]
1967    use super::*;
1968
1969    /// Possible values for the `FleetPackage` state.
1970    ///
1971    /// # Working with unknown values
1972    ///
1973    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1974    /// additional enum variants at any time. Adding new variants is not considered
1975    /// a breaking change. Applications should write their code in anticipation of:
1976    ///
1977    /// - New values appearing in future releases of the client library, **and**
1978    /// - New values received dynamically, without application changes.
1979    ///
1980    /// Please consult the [Working with enums] section in the user guide for some
1981    /// guidelines.
1982    ///
1983    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
1984    #[derive(Clone, Debug, PartialEq)]
1985    #[non_exhaustive]
1986    pub enum State {
1987        /// Unspecified state.
1988        Unspecified,
1989        /// `FleetPackage` is active.
1990        Active,
1991        /// `FleetPackage` is suspended.
1992        Suspended,
1993        /// `FleetPackage` has failed to reconcile.
1994        Failed,
1995        /// `FleetPackage` is being deleted.
1996        Deleting,
1997        /// If set, the enum was initialized with an unknown value.
1998        ///
1999        /// Applications can examine the value using [State::value] or
2000        /// [State::name].
2001        UnknownValue(state::UnknownValue),
2002    }
2003
2004    #[doc(hidden)]
2005    pub mod state {
2006        #[allow(unused_imports)]
2007        use super::*;
2008        #[derive(Clone, Debug, PartialEq)]
2009        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2010    }
2011
2012    impl State {
2013        /// Gets the enum value.
2014        ///
2015        /// Returns `None` if the enum contains an unknown value deserialized from
2016        /// the string representation of enums.
2017        pub fn value(&self) -> std::option::Option<i32> {
2018            match self {
2019                Self::Unspecified => std::option::Option::Some(0),
2020                Self::Active => std::option::Option::Some(1),
2021                Self::Suspended => std::option::Option::Some(2),
2022                Self::Failed => std::option::Option::Some(3),
2023                Self::Deleting => std::option::Option::Some(4),
2024                Self::UnknownValue(u) => u.0.value(),
2025            }
2026        }
2027
2028        /// Gets the enum value as a string.
2029        ///
2030        /// Returns `None` if the enum contains an unknown value deserialized from
2031        /// the integer representation of enums.
2032        pub fn name(&self) -> std::option::Option<&str> {
2033            match self {
2034                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
2035                Self::Active => std::option::Option::Some("ACTIVE"),
2036                Self::Suspended => std::option::Option::Some("SUSPENDED"),
2037                Self::Failed => std::option::Option::Some("FAILED"),
2038                Self::Deleting => std::option::Option::Some("DELETING"),
2039                Self::UnknownValue(u) => u.0.name(),
2040            }
2041        }
2042    }
2043
2044    impl std::default::Default for State {
2045        fn default() -> Self {
2046            use std::convert::From;
2047            Self::from(0)
2048        }
2049    }
2050
2051    impl std::fmt::Display for State {
2052        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2053            wkt::internal::display_enum(f, self.name(), self.value())
2054        }
2055    }
2056
2057    impl std::convert::From<i32> for State {
2058        fn from(value: i32) -> Self {
2059            match value {
2060                0 => Self::Unspecified,
2061                1 => Self::Active,
2062                2 => Self::Suspended,
2063                3 => Self::Failed,
2064                4 => Self::Deleting,
2065                _ => Self::UnknownValue(state::UnknownValue(
2066                    wkt::internal::UnknownEnumValue::Integer(value),
2067                )),
2068            }
2069        }
2070    }
2071
2072    impl std::convert::From<&str> for State {
2073        fn from(value: &str) -> Self {
2074            use std::string::ToString;
2075            match value {
2076                "STATE_UNSPECIFIED" => Self::Unspecified,
2077                "ACTIVE" => Self::Active,
2078                "SUSPENDED" => Self::Suspended,
2079                "FAILED" => Self::Failed,
2080                "DELETING" => Self::Deleting,
2081                _ => Self::UnknownValue(state::UnknownValue(
2082                    wkt::internal::UnknownEnumValue::String(value.to_string()),
2083                )),
2084            }
2085        }
2086    }
2087
2088    impl serde::ser::Serialize for State {
2089        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2090        where
2091            S: serde::Serializer,
2092        {
2093            match self {
2094                Self::Unspecified => serializer.serialize_i32(0),
2095                Self::Active => serializer.serialize_i32(1),
2096                Self::Suspended => serializer.serialize_i32(2),
2097                Self::Failed => serializer.serialize_i32(3),
2098                Self::Deleting => serializer.serialize_i32(4),
2099                Self::UnknownValue(u) => u.0.serialize(serializer),
2100            }
2101        }
2102    }
2103
2104    impl<'de> serde::de::Deserialize<'de> for State {
2105        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2106        where
2107            D: serde::Deserializer<'de>,
2108        {
2109            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
2110                ".google.cloud.configdelivery.v1.FleetPackageInfo.State",
2111            ))
2112        }
2113    }
2114}
2115
2116/// Information representing an error encountered during rolling out
2117/// configurations.
2118#[derive(Clone, Default, PartialEq)]
2119#[non_exhaustive]
2120pub struct FleetPackageError {
2121    /// Optional. A description of the error.
2122    pub error_message: std::string::String,
2123
2124    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2125}
2126
2127impl FleetPackageError {
2128    /// Creates a new default instance.
2129    pub fn new() -> Self {
2130        std::default::Default::default()
2131    }
2132
2133    /// Sets the value of [error_message][crate::model::FleetPackageError::error_message].
2134    ///
2135    /// # Example
2136    /// ```ignore,no_run
2137    /// # use google_cloud_configdelivery_v1::model::FleetPackageError;
2138    /// let x = FleetPackageError::new().set_error_message("example");
2139    /// ```
2140    pub fn set_error_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2141        self.error_message = v.into();
2142        self
2143    }
2144}
2145
2146impl wkt::message::Message for FleetPackageError {
2147    fn typename() -> &'static str {
2148        "type.googleapis.com/google.cloud.configdelivery.v1.FleetPackageError"
2149    }
2150}
2151
2152/// ClusterInfo represents status of a resource bundle rollout for a cluster.
2153#[derive(Clone, Default, PartialEq)]
2154#[non_exhaustive]
2155pub struct ClusterInfo {
2156    /// Output only. gkehub membership of target cluster
2157    pub membership: std::string::String,
2158
2159    /// Output only. Desired state for the resource bundle.
2160    pub desired: std::option::Option<crate::model::ResourceBundleDeploymentInfo>,
2161
2162    /// Output only. Initial state of the resource bundle prior to the deployment.
2163    pub initial: std::option::Option<crate::model::ResourceBundleDeploymentInfo>,
2164
2165    /// Output only. Current state of the resource bundle.
2166    pub current: std::option::Option<crate::model::ResourceBundleDeploymentInfo>,
2167
2168    /// Output only. State of the rollout for the cluster.
2169    pub state: crate::model::cluster_info::State,
2170
2171    /// Output only. Unordered list. Messages convey additional information related
2172    /// to the deployment.
2173    pub messages: std::vec::Vec<std::string::String>,
2174
2175    /// Output only. Timestamp when reconciliation starts.
2176    pub start_time: std::option::Option<wkt::Timestamp>,
2177
2178    /// Output only. Timestamp when reconciliation ends.
2179    pub end_time: std::option::Option<wkt::Timestamp>,
2180
2181    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2182}
2183
2184impl ClusterInfo {
2185    /// Creates a new default instance.
2186    pub fn new() -> Self {
2187        std::default::Default::default()
2188    }
2189
2190    /// Sets the value of [membership][crate::model::ClusterInfo::membership].
2191    ///
2192    /// # Example
2193    /// ```ignore,no_run
2194    /// # use google_cloud_configdelivery_v1::model::ClusterInfo;
2195    /// let x = ClusterInfo::new().set_membership("example");
2196    /// ```
2197    pub fn set_membership<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2198        self.membership = v.into();
2199        self
2200    }
2201
2202    /// Sets the value of [desired][crate::model::ClusterInfo::desired].
2203    ///
2204    /// # Example
2205    /// ```ignore,no_run
2206    /// # use google_cloud_configdelivery_v1::model::ClusterInfo;
2207    /// use google_cloud_configdelivery_v1::model::ResourceBundleDeploymentInfo;
2208    /// let x = ClusterInfo::new().set_desired(ResourceBundleDeploymentInfo::default()/* use setters */);
2209    /// ```
2210    pub fn set_desired<T>(mut self, v: T) -> Self
2211    where
2212        T: std::convert::Into<crate::model::ResourceBundleDeploymentInfo>,
2213    {
2214        self.desired = std::option::Option::Some(v.into());
2215        self
2216    }
2217
2218    /// Sets or clears the value of [desired][crate::model::ClusterInfo::desired].
2219    ///
2220    /// # Example
2221    /// ```ignore,no_run
2222    /// # use google_cloud_configdelivery_v1::model::ClusterInfo;
2223    /// use google_cloud_configdelivery_v1::model::ResourceBundleDeploymentInfo;
2224    /// let x = ClusterInfo::new().set_or_clear_desired(Some(ResourceBundleDeploymentInfo::default()/* use setters */));
2225    /// let x = ClusterInfo::new().set_or_clear_desired(None::<ResourceBundleDeploymentInfo>);
2226    /// ```
2227    pub fn set_or_clear_desired<T>(mut self, v: std::option::Option<T>) -> Self
2228    where
2229        T: std::convert::Into<crate::model::ResourceBundleDeploymentInfo>,
2230    {
2231        self.desired = v.map(|x| x.into());
2232        self
2233    }
2234
2235    /// Sets the value of [initial][crate::model::ClusterInfo::initial].
2236    ///
2237    /// # Example
2238    /// ```ignore,no_run
2239    /// # use google_cloud_configdelivery_v1::model::ClusterInfo;
2240    /// use google_cloud_configdelivery_v1::model::ResourceBundleDeploymentInfo;
2241    /// let x = ClusterInfo::new().set_initial(ResourceBundleDeploymentInfo::default()/* use setters */);
2242    /// ```
2243    pub fn set_initial<T>(mut self, v: T) -> Self
2244    where
2245        T: std::convert::Into<crate::model::ResourceBundleDeploymentInfo>,
2246    {
2247        self.initial = std::option::Option::Some(v.into());
2248        self
2249    }
2250
2251    /// Sets or clears the value of [initial][crate::model::ClusterInfo::initial].
2252    ///
2253    /// # Example
2254    /// ```ignore,no_run
2255    /// # use google_cloud_configdelivery_v1::model::ClusterInfo;
2256    /// use google_cloud_configdelivery_v1::model::ResourceBundleDeploymentInfo;
2257    /// let x = ClusterInfo::new().set_or_clear_initial(Some(ResourceBundleDeploymentInfo::default()/* use setters */));
2258    /// let x = ClusterInfo::new().set_or_clear_initial(None::<ResourceBundleDeploymentInfo>);
2259    /// ```
2260    pub fn set_or_clear_initial<T>(mut self, v: std::option::Option<T>) -> Self
2261    where
2262        T: std::convert::Into<crate::model::ResourceBundleDeploymentInfo>,
2263    {
2264        self.initial = v.map(|x| x.into());
2265        self
2266    }
2267
2268    /// Sets the value of [current][crate::model::ClusterInfo::current].
2269    ///
2270    /// # Example
2271    /// ```ignore,no_run
2272    /// # use google_cloud_configdelivery_v1::model::ClusterInfo;
2273    /// use google_cloud_configdelivery_v1::model::ResourceBundleDeploymentInfo;
2274    /// let x = ClusterInfo::new().set_current(ResourceBundleDeploymentInfo::default()/* use setters */);
2275    /// ```
2276    pub fn set_current<T>(mut self, v: T) -> Self
2277    where
2278        T: std::convert::Into<crate::model::ResourceBundleDeploymentInfo>,
2279    {
2280        self.current = std::option::Option::Some(v.into());
2281        self
2282    }
2283
2284    /// Sets or clears the value of [current][crate::model::ClusterInfo::current].
2285    ///
2286    /// # Example
2287    /// ```ignore,no_run
2288    /// # use google_cloud_configdelivery_v1::model::ClusterInfo;
2289    /// use google_cloud_configdelivery_v1::model::ResourceBundleDeploymentInfo;
2290    /// let x = ClusterInfo::new().set_or_clear_current(Some(ResourceBundleDeploymentInfo::default()/* use setters */));
2291    /// let x = ClusterInfo::new().set_or_clear_current(None::<ResourceBundleDeploymentInfo>);
2292    /// ```
2293    pub fn set_or_clear_current<T>(mut self, v: std::option::Option<T>) -> Self
2294    where
2295        T: std::convert::Into<crate::model::ResourceBundleDeploymentInfo>,
2296    {
2297        self.current = v.map(|x| x.into());
2298        self
2299    }
2300
2301    /// Sets the value of [state][crate::model::ClusterInfo::state].
2302    ///
2303    /// # Example
2304    /// ```ignore,no_run
2305    /// # use google_cloud_configdelivery_v1::model::ClusterInfo;
2306    /// use google_cloud_configdelivery_v1::model::cluster_info::State;
2307    /// let x0 = ClusterInfo::new().set_state(State::Waiting);
2308    /// let x1 = ClusterInfo::new().set_state(State::InProgress);
2309    /// let x2 = ClusterInfo::new().set_state(State::Stalled);
2310    /// ```
2311    pub fn set_state<T: std::convert::Into<crate::model::cluster_info::State>>(
2312        mut self,
2313        v: T,
2314    ) -> Self {
2315        self.state = v.into();
2316        self
2317    }
2318
2319    /// Sets the value of [messages][crate::model::ClusterInfo::messages].
2320    ///
2321    /// # Example
2322    /// ```ignore,no_run
2323    /// # use google_cloud_configdelivery_v1::model::ClusterInfo;
2324    /// let x = ClusterInfo::new().set_messages(["a", "b", "c"]);
2325    /// ```
2326    pub fn set_messages<T, V>(mut self, v: T) -> Self
2327    where
2328        T: std::iter::IntoIterator<Item = V>,
2329        V: std::convert::Into<std::string::String>,
2330    {
2331        use std::iter::Iterator;
2332        self.messages = v.into_iter().map(|i| i.into()).collect();
2333        self
2334    }
2335
2336    /// Sets the value of [start_time][crate::model::ClusterInfo::start_time].
2337    ///
2338    /// # Example
2339    /// ```ignore,no_run
2340    /// # use google_cloud_configdelivery_v1::model::ClusterInfo;
2341    /// use wkt::Timestamp;
2342    /// let x = ClusterInfo::new().set_start_time(Timestamp::default()/* use setters */);
2343    /// ```
2344    pub fn set_start_time<T>(mut self, v: T) -> Self
2345    where
2346        T: std::convert::Into<wkt::Timestamp>,
2347    {
2348        self.start_time = std::option::Option::Some(v.into());
2349        self
2350    }
2351
2352    /// Sets or clears the value of [start_time][crate::model::ClusterInfo::start_time].
2353    ///
2354    /// # Example
2355    /// ```ignore,no_run
2356    /// # use google_cloud_configdelivery_v1::model::ClusterInfo;
2357    /// use wkt::Timestamp;
2358    /// let x = ClusterInfo::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
2359    /// let x = ClusterInfo::new().set_or_clear_start_time(None::<Timestamp>);
2360    /// ```
2361    pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
2362    where
2363        T: std::convert::Into<wkt::Timestamp>,
2364    {
2365        self.start_time = v.map(|x| x.into());
2366        self
2367    }
2368
2369    /// Sets the value of [end_time][crate::model::ClusterInfo::end_time].
2370    ///
2371    /// # Example
2372    /// ```ignore,no_run
2373    /// # use google_cloud_configdelivery_v1::model::ClusterInfo;
2374    /// use wkt::Timestamp;
2375    /// let x = ClusterInfo::new().set_end_time(Timestamp::default()/* use setters */);
2376    /// ```
2377    pub fn set_end_time<T>(mut self, v: T) -> Self
2378    where
2379        T: std::convert::Into<wkt::Timestamp>,
2380    {
2381        self.end_time = std::option::Option::Some(v.into());
2382        self
2383    }
2384
2385    /// Sets or clears the value of [end_time][crate::model::ClusterInfo::end_time].
2386    ///
2387    /// # Example
2388    /// ```ignore,no_run
2389    /// # use google_cloud_configdelivery_v1::model::ClusterInfo;
2390    /// use wkt::Timestamp;
2391    /// let x = ClusterInfo::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
2392    /// let x = ClusterInfo::new().set_or_clear_end_time(None::<Timestamp>);
2393    /// ```
2394    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
2395    where
2396        T: std::convert::Into<wkt::Timestamp>,
2397    {
2398        self.end_time = v.map(|x| x.into());
2399        self
2400    }
2401}
2402
2403impl wkt::message::Message for ClusterInfo {
2404    fn typename() -> &'static str {
2405        "type.googleapis.com/google.cloud.configdelivery.v1.ClusterInfo"
2406    }
2407}
2408
2409/// Defines additional types related to [ClusterInfo].
2410pub mod cluster_info {
2411    #[allow(unused_imports)]
2412    use super::*;
2413
2414    /// State of the rollout for the cluster.
2415    ///
2416    /// # Working with unknown values
2417    ///
2418    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2419    /// additional enum variants at any time. Adding new variants is not considered
2420    /// a breaking change. Applications should write their code in anticipation of:
2421    ///
2422    /// - New values appearing in future releases of the client library, **and**
2423    /// - New values received dynamically, without application changes.
2424    ///
2425    /// Please consult the [Working with enums] section in the user guide for some
2426    /// guidelines.
2427    ///
2428    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
2429    #[derive(Clone, Debug, PartialEq)]
2430    #[non_exhaustive]
2431    pub enum State {
2432        /// Unspecified state.
2433        Unspecified,
2434        /// Waiting state.
2435        Waiting,
2436        /// In progress state.
2437        InProgress,
2438        /// Stalled state.
2439        Stalled,
2440        /// Completed state.
2441        Completed,
2442        /// Aborted state.
2443        Aborted,
2444        /// Cancelled state.
2445        Cancelled,
2446        /// Error state.
2447        Error,
2448        /// Unchanged state.
2449        Unchanged,
2450        /// Skipped state.
2451        Skipped,
2452        /// If set, the enum was initialized with an unknown value.
2453        ///
2454        /// Applications can examine the value using [State::value] or
2455        /// [State::name].
2456        UnknownValue(state::UnknownValue),
2457    }
2458
2459    #[doc(hidden)]
2460    pub mod state {
2461        #[allow(unused_imports)]
2462        use super::*;
2463        #[derive(Clone, Debug, PartialEq)]
2464        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2465    }
2466
2467    impl State {
2468        /// Gets the enum value.
2469        ///
2470        /// Returns `None` if the enum contains an unknown value deserialized from
2471        /// the string representation of enums.
2472        pub fn value(&self) -> std::option::Option<i32> {
2473            match self {
2474                Self::Unspecified => std::option::Option::Some(0),
2475                Self::Waiting => std::option::Option::Some(1),
2476                Self::InProgress => std::option::Option::Some(2),
2477                Self::Stalled => std::option::Option::Some(3),
2478                Self::Completed => std::option::Option::Some(4),
2479                Self::Aborted => std::option::Option::Some(5),
2480                Self::Cancelled => std::option::Option::Some(6),
2481                Self::Error => std::option::Option::Some(7),
2482                Self::Unchanged => std::option::Option::Some(8),
2483                Self::Skipped => std::option::Option::Some(9),
2484                Self::UnknownValue(u) => u.0.value(),
2485            }
2486        }
2487
2488        /// Gets the enum value as a string.
2489        ///
2490        /// Returns `None` if the enum contains an unknown value deserialized from
2491        /// the integer representation of enums.
2492        pub fn name(&self) -> std::option::Option<&str> {
2493            match self {
2494                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
2495                Self::Waiting => std::option::Option::Some("WAITING"),
2496                Self::InProgress => std::option::Option::Some("IN_PROGRESS"),
2497                Self::Stalled => std::option::Option::Some("STALLED"),
2498                Self::Completed => std::option::Option::Some("COMPLETED"),
2499                Self::Aborted => std::option::Option::Some("ABORTED"),
2500                Self::Cancelled => std::option::Option::Some("CANCELLED"),
2501                Self::Error => std::option::Option::Some("ERROR"),
2502                Self::Unchanged => std::option::Option::Some("UNCHANGED"),
2503                Self::Skipped => std::option::Option::Some("SKIPPED"),
2504                Self::UnknownValue(u) => u.0.name(),
2505            }
2506        }
2507    }
2508
2509    impl std::default::Default for State {
2510        fn default() -> Self {
2511            use std::convert::From;
2512            Self::from(0)
2513        }
2514    }
2515
2516    impl std::fmt::Display for State {
2517        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2518            wkt::internal::display_enum(f, self.name(), self.value())
2519        }
2520    }
2521
2522    impl std::convert::From<i32> for State {
2523        fn from(value: i32) -> Self {
2524            match value {
2525                0 => Self::Unspecified,
2526                1 => Self::Waiting,
2527                2 => Self::InProgress,
2528                3 => Self::Stalled,
2529                4 => Self::Completed,
2530                5 => Self::Aborted,
2531                6 => Self::Cancelled,
2532                7 => Self::Error,
2533                8 => Self::Unchanged,
2534                9 => Self::Skipped,
2535                _ => Self::UnknownValue(state::UnknownValue(
2536                    wkt::internal::UnknownEnumValue::Integer(value),
2537                )),
2538            }
2539        }
2540    }
2541
2542    impl std::convert::From<&str> for State {
2543        fn from(value: &str) -> Self {
2544            use std::string::ToString;
2545            match value {
2546                "STATE_UNSPECIFIED" => Self::Unspecified,
2547                "WAITING" => Self::Waiting,
2548                "IN_PROGRESS" => Self::InProgress,
2549                "STALLED" => Self::Stalled,
2550                "COMPLETED" => Self::Completed,
2551                "ABORTED" => Self::Aborted,
2552                "CANCELLED" => Self::Cancelled,
2553                "ERROR" => Self::Error,
2554                "UNCHANGED" => Self::Unchanged,
2555                "SKIPPED" => Self::Skipped,
2556                _ => Self::UnknownValue(state::UnknownValue(
2557                    wkt::internal::UnknownEnumValue::String(value.to_string()),
2558                )),
2559            }
2560        }
2561    }
2562
2563    impl serde::ser::Serialize for State {
2564        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2565        where
2566            S: serde::Serializer,
2567        {
2568            match self {
2569                Self::Unspecified => serializer.serialize_i32(0),
2570                Self::Waiting => serializer.serialize_i32(1),
2571                Self::InProgress => serializer.serialize_i32(2),
2572                Self::Stalled => serializer.serialize_i32(3),
2573                Self::Completed => serializer.serialize_i32(4),
2574                Self::Aborted => serializer.serialize_i32(5),
2575                Self::Cancelled => serializer.serialize_i32(6),
2576                Self::Error => serializer.serialize_i32(7),
2577                Self::Unchanged => serializer.serialize_i32(8),
2578                Self::Skipped => serializer.serialize_i32(9),
2579                Self::UnknownValue(u) => u.0.serialize(serializer),
2580            }
2581        }
2582    }
2583
2584    impl<'de> serde::de::Deserialize<'de> for State {
2585        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2586        where
2587            D: serde::Deserializer<'de>,
2588        {
2589            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
2590                ".google.cloud.configdelivery.v1.ClusterInfo.State",
2591            ))
2592        }
2593    }
2594}
2595
2596/// ResourceBundleDeploymentInfo represents the status of a resource bundle
2597/// deployment.
2598#[derive(Clone, Default, PartialEq)]
2599#[non_exhaustive]
2600pub struct ResourceBundleDeploymentInfo {
2601    /// Output only. Refers to a `ResourceBundle` release.
2602    pub release: std::string::String,
2603
2604    /// Output only. Refers to a version of the `ResourceBundle` release.
2605    pub version: std::string::String,
2606
2607    /// Output only. Refers to a variant in a `ResourceBundle` release.
2608    pub variant: std::string::String,
2609
2610    /// Output only. Synchronization state of the `ResourceBundle` deployment.
2611    pub sync_state: crate::model::resource_bundle_deployment_info::SyncState,
2612
2613    /// Output only. Unordered list. Messages contains information related to the
2614    /// `ResourceBundle` deployment. For example, in case of an error, indicate the
2615    /// reason for the error. In case of a pending deployment, reason for why the
2616    /// deployment of new release is pending.
2617    pub messages: std::vec::Vec<std::string::String>,
2618
2619    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2620}
2621
2622impl ResourceBundleDeploymentInfo {
2623    /// Creates a new default instance.
2624    pub fn new() -> Self {
2625        std::default::Default::default()
2626    }
2627
2628    /// Sets the value of [release][crate::model::ResourceBundleDeploymentInfo::release].
2629    ///
2630    /// # Example
2631    /// ```ignore,no_run
2632    /// # use google_cloud_configdelivery_v1::model::ResourceBundleDeploymentInfo;
2633    /// # let project_id = "project_id";
2634    /// # let location_id = "location_id";
2635    /// # let resource_bundle_id = "resource_bundle_id";
2636    /// # let release_id = "release_id";
2637    /// let x = ResourceBundleDeploymentInfo::new().set_release(format!("projects/{project_id}/locations/{location_id}/resourceBundles/{resource_bundle_id}/releases/{release_id}"));
2638    /// ```
2639    pub fn set_release<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2640        self.release = v.into();
2641        self
2642    }
2643
2644    /// Sets the value of [version][crate::model::ResourceBundleDeploymentInfo::version].
2645    ///
2646    /// # Example
2647    /// ```ignore,no_run
2648    /// # use google_cloud_configdelivery_v1::model::ResourceBundleDeploymentInfo;
2649    /// let x = ResourceBundleDeploymentInfo::new().set_version("example");
2650    /// ```
2651    pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2652        self.version = v.into();
2653        self
2654    }
2655
2656    /// Sets the value of [variant][crate::model::ResourceBundleDeploymentInfo::variant].
2657    ///
2658    /// # Example
2659    /// ```ignore,no_run
2660    /// # use google_cloud_configdelivery_v1::model::ResourceBundleDeploymentInfo;
2661    /// let x = ResourceBundleDeploymentInfo::new().set_variant("example");
2662    /// ```
2663    pub fn set_variant<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2664        self.variant = v.into();
2665        self
2666    }
2667
2668    /// Sets the value of [sync_state][crate::model::ResourceBundleDeploymentInfo::sync_state].
2669    ///
2670    /// # Example
2671    /// ```ignore,no_run
2672    /// # use google_cloud_configdelivery_v1::model::ResourceBundleDeploymentInfo;
2673    /// use google_cloud_configdelivery_v1::model::resource_bundle_deployment_info::SyncState;
2674    /// let x0 = ResourceBundleDeploymentInfo::new().set_sync_state(SyncState::Reconciling);
2675    /// let x1 = ResourceBundleDeploymentInfo::new().set_sync_state(SyncState::Stalled);
2676    /// let x2 = ResourceBundleDeploymentInfo::new().set_sync_state(SyncState::Synced);
2677    /// ```
2678    pub fn set_sync_state<
2679        T: std::convert::Into<crate::model::resource_bundle_deployment_info::SyncState>,
2680    >(
2681        mut self,
2682        v: T,
2683    ) -> Self {
2684        self.sync_state = v.into();
2685        self
2686    }
2687
2688    /// Sets the value of [messages][crate::model::ResourceBundleDeploymentInfo::messages].
2689    ///
2690    /// # Example
2691    /// ```ignore,no_run
2692    /// # use google_cloud_configdelivery_v1::model::ResourceBundleDeploymentInfo;
2693    /// let x = ResourceBundleDeploymentInfo::new().set_messages(["a", "b", "c"]);
2694    /// ```
2695    pub fn set_messages<T, V>(mut self, v: T) -> Self
2696    where
2697        T: std::iter::IntoIterator<Item = V>,
2698        V: std::convert::Into<std::string::String>,
2699    {
2700        use std::iter::Iterator;
2701        self.messages = v.into_iter().map(|i| i.into()).collect();
2702        self
2703    }
2704}
2705
2706impl wkt::message::Message for ResourceBundleDeploymentInfo {
2707    fn typename() -> &'static str {
2708        "type.googleapis.com/google.cloud.configdelivery.v1.ResourceBundleDeploymentInfo"
2709    }
2710}
2711
2712/// Defines additional types related to [ResourceBundleDeploymentInfo].
2713pub mod resource_bundle_deployment_info {
2714    #[allow(unused_imports)]
2715    use super::*;
2716
2717    /// Synchronization state of the resource bundle deployment.
2718    ///
2719    /// # Working with unknown values
2720    ///
2721    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2722    /// additional enum variants at any time. Adding new variants is not considered
2723    /// a breaking change. Applications should write their code in anticipation of:
2724    ///
2725    /// - New values appearing in future releases of the client library, **and**
2726    /// - New values received dynamically, without application changes.
2727    ///
2728    /// Please consult the [Working with enums] section in the user guide for some
2729    /// guidelines.
2730    ///
2731    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
2732    #[derive(Clone, Debug, PartialEq)]
2733    #[non_exhaustive]
2734    pub enum SyncState {
2735        /// Unspecified state.
2736        Unspecified,
2737        /// Reconciling state.
2738        Reconciling,
2739        /// Stalled state.
2740        Stalled,
2741        /// Synced state.
2742        Synced,
2743        /// Pending state.
2744        Pending,
2745        /// Error state.
2746        Error,
2747        /// Deletion pending state.
2748        DeletionPending,
2749        /// Deleting state.
2750        Deleting,
2751        /// Deleted state.
2752        Deleted,
2753        /// If set, the enum was initialized with an unknown value.
2754        ///
2755        /// Applications can examine the value using [SyncState::value] or
2756        /// [SyncState::name].
2757        UnknownValue(sync_state::UnknownValue),
2758    }
2759
2760    #[doc(hidden)]
2761    pub mod sync_state {
2762        #[allow(unused_imports)]
2763        use super::*;
2764        #[derive(Clone, Debug, PartialEq)]
2765        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2766    }
2767
2768    impl SyncState {
2769        /// Gets the enum value.
2770        ///
2771        /// Returns `None` if the enum contains an unknown value deserialized from
2772        /// the string representation of enums.
2773        pub fn value(&self) -> std::option::Option<i32> {
2774            match self {
2775                Self::Unspecified => std::option::Option::Some(0),
2776                Self::Reconciling => std::option::Option::Some(1),
2777                Self::Stalled => std::option::Option::Some(2),
2778                Self::Synced => std::option::Option::Some(3),
2779                Self::Pending => std::option::Option::Some(4),
2780                Self::Error => std::option::Option::Some(5),
2781                Self::DeletionPending => std::option::Option::Some(6),
2782                Self::Deleting => std::option::Option::Some(7),
2783                Self::Deleted => std::option::Option::Some(8),
2784                Self::UnknownValue(u) => u.0.value(),
2785            }
2786        }
2787
2788        /// Gets the enum value as a string.
2789        ///
2790        /// Returns `None` if the enum contains an unknown value deserialized from
2791        /// the integer representation of enums.
2792        pub fn name(&self) -> std::option::Option<&str> {
2793            match self {
2794                Self::Unspecified => std::option::Option::Some("SYNC_STATE_UNSPECIFIED"),
2795                Self::Reconciling => std::option::Option::Some("RECONCILING"),
2796                Self::Stalled => std::option::Option::Some("STALLED"),
2797                Self::Synced => std::option::Option::Some("SYNCED"),
2798                Self::Pending => std::option::Option::Some("PENDING"),
2799                Self::Error => std::option::Option::Some("ERROR"),
2800                Self::DeletionPending => std::option::Option::Some("DELETION_PENDING"),
2801                Self::Deleting => std::option::Option::Some("DELETING"),
2802                Self::Deleted => std::option::Option::Some("DELETED"),
2803                Self::UnknownValue(u) => u.0.name(),
2804            }
2805        }
2806    }
2807
2808    impl std::default::Default for SyncState {
2809        fn default() -> Self {
2810            use std::convert::From;
2811            Self::from(0)
2812        }
2813    }
2814
2815    impl std::fmt::Display for SyncState {
2816        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2817            wkt::internal::display_enum(f, self.name(), self.value())
2818        }
2819    }
2820
2821    impl std::convert::From<i32> for SyncState {
2822        fn from(value: i32) -> Self {
2823            match value {
2824                0 => Self::Unspecified,
2825                1 => Self::Reconciling,
2826                2 => Self::Stalled,
2827                3 => Self::Synced,
2828                4 => Self::Pending,
2829                5 => Self::Error,
2830                6 => Self::DeletionPending,
2831                7 => Self::Deleting,
2832                8 => Self::Deleted,
2833                _ => Self::UnknownValue(sync_state::UnknownValue(
2834                    wkt::internal::UnknownEnumValue::Integer(value),
2835                )),
2836            }
2837        }
2838    }
2839
2840    impl std::convert::From<&str> for SyncState {
2841        fn from(value: &str) -> Self {
2842            use std::string::ToString;
2843            match value {
2844                "SYNC_STATE_UNSPECIFIED" => Self::Unspecified,
2845                "RECONCILING" => Self::Reconciling,
2846                "STALLED" => Self::Stalled,
2847                "SYNCED" => Self::Synced,
2848                "PENDING" => Self::Pending,
2849                "ERROR" => Self::Error,
2850                "DELETION_PENDING" => Self::DeletionPending,
2851                "DELETING" => Self::Deleting,
2852                "DELETED" => Self::Deleted,
2853                _ => Self::UnknownValue(sync_state::UnknownValue(
2854                    wkt::internal::UnknownEnumValue::String(value.to_string()),
2855                )),
2856            }
2857        }
2858    }
2859
2860    impl serde::ser::Serialize for SyncState {
2861        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2862        where
2863            S: serde::Serializer,
2864        {
2865            match self {
2866                Self::Unspecified => serializer.serialize_i32(0),
2867                Self::Reconciling => serializer.serialize_i32(1),
2868                Self::Stalled => serializer.serialize_i32(2),
2869                Self::Synced => serializer.serialize_i32(3),
2870                Self::Pending => serializer.serialize_i32(4),
2871                Self::Error => serializer.serialize_i32(5),
2872                Self::DeletionPending => serializer.serialize_i32(6),
2873                Self::Deleting => serializer.serialize_i32(7),
2874                Self::Deleted => serializer.serialize_i32(8),
2875                Self::UnknownValue(u) => u.0.serialize(serializer),
2876            }
2877        }
2878    }
2879
2880    impl<'de> serde::de::Deserialize<'de> for SyncState {
2881        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2882        where
2883            D: serde::Deserializer<'de>,
2884        {
2885            deserializer.deserialize_any(wkt::internal::EnumVisitor::<SyncState>::new(
2886                ".google.cloud.configdelivery.v1.ResourceBundleDeploymentInfo.SyncState",
2887            ))
2888        }
2889    }
2890}
2891
2892/// The fleet where the `FleetPackage` should be deployed.
2893#[derive(Clone, Default, PartialEq)]
2894#[non_exhaustive]
2895pub struct Fleet {
2896    /// Required. The host project for the GKE fleet. Format is
2897    /// `projects/{project}`.
2898    pub project: std::string::String,
2899
2900    /// Optional. selector allows targeting a subset of fleet members using their
2901    /// labels.
2902    pub selector: std::option::Option<crate::model::fleet::LabelSelector>,
2903
2904    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2905}
2906
2907impl Fleet {
2908    /// Creates a new default instance.
2909    pub fn new() -> Self {
2910        std::default::Default::default()
2911    }
2912
2913    /// Sets the value of [project][crate::model::Fleet::project].
2914    ///
2915    /// # Example
2916    /// ```ignore,no_run
2917    /// # use google_cloud_configdelivery_v1::model::Fleet;
2918    /// let x = Fleet::new().set_project("example");
2919    /// ```
2920    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2921        self.project = v.into();
2922        self
2923    }
2924
2925    /// Sets the value of [selector][crate::model::Fleet::selector].
2926    ///
2927    /// # Example
2928    /// ```ignore,no_run
2929    /// # use google_cloud_configdelivery_v1::model::Fleet;
2930    /// use google_cloud_configdelivery_v1::model::fleet::LabelSelector;
2931    /// let x = Fleet::new().set_selector(LabelSelector::default()/* use setters */);
2932    /// ```
2933    pub fn set_selector<T>(mut self, v: T) -> Self
2934    where
2935        T: std::convert::Into<crate::model::fleet::LabelSelector>,
2936    {
2937        self.selector = std::option::Option::Some(v.into());
2938        self
2939    }
2940
2941    /// Sets or clears the value of [selector][crate::model::Fleet::selector].
2942    ///
2943    /// # Example
2944    /// ```ignore,no_run
2945    /// # use google_cloud_configdelivery_v1::model::Fleet;
2946    /// use google_cloud_configdelivery_v1::model::fleet::LabelSelector;
2947    /// let x = Fleet::new().set_or_clear_selector(Some(LabelSelector::default()/* use setters */));
2948    /// let x = Fleet::new().set_or_clear_selector(None::<LabelSelector>);
2949    /// ```
2950    pub fn set_or_clear_selector<T>(mut self, v: std::option::Option<T>) -> Self
2951    where
2952        T: std::convert::Into<crate::model::fleet::LabelSelector>,
2953    {
2954        self.selector = v.map(|x| x.into());
2955        self
2956    }
2957}
2958
2959impl wkt::message::Message for Fleet {
2960    fn typename() -> &'static str {
2961        "type.googleapis.com/google.cloud.configdelivery.v1.Fleet"
2962    }
2963}
2964
2965/// Defines additional types related to [Fleet].
2966pub mod fleet {
2967    #[allow(unused_imports)]
2968    use super::*;
2969
2970    /// A label selector is a label query over a set of resources. An empty label
2971    /// selector matches all objects.
2972    #[derive(Clone, Default, PartialEq)]
2973    #[non_exhaustive]
2974    pub struct LabelSelector {
2975        /// Optional. match_labels is a map of {key,value} pairs. Each {key,value}
2976        /// pair must match an existing label key and value exactly in order to
2977        /// satisfy the match.
2978        pub match_labels: std::collections::HashMap<std::string::String, std::string::String>,
2979
2980        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2981    }
2982
2983    impl LabelSelector {
2984        /// Creates a new default instance.
2985        pub fn new() -> Self {
2986            std::default::Default::default()
2987        }
2988
2989        /// Sets the value of [match_labels][crate::model::fleet::LabelSelector::match_labels].
2990        ///
2991        /// # Example
2992        /// ```ignore,no_run
2993        /// # use google_cloud_configdelivery_v1::model::fleet::LabelSelector;
2994        /// let x = LabelSelector::new().set_match_labels([
2995        ///     ("key0", "abc"),
2996        ///     ("key1", "xyz"),
2997        /// ]);
2998        /// ```
2999        pub fn set_match_labels<T, K, V>(mut self, v: T) -> Self
3000        where
3001            T: std::iter::IntoIterator<Item = (K, V)>,
3002            K: std::convert::Into<std::string::String>,
3003            V: std::convert::Into<std::string::String>,
3004        {
3005            use std::iter::Iterator;
3006            self.match_labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
3007            self
3008        }
3009    }
3010
3011    impl wkt::message::Message for LabelSelector {
3012        fn typename() -> &'static str {
3013            "type.googleapis.com/google.cloud.configdelivery.v1.Fleet.LabelSelector"
3014        }
3015    }
3016}
3017
3018/// AllAtOnceStrategy causes all clusters to be updated concurrently.
3019#[derive(Clone, Default, PartialEq)]
3020#[non_exhaustive]
3021pub struct AllAtOnceStrategy {
3022    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3023}
3024
3025impl AllAtOnceStrategy {
3026    /// Creates a new default instance.
3027    pub fn new() -> Self {
3028        std::default::Default::default()
3029    }
3030}
3031
3032impl wkt::message::Message for AllAtOnceStrategy {
3033    fn typename() -> &'static str {
3034        "type.googleapis.com/google.cloud.configdelivery.v1.AllAtOnceStrategy"
3035    }
3036}
3037
3038/// RollingStrategy causes a specified number of clusters to be updated
3039/// concurrently until all clusters are updated.
3040#[derive(Clone, Default, PartialEq)]
3041#[non_exhaustive]
3042pub struct RollingStrategy {
3043    /// Optional. Maximum number of clusters to update the resource bundle on
3044    /// concurrently.
3045    pub max_concurrent: i32,
3046
3047    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3048}
3049
3050impl RollingStrategy {
3051    /// Creates a new default instance.
3052    pub fn new() -> Self {
3053        std::default::Default::default()
3054    }
3055
3056    /// Sets the value of [max_concurrent][crate::model::RollingStrategy::max_concurrent].
3057    ///
3058    /// # Example
3059    /// ```ignore,no_run
3060    /// # use google_cloud_configdelivery_v1::model::RollingStrategy;
3061    /// let x = RollingStrategy::new().set_max_concurrent(42);
3062    /// ```
3063    pub fn set_max_concurrent<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3064        self.max_concurrent = v.into();
3065        self
3066    }
3067}
3068
3069impl wkt::message::Message for RollingStrategy {
3070    fn typename() -> &'static str {
3071        "type.googleapis.com/google.cloud.configdelivery.v1.RollingStrategy"
3072    }
3073}
3074
3075/// RolloutStrategy defines different ways to rollout a resource bundle across
3076/// a set of clusters.
3077#[derive(Clone, Default, PartialEq)]
3078#[non_exhaustive]
3079pub struct RolloutStrategy {
3080    /// strategy defines how updates to a resource bundle should be rolled out
3081    /// across clusters.
3082    pub strategy: std::option::Option<crate::model::rollout_strategy::Strategy>,
3083
3084    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3085}
3086
3087impl RolloutStrategy {
3088    /// Creates a new default instance.
3089    pub fn new() -> Self {
3090        std::default::Default::default()
3091    }
3092
3093    /// Sets the value of [strategy][crate::model::RolloutStrategy::strategy].
3094    ///
3095    /// Note that all the setters affecting `strategy` are mutually
3096    /// exclusive.
3097    ///
3098    /// # Example
3099    /// ```ignore,no_run
3100    /// # use google_cloud_configdelivery_v1::model::RolloutStrategy;
3101    /// use google_cloud_configdelivery_v1::model::AllAtOnceStrategy;
3102    /// let x = RolloutStrategy::new().set_strategy(Some(
3103    ///     google_cloud_configdelivery_v1::model::rollout_strategy::Strategy::AllAtOnce(AllAtOnceStrategy::default().into())));
3104    /// ```
3105    pub fn set_strategy<
3106        T: std::convert::Into<std::option::Option<crate::model::rollout_strategy::Strategy>>,
3107    >(
3108        mut self,
3109        v: T,
3110    ) -> Self {
3111        self.strategy = v.into();
3112        self
3113    }
3114
3115    /// The value of [strategy][crate::model::RolloutStrategy::strategy]
3116    /// if it holds a `AllAtOnce`, `None` if the field is not set or
3117    /// holds a different branch.
3118    pub fn all_at_once(
3119        &self,
3120    ) -> std::option::Option<&std::boxed::Box<crate::model::AllAtOnceStrategy>> {
3121        #[allow(unreachable_patterns)]
3122        self.strategy.as_ref().and_then(|v| match v {
3123            crate::model::rollout_strategy::Strategy::AllAtOnce(v) => std::option::Option::Some(v),
3124            _ => std::option::Option::None,
3125        })
3126    }
3127
3128    /// Sets the value of [strategy][crate::model::RolloutStrategy::strategy]
3129    /// to hold a `AllAtOnce`.
3130    ///
3131    /// Note that all the setters affecting `strategy` are
3132    /// mutually exclusive.
3133    ///
3134    /// # Example
3135    /// ```ignore,no_run
3136    /// # use google_cloud_configdelivery_v1::model::RolloutStrategy;
3137    /// use google_cloud_configdelivery_v1::model::AllAtOnceStrategy;
3138    /// let x = RolloutStrategy::new().set_all_at_once(AllAtOnceStrategy::default()/* use setters */);
3139    /// assert!(x.all_at_once().is_some());
3140    /// assert!(x.rolling().is_none());
3141    /// ```
3142    pub fn set_all_at_once<
3143        T: std::convert::Into<std::boxed::Box<crate::model::AllAtOnceStrategy>>,
3144    >(
3145        mut self,
3146        v: T,
3147    ) -> Self {
3148        self.strategy = std::option::Option::Some(
3149            crate::model::rollout_strategy::Strategy::AllAtOnce(v.into()),
3150        );
3151        self
3152    }
3153
3154    /// The value of [strategy][crate::model::RolloutStrategy::strategy]
3155    /// if it holds a `Rolling`, `None` if the field is not set or
3156    /// holds a different branch.
3157    pub fn rolling(&self) -> std::option::Option<&std::boxed::Box<crate::model::RollingStrategy>> {
3158        #[allow(unreachable_patterns)]
3159        self.strategy.as_ref().and_then(|v| match v {
3160            crate::model::rollout_strategy::Strategy::Rolling(v) => std::option::Option::Some(v),
3161            _ => std::option::Option::None,
3162        })
3163    }
3164
3165    /// Sets the value of [strategy][crate::model::RolloutStrategy::strategy]
3166    /// to hold a `Rolling`.
3167    ///
3168    /// Note that all the setters affecting `strategy` are
3169    /// mutually exclusive.
3170    ///
3171    /// # Example
3172    /// ```ignore,no_run
3173    /// # use google_cloud_configdelivery_v1::model::RolloutStrategy;
3174    /// use google_cloud_configdelivery_v1::model::RollingStrategy;
3175    /// let x = RolloutStrategy::new().set_rolling(RollingStrategy::default()/* use setters */);
3176    /// assert!(x.rolling().is_some());
3177    /// assert!(x.all_at_once().is_none());
3178    /// ```
3179    pub fn set_rolling<T: std::convert::Into<std::boxed::Box<crate::model::RollingStrategy>>>(
3180        mut self,
3181        v: T,
3182    ) -> Self {
3183        self.strategy =
3184            std::option::Option::Some(crate::model::rollout_strategy::Strategy::Rolling(v.into()));
3185        self
3186    }
3187}
3188
3189impl wkt::message::Message for RolloutStrategy {
3190    fn typename() -> &'static str {
3191        "type.googleapis.com/google.cloud.configdelivery.v1.RolloutStrategy"
3192    }
3193}
3194
3195/// Defines additional types related to [RolloutStrategy].
3196pub mod rollout_strategy {
3197    #[allow(unused_imports)]
3198    use super::*;
3199
3200    /// strategy defines how updates to a resource bundle should be rolled out
3201    /// across clusters.
3202    #[derive(Clone, Debug, PartialEq)]
3203    #[non_exhaustive]
3204    pub enum Strategy {
3205        /// AllAtOnceStrategy causes all clusters to be updated concurrently.
3206        AllAtOnce(std::boxed::Box<crate::model::AllAtOnceStrategy>),
3207        /// RollingStrategy causes a specified number of clusters to be updated
3208        /// concurrently until all clusters are updated.
3209        Rolling(std::boxed::Box<crate::model::RollingStrategy>),
3210    }
3211}
3212
3213/// RolloutStrategyInfo represents the status of execution of different types of
3214/// rollout strategies. Only the field corresponding to the rollout strategy
3215/// specified at the rollout resource will be populated.
3216#[derive(Clone, Default, PartialEq)]
3217#[non_exhaustive]
3218pub struct RolloutStrategyInfo {
3219    /// strategy represents result of applying one of the rollout strategies.
3220    pub strategy: std::option::Option<crate::model::rollout_strategy_info::Strategy>,
3221
3222    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3223}
3224
3225impl RolloutStrategyInfo {
3226    /// Creates a new default instance.
3227    pub fn new() -> Self {
3228        std::default::Default::default()
3229    }
3230
3231    /// Sets the value of [strategy][crate::model::RolloutStrategyInfo::strategy].
3232    ///
3233    /// Note that all the setters affecting `strategy` are mutually
3234    /// exclusive.
3235    ///
3236    /// # Example
3237    /// ```ignore,no_run
3238    /// # use google_cloud_configdelivery_v1::model::RolloutStrategyInfo;
3239    /// use google_cloud_configdelivery_v1::model::AllAtOnceStrategyInfo;
3240    /// let x = RolloutStrategyInfo::new().set_strategy(Some(
3241    ///     google_cloud_configdelivery_v1::model::rollout_strategy_info::Strategy::AllAtOnceStrategyInfo(AllAtOnceStrategyInfo::default().into())));
3242    /// ```
3243    pub fn set_strategy<
3244        T: std::convert::Into<std::option::Option<crate::model::rollout_strategy_info::Strategy>>,
3245    >(
3246        mut self,
3247        v: T,
3248    ) -> Self {
3249        self.strategy = v.into();
3250        self
3251    }
3252
3253    /// The value of [strategy][crate::model::RolloutStrategyInfo::strategy]
3254    /// if it holds a `AllAtOnceStrategyInfo`, `None` if the field is not set or
3255    /// holds a different branch.
3256    pub fn all_at_once_strategy_info(
3257        &self,
3258    ) -> std::option::Option<&std::boxed::Box<crate::model::AllAtOnceStrategyInfo>> {
3259        #[allow(unreachable_patterns)]
3260        self.strategy.as_ref().and_then(|v| match v {
3261            crate::model::rollout_strategy_info::Strategy::AllAtOnceStrategyInfo(v) => {
3262                std::option::Option::Some(v)
3263            }
3264            _ => std::option::Option::None,
3265        })
3266    }
3267
3268    /// Sets the value of [strategy][crate::model::RolloutStrategyInfo::strategy]
3269    /// to hold a `AllAtOnceStrategyInfo`.
3270    ///
3271    /// Note that all the setters affecting `strategy` are
3272    /// mutually exclusive.
3273    ///
3274    /// # Example
3275    /// ```ignore,no_run
3276    /// # use google_cloud_configdelivery_v1::model::RolloutStrategyInfo;
3277    /// use google_cloud_configdelivery_v1::model::AllAtOnceStrategyInfo;
3278    /// let x = RolloutStrategyInfo::new().set_all_at_once_strategy_info(AllAtOnceStrategyInfo::default()/* use setters */);
3279    /// assert!(x.all_at_once_strategy_info().is_some());
3280    /// assert!(x.rolling_strategy_info().is_none());
3281    /// ```
3282    pub fn set_all_at_once_strategy_info<
3283        T: std::convert::Into<std::boxed::Box<crate::model::AllAtOnceStrategyInfo>>,
3284    >(
3285        mut self,
3286        v: T,
3287    ) -> Self {
3288        self.strategy = std::option::Option::Some(
3289            crate::model::rollout_strategy_info::Strategy::AllAtOnceStrategyInfo(v.into()),
3290        );
3291        self
3292    }
3293
3294    /// The value of [strategy][crate::model::RolloutStrategyInfo::strategy]
3295    /// if it holds a `RollingStrategyInfo`, `None` if the field is not set or
3296    /// holds a different branch.
3297    pub fn rolling_strategy_info(
3298        &self,
3299    ) -> std::option::Option<&std::boxed::Box<crate::model::RollingStrategyInfo>> {
3300        #[allow(unreachable_patterns)]
3301        self.strategy.as_ref().and_then(|v| match v {
3302            crate::model::rollout_strategy_info::Strategy::RollingStrategyInfo(v) => {
3303                std::option::Option::Some(v)
3304            }
3305            _ => std::option::Option::None,
3306        })
3307    }
3308
3309    /// Sets the value of [strategy][crate::model::RolloutStrategyInfo::strategy]
3310    /// to hold a `RollingStrategyInfo`.
3311    ///
3312    /// Note that all the setters affecting `strategy` are
3313    /// mutually exclusive.
3314    ///
3315    /// # Example
3316    /// ```ignore,no_run
3317    /// # use google_cloud_configdelivery_v1::model::RolloutStrategyInfo;
3318    /// use google_cloud_configdelivery_v1::model::RollingStrategyInfo;
3319    /// let x = RolloutStrategyInfo::new().set_rolling_strategy_info(RollingStrategyInfo::default()/* use setters */);
3320    /// assert!(x.rolling_strategy_info().is_some());
3321    /// assert!(x.all_at_once_strategy_info().is_none());
3322    /// ```
3323    pub fn set_rolling_strategy_info<
3324        T: std::convert::Into<std::boxed::Box<crate::model::RollingStrategyInfo>>,
3325    >(
3326        mut self,
3327        v: T,
3328    ) -> Self {
3329        self.strategy = std::option::Option::Some(
3330            crate::model::rollout_strategy_info::Strategy::RollingStrategyInfo(v.into()),
3331        );
3332        self
3333    }
3334}
3335
3336impl wkt::message::Message for RolloutStrategyInfo {
3337    fn typename() -> &'static str {
3338        "type.googleapis.com/google.cloud.configdelivery.v1.RolloutStrategyInfo"
3339    }
3340}
3341
3342/// Defines additional types related to [RolloutStrategyInfo].
3343pub mod rollout_strategy_info {
3344    #[allow(unused_imports)]
3345    use super::*;
3346
3347    /// strategy represents result of applying one of the rollout strategies.
3348    #[derive(Clone, Debug, PartialEq)]
3349    #[non_exhaustive]
3350    pub enum Strategy {
3351        /// AllAtOnceStrategyInfo represents the status of AllAtOnce rollout strategy
3352        /// execution.
3353        AllAtOnceStrategyInfo(std::boxed::Box<crate::model::AllAtOnceStrategyInfo>),
3354        /// RollingStrategyInfo represents the status of Rolling rollout strategy
3355        /// execution.
3356        RollingStrategyInfo(std::boxed::Box<crate::model::RollingStrategyInfo>),
3357    }
3358}
3359
3360/// AllAtOnceStrategyInfo represents the status of execution of AllAtOnce rollout
3361/// strategy.
3362#[derive(Clone, Default, PartialEq)]
3363#[non_exhaustive]
3364pub struct AllAtOnceStrategyInfo {
3365    /// Unordered list. resource bundle's deployment status for all targeted
3366    /// clusters.
3367    pub clusters: std::vec::Vec<crate::model::ClusterInfo>,
3368
3369    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3370}
3371
3372impl AllAtOnceStrategyInfo {
3373    /// Creates a new default instance.
3374    pub fn new() -> Self {
3375        std::default::Default::default()
3376    }
3377
3378    /// Sets the value of [clusters][crate::model::AllAtOnceStrategyInfo::clusters].
3379    ///
3380    /// # Example
3381    /// ```ignore,no_run
3382    /// # use google_cloud_configdelivery_v1::model::AllAtOnceStrategyInfo;
3383    /// use google_cloud_configdelivery_v1::model::ClusterInfo;
3384    /// let x = AllAtOnceStrategyInfo::new()
3385    ///     .set_clusters([
3386    ///         ClusterInfo::default()/* use setters */,
3387    ///         ClusterInfo::default()/* use (different) setters */,
3388    ///     ]);
3389    /// ```
3390    pub fn set_clusters<T, V>(mut self, v: T) -> Self
3391    where
3392        T: std::iter::IntoIterator<Item = V>,
3393        V: std::convert::Into<crate::model::ClusterInfo>,
3394    {
3395        use std::iter::Iterator;
3396        self.clusters = v.into_iter().map(|i| i.into()).collect();
3397        self
3398    }
3399}
3400
3401impl wkt::message::Message for AllAtOnceStrategyInfo {
3402    fn typename() -> &'static str {
3403        "type.googleapis.com/google.cloud.configdelivery.v1.AllAtOnceStrategyInfo"
3404    }
3405}
3406
3407/// RollingStrategyInfo represents the status of execution of Rolling rollout
3408/// strategy.
3409#[derive(Clone, Default, PartialEq)]
3410#[non_exhaustive]
3411pub struct RollingStrategyInfo {
3412    /// Unordered list. resource bundle's deployment status for all targeted
3413    /// clusters.
3414    pub clusters: std::vec::Vec<crate::model::ClusterInfo>,
3415
3416    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3417}
3418
3419impl RollingStrategyInfo {
3420    /// Creates a new default instance.
3421    pub fn new() -> Self {
3422        std::default::Default::default()
3423    }
3424
3425    /// Sets the value of [clusters][crate::model::RollingStrategyInfo::clusters].
3426    ///
3427    /// # Example
3428    /// ```ignore,no_run
3429    /// # use google_cloud_configdelivery_v1::model::RollingStrategyInfo;
3430    /// use google_cloud_configdelivery_v1::model::ClusterInfo;
3431    /// let x = RollingStrategyInfo::new()
3432    ///     .set_clusters([
3433    ///         ClusterInfo::default()/* use setters */,
3434    ///         ClusterInfo::default()/* use (different) setters */,
3435    ///     ]);
3436    /// ```
3437    pub fn set_clusters<T, V>(mut self, v: T) -> Self
3438    where
3439        T: std::iter::IntoIterator<Item = V>,
3440        V: std::convert::Into<crate::model::ClusterInfo>,
3441    {
3442        use std::iter::Iterator;
3443        self.clusters = v.into_iter().map(|i| i.into()).collect();
3444        self
3445    }
3446}
3447
3448impl wkt::message::Message for RollingStrategyInfo {
3449    fn typename() -> &'static str {
3450        "type.googleapis.com/google.cloud.configdelivery.v1.RollingStrategyInfo"
3451    }
3452}
3453
3454/// Message for requesting list of FleetPackage.
3455#[derive(Clone, Default, PartialEq)]
3456#[non_exhaustive]
3457pub struct ListFleetPackagesRequest {
3458    /// Required. Parent value for ListFleetPackagesRequest.
3459    pub parent: std::string::String,
3460
3461    /// Optional. Requested page size. Server may return fewer items than
3462    /// requested. If unspecified, server will pick an appropriate default.
3463    pub page_size: i32,
3464
3465    /// Optional. A token identifying a page of results the server should return.
3466    pub page_token: std::string::String,
3467
3468    /// Optional. Filtering results
3469    pub filter: std::string::String,
3470
3471    /// Optional. Hint for how to order the results
3472    pub order_by: std::string::String,
3473
3474    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3475}
3476
3477impl ListFleetPackagesRequest {
3478    /// Creates a new default instance.
3479    pub fn new() -> Self {
3480        std::default::Default::default()
3481    }
3482
3483    /// Sets the value of [parent][crate::model::ListFleetPackagesRequest::parent].
3484    ///
3485    /// # Example
3486    /// ```ignore,no_run
3487    /// # use google_cloud_configdelivery_v1::model::ListFleetPackagesRequest;
3488    /// # let project_id = "project_id";
3489    /// # let location_id = "location_id";
3490    /// let x = ListFleetPackagesRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
3491    /// ```
3492    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3493        self.parent = v.into();
3494        self
3495    }
3496
3497    /// Sets the value of [page_size][crate::model::ListFleetPackagesRequest::page_size].
3498    ///
3499    /// # Example
3500    /// ```ignore,no_run
3501    /// # use google_cloud_configdelivery_v1::model::ListFleetPackagesRequest;
3502    /// let x = ListFleetPackagesRequest::new().set_page_size(42);
3503    /// ```
3504    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3505        self.page_size = v.into();
3506        self
3507    }
3508
3509    /// Sets the value of [page_token][crate::model::ListFleetPackagesRequest::page_token].
3510    ///
3511    /// # Example
3512    /// ```ignore,no_run
3513    /// # use google_cloud_configdelivery_v1::model::ListFleetPackagesRequest;
3514    /// let x = ListFleetPackagesRequest::new().set_page_token("example");
3515    /// ```
3516    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3517        self.page_token = v.into();
3518        self
3519    }
3520
3521    /// Sets the value of [filter][crate::model::ListFleetPackagesRequest::filter].
3522    ///
3523    /// # Example
3524    /// ```ignore,no_run
3525    /// # use google_cloud_configdelivery_v1::model::ListFleetPackagesRequest;
3526    /// let x = ListFleetPackagesRequest::new().set_filter("example");
3527    /// ```
3528    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3529        self.filter = v.into();
3530        self
3531    }
3532
3533    /// Sets the value of [order_by][crate::model::ListFleetPackagesRequest::order_by].
3534    ///
3535    /// # Example
3536    /// ```ignore,no_run
3537    /// # use google_cloud_configdelivery_v1::model::ListFleetPackagesRequest;
3538    /// let x = ListFleetPackagesRequest::new().set_order_by("example");
3539    /// ```
3540    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3541        self.order_by = v.into();
3542        self
3543    }
3544}
3545
3546impl wkt::message::Message for ListFleetPackagesRequest {
3547    fn typename() -> &'static str {
3548        "type.googleapis.com/google.cloud.configdelivery.v1.ListFleetPackagesRequest"
3549    }
3550}
3551
3552/// Message for response to listing FleetPackage
3553#[derive(Clone, Default, PartialEq)]
3554#[non_exhaustive]
3555pub struct ListFleetPackagesResponse {
3556    /// The list of FleetPackage
3557    pub fleet_packages: std::vec::Vec<crate::model::FleetPackage>,
3558
3559    /// A token identifying a page of results the server should return.
3560    pub next_page_token: std::string::String,
3561
3562    /// Unordered list. Locations that could not be reached.
3563    pub unreachable: std::vec::Vec<std::string::String>,
3564
3565    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3566}
3567
3568impl ListFleetPackagesResponse {
3569    /// Creates a new default instance.
3570    pub fn new() -> Self {
3571        std::default::Default::default()
3572    }
3573
3574    /// Sets the value of [fleet_packages][crate::model::ListFleetPackagesResponse::fleet_packages].
3575    ///
3576    /// # Example
3577    /// ```ignore,no_run
3578    /// # use google_cloud_configdelivery_v1::model::ListFleetPackagesResponse;
3579    /// use google_cloud_configdelivery_v1::model::FleetPackage;
3580    /// let x = ListFleetPackagesResponse::new()
3581    ///     .set_fleet_packages([
3582    ///         FleetPackage::default()/* use setters */,
3583    ///         FleetPackage::default()/* use (different) setters */,
3584    ///     ]);
3585    /// ```
3586    pub fn set_fleet_packages<T, V>(mut self, v: T) -> Self
3587    where
3588        T: std::iter::IntoIterator<Item = V>,
3589        V: std::convert::Into<crate::model::FleetPackage>,
3590    {
3591        use std::iter::Iterator;
3592        self.fleet_packages = v.into_iter().map(|i| i.into()).collect();
3593        self
3594    }
3595
3596    /// Sets the value of [next_page_token][crate::model::ListFleetPackagesResponse::next_page_token].
3597    ///
3598    /// # Example
3599    /// ```ignore,no_run
3600    /// # use google_cloud_configdelivery_v1::model::ListFleetPackagesResponse;
3601    /// let x = ListFleetPackagesResponse::new().set_next_page_token("example");
3602    /// ```
3603    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3604        self.next_page_token = v.into();
3605        self
3606    }
3607
3608    /// Sets the value of [unreachable][crate::model::ListFleetPackagesResponse::unreachable].
3609    ///
3610    /// # Example
3611    /// ```ignore,no_run
3612    /// # use google_cloud_configdelivery_v1::model::ListFleetPackagesResponse;
3613    /// let x = ListFleetPackagesResponse::new().set_unreachable(["a", "b", "c"]);
3614    /// ```
3615    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
3616    where
3617        T: std::iter::IntoIterator<Item = V>,
3618        V: std::convert::Into<std::string::String>,
3619    {
3620        use std::iter::Iterator;
3621        self.unreachable = v.into_iter().map(|i| i.into()).collect();
3622        self
3623    }
3624}
3625
3626impl wkt::message::Message for ListFleetPackagesResponse {
3627    fn typename() -> &'static str {
3628        "type.googleapis.com/google.cloud.configdelivery.v1.ListFleetPackagesResponse"
3629    }
3630}
3631
3632#[doc(hidden)]
3633impl google_cloud_gax::paginator::internal::PageableResponse for ListFleetPackagesResponse {
3634    type PageItem = crate::model::FleetPackage;
3635
3636    fn items(self) -> std::vec::Vec<Self::PageItem> {
3637        self.fleet_packages
3638    }
3639
3640    fn next_page_token(&self) -> std::string::String {
3641        use std::clone::Clone;
3642        self.next_page_token.clone()
3643    }
3644}
3645
3646/// Message for getting a FleetPackage
3647#[derive(Clone, Default, PartialEq)]
3648#[non_exhaustive]
3649pub struct GetFleetPackageRequest {
3650    /// Required. Name of the resource
3651    pub name: std::string::String,
3652
3653    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3654}
3655
3656impl GetFleetPackageRequest {
3657    /// Creates a new default instance.
3658    pub fn new() -> Self {
3659        std::default::Default::default()
3660    }
3661
3662    /// Sets the value of [name][crate::model::GetFleetPackageRequest::name].
3663    ///
3664    /// # Example
3665    /// ```ignore,no_run
3666    /// # use google_cloud_configdelivery_v1::model::GetFleetPackageRequest;
3667    /// # let project_id = "project_id";
3668    /// # let location_id = "location_id";
3669    /// # let fleet_package_id = "fleet_package_id";
3670    /// let x = GetFleetPackageRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/fleetPackages/{fleet_package_id}"));
3671    /// ```
3672    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3673        self.name = v.into();
3674        self
3675    }
3676}
3677
3678impl wkt::message::Message for GetFleetPackageRequest {
3679    fn typename() -> &'static str {
3680        "type.googleapis.com/google.cloud.configdelivery.v1.GetFleetPackageRequest"
3681    }
3682}
3683
3684/// Message for creating a FleetPackage
3685#[derive(Clone, Default, PartialEq)]
3686#[non_exhaustive]
3687pub struct CreateFleetPackageRequest {
3688    /// Required. Value for parent.
3689    pub parent: std::string::String,
3690
3691    /// Required. Id of the requesting object
3692    /// If auto-generating Id server-side, remove this field and
3693    /// fleet_package_id from the method_signature of Create RPC
3694    pub fleet_package_id: std::string::String,
3695
3696    /// Required. The resource being created.
3697    pub fleet_package: std::option::Option<crate::model::FleetPackage>,
3698
3699    /// Optional. An optional request ID to identify requests. Specify a unique
3700    /// request ID so that if you must retry your request, the server will know to
3701    /// ignore the request if it has already been completed. The server will
3702    /// guarantee that for at least 60 minutes since the first request.
3703    ///
3704    /// For example, consider a situation where you make an initial request and the
3705    /// request times out. If you make the request again with the same request
3706    /// ID, the server can check if original operation with the same request ID
3707    /// was received, and if so, will ignore the second request. This prevents
3708    /// clients from accidentally creating duplicate commitments.
3709    ///
3710    /// The request ID must be a valid UUID with the exception that zero UUID is
3711    /// not supported (00000000-0000-0000-0000-000000000000).
3712    pub request_id: std::string::String,
3713
3714    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3715}
3716
3717impl CreateFleetPackageRequest {
3718    /// Creates a new default instance.
3719    pub fn new() -> Self {
3720        std::default::Default::default()
3721    }
3722
3723    /// Sets the value of [parent][crate::model::CreateFleetPackageRequest::parent].
3724    ///
3725    /// # Example
3726    /// ```ignore,no_run
3727    /// # use google_cloud_configdelivery_v1::model::CreateFleetPackageRequest;
3728    /// # let project_id = "project_id";
3729    /// # let location_id = "location_id";
3730    /// let x = CreateFleetPackageRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
3731    /// ```
3732    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3733        self.parent = v.into();
3734        self
3735    }
3736
3737    /// Sets the value of [fleet_package_id][crate::model::CreateFleetPackageRequest::fleet_package_id].
3738    ///
3739    /// # Example
3740    /// ```ignore,no_run
3741    /// # use google_cloud_configdelivery_v1::model::CreateFleetPackageRequest;
3742    /// let x = CreateFleetPackageRequest::new().set_fleet_package_id("example");
3743    /// ```
3744    pub fn set_fleet_package_id<T: std::convert::Into<std::string::String>>(
3745        mut self,
3746        v: T,
3747    ) -> Self {
3748        self.fleet_package_id = v.into();
3749        self
3750    }
3751
3752    /// Sets the value of [fleet_package][crate::model::CreateFleetPackageRequest::fleet_package].
3753    ///
3754    /// # Example
3755    /// ```ignore,no_run
3756    /// # use google_cloud_configdelivery_v1::model::CreateFleetPackageRequest;
3757    /// use google_cloud_configdelivery_v1::model::FleetPackage;
3758    /// let x = CreateFleetPackageRequest::new().set_fleet_package(FleetPackage::default()/* use setters */);
3759    /// ```
3760    pub fn set_fleet_package<T>(mut self, v: T) -> Self
3761    where
3762        T: std::convert::Into<crate::model::FleetPackage>,
3763    {
3764        self.fleet_package = std::option::Option::Some(v.into());
3765        self
3766    }
3767
3768    /// Sets or clears the value of [fleet_package][crate::model::CreateFleetPackageRequest::fleet_package].
3769    ///
3770    /// # Example
3771    /// ```ignore,no_run
3772    /// # use google_cloud_configdelivery_v1::model::CreateFleetPackageRequest;
3773    /// use google_cloud_configdelivery_v1::model::FleetPackage;
3774    /// let x = CreateFleetPackageRequest::new().set_or_clear_fleet_package(Some(FleetPackage::default()/* use setters */));
3775    /// let x = CreateFleetPackageRequest::new().set_or_clear_fleet_package(None::<FleetPackage>);
3776    /// ```
3777    pub fn set_or_clear_fleet_package<T>(mut self, v: std::option::Option<T>) -> Self
3778    where
3779        T: std::convert::Into<crate::model::FleetPackage>,
3780    {
3781        self.fleet_package = v.map(|x| x.into());
3782        self
3783    }
3784
3785    /// Sets the value of [request_id][crate::model::CreateFleetPackageRequest::request_id].
3786    ///
3787    /// # Example
3788    /// ```ignore,no_run
3789    /// # use google_cloud_configdelivery_v1::model::CreateFleetPackageRequest;
3790    /// let x = CreateFleetPackageRequest::new().set_request_id("example");
3791    /// ```
3792    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3793        self.request_id = v.into();
3794        self
3795    }
3796}
3797
3798impl wkt::message::Message for CreateFleetPackageRequest {
3799    fn typename() -> &'static str {
3800        "type.googleapis.com/google.cloud.configdelivery.v1.CreateFleetPackageRequest"
3801    }
3802}
3803
3804/// Message for updating a FleetPackage
3805#[derive(Clone, Default, PartialEq)]
3806#[non_exhaustive]
3807pub struct UpdateFleetPackageRequest {
3808    /// Required. Field mask is used to specify the fields to be overwritten in the
3809    /// FleetPackage resource by the update.
3810    /// The fields specified in the update_mask are relative to the resource, not
3811    /// the full request. A field will be overwritten if it is in the mask. If the
3812    /// user does not provide a mask then all fields will be overwritten.
3813    pub update_mask: std::option::Option<wkt::FieldMask>,
3814
3815    /// Required. The resource being updated
3816    pub fleet_package: std::option::Option<crate::model::FleetPackage>,
3817
3818    /// Optional. An optional request ID to identify requests. Specify a unique
3819    /// request ID so that if you must retry your request, the server will know to
3820    /// ignore the request if it has already been completed. The server will
3821    /// guarantee that for at least 60 minutes since the first request.
3822    ///
3823    /// For example, consider a situation where you make an initial request and the
3824    /// request times out. If you make the request again with the same request
3825    /// ID, the server can check if original operation with the same request ID
3826    /// was received, and if so, will ignore the second request. This prevents
3827    /// clients from accidentally creating duplicate commitments.
3828    ///
3829    /// The request ID must be a valid UUID with the exception that zero UUID is
3830    /// not supported (00000000-0000-0000-0000-000000000000).
3831    pub request_id: std::string::String,
3832
3833    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3834}
3835
3836impl UpdateFleetPackageRequest {
3837    /// Creates a new default instance.
3838    pub fn new() -> Self {
3839        std::default::Default::default()
3840    }
3841
3842    /// Sets the value of [update_mask][crate::model::UpdateFleetPackageRequest::update_mask].
3843    ///
3844    /// # Example
3845    /// ```ignore,no_run
3846    /// # use google_cloud_configdelivery_v1::model::UpdateFleetPackageRequest;
3847    /// use wkt::FieldMask;
3848    /// let x = UpdateFleetPackageRequest::new().set_update_mask(FieldMask::default()/* use setters */);
3849    /// ```
3850    pub fn set_update_mask<T>(mut self, v: T) -> Self
3851    where
3852        T: std::convert::Into<wkt::FieldMask>,
3853    {
3854        self.update_mask = std::option::Option::Some(v.into());
3855        self
3856    }
3857
3858    /// Sets or clears the value of [update_mask][crate::model::UpdateFleetPackageRequest::update_mask].
3859    ///
3860    /// # Example
3861    /// ```ignore,no_run
3862    /// # use google_cloud_configdelivery_v1::model::UpdateFleetPackageRequest;
3863    /// use wkt::FieldMask;
3864    /// let x = UpdateFleetPackageRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
3865    /// let x = UpdateFleetPackageRequest::new().set_or_clear_update_mask(None::<FieldMask>);
3866    /// ```
3867    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3868    where
3869        T: std::convert::Into<wkt::FieldMask>,
3870    {
3871        self.update_mask = v.map(|x| x.into());
3872        self
3873    }
3874
3875    /// Sets the value of [fleet_package][crate::model::UpdateFleetPackageRequest::fleet_package].
3876    ///
3877    /// # Example
3878    /// ```ignore,no_run
3879    /// # use google_cloud_configdelivery_v1::model::UpdateFleetPackageRequest;
3880    /// use google_cloud_configdelivery_v1::model::FleetPackage;
3881    /// let x = UpdateFleetPackageRequest::new().set_fleet_package(FleetPackage::default()/* use setters */);
3882    /// ```
3883    pub fn set_fleet_package<T>(mut self, v: T) -> Self
3884    where
3885        T: std::convert::Into<crate::model::FleetPackage>,
3886    {
3887        self.fleet_package = std::option::Option::Some(v.into());
3888        self
3889    }
3890
3891    /// Sets or clears the value of [fleet_package][crate::model::UpdateFleetPackageRequest::fleet_package].
3892    ///
3893    /// # Example
3894    /// ```ignore,no_run
3895    /// # use google_cloud_configdelivery_v1::model::UpdateFleetPackageRequest;
3896    /// use google_cloud_configdelivery_v1::model::FleetPackage;
3897    /// let x = UpdateFleetPackageRequest::new().set_or_clear_fleet_package(Some(FleetPackage::default()/* use setters */));
3898    /// let x = UpdateFleetPackageRequest::new().set_or_clear_fleet_package(None::<FleetPackage>);
3899    /// ```
3900    pub fn set_or_clear_fleet_package<T>(mut self, v: std::option::Option<T>) -> Self
3901    where
3902        T: std::convert::Into<crate::model::FleetPackage>,
3903    {
3904        self.fleet_package = v.map(|x| x.into());
3905        self
3906    }
3907
3908    /// Sets the value of [request_id][crate::model::UpdateFleetPackageRequest::request_id].
3909    ///
3910    /// # Example
3911    /// ```ignore,no_run
3912    /// # use google_cloud_configdelivery_v1::model::UpdateFleetPackageRequest;
3913    /// let x = UpdateFleetPackageRequest::new().set_request_id("example");
3914    /// ```
3915    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3916        self.request_id = v.into();
3917        self
3918    }
3919}
3920
3921impl wkt::message::Message for UpdateFleetPackageRequest {
3922    fn typename() -> &'static str {
3923        "type.googleapis.com/google.cloud.configdelivery.v1.UpdateFleetPackageRequest"
3924    }
3925}
3926
3927/// Message for deleting a FleetPackage
3928#[derive(Clone, Default, PartialEq)]
3929#[non_exhaustive]
3930pub struct DeleteFleetPackageRequest {
3931    /// Required. Name of the resource
3932    pub name: std::string::String,
3933
3934    /// Optional. An optional request ID to identify requests. Specify a unique
3935    /// request ID so that if you must retry your request, the server will know to
3936    /// ignore the request if it has already been completed. The server will
3937    /// guarantee that for at least 60 minutes after the first request.
3938    ///
3939    /// For example, consider a situation where you make an initial request and the
3940    /// request times out. If you make the request again with the same request
3941    /// ID, the server can check if original operation with the same request ID
3942    /// was received, and if so, will ignore the second request. This prevents
3943    /// clients from accidentally creating duplicate commitments.
3944    ///
3945    /// The request ID must be a valid UUID with the exception that zero UUID is
3946    /// not supported (00000000-0000-0000-0000-000000000000).
3947    pub request_id: std::string::String,
3948
3949    /// Optional. If set to true, any rollouts for this FleetPackage will also be
3950    /// deleted. (Otherwise, the request will only work if the fleet package has no
3951    /// rollouts.)
3952    pub force: bool,
3953
3954    /// Optional. If set to true, then deleting an already deleted or non existing
3955    /// FleetPackage will succeed.
3956    pub allow_missing: bool,
3957
3958    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3959}
3960
3961impl DeleteFleetPackageRequest {
3962    /// Creates a new default instance.
3963    pub fn new() -> Self {
3964        std::default::Default::default()
3965    }
3966
3967    /// Sets the value of [name][crate::model::DeleteFleetPackageRequest::name].
3968    ///
3969    /// # Example
3970    /// ```ignore,no_run
3971    /// # use google_cloud_configdelivery_v1::model::DeleteFleetPackageRequest;
3972    /// # let project_id = "project_id";
3973    /// # let location_id = "location_id";
3974    /// # let fleet_package_id = "fleet_package_id";
3975    /// let x = DeleteFleetPackageRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/fleetPackages/{fleet_package_id}"));
3976    /// ```
3977    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3978        self.name = v.into();
3979        self
3980    }
3981
3982    /// Sets the value of [request_id][crate::model::DeleteFleetPackageRequest::request_id].
3983    ///
3984    /// # Example
3985    /// ```ignore,no_run
3986    /// # use google_cloud_configdelivery_v1::model::DeleteFleetPackageRequest;
3987    /// let x = DeleteFleetPackageRequest::new().set_request_id("example");
3988    /// ```
3989    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3990        self.request_id = v.into();
3991        self
3992    }
3993
3994    /// Sets the value of [force][crate::model::DeleteFleetPackageRequest::force].
3995    ///
3996    /// # Example
3997    /// ```ignore,no_run
3998    /// # use google_cloud_configdelivery_v1::model::DeleteFleetPackageRequest;
3999    /// let x = DeleteFleetPackageRequest::new().set_force(true);
4000    /// ```
4001    pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4002        self.force = v.into();
4003        self
4004    }
4005
4006    /// Sets the value of [allow_missing][crate::model::DeleteFleetPackageRequest::allow_missing].
4007    ///
4008    /// # Example
4009    /// ```ignore,no_run
4010    /// # use google_cloud_configdelivery_v1::model::DeleteFleetPackageRequest;
4011    /// let x = DeleteFleetPackageRequest::new().set_allow_missing(true);
4012    /// ```
4013    pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4014        self.allow_missing = v.into();
4015        self
4016    }
4017}
4018
4019impl wkt::message::Message for DeleteFleetPackageRequest {
4020    fn typename() -> &'static str {
4021        "type.googleapis.com/google.cloud.configdelivery.v1.DeleteFleetPackageRequest"
4022    }
4023}
4024
4025/// Represents the metadata of the long-running operation.
4026#[derive(Clone, Default, PartialEq)]
4027#[non_exhaustive]
4028pub struct OperationMetadata {
4029    /// Output only. The time the operation was created.
4030    pub create_time: std::option::Option<wkt::Timestamp>,
4031
4032    /// Output only. The time the operation finished running.
4033    pub end_time: std::option::Option<wkt::Timestamp>,
4034
4035    /// Output only. Server-defined resource path for the target of the operation.
4036    pub target: std::string::String,
4037
4038    /// Output only. Name of the verb executed by the operation.
4039    pub verb: std::string::String,
4040
4041    /// Output only. Human-readable status of the operation, if any.
4042    pub status_message: std::string::String,
4043
4044    /// Output only. Identifies whether the user has requested cancellation
4045    /// of the operation. Operations that have been cancelled successfully
4046    /// have
4047    /// [google.longrunning.Operation.error][google.longrunning.Operation.error]
4048    /// value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
4049    /// corresponding to `Code.CANCELLED`.
4050    ///
4051    /// [google.longrunning.Operation.error]: google_cloud_longrunning::model::Operation::result
4052    /// [google.rpc.Status.code]: google_cloud_rpc::model::Status::code
4053    pub requested_cancellation: bool,
4054
4055    /// Output only. API version used to start the operation.
4056    pub api_version: std::string::String,
4057
4058    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4059}
4060
4061impl OperationMetadata {
4062    /// Creates a new default instance.
4063    pub fn new() -> Self {
4064        std::default::Default::default()
4065    }
4066
4067    /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
4068    ///
4069    /// # Example
4070    /// ```ignore,no_run
4071    /// # use google_cloud_configdelivery_v1::model::OperationMetadata;
4072    /// use wkt::Timestamp;
4073    /// let x = OperationMetadata::new().set_create_time(Timestamp::default()/* use setters */);
4074    /// ```
4075    pub fn set_create_time<T>(mut self, v: T) -> Self
4076    where
4077        T: std::convert::Into<wkt::Timestamp>,
4078    {
4079        self.create_time = std::option::Option::Some(v.into());
4080        self
4081    }
4082
4083    /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
4084    ///
4085    /// # Example
4086    /// ```ignore,no_run
4087    /// # use google_cloud_configdelivery_v1::model::OperationMetadata;
4088    /// use wkt::Timestamp;
4089    /// let x = OperationMetadata::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
4090    /// let x = OperationMetadata::new().set_or_clear_create_time(None::<Timestamp>);
4091    /// ```
4092    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
4093    where
4094        T: std::convert::Into<wkt::Timestamp>,
4095    {
4096        self.create_time = v.map(|x| x.into());
4097        self
4098    }
4099
4100    /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
4101    ///
4102    /// # Example
4103    /// ```ignore,no_run
4104    /// # use google_cloud_configdelivery_v1::model::OperationMetadata;
4105    /// use wkt::Timestamp;
4106    /// let x = OperationMetadata::new().set_end_time(Timestamp::default()/* use setters */);
4107    /// ```
4108    pub fn set_end_time<T>(mut self, v: T) -> Self
4109    where
4110        T: std::convert::Into<wkt::Timestamp>,
4111    {
4112        self.end_time = std::option::Option::Some(v.into());
4113        self
4114    }
4115
4116    /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
4117    ///
4118    /// # Example
4119    /// ```ignore,no_run
4120    /// # use google_cloud_configdelivery_v1::model::OperationMetadata;
4121    /// use wkt::Timestamp;
4122    /// let x = OperationMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
4123    /// let x = OperationMetadata::new().set_or_clear_end_time(None::<Timestamp>);
4124    /// ```
4125    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
4126    where
4127        T: std::convert::Into<wkt::Timestamp>,
4128    {
4129        self.end_time = v.map(|x| x.into());
4130        self
4131    }
4132
4133    /// Sets the value of [target][crate::model::OperationMetadata::target].
4134    ///
4135    /// # Example
4136    /// ```ignore,no_run
4137    /// # use google_cloud_configdelivery_v1::model::OperationMetadata;
4138    /// let x = OperationMetadata::new().set_target("example");
4139    /// ```
4140    pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4141        self.target = v.into();
4142        self
4143    }
4144
4145    /// Sets the value of [verb][crate::model::OperationMetadata::verb].
4146    ///
4147    /// # Example
4148    /// ```ignore,no_run
4149    /// # use google_cloud_configdelivery_v1::model::OperationMetadata;
4150    /// let x = OperationMetadata::new().set_verb("example");
4151    /// ```
4152    pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4153        self.verb = v.into();
4154        self
4155    }
4156
4157    /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
4158    ///
4159    /// # Example
4160    /// ```ignore,no_run
4161    /// # use google_cloud_configdelivery_v1::model::OperationMetadata;
4162    /// let x = OperationMetadata::new().set_status_message("example");
4163    /// ```
4164    pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4165        self.status_message = v.into();
4166        self
4167    }
4168
4169    /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
4170    ///
4171    /// # Example
4172    /// ```ignore,no_run
4173    /// # use google_cloud_configdelivery_v1::model::OperationMetadata;
4174    /// let x = OperationMetadata::new().set_requested_cancellation(true);
4175    /// ```
4176    pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4177        self.requested_cancellation = v.into();
4178        self
4179    }
4180
4181    /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
4182    ///
4183    /// # Example
4184    /// ```ignore,no_run
4185    /// # use google_cloud_configdelivery_v1::model::OperationMetadata;
4186    /// let x = OperationMetadata::new().set_api_version("example");
4187    /// ```
4188    pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4189        self.api_version = v.into();
4190        self
4191    }
4192}
4193
4194impl wkt::message::Message for OperationMetadata {
4195    fn typename() -> &'static str {
4196        "type.googleapis.com/google.cloud.configdelivery.v1.OperationMetadata"
4197    }
4198}
4199
4200/// `Release` represents a versioned release containing kubernetes manifests.
4201#[derive(Clone, Default, PartialEq)]
4202#[non_exhaustive]
4203pub struct Release {
4204    /// Identifier. Name of the Release. Format is
4205    /// `projects/{project}/locations/location}/resourceBundles/{resource_bundle}/release/[a-z][a-z0-9\-]{0,62}`.
4206    pub name: std::string::String,
4207
4208    /// Output only. Time `Release` was created.
4209    pub create_time: std::option::Option<wkt::Timestamp>,
4210
4211    /// Output only. Time `Release` was last updated.
4212    pub update_time: std::option::Option<wkt::Timestamp>,
4213
4214    /// Optional. Labels as key value pairs.
4215    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
4216
4217    /// Optional. lifecycle of the `Release`.
4218    pub lifecycle: crate::model::release::Lifecycle,
4219
4220    /// Required. version of the `Release`. This must be v\<major\>.\<minor\>.\<patch\>.
4221    pub version: std::string::String,
4222
4223    /// Output only. Time the `Release` was published.
4224    pub publish_time: std::option::Option<wkt::Timestamp>,
4225
4226    /// Optional. `ResourceBundle` Release extra information e.g., artifact
4227    /// registry image path.
4228    pub info: std::option::Option<crate::model::ReleaseInfo>,
4229
4230    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4231}
4232
4233impl Release {
4234    /// Creates a new default instance.
4235    pub fn new() -> Self {
4236        std::default::Default::default()
4237    }
4238
4239    /// Sets the value of [name][crate::model::Release::name].
4240    ///
4241    /// # Example
4242    /// ```ignore,no_run
4243    /// # use google_cloud_configdelivery_v1::model::Release;
4244    /// # let project_id = "project_id";
4245    /// # let location_id = "location_id";
4246    /// # let resource_bundle_id = "resource_bundle_id";
4247    /// # let release_id = "release_id";
4248    /// let x = Release::new().set_name(format!("projects/{project_id}/locations/{location_id}/resourceBundles/{resource_bundle_id}/releases/{release_id}"));
4249    /// ```
4250    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4251        self.name = v.into();
4252        self
4253    }
4254
4255    /// Sets the value of [create_time][crate::model::Release::create_time].
4256    ///
4257    /// # Example
4258    /// ```ignore,no_run
4259    /// # use google_cloud_configdelivery_v1::model::Release;
4260    /// use wkt::Timestamp;
4261    /// let x = Release::new().set_create_time(Timestamp::default()/* use setters */);
4262    /// ```
4263    pub fn set_create_time<T>(mut self, v: T) -> Self
4264    where
4265        T: std::convert::Into<wkt::Timestamp>,
4266    {
4267        self.create_time = std::option::Option::Some(v.into());
4268        self
4269    }
4270
4271    /// Sets or clears the value of [create_time][crate::model::Release::create_time].
4272    ///
4273    /// # Example
4274    /// ```ignore,no_run
4275    /// # use google_cloud_configdelivery_v1::model::Release;
4276    /// use wkt::Timestamp;
4277    /// let x = Release::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
4278    /// let x = Release::new().set_or_clear_create_time(None::<Timestamp>);
4279    /// ```
4280    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
4281    where
4282        T: std::convert::Into<wkt::Timestamp>,
4283    {
4284        self.create_time = v.map(|x| x.into());
4285        self
4286    }
4287
4288    /// Sets the value of [update_time][crate::model::Release::update_time].
4289    ///
4290    /// # Example
4291    /// ```ignore,no_run
4292    /// # use google_cloud_configdelivery_v1::model::Release;
4293    /// use wkt::Timestamp;
4294    /// let x = Release::new().set_update_time(Timestamp::default()/* use setters */);
4295    /// ```
4296    pub fn set_update_time<T>(mut self, v: T) -> Self
4297    where
4298        T: std::convert::Into<wkt::Timestamp>,
4299    {
4300        self.update_time = std::option::Option::Some(v.into());
4301        self
4302    }
4303
4304    /// Sets or clears the value of [update_time][crate::model::Release::update_time].
4305    ///
4306    /// # Example
4307    /// ```ignore,no_run
4308    /// # use google_cloud_configdelivery_v1::model::Release;
4309    /// use wkt::Timestamp;
4310    /// let x = Release::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
4311    /// let x = Release::new().set_or_clear_update_time(None::<Timestamp>);
4312    /// ```
4313    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
4314    where
4315        T: std::convert::Into<wkt::Timestamp>,
4316    {
4317        self.update_time = v.map(|x| x.into());
4318        self
4319    }
4320
4321    /// Sets the value of [labels][crate::model::Release::labels].
4322    ///
4323    /// # Example
4324    /// ```ignore,no_run
4325    /// # use google_cloud_configdelivery_v1::model::Release;
4326    /// let x = Release::new().set_labels([
4327    ///     ("key0", "abc"),
4328    ///     ("key1", "xyz"),
4329    /// ]);
4330    /// ```
4331    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
4332    where
4333        T: std::iter::IntoIterator<Item = (K, V)>,
4334        K: std::convert::Into<std::string::String>,
4335        V: std::convert::Into<std::string::String>,
4336    {
4337        use std::iter::Iterator;
4338        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
4339        self
4340    }
4341
4342    /// Sets the value of [lifecycle][crate::model::Release::lifecycle].
4343    ///
4344    /// # Example
4345    /// ```ignore,no_run
4346    /// # use google_cloud_configdelivery_v1::model::Release;
4347    /// use google_cloud_configdelivery_v1::model::release::Lifecycle;
4348    /// let x0 = Release::new().set_lifecycle(Lifecycle::Draft);
4349    /// let x1 = Release::new().set_lifecycle(Lifecycle::Published);
4350    /// ```
4351    pub fn set_lifecycle<T: std::convert::Into<crate::model::release::Lifecycle>>(
4352        mut self,
4353        v: T,
4354    ) -> Self {
4355        self.lifecycle = v.into();
4356        self
4357    }
4358
4359    /// Sets the value of [version][crate::model::Release::version].
4360    ///
4361    /// # Example
4362    /// ```ignore,no_run
4363    /// # use google_cloud_configdelivery_v1::model::Release;
4364    /// let x = Release::new().set_version("example");
4365    /// ```
4366    pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4367        self.version = v.into();
4368        self
4369    }
4370
4371    /// Sets the value of [publish_time][crate::model::Release::publish_time].
4372    ///
4373    /// # Example
4374    /// ```ignore,no_run
4375    /// # use google_cloud_configdelivery_v1::model::Release;
4376    /// use wkt::Timestamp;
4377    /// let x = Release::new().set_publish_time(Timestamp::default()/* use setters */);
4378    /// ```
4379    pub fn set_publish_time<T>(mut self, v: T) -> Self
4380    where
4381        T: std::convert::Into<wkt::Timestamp>,
4382    {
4383        self.publish_time = std::option::Option::Some(v.into());
4384        self
4385    }
4386
4387    /// Sets or clears the value of [publish_time][crate::model::Release::publish_time].
4388    ///
4389    /// # Example
4390    /// ```ignore,no_run
4391    /// # use google_cloud_configdelivery_v1::model::Release;
4392    /// use wkt::Timestamp;
4393    /// let x = Release::new().set_or_clear_publish_time(Some(Timestamp::default()/* use setters */));
4394    /// let x = Release::new().set_or_clear_publish_time(None::<Timestamp>);
4395    /// ```
4396    pub fn set_or_clear_publish_time<T>(mut self, v: std::option::Option<T>) -> Self
4397    where
4398        T: std::convert::Into<wkt::Timestamp>,
4399    {
4400        self.publish_time = v.map(|x| x.into());
4401        self
4402    }
4403
4404    /// Sets the value of [info][crate::model::Release::info].
4405    ///
4406    /// # Example
4407    /// ```ignore,no_run
4408    /// # use google_cloud_configdelivery_v1::model::Release;
4409    /// use google_cloud_configdelivery_v1::model::ReleaseInfo;
4410    /// let x = Release::new().set_info(ReleaseInfo::default()/* use setters */);
4411    /// ```
4412    pub fn set_info<T>(mut self, v: T) -> Self
4413    where
4414        T: std::convert::Into<crate::model::ReleaseInfo>,
4415    {
4416        self.info = std::option::Option::Some(v.into());
4417        self
4418    }
4419
4420    /// Sets or clears the value of [info][crate::model::Release::info].
4421    ///
4422    /// # Example
4423    /// ```ignore,no_run
4424    /// # use google_cloud_configdelivery_v1::model::Release;
4425    /// use google_cloud_configdelivery_v1::model::ReleaseInfo;
4426    /// let x = Release::new().set_or_clear_info(Some(ReleaseInfo::default()/* use setters */));
4427    /// let x = Release::new().set_or_clear_info(None::<ReleaseInfo>);
4428    /// ```
4429    pub fn set_or_clear_info<T>(mut self, v: std::option::Option<T>) -> Self
4430    where
4431        T: std::convert::Into<crate::model::ReleaseInfo>,
4432    {
4433        self.info = v.map(|x| x.into());
4434        self
4435    }
4436}
4437
4438impl wkt::message::Message for Release {
4439    fn typename() -> &'static str {
4440        "type.googleapis.com/google.cloud.configdelivery.v1.Release"
4441    }
4442}
4443
4444/// Defines additional types related to [Release].
4445pub mod release {
4446    #[allow(unused_imports)]
4447    use super::*;
4448
4449    /// Lifecycle indicates the state of the `Release`. A published release is
4450    /// immutable.
4451    ///
4452    /// # Working with unknown values
4453    ///
4454    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4455    /// additional enum variants at any time. Adding new variants is not considered
4456    /// a breaking change. Applications should write their code in anticipation of:
4457    ///
4458    /// - New values appearing in future releases of the client library, **and**
4459    /// - New values received dynamically, without application changes.
4460    ///
4461    /// Please consult the [Working with enums] section in the user guide for some
4462    /// guidelines.
4463    ///
4464    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
4465    #[derive(Clone, Debug, PartialEq)]
4466    #[non_exhaustive]
4467    pub enum Lifecycle {
4468        /// indicates lifecycle has not been specified.
4469        Unspecified,
4470        /// indicates that the `Release` is being edited.
4471        Draft,
4472        /// indicates that the `Release` is now published (or released) and
4473        /// immutable.
4474        Published,
4475        /// If set, the enum was initialized with an unknown value.
4476        ///
4477        /// Applications can examine the value using [Lifecycle::value] or
4478        /// [Lifecycle::name].
4479        UnknownValue(lifecycle::UnknownValue),
4480    }
4481
4482    #[doc(hidden)]
4483    pub mod lifecycle {
4484        #[allow(unused_imports)]
4485        use super::*;
4486        #[derive(Clone, Debug, PartialEq)]
4487        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4488    }
4489
4490    impl Lifecycle {
4491        /// Gets the enum value.
4492        ///
4493        /// Returns `None` if the enum contains an unknown value deserialized from
4494        /// the string representation of enums.
4495        pub fn value(&self) -> std::option::Option<i32> {
4496            match self {
4497                Self::Unspecified => std::option::Option::Some(0),
4498                Self::Draft => std::option::Option::Some(1),
4499                Self::Published => std::option::Option::Some(2),
4500                Self::UnknownValue(u) => u.0.value(),
4501            }
4502        }
4503
4504        /// Gets the enum value as a string.
4505        ///
4506        /// Returns `None` if the enum contains an unknown value deserialized from
4507        /// the integer representation of enums.
4508        pub fn name(&self) -> std::option::Option<&str> {
4509            match self {
4510                Self::Unspecified => std::option::Option::Some("LIFECYCLE_UNSPECIFIED"),
4511                Self::Draft => std::option::Option::Some("DRAFT"),
4512                Self::Published => std::option::Option::Some("PUBLISHED"),
4513                Self::UnknownValue(u) => u.0.name(),
4514            }
4515        }
4516    }
4517
4518    impl std::default::Default for Lifecycle {
4519        fn default() -> Self {
4520            use std::convert::From;
4521            Self::from(0)
4522        }
4523    }
4524
4525    impl std::fmt::Display for Lifecycle {
4526        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4527            wkt::internal::display_enum(f, self.name(), self.value())
4528        }
4529    }
4530
4531    impl std::convert::From<i32> for Lifecycle {
4532        fn from(value: i32) -> Self {
4533            match value {
4534                0 => Self::Unspecified,
4535                1 => Self::Draft,
4536                2 => Self::Published,
4537                _ => Self::UnknownValue(lifecycle::UnknownValue(
4538                    wkt::internal::UnknownEnumValue::Integer(value),
4539                )),
4540            }
4541        }
4542    }
4543
4544    impl std::convert::From<&str> for Lifecycle {
4545        fn from(value: &str) -> Self {
4546            use std::string::ToString;
4547            match value {
4548                "LIFECYCLE_UNSPECIFIED" => Self::Unspecified,
4549                "DRAFT" => Self::Draft,
4550                "PUBLISHED" => Self::Published,
4551                _ => Self::UnknownValue(lifecycle::UnknownValue(
4552                    wkt::internal::UnknownEnumValue::String(value.to_string()),
4553                )),
4554            }
4555        }
4556    }
4557
4558    impl serde::ser::Serialize for Lifecycle {
4559        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4560        where
4561            S: serde::Serializer,
4562        {
4563            match self {
4564                Self::Unspecified => serializer.serialize_i32(0),
4565                Self::Draft => serializer.serialize_i32(1),
4566                Self::Published => serializer.serialize_i32(2),
4567                Self::UnknownValue(u) => u.0.serialize(serializer),
4568            }
4569        }
4570    }
4571
4572    impl<'de> serde::de::Deserialize<'de> for Lifecycle {
4573        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4574        where
4575            D: serde::Deserializer<'de>,
4576        {
4577            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Lifecycle>::new(
4578                ".google.cloud.configdelivery.v1.Release.Lifecycle",
4579            ))
4580        }
4581    }
4582}
4583
4584/// Variant represents the content of a `ResourceBundle` variant.
4585#[derive(Clone, Default, PartialEq)]
4586#[non_exhaustive]
4587pub struct Variant {
4588    /// Optional. labels to represent any metadata associated with the variant.
4589    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
4590
4591    /// Required. Input only. Unordered list. resources contain the kubernetes
4592    /// manifests (YAMLs) for this variant.
4593    pub resources: std::vec::Vec<std::string::String>,
4594
4595    /// Identifier. Name follows format of
4596    /// projects/{project}/locations/{location}/resourceBundles/{resource_bundle}/releases/{release}/variants/{variant}
4597    pub name: std::string::String,
4598
4599    /// Output only. [Output only] Create time stamp
4600    pub create_time: std::option::Option<wkt::Timestamp>,
4601
4602    /// Output only. [Output only] Update time stamp
4603    pub update_time: std::option::Option<wkt::Timestamp>,
4604
4605    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4606}
4607
4608impl Variant {
4609    /// Creates a new default instance.
4610    pub fn new() -> Self {
4611        std::default::Default::default()
4612    }
4613
4614    /// Sets the value of [labels][crate::model::Variant::labels].
4615    ///
4616    /// # Example
4617    /// ```ignore,no_run
4618    /// # use google_cloud_configdelivery_v1::model::Variant;
4619    /// let x = Variant::new().set_labels([
4620    ///     ("key0", "abc"),
4621    ///     ("key1", "xyz"),
4622    /// ]);
4623    /// ```
4624    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
4625    where
4626        T: std::iter::IntoIterator<Item = (K, V)>,
4627        K: std::convert::Into<std::string::String>,
4628        V: std::convert::Into<std::string::String>,
4629    {
4630        use std::iter::Iterator;
4631        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
4632        self
4633    }
4634
4635    /// Sets the value of [resources][crate::model::Variant::resources].
4636    ///
4637    /// # Example
4638    /// ```ignore,no_run
4639    /// # use google_cloud_configdelivery_v1::model::Variant;
4640    /// let x = Variant::new().set_resources(["a", "b", "c"]);
4641    /// ```
4642    pub fn set_resources<T, V>(mut self, v: T) -> Self
4643    where
4644        T: std::iter::IntoIterator<Item = V>,
4645        V: std::convert::Into<std::string::String>,
4646    {
4647        use std::iter::Iterator;
4648        self.resources = v.into_iter().map(|i| i.into()).collect();
4649        self
4650    }
4651
4652    /// Sets the value of [name][crate::model::Variant::name].
4653    ///
4654    /// # Example
4655    /// ```ignore,no_run
4656    /// # use google_cloud_configdelivery_v1::model::Variant;
4657    /// # let project_id = "project_id";
4658    /// # let location_id = "location_id";
4659    /// # let resource_bundle_id = "resource_bundle_id";
4660    /// # let release_id = "release_id";
4661    /// # let variant_id = "variant_id";
4662    /// let x = Variant::new().set_name(format!("projects/{project_id}/locations/{location_id}/resourceBundles/{resource_bundle_id}/releases/{release_id}/variants/{variant_id}"));
4663    /// ```
4664    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4665        self.name = v.into();
4666        self
4667    }
4668
4669    /// Sets the value of [create_time][crate::model::Variant::create_time].
4670    ///
4671    /// # Example
4672    /// ```ignore,no_run
4673    /// # use google_cloud_configdelivery_v1::model::Variant;
4674    /// use wkt::Timestamp;
4675    /// let x = Variant::new().set_create_time(Timestamp::default()/* use setters */);
4676    /// ```
4677    pub fn set_create_time<T>(mut self, v: T) -> Self
4678    where
4679        T: std::convert::Into<wkt::Timestamp>,
4680    {
4681        self.create_time = std::option::Option::Some(v.into());
4682        self
4683    }
4684
4685    /// Sets or clears the value of [create_time][crate::model::Variant::create_time].
4686    ///
4687    /// # Example
4688    /// ```ignore,no_run
4689    /// # use google_cloud_configdelivery_v1::model::Variant;
4690    /// use wkt::Timestamp;
4691    /// let x = Variant::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
4692    /// let x = Variant::new().set_or_clear_create_time(None::<Timestamp>);
4693    /// ```
4694    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
4695    where
4696        T: std::convert::Into<wkt::Timestamp>,
4697    {
4698        self.create_time = v.map(|x| x.into());
4699        self
4700    }
4701
4702    /// Sets the value of [update_time][crate::model::Variant::update_time].
4703    ///
4704    /// # Example
4705    /// ```ignore,no_run
4706    /// # use google_cloud_configdelivery_v1::model::Variant;
4707    /// use wkt::Timestamp;
4708    /// let x = Variant::new().set_update_time(Timestamp::default()/* use setters */);
4709    /// ```
4710    pub fn set_update_time<T>(mut self, v: T) -> Self
4711    where
4712        T: std::convert::Into<wkt::Timestamp>,
4713    {
4714        self.update_time = std::option::Option::Some(v.into());
4715        self
4716    }
4717
4718    /// Sets or clears the value of [update_time][crate::model::Variant::update_time].
4719    ///
4720    /// # Example
4721    /// ```ignore,no_run
4722    /// # use google_cloud_configdelivery_v1::model::Variant;
4723    /// use wkt::Timestamp;
4724    /// let x = Variant::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
4725    /// let x = Variant::new().set_or_clear_update_time(None::<Timestamp>);
4726    /// ```
4727    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
4728    where
4729        T: std::convert::Into<wkt::Timestamp>,
4730    {
4731        self.update_time = v.map(|x| x.into());
4732        self
4733    }
4734}
4735
4736impl wkt::message::Message for Variant {
4737    fn typename() -> &'static str {
4738        "type.googleapis.com/google.cloud.configdelivery.v1.Variant"
4739    }
4740}
4741
4742/// Message for requesting list of Variants.
4743#[derive(Clone, Default, PartialEq)]
4744#[non_exhaustive]
4745pub struct ListVariantsRequest {
4746    /// Required. Parent value for ListVariantsRequest.
4747    pub parent: std::string::String,
4748
4749    /// Optional. Requested page size. Server may return fewer items than
4750    /// requested. If unspecified, server will pick an appropriate default.
4751    pub page_size: i32,
4752
4753    /// Optional. A token identifying a page of results the server should return.
4754    pub page_token: std::string::String,
4755
4756    /// Optional. Filtering results.
4757    pub filter: std::string::String,
4758
4759    /// Optional. Hint for how to order the results.
4760    pub order_by: std::string::String,
4761
4762    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4763}
4764
4765impl ListVariantsRequest {
4766    /// Creates a new default instance.
4767    pub fn new() -> Self {
4768        std::default::Default::default()
4769    }
4770
4771    /// Sets the value of [parent][crate::model::ListVariantsRequest::parent].
4772    ///
4773    /// # Example
4774    /// ```ignore,no_run
4775    /// # use google_cloud_configdelivery_v1::model::ListVariantsRequest;
4776    /// # let project_id = "project_id";
4777    /// # let location_id = "location_id";
4778    /// # let resource_bundle_id = "resource_bundle_id";
4779    /// # let release_id = "release_id";
4780    /// let x = ListVariantsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/resourceBundles/{resource_bundle_id}/releases/{release_id}"));
4781    /// ```
4782    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4783        self.parent = v.into();
4784        self
4785    }
4786
4787    /// Sets the value of [page_size][crate::model::ListVariantsRequest::page_size].
4788    ///
4789    /// # Example
4790    /// ```ignore,no_run
4791    /// # use google_cloud_configdelivery_v1::model::ListVariantsRequest;
4792    /// let x = ListVariantsRequest::new().set_page_size(42);
4793    /// ```
4794    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4795        self.page_size = v.into();
4796        self
4797    }
4798
4799    /// Sets the value of [page_token][crate::model::ListVariantsRequest::page_token].
4800    ///
4801    /// # Example
4802    /// ```ignore,no_run
4803    /// # use google_cloud_configdelivery_v1::model::ListVariantsRequest;
4804    /// let x = ListVariantsRequest::new().set_page_token("example");
4805    /// ```
4806    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4807        self.page_token = v.into();
4808        self
4809    }
4810
4811    /// Sets the value of [filter][crate::model::ListVariantsRequest::filter].
4812    ///
4813    /// # Example
4814    /// ```ignore,no_run
4815    /// # use google_cloud_configdelivery_v1::model::ListVariantsRequest;
4816    /// let x = ListVariantsRequest::new().set_filter("example");
4817    /// ```
4818    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4819        self.filter = v.into();
4820        self
4821    }
4822
4823    /// Sets the value of [order_by][crate::model::ListVariantsRequest::order_by].
4824    ///
4825    /// # Example
4826    /// ```ignore,no_run
4827    /// # use google_cloud_configdelivery_v1::model::ListVariantsRequest;
4828    /// let x = ListVariantsRequest::new().set_order_by("example");
4829    /// ```
4830    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4831        self.order_by = v.into();
4832        self
4833    }
4834}
4835
4836impl wkt::message::Message for ListVariantsRequest {
4837    fn typename() -> &'static str {
4838        "type.googleapis.com/google.cloud.configdelivery.v1.ListVariantsRequest"
4839    }
4840}
4841
4842/// Message for response to listing Variants
4843#[derive(Clone, Default, PartialEq)]
4844#[non_exhaustive]
4845pub struct ListVariantsResponse {
4846    /// The list of Variants
4847    pub variants: std::vec::Vec<crate::model::Variant>,
4848
4849    /// A token identifying a page of results the server should return.
4850    pub next_page_token: std::string::String,
4851
4852    /// Unordered list. Locations that could not be reached.
4853    pub unreachable: std::vec::Vec<std::string::String>,
4854
4855    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4856}
4857
4858impl ListVariantsResponse {
4859    /// Creates a new default instance.
4860    pub fn new() -> Self {
4861        std::default::Default::default()
4862    }
4863
4864    /// Sets the value of [variants][crate::model::ListVariantsResponse::variants].
4865    ///
4866    /// # Example
4867    /// ```ignore,no_run
4868    /// # use google_cloud_configdelivery_v1::model::ListVariantsResponse;
4869    /// use google_cloud_configdelivery_v1::model::Variant;
4870    /// let x = ListVariantsResponse::new()
4871    ///     .set_variants([
4872    ///         Variant::default()/* use setters */,
4873    ///         Variant::default()/* use (different) setters */,
4874    ///     ]);
4875    /// ```
4876    pub fn set_variants<T, V>(mut self, v: T) -> Self
4877    where
4878        T: std::iter::IntoIterator<Item = V>,
4879        V: std::convert::Into<crate::model::Variant>,
4880    {
4881        use std::iter::Iterator;
4882        self.variants = v.into_iter().map(|i| i.into()).collect();
4883        self
4884    }
4885
4886    /// Sets the value of [next_page_token][crate::model::ListVariantsResponse::next_page_token].
4887    ///
4888    /// # Example
4889    /// ```ignore,no_run
4890    /// # use google_cloud_configdelivery_v1::model::ListVariantsResponse;
4891    /// let x = ListVariantsResponse::new().set_next_page_token("example");
4892    /// ```
4893    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4894        self.next_page_token = v.into();
4895        self
4896    }
4897
4898    /// Sets the value of [unreachable][crate::model::ListVariantsResponse::unreachable].
4899    ///
4900    /// # Example
4901    /// ```ignore,no_run
4902    /// # use google_cloud_configdelivery_v1::model::ListVariantsResponse;
4903    /// let x = ListVariantsResponse::new().set_unreachable(["a", "b", "c"]);
4904    /// ```
4905    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
4906    where
4907        T: std::iter::IntoIterator<Item = V>,
4908        V: std::convert::Into<std::string::String>,
4909    {
4910        use std::iter::Iterator;
4911        self.unreachable = v.into_iter().map(|i| i.into()).collect();
4912        self
4913    }
4914}
4915
4916impl wkt::message::Message for ListVariantsResponse {
4917    fn typename() -> &'static str {
4918        "type.googleapis.com/google.cloud.configdelivery.v1.ListVariantsResponse"
4919    }
4920}
4921
4922#[doc(hidden)]
4923impl google_cloud_gax::paginator::internal::PageableResponse for ListVariantsResponse {
4924    type PageItem = crate::model::Variant;
4925
4926    fn items(self) -> std::vec::Vec<Self::PageItem> {
4927        self.variants
4928    }
4929
4930    fn next_page_token(&self) -> std::string::String {
4931        use std::clone::Clone;
4932        self.next_page_token.clone()
4933    }
4934}
4935
4936/// Message for getting a Variant
4937#[derive(Clone, Default, PartialEq)]
4938#[non_exhaustive]
4939pub struct GetVariantRequest {
4940    /// Required. Name of the resource
4941    pub name: std::string::String,
4942
4943    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4944}
4945
4946impl GetVariantRequest {
4947    /// Creates a new default instance.
4948    pub fn new() -> Self {
4949        std::default::Default::default()
4950    }
4951
4952    /// Sets the value of [name][crate::model::GetVariantRequest::name].
4953    ///
4954    /// # Example
4955    /// ```ignore,no_run
4956    /// # use google_cloud_configdelivery_v1::model::GetVariantRequest;
4957    /// # let project_id = "project_id";
4958    /// # let location_id = "location_id";
4959    /// # let resource_bundle_id = "resource_bundle_id";
4960    /// # let release_id = "release_id";
4961    /// # let variant_id = "variant_id";
4962    /// let x = GetVariantRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/resourceBundles/{resource_bundle_id}/releases/{release_id}/variants/{variant_id}"));
4963    /// ```
4964    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4965        self.name = v.into();
4966        self
4967    }
4968}
4969
4970impl wkt::message::Message for GetVariantRequest {
4971    fn typename() -> &'static str {
4972        "type.googleapis.com/google.cloud.configdelivery.v1.GetVariantRequest"
4973    }
4974}
4975
4976/// Message for creating a Variant
4977#[derive(Clone, Default, PartialEq)]
4978#[non_exhaustive]
4979pub struct CreateVariantRequest {
4980    /// Required. Value for parent.
4981    pub parent: std::string::String,
4982
4983    /// Required. Id of the requesting object
4984    pub variant_id: std::string::String,
4985
4986    /// Required. The resource being created
4987    pub variant: std::option::Option<crate::model::Variant>,
4988
4989    /// Optional. An optional request ID to identify requests. Specify a unique
4990    /// request ID so that if you must retry your request, the server will know to
4991    /// ignore the request if it has already been completed. The server will
4992    /// guarantee that for at least 60 minutes since the first request.
4993    ///
4994    /// For example, consider a situation where you make an initial request and the
4995    /// request times out. If you make the request again with the same request
4996    /// ID, the server can check if original operation with the same request ID
4997    /// was received, and if so, will ignore the second request. This prevents
4998    /// clients from accidentally creating duplicate commitments.
4999    ///
5000    /// The request ID must be a valid UUID with the exception that zero UUID is
5001    /// not supported (00000000-0000-0000-0000-000000000000).
5002    pub request_id: std::string::String,
5003
5004    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5005}
5006
5007impl CreateVariantRequest {
5008    /// Creates a new default instance.
5009    pub fn new() -> Self {
5010        std::default::Default::default()
5011    }
5012
5013    /// Sets the value of [parent][crate::model::CreateVariantRequest::parent].
5014    ///
5015    /// # Example
5016    /// ```ignore,no_run
5017    /// # use google_cloud_configdelivery_v1::model::CreateVariantRequest;
5018    /// # let project_id = "project_id";
5019    /// # let location_id = "location_id";
5020    /// # let resource_bundle_id = "resource_bundle_id";
5021    /// # let release_id = "release_id";
5022    /// let x = CreateVariantRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/resourceBundles/{resource_bundle_id}/releases/{release_id}"));
5023    /// ```
5024    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5025        self.parent = v.into();
5026        self
5027    }
5028
5029    /// Sets the value of [variant_id][crate::model::CreateVariantRequest::variant_id].
5030    ///
5031    /// # Example
5032    /// ```ignore,no_run
5033    /// # use google_cloud_configdelivery_v1::model::CreateVariantRequest;
5034    /// let x = CreateVariantRequest::new().set_variant_id("example");
5035    /// ```
5036    pub fn set_variant_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5037        self.variant_id = v.into();
5038        self
5039    }
5040
5041    /// Sets the value of [variant][crate::model::CreateVariantRequest::variant].
5042    ///
5043    /// # Example
5044    /// ```ignore,no_run
5045    /// # use google_cloud_configdelivery_v1::model::CreateVariantRequest;
5046    /// use google_cloud_configdelivery_v1::model::Variant;
5047    /// let x = CreateVariantRequest::new().set_variant(Variant::default()/* use setters */);
5048    /// ```
5049    pub fn set_variant<T>(mut self, v: T) -> Self
5050    where
5051        T: std::convert::Into<crate::model::Variant>,
5052    {
5053        self.variant = std::option::Option::Some(v.into());
5054        self
5055    }
5056
5057    /// Sets or clears the value of [variant][crate::model::CreateVariantRequest::variant].
5058    ///
5059    /// # Example
5060    /// ```ignore,no_run
5061    /// # use google_cloud_configdelivery_v1::model::CreateVariantRequest;
5062    /// use google_cloud_configdelivery_v1::model::Variant;
5063    /// let x = CreateVariantRequest::new().set_or_clear_variant(Some(Variant::default()/* use setters */));
5064    /// let x = CreateVariantRequest::new().set_or_clear_variant(None::<Variant>);
5065    /// ```
5066    pub fn set_or_clear_variant<T>(mut self, v: std::option::Option<T>) -> Self
5067    where
5068        T: std::convert::Into<crate::model::Variant>,
5069    {
5070        self.variant = v.map(|x| x.into());
5071        self
5072    }
5073
5074    /// Sets the value of [request_id][crate::model::CreateVariantRequest::request_id].
5075    ///
5076    /// # Example
5077    /// ```ignore,no_run
5078    /// # use google_cloud_configdelivery_v1::model::CreateVariantRequest;
5079    /// let x = CreateVariantRequest::new().set_request_id("example");
5080    /// ```
5081    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5082        self.request_id = v.into();
5083        self
5084    }
5085}
5086
5087impl wkt::message::Message for CreateVariantRequest {
5088    fn typename() -> &'static str {
5089        "type.googleapis.com/google.cloud.configdelivery.v1.CreateVariantRequest"
5090    }
5091}
5092
5093/// Message for updating a Variant
5094#[derive(Clone, Default, PartialEq)]
5095#[non_exhaustive]
5096pub struct UpdateVariantRequest {
5097    /// Optional. Field mask is used to specify the fields to be overwritten in the
5098    /// Variant resource by the update.
5099    /// The fields specified in the update_mask are relative to the resource, not
5100    /// the full request. A field will be overwritten if it is in the mask. If the
5101    /// user does not provide a mask then all fields will be overwritten.
5102    pub update_mask: std::option::Option<wkt::FieldMask>,
5103
5104    /// Required. The resource being updated
5105    pub variant: std::option::Option<crate::model::Variant>,
5106
5107    /// Optional. An optional request ID to identify requests. Specify a unique
5108    /// request ID so that if you must retry your request, the server will know to
5109    /// ignore the request if it has already been completed. The server will
5110    /// guarantee that for at least 60 minutes since the first request.
5111    ///
5112    /// For example, consider a situation where you make an initial request and the
5113    /// request times out. If you make the request again with the same request
5114    /// ID, the server can check if original operation with the same request ID
5115    /// was received, and if so, will ignore the second request. This prevents
5116    /// clients from accidentally creating duplicate commitments.
5117    ///
5118    /// The request ID must be a valid UUID with the exception that zero UUID is
5119    /// not supported (00000000-0000-0000-0000-000000000000).
5120    pub request_id: std::string::String,
5121
5122    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5123}
5124
5125impl UpdateVariantRequest {
5126    /// Creates a new default instance.
5127    pub fn new() -> Self {
5128        std::default::Default::default()
5129    }
5130
5131    /// Sets the value of [update_mask][crate::model::UpdateVariantRequest::update_mask].
5132    ///
5133    /// # Example
5134    /// ```ignore,no_run
5135    /// # use google_cloud_configdelivery_v1::model::UpdateVariantRequest;
5136    /// use wkt::FieldMask;
5137    /// let x = UpdateVariantRequest::new().set_update_mask(FieldMask::default()/* use setters */);
5138    /// ```
5139    pub fn set_update_mask<T>(mut self, v: T) -> Self
5140    where
5141        T: std::convert::Into<wkt::FieldMask>,
5142    {
5143        self.update_mask = std::option::Option::Some(v.into());
5144        self
5145    }
5146
5147    /// Sets or clears the value of [update_mask][crate::model::UpdateVariantRequest::update_mask].
5148    ///
5149    /// # Example
5150    /// ```ignore,no_run
5151    /// # use google_cloud_configdelivery_v1::model::UpdateVariantRequest;
5152    /// use wkt::FieldMask;
5153    /// let x = UpdateVariantRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
5154    /// let x = UpdateVariantRequest::new().set_or_clear_update_mask(None::<FieldMask>);
5155    /// ```
5156    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5157    where
5158        T: std::convert::Into<wkt::FieldMask>,
5159    {
5160        self.update_mask = v.map(|x| x.into());
5161        self
5162    }
5163
5164    /// Sets the value of [variant][crate::model::UpdateVariantRequest::variant].
5165    ///
5166    /// # Example
5167    /// ```ignore,no_run
5168    /// # use google_cloud_configdelivery_v1::model::UpdateVariantRequest;
5169    /// use google_cloud_configdelivery_v1::model::Variant;
5170    /// let x = UpdateVariantRequest::new().set_variant(Variant::default()/* use setters */);
5171    /// ```
5172    pub fn set_variant<T>(mut self, v: T) -> Self
5173    where
5174        T: std::convert::Into<crate::model::Variant>,
5175    {
5176        self.variant = std::option::Option::Some(v.into());
5177        self
5178    }
5179
5180    /// Sets or clears the value of [variant][crate::model::UpdateVariantRequest::variant].
5181    ///
5182    /// # Example
5183    /// ```ignore,no_run
5184    /// # use google_cloud_configdelivery_v1::model::UpdateVariantRequest;
5185    /// use google_cloud_configdelivery_v1::model::Variant;
5186    /// let x = UpdateVariantRequest::new().set_or_clear_variant(Some(Variant::default()/* use setters */));
5187    /// let x = UpdateVariantRequest::new().set_or_clear_variant(None::<Variant>);
5188    /// ```
5189    pub fn set_or_clear_variant<T>(mut self, v: std::option::Option<T>) -> Self
5190    where
5191        T: std::convert::Into<crate::model::Variant>,
5192    {
5193        self.variant = v.map(|x| x.into());
5194        self
5195    }
5196
5197    /// Sets the value of [request_id][crate::model::UpdateVariantRequest::request_id].
5198    ///
5199    /// # Example
5200    /// ```ignore,no_run
5201    /// # use google_cloud_configdelivery_v1::model::UpdateVariantRequest;
5202    /// let x = UpdateVariantRequest::new().set_request_id("example");
5203    /// ```
5204    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5205        self.request_id = v.into();
5206        self
5207    }
5208}
5209
5210impl wkt::message::Message for UpdateVariantRequest {
5211    fn typename() -> &'static str {
5212        "type.googleapis.com/google.cloud.configdelivery.v1.UpdateVariantRequest"
5213    }
5214}
5215
5216/// Message for deleting a Variant
5217#[derive(Clone, Default, PartialEq)]
5218#[non_exhaustive]
5219pub struct DeleteVariantRequest {
5220    /// Required. Name of the resource
5221    pub name: std::string::String,
5222
5223    /// Optional. An optional request ID to identify requests. Specify a unique
5224    /// request ID so that if you must retry your request, the server will know to
5225    /// ignore the request if it has already been completed. The server will
5226    /// guarantee that for at least 60 minutes after the first request.
5227    ///
5228    /// For example, consider a situation where you make an initial request and the
5229    /// request times out. If you make the request again with the same request
5230    /// ID, the server can check if original operation with the same request ID
5231    /// was received, and if so, will ignore the second request. This prevents
5232    /// clients from accidentally creating duplicate commitments.
5233    ///
5234    /// The request ID must be a valid UUID with the exception that zero UUID is
5235    /// not supported (00000000-0000-0000-0000-000000000000).
5236    pub request_id: std::string::String,
5237
5238    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5239}
5240
5241impl DeleteVariantRequest {
5242    /// Creates a new default instance.
5243    pub fn new() -> Self {
5244        std::default::Default::default()
5245    }
5246
5247    /// Sets the value of [name][crate::model::DeleteVariantRequest::name].
5248    ///
5249    /// # Example
5250    /// ```ignore,no_run
5251    /// # use google_cloud_configdelivery_v1::model::DeleteVariantRequest;
5252    /// # let project_id = "project_id";
5253    /// # let location_id = "location_id";
5254    /// # let resource_bundle_id = "resource_bundle_id";
5255    /// # let release_id = "release_id";
5256    /// # let variant_id = "variant_id";
5257    /// let x = DeleteVariantRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/resourceBundles/{resource_bundle_id}/releases/{release_id}/variants/{variant_id}"));
5258    /// ```
5259    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5260        self.name = v.into();
5261        self
5262    }
5263
5264    /// Sets the value of [request_id][crate::model::DeleteVariantRequest::request_id].
5265    ///
5266    /// # Example
5267    /// ```ignore,no_run
5268    /// # use google_cloud_configdelivery_v1::model::DeleteVariantRequest;
5269    /// let x = DeleteVariantRequest::new().set_request_id("example");
5270    /// ```
5271    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5272        self.request_id = v.into();
5273        self
5274    }
5275}
5276
5277impl wkt::message::Message for DeleteVariantRequest {
5278    fn typename() -> &'static str {
5279        "type.googleapis.com/google.cloud.configdelivery.v1.DeleteVariantRequest"
5280    }
5281}
5282
5283/// ReleaseInfo contains extra information about the `ResourceBundle` release
5284/// e.g., link to an artifact registry OCI image.
5285#[derive(Clone, Default, PartialEq)]
5286#[non_exhaustive]
5287pub struct ReleaseInfo {
5288    /// Output only. path to the oci image the service uploads to on a `Release`
5289    /// creation.
5290    pub oci_image_path: std::string::String,
5291
5292    /// Optional. per-variant paths to the oci images the service uploads on
5293    /// package release creation
5294    pub variant_oci_image_paths:
5295        std::collections::HashMap<std::string::String, std::string::String>,
5296
5297    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5298}
5299
5300impl ReleaseInfo {
5301    /// Creates a new default instance.
5302    pub fn new() -> Self {
5303        std::default::Default::default()
5304    }
5305
5306    /// Sets the value of [oci_image_path][crate::model::ReleaseInfo::oci_image_path].
5307    ///
5308    /// # Example
5309    /// ```ignore,no_run
5310    /// # use google_cloud_configdelivery_v1::model::ReleaseInfo;
5311    /// let x = ReleaseInfo::new().set_oci_image_path("example");
5312    /// ```
5313    pub fn set_oci_image_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5314        self.oci_image_path = v.into();
5315        self
5316    }
5317
5318    /// Sets the value of [variant_oci_image_paths][crate::model::ReleaseInfo::variant_oci_image_paths].
5319    ///
5320    /// # Example
5321    /// ```ignore,no_run
5322    /// # use google_cloud_configdelivery_v1::model::ReleaseInfo;
5323    /// let x = ReleaseInfo::new().set_variant_oci_image_paths([
5324    ///     ("key0", "abc"),
5325    ///     ("key1", "xyz"),
5326    /// ]);
5327    /// ```
5328    pub fn set_variant_oci_image_paths<T, K, V>(mut self, v: T) -> Self
5329    where
5330        T: std::iter::IntoIterator<Item = (K, V)>,
5331        K: std::convert::Into<std::string::String>,
5332        V: std::convert::Into<std::string::String>,
5333    {
5334        use std::iter::Iterator;
5335        self.variant_oci_image_paths = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5336        self
5337    }
5338}
5339
5340impl wkt::message::Message for ReleaseInfo {
5341    fn typename() -> &'static str {
5342        "type.googleapis.com/google.cloud.configdelivery.v1.ReleaseInfo"
5343    }
5344}
5345
5346/// Message for requesting list of Releases.
5347#[derive(Clone, Default, PartialEq)]
5348#[non_exhaustive]
5349pub struct ListReleasesRequest {
5350    /// Required. Parent value for ListReleasesRequest.
5351    pub parent: std::string::String,
5352
5353    /// Optional. Requested page size. Server may return fewer items than
5354    /// requested. If unspecified, server will pick an appropriate default.
5355    pub page_size: i32,
5356
5357    /// Optional. A token identifying a page of results the server should return.
5358    pub page_token: std::string::String,
5359
5360    /// Optional. Filtering results.
5361    pub filter: std::string::String,
5362
5363    /// Optional. Hint for how to order the results.
5364    pub order_by: std::string::String,
5365
5366    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5367}
5368
5369impl ListReleasesRequest {
5370    /// Creates a new default instance.
5371    pub fn new() -> Self {
5372        std::default::Default::default()
5373    }
5374
5375    /// Sets the value of [parent][crate::model::ListReleasesRequest::parent].
5376    ///
5377    /// # Example
5378    /// ```ignore,no_run
5379    /// # use google_cloud_configdelivery_v1::model::ListReleasesRequest;
5380    /// # let project_id = "project_id";
5381    /// # let location_id = "location_id";
5382    /// # let resource_bundle_id = "resource_bundle_id";
5383    /// let x = ListReleasesRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/resourceBundles/{resource_bundle_id}"));
5384    /// ```
5385    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5386        self.parent = v.into();
5387        self
5388    }
5389
5390    /// Sets the value of [page_size][crate::model::ListReleasesRequest::page_size].
5391    ///
5392    /// # Example
5393    /// ```ignore,no_run
5394    /// # use google_cloud_configdelivery_v1::model::ListReleasesRequest;
5395    /// let x = ListReleasesRequest::new().set_page_size(42);
5396    /// ```
5397    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5398        self.page_size = v.into();
5399        self
5400    }
5401
5402    /// Sets the value of [page_token][crate::model::ListReleasesRequest::page_token].
5403    ///
5404    /// # Example
5405    /// ```ignore,no_run
5406    /// # use google_cloud_configdelivery_v1::model::ListReleasesRequest;
5407    /// let x = ListReleasesRequest::new().set_page_token("example");
5408    /// ```
5409    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5410        self.page_token = v.into();
5411        self
5412    }
5413
5414    /// Sets the value of [filter][crate::model::ListReleasesRequest::filter].
5415    ///
5416    /// # Example
5417    /// ```ignore,no_run
5418    /// # use google_cloud_configdelivery_v1::model::ListReleasesRequest;
5419    /// let x = ListReleasesRequest::new().set_filter("example");
5420    /// ```
5421    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5422        self.filter = v.into();
5423        self
5424    }
5425
5426    /// Sets the value of [order_by][crate::model::ListReleasesRequest::order_by].
5427    ///
5428    /// # Example
5429    /// ```ignore,no_run
5430    /// # use google_cloud_configdelivery_v1::model::ListReleasesRequest;
5431    /// let x = ListReleasesRequest::new().set_order_by("example");
5432    /// ```
5433    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5434        self.order_by = v.into();
5435        self
5436    }
5437}
5438
5439impl wkt::message::Message for ListReleasesRequest {
5440    fn typename() -> &'static str {
5441        "type.googleapis.com/google.cloud.configdelivery.v1.ListReleasesRequest"
5442    }
5443}
5444
5445/// Message for response to listing Releases
5446#[derive(Clone, Default, PartialEq)]
5447#[non_exhaustive]
5448pub struct ListReleasesResponse {
5449    /// The list of Releases
5450    pub releases: std::vec::Vec<crate::model::Release>,
5451
5452    /// A token identifying a page of results the server should return.
5453    pub next_page_token: std::string::String,
5454
5455    /// Unordered list. Locations that could not be reached.
5456    pub unreachable: std::vec::Vec<std::string::String>,
5457
5458    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5459}
5460
5461impl ListReleasesResponse {
5462    /// Creates a new default instance.
5463    pub fn new() -> Self {
5464        std::default::Default::default()
5465    }
5466
5467    /// Sets the value of [releases][crate::model::ListReleasesResponse::releases].
5468    ///
5469    /// # Example
5470    /// ```ignore,no_run
5471    /// # use google_cloud_configdelivery_v1::model::ListReleasesResponse;
5472    /// use google_cloud_configdelivery_v1::model::Release;
5473    /// let x = ListReleasesResponse::new()
5474    ///     .set_releases([
5475    ///         Release::default()/* use setters */,
5476    ///         Release::default()/* use (different) setters */,
5477    ///     ]);
5478    /// ```
5479    pub fn set_releases<T, V>(mut self, v: T) -> Self
5480    where
5481        T: std::iter::IntoIterator<Item = V>,
5482        V: std::convert::Into<crate::model::Release>,
5483    {
5484        use std::iter::Iterator;
5485        self.releases = v.into_iter().map(|i| i.into()).collect();
5486        self
5487    }
5488
5489    /// Sets the value of [next_page_token][crate::model::ListReleasesResponse::next_page_token].
5490    ///
5491    /// # Example
5492    /// ```ignore,no_run
5493    /// # use google_cloud_configdelivery_v1::model::ListReleasesResponse;
5494    /// let x = ListReleasesResponse::new().set_next_page_token("example");
5495    /// ```
5496    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5497        self.next_page_token = v.into();
5498        self
5499    }
5500
5501    /// Sets the value of [unreachable][crate::model::ListReleasesResponse::unreachable].
5502    ///
5503    /// # Example
5504    /// ```ignore,no_run
5505    /// # use google_cloud_configdelivery_v1::model::ListReleasesResponse;
5506    /// let x = ListReleasesResponse::new().set_unreachable(["a", "b", "c"]);
5507    /// ```
5508    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
5509    where
5510        T: std::iter::IntoIterator<Item = V>,
5511        V: std::convert::Into<std::string::String>,
5512    {
5513        use std::iter::Iterator;
5514        self.unreachable = v.into_iter().map(|i| i.into()).collect();
5515        self
5516    }
5517}
5518
5519impl wkt::message::Message for ListReleasesResponse {
5520    fn typename() -> &'static str {
5521        "type.googleapis.com/google.cloud.configdelivery.v1.ListReleasesResponse"
5522    }
5523}
5524
5525#[doc(hidden)]
5526impl google_cloud_gax::paginator::internal::PageableResponse for ListReleasesResponse {
5527    type PageItem = crate::model::Release;
5528
5529    fn items(self) -> std::vec::Vec<Self::PageItem> {
5530        self.releases
5531    }
5532
5533    fn next_page_token(&self) -> std::string::String {
5534        use std::clone::Clone;
5535        self.next_page_token.clone()
5536    }
5537}
5538
5539/// Message for getting a Release
5540#[derive(Clone, Default, PartialEq)]
5541#[non_exhaustive]
5542pub struct GetReleaseRequest {
5543    /// Required. Name of the resource
5544    pub name: std::string::String,
5545
5546    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5547}
5548
5549impl GetReleaseRequest {
5550    /// Creates a new default instance.
5551    pub fn new() -> Self {
5552        std::default::Default::default()
5553    }
5554
5555    /// Sets the value of [name][crate::model::GetReleaseRequest::name].
5556    ///
5557    /// # Example
5558    /// ```ignore,no_run
5559    /// # use google_cloud_configdelivery_v1::model::GetReleaseRequest;
5560    /// # let project_id = "project_id";
5561    /// # let location_id = "location_id";
5562    /// # let resource_bundle_id = "resource_bundle_id";
5563    /// # let release_id = "release_id";
5564    /// let x = GetReleaseRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/resourceBundles/{resource_bundle_id}/releases/{release_id}"));
5565    /// ```
5566    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5567        self.name = v.into();
5568        self
5569    }
5570}
5571
5572impl wkt::message::Message for GetReleaseRequest {
5573    fn typename() -> &'static str {
5574        "type.googleapis.com/google.cloud.configdelivery.v1.GetReleaseRequest"
5575    }
5576}
5577
5578/// Message for creating a Release
5579#[derive(Clone, Default, PartialEq)]
5580#[non_exhaustive]
5581pub struct CreateReleaseRequest {
5582    /// Required. Value for parent.
5583    pub parent: std::string::String,
5584
5585    /// Required. Id of the requesting object
5586    /// If auto-generating Id server-side, remove this field and
5587    /// release_id from the method_signature of Create RPC
5588    pub release_id: std::string::String,
5589
5590    /// Required. The resource being created
5591    pub release: std::option::Option<crate::model::Release>,
5592
5593    /// Optional. An optional request ID to identify requests. Specify a unique
5594    /// request ID so that if you must retry your request, the server will know to
5595    /// ignore the request if it has already been completed. The server will
5596    /// guarantee that for at least 60 minutes since the first request.
5597    ///
5598    /// For example, consider a situation where you make an initial request and the
5599    /// request times out. If you make the request again with the same request
5600    /// ID, the server can check if original operation with the same request ID
5601    /// was received, and if so, will ignore the second request. This prevents
5602    /// clients from accidentally creating duplicate commitments.
5603    ///
5604    /// The request ID must be a valid UUID with the exception that zero UUID is
5605    /// not supported (00000000-0000-0000-0000-000000000000).
5606    pub request_id: std::string::String,
5607
5608    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5609}
5610
5611impl CreateReleaseRequest {
5612    /// Creates a new default instance.
5613    pub fn new() -> Self {
5614        std::default::Default::default()
5615    }
5616
5617    /// Sets the value of [parent][crate::model::CreateReleaseRequest::parent].
5618    ///
5619    /// # Example
5620    /// ```ignore,no_run
5621    /// # use google_cloud_configdelivery_v1::model::CreateReleaseRequest;
5622    /// # let project_id = "project_id";
5623    /// # let location_id = "location_id";
5624    /// # let resource_bundle_id = "resource_bundle_id";
5625    /// let x = CreateReleaseRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/resourceBundles/{resource_bundle_id}"));
5626    /// ```
5627    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5628        self.parent = v.into();
5629        self
5630    }
5631
5632    /// Sets the value of [release_id][crate::model::CreateReleaseRequest::release_id].
5633    ///
5634    /// # Example
5635    /// ```ignore,no_run
5636    /// # use google_cloud_configdelivery_v1::model::CreateReleaseRequest;
5637    /// let x = CreateReleaseRequest::new().set_release_id("example");
5638    /// ```
5639    pub fn set_release_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5640        self.release_id = v.into();
5641        self
5642    }
5643
5644    /// Sets the value of [release][crate::model::CreateReleaseRequest::release].
5645    ///
5646    /// # Example
5647    /// ```ignore,no_run
5648    /// # use google_cloud_configdelivery_v1::model::CreateReleaseRequest;
5649    /// use google_cloud_configdelivery_v1::model::Release;
5650    /// let x = CreateReleaseRequest::new().set_release(Release::default()/* use setters */);
5651    /// ```
5652    pub fn set_release<T>(mut self, v: T) -> Self
5653    where
5654        T: std::convert::Into<crate::model::Release>,
5655    {
5656        self.release = std::option::Option::Some(v.into());
5657        self
5658    }
5659
5660    /// Sets or clears the value of [release][crate::model::CreateReleaseRequest::release].
5661    ///
5662    /// # Example
5663    /// ```ignore,no_run
5664    /// # use google_cloud_configdelivery_v1::model::CreateReleaseRequest;
5665    /// use google_cloud_configdelivery_v1::model::Release;
5666    /// let x = CreateReleaseRequest::new().set_or_clear_release(Some(Release::default()/* use setters */));
5667    /// let x = CreateReleaseRequest::new().set_or_clear_release(None::<Release>);
5668    /// ```
5669    pub fn set_or_clear_release<T>(mut self, v: std::option::Option<T>) -> Self
5670    where
5671        T: std::convert::Into<crate::model::Release>,
5672    {
5673        self.release = v.map(|x| x.into());
5674        self
5675    }
5676
5677    /// Sets the value of [request_id][crate::model::CreateReleaseRequest::request_id].
5678    ///
5679    /// # Example
5680    /// ```ignore,no_run
5681    /// # use google_cloud_configdelivery_v1::model::CreateReleaseRequest;
5682    /// let x = CreateReleaseRequest::new().set_request_id("example");
5683    /// ```
5684    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5685        self.request_id = v.into();
5686        self
5687    }
5688}
5689
5690impl wkt::message::Message for CreateReleaseRequest {
5691    fn typename() -> &'static str {
5692        "type.googleapis.com/google.cloud.configdelivery.v1.CreateReleaseRequest"
5693    }
5694}
5695
5696/// Message for updating a Release
5697#[derive(Clone, Default, PartialEq)]
5698#[non_exhaustive]
5699pub struct UpdateReleaseRequest {
5700    /// Required. Field mask is used to specify the fields to be overwritten in the
5701    /// Release resource by the update.
5702    /// The fields specified in the update_mask are relative to the resource, not
5703    /// the full request. A field will be overwritten if it is in the mask. If the
5704    /// user does not provide a mask then all fields will be overwritten.
5705    pub update_mask: std::option::Option<wkt::FieldMask>,
5706
5707    /// Required. The resource being updated
5708    pub release: std::option::Option<crate::model::Release>,
5709
5710    /// Optional. An optional request ID to identify requests. Specify a unique
5711    /// request ID so that if you must retry your request, the server will know to
5712    /// ignore the request if it has already been completed. The server will
5713    /// guarantee that for at least 60 minutes since the first request.
5714    ///
5715    /// For example, consider a situation where you make an initial request and the
5716    /// request times out. If you make the request again with the same request
5717    /// ID, the server can check if original operation with the same request ID
5718    /// was received, and if so, will ignore the second request. This prevents
5719    /// clients from accidentally creating duplicate commitments.
5720    ///
5721    /// The request ID must be a valid UUID with the exception that zero UUID is
5722    /// not supported (00000000-0000-0000-0000-000000000000).
5723    pub request_id: std::string::String,
5724
5725    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5726}
5727
5728impl UpdateReleaseRequest {
5729    /// Creates a new default instance.
5730    pub fn new() -> Self {
5731        std::default::Default::default()
5732    }
5733
5734    /// Sets the value of [update_mask][crate::model::UpdateReleaseRequest::update_mask].
5735    ///
5736    /// # Example
5737    /// ```ignore,no_run
5738    /// # use google_cloud_configdelivery_v1::model::UpdateReleaseRequest;
5739    /// use wkt::FieldMask;
5740    /// let x = UpdateReleaseRequest::new().set_update_mask(FieldMask::default()/* use setters */);
5741    /// ```
5742    pub fn set_update_mask<T>(mut self, v: T) -> Self
5743    where
5744        T: std::convert::Into<wkt::FieldMask>,
5745    {
5746        self.update_mask = std::option::Option::Some(v.into());
5747        self
5748    }
5749
5750    /// Sets or clears the value of [update_mask][crate::model::UpdateReleaseRequest::update_mask].
5751    ///
5752    /// # Example
5753    /// ```ignore,no_run
5754    /// # use google_cloud_configdelivery_v1::model::UpdateReleaseRequest;
5755    /// use wkt::FieldMask;
5756    /// let x = UpdateReleaseRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
5757    /// let x = UpdateReleaseRequest::new().set_or_clear_update_mask(None::<FieldMask>);
5758    /// ```
5759    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5760    where
5761        T: std::convert::Into<wkt::FieldMask>,
5762    {
5763        self.update_mask = v.map(|x| x.into());
5764        self
5765    }
5766
5767    /// Sets the value of [release][crate::model::UpdateReleaseRequest::release].
5768    ///
5769    /// # Example
5770    /// ```ignore,no_run
5771    /// # use google_cloud_configdelivery_v1::model::UpdateReleaseRequest;
5772    /// use google_cloud_configdelivery_v1::model::Release;
5773    /// let x = UpdateReleaseRequest::new().set_release(Release::default()/* use setters */);
5774    /// ```
5775    pub fn set_release<T>(mut self, v: T) -> Self
5776    where
5777        T: std::convert::Into<crate::model::Release>,
5778    {
5779        self.release = std::option::Option::Some(v.into());
5780        self
5781    }
5782
5783    /// Sets or clears the value of [release][crate::model::UpdateReleaseRequest::release].
5784    ///
5785    /// # Example
5786    /// ```ignore,no_run
5787    /// # use google_cloud_configdelivery_v1::model::UpdateReleaseRequest;
5788    /// use google_cloud_configdelivery_v1::model::Release;
5789    /// let x = UpdateReleaseRequest::new().set_or_clear_release(Some(Release::default()/* use setters */));
5790    /// let x = UpdateReleaseRequest::new().set_or_clear_release(None::<Release>);
5791    /// ```
5792    pub fn set_or_clear_release<T>(mut self, v: std::option::Option<T>) -> Self
5793    where
5794        T: std::convert::Into<crate::model::Release>,
5795    {
5796        self.release = v.map(|x| x.into());
5797        self
5798    }
5799
5800    /// Sets the value of [request_id][crate::model::UpdateReleaseRequest::request_id].
5801    ///
5802    /// # Example
5803    /// ```ignore,no_run
5804    /// # use google_cloud_configdelivery_v1::model::UpdateReleaseRequest;
5805    /// let x = UpdateReleaseRequest::new().set_request_id("example");
5806    /// ```
5807    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5808        self.request_id = v.into();
5809        self
5810    }
5811}
5812
5813impl wkt::message::Message for UpdateReleaseRequest {
5814    fn typename() -> &'static str {
5815        "type.googleapis.com/google.cloud.configdelivery.v1.UpdateReleaseRequest"
5816    }
5817}
5818
5819/// Message for deleting a Release
5820#[derive(Clone, Default, PartialEq)]
5821#[non_exhaustive]
5822pub struct DeleteReleaseRequest {
5823    /// Required. Name of the resource
5824    pub name: std::string::String,
5825
5826    /// Optional. An optional request ID to identify requests. Specify a unique
5827    /// request ID so that if you must retry your request, the server will know to
5828    /// ignore the request if it has already been completed. The server will
5829    /// guarantee that for at least 60 minutes after the first request.
5830    ///
5831    /// For example, consider a situation where you make an initial request and the
5832    /// request times out. If you make the request again with the same request
5833    /// ID, the server can check if original operation with the same request ID
5834    /// was received, and if so, will ignore the second request. This prevents
5835    /// clients from accidentally creating duplicate commitments.
5836    ///
5837    /// The request ID must be a valid UUID with the exception that zero UUID is
5838    /// not supported (00000000-0000-0000-0000-000000000000).
5839    pub request_id: std::string::String,
5840
5841    /// Optional. If set to true, any variants of this release will also be
5842    /// deleted. (Otherwise, the request will only work if the release has no
5843    /// variants.)
5844    pub force: bool,
5845
5846    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5847}
5848
5849impl DeleteReleaseRequest {
5850    /// Creates a new default instance.
5851    pub fn new() -> Self {
5852        std::default::Default::default()
5853    }
5854
5855    /// Sets the value of [name][crate::model::DeleteReleaseRequest::name].
5856    ///
5857    /// # Example
5858    /// ```ignore,no_run
5859    /// # use google_cloud_configdelivery_v1::model::DeleteReleaseRequest;
5860    /// # let project_id = "project_id";
5861    /// # let location_id = "location_id";
5862    /// # let resource_bundle_id = "resource_bundle_id";
5863    /// # let release_id = "release_id";
5864    /// let x = DeleteReleaseRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/resourceBundles/{resource_bundle_id}/releases/{release_id}"));
5865    /// ```
5866    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5867        self.name = v.into();
5868        self
5869    }
5870
5871    /// Sets the value of [request_id][crate::model::DeleteReleaseRequest::request_id].
5872    ///
5873    /// # Example
5874    /// ```ignore,no_run
5875    /// # use google_cloud_configdelivery_v1::model::DeleteReleaseRequest;
5876    /// let x = DeleteReleaseRequest::new().set_request_id("example");
5877    /// ```
5878    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5879        self.request_id = v.into();
5880        self
5881    }
5882
5883    /// Sets the value of [force][crate::model::DeleteReleaseRequest::force].
5884    ///
5885    /// # Example
5886    /// ```ignore,no_run
5887    /// # use google_cloud_configdelivery_v1::model::DeleteReleaseRequest;
5888    /// let x = DeleteReleaseRequest::new().set_force(true);
5889    /// ```
5890    pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5891        self.force = v.into();
5892        self
5893    }
5894}
5895
5896impl wkt::message::Message for DeleteReleaseRequest {
5897    fn typename() -> &'static str {
5898        "type.googleapis.com/google.cloud.configdelivery.v1.DeleteReleaseRequest"
5899    }
5900}
5901
5902/// Message for requesting list of Rollouts
5903#[derive(Clone, Default, PartialEq)]
5904#[non_exhaustive]
5905pub struct ListRolloutsRequest {
5906    /// Required. Parent value for ListRolloutsRequest
5907    pub parent: std::string::String,
5908
5909    /// Optional. Requested page size. Server may return fewer items than
5910    /// requested. If unspecified, server will pick an appropriate default.
5911    pub page_size: i32,
5912
5913    /// Optional. A token identifying a page of results the server should return.
5914    pub page_token: std::string::String,
5915
5916    /// Optional. Filtering results
5917    pub filter: std::string::String,
5918
5919    /// Optional. Hint for how to order the results
5920    pub order_by: std::string::String,
5921
5922    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5923}
5924
5925impl ListRolloutsRequest {
5926    /// Creates a new default instance.
5927    pub fn new() -> Self {
5928        std::default::Default::default()
5929    }
5930
5931    /// Sets the value of [parent][crate::model::ListRolloutsRequest::parent].
5932    ///
5933    /// # Example
5934    /// ```ignore,no_run
5935    /// # use google_cloud_configdelivery_v1::model::ListRolloutsRequest;
5936    /// # let project_id = "project_id";
5937    /// # let location_id = "location_id";
5938    /// # let fleet_package_id = "fleet_package_id";
5939    /// let x = ListRolloutsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/fleetPackages/{fleet_package_id}"));
5940    /// ```
5941    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5942        self.parent = v.into();
5943        self
5944    }
5945
5946    /// Sets the value of [page_size][crate::model::ListRolloutsRequest::page_size].
5947    ///
5948    /// # Example
5949    /// ```ignore,no_run
5950    /// # use google_cloud_configdelivery_v1::model::ListRolloutsRequest;
5951    /// let x = ListRolloutsRequest::new().set_page_size(42);
5952    /// ```
5953    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5954        self.page_size = v.into();
5955        self
5956    }
5957
5958    /// Sets the value of [page_token][crate::model::ListRolloutsRequest::page_token].
5959    ///
5960    /// # Example
5961    /// ```ignore,no_run
5962    /// # use google_cloud_configdelivery_v1::model::ListRolloutsRequest;
5963    /// let x = ListRolloutsRequest::new().set_page_token("example");
5964    /// ```
5965    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5966        self.page_token = v.into();
5967        self
5968    }
5969
5970    /// Sets the value of [filter][crate::model::ListRolloutsRequest::filter].
5971    ///
5972    /// # Example
5973    /// ```ignore,no_run
5974    /// # use google_cloud_configdelivery_v1::model::ListRolloutsRequest;
5975    /// let x = ListRolloutsRequest::new().set_filter("example");
5976    /// ```
5977    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5978        self.filter = v.into();
5979        self
5980    }
5981
5982    /// Sets the value of [order_by][crate::model::ListRolloutsRequest::order_by].
5983    ///
5984    /// # Example
5985    /// ```ignore,no_run
5986    /// # use google_cloud_configdelivery_v1::model::ListRolloutsRequest;
5987    /// let x = ListRolloutsRequest::new().set_order_by("example");
5988    /// ```
5989    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5990        self.order_by = v.into();
5991        self
5992    }
5993}
5994
5995impl wkt::message::Message for ListRolloutsRequest {
5996    fn typename() -> &'static str {
5997        "type.googleapis.com/google.cloud.configdelivery.v1.ListRolloutsRequest"
5998    }
5999}
6000
6001/// Message for response to listing Rollouts
6002#[derive(Clone, Default, PartialEq)]
6003#[non_exhaustive]
6004pub struct ListRolloutsResponse {
6005    /// The list of Rollouts
6006    pub rollouts: std::vec::Vec<crate::model::Rollout>,
6007
6008    /// A token identifying a page of results the server should return.
6009    pub next_page_token: std::string::String,
6010
6011    /// Unordered list. Locations that could not be reached.
6012    pub unreachable: std::vec::Vec<std::string::String>,
6013
6014    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6015}
6016
6017impl ListRolloutsResponse {
6018    /// Creates a new default instance.
6019    pub fn new() -> Self {
6020        std::default::Default::default()
6021    }
6022
6023    /// Sets the value of [rollouts][crate::model::ListRolloutsResponse::rollouts].
6024    ///
6025    /// # Example
6026    /// ```ignore,no_run
6027    /// # use google_cloud_configdelivery_v1::model::ListRolloutsResponse;
6028    /// use google_cloud_configdelivery_v1::model::Rollout;
6029    /// let x = ListRolloutsResponse::new()
6030    ///     .set_rollouts([
6031    ///         Rollout::default()/* use setters */,
6032    ///         Rollout::default()/* use (different) setters */,
6033    ///     ]);
6034    /// ```
6035    pub fn set_rollouts<T, V>(mut self, v: T) -> Self
6036    where
6037        T: std::iter::IntoIterator<Item = V>,
6038        V: std::convert::Into<crate::model::Rollout>,
6039    {
6040        use std::iter::Iterator;
6041        self.rollouts = v.into_iter().map(|i| i.into()).collect();
6042        self
6043    }
6044
6045    /// Sets the value of [next_page_token][crate::model::ListRolloutsResponse::next_page_token].
6046    ///
6047    /// # Example
6048    /// ```ignore,no_run
6049    /// # use google_cloud_configdelivery_v1::model::ListRolloutsResponse;
6050    /// let x = ListRolloutsResponse::new().set_next_page_token("example");
6051    /// ```
6052    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6053        self.next_page_token = v.into();
6054        self
6055    }
6056
6057    /// Sets the value of [unreachable][crate::model::ListRolloutsResponse::unreachable].
6058    ///
6059    /// # Example
6060    /// ```ignore,no_run
6061    /// # use google_cloud_configdelivery_v1::model::ListRolloutsResponse;
6062    /// let x = ListRolloutsResponse::new().set_unreachable(["a", "b", "c"]);
6063    /// ```
6064    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
6065    where
6066        T: std::iter::IntoIterator<Item = V>,
6067        V: std::convert::Into<std::string::String>,
6068    {
6069        use std::iter::Iterator;
6070        self.unreachable = v.into_iter().map(|i| i.into()).collect();
6071        self
6072    }
6073}
6074
6075impl wkt::message::Message for ListRolloutsResponse {
6076    fn typename() -> &'static str {
6077        "type.googleapis.com/google.cloud.configdelivery.v1.ListRolloutsResponse"
6078    }
6079}
6080
6081#[doc(hidden)]
6082impl google_cloud_gax::paginator::internal::PageableResponse for ListRolloutsResponse {
6083    type PageItem = crate::model::Rollout;
6084
6085    fn items(self) -> std::vec::Vec<Self::PageItem> {
6086        self.rollouts
6087    }
6088
6089    fn next_page_token(&self) -> std::string::String {
6090        use std::clone::Clone;
6091        self.next_page_token.clone()
6092    }
6093}
6094
6095/// Message for getting a Rollout
6096#[derive(Clone, Default, PartialEq)]
6097#[non_exhaustive]
6098pub struct GetRolloutRequest {
6099    /// Required. Name of the resource
6100    pub name: std::string::String,
6101
6102    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6103}
6104
6105impl GetRolloutRequest {
6106    /// Creates a new default instance.
6107    pub fn new() -> Self {
6108        std::default::Default::default()
6109    }
6110
6111    /// Sets the value of [name][crate::model::GetRolloutRequest::name].
6112    ///
6113    /// # Example
6114    /// ```ignore,no_run
6115    /// # use google_cloud_configdelivery_v1::model::GetRolloutRequest;
6116    /// # let project_id = "project_id";
6117    /// # let location_id = "location_id";
6118    /// # let fleet_package_id = "fleet_package_id";
6119    /// # let rollout_id = "rollout_id";
6120    /// let x = GetRolloutRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/fleetPackages/{fleet_package_id}/rollouts/{rollout_id}"));
6121    /// ```
6122    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6123        self.name = v.into();
6124        self
6125    }
6126}
6127
6128impl wkt::message::Message for GetRolloutRequest {
6129    fn typename() -> &'static str {
6130        "type.googleapis.com/google.cloud.configdelivery.v1.GetRolloutRequest"
6131    }
6132}
6133
6134/// RolloutInfo represents the state of the `FleetPackage` at all the
6135/// clusters the rollout is targeting.
6136#[derive(Clone, Default, PartialEq)]
6137#[non_exhaustive]
6138pub struct RolloutInfo {
6139    /// Output only. state contains the overall status of the Rollout.
6140    pub state: crate::model::rollout_info::State,
6141
6142    /// Output only. Time when the rollout started.
6143    pub start_time: std::option::Option<wkt::Timestamp>,
6144
6145    /// Output only. Time when the rollout completed.
6146    pub end_time: std::option::Option<wkt::Timestamp>,
6147
6148    /// Output only. Message containing additional information related to the
6149    /// rollout.
6150    pub message: std::string::String,
6151
6152    /// Output only. Rollout strategy info represents the status of execution of
6153    /// rollout strategy.
6154    pub rollout_strategy_info: std::option::Option<crate::model::RolloutStrategyInfo>,
6155
6156    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6157}
6158
6159impl RolloutInfo {
6160    /// Creates a new default instance.
6161    pub fn new() -> Self {
6162        std::default::Default::default()
6163    }
6164
6165    /// Sets the value of [state][crate::model::RolloutInfo::state].
6166    ///
6167    /// # Example
6168    /// ```ignore,no_run
6169    /// # use google_cloud_configdelivery_v1::model::RolloutInfo;
6170    /// use google_cloud_configdelivery_v1::model::rollout_info::State;
6171    /// let x0 = RolloutInfo::new().set_state(State::Completed);
6172    /// let x1 = RolloutInfo::new().set_state(State::Suspended);
6173    /// let x2 = RolloutInfo::new().set_state(State::Aborted);
6174    /// ```
6175    pub fn set_state<T: std::convert::Into<crate::model::rollout_info::State>>(
6176        mut self,
6177        v: T,
6178    ) -> Self {
6179        self.state = v.into();
6180        self
6181    }
6182
6183    /// Sets the value of [start_time][crate::model::RolloutInfo::start_time].
6184    ///
6185    /// # Example
6186    /// ```ignore,no_run
6187    /// # use google_cloud_configdelivery_v1::model::RolloutInfo;
6188    /// use wkt::Timestamp;
6189    /// let x = RolloutInfo::new().set_start_time(Timestamp::default()/* use setters */);
6190    /// ```
6191    pub fn set_start_time<T>(mut self, v: T) -> Self
6192    where
6193        T: std::convert::Into<wkt::Timestamp>,
6194    {
6195        self.start_time = std::option::Option::Some(v.into());
6196        self
6197    }
6198
6199    /// Sets or clears the value of [start_time][crate::model::RolloutInfo::start_time].
6200    ///
6201    /// # Example
6202    /// ```ignore,no_run
6203    /// # use google_cloud_configdelivery_v1::model::RolloutInfo;
6204    /// use wkt::Timestamp;
6205    /// let x = RolloutInfo::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
6206    /// let x = RolloutInfo::new().set_or_clear_start_time(None::<Timestamp>);
6207    /// ```
6208    pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
6209    where
6210        T: std::convert::Into<wkt::Timestamp>,
6211    {
6212        self.start_time = v.map(|x| x.into());
6213        self
6214    }
6215
6216    /// Sets the value of [end_time][crate::model::RolloutInfo::end_time].
6217    ///
6218    /// # Example
6219    /// ```ignore,no_run
6220    /// # use google_cloud_configdelivery_v1::model::RolloutInfo;
6221    /// use wkt::Timestamp;
6222    /// let x = RolloutInfo::new().set_end_time(Timestamp::default()/* use setters */);
6223    /// ```
6224    pub fn set_end_time<T>(mut self, v: T) -> Self
6225    where
6226        T: std::convert::Into<wkt::Timestamp>,
6227    {
6228        self.end_time = std::option::Option::Some(v.into());
6229        self
6230    }
6231
6232    /// Sets or clears the value of [end_time][crate::model::RolloutInfo::end_time].
6233    ///
6234    /// # Example
6235    /// ```ignore,no_run
6236    /// # use google_cloud_configdelivery_v1::model::RolloutInfo;
6237    /// use wkt::Timestamp;
6238    /// let x = RolloutInfo::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
6239    /// let x = RolloutInfo::new().set_or_clear_end_time(None::<Timestamp>);
6240    /// ```
6241    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
6242    where
6243        T: std::convert::Into<wkt::Timestamp>,
6244    {
6245        self.end_time = v.map(|x| x.into());
6246        self
6247    }
6248
6249    /// Sets the value of [message][crate::model::RolloutInfo::message].
6250    ///
6251    /// # Example
6252    /// ```ignore,no_run
6253    /// # use google_cloud_configdelivery_v1::model::RolloutInfo;
6254    /// let x = RolloutInfo::new().set_message("example");
6255    /// ```
6256    pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6257        self.message = v.into();
6258        self
6259    }
6260
6261    /// Sets the value of [rollout_strategy_info][crate::model::RolloutInfo::rollout_strategy_info].
6262    ///
6263    /// # Example
6264    /// ```ignore,no_run
6265    /// # use google_cloud_configdelivery_v1::model::RolloutInfo;
6266    /// use google_cloud_configdelivery_v1::model::RolloutStrategyInfo;
6267    /// let x = RolloutInfo::new().set_rollout_strategy_info(RolloutStrategyInfo::default()/* use setters */);
6268    /// ```
6269    pub fn set_rollout_strategy_info<T>(mut self, v: T) -> Self
6270    where
6271        T: std::convert::Into<crate::model::RolloutStrategyInfo>,
6272    {
6273        self.rollout_strategy_info = std::option::Option::Some(v.into());
6274        self
6275    }
6276
6277    /// Sets or clears the value of [rollout_strategy_info][crate::model::RolloutInfo::rollout_strategy_info].
6278    ///
6279    /// # Example
6280    /// ```ignore,no_run
6281    /// # use google_cloud_configdelivery_v1::model::RolloutInfo;
6282    /// use google_cloud_configdelivery_v1::model::RolloutStrategyInfo;
6283    /// let x = RolloutInfo::new().set_or_clear_rollout_strategy_info(Some(RolloutStrategyInfo::default()/* use setters */));
6284    /// let x = RolloutInfo::new().set_or_clear_rollout_strategy_info(None::<RolloutStrategyInfo>);
6285    /// ```
6286    pub fn set_or_clear_rollout_strategy_info<T>(mut self, v: std::option::Option<T>) -> Self
6287    where
6288        T: std::convert::Into<crate::model::RolloutStrategyInfo>,
6289    {
6290        self.rollout_strategy_info = v.map(|x| x.into());
6291        self
6292    }
6293}
6294
6295impl wkt::message::Message for RolloutInfo {
6296    fn typename() -> &'static str {
6297        "type.googleapis.com/google.cloud.configdelivery.v1.RolloutInfo"
6298    }
6299}
6300
6301/// Defines additional types related to [RolloutInfo].
6302pub mod rollout_info {
6303    #[allow(unused_imports)]
6304    use super::*;
6305
6306    /// State of the rollout
6307    ///
6308    /// # Working with unknown values
6309    ///
6310    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6311    /// additional enum variants at any time. Adding new variants is not considered
6312    /// a breaking change. Applications should write their code in anticipation of:
6313    ///
6314    /// - New values appearing in future releases of the client library, **and**
6315    /// - New values received dynamically, without application changes.
6316    ///
6317    /// Please consult the [Working with enums] section in the user guide for some
6318    /// guidelines.
6319    ///
6320    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
6321    #[derive(Clone, Debug, PartialEq)]
6322    #[non_exhaustive]
6323    pub enum State {
6324        /// Unspecified state.
6325        Unspecified,
6326        /// Rollout completed.
6327        Completed,
6328        /// Rollout suspended.
6329        Suspended,
6330        /// Rollout aborted.
6331        Aborted,
6332        /// Rollout in progress.
6333        InProgress,
6334        /// Rollout stalled.
6335        Stalled,
6336        /// Rollout cancelled.
6337        Cancelled,
6338        /// Rollout aborting.
6339        Aborting,
6340        /// If set, the enum was initialized with an unknown value.
6341        ///
6342        /// Applications can examine the value using [State::value] or
6343        /// [State::name].
6344        UnknownValue(state::UnknownValue),
6345    }
6346
6347    #[doc(hidden)]
6348    pub mod state {
6349        #[allow(unused_imports)]
6350        use super::*;
6351        #[derive(Clone, Debug, PartialEq)]
6352        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6353    }
6354
6355    impl State {
6356        /// Gets the enum value.
6357        ///
6358        /// Returns `None` if the enum contains an unknown value deserialized from
6359        /// the string representation of enums.
6360        pub fn value(&self) -> std::option::Option<i32> {
6361            match self {
6362                Self::Unspecified => std::option::Option::Some(0),
6363                Self::Completed => std::option::Option::Some(1),
6364                Self::Suspended => std::option::Option::Some(2),
6365                Self::Aborted => std::option::Option::Some(3),
6366                Self::InProgress => std::option::Option::Some(5),
6367                Self::Stalled => std::option::Option::Some(6),
6368                Self::Cancelled => std::option::Option::Some(7),
6369                Self::Aborting => std::option::Option::Some(8),
6370                Self::UnknownValue(u) => u.0.value(),
6371            }
6372        }
6373
6374        /// Gets the enum value as a string.
6375        ///
6376        /// Returns `None` if the enum contains an unknown value deserialized from
6377        /// the integer representation of enums.
6378        pub fn name(&self) -> std::option::Option<&str> {
6379            match self {
6380                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
6381                Self::Completed => std::option::Option::Some("COMPLETED"),
6382                Self::Suspended => std::option::Option::Some("SUSPENDED"),
6383                Self::Aborted => std::option::Option::Some("ABORTED"),
6384                Self::InProgress => std::option::Option::Some("IN_PROGRESS"),
6385                Self::Stalled => std::option::Option::Some("STALLED"),
6386                Self::Cancelled => std::option::Option::Some("CANCELLED"),
6387                Self::Aborting => std::option::Option::Some("ABORTING"),
6388                Self::UnknownValue(u) => u.0.name(),
6389            }
6390        }
6391    }
6392
6393    impl std::default::Default for State {
6394        fn default() -> Self {
6395            use std::convert::From;
6396            Self::from(0)
6397        }
6398    }
6399
6400    impl std::fmt::Display for State {
6401        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6402            wkt::internal::display_enum(f, self.name(), self.value())
6403        }
6404    }
6405
6406    impl std::convert::From<i32> for State {
6407        fn from(value: i32) -> Self {
6408            match value {
6409                0 => Self::Unspecified,
6410                1 => Self::Completed,
6411                2 => Self::Suspended,
6412                3 => Self::Aborted,
6413                5 => Self::InProgress,
6414                6 => Self::Stalled,
6415                7 => Self::Cancelled,
6416                8 => Self::Aborting,
6417                _ => Self::UnknownValue(state::UnknownValue(
6418                    wkt::internal::UnknownEnumValue::Integer(value),
6419                )),
6420            }
6421        }
6422    }
6423
6424    impl std::convert::From<&str> for State {
6425        fn from(value: &str) -> Self {
6426            use std::string::ToString;
6427            match value {
6428                "STATE_UNSPECIFIED" => Self::Unspecified,
6429                "COMPLETED" => Self::Completed,
6430                "SUSPENDED" => Self::Suspended,
6431                "ABORTED" => Self::Aborted,
6432                "IN_PROGRESS" => Self::InProgress,
6433                "STALLED" => Self::Stalled,
6434                "CANCELLED" => Self::Cancelled,
6435                "ABORTING" => Self::Aborting,
6436                _ => Self::UnknownValue(state::UnknownValue(
6437                    wkt::internal::UnknownEnumValue::String(value.to_string()),
6438                )),
6439            }
6440        }
6441    }
6442
6443    impl serde::ser::Serialize for State {
6444        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6445        where
6446            S: serde::Serializer,
6447        {
6448            match self {
6449                Self::Unspecified => serializer.serialize_i32(0),
6450                Self::Completed => serializer.serialize_i32(1),
6451                Self::Suspended => serializer.serialize_i32(2),
6452                Self::Aborted => serializer.serialize_i32(3),
6453                Self::InProgress => serializer.serialize_i32(5),
6454                Self::Stalled => serializer.serialize_i32(6),
6455                Self::Cancelled => serializer.serialize_i32(7),
6456                Self::Aborting => serializer.serialize_i32(8),
6457                Self::UnknownValue(u) => u.0.serialize(serializer),
6458            }
6459        }
6460    }
6461
6462    impl<'de> serde::de::Deserialize<'de> for State {
6463        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6464        where
6465            D: serde::Deserializer<'de>,
6466        {
6467            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
6468                ".google.cloud.configdelivery.v1.RolloutInfo.State",
6469            ))
6470        }
6471    }
6472}
6473
6474/// Rollout resource represents an instance of `FleetPackage` rollout operation
6475/// across a fleet. This is a system generated resource and will be read only for
6476/// end-users. It will be primarily used by the service to process the changes in
6477/// the `FleetPackage` and other changes in the environment.
6478#[derive(Clone, Default, PartialEq)]
6479#[non_exhaustive]
6480pub struct Rollout {
6481    /// Identifier. Name of the Rollout. Format is
6482    /// `projects/{project}/locations/{location}/fleetPackages/{fleet_package}/rollouts/[a-z][a-z0-9\-]{0,62}`.
6483    pub name: std::string::String,
6484
6485    /// Reference to the `Release` being rolled out.
6486    pub release: std::string::String,
6487
6488    /// Rollout strategy for rolling out `FleetPackage` to clusters.
6489    pub rollout_strategy: std::option::Option<crate::model::RolloutStrategy>,
6490
6491    /// Current details of the rollout.
6492    pub info: std::option::Option<crate::model::RolloutInfo>,
6493
6494    /// Deletion propagation policy of the rollout.
6495    pub deletion_propagation_policy: crate::model::DeletionPropagationPolicy,
6496
6497    /// Output only. The time the rollout was created.
6498    pub create_time: std::option::Option<wkt::Timestamp>,
6499
6500    /// Output only. The time the rollout was most recently updated.
6501    pub update_time: std::option::Option<wkt::Timestamp>,
6502
6503    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6504}
6505
6506impl Rollout {
6507    /// Creates a new default instance.
6508    pub fn new() -> Self {
6509        std::default::Default::default()
6510    }
6511
6512    /// Sets the value of [name][crate::model::Rollout::name].
6513    ///
6514    /// # Example
6515    /// ```ignore,no_run
6516    /// # use google_cloud_configdelivery_v1::model::Rollout;
6517    /// # let project_id = "project_id";
6518    /// # let location_id = "location_id";
6519    /// # let fleet_package_id = "fleet_package_id";
6520    /// # let rollout_id = "rollout_id";
6521    /// let x = Rollout::new().set_name(format!("projects/{project_id}/locations/{location_id}/fleetPackages/{fleet_package_id}/rollouts/{rollout_id}"));
6522    /// ```
6523    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6524        self.name = v.into();
6525        self
6526    }
6527
6528    /// Sets the value of [release][crate::model::Rollout::release].
6529    ///
6530    /// # Example
6531    /// ```ignore,no_run
6532    /// # use google_cloud_configdelivery_v1::model::Rollout;
6533    /// # let project_id = "project_id";
6534    /// # let location_id = "location_id";
6535    /// # let resource_bundle_id = "resource_bundle_id";
6536    /// # let release_id = "release_id";
6537    /// let x = Rollout::new().set_release(format!("projects/{project_id}/locations/{location_id}/resourceBundles/{resource_bundle_id}/releases/{release_id}"));
6538    /// ```
6539    pub fn set_release<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6540        self.release = v.into();
6541        self
6542    }
6543
6544    /// Sets the value of [rollout_strategy][crate::model::Rollout::rollout_strategy].
6545    ///
6546    /// # Example
6547    /// ```ignore,no_run
6548    /// # use google_cloud_configdelivery_v1::model::Rollout;
6549    /// use google_cloud_configdelivery_v1::model::RolloutStrategy;
6550    /// let x = Rollout::new().set_rollout_strategy(RolloutStrategy::default()/* use setters */);
6551    /// ```
6552    pub fn set_rollout_strategy<T>(mut self, v: T) -> Self
6553    where
6554        T: std::convert::Into<crate::model::RolloutStrategy>,
6555    {
6556        self.rollout_strategy = std::option::Option::Some(v.into());
6557        self
6558    }
6559
6560    /// Sets or clears the value of [rollout_strategy][crate::model::Rollout::rollout_strategy].
6561    ///
6562    /// # Example
6563    /// ```ignore,no_run
6564    /// # use google_cloud_configdelivery_v1::model::Rollout;
6565    /// use google_cloud_configdelivery_v1::model::RolloutStrategy;
6566    /// let x = Rollout::new().set_or_clear_rollout_strategy(Some(RolloutStrategy::default()/* use setters */));
6567    /// let x = Rollout::new().set_or_clear_rollout_strategy(None::<RolloutStrategy>);
6568    /// ```
6569    pub fn set_or_clear_rollout_strategy<T>(mut self, v: std::option::Option<T>) -> Self
6570    where
6571        T: std::convert::Into<crate::model::RolloutStrategy>,
6572    {
6573        self.rollout_strategy = v.map(|x| x.into());
6574        self
6575    }
6576
6577    /// Sets the value of [info][crate::model::Rollout::info].
6578    ///
6579    /// # Example
6580    /// ```ignore,no_run
6581    /// # use google_cloud_configdelivery_v1::model::Rollout;
6582    /// use google_cloud_configdelivery_v1::model::RolloutInfo;
6583    /// let x = Rollout::new().set_info(RolloutInfo::default()/* use setters */);
6584    /// ```
6585    pub fn set_info<T>(mut self, v: T) -> Self
6586    where
6587        T: std::convert::Into<crate::model::RolloutInfo>,
6588    {
6589        self.info = std::option::Option::Some(v.into());
6590        self
6591    }
6592
6593    /// Sets or clears the value of [info][crate::model::Rollout::info].
6594    ///
6595    /// # Example
6596    /// ```ignore,no_run
6597    /// # use google_cloud_configdelivery_v1::model::Rollout;
6598    /// use google_cloud_configdelivery_v1::model::RolloutInfo;
6599    /// let x = Rollout::new().set_or_clear_info(Some(RolloutInfo::default()/* use setters */));
6600    /// let x = Rollout::new().set_or_clear_info(None::<RolloutInfo>);
6601    /// ```
6602    pub fn set_or_clear_info<T>(mut self, v: std::option::Option<T>) -> Self
6603    where
6604        T: std::convert::Into<crate::model::RolloutInfo>,
6605    {
6606        self.info = v.map(|x| x.into());
6607        self
6608    }
6609
6610    /// Sets the value of [deletion_propagation_policy][crate::model::Rollout::deletion_propagation_policy].
6611    ///
6612    /// # Example
6613    /// ```ignore,no_run
6614    /// # use google_cloud_configdelivery_v1::model::Rollout;
6615    /// use google_cloud_configdelivery_v1::model::DeletionPropagationPolicy;
6616    /// let x0 = Rollout::new().set_deletion_propagation_policy(DeletionPropagationPolicy::Foreground);
6617    /// let x1 = Rollout::new().set_deletion_propagation_policy(DeletionPropagationPolicy::Orphan);
6618    /// ```
6619    pub fn set_deletion_propagation_policy<
6620        T: std::convert::Into<crate::model::DeletionPropagationPolicy>,
6621    >(
6622        mut self,
6623        v: T,
6624    ) -> Self {
6625        self.deletion_propagation_policy = v.into();
6626        self
6627    }
6628
6629    /// Sets the value of [create_time][crate::model::Rollout::create_time].
6630    ///
6631    /// # Example
6632    /// ```ignore,no_run
6633    /// # use google_cloud_configdelivery_v1::model::Rollout;
6634    /// use wkt::Timestamp;
6635    /// let x = Rollout::new().set_create_time(Timestamp::default()/* use setters */);
6636    /// ```
6637    pub fn set_create_time<T>(mut self, v: T) -> Self
6638    where
6639        T: std::convert::Into<wkt::Timestamp>,
6640    {
6641        self.create_time = std::option::Option::Some(v.into());
6642        self
6643    }
6644
6645    /// Sets or clears the value of [create_time][crate::model::Rollout::create_time].
6646    ///
6647    /// # Example
6648    /// ```ignore,no_run
6649    /// # use google_cloud_configdelivery_v1::model::Rollout;
6650    /// use wkt::Timestamp;
6651    /// let x = Rollout::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
6652    /// let x = Rollout::new().set_or_clear_create_time(None::<Timestamp>);
6653    /// ```
6654    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
6655    where
6656        T: std::convert::Into<wkt::Timestamp>,
6657    {
6658        self.create_time = v.map(|x| x.into());
6659        self
6660    }
6661
6662    /// Sets the value of [update_time][crate::model::Rollout::update_time].
6663    ///
6664    /// # Example
6665    /// ```ignore,no_run
6666    /// # use google_cloud_configdelivery_v1::model::Rollout;
6667    /// use wkt::Timestamp;
6668    /// let x = Rollout::new().set_update_time(Timestamp::default()/* use setters */);
6669    /// ```
6670    pub fn set_update_time<T>(mut self, v: T) -> Self
6671    where
6672        T: std::convert::Into<wkt::Timestamp>,
6673    {
6674        self.update_time = std::option::Option::Some(v.into());
6675        self
6676    }
6677
6678    /// Sets or clears the value of [update_time][crate::model::Rollout::update_time].
6679    ///
6680    /// # Example
6681    /// ```ignore,no_run
6682    /// # use google_cloud_configdelivery_v1::model::Rollout;
6683    /// use wkt::Timestamp;
6684    /// let x = Rollout::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
6685    /// let x = Rollout::new().set_or_clear_update_time(None::<Timestamp>);
6686    /// ```
6687    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
6688    where
6689        T: std::convert::Into<wkt::Timestamp>,
6690    {
6691        self.update_time = v.map(|x| x.into());
6692        self
6693    }
6694}
6695
6696impl wkt::message::Message for Rollout {
6697    fn typename() -> &'static str {
6698        "type.googleapis.com/google.cloud.configdelivery.v1.Rollout"
6699    }
6700}
6701
6702/// Message for suspending a rollout.
6703#[derive(Clone, Default, PartialEq)]
6704#[non_exhaustive]
6705pub struct SuspendRolloutRequest {
6706    /// Required. Name of the Rollout.
6707    pub name: std::string::String,
6708
6709    /// Optional. Reason for suspension.
6710    pub reason: std::string::String,
6711
6712    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6713}
6714
6715impl SuspendRolloutRequest {
6716    /// Creates a new default instance.
6717    pub fn new() -> Self {
6718        std::default::Default::default()
6719    }
6720
6721    /// Sets the value of [name][crate::model::SuspendRolloutRequest::name].
6722    ///
6723    /// # Example
6724    /// ```ignore,no_run
6725    /// # use google_cloud_configdelivery_v1::model::SuspendRolloutRequest;
6726    /// # let project_id = "project_id";
6727    /// # let location_id = "location_id";
6728    /// # let fleet_package_id = "fleet_package_id";
6729    /// # let rollout_id = "rollout_id";
6730    /// let x = SuspendRolloutRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/fleetPackages/{fleet_package_id}/rollouts/{rollout_id}"));
6731    /// ```
6732    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6733        self.name = v.into();
6734        self
6735    }
6736
6737    /// Sets the value of [reason][crate::model::SuspendRolloutRequest::reason].
6738    ///
6739    /// # Example
6740    /// ```ignore,no_run
6741    /// # use google_cloud_configdelivery_v1::model::SuspendRolloutRequest;
6742    /// let x = SuspendRolloutRequest::new().set_reason("example");
6743    /// ```
6744    pub fn set_reason<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6745        self.reason = v.into();
6746        self
6747    }
6748}
6749
6750impl wkt::message::Message for SuspendRolloutRequest {
6751    fn typename() -> &'static str {
6752        "type.googleapis.com/google.cloud.configdelivery.v1.SuspendRolloutRequest"
6753    }
6754}
6755
6756/// Message for resuming a rollout.
6757#[derive(Clone, Default, PartialEq)]
6758#[non_exhaustive]
6759pub struct ResumeRolloutRequest {
6760    /// Required. Name of the Rollout.
6761    pub name: std::string::String,
6762
6763    /// Optional. Reason for resuming the rollout.
6764    pub reason: std::string::String,
6765
6766    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6767}
6768
6769impl ResumeRolloutRequest {
6770    /// Creates a new default instance.
6771    pub fn new() -> Self {
6772        std::default::Default::default()
6773    }
6774
6775    /// Sets the value of [name][crate::model::ResumeRolloutRequest::name].
6776    ///
6777    /// # Example
6778    /// ```ignore,no_run
6779    /// # use google_cloud_configdelivery_v1::model::ResumeRolloutRequest;
6780    /// # let project_id = "project_id";
6781    /// # let location_id = "location_id";
6782    /// # let fleet_package_id = "fleet_package_id";
6783    /// # let rollout_id = "rollout_id";
6784    /// let x = ResumeRolloutRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/fleetPackages/{fleet_package_id}/rollouts/{rollout_id}"));
6785    /// ```
6786    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6787        self.name = v.into();
6788        self
6789    }
6790
6791    /// Sets the value of [reason][crate::model::ResumeRolloutRequest::reason].
6792    ///
6793    /// # Example
6794    /// ```ignore,no_run
6795    /// # use google_cloud_configdelivery_v1::model::ResumeRolloutRequest;
6796    /// let x = ResumeRolloutRequest::new().set_reason("example");
6797    /// ```
6798    pub fn set_reason<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6799        self.reason = v.into();
6800        self
6801    }
6802}
6803
6804impl wkt::message::Message for ResumeRolloutRequest {
6805    fn typename() -> &'static str {
6806        "type.googleapis.com/google.cloud.configdelivery.v1.ResumeRolloutRequest"
6807    }
6808}
6809
6810/// Message for aborting a rollout.
6811#[derive(Clone, Default, PartialEq)]
6812#[non_exhaustive]
6813pub struct AbortRolloutRequest {
6814    /// Required. Name of the Rollout.
6815    pub name: std::string::String,
6816
6817    /// Optional. Reason for aborting.
6818    pub reason: std::string::String,
6819
6820    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6821}
6822
6823impl AbortRolloutRequest {
6824    /// Creates a new default instance.
6825    pub fn new() -> Self {
6826        std::default::Default::default()
6827    }
6828
6829    /// Sets the value of [name][crate::model::AbortRolloutRequest::name].
6830    ///
6831    /// # Example
6832    /// ```ignore,no_run
6833    /// # use google_cloud_configdelivery_v1::model::AbortRolloutRequest;
6834    /// # let project_id = "project_id";
6835    /// # let location_id = "location_id";
6836    /// # let fleet_package_id = "fleet_package_id";
6837    /// # let rollout_id = "rollout_id";
6838    /// let x = AbortRolloutRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/fleetPackages/{fleet_package_id}/rollouts/{rollout_id}"));
6839    /// ```
6840    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6841        self.name = v.into();
6842        self
6843    }
6844
6845    /// Sets the value of [reason][crate::model::AbortRolloutRequest::reason].
6846    ///
6847    /// # Example
6848    /// ```ignore,no_run
6849    /// # use google_cloud_configdelivery_v1::model::AbortRolloutRequest;
6850    /// let x = AbortRolloutRequest::new().set_reason("example");
6851    /// ```
6852    pub fn set_reason<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6853        self.reason = v.into();
6854        self
6855    }
6856}
6857
6858impl wkt::message::Message for AbortRolloutRequest {
6859    fn typename() -> &'static str {
6860        "type.googleapis.com/google.cloud.configdelivery.v1.AbortRolloutRequest"
6861    }
6862}
6863
6864/// Deletion Propagation Policy determines what happens to the underlying
6865/// Kubernetes resources on a cluster when the `FleetPackage` managing
6866/// those resources no longer targets the cluster or is deleted.
6867///
6868/// # Working with unknown values
6869///
6870/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6871/// additional enum variants at any time. Adding new variants is not considered
6872/// a breaking change. Applications should write their code in anticipation of:
6873///
6874/// - New values appearing in future releases of the client library, **and**
6875/// - New values received dynamically, without application changes.
6876///
6877/// Please consult the [Working with enums] section in the user guide for some
6878/// guidelines.
6879///
6880/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
6881#[derive(Clone, Debug, PartialEq)]
6882#[non_exhaustive]
6883pub enum DeletionPropagationPolicy {
6884    /// Unspecified deletion propagation policy. Defaults to FOREGROUND.
6885    Unspecified,
6886    /// Foreground deletion propagation policy. Any resources synced to the cluster
6887    /// will be deleted.
6888    Foreground,
6889    /// Orphan deletion propagation policy. Any resources synced to the cluster
6890    /// will be abandoned.
6891    Orphan,
6892    /// If set, the enum was initialized with an unknown value.
6893    ///
6894    /// Applications can examine the value using [DeletionPropagationPolicy::value] or
6895    /// [DeletionPropagationPolicy::name].
6896    UnknownValue(deletion_propagation_policy::UnknownValue),
6897}
6898
6899#[doc(hidden)]
6900pub mod deletion_propagation_policy {
6901    #[allow(unused_imports)]
6902    use super::*;
6903    #[derive(Clone, Debug, PartialEq)]
6904    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6905}
6906
6907impl DeletionPropagationPolicy {
6908    /// Gets the enum value.
6909    ///
6910    /// Returns `None` if the enum contains an unknown value deserialized from
6911    /// the string representation of enums.
6912    pub fn value(&self) -> std::option::Option<i32> {
6913        match self {
6914            Self::Unspecified => std::option::Option::Some(0),
6915            Self::Foreground => std::option::Option::Some(1),
6916            Self::Orphan => std::option::Option::Some(2),
6917            Self::UnknownValue(u) => u.0.value(),
6918        }
6919    }
6920
6921    /// Gets the enum value as a string.
6922    ///
6923    /// Returns `None` if the enum contains an unknown value deserialized from
6924    /// the integer representation of enums.
6925    pub fn name(&self) -> std::option::Option<&str> {
6926        match self {
6927            Self::Unspecified => {
6928                std::option::Option::Some("DELETION_PROPAGATION_POLICY_UNSPECIFIED")
6929            }
6930            Self::Foreground => std::option::Option::Some("FOREGROUND"),
6931            Self::Orphan => std::option::Option::Some("ORPHAN"),
6932            Self::UnknownValue(u) => u.0.name(),
6933        }
6934    }
6935}
6936
6937impl std::default::Default for DeletionPropagationPolicy {
6938    fn default() -> Self {
6939        use std::convert::From;
6940        Self::from(0)
6941    }
6942}
6943
6944impl std::fmt::Display for DeletionPropagationPolicy {
6945    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6946        wkt::internal::display_enum(f, self.name(), self.value())
6947    }
6948}
6949
6950impl std::convert::From<i32> for DeletionPropagationPolicy {
6951    fn from(value: i32) -> Self {
6952        match value {
6953            0 => Self::Unspecified,
6954            1 => Self::Foreground,
6955            2 => Self::Orphan,
6956            _ => Self::UnknownValue(deletion_propagation_policy::UnknownValue(
6957                wkt::internal::UnknownEnumValue::Integer(value),
6958            )),
6959        }
6960    }
6961}
6962
6963impl std::convert::From<&str> for DeletionPropagationPolicy {
6964    fn from(value: &str) -> Self {
6965        use std::string::ToString;
6966        match value {
6967            "DELETION_PROPAGATION_POLICY_UNSPECIFIED" => Self::Unspecified,
6968            "FOREGROUND" => Self::Foreground,
6969            "ORPHAN" => Self::Orphan,
6970            _ => Self::UnknownValue(deletion_propagation_policy::UnknownValue(
6971                wkt::internal::UnknownEnumValue::String(value.to_string()),
6972            )),
6973        }
6974    }
6975}
6976
6977impl serde::ser::Serialize for DeletionPropagationPolicy {
6978    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6979    where
6980        S: serde::Serializer,
6981    {
6982        match self {
6983            Self::Unspecified => serializer.serialize_i32(0),
6984            Self::Foreground => serializer.serialize_i32(1),
6985            Self::Orphan => serializer.serialize_i32(2),
6986            Self::UnknownValue(u) => u.0.serialize(serializer),
6987        }
6988    }
6989}
6990
6991impl<'de> serde::de::Deserialize<'de> for DeletionPropagationPolicy {
6992    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6993    where
6994        D: serde::Deserializer<'de>,
6995    {
6996        deserializer.deserialize_any(
6997            wkt::internal::EnumVisitor::<DeletionPropagationPolicy>::new(
6998                ".google.cloud.configdelivery.v1.DeletionPropagationPolicy",
6999            ),
7000        )
7001    }
7002}