Skip to main content

google_cloud_parametermanager_v1/
model.rs

1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17#![allow(rustdoc::redundant_explicit_links)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![no_implicit_prelude]
20extern crate async_trait;
21extern crate bytes;
22extern crate gaxi;
23extern crate google_cloud_gax;
24extern crate google_cloud_iam_v1;
25extern crate google_cloud_location;
26extern crate serde;
27extern crate serde_json;
28extern crate serde_with;
29extern crate std;
30extern crate tracing;
31extern crate wkt;
32
33mod debug;
34mod deserialize;
35mod serialize;
36
37/// Message describing Parameter resource
38#[derive(Clone, Default, PartialEq)]
39#[non_exhaustive]
40pub struct Parameter {
41    /// Identifier. [Output only] The resource name of the Parameter in the format
42    /// `projects/*/locations/*/parameters/*`.
43    pub name: std::string::String,
44
45    /// Output only. [Output only] Create time stamp
46    pub create_time: std::option::Option<wkt::Timestamp>,
47
48    /// Output only. [Output only] Update time stamp
49    pub update_time: std::option::Option<wkt::Timestamp>,
50
51    /// Optional. Labels as key value pairs
52    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
53
54    /// Optional. Specifies the format of a Parameter.
55    pub format: crate::model::ParameterFormat,
56
57    /// Output only. [Output-only] policy member strings of a Google Cloud
58    /// resource.
59    pub policy_member: std::option::Option<google_cloud_iam_v1::model::ResourcePolicyMember>,
60
61    /// Optional. Customer managed encryption key (CMEK) to use for encrypting the
62    /// Parameter Versions. If not set, the default Google-managed encryption key
63    /// will be used. Cloud KMS CryptoKeys must reside in the same location as the
64    /// Parameter. The expected format is
65    /// `projects/*/locations/*/keyRings/*/cryptoKeys/*`.
66    pub kms_key: std::option::Option<std::string::String>,
67
68    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
69}
70
71impl Parameter {
72    /// Creates a new default instance.
73    pub fn new() -> Self {
74        std::default::Default::default()
75    }
76
77    /// Sets the value of [name][crate::model::Parameter::name].
78    ///
79    /// # Example
80    /// ```ignore,no_run
81    /// # use google_cloud_parametermanager_v1::model::Parameter;
82    /// # let project_id = "project_id";
83    /// # let location_id = "location_id";
84    /// # let parameter_id = "parameter_id";
85    /// let x = Parameter::new().set_name(format!("projects/{project_id}/locations/{location_id}/parameters/{parameter_id}"));
86    /// ```
87    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
88        self.name = v.into();
89        self
90    }
91
92    /// Sets the value of [create_time][crate::model::Parameter::create_time].
93    ///
94    /// # Example
95    /// ```ignore,no_run
96    /// # use google_cloud_parametermanager_v1::model::Parameter;
97    /// use wkt::Timestamp;
98    /// let x = Parameter::new().set_create_time(Timestamp::default()/* use setters */);
99    /// ```
100    pub fn set_create_time<T>(mut self, v: T) -> Self
101    where
102        T: std::convert::Into<wkt::Timestamp>,
103    {
104        self.create_time = std::option::Option::Some(v.into());
105        self
106    }
107
108    /// Sets or clears the value of [create_time][crate::model::Parameter::create_time].
109    ///
110    /// # Example
111    /// ```ignore,no_run
112    /// # use google_cloud_parametermanager_v1::model::Parameter;
113    /// use wkt::Timestamp;
114    /// let x = Parameter::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
115    /// let x = Parameter::new().set_or_clear_create_time(None::<Timestamp>);
116    /// ```
117    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
118    where
119        T: std::convert::Into<wkt::Timestamp>,
120    {
121        self.create_time = v.map(|x| x.into());
122        self
123    }
124
125    /// Sets the value of [update_time][crate::model::Parameter::update_time].
126    ///
127    /// # Example
128    /// ```ignore,no_run
129    /// # use google_cloud_parametermanager_v1::model::Parameter;
130    /// use wkt::Timestamp;
131    /// let x = Parameter::new().set_update_time(Timestamp::default()/* use setters */);
132    /// ```
133    pub fn set_update_time<T>(mut self, v: T) -> Self
134    where
135        T: std::convert::Into<wkt::Timestamp>,
136    {
137        self.update_time = std::option::Option::Some(v.into());
138        self
139    }
140
141    /// Sets or clears the value of [update_time][crate::model::Parameter::update_time].
142    ///
143    /// # Example
144    /// ```ignore,no_run
145    /// # use google_cloud_parametermanager_v1::model::Parameter;
146    /// use wkt::Timestamp;
147    /// let x = Parameter::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
148    /// let x = Parameter::new().set_or_clear_update_time(None::<Timestamp>);
149    /// ```
150    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
151    where
152        T: std::convert::Into<wkt::Timestamp>,
153    {
154        self.update_time = v.map(|x| x.into());
155        self
156    }
157
158    /// Sets the value of [labels][crate::model::Parameter::labels].
159    ///
160    /// # Example
161    /// ```ignore,no_run
162    /// # use google_cloud_parametermanager_v1::model::Parameter;
163    /// let x = Parameter::new().set_labels([
164    ///     ("key0", "abc"),
165    ///     ("key1", "xyz"),
166    /// ]);
167    /// ```
168    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
169    where
170        T: std::iter::IntoIterator<Item = (K, V)>,
171        K: std::convert::Into<std::string::String>,
172        V: std::convert::Into<std::string::String>,
173    {
174        use std::iter::Iterator;
175        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
176        self
177    }
178
179    /// Sets the value of [format][crate::model::Parameter::format].
180    ///
181    /// # Example
182    /// ```ignore,no_run
183    /// # use google_cloud_parametermanager_v1::model::Parameter;
184    /// use google_cloud_parametermanager_v1::model::ParameterFormat;
185    /// let x0 = Parameter::new().set_format(ParameterFormat::Unformatted);
186    /// let x1 = Parameter::new().set_format(ParameterFormat::Yaml);
187    /// let x2 = Parameter::new().set_format(ParameterFormat::Json);
188    /// ```
189    pub fn set_format<T: std::convert::Into<crate::model::ParameterFormat>>(
190        mut self,
191        v: T,
192    ) -> Self {
193        self.format = v.into();
194        self
195    }
196
197    /// Sets the value of [policy_member][crate::model::Parameter::policy_member].
198    ///
199    /// # Example
200    /// ```ignore,no_run
201    /// # use google_cloud_parametermanager_v1::model::Parameter;
202    /// use google_cloud_iam_v1::model::ResourcePolicyMember;
203    /// let x = Parameter::new().set_policy_member(ResourcePolicyMember::default()/* use setters */);
204    /// ```
205    pub fn set_policy_member<T>(mut self, v: T) -> Self
206    where
207        T: std::convert::Into<google_cloud_iam_v1::model::ResourcePolicyMember>,
208    {
209        self.policy_member = std::option::Option::Some(v.into());
210        self
211    }
212
213    /// Sets or clears the value of [policy_member][crate::model::Parameter::policy_member].
214    ///
215    /// # Example
216    /// ```ignore,no_run
217    /// # use google_cloud_parametermanager_v1::model::Parameter;
218    /// use google_cloud_iam_v1::model::ResourcePolicyMember;
219    /// let x = Parameter::new().set_or_clear_policy_member(Some(ResourcePolicyMember::default()/* use setters */));
220    /// let x = Parameter::new().set_or_clear_policy_member(None::<ResourcePolicyMember>);
221    /// ```
222    pub fn set_or_clear_policy_member<T>(mut self, v: std::option::Option<T>) -> Self
223    where
224        T: std::convert::Into<google_cloud_iam_v1::model::ResourcePolicyMember>,
225    {
226        self.policy_member = v.map(|x| x.into());
227        self
228    }
229
230    /// Sets the value of [kms_key][crate::model::Parameter::kms_key].
231    ///
232    /// # Example
233    /// ```ignore,no_run
234    /// # use google_cloud_parametermanager_v1::model::Parameter;
235    /// let x = Parameter::new().set_kms_key("example");
236    /// ```
237    pub fn set_kms_key<T>(mut self, v: T) -> Self
238    where
239        T: std::convert::Into<std::string::String>,
240    {
241        self.kms_key = std::option::Option::Some(v.into());
242        self
243    }
244
245    /// Sets or clears the value of [kms_key][crate::model::Parameter::kms_key].
246    ///
247    /// # Example
248    /// ```ignore,no_run
249    /// # use google_cloud_parametermanager_v1::model::Parameter;
250    /// let x = Parameter::new().set_or_clear_kms_key(Some("example"));
251    /// let x = Parameter::new().set_or_clear_kms_key(None::<String>);
252    /// ```
253    pub fn set_or_clear_kms_key<T>(mut self, v: std::option::Option<T>) -> Self
254    where
255        T: std::convert::Into<std::string::String>,
256    {
257        self.kms_key = v.map(|x| x.into());
258        self
259    }
260}
261
262impl wkt::message::Message for Parameter {
263    fn typename() -> &'static str {
264        "type.googleapis.com/google.cloud.parametermanager.v1.Parameter"
265    }
266}
267
268/// Message for requesting list of Parameters
269#[derive(Clone, Default, PartialEq)]
270#[non_exhaustive]
271pub struct ListParametersRequest {
272    /// Required. Parent value for ListParametersRequest in the format
273    /// `projects/*/locations/*`.
274    pub parent: std::string::String,
275
276    /// Optional. Requested page size. Server may return fewer items than
277    /// requested. If unspecified, server will pick an appropriate default.
278    pub page_size: i32,
279
280    /// Optional. A token identifying a page of results the server should return.
281    pub page_token: std::string::String,
282
283    /// Optional. Filtering results
284    pub filter: std::string::String,
285
286    /// Optional. Hint for how to order the results
287    pub order_by: std::string::String,
288
289    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
290}
291
292impl ListParametersRequest {
293    /// Creates a new default instance.
294    pub fn new() -> Self {
295        std::default::Default::default()
296    }
297
298    /// Sets the value of [parent][crate::model::ListParametersRequest::parent].
299    ///
300    /// # Example
301    /// ```ignore,no_run
302    /// # use google_cloud_parametermanager_v1::model::ListParametersRequest;
303    /// # let project_id = "project_id";
304    /// # let location_id = "location_id";
305    /// let x = ListParametersRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
306    /// ```
307    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
308        self.parent = v.into();
309        self
310    }
311
312    /// Sets the value of [page_size][crate::model::ListParametersRequest::page_size].
313    ///
314    /// # Example
315    /// ```ignore,no_run
316    /// # use google_cloud_parametermanager_v1::model::ListParametersRequest;
317    /// let x = ListParametersRequest::new().set_page_size(42);
318    /// ```
319    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
320        self.page_size = v.into();
321        self
322    }
323
324    /// Sets the value of [page_token][crate::model::ListParametersRequest::page_token].
325    ///
326    /// # Example
327    /// ```ignore,no_run
328    /// # use google_cloud_parametermanager_v1::model::ListParametersRequest;
329    /// let x = ListParametersRequest::new().set_page_token("example");
330    /// ```
331    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
332        self.page_token = v.into();
333        self
334    }
335
336    /// Sets the value of [filter][crate::model::ListParametersRequest::filter].
337    ///
338    /// # Example
339    /// ```ignore,no_run
340    /// # use google_cloud_parametermanager_v1::model::ListParametersRequest;
341    /// let x = ListParametersRequest::new().set_filter("example");
342    /// ```
343    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
344        self.filter = v.into();
345        self
346    }
347
348    /// Sets the value of [order_by][crate::model::ListParametersRequest::order_by].
349    ///
350    /// # Example
351    /// ```ignore,no_run
352    /// # use google_cloud_parametermanager_v1::model::ListParametersRequest;
353    /// let x = ListParametersRequest::new().set_order_by("example");
354    /// ```
355    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
356        self.order_by = v.into();
357        self
358    }
359}
360
361impl wkt::message::Message for ListParametersRequest {
362    fn typename() -> &'static str {
363        "type.googleapis.com/google.cloud.parametermanager.v1.ListParametersRequest"
364    }
365}
366
367/// Message for response to listing Parameters
368#[derive(Clone, Default, PartialEq)]
369#[non_exhaustive]
370pub struct ListParametersResponse {
371    /// The list of Parameters
372    pub parameters: std::vec::Vec<crate::model::Parameter>,
373
374    /// A token identifying a page of results the server should return.
375    pub next_page_token: std::string::String,
376
377    /// Unordered list. Locations that could not be reached.
378    pub unreachable: std::vec::Vec<std::string::String>,
379
380    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
381}
382
383impl ListParametersResponse {
384    /// Creates a new default instance.
385    pub fn new() -> Self {
386        std::default::Default::default()
387    }
388
389    /// Sets the value of [parameters][crate::model::ListParametersResponse::parameters].
390    ///
391    /// # Example
392    /// ```ignore,no_run
393    /// # use google_cloud_parametermanager_v1::model::ListParametersResponse;
394    /// use google_cloud_parametermanager_v1::model::Parameter;
395    /// let x = ListParametersResponse::new()
396    ///     .set_parameters([
397    ///         Parameter::default()/* use setters */,
398    ///         Parameter::default()/* use (different) setters */,
399    ///     ]);
400    /// ```
401    pub fn set_parameters<T, V>(mut self, v: T) -> Self
402    where
403        T: std::iter::IntoIterator<Item = V>,
404        V: std::convert::Into<crate::model::Parameter>,
405    {
406        use std::iter::Iterator;
407        self.parameters = v.into_iter().map(|i| i.into()).collect();
408        self
409    }
410
411    /// Sets the value of [next_page_token][crate::model::ListParametersResponse::next_page_token].
412    ///
413    /// # Example
414    /// ```ignore,no_run
415    /// # use google_cloud_parametermanager_v1::model::ListParametersResponse;
416    /// let x = ListParametersResponse::new().set_next_page_token("example");
417    /// ```
418    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
419        self.next_page_token = v.into();
420        self
421    }
422
423    /// Sets the value of [unreachable][crate::model::ListParametersResponse::unreachable].
424    ///
425    /// # Example
426    /// ```ignore,no_run
427    /// # use google_cloud_parametermanager_v1::model::ListParametersResponse;
428    /// let x = ListParametersResponse::new().set_unreachable(["a", "b", "c"]);
429    /// ```
430    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
431    where
432        T: std::iter::IntoIterator<Item = V>,
433        V: std::convert::Into<std::string::String>,
434    {
435        use std::iter::Iterator;
436        self.unreachable = v.into_iter().map(|i| i.into()).collect();
437        self
438    }
439}
440
441impl wkt::message::Message for ListParametersResponse {
442    fn typename() -> &'static str {
443        "type.googleapis.com/google.cloud.parametermanager.v1.ListParametersResponse"
444    }
445}
446
447#[doc(hidden)]
448impl google_cloud_gax::paginator::internal::PageableResponse for ListParametersResponse {
449    type PageItem = crate::model::Parameter;
450
451    fn items(self) -> std::vec::Vec<Self::PageItem> {
452        self.parameters
453    }
454
455    fn next_page_token(&self) -> std::string::String {
456        use std::clone::Clone;
457        self.next_page_token.clone()
458    }
459}
460
461/// Message for getting a Parameter
462#[derive(Clone, Default, PartialEq)]
463#[non_exhaustive]
464pub struct GetParameterRequest {
465    /// Required. Name of the resource in the format
466    /// `projects/*/locations/*/parameters/*`.
467    pub name: std::string::String,
468
469    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
470}
471
472impl GetParameterRequest {
473    /// Creates a new default instance.
474    pub fn new() -> Self {
475        std::default::Default::default()
476    }
477
478    /// Sets the value of [name][crate::model::GetParameterRequest::name].
479    ///
480    /// # Example
481    /// ```ignore,no_run
482    /// # use google_cloud_parametermanager_v1::model::GetParameterRequest;
483    /// # let project_id = "project_id";
484    /// # let location_id = "location_id";
485    /// # let parameter_id = "parameter_id";
486    /// let x = GetParameterRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/parameters/{parameter_id}"));
487    /// ```
488    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
489        self.name = v.into();
490        self
491    }
492}
493
494impl wkt::message::Message for GetParameterRequest {
495    fn typename() -> &'static str {
496        "type.googleapis.com/google.cloud.parametermanager.v1.GetParameterRequest"
497    }
498}
499
500/// Message for creating a Parameter
501#[derive(Clone, Default, PartialEq)]
502#[non_exhaustive]
503pub struct CreateParameterRequest {
504    /// Required. Value for parent in the format
505    /// `projects/*/locations/*`.
506    pub parent: std::string::String,
507
508    /// Required. Id of the Parameter resource
509    pub parameter_id: std::string::String,
510
511    /// Required. The Parameter resource being created
512    pub parameter: std::option::Option<crate::model::Parameter>,
513
514    /// Optional. An optional request ID to identify requests. Specify a unique
515    /// request ID so that if you must retry your request, the server will know to
516    /// ignore the request if it has already been completed. The server will
517    /// guarantee that for at least 60 minutes since the first request.
518    ///
519    /// For example, consider a situation where you make an initial request and the
520    /// request times out. If you make the request again with the same request
521    /// ID, the server can check if original operation with the same request ID
522    /// was received, and if so, will ignore the second request. This prevents
523    /// clients from accidentally creating duplicate commitments.
524    ///
525    /// The request ID must be a valid UUID with the exception that zero UUID is
526    /// not supported (00000000-0000-0000-0000-000000000000).
527    pub request_id: std::string::String,
528
529    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
530}
531
532impl CreateParameterRequest {
533    /// Creates a new default instance.
534    pub fn new() -> Self {
535        std::default::Default::default()
536    }
537
538    /// Sets the value of [parent][crate::model::CreateParameterRequest::parent].
539    ///
540    /// # Example
541    /// ```ignore,no_run
542    /// # use google_cloud_parametermanager_v1::model::CreateParameterRequest;
543    /// # let project_id = "project_id";
544    /// # let location_id = "location_id";
545    /// let x = CreateParameterRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
546    /// ```
547    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
548        self.parent = v.into();
549        self
550    }
551
552    /// Sets the value of [parameter_id][crate::model::CreateParameterRequest::parameter_id].
553    ///
554    /// # Example
555    /// ```ignore,no_run
556    /// # use google_cloud_parametermanager_v1::model::CreateParameterRequest;
557    /// let x = CreateParameterRequest::new().set_parameter_id("example");
558    /// ```
559    pub fn set_parameter_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
560        self.parameter_id = v.into();
561        self
562    }
563
564    /// Sets the value of [parameter][crate::model::CreateParameterRequest::parameter].
565    ///
566    /// # Example
567    /// ```ignore,no_run
568    /// # use google_cloud_parametermanager_v1::model::CreateParameterRequest;
569    /// use google_cloud_parametermanager_v1::model::Parameter;
570    /// let x = CreateParameterRequest::new().set_parameter(Parameter::default()/* use setters */);
571    /// ```
572    pub fn set_parameter<T>(mut self, v: T) -> Self
573    where
574        T: std::convert::Into<crate::model::Parameter>,
575    {
576        self.parameter = std::option::Option::Some(v.into());
577        self
578    }
579
580    /// Sets or clears the value of [parameter][crate::model::CreateParameterRequest::parameter].
581    ///
582    /// # Example
583    /// ```ignore,no_run
584    /// # use google_cloud_parametermanager_v1::model::CreateParameterRequest;
585    /// use google_cloud_parametermanager_v1::model::Parameter;
586    /// let x = CreateParameterRequest::new().set_or_clear_parameter(Some(Parameter::default()/* use setters */));
587    /// let x = CreateParameterRequest::new().set_or_clear_parameter(None::<Parameter>);
588    /// ```
589    pub fn set_or_clear_parameter<T>(mut self, v: std::option::Option<T>) -> Self
590    where
591        T: std::convert::Into<crate::model::Parameter>,
592    {
593        self.parameter = v.map(|x| x.into());
594        self
595    }
596
597    /// Sets the value of [request_id][crate::model::CreateParameterRequest::request_id].
598    ///
599    /// # Example
600    /// ```ignore,no_run
601    /// # use google_cloud_parametermanager_v1::model::CreateParameterRequest;
602    /// let x = CreateParameterRequest::new().set_request_id("example");
603    /// ```
604    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
605        self.request_id = v.into();
606        self
607    }
608}
609
610impl wkt::message::Message for CreateParameterRequest {
611    fn typename() -> &'static str {
612        "type.googleapis.com/google.cloud.parametermanager.v1.CreateParameterRequest"
613    }
614}
615
616/// Message for updating a Parameter
617#[derive(Clone, Default, PartialEq)]
618#[non_exhaustive]
619pub struct UpdateParameterRequest {
620    /// Optional. Field mask is used to specify the fields to be overwritten in the
621    /// Parameter resource by the update.
622    /// The fields specified in the update_mask are relative to the resource, not
623    /// the full request. A mutable field will be overwritten if it is in the
624    /// mask. If the user does not provide a mask then all mutable fields present
625    /// in the request will be overwritten.
626    pub update_mask: std::option::Option<wkt::FieldMask>,
627
628    /// Required. The Parameter resource being updated
629    pub parameter: std::option::Option<crate::model::Parameter>,
630
631    /// Optional. An optional request ID to identify requests. Specify a unique
632    /// request ID so that if you must retry your request, the server will know to
633    /// ignore the request if it has already been completed. The server will
634    /// guarantee that for at least 60 minutes since the first request.
635    ///
636    /// For example, consider a situation where you make an initial request and the
637    /// request times out. If you make the request again with the same request
638    /// ID, the server can check if original operation with the same request ID
639    /// was received, and if so, will ignore the second request. This prevents
640    /// clients from accidentally creating duplicate commitments.
641    ///
642    /// The request ID must be a valid UUID with the exception that zero UUID is
643    /// not supported (00000000-0000-0000-0000-000000000000).
644    pub request_id: std::string::String,
645
646    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
647}
648
649impl UpdateParameterRequest {
650    /// Creates a new default instance.
651    pub fn new() -> Self {
652        std::default::Default::default()
653    }
654
655    /// Sets the value of [update_mask][crate::model::UpdateParameterRequest::update_mask].
656    ///
657    /// # Example
658    /// ```ignore,no_run
659    /// # use google_cloud_parametermanager_v1::model::UpdateParameterRequest;
660    /// use wkt::FieldMask;
661    /// let x = UpdateParameterRequest::new().set_update_mask(FieldMask::default()/* use setters */);
662    /// ```
663    pub fn set_update_mask<T>(mut self, v: T) -> Self
664    where
665        T: std::convert::Into<wkt::FieldMask>,
666    {
667        self.update_mask = std::option::Option::Some(v.into());
668        self
669    }
670
671    /// Sets or clears the value of [update_mask][crate::model::UpdateParameterRequest::update_mask].
672    ///
673    /// # Example
674    /// ```ignore,no_run
675    /// # use google_cloud_parametermanager_v1::model::UpdateParameterRequest;
676    /// use wkt::FieldMask;
677    /// let x = UpdateParameterRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
678    /// let x = UpdateParameterRequest::new().set_or_clear_update_mask(None::<FieldMask>);
679    /// ```
680    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
681    where
682        T: std::convert::Into<wkt::FieldMask>,
683    {
684        self.update_mask = v.map(|x| x.into());
685        self
686    }
687
688    /// Sets the value of [parameter][crate::model::UpdateParameterRequest::parameter].
689    ///
690    /// # Example
691    /// ```ignore,no_run
692    /// # use google_cloud_parametermanager_v1::model::UpdateParameterRequest;
693    /// use google_cloud_parametermanager_v1::model::Parameter;
694    /// let x = UpdateParameterRequest::new().set_parameter(Parameter::default()/* use setters */);
695    /// ```
696    pub fn set_parameter<T>(mut self, v: T) -> Self
697    where
698        T: std::convert::Into<crate::model::Parameter>,
699    {
700        self.parameter = std::option::Option::Some(v.into());
701        self
702    }
703
704    /// Sets or clears the value of [parameter][crate::model::UpdateParameterRequest::parameter].
705    ///
706    /// # Example
707    /// ```ignore,no_run
708    /// # use google_cloud_parametermanager_v1::model::UpdateParameterRequest;
709    /// use google_cloud_parametermanager_v1::model::Parameter;
710    /// let x = UpdateParameterRequest::new().set_or_clear_parameter(Some(Parameter::default()/* use setters */));
711    /// let x = UpdateParameterRequest::new().set_or_clear_parameter(None::<Parameter>);
712    /// ```
713    pub fn set_or_clear_parameter<T>(mut self, v: std::option::Option<T>) -> Self
714    where
715        T: std::convert::Into<crate::model::Parameter>,
716    {
717        self.parameter = v.map(|x| x.into());
718        self
719    }
720
721    /// Sets the value of [request_id][crate::model::UpdateParameterRequest::request_id].
722    ///
723    /// # Example
724    /// ```ignore,no_run
725    /// # use google_cloud_parametermanager_v1::model::UpdateParameterRequest;
726    /// let x = UpdateParameterRequest::new().set_request_id("example");
727    /// ```
728    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
729        self.request_id = v.into();
730        self
731    }
732}
733
734impl wkt::message::Message for UpdateParameterRequest {
735    fn typename() -> &'static str {
736        "type.googleapis.com/google.cloud.parametermanager.v1.UpdateParameterRequest"
737    }
738}
739
740/// Message for deleting a Parameter
741#[derive(Clone, Default, PartialEq)]
742#[non_exhaustive]
743pub struct DeleteParameterRequest {
744    /// Required. Name of the resource in the format
745    /// `projects/*/locations/*/parameters/*`.
746    pub name: std::string::String,
747
748    /// Optional. An optional request ID to identify requests. Specify a unique
749    /// request ID so that if you must retry your request, the server will know to
750    /// ignore the request if it has already been completed. The server will
751    /// guarantee that for at least 60 minutes after the first request.
752    ///
753    /// For example, consider a situation where you make an initial request and the
754    /// request times out. If you make the request again with the same request
755    /// ID, the server can check if original operation with the same request ID
756    /// was received, and if so, will ignore the second request. This prevents
757    /// clients from accidentally creating duplicate commitments.
758    ///
759    /// The request ID must be a valid UUID with the exception that zero UUID is
760    /// not supported (00000000-0000-0000-0000-000000000000).
761    pub request_id: std::string::String,
762
763    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
764}
765
766impl DeleteParameterRequest {
767    /// Creates a new default instance.
768    pub fn new() -> Self {
769        std::default::Default::default()
770    }
771
772    /// Sets the value of [name][crate::model::DeleteParameterRequest::name].
773    ///
774    /// # Example
775    /// ```ignore,no_run
776    /// # use google_cloud_parametermanager_v1::model::DeleteParameterRequest;
777    /// # let project_id = "project_id";
778    /// # let location_id = "location_id";
779    /// # let parameter_id = "parameter_id";
780    /// let x = DeleteParameterRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/parameters/{parameter_id}"));
781    /// ```
782    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
783        self.name = v.into();
784        self
785    }
786
787    /// Sets the value of [request_id][crate::model::DeleteParameterRequest::request_id].
788    ///
789    /// # Example
790    /// ```ignore,no_run
791    /// # use google_cloud_parametermanager_v1::model::DeleteParameterRequest;
792    /// let x = DeleteParameterRequest::new().set_request_id("example");
793    /// ```
794    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
795        self.request_id = v.into();
796        self
797    }
798}
799
800impl wkt::message::Message for DeleteParameterRequest {
801    fn typename() -> &'static str {
802        "type.googleapis.com/google.cloud.parametermanager.v1.DeleteParameterRequest"
803    }
804}
805
806/// Message describing ParameterVersion resource
807#[derive(Clone, Default, PartialEq)]
808#[non_exhaustive]
809pub struct ParameterVersion {
810    /// Identifier. [Output only] The resource name of the ParameterVersion in the
811    /// format `projects/*/locations/*/parameters/*/versions/*`.
812    pub name: std::string::String,
813
814    /// Output only. [Output only] Create time stamp
815    pub create_time: std::option::Option<wkt::Timestamp>,
816
817    /// Output only. [Output only] Update time stamp
818    pub update_time: std::option::Option<wkt::Timestamp>,
819
820    /// Optional. Disabled boolean to determine if a ParameterVersion acts as a
821    /// metadata only resource (payload is never returned if disabled is true). If
822    /// true any calls will always default to BASIC view even if the user
823    /// explicitly passes FULL view as part of the request. A render call on a
824    /// disabled resource fails with an error. Default value is False.
825    pub disabled: bool,
826
827    /// Required. Immutable. Payload content of a ParameterVersion resource.  This
828    /// is only returned when the request provides the View value of FULL (default
829    /// for GET request).
830    pub payload: std::option::Option<crate::model::ParameterVersionPayload>,
831
832    /// Optional. Output only. [Output only] The resource name of the KMS key
833    /// version used to encrypt the ParameterVersion payload. This field is
834    /// populated only if the Parameter resource has customer managed encryption
835    /// key (CMEK) configured.
836    pub kms_key_version: std::option::Option<std::string::String>,
837
838    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
839}
840
841impl ParameterVersion {
842    /// Creates a new default instance.
843    pub fn new() -> Self {
844        std::default::Default::default()
845    }
846
847    /// Sets the value of [name][crate::model::ParameterVersion::name].
848    ///
849    /// # Example
850    /// ```ignore,no_run
851    /// # use google_cloud_parametermanager_v1::model::ParameterVersion;
852    /// # let project_id = "project_id";
853    /// # let location_id = "location_id";
854    /// # let parameter_id = "parameter_id";
855    /// # let parameter_version_id = "parameter_version_id";
856    /// let x = ParameterVersion::new().set_name(format!("projects/{project_id}/locations/{location_id}/parameters/{parameter_id}/versions/{parameter_version_id}"));
857    /// ```
858    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
859        self.name = v.into();
860        self
861    }
862
863    /// Sets the value of [create_time][crate::model::ParameterVersion::create_time].
864    ///
865    /// # Example
866    /// ```ignore,no_run
867    /// # use google_cloud_parametermanager_v1::model::ParameterVersion;
868    /// use wkt::Timestamp;
869    /// let x = ParameterVersion::new().set_create_time(Timestamp::default()/* use setters */);
870    /// ```
871    pub fn set_create_time<T>(mut self, v: T) -> Self
872    where
873        T: std::convert::Into<wkt::Timestamp>,
874    {
875        self.create_time = std::option::Option::Some(v.into());
876        self
877    }
878
879    /// Sets or clears the value of [create_time][crate::model::ParameterVersion::create_time].
880    ///
881    /// # Example
882    /// ```ignore,no_run
883    /// # use google_cloud_parametermanager_v1::model::ParameterVersion;
884    /// use wkt::Timestamp;
885    /// let x = ParameterVersion::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
886    /// let x = ParameterVersion::new().set_or_clear_create_time(None::<Timestamp>);
887    /// ```
888    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
889    where
890        T: std::convert::Into<wkt::Timestamp>,
891    {
892        self.create_time = v.map(|x| x.into());
893        self
894    }
895
896    /// Sets the value of [update_time][crate::model::ParameterVersion::update_time].
897    ///
898    /// # Example
899    /// ```ignore,no_run
900    /// # use google_cloud_parametermanager_v1::model::ParameterVersion;
901    /// use wkt::Timestamp;
902    /// let x = ParameterVersion::new().set_update_time(Timestamp::default()/* use setters */);
903    /// ```
904    pub fn set_update_time<T>(mut self, v: T) -> Self
905    where
906        T: std::convert::Into<wkt::Timestamp>,
907    {
908        self.update_time = std::option::Option::Some(v.into());
909        self
910    }
911
912    /// Sets or clears the value of [update_time][crate::model::ParameterVersion::update_time].
913    ///
914    /// # Example
915    /// ```ignore,no_run
916    /// # use google_cloud_parametermanager_v1::model::ParameterVersion;
917    /// use wkt::Timestamp;
918    /// let x = ParameterVersion::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
919    /// let x = ParameterVersion::new().set_or_clear_update_time(None::<Timestamp>);
920    /// ```
921    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
922    where
923        T: std::convert::Into<wkt::Timestamp>,
924    {
925        self.update_time = v.map(|x| x.into());
926        self
927    }
928
929    /// Sets the value of [disabled][crate::model::ParameterVersion::disabled].
930    ///
931    /// # Example
932    /// ```ignore,no_run
933    /// # use google_cloud_parametermanager_v1::model::ParameterVersion;
934    /// let x = ParameterVersion::new().set_disabled(true);
935    /// ```
936    pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
937        self.disabled = v.into();
938        self
939    }
940
941    /// Sets the value of [payload][crate::model::ParameterVersion::payload].
942    ///
943    /// # Example
944    /// ```ignore,no_run
945    /// # use google_cloud_parametermanager_v1::model::ParameterVersion;
946    /// use google_cloud_parametermanager_v1::model::ParameterVersionPayload;
947    /// let x = ParameterVersion::new().set_payload(ParameterVersionPayload::default()/* use setters */);
948    /// ```
949    pub fn set_payload<T>(mut self, v: T) -> Self
950    where
951        T: std::convert::Into<crate::model::ParameterVersionPayload>,
952    {
953        self.payload = std::option::Option::Some(v.into());
954        self
955    }
956
957    /// Sets or clears the value of [payload][crate::model::ParameterVersion::payload].
958    ///
959    /// # Example
960    /// ```ignore,no_run
961    /// # use google_cloud_parametermanager_v1::model::ParameterVersion;
962    /// use google_cloud_parametermanager_v1::model::ParameterVersionPayload;
963    /// let x = ParameterVersion::new().set_or_clear_payload(Some(ParameterVersionPayload::default()/* use setters */));
964    /// let x = ParameterVersion::new().set_or_clear_payload(None::<ParameterVersionPayload>);
965    /// ```
966    pub fn set_or_clear_payload<T>(mut self, v: std::option::Option<T>) -> Self
967    where
968        T: std::convert::Into<crate::model::ParameterVersionPayload>,
969    {
970        self.payload = v.map(|x| x.into());
971        self
972    }
973
974    /// Sets the value of [kms_key_version][crate::model::ParameterVersion::kms_key_version].
975    ///
976    /// # Example
977    /// ```ignore,no_run
978    /// # use google_cloud_parametermanager_v1::model::ParameterVersion;
979    /// let x = ParameterVersion::new().set_kms_key_version("example");
980    /// ```
981    pub fn set_kms_key_version<T>(mut self, v: T) -> Self
982    where
983        T: std::convert::Into<std::string::String>,
984    {
985        self.kms_key_version = std::option::Option::Some(v.into());
986        self
987    }
988
989    /// Sets or clears the value of [kms_key_version][crate::model::ParameterVersion::kms_key_version].
990    ///
991    /// # Example
992    /// ```ignore,no_run
993    /// # use google_cloud_parametermanager_v1::model::ParameterVersion;
994    /// let x = ParameterVersion::new().set_or_clear_kms_key_version(Some("example"));
995    /// let x = ParameterVersion::new().set_or_clear_kms_key_version(None::<String>);
996    /// ```
997    pub fn set_or_clear_kms_key_version<T>(mut self, v: std::option::Option<T>) -> Self
998    where
999        T: std::convert::Into<std::string::String>,
1000    {
1001        self.kms_key_version = v.map(|x| x.into());
1002        self
1003    }
1004}
1005
1006impl wkt::message::Message for ParameterVersion {
1007    fn typename() -> &'static str {
1008        "type.googleapis.com/google.cloud.parametermanager.v1.ParameterVersion"
1009    }
1010}
1011
1012/// Message for storing a ParameterVersion resource's payload data
1013#[derive(Clone, Default, PartialEq)]
1014#[non_exhaustive]
1015pub struct ParameterVersionPayload {
1016    /// Required. bytes data for storing payload.
1017    pub data: ::bytes::Bytes,
1018
1019    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1020}
1021
1022impl ParameterVersionPayload {
1023    /// Creates a new default instance.
1024    pub fn new() -> Self {
1025        std::default::Default::default()
1026    }
1027
1028    /// Sets the value of [data][crate::model::ParameterVersionPayload::data].
1029    ///
1030    /// # Example
1031    /// ```ignore,no_run
1032    /// # use google_cloud_parametermanager_v1::model::ParameterVersionPayload;
1033    /// let x = ParameterVersionPayload::new().set_data(bytes::Bytes::from_static(b"example"));
1034    /// ```
1035    pub fn set_data<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
1036        self.data = v.into();
1037        self
1038    }
1039}
1040
1041impl wkt::message::Message for ParameterVersionPayload {
1042    fn typename() -> &'static str {
1043        "type.googleapis.com/google.cloud.parametermanager.v1.ParameterVersionPayload"
1044    }
1045}
1046
1047/// Message for requesting list of ParameterVersions
1048#[derive(Clone, Default, PartialEq)]
1049#[non_exhaustive]
1050pub struct ListParameterVersionsRequest {
1051    /// Required. Parent value for ListParameterVersionsRequest in the format
1052    /// `projects/*/locations/*/parameters/*`.
1053    pub parent: std::string::String,
1054
1055    /// Optional. Requested page size. Server may return fewer items than
1056    /// requested. If unspecified, server will pick an appropriate default.
1057    pub page_size: i32,
1058
1059    /// Optional. A token identifying a page of results the server should return.
1060    pub page_token: std::string::String,
1061
1062    /// Optional. Filtering results
1063    pub filter: std::string::String,
1064
1065    /// Optional. Hint for how to order the results
1066    pub order_by: std::string::String,
1067
1068    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1069}
1070
1071impl ListParameterVersionsRequest {
1072    /// Creates a new default instance.
1073    pub fn new() -> Self {
1074        std::default::Default::default()
1075    }
1076
1077    /// Sets the value of [parent][crate::model::ListParameterVersionsRequest::parent].
1078    ///
1079    /// # Example
1080    /// ```ignore,no_run
1081    /// # use google_cloud_parametermanager_v1::model::ListParameterVersionsRequest;
1082    /// # let project_id = "project_id";
1083    /// # let location_id = "location_id";
1084    /// # let parameter_id = "parameter_id";
1085    /// let x = ListParameterVersionsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/parameters/{parameter_id}"));
1086    /// ```
1087    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1088        self.parent = v.into();
1089        self
1090    }
1091
1092    /// Sets the value of [page_size][crate::model::ListParameterVersionsRequest::page_size].
1093    ///
1094    /// # Example
1095    /// ```ignore,no_run
1096    /// # use google_cloud_parametermanager_v1::model::ListParameterVersionsRequest;
1097    /// let x = ListParameterVersionsRequest::new().set_page_size(42);
1098    /// ```
1099    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1100        self.page_size = v.into();
1101        self
1102    }
1103
1104    /// Sets the value of [page_token][crate::model::ListParameterVersionsRequest::page_token].
1105    ///
1106    /// # Example
1107    /// ```ignore,no_run
1108    /// # use google_cloud_parametermanager_v1::model::ListParameterVersionsRequest;
1109    /// let x = ListParameterVersionsRequest::new().set_page_token("example");
1110    /// ```
1111    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1112        self.page_token = v.into();
1113        self
1114    }
1115
1116    /// Sets the value of [filter][crate::model::ListParameterVersionsRequest::filter].
1117    ///
1118    /// # Example
1119    /// ```ignore,no_run
1120    /// # use google_cloud_parametermanager_v1::model::ListParameterVersionsRequest;
1121    /// let x = ListParameterVersionsRequest::new().set_filter("example");
1122    /// ```
1123    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1124        self.filter = v.into();
1125        self
1126    }
1127
1128    /// Sets the value of [order_by][crate::model::ListParameterVersionsRequest::order_by].
1129    ///
1130    /// # Example
1131    /// ```ignore,no_run
1132    /// # use google_cloud_parametermanager_v1::model::ListParameterVersionsRequest;
1133    /// let x = ListParameterVersionsRequest::new().set_order_by("example");
1134    /// ```
1135    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1136        self.order_by = v.into();
1137        self
1138    }
1139}
1140
1141impl wkt::message::Message for ListParameterVersionsRequest {
1142    fn typename() -> &'static str {
1143        "type.googleapis.com/google.cloud.parametermanager.v1.ListParameterVersionsRequest"
1144    }
1145}
1146
1147/// Message for response to listing ParameterVersions
1148#[derive(Clone, Default, PartialEq)]
1149#[non_exhaustive]
1150pub struct ListParameterVersionsResponse {
1151    /// The list of ParameterVersions
1152    pub parameter_versions: std::vec::Vec<crate::model::ParameterVersion>,
1153
1154    /// A token identifying a page of results the server should return.
1155    pub next_page_token: std::string::String,
1156
1157    /// Unordered list. Locations that could not be reached.
1158    pub unreachable: std::vec::Vec<std::string::String>,
1159
1160    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1161}
1162
1163impl ListParameterVersionsResponse {
1164    /// Creates a new default instance.
1165    pub fn new() -> Self {
1166        std::default::Default::default()
1167    }
1168
1169    /// Sets the value of [parameter_versions][crate::model::ListParameterVersionsResponse::parameter_versions].
1170    ///
1171    /// # Example
1172    /// ```ignore,no_run
1173    /// # use google_cloud_parametermanager_v1::model::ListParameterVersionsResponse;
1174    /// use google_cloud_parametermanager_v1::model::ParameterVersion;
1175    /// let x = ListParameterVersionsResponse::new()
1176    ///     .set_parameter_versions([
1177    ///         ParameterVersion::default()/* use setters */,
1178    ///         ParameterVersion::default()/* use (different) setters */,
1179    ///     ]);
1180    /// ```
1181    pub fn set_parameter_versions<T, V>(mut self, v: T) -> Self
1182    where
1183        T: std::iter::IntoIterator<Item = V>,
1184        V: std::convert::Into<crate::model::ParameterVersion>,
1185    {
1186        use std::iter::Iterator;
1187        self.parameter_versions = v.into_iter().map(|i| i.into()).collect();
1188        self
1189    }
1190
1191    /// Sets the value of [next_page_token][crate::model::ListParameterVersionsResponse::next_page_token].
1192    ///
1193    /// # Example
1194    /// ```ignore,no_run
1195    /// # use google_cloud_parametermanager_v1::model::ListParameterVersionsResponse;
1196    /// let x = ListParameterVersionsResponse::new().set_next_page_token("example");
1197    /// ```
1198    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1199        self.next_page_token = v.into();
1200        self
1201    }
1202
1203    /// Sets the value of [unreachable][crate::model::ListParameterVersionsResponse::unreachable].
1204    ///
1205    /// # Example
1206    /// ```ignore,no_run
1207    /// # use google_cloud_parametermanager_v1::model::ListParameterVersionsResponse;
1208    /// let x = ListParameterVersionsResponse::new().set_unreachable(["a", "b", "c"]);
1209    /// ```
1210    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
1211    where
1212        T: std::iter::IntoIterator<Item = V>,
1213        V: std::convert::Into<std::string::String>,
1214    {
1215        use std::iter::Iterator;
1216        self.unreachable = v.into_iter().map(|i| i.into()).collect();
1217        self
1218    }
1219}
1220
1221impl wkt::message::Message for ListParameterVersionsResponse {
1222    fn typename() -> &'static str {
1223        "type.googleapis.com/google.cloud.parametermanager.v1.ListParameterVersionsResponse"
1224    }
1225}
1226
1227#[doc(hidden)]
1228impl google_cloud_gax::paginator::internal::PageableResponse for ListParameterVersionsResponse {
1229    type PageItem = crate::model::ParameterVersion;
1230
1231    fn items(self) -> std::vec::Vec<Self::PageItem> {
1232        self.parameter_versions
1233    }
1234
1235    fn next_page_token(&self) -> std::string::String {
1236        use std::clone::Clone;
1237        self.next_page_token.clone()
1238    }
1239}
1240
1241/// Message for getting a ParameterVersion
1242#[derive(Clone, Default, PartialEq)]
1243#[non_exhaustive]
1244pub struct GetParameterVersionRequest {
1245    /// Required. Name of the resource in the format
1246    /// `projects/*/locations/*/parameters/*/versions/*`.
1247    pub name: std::string::String,
1248
1249    /// Optional. View of the ParameterVersion.
1250    /// In the default FULL view, all metadata & payload associated with the
1251    /// ParameterVersion will be returned.
1252    pub view: crate::model::View,
1253
1254    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1255}
1256
1257impl GetParameterVersionRequest {
1258    /// Creates a new default instance.
1259    pub fn new() -> Self {
1260        std::default::Default::default()
1261    }
1262
1263    /// Sets the value of [name][crate::model::GetParameterVersionRequest::name].
1264    ///
1265    /// # Example
1266    /// ```ignore,no_run
1267    /// # use google_cloud_parametermanager_v1::model::GetParameterVersionRequest;
1268    /// # let project_id = "project_id";
1269    /// # let location_id = "location_id";
1270    /// # let parameter_id = "parameter_id";
1271    /// # let parameter_version_id = "parameter_version_id";
1272    /// let x = GetParameterVersionRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/parameters/{parameter_id}/versions/{parameter_version_id}"));
1273    /// ```
1274    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1275        self.name = v.into();
1276        self
1277    }
1278
1279    /// Sets the value of [view][crate::model::GetParameterVersionRequest::view].
1280    ///
1281    /// # Example
1282    /// ```ignore,no_run
1283    /// # use google_cloud_parametermanager_v1::model::GetParameterVersionRequest;
1284    /// use google_cloud_parametermanager_v1::model::View;
1285    /// let x0 = GetParameterVersionRequest::new().set_view(View::Basic);
1286    /// let x1 = GetParameterVersionRequest::new().set_view(View::Full);
1287    /// ```
1288    pub fn set_view<T: std::convert::Into<crate::model::View>>(mut self, v: T) -> Self {
1289        self.view = v.into();
1290        self
1291    }
1292}
1293
1294impl wkt::message::Message for GetParameterVersionRequest {
1295    fn typename() -> &'static str {
1296        "type.googleapis.com/google.cloud.parametermanager.v1.GetParameterVersionRequest"
1297    }
1298}
1299
1300/// Message for getting a ParameterVersionRender
1301#[derive(Clone, Default, PartialEq)]
1302#[non_exhaustive]
1303pub struct RenderParameterVersionRequest {
1304    /// Required. Name of the resource
1305    pub name: std::string::String,
1306
1307    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1308}
1309
1310impl RenderParameterVersionRequest {
1311    /// Creates a new default instance.
1312    pub fn new() -> Self {
1313        std::default::Default::default()
1314    }
1315
1316    /// Sets the value of [name][crate::model::RenderParameterVersionRequest::name].
1317    ///
1318    /// # Example
1319    /// ```ignore,no_run
1320    /// # use google_cloud_parametermanager_v1::model::RenderParameterVersionRequest;
1321    /// # let project_id = "project_id";
1322    /// # let location_id = "location_id";
1323    /// # let parameter_id = "parameter_id";
1324    /// # let parameter_version_id = "parameter_version_id";
1325    /// let x = RenderParameterVersionRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/parameters/{parameter_id}/versions/{parameter_version_id}"));
1326    /// ```
1327    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1328        self.name = v.into();
1329        self
1330    }
1331}
1332
1333impl wkt::message::Message for RenderParameterVersionRequest {
1334    fn typename() -> &'static str {
1335        "type.googleapis.com/google.cloud.parametermanager.v1.RenderParameterVersionRequest"
1336    }
1337}
1338
1339/// Message describing RenderParameterVersionResponse resource
1340#[derive(Clone, Default, PartialEq)]
1341#[non_exhaustive]
1342pub struct RenderParameterVersionResponse {
1343    /// Output only. Resource identifier of a ParameterVersion in the format
1344    /// `projects/*/locations/*/parameters/*/versions/*`.
1345    pub parameter_version: std::string::String,
1346
1347    /// Payload content of a ParameterVersion resource.
1348    pub payload: std::option::Option<crate::model::ParameterVersionPayload>,
1349
1350    /// Output only. Server generated rendered version of the user provided payload
1351    /// data (ParameterVersionPayload) which has substitutions of all (if any)
1352    /// references to a SecretManager SecretVersion resources. This substitution
1353    /// only works for a Parameter which is in JSON or YAML format.
1354    pub rendered_payload: ::bytes::Bytes,
1355
1356    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1357}
1358
1359impl RenderParameterVersionResponse {
1360    /// Creates a new default instance.
1361    pub fn new() -> Self {
1362        std::default::Default::default()
1363    }
1364
1365    /// Sets the value of [parameter_version][crate::model::RenderParameterVersionResponse::parameter_version].
1366    ///
1367    /// # Example
1368    /// ```ignore,no_run
1369    /// # use google_cloud_parametermanager_v1::model::RenderParameterVersionResponse;
1370    /// # let project_id = "project_id";
1371    /// # let location_id = "location_id";
1372    /// # let parameter_id = "parameter_id";
1373    /// # let parameter_version_id = "parameter_version_id";
1374    /// let x = RenderParameterVersionResponse::new().set_parameter_version(format!("projects/{project_id}/locations/{location_id}/parameters/{parameter_id}/versions/{parameter_version_id}"));
1375    /// ```
1376    pub fn set_parameter_version<T: std::convert::Into<std::string::String>>(
1377        mut self,
1378        v: T,
1379    ) -> Self {
1380        self.parameter_version = v.into();
1381        self
1382    }
1383
1384    /// Sets the value of [payload][crate::model::RenderParameterVersionResponse::payload].
1385    ///
1386    /// # Example
1387    /// ```ignore,no_run
1388    /// # use google_cloud_parametermanager_v1::model::RenderParameterVersionResponse;
1389    /// use google_cloud_parametermanager_v1::model::ParameterVersionPayload;
1390    /// let x = RenderParameterVersionResponse::new().set_payload(ParameterVersionPayload::default()/* use setters */);
1391    /// ```
1392    pub fn set_payload<T>(mut self, v: T) -> Self
1393    where
1394        T: std::convert::Into<crate::model::ParameterVersionPayload>,
1395    {
1396        self.payload = std::option::Option::Some(v.into());
1397        self
1398    }
1399
1400    /// Sets or clears the value of [payload][crate::model::RenderParameterVersionResponse::payload].
1401    ///
1402    /// # Example
1403    /// ```ignore,no_run
1404    /// # use google_cloud_parametermanager_v1::model::RenderParameterVersionResponse;
1405    /// use google_cloud_parametermanager_v1::model::ParameterVersionPayload;
1406    /// let x = RenderParameterVersionResponse::new().set_or_clear_payload(Some(ParameterVersionPayload::default()/* use setters */));
1407    /// let x = RenderParameterVersionResponse::new().set_or_clear_payload(None::<ParameterVersionPayload>);
1408    /// ```
1409    pub fn set_or_clear_payload<T>(mut self, v: std::option::Option<T>) -> Self
1410    where
1411        T: std::convert::Into<crate::model::ParameterVersionPayload>,
1412    {
1413        self.payload = v.map(|x| x.into());
1414        self
1415    }
1416
1417    /// Sets the value of [rendered_payload][crate::model::RenderParameterVersionResponse::rendered_payload].
1418    ///
1419    /// # Example
1420    /// ```ignore,no_run
1421    /// # use google_cloud_parametermanager_v1::model::RenderParameterVersionResponse;
1422    /// let x = RenderParameterVersionResponse::new().set_rendered_payload(bytes::Bytes::from_static(b"example"));
1423    /// ```
1424    pub fn set_rendered_payload<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
1425        self.rendered_payload = v.into();
1426        self
1427    }
1428}
1429
1430impl wkt::message::Message for RenderParameterVersionResponse {
1431    fn typename() -> &'static str {
1432        "type.googleapis.com/google.cloud.parametermanager.v1.RenderParameterVersionResponse"
1433    }
1434}
1435
1436/// Message for creating a ParameterVersion
1437#[derive(Clone, Default, PartialEq)]
1438#[non_exhaustive]
1439pub struct CreateParameterVersionRequest {
1440    /// Required. Value for parent in the format
1441    /// `projects/*/locations/*/parameters/*`.
1442    pub parent: std::string::String,
1443
1444    /// Required. Id of the ParameterVersion resource
1445    pub parameter_version_id: std::string::String,
1446
1447    /// Required. The ParameterVersion resource being created
1448    pub parameter_version: std::option::Option<crate::model::ParameterVersion>,
1449
1450    /// Optional. An optional request ID to identify requests. Specify a unique
1451    /// request ID so that if you must retry your request, the server will know to
1452    /// ignore the request if it has already been completed. The server will
1453    /// guarantee that for at least 60 minutes since the first request.
1454    ///
1455    /// For example, consider a situation where you make an initial request and the
1456    /// request times out. If you make the request again with the same request
1457    /// ID, the server can check if original operation with the same request ID
1458    /// was received, and if so, will ignore the second request. This prevents
1459    /// clients from accidentally creating duplicate commitments.
1460    ///
1461    /// The request ID must be a valid UUID with the exception that zero UUID is
1462    /// not supported (00000000-0000-0000-0000-000000000000).
1463    pub request_id: std::string::String,
1464
1465    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1466}
1467
1468impl CreateParameterVersionRequest {
1469    /// Creates a new default instance.
1470    pub fn new() -> Self {
1471        std::default::Default::default()
1472    }
1473
1474    /// Sets the value of [parent][crate::model::CreateParameterVersionRequest::parent].
1475    ///
1476    /// # Example
1477    /// ```ignore,no_run
1478    /// # use google_cloud_parametermanager_v1::model::CreateParameterVersionRequest;
1479    /// # let project_id = "project_id";
1480    /// # let location_id = "location_id";
1481    /// # let parameter_id = "parameter_id";
1482    /// let x = CreateParameterVersionRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/parameters/{parameter_id}"));
1483    /// ```
1484    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1485        self.parent = v.into();
1486        self
1487    }
1488
1489    /// Sets the value of [parameter_version_id][crate::model::CreateParameterVersionRequest::parameter_version_id].
1490    ///
1491    /// # Example
1492    /// ```ignore,no_run
1493    /// # use google_cloud_parametermanager_v1::model::CreateParameterVersionRequest;
1494    /// let x = CreateParameterVersionRequest::new().set_parameter_version_id("example");
1495    /// ```
1496    pub fn set_parameter_version_id<T: std::convert::Into<std::string::String>>(
1497        mut self,
1498        v: T,
1499    ) -> Self {
1500        self.parameter_version_id = v.into();
1501        self
1502    }
1503
1504    /// Sets the value of [parameter_version][crate::model::CreateParameterVersionRequest::parameter_version].
1505    ///
1506    /// # Example
1507    /// ```ignore,no_run
1508    /// # use google_cloud_parametermanager_v1::model::CreateParameterVersionRequest;
1509    /// use google_cloud_parametermanager_v1::model::ParameterVersion;
1510    /// let x = CreateParameterVersionRequest::new().set_parameter_version(ParameterVersion::default()/* use setters */);
1511    /// ```
1512    pub fn set_parameter_version<T>(mut self, v: T) -> Self
1513    where
1514        T: std::convert::Into<crate::model::ParameterVersion>,
1515    {
1516        self.parameter_version = std::option::Option::Some(v.into());
1517        self
1518    }
1519
1520    /// Sets or clears the value of [parameter_version][crate::model::CreateParameterVersionRequest::parameter_version].
1521    ///
1522    /// # Example
1523    /// ```ignore,no_run
1524    /// # use google_cloud_parametermanager_v1::model::CreateParameterVersionRequest;
1525    /// use google_cloud_parametermanager_v1::model::ParameterVersion;
1526    /// let x = CreateParameterVersionRequest::new().set_or_clear_parameter_version(Some(ParameterVersion::default()/* use setters */));
1527    /// let x = CreateParameterVersionRequest::new().set_or_clear_parameter_version(None::<ParameterVersion>);
1528    /// ```
1529    pub fn set_or_clear_parameter_version<T>(mut self, v: std::option::Option<T>) -> Self
1530    where
1531        T: std::convert::Into<crate::model::ParameterVersion>,
1532    {
1533        self.parameter_version = v.map(|x| x.into());
1534        self
1535    }
1536
1537    /// Sets the value of [request_id][crate::model::CreateParameterVersionRequest::request_id].
1538    ///
1539    /// # Example
1540    /// ```ignore,no_run
1541    /// # use google_cloud_parametermanager_v1::model::CreateParameterVersionRequest;
1542    /// let x = CreateParameterVersionRequest::new().set_request_id("example");
1543    /// ```
1544    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1545        self.request_id = v.into();
1546        self
1547    }
1548}
1549
1550impl wkt::message::Message for CreateParameterVersionRequest {
1551    fn typename() -> &'static str {
1552        "type.googleapis.com/google.cloud.parametermanager.v1.CreateParameterVersionRequest"
1553    }
1554}
1555
1556/// Message for updating a ParameterVersion
1557#[derive(Clone, Default, PartialEq)]
1558#[non_exhaustive]
1559pub struct UpdateParameterVersionRequest {
1560    /// Optional. Field mask is used to specify the fields to be overwritten in the
1561    /// ParameterVersion resource by the update.
1562    /// The fields specified in the update_mask are relative to the resource, not
1563    /// the full request. A mutable field will be overwritten if it is in the
1564    /// mask. If the user does not provide a mask then all mutable fields present
1565    /// in the request will be overwritten.
1566    pub update_mask: std::option::Option<wkt::FieldMask>,
1567
1568    /// Required. The ParameterVersion resource being updated
1569    pub parameter_version: std::option::Option<crate::model::ParameterVersion>,
1570
1571    /// Optional. An optional request ID to identify requests. Specify a unique
1572    /// request ID so that if you must retry your request, the server will know to
1573    /// ignore the request if it has already been completed. The server will
1574    /// guarantee that for at least 60 minutes since the first request.
1575    ///
1576    /// For example, consider a situation where you make an initial request and the
1577    /// request times out. If you make the request again with the same request
1578    /// ID, the server can check if original operation with the same request ID
1579    /// was received, and if so, will ignore the second request. This prevents
1580    /// clients from accidentally creating duplicate commitments.
1581    ///
1582    /// The request ID must be a valid UUID with the exception that zero UUID is
1583    /// not supported (00000000-0000-0000-0000-000000000000).
1584    pub request_id: std::string::String,
1585
1586    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1587}
1588
1589impl UpdateParameterVersionRequest {
1590    /// Creates a new default instance.
1591    pub fn new() -> Self {
1592        std::default::Default::default()
1593    }
1594
1595    /// Sets the value of [update_mask][crate::model::UpdateParameterVersionRequest::update_mask].
1596    ///
1597    /// # Example
1598    /// ```ignore,no_run
1599    /// # use google_cloud_parametermanager_v1::model::UpdateParameterVersionRequest;
1600    /// use wkt::FieldMask;
1601    /// let x = UpdateParameterVersionRequest::new().set_update_mask(FieldMask::default()/* use setters */);
1602    /// ```
1603    pub fn set_update_mask<T>(mut self, v: T) -> Self
1604    where
1605        T: std::convert::Into<wkt::FieldMask>,
1606    {
1607        self.update_mask = std::option::Option::Some(v.into());
1608        self
1609    }
1610
1611    /// Sets or clears the value of [update_mask][crate::model::UpdateParameterVersionRequest::update_mask].
1612    ///
1613    /// # Example
1614    /// ```ignore,no_run
1615    /// # use google_cloud_parametermanager_v1::model::UpdateParameterVersionRequest;
1616    /// use wkt::FieldMask;
1617    /// let x = UpdateParameterVersionRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
1618    /// let x = UpdateParameterVersionRequest::new().set_or_clear_update_mask(None::<FieldMask>);
1619    /// ```
1620    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1621    where
1622        T: std::convert::Into<wkt::FieldMask>,
1623    {
1624        self.update_mask = v.map(|x| x.into());
1625        self
1626    }
1627
1628    /// Sets the value of [parameter_version][crate::model::UpdateParameterVersionRequest::parameter_version].
1629    ///
1630    /// # Example
1631    /// ```ignore,no_run
1632    /// # use google_cloud_parametermanager_v1::model::UpdateParameterVersionRequest;
1633    /// use google_cloud_parametermanager_v1::model::ParameterVersion;
1634    /// let x = UpdateParameterVersionRequest::new().set_parameter_version(ParameterVersion::default()/* use setters */);
1635    /// ```
1636    pub fn set_parameter_version<T>(mut self, v: T) -> Self
1637    where
1638        T: std::convert::Into<crate::model::ParameterVersion>,
1639    {
1640        self.parameter_version = std::option::Option::Some(v.into());
1641        self
1642    }
1643
1644    /// Sets or clears the value of [parameter_version][crate::model::UpdateParameterVersionRequest::parameter_version].
1645    ///
1646    /// # Example
1647    /// ```ignore,no_run
1648    /// # use google_cloud_parametermanager_v1::model::UpdateParameterVersionRequest;
1649    /// use google_cloud_parametermanager_v1::model::ParameterVersion;
1650    /// let x = UpdateParameterVersionRequest::new().set_or_clear_parameter_version(Some(ParameterVersion::default()/* use setters */));
1651    /// let x = UpdateParameterVersionRequest::new().set_or_clear_parameter_version(None::<ParameterVersion>);
1652    /// ```
1653    pub fn set_or_clear_parameter_version<T>(mut self, v: std::option::Option<T>) -> Self
1654    where
1655        T: std::convert::Into<crate::model::ParameterVersion>,
1656    {
1657        self.parameter_version = v.map(|x| x.into());
1658        self
1659    }
1660
1661    /// Sets the value of [request_id][crate::model::UpdateParameterVersionRequest::request_id].
1662    ///
1663    /// # Example
1664    /// ```ignore,no_run
1665    /// # use google_cloud_parametermanager_v1::model::UpdateParameterVersionRequest;
1666    /// let x = UpdateParameterVersionRequest::new().set_request_id("example");
1667    /// ```
1668    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1669        self.request_id = v.into();
1670        self
1671    }
1672}
1673
1674impl wkt::message::Message for UpdateParameterVersionRequest {
1675    fn typename() -> &'static str {
1676        "type.googleapis.com/google.cloud.parametermanager.v1.UpdateParameterVersionRequest"
1677    }
1678}
1679
1680/// Message for deleting a ParameterVersion
1681#[derive(Clone, Default, PartialEq)]
1682#[non_exhaustive]
1683pub struct DeleteParameterVersionRequest {
1684    /// Required. Name of the resource in the format
1685    /// `projects/*/locations/*/parameters/*/versions/*`.
1686    pub name: std::string::String,
1687
1688    /// Optional. An optional request ID to identify requests. Specify a unique
1689    /// request ID so that if you must retry your request, the server will know to
1690    /// ignore the request if it has already been completed. The server will
1691    /// guarantee that for at least 60 minutes after the first request.
1692    ///
1693    /// For example, consider a situation where you make an initial request and the
1694    /// request times out. If you make the request again with the same request
1695    /// ID, the server can check if original operation with the same request ID
1696    /// was received, and if so, will ignore the second request. This prevents
1697    /// clients from accidentally creating duplicate commitments.
1698    ///
1699    /// The request ID must be a valid UUID with the exception that zero UUID is
1700    /// not supported (00000000-0000-0000-0000-000000000000).
1701    pub request_id: std::string::String,
1702
1703    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1704}
1705
1706impl DeleteParameterVersionRequest {
1707    /// Creates a new default instance.
1708    pub fn new() -> Self {
1709        std::default::Default::default()
1710    }
1711
1712    /// Sets the value of [name][crate::model::DeleteParameterVersionRequest::name].
1713    ///
1714    /// # Example
1715    /// ```ignore,no_run
1716    /// # use google_cloud_parametermanager_v1::model::DeleteParameterVersionRequest;
1717    /// # let project_id = "project_id";
1718    /// # let location_id = "location_id";
1719    /// # let parameter_id = "parameter_id";
1720    /// # let parameter_version_id = "parameter_version_id";
1721    /// let x = DeleteParameterVersionRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/parameters/{parameter_id}/versions/{parameter_version_id}"));
1722    /// ```
1723    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1724        self.name = v.into();
1725        self
1726    }
1727
1728    /// Sets the value of [request_id][crate::model::DeleteParameterVersionRequest::request_id].
1729    ///
1730    /// # Example
1731    /// ```ignore,no_run
1732    /// # use google_cloud_parametermanager_v1::model::DeleteParameterVersionRequest;
1733    /// let x = DeleteParameterVersionRequest::new().set_request_id("example");
1734    /// ```
1735    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1736        self.request_id = v.into();
1737        self
1738    }
1739}
1740
1741impl wkt::message::Message for DeleteParameterVersionRequest {
1742    fn typename() -> &'static str {
1743        "type.googleapis.com/google.cloud.parametermanager.v1.DeleteParameterVersionRequest"
1744    }
1745}
1746
1747/// Option to specify the format of a Parameter resource (UNFORMATTED / YAML /
1748/// JSON). This option is user specified at the time of creation of the resource
1749/// and is immutable.
1750///
1751/// # Working with unknown values
1752///
1753/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1754/// additional enum variants at any time. Adding new variants is not considered
1755/// a breaking change. Applications should write their code in anticipation of:
1756///
1757/// - New values appearing in future releases of the client library, **and**
1758/// - New values received dynamically, without application changes.
1759///
1760/// Please consult the [Working with enums] section in the user guide for some
1761/// guidelines.
1762///
1763/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
1764#[derive(Clone, Debug, PartialEq)]
1765#[non_exhaustive]
1766pub enum ParameterFormat {
1767    /// The default / unset value.
1768    /// The API will default to the UNFORMATTED format.
1769    Unspecified,
1770    /// Unformatted.
1771    Unformatted,
1772    /// YAML format.
1773    Yaml,
1774    /// JSON format.
1775    Json,
1776    /// If set, the enum was initialized with an unknown value.
1777    ///
1778    /// Applications can examine the value using [ParameterFormat::value] or
1779    /// [ParameterFormat::name].
1780    UnknownValue(parameter_format::UnknownValue),
1781}
1782
1783#[doc(hidden)]
1784pub mod parameter_format {
1785    #[allow(unused_imports)]
1786    use super::*;
1787    #[derive(Clone, Debug, PartialEq)]
1788    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1789}
1790
1791impl ParameterFormat {
1792    /// Gets the enum value.
1793    ///
1794    /// Returns `None` if the enum contains an unknown value deserialized from
1795    /// the string representation of enums.
1796    pub fn value(&self) -> std::option::Option<i32> {
1797        match self {
1798            Self::Unspecified => std::option::Option::Some(0),
1799            Self::Unformatted => std::option::Option::Some(1),
1800            Self::Yaml => std::option::Option::Some(2),
1801            Self::Json => std::option::Option::Some(3),
1802            Self::UnknownValue(u) => u.0.value(),
1803        }
1804    }
1805
1806    /// Gets the enum value as a string.
1807    ///
1808    /// Returns `None` if the enum contains an unknown value deserialized from
1809    /// the integer representation of enums.
1810    pub fn name(&self) -> std::option::Option<&str> {
1811        match self {
1812            Self::Unspecified => std::option::Option::Some("PARAMETER_FORMAT_UNSPECIFIED"),
1813            Self::Unformatted => std::option::Option::Some("UNFORMATTED"),
1814            Self::Yaml => std::option::Option::Some("YAML"),
1815            Self::Json => std::option::Option::Some("JSON"),
1816            Self::UnknownValue(u) => u.0.name(),
1817        }
1818    }
1819}
1820
1821impl std::default::Default for ParameterFormat {
1822    fn default() -> Self {
1823        use std::convert::From;
1824        Self::from(0)
1825    }
1826}
1827
1828impl std::fmt::Display for ParameterFormat {
1829    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1830        wkt::internal::display_enum(f, self.name(), self.value())
1831    }
1832}
1833
1834impl std::convert::From<i32> for ParameterFormat {
1835    fn from(value: i32) -> Self {
1836        match value {
1837            0 => Self::Unspecified,
1838            1 => Self::Unformatted,
1839            2 => Self::Yaml,
1840            3 => Self::Json,
1841            _ => Self::UnknownValue(parameter_format::UnknownValue(
1842                wkt::internal::UnknownEnumValue::Integer(value),
1843            )),
1844        }
1845    }
1846}
1847
1848impl std::convert::From<&str> for ParameterFormat {
1849    fn from(value: &str) -> Self {
1850        use std::string::ToString;
1851        match value {
1852            "PARAMETER_FORMAT_UNSPECIFIED" => Self::Unspecified,
1853            "UNFORMATTED" => Self::Unformatted,
1854            "YAML" => Self::Yaml,
1855            "JSON" => Self::Json,
1856            _ => Self::UnknownValue(parameter_format::UnknownValue(
1857                wkt::internal::UnknownEnumValue::String(value.to_string()),
1858            )),
1859        }
1860    }
1861}
1862
1863impl serde::ser::Serialize for ParameterFormat {
1864    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1865    where
1866        S: serde::Serializer,
1867    {
1868        match self {
1869            Self::Unspecified => serializer.serialize_i32(0),
1870            Self::Unformatted => serializer.serialize_i32(1),
1871            Self::Yaml => serializer.serialize_i32(2),
1872            Self::Json => serializer.serialize_i32(3),
1873            Self::UnknownValue(u) => u.0.serialize(serializer),
1874        }
1875    }
1876}
1877
1878impl<'de> serde::de::Deserialize<'de> for ParameterFormat {
1879    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1880    where
1881        D: serde::Deserializer<'de>,
1882    {
1883        deserializer.deserialize_any(wkt::internal::EnumVisitor::<ParameterFormat>::new(
1884            ".google.cloud.parametermanager.v1.ParameterFormat",
1885        ))
1886    }
1887}
1888
1889/// Option for requesting only metadata, or user provided payload
1890/// of a ParameterVersion resource.
1891///
1892/// # Working with unknown values
1893///
1894/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1895/// additional enum variants at any time. Adding new variants is not considered
1896/// a breaking change. Applications should write their code in anticipation of:
1897///
1898/// - New values appearing in future releases of the client library, **and**
1899/// - New values received dynamically, without application changes.
1900///
1901/// Please consult the [Working with enums] section in the user guide for some
1902/// guidelines.
1903///
1904/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
1905#[derive(Clone, Debug, PartialEq)]
1906#[non_exhaustive]
1907pub enum View {
1908    /// The default / unset value.
1909    /// The API will default to the FULL view..
1910    Unspecified,
1911    /// Include only the metadata for the resource.
1912    Basic,
1913    /// Include metadata & other relevant payload data as well.
1914    /// This is the default view.
1915    Full,
1916    /// If set, the enum was initialized with an unknown value.
1917    ///
1918    /// Applications can examine the value using [View::value] or
1919    /// [View::name].
1920    UnknownValue(view::UnknownValue),
1921}
1922
1923#[doc(hidden)]
1924pub mod view {
1925    #[allow(unused_imports)]
1926    use super::*;
1927    #[derive(Clone, Debug, PartialEq)]
1928    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1929}
1930
1931impl View {
1932    /// Gets the enum value.
1933    ///
1934    /// Returns `None` if the enum contains an unknown value deserialized from
1935    /// the string representation of enums.
1936    pub fn value(&self) -> std::option::Option<i32> {
1937        match self {
1938            Self::Unspecified => std::option::Option::Some(0),
1939            Self::Basic => std::option::Option::Some(1),
1940            Self::Full => std::option::Option::Some(2),
1941            Self::UnknownValue(u) => u.0.value(),
1942        }
1943    }
1944
1945    /// Gets the enum value as a string.
1946    ///
1947    /// Returns `None` if the enum contains an unknown value deserialized from
1948    /// the integer representation of enums.
1949    pub fn name(&self) -> std::option::Option<&str> {
1950        match self {
1951            Self::Unspecified => std::option::Option::Some("VIEW_UNSPECIFIED"),
1952            Self::Basic => std::option::Option::Some("BASIC"),
1953            Self::Full => std::option::Option::Some("FULL"),
1954            Self::UnknownValue(u) => u.0.name(),
1955        }
1956    }
1957}
1958
1959impl std::default::Default for View {
1960    fn default() -> Self {
1961        use std::convert::From;
1962        Self::from(0)
1963    }
1964}
1965
1966impl std::fmt::Display for View {
1967    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1968        wkt::internal::display_enum(f, self.name(), self.value())
1969    }
1970}
1971
1972impl std::convert::From<i32> for View {
1973    fn from(value: i32) -> Self {
1974        match value {
1975            0 => Self::Unspecified,
1976            1 => Self::Basic,
1977            2 => Self::Full,
1978            _ => Self::UnknownValue(view::UnknownValue(
1979                wkt::internal::UnknownEnumValue::Integer(value),
1980            )),
1981        }
1982    }
1983}
1984
1985impl std::convert::From<&str> for View {
1986    fn from(value: &str) -> Self {
1987        use std::string::ToString;
1988        match value {
1989            "VIEW_UNSPECIFIED" => Self::Unspecified,
1990            "BASIC" => Self::Basic,
1991            "FULL" => Self::Full,
1992            _ => Self::UnknownValue(view::UnknownValue(wkt::internal::UnknownEnumValue::String(
1993                value.to_string(),
1994            ))),
1995        }
1996    }
1997}
1998
1999impl serde::ser::Serialize for View {
2000    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2001    where
2002        S: serde::Serializer,
2003    {
2004        match self {
2005            Self::Unspecified => serializer.serialize_i32(0),
2006            Self::Basic => serializer.serialize_i32(1),
2007            Self::Full => serializer.serialize_i32(2),
2008            Self::UnknownValue(u) => u.0.serialize(serializer),
2009        }
2010    }
2011}
2012
2013impl<'de> serde::de::Deserialize<'de> for View {
2014    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2015    where
2016        D: serde::Deserializer<'de>,
2017    {
2018        deserializer.deserialize_any(wkt::internal::EnumVisitor::<View>::new(
2019            ".google.cloud.parametermanager.v1.View",
2020        ))
2021    }
2022}