google_cloud_security_privateca_v1/model.rs
1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17#![allow(rustdoc::redundant_explicit_links)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![no_implicit_prelude]
20extern crate async_trait;
21extern crate bytes;
22extern crate gax;
23extern crate gaxi;
24extern crate gtype;
25extern crate iam_v1;
26extern crate lazy_static;
27extern crate location;
28extern crate longrunning;
29extern crate lro;
30extern crate reqwest;
31extern crate serde;
32extern crate serde_json;
33extern crate serde_with;
34extern crate std;
35extern crate tracing;
36extern crate wkt;
37
38mod debug;
39mod deserialize;
40mod serialize;
41
42/// A
43/// [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]
44/// represents an individual Certificate Authority. A
45/// [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]
46/// can be used to create
47/// [Certificates][google.cloud.security.privateca.v1.Certificate].
48///
49/// [google.cloud.security.privateca.v1.Certificate]: crate::model::Certificate
50/// [google.cloud.security.privateca.v1.CertificateAuthority]: crate::model::CertificateAuthority
51#[derive(Clone, Default, PartialEq)]
52#[non_exhaustive]
53pub struct CertificateAuthority {
54 /// Identifier. The resource name for this
55 /// [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]
56 /// in the format `projects/*/locations/*/caPools/*/certificateAuthorities/*`.
57 ///
58 /// [google.cloud.security.privateca.v1.CertificateAuthority]: crate::model::CertificateAuthority
59 pub name: std::string::String,
60
61 /// Required. Immutable. The
62 /// [Type][google.cloud.security.privateca.v1.CertificateAuthority.Type] of
63 /// this
64 /// [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority].
65 ///
66 /// [google.cloud.security.privateca.v1.CertificateAuthority]: crate::model::CertificateAuthority
67 /// [google.cloud.security.privateca.v1.CertificateAuthority.Type]: crate::model::certificate_authority::Type
68 pub r#type: crate::model::certificate_authority::Type,
69
70 /// Required. Immutable. The config used to create a self-signed X.509
71 /// certificate or CSR.
72 pub config: std::option::Option<crate::model::CertificateConfig>,
73
74 /// Required. Immutable. The desired lifetime of the CA certificate. Used to
75 /// create the "not_before_time" and "not_after_time" fields inside an X.509
76 /// certificate.
77 pub lifetime: std::option::Option<wkt::Duration>,
78
79 /// Required. Immutable. Used when issuing certificates for this
80 /// [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority].
81 /// If this
82 /// [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]
83 /// is a self-signed CertificateAuthority, this key is also used to sign the
84 /// self-signed CA certificate. Otherwise, it is used to sign a CSR.
85 ///
86 /// [google.cloud.security.privateca.v1.CertificateAuthority]: crate::model::CertificateAuthority
87 pub key_spec: std::option::Option<crate::model::certificate_authority::KeyVersionSpec>,
88
89 /// Optional. If this is a subordinate
90 /// [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority],
91 /// this field will be set with the subordinate configuration, which describes
92 /// its issuers. This may be updated, but this
93 /// [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]
94 /// must continue to validate.
95 ///
96 /// [google.cloud.security.privateca.v1.CertificateAuthority]: crate::model::CertificateAuthority
97 pub subordinate_config: std::option::Option<crate::model::SubordinateConfig>,
98
99 /// Output only. The
100 /// [CaPool.Tier][google.cloud.security.privateca.v1.CaPool.Tier] of the
101 /// [CaPool][google.cloud.security.privateca.v1.CaPool] that includes this
102 /// [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority].
103 ///
104 /// [google.cloud.security.privateca.v1.CaPool]: crate::model::CaPool
105 /// [google.cloud.security.privateca.v1.CaPool.Tier]: crate::model::ca_pool::Tier
106 /// [google.cloud.security.privateca.v1.CertificateAuthority]: crate::model::CertificateAuthority
107 pub tier: crate::model::ca_pool::Tier,
108
109 /// Output only. The
110 /// [State][google.cloud.security.privateca.v1.CertificateAuthority.State] for
111 /// this
112 /// [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority].
113 ///
114 /// [google.cloud.security.privateca.v1.CertificateAuthority]: crate::model::CertificateAuthority
115 /// [google.cloud.security.privateca.v1.CertificateAuthority.State]: crate::model::certificate_authority::State
116 pub state: crate::model::certificate_authority::State,
117
118 /// Output only. This
119 /// [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]'s
120 /// certificate chain, including the current
121 /// [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]'s
122 /// certificate. Ordered such that the root issuer is the final element
123 /// (consistent with RFC 5246). For a self-signed CA, this will only list the
124 /// current
125 /// [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]'s
126 /// certificate.
127 ///
128 /// [google.cloud.security.privateca.v1.CertificateAuthority]: crate::model::CertificateAuthority
129 pub pem_ca_certificates: std::vec::Vec<std::string::String>,
130
131 /// Output only. A structured description of this
132 /// [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]'s
133 /// CA certificate and its issuers. Ordered as self-to-root.
134 ///
135 /// [google.cloud.security.privateca.v1.CertificateAuthority]: crate::model::CertificateAuthority
136 pub ca_certificate_descriptions: std::vec::Vec<crate::model::CertificateDescription>,
137
138 /// Immutable. The name of a Cloud Storage bucket where this
139 /// [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]
140 /// will publish content, such as the CA certificate and CRLs. This must be a
141 /// bucket name, without any prefixes (such as `gs://`) or suffixes (such as
142 /// `.googleapis.com`). For example, to use a bucket named `my-bucket`, you
143 /// would simply specify `my-bucket`. If not specified, a managed bucket will
144 /// be created.
145 ///
146 /// [google.cloud.security.privateca.v1.CertificateAuthority]: crate::model::CertificateAuthority
147 pub gcs_bucket: std::string::String,
148
149 /// Output only. URLs for accessing content published by this CA, such as the
150 /// CA certificate and CRLs.
151 pub access_urls: std::option::Option<crate::model::certificate_authority::AccessUrls>,
152
153 /// Output only. The time at which this
154 /// [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]
155 /// was created.
156 ///
157 /// [google.cloud.security.privateca.v1.CertificateAuthority]: crate::model::CertificateAuthority
158 pub create_time: std::option::Option<wkt::Timestamp>,
159
160 /// Output only. The time at which this
161 /// [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]
162 /// was last updated.
163 ///
164 /// [google.cloud.security.privateca.v1.CertificateAuthority]: crate::model::CertificateAuthority
165 pub update_time: std::option::Option<wkt::Timestamp>,
166
167 /// Output only. The time at which this
168 /// [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]
169 /// was soft deleted, if it is in the
170 /// [DELETED][google.cloud.security.privateca.v1.CertificateAuthority.State.DELETED]
171 /// state.
172 ///
173 /// [google.cloud.security.privateca.v1.CertificateAuthority]: crate::model::CertificateAuthority
174 /// [google.cloud.security.privateca.v1.CertificateAuthority.State.DELETED]: crate::model::certificate_authority::State::Deleted
175 pub delete_time: std::option::Option<wkt::Timestamp>,
176
177 /// Output only. The time at which this
178 /// [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]
179 /// will be permanently purged, if it is in the
180 /// [DELETED][google.cloud.security.privateca.v1.CertificateAuthority.State.DELETED]
181 /// state.
182 ///
183 /// [google.cloud.security.privateca.v1.CertificateAuthority]: crate::model::CertificateAuthority
184 /// [google.cloud.security.privateca.v1.CertificateAuthority.State.DELETED]: crate::model::certificate_authority::State::Deleted
185 pub expire_time: std::option::Option<wkt::Timestamp>,
186
187 /// Optional. Labels with user-defined metadata.
188 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
189
190 /// Optional. User-defined URLs for CA certificate and CRLs. The service does
191 /// not publish content to these URLs. It is up to the user to mirror content
192 /// to these URLs.
193 pub user_defined_access_urls:
194 std::option::Option<crate::model::certificate_authority::UserDefinedAccessUrls>,
195
196 /// Output only. Reserved for future use.
197 pub satisfies_pzs: bool,
198
199 /// Output only. Reserved for future use.
200 pub satisfies_pzi: bool,
201
202 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
203}
204
205impl CertificateAuthority {
206 pub fn new() -> Self {
207 std::default::Default::default()
208 }
209
210 /// Sets the value of [name][crate::model::CertificateAuthority::name].
211 ///
212 /// # Example
213 /// ```ignore,no_run
214 /// # use google_cloud_security_privateca_v1::model::CertificateAuthority;
215 /// let x = CertificateAuthority::new().set_name("example");
216 /// ```
217 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
218 self.name = v.into();
219 self
220 }
221
222 /// Sets the value of [r#type][crate::model::CertificateAuthority::type].
223 ///
224 /// # Example
225 /// ```ignore,no_run
226 /// # use google_cloud_security_privateca_v1::model::CertificateAuthority;
227 /// use google_cloud_security_privateca_v1::model::certificate_authority::Type;
228 /// let x0 = CertificateAuthority::new().set_type(Type::SelfSigned);
229 /// let x1 = CertificateAuthority::new().set_type(Type::Subordinate);
230 /// ```
231 pub fn set_type<T: std::convert::Into<crate::model::certificate_authority::Type>>(
232 mut self,
233 v: T,
234 ) -> Self {
235 self.r#type = v.into();
236 self
237 }
238
239 /// Sets the value of [config][crate::model::CertificateAuthority::config].
240 ///
241 /// # Example
242 /// ```ignore,no_run
243 /// # use google_cloud_security_privateca_v1::model::CertificateAuthority;
244 /// use google_cloud_security_privateca_v1::model::CertificateConfig;
245 /// let x = CertificateAuthority::new().set_config(CertificateConfig::default()/* use setters */);
246 /// ```
247 pub fn set_config<T>(mut self, v: T) -> Self
248 where
249 T: std::convert::Into<crate::model::CertificateConfig>,
250 {
251 self.config = std::option::Option::Some(v.into());
252 self
253 }
254
255 /// Sets or clears the value of [config][crate::model::CertificateAuthority::config].
256 ///
257 /// # Example
258 /// ```ignore,no_run
259 /// # use google_cloud_security_privateca_v1::model::CertificateAuthority;
260 /// use google_cloud_security_privateca_v1::model::CertificateConfig;
261 /// let x = CertificateAuthority::new().set_or_clear_config(Some(CertificateConfig::default()/* use setters */));
262 /// let x = CertificateAuthority::new().set_or_clear_config(None::<CertificateConfig>);
263 /// ```
264 pub fn set_or_clear_config<T>(mut self, v: std::option::Option<T>) -> Self
265 where
266 T: std::convert::Into<crate::model::CertificateConfig>,
267 {
268 self.config = v.map(|x| x.into());
269 self
270 }
271
272 /// Sets the value of [lifetime][crate::model::CertificateAuthority::lifetime].
273 ///
274 /// # Example
275 /// ```ignore,no_run
276 /// # use google_cloud_security_privateca_v1::model::CertificateAuthority;
277 /// use wkt::Duration;
278 /// let x = CertificateAuthority::new().set_lifetime(Duration::default()/* use setters */);
279 /// ```
280 pub fn set_lifetime<T>(mut self, v: T) -> Self
281 where
282 T: std::convert::Into<wkt::Duration>,
283 {
284 self.lifetime = std::option::Option::Some(v.into());
285 self
286 }
287
288 /// Sets or clears the value of [lifetime][crate::model::CertificateAuthority::lifetime].
289 ///
290 /// # Example
291 /// ```ignore,no_run
292 /// # use google_cloud_security_privateca_v1::model::CertificateAuthority;
293 /// use wkt::Duration;
294 /// let x = CertificateAuthority::new().set_or_clear_lifetime(Some(Duration::default()/* use setters */));
295 /// let x = CertificateAuthority::new().set_or_clear_lifetime(None::<Duration>);
296 /// ```
297 pub fn set_or_clear_lifetime<T>(mut self, v: std::option::Option<T>) -> Self
298 where
299 T: std::convert::Into<wkt::Duration>,
300 {
301 self.lifetime = v.map(|x| x.into());
302 self
303 }
304
305 /// Sets the value of [key_spec][crate::model::CertificateAuthority::key_spec].
306 ///
307 /// # Example
308 /// ```ignore,no_run
309 /// # use google_cloud_security_privateca_v1::model::CertificateAuthority;
310 /// use google_cloud_security_privateca_v1::model::certificate_authority::KeyVersionSpec;
311 /// let x = CertificateAuthority::new().set_key_spec(KeyVersionSpec::default()/* use setters */);
312 /// ```
313 pub fn set_key_spec<T>(mut self, v: T) -> Self
314 where
315 T: std::convert::Into<crate::model::certificate_authority::KeyVersionSpec>,
316 {
317 self.key_spec = std::option::Option::Some(v.into());
318 self
319 }
320
321 /// Sets or clears the value of [key_spec][crate::model::CertificateAuthority::key_spec].
322 ///
323 /// # Example
324 /// ```ignore,no_run
325 /// # use google_cloud_security_privateca_v1::model::CertificateAuthority;
326 /// use google_cloud_security_privateca_v1::model::certificate_authority::KeyVersionSpec;
327 /// let x = CertificateAuthority::new().set_or_clear_key_spec(Some(KeyVersionSpec::default()/* use setters */));
328 /// let x = CertificateAuthority::new().set_or_clear_key_spec(None::<KeyVersionSpec>);
329 /// ```
330 pub fn set_or_clear_key_spec<T>(mut self, v: std::option::Option<T>) -> Self
331 where
332 T: std::convert::Into<crate::model::certificate_authority::KeyVersionSpec>,
333 {
334 self.key_spec = v.map(|x| x.into());
335 self
336 }
337
338 /// Sets the value of [subordinate_config][crate::model::CertificateAuthority::subordinate_config].
339 ///
340 /// # Example
341 /// ```ignore,no_run
342 /// # use google_cloud_security_privateca_v1::model::CertificateAuthority;
343 /// use google_cloud_security_privateca_v1::model::SubordinateConfig;
344 /// let x = CertificateAuthority::new().set_subordinate_config(SubordinateConfig::default()/* use setters */);
345 /// ```
346 pub fn set_subordinate_config<T>(mut self, v: T) -> Self
347 where
348 T: std::convert::Into<crate::model::SubordinateConfig>,
349 {
350 self.subordinate_config = std::option::Option::Some(v.into());
351 self
352 }
353
354 /// Sets or clears the value of [subordinate_config][crate::model::CertificateAuthority::subordinate_config].
355 ///
356 /// # Example
357 /// ```ignore,no_run
358 /// # use google_cloud_security_privateca_v1::model::CertificateAuthority;
359 /// use google_cloud_security_privateca_v1::model::SubordinateConfig;
360 /// let x = CertificateAuthority::new().set_or_clear_subordinate_config(Some(SubordinateConfig::default()/* use setters */));
361 /// let x = CertificateAuthority::new().set_or_clear_subordinate_config(None::<SubordinateConfig>);
362 /// ```
363 pub fn set_or_clear_subordinate_config<T>(mut self, v: std::option::Option<T>) -> Self
364 where
365 T: std::convert::Into<crate::model::SubordinateConfig>,
366 {
367 self.subordinate_config = v.map(|x| x.into());
368 self
369 }
370
371 /// Sets the value of [tier][crate::model::CertificateAuthority::tier].
372 ///
373 /// # Example
374 /// ```ignore,no_run
375 /// # use google_cloud_security_privateca_v1::model::CertificateAuthority;
376 /// use google_cloud_security_privateca_v1::model::ca_pool::Tier;
377 /// let x0 = CertificateAuthority::new().set_tier(Tier::Enterprise);
378 /// let x1 = CertificateAuthority::new().set_tier(Tier::Devops);
379 /// ```
380 pub fn set_tier<T: std::convert::Into<crate::model::ca_pool::Tier>>(mut self, v: T) -> Self {
381 self.tier = v.into();
382 self
383 }
384
385 /// Sets the value of [state][crate::model::CertificateAuthority::state].
386 ///
387 /// # Example
388 /// ```ignore,no_run
389 /// # use google_cloud_security_privateca_v1::model::CertificateAuthority;
390 /// use google_cloud_security_privateca_v1::model::certificate_authority::State;
391 /// let x0 = CertificateAuthority::new().set_state(State::Enabled);
392 /// let x1 = CertificateAuthority::new().set_state(State::Disabled);
393 /// let x2 = CertificateAuthority::new().set_state(State::Staged);
394 /// ```
395 pub fn set_state<T: std::convert::Into<crate::model::certificate_authority::State>>(
396 mut self,
397 v: T,
398 ) -> Self {
399 self.state = v.into();
400 self
401 }
402
403 /// Sets the value of [pem_ca_certificates][crate::model::CertificateAuthority::pem_ca_certificates].
404 ///
405 /// # Example
406 /// ```ignore,no_run
407 /// # use google_cloud_security_privateca_v1::model::CertificateAuthority;
408 /// let x = CertificateAuthority::new().set_pem_ca_certificates(["a", "b", "c"]);
409 /// ```
410 pub fn set_pem_ca_certificates<T, V>(mut self, v: T) -> Self
411 where
412 T: std::iter::IntoIterator<Item = V>,
413 V: std::convert::Into<std::string::String>,
414 {
415 use std::iter::Iterator;
416 self.pem_ca_certificates = v.into_iter().map(|i| i.into()).collect();
417 self
418 }
419
420 /// Sets the value of [ca_certificate_descriptions][crate::model::CertificateAuthority::ca_certificate_descriptions].
421 ///
422 /// # Example
423 /// ```ignore,no_run
424 /// # use google_cloud_security_privateca_v1::model::CertificateAuthority;
425 /// use google_cloud_security_privateca_v1::model::CertificateDescription;
426 /// let x = CertificateAuthority::new()
427 /// .set_ca_certificate_descriptions([
428 /// CertificateDescription::default()/* use setters */,
429 /// CertificateDescription::default()/* use (different) setters */,
430 /// ]);
431 /// ```
432 pub fn set_ca_certificate_descriptions<T, V>(mut self, v: T) -> Self
433 where
434 T: std::iter::IntoIterator<Item = V>,
435 V: std::convert::Into<crate::model::CertificateDescription>,
436 {
437 use std::iter::Iterator;
438 self.ca_certificate_descriptions = v.into_iter().map(|i| i.into()).collect();
439 self
440 }
441
442 /// Sets the value of [gcs_bucket][crate::model::CertificateAuthority::gcs_bucket].
443 ///
444 /// # Example
445 /// ```ignore,no_run
446 /// # use google_cloud_security_privateca_v1::model::CertificateAuthority;
447 /// let x = CertificateAuthority::new().set_gcs_bucket("example");
448 /// ```
449 pub fn set_gcs_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
450 self.gcs_bucket = v.into();
451 self
452 }
453
454 /// Sets the value of [access_urls][crate::model::CertificateAuthority::access_urls].
455 ///
456 /// # Example
457 /// ```ignore,no_run
458 /// # use google_cloud_security_privateca_v1::model::CertificateAuthority;
459 /// use google_cloud_security_privateca_v1::model::certificate_authority::AccessUrls;
460 /// let x = CertificateAuthority::new().set_access_urls(AccessUrls::default()/* use setters */);
461 /// ```
462 pub fn set_access_urls<T>(mut self, v: T) -> Self
463 where
464 T: std::convert::Into<crate::model::certificate_authority::AccessUrls>,
465 {
466 self.access_urls = std::option::Option::Some(v.into());
467 self
468 }
469
470 /// Sets or clears the value of [access_urls][crate::model::CertificateAuthority::access_urls].
471 ///
472 /// # Example
473 /// ```ignore,no_run
474 /// # use google_cloud_security_privateca_v1::model::CertificateAuthority;
475 /// use google_cloud_security_privateca_v1::model::certificate_authority::AccessUrls;
476 /// let x = CertificateAuthority::new().set_or_clear_access_urls(Some(AccessUrls::default()/* use setters */));
477 /// let x = CertificateAuthority::new().set_or_clear_access_urls(None::<AccessUrls>);
478 /// ```
479 pub fn set_or_clear_access_urls<T>(mut self, v: std::option::Option<T>) -> Self
480 where
481 T: std::convert::Into<crate::model::certificate_authority::AccessUrls>,
482 {
483 self.access_urls = v.map(|x| x.into());
484 self
485 }
486
487 /// Sets the value of [create_time][crate::model::CertificateAuthority::create_time].
488 ///
489 /// # Example
490 /// ```ignore,no_run
491 /// # use google_cloud_security_privateca_v1::model::CertificateAuthority;
492 /// use wkt::Timestamp;
493 /// let x = CertificateAuthority::new().set_create_time(Timestamp::default()/* use setters */);
494 /// ```
495 pub fn set_create_time<T>(mut self, v: T) -> Self
496 where
497 T: std::convert::Into<wkt::Timestamp>,
498 {
499 self.create_time = std::option::Option::Some(v.into());
500 self
501 }
502
503 /// Sets or clears the value of [create_time][crate::model::CertificateAuthority::create_time].
504 ///
505 /// # Example
506 /// ```ignore,no_run
507 /// # use google_cloud_security_privateca_v1::model::CertificateAuthority;
508 /// use wkt::Timestamp;
509 /// let x = CertificateAuthority::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
510 /// let x = CertificateAuthority::new().set_or_clear_create_time(None::<Timestamp>);
511 /// ```
512 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
513 where
514 T: std::convert::Into<wkt::Timestamp>,
515 {
516 self.create_time = v.map(|x| x.into());
517 self
518 }
519
520 /// Sets the value of [update_time][crate::model::CertificateAuthority::update_time].
521 ///
522 /// # Example
523 /// ```ignore,no_run
524 /// # use google_cloud_security_privateca_v1::model::CertificateAuthority;
525 /// use wkt::Timestamp;
526 /// let x = CertificateAuthority::new().set_update_time(Timestamp::default()/* use setters */);
527 /// ```
528 pub fn set_update_time<T>(mut self, v: T) -> Self
529 where
530 T: std::convert::Into<wkt::Timestamp>,
531 {
532 self.update_time = std::option::Option::Some(v.into());
533 self
534 }
535
536 /// Sets or clears the value of [update_time][crate::model::CertificateAuthority::update_time].
537 ///
538 /// # Example
539 /// ```ignore,no_run
540 /// # use google_cloud_security_privateca_v1::model::CertificateAuthority;
541 /// use wkt::Timestamp;
542 /// let x = CertificateAuthority::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
543 /// let x = CertificateAuthority::new().set_or_clear_update_time(None::<Timestamp>);
544 /// ```
545 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
546 where
547 T: std::convert::Into<wkt::Timestamp>,
548 {
549 self.update_time = v.map(|x| x.into());
550 self
551 }
552
553 /// Sets the value of [delete_time][crate::model::CertificateAuthority::delete_time].
554 ///
555 /// # Example
556 /// ```ignore,no_run
557 /// # use google_cloud_security_privateca_v1::model::CertificateAuthority;
558 /// use wkt::Timestamp;
559 /// let x = CertificateAuthority::new().set_delete_time(Timestamp::default()/* use setters */);
560 /// ```
561 pub fn set_delete_time<T>(mut self, v: T) -> Self
562 where
563 T: std::convert::Into<wkt::Timestamp>,
564 {
565 self.delete_time = std::option::Option::Some(v.into());
566 self
567 }
568
569 /// Sets or clears the value of [delete_time][crate::model::CertificateAuthority::delete_time].
570 ///
571 /// # Example
572 /// ```ignore,no_run
573 /// # use google_cloud_security_privateca_v1::model::CertificateAuthority;
574 /// use wkt::Timestamp;
575 /// let x = CertificateAuthority::new().set_or_clear_delete_time(Some(Timestamp::default()/* use setters */));
576 /// let x = CertificateAuthority::new().set_or_clear_delete_time(None::<Timestamp>);
577 /// ```
578 pub fn set_or_clear_delete_time<T>(mut self, v: std::option::Option<T>) -> Self
579 where
580 T: std::convert::Into<wkt::Timestamp>,
581 {
582 self.delete_time = v.map(|x| x.into());
583 self
584 }
585
586 /// Sets the value of [expire_time][crate::model::CertificateAuthority::expire_time].
587 ///
588 /// # Example
589 /// ```ignore,no_run
590 /// # use google_cloud_security_privateca_v1::model::CertificateAuthority;
591 /// use wkt::Timestamp;
592 /// let x = CertificateAuthority::new().set_expire_time(Timestamp::default()/* use setters */);
593 /// ```
594 pub fn set_expire_time<T>(mut self, v: T) -> Self
595 where
596 T: std::convert::Into<wkt::Timestamp>,
597 {
598 self.expire_time = std::option::Option::Some(v.into());
599 self
600 }
601
602 /// Sets or clears the value of [expire_time][crate::model::CertificateAuthority::expire_time].
603 ///
604 /// # Example
605 /// ```ignore,no_run
606 /// # use google_cloud_security_privateca_v1::model::CertificateAuthority;
607 /// use wkt::Timestamp;
608 /// let x = CertificateAuthority::new().set_or_clear_expire_time(Some(Timestamp::default()/* use setters */));
609 /// let x = CertificateAuthority::new().set_or_clear_expire_time(None::<Timestamp>);
610 /// ```
611 pub fn set_or_clear_expire_time<T>(mut self, v: std::option::Option<T>) -> Self
612 where
613 T: std::convert::Into<wkt::Timestamp>,
614 {
615 self.expire_time = v.map(|x| x.into());
616 self
617 }
618
619 /// Sets the value of [labels][crate::model::CertificateAuthority::labels].
620 ///
621 /// # Example
622 /// ```ignore,no_run
623 /// # use google_cloud_security_privateca_v1::model::CertificateAuthority;
624 /// let x = CertificateAuthority::new().set_labels([
625 /// ("key0", "abc"),
626 /// ("key1", "xyz"),
627 /// ]);
628 /// ```
629 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
630 where
631 T: std::iter::IntoIterator<Item = (K, V)>,
632 K: std::convert::Into<std::string::String>,
633 V: std::convert::Into<std::string::String>,
634 {
635 use std::iter::Iterator;
636 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
637 self
638 }
639
640 /// Sets the value of [user_defined_access_urls][crate::model::CertificateAuthority::user_defined_access_urls].
641 ///
642 /// # Example
643 /// ```ignore,no_run
644 /// # use google_cloud_security_privateca_v1::model::CertificateAuthority;
645 /// use google_cloud_security_privateca_v1::model::certificate_authority::UserDefinedAccessUrls;
646 /// let x = CertificateAuthority::new().set_user_defined_access_urls(UserDefinedAccessUrls::default()/* use setters */);
647 /// ```
648 pub fn set_user_defined_access_urls<T>(mut self, v: T) -> Self
649 where
650 T: std::convert::Into<crate::model::certificate_authority::UserDefinedAccessUrls>,
651 {
652 self.user_defined_access_urls = std::option::Option::Some(v.into());
653 self
654 }
655
656 /// Sets or clears the value of [user_defined_access_urls][crate::model::CertificateAuthority::user_defined_access_urls].
657 ///
658 /// # Example
659 /// ```ignore,no_run
660 /// # use google_cloud_security_privateca_v1::model::CertificateAuthority;
661 /// use google_cloud_security_privateca_v1::model::certificate_authority::UserDefinedAccessUrls;
662 /// let x = CertificateAuthority::new().set_or_clear_user_defined_access_urls(Some(UserDefinedAccessUrls::default()/* use setters */));
663 /// let x = CertificateAuthority::new().set_or_clear_user_defined_access_urls(None::<UserDefinedAccessUrls>);
664 /// ```
665 pub fn set_or_clear_user_defined_access_urls<T>(mut self, v: std::option::Option<T>) -> Self
666 where
667 T: std::convert::Into<crate::model::certificate_authority::UserDefinedAccessUrls>,
668 {
669 self.user_defined_access_urls = v.map(|x| x.into());
670 self
671 }
672
673 /// Sets the value of [satisfies_pzs][crate::model::CertificateAuthority::satisfies_pzs].
674 ///
675 /// # Example
676 /// ```ignore,no_run
677 /// # use google_cloud_security_privateca_v1::model::CertificateAuthority;
678 /// let x = CertificateAuthority::new().set_satisfies_pzs(true);
679 /// ```
680 pub fn set_satisfies_pzs<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
681 self.satisfies_pzs = v.into();
682 self
683 }
684
685 /// Sets the value of [satisfies_pzi][crate::model::CertificateAuthority::satisfies_pzi].
686 ///
687 /// # Example
688 /// ```ignore,no_run
689 /// # use google_cloud_security_privateca_v1::model::CertificateAuthority;
690 /// let x = CertificateAuthority::new().set_satisfies_pzi(true);
691 /// ```
692 pub fn set_satisfies_pzi<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
693 self.satisfies_pzi = v.into();
694 self
695 }
696}
697
698impl wkt::message::Message for CertificateAuthority {
699 fn typename() -> &'static str {
700 "type.googleapis.com/google.cloud.security.privateca.v1.CertificateAuthority"
701 }
702}
703
704/// Defines additional types related to [CertificateAuthority].
705pub mod certificate_authority {
706 #[allow(unused_imports)]
707 use super::*;
708
709 /// URLs where a
710 /// [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]
711 /// will publish content.
712 ///
713 /// [google.cloud.security.privateca.v1.CertificateAuthority]: crate::model::CertificateAuthority
714 #[derive(Clone, Default, PartialEq)]
715 #[non_exhaustive]
716 pub struct AccessUrls {
717 /// The URL where this
718 /// [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]'s
719 /// CA certificate is published. This will only be set for CAs that have been
720 /// activated.
721 ///
722 /// [google.cloud.security.privateca.v1.CertificateAuthority]: crate::model::CertificateAuthority
723 pub ca_certificate_access_url: std::string::String,
724
725 /// The URLs where this
726 /// [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]'s
727 /// CRLs are published. This will only be set for CAs that have been
728 /// activated.
729 ///
730 /// [google.cloud.security.privateca.v1.CertificateAuthority]: crate::model::CertificateAuthority
731 pub crl_access_urls: std::vec::Vec<std::string::String>,
732
733 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
734 }
735
736 impl AccessUrls {
737 pub fn new() -> Self {
738 std::default::Default::default()
739 }
740
741 /// Sets the value of [ca_certificate_access_url][crate::model::certificate_authority::AccessUrls::ca_certificate_access_url].
742 ///
743 /// # Example
744 /// ```ignore,no_run
745 /// # use google_cloud_security_privateca_v1::model::certificate_authority::AccessUrls;
746 /// let x = AccessUrls::new().set_ca_certificate_access_url("example");
747 /// ```
748 pub fn set_ca_certificate_access_url<T: std::convert::Into<std::string::String>>(
749 mut self,
750 v: T,
751 ) -> Self {
752 self.ca_certificate_access_url = v.into();
753 self
754 }
755
756 /// Sets the value of [crl_access_urls][crate::model::certificate_authority::AccessUrls::crl_access_urls].
757 ///
758 /// # Example
759 /// ```ignore,no_run
760 /// # use google_cloud_security_privateca_v1::model::certificate_authority::AccessUrls;
761 /// let x = AccessUrls::new().set_crl_access_urls(["a", "b", "c"]);
762 /// ```
763 pub fn set_crl_access_urls<T, V>(mut self, v: T) -> Self
764 where
765 T: std::iter::IntoIterator<Item = V>,
766 V: std::convert::Into<std::string::String>,
767 {
768 use std::iter::Iterator;
769 self.crl_access_urls = v.into_iter().map(|i| i.into()).collect();
770 self
771 }
772 }
773
774 impl wkt::message::Message for AccessUrls {
775 fn typename() -> &'static str {
776 "type.googleapis.com/google.cloud.security.privateca.v1.CertificateAuthority.AccessUrls"
777 }
778 }
779
780 /// A Cloud KMS key configuration that a
781 /// [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]
782 /// will use.
783 ///
784 /// [google.cloud.security.privateca.v1.CertificateAuthority]: crate::model::CertificateAuthority
785 #[derive(Clone, Default, PartialEq)]
786 #[non_exhaustive]
787 pub struct KeyVersionSpec {
788 pub key_version:
789 std::option::Option<crate::model::certificate_authority::key_version_spec::KeyVersion>,
790
791 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
792 }
793
794 impl KeyVersionSpec {
795 pub fn new() -> Self {
796 std::default::Default::default()
797 }
798
799 /// Sets the value of [key_version][crate::model::certificate_authority::KeyVersionSpec::key_version].
800 ///
801 /// Note that all the setters affecting `key_version` are mutually
802 /// exclusive.
803 ///
804 /// # Example
805 /// ```ignore,no_run
806 /// # use google_cloud_security_privateca_v1::model::certificate_authority::KeyVersionSpec;
807 /// use google_cloud_security_privateca_v1::model::certificate_authority::key_version_spec::KeyVersion;
808 /// let x = KeyVersionSpec::new().set_key_version(Some(KeyVersion::CloudKmsKeyVersion("example".to_string())));
809 /// ```
810 pub fn set_key_version<
811 T: std::convert::Into<
812 std::option::Option<
813 crate::model::certificate_authority::key_version_spec::KeyVersion,
814 >,
815 >,
816 >(
817 mut self,
818 v: T,
819 ) -> Self {
820 self.key_version = v.into();
821 self
822 }
823
824 /// The value of [key_version][crate::model::certificate_authority::KeyVersionSpec::key_version]
825 /// if it holds a `CloudKmsKeyVersion`, `None` if the field is not set or
826 /// holds a different branch.
827 pub fn cloud_kms_key_version(&self) -> std::option::Option<&std::string::String> {
828 #[allow(unreachable_patterns)]
829 self.key_version.as_ref().and_then(|v| match v {
830 crate::model::certificate_authority::key_version_spec::KeyVersion::CloudKmsKeyVersion(v) => std::option::Option::Some(v),
831 _ => std::option::Option::None,
832 })
833 }
834
835 /// Sets the value of [key_version][crate::model::certificate_authority::KeyVersionSpec::key_version]
836 /// to hold a `CloudKmsKeyVersion`.
837 ///
838 /// Note that all the setters affecting `key_version` are
839 /// mutually exclusive.
840 ///
841 /// # Example
842 /// ```ignore,no_run
843 /// # use google_cloud_security_privateca_v1::model::certificate_authority::KeyVersionSpec;
844 /// let x = KeyVersionSpec::new().set_cloud_kms_key_version("example");
845 /// assert!(x.cloud_kms_key_version().is_some());
846 /// assert!(x.algorithm().is_none());
847 /// ```
848 pub fn set_cloud_kms_key_version<T: std::convert::Into<std::string::String>>(
849 mut self,
850 v: T,
851 ) -> Self {
852 self.key_version = std::option::Option::Some(
853 crate::model::certificate_authority::key_version_spec::KeyVersion::CloudKmsKeyVersion(
854 v.into()
855 )
856 );
857 self
858 }
859
860 /// The value of [key_version][crate::model::certificate_authority::KeyVersionSpec::key_version]
861 /// if it holds a `Algorithm`, `None` if the field is not set or
862 /// holds a different branch.
863 pub fn algorithm(
864 &self,
865 ) -> std::option::Option<&crate::model::certificate_authority::SignHashAlgorithm> {
866 #[allow(unreachable_patterns)]
867 self.key_version.as_ref().and_then(|v| match v {
868 crate::model::certificate_authority::key_version_spec::KeyVersion::Algorithm(v) => {
869 std::option::Option::Some(v)
870 }
871 _ => std::option::Option::None,
872 })
873 }
874
875 /// Sets the value of [key_version][crate::model::certificate_authority::KeyVersionSpec::key_version]
876 /// to hold a `Algorithm`.
877 ///
878 /// Note that all the setters affecting `key_version` are
879 /// mutually exclusive.
880 ///
881 /// # Example
882 /// ```ignore,no_run
883 /// # use google_cloud_security_privateca_v1::model::certificate_authority::KeyVersionSpec;
884 /// use google_cloud_security_privateca_v1::model::certificate_authority::SignHashAlgorithm;
885 /// let x0 = KeyVersionSpec::new().set_algorithm(SignHashAlgorithm::RsaPss2048Sha256);
886 /// let x1 = KeyVersionSpec::new().set_algorithm(SignHashAlgorithm::RsaPss3072Sha256);
887 /// let x2 = KeyVersionSpec::new().set_algorithm(SignHashAlgorithm::RsaPss4096Sha256);
888 /// assert!(x0.algorithm().is_some());
889 /// assert!(x0.cloud_kms_key_version().is_none());
890 /// assert!(x1.algorithm().is_some());
891 /// assert!(x1.cloud_kms_key_version().is_none());
892 /// assert!(x2.algorithm().is_some());
893 /// assert!(x2.cloud_kms_key_version().is_none());
894 /// ```
895 pub fn set_algorithm<
896 T: std::convert::Into<crate::model::certificate_authority::SignHashAlgorithm>,
897 >(
898 mut self,
899 v: T,
900 ) -> Self {
901 self.key_version = std::option::Option::Some(
902 crate::model::certificate_authority::key_version_spec::KeyVersion::Algorithm(
903 v.into(),
904 ),
905 );
906 self
907 }
908 }
909
910 impl wkt::message::Message for KeyVersionSpec {
911 fn typename() -> &'static str {
912 "type.googleapis.com/google.cloud.security.privateca.v1.CertificateAuthority.KeyVersionSpec"
913 }
914 }
915
916 /// Defines additional types related to [KeyVersionSpec].
917 pub mod key_version_spec {
918 #[allow(unused_imports)]
919 use super::*;
920
921 #[derive(Clone, Debug, PartialEq)]
922 #[non_exhaustive]
923 pub enum KeyVersion {
924 /// The resource name for an existing Cloud KMS CryptoKeyVersion in the
925 /// format
926 /// `projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*`.
927 /// This option enables full flexibility in the key's capabilities and
928 /// properties.
929 CloudKmsKeyVersion(std::string::String),
930 /// The algorithm to use for creating a managed Cloud KMS key for a for a
931 /// simplified experience. All managed keys will be have their
932 /// [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] as `HSM`.
933 Algorithm(crate::model::certificate_authority::SignHashAlgorithm),
934 }
935 }
936
937 /// User-defined URLs for accessing content published by this
938 /// [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority].
939 ///
940 /// [google.cloud.security.privateca.v1.CertificateAuthority]: crate::model::CertificateAuthority
941 #[derive(Clone, Default, PartialEq)]
942 #[non_exhaustive]
943 pub struct UserDefinedAccessUrls {
944 /// Optional. A list of URLs where the issuer CA certificate may be
945 /// downloaded, which appears in the "Authority Information Access" extension
946 /// in the certificate. If specified, the default [Cloud Storage
947 /// URLs][google.cloud.security.privateca.v1.CertificateAuthority.AccessUrls.ca_certificate_access_url]
948 /// will be omitted.
949 ///
950 /// [google.cloud.security.privateca.v1.CertificateAuthority.AccessUrls.ca_certificate_access_url]: crate::model::certificate_authority::AccessUrls::ca_certificate_access_url
951 pub aia_issuing_certificate_urls: std::vec::Vec<std::string::String>,
952
953 /// Optional. A list of URLs where to obtain CRL information, i.e.
954 /// the DistributionPoint.fullName described by
955 /// <https://tools.ietf.org/html/rfc5280#section-4.2.1.13>.
956 /// If specified, the default
957 /// [Cloud Storage
958 /// URLs][google.cloud.security.privateca.v1.CertificateAuthority.AccessUrls.crl_access_urls]
959 /// will be omitted.
960 ///
961 /// [google.cloud.security.privateca.v1.CertificateAuthority.AccessUrls.crl_access_urls]: crate::model::certificate_authority::AccessUrls::crl_access_urls
962 pub crl_access_urls: std::vec::Vec<std::string::String>,
963
964 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
965 }
966
967 impl UserDefinedAccessUrls {
968 pub fn new() -> Self {
969 std::default::Default::default()
970 }
971
972 /// Sets the value of [aia_issuing_certificate_urls][crate::model::certificate_authority::UserDefinedAccessUrls::aia_issuing_certificate_urls].
973 ///
974 /// # Example
975 /// ```ignore,no_run
976 /// # use google_cloud_security_privateca_v1::model::certificate_authority::UserDefinedAccessUrls;
977 /// let x = UserDefinedAccessUrls::new().set_aia_issuing_certificate_urls(["a", "b", "c"]);
978 /// ```
979 pub fn set_aia_issuing_certificate_urls<T, V>(mut self, v: T) -> Self
980 where
981 T: std::iter::IntoIterator<Item = V>,
982 V: std::convert::Into<std::string::String>,
983 {
984 use std::iter::Iterator;
985 self.aia_issuing_certificate_urls = v.into_iter().map(|i| i.into()).collect();
986 self
987 }
988
989 /// Sets the value of [crl_access_urls][crate::model::certificate_authority::UserDefinedAccessUrls::crl_access_urls].
990 ///
991 /// # Example
992 /// ```ignore,no_run
993 /// # use google_cloud_security_privateca_v1::model::certificate_authority::UserDefinedAccessUrls;
994 /// let x = UserDefinedAccessUrls::new().set_crl_access_urls(["a", "b", "c"]);
995 /// ```
996 pub fn set_crl_access_urls<T, V>(mut self, v: T) -> Self
997 where
998 T: std::iter::IntoIterator<Item = V>,
999 V: std::convert::Into<std::string::String>,
1000 {
1001 use std::iter::Iterator;
1002 self.crl_access_urls = v.into_iter().map(|i| i.into()).collect();
1003 self
1004 }
1005 }
1006
1007 impl wkt::message::Message for UserDefinedAccessUrls {
1008 fn typename() -> &'static str {
1009 "type.googleapis.com/google.cloud.security.privateca.v1.CertificateAuthority.UserDefinedAccessUrls"
1010 }
1011 }
1012
1013 /// The type of a
1014 /// [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority],
1015 /// indicating its issuing chain.
1016 ///
1017 /// [google.cloud.security.privateca.v1.CertificateAuthority]: crate::model::CertificateAuthority
1018 ///
1019 /// # Working with unknown values
1020 ///
1021 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1022 /// additional enum variants at any time. Adding new variants is not considered
1023 /// a breaking change. Applications should write their code in anticipation of:
1024 ///
1025 /// - New values appearing in future releases of the client library, **and**
1026 /// - New values received dynamically, without application changes.
1027 ///
1028 /// Please consult the [Working with enums] section in the user guide for some
1029 /// guidelines.
1030 ///
1031 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
1032 #[derive(Clone, Debug, PartialEq)]
1033 #[non_exhaustive]
1034 pub enum Type {
1035 /// Not specified.
1036 Unspecified,
1037 /// Self-signed CA.
1038 SelfSigned,
1039 /// Subordinate CA. Could be issued by a Private CA
1040 /// [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]
1041 /// or an unmanaged CA.
1042 ///
1043 /// [google.cloud.security.privateca.v1.CertificateAuthority]: crate::model::CertificateAuthority
1044 Subordinate,
1045 /// If set, the enum was initialized with an unknown value.
1046 ///
1047 /// Applications can examine the value using [Type::value] or
1048 /// [Type::name].
1049 UnknownValue(r#type::UnknownValue),
1050 }
1051
1052 #[doc(hidden)]
1053 pub mod r#type {
1054 #[allow(unused_imports)]
1055 use super::*;
1056 #[derive(Clone, Debug, PartialEq)]
1057 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1058 }
1059
1060 impl Type {
1061 /// Gets the enum value.
1062 ///
1063 /// Returns `None` if the enum contains an unknown value deserialized from
1064 /// the string representation of enums.
1065 pub fn value(&self) -> std::option::Option<i32> {
1066 match self {
1067 Self::Unspecified => std::option::Option::Some(0),
1068 Self::SelfSigned => std::option::Option::Some(1),
1069 Self::Subordinate => std::option::Option::Some(2),
1070 Self::UnknownValue(u) => u.0.value(),
1071 }
1072 }
1073
1074 /// Gets the enum value as a string.
1075 ///
1076 /// Returns `None` if the enum contains an unknown value deserialized from
1077 /// the integer representation of enums.
1078 pub fn name(&self) -> std::option::Option<&str> {
1079 match self {
1080 Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
1081 Self::SelfSigned => std::option::Option::Some("SELF_SIGNED"),
1082 Self::Subordinate => std::option::Option::Some("SUBORDINATE"),
1083 Self::UnknownValue(u) => u.0.name(),
1084 }
1085 }
1086 }
1087
1088 impl std::default::Default for Type {
1089 fn default() -> Self {
1090 use std::convert::From;
1091 Self::from(0)
1092 }
1093 }
1094
1095 impl std::fmt::Display for Type {
1096 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1097 wkt::internal::display_enum(f, self.name(), self.value())
1098 }
1099 }
1100
1101 impl std::convert::From<i32> for Type {
1102 fn from(value: i32) -> Self {
1103 match value {
1104 0 => Self::Unspecified,
1105 1 => Self::SelfSigned,
1106 2 => Self::Subordinate,
1107 _ => Self::UnknownValue(r#type::UnknownValue(
1108 wkt::internal::UnknownEnumValue::Integer(value),
1109 )),
1110 }
1111 }
1112 }
1113
1114 impl std::convert::From<&str> for Type {
1115 fn from(value: &str) -> Self {
1116 use std::string::ToString;
1117 match value {
1118 "TYPE_UNSPECIFIED" => Self::Unspecified,
1119 "SELF_SIGNED" => Self::SelfSigned,
1120 "SUBORDINATE" => Self::Subordinate,
1121 _ => Self::UnknownValue(r#type::UnknownValue(
1122 wkt::internal::UnknownEnumValue::String(value.to_string()),
1123 )),
1124 }
1125 }
1126 }
1127
1128 impl serde::ser::Serialize for Type {
1129 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1130 where
1131 S: serde::Serializer,
1132 {
1133 match self {
1134 Self::Unspecified => serializer.serialize_i32(0),
1135 Self::SelfSigned => serializer.serialize_i32(1),
1136 Self::Subordinate => serializer.serialize_i32(2),
1137 Self::UnknownValue(u) => u.0.serialize(serializer),
1138 }
1139 }
1140 }
1141
1142 impl<'de> serde::de::Deserialize<'de> for Type {
1143 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1144 where
1145 D: serde::Deserializer<'de>,
1146 {
1147 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
1148 ".google.cloud.security.privateca.v1.CertificateAuthority.Type",
1149 ))
1150 }
1151 }
1152
1153 /// The state of a
1154 /// [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority],
1155 /// indicating if it can be used.
1156 ///
1157 /// [google.cloud.security.privateca.v1.CertificateAuthority]: crate::model::CertificateAuthority
1158 ///
1159 /// # Working with unknown values
1160 ///
1161 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1162 /// additional enum variants at any time. Adding new variants is not considered
1163 /// a breaking change. Applications should write their code in anticipation of:
1164 ///
1165 /// - New values appearing in future releases of the client library, **and**
1166 /// - New values received dynamically, without application changes.
1167 ///
1168 /// Please consult the [Working with enums] section in the user guide for some
1169 /// guidelines.
1170 ///
1171 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
1172 #[derive(Clone, Debug, PartialEq)]
1173 #[non_exhaustive]
1174 pub enum State {
1175 /// Not specified.
1176 Unspecified,
1177 /// Certificates can be issued from this CA. CRLs will be generated for this
1178 /// CA. The CA will be part of the
1179 /// [CaPool][google.cloud.security.privateca.v1.CaPool]'s trust anchor, and
1180 /// will be used to issue certificates from the
1181 /// [CaPool][google.cloud.security.privateca.v1.CaPool].
1182 ///
1183 /// [google.cloud.security.privateca.v1.CaPool]: crate::model::CaPool
1184 Enabled,
1185 /// Certificates cannot be issued from this CA. CRLs will still be generated.
1186 /// The CA will be part of the
1187 /// [CaPool][google.cloud.security.privateca.v1.CaPool]'s trust anchor, but
1188 /// will not be used to issue certificates from the
1189 /// [CaPool][google.cloud.security.privateca.v1.CaPool].
1190 ///
1191 /// [google.cloud.security.privateca.v1.CaPool]: crate::model::CaPool
1192 Disabled,
1193 /// Certificates can be issued from this CA. CRLs will be generated for this
1194 /// CA. The CA will be part of the
1195 /// [CaPool][google.cloud.security.privateca.v1.CaPool]'s trust anchor, but
1196 /// will not be used to issue certificates from the
1197 /// [CaPool][google.cloud.security.privateca.v1.CaPool].
1198 ///
1199 /// [google.cloud.security.privateca.v1.CaPool]: crate::model::CaPool
1200 Staged,
1201 /// Certificates cannot be issued from this CA. CRLs will not be generated.
1202 /// The CA will not be part of the
1203 /// [CaPool][google.cloud.security.privateca.v1.CaPool]'s trust anchor, and
1204 /// will not be used to issue certificates from the
1205 /// [CaPool][google.cloud.security.privateca.v1.CaPool].
1206 ///
1207 /// [google.cloud.security.privateca.v1.CaPool]: crate::model::CaPool
1208 AwaitingUserActivation,
1209 /// Certificates cannot be issued from this CA. CRLs will not be generated.
1210 /// The CA may still be recovered by calling
1211 /// [CertificateAuthorityService.UndeleteCertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthorityService.UndeleteCertificateAuthority]
1212 /// before
1213 /// [expire_time][google.cloud.security.privateca.v1.CertificateAuthority.expire_time].
1214 /// The CA will not be part of the
1215 /// [CaPool][google.cloud.security.privateca.v1.CaPool]'s trust anchor, and
1216 /// will not be used to issue certificates from the
1217 /// [CaPool][google.cloud.security.privateca.v1.CaPool].
1218 ///
1219 /// [google.cloud.security.privateca.v1.CaPool]: crate::model::CaPool
1220 /// [google.cloud.security.privateca.v1.CertificateAuthority.expire_time]: crate::model::CertificateAuthority::expire_time
1221 /// [google.cloud.security.privateca.v1.CertificateAuthorityService.UndeleteCertificateAuthority]: crate::client::CertificateAuthorityService::undelete_certificate_authority
1222 Deleted,
1223 /// If set, the enum was initialized with an unknown value.
1224 ///
1225 /// Applications can examine the value using [State::value] or
1226 /// [State::name].
1227 UnknownValue(state::UnknownValue),
1228 }
1229
1230 #[doc(hidden)]
1231 pub mod state {
1232 #[allow(unused_imports)]
1233 use super::*;
1234 #[derive(Clone, Debug, PartialEq)]
1235 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1236 }
1237
1238 impl State {
1239 /// Gets the enum value.
1240 ///
1241 /// Returns `None` if the enum contains an unknown value deserialized from
1242 /// the string representation of enums.
1243 pub fn value(&self) -> std::option::Option<i32> {
1244 match self {
1245 Self::Unspecified => std::option::Option::Some(0),
1246 Self::Enabled => std::option::Option::Some(1),
1247 Self::Disabled => std::option::Option::Some(2),
1248 Self::Staged => std::option::Option::Some(3),
1249 Self::AwaitingUserActivation => std::option::Option::Some(4),
1250 Self::Deleted => std::option::Option::Some(5),
1251 Self::UnknownValue(u) => u.0.value(),
1252 }
1253 }
1254
1255 /// Gets the enum value as a string.
1256 ///
1257 /// Returns `None` if the enum contains an unknown value deserialized from
1258 /// the integer representation of enums.
1259 pub fn name(&self) -> std::option::Option<&str> {
1260 match self {
1261 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
1262 Self::Enabled => std::option::Option::Some("ENABLED"),
1263 Self::Disabled => std::option::Option::Some("DISABLED"),
1264 Self::Staged => std::option::Option::Some("STAGED"),
1265 Self::AwaitingUserActivation => {
1266 std::option::Option::Some("AWAITING_USER_ACTIVATION")
1267 }
1268 Self::Deleted => std::option::Option::Some("DELETED"),
1269 Self::UnknownValue(u) => u.0.name(),
1270 }
1271 }
1272 }
1273
1274 impl std::default::Default for State {
1275 fn default() -> Self {
1276 use std::convert::From;
1277 Self::from(0)
1278 }
1279 }
1280
1281 impl std::fmt::Display for State {
1282 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1283 wkt::internal::display_enum(f, self.name(), self.value())
1284 }
1285 }
1286
1287 impl std::convert::From<i32> for State {
1288 fn from(value: i32) -> Self {
1289 match value {
1290 0 => Self::Unspecified,
1291 1 => Self::Enabled,
1292 2 => Self::Disabled,
1293 3 => Self::Staged,
1294 4 => Self::AwaitingUserActivation,
1295 5 => Self::Deleted,
1296 _ => Self::UnknownValue(state::UnknownValue(
1297 wkt::internal::UnknownEnumValue::Integer(value),
1298 )),
1299 }
1300 }
1301 }
1302
1303 impl std::convert::From<&str> for State {
1304 fn from(value: &str) -> Self {
1305 use std::string::ToString;
1306 match value {
1307 "STATE_UNSPECIFIED" => Self::Unspecified,
1308 "ENABLED" => Self::Enabled,
1309 "DISABLED" => Self::Disabled,
1310 "STAGED" => Self::Staged,
1311 "AWAITING_USER_ACTIVATION" => Self::AwaitingUserActivation,
1312 "DELETED" => Self::Deleted,
1313 _ => Self::UnknownValue(state::UnknownValue(
1314 wkt::internal::UnknownEnumValue::String(value.to_string()),
1315 )),
1316 }
1317 }
1318 }
1319
1320 impl serde::ser::Serialize for State {
1321 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1322 where
1323 S: serde::Serializer,
1324 {
1325 match self {
1326 Self::Unspecified => serializer.serialize_i32(0),
1327 Self::Enabled => serializer.serialize_i32(1),
1328 Self::Disabled => serializer.serialize_i32(2),
1329 Self::Staged => serializer.serialize_i32(3),
1330 Self::AwaitingUserActivation => serializer.serialize_i32(4),
1331 Self::Deleted => serializer.serialize_i32(5),
1332 Self::UnknownValue(u) => u.0.serialize(serializer),
1333 }
1334 }
1335 }
1336
1337 impl<'de> serde::de::Deserialize<'de> for State {
1338 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1339 where
1340 D: serde::Deserializer<'de>,
1341 {
1342 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
1343 ".google.cloud.security.privateca.v1.CertificateAuthority.State",
1344 ))
1345 }
1346 }
1347
1348 /// The algorithm of a Cloud KMS CryptoKeyVersion of a
1349 /// [CryptoKey][google.cloud.kms.v1.CryptoKey] with the
1350 /// [CryptoKeyPurpose][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose] value
1351 /// `ASYMMETRIC_SIGN`. These values correspond to the
1352 /// [CryptoKeyVersionAlgorithm][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm]
1353 /// values. For RSA signing algorithms, the PSS algorithms should be preferred,
1354 /// use PKCS1 algorithms if required for compatibility. For further
1355 /// recommendations, see
1356 /// <https://cloud.google.com/kms/docs/algorithms#algorithm_recommendations>.
1357 ///
1358 /// # Working with unknown values
1359 ///
1360 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1361 /// additional enum variants at any time. Adding new variants is not considered
1362 /// a breaking change. Applications should write their code in anticipation of:
1363 ///
1364 /// - New values appearing in future releases of the client library, **and**
1365 /// - New values received dynamically, without application changes.
1366 ///
1367 /// Please consult the [Working with enums] section in the user guide for some
1368 /// guidelines.
1369 ///
1370 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
1371 #[derive(Clone, Debug, PartialEq)]
1372 #[non_exhaustive]
1373 pub enum SignHashAlgorithm {
1374 /// Not specified.
1375 Unspecified,
1376 /// maps to CryptoKeyVersionAlgorithm.RSA_SIGN_PSS_2048_SHA256
1377 RsaPss2048Sha256,
1378 /// maps to CryptoKeyVersionAlgorithm. RSA_SIGN_PSS_3072_SHA256
1379 RsaPss3072Sha256,
1380 /// maps to CryptoKeyVersionAlgorithm.RSA_SIGN_PSS_4096_SHA256
1381 RsaPss4096Sha256,
1382 /// maps to CryptoKeyVersionAlgorithm.RSA_SIGN_PKCS1_2048_SHA256
1383 RsaPkcs12048Sha256,
1384 /// maps to CryptoKeyVersionAlgorithm.RSA_SIGN_PKCS1_3072_SHA256
1385 RsaPkcs13072Sha256,
1386 /// maps to CryptoKeyVersionAlgorithm.RSA_SIGN_PKCS1_4096_SHA256
1387 RsaPkcs14096Sha256,
1388 /// maps to CryptoKeyVersionAlgorithm.EC_SIGN_P256_SHA256
1389 EcP256Sha256,
1390 /// maps to CryptoKeyVersionAlgorithm.EC_SIGN_P384_SHA384
1391 EcP384Sha384,
1392 /// If set, the enum was initialized with an unknown value.
1393 ///
1394 /// Applications can examine the value using [SignHashAlgorithm::value] or
1395 /// [SignHashAlgorithm::name].
1396 UnknownValue(sign_hash_algorithm::UnknownValue),
1397 }
1398
1399 #[doc(hidden)]
1400 pub mod sign_hash_algorithm {
1401 #[allow(unused_imports)]
1402 use super::*;
1403 #[derive(Clone, Debug, PartialEq)]
1404 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1405 }
1406
1407 impl SignHashAlgorithm {
1408 /// Gets the enum value.
1409 ///
1410 /// Returns `None` if the enum contains an unknown value deserialized from
1411 /// the string representation of enums.
1412 pub fn value(&self) -> std::option::Option<i32> {
1413 match self {
1414 Self::Unspecified => std::option::Option::Some(0),
1415 Self::RsaPss2048Sha256 => std::option::Option::Some(1),
1416 Self::RsaPss3072Sha256 => std::option::Option::Some(2),
1417 Self::RsaPss4096Sha256 => std::option::Option::Some(3),
1418 Self::RsaPkcs12048Sha256 => std::option::Option::Some(6),
1419 Self::RsaPkcs13072Sha256 => std::option::Option::Some(7),
1420 Self::RsaPkcs14096Sha256 => std::option::Option::Some(8),
1421 Self::EcP256Sha256 => std::option::Option::Some(4),
1422 Self::EcP384Sha384 => std::option::Option::Some(5),
1423 Self::UnknownValue(u) => u.0.value(),
1424 }
1425 }
1426
1427 /// Gets the enum value as a string.
1428 ///
1429 /// Returns `None` if the enum contains an unknown value deserialized from
1430 /// the integer representation of enums.
1431 pub fn name(&self) -> std::option::Option<&str> {
1432 match self {
1433 Self::Unspecified => std::option::Option::Some("SIGN_HASH_ALGORITHM_UNSPECIFIED"),
1434 Self::RsaPss2048Sha256 => std::option::Option::Some("RSA_PSS_2048_SHA256"),
1435 Self::RsaPss3072Sha256 => std::option::Option::Some("RSA_PSS_3072_SHA256"),
1436 Self::RsaPss4096Sha256 => std::option::Option::Some("RSA_PSS_4096_SHA256"),
1437 Self::RsaPkcs12048Sha256 => std::option::Option::Some("RSA_PKCS1_2048_SHA256"),
1438 Self::RsaPkcs13072Sha256 => std::option::Option::Some("RSA_PKCS1_3072_SHA256"),
1439 Self::RsaPkcs14096Sha256 => std::option::Option::Some("RSA_PKCS1_4096_SHA256"),
1440 Self::EcP256Sha256 => std::option::Option::Some("EC_P256_SHA256"),
1441 Self::EcP384Sha384 => std::option::Option::Some("EC_P384_SHA384"),
1442 Self::UnknownValue(u) => u.0.name(),
1443 }
1444 }
1445 }
1446
1447 impl std::default::Default for SignHashAlgorithm {
1448 fn default() -> Self {
1449 use std::convert::From;
1450 Self::from(0)
1451 }
1452 }
1453
1454 impl std::fmt::Display for SignHashAlgorithm {
1455 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1456 wkt::internal::display_enum(f, self.name(), self.value())
1457 }
1458 }
1459
1460 impl std::convert::From<i32> for SignHashAlgorithm {
1461 fn from(value: i32) -> Self {
1462 match value {
1463 0 => Self::Unspecified,
1464 1 => Self::RsaPss2048Sha256,
1465 2 => Self::RsaPss3072Sha256,
1466 3 => Self::RsaPss4096Sha256,
1467 4 => Self::EcP256Sha256,
1468 5 => Self::EcP384Sha384,
1469 6 => Self::RsaPkcs12048Sha256,
1470 7 => Self::RsaPkcs13072Sha256,
1471 8 => Self::RsaPkcs14096Sha256,
1472 _ => Self::UnknownValue(sign_hash_algorithm::UnknownValue(
1473 wkt::internal::UnknownEnumValue::Integer(value),
1474 )),
1475 }
1476 }
1477 }
1478
1479 impl std::convert::From<&str> for SignHashAlgorithm {
1480 fn from(value: &str) -> Self {
1481 use std::string::ToString;
1482 match value {
1483 "SIGN_HASH_ALGORITHM_UNSPECIFIED" => Self::Unspecified,
1484 "RSA_PSS_2048_SHA256" => Self::RsaPss2048Sha256,
1485 "RSA_PSS_3072_SHA256" => Self::RsaPss3072Sha256,
1486 "RSA_PSS_4096_SHA256" => Self::RsaPss4096Sha256,
1487 "RSA_PKCS1_2048_SHA256" => Self::RsaPkcs12048Sha256,
1488 "RSA_PKCS1_3072_SHA256" => Self::RsaPkcs13072Sha256,
1489 "RSA_PKCS1_4096_SHA256" => Self::RsaPkcs14096Sha256,
1490 "EC_P256_SHA256" => Self::EcP256Sha256,
1491 "EC_P384_SHA384" => Self::EcP384Sha384,
1492 _ => Self::UnknownValue(sign_hash_algorithm::UnknownValue(
1493 wkt::internal::UnknownEnumValue::String(value.to_string()),
1494 )),
1495 }
1496 }
1497 }
1498
1499 impl serde::ser::Serialize for SignHashAlgorithm {
1500 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1501 where
1502 S: serde::Serializer,
1503 {
1504 match self {
1505 Self::Unspecified => serializer.serialize_i32(0),
1506 Self::RsaPss2048Sha256 => serializer.serialize_i32(1),
1507 Self::RsaPss3072Sha256 => serializer.serialize_i32(2),
1508 Self::RsaPss4096Sha256 => serializer.serialize_i32(3),
1509 Self::RsaPkcs12048Sha256 => serializer.serialize_i32(6),
1510 Self::RsaPkcs13072Sha256 => serializer.serialize_i32(7),
1511 Self::RsaPkcs14096Sha256 => serializer.serialize_i32(8),
1512 Self::EcP256Sha256 => serializer.serialize_i32(4),
1513 Self::EcP384Sha384 => serializer.serialize_i32(5),
1514 Self::UnknownValue(u) => u.0.serialize(serializer),
1515 }
1516 }
1517 }
1518
1519 impl<'de> serde::de::Deserialize<'de> for SignHashAlgorithm {
1520 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1521 where
1522 D: serde::Deserializer<'de>,
1523 {
1524 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SignHashAlgorithm>::new(
1525 ".google.cloud.security.privateca.v1.CertificateAuthority.SignHashAlgorithm",
1526 ))
1527 }
1528 }
1529}
1530
1531/// A [CaPool][google.cloud.security.privateca.v1.CaPool] represents a group of
1532/// [CertificateAuthorities][google.cloud.security.privateca.v1.CertificateAuthority]
1533/// that form a trust anchor. A
1534/// [CaPool][google.cloud.security.privateca.v1.CaPool] can be used to manage
1535/// issuance policies for one or more
1536/// [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]
1537/// resources and to rotate CA certificates in and out of the trust anchor.
1538///
1539/// [google.cloud.security.privateca.v1.CaPool]: crate::model::CaPool
1540/// [google.cloud.security.privateca.v1.CertificateAuthority]: crate::model::CertificateAuthority
1541#[derive(Clone, Default, PartialEq)]
1542#[non_exhaustive]
1543pub struct CaPool {
1544 /// Identifier. The resource name for this
1545 /// [CaPool][google.cloud.security.privateca.v1.CaPool] in the format
1546 /// `projects/*/locations/*/caPools/*`.
1547 ///
1548 /// [google.cloud.security.privateca.v1.CaPool]: crate::model::CaPool
1549 pub name: std::string::String,
1550
1551 /// Required. Immutable. The
1552 /// [Tier][google.cloud.security.privateca.v1.CaPool.Tier] of this
1553 /// [CaPool][google.cloud.security.privateca.v1.CaPool].
1554 ///
1555 /// [google.cloud.security.privateca.v1.CaPool]: crate::model::CaPool
1556 /// [google.cloud.security.privateca.v1.CaPool.Tier]: crate::model::ca_pool::Tier
1557 pub tier: crate::model::ca_pool::Tier,
1558
1559 /// Optional. The
1560 /// [IssuancePolicy][google.cloud.security.privateca.v1.CaPool.IssuancePolicy]
1561 /// to control how
1562 /// [Certificates][google.cloud.security.privateca.v1.Certificate] will be
1563 /// issued from this [CaPool][google.cloud.security.privateca.v1.CaPool].
1564 ///
1565 /// [google.cloud.security.privateca.v1.CaPool]: crate::model::CaPool
1566 /// [google.cloud.security.privateca.v1.CaPool.IssuancePolicy]: crate::model::ca_pool::IssuancePolicy
1567 /// [google.cloud.security.privateca.v1.Certificate]: crate::model::Certificate
1568 pub issuance_policy: std::option::Option<crate::model::ca_pool::IssuancePolicy>,
1569
1570 /// Optional. The
1571 /// [PublishingOptions][google.cloud.security.privateca.v1.CaPool.PublishingOptions]
1572 /// to follow when issuing
1573 /// [Certificates][google.cloud.security.privateca.v1.Certificate] from any
1574 /// [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]
1575 /// in this [CaPool][google.cloud.security.privateca.v1.CaPool].
1576 ///
1577 /// [google.cloud.security.privateca.v1.CaPool]: crate::model::CaPool
1578 /// [google.cloud.security.privateca.v1.CaPool.PublishingOptions]: crate::model::ca_pool::PublishingOptions
1579 /// [google.cloud.security.privateca.v1.Certificate]: crate::model::Certificate
1580 /// [google.cloud.security.privateca.v1.CertificateAuthority]: crate::model::CertificateAuthority
1581 pub publishing_options: std::option::Option<crate::model::ca_pool::PublishingOptions>,
1582
1583 /// Optional. Labels with user-defined metadata.
1584 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
1585
1586 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1587}
1588
1589impl CaPool {
1590 pub fn new() -> Self {
1591 std::default::Default::default()
1592 }
1593
1594 /// Sets the value of [name][crate::model::CaPool::name].
1595 ///
1596 /// # Example
1597 /// ```ignore,no_run
1598 /// # use google_cloud_security_privateca_v1::model::CaPool;
1599 /// let x = CaPool::new().set_name("example");
1600 /// ```
1601 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1602 self.name = v.into();
1603 self
1604 }
1605
1606 /// Sets the value of [tier][crate::model::CaPool::tier].
1607 ///
1608 /// # Example
1609 /// ```ignore,no_run
1610 /// # use google_cloud_security_privateca_v1::model::CaPool;
1611 /// use google_cloud_security_privateca_v1::model::ca_pool::Tier;
1612 /// let x0 = CaPool::new().set_tier(Tier::Enterprise);
1613 /// let x1 = CaPool::new().set_tier(Tier::Devops);
1614 /// ```
1615 pub fn set_tier<T: std::convert::Into<crate::model::ca_pool::Tier>>(mut self, v: T) -> Self {
1616 self.tier = v.into();
1617 self
1618 }
1619
1620 /// Sets the value of [issuance_policy][crate::model::CaPool::issuance_policy].
1621 ///
1622 /// # Example
1623 /// ```ignore,no_run
1624 /// # use google_cloud_security_privateca_v1::model::CaPool;
1625 /// use google_cloud_security_privateca_v1::model::ca_pool::IssuancePolicy;
1626 /// let x = CaPool::new().set_issuance_policy(IssuancePolicy::default()/* use setters */);
1627 /// ```
1628 pub fn set_issuance_policy<T>(mut self, v: T) -> Self
1629 where
1630 T: std::convert::Into<crate::model::ca_pool::IssuancePolicy>,
1631 {
1632 self.issuance_policy = std::option::Option::Some(v.into());
1633 self
1634 }
1635
1636 /// Sets or clears the value of [issuance_policy][crate::model::CaPool::issuance_policy].
1637 ///
1638 /// # Example
1639 /// ```ignore,no_run
1640 /// # use google_cloud_security_privateca_v1::model::CaPool;
1641 /// use google_cloud_security_privateca_v1::model::ca_pool::IssuancePolicy;
1642 /// let x = CaPool::new().set_or_clear_issuance_policy(Some(IssuancePolicy::default()/* use setters */));
1643 /// let x = CaPool::new().set_or_clear_issuance_policy(None::<IssuancePolicy>);
1644 /// ```
1645 pub fn set_or_clear_issuance_policy<T>(mut self, v: std::option::Option<T>) -> Self
1646 where
1647 T: std::convert::Into<crate::model::ca_pool::IssuancePolicy>,
1648 {
1649 self.issuance_policy = v.map(|x| x.into());
1650 self
1651 }
1652
1653 /// Sets the value of [publishing_options][crate::model::CaPool::publishing_options].
1654 ///
1655 /// # Example
1656 /// ```ignore,no_run
1657 /// # use google_cloud_security_privateca_v1::model::CaPool;
1658 /// use google_cloud_security_privateca_v1::model::ca_pool::PublishingOptions;
1659 /// let x = CaPool::new().set_publishing_options(PublishingOptions::default()/* use setters */);
1660 /// ```
1661 pub fn set_publishing_options<T>(mut self, v: T) -> Self
1662 where
1663 T: std::convert::Into<crate::model::ca_pool::PublishingOptions>,
1664 {
1665 self.publishing_options = std::option::Option::Some(v.into());
1666 self
1667 }
1668
1669 /// Sets or clears the value of [publishing_options][crate::model::CaPool::publishing_options].
1670 ///
1671 /// # Example
1672 /// ```ignore,no_run
1673 /// # use google_cloud_security_privateca_v1::model::CaPool;
1674 /// use google_cloud_security_privateca_v1::model::ca_pool::PublishingOptions;
1675 /// let x = CaPool::new().set_or_clear_publishing_options(Some(PublishingOptions::default()/* use setters */));
1676 /// let x = CaPool::new().set_or_clear_publishing_options(None::<PublishingOptions>);
1677 /// ```
1678 pub fn set_or_clear_publishing_options<T>(mut self, v: std::option::Option<T>) -> Self
1679 where
1680 T: std::convert::Into<crate::model::ca_pool::PublishingOptions>,
1681 {
1682 self.publishing_options = v.map(|x| x.into());
1683 self
1684 }
1685
1686 /// Sets the value of [labels][crate::model::CaPool::labels].
1687 ///
1688 /// # Example
1689 /// ```ignore,no_run
1690 /// # use google_cloud_security_privateca_v1::model::CaPool;
1691 /// let x = CaPool::new().set_labels([
1692 /// ("key0", "abc"),
1693 /// ("key1", "xyz"),
1694 /// ]);
1695 /// ```
1696 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
1697 where
1698 T: std::iter::IntoIterator<Item = (K, V)>,
1699 K: std::convert::Into<std::string::String>,
1700 V: std::convert::Into<std::string::String>,
1701 {
1702 use std::iter::Iterator;
1703 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1704 self
1705 }
1706}
1707
1708impl wkt::message::Message for CaPool {
1709 fn typename() -> &'static str {
1710 "type.googleapis.com/google.cloud.security.privateca.v1.CaPool"
1711 }
1712}
1713
1714/// Defines additional types related to [CaPool].
1715pub mod ca_pool {
1716 #[allow(unused_imports)]
1717 use super::*;
1718
1719 /// Options relating to the publication of each
1720 /// [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]'s
1721 /// CA certificate and CRLs and their inclusion as extensions in issued
1722 /// [Certificates][google.cloud.security.privateca.v1.Certificate]. The options
1723 /// set here apply to certificates issued by any
1724 /// [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]
1725 /// in the [CaPool][google.cloud.security.privateca.v1.CaPool].
1726 ///
1727 /// [google.cloud.security.privateca.v1.CaPool]: crate::model::CaPool
1728 /// [google.cloud.security.privateca.v1.Certificate]: crate::model::Certificate
1729 /// [google.cloud.security.privateca.v1.CertificateAuthority]: crate::model::CertificateAuthority
1730 #[derive(Clone, Default, PartialEq)]
1731 #[non_exhaustive]
1732 pub struct PublishingOptions {
1733 /// Optional. When true, publishes each
1734 /// [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]'s
1735 /// CA certificate and includes its URL in the "Authority Information Access"
1736 /// X.509 extension in all issued
1737 /// [Certificates][google.cloud.security.privateca.v1.Certificate]. If this
1738 /// is false, the CA certificate will not be published and the corresponding
1739 /// X.509 extension will not be written in issued certificates.
1740 ///
1741 /// [google.cloud.security.privateca.v1.Certificate]: crate::model::Certificate
1742 /// [google.cloud.security.privateca.v1.CertificateAuthority]: crate::model::CertificateAuthority
1743 pub publish_ca_cert: bool,
1744
1745 /// Optional. When true, publishes each
1746 /// [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]'s
1747 /// CRL and includes its URL in the "CRL Distribution Points" X.509 extension
1748 /// in all issued
1749 /// [Certificates][google.cloud.security.privateca.v1.Certificate]. If this
1750 /// is false, CRLs will not be published and the corresponding X.509
1751 /// extension will not be written in issued certificates. CRLs will expire 7
1752 /// days from their creation. However, we will rebuild daily. CRLs are also
1753 /// rebuilt shortly after a certificate is revoked.
1754 ///
1755 /// [google.cloud.security.privateca.v1.Certificate]: crate::model::Certificate
1756 /// [google.cloud.security.privateca.v1.CertificateAuthority]: crate::model::CertificateAuthority
1757 pub publish_crl: bool,
1758
1759 /// Optional. Specifies the encoding format of each
1760 /// [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]
1761 /// resource's CA certificate and CRLs. If this is omitted, CA certificates
1762 /// and CRLs will be published in PEM.
1763 ///
1764 /// [google.cloud.security.privateca.v1.CertificateAuthority]: crate::model::CertificateAuthority
1765 pub encoding_format: crate::model::ca_pool::publishing_options::EncodingFormat,
1766
1767 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1768 }
1769
1770 impl PublishingOptions {
1771 pub fn new() -> Self {
1772 std::default::Default::default()
1773 }
1774
1775 /// Sets the value of [publish_ca_cert][crate::model::ca_pool::PublishingOptions::publish_ca_cert].
1776 ///
1777 /// # Example
1778 /// ```ignore,no_run
1779 /// # use google_cloud_security_privateca_v1::model::ca_pool::PublishingOptions;
1780 /// let x = PublishingOptions::new().set_publish_ca_cert(true);
1781 /// ```
1782 pub fn set_publish_ca_cert<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1783 self.publish_ca_cert = v.into();
1784 self
1785 }
1786
1787 /// Sets the value of [publish_crl][crate::model::ca_pool::PublishingOptions::publish_crl].
1788 ///
1789 /// # Example
1790 /// ```ignore,no_run
1791 /// # use google_cloud_security_privateca_v1::model::ca_pool::PublishingOptions;
1792 /// let x = PublishingOptions::new().set_publish_crl(true);
1793 /// ```
1794 pub fn set_publish_crl<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1795 self.publish_crl = v.into();
1796 self
1797 }
1798
1799 /// Sets the value of [encoding_format][crate::model::ca_pool::PublishingOptions::encoding_format].
1800 ///
1801 /// # Example
1802 /// ```ignore,no_run
1803 /// # use google_cloud_security_privateca_v1::model::ca_pool::PublishingOptions;
1804 /// use google_cloud_security_privateca_v1::model::ca_pool::publishing_options::EncodingFormat;
1805 /// let x0 = PublishingOptions::new().set_encoding_format(EncodingFormat::Pem);
1806 /// let x1 = PublishingOptions::new().set_encoding_format(EncodingFormat::Der);
1807 /// ```
1808 pub fn set_encoding_format<
1809 T: std::convert::Into<crate::model::ca_pool::publishing_options::EncodingFormat>,
1810 >(
1811 mut self,
1812 v: T,
1813 ) -> Self {
1814 self.encoding_format = v.into();
1815 self
1816 }
1817 }
1818
1819 impl wkt::message::Message for PublishingOptions {
1820 fn typename() -> &'static str {
1821 "type.googleapis.com/google.cloud.security.privateca.v1.CaPool.PublishingOptions"
1822 }
1823 }
1824
1825 /// Defines additional types related to [PublishingOptions].
1826 pub mod publishing_options {
1827 #[allow(unused_imports)]
1828 use super::*;
1829
1830 /// Supported encoding formats for publishing.
1831 ///
1832 /// # Working with unknown values
1833 ///
1834 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1835 /// additional enum variants at any time. Adding new variants is not considered
1836 /// a breaking change. Applications should write their code in anticipation of:
1837 ///
1838 /// - New values appearing in future releases of the client library, **and**
1839 /// - New values received dynamically, without application changes.
1840 ///
1841 /// Please consult the [Working with enums] section in the user guide for some
1842 /// guidelines.
1843 ///
1844 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
1845 #[derive(Clone, Debug, PartialEq)]
1846 #[non_exhaustive]
1847 pub enum EncodingFormat {
1848 /// Not specified. By default, PEM format will be used.
1849 Unspecified,
1850 /// The
1851 /// [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]'s
1852 /// CA certificate and CRLs will be published in PEM format.
1853 ///
1854 /// [google.cloud.security.privateca.v1.CertificateAuthority]: crate::model::CertificateAuthority
1855 Pem,
1856 /// The
1857 /// [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]'s
1858 /// CA certificate and CRLs will be published in DER format.
1859 ///
1860 /// [google.cloud.security.privateca.v1.CertificateAuthority]: crate::model::CertificateAuthority
1861 Der,
1862 /// If set, the enum was initialized with an unknown value.
1863 ///
1864 /// Applications can examine the value using [EncodingFormat::value] or
1865 /// [EncodingFormat::name].
1866 UnknownValue(encoding_format::UnknownValue),
1867 }
1868
1869 #[doc(hidden)]
1870 pub mod encoding_format {
1871 #[allow(unused_imports)]
1872 use super::*;
1873 #[derive(Clone, Debug, PartialEq)]
1874 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1875 }
1876
1877 impl EncodingFormat {
1878 /// Gets the enum value.
1879 ///
1880 /// Returns `None` if the enum contains an unknown value deserialized from
1881 /// the string representation of enums.
1882 pub fn value(&self) -> std::option::Option<i32> {
1883 match self {
1884 Self::Unspecified => std::option::Option::Some(0),
1885 Self::Pem => std::option::Option::Some(1),
1886 Self::Der => std::option::Option::Some(2),
1887 Self::UnknownValue(u) => u.0.value(),
1888 }
1889 }
1890
1891 /// Gets the enum value as a string.
1892 ///
1893 /// Returns `None` if the enum contains an unknown value deserialized from
1894 /// the integer representation of enums.
1895 pub fn name(&self) -> std::option::Option<&str> {
1896 match self {
1897 Self::Unspecified => std::option::Option::Some("ENCODING_FORMAT_UNSPECIFIED"),
1898 Self::Pem => std::option::Option::Some("PEM"),
1899 Self::Der => std::option::Option::Some("DER"),
1900 Self::UnknownValue(u) => u.0.name(),
1901 }
1902 }
1903 }
1904
1905 impl std::default::Default for EncodingFormat {
1906 fn default() -> Self {
1907 use std::convert::From;
1908 Self::from(0)
1909 }
1910 }
1911
1912 impl std::fmt::Display for EncodingFormat {
1913 fn fmt(
1914 &self,
1915 f: &mut std::fmt::Formatter<'_>,
1916 ) -> std::result::Result<(), std::fmt::Error> {
1917 wkt::internal::display_enum(f, self.name(), self.value())
1918 }
1919 }
1920
1921 impl std::convert::From<i32> for EncodingFormat {
1922 fn from(value: i32) -> Self {
1923 match value {
1924 0 => Self::Unspecified,
1925 1 => Self::Pem,
1926 2 => Self::Der,
1927 _ => Self::UnknownValue(encoding_format::UnknownValue(
1928 wkt::internal::UnknownEnumValue::Integer(value),
1929 )),
1930 }
1931 }
1932 }
1933
1934 impl std::convert::From<&str> for EncodingFormat {
1935 fn from(value: &str) -> Self {
1936 use std::string::ToString;
1937 match value {
1938 "ENCODING_FORMAT_UNSPECIFIED" => Self::Unspecified,
1939 "PEM" => Self::Pem,
1940 "DER" => Self::Der,
1941 _ => Self::UnknownValue(encoding_format::UnknownValue(
1942 wkt::internal::UnknownEnumValue::String(value.to_string()),
1943 )),
1944 }
1945 }
1946 }
1947
1948 impl serde::ser::Serialize for EncodingFormat {
1949 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1950 where
1951 S: serde::Serializer,
1952 {
1953 match self {
1954 Self::Unspecified => serializer.serialize_i32(0),
1955 Self::Pem => serializer.serialize_i32(1),
1956 Self::Der => serializer.serialize_i32(2),
1957 Self::UnknownValue(u) => u.0.serialize(serializer),
1958 }
1959 }
1960 }
1961
1962 impl<'de> serde::de::Deserialize<'de> for EncodingFormat {
1963 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1964 where
1965 D: serde::Deserializer<'de>,
1966 {
1967 deserializer.deserialize_any(wkt::internal::EnumVisitor::<EncodingFormat>::new(
1968 ".google.cloud.security.privateca.v1.CaPool.PublishingOptions.EncodingFormat",
1969 ))
1970 }
1971 }
1972 }
1973
1974 /// Defines controls over all certificate issuance within a
1975 /// [CaPool][google.cloud.security.privateca.v1.CaPool].
1976 ///
1977 /// [google.cloud.security.privateca.v1.CaPool]: crate::model::CaPool
1978 #[derive(Clone, Default, PartialEq)]
1979 #[non_exhaustive]
1980 pub struct IssuancePolicy {
1981 /// Optional. If any
1982 /// [AllowedKeyType][google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType]
1983 /// is specified, then the certificate request's public key must match one of
1984 /// the key types listed here. Otherwise, any key may be used.
1985 ///
1986 /// [google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType]: crate::model::ca_pool::issuance_policy::AllowedKeyType
1987 pub allowed_key_types:
1988 std::vec::Vec<crate::model::ca_pool::issuance_policy::AllowedKeyType>,
1989
1990 /// Optional. The duration to backdate all certificates issued from this
1991 /// [CaPool][google.cloud.security.privateca.v1.CaPool]. If not set, the
1992 /// certificates will be issued with a not_before_time of the issuance time
1993 /// (i.e. the current time). If set, the certificates will be issued with a
1994 /// not_before_time of the issuance time minus the backdate_duration. The
1995 /// not_after_time will be adjusted to preserve the requested lifetime. The
1996 /// backdate_duration must be less than or equal to 48 hours.
1997 ///
1998 /// [google.cloud.security.privateca.v1.CaPool]: crate::model::CaPool
1999 pub backdate_duration: std::option::Option<wkt::Duration>,
2000
2001 /// Optional. The maximum lifetime allowed for issued
2002 /// [Certificates][google.cloud.security.privateca.v1.Certificate]. Note that
2003 /// if the issuing
2004 /// [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]
2005 /// expires before a
2006 /// [Certificate][google.cloud.security.privateca.v1.Certificate] resource's
2007 /// requested maximum_lifetime, the effective lifetime will be explicitly
2008 /// truncated to match it.
2009 ///
2010 /// [google.cloud.security.privateca.v1.Certificate]: crate::model::Certificate
2011 /// [google.cloud.security.privateca.v1.CertificateAuthority]: crate::model::CertificateAuthority
2012 pub maximum_lifetime: std::option::Option<wkt::Duration>,
2013
2014 /// Optional. If specified, then only methods allowed in the
2015 /// [IssuanceModes][google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IssuanceModes]
2016 /// may be used to issue
2017 /// [Certificates][google.cloud.security.privateca.v1.Certificate].
2018 ///
2019 /// [google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IssuanceModes]: crate::model::ca_pool::issuance_policy::IssuanceModes
2020 /// [google.cloud.security.privateca.v1.Certificate]: crate::model::Certificate
2021 pub allowed_issuance_modes:
2022 std::option::Option<crate::model::ca_pool::issuance_policy::IssuanceModes>,
2023
2024 /// Optional. A set of X.509 values that will be applied to all certificates
2025 /// issued through this [CaPool][google.cloud.security.privateca.v1.CaPool].
2026 /// If a certificate request includes conflicting values for the same
2027 /// properties, they will be overwritten by the values defined here. If a
2028 /// certificate request uses a
2029 /// [CertificateTemplate][google.cloud.security.privateca.v1.CertificateTemplate]
2030 /// that defines conflicting
2031 /// [predefined_values][google.cloud.security.privateca.v1.CertificateTemplate.predefined_values]
2032 /// for the same properties, the certificate issuance request will fail.
2033 ///
2034 /// [google.cloud.security.privateca.v1.CaPool]: crate::model::CaPool
2035 /// [google.cloud.security.privateca.v1.CertificateTemplate]: crate::model::CertificateTemplate
2036 /// [google.cloud.security.privateca.v1.CertificateTemplate.predefined_values]: crate::model::CertificateTemplate::predefined_values
2037 pub baseline_values: std::option::Option<crate::model::X509Parameters>,
2038
2039 /// Optional. Describes constraints on identities that may appear in
2040 /// [Certificates][google.cloud.security.privateca.v1.Certificate] issued
2041 /// through this [CaPool][google.cloud.security.privateca.v1.CaPool]. If this
2042 /// is omitted, then this [CaPool][google.cloud.security.privateca.v1.CaPool]
2043 /// will not add restrictions on a certificate's identity.
2044 ///
2045 /// [google.cloud.security.privateca.v1.CaPool]: crate::model::CaPool
2046 /// [google.cloud.security.privateca.v1.Certificate]: crate::model::Certificate
2047 pub identity_constraints: std::option::Option<crate::model::CertificateIdentityConstraints>,
2048
2049 /// Optional. Describes the set of X.509 extensions that may appear in a
2050 /// [Certificate][google.cloud.security.privateca.v1.Certificate] issued
2051 /// through this [CaPool][google.cloud.security.privateca.v1.CaPool]. If a
2052 /// certificate request sets extensions that don't appear in the
2053 /// [passthrough_extensions][google.cloud.security.privateca.v1.CaPool.IssuancePolicy.passthrough_extensions],
2054 /// those extensions will be dropped. If a certificate request uses a
2055 /// [CertificateTemplate][google.cloud.security.privateca.v1.CertificateTemplate]
2056 /// with
2057 /// [predefined_values][google.cloud.security.privateca.v1.CertificateTemplate.predefined_values]
2058 /// that don't appear here, the certificate issuance request will fail. If
2059 /// this is omitted, then this
2060 /// [CaPool][google.cloud.security.privateca.v1.CaPool] will not add
2061 /// restrictions on a certificate's X.509 extensions. These constraints do
2062 /// not apply to X.509 extensions set in this
2063 /// [CaPool][google.cloud.security.privateca.v1.CaPool]'s
2064 /// [baseline_values][google.cloud.security.privateca.v1.CaPool.IssuancePolicy.baseline_values].
2065 ///
2066 /// [google.cloud.security.privateca.v1.CaPool]: crate::model::CaPool
2067 /// [google.cloud.security.privateca.v1.CaPool.IssuancePolicy.baseline_values]: crate::model::ca_pool::IssuancePolicy::baseline_values
2068 /// [google.cloud.security.privateca.v1.CaPool.IssuancePolicy.passthrough_extensions]: crate::model::ca_pool::IssuancePolicy::passthrough_extensions
2069 /// [google.cloud.security.privateca.v1.Certificate]: crate::model::Certificate
2070 /// [google.cloud.security.privateca.v1.CertificateTemplate]: crate::model::CertificateTemplate
2071 /// [google.cloud.security.privateca.v1.CertificateTemplate.predefined_values]: crate::model::CertificateTemplate::predefined_values
2072 pub passthrough_extensions:
2073 std::option::Option<crate::model::CertificateExtensionConstraints>,
2074
2075 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2076 }
2077
2078 impl IssuancePolicy {
2079 pub fn new() -> Self {
2080 std::default::Default::default()
2081 }
2082
2083 /// Sets the value of [allowed_key_types][crate::model::ca_pool::IssuancePolicy::allowed_key_types].
2084 ///
2085 /// # Example
2086 /// ```ignore,no_run
2087 /// # use google_cloud_security_privateca_v1::model::ca_pool::IssuancePolicy;
2088 /// use google_cloud_security_privateca_v1::model::ca_pool::issuance_policy::AllowedKeyType;
2089 /// let x = IssuancePolicy::new()
2090 /// .set_allowed_key_types([
2091 /// AllowedKeyType::default()/* use setters */,
2092 /// AllowedKeyType::default()/* use (different) setters */,
2093 /// ]);
2094 /// ```
2095 pub fn set_allowed_key_types<T, V>(mut self, v: T) -> Self
2096 where
2097 T: std::iter::IntoIterator<Item = V>,
2098 V: std::convert::Into<crate::model::ca_pool::issuance_policy::AllowedKeyType>,
2099 {
2100 use std::iter::Iterator;
2101 self.allowed_key_types = v.into_iter().map(|i| i.into()).collect();
2102 self
2103 }
2104
2105 /// Sets the value of [backdate_duration][crate::model::ca_pool::IssuancePolicy::backdate_duration].
2106 ///
2107 /// # Example
2108 /// ```ignore,no_run
2109 /// # use google_cloud_security_privateca_v1::model::ca_pool::IssuancePolicy;
2110 /// use wkt::Duration;
2111 /// let x = IssuancePolicy::new().set_backdate_duration(Duration::default()/* use setters */);
2112 /// ```
2113 pub fn set_backdate_duration<T>(mut self, v: T) -> Self
2114 where
2115 T: std::convert::Into<wkt::Duration>,
2116 {
2117 self.backdate_duration = std::option::Option::Some(v.into());
2118 self
2119 }
2120
2121 /// Sets or clears the value of [backdate_duration][crate::model::ca_pool::IssuancePolicy::backdate_duration].
2122 ///
2123 /// # Example
2124 /// ```ignore,no_run
2125 /// # use google_cloud_security_privateca_v1::model::ca_pool::IssuancePolicy;
2126 /// use wkt::Duration;
2127 /// let x = IssuancePolicy::new().set_or_clear_backdate_duration(Some(Duration::default()/* use setters */));
2128 /// let x = IssuancePolicy::new().set_or_clear_backdate_duration(None::<Duration>);
2129 /// ```
2130 pub fn set_or_clear_backdate_duration<T>(mut self, v: std::option::Option<T>) -> Self
2131 where
2132 T: std::convert::Into<wkt::Duration>,
2133 {
2134 self.backdate_duration = v.map(|x| x.into());
2135 self
2136 }
2137
2138 /// Sets the value of [maximum_lifetime][crate::model::ca_pool::IssuancePolicy::maximum_lifetime].
2139 ///
2140 /// # Example
2141 /// ```ignore,no_run
2142 /// # use google_cloud_security_privateca_v1::model::ca_pool::IssuancePolicy;
2143 /// use wkt::Duration;
2144 /// let x = IssuancePolicy::new().set_maximum_lifetime(Duration::default()/* use setters */);
2145 /// ```
2146 pub fn set_maximum_lifetime<T>(mut self, v: T) -> Self
2147 where
2148 T: std::convert::Into<wkt::Duration>,
2149 {
2150 self.maximum_lifetime = std::option::Option::Some(v.into());
2151 self
2152 }
2153
2154 /// Sets or clears the value of [maximum_lifetime][crate::model::ca_pool::IssuancePolicy::maximum_lifetime].
2155 ///
2156 /// # Example
2157 /// ```ignore,no_run
2158 /// # use google_cloud_security_privateca_v1::model::ca_pool::IssuancePolicy;
2159 /// use wkt::Duration;
2160 /// let x = IssuancePolicy::new().set_or_clear_maximum_lifetime(Some(Duration::default()/* use setters */));
2161 /// let x = IssuancePolicy::new().set_or_clear_maximum_lifetime(None::<Duration>);
2162 /// ```
2163 pub fn set_or_clear_maximum_lifetime<T>(mut self, v: std::option::Option<T>) -> Self
2164 where
2165 T: std::convert::Into<wkt::Duration>,
2166 {
2167 self.maximum_lifetime = v.map(|x| x.into());
2168 self
2169 }
2170
2171 /// Sets the value of [allowed_issuance_modes][crate::model::ca_pool::IssuancePolicy::allowed_issuance_modes].
2172 ///
2173 /// # Example
2174 /// ```ignore,no_run
2175 /// # use google_cloud_security_privateca_v1::model::ca_pool::IssuancePolicy;
2176 /// use google_cloud_security_privateca_v1::model::ca_pool::issuance_policy::IssuanceModes;
2177 /// let x = IssuancePolicy::new().set_allowed_issuance_modes(IssuanceModes::default()/* use setters */);
2178 /// ```
2179 pub fn set_allowed_issuance_modes<T>(mut self, v: T) -> Self
2180 where
2181 T: std::convert::Into<crate::model::ca_pool::issuance_policy::IssuanceModes>,
2182 {
2183 self.allowed_issuance_modes = std::option::Option::Some(v.into());
2184 self
2185 }
2186
2187 /// Sets or clears the value of [allowed_issuance_modes][crate::model::ca_pool::IssuancePolicy::allowed_issuance_modes].
2188 ///
2189 /// # Example
2190 /// ```ignore,no_run
2191 /// # use google_cloud_security_privateca_v1::model::ca_pool::IssuancePolicy;
2192 /// use google_cloud_security_privateca_v1::model::ca_pool::issuance_policy::IssuanceModes;
2193 /// let x = IssuancePolicy::new().set_or_clear_allowed_issuance_modes(Some(IssuanceModes::default()/* use setters */));
2194 /// let x = IssuancePolicy::new().set_or_clear_allowed_issuance_modes(None::<IssuanceModes>);
2195 /// ```
2196 pub fn set_or_clear_allowed_issuance_modes<T>(mut self, v: std::option::Option<T>) -> Self
2197 where
2198 T: std::convert::Into<crate::model::ca_pool::issuance_policy::IssuanceModes>,
2199 {
2200 self.allowed_issuance_modes = v.map(|x| x.into());
2201 self
2202 }
2203
2204 /// Sets the value of [baseline_values][crate::model::ca_pool::IssuancePolicy::baseline_values].
2205 ///
2206 /// # Example
2207 /// ```ignore,no_run
2208 /// # use google_cloud_security_privateca_v1::model::ca_pool::IssuancePolicy;
2209 /// use google_cloud_security_privateca_v1::model::X509Parameters;
2210 /// let x = IssuancePolicy::new().set_baseline_values(X509Parameters::default()/* use setters */);
2211 /// ```
2212 pub fn set_baseline_values<T>(mut self, v: T) -> Self
2213 where
2214 T: std::convert::Into<crate::model::X509Parameters>,
2215 {
2216 self.baseline_values = std::option::Option::Some(v.into());
2217 self
2218 }
2219
2220 /// Sets or clears the value of [baseline_values][crate::model::ca_pool::IssuancePolicy::baseline_values].
2221 ///
2222 /// # Example
2223 /// ```ignore,no_run
2224 /// # use google_cloud_security_privateca_v1::model::ca_pool::IssuancePolicy;
2225 /// use google_cloud_security_privateca_v1::model::X509Parameters;
2226 /// let x = IssuancePolicy::new().set_or_clear_baseline_values(Some(X509Parameters::default()/* use setters */));
2227 /// let x = IssuancePolicy::new().set_or_clear_baseline_values(None::<X509Parameters>);
2228 /// ```
2229 pub fn set_or_clear_baseline_values<T>(mut self, v: std::option::Option<T>) -> Self
2230 where
2231 T: std::convert::Into<crate::model::X509Parameters>,
2232 {
2233 self.baseline_values = v.map(|x| x.into());
2234 self
2235 }
2236
2237 /// Sets the value of [identity_constraints][crate::model::ca_pool::IssuancePolicy::identity_constraints].
2238 ///
2239 /// # Example
2240 /// ```ignore,no_run
2241 /// # use google_cloud_security_privateca_v1::model::ca_pool::IssuancePolicy;
2242 /// use google_cloud_security_privateca_v1::model::CertificateIdentityConstraints;
2243 /// let x = IssuancePolicy::new().set_identity_constraints(CertificateIdentityConstraints::default()/* use setters */);
2244 /// ```
2245 pub fn set_identity_constraints<T>(mut self, v: T) -> Self
2246 where
2247 T: std::convert::Into<crate::model::CertificateIdentityConstraints>,
2248 {
2249 self.identity_constraints = std::option::Option::Some(v.into());
2250 self
2251 }
2252
2253 /// Sets or clears the value of [identity_constraints][crate::model::ca_pool::IssuancePolicy::identity_constraints].
2254 ///
2255 /// # Example
2256 /// ```ignore,no_run
2257 /// # use google_cloud_security_privateca_v1::model::ca_pool::IssuancePolicy;
2258 /// use google_cloud_security_privateca_v1::model::CertificateIdentityConstraints;
2259 /// let x = IssuancePolicy::new().set_or_clear_identity_constraints(Some(CertificateIdentityConstraints::default()/* use setters */));
2260 /// let x = IssuancePolicy::new().set_or_clear_identity_constraints(None::<CertificateIdentityConstraints>);
2261 /// ```
2262 pub fn set_or_clear_identity_constraints<T>(mut self, v: std::option::Option<T>) -> Self
2263 where
2264 T: std::convert::Into<crate::model::CertificateIdentityConstraints>,
2265 {
2266 self.identity_constraints = v.map(|x| x.into());
2267 self
2268 }
2269
2270 /// Sets the value of [passthrough_extensions][crate::model::ca_pool::IssuancePolicy::passthrough_extensions].
2271 ///
2272 /// # Example
2273 /// ```ignore,no_run
2274 /// # use google_cloud_security_privateca_v1::model::ca_pool::IssuancePolicy;
2275 /// use google_cloud_security_privateca_v1::model::CertificateExtensionConstraints;
2276 /// let x = IssuancePolicy::new().set_passthrough_extensions(CertificateExtensionConstraints::default()/* use setters */);
2277 /// ```
2278 pub fn set_passthrough_extensions<T>(mut self, v: T) -> Self
2279 where
2280 T: std::convert::Into<crate::model::CertificateExtensionConstraints>,
2281 {
2282 self.passthrough_extensions = std::option::Option::Some(v.into());
2283 self
2284 }
2285
2286 /// Sets or clears the value of [passthrough_extensions][crate::model::ca_pool::IssuancePolicy::passthrough_extensions].
2287 ///
2288 /// # Example
2289 /// ```ignore,no_run
2290 /// # use google_cloud_security_privateca_v1::model::ca_pool::IssuancePolicy;
2291 /// use google_cloud_security_privateca_v1::model::CertificateExtensionConstraints;
2292 /// let x = IssuancePolicy::new().set_or_clear_passthrough_extensions(Some(CertificateExtensionConstraints::default()/* use setters */));
2293 /// let x = IssuancePolicy::new().set_or_clear_passthrough_extensions(None::<CertificateExtensionConstraints>);
2294 /// ```
2295 pub fn set_or_clear_passthrough_extensions<T>(mut self, v: std::option::Option<T>) -> Self
2296 where
2297 T: std::convert::Into<crate::model::CertificateExtensionConstraints>,
2298 {
2299 self.passthrough_extensions = v.map(|x| x.into());
2300 self
2301 }
2302 }
2303
2304 impl wkt::message::Message for IssuancePolicy {
2305 fn typename() -> &'static str {
2306 "type.googleapis.com/google.cloud.security.privateca.v1.CaPool.IssuancePolicy"
2307 }
2308 }
2309
2310 /// Defines additional types related to [IssuancePolicy].
2311 pub mod issuance_policy {
2312 #[allow(unused_imports)]
2313 use super::*;
2314
2315 /// Describes a "type" of key that may be used in a
2316 /// [Certificate][google.cloud.security.privateca.v1.Certificate] issued from
2317 /// a [CaPool][google.cloud.security.privateca.v1.CaPool]. Note that a single
2318 /// [AllowedKeyType][google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType]
2319 /// may refer to either a fully-qualified key algorithm, such as RSA 4096, or
2320 /// a family of key algorithms, such as any RSA key.
2321 ///
2322 /// [google.cloud.security.privateca.v1.CaPool]: crate::model::CaPool
2323 /// [google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType]: crate::model::ca_pool::issuance_policy::AllowedKeyType
2324 /// [google.cloud.security.privateca.v1.Certificate]: crate::model::Certificate
2325 #[derive(Clone, Default, PartialEq)]
2326 #[non_exhaustive]
2327 pub struct AllowedKeyType {
2328 pub key_type: std::option::Option<
2329 crate::model::ca_pool::issuance_policy::allowed_key_type::KeyType,
2330 >,
2331
2332 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2333 }
2334
2335 impl AllowedKeyType {
2336 pub fn new() -> Self {
2337 std::default::Default::default()
2338 }
2339
2340 /// Sets the value of [key_type][crate::model::ca_pool::issuance_policy::AllowedKeyType::key_type].
2341 ///
2342 /// Note that all the setters affecting `key_type` are mutually
2343 /// exclusive.
2344 ///
2345 /// # Example
2346 /// ```ignore,no_run
2347 /// # use google_cloud_security_privateca_v1::model::ca_pool::issuance_policy::AllowedKeyType;
2348 /// use google_cloud_security_privateca_v1::model::ca_pool::issuance_policy::allowed_key_type::RsaKeyType;
2349 /// let x = AllowedKeyType::new().set_key_type(Some(
2350 /// google_cloud_security_privateca_v1::model::ca_pool::issuance_policy::allowed_key_type::KeyType::Rsa(RsaKeyType::default().into())));
2351 /// ```
2352 pub fn set_key_type<
2353 T: std::convert::Into<
2354 std::option::Option<
2355 crate::model::ca_pool::issuance_policy::allowed_key_type::KeyType,
2356 >,
2357 >,
2358 >(
2359 mut self,
2360 v: T,
2361 ) -> Self {
2362 self.key_type = v.into();
2363 self
2364 }
2365
2366 /// The value of [key_type][crate::model::ca_pool::issuance_policy::AllowedKeyType::key_type]
2367 /// if it holds a `Rsa`, `None` if the field is not set or
2368 /// holds a different branch.
2369 pub fn rsa(
2370 &self,
2371 ) -> std::option::Option<
2372 &std::boxed::Box<
2373 crate::model::ca_pool::issuance_policy::allowed_key_type::RsaKeyType,
2374 >,
2375 > {
2376 #[allow(unreachable_patterns)]
2377 self.key_type.as_ref().and_then(|v| match v {
2378 crate::model::ca_pool::issuance_policy::allowed_key_type::KeyType::Rsa(v) => {
2379 std::option::Option::Some(v)
2380 }
2381 _ => std::option::Option::None,
2382 })
2383 }
2384
2385 /// Sets the value of [key_type][crate::model::ca_pool::issuance_policy::AllowedKeyType::key_type]
2386 /// to hold a `Rsa`.
2387 ///
2388 /// Note that all the setters affecting `key_type` are
2389 /// mutually exclusive.
2390 ///
2391 /// # Example
2392 /// ```ignore,no_run
2393 /// # use google_cloud_security_privateca_v1::model::ca_pool::issuance_policy::AllowedKeyType;
2394 /// use google_cloud_security_privateca_v1::model::ca_pool::issuance_policy::allowed_key_type::RsaKeyType;
2395 /// let x = AllowedKeyType::new().set_rsa(RsaKeyType::default()/* use setters */);
2396 /// assert!(x.rsa().is_some());
2397 /// assert!(x.elliptic_curve().is_none());
2398 /// ```
2399 pub fn set_rsa<
2400 T: std::convert::Into<
2401 std::boxed::Box<
2402 crate::model::ca_pool::issuance_policy::allowed_key_type::RsaKeyType,
2403 >,
2404 >,
2405 >(
2406 mut self,
2407 v: T,
2408 ) -> Self {
2409 self.key_type = std::option::Option::Some(
2410 crate::model::ca_pool::issuance_policy::allowed_key_type::KeyType::Rsa(
2411 v.into(),
2412 ),
2413 );
2414 self
2415 }
2416
2417 /// The value of [key_type][crate::model::ca_pool::issuance_policy::AllowedKeyType::key_type]
2418 /// if it holds a `EllipticCurve`, `None` if the field is not set or
2419 /// holds a different branch.
2420 pub fn elliptic_curve(
2421 &self,
2422 ) -> std::option::Option<
2423 &std::boxed::Box<
2424 crate::model::ca_pool::issuance_policy::allowed_key_type::EcKeyType,
2425 >,
2426 > {
2427 #[allow(unreachable_patterns)]
2428 self.key_type.as_ref().and_then(|v| match v {
2429 crate::model::ca_pool::issuance_policy::allowed_key_type::KeyType::EllipticCurve(v) => std::option::Option::Some(v),
2430 _ => std::option::Option::None,
2431 })
2432 }
2433
2434 /// Sets the value of [key_type][crate::model::ca_pool::issuance_policy::AllowedKeyType::key_type]
2435 /// to hold a `EllipticCurve`.
2436 ///
2437 /// Note that all the setters affecting `key_type` are
2438 /// mutually exclusive.
2439 ///
2440 /// # Example
2441 /// ```ignore,no_run
2442 /// # use google_cloud_security_privateca_v1::model::ca_pool::issuance_policy::AllowedKeyType;
2443 /// use google_cloud_security_privateca_v1::model::ca_pool::issuance_policy::allowed_key_type::EcKeyType;
2444 /// let x = AllowedKeyType::new().set_elliptic_curve(EcKeyType::default()/* use setters */);
2445 /// assert!(x.elliptic_curve().is_some());
2446 /// assert!(x.rsa().is_none());
2447 /// ```
2448 pub fn set_elliptic_curve<
2449 T: std::convert::Into<
2450 std::boxed::Box<
2451 crate::model::ca_pool::issuance_policy::allowed_key_type::EcKeyType,
2452 >,
2453 >,
2454 >(
2455 mut self,
2456 v: T,
2457 ) -> Self {
2458 self.key_type = std::option::Option::Some(
2459 crate::model::ca_pool::issuance_policy::allowed_key_type::KeyType::EllipticCurve(
2460 v.into()
2461 )
2462 );
2463 self
2464 }
2465 }
2466
2467 impl wkt::message::Message for AllowedKeyType {
2468 fn typename() -> &'static str {
2469 "type.googleapis.com/google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType"
2470 }
2471 }
2472
2473 /// Defines additional types related to [AllowedKeyType].
2474 pub mod allowed_key_type {
2475 #[allow(unused_imports)]
2476 use super::*;
2477
2478 /// Describes an RSA key that may be used in a
2479 /// [Certificate][google.cloud.security.privateca.v1.Certificate] issued
2480 /// from a [CaPool][google.cloud.security.privateca.v1.CaPool].
2481 ///
2482 /// [google.cloud.security.privateca.v1.CaPool]: crate::model::CaPool
2483 /// [google.cloud.security.privateca.v1.Certificate]: crate::model::Certificate
2484 #[derive(Clone, Default, PartialEq)]
2485 #[non_exhaustive]
2486 pub struct RsaKeyType {
2487 /// Optional. The minimum allowed RSA modulus size (inclusive), in bits.
2488 /// If this is not set, or if set to zero, the service-level min RSA
2489 /// modulus size will continue to apply.
2490 pub min_modulus_size: i64,
2491
2492 /// Optional. The maximum allowed RSA modulus size (inclusive), in bits.
2493 /// If this is not set, or if set to zero, the service will not enforce
2494 /// an explicit upper bound on RSA modulus sizes.
2495 pub max_modulus_size: i64,
2496
2497 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2498 }
2499
2500 impl RsaKeyType {
2501 pub fn new() -> Self {
2502 std::default::Default::default()
2503 }
2504
2505 /// Sets the value of [min_modulus_size][crate::model::ca_pool::issuance_policy::allowed_key_type::RsaKeyType::min_modulus_size].
2506 ///
2507 /// # Example
2508 /// ```ignore,no_run
2509 /// # use google_cloud_security_privateca_v1::model::ca_pool::issuance_policy::allowed_key_type::RsaKeyType;
2510 /// let x = RsaKeyType::new().set_min_modulus_size(42);
2511 /// ```
2512 pub fn set_min_modulus_size<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
2513 self.min_modulus_size = v.into();
2514 self
2515 }
2516
2517 /// Sets the value of [max_modulus_size][crate::model::ca_pool::issuance_policy::allowed_key_type::RsaKeyType::max_modulus_size].
2518 ///
2519 /// # Example
2520 /// ```ignore,no_run
2521 /// # use google_cloud_security_privateca_v1::model::ca_pool::issuance_policy::allowed_key_type::RsaKeyType;
2522 /// let x = RsaKeyType::new().set_max_modulus_size(42);
2523 /// ```
2524 pub fn set_max_modulus_size<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
2525 self.max_modulus_size = v.into();
2526 self
2527 }
2528 }
2529
2530 impl wkt::message::Message for RsaKeyType {
2531 fn typename() -> &'static str {
2532 "type.googleapis.com/google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.RsaKeyType"
2533 }
2534 }
2535
2536 /// Describes an Elliptic Curve key that may be used in a
2537 /// [Certificate][google.cloud.security.privateca.v1.Certificate] issued
2538 /// from a [CaPool][google.cloud.security.privateca.v1.CaPool].
2539 ///
2540 /// [google.cloud.security.privateca.v1.CaPool]: crate::model::CaPool
2541 /// [google.cloud.security.privateca.v1.Certificate]: crate::model::Certificate
2542 #[derive(Clone, Default, PartialEq)]
2543 #[non_exhaustive]
2544 pub struct EcKeyType {
2545
2546 /// Optional. A signature algorithm that must be used. If this is
2547 /// omitted, any EC-based signature algorithm will be allowed.
2548 pub signature_algorithm: crate::model::ca_pool::issuance_policy::allowed_key_type::ec_key_type::EcSignatureAlgorithm,
2549
2550 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2551 }
2552
2553 impl EcKeyType {
2554 pub fn new() -> Self {
2555 std::default::Default::default()
2556 }
2557
2558 /// Sets the value of [signature_algorithm][crate::model::ca_pool::issuance_policy::allowed_key_type::EcKeyType::signature_algorithm].
2559 ///
2560 /// # Example
2561 /// ```ignore,no_run
2562 /// # use google_cloud_security_privateca_v1::model::ca_pool::issuance_policy::allowed_key_type::EcKeyType;
2563 /// use google_cloud_security_privateca_v1::model::ca_pool::issuance_policy::allowed_key_type::ec_key_type::EcSignatureAlgorithm;
2564 /// let x0 = EcKeyType::new().set_signature_algorithm(EcSignatureAlgorithm::EcdsaP256);
2565 /// let x1 = EcKeyType::new().set_signature_algorithm(EcSignatureAlgorithm::EcdsaP384);
2566 /// let x2 = EcKeyType::new().set_signature_algorithm(EcSignatureAlgorithm::Eddsa25519);
2567 /// ```
2568 pub fn set_signature_algorithm<T: std::convert::Into<crate::model::ca_pool::issuance_policy::allowed_key_type::ec_key_type::EcSignatureAlgorithm>>(mut self, v: T) -> Self{
2569 self.signature_algorithm = v.into();
2570 self
2571 }
2572 }
2573
2574 impl wkt::message::Message for EcKeyType {
2575 fn typename() -> &'static str {
2576 "type.googleapis.com/google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.EcKeyType"
2577 }
2578 }
2579
2580 /// Defines additional types related to [EcKeyType].
2581 pub mod ec_key_type {
2582 #[allow(unused_imports)]
2583 use super::*;
2584
2585 /// Describes an elliptic curve-based signature algorithm that may be
2586 /// used in a
2587 /// [Certificate][google.cloud.security.privateca.v1.Certificate] issued
2588 /// from a [CaPool][google.cloud.security.privateca.v1.CaPool].
2589 ///
2590 /// [google.cloud.security.privateca.v1.CaPool]: crate::model::CaPool
2591 /// [google.cloud.security.privateca.v1.Certificate]: crate::model::Certificate
2592 ///
2593 /// # Working with unknown values
2594 ///
2595 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2596 /// additional enum variants at any time. Adding new variants is not considered
2597 /// a breaking change. Applications should write their code in anticipation of:
2598 ///
2599 /// - New values appearing in future releases of the client library, **and**
2600 /// - New values received dynamically, without application changes.
2601 ///
2602 /// Please consult the [Working with enums] section in the user guide for some
2603 /// guidelines.
2604 ///
2605 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
2606 #[derive(Clone, Debug, PartialEq)]
2607 #[non_exhaustive]
2608 pub enum EcSignatureAlgorithm {
2609 /// Not specified. Signifies that any signature algorithm may be used.
2610 Unspecified,
2611 /// Refers to the Elliptic Curve Digital Signature Algorithm over the
2612 /// NIST P-256 curve.
2613 EcdsaP256,
2614 /// Refers to the Elliptic Curve Digital Signature Algorithm over the
2615 /// NIST P-384 curve.
2616 EcdsaP384,
2617 /// Refers to the Edwards-curve Digital Signature Algorithm over curve
2618 /// 25519, as described in RFC 8410.
2619 Eddsa25519,
2620 /// If set, the enum was initialized with an unknown value.
2621 ///
2622 /// Applications can examine the value using [EcSignatureAlgorithm::value] or
2623 /// [EcSignatureAlgorithm::name].
2624 UnknownValue(ec_signature_algorithm::UnknownValue),
2625 }
2626
2627 #[doc(hidden)]
2628 pub mod ec_signature_algorithm {
2629 #[allow(unused_imports)]
2630 use super::*;
2631 #[derive(Clone, Debug, PartialEq)]
2632 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2633 }
2634
2635 impl EcSignatureAlgorithm {
2636 /// Gets the enum value.
2637 ///
2638 /// Returns `None` if the enum contains an unknown value deserialized from
2639 /// the string representation of enums.
2640 pub fn value(&self) -> std::option::Option<i32> {
2641 match self {
2642 Self::Unspecified => std::option::Option::Some(0),
2643 Self::EcdsaP256 => std::option::Option::Some(1),
2644 Self::EcdsaP384 => std::option::Option::Some(2),
2645 Self::Eddsa25519 => std::option::Option::Some(3),
2646 Self::UnknownValue(u) => u.0.value(),
2647 }
2648 }
2649
2650 /// Gets the enum value as a string.
2651 ///
2652 /// Returns `None` if the enum contains an unknown value deserialized from
2653 /// the integer representation of enums.
2654 pub fn name(&self) -> std::option::Option<&str> {
2655 match self {
2656 Self::Unspecified => {
2657 std::option::Option::Some("EC_SIGNATURE_ALGORITHM_UNSPECIFIED")
2658 }
2659 Self::EcdsaP256 => std::option::Option::Some("ECDSA_P256"),
2660 Self::EcdsaP384 => std::option::Option::Some("ECDSA_P384"),
2661 Self::Eddsa25519 => std::option::Option::Some("EDDSA_25519"),
2662 Self::UnknownValue(u) => u.0.name(),
2663 }
2664 }
2665 }
2666
2667 impl std::default::Default for EcSignatureAlgorithm {
2668 fn default() -> Self {
2669 use std::convert::From;
2670 Self::from(0)
2671 }
2672 }
2673
2674 impl std::fmt::Display for EcSignatureAlgorithm {
2675 fn fmt(
2676 &self,
2677 f: &mut std::fmt::Formatter<'_>,
2678 ) -> std::result::Result<(), std::fmt::Error> {
2679 wkt::internal::display_enum(f, self.name(), self.value())
2680 }
2681 }
2682
2683 impl std::convert::From<i32> for EcSignatureAlgorithm {
2684 fn from(value: i32) -> Self {
2685 match value {
2686 0 => Self::Unspecified,
2687 1 => Self::EcdsaP256,
2688 2 => Self::EcdsaP384,
2689 3 => Self::Eddsa25519,
2690 _ => Self::UnknownValue(ec_signature_algorithm::UnknownValue(
2691 wkt::internal::UnknownEnumValue::Integer(value),
2692 )),
2693 }
2694 }
2695 }
2696
2697 impl std::convert::From<&str> for EcSignatureAlgorithm {
2698 fn from(value: &str) -> Self {
2699 use std::string::ToString;
2700 match value {
2701 "EC_SIGNATURE_ALGORITHM_UNSPECIFIED" => Self::Unspecified,
2702 "ECDSA_P256" => Self::EcdsaP256,
2703 "ECDSA_P384" => Self::EcdsaP384,
2704 "EDDSA_25519" => Self::Eddsa25519,
2705 _ => Self::UnknownValue(ec_signature_algorithm::UnknownValue(
2706 wkt::internal::UnknownEnumValue::String(value.to_string()),
2707 )),
2708 }
2709 }
2710 }
2711
2712 impl serde::ser::Serialize for EcSignatureAlgorithm {
2713 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2714 where
2715 S: serde::Serializer,
2716 {
2717 match self {
2718 Self::Unspecified => serializer.serialize_i32(0),
2719 Self::EcdsaP256 => serializer.serialize_i32(1),
2720 Self::EcdsaP384 => serializer.serialize_i32(2),
2721 Self::Eddsa25519 => serializer.serialize_i32(3),
2722 Self::UnknownValue(u) => u.0.serialize(serializer),
2723 }
2724 }
2725 }
2726
2727 impl<'de> serde::de::Deserialize<'de> for EcSignatureAlgorithm {
2728 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2729 where
2730 D: serde::Deserializer<'de>,
2731 {
2732 deserializer.deserialize_any(wkt::internal::EnumVisitor::<EcSignatureAlgorithm>::new(
2733 ".google.cloud.security.privateca.v1.CaPool.IssuancePolicy.AllowedKeyType.EcKeyType.EcSignatureAlgorithm"))
2734 }
2735 }
2736 }
2737
2738 #[derive(Clone, Debug, PartialEq)]
2739 #[non_exhaustive]
2740 pub enum KeyType {
2741 /// Represents an allowed RSA key type.
2742 Rsa(
2743 std::boxed::Box<
2744 crate::model::ca_pool::issuance_policy::allowed_key_type::RsaKeyType,
2745 >,
2746 ),
2747 /// Represents an allowed Elliptic Curve key type.
2748 EllipticCurve(
2749 std::boxed::Box<
2750 crate::model::ca_pool::issuance_policy::allowed_key_type::EcKeyType,
2751 >,
2752 ),
2753 }
2754 }
2755
2756 /// [IssuanceModes][google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IssuanceModes]
2757 /// specifies the allowed ways in which
2758 /// [Certificates][google.cloud.security.privateca.v1.Certificate] may be
2759 /// requested from this [CaPool][google.cloud.security.privateca.v1.CaPool].
2760 ///
2761 /// [google.cloud.security.privateca.v1.CaPool]: crate::model::CaPool
2762 /// [google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IssuanceModes]: crate::model::ca_pool::issuance_policy::IssuanceModes
2763 /// [google.cloud.security.privateca.v1.Certificate]: crate::model::Certificate
2764 #[derive(Clone, Default, PartialEq)]
2765 #[non_exhaustive]
2766 pub struct IssuanceModes {
2767 /// Optional. When true, allows callers to create
2768 /// [Certificates][google.cloud.security.privateca.v1.Certificate] by
2769 /// specifying a CSR.
2770 ///
2771 /// [google.cloud.security.privateca.v1.Certificate]: crate::model::Certificate
2772 pub allow_csr_based_issuance: bool,
2773
2774 /// Optional. When true, allows callers to create
2775 /// [Certificates][google.cloud.security.privateca.v1.Certificate] by
2776 /// specifying a
2777 /// [CertificateConfig][google.cloud.security.privateca.v1.CertificateConfig].
2778 ///
2779 /// [google.cloud.security.privateca.v1.Certificate]: crate::model::Certificate
2780 /// [google.cloud.security.privateca.v1.CertificateConfig]: crate::model::CertificateConfig
2781 pub allow_config_based_issuance: bool,
2782
2783 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2784 }
2785
2786 impl IssuanceModes {
2787 pub fn new() -> Self {
2788 std::default::Default::default()
2789 }
2790
2791 /// Sets the value of [allow_csr_based_issuance][crate::model::ca_pool::issuance_policy::IssuanceModes::allow_csr_based_issuance].
2792 ///
2793 /// # Example
2794 /// ```ignore,no_run
2795 /// # use google_cloud_security_privateca_v1::model::ca_pool::issuance_policy::IssuanceModes;
2796 /// let x = IssuanceModes::new().set_allow_csr_based_issuance(true);
2797 /// ```
2798 pub fn set_allow_csr_based_issuance<T: std::convert::Into<bool>>(
2799 mut self,
2800 v: T,
2801 ) -> Self {
2802 self.allow_csr_based_issuance = v.into();
2803 self
2804 }
2805
2806 /// Sets the value of [allow_config_based_issuance][crate::model::ca_pool::issuance_policy::IssuanceModes::allow_config_based_issuance].
2807 ///
2808 /// # Example
2809 /// ```ignore,no_run
2810 /// # use google_cloud_security_privateca_v1::model::ca_pool::issuance_policy::IssuanceModes;
2811 /// let x = IssuanceModes::new().set_allow_config_based_issuance(true);
2812 /// ```
2813 pub fn set_allow_config_based_issuance<T: std::convert::Into<bool>>(
2814 mut self,
2815 v: T,
2816 ) -> Self {
2817 self.allow_config_based_issuance = v.into();
2818 self
2819 }
2820 }
2821
2822 impl wkt::message::Message for IssuanceModes {
2823 fn typename() -> &'static str {
2824 "type.googleapis.com/google.cloud.security.privateca.v1.CaPool.IssuancePolicy.IssuanceModes"
2825 }
2826 }
2827 }
2828
2829 /// The tier of a [CaPool][google.cloud.security.privateca.v1.CaPool],
2830 /// indicating its supported functionality and/or billing SKU.
2831 ///
2832 /// [google.cloud.security.privateca.v1.CaPool]: crate::model::CaPool
2833 ///
2834 /// # Working with unknown values
2835 ///
2836 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2837 /// additional enum variants at any time. Adding new variants is not considered
2838 /// a breaking change. Applications should write their code in anticipation of:
2839 ///
2840 /// - New values appearing in future releases of the client library, **and**
2841 /// - New values received dynamically, without application changes.
2842 ///
2843 /// Please consult the [Working with enums] section in the user guide for some
2844 /// guidelines.
2845 ///
2846 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
2847 #[derive(Clone, Debug, PartialEq)]
2848 #[non_exhaustive]
2849 pub enum Tier {
2850 /// Not specified.
2851 Unspecified,
2852 /// Enterprise tier.
2853 Enterprise,
2854 /// DevOps tier.
2855 Devops,
2856 /// If set, the enum was initialized with an unknown value.
2857 ///
2858 /// Applications can examine the value using [Tier::value] or
2859 /// [Tier::name].
2860 UnknownValue(tier::UnknownValue),
2861 }
2862
2863 #[doc(hidden)]
2864 pub mod tier {
2865 #[allow(unused_imports)]
2866 use super::*;
2867 #[derive(Clone, Debug, PartialEq)]
2868 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2869 }
2870
2871 impl Tier {
2872 /// Gets the enum value.
2873 ///
2874 /// Returns `None` if the enum contains an unknown value deserialized from
2875 /// the string representation of enums.
2876 pub fn value(&self) -> std::option::Option<i32> {
2877 match self {
2878 Self::Unspecified => std::option::Option::Some(0),
2879 Self::Enterprise => std::option::Option::Some(1),
2880 Self::Devops => std::option::Option::Some(2),
2881 Self::UnknownValue(u) => u.0.value(),
2882 }
2883 }
2884
2885 /// Gets the enum value as a string.
2886 ///
2887 /// Returns `None` if the enum contains an unknown value deserialized from
2888 /// the integer representation of enums.
2889 pub fn name(&self) -> std::option::Option<&str> {
2890 match self {
2891 Self::Unspecified => std::option::Option::Some("TIER_UNSPECIFIED"),
2892 Self::Enterprise => std::option::Option::Some("ENTERPRISE"),
2893 Self::Devops => std::option::Option::Some("DEVOPS"),
2894 Self::UnknownValue(u) => u.0.name(),
2895 }
2896 }
2897 }
2898
2899 impl std::default::Default for Tier {
2900 fn default() -> Self {
2901 use std::convert::From;
2902 Self::from(0)
2903 }
2904 }
2905
2906 impl std::fmt::Display for Tier {
2907 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2908 wkt::internal::display_enum(f, self.name(), self.value())
2909 }
2910 }
2911
2912 impl std::convert::From<i32> for Tier {
2913 fn from(value: i32) -> Self {
2914 match value {
2915 0 => Self::Unspecified,
2916 1 => Self::Enterprise,
2917 2 => Self::Devops,
2918 _ => Self::UnknownValue(tier::UnknownValue(
2919 wkt::internal::UnknownEnumValue::Integer(value),
2920 )),
2921 }
2922 }
2923 }
2924
2925 impl std::convert::From<&str> for Tier {
2926 fn from(value: &str) -> Self {
2927 use std::string::ToString;
2928 match value {
2929 "TIER_UNSPECIFIED" => Self::Unspecified,
2930 "ENTERPRISE" => Self::Enterprise,
2931 "DEVOPS" => Self::Devops,
2932 _ => Self::UnknownValue(tier::UnknownValue(
2933 wkt::internal::UnknownEnumValue::String(value.to_string()),
2934 )),
2935 }
2936 }
2937 }
2938
2939 impl serde::ser::Serialize for Tier {
2940 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2941 where
2942 S: serde::Serializer,
2943 {
2944 match self {
2945 Self::Unspecified => serializer.serialize_i32(0),
2946 Self::Enterprise => serializer.serialize_i32(1),
2947 Self::Devops => serializer.serialize_i32(2),
2948 Self::UnknownValue(u) => u.0.serialize(serializer),
2949 }
2950 }
2951 }
2952
2953 impl<'de> serde::de::Deserialize<'de> for Tier {
2954 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2955 where
2956 D: serde::Deserializer<'de>,
2957 {
2958 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Tier>::new(
2959 ".google.cloud.security.privateca.v1.CaPool.Tier",
2960 ))
2961 }
2962 }
2963}
2964
2965/// A
2966/// [CertificateRevocationList][google.cloud.security.privateca.v1.CertificateRevocationList]
2967/// corresponds to a signed X.509 certificate Revocation List (CRL). A CRL
2968/// contains the serial numbers of certificates that should no longer be trusted.
2969///
2970/// [google.cloud.security.privateca.v1.CertificateRevocationList]: crate::model::CertificateRevocationList
2971#[derive(Clone, Default, PartialEq)]
2972#[non_exhaustive]
2973pub struct CertificateRevocationList {
2974 /// Identifier. The resource name for this
2975 /// [CertificateRevocationList][google.cloud.security.privateca.v1.CertificateRevocationList]
2976 /// in the format `projects/*/locations/*/caPools/*certificateAuthorities/*/
2977 /// certificateRevocationLists/*`.
2978 ///
2979 /// [google.cloud.security.privateca.v1.CertificateRevocationList]: crate::model::CertificateRevocationList
2980 pub name: std::string::String,
2981
2982 /// Output only. The CRL sequence number that appears in pem_crl.
2983 pub sequence_number: i64,
2984
2985 /// Output only. The revoked serial numbers that appear in pem_crl.
2986 pub revoked_certificates:
2987 std::vec::Vec<crate::model::certificate_revocation_list::RevokedCertificate>,
2988
2989 /// Output only. The PEM-encoded X.509 CRL.
2990 pub pem_crl: std::string::String,
2991
2992 /// Output only. The location where 'pem_crl' can be accessed.
2993 pub access_url: std::string::String,
2994
2995 /// Output only. The
2996 /// [State][google.cloud.security.privateca.v1.CertificateRevocationList.State]
2997 /// for this
2998 /// [CertificateRevocationList][google.cloud.security.privateca.v1.CertificateRevocationList].
2999 ///
3000 /// [google.cloud.security.privateca.v1.CertificateRevocationList]: crate::model::CertificateRevocationList
3001 /// [google.cloud.security.privateca.v1.CertificateRevocationList.State]: crate::model::certificate_revocation_list::State
3002 pub state: crate::model::certificate_revocation_list::State,
3003
3004 /// Output only. The time at which this
3005 /// [CertificateRevocationList][google.cloud.security.privateca.v1.CertificateRevocationList]
3006 /// was created.
3007 ///
3008 /// [google.cloud.security.privateca.v1.CertificateRevocationList]: crate::model::CertificateRevocationList
3009 pub create_time: std::option::Option<wkt::Timestamp>,
3010
3011 /// Output only. The time at which this
3012 /// [CertificateRevocationList][google.cloud.security.privateca.v1.CertificateRevocationList]
3013 /// was updated.
3014 ///
3015 /// [google.cloud.security.privateca.v1.CertificateRevocationList]: crate::model::CertificateRevocationList
3016 pub update_time: std::option::Option<wkt::Timestamp>,
3017
3018 /// Output only. The revision ID of this
3019 /// [CertificateRevocationList][google.cloud.security.privateca.v1.CertificateRevocationList].
3020 /// A new revision is committed whenever a new CRL is published. The format is
3021 /// an 8-character hexadecimal string.
3022 ///
3023 /// [google.cloud.security.privateca.v1.CertificateRevocationList]: crate::model::CertificateRevocationList
3024 pub revision_id: std::string::String,
3025
3026 /// Optional. Labels with user-defined metadata.
3027 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
3028
3029 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3030}
3031
3032impl CertificateRevocationList {
3033 pub fn new() -> Self {
3034 std::default::Default::default()
3035 }
3036
3037 /// Sets the value of [name][crate::model::CertificateRevocationList::name].
3038 ///
3039 /// # Example
3040 /// ```ignore,no_run
3041 /// # use google_cloud_security_privateca_v1::model::CertificateRevocationList;
3042 /// let x = CertificateRevocationList::new().set_name("example");
3043 /// ```
3044 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3045 self.name = v.into();
3046 self
3047 }
3048
3049 /// Sets the value of [sequence_number][crate::model::CertificateRevocationList::sequence_number].
3050 ///
3051 /// # Example
3052 /// ```ignore,no_run
3053 /// # use google_cloud_security_privateca_v1::model::CertificateRevocationList;
3054 /// let x = CertificateRevocationList::new().set_sequence_number(42);
3055 /// ```
3056 pub fn set_sequence_number<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
3057 self.sequence_number = v.into();
3058 self
3059 }
3060
3061 /// Sets the value of [revoked_certificates][crate::model::CertificateRevocationList::revoked_certificates].
3062 ///
3063 /// # Example
3064 /// ```ignore,no_run
3065 /// # use google_cloud_security_privateca_v1::model::CertificateRevocationList;
3066 /// use google_cloud_security_privateca_v1::model::certificate_revocation_list::RevokedCertificate;
3067 /// let x = CertificateRevocationList::new()
3068 /// .set_revoked_certificates([
3069 /// RevokedCertificate::default()/* use setters */,
3070 /// RevokedCertificate::default()/* use (different) setters */,
3071 /// ]);
3072 /// ```
3073 pub fn set_revoked_certificates<T, V>(mut self, v: T) -> Self
3074 where
3075 T: std::iter::IntoIterator<Item = V>,
3076 V: std::convert::Into<crate::model::certificate_revocation_list::RevokedCertificate>,
3077 {
3078 use std::iter::Iterator;
3079 self.revoked_certificates = v.into_iter().map(|i| i.into()).collect();
3080 self
3081 }
3082
3083 /// Sets the value of [pem_crl][crate::model::CertificateRevocationList::pem_crl].
3084 ///
3085 /// # Example
3086 /// ```ignore,no_run
3087 /// # use google_cloud_security_privateca_v1::model::CertificateRevocationList;
3088 /// let x = CertificateRevocationList::new().set_pem_crl("example");
3089 /// ```
3090 pub fn set_pem_crl<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3091 self.pem_crl = v.into();
3092 self
3093 }
3094
3095 /// Sets the value of [access_url][crate::model::CertificateRevocationList::access_url].
3096 ///
3097 /// # Example
3098 /// ```ignore,no_run
3099 /// # use google_cloud_security_privateca_v1::model::CertificateRevocationList;
3100 /// let x = CertificateRevocationList::new().set_access_url("example");
3101 /// ```
3102 pub fn set_access_url<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3103 self.access_url = v.into();
3104 self
3105 }
3106
3107 /// Sets the value of [state][crate::model::CertificateRevocationList::state].
3108 ///
3109 /// # Example
3110 /// ```ignore,no_run
3111 /// # use google_cloud_security_privateca_v1::model::CertificateRevocationList;
3112 /// use google_cloud_security_privateca_v1::model::certificate_revocation_list::State;
3113 /// let x0 = CertificateRevocationList::new().set_state(State::Active);
3114 /// let x1 = CertificateRevocationList::new().set_state(State::Superseded);
3115 /// ```
3116 pub fn set_state<T: std::convert::Into<crate::model::certificate_revocation_list::State>>(
3117 mut self,
3118 v: T,
3119 ) -> Self {
3120 self.state = v.into();
3121 self
3122 }
3123
3124 /// Sets the value of [create_time][crate::model::CertificateRevocationList::create_time].
3125 ///
3126 /// # Example
3127 /// ```ignore,no_run
3128 /// # use google_cloud_security_privateca_v1::model::CertificateRevocationList;
3129 /// use wkt::Timestamp;
3130 /// let x = CertificateRevocationList::new().set_create_time(Timestamp::default()/* use setters */);
3131 /// ```
3132 pub fn set_create_time<T>(mut self, v: T) -> Self
3133 where
3134 T: std::convert::Into<wkt::Timestamp>,
3135 {
3136 self.create_time = std::option::Option::Some(v.into());
3137 self
3138 }
3139
3140 /// Sets or clears the value of [create_time][crate::model::CertificateRevocationList::create_time].
3141 ///
3142 /// # Example
3143 /// ```ignore,no_run
3144 /// # use google_cloud_security_privateca_v1::model::CertificateRevocationList;
3145 /// use wkt::Timestamp;
3146 /// let x = CertificateRevocationList::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
3147 /// let x = CertificateRevocationList::new().set_or_clear_create_time(None::<Timestamp>);
3148 /// ```
3149 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
3150 where
3151 T: std::convert::Into<wkt::Timestamp>,
3152 {
3153 self.create_time = v.map(|x| x.into());
3154 self
3155 }
3156
3157 /// Sets the value of [update_time][crate::model::CertificateRevocationList::update_time].
3158 ///
3159 /// # Example
3160 /// ```ignore,no_run
3161 /// # use google_cloud_security_privateca_v1::model::CertificateRevocationList;
3162 /// use wkt::Timestamp;
3163 /// let x = CertificateRevocationList::new().set_update_time(Timestamp::default()/* use setters */);
3164 /// ```
3165 pub fn set_update_time<T>(mut self, v: T) -> Self
3166 where
3167 T: std::convert::Into<wkt::Timestamp>,
3168 {
3169 self.update_time = std::option::Option::Some(v.into());
3170 self
3171 }
3172
3173 /// Sets or clears the value of [update_time][crate::model::CertificateRevocationList::update_time].
3174 ///
3175 /// # Example
3176 /// ```ignore,no_run
3177 /// # use google_cloud_security_privateca_v1::model::CertificateRevocationList;
3178 /// use wkt::Timestamp;
3179 /// let x = CertificateRevocationList::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
3180 /// let x = CertificateRevocationList::new().set_or_clear_update_time(None::<Timestamp>);
3181 /// ```
3182 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
3183 where
3184 T: std::convert::Into<wkt::Timestamp>,
3185 {
3186 self.update_time = v.map(|x| x.into());
3187 self
3188 }
3189
3190 /// Sets the value of [revision_id][crate::model::CertificateRevocationList::revision_id].
3191 ///
3192 /// # Example
3193 /// ```ignore,no_run
3194 /// # use google_cloud_security_privateca_v1::model::CertificateRevocationList;
3195 /// let x = CertificateRevocationList::new().set_revision_id("example");
3196 /// ```
3197 pub fn set_revision_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3198 self.revision_id = v.into();
3199 self
3200 }
3201
3202 /// Sets the value of [labels][crate::model::CertificateRevocationList::labels].
3203 ///
3204 /// # Example
3205 /// ```ignore,no_run
3206 /// # use google_cloud_security_privateca_v1::model::CertificateRevocationList;
3207 /// let x = CertificateRevocationList::new().set_labels([
3208 /// ("key0", "abc"),
3209 /// ("key1", "xyz"),
3210 /// ]);
3211 /// ```
3212 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
3213 where
3214 T: std::iter::IntoIterator<Item = (K, V)>,
3215 K: std::convert::Into<std::string::String>,
3216 V: std::convert::Into<std::string::String>,
3217 {
3218 use std::iter::Iterator;
3219 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
3220 self
3221 }
3222}
3223
3224impl wkt::message::Message for CertificateRevocationList {
3225 fn typename() -> &'static str {
3226 "type.googleapis.com/google.cloud.security.privateca.v1.CertificateRevocationList"
3227 }
3228}
3229
3230/// Defines additional types related to [CertificateRevocationList].
3231pub mod certificate_revocation_list {
3232 #[allow(unused_imports)]
3233 use super::*;
3234
3235 /// Describes a revoked
3236 /// [Certificate][google.cloud.security.privateca.v1.Certificate].
3237 ///
3238 /// [google.cloud.security.privateca.v1.Certificate]: crate::model::Certificate
3239 #[derive(Clone, Default, PartialEq)]
3240 #[non_exhaustive]
3241 pub struct RevokedCertificate {
3242 /// The resource name for the
3243 /// [Certificate][google.cloud.security.privateca.v1.Certificate] in the
3244 /// format `projects/*/locations/*/caPools/*/certificates/*`.
3245 ///
3246 /// [google.cloud.security.privateca.v1.Certificate]: crate::model::Certificate
3247 pub certificate: std::string::String,
3248
3249 /// The serial number of the
3250 /// [Certificate][google.cloud.security.privateca.v1.Certificate].
3251 ///
3252 /// [google.cloud.security.privateca.v1.Certificate]: crate::model::Certificate
3253 pub hex_serial_number: std::string::String,
3254
3255 /// The reason the
3256 /// [Certificate][google.cloud.security.privateca.v1.Certificate] was
3257 /// revoked.
3258 ///
3259 /// [google.cloud.security.privateca.v1.Certificate]: crate::model::Certificate
3260 pub revocation_reason: crate::model::RevocationReason,
3261
3262 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3263 }
3264
3265 impl RevokedCertificate {
3266 pub fn new() -> Self {
3267 std::default::Default::default()
3268 }
3269
3270 /// Sets the value of [certificate][crate::model::certificate_revocation_list::RevokedCertificate::certificate].
3271 ///
3272 /// # Example
3273 /// ```ignore,no_run
3274 /// # use google_cloud_security_privateca_v1::model::certificate_revocation_list::RevokedCertificate;
3275 /// let x = RevokedCertificate::new().set_certificate("example");
3276 /// ```
3277 pub fn set_certificate<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3278 self.certificate = v.into();
3279 self
3280 }
3281
3282 /// Sets the value of [hex_serial_number][crate::model::certificate_revocation_list::RevokedCertificate::hex_serial_number].
3283 ///
3284 /// # Example
3285 /// ```ignore,no_run
3286 /// # use google_cloud_security_privateca_v1::model::certificate_revocation_list::RevokedCertificate;
3287 /// let x = RevokedCertificate::new().set_hex_serial_number("example");
3288 /// ```
3289 pub fn set_hex_serial_number<T: std::convert::Into<std::string::String>>(
3290 mut self,
3291 v: T,
3292 ) -> Self {
3293 self.hex_serial_number = v.into();
3294 self
3295 }
3296
3297 /// Sets the value of [revocation_reason][crate::model::certificate_revocation_list::RevokedCertificate::revocation_reason].
3298 ///
3299 /// # Example
3300 /// ```ignore,no_run
3301 /// # use google_cloud_security_privateca_v1::model::certificate_revocation_list::RevokedCertificate;
3302 /// use google_cloud_security_privateca_v1::model::RevocationReason;
3303 /// let x0 = RevokedCertificate::new().set_revocation_reason(RevocationReason::KeyCompromise);
3304 /// let x1 = RevokedCertificate::new().set_revocation_reason(RevocationReason::CertificateAuthorityCompromise);
3305 /// let x2 = RevokedCertificate::new().set_revocation_reason(RevocationReason::AffiliationChanged);
3306 /// ```
3307 pub fn set_revocation_reason<T: std::convert::Into<crate::model::RevocationReason>>(
3308 mut self,
3309 v: T,
3310 ) -> Self {
3311 self.revocation_reason = v.into();
3312 self
3313 }
3314 }
3315
3316 impl wkt::message::Message for RevokedCertificate {
3317 fn typename() -> &'static str {
3318 "type.googleapis.com/google.cloud.security.privateca.v1.CertificateRevocationList.RevokedCertificate"
3319 }
3320 }
3321
3322 /// The state of a
3323 /// [CertificateRevocationList][google.cloud.security.privateca.v1.CertificateRevocationList],
3324 /// indicating if it is current.
3325 ///
3326 /// [google.cloud.security.privateca.v1.CertificateRevocationList]: crate::model::CertificateRevocationList
3327 ///
3328 /// # Working with unknown values
3329 ///
3330 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3331 /// additional enum variants at any time. Adding new variants is not considered
3332 /// a breaking change. Applications should write their code in anticipation of:
3333 ///
3334 /// - New values appearing in future releases of the client library, **and**
3335 /// - New values received dynamically, without application changes.
3336 ///
3337 /// Please consult the [Working with enums] section in the user guide for some
3338 /// guidelines.
3339 ///
3340 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
3341 #[derive(Clone, Debug, PartialEq)]
3342 #[non_exhaustive]
3343 pub enum State {
3344 /// Not specified.
3345 Unspecified,
3346 /// The
3347 /// [CertificateRevocationList][google.cloud.security.privateca.v1.CertificateRevocationList]
3348 /// is up to date.
3349 ///
3350 /// [google.cloud.security.privateca.v1.CertificateRevocationList]: crate::model::CertificateRevocationList
3351 Active,
3352 /// The
3353 /// [CertificateRevocationList][google.cloud.security.privateca.v1.CertificateRevocationList]
3354 /// is no longer current.
3355 ///
3356 /// [google.cloud.security.privateca.v1.CertificateRevocationList]: crate::model::CertificateRevocationList
3357 Superseded,
3358 /// If set, the enum was initialized with an unknown value.
3359 ///
3360 /// Applications can examine the value using [State::value] or
3361 /// [State::name].
3362 UnknownValue(state::UnknownValue),
3363 }
3364
3365 #[doc(hidden)]
3366 pub mod state {
3367 #[allow(unused_imports)]
3368 use super::*;
3369 #[derive(Clone, Debug, PartialEq)]
3370 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3371 }
3372
3373 impl State {
3374 /// Gets the enum value.
3375 ///
3376 /// Returns `None` if the enum contains an unknown value deserialized from
3377 /// the string representation of enums.
3378 pub fn value(&self) -> std::option::Option<i32> {
3379 match self {
3380 Self::Unspecified => std::option::Option::Some(0),
3381 Self::Active => std::option::Option::Some(1),
3382 Self::Superseded => std::option::Option::Some(2),
3383 Self::UnknownValue(u) => u.0.value(),
3384 }
3385 }
3386
3387 /// Gets the enum value as a string.
3388 ///
3389 /// Returns `None` if the enum contains an unknown value deserialized from
3390 /// the integer representation of enums.
3391 pub fn name(&self) -> std::option::Option<&str> {
3392 match self {
3393 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
3394 Self::Active => std::option::Option::Some("ACTIVE"),
3395 Self::Superseded => std::option::Option::Some("SUPERSEDED"),
3396 Self::UnknownValue(u) => u.0.name(),
3397 }
3398 }
3399 }
3400
3401 impl std::default::Default for State {
3402 fn default() -> Self {
3403 use std::convert::From;
3404 Self::from(0)
3405 }
3406 }
3407
3408 impl std::fmt::Display for State {
3409 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3410 wkt::internal::display_enum(f, self.name(), self.value())
3411 }
3412 }
3413
3414 impl std::convert::From<i32> for State {
3415 fn from(value: i32) -> Self {
3416 match value {
3417 0 => Self::Unspecified,
3418 1 => Self::Active,
3419 2 => Self::Superseded,
3420 _ => Self::UnknownValue(state::UnknownValue(
3421 wkt::internal::UnknownEnumValue::Integer(value),
3422 )),
3423 }
3424 }
3425 }
3426
3427 impl std::convert::From<&str> for State {
3428 fn from(value: &str) -> Self {
3429 use std::string::ToString;
3430 match value {
3431 "STATE_UNSPECIFIED" => Self::Unspecified,
3432 "ACTIVE" => Self::Active,
3433 "SUPERSEDED" => Self::Superseded,
3434 _ => Self::UnknownValue(state::UnknownValue(
3435 wkt::internal::UnknownEnumValue::String(value.to_string()),
3436 )),
3437 }
3438 }
3439 }
3440
3441 impl serde::ser::Serialize for State {
3442 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3443 where
3444 S: serde::Serializer,
3445 {
3446 match self {
3447 Self::Unspecified => serializer.serialize_i32(0),
3448 Self::Active => serializer.serialize_i32(1),
3449 Self::Superseded => serializer.serialize_i32(2),
3450 Self::UnknownValue(u) => u.0.serialize(serializer),
3451 }
3452 }
3453 }
3454
3455 impl<'de> serde::de::Deserialize<'de> for State {
3456 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3457 where
3458 D: serde::Deserializer<'de>,
3459 {
3460 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
3461 ".google.cloud.security.privateca.v1.CertificateRevocationList.State",
3462 ))
3463 }
3464 }
3465}
3466
3467/// A [Certificate][google.cloud.security.privateca.v1.Certificate] corresponds
3468/// to a signed X.509 certificate issued by a
3469/// [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority].
3470///
3471/// [google.cloud.security.privateca.v1.Certificate]: crate::model::Certificate
3472/// [google.cloud.security.privateca.v1.CertificateAuthority]: crate::model::CertificateAuthority
3473#[derive(Clone, Default, PartialEq)]
3474#[non_exhaustive]
3475pub struct Certificate {
3476 /// Identifier. The resource name for this
3477 /// [Certificate][google.cloud.security.privateca.v1.Certificate] in the format
3478 /// `projects/*/locations/*/caPools/*/certificates/*`.
3479 ///
3480 /// [google.cloud.security.privateca.v1.Certificate]: crate::model::Certificate
3481 pub name: std::string::String,
3482
3483 /// Output only. The resource name of the issuing
3484 /// [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]
3485 /// in the format `projects/*/locations/*/caPools/*/certificateAuthorities/*`.
3486 ///
3487 /// [google.cloud.security.privateca.v1.CertificateAuthority]: crate::model::CertificateAuthority
3488 pub issuer_certificate_authority: std::string::String,
3489
3490 /// Required. Immutable. The desired lifetime of a certificate. Used to create
3491 /// the "not_before_time" and "not_after_time" fields inside an X.509
3492 /// certificate. Note that the lifetime may be truncated if it would extend
3493 /// past the life of any certificate authority in the issuing chain.
3494 pub lifetime: std::option::Option<wkt::Duration>,
3495
3496 /// Immutable. The resource name for a
3497 /// [CertificateTemplate][google.cloud.security.privateca.v1.CertificateTemplate]
3498 /// used to issue this certificate, in the format
3499 /// `projects/*/locations/*/certificateTemplates/*`.
3500 /// If this is specified, the caller must have the necessary permission to
3501 /// use this template. If this is omitted, no template will be used.
3502 /// This template must be in the same location as the
3503 /// [Certificate][google.cloud.security.privateca.v1.Certificate].
3504 ///
3505 /// [google.cloud.security.privateca.v1.Certificate]: crate::model::Certificate
3506 /// [google.cloud.security.privateca.v1.CertificateTemplate]: crate::model::CertificateTemplate
3507 pub certificate_template: std::string::String,
3508
3509 /// Immutable. Specifies how the
3510 /// [Certificate][google.cloud.security.privateca.v1.Certificate]'s identity
3511 /// fields are to be decided. If this is omitted, the `DEFAULT` subject mode
3512 /// will be used.
3513 ///
3514 /// [google.cloud.security.privateca.v1.Certificate]: crate::model::Certificate
3515 pub subject_mode: crate::model::SubjectRequestMode,
3516
3517 /// Output only. Details regarding the revocation of this
3518 /// [Certificate][google.cloud.security.privateca.v1.Certificate]. This
3519 /// [Certificate][google.cloud.security.privateca.v1.Certificate] is considered
3520 /// revoked if and only if this field is present.
3521 ///
3522 /// [google.cloud.security.privateca.v1.Certificate]: crate::model::Certificate
3523 pub revocation_details: std::option::Option<crate::model::certificate::RevocationDetails>,
3524
3525 /// Output only. The pem-encoded, signed X.509 certificate.
3526 pub pem_certificate: std::string::String,
3527
3528 /// Output only. A structured description of the issued X.509 certificate.
3529 pub certificate_description: std::option::Option<crate::model::CertificateDescription>,
3530
3531 /// Output only. The chain that may be used to verify the X.509 certificate.
3532 /// Expected to be in issuer-to-root order according to RFC 5246.
3533 pub pem_certificate_chain: std::vec::Vec<std::string::String>,
3534
3535 /// Output only. The time at which this
3536 /// [Certificate][google.cloud.security.privateca.v1.Certificate] was created.
3537 ///
3538 /// [google.cloud.security.privateca.v1.Certificate]: crate::model::Certificate
3539 pub create_time: std::option::Option<wkt::Timestamp>,
3540
3541 /// Output only. The time at which this
3542 /// [Certificate][google.cloud.security.privateca.v1.Certificate] was updated.
3543 ///
3544 /// [google.cloud.security.privateca.v1.Certificate]: crate::model::Certificate
3545 pub update_time: std::option::Option<wkt::Timestamp>,
3546
3547 /// Optional. Labels with user-defined metadata.
3548 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
3549
3550 /// The config used to create a signed X.509 certificate.
3551 pub certificate_config: std::option::Option<crate::model::certificate::CertificateConfig>,
3552
3553 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3554}
3555
3556impl Certificate {
3557 pub fn new() -> Self {
3558 std::default::Default::default()
3559 }
3560
3561 /// Sets the value of [name][crate::model::Certificate::name].
3562 ///
3563 /// # Example
3564 /// ```ignore,no_run
3565 /// # use google_cloud_security_privateca_v1::model::Certificate;
3566 /// let x = Certificate::new().set_name("example");
3567 /// ```
3568 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3569 self.name = v.into();
3570 self
3571 }
3572
3573 /// Sets the value of [issuer_certificate_authority][crate::model::Certificate::issuer_certificate_authority].
3574 ///
3575 /// # Example
3576 /// ```ignore,no_run
3577 /// # use google_cloud_security_privateca_v1::model::Certificate;
3578 /// let x = Certificate::new().set_issuer_certificate_authority("example");
3579 /// ```
3580 pub fn set_issuer_certificate_authority<T: std::convert::Into<std::string::String>>(
3581 mut self,
3582 v: T,
3583 ) -> Self {
3584 self.issuer_certificate_authority = v.into();
3585 self
3586 }
3587
3588 /// Sets the value of [lifetime][crate::model::Certificate::lifetime].
3589 ///
3590 /// # Example
3591 /// ```ignore,no_run
3592 /// # use google_cloud_security_privateca_v1::model::Certificate;
3593 /// use wkt::Duration;
3594 /// let x = Certificate::new().set_lifetime(Duration::default()/* use setters */);
3595 /// ```
3596 pub fn set_lifetime<T>(mut self, v: T) -> Self
3597 where
3598 T: std::convert::Into<wkt::Duration>,
3599 {
3600 self.lifetime = std::option::Option::Some(v.into());
3601 self
3602 }
3603
3604 /// Sets or clears the value of [lifetime][crate::model::Certificate::lifetime].
3605 ///
3606 /// # Example
3607 /// ```ignore,no_run
3608 /// # use google_cloud_security_privateca_v1::model::Certificate;
3609 /// use wkt::Duration;
3610 /// let x = Certificate::new().set_or_clear_lifetime(Some(Duration::default()/* use setters */));
3611 /// let x = Certificate::new().set_or_clear_lifetime(None::<Duration>);
3612 /// ```
3613 pub fn set_or_clear_lifetime<T>(mut self, v: std::option::Option<T>) -> Self
3614 where
3615 T: std::convert::Into<wkt::Duration>,
3616 {
3617 self.lifetime = v.map(|x| x.into());
3618 self
3619 }
3620
3621 /// Sets the value of [certificate_template][crate::model::Certificate::certificate_template].
3622 ///
3623 /// # Example
3624 /// ```ignore,no_run
3625 /// # use google_cloud_security_privateca_v1::model::Certificate;
3626 /// let x = Certificate::new().set_certificate_template("example");
3627 /// ```
3628 pub fn set_certificate_template<T: std::convert::Into<std::string::String>>(
3629 mut self,
3630 v: T,
3631 ) -> Self {
3632 self.certificate_template = v.into();
3633 self
3634 }
3635
3636 /// Sets the value of [subject_mode][crate::model::Certificate::subject_mode].
3637 ///
3638 /// # Example
3639 /// ```ignore,no_run
3640 /// # use google_cloud_security_privateca_v1::model::Certificate;
3641 /// use google_cloud_security_privateca_v1::model::SubjectRequestMode;
3642 /// let x0 = Certificate::new().set_subject_mode(SubjectRequestMode::Default);
3643 /// let x1 = Certificate::new().set_subject_mode(SubjectRequestMode::RdnSequence);
3644 /// let x2 = Certificate::new().set_subject_mode(SubjectRequestMode::ReflectedSpiffe);
3645 /// ```
3646 pub fn set_subject_mode<T: std::convert::Into<crate::model::SubjectRequestMode>>(
3647 mut self,
3648 v: T,
3649 ) -> Self {
3650 self.subject_mode = v.into();
3651 self
3652 }
3653
3654 /// Sets the value of [revocation_details][crate::model::Certificate::revocation_details].
3655 ///
3656 /// # Example
3657 /// ```ignore,no_run
3658 /// # use google_cloud_security_privateca_v1::model::Certificate;
3659 /// use google_cloud_security_privateca_v1::model::certificate::RevocationDetails;
3660 /// let x = Certificate::new().set_revocation_details(RevocationDetails::default()/* use setters */);
3661 /// ```
3662 pub fn set_revocation_details<T>(mut self, v: T) -> Self
3663 where
3664 T: std::convert::Into<crate::model::certificate::RevocationDetails>,
3665 {
3666 self.revocation_details = std::option::Option::Some(v.into());
3667 self
3668 }
3669
3670 /// Sets or clears the value of [revocation_details][crate::model::Certificate::revocation_details].
3671 ///
3672 /// # Example
3673 /// ```ignore,no_run
3674 /// # use google_cloud_security_privateca_v1::model::Certificate;
3675 /// use google_cloud_security_privateca_v1::model::certificate::RevocationDetails;
3676 /// let x = Certificate::new().set_or_clear_revocation_details(Some(RevocationDetails::default()/* use setters */));
3677 /// let x = Certificate::new().set_or_clear_revocation_details(None::<RevocationDetails>);
3678 /// ```
3679 pub fn set_or_clear_revocation_details<T>(mut self, v: std::option::Option<T>) -> Self
3680 where
3681 T: std::convert::Into<crate::model::certificate::RevocationDetails>,
3682 {
3683 self.revocation_details = v.map(|x| x.into());
3684 self
3685 }
3686
3687 /// Sets the value of [pem_certificate][crate::model::Certificate::pem_certificate].
3688 ///
3689 /// # Example
3690 /// ```ignore,no_run
3691 /// # use google_cloud_security_privateca_v1::model::Certificate;
3692 /// let x = Certificate::new().set_pem_certificate("example");
3693 /// ```
3694 pub fn set_pem_certificate<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3695 self.pem_certificate = v.into();
3696 self
3697 }
3698
3699 /// Sets the value of [certificate_description][crate::model::Certificate::certificate_description].
3700 ///
3701 /// # Example
3702 /// ```ignore,no_run
3703 /// # use google_cloud_security_privateca_v1::model::Certificate;
3704 /// use google_cloud_security_privateca_v1::model::CertificateDescription;
3705 /// let x = Certificate::new().set_certificate_description(CertificateDescription::default()/* use setters */);
3706 /// ```
3707 pub fn set_certificate_description<T>(mut self, v: T) -> Self
3708 where
3709 T: std::convert::Into<crate::model::CertificateDescription>,
3710 {
3711 self.certificate_description = std::option::Option::Some(v.into());
3712 self
3713 }
3714
3715 /// Sets or clears the value of [certificate_description][crate::model::Certificate::certificate_description].
3716 ///
3717 /// # Example
3718 /// ```ignore,no_run
3719 /// # use google_cloud_security_privateca_v1::model::Certificate;
3720 /// use google_cloud_security_privateca_v1::model::CertificateDescription;
3721 /// let x = Certificate::new().set_or_clear_certificate_description(Some(CertificateDescription::default()/* use setters */));
3722 /// let x = Certificate::new().set_or_clear_certificate_description(None::<CertificateDescription>);
3723 /// ```
3724 pub fn set_or_clear_certificate_description<T>(mut self, v: std::option::Option<T>) -> Self
3725 where
3726 T: std::convert::Into<crate::model::CertificateDescription>,
3727 {
3728 self.certificate_description = v.map(|x| x.into());
3729 self
3730 }
3731
3732 /// Sets the value of [pem_certificate_chain][crate::model::Certificate::pem_certificate_chain].
3733 ///
3734 /// # Example
3735 /// ```ignore,no_run
3736 /// # use google_cloud_security_privateca_v1::model::Certificate;
3737 /// let x = Certificate::new().set_pem_certificate_chain(["a", "b", "c"]);
3738 /// ```
3739 pub fn set_pem_certificate_chain<T, V>(mut self, v: T) -> Self
3740 where
3741 T: std::iter::IntoIterator<Item = V>,
3742 V: std::convert::Into<std::string::String>,
3743 {
3744 use std::iter::Iterator;
3745 self.pem_certificate_chain = v.into_iter().map(|i| i.into()).collect();
3746 self
3747 }
3748
3749 /// Sets the value of [create_time][crate::model::Certificate::create_time].
3750 ///
3751 /// # Example
3752 /// ```ignore,no_run
3753 /// # use google_cloud_security_privateca_v1::model::Certificate;
3754 /// use wkt::Timestamp;
3755 /// let x = Certificate::new().set_create_time(Timestamp::default()/* use setters */);
3756 /// ```
3757 pub fn set_create_time<T>(mut self, v: T) -> Self
3758 where
3759 T: std::convert::Into<wkt::Timestamp>,
3760 {
3761 self.create_time = std::option::Option::Some(v.into());
3762 self
3763 }
3764
3765 /// Sets or clears the value of [create_time][crate::model::Certificate::create_time].
3766 ///
3767 /// # Example
3768 /// ```ignore,no_run
3769 /// # use google_cloud_security_privateca_v1::model::Certificate;
3770 /// use wkt::Timestamp;
3771 /// let x = Certificate::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
3772 /// let x = Certificate::new().set_or_clear_create_time(None::<Timestamp>);
3773 /// ```
3774 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
3775 where
3776 T: std::convert::Into<wkt::Timestamp>,
3777 {
3778 self.create_time = v.map(|x| x.into());
3779 self
3780 }
3781
3782 /// Sets the value of [update_time][crate::model::Certificate::update_time].
3783 ///
3784 /// # Example
3785 /// ```ignore,no_run
3786 /// # use google_cloud_security_privateca_v1::model::Certificate;
3787 /// use wkt::Timestamp;
3788 /// let x = Certificate::new().set_update_time(Timestamp::default()/* use setters */);
3789 /// ```
3790 pub fn set_update_time<T>(mut self, v: T) -> Self
3791 where
3792 T: std::convert::Into<wkt::Timestamp>,
3793 {
3794 self.update_time = std::option::Option::Some(v.into());
3795 self
3796 }
3797
3798 /// Sets or clears the value of [update_time][crate::model::Certificate::update_time].
3799 ///
3800 /// # Example
3801 /// ```ignore,no_run
3802 /// # use google_cloud_security_privateca_v1::model::Certificate;
3803 /// use wkt::Timestamp;
3804 /// let x = Certificate::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
3805 /// let x = Certificate::new().set_or_clear_update_time(None::<Timestamp>);
3806 /// ```
3807 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
3808 where
3809 T: std::convert::Into<wkt::Timestamp>,
3810 {
3811 self.update_time = v.map(|x| x.into());
3812 self
3813 }
3814
3815 /// Sets the value of [labels][crate::model::Certificate::labels].
3816 ///
3817 /// # Example
3818 /// ```ignore,no_run
3819 /// # use google_cloud_security_privateca_v1::model::Certificate;
3820 /// let x = Certificate::new().set_labels([
3821 /// ("key0", "abc"),
3822 /// ("key1", "xyz"),
3823 /// ]);
3824 /// ```
3825 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
3826 where
3827 T: std::iter::IntoIterator<Item = (K, V)>,
3828 K: std::convert::Into<std::string::String>,
3829 V: std::convert::Into<std::string::String>,
3830 {
3831 use std::iter::Iterator;
3832 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
3833 self
3834 }
3835
3836 /// Sets the value of [certificate_config][crate::model::Certificate::certificate_config].
3837 ///
3838 /// Note that all the setters affecting `certificate_config` are mutually
3839 /// exclusive.
3840 ///
3841 /// # Example
3842 /// ```ignore,no_run
3843 /// # use google_cloud_security_privateca_v1::model::Certificate;
3844 /// use google_cloud_security_privateca_v1::model::certificate::CertificateConfig;
3845 /// let x = Certificate::new().set_certificate_config(Some(CertificateConfig::PemCsr("example".to_string())));
3846 /// ```
3847 pub fn set_certificate_config<
3848 T: std::convert::Into<std::option::Option<crate::model::certificate::CertificateConfig>>,
3849 >(
3850 mut self,
3851 v: T,
3852 ) -> Self {
3853 self.certificate_config = v.into();
3854 self
3855 }
3856
3857 /// The value of [certificate_config][crate::model::Certificate::certificate_config]
3858 /// if it holds a `PemCsr`, `None` if the field is not set or
3859 /// holds a different branch.
3860 pub fn pem_csr(&self) -> std::option::Option<&std::string::String> {
3861 #[allow(unreachable_patterns)]
3862 self.certificate_config.as_ref().and_then(|v| match v {
3863 crate::model::certificate::CertificateConfig::PemCsr(v) => std::option::Option::Some(v),
3864 _ => std::option::Option::None,
3865 })
3866 }
3867
3868 /// Sets the value of [certificate_config][crate::model::Certificate::certificate_config]
3869 /// to hold a `PemCsr`.
3870 ///
3871 /// Note that all the setters affecting `certificate_config` are
3872 /// mutually exclusive.
3873 ///
3874 /// # Example
3875 /// ```ignore,no_run
3876 /// # use google_cloud_security_privateca_v1::model::Certificate;
3877 /// let x = Certificate::new().set_pem_csr("example");
3878 /// assert!(x.pem_csr().is_some());
3879 /// assert!(x.config().is_none());
3880 /// ```
3881 pub fn set_pem_csr<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3882 self.certificate_config = std::option::Option::Some(
3883 crate::model::certificate::CertificateConfig::PemCsr(v.into()),
3884 );
3885 self
3886 }
3887
3888 /// The value of [certificate_config][crate::model::Certificate::certificate_config]
3889 /// if it holds a `Config`, `None` if the field is not set or
3890 /// holds a different branch.
3891 pub fn config(&self) -> std::option::Option<&std::boxed::Box<crate::model::CertificateConfig>> {
3892 #[allow(unreachable_patterns)]
3893 self.certificate_config.as_ref().and_then(|v| match v {
3894 crate::model::certificate::CertificateConfig::Config(v) => std::option::Option::Some(v),
3895 _ => std::option::Option::None,
3896 })
3897 }
3898
3899 /// Sets the value of [certificate_config][crate::model::Certificate::certificate_config]
3900 /// to hold a `Config`.
3901 ///
3902 /// Note that all the setters affecting `certificate_config` are
3903 /// mutually exclusive.
3904 ///
3905 /// # Example
3906 /// ```ignore,no_run
3907 /// # use google_cloud_security_privateca_v1::model::Certificate;
3908 /// use google_cloud_security_privateca_v1::model::CertificateConfig;
3909 /// let x = Certificate::new().set_config(CertificateConfig::default()/* use setters */);
3910 /// assert!(x.config().is_some());
3911 /// assert!(x.pem_csr().is_none());
3912 /// ```
3913 pub fn set_config<T: std::convert::Into<std::boxed::Box<crate::model::CertificateConfig>>>(
3914 mut self,
3915 v: T,
3916 ) -> Self {
3917 self.certificate_config = std::option::Option::Some(
3918 crate::model::certificate::CertificateConfig::Config(v.into()),
3919 );
3920 self
3921 }
3922}
3923
3924impl wkt::message::Message for Certificate {
3925 fn typename() -> &'static str {
3926 "type.googleapis.com/google.cloud.security.privateca.v1.Certificate"
3927 }
3928}
3929
3930/// Defines additional types related to [Certificate].
3931pub mod certificate {
3932 #[allow(unused_imports)]
3933 use super::*;
3934
3935 /// Describes fields that are relavent to the revocation of a
3936 /// [Certificate][google.cloud.security.privateca.v1.Certificate].
3937 ///
3938 /// [google.cloud.security.privateca.v1.Certificate]: crate::model::Certificate
3939 #[derive(Clone, Default, PartialEq)]
3940 #[non_exhaustive]
3941 pub struct RevocationDetails {
3942 /// Indicates why a
3943 /// [Certificate][google.cloud.security.privateca.v1.Certificate] was
3944 /// revoked.
3945 ///
3946 /// [google.cloud.security.privateca.v1.Certificate]: crate::model::Certificate
3947 pub revocation_state: crate::model::RevocationReason,
3948
3949 /// The time at which this
3950 /// [Certificate][google.cloud.security.privateca.v1.Certificate] was
3951 /// revoked.
3952 ///
3953 /// [google.cloud.security.privateca.v1.Certificate]: crate::model::Certificate
3954 pub revocation_time: std::option::Option<wkt::Timestamp>,
3955
3956 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3957 }
3958
3959 impl RevocationDetails {
3960 pub fn new() -> Self {
3961 std::default::Default::default()
3962 }
3963
3964 /// Sets the value of [revocation_state][crate::model::certificate::RevocationDetails::revocation_state].
3965 ///
3966 /// # Example
3967 /// ```ignore,no_run
3968 /// # use google_cloud_security_privateca_v1::model::certificate::RevocationDetails;
3969 /// use google_cloud_security_privateca_v1::model::RevocationReason;
3970 /// let x0 = RevocationDetails::new().set_revocation_state(RevocationReason::KeyCompromise);
3971 /// let x1 = RevocationDetails::new().set_revocation_state(RevocationReason::CertificateAuthorityCompromise);
3972 /// let x2 = RevocationDetails::new().set_revocation_state(RevocationReason::AffiliationChanged);
3973 /// ```
3974 pub fn set_revocation_state<T: std::convert::Into<crate::model::RevocationReason>>(
3975 mut self,
3976 v: T,
3977 ) -> Self {
3978 self.revocation_state = v.into();
3979 self
3980 }
3981
3982 /// Sets the value of [revocation_time][crate::model::certificate::RevocationDetails::revocation_time].
3983 ///
3984 /// # Example
3985 /// ```ignore,no_run
3986 /// # use google_cloud_security_privateca_v1::model::certificate::RevocationDetails;
3987 /// use wkt::Timestamp;
3988 /// let x = RevocationDetails::new().set_revocation_time(Timestamp::default()/* use setters */);
3989 /// ```
3990 pub fn set_revocation_time<T>(mut self, v: T) -> Self
3991 where
3992 T: std::convert::Into<wkt::Timestamp>,
3993 {
3994 self.revocation_time = std::option::Option::Some(v.into());
3995 self
3996 }
3997
3998 /// Sets or clears the value of [revocation_time][crate::model::certificate::RevocationDetails::revocation_time].
3999 ///
4000 /// # Example
4001 /// ```ignore,no_run
4002 /// # use google_cloud_security_privateca_v1::model::certificate::RevocationDetails;
4003 /// use wkt::Timestamp;
4004 /// let x = RevocationDetails::new().set_or_clear_revocation_time(Some(Timestamp::default()/* use setters */));
4005 /// let x = RevocationDetails::new().set_or_clear_revocation_time(None::<Timestamp>);
4006 /// ```
4007 pub fn set_or_clear_revocation_time<T>(mut self, v: std::option::Option<T>) -> Self
4008 where
4009 T: std::convert::Into<wkt::Timestamp>,
4010 {
4011 self.revocation_time = v.map(|x| x.into());
4012 self
4013 }
4014 }
4015
4016 impl wkt::message::Message for RevocationDetails {
4017 fn typename() -> &'static str {
4018 "type.googleapis.com/google.cloud.security.privateca.v1.Certificate.RevocationDetails"
4019 }
4020 }
4021
4022 /// The config used to create a signed X.509 certificate.
4023 #[derive(Clone, Debug, PartialEq)]
4024 #[non_exhaustive]
4025 pub enum CertificateConfig {
4026 /// Immutable. A pem-encoded X.509 certificate signing request (CSR).
4027 PemCsr(std::string::String),
4028 /// Immutable. A description of the certificate and key that does not require
4029 /// X.509 or ASN.1.
4030 Config(std::boxed::Box<crate::model::CertificateConfig>),
4031 }
4032}
4033
4034/// A
4035/// [CertificateTemplate][google.cloud.security.privateca.v1.CertificateTemplate]
4036/// refers to a managed template for certificate issuance.
4037///
4038/// [google.cloud.security.privateca.v1.CertificateTemplate]: crate::model::CertificateTemplate
4039#[derive(Clone, Default, PartialEq)]
4040#[non_exhaustive]
4041pub struct CertificateTemplate {
4042 /// Identifier. The resource name for this
4043 /// [CertificateTemplate][google.cloud.security.privateca.v1.CertificateTemplate]
4044 /// in the format `projects/*/locations/*/certificateTemplates/*`.
4045 ///
4046 /// [google.cloud.security.privateca.v1.CertificateTemplate]: crate::model::CertificateTemplate
4047 pub name: std::string::String,
4048
4049 /// Optional. The maximum lifetime allowed for issued
4050 /// [Certificates][google.cloud.security.privateca.v1.Certificate] that use
4051 /// this template. If the issuing
4052 /// [CaPool][google.cloud.security.privateca.v1.CaPool] resource's
4053 /// [IssuancePolicy][google.cloud.security.privateca.v1.CaPool.IssuancePolicy]
4054 /// specifies a
4055 /// [maximum_lifetime][google.cloud.security.privateca.v1.CaPool.IssuancePolicy.maximum_lifetime]
4056 /// the minimum of the two durations will be the maximum lifetime for issued
4057 /// [Certificates][google.cloud.security.privateca.v1.Certificate]. Note that
4058 /// if the issuing
4059 /// [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]
4060 /// expires before a
4061 /// [Certificate][google.cloud.security.privateca.v1.Certificate]'s requested
4062 /// maximum_lifetime, the effective lifetime will be explicitly truncated
4063 /// to match it.
4064 ///
4065 /// [google.cloud.security.privateca.v1.CaPool]: crate::model::CaPool
4066 /// [google.cloud.security.privateca.v1.CaPool.IssuancePolicy]: crate::model::ca_pool::IssuancePolicy
4067 /// [google.cloud.security.privateca.v1.CaPool.IssuancePolicy.maximum_lifetime]: crate::model::ca_pool::IssuancePolicy::maximum_lifetime
4068 /// [google.cloud.security.privateca.v1.Certificate]: crate::model::Certificate
4069 /// [google.cloud.security.privateca.v1.CertificateAuthority]: crate::model::CertificateAuthority
4070 pub maximum_lifetime: std::option::Option<wkt::Duration>,
4071
4072 /// Optional. A set of X.509 values that will be applied to all issued
4073 /// certificates that use this template. If the certificate request includes
4074 /// conflicting values for the same properties, they will be overwritten by the
4075 /// values defined here. If the issuing
4076 /// [CaPool][google.cloud.security.privateca.v1.CaPool]'s
4077 /// [IssuancePolicy][google.cloud.security.privateca.v1.CaPool.IssuancePolicy]
4078 /// defines conflicting
4079 /// [baseline_values][google.cloud.security.privateca.v1.CaPool.IssuancePolicy.baseline_values]
4080 /// for the same properties, the certificate issuance request will fail.
4081 ///
4082 /// [google.cloud.security.privateca.v1.CaPool]: crate::model::CaPool
4083 /// [google.cloud.security.privateca.v1.CaPool.IssuancePolicy]: crate::model::ca_pool::IssuancePolicy
4084 /// [google.cloud.security.privateca.v1.CaPool.IssuancePolicy.baseline_values]: crate::model::ca_pool::IssuancePolicy::baseline_values
4085 pub predefined_values: std::option::Option<crate::model::X509Parameters>,
4086
4087 /// Optional. Describes constraints on identities that may be appear in
4088 /// [Certificates][google.cloud.security.privateca.v1.Certificate] issued using
4089 /// this template. If this is omitted, then this template will not add
4090 /// restrictions on a certificate's identity.
4091 ///
4092 /// [google.cloud.security.privateca.v1.Certificate]: crate::model::Certificate
4093 pub identity_constraints: std::option::Option<crate::model::CertificateIdentityConstraints>,
4094
4095 /// Optional. Describes the set of X.509 extensions that may appear in a
4096 /// [Certificate][google.cloud.security.privateca.v1.Certificate] issued using
4097 /// this
4098 /// [CertificateTemplate][google.cloud.security.privateca.v1.CertificateTemplate].
4099 /// If a certificate request sets extensions that don't appear in the
4100 /// [passthrough_extensions][google.cloud.security.privateca.v1.CertificateTemplate.passthrough_extensions],
4101 /// those extensions will be dropped. If the issuing
4102 /// [CaPool][google.cloud.security.privateca.v1.CaPool]'s
4103 /// [IssuancePolicy][google.cloud.security.privateca.v1.CaPool.IssuancePolicy]
4104 /// defines
4105 /// [baseline_values][google.cloud.security.privateca.v1.CaPool.IssuancePolicy.baseline_values]
4106 /// that don't appear here, the certificate issuance request will fail. If this
4107 /// is omitted, then this template will not add restrictions on a certificate's
4108 /// X.509 extensions. These constraints do not apply to X.509 extensions set in
4109 /// this
4110 /// [CertificateTemplate][google.cloud.security.privateca.v1.CertificateTemplate]'s
4111 /// [predefined_values][google.cloud.security.privateca.v1.CertificateTemplate.predefined_values].
4112 ///
4113 /// [google.cloud.security.privateca.v1.CaPool]: crate::model::CaPool
4114 /// [google.cloud.security.privateca.v1.CaPool.IssuancePolicy]: crate::model::ca_pool::IssuancePolicy
4115 /// [google.cloud.security.privateca.v1.CaPool.IssuancePolicy.baseline_values]: crate::model::ca_pool::IssuancePolicy::baseline_values
4116 /// [google.cloud.security.privateca.v1.Certificate]: crate::model::Certificate
4117 /// [google.cloud.security.privateca.v1.CertificateTemplate]: crate::model::CertificateTemplate
4118 /// [google.cloud.security.privateca.v1.CertificateTemplate.passthrough_extensions]: crate::model::CertificateTemplate::passthrough_extensions
4119 /// [google.cloud.security.privateca.v1.CertificateTemplate.predefined_values]: crate::model::CertificateTemplate::predefined_values
4120 pub passthrough_extensions: std::option::Option<crate::model::CertificateExtensionConstraints>,
4121
4122 /// Optional. A human-readable description of scenarios this template is
4123 /// intended for.
4124 pub description: std::string::String,
4125
4126 /// Output only. The time at which this
4127 /// [CertificateTemplate][google.cloud.security.privateca.v1.CertificateTemplate]
4128 /// was created.
4129 ///
4130 /// [google.cloud.security.privateca.v1.CertificateTemplate]: crate::model::CertificateTemplate
4131 pub create_time: std::option::Option<wkt::Timestamp>,
4132
4133 /// Output only. The time at which this
4134 /// [CertificateTemplate][google.cloud.security.privateca.v1.CertificateTemplate]
4135 /// was updated.
4136 ///
4137 /// [google.cloud.security.privateca.v1.CertificateTemplate]: crate::model::CertificateTemplate
4138 pub update_time: std::option::Option<wkt::Timestamp>,
4139
4140 /// Optional. Labels with user-defined metadata.
4141 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
4142
4143 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4144}
4145
4146impl CertificateTemplate {
4147 pub fn new() -> Self {
4148 std::default::Default::default()
4149 }
4150
4151 /// Sets the value of [name][crate::model::CertificateTemplate::name].
4152 ///
4153 /// # Example
4154 /// ```ignore,no_run
4155 /// # use google_cloud_security_privateca_v1::model::CertificateTemplate;
4156 /// let x = CertificateTemplate::new().set_name("example");
4157 /// ```
4158 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4159 self.name = v.into();
4160 self
4161 }
4162
4163 /// Sets the value of [maximum_lifetime][crate::model::CertificateTemplate::maximum_lifetime].
4164 ///
4165 /// # Example
4166 /// ```ignore,no_run
4167 /// # use google_cloud_security_privateca_v1::model::CertificateTemplate;
4168 /// use wkt::Duration;
4169 /// let x = CertificateTemplate::new().set_maximum_lifetime(Duration::default()/* use setters */);
4170 /// ```
4171 pub fn set_maximum_lifetime<T>(mut self, v: T) -> Self
4172 where
4173 T: std::convert::Into<wkt::Duration>,
4174 {
4175 self.maximum_lifetime = std::option::Option::Some(v.into());
4176 self
4177 }
4178
4179 /// Sets or clears the value of [maximum_lifetime][crate::model::CertificateTemplate::maximum_lifetime].
4180 ///
4181 /// # Example
4182 /// ```ignore,no_run
4183 /// # use google_cloud_security_privateca_v1::model::CertificateTemplate;
4184 /// use wkt::Duration;
4185 /// let x = CertificateTemplate::new().set_or_clear_maximum_lifetime(Some(Duration::default()/* use setters */));
4186 /// let x = CertificateTemplate::new().set_or_clear_maximum_lifetime(None::<Duration>);
4187 /// ```
4188 pub fn set_or_clear_maximum_lifetime<T>(mut self, v: std::option::Option<T>) -> Self
4189 where
4190 T: std::convert::Into<wkt::Duration>,
4191 {
4192 self.maximum_lifetime = v.map(|x| x.into());
4193 self
4194 }
4195
4196 /// Sets the value of [predefined_values][crate::model::CertificateTemplate::predefined_values].
4197 ///
4198 /// # Example
4199 /// ```ignore,no_run
4200 /// # use google_cloud_security_privateca_v1::model::CertificateTemplate;
4201 /// use google_cloud_security_privateca_v1::model::X509Parameters;
4202 /// let x = CertificateTemplate::new().set_predefined_values(X509Parameters::default()/* use setters */);
4203 /// ```
4204 pub fn set_predefined_values<T>(mut self, v: T) -> Self
4205 where
4206 T: std::convert::Into<crate::model::X509Parameters>,
4207 {
4208 self.predefined_values = std::option::Option::Some(v.into());
4209 self
4210 }
4211
4212 /// Sets or clears the value of [predefined_values][crate::model::CertificateTemplate::predefined_values].
4213 ///
4214 /// # Example
4215 /// ```ignore,no_run
4216 /// # use google_cloud_security_privateca_v1::model::CertificateTemplate;
4217 /// use google_cloud_security_privateca_v1::model::X509Parameters;
4218 /// let x = CertificateTemplate::new().set_or_clear_predefined_values(Some(X509Parameters::default()/* use setters */));
4219 /// let x = CertificateTemplate::new().set_or_clear_predefined_values(None::<X509Parameters>);
4220 /// ```
4221 pub fn set_or_clear_predefined_values<T>(mut self, v: std::option::Option<T>) -> Self
4222 where
4223 T: std::convert::Into<crate::model::X509Parameters>,
4224 {
4225 self.predefined_values = v.map(|x| x.into());
4226 self
4227 }
4228
4229 /// Sets the value of [identity_constraints][crate::model::CertificateTemplate::identity_constraints].
4230 ///
4231 /// # Example
4232 /// ```ignore,no_run
4233 /// # use google_cloud_security_privateca_v1::model::CertificateTemplate;
4234 /// use google_cloud_security_privateca_v1::model::CertificateIdentityConstraints;
4235 /// let x = CertificateTemplate::new().set_identity_constraints(CertificateIdentityConstraints::default()/* use setters */);
4236 /// ```
4237 pub fn set_identity_constraints<T>(mut self, v: T) -> Self
4238 where
4239 T: std::convert::Into<crate::model::CertificateIdentityConstraints>,
4240 {
4241 self.identity_constraints = std::option::Option::Some(v.into());
4242 self
4243 }
4244
4245 /// Sets or clears the value of [identity_constraints][crate::model::CertificateTemplate::identity_constraints].
4246 ///
4247 /// # Example
4248 /// ```ignore,no_run
4249 /// # use google_cloud_security_privateca_v1::model::CertificateTemplate;
4250 /// use google_cloud_security_privateca_v1::model::CertificateIdentityConstraints;
4251 /// let x = CertificateTemplate::new().set_or_clear_identity_constraints(Some(CertificateIdentityConstraints::default()/* use setters */));
4252 /// let x = CertificateTemplate::new().set_or_clear_identity_constraints(None::<CertificateIdentityConstraints>);
4253 /// ```
4254 pub fn set_or_clear_identity_constraints<T>(mut self, v: std::option::Option<T>) -> Self
4255 where
4256 T: std::convert::Into<crate::model::CertificateIdentityConstraints>,
4257 {
4258 self.identity_constraints = v.map(|x| x.into());
4259 self
4260 }
4261
4262 /// Sets the value of [passthrough_extensions][crate::model::CertificateTemplate::passthrough_extensions].
4263 ///
4264 /// # Example
4265 /// ```ignore,no_run
4266 /// # use google_cloud_security_privateca_v1::model::CertificateTemplate;
4267 /// use google_cloud_security_privateca_v1::model::CertificateExtensionConstraints;
4268 /// let x = CertificateTemplate::new().set_passthrough_extensions(CertificateExtensionConstraints::default()/* use setters */);
4269 /// ```
4270 pub fn set_passthrough_extensions<T>(mut self, v: T) -> Self
4271 where
4272 T: std::convert::Into<crate::model::CertificateExtensionConstraints>,
4273 {
4274 self.passthrough_extensions = std::option::Option::Some(v.into());
4275 self
4276 }
4277
4278 /// Sets or clears the value of [passthrough_extensions][crate::model::CertificateTemplate::passthrough_extensions].
4279 ///
4280 /// # Example
4281 /// ```ignore,no_run
4282 /// # use google_cloud_security_privateca_v1::model::CertificateTemplate;
4283 /// use google_cloud_security_privateca_v1::model::CertificateExtensionConstraints;
4284 /// let x = CertificateTemplate::new().set_or_clear_passthrough_extensions(Some(CertificateExtensionConstraints::default()/* use setters */));
4285 /// let x = CertificateTemplate::new().set_or_clear_passthrough_extensions(None::<CertificateExtensionConstraints>);
4286 /// ```
4287 pub fn set_or_clear_passthrough_extensions<T>(mut self, v: std::option::Option<T>) -> Self
4288 where
4289 T: std::convert::Into<crate::model::CertificateExtensionConstraints>,
4290 {
4291 self.passthrough_extensions = v.map(|x| x.into());
4292 self
4293 }
4294
4295 /// Sets the value of [description][crate::model::CertificateTemplate::description].
4296 ///
4297 /// # Example
4298 /// ```ignore,no_run
4299 /// # use google_cloud_security_privateca_v1::model::CertificateTemplate;
4300 /// let x = CertificateTemplate::new().set_description("example");
4301 /// ```
4302 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4303 self.description = v.into();
4304 self
4305 }
4306
4307 /// Sets the value of [create_time][crate::model::CertificateTemplate::create_time].
4308 ///
4309 /// # Example
4310 /// ```ignore,no_run
4311 /// # use google_cloud_security_privateca_v1::model::CertificateTemplate;
4312 /// use wkt::Timestamp;
4313 /// let x = CertificateTemplate::new().set_create_time(Timestamp::default()/* use setters */);
4314 /// ```
4315 pub fn set_create_time<T>(mut self, v: T) -> Self
4316 where
4317 T: std::convert::Into<wkt::Timestamp>,
4318 {
4319 self.create_time = std::option::Option::Some(v.into());
4320 self
4321 }
4322
4323 /// Sets or clears the value of [create_time][crate::model::CertificateTemplate::create_time].
4324 ///
4325 /// # Example
4326 /// ```ignore,no_run
4327 /// # use google_cloud_security_privateca_v1::model::CertificateTemplate;
4328 /// use wkt::Timestamp;
4329 /// let x = CertificateTemplate::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
4330 /// let x = CertificateTemplate::new().set_or_clear_create_time(None::<Timestamp>);
4331 /// ```
4332 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
4333 where
4334 T: std::convert::Into<wkt::Timestamp>,
4335 {
4336 self.create_time = v.map(|x| x.into());
4337 self
4338 }
4339
4340 /// Sets the value of [update_time][crate::model::CertificateTemplate::update_time].
4341 ///
4342 /// # Example
4343 /// ```ignore,no_run
4344 /// # use google_cloud_security_privateca_v1::model::CertificateTemplate;
4345 /// use wkt::Timestamp;
4346 /// let x = CertificateTemplate::new().set_update_time(Timestamp::default()/* use setters */);
4347 /// ```
4348 pub fn set_update_time<T>(mut self, v: T) -> Self
4349 where
4350 T: std::convert::Into<wkt::Timestamp>,
4351 {
4352 self.update_time = std::option::Option::Some(v.into());
4353 self
4354 }
4355
4356 /// Sets or clears the value of [update_time][crate::model::CertificateTemplate::update_time].
4357 ///
4358 /// # Example
4359 /// ```ignore,no_run
4360 /// # use google_cloud_security_privateca_v1::model::CertificateTemplate;
4361 /// use wkt::Timestamp;
4362 /// let x = CertificateTemplate::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
4363 /// let x = CertificateTemplate::new().set_or_clear_update_time(None::<Timestamp>);
4364 /// ```
4365 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
4366 where
4367 T: std::convert::Into<wkt::Timestamp>,
4368 {
4369 self.update_time = v.map(|x| x.into());
4370 self
4371 }
4372
4373 /// Sets the value of [labels][crate::model::CertificateTemplate::labels].
4374 ///
4375 /// # Example
4376 /// ```ignore,no_run
4377 /// # use google_cloud_security_privateca_v1::model::CertificateTemplate;
4378 /// let x = CertificateTemplate::new().set_labels([
4379 /// ("key0", "abc"),
4380 /// ("key1", "xyz"),
4381 /// ]);
4382 /// ```
4383 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
4384 where
4385 T: std::iter::IntoIterator<Item = (K, V)>,
4386 K: std::convert::Into<std::string::String>,
4387 V: std::convert::Into<std::string::String>,
4388 {
4389 use std::iter::Iterator;
4390 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
4391 self
4392 }
4393}
4394
4395impl wkt::message::Message for CertificateTemplate {
4396 fn typename() -> &'static str {
4397 "type.googleapis.com/google.cloud.security.privateca.v1.CertificateTemplate"
4398 }
4399}
4400
4401/// An [X509Parameters][google.cloud.security.privateca.v1.X509Parameters] is
4402/// used to describe certain fields of an X.509 certificate, such as the key
4403/// usage fields, fields specific to CA certificates, certificate policy
4404/// extensions and custom extensions.
4405///
4406/// [google.cloud.security.privateca.v1.X509Parameters]: crate::model::X509Parameters
4407#[derive(Clone, Default, PartialEq)]
4408#[non_exhaustive]
4409pub struct X509Parameters {
4410 /// Optional. Indicates the intended use for keys that correspond to a
4411 /// certificate.
4412 pub key_usage: std::option::Option<crate::model::KeyUsage>,
4413
4414 /// Optional. Describes options in this
4415 /// [X509Parameters][google.cloud.security.privateca.v1.X509Parameters] that
4416 /// are relevant in a CA certificate. If not specified, a default basic
4417 /// constraints extension with `is_ca=false` will be added for leaf
4418 /// certificates.
4419 ///
4420 /// [google.cloud.security.privateca.v1.X509Parameters]: crate::model::X509Parameters
4421 pub ca_options: std::option::Option<crate::model::x_509_parameters::CaOptions>,
4422
4423 /// Optional. Describes the X.509 certificate policy object identifiers, per
4424 /// <https://tools.ietf.org/html/rfc5280#section-4.2.1.4>.
4425 pub policy_ids: std::vec::Vec<crate::model::ObjectId>,
4426
4427 /// Optional. Describes Online Certificate Status Protocol (OCSP) endpoint
4428 /// addresses that appear in the "Authority Information Access" extension in
4429 /// the certificate.
4430 pub aia_ocsp_servers: std::vec::Vec<std::string::String>,
4431
4432 /// Optional. Describes the X.509 name constraints extension.
4433 pub name_constraints: std::option::Option<crate::model::x_509_parameters::NameConstraints>,
4434
4435 /// Optional. Describes custom X.509 extensions.
4436 pub additional_extensions: std::vec::Vec<crate::model::X509Extension>,
4437
4438 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4439}
4440
4441impl X509Parameters {
4442 pub fn new() -> Self {
4443 std::default::Default::default()
4444 }
4445
4446 /// Sets the value of [key_usage][crate::model::X509Parameters::key_usage].
4447 ///
4448 /// # Example
4449 /// ```ignore,no_run
4450 /// # use google_cloud_security_privateca_v1::model::X509Parameters;
4451 /// use google_cloud_security_privateca_v1::model::KeyUsage;
4452 /// let x = X509Parameters::new().set_key_usage(KeyUsage::default()/* use setters */);
4453 /// ```
4454 pub fn set_key_usage<T>(mut self, v: T) -> Self
4455 where
4456 T: std::convert::Into<crate::model::KeyUsage>,
4457 {
4458 self.key_usage = std::option::Option::Some(v.into());
4459 self
4460 }
4461
4462 /// Sets or clears the value of [key_usage][crate::model::X509Parameters::key_usage].
4463 ///
4464 /// # Example
4465 /// ```ignore,no_run
4466 /// # use google_cloud_security_privateca_v1::model::X509Parameters;
4467 /// use google_cloud_security_privateca_v1::model::KeyUsage;
4468 /// let x = X509Parameters::new().set_or_clear_key_usage(Some(KeyUsage::default()/* use setters */));
4469 /// let x = X509Parameters::new().set_or_clear_key_usage(None::<KeyUsage>);
4470 /// ```
4471 pub fn set_or_clear_key_usage<T>(mut self, v: std::option::Option<T>) -> Self
4472 where
4473 T: std::convert::Into<crate::model::KeyUsage>,
4474 {
4475 self.key_usage = v.map(|x| x.into());
4476 self
4477 }
4478
4479 /// Sets the value of [ca_options][crate::model::X509Parameters::ca_options].
4480 ///
4481 /// # Example
4482 /// ```ignore,no_run
4483 /// # use google_cloud_security_privateca_v1::model::X509Parameters;
4484 /// use google_cloud_security_privateca_v1::model::x_509_parameters::CaOptions;
4485 /// let x = X509Parameters::new().set_ca_options(CaOptions::default()/* use setters */);
4486 /// ```
4487 pub fn set_ca_options<T>(mut self, v: T) -> Self
4488 where
4489 T: std::convert::Into<crate::model::x_509_parameters::CaOptions>,
4490 {
4491 self.ca_options = std::option::Option::Some(v.into());
4492 self
4493 }
4494
4495 /// Sets or clears the value of [ca_options][crate::model::X509Parameters::ca_options].
4496 ///
4497 /// # Example
4498 /// ```ignore,no_run
4499 /// # use google_cloud_security_privateca_v1::model::X509Parameters;
4500 /// use google_cloud_security_privateca_v1::model::x_509_parameters::CaOptions;
4501 /// let x = X509Parameters::new().set_or_clear_ca_options(Some(CaOptions::default()/* use setters */));
4502 /// let x = X509Parameters::new().set_or_clear_ca_options(None::<CaOptions>);
4503 /// ```
4504 pub fn set_or_clear_ca_options<T>(mut self, v: std::option::Option<T>) -> Self
4505 where
4506 T: std::convert::Into<crate::model::x_509_parameters::CaOptions>,
4507 {
4508 self.ca_options = v.map(|x| x.into());
4509 self
4510 }
4511
4512 /// Sets the value of [policy_ids][crate::model::X509Parameters::policy_ids].
4513 ///
4514 /// # Example
4515 /// ```ignore,no_run
4516 /// # use google_cloud_security_privateca_v1::model::X509Parameters;
4517 /// use google_cloud_security_privateca_v1::model::ObjectId;
4518 /// let x = X509Parameters::new()
4519 /// .set_policy_ids([
4520 /// ObjectId::default()/* use setters */,
4521 /// ObjectId::default()/* use (different) setters */,
4522 /// ]);
4523 /// ```
4524 pub fn set_policy_ids<T, V>(mut self, v: T) -> Self
4525 where
4526 T: std::iter::IntoIterator<Item = V>,
4527 V: std::convert::Into<crate::model::ObjectId>,
4528 {
4529 use std::iter::Iterator;
4530 self.policy_ids = v.into_iter().map(|i| i.into()).collect();
4531 self
4532 }
4533
4534 /// Sets the value of [aia_ocsp_servers][crate::model::X509Parameters::aia_ocsp_servers].
4535 ///
4536 /// # Example
4537 /// ```ignore,no_run
4538 /// # use google_cloud_security_privateca_v1::model::X509Parameters;
4539 /// let x = X509Parameters::new().set_aia_ocsp_servers(["a", "b", "c"]);
4540 /// ```
4541 pub fn set_aia_ocsp_servers<T, V>(mut self, v: T) -> Self
4542 where
4543 T: std::iter::IntoIterator<Item = V>,
4544 V: std::convert::Into<std::string::String>,
4545 {
4546 use std::iter::Iterator;
4547 self.aia_ocsp_servers = v.into_iter().map(|i| i.into()).collect();
4548 self
4549 }
4550
4551 /// Sets the value of [name_constraints][crate::model::X509Parameters::name_constraints].
4552 ///
4553 /// # Example
4554 /// ```ignore,no_run
4555 /// # use google_cloud_security_privateca_v1::model::X509Parameters;
4556 /// use google_cloud_security_privateca_v1::model::x_509_parameters::NameConstraints;
4557 /// let x = X509Parameters::new().set_name_constraints(NameConstraints::default()/* use setters */);
4558 /// ```
4559 pub fn set_name_constraints<T>(mut self, v: T) -> Self
4560 where
4561 T: std::convert::Into<crate::model::x_509_parameters::NameConstraints>,
4562 {
4563 self.name_constraints = std::option::Option::Some(v.into());
4564 self
4565 }
4566
4567 /// Sets or clears the value of [name_constraints][crate::model::X509Parameters::name_constraints].
4568 ///
4569 /// # Example
4570 /// ```ignore,no_run
4571 /// # use google_cloud_security_privateca_v1::model::X509Parameters;
4572 /// use google_cloud_security_privateca_v1::model::x_509_parameters::NameConstraints;
4573 /// let x = X509Parameters::new().set_or_clear_name_constraints(Some(NameConstraints::default()/* use setters */));
4574 /// let x = X509Parameters::new().set_or_clear_name_constraints(None::<NameConstraints>);
4575 /// ```
4576 pub fn set_or_clear_name_constraints<T>(mut self, v: std::option::Option<T>) -> Self
4577 where
4578 T: std::convert::Into<crate::model::x_509_parameters::NameConstraints>,
4579 {
4580 self.name_constraints = v.map(|x| x.into());
4581 self
4582 }
4583
4584 /// Sets the value of [additional_extensions][crate::model::X509Parameters::additional_extensions].
4585 ///
4586 /// # Example
4587 /// ```ignore,no_run
4588 /// # use google_cloud_security_privateca_v1::model::X509Parameters;
4589 /// use google_cloud_security_privateca_v1::model::X509Extension;
4590 /// let x = X509Parameters::new()
4591 /// .set_additional_extensions([
4592 /// X509Extension::default()/* use setters */,
4593 /// X509Extension::default()/* use (different) setters */,
4594 /// ]);
4595 /// ```
4596 pub fn set_additional_extensions<T, V>(mut self, v: T) -> Self
4597 where
4598 T: std::iter::IntoIterator<Item = V>,
4599 V: std::convert::Into<crate::model::X509Extension>,
4600 {
4601 use std::iter::Iterator;
4602 self.additional_extensions = v.into_iter().map(|i| i.into()).collect();
4603 self
4604 }
4605}
4606
4607impl wkt::message::Message for X509Parameters {
4608 fn typename() -> &'static str {
4609 "type.googleapis.com/google.cloud.security.privateca.v1.X509Parameters"
4610 }
4611}
4612
4613/// Defines additional types related to [X509Parameters].
4614pub mod x_509_parameters {
4615 #[allow(unused_imports)]
4616 use super::*;
4617
4618 /// Describes the X.509 basic constraints extension, per [RFC 5280
4619 /// section 4.2.1.9](https://tools.ietf.org/html/rfc5280#section-4.2.1.9)
4620 #[derive(Clone, Default, PartialEq)]
4621 #[non_exhaustive]
4622 pub struct CaOptions {
4623 /// Optional. Refers to the "CA" boolean field in the X.509 extension.
4624 /// When this value is missing, the basic constraints extension will be
4625 /// omitted from the certificate.
4626 pub is_ca: std::option::Option<bool>,
4627
4628 /// Optional. Refers to the path length constraint field in the X.509
4629 /// extension. For a CA certificate, this value describes the depth of
4630 /// subordinate CA certificates that are allowed. If this value is less than
4631 /// 0, the request will fail. If this value is missing, the max path length
4632 /// will be omitted from the certificate.
4633 pub max_issuer_path_length: std::option::Option<i32>,
4634
4635 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4636 }
4637
4638 impl CaOptions {
4639 pub fn new() -> Self {
4640 std::default::Default::default()
4641 }
4642
4643 /// Sets the value of [is_ca][crate::model::x_509_parameters::CaOptions::is_ca].
4644 ///
4645 /// # Example
4646 /// ```ignore,no_run
4647 /// # use google_cloud_security_privateca_v1::model::x_509_parameters::CaOptions;
4648 /// let x = CaOptions::new().set_is_ca(true);
4649 /// ```
4650 pub fn set_is_ca<T>(mut self, v: T) -> Self
4651 where
4652 T: std::convert::Into<bool>,
4653 {
4654 self.is_ca = std::option::Option::Some(v.into());
4655 self
4656 }
4657
4658 /// Sets or clears the value of [is_ca][crate::model::x_509_parameters::CaOptions::is_ca].
4659 ///
4660 /// # Example
4661 /// ```ignore,no_run
4662 /// # use google_cloud_security_privateca_v1::model::x_509_parameters::CaOptions;
4663 /// let x = CaOptions::new().set_or_clear_is_ca(Some(false));
4664 /// let x = CaOptions::new().set_or_clear_is_ca(None::<bool>);
4665 /// ```
4666 pub fn set_or_clear_is_ca<T>(mut self, v: std::option::Option<T>) -> Self
4667 where
4668 T: std::convert::Into<bool>,
4669 {
4670 self.is_ca = v.map(|x| x.into());
4671 self
4672 }
4673
4674 /// Sets the value of [max_issuer_path_length][crate::model::x_509_parameters::CaOptions::max_issuer_path_length].
4675 ///
4676 /// # Example
4677 /// ```ignore,no_run
4678 /// # use google_cloud_security_privateca_v1::model::x_509_parameters::CaOptions;
4679 /// let x = CaOptions::new().set_max_issuer_path_length(42);
4680 /// ```
4681 pub fn set_max_issuer_path_length<T>(mut self, v: T) -> Self
4682 where
4683 T: std::convert::Into<i32>,
4684 {
4685 self.max_issuer_path_length = std::option::Option::Some(v.into());
4686 self
4687 }
4688
4689 /// Sets or clears the value of [max_issuer_path_length][crate::model::x_509_parameters::CaOptions::max_issuer_path_length].
4690 ///
4691 /// # Example
4692 /// ```ignore,no_run
4693 /// # use google_cloud_security_privateca_v1::model::x_509_parameters::CaOptions;
4694 /// let x = CaOptions::new().set_or_clear_max_issuer_path_length(Some(42));
4695 /// let x = CaOptions::new().set_or_clear_max_issuer_path_length(None::<i32>);
4696 /// ```
4697 pub fn set_or_clear_max_issuer_path_length<T>(mut self, v: std::option::Option<T>) -> Self
4698 where
4699 T: std::convert::Into<i32>,
4700 {
4701 self.max_issuer_path_length = v.map(|x| x.into());
4702 self
4703 }
4704 }
4705
4706 impl wkt::message::Message for CaOptions {
4707 fn typename() -> &'static str {
4708 "type.googleapis.com/google.cloud.security.privateca.v1.X509Parameters.CaOptions"
4709 }
4710 }
4711
4712 /// Describes the X.509 name constraints extension, per
4713 /// <https://tools.ietf.org/html/rfc5280#section-4.2.1.10>
4714 #[derive(Clone, Default, PartialEq)]
4715 #[non_exhaustive]
4716 pub struct NameConstraints {
4717 /// Indicates whether or not the name constraints are marked critical.
4718 pub critical: bool,
4719
4720 /// Contains permitted DNS names. Any DNS name that can be
4721 /// constructed by simply adding zero or more labels to
4722 /// the left-hand side of the name satisfies the name constraint.
4723 /// For example, `example.com`, `www.example.com`, `www.sub.example.com`
4724 /// would satisfy `example.com` while `example1.com` does not.
4725 pub permitted_dns_names: std::vec::Vec<std::string::String>,
4726
4727 /// Contains excluded DNS names. Any DNS name that can be
4728 /// constructed by simply adding zero or more labels to
4729 /// the left-hand side of the name satisfies the name constraint.
4730 /// For example, `example.com`, `www.example.com`, `www.sub.example.com`
4731 /// would satisfy `example.com` while `example1.com` does not.
4732 pub excluded_dns_names: std::vec::Vec<std::string::String>,
4733
4734 /// Contains the permitted IP ranges. For IPv4 addresses, the ranges
4735 /// are expressed using CIDR notation as specified in RFC 4632.
4736 /// For IPv6 addresses, the ranges are expressed in similar encoding as IPv4
4737 /// addresses.
4738 pub permitted_ip_ranges: std::vec::Vec<std::string::String>,
4739
4740 /// Contains the excluded IP ranges. For IPv4 addresses, the ranges
4741 /// are expressed using CIDR notation as specified in RFC 4632.
4742 /// For IPv6 addresses, the ranges are expressed in similar encoding as IPv4
4743 /// addresses.
4744 pub excluded_ip_ranges: std::vec::Vec<std::string::String>,
4745
4746 /// Contains the permitted email addresses. The value can be a particular
4747 /// email address, a hostname to indicate all email addresses on that host or
4748 /// a domain with a leading period (e.g. `.example.com`) to indicate
4749 /// all email addresses in that domain.
4750 pub permitted_email_addresses: std::vec::Vec<std::string::String>,
4751
4752 /// Contains the excluded email addresses. The value can be a particular
4753 /// email address, a hostname to indicate all email addresses on that host or
4754 /// a domain with a leading period (e.g. `.example.com`) to indicate
4755 /// all email addresses in that domain.
4756 pub excluded_email_addresses: std::vec::Vec<std::string::String>,
4757
4758 /// Contains the permitted URIs that apply to the host part of the name.
4759 /// The value can be a hostname or a domain with a
4760 /// leading period (like `.example.com`)
4761 pub permitted_uris: std::vec::Vec<std::string::String>,
4762
4763 /// Contains the excluded URIs that apply to the host part of the name.
4764 /// The value can be a hostname or a domain with a
4765 /// leading period (like `.example.com`)
4766 pub excluded_uris: std::vec::Vec<std::string::String>,
4767
4768 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4769 }
4770
4771 impl NameConstraints {
4772 pub fn new() -> Self {
4773 std::default::Default::default()
4774 }
4775
4776 /// Sets the value of [critical][crate::model::x_509_parameters::NameConstraints::critical].
4777 ///
4778 /// # Example
4779 /// ```ignore,no_run
4780 /// # use google_cloud_security_privateca_v1::model::x_509_parameters::NameConstraints;
4781 /// let x = NameConstraints::new().set_critical(true);
4782 /// ```
4783 pub fn set_critical<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4784 self.critical = v.into();
4785 self
4786 }
4787
4788 /// Sets the value of [permitted_dns_names][crate::model::x_509_parameters::NameConstraints::permitted_dns_names].
4789 ///
4790 /// # Example
4791 /// ```ignore,no_run
4792 /// # use google_cloud_security_privateca_v1::model::x_509_parameters::NameConstraints;
4793 /// let x = NameConstraints::new().set_permitted_dns_names(["a", "b", "c"]);
4794 /// ```
4795 pub fn set_permitted_dns_names<T, V>(mut self, v: T) -> Self
4796 where
4797 T: std::iter::IntoIterator<Item = V>,
4798 V: std::convert::Into<std::string::String>,
4799 {
4800 use std::iter::Iterator;
4801 self.permitted_dns_names = v.into_iter().map(|i| i.into()).collect();
4802 self
4803 }
4804
4805 /// Sets the value of [excluded_dns_names][crate::model::x_509_parameters::NameConstraints::excluded_dns_names].
4806 ///
4807 /// # Example
4808 /// ```ignore,no_run
4809 /// # use google_cloud_security_privateca_v1::model::x_509_parameters::NameConstraints;
4810 /// let x = NameConstraints::new().set_excluded_dns_names(["a", "b", "c"]);
4811 /// ```
4812 pub fn set_excluded_dns_names<T, V>(mut self, v: T) -> Self
4813 where
4814 T: std::iter::IntoIterator<Item = V>,
4815 V: std::convert::Into<std::string::String>,
4816 {
4817 use std::iter::Iterator;
4818 self.excluded_dns_names = v.into_iter().map(|i| i.into()).collect();
4819 self
4820 }
4821
4822 /// Sets the value of [permitted_ip_ranges][crate::model::x_509_parameters::NameConstraints::permitted_ip_ranges].
4823 ///
4824 /// # Example
4825 /// ```ignore,no_run
4826 /// # use google_cloud_security_privateca_v1::model::x_509_parameters::NameConstraints;
4827 /// let x = NameConstraints::new().set_permitted_ip_ranges(["a", "b", "c"]);
4828 /// ```
4829 pub fn set_permitted_ip_ranges<T, V>(mut self, v: T) -> Self
4830 where
4831 T: std::iter::IntoIterator<Item = V>,
4832 V: std::convert::Into<std::string::String>,
4833 {
4834 use std::iter::Iterator;
4835 self.permitted_ip_ranges = v.into_iter().map(|i| i.into()).collect();
4836 self
4837 }
4838
4839 /// Sets the value of [excluded_ip_ranges][crate::model::x_509_parameters::NameConstraints::excluded_ip_ranges].
4840 ///
4841 /// # Example
4842 /// ```ignore,no_run
4843 /// # use google_cloud_security_privateca_v1::model::x_509_parameters::NameConstraints;
4844 /// let x = NameConstraints::new().set_excluded_ip_ranges(["a", "b", "c"]);
4845 /// ```
4846 pub fn set_excluded_ip_ranges<T, V>(mut self, v: T) -> Self
4847 where
4848 T: std::iter::IntoIterator<Item = V>,
4849 V: std::convert::Into<std::string::String>,
4850 {
4851 use std::iter::Iterator;
4852 self.excluded_ip_ranges = v.into_iter().map(|i| i.into()).collect();
4853 self
4854 }
4855
4856 /// Sets the value of [permitted_email_addresses][crate::model::x_509_parameters::NameConstraints::permitted_email_addresses].
4857 ///
4858 /// # Example
4859 /// ```ignore,no_run
4860 /// # use google_cloud_security_privateca_v1::model::x_509_parameters::NameConstraints;
4861 /// let x = NameConstraints::new().set_permitted_email_addresses(["a", "b", "c"]);
4862 /// ```
4863 pub fn set_permitted_email_addresses<T, V>(mut self, v: T) -> Self
4864 where
4865 T: std::iter::IntoIterator<Item = V>,
4866 V: std::convert::Into<std::string::String>,
4867 {
4868 use std::iter::Iterator;
4869 self.permitted_email_addresses = v.into_iter().map(|i| i.into()).collect();
4870 self
4871 }
4872
4873 /// Sets the value of [excluded_email_addresses][crate::model::x_509_parameters::NameConstraints::excluded_email_addresses].
4874 ///
4875 /// # Example
4876 /// ```ignore,no_run
4877 /// # use google_cloud_security_privateca_v1::model::x_509_parameters::NameConstraints;
4878 /// let x = NameConstraints::new().set_excluded_email_addresses(["a", "b", "c"]);
4879 /// ```
4880 pub fn set_excluded_email_addresses<T, V>(mut self, v: T) -> Self
4881 where
4882 T: std::iter::IntoIterator<Item = V>,
4883 V: std::convert::Into<std::string::String>,
4884 {
4885 use std::iter::Iterator;
4886 self.excluded_email_addresses = v.into_iter().map(|i| i.into()).collect();
4887 self
4888 }
4889
4890 /// Sets the value of [permitted_uris][crate::model::x_509_parameters::NameConstraints::permitted_uris].
4891 ///
4892 /// # Example
4893 /// ```ignore,no_run
4894 /// # use google_cloud_security_privateca_v1::model::x_509_parameters::NameConstraints;
4895 /// let x = NameConstraints::new().set_permitted_uris(["a", "b", "c"]);
4896 /// ```
4897 pub fn set_permitted_uris<T, V>(mut self, v: T) -> Self
4898 where
4899 T: std::iter::IntoIterator<Item = V>,
4900 V: std::convert::Into<std::string::String>,
4901 {
4902 use std::iter::Iterator;
4903 self.permitted_uris = v.into_iter().map(|i| i.into()).collect();
4904 self
4905 }
4906
4907 /// Sets the value of [excluded_uris][crate::model::x_509_parameters::NameConstraints::excluded_uris].
4908 ///
4909 /// # Example
4910 /// ```ignore,no_run
4911 /// # use google_cloud_security_privateca_v1::model::x_509_parameters::NameConstraints;
4912 /// let x = NameConstraints::new().set_excluded_uris(["a", "b", "c"]);
4913 /// ```
4914 pub fn set_excluded_uris<T, V>(mut self, v: T) -> Self
4915 where
4916 T: std::iter::IntoIterator<Item = V>,
4917 V: std::convert::Into<std::string::String>,
4918 {
4919 use std::iter::Iterator;
4920 self.excluded_uris = v.into_iter().map(|i| i.into()).collect();
4921 self
4922 }
4923 }
4924
4925 impl wkt::message::Message for NameConstraints {
4926 fn typename() -> &'static str {
4927 "type.googleapis.com/google.cloud.security.privateca.v1.X509Parameters.NameConstraints"
4928 }
4929 }
4930}
4931
4932/// Describes a subordinate CA's issuers. This is either a resource name to a
4933/// known issuing
4934/// [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority],
4935/// or a PEM issuer certificate chain.
4936///
4937/// [google.cloud.security.privateca.v1.CertificateAuthority]: crate::model::CertificateAuthority
4938#[derive(Clone, Default, PartialEq)]
4939#[non_exhaustive]
4940pub struct SubordinateConfig {
4941 pub subordinate_config:
4942 std::option::Option<crate::model::subordinate_config::SubordinateConfig>,
4943
4944 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4945}
4946
4947impl SubordinateConfig {
4948 pub fn new() -> Self {
4949 std::default::Default::default()
4950 }
4951
4952 /// Sets the value of [subordinate_config][crate::model::SubordinateConfig::subordinate_config].
4953 ///
4954 /// Note that all the setters affecting `subordinate_config` are mutually
4955 /// exclusive.
4956 ///
4957 /// # Example
4958 /// ```ignore,no_run
4959 /// # use google_cloud_security_privateca_v1::model::SubordinateConfig;
4960 /// use google_cloud_security_privateca_v1::model::subordinate_config::SubordinateConfig as SubordinateConfigOneOf;
4961 /// let x = SubordinateConfig::new().set_subordinate_config(Some(SubordinateConfigOneOf::CertificateAuthority("example".to_string())));
4962 /// ```
4963 pub fn set_subordinate_config<
4964 T: std::convert::Into<
4965 std::option::Option<crate::model::subordinate_config::SubordinateConfig>,
4966 >,
4967 >(
4968 mut self,
4969 v: T,
4970 ) -> Self {
4971 self.subordinate_config = v.into();
4972 self
4973 }
4974
4975 /// The value of [subordinate_config][crate::model::SubordinateConfig::subordinate_config]
4976 /// if it holds a `CertificateAuthority`, `None` if the field is not set or
4977 /// holds a different branch.
4978 pub fn certificate_authority(&self) -> std::option::Option<&std::string::String> {
4979 #[allow(unreachable_patterns)]
4980 self.subordinate_config.as_ref().and_then(|v| match v {
4981 crate::model::subordinate_config::SubordinateConfig::CertificateAuthority(v) => {
4982 std::option::Option::Some(v)
4983 }
4984 _ => std::option::Option::None,
4985 })
4986 }
4987
4988 /// Sets the value of [subordinate_config][crate::model::SubordinateConfig::subordinate_config]
4989 /// to hold a `CertificateAuthority`.
4990 ///
4991 /// Note that all the setters affecting `subordinate_config` are
4992 /// mutually exclusive.
4993 ///
4994 /// # Example
4995 /// ```ignore,no_run
4996 /// # use google_cloud_security_privateca_v1::model::SubordinateConfig;
4997 /// let x = SubordinateConfig::new().set_certificate_authority("example");
4998 /// assert!(x.certificate_authority().is_some());
4999 /// assert!(x.pem_issuer_chain().is_none());
5000 /// ```
5001 pub fn set_certificate_authority<T: std::convert::Into<std::string::String>>(
5002 mut self,
5003 v: T,
5004 ) -> Self {
5005 self.subordinate_config = std::option::Option::Some(
5006 crate::model::subordinate_config::SubordinateConfig::CertificateAuthority(v.into()),
5007 );
5008 self
5009 }
5010
5011 /// The value of [subordinate_config][crate::model::SubordinateConfig::subordinate_config]
5012 /// if it holds a `PemIssuerChain`, `None` if the field is not set or
5013 /// holds a different branch.
5014 pub fn pem_issuer_chain(
5015 &self,
5016 ) -> std::option::Option<
5017 &std::boxed::Box<crate::model::subordinate_config::SubordinateConfigChain>,
5018 > {
5019 #[allow(unreachable_patterns)]
5020 self.subordinate_config.as_ref().and_then(|v| match v {
5021 crate::model::subordinate_config::SubordinateConfig::PemIssuerChain(v) => {
5022 std::option::Option::Some(v)
5023 }
5024 _ => std::option::Option::None,
5025 })
5026 }
5027
5028 /// Sets the value of [subordinate_config][crate::model::SubordinateConfig::subordinate_config]
5029 /// to hold a `PemIssuerChain`.
5030 ///
5031 /// Note that all the setters affecting `subordinate_config` are
5032 /// mutually exclusive.
5033 ///
5034 /// # Example
5035 /// ```ignore,no_run
5036 /// # use google_cloud_security_privateca_v1::model::SubordinateConfig;
5037 /// use google_cloud_security_privateca_v1::model::subordinate_config::SubordinateConfigChain;
5038 /// let x = SubordinateConfig::new().set_pem_issuer_chain(SubordinateConfigChain::default()/* use setters */);
5039 /// assert!(x.pem_issuer_chain().is_some());
5040 /// assert!(x.certificate_authority().is_none());
5041 /// ```
5042 pub fn set_pem_issuer_chain<
5043 T: std::convert::Into<
5044 std::boxed::Box<crate::model::subordinate_config::SubordinateConfigChain>,
5045 >,
5046 >(
5047 mut self,
5048 v: T,
5049 ) -> Self {
5050 self.subordinate_config = std::option::Option::Some(
5051 crate::model::subordinate_config::SubordinateConfig::PemIssuerChain(v.into()),
5052 );
5053 self
5054 }
5055}
5056
5057impl wkt::message::Message for SubordinateConfig {
5058 fn typename() -> &'static str {
5059 "type.googleapis.com/google.cloud.security.privateca.v1.SubordinateConfig"
5060 }
5061}
5062
5063/// Defines additional types related to [SubordinateConfig].
5064pub mod subordinate_config {
5065 #[allow(unused_imports)]
5066 use super::*;
5067
5068 /// This message describes a subordinate CA's issuer certificate chain. This
5069 /// wrapper exists for compatibility reasons.
5070 #[derive(Clone, Default, PartialEq)]
5071 #[non_exhaustive]
5072 pub struct SubordinateConfigChain {
5073 /// Required. Expected to be in leaf-to-root order according to RFC 5246.
5074 pub pem_certificates: std::vec::Vec<std::string::String>,
5075
5076 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5077 }
5078
5079 impl SubordinateConfigChain {
5080 pub fn new() -> Self {
5081 std::default::Default::default()
5082 }
5083
5084 /// Sets the value of [pem_certificates][crate::model::subordinate_config::SubordinateConfigChain::pem_certificates].
5085 ///
5086 /// # Example
5087 /// ```ignore,no_run
5088 /// # use google_cloud_security_privateca_v1::model::subordinate_config::SubordinateConfigChain;
5089 /// let x = SubordinateConfigChain::new().set_pem_certificates(["a", "b", "c"]);
5090 /// ```
5091 pub fn set_pem_certificates<T, V>(mut self, v: T) -> Self
5092 where
5093 T: std::iter::IntoIterator<Item = V>,
5094 V: std::convert::Into<std::string::String>,
5095 {
5096 use std::iter::Iterator;
5097 self.pem_certificates = v.into_iter().map(|i| i.into()).collect();
5098 self
5099 }
5100 }
5101
5102 impl wkt::message::Message for SubordinateConfigChain {
5103 fn typename() -> &'static str {
5104 "type.googleapis.com/google.cloud.security.privateca.v1.SubordinateConfig.SubordinateConfigChain"
5105 }
5106 }
5107
5108 #[derive(Clone, Debug, PartialEq)]
5109 #[non_exhaustive]
5110 pub enum SubordinateConfig {
5111 /// Required. This can refer to a
5112 /// [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]
5113 /// that was used to create a subordinate
5114 /// [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority].
5115 /// This field is used for information and usability purposes only. The
5116 /// resource name is in the format
5117 /// `projects/*/locations/*/caPools/*/certificateAuthorities/*`.
5118 ///
5119 /// [google.cloud.security.privateca.v1.CertificateAuthority]: crate::model::CertificateAuthority
5120 CertificateAuthority(std::string::String),
5121 /// Required. Contains the PEM certificate chain for the issuers of this
5122 /// [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority],
5123 /// but not pem certificate for this CA itself.
5124 ///
5125 /// [google.cloud.security.privateca.v1.CertificateAuthority]: crate::model::CertificateAuthority
5126 PemIssuerChain(std::boxed::Box<crate::model::subordinate_config::SubordinateConfigChain>),
5127 }
5128}
5129
5130/// A [PublicKey][google.cloud.security.privateca.v1.PublicKey] describes a
5131/// public key.
5132///
5133/// [google.cloud.security.privateca.v1.PublicKey]: crate::model::PublicKey
5134#[derive(Clone, Default, PartialEq)]
5135#[non_exhaustive]
5136pub struct PublicKey {
5137 /// Required. A public key. The padding and encoding
5138 /// must match with the `KeyFormat` value specified for the `format` field.
5139 pub key: ::bytes::Bytes,
5140
5141 /// Required. The format of the public key.
5142 pub format: crate::model::public_key::KeyFormat,
5143
5144 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5145}
5146
5147impl PublicKey {
5148 pub fn new() -> Self {
5149 std::default::Default::default()
5150 }
5151
5152 /// Sets the value of [key][crate::model::PublicKey::key].
5153 ///
5154 /// # Example
5155 /// ```ignore,no_run
5156 /// # use google_cloud_security_privateca_v1::model::PublicKey;
5157 /// let x = PublicKey::new().set_key(bytes::Bytes::from_static(b"example"));
5158 /// ```
5159 pub fn set_key<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
5160 self.key = v.into();
5161 self
5162 }
5163
5164 /// Sets the value of [format][crate::model::PublicKey::format].
5165 ///
5166 /// # Example
5167 /// ```ignore,no_run
5168 /// # use google_cloud_security_privateca_v1::model::PublicKey;
5169 /// use google_cloud_security_privateca_v1::model::public_key::KeyFormat;
5170 /// let x0 = PublicKey::new().set_format(KeyFormat::Pem);
5171 /// ```
5172 pub fn set_format<T: std::convert::Into<crate::model::public_key::KeyFormat>>(
5173 mut self,
5174 v: T,
5175 ) -> Self {
5176 self.format = v.into();
5177 self
5178 }
5179}
5180
5181impl wkt::message::Message for PublicKey {
5182 fn typename() -> &'static str {
5183 "type.googleapis.com/google.cloud.security.privateca.v1.PublicKey"
5184 }
5185}
5186
5187/// Defines additional types related to [PublicKey].
5188pub mod public_key {
5189 #[allow(unused_imports)]
5190 use super::*;
5191
5192 /// Types of public keys formats that are supported. Currently, only `PEM`
5193 /// format is supported.
5194 ///
5195 /// # Working with unknown values
5196 ///
5197 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5198 /// additional enum variants at any time. Adding new variants is not considered
5199 /// a breaking change. Applications should write their code in anticipation of:
5200 ///
5201 /// - New values appearing in future releases of the client library, **and**
5202 /// - New values received dynamically, without application changes.
5203 ///
5204 /// Please consult the [Working with enums] section in the user guide for some
5205 /// guidelines.
5206 ///
5207 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
5208 #[derive(Clone, Debug, PartialEq)]
5209 #[non_exhaustive]
5210 pub enum KeyFormat {
5211 /// Default unspecified value.
5212 Unspecified,
5213 /// The key is PEM-encoded as defined in [RFC
5214 /// 7468](https://tools.ietf.org/html/rfc7468). It can be any of the
5215 /// following: a PEM-encoded PKCS#1/RFC 3447 RSAPublicKey
5216 /// structure, an RFC 5280
5217 /// [SubjectPublicKeyInfo](https://tools.ietf.org/html/rfc5280#section-4.1)
5218 /// or a PEM-encoded X.509 certificate signing request (CSR). If a
5219 /// [SubjectPublicKeyInfo](https://tools.ietf.org/html/rfc5280#section-4.1)
5220 /// is specified, it can contain a A PEM-encoded PKCS#1/RFC 3447 RSAPublicKey
5221 /// or a NIST P-256/secp256r1/prime256v1 or P-384 key. If a CSR is specified,
5222 /// it will used solely for the purpose of extracting the public key. When
5223 /// generated by the service, it will always be an RFC 5280
5224 /// [SubjectPublicKeyInfo](https://tools.ietf.org/html/rfc5280#section-4.1)
5225 /// structure containing an algorithm identifier and a key.
5226 Pem,
5227 /// If set, the enum was initialized with an unknown value.
5228 ///
5229 /// Applications can examine the value using [KeyFormat::value] or
5230 /// [KeyFormat::name].
5231 UnknownValue(key_format::UnknownValue),
5232 }
5233
5234 #[doc(hidden)]
5235 pub mod key_format {
5236 #[allow(unused_imports)]
5237 use super::*;
5238 #[derive(Clone, Debug, PartialEq)]
5239 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5240 }
5241
5242 impl KeyFormat {
5243 /// Gets the enum value.
5244 ///
5245 /// Returns `None` if the enum contains an unknown value deserialized from
5246 /// the string representation of enums.
5247 pub fn value(&self) -> std::option::Option<i32> {
5248 match self {
5249 Self::Unspecified => std::option::Option::Some(0),
5250 Self::Pem => std::option::Option::Some(1),
5251 Self::UnknownValue(u) => u.0.value(),
5252 }
5253 }
5254
5255 /// Gets the enum value as a string.
5256 ///
5257 /// Returns `None` if the enum contains an unknown value deserialized from
5258 /// the integer representation of enums.
5259 pub fn name(&self) -> std::option::Option<&str> {
5260 match self {
5261 Self::Unspecified => std::option::Option::Some("KEY_FORMAT_UNSPECIFIED"),
5262 Self::Pem => std::option::Option::Some("PEM"),
5263 Self::UnknownValue(u) => u.0.name(),
5264 }
5265 }
5266 }
5267
5268 impl std::default::Default for KeyFormat {
5269 fn default() -> Self {
5270 use std::convert::From;
5271 Self::from(0)
5272 }
5273 }
5274
5275 impl std::fmt::Display for KeyFormat {
5276 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5277 wkt::internal::display_enum(f, self.name(), self.value())
5278 }
5279 }
5280
5281 impl std::convert::From<i32> for KeyFormat {
5282 fn from(value: i32) -> Self {
5283 match value {
5284 0 => Self::Unspecified,
5285 1 => Self::Pem,
5286 _ => Self::UnknownValue(key_format::UnknownValue(
5287 wkt::internal::UnknownEnumValue::Integer(value),
5288 )),
5289 }
5290 }
5291 }
5292
5293 impl std::convert::From<&str> for KeyFormat {
5294 fn from(value: &str) -> Self {
5295 use std::string::ToString;
5296 match value {
5297 "KEY_FORMAT_UNSPECIFIED" => Self::Unspecified,
5298 "PEM" => Self::Pem,
5299 _ => Self::UnknownValue(key_format::UnknownValue(
5300 wkt::internal::UnknownEnumValue::String(value.to_string()),
5301 )),
5302 }
5303 }
5304 }
5305
5306 impl serde::ser::Serialize for KeyFormat {
5307 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5308 where
5309 S: serde::Serializer,
5310 {
5311 match self {
5312 Self::Unspecified => serializer.serialize_i32(0),
5313 Self::Pem => serializer.serialize_i32(1),
5314 Self::UnknownValue(u) => u.0.serialize(serializer),
5315 }
5316 }
5317 }
5318
5319 impl<'de> serde::de::Deserialize<'de> for KeyFormat {
5320 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5321 where
5322 D: serde::Deserializer<'de>,
5323 {
5324 deserializer.deserialize_any(wkt::internal::EnumVisitor::<KeyFormat>::new(
5325 ".google.cloud.security.privateca.v1.PublicKey.KeyFormat",
5326 ))
5327 }
5328 }
5329}
5330
5331/// A [CertificateConfig][google.cloud.security.privateca.v1.CertificateConfig]
5332/// describes an X.509 certificate or CSR that is to be created, as an
5333/// alternative to using ASN.1.
5334///
5335/// [google.cloud.security.privateca.v1.CertificateConfig]: crate::model::CertificateConfig
5336#[derive(Clone, Default, PartialEq)]
5337#[non_exhaustive]
5338pub struct CertificateConfig {
5339 /// Required. Specifies some of the values in a certificate that are related to
5340 /// the subject.
5341 pub subject_config: std::option::Option<crate::model::certificate_config::SubjectConfig>,
5342
5343 /// Required. Describes how some of the technical X.509 fields in a certificate
5344 /// should be populated.
5345 pub x509_config: std::option::Option<crate::model::X509Parameters>,
5346
5347 /// Optional. The public key that corresponds to this config. This is, for
5348 /// example, used when issuing
5349 /// [Certificates][google.cloud.security.privateca.v1.Certificate], but not
5350 /// when creating a self-signed
5351 /// [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]
5352 /// or
5353 /// [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]
5354 /// CSR.
5355 ///
5356 /// [google.cloud.security.privateca.v1.Certificate]: crate::model::Certificate
5357 /// [google.cloud.security.privateca.v1.CertificateAuthority]: crate::model::CertificateAuthority
5358 pub public_key: std::option::Option<crate::model::PublicKey>,
5359
5360 /// Optional. When specified this provides a custom SKI to be used in the
5361 /// certificate. This should only be used to maintain a SKI of an existing CA
5362 /// originally created outside CA service, which was not generated using method
5363 /// (1) described in RFC 5280 section 4.2.1.2.
5364 pub subject_key_id: std::option::Option<crate::model::certificate_config::KeyId>,
5365
5366 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5367}
5368
5369impl CertificateConfig {
5370 pub fn new() -> Self {
5371 std::default::Default::default()
5372 }
5373
5374 /// Sets the value of [subject_config][crate::model::CertificateConfig::subject_config].
5375 ///
5376 /// # Example
5377 /// ```ignore,no_run
5378 /// # use google_cloud_security_privateca_v1::model::CertificateConfig;
5379 /// use google_cloud_security_privateca_v1::model::certificate_config::SubjectConfig;
5380 /// let x = CertificateConfig::new().set_subject_config(SubjectConfig::default()/* use setters */);
5381 /// ```
5382 pub fn set_subject_config<T>(mut self, v: T) -> Self
5383 where
5384 T: std::convert::Into<crate::model::certificate_config::SubjectConfig>,
5385 {
5386 self.subject_config = std::option::Option::Some(v.into());
5387 self
5388 }
5389
5390 /// Sets or clears the value of [subject_config][crate::model::CertificateConfig::subject_config].
5391 ///
5392 /// # Example
5393 /// ```ignore,no_run
5394 /// # use google_cloud_security_privateca_v1::model::CertificateConfig;
5395 /// use google_cloud_security_privateca_v1::model::certificate_config::SubjectConfig;
5396 /// let x = CertificateConfig::new().set_or_clear_subject_config(Some(SubjectConfig::default()/* use setters */));
5397 /// let x = CertificateConfig::new().set_or_clear_subject_config(None::<SubjectConfig>);
5398 /// ```
5399 pub fn set_or_clear_subject_config<T>(mut self, v: std::option::Option<T>) -> Self
5400 where
5401 T: std::convert::Into<crate::model::certificate_config::SubjectConfig>,
5402 {
5403 self.subject_config = v.map(|x| x.into());
5404 self
5405 }
5406
5407 /// Sets the value of [x509_config][crate::model::CertificateConfig::x509_config].
5408 ///
5409 /// # Example
5410 /// ```ignore,no_run
5411 /// # use google_cloud_security_privateca_v1::model::CertificateConfig;
5412 /// use google_cloud_security_privateca_v1::model::X509Parameters;
5413 /// let x = CertificateConfig::new().set_x509_config(X509Parameters::default()/* use setters */);
5414 /// ```
5415 pub fn set_x509_config<T>(mut self, v: T) -> Self
5416 where
5417 T: std::convert::Into<crate::model::X509Parameters>,
5418 {
5419 self.x509_config = std::option::Option::Some(v.into());
5420 self
5421 }
5422
5423 /// Sets or clears the value of [x509_config][crate::model::CertificateConfig::x509_config].
5424 ///
5425 /// # Example
5426 /// ```ignore,no_run
5427 /// # use google_cloud_security_privateca_v1::model::CertificateConfig;
5428 /// use google_cloud_security_privateca_v1::model::X509Parameters;
5429 /// let x = CertificateConfig::new().set_or_clear_x509_config(Some(X509Parameters::default()/* use setters */));
5430 /// let x = CertificateConfig::new().set_or_clear_x509_config(None::<X509Parameters>);
5431 /// ```
5432 pub fn set_or_clear_x509_config<T>(mut self, v: std::option::Option<T>) -> Self
5433 where
5434 T: std::convert::Into<crate::model::X509Parameters>,
5435 {
5436 self.x509_config = v.map(|x| x.into());
5437 self
5438 }
5439
5440 /// Sets the value of [public_key][crate::model::CertificateConfig::public_key].
5441 ///
5442 /// # Example
5443 /// ```ignore,no_run
5444 /// # use google_cloud_security_privateca_v1::model::CertificateConfig;
5445 /// use google_cloud_security_privateca_v1::model::PublicKey;
5446 /// let x = CertificateConfig::new().set_public_key(PublicKey::default()/* use setters */);
5447 /// ```
5448 pub fn set_public_key<T>(mut self, v: T) -> Self
5449 where
5450 T: std::convert::Into<crate::model::PublicKey>,
5451 {
5452 self.public_key = std::option::Option::Some(v.into());
5453 self
5454 }
5455
5456 /// Sets or clears the value of [public_key][crate::model::CertificateConfig::public_key].
5457 ///
5458 /// # Example
5459 /// ```ignore,no_run
5460 /// # use google_cloud_security_privateca_v1::model::CertificateConfig;
5461 /// use google_cloud_security_privateca_v1::model::PublicKey;
5462 /// let x = CertificateConfig::new().set_or_clear_public_key(Some(PublicKey::default()/* use setters */));
5463 /// let x = CertificateConfig::new().set_or_clear_public_key(None::<PublicKey>);
5464 /// ```
5465 pub fn set_or_clear_public_key<T>(mut self, v: std::option::Option<T>) -> Self
5466 where
5467 T: std::convert::Into<crate::model::PublicKey>,
5468 {
5469 self.public_key = v.map(|x| x.into());
5470 self
5471 }
5472
5473 /// Sets the value of [subject_key_id][crate::model::CertificateConfig::subject_key_id].
5474 ///
5475 /// # Example
5476 /// ```ignore,no_run
5477 /// # use google_cloud_security_privateca_v1::model::CertificateConfig;
5478 /// use google_cloud_security_privateca_v1::model::certificate_config::KeyId;
5479 /// let x = CertificateConfig::new().set_subject_key_id(KeyId::default()/* use setters */);
5480 /// ```
5481 pub fn set_subject_key_id<T>(mut self, v: T) -> Self
5482 where
5483 T: std::convert::Into<crate::model::certificate_config::KeyId>,
5484 {
5485 self.subject_key_id = std::option::Option::Some(v.into());
5486 self
5487 }
5488
5489 /// Sets or clears the value of [subject_key_id][crate::model::CertificateConfig::subject_key_id].
5490 ///
5491 /// # Example
5492 /// ```ignore,no_run
5493 /// # use google_cloud_security_privateca_v1::model::CertificateConfig;
5494 /// use google_cloud_security_privateca_v1::model::certificate_config::KeyId;
5495 /// let x = CertificateConfig::new().set_or_clear_subject_key_id(Some(KeyId::default()/* use setters */));
5496 /// let x = CertificateConfig::new().set_or_clear_subject_key_id(None::<KeyId>);
5497 /// ```
5498 pub fn set_or_clear_subject_key_id<T>(mut self, v: std::option::Option<T>) -> Self
5499 where
5500 T: std::convert::Into<crate::model::certificate_config::KeyId>,
5501 {
5502 self.subject_key_id = v.map(|x| x.into());
5503 self
5504 }
5505}
5506
5507impl wkt::message::Message for CertificateConfig {
5508 fn typename() -> &'static str {
5509 "type.googleapis.com/google.cloud.security.privateca.v1.CertificateConfig"
5510 }
5511}
5512
5513/// Defines additional types related to [CertificateConfig].
5514pub mod certificate_config {
5515 #[allow(unused_imports)]
5516 use super::*;
5517
5518 /// These values are used to create the distinguished name and subject
5519 /// alternative name fields in an X.509 certificate.
5520 #[derive(Clone, Default, PartialEq)]
5521 #[non_exhaustive]
5522 pub struct SubjectConfig {
5523 /// Optional. Contains distinguished name fields such as the common name,
5524 /// location and organization.
5525 pub subject: std::option::Option<crate::model::Subject>,
5526
5527 /// Optional. The subject alternative name fields.
5528 pub subject_alt_name: std::option::Option<crate::model::SubjectAltNames>,
5529
5530 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5531 }
5532
5533 impl SubjectConfig {
5534 pub fn new() -> Self {
5535 std::default::Default::default()
5536 }
5537
5538 /// Sets the value of [subject][crate::model::certificate_config::SubjectConfig::subject].
5539 ///
5540 /// # Example
5541 /// ```ignore,no_run
5542 /// # use google_cloud_security_privateca_v1::model::certificate_config::SubjectConfig;
5543 /// use google_cloud_security_privateca_v1::model::Subject;
5544 /// let x = SubjectConfig::new().set_subject(Subject::default()/* use setters */);
5545 /// ```
5546 pub fn set_subject<T>(mut self, v: T) -> Self
5547 where
5548 T: std::convert::Into<crate::model::Subject>,
5549 {
5550 self.subject = std::option::Option::Some(v.into());
5551 self
5552 }
5553
5554 /// Sets or clears the value of [subject][crate::model::certificate_config::SubjectConfig::subject].
5555 ///
5556 /// # Example
5557 /// ```ignore,no_run
5558 /// # use google_cloud_security_privateca_v1::model::certificate_config::SubjectConfig;
5559 /// use google_cloud_security_privateca_v1::model::Subject;
5560 /// let x = SubjectConfig::new().set_or_clear_subject(Some(Subject::default()/* use setters */));
5561 /// let x = SubjectConfig::new().set_or_clear_subject(None::<Subject>);
5562 /// ```
5563 pub fn set_or_clear_subject<T>(mut self, v: std::option::Option<T>) -> Self
5564 where
5565 T: std::convert::Into<crate::model::Subject>,
5566 {
5567 self.subject = v.map(|x| x.into());
5568 self
5569 }
5570
5571 /// Sets the value of [subject_alt_name][crate::model::certificate_config::SubjectConfig::subject_alt_name].
5572 ///
5573 /// # Example
5574 /// ```ignore,no_run
5575 /// # use google_cloud_security_privateca_v1::model::certificate_config::SubjectConfig;
5576 /// use google_cloud_security_privateca_v1::model::SubjectAltNames;
5577 /// let x = SubjectConfig::new().set_subject_alt_name(SubjectAltNames::default()/* use setters */);
5578 /// ```
5579 pub fn set_subject_alt_name<T>(mut self, v: T) -> Self
5580 where
5581 T: std::convert::Into<crate::model::SubjectAltNames>,
5582 {
5583 self.subject_alt_name = std::option::Option::Some(v.into());
5584 self
5585 }
5586
5587 /// Sets or clears the value of [subject_alt_name][crate::model::certificate_config::SubjectConfig::subject_alt_name].
5588 ///
5589 /// # Example
5590 /// ```ignore,no_run
5591 /// # use google_cloud_security_privateca_v1::model::certificate_config::SubjectConfig;
5592 /// use google_cloud_security_privateca_v1::model::SubjectAltNames;
5593 /// let x = SubjectConfig::new().set_or_clear_subject_alt_name(Some(SubjectAltNames::default()/* use setters */));
5594 /// let x = SubjectConfig::new().set_or_clear_subject_alt_name(None::<SubjectAltNames>);
5595 /// ```
5596 pub fn set_or_clear_subject_alt_name<T>(mut self, v: std::option::Option<T>) -> Self
5597 where
5598 T: std::convert::Into<crate::model::SubjectAltNames>,
5599 {
5600 self.subject_alt_name = v.map(|x| x.into());
5601 self
5602 }
5603 }
5604
5605 impl wkt::message::Message for SubjectConfig {
5606 fn typename() -> &'static str {
5607 "type.googleapis.com/google.cloud.security.privateca.v1.CertificateConfig.SubjectConfig"
5608 }
5609 }
5610
5611 /// A KeyId identifies a specific public key, usually by hashing the public
5612 /// key.
5613 #[derive(Clone, Default, PartialEq)]
5614 #[non_exhaustive]
5615 pub struct KeyId {
5616 /// Required. The value of this KeyId encoded in lowercase hexadecimal. This
5617 /// is most likely the 160 bit SHA-1 hash of the public key.
5618 pub key_id: std::string::String,
5619
5620 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5621 }
5622
5623 impl KeyId {
5624 pub fn new() -> Self {
5625 std::default::Default::default()
5626 }
5627
5628 /// Sets the value of [key_id][crate::model::certificate_config::KeyId::key_id].
5629 ///
5630 /// # Example
5631 /// ```ignore,no_run
5632 /// # use google_cloud_security_privateca_v1::model::certificate_config::KeyId;
5633 /// let x = KeyId::new().set_key_id("example");
5634 /// ```
5635 pub fn set_key_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5636 self.key_id = v.into();
5637 self
5638 }
5639 }
5640
5641 impl wkt::message::Message for KeyId {
5642 fn typename() -> &'static str {
5643 "type.googleapis.com/google.cloud.security.privateca.v1.CertificateConfig.KeyId"
5644 }
5645 }
5646}
5647
5648/// A
5649/// [CertificateDescription][google.cloud.security.privateca.v1.CertificateDescription]
5650/// describes an X.509 certificate or CSR that has been issued, as an alternative
5651/// to using ASN.1 / X.509.
5652///
5653/// [google.cloud.security.privateca.v1.CertificateDescription]: crate::model::CertificateDescription
5654#[derive(Clone, Default, PartialEq)]
5655#[non_exhaustive]
5656pub struct CertificateDescription {
5657 /// Describes some of the values in a certificate that are related to the
5658 /// subject and lifetime.
5659 pub subject_description:
5660 std::option::Option<crate::model::certificate_description::SubjectDescription>,
5661
5662 /// Describes some of the technical X.509 fields in a certificate.
5663 pub x509_description: std::option::Option<crate::model::X509Parameters>,
5664
5665 /// The public key that corresponds to an issued certificate.
5666 pub public_key: std::option::Option<crate::model::PublicKey>,
5667
5668 /// Provides a means of identifiying certificates that contain a particular
5669 /// public key, per <https://tools.ietf.org/html/rfc5280#section-4.2.1.2>.
5670 pub subject_key_id: std::option::Option<crate::model::certificate_description::KeyId>,
5671
5672 /// Identifies the subject_key_id of the parent certificate, per
5673 /// <https://tools.ietf.org/html/rfc5280#section-4.2.1.1>
5674 pub authority_key_id: std::option::Option<crate::model::certificate_description::KeyId>,
5675
5676 /// Describes a list of locations to obtain CRL information, i.e.
5677 /// the DistributionPoint.fullName described by
5678 /// <https://tools.ietf.org/html/rfc5280#section-4.2.1.13>
5679 pub crl_distribution_points: std::vec::Vec<std::string::String>,
5680
5681 /// Describes lists of issuer CA certificate URLs that appear in the
5682 /// "Authority Information Access" extension in the certificate.
5683 pub aia_issuing_certificate_urls: std::vec::Vec<std::string::String>,
5684
5685 /// The hash of the x.509 certificate.
5686 pub cert_fingerprint:
5687 std::option::Option<crate::model::certificate_description::CertificateFingerprint>,
5688
5689 /// The hash of the pre-signed certificate, which will be signed by the CA.
5690 /// Corresponds to the TBS Certificate in
5691 /// <https://tools.ietf.org/html/rfc5280#section-4.1.2>. The field will always be
5692 /// populated.
5693 pub tbs_certificate_digest: std::string::String,
5694
5695 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5696}
5697
5698impl CertificateDescription {
5699 pub fn new() -> Self {
5700 std::default::Default::default()
5701 }
5702
5703 /// Sets the value of [subject_description][crate::model::CertificateDescription::subject_description].
5704 ///
5705 /// # Example
5706 /// ```ignore,no_run
5707 /// # use google_cloud_security_privateca_v1::model::CertificateDescription;
5708 /// use google_cloud_security_privateca_v1::model::certificate_description::SubjectDescription;
5709 /// let x = CertificateDescription::new().set_subject_description(SubjectDescription::default()/* use setters */);
5710 /// ```
5711 pub fn set_subject_description<T>(mut self, v: T) -> Self
5712 where
5713 T: std::convert::Into<crate::model::certificate_description::SubjectDescription>,
5714 {
5715 self.subject_description = std::option::Option::Some(v.into());
5716 self
5717 }
5718
5719 /// Sets or clears the value of [subject_description][crate::model::CertificateDescription::subject_description].
5720 ///
5721 /// # Example
5722 /// ```ignore,no_run
5723 /// # use google_cloud_security_privateca_v1::model::CertificateDescription;
5724 /// use google_cloud_security_privateca_v1::model::certificate_description::SubjectDescription;
5725 /// let x = CertificateDescription::new().set_or_clear_subject_description(Some(SubjectDescription::default()/* use setters */));
5726 /// let x = CertificateDescription::new().set_or_clear_subject_description(None::<SubjectDescription>);
5727 /// ```
5728 pub fn set_or_clear_subject_description<T>(mut self, v: std::option::Option<T>) -> Self
5729 where
5730 T: std::convert::Into<crate::model::certificate_description::SubjectDescription>,
5731 {
5732 self.subject_description = v.map(|x| x.into());
5733 self
5734 }
5735
5736 /// Sets the value of [x509_description][crate::model::CertificateDescription::x509_description].
5737 ///
5738 /// # Example
5739 /// ```ignore,no_run
5740 /// # use google_cloud_security_privateca_v1::model::CertificateDescription;
5741 /// use google_cloud_security_privateca_v1::model::X509Parameters;
5742 /// let x = CertificateDescription::new().set_x509_description(X509Parameters::default()/* use setters */);
5743 /// ```
5744 pub fn set_x509_description<T>(mut self, v: T) -> Self
5745 where
5746 T: std::convert::Into<crate::model::X509Parameters>,
5747 {
5748 self.x509_description = std::option::Option::Some(v.into());
5749 self
5750 }
5751
5752 /// Sets or clears the value of [x509_description][crate::model::CertificateDescription::x509_description].
5753 ///
5754 /// # Example
5755 /// ```ignore,no_run
5756 /// # use google_cloud_security_privateca_v1::model::CertificateDescription;
5757 /// use google_cloud_security_privateca_v1::model::X509Parameters;
5758 /// let x = CertificateDescription::new().set_or_clear_x509_description(Some(X509Parameters::default()/* use setters */));
5759 /// let x = CertificateDescription::new().set_or_clear_x509_description(None::<X509Parameters>);
5760 /// ```
5761 pub fn set_or_clear_x509_description<T>(mut self, v: std::option::Option<T>) -> Self
5762 where
5763 T: std::convert::Into<crate::model::X509Parameters>,
5764 {
5765 self.x509_description = v.map(|x| x.into());
5766 self
5767 }
5768
5769 /// Sets the value of [public_key][crate::model::CertificateDescription::public_key].
5770 ///
5771 /// # Example
5772 /// ```ignore,no_run
5773 /// # use google_cloud_security_privateca_v1::model::CertificateDescription;
5774 /// use google_cloud_security_privateca_v1::model::PublicKey;
5775 /// let x = CertificateDescription::new().set_public_key(PublicKey::default()/* use setters */);
5776 /// ```
5777 pub fn set_public_key<T>(mut self, v: T) -> Self
5778 where
5779 T: std::convert::Into<crate::model::PublicKey>,
5780 {
5781 self.public_key = std::option::Option::Some(v.into());
5782 self
5783 }
5784
5785 /// Sets or clears the value of [public_key][crate::model::CertificateDescription::public_key].
5786 ///
5787 /// # Example
5788 /// ```ignore,no_run
5789 /// # use google_cloud_security_privateca_v1::model::CertificateDescription;
5790 /// use google_cloud_security_privateca_v1::model::PublicKey;
5791 /// let x = CertificateDescription::new().set_or_clear_public_key(Some(PublicKey::default()/* use setters */));
5792 /// let x = CertificateDescription::new().set_or_clear_public_key(None::<PublicKey>);
5793 /// ```
5794 pub fn set_or_clear_public_key<T>(mut self, v: std::option::Option<T>) -> Self
5795 where
5796 T: std::convert::Into<crate::model::PublicKey>,
5797 {
5798 self.public_key = v.map(|x| x.into());
5799 self
5800 }
5801
5802 /// Sets the value of [subject_key_id][crate::model::CertificateDescription::subject_key_id].
5803 ///
5804 /// # Example
5805 /// ```ignore,no_run
5806 /// # use google_cloud_security_privateca_v1::model::CertificateDescription;
5807 /// use google_cloud_security_privateca_v1::model::certificate_description::KeyId;
5808 /// let x = CertificateDescription::new().set_subject_key_id(KeyId::default()/* use setters */);
5809 /// ```
5810 pub fn set_subject_key_id<T>(mut self, v: T) -> Self
5811 where
5812 T: std::convert::Into<crate::model::certificate_description::KeyId>,
5813 {
5814 self.subject_key_id = std::option::Option::Some(v.into());
5815 self
5816 }
5817
5818 /// Sets or clears the value of [subject_key_id][crate::model::CertificateDescription::subject_key_id].
5819 ///
5820 /// # Example
5821 /// ```ignore,no_run
5822 /// # use google_cloud_security_privateca_v1::model::CertificateDescription;
5823 /// use google_cloud_security_privateca_v1::model::certificate_description::KeyId;
5824 /// let x = CertificateDescription::new().set_or_clear_subject_key_id(Some(KeyId::default()/* use setters */));
5825 /// let x = CertificateDescription::new().set_or_clear_subject_key_id(None::<KeyId>);
5826 /// ```
5827 pub fn set_or_clear_subject_key_id<T>(mut self, v: std::option::Option<T>) -> Self
5828 where
5829 T: std::convert::Into<crate::model::certificate_description::KeyId>,
5830 {
5831 self.subject_key_id = v.map(|x| x.into());
5832 self
5833 }
5834
5835 /// Sets the value of [authority_key_id][crate::model::CertificateDescription::authority_key_id].
5836 ///
5837 /// # Example
5838 /// ```ignore,no_run
5839 /// # use google_cloud_security_privateca_v1::model::CertificateDescription;
5840 /// use google_cloud_security_privateca_v1::model::certificate_description::KeyId;
5841 /// let x = CertificateDescription::new().set_authority_key_id(KeyId::default()/* use setters */);
5842 /// ```
5843 pub fn set_authority_key_id<T>(mut self, v: T) -> Self
5844 where
5845 T: std::convert::Into<crate::model::certificate_description::KeyId>,
5846 {
5847 self.authority_key_id = std::option::Option::Some(v.into());
5848 self
5849 }
5850
5851 /// Sets or clears the value of [authority_key_id][crate::model::CertificateDescription::authority_key_id].
5852 ///
5853 /// # Example
5854 /// ```ignore,no_run
5855 /// # use google_cloud_security_privateca_v1::model::CertificateDescription;
5856 /// use google_cloud_security_privateca_v1::model::certificate_description::KeyId;
5857 /// let x = CertificateDescription::new().set_or_clear_authority_key_id(Some(KeyId::default()/* use setters */));
5858 /// let x = CertificateDescription::new().set_or_clear_authority_key_id(None::<KeyId>);
5859 /// ```
5860 pub fn set_or_clear_authority_key_id<T>(mut self, v: std::option::Option<T>) -> Self
5861 where
5862 T: std::convert::Into<crate::model::certificate_description::KeyId>,
5863 {
5864 self.authority_key_id = v.map(|x| x.into());
5865 self
5866 }
5867
5868 /// Sets the value of [crl_distribution_points][crate::model::CertificateDescription::crl_distribution_points].
5869 ///
5870 /// # Example
5871 /// ```ignore,no_run
5872 /// # use google_cloud_security_privateca_v1::model::CertificateDescription;
5873 /// let x = CertificateDescription::new().set_crl_distribution_points(["a", "b", "c"]);
5874 /// ```
5875 pub fn set_crl_distribution_points<T, V>(mut self, v: T) -> Self
5876 where
5877 T: std::iter::IntoIterator<Item = V>,
5878 V: std::convert::Into<std::string::String>,
5879 {
5880 use std::iter::Iterator;
5881 self.crl_distribution_points = v.into_iter().map(|i| i.into()).collect();
5882 self
5883 }
5884
5885 /// Sets the value of [aia_issuing_certificate_urls][crate::model::CertificateDescription::aia_issuing_certificate_urls].
5886 ///
5887 /// # Example
5888 /// ```ignore,no_run
5889 /// # use google_cloud_security_privateca_v1::model::CertificateDescription;
5890 /// let x = CertificateDescription::new().set_aia_issuing_certificate_urls(["a", "b", "c"]);
5891 /// ```
5892 pub fn set_aia_issuing_certificate_urls<T, V>(mut self, v: T) -> Self
5893 where
5894 T: std::iter::IntoIterator<Item = V>,
5895 V: std::convert::Into<std::string::String>,
5896 {
5897 use std::iter::Iterator;
5898 self.aia_issuing_certificate_urls = v.into_iter().map(|i| i.into()).collect();
5899 self
5900 }
5901
5902 /// Sets the value of [cert_fingerprint][crate::model::CertificateDescription::cert_fingerprint].
5903 ///
5904 /// # Example
5905 /// ```ignore,no_run
5906 /// # use google_cloud_security_privateca_v1::model::CertificateDescription;
5907 /// use google_cloud_security_privateca_v1::model::certificate_description::CertificateFingerprint;
5908 /// let x = CertificateDescription::new().set_cert_fingerprint(CertificateFingerprint::default()/* use setters */);
5909 /// ```
5910 pub fn set_cert_fingerprint<T>(mut self, v: T) -> Self
5911 where
5912 T: std::convert::Into<crate::model::certificate_description::CertificateFingerprint>,
5913 {
5914 self.cert_fingerprint = std::option::Option::Some(v.into());
5915 self
5916 }
5917
5918 /// Sets or clears the value of [cert_fingerprint][crate::model::CertificateDescription::cert_fingerprint].
5919 ///
5920 /// # Example
5921 /// ```ignore,no_run
5922 /// # use google_cloud_security_privateca_v1::model::CertificateDescription;
5923 /// use google_cloud_security_privateca_v1::model::certificate_description::CertificateFingerprint;
5924 /// let x = CertificateDescription::new().set_or_clear_cert_fingerprint(Some(CertificateFingerprint::default()/* use setters */));
5925 /// let x = CertificateDescription::new().set_or_clear_cert_fingerprint(None::<CertificateFingerprint>);
5926 /// ```
5927 pub fn set_or_clear_cert_fingerprint<T>(mut self, v: std::option::Option<T>) -> Self
5928 where
5929 T: std::convert::Into<crate::model::certificate_description::CertificateFingerprint>,
5930 {
5931 self.cert_fingerprint = v.map(|x| x.into());
5932 self
5933 }
5934
5935 /// Sets the value of [tbs_certificate_digest][crate::model::CertificateDescription::tbs_certificate_digest].
5936 ///
5937 /// # Example
5938 /// ```ignore,no_run
5939 /// # use google_cloud_security_privateca_v1::model::CertificateDescription;
5940 /// let x = CertificateDescription::new().set_tbs_certificate_digest("example");
5941 /// ```
5942 pub fn set_tbs_certificate_digest<T: std::convert::Into<std::string::String>>(
5943 mut self,
5944 v: T,
5945 ) -> Self {
5946 self.tbs_certificate_digest = v.into();
5947 self
5948 }
5949}
5950
5951impl wkt::message::Message for CertificateDescription {
5952 fn typename() -> &'static str {
5953 "type.googleapis.com/google.cloud.security.privateca.v1.CertificateDescription"
5954 }
5955}
5956
5957/// Defines additional types related to [CertificateDescription].
5958pub mod certificate_description {
5959 #[allow(unused_imports)]
5960 use super::*;
5961
5962 /// These values describe fields in an issued X.509 certificate such as the
5963 /// distinguished name, subject alternative names, serial number, and lifetime.
5964 #[derive(Clone, Default, PartialEq)]
5965 #[non_exhaustive]
5966 pub struct SubjectDescription {
5967 /// Contains distinguished name fields such as the common name, location and
5968 /// / organization.
5969 pub subject: std::option::Option<crate::model::Subject>,
5970
5971 /// The subject alternative name fields.
5972 pub subject_alt_name: std::option::Option<crate::model::SubjectAltNames>,
5973
5974 /// The serial number encoded in lowercase hexadecimal.
5975 pub hex_serial_number: std::string::String,
5976
5977 /// For convenience, the actual lifetime of an issued certificate.
5978 pub lifetime: std::option::Option<wkt::Duration>,
5979
5980 /// The time at which the certificate becomes valid.
5981 pub not_before_time: std::option::Option<wkt::Timestamp>,
5982
5983 /// The time after which the certificate is expired.
5984 /// Per RFC 5280, the validity period for a certificate is the period of time
5985 /// from not_before_time through not_after_time, inclusive.
5986 /// Corresponds to 'not_before_time' + 'lifetime' - 1 second.
5987 pub not_after_time: std::option::Option<wkt::Timestamp>,
5988
5989 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5990 }
5991
5992 impl SubjectDescription {
5993 pub fn new() -> Self {
5994 std::default::Default::default()
5995 }
5996
5997 /// Sets the value of [subject][crate::model::certificate_description::SubjectDescription::subject].
5998 ///
5999 /// # Example
6000 /// ```ignore,no_run
6001 /// # use google_cloud_security_privateca_v1::model::certificate_description::SubjectDescription;
6002 /// use google_cloud_security_privateca_v1::model::Subject;
6003 /// let x = SubjectDescription::new().set_subject(Subject::default()/* use setters */);
6004 /// ```
6005 pub fn set_subject<T>(mut self, v: T) -> Self
6006 where
6007 T: std::convert::Into<crate::model::Subject>,
6008 {
6009 self.subject = std::option::Option::Some(v.into());
6010 self
6011 }
6012
6013 /// Sets or clears the value of [subject][crate::model::certificate_description::SubjectDescription::subject].
6014 ///
6015 /// # Example
6016 /// ```ignore,no_run
6017 /// # use google_cloud_security_privateca_v1::model::certificate_description::SubjectDescription;
6018 /// use google_cloud_security_privateca_v1::model::Subject;
6019 /// let x = SubjectDescription::new().set_or_clear_subject(Some(Subject::default()/* use setters */));
6020 /// let x = SubjectDescription::new().set_or_clear_subject(None::<Subject>);
6021 /// ```
6022 pub fn set_or_clear_subject<T>(mut self, v: std::option::Option<T>) -> Self
6023 where
6024 T: std::convert::Into<crate::model::Subject>,
6025 {
6026 self.subject = v.map(|x| x.into());
6027 self
6028 }
6029
6030 /// Sets the value of [subject_alt_name][crate::model::certificate_description::SubjectDescription::subject_alt_name].
6031 ///
6032 /// # Example
6033 /// ```ignore,no_run
6034 /// # use google_cloud_security_privateca_v1::model::certificate_description::SubjectDescription;
6035 /// use google_cloud_security_privateca_v1::model::SubjectAltNames;
6036 /// let x = SubjectDescription::new().set_subject_alt_name(SubjectAltNames::default()/* use setters */);
6037 /// ```
6038 pub fn set_subject_alt_name<T>(mut self, v: T) -> Self
6039 where
6040 T: std::convert::Into<crate::model::SubjectAltNames>,
6041 {
6042 self.subject_alt_name = std::option::Option::Some(v.into());
6043 self
6044 }
6045
6046 /// Sets or clears the value of [subject_alt_name][crate::model::certificate_description::SubjectDescription::subject_alt_name].
6047 ///
6048 /// # Example
6049 /// ```ignore,no_run
6050 /// # use google_cloud_security_privateca_v1::model::certificate_description::SubjectDescription;
6051 /// use google_cloud_security_privateca_v1::model::SubjectAltNames;
6052 /// let x = SubjectDescription::new().set_or_clear_subject_alt_name(Some(SubjectAltNames::default()/* use setters */));
6053 /// let x = SubjectDescription::new().set_or_clear_subject_alt_name(None::<SubjectAltNames>);
6054 /// ```
6055 pub fn set_or_clear_subject_alt_name<T>(mut self, v: std::option::Option<T>) -> Self
6056 where
6057 T: std::convert::Into<crate::model::SubjectAltNames>,
6058 {
6059 self.subject_alt_name = v.map(|x| x.into());
6060 self
6061 }
6062
6063 /// Sets the value of [hex_serial_number][crate::model::certificate_description::SubjectDescription::hex_serial_number].
6064 ///
6065 /// # Example
6066 /// ```ignore,no_run
6067 /// # use google_cloud_security_privateca_v1::model::certificate_description::SubjectDescription;
6068 /// let x = SubjectDescription::new().set_hex_serial_number("example");
6069 /// ```
6070 pub fn set_hex_serial_number<T: std::convert::Into<std::string::String>>(
6071 mut self,
6072 v: T,
6073 ) -> Self {
6074 self.hex_serial_number = v.into();
6075 self
6076 }
6077
6078 /// Sets the value of [lifetime][crate::model::certificate_description::SubjectDescription::lifetime].
6079 ///
6080 /// # Example
6081 /// ```ignore,no_run
6082 /// # use google_cloud_security_privateca_v1::model::certificate_description::SubjectDescription;
6083 /// use wkt::Duration;
6084 /// let x = SubjectDescription::new().set_lifetime(Duration::default()/* use setters */);
6085 /// ```
6086 pub fn set_lifetime<T>(mut self, v: T) -> Self
6087 where
6088 T: std::convert::Into<wkt::Duration>,
6089 {
6090 self.lifetime = std::option::Option::Some(v.into());
6091 self
6092 }
6093
6094 /// Sets or clears the value of [lifetime][crate::model::certificate_description::SubjectDescription::lifetime].
6095 ///
6096 /// # Example
6097 /// ```ignore,no_run
6098 /// # use google_cloud_security_privateca_v1::model::certificate_description::SubjectDescription;
6099 /// use wkt::Duration;
6100 /// let x = SubjectDescription::new().set_or_clear_lifetime(Some(Duration::default()/* use setters */));
6101 /// let x = SubjectDescription::new().set_or_clear_lifetime(None::<Duration>);
6102 /// ```
6103 pub fn set_or_clear_lifetime<T>(mut self, v: std::option::Option<T>) -> Self
6104 where
6105 T: std::convert::Into<wkt::Duration>,
6106 {
6107 self.lifetime = v.map(|x| x.into());
6108 self
6109 }
6110
6111 /// Sets the value of [not_before_time][crate::model::certificate_description::SubjectDescription::not_before_time].
6112 ///
6113 /// # Example
6114 /// ```ignore,no_run
6115 /// # use google_cloud_security_privateca_v1::model::certificate_description::SubjectDescription;
6116 /// use wkt::Timestamp;
6117 /// let x = SubjectDescription::new().set_not_before_time(Timestamp::default()/* use setters */);
6118 /// ```
6119 pub fn set_not_before_time<T>(mut self, v: T) -> Self
6120 where
6121 T: std::convert::Into<wkt::Timestamp>,
6122 {
6123 self.not_before_time = std::option::Option::Some(v.into());
6124 self
6125 }
6126
6127 /// Sets or clears the value of [not_before_time][crate::model::certificate_description::SubjectDescription::not_before_time].
6128 ///
6129 /// # Example
6130 /// ```ignore,no_run
6131 /// # use google_cloud_security_privateca_v1::model::certificate_description::SubjectDescription;
6132 /// use wkt::Timestamp;
6133 /// let x = SubjectDescription::new().set_or_clear_not_before_time(Some(Timestamp::default()/* use setters */));
6134 /// let x = SubjectDescription::new().set_or_clear_not_before_time(None::<Timestamp>);
6135 /// ```
6136 pub fn set_or_clear_not_before_time<T>(mut self, v: std::option::Option<T>) -> Self
6137 where
6138 T: std::convert::Into<wkt::Timestamp>,
6139 {
6140 self.not_before_time = v.map(|x| x.into());
6141 self
6142 }
6143
6144 /// Sets the value of [not_after_time][crate::model::certificate_description::SubjectDescription::not_after_time].
6145 ///
6146 /// # Example
6147 /// ```ignore,no_run
6148 /// # use google_cloud_security_privateca_v1::model::certificate_description::SubjectDescription;
6149 /// use wkt::Timestamp;
6150 /// let x = SubjectDescription::new().set_not_after_time(Timestamp::default()/* use setters */);
6151 /// ```
6152 pub fn set_not_after_time<T>(mut self, v: T) -> Self
6153 where
6154 T: std::convert::Into<wkt::Timestamp>,
6155 {
6156 self.not_after_time = std::option::Option::Some(v.into());
6157 self
6158 }
6159
6160 /// Sets or clears the value of [not_after_time][crate::model::certificate_description::SubjectDescription::not_after_time].
6161 ///
6162 /// # Example
6163 /// ```ignore,no_run
6164 /// # use google_cloud_security_privateca_v1::model::certificate_description::SubjectDescription;
6165 /// use wkt::Timestamp;
6166 /// let x = SubjectDescription::new().set_or_clear_not_after_time(Some(Timestamp::default()/* use setters */));
6167 /// let x = SubjectDescription::new().set_or_clear_not_after_time(None::<Timestamp>);
6168 /// ```
6169 pub fn set_or_clear_not_after_time<T>(mut self, v: std::option::Option<T>) -> Self
6170 where
6171 T: std::convert::Into<wkt::Timestamp>,
6172 {
6173 self.not_after_time = v.map(|x| x.into());
6174 self
6175 }
6176 }
6177
6178 impl wkt::message::Message for SubjectDescription {
6179 fn typename() -> &'static str {
6180 "type.googleapis.com/google.cloud.security.privateca.v1.CertificateDescription.SubjectDescription"
6181 }
6182 }
6183
6184 /// A KeyId identifies a specific public key, usually by hashing the public
6185 /// key.
6186 #[derive(Clone, Default, PartialEq)]
6187 #[non_exhaustive]
6188 pub struct KeyId {
6189 /// Optional. The value of this KeyId encoded in lowercase hexadecimal. This
6190 /// is most likely the 160 bit SHA-1 hash of the public key.
6191 pub key_id: std::string::String,
6192
6193 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6194 }
6195
6196 impl KeyId {
6197 pub fn new() -> Self {
6198 std::default::Default::default()
6199 }
6200
6201 /// Sets the value of [key_id][crate::model::certificate_description::KeyId::key_id].
6202 ///
6203 /// # Example
6204 /// ```ignore,no_run
6205 /// # use google_cloud_security_privateca_v1::model::certificate_description::KeyId;
6206 /// let x = KeyId::new().set_key_id("example");
6207 /// ```
6208 pub fn set_key_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6209 self.key_id = v.into();
6210 self
6211 }
6212 }
6213
6214 impl wkt::message::Message for KeyId {
6215 fn typename() -> &'static str {
6216 "type.googleapis.com/google.cloud.security.privateca.v1.CertificateDescription.KeyId"
6217 }
6218 }
6219
6220 /// A group of fingerprints for the x509 certificate.
6221 #[derive(Clone, Default, PartialEq)]
6222 #[non_exhaustive]
6223 pub struct CertificateFingerprint {
6224 /// The SHA 256 hash, encoded in hexadecimal, of the DER x509 certificate.
6225 pub sha256_hash: std::string::String,
6226
6227 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6228 }
6229
6230 impl CertificateFingerprint {
6231 pub fn new() -> Self {
6232 std::default::Default::default()
6233 }
6234
6235 /// Sets the value of [sha256_hash][crate::model::certificate_description::CertificateFingerprint::sha256_hash].
6236 ///
6237 /// # Example
6238 /// ```ignore,no_run
6239 /// # use google_cloud_security_privateca_v1::model::certificate_description::CertificateFingerprint;
6240 /// let x = CertificateFingerprint::new().set_sha256_hash("example");
6241 /// ```
6242 pub fn set_sha256_hash<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6243 self.sha256_hash = v.into();
6244 self
6245 }
6246 }
6247
6248 impl wkt::message::Message for CertificateFingerprint {
6249 fn typename() -> &'static str {
6250 "type.googleapis.com/google.cloud.security.privateca.v1.CertificateDescription.CertificateFingerprint"
6251 }
6252 }
6253}
6254
6255/// An [ObjectId][google.cloud.security.privateca.v1.ObjectId] specifies an
6256/// object identifier (OID). These provide context and describe types in ASN.1
6257/// messages.
6258///
6259/// [google.cloud.security.privateca.v1.ObjectId]: crate::model::ObjectId
6260#[derive(Clone, Default, PartialEq)]
6261#[non_exhaustive]
6262pub struct ObjectId {
6263 /// Required. The parts of an OID path. The most significant parts of the path
6264 /// come first.
6265 pub object_id_path: std::vec::Vec<i32>,
6266
6267 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6268}
6269
6270impl ObjectId {
6271 pub fn new() -> Self {
6272 std::default::Default::default()
6273 }
6274
6275 /// Sets the value of [object_id_path][crate::model::ObjectId::object_id_path].
6276 ///
6277 /// # Example
6278 /// ```ignore,no_run
6279 /// # use google_cloud_security_privateca_v1::model::ObjectId;
6280 /// let x = ObjectId::new().set_object_id_path([1, 2, 3]);
6281 /// ```
6282 pub fn set_object_id_path<T, V>(mut self, v: T) -> Self
6283 where
6284 T: std::iter::IntoIterator<Item = V>,
6285 V: std::convert::Into<i32>,
6286 {
6287 use std::iter::Iterator;
6288 self.object_id_path = v.into_iter().map(|i| i.into()).collect();
6289 self
6290 }
6291}
6292
6293impl wkt::message::Message for ObjectId {
6294 fn typename() -> &'static str {
6295 "type.googleapis.com/google.cloud.security.privateca.v1.ObjectId"
6296 }
6297}
6298
6299/// An [X509Extension][google.cloud.security.privateca.v1.X509Extension]
6300/// specifies an X.509 extension, which may be used in different parts of X.509
6301/// objects like certificates, CSRs, and CRLs.
6302///
6303/// [google.cloud.security.privateca.v1.X509Extension]: crate::model::X509Extension
6304#[derive(Clone, Default, PartialEq)]
6305#[non_exhaustive]
6306pub struct X509Extension {
6307 /// Required. The OID for this X.509 extension.
6308 pub object_id: std::option::Option<crate::model::ObjectId>,
6309
6310 /// Optional. Indicates whether or not this extension is critical (i.e., if the
6311 /// client does not know how to handle this extension, the client should
6312 /// consider this to be an error).
6313 pub critical: bool,
6314
6315 /// Required. The value of this X.509 extension.
6316 pub value: ::bytes::Bytes,
6317
6318 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6319}
6320
6321impl X509Extension {
6322 pub fn new() -> Self {
6323 std::default::Default::default()
6324 }
6325
6326 /// Sets the value of [object_id][crate::model::X509Extension::object_id].
6327 ///
6328 /// # Example
6329 /// ```ignore,no_run
6330 /// # use google_cloud_security_privateca_v1::model::X509Extension;
6331 /// use google_cloud_security_privateca_v1::model::ObjectId;
6332 /// let x = X509Extension::new().set_object_id(ObjectId::default()/* use setters */);
6333 /// ```
6334 pub fn set_object_id<T>(mut self, v: T) -> Self
6335 where
6336 T: std::convert::Into<crate::model::ObjectId>,
6337 {
6338 self.object_id = std::option::Option::Some(v.into());
6339 self
6340 }
6341
6342 /// Sets or clears the value of [object_id][crate::model::X509Extension::object_id].
6343 ///
6344 /// # Example
6345 /// ```ignore,no_run
6346 /// # use google_cloud_security_privateca_v1::model::X509Extension;
6347 /// use google_cloud_security_privateca_v1::model::ObjectId;
6348 /// let x = X509Extension::new().set_or_clear_object_id(Some(ObjectId::default()/* use setters */));
6349 /// let x = X509Extension::new().set_or_clear_object_id(None::<ObjectId>);
6350 /// ```
6351 pub fn set_or_clear_object_id<T>(mut self, v: std::option::Option<T>) -> Self
6352 where
6353 T: std::convert::Into<crate::model::ObjectId>,
6354 {
6355 self.object_id = v.map(|x| x.into());
6356 self
6357 }
6358
6359 /// Sets the value of [critical][crate::model::X509Extension::critical].
6360 ///
6361 /// # Example
6362 /// ```ignore,no_run
6363 /// # use google_cloud_security_privateca_v1::model::X509Extension;
6364 /// let x = X509Extension::new().set_critical(true);
6365 /// ```
6366 pub fn set_critical<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6367 self.critical = v.into();
6368 self
6369 }
6370
6371 /// Sets the value of [value][crate::model::X509Extension::value].
6372 ///
6373 /// # Example
6374 /// ```ignore,no_run
6375 /// # use google_cloud_security_privateca_v1::model::X509Extension;
6376 /// let x = X509Extension::new().set_value(bytes::Bytes::from_static(b"example"));
6377 /// ```
6378 pub fn set_value<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
6379 self.value = v.into();
6380 self
6381 }
6382}
6383
6384impl wkt::message::Message for X509Extension {
6385 fn typename() -> &'static str {
6386 "type.googleapis.com/google.cloud.security.privateca.v1.X509Extension"
6387 }
6388}
6389
6390/// A [KeyUsage][google.cloud.security.privateca.v1.KeyUsage] describes key usage
6391/// values that may appear in an X.509 certificate.
6392///
6393/// [google.cloud.security.privateca.v1.KeyUsage]: crate::model::KeyUsage
6394#[derive(Clone, Default, PartialEq)]
6395#[non_exhaustive]
6396pub struct KeyUsage {
6397 /// Describes high-level ways in which a key may be used.
6398 pub base_key_usage: std::option::Option<crate::model::key_usage::KeyUsageOptions>,
6399
6400 /// Detailed scenarios in which a key may be used.
6401 pub extended_key_usage: std::option::Option<crate::model::key_usage::ExtendedKeyUsageOptions>,
6402
6403 /// Used to describe extended key usages that are not listed in the
6404 /// [KeyUsage.ExtendedKeyUsageOptions][google.cloud.security.privateca.v1.KeyUsage.ExtendedKeyUsageOptions]
6405 /// message.
6406 ///
6407 /// [google.cloud.security.privateca.v1.KeyUsage.ExtendedKeyUsageOptions]: crate::model::key_usage::ExtendedKeyUsageOptions
6408 pub unknown_extended_key_usages: std::vec::Vec<crate::model::ObjectId>,
6409
6410 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6411}
6412
6413impl KeyUsage {
6414 pub fn new() -> Self {
6415 std::default::Default::default()
6416 }
6417
6418 /// Sets the value of [base_key_usage][crate::model::KeyUsage::base_key_usage].
6419 ///
6420 /// # Example
6421 /// ```ignore,no_run
6422 /// # use google_cloud_security_privateca_v1::model::KeyUsage;
6423 /// use google_cloud_security_privateca_v1::model::key_usage::KeyUsageOptions;
6424 /// let x = KeyUsage::new().set_base_key_usage(KeyUsageOptions::default()/* use setters */);
6425 /// ```
6426 pub fn set_base_key_usage<T>(mut self, v: T) -> Self
6427 where
6428 T: std::convert::Into<crate::model::key_usage::KeyUsageOptions>,
6429 {
6430 self.base_key_usage = std::option::Option::Some(v.into());
6431 self
6432 }
6433
6434 /// Sets or clears the value of [base_key_usage][crate::model::KeyUsage::base_key_usage].
6435 ///
6436 /// # Example
6437 /// ```ignore,no_run
6438 /// # use google_cloud_security_privateca_v1::model::KeyUsage;
6439 /// use google_cloud_security_privateca_v1::model::key_usage::KeyUsageOptions;
6440 /// let x = KeyUsage::new().set_or_clear_base_key_usage(Some(KeyUsageOptions::default()/* use setters */));
6441 /// let x = KeyUsage::new().set_or_clear_base_key_usage(None::<KeyUsageOptions>);
6442 /// ```
6443 pub fn set_or_clear_base_key_usage<T>(mut self, v: std::option::Option<T>) -> Self
6444 where
6445 T: std::convert::Into<crate::model::key_usage::KeyUsageOptions>,
6446 {
6447 self.base_key_usage = v.map(|x| x.into());
6448 self
6449 }
6450
6451 /// Sets the value of [extended_key_usage][crate::model::KeyUsage::extended_key_usage].
6452 ///
6453 /// # Example
6454 /// ```ignore,no_run
6455 /// # use google_cloud_security_privateca_v1::model::KeyUsage;
6456 /// use google_cloud_security_privateca_v1::model::key_usage::ExtendedKeyUsageOptions;
6457 /// let x = KeyUsage::new().set_extended_key_usage(ExtendedKeyUsageOptions::default()/* use setters */);
6458 /// ```
6459 pub fn set_extended_key_usage<T>(mut self, v: T) -> Self
6460 where
6461 T: std::convert::Into<crate::model::key_usage::ExtendedKeyUsageOptions>,
6462 {
6463 self.extended_key_usage = std::option::Option::Some(v.into());
6464 self
6465 }
6466
6467 /// Sets or clears the value of [extended_key_usage][crate::model::KeyUsage::extended_key_usage].
6468 ///
6469 /// # Example
6470 /// ```ignore,no_run
6471 /// # use google_cloud_security_privateca_v1::model::KeyUsage;
6472 /// use google_cloud_security_privateca_v1::model::key_usage::ExtendedKeyUsageOptions;
6473 /// let x = KeyUsage::new().set_or_clear_extended_key_usage(Some(ExtendedKeyUsageOptions::default()/* use setters */));
6474 /// let x = KeyUsage::new().set_or_clear_extended_key_usage(None::<ExtendedKeyUsageOptions>);
6475 /// ```
6476 pub fn set_or_clear_extended_key_usage<T>(mut self, v: std::option::Option<T>) -> Self
6477 where
6478 T: std::convert::Into<crate::model::key_usage::ExtendedKeyUsageOptions>,
6479 {
6480 self.extended_key_usage = v.map(|x| x.into());
6481 self
6482 }
6483
6484 /// Sets the value of [unknown_extended_key_usages][crate::model::KeyUsage::unknown_extended_key_usages].
6485 ///
6486 /// # Example
6487 /// ```ignore,no_run
6488 /// # use google_cloud_security_privateca_v1::model::KeyUsage;
6489 /// use google_cloud_security_privateca_v1::model::ObjectId;
6490 /// let x = KeyUsage::new()
6491 /// .set_unknown_extended_key_usages([
6492 /// ObjectId::default()/* use setters */,
6493 /// ObjectId::default()/* use (different) setters */,
6494 /// ]);
6495 /// ```
6496 pub fn set_unknown_extended_key_usages<T, V>(mut self, v: T) -> Self
6497 where
6498 T: std::iter::IntoIterator<Item = V>,
6499 V: std::convert::Into<crate::model::ObjectId>,
6500 {
6501 use std::iter::Iterator;
6502 self.unknown_extended_key_usages = v.into_iter().map(|i| i.into()).collect();
6503 self
6504 }
6505}
6506
6507impl wkt::message::Message for KeyUsage {
6508 fn typename() -> &'static str {
6509 "type.googleapis.com/google.cloud.security.privateca.v1.KeyUsage"
6510 }
6511}
6512
6513/// Defines additional types related to [KeyUsage].
6514pub mod key_usage {
6515 #[allow(unused_imports)]
6516 use super::*;
6517
6518 /// [KeyUsage.KeyUsageOptions][google.cloud.security.privateca.v1.KeyUsage.KeyUsageOptions]
6519 /// corresponds to the key usage values described in
6520 /// <https://tools.ietf.org/html/rfc5280#section-4.2.1.3>.
6521 ///
6522 /// [google.cloud.security.privateca.v1.KeyUsage.KeyUsageOptions]: crate::model::key_usage::KeyUsageOptions
6523 #[derive(Clone, Default, PartialEq)]
6524 #[non_exhaustive]
6525 pub struct KeyUsageOptions {
6526 /// The key may be used for digital signatures.
6527 pub digital_signature: bool,
6528
6529 /// The key may be used for cryptographic commitments. Note that this may
6530 /// also be referred to as "non-repudiation".
6531 pub content_commitment: bool,
6532
6533 /// The key may be used to encipher other keys.
6534 pub key_encipherment: bool,
6535
6536 /// The key may be used to encipher data.
6537 pub data_encipherment: bool,
6538
6539 /// The key may be used in a key agreement protocol.
6540 pub key_agreement: bool,
6541
6542 /// The key may be used to sign certificates.
6543 pub cert_sign: bool,
6544
6545 /// The key may be used sign certificate revocation lists.
6546 pub crl_sign: bool,
6547
6548 /// The key may be used to encipher only.
6549 pub encipher_only: bool,
6550
6551 /// The key may be used to decipher only.
6552 pub decipher_only: bool,
6553
6554 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6555 }
6556
6557 impl KeyUsageOptions {
6558 pub fn new() -> Self {
6559 std::default::Default::default()
6560 }
6561
6562 /// Sets the value of [digital_signature][crate::model::key_usage::KeyUsageOptions::digital_signature].
6563 ///
6564 /// # Example
6565 /// ```ignore,no_run
6566 /// # use google_cloud_security_privateca_v1::model::key_usage::KeyUsageOptions;
6567 /// let x = KeyUsageOptions::new().set_digital_signature(true);
6568 /// ```
6569 pub fn set_digital_signature<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6570 self.digital_signature = v.into();
6571 self
6572 }
6573
6574 /// Sets the value of [content_commitment][crate::model::key_usage::KeyUsageOptions::content_commitment].
6575 ///
6576 /// # Example
6577 /// ```ignore,no_run
6578 /// # use google_cloud_security_privateca_v1::model::key_usage::KeyUsageOptions;
6579 /// let x = KeyUsageOptions::new().set_content_commitment(true);
6580 /// ```
6581 pub fn set_content_commitment<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6582 self.content_commitment = v.into();
6583 self
6584 }
6585
6586 /// Sets the value of [key_encipherment][crate::model::key_usage::KeyUsageOptions::key_encipherment].
6587 ///
6588 /// # Example
6589 /// ```ignore,no_run
6590 /// # use google_cloud_security_privateca_v1::model::key_usage::KeyUsageOptions;
6591 /// let x = KeyUsageOptions::new().set_key_encipherment(true);
6592 /// ```
6593 pub fn set_key_encipherment<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6594 self.key_encipherment = v.into();
6595 self
6596 }
6597
6598 /// Sets the value of [data_encipherment][crate::model::key_usage::KeyUsageOptions::data_encipherment].
6599 ///
6600 /// # Example
6601 /// ```ignore,no_run
6602 /// # use google_cloud_security_privateca_v1::model::key_usage::KeyUsageOptions;
6603 /// let x = KeyUsageOptions::new().set_data_encipherment(true);
6604 /// ```
6605 pub fn set_data_encipherment<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6606 self.data_encipherment = v.into();
6607 self
6608 }
6609
6610 /// Sets the value of [key_agreement][crate::model::key_usage::KeyUsageOptions::key_agreement].
6611 ///
6612 /// # Example
6613 /// ```ignore,no_run
6614 /// # use google_cloud_security_privateca_v1::model::key_usage::KeyUsageOptions;
6615 /// let x = KeyUsageOptions::new().set_key_agreement(true);
6616 /// ```
6617 pub fn set_key_agreement<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6618 self.key_agreement = v.into();
6619 self
6620 }
6621
6622 /// Sets the value of [cert_sign][crate::model::key_usage::KeyUsageOptions::cert_sign].
6623 ///
6624 /// # Example
6625 /// ```ignore,no_run
6626 /// # use google_cloud_security_privateca_v1::model::key_usage::KeyUsageOptions;
6627 /// let x = KeyUsageOptions::new().set_cert_sign(true);
6628 /// ```
6629 pub fn set_cert_sign<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6630 self.cert_sign = v.into();
6631 self
6632 }
6633
6634 /// Sets the value of [crl_sign][crate::model::key_usage::KeyUsageOptions::crl_sign].
6635 ///
6636 /// # Example
6637 /// ```ignore,no_run
6638 /// # use google_cloud_security_privateca_v1::model::key_usage::KeyUsageOptions;
6639 /// let x = KeyUsageOptions::new().set_crl_sign(true);
6640 /// ```
6641 pub fn set_crl_sign<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6642 self.crl_sign = v.into();
6643 self
6644 }
6645
6646 /// Sets the value of [encipher_only][crate::model::key_usage::KeyUsageOptions::encipher_only].
6647 ///
6648 /// # Example
6649 /// ```ignore,no_run
6650 /// # use google_cloud_security_privateca_v1::model::key_usage::KeyUsageOptions;
6651 /// let x = KeyUsageOptions::new().set_encipher_only(true);
6652 /// ```
6653 pub fn set_encipher_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6654 self.encipher_only = v.into();
6655 self
6656 }
6657
6658 /// Sets the value of [decipher_only][crate::model::key_usage::KeyUsageOptions::decipher_only].
6659 ///
6660 /// # Example
6661 /// ```ignore,no_run
6662 /// # use google_cloud_security_privateca_v1::model::key_usage::KeyUsageOptions;
6663 /// let x = KeyUsageOptions::new().set_decipher_only(true);
6664 /// ```
6665 pub fn set_decipher_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6666 self.decipher_only = v.into();
6667 self
6668 }
6669 }
6670
6671 impl wkt::message::Message for KeyUsageOptions {
6672 fn typename() -> &'static str {
6673 "type.googleapis.com/google.cloud.security.privateca.v1.KeyUsage.KeyUsageOptions"
6674 }
6675 }
6676
6677 /// [KeyUsage.ExtendedKeyUsageOptions][google.cloud.security.privateca.v1.KeyUsage.ExtendedKeyUsageOptions]
6678 /// has fields that correspond to certain common OIDs that could be specified
6679 /// as an extended key usage value.
6680 ///
6681 /// [google.cloud.security.privateca.v1.KeyUsage.ExtendedKeyUsageOptions]: crate::model::key_usage::ExtendedKeyUsageOptions
6682 #[derive(Clone, Default, PartialEq)]
6683 #[non_exhaustive]
6684 pub struct ExtendedKeyUsageOptions {
6685 /// Corresponds to OID 1.3.6.1.5.5.7.3.1. Officially described as "TLS WWW
6686 /// server authentication", though regularly used for non-WWW TLS.
6687 pub server_auth: bool,
6688
6689 /// Corresponds to OID 1.3.6.1.5.5.7.3.2. Officially described as "TLS WWW
6690 /// client authentication", though regularly used for non-WWW TLS.
6691 pub client_auth: bool,
6692
6693 /// Corresponds to OID 1.3.6.1.5.5.7.3.3. Officially described as "Signing of
6694 /// downloadable executable code client authentication".
6695 pub code_signing: bool,
6696
6697 /// Corresponds to OID 1.3.6.1.5.5.7.3.4. Officially described as "Email
6698 /// protection".
6699 pub email_protection: bool,
6700
6701 /// Corresponds to OID 1.3.6.1.5.5.7.3.8. Officially described as "Binding
6702 /// the hash of an object to a time".
6703 pub time_stamping: bool,
6704
6705 /// Corresponds to OID 1.3.6.1.5.5.7.3.9. Officially described as "Signing
6706 /// OCSP responses".
6707 pub ocsp_signing: bool,
6708
6709 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6710 }
6711
6712 impl ExtendedKeyUsageOptions {
6713 pub fn new() -> Self {
6714 std::default::Default::default()
6715 }
6716
6717 /// Sets the value of [server_auth][crate::model::key_usage::ExtendedKeyUsageOptions::server_auth].
6718 ///
6719 /// # Example
6720 /// ```ignore,no_run
6721 /// # use google_cloud_security_privateca_v1::model::key_usage::ExtendedKeyUsageOptions;
6722 /// let x = ExtendedKeyUsageOptions::new().set_server_auth(true);
6723 /// ```
6724 pub fn set_server_auth<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6725 self.server_auth = v.into();
6726 self
6727 }
6728
6729 /// Sets the value of [client_auth][crate::model::key_usage::ExtendedKeyUsageOptions::client_auth].
6730 ///
6731 /// # Example
6732 /// ```ignore,no_run
6733 /// # use google_cloud_security_privateca_v1::model::key_usage::ExtendedKeyUsageOptions;
6734 /// let x = ExtendedKeyUsageOptions::new().set_client_auth(true);
6735 /// ```
6736 pub fn set_client_auth<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6737 self.client_auth = v.into();
6738 self
6739 }
6740
6741 /// Sets the value of [code_signing][crate::model::key_usage::ExtendedKeyUsageOptions::code_signing].
6742 ///
6743 /// # Example
6744 /// ```ignore,no_run
6745 /// # use google_cloud_security_privateca_v1::model::key_usage::ExtendedKeyUsageOptions;
6746 /// let x = ExtendedKeyUsageOptions::new().set_code_signing(true);
6747 /// ```
6748 pub fn set_code_signing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6749 self.code_signing = v.into();
6750 self
6751 }
6752
6753 /// Sets the value of [email_protection][crate::model::key_usage::ExtendedKeyUsageOptions::email_protection].
6754 ///
6755 /// # Example
6756 /// ```ignore,no_run
6757 /// # use google_cloud_security_privateca_v1::model::key_usage::ExtendedKeyUsageOptions;
6758 /// let x = ExtendedKeyUsageOptions::new().set_email_protection(true);
6759 /// ```
6760 pub fn set_email_protection<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6761 self.email_protection = v.into();
6762 self
6763 }
6764
6765 /// Sets the value of [time_stamping][crate::model::key_usage::ExtendedKeyUsageOptions::time_stamping].
6766 ///
6767 /// # Example
6768 /// ```ignore,no_run
6769 /// # use google_cloud_security_privateca_v1::model::key_usage::ExtendedKeyUsageOptions;
6770 /// let x = ExtendedKeyUsageOptions::new().set_time_stamping(true);
6771 /// ```
6772 pub fn set_time_stamping<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6773 self.time_stamping = v.into();
6774 self
6775 }
6776
6777 /// Sets the value of [ocsp_signing][crate::model::key_usage::ExtendedKeyUsageOptions::ocsp_signing].
6778 ///
6779 /// # Example
6780 /// ```ignore,no_run
6781 /// # use google_cloud_security_privateca_v1::model::key_usage::ExtendedKeyUsageOptions;
6782 /// let x = ExtendedKeyUsageOptions::new().set_ocsp_signing(true);
6783 /// ```
6784 pub fn set_ocsp_signing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6785 self.ocsp_signing = v.into();
6786 self
6787 }
6788 }
6789
6790 impl wkt::message::Message for ExtendedKeyUsageOptions {
6791 fn typename() -> &'static str {
6792 "type.googleapis.com/google.cloud.security.privateca.v1.KeyUsage.ExtendedKeyUsageOptions"
6793 }
6794 }
6795}
6796
6797/// [AttributeTypeAndValue][google.cloud.security.privateca.v1.AttributeTypeAndValue]
6798/// specifies an attribute type and value. It can use either a OID or enum value
6799/// to specify the attribute type.
6800///
6801/// [google.cloud.security.privateca.v1.AttributeTypeAndValue]: crate::model::AttributeTypeAndValue
6802#[derive(Clone, Default, PartialEq)]
6803#[non_exhaustive]
6804pub struct AttributeTypeAndValue {
6805 /// The value for the attribute type.
6806 pub value: std::string::String,
6807
6808 /// The attribute type for the attribute and value pair.
6809 pub attribute_type: std::option::Option<crate::model::attribute_type_and_value::AttributeType>,
6810
6811 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6812}
6813
6814impl AttributeTypeAndValue {
6815 pub fn new() -> Self {
6816 std::default::Default::default()
6817 }
6818
6819 /// Sets the value of [value][crate::model::AttributeTypeAndValue::value].
6820 ///
6821 /// # Example
6822 /// ```ignore,no_run
6823 /// # use google_cloud_security_privateca_v1::model::AttributeTypeAndValue;
6824 /// let x = AttributeTypeAndValue::new().set_value("example");
6825 /// ```
6826 pub fn set_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6827 self.value = v.into();
6828 self
6829 }
6830
6831 /// Sets the value of [attribute_type][crate::model::AttributeTypeAndValue::attribute_type].
6832 ///
6833 /// Note that all the setters affecting `attribute_type` are mutually
6834 /// exclusive.
6835 ///
6836 /// # Example
6837 /// ```ignore,no_run
6838 /// # use google_cloud_security_privateca_v1::model::AttributeTypeAndValue;
6839 /// use google_cloud_security_privateca_v1::model::AttributeType;
6840 /// let x0 = AttributeTypeAndValue::new().set_attribute_type(Some(
6841 /// google_cloud_security_privateca_v1::model::attribute_type_and_value::AttributeType::Type(AttributeType::CommonName)));
6842 /// let x1 = AttributeTypeAndValue::new().set_attribute_type(Some(
6843 /// google_cloud_security_privateca_v1::model::attribute_type_and_value::AttributeType::Type(AttributeType::CountryCode)));
6844 /// let x2 = AttributeTypeAndValue::new().set_attribute_type(Some(
6845 /// google_cloud_security_privateca_v1::model::attribute_type_and_value::AttributeType::Type(AttributeType::Organization)));
6846 /// ```
6847 pub fn set_attribute_type<
6848 T: std::convert::Into<
6849 std::option::Option<crate::model::attribute_type_and_value::AttributeType>,
6850 >,
6851 >(
6852 mut self,
6853 v: T,
6854 ) -> Self {
6855 self.attribute_type = v.into();
6856 self
6857 }
6858
6859 /// The value of [attribute_type][crate::model::AttributeTypeAndValue::attribute_type]
6860 /// if it holds a `Type`, `None` if the field is not set or
6861 /// holds a different branch.
6862 pub fn r#type(&self) -> std::option::Option<&crate::model::AttributeType> {
6863 #[allow(unreachable_patterns)]
6864 self.attribute_type.as_ref().and_then(|v| match v {
6865 crate::model::attribute_type_and_value::AttributeType::Type(v) => {
6866 std::option::Option::Some(v)
6867 }
6868 _ => std::option::Option::None,
6869 })
6870 }
6871
6872 /// Sets the value of [attribute_type][crate::model::AttributeTypeAndValue::attribute_type]
6873 /// to hold a `Type`.
6874 ///
6875 /// Note that all the setters affecting `attribute_type` are
6876 /// mutually exclusive.
6877 ///
6878 /// # Example
6879 /// ```ignore,no_run
6880 /// # use google_cloud_security_privateca_v1::model::AttributeTypeAndValue;
6881 /// use google_cloud_security_privateca_v1::model::AttributeType;
6882 /// let x0 = AttributeTypeAndValue::new().set_type(AttributeType::CommonName);
6883 /// let x1 = AttributeTypeAndValue::new().set_type(AttributeType::CountryCode);
6884 /// let x2 = AttributeTypeAndValue::new().set_type(AttributeType::Organization);
6885 /// assert!(x0.r#type().is_some());
6886 /// assert!(x0.object_id().is_none());
6887 /// assert!(x1.r#type().is_some());
6888 /// assert!(x1.object_id().is_none());
6889 /// assert!(x2.r#type().is_some());
6890 /// assert!(x2.object_id().is_none());
6891 /// ```
6892 pub fn set_type<T: std::convert::Into<crate::model::AttributeType>>(mut self, v: T) -> Self {
6893 self.attribute_type = std::option::Option::Some(
6894 crate::model::attribute_type_and_value::AttributeType::Type(v.into()),
6895 );
6896 self
6897 }
6898
6899 /// The value of [attribute_type][crate::model::AttributeTypeAndValue::attribute_type]
6900 /// if it holds a `ObjectId`, `None` if the field is not set or
6901 /// holds a different branch.
6902 pub fn object_id(&self) -> std::option::Option<&std::boxed::Box<crate::model::ObjectId>> {
6903 #[allow(unreachable_patterns)]
6904 self.attribute_type.as_ref().and_then(|v| match v {
6905 crate::model::attribute_type_and_value::AttributeType::ObjectId(v) => {
6906 std::option::Option::Some(v)
6907 }
6908 _ => std::option::Option::None,
6909 })
6910 }
6911
6912 /// Sets the value of [attribute_type][crate::model::AttributeTypeAndValue::attribute_type]
6913 /// to hold a `ObjectId`.
6914 ///
6915 /// Note that all the setters affecting `attribute_type` are
6916 /// mutually exclusive.
6917 ///
6918 /// # Example
6919 /// ```ignore,no_run
6920 /// # use google_cloud_security_privateca_v1::model::AttributeTypeAndValue;
6921 /// use google_cloud_security_privateca_v1::model::ObjectId;
6922 /// let x = AttributeTypeAndValue::new().set_object_id(ObjectId::default()/* use setters */);
6923 /// assert!(x.object_id().is_some());
6924 /// assert!(x.r#type().is_none());
6925 /// ```
6926 pub fn set_object_id<T: std::convert::Into<std::boxed::Box<crate::model::ObjectId>>>(
6927 mut self,
6928 v: T,
6929 ) -> Self {
6930 self.attribute_type = std::option::Option::Some(
6931 crate::model::attribute_type_and_value::AttributeType::ObjectId(v.into()),
6932 );
6933 self
6934 }
6935}
6936
6937impl wkt::message::Message for AttributeTypeAndValue {
6938 fn typename() -> &'static str {
6939 "type.googleapis.com/google.cloud.security.privateca.v1.AttributeTypeAndValue"
6940 }
6941}
6942
6943/// Defines additional types related to [AttributeTypeAndValue].
6944pub mod attribute_type_and_value {
6945 #[allow(unused_imports)]
6946 use super::*;
6947
6948 /// The attribute type for the attribute and value pair.
6949 #[derive(Clone, Debug, PartialEq)]
6950 #[non_exhaustive]
6951 pub enum AttributeType {
6952 /// The attribute type of the attribute and value pair.
6953 Type(crate::model::AttributeType),
6954 /// Object ID for an attribute type of an attribute and value pair.
6955 ObjectId(std::boxed::Box<crate::model::ObjectId>),
6956 }
6957}
6958
6959/// [RelativeDistinguishedName][google.cloud.security.privateca.v1.RelativeDistinguishedName]
6960/// specifies a relative distinguished name which will be used to build a
6961/// distinguished name.
6962///
6963/// [google.cloud.security.privateca.v1.RelativeDistinguishedName]: crate::model::RelativeDistinguishedName
6964#[derive(Clone, Default, PartialEq)]
6965#[non_exhaustive]
6966pub struct RelativeDistinguishedName {
6967 /// Attributes describes the attribute value assertions in the RDN.
6968 pub attributes: std::vec::Vec<crate::model::AttributeTypeAndValue>,
6969
6970 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6971}
6972
6973impl RelativeDistinguishedName {
6974 pub fn new() -> Self {
6975 std::default::Default::default()
6976 }
6977
6978 /// Sets the value of [attributes][crate::model::RelativeDistinguishedName::attributes].
6979 ///
6980 /// # Example
6981 /// ```ignore,no_run
6982 /// # use google_cloud_security_privateca_v1::model::RelativeDistinguishedName;
6983 /// use google_cloud_security_privateca_v1::model::AttributeTypeAndValue;
6984 /// let x = RelativeDistinguishedName::new()
6985 /// .set_attributes([
6986 /// AttributeTypeAndValue::default()/* use setters */,
6987 /// AttributeTypeAndValue::default()/* use (different) setters */,
6988 /// ]);
6989 /// ```
6990 pub fn set_attributes<T, V>(mut self, v: T) -> Self
6991 where
6992 T: std::iter::IntoIterator<Item = V>,
6993 V: std::convert::Into<crate::model::AttributeTypeAndValue>,
6994 {
6995 use std::iter::Iterator;
6996 self.attributes = v.into_iter().map(|i| i.into()).collect();
6997 self
6998 }
6999}
7000
7001impl wkt::message::Message for RelativeDistinguishedName {
7002 fn typename() -> &'static str {
7003 "type.googleapis.com/google.cloud.security.privateca.v1.RelativeDistinguishedName"
7004 }
7005}
7006
7007/// [Subject][google.cloud.security.privateca.v1.Subject] describes parts of a
7008/// distinguished name that, in turn, describes the subject of the certificate.
7009///
7010/// [google.cloud.security.privateca.v1.Subject]: crate::model::Subject
7011#[derive(Clone, Default, PartialEq)]
7012#[non_exhaustive]
7013pub struct Subject {
7014 /// The "common name" of the subject.
7015 pub common_name: std::string::String,
7016
7017 /// The country code of the subject.
7018 pub country_code: std::string::String,
7019
7020 /// The organization of the subject.
7021 pub organization: std::string::String,
7022
7023 /// The organizational_unit of the subject.
7024 pub organizational_unit: std::string::String,
7025
7026 /// The locality or city of the subject.
7027 pub locality: std::string::String,
7028
7029 /// The province, territory, or regional state of the subject.
7030 pub province: std::string::String,
7031
7032 /// The street address of the subject.
7033 pub street_address: std::string::String,
7034
7035 /// The postal code of the subject.
7036 pub postal_code: std::string::String,
7037
7038 /// This field can be used in place of the named subject fields.
7039 pub rdn_sequence: std::vec::Vec<crate::model::RelativeDistinguishedName>,
7040
7041 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7042}
7043
7044impl Subject {
7045 pub fn new() -> Self {
7046 std::default::Default::default()
7047 }
7048
7049 /// Sets the value of [common_name][crate::model::Subject::common_name].
7050 ///
7051 /// # Example
7052 /// ```ignore,no_run
7053 /// # use google_cloud_security_privateca_v1::model::Subject;
7054 /// let x = Subject::new().set_common_name("example");
7055 /// ```
7056 pub fn set_common_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7057 self.common_name = v.into();
7058 self
7059 }
7060
7061 /// Sets the value of [country_code][crate::model::Subject::country_code].
7062 ///
7063 /// # Example
7064 /// ```ignore,no_run
7065 /// # use google_cloud_security_privateca_v1::model::Subject;
7066 /// let x = Subject::new().set_country_code("example");
7067 /// ```
7068 pub fn set_country_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7069 self.country_code = v.into();
7070 self
7071 }
7072
7073 /// Sets the value of [organization][crate::model::Subject::organization].
7074 ///
7075 /// # Example
7076 /// ```ignore,no_run
7077 /// # use google_cloud_security_privateca_v1::model::Subject;
7078 /// let x = Subject::new().set_organization("example");
7079 /// ```
7080 pub fn set_organization<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7081 self.organization = v.into();
7082 self
7083 }
7084
7085 /// Sets the value of [organizational_unit][crate::model::Subject::organizational_unit].
7086 ///
7087 /// # Example
7088 /// ```ignore,no_run
7089 /// # use google_cloud_security_privateca_v1::model::Subject;
7090 /// let x = Subject::new().set_organizational_unit("example");
7091 /// ```
7092 pub fn set_organizational_unit<T: std::convert::Into<std::string::String>>(
7093 mut self,
7094 v: T,
7095 ) -> Self {
7096 self.organizational_unit = v.into();
7097 self
7098 }
7099
7100 /// Sets the value of [locality][crate::model::Subject::locality].
7101 ///
7102 /// # Example
7103 /// ```ignore,no_run
7104 /// # use google_cloud_security_privateca_v1::model::Subject;
7105 /// let x = Subject::new().set_locality("example");
7106 /// ```
7107 pub fn set_locality<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7108 self.locality = v.into();
7109 self
7110 }
7111
7112 /// Sets the value of [province][crate::model::Subject::province].
7113 ///
7114 /// # Example
7115 /// ```ignore,no_run
7116 /// # use google_cloud_security_privateca_v1::model::Subject;
7117 /// let x = Subject::new().set_province("example");
7118 /// ```
7119 pub fn set_province<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7120 self.province = v.into();
7121 self
7122 }
7123
7124 /// Sets the value of [street_address][crate::model::Subject::street_address].
7125 ///
7126 /// # Example
7127 /// ```ignore,no_run
7128 /// # use google_cloud_security_privateca_v1::model::Subject;
7129 /// let x = Subject::new().set_street_address("example");
7130 /// ```
7131 pub fn set_street_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7132 self.street_address = v.into();
7133 self
7134 }
7135
7136 /// Sets the value of [postal_code][crate::model::Subject::postal_code].
7137 ///
7138 /// # Example
7139 /// ```ignore,no_run
7140 /// # use google_cloud_security_privateca_v1::model::Subject;
7141 /// let x = Subject::new().set_postal_code("example");
7142 /// ```
7143 pub fn set_postal_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7144 self.postal_code = v.into();
7145 self
7146 }
7147
7148 /// Sets the value of [rdn_sequence][crate::model::Subject::rdn_sequence].
7149 ///
7150 /// # Example
7151 /// ```ignore,no_run
7152 /// # use google_cloud_security_privateca_v1::model::Subject;
7153 /// use google_cloud_security_privateca_v1::model::RelativeDistinguishedName;
7154 /// let x = Subject::new()
7155 /// .set_rdn_sequence([
7156 /// RelativeDistinguishedName::default()/* use setters */,
7157 /// RelativeDistinguishedName::default()/* use (different) setters */,
7158 /// ]);
7159 /// ```
7160 pub fn set_rdn_sequence<T, V>(mut self, v: T) -> Self
7161 where
7162 T: std::iter::IntoIterator<Item = V>,
7163 V: std::convert::Into<crate::model::RelativeDistinguishedName>,
7164 {
7165 use std::iter::Iterator;
7166 self.rdn_sequence = v.into_iter().map(|i| i.into()).collect();
7167 self
7168 }
7169}
7170
7171impl wkt::message::Message for Subject {
7172 fn typename() -> &'static str {
7173 "type.googleapis.com/google.cloud.security.privateca.v1.Subject"
7174 }
7175}
7176
7177/// [SubjectAltNames][google.cloud.security.privateca.v1.SubjectAltNames]
7178/// corresponds to a more modern way of listing what the asserted identity is in
7179/// a certificate (i.e., compared to the "common name" in the distinguished
7180/// name).
7181///
7182/// [google.cloud.security.privateca.v1.SubjectAltNames]: crate::model::SubjectAltNames
7183#[derive(Clone, Default, PartialEq)]
7184#[non_exhaustive]
7185pub struct SubjectAltNames {
7186 /// Contains only valid, fully-qualified host names.
7187 pub dns_names: std::vec::Vec<std::string::String>,
7188
7189 /// Contains only valid RFC 3986 URIs.
7190 pub uris: std::vec::Vec<std::string::String>,
7191
7192 /// Contains only valid RFC 2822 E-mail addresses.
7193 pub email_addresses: std::vec::Vec<std::string::String>,
7194
7195 /// Contains only valid 32-bit IPv4 addresses or RFC 4291 IPv6 addresses.
7196 pub ip_addresses: std::vec::Vec<std::string::String>,
7197
7198 /// Contains additional subject alternative name values.
7199 /// For each custom_san, the `value` field must contain an ASN.1 encoded
7200 /// UTF8String.
7201 pub custom_sans: std::vec::Vec<crate::model::X509Extension>,
7202
7203 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7204}
7205
7206impl SubjectAltNames {
7207 pub fn new() -> Self {
7208 std::default::Default::default()
7209 }
7210
7211 /// Sets the value of [dns_names][crate::model::SubjectAltNames::dns_names].
7212 ///
7213 /// # Example
7214 /// ```ignore,no_run
7215 /// # use google_cloud_security_privateca_v1::model::SubjectAltNames;
7216 /// let x = SubjectAltNames::new().set_dns_names(["a", "b", "c"]);
7217 /// ```
7218 pub fn set_dns_names<T, V>(mut self, v: T) -> Self
7219 where
7220 T: std::iter::IntoIterator<Item = V>,
7221 V: std::convert::Into<std::string::String>,
7222 {
7223 use std::iter::Iterator;
7224 self.dns_names = v.into_iter().map(|i| i.into()).collect();
7225 self
7226 }
7227
7228 /// Sets the value of [uris][crate::model::SubjectAltNames::uris].
7229 ///
7230 /// # Example
7231 /// ```ignore,no_run
7232 /// # use google_cloud_security_privateca_v1::model::SubjectAltNames;
7233 /// let x = SubjectAltNames::new().set_uris(["a", "b", "c"]);
7234 /// ```
7235 pub fn set_uris<T, V>(mut self, v: T) -> Self
7236 where
7237 T: std::iter::IntoIterator<Item = V>,
7238 V: std::convert::Into<std::string::String>,
7239 {
7240 use std::iter::Iterator;
7241 self.uris = v.into_iter().map(|i| i.into()).collect();
7242 self
7243 }
7244
7245 /// Sets the value of [email_addresses][crate::model::SubjectAltNames::email_addresses].
7246 ///
7247 /// # Example
7248 /// ```ignore,no_run
7249 /// # use google_cloud_security_privateca_v1::model::SubjectAltNames;
7250 /// let x = SubjectAltNames::new().set_email_addresses(["a", "b", "c"]);
7251 /// ```
7252 pub fn set_email_addresses<T, V>(mut self, v: T) -> Self
7253 where
7254 T: std::iter::IntoIterator<Item = V>,
7255 V: std::convert::Into<std::string::String>,
7256 {
7257 use std::iter::Iterator;
7258 self.email_addresses = v.into_iter().map(|i| i.into()).collect();
7259 self
7260 }
7261
7262 /// Sets the value of [ip_addresses][crate::model::SubjectAltNames::ip_addresses].
7263 ///
7264 /// # Example
7265 /// ```ignore,no_run
7266 /// # use google_cloud_security_privateca_v1::model::SubjectAltNames;
7267 /// let x = SubjectAltNames::new().set_ip_addresses(["a", "b", "c"]);
7268 /// ```
7269 pub fn set_ip_addresses<T, V>(mut self, v: T) -> Self
7270 where
7271 T: std::iter::IntoIterator<Item = V>,
7272 V: std::convert::Into<std::string::String>,
7273 {
7274 use std::iter::Iterator;
7275 self.ip_addresses = v.into_iter().map(|i| i.into()).collect();
7276 self
7277 }
7278
7279 /// Sets the value of [custom_sans][crate::model::SubjectAltNames::custom_sans].
7280 ///
7281 /// # Example
7282 /// ```ignore,no_run
7283 /// # use google_cloud_security_privateca_v1::model::SubjectAltNames;
7284 /// use google_cloud_security_privateca_v1::model::X509Extension;
7285 /// let x = SubjectAltNames::new()
7286 /// .set_custom_sans([
7287 /// X509Extension::default()/* use setters */,
7288 /// X509Extension::default()/* use (different) setters */,
7289 /// ]);
7290 /// ```
7291 pub fn set_custom_sans<T, V>(mut self, v: T) -> Self
7292 where
7293 T: std::iter::IntoIterator<Item = V>,
7294 V: std::convert::Into<crate::model::X509Extension>,
7295 {
7296 use std::iter::Iterator;
7297 self.custom_sans = v.into_iter().map(|i| i.into()).collect();
7298 self
7299 }
7300}
7301
7302impl wkt::message::Message for SubjectAltNames {
7303 fn typename() -> &'static str {
7304 "type.googleapis.com/google.cloud.security.privateca.v1.SubjectAltNames"
7305 }
7306}
7307
7308/// Describes constraints on a
7309/// [Certificate][google.cloud.security.privateca.v1.Certificate]'s
7310/// [Subject][google.cloud.security.privateca.v1.Subject] and
7311/// [SubjectAltNames][google.cloud.security.privateca.v1.SubjectAltNames].
7312///
7313/// [google.cloud.security.privateca.v1.Certificate]: crate::model::Certificate
7314/// [google.cloud.security.privateca.v1.Subject]: crate::model::Subject
7315/// [google.cloud.security.privateca.v1.SubjectAltNames]: crate::model::SubjectAltNames
7316#[derive(Clone, Default, PartialEq)]
7317#[non_exhaustive]
7318pub struct CertificateIdentityConstraints {
7319 /// Optional. A CEL expression that may be used to validate the resolved X.509
7320 /// Subject and/or Subject Alternative Name before a certificate is signed. To
7321 /// see the full allowed syntax and some examples, see
7322 /// <https://cloud.google.com/certificate-authority-service/docs/using-cel>
7323 pub cel_expression: std::option::Option<gtype::model::Expr>,
7324
7325 /// Required. If this is true, the
7326 /// [Subject][google.cloud.security.privateca.v1.Subject] field may be copied
7327 /// from a certificate request into the signed certificate. Otherwise, the
7328 /// requested [Subject][google.cloud.security.privateca.v1.Subject] will be
7329 /// discarded.
7330 ///
7331 /// [google.cloud.security.privateca.v1.Subject]: crate::model::Subject
7332 pub allow_subject_passthrough: std::option::Option<bool>,
7333
7334 /// Required. If this is true, the
7335 /// [SubjectAltNames][google.cloud.security.privateca.v1.SubjectAltNames]
7336 /// extension may be copied from a certificate request into the signed
7337 /// certificate. Otherwise, the requested
7338 /// [SubjectAltNames][google.cloud.security.privateca.v1.SubjectAltNames] will
7339 /// be discarded.
7340 ///
7341 /// [google.cloud.security.privateca.v1.SubjectAltNames]: crate::model::SubjectAltNames
7342 pub allow_subject_alt_names_passthrough: std::option::Option<bool>,
7343
7344 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7345}
7346
7347impl CertificateIdentityConstraints {
7348 pub fn new() -> Self {
7349 std::default::Default::default()
7350 }
7351
7352 /// Sets the value of [cel_expression][crate::model::CertificateIdentityConstraints::cel_expression].
7353 ///
7354 /// # Example
7355 /// ```ignore,no_run
7356 /// # use google_cloud_security_privateca_v1::model::CertificateIdentityConstraints;
7357 /// use gtype::model::Expr;
7358 /// let x = CertificateIdentityConstraints::new().set_cel_expression(Expr::default()/* use setters */);
7359 /// ```
7360 pub fn set_cel_expression<T>(mut self, v: T) -> Self
7361 where
7362 T: std::convert::Into<gtype::model::Expr>,
7363 {
7364 self.cel_expression = std::option::Option::Some(v.into());
7365 self
7366 }
7367
7368 /// Sets or clears the value of [cel_expression][crate::model::CertificateIdentityConstraints::cel_expression].
7369 ///
7370 /// # Example
7371 /// ```ignore,no_run
7372 /// # use google_cloud_security_privateca_v1::model::CertificateIdentityConstraints;
7373 /// use gtype::model::Expr;
7374 /// let x = CertificateIdentityConstraints::new().set_or_clear_cel_expression(Some(Expr::default()/* use setters */));
7375 /// let x = CertificateIdentityConstraints::new().set_or_clear_cel_expression(None::<Expr>);
7376 /// ```
7377 pub fn set_or_clear_cel_expression<T>(mut self, v: std::option::Option<T>) -> Self
7378 where
7379 T: std::convert::Into<gtype::model::Expr>,
7380 {
7381 self.cel_expression = v.map(|x| x.into());
7382 self
7383 }
7384
7385 /// Sets the value of [allow_subject_passthrough][crate::model::CertificateIdentityConstraints::allow_subject_passthrough].
7386 ///
7387 /// # Example
7388 /// ```ignore,no_run
7389 /// # use google_cloud_security_privateca_v1::model::CertificateIdentityConstraints;
7390 /// let x = CertificateIdentityConstraints::new().set_allow_subject_passthrough(true);
7391 /// ```
7392 pub fn set_allow_subject_passthrough<T>(mut self, v: T) -> Self
7393 where
7394 T: std::convert::Into<bool>,
7395 {
7396 self.allow_subject_passthrough = std::option::Option::Some(v.into());
7397 self
7398 }
7399
7400 /// Sets or clears the value of [allow_subject_passthrough][crate::model::CertificateIdentityConstraints::allow_subject_passthrough].
7401 ///
7402 /// # Example
7403 /// ```ignore,no_run
7404 /// # use google_cloud_security_privateca_v1::model::CertificateIdentityConstraints;
7405 /// let x = CertificateIdentityConstraints::new().set_or_clear_allow_subject_passthrough(Some(false));
7406 /// let x = CertificateIdentityConstraints::new().set_or_clear_allow_subject_passthrough(None::<bool>);
7407 /// ```
7408 pub fn set_or_clear_allow_subject_passthrough<T>(mut self, v: std::option::Option<T>) -> Self
7409 where
7410 T: std::convert::Into<bool>,
7411 {
7412 self.allow_subject_passthrough = v.map(|x| x.into());
7413 self
7414 }
7415
7416 /// Sets the value of [allow_subject_alt_names_passthrough][crate::model::CertificateIdentityConstraints::allow_subject_alt_names_passthrough].
7417 ///
7418 /// # Example
7419 /// ```ignore,no_run
7420 /// # use google_cloud_security_privateca_v1::model::CertificateIdentityConstraints;
7421 /// let x = CertificateIdentityConstraints::new().set_allow_subject_alt_names_passthrough(true);
7422 /// ```
7423 pub fn set_allow_subject_alt_names_passthrough<T>(mut self, v: T) -> Self
7424 where
7425 T: std::convert::Into<bool>,
7426 {
7427 self.allow_subject_alt_names_passthrough = std::option::Option::Some(v.into());
7428 self
7429 }
7430
7431 /// Sets or clears the value of [allow_subject_alt_names_passthrough][crate::model::CertificateIdentityConstraints::allow_subject_alt_names_passthrough].
7432 ///
7433 /// # Example
7434 /// ```ignore,no_run
7435 /// # use google_cloud_security_privateca_v1::model::CertificateIdentityConstraints;
7436 /// let x = CertificateIdentityConstraints::new().set_or_clear_allow_subject_alt_names_passthrough(Some(false));
7437 /// let x = CertificateIdentityConstraints::new().set_or_clear_allow_subject_alt_names_passthrough(None::<bool>);
7438 /// ```
7439 pub fn set_or_clear_allow_subject_alt_names_passthrough<T>(
7440 mut self,
7441 v: std::option::Option<T>,
7442 ) -> Self
7443 where
7444 T: std::convert::Into<bool>,
7445 {
7446 self.allow_subject_alt_names_passthrough = v.map(|x| x.into());
7447 self
7448 }
7449}
7450
7451impl wkt::message::Message for CertificateIdentityConstraints {
7452 fn typename() -> &'static str {
7453 "type.googleapis.com/google.cloud.security.privateca.v1.CertificateIdentityConstraints"
7454 }
7455}
7456
7457/// Describes a set of X.509 extensions that may be part of some certificate
7458/// issuance controls.
7459#[derive(Clone, Default, PartialEq)]
7460#[non_exhaustive]
7461pub struct CertificateExtensionConstraints {
7462 /// Optional. A set of named X.509 extensions. Will be combined with
7463 /// [additional_extensions][google.cloud.security.privateca.v1.CertificateExtensionConstraints.additional_extensions]
7464 /// to determine the full set of X.509 extensions.
7465 ///
7466 /// [google.cloud.security.privateca.v1.CertificateExtensionConstraints.additional_extensions]: crate::model::CertificateExtensionConstraints::additional_extensions
7467 pub known_extensions:
7468 std::vec::Vec<crate::model::certificate_extension_constraints::KnownCertificateExtension>,
7469
7470 /// Optional. A set of [ObjectIds][google.cloud.security.privateca.v1.ObjectId]
7471 /// identifying custom X.509 extensions. Will be combined with
7472 /// [known_extensions][google.cloud.security.privateca.v1.CertificateExtensionConstraints.known_extensions]
7473 /// to determine the full set of X.509 extensions.
7474 ///
7475 /// [google.cloud.security.privateca.v1.CertificateExtensionConstraints.known_extensions]: crate::model::CertificateExtensionConstraints::known_extensions
7476 /// [google.cloud.security.privateca.v1.ObjectId]: crate::model::ObjectId
7477 pub additional_extensions: std::vec::Vec<crate::model::ObjectId>,
7478
7479 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7480}
7481
7482impl CertificateExtensionConstraints {
7483 pub fn new() -> Self {
7484 std::default::Default::default()
7485 }
7486
7487 /// Sets the value of [known_extensions][crate::model::CertificateExtensionConstraints::known_extensions].
7488 ///
7489 /// # Example
7490 /// ```ignore,no_run
7491 /// # use google_cloud_security_privateca_v1::model::CertificateExtensionConstraints;
7492 /// use google_cloud_security_privateca_v1::model::certificate_extension_constraints::KnownCertificateExtension;
7493 /// let x = CertificateExtensionConstraints::new().set_known_extensions([
7494 /// KnownCertificateExtension::BaseKeyUsage,
7495 /// KnownCertificateExtension::ExtendedKeyUsage,
7496 /// KnownCertificateExtension::CaOptions,
7497 /// ]);
7498 /// ```
7499 pub fn set_known_extensions<T, V>(mut self, v: T) -> Self
7500 where
7501 T: std::iter::IntoIterator<Item = V>,
7502 V: std::convert::Into<
7503 crate::model::certificate_extension_constraints::KnownCertificateExtension,
7504 >,
7505 {
7506 use std::iter::Iterator;
7507 self.known_extensions = v.into_iter().map(|i| i.into()).collect();
7508 self
7509 }
7510
7511 /// Sets the value of [additional_extensions][crate::model::CertificateExtensionConstraints::additional_extensions].
7512 ///
7513 /// # Example
7514 /// ```ignore,no_run
7515 /// # use google_cloud_security_privateca_v1::model::CertificateExtensionConstraints;
7516 /// use google_cloud_security_privateca_v1::model::ObjectId;
7517 /// let x = CertificateExtensionConstraints::new()
7518 /// .set_additional_extensions([
7519 /// ObjectId::default()/* use setters */,
7520 /// ObjectId::default()/* use (different) setters */,
7521 /// ]);
7522 /// ```
7523 pub fn set_additional_extensions<T, V>(mut self, v: T) -> Self
7524 where
7525 T: std::iter::IntoIterator<Item = V>,
7526 V: std::convert::Into<crate::model::ObjectId>,
7527 {
7528 use std::iter::Iterator;
7529 self.additional_extensions = v.into_iter().map(|i| i.into()).collect();
7530 self
7531 }
7532}
7533
7534impl wkt::message::Message for CertificateExtensionConstraints {
7535 fn typename() -> &'static str {
7536 "type.googleapis.com/google.cloud.security.privateca.v1.CertificateExtensionConstraints"
7537 }
7538}
7539
7540/// Defines additional types related to [CertificateExtensionConstraints].
7541pub mod certificate_extension_constraints {
7542 #[allow(unused_imports)]
7543 use super::*;
7544
7545 /// Describes well-known X.509 extensions that can appear in a
7546 /// [Certificate][google.cloud.security.privateca.v1.Certificate], not
7547 /// including the
7548 /// [SubjectAltNames][google.cloud.security.privateca.v1.SubjectAltNames]
7549 /// extension.
7550 ///
7551 /// [google.cloud.security.privateca.v1.Certificate]: crate::model::Certificate
7552 /// [google.cloud.security.privateca.v1.SubjectAltNames]: crate::model::SubjectAltNames
7553 ///
7554 /// # Working with unknown values
7555 ///
7556 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7557 /// additional enum variants at any time. Adding new variants is not considered
7558 /// a breaking change. Applications should write their code in anticipation of:
7559 ///
7560 /// - New values appearing in future releases of the client library, **and**
7561 /// - New values received dynamically, without application changes.
7562 ///
7563 /// Please consult the [Working with enums] section in the user guide for some
7564 /// guidelines.
7565 ///
7566 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
7567 #[derive(Clone, Debug, PartialEq)]
7568 #[non_exhaustive]
7569 pub enum KnownCertificateExtension {
7570 /// Not specified.
7571 Unspecified,
7572 /// Refers to a certificate's Key Usage extension, as described in [RFC 5280
7573 /// section 4.2.1.3](https://tools.ietf.org/html/rfc5280#section-4.2.1.3).
7574 /// This corresponds to the
7575 /// [KeyUsage.base_key_usage][google.cloud.security.privateca.v1.KeyUsage.base_key_usage]
7576 /// field.
7577 ///
7578 /// [google.cloud.security.privateca.v1.KeyUsage.base_key_usage]: crate::model::KeyUsage::base_key_usage
7579 BaseKeyUsage,
7580 /// Refers to a certificate's Extended Key Usage extension, as described in
7581 /// [RFC 5280
7582 /// section 4.2.1.12](https://tools.ietf.org/html/rfc5280#section-4.2.1.12).
7583 /// This corresponds to the
7584 /// [KeyUsage.extended_key_usage][google.cloud.security.privateca.v1.KeyUsage.extended_key_usage]
7585 /// message.
7586 ///
7587 /// [google.cloud.security.privateca.v1.KeyUsage.extended_key_usage]: crate::model::KeyUsage::extended_key_usage
7588 ExtendedKeyUsage,
7589 /// Refers to a certificate's Basic Constraints extension, as described in
7590 /// [RFC 5280
7591 /// section 4.2.1.9](https://tools.ietf.org/html/rfc5280#section-4.2.1.9).
7592 /// This corresponds to the
7593 /// [X509Parameters.ca_options][google.cloud.security.privateca.v1.X509Parameters.ca_options]
7594 /// field.
7595 ///
7596 /// [google.cloud.security.privateca.v1.X509Parameters.ca_options]: crate::model::X509Parameters::ca_options
7597 CaOptions,
7598 /// Refers to a certificate's Policy object identifiers, as described in
7599 /// [RFC 5280
7600 /// section 4.2.1.4](https://tools.ietf.org/html/rfc5280#section-4.2.1.4).
7601 /// This corresponds to the
7602 /// [X509Parameters.policy_ids][google.cloud.security.privateca.v1.X509Parameters.policy_ids]
7603 /// field.
7604 ///
7605 /// [google.cloud.security.privateca.v1.X509Parameters.policy_ids]: crate::model::X509Parameters::policy_ids
7606 PolicyIds,
7607 /// Refers to OCSP servers in a certificate's Authority Information Access
7608 /// extension, as described in
7609 /// [RFC 5280
7610 /// section 4.2.2.1](https://tools.ietf.org/html/rfc5280#section-4.2.2.1),
7611 /// This corresponds to the
7612 /// [X509Parameters.aia_ocsp_servers][google.cloud.security.privateca.v1.X509Parameters.aia_ocsp_servers]
7613 /// field.
7614 ///
7615 /// [google.cloud.security.privateca.v1.X509Parameters.aia_ocsp_servers]: crate::model::X509Parameters::aia_ocsp_servers
7616 AiaOcspServers,
7617 /// Refers to Name Constraints extension as described in
7618 /// [RFC 5280
7619 /// section 4.2.1.10](https://tools.ietf.org/html/rfc5280#section-4.2.1.10)
7620 NameConstraints,
7621 /// If set, the enum was initialized with an unknown value.
7622 ///
7623 /// Applications can examine the value using [KnownCertificateExtension::value] or
7624 /// [KnownCertificateExtension::name].
7625 UnknownValue(known_certificate_extension::UnknownValue),
7626 }
7627
7628 #[doc(hidden)]
7629 pub mod known_certificate_extension {
7630 #[allow(unused_imports)]
7631 use super::*;
7632 #[derive(Clone, Debug, PartialEq)]
7633 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7634 }
7635
7636 impl KnownCertificateExtension {
7637 /// Gets the enum value.
7638 ///
7639 /// Returns `None` if the enum contains an unknown value deserialized from
7640 /// the string representation of enums.
7641 pub fn value(&self) -> std::option::Option<i32> {
7642 match self {
7643 Self::Unspecified => std::option::Option::Some(0),
7644 Self::BaseKeyUsage => std::option::Option::Some(1),
7645 Self::ExtendedKeyUsage => std::option::Option::Some(2),
7646 Self::CaOptions => std::option::Option::Some(3),
7647 Self::PolicyIds => std::option::Option::Some(4),
7648 Self::AiaOcspServers => std::option::Option::Some(5),
7649 Self::NameConstraints => std::option::Option::Some(6),
7650 Self::UnknownValue(u) => u.0.value(),
7651 }
7652 }
7653
7654 /// Gets the enum value as a string.
7655 ///
7656 /// Returns `None` if the enum contains an unknown value deserialized from
7657 /// the integer representation of enums.
7658 pub fn name(&self) -> std::option::Option<&str> {
7659 match self {
7660 Self::Unspecified => {
7661 std::option::Option::Some("KNOWN_CERTIFICATE_EXTENSION_UNSPECIFIED")
7662 }
7663 Self::BaseKeyUsage => std::option::Option::Some("BASE_KEY_USAGE"),
7664 Self::ExtendedKeyUsage => std::option::Option::Some("EXTENDED_KEY_USAGE"),
7665 Self::CaOptions => std::option::Option::Some("CA_OPTIONS"),
7666 Self::PolicyIds => std::option::Option::Some("POLICY_IDS"),
7667 Self::AiaOcspServers => std::option::Option::Some("AIA_OCSP_SERVERS"),
7668 Self::NameConstraints => std::option::Option::Some("NAME_CONSTRAINTS"),
7669 Self::UnknownValue(u) => u.0.name(),
7670 }
7671 }
7672 }
7673
7674 impl std::default::Default for KnownCertificateExtension {
7675 fn default() -> Self {
7676 use std::convert::From;
7677 Self::from(0)
7678 }
7679 }
7680
7681 impl std::fmt::Display for KnownCertificateExtension {
7682 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7683 wkt::internal::display_enum(f, self.name(), self.value())
7684 }
7685 }
7686
7687 impl std::convert::From<i32> for KnownCertificateExtension {
7688 fn from(value: i32) -> Self {
7689 match value {
7690 0 => Self::Unspecified,
7691 1 => Self::BaseKeyUsage,
7692 2 => Self::ExtendedKeyUsage,
7693 3 => Self::CaOptions,
7694 4 => Self::PolicyIds,
7695 5 => Self::AiaOcspServers,
7696 6 => Self::NameConstraints,
7697 _ => Self::UnknownValue(known_certificate_extension::UnknownValue(
7698 wkt::internal::UnknownEnumValue::Integer(value),
7699 )),
7700 }
7701 }
7702 }
7703
7704 impl std::convert::From<&str> for KnownCertificateExtension {
7705 fn from(value: &str) -> Self {
7706 use std::string::ToString;
7707 match value {
7708 "KNOWN_CERTIFICATE_EXTENSION_UNSPECIFIED" => Self::Unspecified,
7709 "BASE_KEY_USAGE" => Self::BaseKeyUsage,
7710 "EXTENDED_KEY_USAGE" => Self::ExtendedKeyUsage,
7711 "CA_OPTIONS" => Self::CaOptions,
7712 "POLICY_IDS" => Self::PolicyIds,
7713 "AIA_OCSP_SERVERS" => Self::AiaOcspServers,
7714 "NAME_CONSTRAINTS" => Self::NameConstraints,
7715 _ => Self::UnknownValue(known_certificate_extension::UnknownValue(
7716 wkt::internal::UnknownEnumValue::String(value.to_string()),
7717 )),
7718 }
7719 }
7720 }
7721
7722 impl serde::ser::Serialize for KnownCertificateExtension {
7723 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7724 where
7725 S: serde::Serializer,
7726 {
7727 match self {
7728 Self::Unspecified => serializer.serialize_i32(0),
7729 Self::BaseKeyUsage => serializer.serialize_i32(1),
7730 Self::ExtendedKeyUsage => serializer.serialize_i32(2),
7731 Self::CaOptions => serializer.serialize_i32(3),
7732 Self::PolicyIds => serializer.serialize_i32(4),
7733 Self::AiaOcspServers => serializer.serialize_i32(5),
7734 Self::NameConstraints => serializer.serialize_i32(6),
7735 Self::UnknownValue(u) => u.0.serialize(serializer),
7736 }
7737 }
7738 }
7739
7740 impl<'de> serde::de::Deserialize<'de> for KnownCertificateExtension {
7741 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7742 where
7743 D: serde::Deserializer<'de>,
7744 {
7745 deserializer.deserialize_any(wkt::internal::EnumVisitor::<KnownCertificateExtension>::new(
7746 ".google.cloud.security.privateca.v1.CertificateExtensionConstraints.KnownCertificateExtension"))
7747 }
7748 }
7749}
7750
7751/// Request message for
7752/// [CertificateAuthorityService.CreateCertificate][google.cloud.security.privateca.v1.CertificateAuthorityService.CreateCertificate].
7753///
7754/// [google.cloud.security.privateca.v1.CertificateAuthorityService.CreateCertificate]: crate::client::CertificateAuthorityService::create_certificate
7755#[derive(Clone, Default, PartialEq)]
7756#[non_exhaustive]
7757pub struct CreateCertificateRequest {
7758 /// Required. The resource name of the
7759 /// [CaPool][google.cloud.security.privateca.v1.CaPool] associated with the
7760 /// [Certificate][google.cloud.security.privateca.v1.Certificate], in the
7761 /// format `projects/*/locations/*/caPools/*`.
7762 ///
7763 /// [google.cloud.security.privateca.v1.CaPool]: crate::model::CaPool
7764 /// [google.cloud.security.privateca.v1.Certificate]: crate::model::Certificate
7765 pub parent: std::string::String,
7766
7767 /// Optional. It must be unique within a location and match the regular
7768 /// expression `[a-zA-Z0-9_-]{1,63}`. This field is required when using a
7769 /// [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]
7770 /// in the Enterprise
7771 /// [CertificateAuthority.tier][google.cloud.security.privateca.v1.CertificateAuthority.tier],
7772 /// but is optional and its value is ignored otherwise.
7773 ///
7774 /// [google.cloud.security.privateca.v1.CertificateAuthority]: crate::model::CertificateAuthority
7775 /// [google.cloud.security.privateca.v1.CertificateAuthority.tier]: crate::model::CertificateAuthority::tier
7776 pub certificate_id: std::string::String,
7777
7778 /// Required. A [Certificate][google.cloud.security.privateca.v1.Certificate]
7779 /// with initial field values.
7780 ///
7781 /// [google.cloud.security.privateca.v1.Certificate]: crate::model::Certificate
7782 pub certificate: std::option::Option<crate::model::Certificate>,
7783
7784 /// Optional. An ID to identify requests. Specify a unique request ID so that
7785 /// if you must retry your request, the server will know to ignore the request
7786 /// if it has already been completed. The server will guarantee that for at
7787 /// least 60 minutes since the first request.
7788 ///
7789 /// For example, consider a situation where you make an initial request and the
7790 /// request times out. If you make the request again with the same request ID,
7791 /// the server can check if original operation with the same request ID was
7792 /// received, and if so, will ignore the second request. This prevents clients
7793 /// from accidentally creating duplicate commitments.
7794 ///
7795 /// The request ID must be a valid UUID with the exception that zero UUID is
7796 /// not supported (00000000-0000-0000-0000-000000000000).
7797 pub request_id: std::string::String,
7798
7799 /// Optional. If this is true, no
7800 /// [Certificate][google.cloud.security.privateca.v1.Certificate] resource will
7801 /// be persisted regardless of the
7802 /// [CaPool][google.cloud.security.privateca.v1.CaPool]'s
7803 /// [tier][google.cloud.security.privateca.v1.CaPool.tier], and the returned
7804 /// [Certificate][google.cloud.security.privateca.v1.Certificate] will not
7805 /// contain the
7806 /// [pem_certificate][google.cloud.security.privateca.v1.Certificate.pem_certificate]
7807 /// field.
7808 ///
7809 /// [google.cloud.security.privateca.v1.CaPool]: crate::model::CaPool
7810 /// [google.cloud.security.privateca.v1.CaPool.tier]: crate::model::CaPool::tier
7811 /// [google.cloud.security.privateca.v1.Certificate]: crate::model::Certificate
7812 /// [google.cloud.security.privateca.v1.Certificate.pem_certificate]: crate::model::Certificate::pem_certificate
7813 pub validate_only: bool,
7814
7815 /// Optional. The resource ID of the
7816 /// [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]
7817 /// that should issue the certificate. This optional field will ignore the
7818 /// load-balancing scheme of the Pool and directly issue the certificate from
7819 /// the CA with the specified ID, contained in the same
7820 /// [CaPool][google.cloud.security.privateca.v1.CaPool] referenced by `parent`.
7821 /// Per-CA quota rules apply. If left empty, a
7822 /// [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]
7823 /// will be chosen from the [CaPool][google.cloud.security.privateca.v1.CaPool]
7824 /// by the service. For example, to issue a
7825 /// [Certificate][google.cloud.security.privateca.v1.Certificate] from a
7826 /// Certificate Authority with resource name
7827 /// "projects/my-project/locations/us-central1/caPools/my-pool/certificateAuthorities/my-ca",
7828 /// you can set the
7829 /// [parent][google.cloud.security.privateca.v1.CreateCertificateRequest.parent]
7830 /// to "projects/my-project/locations/us-central1/caPools/my-pool" and the
7831 /// [issuing_certificate_authority_id][google.cloud.security.privateca.v1.CreateCertificateRequest.issuing_certificate_authority_id]
7832 /// to "my-ca".
7833 ///
7834 /// [google.cloud.security.privateca.v1.CaPool]: crate::model::CaPool
7835 /// [google.cloud.security.privateca.v1.Certificate]: crate::model::Certificate
7836 /// [google.cloud.security.privateca.v1.CertificateAuthority]: crate::model::CertificateAuthority
7837 /// [google.cloud.security.privateca.v1.CreateCertificateRequest.issuing_certificate_authority_id]: crate::model::CreateCertificateRequest::issuing_certificate_authority_id
7838 /// [google.cloud.security.privateca.v1.CreateCertificateRequest.parent]: crate::model::CreateCertificateRequest::parent
7839 pub issuing_certificate_authority_id: std::string::String,
7840
7841 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7842}
7843
7844impl CreateCertificateRequest {
7845 pub fn new() -> Self {
7846 std::default::Default::default()
7847 }
7848
7849 /// Sets the value of [parent][crate::model::CreateCertificateRequest::parent].
7850 ///
7851 /// # Example
7852 /// ```ignore,no_run
7853 /// # use google_cloud_security_privateca_v1::model::CreateCertificateRequest;
7854 /// let x = CreateCertificateRequest::new().set_parent("example");
7855 /// ```
7856 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7857 self.parent = v.into();
7858 self
7859 }
7860
7861 /// Sets the value of [certificate_id][crate::model::CreateCertificateRequest::certificate_id].
7862 ///
7863 /// # Example
7864 /// ```ignore,no_run
7865 /// # use google_cloud_security_privateca_v1::model::CreateCertificateRequest;
7866 /// let x = CreateCertificateRequest::new().set_certificate_id("example");
7867 /// ```
7868 pub fn set_certificate_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7869 self.certificate_id = v.into();
7870 self
7871 }
7872
7873 /// Sets the value of [certificate][crate::model::CreateCertificateRequest::certificate].
7874 ///
7875 /// # Example
7876 /// ```ignore,no_run
7877 /// # use google_cloud_security_privateca_v1::model::CreateCertificateRequest;
7878 /// use google_cloud_security_privateca_v1::model::Certificate;
7879 /// let x = CreateCertificateRequest::new().set_certificate(Certificate::default()/* use setters */);
7880 /// ```
7881 pub fn set_certificate<T>(mut self, v: T) -> Self
7882 where
7883 T: std::convert::Into<crate::model::Certificate>,
7884 {
7885 self.certificate = std::option::Option::Some(v.into());
7886 self
7887 }
7888
7889 /// Sets or clears the value of [certificate][crate::model::CreateCertificateRequest::certificate].
7890 ///
7891 /// # Example
7892 /// ```ignore,no_run
7893 /// # use google_cloud_security_privateca_v1::model::CreateCertificateRequest;
7894 /// use google_cloud_security_privateca_v1::model::Certificate;
7895 /// let x = CreateCertificateRequest::new().set_or_clear_certificate(Some(Certificate::default()/* use setters */));
7896 /// let x = CreateCertificateRequest::new().set_or_clear_certificate(None::<Certificate>);
7897 /// ```
7898 pub fn set_or_clear_certificate<T>(mut self, v: std::option::Option<T>) -> Self
7899 where
7900 T: std::convert::Into<crate::model::Certificate>,
7901 {
7902 self.certificate = v.map(|x| x.into());
7903 self
7904 }
7905
7906 /// Sets the value of [request_id][crate::model::CreateCertificateRequest::request_id].
7907 ///
7908 /// # Example
7909 /// ```ignore,no_run
7910 /// # use google_cloud_security_privateca_v1::model::CreateCertificateRequest;
7911 /// let x = CreateCertificateRequest::new().set_request_id("example");
7912 /// ```
7913 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7914 self.request_id = v.into();
7915 self
7916 }
7917
7918 /// Sets the value of [validate_only][crate::model::CreateCertificateRequest::validate_only].
7919 ///
7920 /// # Example
7921 /// ```ignore,no_run
7922 /// # use google_cloud_security_privateca_v1::model::CreateCertificateRequest;
7923 /// let x = CreateCertificateRequest::new().set_validate_only(true);
7924 /// ```
7925 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7926 self.validate_only = v.into();
7927 self
7928 }
7929
7930 /// Sets the value of [issuing_certificate_authority_id][crate::model::CreateCertificateRequest::issuing_certificate_authority_id].
7931 ///
7932 /// # Example
7933 /// ```ignore,no_run
7934 /// # use google_cloud_security_privateca_v1::model::CreateCertificateRequest;
7935 /// let x = CreateCertificateRequest::new().set_issuing_certificate_authority_id("example");
7936 /// ```
7937 pub fn set_issuing_certificate_authority_id<T: std::convert::Into<std::string::String>>(
7938 mut self,
7939 v: T,
7940 ) -> Self {
7941 self.issuing_certificate_authority_id = v.into();
7942 self
7943 }
7944}
7945
7946impl wkt::message::Message for CreateCertificateRequest {
7947 fn typename() -> &'static str {
7948 "type.googleapis.com/google.cloud.security.privateca.v1.CreateCertificateRequest"
7949 }
7950}
7951
7952/// Request message for
7953/// [CertificateAuthorityService.GetCertificate][google.cloud.security.privateca.v1.CertificateAuthorityService.GetCertificate].
7954///
7955/// [google.cloud.security.privateca.v1.CertificateAuthorityService.GetCertificate]: crate::client::CertificateAuthorityService::get_certificate
7956#[derive(Clone, Default, PartialEq)]
7957#[non_exhaustive]
7958pub struct GetCertificateRequest {
7959 /// Required. The [name][google.cloud.security.privateca.v1.Certificate.name]
7960 /// of the [Certificate][google.cloud.security.privateca.v1.Certificate] to
7961 /// get.
7962 ///
7963 /// [google.cloud.security.privateca.v1.Certificate]: crate::model::Certificate
7964 /// [google.cloud.security.privateca.v1.Certificate.name]: crate::model::Certificate::name
7965 pub name: std::string::String,
7966
7967 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7968}
7969
7970impl GetCertificateRequest {
7971 pub fn new() -> Self {
7972 std::default::Default::default()
7973 }
7974
7975 /// Sets the value of [name][crate::model::GetCertificateRequest::name].
7976 ///
7977 /// # Example
7978 /// ```ignore,no_run
7979 /// # use google_cloud_security_privateca_v1::model::GetCertificateRequest;
7980 /// let x = GetCertificateRequest::new().set_name("example");
7981 /// ```
7982 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7983 self.name = v.into();
7984 self
7985 }
7986}
7987
7988impl wkt::message::Message for GetCertificateRequest {
7989 fn typename() -> &'static str {
7990 "type.googleapis.com/google.cloud.security.privateca.v1.GetCertificateRequest"
7991 }
7992}
7993
7994/// Request message for
7995/// [CertificateAuthorityService.ListCertificates][google.cloud.security.privateca.v1.CertificateAuthorityService.ListCertificates].
7996///
7997/// [google.cloud.security.privateca.v1.CertificateAuthorityService.ListCertificates]: crate::client::CertificateAuthorityService::list_certificates
7998#[derive(Clone, Default, PartialEq)]
7999#[non_exhaustive]
8000pub struct ListCertificatesRequest {
8001 /// Required. The resource name of the location associated with the
8002 /// [Certificates][google.cloud.security.privateca.v1.Certificate], in the
8003 /// format `projects/*/locations/*/caPools/*`.
8004 ///
8005 /// [google.cloud.security.privateca.v1.Certificate]: crate::model::Certificate
8006 pub parent: std::string::String,
8007
8008 /// Optional. Limit on the number of
8009 /// [Certificates][google.cloud.security.privateca.v1.Certificate] to include
8010 /// in the response. Further
8011 /// [Certificates][google.cloud.security.privateca.v1.Certificate] can
8012 /// subsequently be obtained by including the
8013 /// [ListCertificatesResponse.next_page_token][google.cloud.security.privateca.v1.ListCertificatesResponse.next_page_token]
8014 /// in a subsequent request. If unspecified, the server will pick an
8015 /// appropriate default.
8016 ///
8017 /// [google.cloud.security.privateca.v1.Certificate]: crate::model::Certificate
8018 /// [google.cloud.security.privateca.v1.ListCertificatesResponse.next_page_token]: crate::model::ListCertificatesResponse::next_page_token
8019 pub page_size: i32,
8020
8021 /// Optional. Pagination token, returned earlier via
8022 /// [ListCertificatesResponse.next_page_token][google.cloud.security.privateca.v1.ListCertificatesResponse.next_page_token].
8023 ///
8024 /// [google.cloud.security.privateca.v1.ListCertificatesResponse.next_page_token]: crate::model::ListCertificatesResponse::next_page_token
8025 pub page_token: std::string::String,
8026
8027 /// Optional. Only include resources that match the filter in the response. For
8028 /// details on supported filters and syntax, see [Certificates Filtering
8029 /// documentation](https://cloud.google.com/certificate-authority-service/docs/sorting-filtering-certificates#filtering_support).
8030 pub filter: std::string::String,
8031
8032 /// Optional. Specify how the results should be sorted. For details on
8033 /// supported fields and syntax, see [Certificates Sorting
8034 /// documentation](https://cloud.google.com/certificate-authority-service/docs/sorting-filtering-certificates#sorting_support).
8035 pub order_by: std::string::String,
8036
8037 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8038}
8039
8040impl ListCertificatesRequest {
8041 pub fn new() -> Self {
8042 std::default::Default::default()
8043 }
8044
8045 /// Sets the value of [parent][crate::model::ListCertificatesRequest::parent].
8046 ///
8047 /// # Example
8048 /// ```ignore,no_run
8049 /// # use google_cloud_security_privateca_v1::model::ListCertificatesRequest;
8050 /// let x = ListCertificatesRequest::new().set_parent("example");
8051 /// ```
8052 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8053 self.parent = v.into();
8054 self
8055 }
8056
8057 /// Sets the value of [page_size][crate::model::ListCertificatesRequest::page_size].
8058 ///
8059 /// # Example
8060 /// ```ignore,no_run
8061 /// # use google_cloud_security_privateca_v1::model::ListCertificatesRequest;
8062 /// let x = ListCertificatesRequest::new().set_page_size(42);
8063 /// ```
8064 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8065 self.page_size = v.into();
8066 self
8067 }
8068
8069 /// Sets the value of [page_token][crate::model::ListCertificatesRequest::page_token].
8070 ///
8071 /// # Example
8072 /// ```ignore,no_run
8073 /// # use google_cloud_security_privateca_v1::model::ListCertificatesRequest;
8074 /// let x = ListCertificatesRequest::new().set_page_token("example");
8075 /// ```
8076 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8077 self.page_token = v.into();
8078 self
8079 }
8080
8081 /// Sets the value of [filter][crate::model::ListCertificatesRequest::filter].
8082 ///
8083 /// # Example
8084 /// ```ignore,no_run
8085 /// # use google_cloud_security_privateca_v1::model::ListCertificatesRequest;
8086 /// let x = ListCertificatesRequest::new().set_filter("example");
8087 /// ```
8088 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8089 self.filter = v.into();
8090 self
8091 }
8092
8093 /// Sets the value of [order_by][crate::model::ListCertificatesRequest::order_by].
8094 ///
8095 /// # Example
8096 /// ```ignore,no_run
8097 /// # use google_cloud_security_privateca_v1::model::ListCertificatesRequest;
8098 /// let x = ListCertificatesRequest::new().set_order_by("example");
8099 /// ```
8100 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8101 self.order_by = v.into();
8102 self
8103 }
8104}
8105
8106impl wkt::message::Message for ListCertificatesRequest {
8107 fn typename() -> &'static str {
8108 "type.googleapis.com/google.cloud.security.privateca.v1.ListCertificatesRequest"
8109 }
8110}
8111
8112/// Response message for
8113/// [CertificateAuthorityService.ListCertificates][google.cloud.security.privateca.v1.CertificateAuthorityService.ListCertificates].
8114///
8115/// [google.cloud.security.privateca.v1.CertificateAuthorityService.ListCertificates]: crate::client::CertificateAuthorityService::list_certificates
8116#[derive(Clone, Default, PartialEq)]
8117#[non_exhaustive]
8118pub struct ListCertificatesResponse {
8119 /// The list of [Certificates][google.cloud.security.privateca.v1.Certificate].
8120 ///
8121 /// [google.cloud.security.privateca.v1.Certificate]: crate::model::Certificate
8122 pub certificates: std::vec::Vec<crate::model::Certificate>,
8123
8124 /// A token to retrieve next page of results. Pass this value in
8125 /// [ListCertificatesRequest.page_token][google.cloud.security.privateca.v1.ListCertificatesRequest.page_token]
8126 /// to retrieve the next page of results.
8127 ///
8128 /// [google.cloud.security.privateca.v1.ListCertificatesRequest.page_token]: crate::model::ListCertificatesRequest::page_token
8129 pub next_page_token: std::string::String,
8130
8131 /// A list of locations (e.g. "us-west1") that could not be reached.
8132 pub unreachable: std::vec::Vec<std::string::String>,
8133
8134 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8135}
8136
8137impl ListCertificatesResponse {
8138 pub fn new() -> Self {
8139 std::default::Default::default()
8140 }
8141
8142 /// Sets the value of [certificates][crate::model::ListCertificatesResponse::certificates].
8143 ///
8144 /// # Example
8145 /// ```ignore,no_run
8146 /// # use google_cloud_security_privateca_v1::model::ListCertificatesResponse;
8147 /// use google_cloud_security_privateca_v1::model::Certificate;
8148 /// let x = ListCertificatesResponse::new()
8149 /// .set_certificates([
8150 /// Certificate::default()/* use setters */,
8151 /// Certificate::default()/* use (different) setters */,
8152 /// ]);
8153 /// ```
8154 pub fn set_certificates<T, V>(mut self, v: T) -> Self
8155 where
8156 T: std::iter::IntoIterator<Item = V>,
8157 V: std::convert::Into<crate::model::Certificate>,
8158 {
8159 use std::iter::Iterator;
8160 self.certificates = v.into_iter().map(|i| i.into()).collect();
8161 self
8162 }
8163
8164 /// Sets the value of [next_page_token][crate::model::ListCertificatesResponse::next_page_token].
8165 ///
8166 /// # Example
8167 /// ```ignore,no_run
8168 /// # use google_cloud_security_privateca_v1::model::ListCertificatesResponse;
8169 /// let x = ListCertificatesResponse::new().set_next_page_token("example");
8170 /// ```
8171 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8172 self.next_page_token = v.into();
8173 self
8174 }
8175
8176 /// Sets the value of [unreachable][crate::model::ListCertificatesResponse::unreachable].
8177 ///
8178 /// # Example
8179 /// ```ignore,no_run
8180 /// # use google_cloud_security_privateca_v1::model::ListCertificatesResponse;
8181 /// let x = ListCertificatesResponse::new().set_unreachable(["a", "b", "c"]);
8182 /// ```
8183 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
8184 where
8185 T: std::iter::IntoIterator<Item = V>,
8186 V: std::convert::Into<std::string::String>,
8187 {
8188 use std::iter::Iterator;
8189 self.unreachable = v.into_iter().map(|i| i.into()).collect();
8190 self
8191 }
8192}
8193
8194impl wkt::message::Message for ListCertificatesResponse {
8195 fn typename() -> &'static str {
8196 "type.googleapis.com/google.cloud.security.privateca.v1.ListCertificatesResponse"
8197 }
8198}
8199
8200#[doc(hidden)]
8201impl gax::paginator::internal::PageableResponse for ListCertificatesResponse {
8202 type PageItem = crate::model::Certificate;
8203
8204 fn items(self) -> std::vec::Vec<Self::PageItem> {
8205 self.certificates
8206 }
8207
8208 fn next_page_token(&self) -> std::string::String {
8209 use std::clone::Clone;
8210 self.next_page_token.clone()
8211 }
8212}
8213
8214/// Request message for
8215/// [CertificateAuthorityService.RevokeCertificate][google.cloud.security.privateca.v1.CertificateAuthorityService.RevokeCertificate].
8216///
8217/// [google.cloud.security.privateca.v1.CertificateAuthorityService.RevokeCertificate]: crate::client::CertificateAuthorityService::revoke_certificate
8218#[derive(Clone, Default, PartialEq)]
8219#[non_exhaustive]
8220pub struct RevokeCertificateRequest {
8221 /// Required. The resource name for this
8222 /// [Certificate][google.cloud.security.privateca.v1.Certificate] in the format
8223 /// `projects/*/locations/*/caPools/*/certificates/*`.
8224 ///
8225 /// [google.cloud.security.privateca.v1.Certificate]: crate::model::Certificate
8226 pub name: std::string::String,
8227
8228 /// Required. The
8229 /// [RevocationReason][google.cloud.security.privateca.v1.RevocationReason] for
8230 /// revoking this certificate.
8231 ///
8232 /// [google.cloud.security.privateca.v1.RevocationReason]: crate::model::RevocationReason
8233 pub reason: crate::model::RevocationReason,
8234
8235 /// Optional. An ID to identify requests. Specify a unique request ID so that
8236 /// if you must retry your request, the server will know to ignore the request
8237 /// if it has already been completed. The server will guarantee that for at
8238 /// least 60 minutes since the first request.
8239 ///
8240 /// For example, consider a situation where you make an initial request and
8241 /// the request times out. If you make the request again with the same request
8242 /// ID, the server can check if original operation with the same request ID
8243 /// was received, and if so, will ignore the second request. This prevents
8244 /// clients from accidentally creating duplicate commitments.
8245 ///
8246 /// The request ID must be a valid UUID with the exception that zero UUID is
8247 /// not supported (00000000-0000-0000-0000-000000000000).
8248 pub request_id: std::string::String,
8249
8250 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8251}
8252
8253impl RevokeCertificateRequest {
8254 pub fn new() -> Self {
8255 std::default::Default::default()
8256 }
8257
8258 /// Sets the value of [name][crate::model::RevokeCertificateRequest::name].
8259 ///
8260 /// # Example
8261 /// ```ignore,no_run
8262 /// # use google_cloud_security_privateca_v1::model::RevokeCertificateRequest;
8263 /// let x = RevokeCertificateRequest::new().set_name("example");
8264 /// ```
8265 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8266 self.name = v.into();
8267 self
8268 }
8269
8270 /// Sets the value of [reason][crate::model::RevokeCertificateRequest::reason].
8271 ///
8272 /// # Example
8273 /// ```ignore,no_run
8274 /// # use google_cloud_security_privateca_v1::model::RevokeCertificateRequest;
8275 /// use google_cloud_security_privateca_v1::model::RevocationReason;
8276 /// let x0 = RevokeCertificateRequest::new().set_reason(RevocationReason::KeyCompromise);
8277 /// let x1 = RevokeCertificateRequest::new().set_reason(RevocationReason::CertificateAuthorityCompromise);
8278 /// let x2 = RevokeCertificateRequest::new().set_reason(RevocationReason::AffiliationChanged);
8279 /// ```
8280 pub fn set_reason<T: std::convert::Into<crate::model::RevocationReason>>(
8281 mut self,
8282 v: T,
8283 ) -> Self {
8284 self.reason = v.into();
8285 self
8286 }
8287
8288 /// Sets the value of [request_id][crate::model::RevokeCertificateRequest::request_id].
8289 ///
8290 /// # Example
8291 /// ```ignore,no_run
8292 /// # use google_cloud_security_privateca_v1::model::RevokeCertificateRequest;
8293 /// let x = RevokeCertificateRequest::new().set_request_id("example");
8294 /// ```
8295 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8296 self.request_id = v.into();
8297 self
8298 }
8299}
8300
8301impl wkt::message::Message for RevokeCertificateRequest {
8302 fn typename() -> &'static str {
8303 "type.googleapis.com/google.cloud.security.privateca.v1.RevokeCertificateRequest"
8304 }
8305}
8306
8307/// Request message for
8308/// [CertificateAuthorityService.UpdateCertificate][google.cloud.security.privateca.v1.CertificateAuthorityService.UpdateCertificate].
8309///
8310/// [google.cloud.security.privateca.v1.CertificateAuthorityService.UpdateCertificate]: crate::client::CertificateAuthorityService::update_certificate
8311#[derive(Clone, Default, PartialEq)]
8312#[non_exhaustive]
8313pub struct UpdateCertificateRequest {
8314 /// Required. [Certificate][google.cloud.security.privateca.v1.Certificate]
8315 /// with updated values.
8316 ///
8317 /// [google.cloud.security.privateca.v1.Certificate]: crate::model::Certificate
8318 pub certificate: std::option::Option<crate::model::Certificate>,
8319
8320 /// Required. A list of fields to be updated in this request.
8321 pub update_mask: std::option::Option<wkt::FieldMask>,
8322
8323 /// Optional. An ID to identify requests. Specify a unique request ID so that
8324 /// if you must retry your request, the server will know to ignore the request
8325 /// if it has already been completed. The server will guarantee that for at
8326 /// least 60 minutes since the first request.
8327 ///
8328 /// For example, consider a situation where you make an initial request and
8329 /// the request times out. If you make the request again with the same request
8330 /// ID, the server can check if original operation with the same request ID
8331 /// was received, and if so, will ignore the second request. This prevents
8332 /// clients from accidentally creating duplicate commitments.
8333 ///
8334 /// The request ID must be a valid UUID with the exception that zero UUID is
8335 /// not supported (00000000-0000-0000-0000-000000000000).
8336 pub request_id: std::string::String,
8337
8338 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8339}
8340
8341impl UpdateCertificateRequest {
8342 pub fn new() -> Self {
8343 std::default::Default::default()
8344 }
8345
8346 /// Sets the value of [certificate][crate::model::UpdateCertificateRequest::certificate].
8347 ///
8348 /// # Example
8349 /// ```ignore,no_run
8350 /// # use google_cloud_security_privateca_v1::model::UpdateCertificateRequest;
8351 /// use google_cloud_security_privateca_v1::model::Certificate;
8352 /// let x = UpdateCertificateRequest::new().set_certificate(Certificate::default()/* use setters */);
8353 /// ```
8354 pub fn set_certificate<T>(mut self, v: T) -> Self
8355 where
8356 T: std::convert::Into<crate::model::Certificate>,
8357 {
8358 self.certificate = std::option::Option::Some(v.into());
8359 self
8360 }
8361
8362 /// Sets or clears the value of [certificate][crate::model::UpdateCertificateRequest::certificate].
8363 ///
8364 /// # Example
8365 /// ```ignore,no_run
8366 /// # use google_cloud_security_privateca_v1::model::UpdateCertificateRequest;
8367 /// use google_cloud_security_privateca_v1::model::Certificate;
8368 /// let x = UpdateCertificateRequest::new().set_or_clear_certificate(Some(Certificate::default()/* use setters */));
8369 /// let x = UpdateCertificateRequest::new().set_or_clear_certificate(None::<Certificate>);
8370 /// ```
8371 pub fn set_or_clear_certificate<T>(mut self, v: std::option::Option<T>) -> Self
8372 where
8373 T: std::convert::Into<crate::model::Certificate>,
8374 {
8375 self.certificate = v.map(|x| x.into());
8376 self
8377 }
8378
8379 /// Sets the value of [update_mask][crate::model::UpdateCertificateRequest::update_mask].
8380 ///
8381 /// # Example
8382 /// ```ignore,no_run
8383 /// # use google_cloud_security_privateca_v1::model::UpdateCertificateRequest;
8384 /// use wkt::FieldMask;
8385 /// let x = UpdateCertificateRequest::new().set_update_mask(FieldMask::default()/* use setters */);
8386 /// ```
8387 pub fn set_update_mask<T>(mut self, v: T) -> Self
8388 where
8389 T: std::convert::Into<wkt::FieldMask>,
8390 {
8391 self.update_mask = std::option::Option::Some(v.into());
8392 self
8393 }
8394
8395 /// Sets or clears the value of [update_mask][crate::model::UpdateCertificateRequest::update_mask].
8396 ///
8397 /// # Example
8398 /// ```ignore,no_run
8399 /// # use google_cloud_security_privateca_v1::model::UpdateCertificateRequest;
8400 /// use wkt::FieldMask;
8401 /// let x = UpdateCertificateRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
8402 /// let x = UpdateCertificateRequest::new().set_or_clear_update_mask(None::<FieldMask>);
8403 /// ```
8404 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
8405 where
8406 T: std::convert::Into<wkt::FieldMask>,
8407 {
8408 self.update_mask = v.map(|x| x.into());
8409 self
8410 }
8411
8412 /// Sets the value of [request_id][crate::model::UpdateCertificateRequest::request_id].
8413 ///
8414 /// # Example
8415 /// ```ignore,no_run
8416 /// # use google_cloud_security_privateca_v1::model::UpdateCertificateRequest;
8417 /// let x = UpdateCertificateRequest::new().set_request_id("example");
8418 /// ```
8419 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8420 self.request_id = v.into();
8421 self
8422 }
8423}
8424
8425impl wkt::message::Message for UpdateCertificateRequest {
8426 fn typename() -> &'static str {
8427 "type.googleapis.com/google.cloud.security.privateca.v1.UpdateCertificateRequest"
8428 }
8429}
8430
8431/// Request message for
8432/// [CertificateAuthorityService.ActivateCertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthorityService.ActivateCertificateAuthority].
8433///
8434/// [google.cloud.security.privateca.v1.CertificateAuthorityService.ActivateCertificateAuthority]: crate::client::CertificateAuthorityService::activate_certificate_authority
8435#[derive(Clone, Default, PartialEq)]
8436#[non_exhaustive]
8437pub struct ActivateCertificateAuthorityRequest {
8438 /// Required. The resource name for this
8439 /// [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]
8440 /// in the format `projects/*/locations/*/caPools/*/certificateAuthorities/*`.
8441 ///
8442 /// [google.cloud.security.privateca.v1.CertificateAuthority]: crate::model::CertificateAuthority
8443 pub name: std::string::String,
8444
8445 /// Required. The signed CA certificate issued from
8446 /// [FetchCertificateAuthorityCsrResponse.pem_csr][google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrResponse.pem_csr].
8447 ///
8448 /// [google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrResponse.pem_csr]: crate::model::FetchCertificateAuthorityCsrResponse::pem_csr
8449 pub pem_ca_certificate: std::string::String,
8450
8451 /// Required. Must include information about the issuer of
8452 /// 'pem_ca_certificate', and any further issuers until the self-signed CA.
8453 pub subordinate_config: std::option::Option<crate::model::SubordinateConfig>,
8454
8455 /// Optional. An ID to identify requests. Specify a unique request ID so that
8456 /// if you must retry your request, the server will know to ignore the request
8457 /// if it has already been completed. The server will guarantee that for at
8458 /// least 60 minutes since the first request.
8459 ///
8460 /// For example, consider a situation where you make an initial request and
8461 /// the request times out. If you make the request again with the same request
8462 /// ID, the server can check if original operation with the same request ID
8463 /// was received, and if so, will ignore the second request. This prevents
8464 /// clients from accidentally creating duplicate commitments.
8465 ///
8466 /// The request ID must be a valid UUID with the exception that zero UUID is
8467 /// not supported (00000000-0000-0000-0000-000000000000).
8468 pub request_id: std::string::String,
8469
8470 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8471}
8472
8473impl ActivateCertificateAuthorityRequest {
8474 pub fn new() -> Self {
8475 std::default::Default::default()
8476 }
8477
8478 /// Sets the value of [name][crate::model::ActivateCertificateAuthorityRequest::name].
8479 ///
8480 /// # Example
8481 /// ```ignore,no_run
8482 /// # use google_cloud_security_privateca_v1::model::ActivateCertificateAuthorityRequest;
8483 /// let x = ActivateCertificateAuthorityRequest::new().set_name("example");
8484 /// ```
8485 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8486 self.name = v.into();
8487 self
8488 }
8489
8490 /// Sets the value of [pem_ca_certificate][crate::model::ActivateCertificateAuthorityRequest::pem_ca_certificate].
8491 ///
8492 /// # Example
8493 /// ```ignore,no_run
8494 /// # use google_cloud_security_privateca_v1::model::ActivateCertificateAuthorityRequest;
8495 /// let x = ActivateCertificateAuthorityRequest::new().set_pem_ca_certificate("example");
8496 /// ```
8497 pub fn set_pem_ca_certificate<T: std::convert::Into<std::string::String>>(
8498 mut self,
8499 v: T,
8500 ) -> Self {
8501 self.pem_ca_certificate = v.into();
8502 self
8503 }
8504
8505 /// Sets the value of [subordinate_config][crate::model::ActivateCertificateAuthorityRequest::subordinate_config].
8506 ///
8507 /// # Example
8508 /// ```ignore,no_run
8509 /// # use google_cloud_security_privateca_v1::model::ActivateCertificateAuthorityRequest;
8510 /// use google_cloud_security_privateca_v1::model::SubordinateConfig;
8511 /// let x = ActivateCertificateAuthorityRequest::new().set_subordinate_config(SubordinateConfig::default()/* use setters */);
8512 /// ```
8513 pub fn set_subordinate_config<T>(mut self, v: T) -> Self
8514 where
8515 T: std::convert::Into<crate::model::SubordinateConfig>,
8516 {
8517 self.subordinate_config = std::option::Option::Some(v.into());
8518 self
8519 }
8520
8521 /// Sets or clears the value of [subordinate_config][crate::model::ActivateCertificateAuthorityRequest::subordinate_config].
8522 ///
8523 /// # Example
8524 /// ```ignore,no_run
8525 /// # use google_cloud_security_privateca_v1::model::ActivateCertificateAuthorityRequest;
8526 /// use google_cloud_security_privateca_v1::model::SubordinateConfig;
8527 /// let x = ActivateCertificateAuthorityRequest::new().set_or_clear_subordinate_config(Some(SubordinateConfig::default()/* use setters */));
8528 /// let x = ActivateCertificateAuthorityRequest::new().set_or_clear_subordinate_config(None::<SubordinateConfig>);
8529 /// ```
8530 pub fn set_or_clear_subordinate_config<T>(mut self, v: std::option::Option<T>) -> Self
8531 where
8532 T: std::convert::Into<crate::model::SubordinateConfig>,
8533 {
8534 self.subordinate_config = v.map(|x| x.into());
8535 self
8536 }
8537
8538 /// Sets the value of [request_id][crate::model::ActivateCertificateAuthorityRequest::request_id].
8539 ///
8540 /// # Example
8541 /// ```ignore,no_run
8542 /// # use google_cloud_security_privateca_v1::model::ActivateCertificateAuthorityRequest;
8543 /// let x = ActivateCertificateAuthorityRequest::new().set_request_id("example");
8544 /// ```
8545 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8546 self.request_id = v.into();
8547 self
8548 }
8549}
8550
8551impl wkt::message::Message for ActivateCertificateAuthorityRequest {
8552 fn typename() -> &'static str {
8553 "type.googleapis.com/google.cloud.security.privateca.v1.ActivateCertificateAuthorityRequest"
8554 }
8555}
8556
8557/// Request message for
8558/// [CertificateAuthorityService.CreateCertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthorityService.CreateCertificateAuthority].
8559///
8560/// [google.cloud.security.privateca.v1.CertificateAuthorityService.CreateCertificateAuthority]: crate::client::CertificateAuthorityService::create_certificate_authority
8561#[derive(Clone, Default, PartialEq)]
8562#[non_exhaustive]
8563pub struct CreateCertificateAuthorityRequest {
8564 /// Required. The resource name of the
8565 /// [CaPool][google.cloud.security.privateca.v1.CaPool] associated with the
8566 /// [CertificateAuthorities][google.cloud.security.privateca.v1.CertificateAuthority],
8567 /// in the format `projects/*/locations/*/caPools/*`.
8568 ///
8569 /// [google.cloud.security.privateca.v1.CaPool]: crate::model::CaPool
8570 /// [google.cloud.security.privateca.v1.CertificateAuthority]: crate::model::CertificateAuthority
8571 pub parent: std::string::String,
8572
8573 /// Required. It must be unique within a location and match the regular
8574 /// expression `[a-zA-Z0-9_-]{1,63}`
8575 pub certificate_authority_id: std::string::String,
8576
8577 /// Required. A
8578 /// [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]
8579 /// with initial field values.
8580 ///
8581 /// [google.cloud.security.privateca.v1.CertificateAuthority]: crate::model::CertificateAuthority
8582 pub certificate_authority: std::option::Option<crate::model::CertificateAuthority>,
8583
8584 /// Optional. An ID to identify requests. Specify a unique request ID so that
8585 /// if you must retry your request, the server will know to ignore the request
8586 /// if it has already been completed. The server will guarantee that for at
8587 /// least 60 minutes since the first request.
8588 ///
8589 /// For example, consider a situation where you make an initial request and
8590 /// the request times out. If you make the request again with the same request
8591 /// ID, the server can check if original operation with the same request ID
8592 /// was received, and if so, will ignore the second request. This prevents
8593 /// clients from accidentally creating duplicate commitments.
8594 ///
8595 /// The request ID must be a valid UUID with the exception that zero UUID is
8596 /// not supported (00000000-0000-0000-0000-000000000000).
8597 pub request_id: std::string::String,
8598
8599 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8600}
8601
8602impl CreateCertificateAuthorityRequest {
8603 pub fn new() -> Self {
8604 std::default::Default::default()
8605 }
8606
8607 /// Sets the value of [parent][crate::model::CreateCertificateAuthorityRequest::parent].
8608 ///
8609 /// # Example
8610 /// ```ignore,no_run
8611 /// # use google_cloud_security_privateca_v1::model::CreateCertificateAuthorityRequest;
8612 /// let x = CreateCertificateAuthorityRequest::new().set_parent("example");
8613 /// ```
8614 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8615 self.parent = v.into();
8616 self
8617 }
8618
8619 /// Sets the value of [certificate_authority_id][crate::model::CreateCertificateAuthorityRequest::certificate_authority_id].
8620 ///
8621 /// # Example
8622 /// ```ignore,no_run
8623 /// # use google_cloud_security_privateca_v1::model::CreateCertificateAuthorityRequest;
8624 /// let x = CreateCertificateAuthorityRequest::new().set_certificate_authority_id("example");
8625 /// ```
8626 pub fn set_certificate_authority_id<T: std::convert::Into<std::string::String>>(
8627 mut self,
8628 v: T,
8629 ) -> Self {
8630 self.certificate_authority_id = v.into();
8631 self
8632 }
8633
8634 /// Sets the value of [certificate_authority][crate::model::CreateCertificateAuthorityRequest::certificate_authority].
8635 ///
8636 /// # Example
8637 /// ```ignore,no_run
8638 /// # use google_cloud_security_privateca_v1::model::CreateCertificateAuthorityRequest;
8639 /// use google_cloud_security_privateca_v1::model::CertificateAuthority;
8640 /// let x = CreateCertificateAuthorityRequest::new().set_certificate_authority(CertificateAuthority::default()/* use setters */);
8641 /// ```
8642 pub fn set_certificate_authority<T>(mut self, v: T) -> Self
8643 where
8644 T: std::convert::Into<crate::model::CertificateAuthority>,
8645 {
8646 self.certificate_authority = std::option::Option::Some(v.into());
8647 self
8648 }
8649
8650 /// Sets or clears the value of [certificate_authority][crate::model::CreateCertificateAuthorityRequest::certificate_authority].
8651 ///
8652 /// # Example
8653 /// ```ignore,no_run
8654 /// # use google_cloud_security_privateca_v1::model::CreateCertificateAuthorityRequest;
8655 /// use google_cloud_security_privateca_v1::model::CertificateAuthority;
8656 /// let x = CreateCertificateAuthorityRequest::new().set_or_clear_certificate_authority(Some(CertificateAuthority::default()/* use setters */));
8657 /// let x = CreateCertificateAuthorityRequest::new().set_or_clear_certificate_authority(None::<CertificateAuthority>);
8658 /// ```
8659 pub fn set_or_clear_certificate_authority<T>(mut self, v: std::option::Option<T>) -> Self
8660 where
8661 T: std::convert::Into<crate::model::CertificateAuthority>,
8662 {
8663 self.certificate_authority = v.map(|x| x.into());
8664 self
8665 }
8666
8667 /// Sets the value of [request_id][crate::model::CreateCertificateAuthorityRequest::request_id].
8668 ///
8669 /// # Example
8670 /// ```ignore,no_run
8671 /// # use google_cloud_security_privateca_v1::model::CreateCertificateAuthorityRequest;
8672 /// let x = CreateCertificateAuthorityRequest::new().set_request_id("example");
8673 /// ```
8674 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8675 self.request_id = v.into();
8676 self
8677 }
8678}
8679
8680impl wkt::message::Message for CreateCertificateAuthorityRequest {
8681 fn typename() -> &'static str {
8682 "type.googleapis.com/google.cloud.security.privateca.v1.CreateCertificateAuthorityRequest"
8683 }
8684}
8685
8686/// Request message for
8687/// [CertificateAuthorityService.DisableCertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthorityService.DisableCertificateAuthority].
8688///
8689/// [google.cloud.security.privateca.v1.CertificateAuthorityService.DisableCertificateAuthority]: crate::client::CertificateAuthorityService::disable_certificate_authority
8690#[derive(Clone, Default, PartialEq)]
8691#[non_exhaustive]
8692pub struct DisableCertificateAuthorityRequest {
8693 /// Required. The resource name for this
8694 /// [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]
8695 /// in the format `projects/*/locations/*/caPools/*/certificateAuthorities/*`.
8696 ///
8697 /// [google.cloud.security.privateca.v1.CertificateAuthority]: crate::model::CertificateAuthority
8698 pub name: std::string::String,
8699
8700 /// Optional. An ID to identify requests. Specify a unique request ID so that
8701 /// if you must retry your request, the server will know to ignore the request
8702 /// if it has already been completed. The server will guarantee that for at
8703 /// least 60 minutes since the first request.
8704 ///
8705 /// For example, consider a situation where you make an initial request and
8706 /// the request times out. If you make the request again with the same request
8707 /// ID, the server can check if original operation with the same request ID
8708 /// was received, and if so, will ignore the second request. This prevents
8709 /// clients from accidentally creating duplicate commitments.
8710 ///
8711 /// The request ID must be a valid UUID with the exception that zero UUID is
8712 /// not supported (00000000-0000-0000-0000-000000000000).
8713 pub request_id: std::string::String,
8714
8715 /// Optional. This field allows this CA to be disabled even if it's being
8716 /// depended on by another resource. However, doing so may result in unintended
8717 /// and unrecoverable effects on any dependent resources since the CA will
8718 /// no longer be able to issue certificates.
8719 pub ignore_dependent_resources: bool,
8720
8721 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8722}
8723
8724impl DisableCertificateAuthorityRequest {
8725 pub fn new() -> Self {
8726 std::default::Default::default()
8727 }
8728
8729 /// Sets the value of [name][crate::model::DisableCertificateAuthorityRequest::name].
8730 ///
8731 /// # Example
8732 /// ```ignore,no_run
8733 /// # use google_cloud_security_privateca_v1::model::DisableCertificateAuthorityRequest;
8734 /// let x = DisableCertificateAuthorityRequest::new().set_name("example");
8735 /// ```
8736 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8737 self.name = v.into();
8738 self
8739 }
8740
8741 /// Sets the value of [request_id][crate::model::DisableCertificateAuthorityRequest::request_id].
8742 ///
8743 /// # Example
8744 /// ```ignore,no_run
8745 /// # use google_cloud_security_privateca_v1::model::DisableCertificateAuthorityRequest;
8746 /// let x = DisableCertificateAuthorityRequest::new().set_request_id("example");
8747 /// ```
8748 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8749 self.request_id = v.into();
8750 self
8751 }
8752
8753 /// Sets the value of [ignore_dependent_resources][crate::model::DisableCertificateAuthorityRequest::ignore_dependent_resources].
8754 ///
8755 /// # Example
8756 /// ```ignore,no_run
8757 /// # use google_cloud_security_privateca_v1::model::DisableCertificateAuthorityRequest;
8758 /// let x = DisableCertificateAuthorityRequest::new().set_ignore_dependent_resources(true);
8759 /// ```
8760 pub fn set_ignore_dependent_resources<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8761 self.ignore_dependent_resources = v.into();
8762 self
8763 }
8764}
8765
8766impl wkt::message::Message for DisableCertificateAuthorityRequest {
8767 fn typename() -> &'static str {
8768 "type.googleapis.com/google.cloud.security.privateca.v1.DisableCertificateAuthorityRequest"
8769 }
8770}
8771
8772/// Request message for
8773/// [CertificateAuthorityService.EnableCertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthorityService.EnableCertificateAuthority].
8774///
8775/// [google.cloud.security.privateca.v1.CertificateAuthorityService.EnableCertificateAuthority]: crate::client::CertificateAuthorityService::enable_certificate_authority
8776#[derive(Clone, Default, PartialEq)]
8777#[non_exhaustive]
8778pub struct EnableCertificateAuthorityRequest {
8779 /// Required. The resource name for this
8780 /// [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]
8781 /// in the format `projects/*/locations/*/caPools/*/certificateAuthorities/*`.
8782 ///
8783 /// [google.cloud.security.privateca.v1.CertificateAuthority]: crate::model::CertificateAuthority
8784 pub name: std::string::String,
8785
8786 /// Optional. An ID to identify requests. Specify a unique request ID so that
8787 /// if you must retry your request, the server will know to ignore the request
8788 /// if it has already been completed. The server will guarantee that for at
8789 /// least 60 minutes since the first request.
8790 ///
8791 /// For example, consider a situation where you make an initial request and
8792 /// the request times out. If you make the request again with the same request
8793 /// ID, the server can check if original operation with the same request ID
8794 /// was received, and if so, will ignore the second request. This prevents
8795 /// clients from accidentally creating duplicate commitments.
8796 ///
8797 /// The request ID must be a valid UUID with the exception that zero UUID is
8798 /// not supported (00000000-0000-0000-0000-000000000000).
8799 pub request_id: std::string::String,
8800
8801 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8802}
8803
8804impl EnableCertificateAuthorityRequest {
8805 pub fn new() -> Self {
8806 std::default::Default::default()
8807 }
8808
8809 /// Sets the value of [name][crate::model::EnableCertificateAuthorityRequest::name].
8810 ///
8811 /// # Example
8812 /// ```ignore,no_run
8813 /// # use google_cloud_security_privateca_v1::model::EnableCertificateAuthorityRequest;
8814 /// let x = EnableCertificateAuthorityRequest::new().set_name("example");
8815 /// ```
8816 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8817 self.name = v.into();
8818 self
8819 }
8820
8821 /// Sets the value of [request_id][crate::model::EnableCertificateAuthorityRequest::request_id].
8822 ///
8823 /// # Example
8824 /// ```ignore,no_run
8825 /// # use google_cloud_security_privateca_v1::model::EnableCertificateAuthorityRequest;
8826 /// let x = EnableCertificateAuthorityRequest::new().set_request_id("example");
8827 /// ```
8828 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8829 self.request_id = v.into();
8830 self
8831 }
8832}
8833
8834impl wkt::message::Message for EnableCertificateAuthorityRequest {
8835 fn typename() -> &'static str {
8836 "type.googleapis.com/google.cloud.security.privateca.v1.EnableCertificateAuthorityRequest"
8837 }
8838}
8839
8840/// Request message for
8841/// [CertificateAuthorityService.FetchCertificateAuthorityCsr][google.cloud.security.privateca.v1.CertificateAuthorityService.FetchCertificateAuthorityCsr].
8842///
8843/// [google.cloud.security.privateca.v1.CertificateAuthorityService.FetchCertificateAuthorityCsr]: crate::client::CertificateAuthorityService::fetch_certificate_authority_csr
8844#[derive(Clone, Default, PartialEq)]
8845#[non_exhaustive]
8846pub struct FetchCertificateAuthorityCsrRequest {
8847 /// Required. The resource name for this
8848 /// [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]
8849 /// in the format `projects/*/locations/*/caPools/*/certificateAuthorities/*`.
8850 ///
8851 /// [google.cloud.security.privateca.v1.CertificateAuthority]: crate::model::CertificateAuthority
8852 pub name: std::string::String,
8853
8854 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8855}
8856
8857impl FetchCertificateAuthorityCsrRequest {
8858 pub fn new() -> Self {
8859 std::default::Default::default()
8860 }
8861
8862 /// Sets the value of [name][crate::model::FetchCertificateAuthorityCsrRequest::name].
8863 ///
8864 /// # Example
8865 /// ```ignore,no_run
8866 /// # use google_cloud_security_privateca_v1::model::FetchCertificateAuthorityCsrRequest;
8867 /// let x = FetchCertificateAuthorityCsrRequest::new().set_name("example");
8868 /// ```
8869 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8870 self.name = v.into();
8871 self
8872 }
8873}
8874
8875impl wkt::message::Message for FetchCertificateAuthorityCsrRequest {
8876 fn typename() -> &'static str {
8877 "type.googleapis.com/google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrRequest"
8878 }
8879}
8880
8881/// Response message for
8882/// [CertificateAuthorityService.FetchCertificateAuthorityCsr][google.cloud.security.privateca.v1.CertificateAuthorityService.FetchCertificateAuthorityCsr].
8883///
8884/// [google.cloud.security.privateca.v1.CertificateAuthorityService.FetchCertificateAuthorityCsr]: crate::client::CertificateAuthorityService::fetch_certificate_authority_csr
8885#[derive(Clone, Default, PartialEq)]
8886#[non_exhaustive]
8887pub struct FetchCertificateAuthorityCsrResponse {
8888 /// Output only. The PEM-encoded signed certificate signing request (CSR).
8889 pub pem_csr: std::string::String,
8890
8891 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8892}
8893
8894impl FetchCertificateAuthorityCsrResponse {
8895 pub fn new() -> Self {
8896 std::default::Default::default()
8897 }
8898
8899 /// Sets the value of [pem_csr][crate::model::FetchCertificateAuthorityCsrResponse::pem_csr].
8900 ///
8901 /// # Example
8902 /// ```ignore,no_run
8903 /// # use google_cloud_security_privateca_v1::model::FetchCertificateAuthorityCsrResponse;
8904 /// let x = FetchCertificateAuthorityCsrResponse::new().set_pem_csr("example");
8905 /// ```
8906 pub fn set_pem_csr<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8907 self.pem_csr = v.into();
8908 self
8909 }
8910}
8911
8912impl wkt::message::Message for FetchCertificateAuthorityCsrResponse {
8913 fn typename() -> &'static str {
8914 "type.googleapis.com/google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrResponse"
8915 }
8916}
8917
8918/// Request message for
8919/// [CertificateAuthorityService.GetCertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthorityService.GetCertificateAuthority].
8920///
8921/// [google.cloud.security.privateca.v1.CertificateAuthorityService.GetCertificateAuthority]: crate::client::CertificateAuthorityService::get_certificate_authority
8922#[derive(Clone, Default, PartialEq)]
8923#[non_exhaustive]
8924pub struct GetCertificateAuthorityRequest {
8925 /// Required. The
8926 /// [name][google.cloud.security.privateca.v1.CertificateAuthority.name] of the
8927 /// [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]
8928 /// to get.
8929 ///
8930 /// [google.cloud.security.privateca.v1.CertificateAuthority]: crate::model::CertificateAuthority
8931 /// [google.cloud.security.privateca.v1.CertificateAuthority.name]: crate::model::CertificateAuthority::name
8932 pub name: std::string::String,
8933
8934 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8935}
8936
8937impl GetCertificateAuthorityRequest {
8938 pub fn new() -> Self {
8939 std::default::Default::default()
8940 }
8941
8942 /// Sets the value of [name][crate::model::GetCertificateAuthorityRequest::name].
8943 ///
8944 /// # Example
8945 /// ```ignore,no_run
8946 /// # use google_cloud_security_privateca_v1::model::GetCertificateAuthorityRequest;
8947 /// let x = GetCertificateAuthorityRequest::new().set_name("example");
8948 /// ```
8949 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8950 self.name = v.into();
8951 self
8952 }
8953}
8954
8955impl wkt::message::Message for GetCertificateAuthorityRequest {
8956 fn typename() -> &'static str {
8957 "type.googleapis.com/google.cloud.security.privateca.v1.GetCertificateAuthorityRequest"
8958 }
8959}
8960
8961/// Request message for
8962/// [CertificateAuthorityService.ListCertificateAuthorities][google.cloud.security.privateca.v1.CertificateAuthorityService.ListCertificateAuthorities].
8963///
8964/// [google.cloud.security.privateca.v1.CertificateAuthorityService.ListCertificateAuthorities]: crate::client::CertificateAuthorityService::list_certificate_authorities
8965#[derive(Clone, Default, PartialEq)]
8966#[non_exhaustive]
8967pub struct ListCertificateAuthoritiesRequest {
8968 /// Required. The resource name of the
8969 /// [CaPool][google.cloud.security.privateca.v1.CaPool] associated with the
8970 /// [CertificateAuthorities][google.cloud.security.privateca.v1.CertificateAuthority],
8971 /// in the format `projects/*/locations/*/caPools/*`.
8972 ///
8973 /// [google.cloud.security.privateca.v1.CaPool]: crate::model::CaPool
8974 /// [google.cloud.security.privateca.v1.CertificateAuthority]: crate::model::CertificateAuthority
8975 pub parent: std::string::String,
8976
8977 /// Optional. Limit on the number of
8978 /// [CertificateAuthorities][google.cloud.security.privateca.v1.CertificateAuthority]
8979 /// to include in the response. Further
8980 /// [CertificateAuthorities][google.cloud.security.privateca.v1.CertificateAuthority]
8981 /// can subsequently be obtained by including the
8982 /// [ListCertificateAuthoritiesResponse.next_page_token][google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse.next_page_token]
8983 /// in a subsequent request. If unspecified, the server will pick an
8984 /// appropriate default.
8985 ///
8986 /// [google.cloud.security.privateca.v1.CertificateAuthority]: crate::model::CertificateAuthority
8987 /// [google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse.next_page_token]: crate::model::ListCertificateAuthoritiesResponse::next_page_token
8988 pub page_size: i32,
8989
8990 /// Optional. Pagination token, returned earlier via
8991 /// [ListCertificateAuthoritiesResponse.next_page_token][google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse.next_page_token].
8992 ///
8993 /// [google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse.next_page_token]: crate::model::ListCertificateAuthoritiesResponse::next_page_token
8994 pub page_token: std::string::String,
8995
8996 /// Optional. Only include resources that match the filter in the response.
8997 pub filter: std::string::String,
8998
8999 /// Optional. Specify how the results should be sorted.
9000 pub order_by: std::string::String,
9001
9002 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9003}
9004
9005impl ListCertificateAuthoritiesRequest {
9006 pub fn new() -> Self {
9007 std::default::Default::default()
9008 }
9009
9010 /// Sets the value of [parent][crate::model::ListCertificateAuthoritiesRequest::parent].
9011 ///
9012 /// # Example
9013 /// ```ignore,no_run
9014 /// # use google_cloud_security_privateca_v1::model::ListCertificateAuthoritiesRequest;
9015 /// let x = ListCertificateAuthoritiesRequest::new().set_parent("example");
9016 /// ```
9017 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9018 self.parent = v.into();
9019 self
9020 }
9021
9022 /// Sets the value of [page_size][crate::model::ListCertificateAuthoritiesRequest::page_size].
9023 ///
9024 /// # Example
9025 /// ```ignore,no_run
9026 /// # use google_cloud_security_privateca_v1::model::ListCertificateAuthoritiesRequest;
9027 /// let x = ListCertificateAuthoritiesRequest::new().set_page_size(42);
9028 /// ```
9029 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9030 self.page_size = v.into();
9031 self
9032 }
9033
9034 /// Sets the value of [page_token][crate::model::ListCertificateAuthoritiesRequest::page_token].
9035 ///
9036 /// # Example
9037 /// ```ignore,no_run
9038 /// # use google_cloud_security_privateca_v1::model::ListCertificateAuthoritiesRequest;
9039 /// let x = ListCertificateAuthoritiesRequest::new().set_page_token("example");
9040 /// ```
9041 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9042 self.page_token = v.into();
9043 self
9044 }
9045
9046 /// Sets the value of [filter][crate::model::ListCertificateAuthoritiesRequest::filter].
9047 ///
9048 /// # Example
9049 /// ```ignore,no_run
9050 /// # use google_cloud_security_privateca_v1::model::ListCertificateAuthoritiesRequest;
9051 /// let x = ListCertificateAuthoritiesRequest::new().set_filter("example");
9052 /// ```
9053 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9054 self.filter = v.into();
9055 self
9056 }
9057
9058 /// Sets the value of [order_by][crate::model::ListCertificateAuthoritiesRequest::order_by].
9059 ///
9060 /// # Example
9061 /// ```ignore,no_run
9062 /// # use google_cloud_security_privateca_v1::model::ListCertificateAuthoritiesRequest;
9063 /// let x = ListCertificateAuthoritiesRequest::new().set_order_by("example");
9064 /// ```
9065 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9066 self.order_by = v.into();
9067 self
9068 }
9069}
9070
9071impl wkt::message::Message for ListCertificateAuthoritiesRequest {
9072 fn typename() -> &'static str {
9073 "type.googleapis.com/google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest"
9074 }
9075}
9076
9077/// Response message for
9078/// [CertificateAuthorityService.ListCertificateAuthorities][google.cloud.security.privateca.v1.CertificateAuthorityService.ListCertificateAuthorities].
9079///
9080/// [google.cloud.security.privateca.v1.CertificateAuthorityService.ListCertificateAuthorities]: crate::client::CertificateAuthorityService::list_certificate_authorities
9081#[derive(Clone, Default, PartialEq)]
9082#[non_exhaustive]
9083pub struct ListCertificateAuthoritiesResponse {
9084 /// The list of
9085 /// [CertificateAuthorities][google.cloud.security.privateca.v1.CertificateAuthority].
9086 ///
9087 /// [google.cloud.security.privateca.v1.CertificateAuthority]: crate::model::CertificateAuthority
9088 pub certificate_authorities: std::vec::Vec<crate::model::CertificateAuthority>,
9089
9090 /// A token to retrieve next page of results. Pass this value in
9091 /// [ListCertificateAuthoritiesRequest.page_token][google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest.page_token]
9092 /// to retrieve the next page of results.
9093 ///
9094 /// [google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest.page_token]: crate::model::ListCertificateAuthoritiesRequest::page_token
9095 pub next_page_token: std::string::String,
9096
9097 /// A list of locations (e.g. "us-west1") that could not be reached.
9098 pub unreachable: std::vec::Vec<std::string::String>,
9099
9100 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9101}
9102
9103impl ListCertificateAuthoritiesResponse {
9104 pub fn new() -> Self {
9105 std::default::Default::default()
9106 }
9107
9108 /// Sets the value of [certificate_authorities][crate::model::ListCertificateAuthoritiesResponse::certificate_authorities].
9109 ///
9110 /// # Example
9111 /// ```ignore,no_run
9112 /// # use google_cloud_security_privateca_v1::model::ListCertificateAuthoritiesResponse;
9113 /// use google_cloud_security_privateca_v1::model::CertificateAuthority;
9114 /// let x = ListCertificateAuthoritiesResponse::new()
9115 /// .set_certificate_authorities([
9116 /// CertificateAuthority::default()/* use setters */,
9117 /// CertificateAuthority::default()/* use (different) setters */,
9118 /// ]);
9119 /// ```
9120 pub fn set_certificate_authorities<T, V>(mut self, v: T) -> Self
9121 where
9122 T: std::iter::IntoIterator<Item = V>,
9123 V: std::convert::Into<crate::model::CertificateAuthority>,
9124 {
9125 use std::iter::Iterator;
9126 self.certificate_authorities = v.into_iter().map(|i| i.into()).collect();
9127 self
9128 }
9129
9130 /// Sets the value of [next_page_token][crate::model::ListCertificateAuthoritiesResponse::next_page_token].
9131 ///
9132 /// # Example
9133 /// ```ignore,no_run
9134 /// # use google_cloud_security_privateca_v1::model::ListCertificateAuthoritiesResponse;
9135 /// let x = ListCertificateAuthoritiesResponse::new().set_next_page_token("example");
9136 /// ```
9137 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9138 self.next_page_token = v.into();
9139 self
9140 }
9141
9142 /// Sets the value of [unreachable][crate::model::ListCertificateAuthoritiesResponse::unreachable].
9143 ///
9144 /// # Example
9145 /// ```ignore,no_run
9146 /// # use google_cloud_security_privateca_v1::model::ListCertificateAuthoritiesResponse;
9147 /// let x = ListCertificateAuthoritiesResponse::new().set_unreachable(["a", "b", "c"]);
9148 /// ```
9149 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
9150 where
9151 T: std::iter::IntoIterator<Item = V>,
9152 V: std::convert::Into<std::string::String>,
9153 {
9154 use std::iter::Iterator;
9155 self.unreachable = v.into_iter().map(|i| i.into()).collect();
9156 self
9157 }
9158}
9159
9160impl wkt::message::Message for ListCertificateAuthoritiesResponse {
9161 fn typename() -> &'static str {
9162 "type.googleapis.com/google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse"
9163 }
9164}
9165
9166#[doc(hidden)]
9167impl gax::paginator::internal::PageableResponse for ListCertificateAuthoritiesResponse {
9168 type PageItem = crate::model::CertificateAuthority;
9169
9170 fn items(self) -> std::vec::Vec<Self::PageItem> {
9171 self.certificate_authorities
9172 }
9173
9174 fn next_page_token(&self) -> std::string::String {
9175 use std::clone::Clone;
9176 self.next_page_token.clone()
9177 }
9178}
9179
9180/// Request message for
9181/// [CertificateAuthorityService.UndeleteCertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthorityService.UndeleteCertificateAuthority].
9182///
9183/// [google.cloud.security.privateca.v1.CertificateAuthorityService.UndeleteCertificateAuthority]: crate::client::CertificateAuthorityService::undelete_certificate_authority
9184#[derive(Clone, Default, PartialEq)]
9185#[non_exhaustive]
9186pub struct UndeleteCertificateAuthorityRequest {
9187 /// Required. The resource name for this
9188 /// [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]
9189 /// in the format `projects/*/locations/*/caPools/*/certificateAuthorities/*`.
9190 ///
9191 /// [google.cloud.security.privateca.v1.CertificateAuthority]: crate::model::CertificateAuthority
9192 pub name: std::string::String,
9193
9194 /// Optional. An ID to identify requests. Specify a unique request ID so that
9195 /// if you must retry your request, the server will know to ignore the request
9196 /// if it has already been completed. The server will guarantee that for at
9197 /// least 60 minutes since the first request.
9198 ///
9199 /// For example, consider a situation where you make an initial request and
9200 /// the request times out. If you make the request again with the same request
9201 /// ID, the server can check if original operation with the same request ID
9202 /// was received, and if so, will ignore the second request. This prevents
9203 /// clients from accidentally creating duplicate commitments.
9204 ///
9205 /// The request ID must be a valid UUID with the exception that zero UUID is
9206 /// not supported (00000000-0000-0000-0000-000000000000).
9207 pub request_id: std::string::String,
9208
9209 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9210}
9211
9212impl UndeleteCertificateAuthorityRequest {
9213 pub fn new() -> Self {
9214 std::default::Default::default()
9215 }
9216
9217 /// Sets the value of [name][crate::model::UndeleteCertificateAuthorityRequest::name].
9218 ///
9219 /// # Example
9220 /// ```ignore,no_run
9221 /// # use google_cloud_security_privateca_v1::model::UndeleteCertificateAuthorityRequest;
9222 /// let x = UndeleteCertificateAuthorityRequest::new().set_name("example");
9223 /// ```
9224 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9225 self.name = v.into();
9226 self
9227 }
9228
9229 /// Sets the value of [request_id][crate::model::UndeleteCertificateAuthorityRequest::request_id].
9230 ///
9231 /// # Example
9232 /// ```ignore,no_run
9233 /// # use google_cloud_security_privateca_v1::model::UndeleteCertificateAuthorityRequest;
9234 /// let x = UndeleteCertificateAuthorityRequest::new().set_request_id("example");
9235 /// ```
9236 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9237 self.request_id = v.into();
9238 self
9239 }
9240}
9241
9242impl wkt::message::Message for UndeleteCertificateAuthorityRequest {
9243 fn typename() -> &'static str {
9244 "type.googleapis.com/google.cloud.security.privateca.v1.UndeleteCertificateAuthorityRequest"
9245 }
9246}
9247
9248/// Request message for
9249/// [CertificateAuthorityService.DeleteCertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthorityService.DeleteCertificateAuthority].
9250///
9251/// [google.cloud.security.privateca.v1.CertificateAuthorityService.DeleteCertificateAuthority]: crate::client::CertificateAuthorityService::delete_certificate_authority
9252#[derive(Clone, Default, PartialEq)]
9253#[non_exhaustive]
9254pub struct DeleteCertificateAuthorityRequest {
9255 /// Required. The resource name for this
9256 /// [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]
9257 /// in the format `projects/*/locations/*/caPools/*/certificateAuthorities/*`.
9258 ///
9259 /// [google.cloud.security.privateca.v1.CertificateAuthority]: crate::model::CertificateAuthority
9260 pub name: std::string::String,
9261
9262 /// Optional. An ID to identify requests. Specify a unique request ID so that
9263 /// if you must retry your request, the server will know to ignore the request
9264 /// if it has already been completed. The server will guarantee that for at
9265 /// least 60 minutes since the first request.
9266 ///
9267 /// For example, consider a situation where you make an initial request and
9268 /// the request times out. If you make the request again with the same request
9269 /// ID, the server can check if original operation with the same request ID
9270 /// was received, and if so, will ignore the second request. This prevents
9271 /// clients from accidentally creating duplicate commitments.
9272 ///
9273 /// The request ID must be a valid UUID with the exception that zero UUID is
9274 /// not supported (00000000-0000-0000-0000-000000000000).
9275 pub request_id: std::string::String,
9276
9277 /// Optional. This field allows the CA to be deleted even if the CA has
9278 /// active certs. Active certs include both unrevoked and unexpired certs.
9279 pub ignore_active_certificates: bool,
9280
9281 /// Optional. If this flag is set, the Certificate Authority will be deleted as
9282 /// soon as possible without a 30-day grace period where undeletion would have
9283 /// been allowed. If you proceed, there will be no way to recover this CA.
9284 pub skip_grace_period: bool,
9285
9286 /// Optional. This field allows this CA to be deleted even if it's being
9287 /// depended on by another resource. However, doing so may result in unintended
9288 /// and unrecoverable effects on any dependent resources since the CA will
9289 /// no longer be able to issue certificates.
9290 pub ignore_dependent_resources: bool,
9291
9292 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9293}
9294
9295impl DeleteCertificateAuthorityRequest {
9296 pub fn new() -> Self {
9297 std::default::Default::default()
9298 }
9299
9300 /// Sets the value of [name][crate::model::DeleteCertificateAuthorityRequest::name].
9301 ///
9302 /// # Example
9303 /// ```ignore,no_run
9304 /// # use google_cloud_security_privateca_v1::model::DeleteCertificateAuthorityRequest;
9305 /// let x = DeleteCertificateAuthorityRequest::new().set_name("example");
9306 /// ```
9307 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9308 self.name = v.into();
9309 self
9310 }
9311
9312 /// Sets the value of [request_id][crate::model::DeleteCertificateAuthorityRequest::request_id].
9313 ///
9314 /// # Example
9315 /// ```ignore,no_run
9316 /// # use google_cloud_security_privateca_v1::model::DeleteCertificateAuthorityRequest;
9317 /// let x = DeleteCertificateAuthorityRequest::new().set_request_id("example");
9318 /// ```
9319 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9320 self.request_id = v.into();
9321 self
9322 }
9323
9324 /// Sets the value of [ignore_active_certificates][crate::model::DeleteCertificateAuthorityRequest::ignore_active_certificates].
9325 ///
9326 /// # Example
9327 /// ```ignore,no_run
9328 /// # use google_cloud_security_privateca_v1::model::DeleteCertificateAuthorityRequest;
9329 /// let x = DeleteCertificateAuthorityRequest::new().set_ignore_active_certificates(true);
9330 /// ```
9331 pub fn set_ignore_active_certificates<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9332 self.ignore_active_certificates = v.into();
9333 self
9334 }
9335
9336 /// Sets the value of [skip_grace_period][crate::model::DeleteCertificateAuthorityRequest::skip_grace_period].
9337 ///
9338 /// # Example
9339 /// ```ignore,no_run
9340 /// # use google_cloud_security_privateca_v1::model::DeleteCertificateAuthorityRequest;
9341 /// let x = DeleteCertificateAuthorityRequest::new().set_skip_grace_period(true);
9342 /// ```
9343 pub fn set_skip_grace_period<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9344 self.skip_grace_period = v.into();
9345 self
9346 }
9347
9348 /// Sets the value of [ignore_dependent_resources][crate::model::DeleteCertificateAuthorityRequest::ignore_dependent_resources].
9349 ///
9350 /// # Example
9351 /// ```ignore,no_run
9352 /// # use google_cloud_security_privateca_v1::model::DeleteCertificateAuthorityRequest;
9353 /// let x = DeleteCertificateAuthorityRequest::new().set_ignore_dependent_resources(true);
9354 /// ```
9355 pub fn set_ignore_dependent_resources<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9356 self.ignore_dependent_resources = v.into();
9357 self
9358 }
9359}
9360
9361impl wkt::message::Message for DeleteCertificateAuthorityRequest {
9362 fn typename() -> &'static str {
9363 "type.googleapis.com/google.cloud.security.privateca.v1.DeleteCertificateAuthorityRequest"
9364 }
9365}
9366
9367/// Request message for
9368/// [CertificateAuthorityService.UpdateCertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthorityService.UpdateCertificateAuthority].
9369///
9370/// [google.cloud.security.privateca.v1.CertificateAuthorityService.UpdateCertificateAuthority]: crate::client::CertificateAuthorityService::update_certificate_authority
9371#[derive(Clone, Default, PartialEq)]
9372#[non_exhaustive]
9373pub struct UpdateCertificateAuthorityRequest {
9374 /// Required.
9375 /// [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]
9376 /// with updated values.
9377 ///
9378 /// [google.cloud.security.privateca.v1.CertificateAuthority]: crate::model::CertificateAuthority
9379 pub certificate_authority: std::option::Option<crate::model::CertificateAuthority>,
9380
9381 /// Required. A list of fields to be updated in this request.
9382 pub update_mask: std::option::Option<wkt::FieldMask>,
9383
9384 /// Optional. An ID to identify requests. Specify a unique request ID so that
9385 /// if you must retry your request, the server will know to ignore the request
9386 /// if it has already been completed. The server will guarantee that for at
9387 /// least 60 minutes since the first request.
9388 ///
9389 /// For example, consider a situation where you make an initial request and
9390 /// the request times out. If you make the request again with the same request
9391 /// ID, the server can check if original operation with the same request ID
9392 /// was received, and if so, will ignore the second request. This prevents
9393 /// clients from accidentally creating duplicate commitments.
9394 ///
9395 /// The request ID must be a valid UUID with the exception that zero UUID is
9396 /// not supported (00000000-0000-0000-0000-000000000000).
9397 pub request_id: std::string::String,
9398
9399 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9400}
9401
9402impl UpdateCertificateAuthorityRequest {
9403 pub fn new() -> Self {
9404 std::default::Default::default()
9405 }
9406
9407 /// Sets the value of [certificate_authority][crate::model::UpdateCertificateAuthorityRequest::certificate_authority].
9408 ///
9409 /// # Example
9410 /// ```ignore,no_run
9411 /// # use google_cloud_security_privateca_v1::model::UpdateCertificateAuthorityRequest;
9412 /// use google_cloud_security_privateca_v1::model::CertificateAuthority;
9413 /// let x = UpdateCertificateAuthorityRequest::new().set_certificate_authority(CertificateAuthority::default()/* use setters */);
9414 /// ```
9415 pub fn set_certificate_authority<T>(mut self, v: T) -> Self
9416 where
9417 T: std::convert::Into<crate::model::CertificateAuthority>,
9418 {
9419 self.certificate_authority = std::option::Option::Some(v.into());
9420 self
9421 }
9422
9423 /// Sets or clears the value of [certificate_authority][crate::model::UpdateCertificateAuthorityRequest::certificate_authority].
9424 ///
9425 /// # Example
9426 /// ```ignore,no_run
9427 /// # use google_cloud_security_privateca_v1::model::UpdateCertificateAuthorityRequest;
9428 /// use google_cloud_security_privateca_v1::model::CertificateAuthority;
9429 /// let x = UpdateCertificateAuthorityRequest::new().set_or_clear_certificate_authority(Some(CertificateAuthority::default()/* use setters */));
9430 /// let x = UpdateCertificateAuthorityRequest::new().set_or_clear_certificate_authority(None::<CertificateAuthority>);
9431 /// ```
9432 pub fn set_or_clear_certificate_authority<T>(mut self, v: std::option::Option<T>) -> Self
9433 where
9434 T: std::convert::Into<crate::model::CertificateAuthority>,
9435 {
9436 self.certificate_authority = v.map(|x| x.into());
9437 self
9438 }
9439
9440 /// Sets the value of [update_mask][crate::model::UpdateCertificateAuthorityRequest::update_mask].
9441 ///
9442 /// # Example
9443 /// ```ignore,no_run
9444 /// # use google_cloud_security_privateca_v1::model::UpdateCertificateAuthorityRequest;
9445 /// use wkt::FieldMask;
9446 /// let x = UpdateCertificateAuthorityRequest::new().set_update_mask(FieldMask::default()/* use setters */);
9447 /// ```
9448 pub fn set_update_mask<T>(mut self, v: T) -> Self
9449 where
9450 T: std::convert::Into<wkt::FieldMask>,
9451 {
9452 self.update_mask = std::option::Option::Some(v.into());
9453 self
9454 }
9455
9456 /// Sets or clears the value of [update_mask][crate::model::UpdateCertificateAuthorityRequest::update_mask].
9457 ///
9458 /// # Example
9459 /// ```ignore,no_run
9460 /// # use google_cloud_security_privateca_v1::model::UpdateCertificateAuthorityRequest;
9461 /// use wkt::FieldMask;
9462 /// let x = UpdateCertificateAuthorityRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
9463 /// let x = UpdateCertificateAuthorityRequest::new().set_or_clear_update_mask(None::<FieldMask>);
9464 /// ```
9465 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
9466 where
9467 T: std::convert::Into<wkt::FieldMask>,
9468 {
9469 self.update_mask = v.map(|x| x.into());
9470 self
9471 }
9472
9473 /// Sets the value of [request_id][crate::model::UpdateCertificateAuthorityRequest::request_id].
9474 ///
9475 /// # Example
9476 /// ```ignore,no_run
9477 /// # use google_cloud_security_privateca_v1::model::UpdateCertificateAuthorityRequest;
9478 /// let x = UpdateCertificateAuthorityRequest::new().set_request_id("example");
9479 /// ```
9480 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9481 self.request_id = v.into();
9482 self
9483 }
9484}
9485
9486impl wkt::message::Message for UpdateCertificateAuthorityRequest {
9487 fn typename() -> &'static str {
9488 "type.googleapis.com/google.cloud.security.privateca.v1.UpdateCertificateAuthorityRequest"
9489 }
9490}
9491
9492/// Request message for
9493/// [CertificateAuthorityService.CreateCaPool][google.cloud.security.privateca.v1.CertificateAuthorityService.CreateCaPool].
9494///
9495/// [google.cloud.security.privateca.v1.CertificateAuthorityService.CreateCaPool]: crate::client::CertificateAuthorityService::create_ca_pool
9496#[derive(Clone, Default, PartialEq)]
9497#[non_exhaustive]
9498pub struct CreateCaPoolRequest {
9499 /// Required. The resource name of the location associated with the
9500 /// [CaPool][google.cloud.security.privateca.v1.CaPool], in the format
9501 /// `projects/*/locations/*`.
9502 ///
9503 /// [google.cloud.security.privateca.v1.CaPool]: crate::model::CaPool
9504 pub parent: std::string::String,
9505
9506 /// Required. It must be unique within a location and match the regular
9507 /// expression `[a-zA-Z0-9_-]{1,63}`
9508 pub ca_pool_id: std::string::String,
9509
9510 /// Required. A [CaPool][google.cloud.security.privateca.v1.CaPool] with
9511 /// initial field values.
9512 ///
9513 /// [google.cloud.security.privateca.v1.CaPool]: crate::model::CaPool
9514 pub ca_pool: std::option::Option<crate::model::CaPool>,
9515
9516 /// Optional. An ID to identify requests. Specify a unique request ID so that
9517 /// if you must retry your request, the server will know to ignore the request
9518 /// if it has already been completed. The server will guarantee that for at
9519 /// least 60 minutes since the first request.
9520 ///
9521 /// For example, consider a situation where you make an initial request and
9522 /// the request times out. If you make the request again with the same request
9523 /// ID, the server can check if original operation with the same request ID
9524 /// was received, and if so, will ignore the second request. This prevents
9525 /// clients from accidentally creating duplicate commitments.
9526 ///
9527 /// The request ID must be a valid UUID with the exception that zero UUID is
9528 /// not supported (00000000-0000-0000-0000-000000000000).
9529 pub request_id: std::string::String,
9530
9531 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9532}
9533
9534impl CreateCaPoolRequest {
9535 pub fn new() -> Self {
9536 std::default::Default::default()
9537 }
9538
9539 /// Sets the value of [parent][crate::model::CreateCaPoolRequest::parent].
9540 ///
9541 /// # Example
9542 /// ```ignore,no_run
9543 /// # use google_cloud_security_privateca_v1::model::CreateCaPoolRequest;
9544 /// let x = CreateCaPoolRequest::new().set_parent("example");
9545 /// ```
9546 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9547 self.parent = v.into();
9548 self
9549 }
9550
9551 /// Sets the value of [ca_pool_id][crate::model::CreateCaPoolRequest::ca_pool_id].
9552 ///
9553 /// # Example
9554 /// ```ignore,no_run
9555 /// # use google_cloud_security_privateca_v1::model::CreateCaPoolRequest;
9556 /// let x = CreateCaPoolRequest::new().set_ca_pool_id("example");
9557 /// ```
9558 pub fn set_ca_pool_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9559 self.ca_pool_id = v.into();
9560 self
9561 }
9562
9563 /// Sets the value of [ca_pool][crate::model::CreateCaPoolRequest::ca_pool].
9564 ///
9565 /// # Example
9566 /// ```ignore,no_run
9567 /// # use google_cloud_security_privateca_v1::model::CreateCaPoolRequest;
9568 /// use google_cloud_security_privateca_v1::model::CaPool;
9569 /// let x = CreateCaPoolRequest::new().set_ca_pool(CaPool::default()/* use setters */);
9570 /// ```
9571 pub fn set_ca_pool<T>(mut self, v: T) -> Self
9572 where
9573 T: std::convert::Into<crate::model::CaPool>,
9574 {
9575 self.ca_pool = std::option::Option::Some(v.into());
9576 self
9577 }
9578
9579 /// Sets or clears the value of [ca_pool][crate::model::CreateCaPoolRequest::ca_pool].
9580 ///
9581 /// # Example
9582 /// ```ignore,no_run
9583 /// # use google_cloud_security_privateca_v1::model::CreateCaPoolRequest;
9584 /// use google_cloud_security_privateca_v1::model::CaPool;
9585 /// let x = CreateCaPoolRequest::new().set_or_clear_ca_pool(Some(CaPool::default()/* use setters */));
9586 /// let x = CreateCaPoolRequest::new().set_or_clear_ca_pool(None::<CaPool>);
9587 /// ```
9588 pub fn set_or_clear_ca_pool<T>(mut self, v: std::option::Option<T>) -> Self
9589 where
9590 T: std::convert::Into<crate::model::CaPool>,
9591 {
9592 self.ca_pool = v.map(|x| x.into());
9593 self
9594 }
9595
9596 /// Sets the value of [request_id][crate::model::CreateCaPoolRequest::request_id].
9597 ///
9598 /// # Example
9599 /// ```ignore,no_run
9600 /// # use google_cloud_security_privateca_v1::model::CreateCaPoolRequest;
9601 /// let x = CreateCaPoolRequest::new().set_request_id("example");
9602 /// ```
9603 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9604 self.request_id = v.into();
9605 self
9606 }
9607}
9608
9609impl wkt::message::Message for CreateCaPoolRequest {
9610 fn typename() -> &'static str {
9611 "type.googleapis.com/google.cloud.security.privateca.v1.CreateCaPoolRequest"
9612 }
9613}
9614
9615/// Request message for
9616/// [CertificateAuthorityService.UpdateCaPool][google.cloud.security.privateca.v1.CertificateAuthorityService.UpdateCaPool].
9617///
9618/// [google.cloud.security.privateca.v1.CertificateAuthorityService.UpdateCaPool]: crate::client::CertificateAuthorityService::update_ca_pool
9619#[derive(Clone, Default, PartialEq)]
9620#[non_exhaustive]
9621pub struct UpdateCaPoolRequest {
9622 /// Required. [CaPool][google.cloud.security.privateca.v1.CaPool] with updated
9623 /// values.
9624 ///
9625 /// [google.cloud.security.privateca.v1.CaPool]: crate::model::CaPool
9626 pub ca_pool: std::option::Option<crate::model::CaPool>,
9627
9628 /// Required. A list of fields to be updated in this request.
9629 pub update_mask: std::option::Option<wkt::FieldMask>,
9630
9631 /// Optional. An ID to identify requests. Specify a unique request ID so that
9632 /// if you must retry your request, the server will know to ignore the request
9633 /// if it has already been completed. The server will guarantee that for at
9634 /// least 60 minutes since the first request.
9635 ///
9636 /// For example, consider a situation where you make an initial request and
9637 /// the request times out. If you make the request again with the same request
9638 /// ID, the server can check if original operation with the same request ID
9639 /// was received, and if so, will ignore the second request. This prevents
9640 /// clients from accidentally creating duplicate commitments.
9641 ///
9642 /// The request ID must be a valid UUID with the exception that zero UUID is
9643 /// not supported (00000000-0000-0000-0000-000000000000).
9644 pub request_id: std::string::String,
9645
9646 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9647}
9648
9649impl UpdateCaPoolRequest {
9650 pub fn new() -> Self {
9651 std::default::Default::default()
9652 }
9653
9654 /// Sets the value of [ca_pool][crate::model::UpdateCaPoolRequest::ca_pool].
9655 ///
9656 /// # Example
9657 /// ```ignore,no_run
9658 /// # use google_cloud_security_privateca_v1::model::UpdateCaPoolRequest;
9659 /// use google_cloud_security_privateca_v1::model::CaPool;
9660 /// let x = UpdateCaPoolRequest::new().set_ca_pool(CaPool::default()/* use setters */);
9661 /// ```
9662 pub fn set_ca_pool<T>(mut self, v: T) -> Self
9663 where
9664 T: std::convert::Into<crate::model::CaPool>,
9665 {
9666 self.ca_pool = std::option::Option::Some(v.into());
9667 self
9668 }
9669
9670 /// Sets or clears the value of [ca_pool][crate::model::UpdateCaPoolRequest::ca_pool].
9671 ///
9672 /// # Example
9673 /// ```ignore,no_run
9674 /// # use google_cloud_security_privateca_v1::model::UpdateCaPoolRequest;
9675 /// use google_cloud_security_privateca_v1::model::CaPool;
9676 /// let x = UpdateCaPoolRequest::new().set_or_clear_ca_pool(Some(CaPool::default()/* use setters */));
9677 /// let x = UpdateCaPoolRequest::new().set_or_clear_ca_pool(None::<CaPool>);
9678 /// ```
9679 pub fn set_or_clear_ca_pool<T>(mut self, v: std::option::Option<T>) -> Self
9680 where
9681 T: std::convert::Into<crate::model::CaPool>,
9682 {
9683 self.ca_pool = v.map(|x| x.into());
9684 self
9685 }
9686
9687 /// Sets the value of [update_mask][crate::model::UpdateCaPoolRequest::update_mask].
9688 ///
9689 /// # Example
9690 /// ```ignore,no_run
9691 /// # use google_cloud_security_privateca_v1::model::UpdateCaPoolRequest;
9692 /// use wkt::FieldMask;
9693 /// let x = UpdateCaPoolRequest::new().set_update_mask(FieldMask::default()/* use setters */);
9694 /// ```
9695 pub fn set_update_mask<T>(mut self, v: T) -> Self
9696 where
9697 T: std::convert::Into<wkt::FieldMask>,
9698 {
9699 self.update_mask = std::option::Option::Some(v.into());
9700 self
9701 }
9702
9703 /// Sets or clears the value of [update_mask][crate::model::UpdateCaPoolRequest::update_mask].
9704 ///
9705 /// # Example
9706 /// ```ignore,no_run
9707 /// # use google_cloud_security_privateca_v1::model::UpdateCaPoolRequest;
9708 /// use wkt::FieldMask;
9709 /// let x = UpdateCaPoolRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
9710 /// let x = UpdateCaPoolRequest::new().set_or_clear_update_mask(None::<FieldMask>);
9711 /// ```
9712 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
9713 where
9714 T: std::convert::Into<wkt::FieldMask>,
9715 {
9716 self.update_mask = v.map(|x| x.into());
9717 self
9718 }
9719
9720 /// Sets the value of [request_id][crate::model::UpdateCaPoolRequest::request_id].
9721 ///
9722 /// # Example
9723 /// ```ignore,no_run
9724 /// # use google_cloud_security_privateca_v1::model::UpdateCaPoolRequest;
9725 /// let x = UpdateCaPoolRequest::new().set_request_id("example");
9726 /// ```
9727 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9728 self.request_id = v.into();
9729 self
9730 }
9731}
9732
9733impl wkt::message::Message for UpdateCaPoolRequest {
9734 fn typename() -> &'static str {
9735 "type.googleapis.com/google.cloud.security.privateca.v1.UpdateCaPoolRequest"
9736 }
9737}
9738
9739/// Request message for
9740/// [CertificateAuthorityService.DeleteCaPool][google.cloud.security.privateca.v1.CertificateAuthorityService.DeleteCaPool].
9741///
9742/// [google.cloud.security.privateca.v1.CertificateAuthorityService.DeleteCaPool]: crate::client::CertificateAuthorityService::delete_ca_pool
9743#[derive(Clone, Default, PartialEq)]
9744#[non_exhaustive]
9745pub struct DeleteCaPoolRequest {
9746 /// Required. The resource name for this
9747 /// [CaPool][google.cloud.security.privateca.v1.CaPool] in the format
9748 /// `projects/*/locations/*/caPools/*`.
9749 ///
9750 /// [google.cloud.security.privateca.v1.CaPool]: crate::model::CaPool
9751 pub name: std::string::String,
9752
9753 /// Optional. An ID to identify requests. Specify a unique request ID so that
9754 /// if you must retry your request, the server will know to ignore the request
9755 /// if it has already been completed. The server will guarantee that for at
9756 /// least 60 minutes since the first request.
9757 ///
9758 /// For example, consider a situation where you make an initial request and
9759 /// the request times out. If you make the request again with the same request
9760 /// ID, the server can check if original operation with the same request ID
9761 /// was received, and if so, will ignore the second request. This prevents
9762 /// clients from accidentally creating duplicate commitments.
9763 ///
9764 /// The request ID must be a valid UUID with the exception that zero UUID is
9765 /// not supported (00000000-0000-0000-0000-000000000000).
9766 pub request_id: std::string::String,
9767
9768 /// Optional. This field allows this pool to be deleted even if it's being
9769 /// depended on by another resource. However, doing so may result in unintended
9770 /// and unrecoverable effects on any dependent resources since the pool will
9771 /// no longer be able to issue certificates.
9772 pub ignore_dependent_resources: bool,
9773
9774 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9775}
9776
9777impl DeleteCaPoolRequest {
9778 pub fn new() -> Self {
9779 std::default::Default::default()
9780 }
9781
9782 /// Sets the value of [name][crate::model::DeleteCaPoolRequest::name].
9783 ///
9784 /// # Example
9785 /// ```ignore,no_run
9786 /// # use google_cloud_security_privateca_v1::model::DeleteCaPoolRequest;
9787 /// let x = DeleteCaPoolRequest::new().set_name("example");
9788 /// ```
9789 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9790 self.name = v.into();
9791 self
9792 }
9793
9794 /// Sets the value of [request_id][crate::model::DeleteCaPoolRequest::request_id].
9795 ///
9796 /// # Example
9797 /// ```ignore,no_run
9798 /// # use google_cloud_security_privateca_v1::model::DeleteCaPoolRequest;
9799 /// let x = DeleteCaPoolRequest::new().set_request_id("example");
9800 /// ```
9801 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9802 self.request_id = v.into();
9803 self
9804 }
9805
9806 /// Sets the value of [ignore_dependent_resources][crate::model::DeleteCaPoolRequest::ignore_dependent_resources].
9807 ///
9808 /// # Example
9809 /// ```ignore,no_run
9810 /// # use google_cloud_security_privateca_v1::model::DeleteCaPoolRequest;
9811 /// let x = DeleteCaPoolRequest::new().set_ignore_dependent_resources(true);
9812 /// ```
9813 pub fn set_ignore_dependent_resources<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9814 self.ignore_dependent_resources = v.into();
9815 self
9816 }
9817}
9818
9819impl wkt::message::Message for DeleteCaPoolRequest {
9820 fn typename() -> &'static str {
9821 "type.googleapis.com/google.cloud.security.privateca.v1.DeleteCaPoolRequest"
9822 }
9823}
9824
9825/// Request message for
9826/// [CertificateAuthorityService.FetchCaCerts][google.cloud.security.privateca.v1.CertificateAuthorityService.FetchCaCerts].
9827///
9828/// [google.cloud.security.privateca.v1.CertificateAuthorityService.FetchCaCerts]: crate::client::CertificateAuthorityService::fetch_ca_certs
9829#[derive(Clone, Default, PartialEq)]
9830#[non_exhaustive]
9831pub struct FetchCaCertsRequest {
9832 /// Required. The resource name for the
9833 /// [CaPool][google.cloud.security.privateca.v1.CaPool] in the format
9834 /// `projects/*/locations/*/caPools/*`.
9835 ///
9836 /// [google.cloud.security.privateca.v1.CaPool]: crate::model::CaPool
9837 pub ca_pool: std::string::String,
9838
9839 /// Optional. An ID to identify requests. Specify a unique request ID so that
9840 /// if you must retry your request, the server will know to ignore the request
9841 /// if it has already been completed. The server will guarantee that for at
9842 /// least 60 minutes since the first request.
9843 ///
9844 /// For example, consider a situation where you make an initial request and
9845 /// the request times out. If you make the request again with the same request
9846 /// ID, the server can check if original operation with the same request ID
9847 /// was received, and if so, will ignore the second request. This prevents
9848 /// clients from accidentally creating duplicate commitments.
9849 ///
9850 /// The request ID must be a valid UUID with the exception that zero UUID is
9851 /// not supported (00000000-0000-0000-0000-000000000000).
9852 pub request_id: std::string::String,
9853
9854 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9855}
9856
9857impl FetchCaCertsRequest {
9858 pub fn new() -> Self {
9859 std::default::Default::default()
9860 }
9861
9862 /// Sets the value of [ca_pool][crate::model::FetchCaCertsRequest::ca_pool].
9863 ///
9864 /// # Example
9865 /// ```ignore,no_run
9866 /// # use google_cloud_security_privateca_v1::model::FetchCaCertsRequest;
9867 /// let x = FetchCaCertsRequest::new().set_ca_pool("example");
9868 /// ```
9869 pub fn set_ca_pool<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9870 self.ca_pool = v.into();
9871 self
9872 }
9873
9874 /// Sets the value of [request_id][crate::model::FetchCaCertsRequest::request_id].
9875 ///
9876 /// # Example
9877 /// ```ignore,no_run
9878 /// # use google_cloud_security_privateca_v1::model::FetchCaCertsRequest;
9879 /// let x = FetchCaCertsRequest::new().set_request_id("example");
9880 /// ```
9881 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9882 self.request_id = v.into();
9883 self
9884 }
9885}
9886
9887impl wkt::message::Message for FetchCaCertsRequest {
9888 fn typename() -> &'static str {
9889 "type.googleapis.com/google.cloud.security.privateca.v1.FetchCaCertsRequest"
9890 }
9891}
9892
9893/// Response message for
9894/// [CertificateAuthorityService.FetchCaCerts][google.cloud.security.privateca.v1.CertificateAuthorityService.FetchCaCerts].
9895///
9896/// [google.cloud.security.privateca.v1.CertificateAuthorityService.FetchCaCerts]: crate::client::CertificateAuthorityService::fetch_ca_certs
9897#[derive(Clone, Default, PartialEq)]
9898#[non_exhaustive]
9899pub struct FetchCaCertsResponse {
9900 /// The PEM encoded CA certificate chains of all certificate authorities in
9901 /// this [CaPool][google.cloud.security.privateca.v1.CaPool] in the ENABLED,
9902 /// DISABLED, or STAGED states.
9903 ///
9904 /// [google.cloud.security.privateca.v1.CaPool]: crate::model::CaPool
9905 pub ca_certs: std::vec::Vec<crate::model::fetch_ca_certs_response::CertChain>,
9906
9907 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9908}
9909
9910impl FetchCaCertsResponse {
9911 pub fn new() -> Self {
9912 std::default::Default::default()
9913 }
9914
9915 /// Sets the value of [ca_certs][crate::model::FetchCaCertsResponse::ca_certs].
9916 ///
9917 /// # Example
9918 /// ```ignore,no_run
9919 /// # use google_cloud_security_privateca_v1::model::FetchCaCertsResponse;
9920 /// use google_cloud_security_privateca_v1::model::fetch_ca_certs_response::CertChain;
9921 /// let x = FetchCaCertsResponse::new()
9922 /// .set_ca_certs([
9923 /// CertChain::default()/* use setters */,
9924 /// CertChain::default()/* use (different) setters */,
9925 /// ]);
9926 /// ```
9927 pub fn set_ca_certs<T, V>(mut self, v: T) -> Self
9928 where
9929 T: std::iter::IntoIterator<Item = V>,
9930 V: std::convert::Into<crate::model::fetch_ca_certs_response::CertChain>,
9931 {
9932 use std::iter::Iterator;
9933 self.ca_certs = v.into_iter().map(|i| i.into()).collect();
9934 self
9935 }
9936}
9937
9938impl wkt::message::Message for FetchCaCertsResponse {
9939 fn typename() -> &'static str {
9940 "type.googleapis.com/google.cloud.security.privateca.v1.FetchCaCertsResponse"
9941 }
9942}
9943
9944/// Defines additional types related to [FetchCaCertsResponse].
9945pub mod fetch_ca_certs_response {
9946 #[allow(unused_imports)]
9947 use super::*;
9948
9949 #[derive(Clone, Default, PartialEq)]
9950 #[non_exhaustive]
9951 pub struct CertChain {
9952 /// The certificates that form the CA chain, from leaf to root order.
9953 pub certificates: std::vec::Vec<std::string::String>,
9954
9955 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9956 }
9957
9958 impl CertChain {
9959 pub fn new() -> Self {
9960 std::default::Default::default()
9961 }
9962
9963 /// Sets the value of [certificates][crate::model::fetch_ca_certs_response::CertChain::certificates].
9964 ///
9965 /// # Example
9966 /// ```ignore,no_run
9967 /// # use google_cloud_security_privateca_v1::model::fetch_ca_certs_response::CertChain;
9968 /// let x = CertChain::new().set_certificates(["a", "b", "c"]);
9969 /// ```
9970 pub fn set_certificates<T, V>(mut self, v: T) -> Self
9971 where
9972 T: std::iter::IntoIterator<Item = V>,
9973 V: std::convert::Into<std::string::String>,
9974 {
9975 use std::iter::Iterator;
9976 self.certificates = v.into_iter().map(|i| i.into()).collect();
9977 self
9978 }
9979 }
9980
9981 impl wkt::message::Message for CertChain {
9982 fn typename() -> &'static str {
9983 "type.googleapis.com/google.cloud.security.privateca.v1.FetchCaCertsResponse.CertChain"
9984 }
9985 }
9986}
9987
9988/// Request message for
9989/// [CertificateAuthorityService.GetCaPool][google.cloud.security.privateca.v1.CertificateAuthorityService.GetCaPool].
9990///
9991/// [google.cloud.security.privateca.v1.CertificateAuthorityService.GetCaPool]: crate::client::CertificateAuthorityService::get_ca_pool
9992#[derive(Clone, Default, PartialEq)]
9993#[non_exhaustive]
9994pub struct GetCaPoolRequest {
9995 /// Required. The [name][google.cloud.security.privateca.v1.CaPool.name] of the
9996 /// [CaPool][google.cloud.security.privateca.v1.CaPool] to get.
9997 ///
9998 /// [google.cloud.security.privateca.v1.CaPool]: crate::model::CaPool
9999 /// [google.cloud.security.privateca.v1.CaPool.name]: crate::model::CaPool::name
10000 pub name: std::string::String,
10001
10002 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10003}
10004
10005impl GetCaPoolRequest {
10006 pub fn new() -> Self {
10007 std::default::Default::default()
10008 }
10009
10010 /// Sets the value of [name][crate::model::GetCaPoolRequest::name].
10011 ///
10012 /// # Example
10013 /// ```ignore,no_run
10014 /// # use google_cloud_security_privateca_v1::model::GetCaPoolRequest;
10015 /// let x = GetCaPoolRequest::new().set_name("example");
10016 /// ```
10017 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10018 self.name = v.into();
10019 self
10020 }
10021}
10022
10023impl wkt::message::Message for GetCaPoolRequest {
10024 fn typename() -> &'static str {
10025 "type.googleapis.com/google.cloud.security.privateca.v1.GetCaPoolRequest"
10026 }
10027}
10028
10029/// Request message for
10030/// [CertificateAuthorityService.ListCaPools][google.cloud.security.privateca.v1.CertificateAuthorityService.ListCaPools].
10031///
10032/// [google.cloud.security.privateca.v1.CertificateAuthorityService.ListCaPools]: crate::client::CertificateAuthorityService::list_ca_pools
10033#[derive(Clone, Default, PartialEq)]
10034#[non_exhaustive]
10035pub struct ListCaPoolsRequest {
10036 /// Required. The resource name of the location associated with the
10037 /// [CaPools][google.cloud.security.privateca.v1.CaPool], in the format
10038 /// `projects/*/locations/*`.
10039 ///
10040 /// [google.cloud.security.privateca.v1.CaPool]: crate::model::CaPool
10041 pub parent: std::string::String,
10042
10043 /// Optional. Limit on the number of
10044 /// [CaPools][google.cloud.security.privateca.v1.CaPool] to include in the
10045 /// response. Further [CaPools][google.cloud.security.privateca.v1.CaPool] can
10046 /// subsequently be obtained by including the
10047 /// [ListCaPoolsResponse.next_page_token][google.cloud.security.privateca.v1.ListCaPoolsResponse.next_page_token]
10048 /// in a subsequent request. If unspecified, the server will pick an
10049 /// appropriate default.
10050 ///
10051 /// [google.cloud.security.privateca.v1.CaPool]: crate::model::CaPool
10052 /// [google.cloud.security.privateca.v1.ListCaPoolsResponse.next_page_token]: crate::model::ListCaPoolsResponse::next_page_token
10053 pub page_size: i32,
10054
10055 /// Optional. Pagination token, returned earlier via
10056 /// [ListCaPoolsResponse.next_page_token][google.cloud.security.privateca.v1.ListCaPoolsResponse.next_page_token].
10057 ///
10058 /// [google.cloud.security.privateca.v1.ListCaPoolsResponse.next_page_token]: crate::model::ListCaPoolsResponse::next_page_token
10059 pub page_token: std::string::String,
10060
10061 /// Optional. Only include resources that match the filter in the response.
10062 pub filter: std::string::String,
10063
10064 /// Optional. Specify how the results should be sorted.
10065 pub order_by: std::string::String,
10066
10067 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10068}
10069
10070impl ListCaPoolsRequest {
10071 pub fn new() -> Self {
10072 std::default::Default::default()
10073 }
10074
10075 /// Sets the value of [parent][crate::model::ListCaPoolsRequest::parent].
10076 ///
10077 /// # Example
10078 /// ```ignore,no_run
10079 /// # use google_cloud_security_privateca_v1::model::ListCaPoolsRequest;
10080 /// let x = ListCaPoolsRequest::new().set_parent("example");
10081 /// ```
10082 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10083 self.parent = v.into();
10084 self
10085 }
10086
10087 /// Sets the value of [page_size][crate::model::ListCaPoolsRequest::page_size].
10088 ///
10089 /// # Example
10090 /// ```ignore,no_run
10091 /// # use google_cloud_security_privateca_v1::model::ListCaPoolsRequest;
10092 /// let x = ListCaPoolsRequest::new().set_page_size(42);
10093 /// ```
10094 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10095 self.page_size = v.into();
10096 self
10097 }
10098
10099 /// Sets the value of [page_token][crate::model::ListCaPoolsRequest::page_token].
10100 ///
10101 /// # Example
10102 /// ```ignore,no_run
10103 /// # use google_cloud_security_privateca_v1::model::ListCaPoolsRequest;
10104 /// let x = ListCaPoolsRequest::new().set_page_token("example");
10105 /// ```
10106 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10107 self.page_token = v.into();
10108 self
10109 }
10110
10111 /// Sets the value of [filter][crate::model::ListCaPoolsRequest::filter].
10112 ///
10113 /// # Example
10114 /// ```ignore,no_run
10115 /// # use google_cloud_security_privateca_v1::model::ListCaPoolsRequest;
10116 /// let x = ListCaPoolsRequest::new().set_filter("example");
10117 /// ```
10118 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10119 self.filter = v.into();
10120 self
10121 }
10122
10123 /// Sets the value of [order_by][crate::model::ListCaPoolsRequest::order_by].
10124 ///
10125 /// # Example
10126 /// ```ignore,no_run
10127 /// # use google_cloud_security_privateca_v1::model::ListCaPoolsRequest;
10128 /// let x = ListCaPoolsRequest::new().set_order_by("example");
10129 /// ```
10130 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10131 self.order_by = v.into();
10132 self
10133 }
10134}
10135
10136impl wkt::message::Message for ListCaPoolsRequest {
10137 fn typename() -> &'static str {
10138 "type.googleapis.com/google.cloud.security.privateca.v1.ListCaPoolsRequest"
10139 }
10140}
10141
10142/// Response message for
10143/// [CertificateAuthorityService.ListCaPools][google.cloud.security.privateca.v1.CertificateAuthorityService.ListCaPools].
10144///
10145/// [google.cloud.security.privateca.v1.CertificateAuthorityService.ListCaPools]: crate::client::CertificateAuthorityService::list_ca_pools
10146#[derive(Clone, Default, PartialEq)]
10147#[non_exhaustive]
10148pub struct ListCaPoolsResponse {
10149 /// The list of [CaPools][google.cloud.security.privateca.v1.CaPool].
10150 ///
10151 /// [google.cloud.security.privateca.v1.CaPool]: crate::model::CaPool
10152 pub ca_pools: std::vec::Vec<crate::model::CaPool>,
10153
10154 /// A token to retrieve next page of results. Pass this value in
10155 /// [ListCertificateAuthoritiesRequest.page_token][google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest.page_token]
10156 /// to retrieve the next page of results.
10157 ///
10158 /// [google.cloud.security.privateca.v1.ListCertificateAuthoritiesRequest.page_token]: crate::model::ListCertificateAuthoritiesRequest::page_token
10159 pub next_page_token: std::string::String,
10160
10161 /// A list of locations (e.g. "us-west1") that could not be reached.
10162 pub unreachable: std::vec::Vec<std::string::String>,
10163
10164 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10165}
10166
10167impl ListCaPoolsResponse {
10168 pub fn new() -> Self {
10169 std::default::Default::default()
10170 }
10171
10172 /// Sets the value of [ca_pools][crate::model::ListCaPoolsResponse::ca_pools].
10173 ///
10174 /// # Example
10175 /// ```ignore,no_run
10176 /// # use google_cloud_security_privateca_v1::model::ListCaPoolsResponse;
10177 /// use google_cloud_security_privateca_v1::model::CaPool;
10178 /// let x = ListCaPoolsResponse::new()
10179 /// .set_ca_pools([
10180 /// CaPool::default()/* use setters */,
10181 /// CaPool::default()/* use (different) setters */,
10182 /// ]);
10183 /// ```
10184 pub fn set_ca_pools<T, V>(mut self, v: T) -> Self
10185 where
10186 T: std::iter::IntoIterator<Item = V>,
10187 V: std::convert::Into<crate::model::CaPool>,
10188 {
10189 use std::iter::Iterator;
10190 self.ca_pools = v.into_iter().map(|i| i.into()).collect();
10191 self
10192 }
10193
10194 /// Sets the value of [next_page_token][crate::model::ListCaPoolsResponse::next_page_token].
10195 ///
10196 /// # Example
10197 /// ```ignore,no_run
10198 /// # use google_cloud_security_privateca_v1::model::ListCaPoolsResponse;
10199 /// let x = ListCaPoolsResponse::new().set_next_page_token("example");
10200 /// ```
10201 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10202 self.next_page_token = v.into();
10203 self
10204 }
10205
10206 /// Sets the value of [unreachable][crate::model::ListCaPoolsResponse::unreachable].
10207 ///
10208 /// # Example
10209 /// ```ignore,no_run
10210 /// # use google_cloud_security_privateca_v1::model::ListCaPoolsResponse;
10211 /// let x = ListCaPoolsResponse::new().set_unreachable(["a", "b", "c"]);
10212 /// ```
10213 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
10214 where
10215 T: std::iter::IntoIterator<Item = V>,
10216 V: std::convert::Into<std::string::String>,
10217 {
10218 use std::iter::Iterator;
10219 self.unreachable = v.into_iter().map(|i| i.into()).collect();
10220 self
10221 }
10222}
10223
10224impl wkt::message::Message for ListCaPoolsResponse {
10225 fn typename() -> &'static str {
10226 "type.googleapis.com/google.cloud.security.privateca.v1.ListCaPoolsResponse"
10227 }
10228}
10229
10230#[doc(hidden)]
10231impl gax::paginator::internal::PageableResponse for ListCaPoolsResponse {
10232 type PageItem = crate::model::CaPool;
10233
10234 fn items(self) -> std::vec::Vec<Self::PageItem> {
10235 self.ca_pools
10236 }
10237
10238 fn next_page_token(&self) -> std::string::String {
10239 use std::clone::Clone;
10240 self.next_page_token.clone()
10241 }
10242}
10243
10244/// Request message for
10245/// [CertificateAuthorityService.GetCertificateRevocationList][google.cloud.security.privateca.v1.CertificateAuthorityService.GetCertificateRevocationList].
10246///
10247/// [google.cloud.security.privateca.v1.CertificateAuthorityService.GetCertificateRevocationList]: crate::client::CertificateAuthorityService::get_certificate_revocation_list
10248#[derive(Clone, Default, PartialEq)]
10249#[non_exhaustive]
10250pub struct GetCertificateRevocationListRequest {
10251 /// Required. The
10252 /// [name][google.cloud.security.privateca.v1.CertificateRevocationList.name]
10253 /// of the
10254 /// [CertificateRevocationList][google.cloud.security.privateca.v1.CertificateRevocationList]
10255 /// to get.
10256 ///
10257 /// [google.cloud.security.privateca.v1.CertificateRevocationList]: crate::model::CertificateRevocationList
10258 /// [google.cloud.security.privateca.v1.CertificateRevocationList.name]: crate::model::CertificateRevocationList::name
10259 pub name: std::string::String,
10260
10261 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10262}
10263
10264impl GetCertificateRevocationListRequest {
10265 pub fn new() -> Self {
10266 std::default::Default::default()
10267 }
10268
10269 /// Sets the value of [name][crate::model::GetCertificateRevocationListRequest::name].
10270 ///
10271 /// # Example
10272 /// ```ignore,no_run
10273 /// # use google_cloud_security_privateca_v1::model::GetCertificateRevocationListRequest;
10274 /// let x = GetCertificateRevocationListRequest::new().set_name("example");
10275 /// ```
10276 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10277 self.name = v.into();
10278 self
10279 }
10280}
10281
10282impl wkt::message::Message for GetCertificateRevocationListRequest {
10283 fn typename() -> &'static str {
10284 "type.googleapis.com/google.cloud.security.privateca.v1.GetCertificateRevocationListRequest"
10285 }
10286}
10287
10288/// Request message for
10289/// [CertificateAuthorityService.ListCertificateRevocationLists][google.cloud.security.privateca.v1.CertificateAuthorityService.ListCertificateRevocationLists].
10290///
10291/// [google.cloud.security.privateca.v1.CertificateAuthorityService.ListCertificateRevocationLists]: crate::client::CertificateAuthorityService::list_certificate_revocation_lists
10292#[derive(Clone, Default, PartialEq)]
10293#[non_exhaustive]
10294pub struct ListCertificateRevocationListsRequest {
10295 /// Required. The resource name of the location associated with the
10296 /// [CertificateRevocationLists][google.cloud.security.privateca.v1.CertificateRevocationList],
10297 /// in the format `projects/*/locations/*/caPools/*/certificateAuthorities/*`.
10298 ///
10299 /// [google.cloud.security.privateca.v1.CertificateRevocationList]: crate::model::CertificateRevocationList
10300 pub parent: std::string::String,
10301
10302 /// Optional. Limit on the number of
10303 /// [CertificateRevocationLists][google.cloud.security.privateca.v1.CertificateRevocationList]
10304 /// to include in the response. Further
10305 /// [CertificateRevocationLists][google.cloud.security.privateca.v1.CertificateRevocationList]
10306 /// can subsequently be obtained by including the
10307 /// [ListCertificateRevocationListsResponse.next_page_token][google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse.next_page_token]
10308 /// in a subsequent request. If unspecified, the server will pick an
10309 /// appropriate default.
10310 ///
10311 /// [google.cloud.security.privateca.v1.CertificateRevocationList]: crate::model::CertificateRevocationList
10312 /// [google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse.next_page_token]: crate::model::ListCertificateRevocationListsResponse::next_page_token
10313 pub page_size: i32,
10314
10315 /// Optional. Pagination token, returned earlier via
10316 /// [ListCertificateRevocationListsResponse.next_page_token][google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse.next_page_token].
10317 ///
10318 /// [google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse.next_page_token]: crate::model::ListCertificateRevocationListsResponse::next_page_token
10319 pub page_token: std::string::String,
10320
10321 /// Optional. Only include resources that match the filter in the response.
10322 pub filter: std::string::String,
10323
10324 /// Optional. Specify how the results should be sorted.
10325 pub order_by: std::string::String,
10326
10327 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10328}
10329
10330impl ListCertificateRevocationListsRequest {
10331 pub fn new() -> Self {
10332 std::default::Default::default()
10333 }
10334
10335 /// Sets the value of [parent][crate::model::ListCertificateRevocationListsRequest::parent].
10336 ///
10337 /// # Example
10338 /// ```ignore,no_run
10339 /// # use google_cloud_security_privateca_v1::model::ListCertificateRevocationListsRequest;
10340 /// let x = ListCertificateRevocationListsRequest::new().set_parent("example");
10341 /// ```
10342 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10343 self.parent = v.into();
10344 self
10345 }
10346
10347 /// Sets the value of [page_size][crate::model::ListCertificateRevocationListsRequest::page_size].
10348 ///
10349 /// # Example
10350 /// ```ignore,no_run
10351 /// # use google_cloud_security_privateca_v1::model::ListCertificateRevocationListsRequest;
10352 /// let x = ListCertificateRevocationListsRequest::new().set_page_size(42);
10353 /// ```
10354 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10355 self.page_size = v.into();
10356 self
10357 }
10358
10359 /// Sets the value of [page_token][crate::model::ListCertificateRevocationListsRequest::page_token].
10360 ///
10361 /// # Example
10362 /// ```ignore,no_run
10363 /// # use google_cloud_security_privateca_v1::model::ListCertificateRevocationListsRequest;
10364 /// let x = ListCertificateRevocationListsRequest::new().set_page_token("example");
10365 /// ```
10366 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10367 self.page_token = v.into();
10368 self
10369 }
10370
10371 /// Sets the value of [filter][crate::model::ListCertificateRevocationListsRequest::filter].
10372 ///
10373 /// # Example
10374 /// ```ignore,no_run
10375 /// # use google_cloud_security_privateca_v1::model::ListCertificateRevocationListsRequest;
10376 /// let x = ListCertificateRevocationListsRequest::new().set_filter("example");
10377 /// ```
10378 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10379 self.filter = v.into();
10380 self
10381 }
10382
10383 /// Sets the value of [order_by][crate::model::ListCertificateRevocationListsRequest::order_by].
10384 ///
10385 /// # Example
10386 /// ```ignore,no_run
10387 /// # use google_cloud_security_privateca_v1::model::ListCertificateRevocationListsRequest;
10388 /// let x = ListCertificateRevocationListsRequest::new().set_order_by("example");
10389 /// ```
10390 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10391 self.order_by = v.into();
10392 self
10393 }
10394}
10395
10396impl wkt::message::Message for ListCertificateRevocationListsRequest {
10397 fn typename() -> &'static str {
10398 "type.googleapis.com/google.cloud.security.privateca.v1.ListCertificateRevocationListsRequest"
10399 }
10400}
10401
10402/// Response message for
10403/// [CertificateAuthorityService.ListCertificateRevocationLists][google.cloud.security.privateca.v1.CertificateAuthorityService.ListCertificateRevocationLists].
10404///
10405/// [google.cloud.security.privateca.v1.CertificateAuthorityService.ListCertificateRevocationLists]: crate::client::CertificateAuthorityService::list_certificate_revocation_lists
10406#[derive(Clone, Default, PartialEq)]
10407#[non_exhaustive]
10408pub struct ListCertificateRevocationListsResponse {
10409 /// The list of
10410 /// [CertificateRevocationLists][google.cloud.security.privateca.v1.CertificateRevocationList].
10411 ///
10412 /// [google.cloud.security.privateca.v1.CertificateRevocationList]: crate::model::CertificateRevocationList
10413 pub certificate_revocation_lists: std::vec::Vec<crate::model::CertificateRevocationList>,
10414
10415 /// A token to retrieve next page of results. Pass this value in
10416 /// [ListCertificateRevocationListsRequest.page_token][google.cloud.security.privateca.v1.ListCertificateRevocationListsRequest.page_token]
10417 /// to retrieve the next page of results.
10418 ///
10419 /// [google.cloud.security.privateca.v1.ListCertificateRevocationListsRequest.page_token]: crate::model::ListCertificateRevocationListsRequest::page_token
10420 pub next_page_token: std::string::String,
10421
10422 /// A list of locations (e.g. "us-west1") that could not be reached.
10423 pub unreachable: std::vec::Vec<std::string::String>,
10424
10425 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10426}
10427
10428impl ListCertificateRevocationListsResponse {
10429 pub fn new() -> Self {
10430 std::default::Default::default()
10431 }
10432
10433 /// Sets the value of [certificate_revocation_lists][crate::model::ListCertificateRevocationListsResponse::certificate_revocation_lists].
10434 ///
10435 /// # Example
10436 /// ```ignore,no_run
10437 /// # use google_cloud_security_privateca_v1::model::ListCertificateRevocationListsResponse;
10438 /// use google_cloud_security_privateca_v1::model::CertificateRevocationList;
10439 /// let x = ListCertificateRevocationListsResponse::new()
10440 /// .set_certificate_revocation_lists([
10441 /// CertificateRevocationList::default()/* use setters */,
10442 /// CertificateRevocationList::default()/* use (different) setters */,
10443 /// ]);
10444 /// ```
10445 pub fn set_certificate_revocation_lists<T, V>(mut self, v: T) -> Self
10446 where
10447 T: std::iter::IntoIterator<Item = V>,
10448 V: std::convert::Into<crate::model::CertificateRevocationList>,
10449 {
10450 use std::iter::Iterator;
10451 self.certificate_revocation_lists = v.into_iter().map(|i| i.into()).collect();
10452 self
10453 }
10454
10455 /// Sets the value of [next_page_token][crate::model::ListCertificateRevocationListsResponse::next_page_token].
10456 ///
10457 /// # Example
10458 /// ```ignore,no_run
10459 /// # use google_cloud_security_privateca_v1::model::ListCertificateRevocationListsResponse;
10460 /// let x = ListCertificateRevocationListsResponse::new().set_next_page_token("example");
10461 /// ```
10462 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10463 self.next_page_token = v.into();
10464 self
10465 }
10466
10467 /// Sets the value of [unreachable][crate::model::ListCertificateRevocationListsResponse::unreachable].
10468 ///
10469 /// # Example
10470 /// ```ignore,no_run
10471 /// # use google_cloud_security_privateca_v1::model::ListCertificateRevocationListsResponse;
10472 /// let x = ListCertificateRevocationListsResponse::new().set_unreachable(["a", "b", "c"]);
10473 /// ```
10474 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
10475 where
10476 T: std::iter::IntoIterator<Item = V>,
10477 V: std::convert::Into<std::string::String>,
10478 {
10479 use std::iter::Iterator;
10480 self.unreachable = v.into_iter().map(|i| i.into()).collect();
10481 self
10482 }
10483}
10484
10485impl wkt::message::Message for ListCertificateRevocationListsResponse {
10486 fn typename() -> &'static str {
10487 "type.googleapis.com/google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse"
10488 }
10489}
10490
10491#[doc(hidden)]
10492impl gax::paginator::internal::PageableResponse for ListCertificateRevocationListsResponse {
10493 type PageItem = crate::model::CertificateRevocationList;
10494
10495 fn items(self) -> std::vec::Vec<Self::PageItem> {
10496 self.certificate_revocation_lists
10497 }
10498
10499 fn next_page_token(&self) -> std::string::String {
10500 use std::clone::Clone;
10501 self.next_page_token.clone()
10502 }
10503}
10504
10505/// Request message for
10506/// [CertificateAuthorityService.UpdateCertificateRevocationList][google.cloud.security.privateca.v1.CertificateAuthorityService.UpdateCertificateRevocationList].
10507///
10508/// [google.cloud.security.privateca.v1.CertificateAuthorityService.UpdateCertificateRevocationList]: crate::client::CertificateAuthorityService::update_certificate_revocation_list
10509#[derive(Clone, Default, PartialEq)]
10510#[non_exhaustive]
10511pub struct UpdateCertificateRevocationListRequest {
10512 /// Required.
10513 /// [CertificateRevocationList][google.cloud.security.privateca.v1.CertificateRevocationList]
10514 /// with updated values.
10515 ///
10516 /// [google.cloud.security.privateca.v1.CertificateRevocationList]: crate::model::CertificateRevocationList
10517 pub certificate_revocation_list: std::option::Option<crate::model::CertificateRevocationList>,
10518
10519 /// Required. A list of fields to be updated in this request.
10520 pub update_mask: std::option::Option<wkt::FieldMask>,
10521
10522 /// Optional. An ID to identify requests. Specify a unique request ID so that
10523 /// if you must retry your request, the server will know to ignore the request
10524 /// if it has already been completed. The server will guarantee that for at
10525 /// least 60 minutes since the first request.
10526 ///
10527 /// For example, consider a situation where you make an initial request and
10528 /// the request times out. If you make the request again with the same request
10529 /// ID, the server can check if original operation with the same request ID
10530 /// was received, and if so, will ignore the second request. This prevents
10531 /// clients from accidentally creating duplicate commitments.
10532 ///
10533 /// The request ID must be a valid UUID with the exception that zero UUID is
10534 /// not supported (00000000-0000-0000-0000-000000000000).
10535 pub request_id: std::string::String,
10536
10537 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10538}
10539
10540impl UpdateCertificateRevocationListRequest {
10541 pub fn new() -> Self {
10542 std::default::Default::default()
10543 }
10544
10545 /// Sets the value of [certificate_revocation_list][crate::model::UpdateCertificateRevocationListRequest::certificate_revocation_list].
10546 ///
10547 /// # Example
10548 /// ```ignore,no_run
10549 /// # use google_cloud_security_privateca_v1::model::UpdateCertificateRevocationListRequest;
10550 /// use google_cloud_security_privateca_v1::model::CertificateRevocationList;
10551 /// let x = UpdateCertificateRevocationListRequest::new().set_certificate_revocation_list(CertificateRevocationList::default()/* use setters */);
10552 /// ```
10553 pub fn set_certificate_revocation_list<T>(mut self, v: T) -> Self
10554 where
10555 T: std::convert::Into<crate::model::CertificateRevocationList>,
10556 {
10557 self.certificate_revocation_list = std::option::Option::Some(v.into());
10558 self
10559 }
10560
10561 /// Sets or clears the value of [certificate_revocation_list][crate::model::UpdateCertificateRevocationListRequest::certificate_revocation_list].
10562 ///
10563 /// # Example
10564 /// ```ignore,no_run
10565 /// # use google_cloud_security_privateca_v1::model::UpdateCertificateRevocationListRequest;
10566 /// use google_cloud_security_privateca_v1::model::CertificateRevocationList;
10567 /// let x = UpdateCertificateRevocationListRequest::new().set_or_clear_certificate_revocation_list(Some(CertificateRevocationList::default()/* use setters */));
10568 /// let x = UpdateCertificateRevocationListRequest::new().set_or_clear_certificate_revocation_list(None::<CertificateRevocationList>);
10569 /// ```
10570 pub fn set_or_clear_certificate_revocation_list<T>(mut self, v: std::option::Option<T>) -> Self
10571 where
10572 T: std::convert::Into<crate::model::CertificateRevocationList>,
10573 {
10574 self.certificate_revocation_list = v.map(|x| x.into());
10575 self
10576 }
10577
10578 /// Sets the value of [update_mask][crate::model::UpdateCertificateRevocationListRequest::update_mask].
10579 ///
10580 /// # Example
10581 /// ```ignore,no_run
10582 /// # use google_cloud_security_privateca_v1::model::UpdateCertificateRevocationListRequest;
10583 /// use wkt::FieldMask;
10584 /// let x = UpdateCertificateRevocationListRequest::new().set_update_mask(FieldMask::default()/* use setters */);
10585 /// ```
10586 pub fn set_update_mask<T>(mut self, v: T) -> Self
10587 where
10588 T: std::convert::Into<wkt::FieldMask>,
10589 {
10590 self.update_mask = std::option::Option::Some(v.into());
10591 self
10592 }
10593
10594 /// Sets or clears the value of [update_mask][crate::model::UpdateCertificateRevocationListRequest::update_mask].
10595 ///
10596 /// # Example
10597 /// ```ignore,no_run
10598 /// # use google_cloud_security_privateca_v1::model::UpdateCertificateRevocationListRequest;
10599 /// use wkt::FieldMask;
10600 /// let x = UpdateCertificateRevocationListRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
10601 /// let x = UpdateCertificateRevocationListRequest::new().set_or_clear_update_mask(None::<FieldMask>);
10602 /// ```
10603 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
10604 where
10605 T: std::convert::Into<wkt::FieldMask>,
10606 {
10607 self.update_mask = v.map(|x| x.into());
10608 self
10609 }
10610
10611 /// Sets the value of [request_id][crate::model::UpdateCertificateRevocationListRequest::request_id].
10612 ///
10613 /// # Example
10614 /// ```ignore,no_run
10615 /// # use google_cloud_security_privateca_v1::model::UpdateCertificateRevocationListRequest;
10616 /// let x = UpdateCertificateRevocationListRequest::new().set_request_id("example");
10617 /// ```
10618 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10619 self.request_id = v.into();
10620 self
10621 }
10622}
10623
10624impl wkt::message::Message for UpdateCertificateRevocationListRequest {
10625 fn typename() -> &'static str {
10626 "type.googleapis.com/google.cloud.security.privateca.v1.UpdateCertificateRevocationListRequest"
10627 }
10628}
10629
10630/// Request message for
10631/// [CertificateAuthorityService.CreateCertificateTemplate][google.cloud.security.privateca.v1.CertificateAuthorityService.CreateCertificateTemplate].
10632///
10633/// [google.cloud.security.privateca.v1.CertificateAuthorityService.CreateCertificateTemplate]: crate::client::CertificateAuthorityService::create_certificate_template
10634#[derive(Clone, Default, PartialEq)]
10635#[non_exhaustive]
10636pub struct CreateCertificateTemplateRequest {
10637 /// Required. The resource name of the location associated with the
10638 /// [CertificateTemplate][google.cloud.security.privateca.v1.CertificateTemplate],
10639 /// in the format `projects/*/locations/*`.
10640 ///
10641 /// [google.cloud.security.privateca.v1.CertificateTemplate]: crate::model::CertificateTemplate
10642 pub parent: std::string::String,
10643
10644 /// Required. It must be unique within a location and match the regular
10645 /// expression `[a-zA-Z0-9_-]{1,63}`
10646 pub certificate_template_id: std::string::String,
10647
10648 /// Required. A
10649 /// [CertificateTemplate][google.cloud.security.privateca.v1.CertificateTemplate]
10650 /// with initial field values.
10651 ///
10652 /// [google.cloud.security.privateca.v1.CertificateTemplate]: crate::model::CertificateTemplate
10653 pub certificate_template: std::option::Option<crate::model::CertificateTemplate>,
10654
10655 /// Optional. An ID to identify requests. Specify a unique request ID so that
10656 /// if you must retry your request, the server will know to ignore the request
10657 /// if it has already been completed. The server will guarantee that for at
10658 /// least 60 minutes since the first request.
10659 ///
10660 /// For example, consider a situation where you make an initial request and
10661 /// the request times out. If you make the request again with the same request
10662 /// ID, the server can check if original operation with the same request ID
10663 /// was received, and if so, will ignore the second request. This prevents
10664 /// clients from accidentally creating duplicate commitments.
10665 ///
10666 /// The request ID must be a valid UUID with the exception that zero UUID is
10667 /// not supported (00000000-0000-0000-0000-000000000000).
10668 pub request_id: std::string::String,
10669
10670 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10671}
10672
10673impl CreateCertificateTemplateRequest {
10674 pub fn new() -> Self {
10675 std::default::Default::default()
10676 }
10677
10678 /// Sets the value of [parent][crate::model::CreateCertificateTemplateRequest::parent].
10679 ///
10680 /// # Example
10681 /// ```ignore,no_run
10682 /// # use google_cloud_security_privateca_v1::model::CreateCertificateTemplateRequest;
10683 /// let x = CreateCertificateTemplateRequest::new().set_parent("example");
10684 /// ```
10685 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10686 self.parent = v.into();
10687 self
10688 }
10689
10690 /// Sets the value of [certificate_template_id][crate::model::CreateCertificateTemplateRequest::certificate_template_id].
10691 ///
10692 /// # Example
10693 /// ```ignore,no_run
10694 /// # use google_cloud_security_privateca_v1::model::CreateCertificateTemplateRequest;
10695 /// let x = CreateCertificateTemplateRequest::new().set_certificate_template_id("example");
10696 /// ```
10697 pub fn set_certificate_template_id<T: std::convert::Into<std::string::String>>(
10698 mut self,
10699 v: T,
10700 ) -> Self {
10701 self.certificate_template_id = v.into();
10702 self
10703 }
10704
10705 /// Sets the value of [certificate_template][crate::model::CreateCertificateTemplateRequest::certificate_template].
10706 ///
10707 /// # Example
10708 /// ```ignore,no_run
10709 /// # use google_cloud_security_privateca_v1::model::CreateCertificateTemplateRequest;
10710 /// use google_cloud_security_privateca_v1::model::CertificateTemplate;
10711 /// let x = CreateCertificateTemplateRequest::new().set_certificate_template(CertificateTemplate::default()/* use setters */);
10712 /// ```
10713 pub fn set_certificate_template<T>(mut self, v: T) -> Self
10714 where
10715 T: std::convert::Into<crate::model::CertificateTemplate>,
10716 {
10717 self.certificate_template = std::option::Option::Some(v.into());
10718 self
10719 }
10720
10721 /// Sets or clears the value of [certificate_template][crate::model::CreateCertificateTemplateRequest::certificate_template].
10722 ///
10723 /// # Example
10724 /// ```ignore,no_run
10725 /// # use google_cloud_security_privateca_v1::model::CreateCertificateTemplateRequest;
10726 /// use google_cloud_security_privateca_v1::model::CertificateTemplate;
10727 /// let x = CreateCertificateTemplateRequest::new().set_or_clear_certificate_template(Some(CertificateTemplate::default()/* use setters */));
10728 /// let x = CreateCertificateTemplateRequest::new().set_or_clear_certificate_template(None::<CertificateTemplate>);
10729 /// ```
10730 pub fn set_or_clear_certificate_template<T>(mut self, v: std::option::Option<T>) -> Self
10731 where
10732 T: std::convert::Into<crate::model::CertificateTemplate>,
10733 {
10734 self.certificate_template = v.map(|x| x.into());
10735 self
10736 }
10737
10738 /// Sets the value of [request_id][crate::model::CreateCertificateTemplateRequest::request_id].
10739 ///
10740 /// # Example
10741 /// ```ignore,no_run
10742 /// # use google_cloud_security_privateca_v1::model::CreateCertificateTemplateRequest;
10743 /// let x = CreateCertificateTemplateRequest::new().set_request_id("example");
10744 /// ```
10745 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10746 self.request_id = v.into();
10747 self
10748 }
10749}
10750
10751impl wkt::message::Message for CreateCertificateTemplateRequest {
10752 fn typename() -> &'static str {
10753 "type.googleapis.com/google.cloud.security.privateca.v1.CreateCertificateTemplateRequest"
10754 }
10755}
10756
10757/// Request message for
10758/// [CertificateAuthorityService.DeleteCertificateTemplate][google.cloud.security.privateca.v1.CertificateAuthorityService.DeleteCertificateTemplate].
10759///
10760/// [google.cloud.security.privateca.v1.CertificateAuthorityService.DeleteCertificateTemplate]: crate::client::CertificateAuthorityService::delete_certificate_template
10761#[derive(Clone, Default, PartialEq)]
10762#[non_exhaustive]
10763pub struct DeleteCertificateTemplateRequest {
10764 /// Required. The resource name for this
10765 /// [CertificateTemplate][google.cloud.security.privateca.v1.CertificateTemplate]
10766 /// in the format `projects/*/locations/*/certificateTemplates/*`.
10767 ///
10768 /// [google.cloud.security.privateca.v1.CertificateTemplate]: crate::model::CertificateTemplate
10769 pub name: std::string::String,
10770
10771 /// Optional. An ID to identify requests. Specify a unique request ID so that
10772 /// if you must retry your request, the server will know to ignore the request
10773 /// if it has already been completed. The server will guarantee that for at
10774 /// least 60 minutes since the first request.
10775 ///
10776 /// For example, consider a situation where you make an initial request and
10777 /// the request times out. If you make the request again with the same request
10778 /// ID, the server can check if original operation with the same request ID
10779 /// was received, and if so, will ignore the second request. This prevents
10780 /// clients from accidentally creating duplicate commitments.
10781 ///
10782 /// The request ID must be a valid UUID with the exception that zero UUID is
10783 /// not supported (00000000-0000-0000-0000-000000000000).
10784 pub request_id: std::string::String,
10785
10786 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10787}
10788
10789impl DeleteCertificateTemplateRequest {
10790 pub fn new() -> Self {
10791 std::default::Default::default()
10792 }
10793
10794 /// Sets the value of [name][crate::model::DeleteCertificateTemplateRequest::name].
10795 ///
10796 /// # Example
10797 /// ```ignore,no_run
10798 /// # use google_cloud_security_privateca_v1::model::DeleteCertificateTemplateRequest;
10799 /// let x = DeleteCertificateTemplateRequest::new().set_name("example");
10800 /// ```
10801 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10802 self.name = v.into();
10803 self
10804 }
10805
10806 /// Sets the value of [request_id][crate::model::DeleteCertificateTemplateRequest::request_id].
10807 ///
10808 /// # Example
10809 /// ```ignore,no_run
10810 /// # use google_cloud_security_privateca_v1::model::DeleteCertificateTemplateRequest;
10811 /// let x = DeleteCertificateTemplateRequest::new().set_request_id("example");
10812 /// ```
10813 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10814 self.request_id = v.into();
10815 self
10816 }
10817}
10818
10819impl wkt::message::Message for DeleteCertificateTemplateRequest {
10820 fn typename() -> &'static str {
10821 "type.googleapis.com/google.cloud.security.privateca.v1.DeleteCertificateTemplateRequest"
10822 }
10823}
10824
10825/// Request message for
10826/// [CertificateAuthorityService.GetCertificateTemplate][google.cloud.security.privateca.v1.CertificateAuthorityService.GetCertificateTemplate].
10827///
10828/// [google.cloud.security.privateca.v1.CertificateAuthorityService.GetCertificateTemplate]: crate::client::CertificateAuthorityService::get_certificate_template
10829#[derive(Clone, Default, PartialEq)]
10830#[non_exhaustive]
10831pub struct GetCertificateTemplateRequest {
10832 /// Required. The
10833 /// [name][google.cloud.security.privateca.v1.CertificateTemplate.name] of the
10834 /// [CertificateTemplate][google.cloud.security.privateca.v1.CertificateTemplate]
10835 /// to get.
10836 ///
10837 /// [google.cloud.security.privateca.v1.CertificateTemplate]: crate::model::CertificateTemplate
10838 /// [google.cloud.security.privateca.v1.CertificateTemplate.name]: crate::model::CertificateTemplate::name
10839 pub name: std::string::String,
10840
10841 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10842}
10843
10844impl GetCertificateTemplateRequest {
10845 pub fn new() -> Self {
10846 std::default::Default::default()
10847 }
10848
10849 /// Sets the value of [name][crate::model::GetCertificateTemplateRequest::name].
10850 ///
10851 /// # Example
10852 /// ```ignore,no_run
10853 /// # use google_cloud_security_privateca_v1::model::GetCertificateTemplateRequest;
10854 /// let x = GetCertificateTemplateRequest::new().set_name("example");
10855 /// ```
10856 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10857 self.name = v.into();
10858 self
10859 }
10860}
10861
10862impl wkt::message::Message for GetCertificateTemplateRequest {
10863 fn typename() -> &'static str {
10864 "type.googleapis.com/google.cloud.security.privateca.v1.GetCertificateTemplateRequest"
10865 }
10866}
10867
10868/// Request message for
10869/// [CertificateAuthorityService.ListCertificateTemplates][google.cloud.security.privateca.v1.CertificateAuthorityService.ListCertificateTemplates].
10870///
10871/// [google.cloud.security.privateca.v1.CertificateAuthorityService.ListCertificateTemplates]: crate::client::CertificateAuthorityService::list_certificate_templates
10872#[derive(Clone, Default, PartialEq)]
10873#[non_exhaustive]
10874pub struct ListCertificateTemplatesRequest {
10875 /// Required. The resource name of the location associated with the
10876 /// [CertificateTemplates][google.cloud.security.privateca.v1.CertificateTemplate],
10877 /// in the format `projects/*/locations/*`.
10878 ///
10879 /// [google.cloud.security.privateca.v1.CertificateTemplate]: crate::model::CertificateTemplate
10880 pub parent: std::string::String,
10881
10882 /// Optional. Limit on the number of
10883 /// [CertificateTemplates][google.cloud.security.privateca.v1.CertificateTemplate]
10884 /// to include in the response. Further
10885 /// [CertificateTemplates][google.cloud.security.privateca.v1.CertificateTemplate]
10886 /// can subsequently be obtained by including the
10887 /// [ListCertificateTemplatesResponse.next_page_token][google.cloud.security.privateca.v1.ListCertificateTemplatesResponse.next_page_token]
10888 /// in a subsequent request. If unspecified, the server will pick an
10889 /// appropriate default.
10890 ///
10891 /// [google.cloud.security.privateca.v1.CertificateTemplate]: crate::model::CertificateTemplate
10892 /// [google.cloud.security.privateca.v1.ListCertificateTemplatesResponse.next_page_token]: crate::model::ListCertificateTemplatesResponse::next_page_token
10893 pub page_size: i32,
10894
10895 /// Optional. Pagination token, returned earlier via
10896 /// [ListCertificateTemplatesResponse.next_page_token][google.cloud.security.privateca.v1.ListCertificateTemplatesResponse.next_page_token].
10897 ///
10898 /// [google.cloud.security.privateca.v1.ListCertificateTemplatesResponse.next_page_token]: crate::model::ListCertificateTemplatesResponse::next_page_token
10899 pub page_token: std::string::String,
10900
10901 /// Optional. Only include resources that match the filter in the response.
10902 pub filter: std::string::String,
10903
10904 /// Optional. Specify how the results should be sorted.
10905 pub order_by: std::string::String,
10906
10907 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10908}
10909
10910impl ListCertificateTemplatesRequest {
10911 pub fn new() -> Self {
10912 std::default::Default::default()
10913 }
10914
10915 /// Sets the value of [parent][crate::model::ListCertificateTemplatesRequest::parent].
10916 ///
10917 /// # Example
10918 /// ```ignore,no_run
10919 /// # use google_cloud_security_privateca_v1::model::ListCertificateTemplatesRequest;
10920 /// let x = ListCertificateTemplatesRequest::new().set_parent("example");
10921 /// ```
10922 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10923 self.parent = v.into();
10924 self
10925 }
10926
10927 /// Sets the value of [page_size][crate::model::ListCertificateTemplatesRequest::page_size].
10928 ///
10929 /// # Example
10930 /// ```ignore,no_run
10931 /// # use google_cloud_security_privateca_v1::model::ListCertificateTemplatesRequest;
10932 /// let x = ListCertificateTemplatesRequest::new().set_page_size(42);
10933 /// ```
10934 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10935 self.page_size = v.into();
10936 self
10937 }
10938
10939 /// Sets the value of [page_token][crate::model::ListCertificateTemplatesRequest::page_token].
10940 ///
10941 /// # Example
10942 /// ```ignore,no_run
10943 /// # use google_cloud_security_privateca_v1::model::ListCertificateTemplatesRequest;
10944 /// let x = ListCertificateTemplatesRequest::new().set_page_token("example");
10945 /// ```
10946 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10947 self.page_token = v.into();
10948 self
10949 }
10950
10951 /// Sets the value of [filter][crate::model::ListCertificateTemplatesRequest::filter].
10952 ///
10953 /// # Example
10954 /// ```ignore,no_run
10955 /// # use google_cloud_security_privateca_v1::model::ListCertificateTemplatesRequest;
10956 /// let x = ListCertificateTemplatesRequest::new().set_filter("example");
10957 /// ```
10958 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10959 self.filter = v.into();
10960 self
10961 }
10962
10963 /// Sets the value of [order_by][crate::model::ListCertificateTemplatesRequest::order_by].
10964 ///
10965 /// # Example
10966 /// ```ignore,no_run
10967 /// # use google_cloud_security_privateca_v1::model::ListCertificateTemplatesRequest;
10968 /// let x = ListCertificateTemplatesRequest::new().set_order_by("example");
10969 /// ```
10970 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10971 self.order_by = v.into();
10972 self
10973 }
10974}
10975
10976impl wkt::message::Message for ListCertificateTemplatesRequest {
10977 fn typename() -> &'static str {
10978 "type.googleapis.com/google.cloud.security.privateca.v1.ListCertificateTemplatesRequest"
10979 }
10980}
10981
10982/// Response message for
10983/// [CertificateAuthorityService.ListCertificateTemplates][google.cloud.security.privateca.v1.CertificateAuthorityService.ListCertificateTemplates].
10984///
10985/// [google.cloud.security.privateca.v1.CertificateAuthorityService.ListCertificateTemplates]: crate::client::CertificateAuthorityService::list_certificate_templates
10986#[derive(Clone, Default, PartialEq)]
10987#[non_exhaustive]
10988pub struct ListCertificateTemplatesResponse {
10989 /// The list of
10990 /// [CertificateTemplates][google.cloud.security.privateca.v1.CertificateTemplate].
10991 ///
10992 /// [google.cloud.security.privateca.v1.CertificateTemplate]: crate::model::CertificateTemplate
10993 pub certificate_templates: std::vec::Vec<crate::model::CertificateTemplate>,
10994
10995 /// A token to retrieve next page of results. Pass this value in
10996 /// [ListCertificateTemplatesRequest.page_token][google.cloud.security.privateca.v1.ListCertificateTemplatesRequest.page_token]
10997 /// to retrieve the next page of results.
10998 ///
10999 /// [google.cloud.security.privateca.v1.ListCertificateTemplatesRequest.page_token]: crate::model::ListCertificateTemplatesRequest::page_token
11000 pub next_page_token: std::string::String,
11001
11002 /// A list of locations (e.g. "us-west1") that could not be reached.
11003 pub unreachable: std::vec::Vec<std::string::String>,
11004
11005 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11006}
11007
11008impl ListCertificateTemplatesResponse {
11009 pub fn new() -> Self {
11010 std::default::Default::default()
11011 }
11012
11013 /// Sets the value of [certificate_templates][crate::model::ListCertificateTemplatesResponse::certificate_templates].
11014 ///
11015 /// # Example
11016 /// ```ignore,no_run
11017 /// # use google_cloud_security_privateca_v1::model::ListCertificateTemplatesResponse;
11018 /// use google_cloud_security_privateca_v1::model::CertificateTemplate;
11019 /// let x = ListCertificateTemplatesResponse::new()
11020 /// .set_certificate_templates([
11021 /// CertificateTemplate::default()/* use setters */,
11022 /// CertificateTemplate::default()/* use (different) setters */,
11023 /// ]);
11024 /// ```
11025 pub fn set_certificate_templates<T, V>(mut self, v: T) -> Self
11026 where
11027 T: std::iter::IntoIterator<Item = V>,
11028 V: std::convert::Into<crate::model::CertificateTemplate>,
11029 {
11030 use std::iter::Iterator;
11031 self.certificate_templates = v.into_iter().map(|i| i.into()).collect();
11032 self
11033 }
11034
11035 /// Sets the value of [next_page_token][crate::model::ListCertificateTemplatesResponse::next_page_token].
11036 ///
11037 /// # Example
11038 /// ```ignore,no_run
11039 /// # use google_cloud_security_privateca_v1::model::ListCertificateTemplatesResponse;
11040 /// let x = ListCertificateTemplatesResponse::new().set_next_page_token("example");
11041 /// ```
11042 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11043 self.next_page_token = v.into();
11044 self
11045 }
11046
11047 /// Sets the value of [unreachable][crate::model::ListCertificateTemplatesResponse::unreachable].
11048 ///
11049 /// # Example
11050 /// ```ignore,no_run
11051 /// # use google_cloud_security_privateca_v1::model::ListCertificateTemplatesResponse;
11052 /// let x = ListCertificateTemplatesResponse::new().set_unreachable(["a", "b", "c"]);
11053 /// ```
11054 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
11055 where
11056 T: std::iter::IntoIterator<Item = V>,
11057 V: std::convert::Into<std::string::String>,
11058 {
11059 use std::iter::Iterator;
11060 self.unreachable = v.into_iter().map(|i| i.into()).collect();
11061 self
11062 }
11063}
11064
11065impl wkt::message::Message for ListCertificateTemplatesResponse {
11066 fn typename() -> &'static str {
11067 "type.googleapis.com/google.cloud.security.privateca.v1.ListCertificateTemplatesResponse"
11068 }
11069}
11070
11071#[doc(hidden)]
11072impl gax::paginator::internal::PageableResponse for ListCertificateTemplatesResponse {
11073 type PageItem = crate::model::CertificateTemplate;
11074
11075 fn items(self) -> std::vec::Vec<Self::PageItem> {
11076 self.certificate_templates
11077 }
11078
11079 fn next_page_token(&self) -> std::string::String {
11080 use std::clone::Clone;
11081 self.next_page_token.clone()
11082 }
11083}
11084
11085/// Request message for
11086/// [CertificateAuthorityService.UpdateCertificateTemplate][google.cloud.security.privateca.v1.CertificateAuthorityService.UpdateCertificateTemplate].
11087///
11088/// [google.cloud.security.privateca.v1.CertificateAuthorityService.UpdateCertificateTemplate]: crate::client::CertificateAuthorityService::update_certificate_template
11089#[derive(Clone, Default, PartialEq)]
11090#[non_exhaustive]
11091pub struct UpdateCertificateTemplateRequest {
11092 /// Required.
11093 /// [CertificateTemplate][google.cloud.security.privateca.v1.CertificateTemplate]
11094 /// with updated values.
11095 ///
11096 /// [google.cloud.security.privateca.v1.CertificateTemplate]: crate::model::CertificateTemplate
11097 pub certificate_template: std::option::Option<crate::model::CertificateTemplate>,
11098
11099 /// Required. A list of fields to be updated in this request.
11100 pub update_mask: std::option::Option<wkt::FieldMask>,
11101
11102 /// Optional. An ID to identify requests. Specify a unique request ID so that
11103 /// if you must retry your request, the server will know to ignore the request
11104 /// if it has already been completed. The server will guarantee that for at
11105 /// least 60 minutes since the first request.
11106 ///
11107 /// For example, consider a situation where you make an initial request and
11108 /// the request times out. If you make the request again with the same request
11109 /// ID, the server can check if original operation with the same request ID
11110 /// was received, and if so, will ignore the second request. This prevents
11111 /// clients from accidentally creating duplicate commitments.
11112 ///
11113 /// The request ID must be a valid UUID with the exception that zero UUID is
11114 /// not supported (00000000-0000-0000-0000-000000000000).
11115 pub request_id: std::string::String,
11116
11117 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11118}
11119
11120impl UpdateCertificateTemplateRequest {
11121 pub fn new() -> Self {
11122 std::default::Default::default()
11123 }
11124
11125 /// Sets the value of [certificate_template][crate::model::UpdateCertificateTemplateRequest::certificate_template].
11126 ///
11127 /// # Example
11128 /// ```ignore,no_run
11129 /// # use google_cloud_security_privateca_v1::model::UpdateCertificateTemplateRequest;
11130 /// use google_cloud_security_privateca_v1::model::CertificateTemplate;
11131 /// let x = UpdateCertificateTemplateRequest::new().set_certificate_template(CertificateTemplate::default()/* use setters */);
11132 /// ```
11133 pub fn set_certificate_template<T>(mut self, v: T) -> Self
11134 where
11135 T: std::convert::Into<crate::model::CertificateTemplate>,
11136 {
11137 self.certificate_template = std::option::Option::Some(v.into());
11138 self
11139 }
11140
11141 /// Sets or clears the value of [certificate_template][crate::model::UpdateCertificateTemplateRequest::certificate_template].
11142 ///
11143 /// # Example
11144 /// ```ignore,no_run
11145 /// # use google_cloud_security_privateca_v1::model::UpdateCertificateTemplateRequest;
11146 /// use google_cloud_security_privateca_v1::model::CertificateTemplate;
11147 /// let x = UpdateCertificateTemplateRequest::new().set_or_clear_certificate_template(Some(CertificateTemplate::default()/* use setters */));
11148 /// let x = UpdateCertificateTemplateRequest::new().set_or_clear_certificate_template(None::<CertificateTemplate>);
11149 /// ```
11150 pub fn set_or_clear_certificate_template<T>(mut self, v: std::option::Option<T>) -> Self
11151 where
11152 T: std::convert::Into<crate::model::CertificateTemplate>,
11153 {
11154 self.certificate_template = v.map(|x| x.into());
11155 self
11156 }
11157
11158 /// Sets the value of [update_mask][crate::model::UpdateCertificateTemplateRequest::update_mask].
11159 ///
11160 /// # Example
11161 /// ```ignore,no_run
11162 /// # use google_cloud_security_privateca_v1::model::UpdateCertificateTemplateRequest;
11163 /// use wkt::FieldMask;
11164 /// let x = UpdateCertificateTemplateRequest::new().set_update_mask(FieldMask::default()/* use setters */);
11165 /// ```
11166 pub fn set_update_mask<T>(mut self, v: T) -> Self
11167 where
11168 T: std::convert::Into<wkt::FieldMask>,
11169 {
11170 self.update_mask = std::option::Option::Some(v.into());
11171 self
11172 }
11173
11174 /// Sets or clears the value of [update_mask][crate::model::UpdateCertificateTemplateRequest::update_mask].
11175 ///
11176 /// # Example
11177 /// ```ignore,no_run
11178 /// # use google_cloud_security_privateca_v1::model::UpdateCertificateTemplateRequest;
11179 /// use wkt::FieldMask;
11180 /// let x = UpdateCertificateTemplateRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
11181 /// let x = UpdateCertificateTemplateRequest::new().set_or_clear_update_mask(None::<FieldMask>);
11182 /// ```
11183 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
11184 where
11185 T: std::convert::Into<wkt::FieldMask>,
11186 {
11187 self.update_mask = v.map(|x| x.into());
11188 self
11189 }
11190
11191 /// Sets the value of [request_id][crate::model::UpdateCertificateTemplateRequest::request_id].
11192 ///
11193 /// # Example
11194 /// ```ignore,no_run
11195 /// # use google_cloud_security_privateca_v1::model::UpdateCertificateTemplateRequest;
11196 /// let x = UpdateCertificateTemplateRequest::new().set_request_id("example");
11197 /// ```
11198 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11199 self.request_id = v.into();
11200 self
11201 }
11202}
11203
11204impl wkt::message::Message for UpdateCertificateTemplateRequest {
11205 fn typename() -> &'static str {
11206 "type.googleapis.com/google.cloud.security.privateca.v1.UpdateCertificateTemplateRequest"
11207 }
11208}
11209
11210/// Represents the metadata of the long-running operation.
11211#[derive(Clone, Default, PartialEq)]
11212#[non_exhaustive]
11213pub struct OperationMetadata {
11214 /// Output only. The time the operation was created.
11215 pub create_time: std::option::Option<wkt::Timestamp>,
11216
11217 /// Output only. The time the operation finished running.
11218 pub end_time: std::option::Option<wkt::Timestamp>,
11219
11220 /// Output only. Server-defined resource path for the target of the operation.
11221 pub target: std::string::String,
11222
11223 /// Output only. Name of the verb executed by the operation.
11224 pub verb: std::string::String,
11225
11226 /// Output only. Human-readable status of the operation, if any.
11227 pub status_message: std::string::String,
11228
11229 /// Output only. Identifies whether the user has requested cancellation
11230 /// of the operation. Operations that have successfully been cancelled
11231 /// have
11232 /// [google.longrunning.Operation.error][google.longrunning.Operation.error]
11233 /// value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
11234 /// corresponding to `Code.CANCELLED`.
11235 ///
11236 /// [google.longrunning.Operation.error]: longrunning::model::Operation::result
11237 /// [google.rpc.Status.code]: rpc::model::Status::code
11238 pub requested_cancellation: bool,
11239
11240 /// Output only. API version used to start the operation.
11241 pub api_version: std::string::String,
11242
11243 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11244}
11245
11246impl OperationMetadata {
11247 pub fn new() -> Self {
11248 std::default::Default::default()
11249 }
11250
11251 /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
11252 ///
11253 /// # Example
11254 /// ```ignore,no_run
11255 /// # use google_cloud_security_privateca_v1::model::OperationMetadata;
11256 /// use wkt::Timestamp;
11257 /// let x = OperationMetadata::new().set_create_time(Timestamp::default()/* use setters */);
11258 /// ```
11259 pub fn set_create_time<T>(mut self, v: T) -> Self
11260 where
11261 T: std::convert::Into<wkt::Timestamp>,
11262 {
11263 self.create_time = std::option::Option::Some(v.into());
11264 self
11265 }
11266
11267 /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
11268 ///
11269 /// # Example
11270 /// ```ignore,no_run
11271 /// # use google_cloud_security_privateca_v1::model::OperationMetadata;
11272 /// use wkt::Timestamp;
11273 /// let x = OperationMetadata::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
11274 /// let x = OperationMetadata::new().set_or_clear_create_time(None::<Timestamp>);
11275 /// ```
11276 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
11277 where
11278 T: std::convert::Into<wkt::Timestamp>,
11279 {
11280 self.create_time = v.map(|x| x.into());
11281 self
11282 }
11283
11284 /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
11285 ///
11286 /// # Example
11287 /// ```ignore,no_run
11288 /// # use google_cloud_security_privateca_v1::model::OperationMetadata;
11289 /// use wkt::Timestamp;
11290 /// let x = OperationMetadata::new().set_end_time(Timestamp::default()/* use setters */);
11291 /// ```
11292 pub fn set_end_time<T>(mut self, v: T) -> Self
11293 where
11294 T: std::convert::Into<wkt::Timestamp>,
11295 {
11296 self.end_time = std::option::Option::Some(v.into());
11297 self
11298 }
11299
11300 /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
11301 ///
11302 /// # Example
11303 /// ```ignore,no_run
11304 /// # use google_cloud_security_privateca_v1::model::OperationMetadata;
11305 /// use wkt::Timestamp;
11306 /// let x = OperationMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
11307 /// let x = OperationMetadata::new().set_or_clear_end_time(None::<Timestamp>);
11308 /// ```
11309 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
11310 where
11311 T: std::convert::Into<wkt::Timestamp>,
11312 {
11313 self.end_time = v.map(|x| x.into());
11314 self
11315 }
11316
11317 /// Sets the value of [target][crate::model::OperationMetadata::target].
11318 ///
11319 /// # Example
11320 /// ```ignore,no_run
11321 /// # use google_cloud_security_privateca_v1::model::OperationMetadata;
11322 /// let x = OperationMetadata::new().set_target("example");
11323 /// ```
11324 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11325 self.target = v.into();
11326 self
11327 }
11328
11329 /// Sets the value of [verb][crate::model::OperationMetadata::verb].
11330 ///
11331 /// # Example
11332 /// ```ignore,no_run
11333 /// # use google_cloud_security_privateca_v1::model::OperationMetadata;
11334 /// let x = OperationMetadata::new().set_verb("example");
11335 /// ```
11336 pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11337 self.verb = v.into();
11338 self
11339 }
11340
11341 /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
11342 ///
11343 /// # Example
11344 /// ```ignore,no_run
11345 /// # use google_cloud_security_privateca_v1::model::OperationMetadata;
11346 /// let x = OperationMetadata::new().set_status_message("example");
11347 /// ```
11348 pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11349 self.status_message = v.into();
11350 self
11351 }
11352
11353 /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
11354 ///
11355 /// # Example
11356 /// ```ignore,no_run
11357 /// # use google_cloud_security_privateca_v1::model::OperationMetadata;
11358 /// let x = OperationMetadata::new().set_requested_cancellation(true);
11359 /// ```
11360 pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
11361 self.requested_cancellation = v.into();
11362 self
11363 }
11364
11365 /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
11366 ///
11367 /// # Example
11368 /// ```ignore,no_run
11369 /// # use google_cloud_security_privateca_v1::model::OperationMetadata;
11370 /// let x = OperationMetadata::new().set_api_version("example");
11371 /// ```
11372 pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11373 self.api_version = v.into();
11374 self
11375 }
11376}
11377
11378impl wkt::message::Message for OperationMetadata {
11379 fn typename() -> &'static str {
11380 "type.googleapis.com/google.cloud.security.privateca.v1.OperationMetadata"
11381 }
11382}
11383
11384/// [AttributeType][google.cloud.security.privateca.v1.AttributeType] specifies
11385/// the type of Attribute in a relative distinguished name.
11386///
11387/// [google.cloud.security.privateca.v1.AttributeType]: crate::model::AttributeType
11388///
11389/// # Working with unknown values
11390///
11391/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11392/// additional enum variants at any time. Adding new variants is not considered
11393/// a breaking change. Applications should write their code in anticipation of:
11394///
11395/// - New values appearing in future releases of the client library, **and**
11396/// - New values received dynamically, without application changes.
11397///
11398/// Please consult the [Working with enums] section in the user guide for some
11399/// guidelines.
11400///
11401/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
11402#[derive(Clone, Debug, PartialEq)]
11403#[non_exhaustive]
11404pub enum AttributeType {
11405 /// Attribute type is unspecified.
11406 Unspecified,
11407 /// The "common name" of the subject.
11408 CommonName,
11409 /// The country code of the subject.
11410 CountryCode,
11411 /// The organization of the subject.
11412 Organization,
11413 /// The organizational unit of the subject.
11414 OrganizationalUnit,
11415 /// The locality or city of the subject.
11416 Locality,
11417 /// The province, territory, or regional state of the subject.
11418 Province,
11419 /// The street address of the subject.
11420 StreetAddress,
11421 /// The postal code of the subject.
11422 PostalCode,
11423 /// If set, the enum was initialized with an unknown value.
11424 ///
11425 /// Applications can examine the value using [AttributeType::value] or
11426 /// [AttributeType::name].
11427 UnknownValue(attribute_type::UnknownValue),
11428}
11429
11430#[doc(hidden)]
11431pub mod attribute_type {
11432 #[allow(unused_imports)]
11433 use super::*;
11434 #[derive(Clone, Debug, PartialEq)]
11435 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11436}
11437
11438impl AttributeType {
11439 /// Gets the enum value.
11440 ///
11441 /// Returns `None` if the enum contains an unknown value deserialized from
11442 /// the string representation of enums.
11443 pub fn value(&self) -> std::option::Option<i32> {
11444 match self {
11445 Self::Unspecified => std::option::Option::Some(0),
11446 Self::CommonName => std::option::Option::Some(1),
11447 Self::CountryCode => std::option::Option::Some(2),
11448 Self::Organization => std::option::Option::Some(3),
11449 Self::OrganizationalUnit => std::option::Option::Some(4),
11450 Self::Locality => std::option::Option::Some(5),
11451 Self::Province => std::option::Option::Some(6),
11452 Self::StreetAddress => std::option::Option::Some(7),
11453 Self::PostalCode => std::option::Option::Some(8),
11454 Self::UnknownValue(u) => u.0.value(),
11455 }
11456 }
11457
11458 /// Gets the enum value as a string.
11459 ///
11460 /// Returns `None` if the enum contains an unknown value deserialized from
11461 /// the integer representation of enums.
11462 pub fn name(&self) -> std::option::Option<&str> {
11463 match self {
11464 Self::Unspecified => std::option::Option::Some("ATTRIBUTE_TYPE_UNSPECIFIED"),
11465 Self::CommonName => std::option::Option::Some("COMMON_NAME"),
11466 Self::CountryCode => std::option::Option::Some("COUNTRY_CODE"),
11467 Self::Organization => std::option::Option::Some("ORGANIZATION"),
11468 Self::OrganizationalUnit => std::option::Option::Some("ORGANIZATIONAL_UNIT"),
11469 Self::Locality => std::option::Option::Some("LOCALITY"),
11470 Self::Province => std::option::Option::Some("PROVINCE"),
11471 Self::StreetAddress => std::option::Option::Some("STREET_ADDRESS"),
11472 Self::PostalCode => std::option::Option::Some("POSTAL_CODE"),
11473 Self::UnknownValue(u) => u.0.name(),
11474 }
11475 }
11476}
11477
11478impl std::default::Default for AttributeType {
11479 fn default() -> Self {
11480 use std::convert::From;
11481 Self::from(0)
11482 }
11483}
11484
11485impl std::fmt::Display for AttributeType {
11486 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11487 wkt::internal::display_enum(f, self.name(), self.value())
11488 }
11489}
11490
11491impl std::convert::From<i32> for AttributeType {
11492 fn from(value: i32) -> Self {
11493 match value {
11494 0 => Self::Unspecified,
11495 1 => Self::CommonName,
11496 2 => Self::CountryCode,
11497 3 => Self::Organization,
11498 4 => Self::OrganizationalUnit,
11499 5 => Self::Locality,
11500 6 => Self::Province,
11501 7 => Self::StreetAddress,
11502 8 => Self::PostalCode,
11503 _ => Self::UnknownValue(attribute_type::UnknownValue(
11504 wkt::internal::UnknownEnumValue::Integer(value),
11505 )),
11506 }
11507 }
11508}
11509
11510impl std::convert::From<&str> for AttributeType {
11511 fn from(value: &str) -> Self {
11512 use std::string::ToString;
11513 match value {
11514 "ATTRIBUTE_TYPE_UNSPECIFIED" => Self::Unspecified,
11515 "COMMON_NAME" => Self::CommonName,
11516 "COUNTRY_CODE" => Self::CountryCode,
11517 "ORGANIZATION" => Self::Organization,
11518 "ORGANIZATIONAL_UNIT" => Self::OrganizationalUnit,
11519 "LOCALITY" => Self::Locality,
11520 "PROVINCE" => Self::Province,
11521 "STREET_ADDRESS" => Self::StreetAddress,
11522 "POSTAL_CODE" => Self::PostalCode,
11523 _ => Self::UnknownValue(attribute_type::UnknownValue(
11524 wkt::internal::UnknownEnumValue::String(value.to_string()),
11525 )),
11526 }
11527 }
11528}
11529
11530impl serde::ser::Serialize for AttributeType {
11531 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11532 where
11533 S: serde::Serializer,
11534 {
11535 match self {
11536 Self::Unspecified => serializer.serialize_i32(0),
11537 Self::CommonName => serializer.serialize_i32(1),
11538 Self::CountryCode => serializer.serialize_i32(2),
11539 Self::Organization => serializer.serialize_i32(3),
11540 Self::OrganizationalUnit => serializer.serialize_i32(4),
11541 Self::Locality => serializer.serialize_i32(5),
11542 Self::Province => serializer.serialize_i32(6),
11543 Self::StreetAddress => serializer.serialize_i32(7),
11544 Self::PostalCode => serializer.serialize_i32(8),
11545 Self::UnknownValue(u) => u.0.serialize(serializer),
11546 }
11547 }
11548}
11549
11550impl<'de> serde::de::Deserialize<'de> for AttributeType {
11551 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11552 where
11553 D: serde::Deserializer<'de>,
11554 {
11555 deserializer.deserialize_any(wkt::internal::EnumVisitor::<AttributeType>::new(
11556 ".google.cloud.security.privateca.v1.AttributeType",
11557 ))
11558 }
11559}
11560
11561/// A [RevocationReason][google.cloud.security.privateca.v1.RevocationReason]
11562/// indicates whether a
11563/// [Certificate][google.cloud.security.privateca.v1.Certificate] has been
11564/// revoked, and the reason for revocation. These correspond to standard
11565/// revocation reasons from RFC 5280. Note that the enum labels and values in
11566/// this definition are not the same ASN.1 values defined in RFC 5280. These
11567/// values will be translated to the correct ASN.1 values when a CRL is created.
11568///
11569/// [google.cloud.security.privateca.v1.Certificate]: crate::model::Certificate
11570/// [google.cloud.security.privateca.v1.RevocationReason]: crate::model::RevocationReason
11571///
11572/// # Working with unknown values
11573///
11574/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11575/// additional enum variants at any time. Adding new variants is not considered
11576/// a breaking change. Applications should write their code in anticipation of:
11577///
11578/// - New values appearing in future releases of the client library, **and**
11579/// - New values received dynamically, without application changes.
11580///
11581/// Please consult the [Working with enums] section in the user guide for some
11582/// guidelines.
11583///
11584/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
11585#[derive(Clone, Debug, PartialEq)]
11586#[non_exhaustive]
11587pub enum RevocationReason {
11588 /// Default unspecified value. This value does indicate that a
11589 /// [Certificate][google.cloud.security.privateca.v1.Certificate] has been
11590 /// revoked, but that a reason has not been recorded.
11591 ///
11592 /// [google.cloud.security.privateca.v1.Certificate]: crate::model::Certificate
11593 Unspecified,
11594 /// Key material for this
11595 /// [Certificate][google.cloud.security.privateca.v1.Certificate] may have
11596 /// leaked.
11597 ///
11598 /// [google.cloud.security.privateca.v1.Certificate]: crate::model::Certificate
11599 KeyCompromise,
11600 /// The key material for a certificate authority in the issuing path may have
11601 /// leaked.
11602 CertificateAuthorityCompromise,
11603 /// The subject or other attributes in this
11604 /// [Certificate][google.cloud.security.privateca.v1.Certificate] have changed.
11605 ///
11606 /// [google.cloud.security.privateca.v1.Certificate]: crate::model::Certificate
11607 AffiliationChanged,
11608 /// This [Certificate][google.cloud.security.privateca.v1.Certificate] has been
11609 /// superseded.
11610 ///
11611 /// [google.cloud.security.privateca.v1.Certificate]: crate::model::Certificate
11612 Superseded,
11613 /// This [Certificate][google.cloud.security.privateca.v1.Certificate] or
11614 /// entities in the issuing path have ceased to operate.
11615 ///
11616 /// [google.cloud.security.privateca.v1.Certificate]: crate::model::Certificate
11617 CessationOfOperation,
11618 /// This [Certificate][google.cloud.security.privateca.v1.Certificate] should
11619 /// not be considered valid, it is expected that it may become valid in the
11620 /// future.
11621 ///
11622 /// [google.cloud.security.privateca.v1.Certificate]: crate::model::Certificate
11623 CertificateHold,
11624 /// This [Certificate][google.cloud.security.privateca.v1.Certificate] no
11625 /// longer has permission to assert the listed attributes.
11626 ///
11627 /// [google.cloud.security.privateca.v1.Certificate]: crate::model::Certificate
11628 PrivilegeWithdrawn,
11629 /// The authority which determines appropriate attributes for a
11630 /// [Certificate][google.cloud.security.privateca.v1.Certificate] may have been
11631 /// compromised.
11632 ///
11633 /// [google.cloud.security.privateca.v1.Certificate]: crate::model::Certificate
11634 AttributeAuthorityCompromise,
11635 /// If set, the enum was initialized with an unknown value.
11636 ///
11637 /// Applications can examine the value using [RevocationReason::value] or
11638 /// [RevocationReason::name].
11639 UnknownValue(revocation_reason::UnknownValue),
11640}
11641
11642#[doc(hidden)]
11643pub mod revocation_reason {
11644 #[allow(unused_imports)]
11645 use super::*;
11646 #[derive(Clone, Debug, PartialEq)]
11647 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11648}
11649
11650impl RevocationReason {
11651 /// Gets the enum value.
11652 ///
11653 /// Returns `None` if the enum contains an unknown value deserialized from
11654 /// the string representation of enums.
11655 pub fn value(&self) -> std::option::Option<i32> {
11656 match self {
11657 Self::Unspecified => std::option::Option::Some(0),
11658 Self::KeyCompromise => std::option::Option::Some(1),
11659 Self::CertificateAuthorityCompromise => std::option::Option::Some(2),
11660 Self::AffiliationChanged => std::option::Option::Some(3),
11661 Self::Superseded => std::option::Option::Some(4),
11662 Self::CessationOfOperation => std::option::Option::Some(5),
11663 Self::CertificateHold => std::option::Option::Some(6),
11664 Self::PrivilegeWithdrawn => std::option::Option::Some(7),
11665 Self::AttributeAuthorityCompromise => std::option::Option::Some(8),
11666 Self::UnknownValue(u) => u.0.value(),
11667 }
11668 }
11669
11670 /// Gets the enum value as a string.
11671 ///
11672 /// Returns `None` if the enum contains an unknown value deserialized from
11673 /// the integer representation of enums.
11674 pub fn name(&self) -> std::option::Option<&str> {
11675 match self {
11676 Self::Unspecified => std::option::Option::Some("REVOCATION_REASON_UNSPECIFIED"),
11677 Self::KeyCompromise => std::option::Option::Some("KEY_COMPROMISE"),
11678 Self::CertificateAuthorityCompromise => {
11679 std::option::Option::Some("CERTIFICATE_AUTHORITY_COMPROMISE")
11680 }
11681 Self::AffiliationChanged => std::option::Option::Some("AFFILIATION_CHANGED"),
11682 Self::Superseded => std::option::Option::Some("SUPERSEDED"),
11683 Self::CessationOfOperation => std::option::Option::Some("CESSATION_OF_OPERATION"),
11684 Self::CertificateHold => std::option::Option::Some("CERTIFICATE_HOLD"),
11685 Self::PrivilegeWithdrawn => std::option::Option::Some("PRIVILEGE_WITHDRAWN"),
11686 Self::AttributeAuthorityCompromise => {
11687 std::option::Option::Some("ATTRIBUTE_AUTHORITY_COMPROMISE")
11688 }
11689 Self::UnknownValue(u) => u.0.name(),
11690 }
11691 }
11692}
11693
11694impl std::default::Default for RevocationReason {
11695 fn default() -> Self {
11696 use std::convert::From;
11697 Self::from(0)
11698 }
11699}
11700
11701impl std::fmt::Display for RevocationReason {
11702 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11703 wkt::internal::display_enum(f, self.name(), self.value())
11704 }
11705}
11706
11707impl std::convert::From<i32> for RevocationReason {
11708 fn from(value: i32) -> Self {
11709 match value {
11710 0 => Self::Unspecified,
11711 1 => Self::KeyCompromise,
11712 2 => Self::CertificateAuthorityCompromise,
11713 3 => Self::AffiliationChanged,
11714 4 => Self::Superseded,
11715 5 => Self::CessationOfOperation,
11716 6 => Self::CertificateHold,
11717 7 => Self::PrivilegeWithdrawn,
11718 8 => Self::AttributeAuthorityCompromise,
11719 _ => Self::UnknownValue(revocation_reason::UnknownValue(
11720 wkt::internal::UnknownEnumValue::Integer(value),
11721 )),
11722 }
11723 }
11724}
11725
11726impl std::convert::From<&str> for RevocationReason {
11727 fn from(value: &str) -> Self {
11728 use std::string::ToString;
11729 match value {
11730 "REVOCATION_REASON_UNSPECIFIED" => Self::Unspecified,
11731 "KEY_COMPROMISE" => Self::KeyCompromise,
11732 "CERTIFICATE_AUTHORITY_COMPROMISE" => Self::CertificateAuthorityCompromise,
11733 "AFFILIATION_CHANGED" => Self::AffiliationChanged,
11734 "SUPERSEDED" => Self::Superseded,
11735 "CESSATION_OF_OPERATION" => Self::CessationOfOperation,
11736 "CERTIFICATE_HOLD" => Self::CertificateHold,
11737 "PRIVILEGE_WITHDRAWN" => Self::PrivilegeWithdrawn,
11738 "ATTRIBUTE_AUTHORITY_COMPROMISE" => Self::AttributeAuthorityCompromise,
11739 _ => Self::UnknownValue(revocation_reason::UnknownValue(
11740 wkt::internal::UnknownEnumValue::String(value.to_string()),
11741 )),
11742 }
11743 }
11744}
11745
11746impl serde::ser::Serialize for RevocationReason {
11747 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11748 where
11749 S: serde::Serializer,
11750 {
11751 match self {
11752 Self::Unspecified => serializer.serialize_i32(0),
11753 Self::KeyCompromise => serializer.serialize_i32(1),
11754 Self::CertificateAuthorityCompromise => serializer.serialize_i32(2),
11755 Self::AffiliationChanged => serializer.serialize_i32(3),
11756 Self::Superseded => serializer.serialize_i32(4),
11757 Self::CessationOfOperation => serializer.serialize_i32(5),
11758 Self::CertificateHold => serializer.serialize_i32(6),
11759 Self::PrivilegeWithdrawn => serializer.serialize_i32(7),
11760 Self::AttributeAuthorityCompromise => serializer.serialize_i32(8),
11761 Self::UnknownValue(u) => u.0.serialize(serializer),
11762 }
11763 }
11764}
11765
11766impl<'de> serde::de::Deserialize<'de> for RevocationReason {
11767 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11768 where
11769 D: serde::Deserializer<'de>,
11770 {
11771 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RevocationReason>::new(
11772 ".google.cloud.security.privateca.v1.RevocationReason",
11773 ))
11774 }
11775}
11776
11777/// Describes the way in which a
11778/// [Certificate][google.cloud.security.privateca.v1.Certificate]'s
11779/// [Subject][google.cloud.security.privateca.v1.Subject] and/or
11780/// [SubjectAltNames][google.cloud.security.privateca.v1.SubjectAltNames] will be
11781/// resolved.
11782///
11783/// [google.cloud.security.privateca.v1.Certificate]: crate::model::Certificate
11784/// [google.cloud.security.privateca.v1.Subject]: crate::model::Subject
11785/// [google.cloud.security.privateca.v1.SubjectAltNames]: crate::model::SubjectAltNames
11786///
11787/// # Working with unknown values
11788///
11789/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11790/// additional enum variants at any time. Adding new variants is not considered
11791/// a breaking change. Applications should write their code in anticipation of:
11792///
11793/// - New values appearing in future releases of the client library, **and**
11794/// - New values received dynamically, without application changes.
11795///
11796/// Please consult the [Working with enums] section in the user guide for some
11797/// guidelines.
11798///
11799/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
11800#[derive(Clone, Debug, PartialEq)]
11801#[non_exhaustive]
11802pub enum SubjectRequestMode {
11803 /// Not specified.
11804 Unspecified,
11805 /// The default mode used in most cases. Indicates that the certificate's
11806 /// [Subject][google.cloud.security.privateca.v1.Subject] and/or
11807 /// [SubjectAltNames][google.cloud.security.privateca.v1.SubjectAltNames] are
11808 /// specified in the certificate request. This mode requires the caller to have
11809 /// the `privateca.certificates.create` permission.
11810 ///
11811 /// [google.cloud.security.privateca.v1.Subject]: crate::model::Subject
11812 /// [google.cloud.security.privateca.v1.SubjectAltNames]: crate::model::SubjectAltNames
11813 Default,
11814 /// A mode used to get an accurate representation of the Subject
11815 /// field's distinguished name. Indicates that the certificate's
11816 /// [Subject][google.cloud.security.privateca.v1.Subject] and/or
11817 /// [SubjectAltNames][google.cloud.security.privateca.v1.SubjectAltNames] are
11818 /// specified in the certificate request. When parsing a PEM CSR this mode will
11819 /// maintain the sequence of RDNs found in the CSR's subject field in the
11820 /// issued [Certificate][google.cloud.security.privateca.v1.Certificate]. This
11821 /// mode requires the caller to have the `privateca.certificates.create`
11822 /// permission.
11823 ///
11824 /// [google.cloud.security.privateca.v1.Certificate]: crate::model::Certificate
11825 /// [google.cloud.security.privateca.v1.Subject]: crate::model::Subject
11826 /// [google.cloud.security.privateca.v1.SubjectAltNames]: crate::model::SubjectAltNames
11827 RdnSequence,
11828 /// A mode reserved for special cases. Indicates that the certificate should
11829 /// have one SPIFFE
11830 /// [SubjectAltNames][google.cloud.security.privateca.v1.SubjectAltNames] set
11831 /// by the service based on the caller's identity. This mode will ignore any
11832 /// explicitly specified [Subject][google.cloud.security.privateca.v1.Subject]
11833 /// and/or
11834 /// [SubjectAltNames][google.cloud.security.privateca.v1.SubjectAltNames] in
11835 /// the certificate request. This mode requires the caller to have the
11836 /// `privateca.certificates.createForSelf` permission.
11837 ///
11838 /// [google.cloud.security.privateca.v1.Subject]: crate::model::Subject
11839 /// [google.cloud.security.privateca.v1.SubjectAltNames]: crate::model::SubjectAltNames
11840 ReflectedSpiffe,
11841 /// If set, the enum was initialized with an unknown value.
11842 ///
11843 /// Applications can examine the value using [SubjectRequestMode::value] or
11844 /// [SubjectRequestMode::name].
11845 UnknownValue(subject_request_mode::UnknownValue),
11846}
11847
11848#[doc(hidden)]
11849pub mod subject_request_mode {
11850 #[allow(unused_imports)]
11851 use super::*;
11852 #[derive(Clone, Debug, PartialEq)]
11853 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11854}
11855
11856impl SubjectRequestMode {
11857 /// Gets the enum value.
11858 ///
11859 /// Returns `None` if the enum contains an unknown value deserialized from
11860 /// the string representation of enums.
11861 pub fn value(&self) -> std::option::Option<i32> {
11862 match self {
11863 Self::Unspecified => std::option::Option::Some(0),
11864 Self::Default => std::option::Option::Some(1),
11865 Self::RdnSequence => std::option::Option::Some(3),
11866 Self::ReflectedSpiffe => std::option::Option::Some(2),
11867 Self::UnknownValue(u) => u.0.value(),
11868 }
11869 }
11870
11871 /// Gets the enum value as a string.
11872 ///
11873 /// Returns `None` if the enum contains an unknown value deserialized from
11874 /// the integer representation of enums.
11875 pub fn name(&self) -> std::option::Option<&str> {
11876 match self {
11877 Self::Unspecified => std::option::Option::Some("SUBJECT_REQUEST_MODE_UNSPECIFIED"),
11878 Self::Default => std::option::Option::Some("DEFAULT"),
11879 Self::RdnSequence => std::option::Option::Some("RDN_SEQUENCE"),
11880 Self::ReflectedSpiffe => std::option::Option::Some("REFLECTED_SPIFFE"),
11881 Self::UnknownValue(u) => u.0.name(),
11882 }
11883 }
11884}
11885
11886impl std::default::Default for SubjectRequestMode {
11887 fn default() -> Self {
11888 use std::convert::From;
11889 Self::from(0)
11890 }
11891}
11892
11893impl std::fmt::Display for SubjectRequestMode {
11894 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11895 wkt::internal::display_enum(f, self.name(), self.value())
11896 }
11897}
11898
11899impl std::convert::From<i32> for SubjectRequestMode {
11900 fn from(value: i32) -> Self {
11901 match value {
11902 0 => Self::Unspecified,
11903 1 => Self::Default,
11904 2 => Self::ReflectedSpiffe,
11905 3 => Self::RdnSequence,
11906 _ => Self::UnknownValue(subject_request_mode::UnknownValue(
11907 wkt::internal::UnknownEnumValue::Integer(value),
11908 )),
11909 }
11910 }
11911}
11912
11913impl std::convert::From<&str> for SubjectRequestMode {
11914 fn from(value: &str) -> Self {
11915 use std::string::ToString;
11916 match value {
11917 "SUBJECT_REQUEST_MODE_UNSPECIFIED" => Self::Unspecified,
11918 "DEFAULT" => Self::Default,
11919 "RDN_SEQUENCE" => Self::RdnSequence,
11920 "REFLECTED_SPIFFE" => Self::ReflectedSpiffe,
11921 _ => Self::UnknownValue(subject_request_mode::UnknownValue(
11922 wkt::internal::UnknownEnumValue::String(value.to_string()),
11923 )),
11924 }
11925 }
11926}
11927
11928impl serde::ser::Serialize for SubjectRequestMode {
11929 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11930 where
11931 S: serde::Serializer,
11932 {
11933 match self {
11934 Self::Unspecified => serializer.serialize_i32(0),
11935 Self::Default => serializer.serialize_i32(1),
11936 Self::RdnSequence => serializer.serialize_i32(3),
11937 Self::ReflectedSpiffe => serializer.serialize_i32(2),
11938 Self::UnknownValue(u) => u.0.serialize(serializer),
11939 }
11940 }
11941}
11942
11943impl<'de> serde::de::Deserialize<'de> for SubjectRequestMode {
11944 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11945 where
11946 D: serde::Deserializer<'de>,
11947 {
11948 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SubjectRequestMode>::new(
11949 ".google.cloud.security.privateca.v1.SubjectRequestMode",
11950 ))
11951 }
11952}