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