google_cloud_iam_v3/model.rs
1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17#![allow(rustdoc::redundant_explicit_links)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![no_implicit_prelude]
20extern crate async_trait;
21extern crate bytes;
22extern crate gaxi;
23extern crate google_cloud_gax;
24extern crate google_cloud_longrunning;
25extern crate google_cloud_lro;
26extern crate google_cloud_type;
27extern crate serde;
28extern crate serde_json;
29extern crate serde_with;
30extern crate std;
31extern crate tracing;
32extern crate wkt;
33
34mod debug;
35mod deserialize;
36mod serialize;
37
38/// Represents the metadata of the long-running operation.
39#[derive(Clone, Default, PartialEq)]
40#[non_exhaustive]
41pub struct OperationMetadata {
42 /// Output only. The time the operation was created.
43 pub create_time: std::option::Option<wkt::Timestamp>,
44
45 /// Output only. The time the operation finished running.
46 pub end_time: std::option::Option<wkt::Timestamp>,
47
48 /// Output only. Server-defined resource path for the target of the
49 pub target: std::string::String,
50
51 /// Output only. Name of the verb executed by the operation.
52 pub verb: std::string::String,
53
54 /// Output only. Human-readable status of the operation, if any.
55 pub status_message: std::string::String,
56
57 /// Output only. Identifies whether the user has requested cancellation
58 /// of the operation. Operations that have successfully been cancelled
59 /// have [Operation.error][] value with a
60 /// [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
61 /// `Code.CANCELLED`.
62 ///
63 /// [google.rpc.Status.code]: google_cloud_rpc::model::Status::code
64 pub requested_cancellation: bool,
65
66 /// Output only. API version used to start the operation.
67 pub api_version: std::string::String,
68
69 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
70}
71
72impl OperationMetadata {
73 pub fn new() -> Self {
74 std::default::Default::default()
75 }
76
77 /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
78 ///
79 /// # Example
80 /// ```ignore,no_run
81 /// # use google_cloud_iam_v3::model::OperationMetadata;
82 /// use wkt::Timestamp;
83 /// let x = OperationMetadata::new().set_create_time(Timestamp::default()/* use setters */);
84 /// ```
85 pub fn set_create_time<T>(mut self, v: T) -> Self
86 where
87 T: std::convert::Into<wkt::Timestamp>,
88 {
89 self.create_time = std::option::Option::Some(v.into());
90 self
91 }
92
93 /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
94 ///
95 /// # Example
96 /// ```ignore,no_run
97 /// # use google_cloud_iam_v3::model::OperationMetadata;
98 /// use wkt::Timestamp;
99 /// let x = OperationMetadata::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
100 /// let x = OperationMetadata::new().set_or_clear_create_time(None::<Timestamp>);
101 /// ```
102 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
103 where
104 T: std::convert::Into<wkt::Timestamp>,
105 {
106 self.create_time = v.map(|x| x.into());
107 self
108 }
109
110 /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
111 ///
112 /// # Example
113 /// ```ignore,no_run
114 /// # use google_cloud_iam_v3::model::OperationMetadata;
115 /// use wkt::Timestamp;
116 /// let x = OperationMetadata::new().set_end_time(Timestamp::default()/* use setters */);
117 /// ```
118 pub fn set_end_time<T>(mut self, v: T) -> Self
119 where
120 T: std::convert::Into<wkt::Timestamp>,
121 {
122 self.end_time = std::option::Option::Some(v.into());
123 self
124 }
125
126 /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
127 ///
128 /// # Example
129 /// ```ignore,no_run
130 /// # use google_cloud_iam_v3::model::OperationMetadata;
131 /// use wkt::Timestamp;
132 /// let x = OperationMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
133 /// let x = OperationMetadata::new().set_or_clear_end_time(None::<Timestamp>);
134 /// ```
135 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
136 where
137 T: std::convert::Into<wkt::Timestamp>,
138 {
139 self.end_time = v.map(|x| x.into());
140 self
141 }
142
143 /// Sets the value of [target][crate::model::OperationMetadata::target].
144 ///
145 /// # Example
146 /// ```ignore,no_run
147 /// # use google_cloud_iam_v3::model::OperationMetadata;
148 /// let x = OperationMetadata::new().set_target("example");
149 /// ```
150 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
151 self.target = v.into();
152 self
153 }
154
155 /// Sets the value of [verb][crate::model::OperationMetadata::verb].
156 ///
157 /// # Example
158 /// ```ignore,no_run
159 /// # use google_cloud_iam_v3::model::OperationMetadata;
160 /// let x = OperationMetadata::new().set_verb("example");
161 /// ```
162 pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
163 self.verb = v.into();
164 self
165 }
166
167 /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
168 ///
169 /// # Example
170 /// ```ignore,no_run
171 /// # use google_cloud_iam_v3::model::OperationMetadata;
172 /// let x = OperationMetadata::new().set_status_message("example");
173 /// ```
174 pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
175 self.status_message = v.into();
176 self
177 }
178
179 /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
180 ///
181 /// # Example
182 /// ```ignore,no_run
183 /// # use google_cloud_iam_v3::model::OperationMetadata;
184 /// let x = OperationMetadata::new().set_requested_cancellation(true);
185 /// ```
186 pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
187 self.requested_cancellation = v.into();
188 self
189 }
190
191 /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
192 ///
193 /// # Example
194 /// ```ignore,no_run
195 /// # use google_cloud_iam_v3::model::OperationMetadata;
196 /// let x = OperationMetadata::new().set_api_version("example");
197 /// ```
198 pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
199 self.api_version = v.into();
200 self
201 }
202}
203
204impl wkt::message::Message for OperationMetadata {
205 fn typename() -> &'static str {
206 "type.googleapis.com/google.iam.v3.OperationMetadata"
207 }
208}
209
210/// IAM policy binding resource.
211#[derive(Clone, Default, PartialEq)]
212#[non_exhaustive]
213pub struct PolicyBinding {
214 /// Identifier. The name of the policy binding, in the format
215 /// `{binding_parent/locations/{location}/policyBindings/{policy_binding_id}`.
216 /// The binding parent is the closest Resource Manager resource (project,
217 /// folder, or organization) to the binding target.
218 ///
219 /// Format:
220 ///
221 /// * `projects/{project_id}/locations/{location}/policyBindings/{policy_binding_id}`
222 /// * `projects/{project_number}/locations/{location}/policyBindings/{policy_binding_id}`
223 /// * `folders/{folder_id}/locations/{location}/policyBindings/{policy_binding_id}`
224 /// * `organizations/{organization_id}/locations/{location}/policyBindings/{policy_binding_id}`
225 pub name: std::string::String,
226
227 /// Output only. The globally unique ID of the policy binding. Assigned when
228 /// the policy binding is created.
229 pub uid: std::string::String,
230
231 /// Optional. The etag for the policy binding.
232 /// If this is provided on update, it must match the server's etag.
233 pub etag: std::string::String,
234
235 /// Optional. The description of the policy binding. Must be less than or equal
236 /// to 63 characters.
237 pub display_name: std::string::String,
238
239 /// Optional. User-defined annotations. See
240 /// <https://google.aip.dev/148#annotations> for more details such as format and
241 /// size limitations
242 pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
243
244 /// Required. Immutable. Target is the full resource name of the resource to
245 /// which the policy will be bound. Immutable once set.
246 pub target: std::option::Option<crate::model::policy_binding::Target>,
247
248 /// Immutable. The kind of the policy to attach in this binding. This field
249 /// must be one of the following:
250 ///
251 /// - Left empty (will be automatically set to the policy kind)
252 /// - The input policy kind
253 pub policy_kind: crate::model::policy_binding::PolicyKind,
254
255 /// Required. Immutable. The resource name of the policy to be bound. The
256 /// binding parent and policy must belong to the same organization.
257 pub policy: std::string::String,
258
259 /// Output only. The globally unique ID of the policy to be bound.
260 pub policy_uid: std::string::String,
261
262 /// Optional. The condition to apply to the policy binding. When set, the
263 /// `expression` field in the `Expr` must include from 1 to 10 subexpressions,
264 /// joined by the
265 /// "||"(Logical OR), "&&"(Logical AND) or "!"(Logical NOT) operators and
266 /// cannot contain more than 250 characters.
267 ///
268 /// The condition is currently only supported when bound to policies of kind
269 /// principal access boundary.
270 ///
271 /// When the bound policy is a principal access boundary policy, the only
272 /// supported attributes in any subexpression are `principal.type` and
273 /// `principal.subject`. An example expression is: "principal.type ==
274 /// 'iam.googleapis.com/ServiceAccount'" or "principal.subject ==
275 /// 'bob@example.com'".
276 ///
277 /// Allowed operations for `principal.subject`:
278 ///
279 /// - `principal.subject == <principal subject string>`
280 /// - `principal.subject != <principal subject string>`
281 /// - `principal.subject in [<list of principal subjects>]`
282 /// - `principal.subject.startsWith(<string>)`
283 /// - `principal.subject.endsWith(<string>)`
284 ///
285 /// Allowed operations for `principal.type`:
286 ///
287 /// - `principal.type == <principal type string>`
288 /// - `principal.type != <principal type string>`
289 /// - `principal.type in [<list of principal types>]`
290 ///
291 /// Supported principal types are Workspace, Workforce Pool, Workload Pool and
292 /// Service Account. Allowed string must be one of:
293 ///
294 /// - iam.googleapis.com/WorkspaceIdentity
295 /// - iam.googleapis.com/WorkforcePoolIdentity
296 /// - iam.googleapis.com/WorkloadPoolIdentity
297 /// - iam.googleapis.com/ServiceAccount
298 pub condition: std::option::Option<google_cloud_type::model::Expr>,
299
300 /// Output only. The time when the policy binding was created.
301 pub create_time: std::option::Option<wkt::Timestamp>,
302
303 /// Output only. The time when the policy binding was most recently updated.
304 pub update_time: std::option::Option<wkt::Timestamp>,
305
306 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
307}
308
309impl PolicyBinding {
310 pub fn new() -> Self {
311 std::default::Default::default()
312 }
313
314 /// Sets the value of [name][crate::model::PolicyBinding::name].
315 ///
316 /// # Example
317 /// ```ignore,no_run
318 /// # use google_cloud_iam_v3::model::PolicyBinding;
319 /// let x = PolicyBinding::new().set_name("example");
320 /// ```
321 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
322 self.name = v.into();
323 self
324 }
325
326 /// Sets the value of [uid][crate::model::PolicyBinding::uid].
327 ///
328 /// # Example
329 /// ```ignore,no_run
330 /// # use google_cloud_iam_v3::model::PolicyBinding;
331 /// let x = PolicyBinding::new().set_uid("example");
332 /// ```
333 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
334 self.uid = v.into();
335 self
336 }
337
338 /// Sets the value of [etag][crate::model::PolicyBinding::etag].
339 ///
340 /// # Example
341 /// ```ignore,no_run
342 /// # use google_cloud_iam_v3::model::PolicyBinding;
343 /// let x = PolicyBinding::new().set_etag("example");
344 /// ```
345 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
346 self.etag = v.into();
347 self
348 }
349
350 /// Sets the value of [display_name][crate::model::PolicyBinding::display_name].
351 ///
352 /// # Example
353 /// ```ignore,no_run
354 /// # use google_cloud_iam_v3::model::PolicyBinding;
355 /// let x = PolicyBinding::new().set_display_name("example");
356 /// ```
357 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
358 self.display_name = v.into();
359 self
360 }
361
362 /// Sets the value of [annotations][crate::model::PolicyBinding::annotations].
363 ///
364 /// # Example
365 /// ```ignore,no_run
366 /// # use google_cloud_iam_v3::model::PolicyBinding;
367 /// let x = PolicyBinding::new().set_annotations([
368 /// ("key0", "abc"),
369 /// ("key1", "xyz"),
370 /// ]);
371 /// ```
372 pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
373 where
374 T: std::iter::IntoIterator<Item = (K, V)>,
375 K: std::convert::Into<std::string::String>,
376 V: std::convert::Into<std::string::String>,
377 {
378 use std::iter::Iterator;
379 self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
380 self
381 }
382
383 /// Sets the value of [target][crate::model::PolicyBinding::target].
384 ///
385 /// # Example
386 /// ```ignore,no_run
387 /// # use google_cloud_iam_v3::model::PolicyBinding;
388 /// use google_cloud_iam_v3::model::policy_binding::Target;
389 /// let x = PolicyBinding::new().set_target(Target::default()/* use setters */);
390 /// ```
391 pub fn set_target<T>(mut self, v: T) -> Self
392 where
393 T: std::convert::Into<crate::model::policy_binding::Target>,
394 {
395 self.target = std::option::Option::Some(v.into());
396 self
397 }
398
399 /// Sets or clears the value of [target][crate::model::PolicyBinding::target].
400 ///
401 /// # Example
402 /// ```ignore,no_run
403 /// # use google_cloud_iam_v3::model::PolicyBinding;
404 /// use google_cloud_iam_v3::model::policy_binding::Target;
405 /// let x = PolicyBinding::new().set_or_clear_target(Some(Target::default()/* use setters */));
406 /// let x = PolicyBinding::new().set_or_clear_target(None::<Target>);
407 /// ```
408 pub fn set_or_clear_target<T>(mut self, v: std::option::Option<T>) -> Self
409 where
410 T: std::convert::Into<crate::model::policy_binding::Target>,
411 {
412 self.target = v.map(|x| x.into());
413 self
414 }
415
416 /// Sets the value of [policy_kind][crate::model::PolicyBinding::policy_kind].
417 ///
418 /// # Example
419 /// ```ignore,no_run
420 /// # use google_cloud_iam_v3::model::PolicyBinding;
421 /// use google_cloud_iam_v3::model::policy_binding::PolicyKind;
422 /// let x0 = PolicyBinding::new().set_policy_kind(PolicyKind::PrincipalAccessBoundary);
423 /// ```
424 pub fn set_policy_kind<T: std::convert::Into<crate::model::policy_binding::PolicyKind>>(
425 mut self,
426 v: T,
427 ) -> Self {
428 self.policy_kind = v.into();
429 self
430 }
431
432 /// Sets the value of [policy][crate::model::PolicyBinding::policy].
433 ///
434 /// # Example
435 /// ```ignore,no_run
436 /// # use google_cloud_iam_v3::model::PolicyBinding;
437 /// let x = PolicyBinding::new().set_policy("example");
438 /// ```
439 pub fn set_policy<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
440 self.policy = v.into();
441 self
442 }
443
444 /// Sets the value of [policy_uid][crate::model::PolicyBinding::policy_uid].
445 ///
446 /// # Example
447 /// ```ignore,no_run
448 /// # use google_cloud_iam_v3::model::PolicyBinding;
449 /// let x = PolicyBinding::new().set_policy_uid("example");
450 /// ```
451 pub fn set_policy_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
452 self.policy_uid = v.into();
453 self
454 }
455
456 /// Sets the value of [condition][crate::model::PolicyBinding::condition].
457 ///
458 /// # Example
459 /// ```ignore,no_run
460 /// # use google_cloud_iam_v3::model::PolicyBinding;
461 /// use google_cloud_type::model::Expr;
462 /// let x = PolicyBinding::new().set_condition(Expr::default()/* use setters */);
463 /// ```
464 pub fn set_condition<T>(mut self, v: T) -> Self
465 where
466 T: std::convert::Into<google_cloud_type::model::Expr>,
467 {
468 self.condition = std::option::Option::Some(v.into());
469 self
470 }
471
472 /// Sets or clears the value of [condition][crate::model::PolicyBinding::condition].
473 ///
474 /// # Example
475 /// ```ignore,no_run
476 /// # use google_cloud_iam_v3::model::PolicyBinding;
477 /// use google_cloud_type::model::Expr;
478 /// let x = PolicyBinding::new().set_or_clear_condition(Some(Expr::default()/* use setters */));
479 /// let x = PolicyBinding::new().set_or_clear_condition(None::<Expr>);
480 /// ```
481 pub fn set_or_clear_condition<T>(mut self, v: std::option::Option<T>) -> Self
482 where
483 T: std::convert::Into<google_cloud_type::model::Expr>,
484 {
485 self.condition = v.map(|x| x.into());
486 self
487 }
488
489 /// Sets the value of [create_time][crate::model::PolicyBinding::create_time].
490 ///
491 /// # Example
492 /// ```ignore,no_run
493 /// # use google_cloud_iam_v3::model::PolicyBinding;
494 /// use wkt::Timestamp;
495 /// let x = PolicyBinding::new().set_create_time(Timestamp::default()/* use setters */);
496 /// ```
497 pub fn set_create_time<T>(mut self, v: T) -> Self
498 where
499 T: std::convert::Into<wkt::Timestamp>,
500 {
501 self.create_time = std::option::Option::Some(v.into());
502 self
503 }
504
505 /// Sets or clears the value of [create_time][crate::model::PolicyBinding::create_time].
506 ///
507 /// # Example
508 /// ```ignore,no_run
509 /// # use google_cloud_iam_v3::model::PolicyBinding;
510 /// use wkt::Timestamp;
511 /// let x = PolicyBinding::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
512 /// let x = PolicyBinding::new().set_or_clear_create_time(None::<Timestamp>);
513 /// ```
514 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
515 where
516 T: std::convert::Into<wkt::Timestamp>,
517 {
518 self.create_time = v.map(|x| x.into());
519 self
520 }
521
522 /// Sets the value of [update_time][crate::model::PolicyBinding::update_time].
523 ///
524 /// # Example
525 /// ```ignore,no_run
526 /// # use google_cloud_iam_v3::model::PolicyBinding;
527 /// use wkt::Timestamp;
528 /// let x = PolicyBinding::new().set_update_time(Timestamp::default()/* use setters */);
529 /// ```
530 pub fn set_update_time<T>(mut self, v: T) -> Self
531 where
532 T: std::convert::Into<wkt::Timestamp>,
533 {
534 self.update_time = std::option::Option::Some(v.into());
535 self
536 }
537
538 /// Sets or clears the value of [update_time][crate::model::PolicyBinding::update_time].
539 ///
540 /// # Example
541 /// ```ignore,no_run
542 /// # use google_cloud_iam_v3::model::PolicyBinding;
543 /// use wkt::Timestamp;
544 /// let x = PolicyBinding::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
545 /// let x = PolicyBinding::new().set_or_clear_update_time(None::<Timestamp>);
546 /// ```
547 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
548 where
549 T: std::convert::Into<wkt::Timestamp>,
550 {
551 self.update_time = v.map(|x| x.into());
552 self
553 }
554}
555
556impl wkt::message::Message for PolicyBinding {
557 fn typename() -> &'static str {
558 "type.googleapis.com/google.iam.v3.PolicyBinding"
559 }
560}
561
562/// Defines additional types related to [PolicyBinding].
563pub mod policy_binding {
564 #[allow(unused_imports)]
565 use super::*;
566
567 /// Target is the full resource name of the resource to which the policy will
568 /// be bound. Immutable once set.
569 #[derive(Clone, Default, PartialEq)]
570 #[non_exhaustive]
571 pub struct Target {
572 /// The different types of targets that can be bound to a policy.
573 pub target: std::option::Option<crate::model::policy_binding::target::Target>,
574
575 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
576 }
577
578 impl Target {
579 pub fn new() -> Self {
580 std::default::Default::default()
581 }
582
583 /// Sets the value of [target][crate::model::policy_binding::Target::target].
584 ///
585 /// Note that all the setters affecting `target` are mutually
586 /// exclusive.
587 ///
588 /// # Example
589 /// ```ignore,no_run
590 /// # use google_cloud_iam_v3::model::policy_binding::Target;
591 /// use google_cloud_iam_v3::model::policy_binding::target::Target as TargetOneOf;
592 /// let x = Target::new().set_target(Some(TargetOneOf::PrincipalSet("example".to_string())));
593 /// ```
594 pub fn set_target<
595 T: std::convert::Into<std::option::Option<crate::model::policy_binding::target::Target>>,
596 >(
597 mut self,
598 v: T,
599 ) -> Self {
600 self.target = v.into();
601 self
602 }
603
604 /// The value of [target][crate::model::policy_binding::Target::target]
605 /// if it holds a `PrincipalSet`, `None` if the field is not set or
606 /// holds a different branch.
607 pub fn principal_set(&self) -> std::option::Option<&std::string::String> {
608 #[allow(unreachable_patterns)]
609 self.target.as_ref().and_then(|v| match v {
610 crate::model::policy_binding::target::Target::PrincipalSet(v) => {
611 std::option::Option::Some(v)
612 }
613 _ => std::option::Option::None,
614 })
615 }
616
617 /// Sets the value of [target][crate::model::policy_binding::Target::target]
618 /// to hold a `PrincipalSet`.
619 ///
620 /// Note that all the setters affecting `target` are
621 /// mutually exclusive.
622 ///
623 /// # Example
624 /// ```ignore,no_run
625 /// # use google_cloud_iam_v3::model::policy_binding::Target;
626 /// let x = Target::new().set_principal_set("example");
627 /// assert!(x.principal_set().is_some());
628 /// ```
629 pub fn set_principal_set<T: std::convert::Into<std::string::String>>(
630 mut self,
631 v: T,
632 ) -> Self {
633 self.target = std::option::Option::Some(
634 crate::model::policy_binding::target::Target::PrincipalSet(v.into()),
635 );
636 self
637 }
638 }
639
640 impl wkt::message::Message for Target {
641 fn typename() -> &'static str {
642 "type.googleapis.com/google.iam.v3.PolicyBinding.Target"
643 }
644 }
645
646 /// Defines additional types related to [Target].
647 pub mod target {
648 #[allow(unused_imports)]
649 use super::*;
650
651 /// The different types of targets that can be bound to a policy.
652 #[derive(Clone, Debug, PartialEq)]
653 #[non_exhaustive]
654 pub enum Target {
655 /// Immutable. Full Resource Name used for principal access boundary policy
656 /// bindings. The principal set must be directly parented by the policy
657 /// binding's parent or same as the parent if the target is a
658 /// project/folder/organization.
659 ///
660 /// Examples:
661 ///
662 /// * For binding's parented by an organization:
663 /// * Organization:
664 /// `//cloudresourcemanager.googleapis.com/organizations/ORGANIZATION_ID`
665 /// * Workforce Identity:
666 /// `//iam.googleapis.com/locations/global/workforcePools/WORKFORCE_POOL_ID`
667 /// * Workspace Identity:
668 /// `//iam.googleapis.com/locations/global/workspace/WORKSPACE_ID`
669 /// * For binding's parented by a folder:
670 /// * Folder:
671 /// `//cloudresourcemanager.googleapis.com/folders/FOLDER_ID`
672 /// * For binding's parented by a project:
673 /// * Project:
674 /// * `//cloudresourcemanager.googleapis.com/projects/PROJECT_NUMBER`
675 /// * `//cloudresourcemanager.googleapis.com/projects/PROJECT_ID`
676 /// * Workload Identity Pool:
677 /// `//iam.googleapis.com/projects/PROJECT_NUMBER/locations/LOCATION/workloadIdentityPools/WORKLOAD_POOL_ID`
678 PrincipalSet(std::string::String),
679 }
680 }
681
682 /// Different policy kinds supported in this binding.
683 ///
684 /// # Working with unknown values
685 ///
686 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
687 /// additional enum variants at any time. Adding new variants is not considered
688 /// a breaking change. Applications should write their code in anticipation of:
689 ///
690 /// - New values appearing in future releases of the client library, **and**
691 /// - New values received dynamically, without application changes.
692 ///
693 /// Please consult the [Working with enums] section in the user guide for some
694 /// guidelines.
695 ///
696 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
697 #[derive(Clone, Debug, PartialEq)]
698 #[non_exhaustive]
699 pub enum PolicyKind {
700 /// Unspecified policy kind; Not a valid state
701 Unspecified,
702 /// Principal access boundary policy kind
703 PrincipalAccessBoundary,
704 /// If set, the enum was initialized with an unknown value.
705 ///
706 /// Applications can examine the value using [PolicyKind::value] or
707 /// [PolicyKind::name].
708 UnknownValue(policy_kind::UnknownValue),
709 }
710
711 #[doc(hidden)]
712 pub mod policy_kind {
713 #[allow(unused_imports)]
714 use super::*;
715 #[derive(Clone, Debug, PartialEq)]
716 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
717 }
718
719 impl PolicyKind {
720 /// Gets the enum value.
721 ///
722 /// Returns `None` if the enum contains an unknown value deserialized from
723 /// the string representation of enums.
724 pub fn value(&self) -> std::option::Option<i32> {
725 match self {
726 Self::Unspecified => std::option::Option::Some(0),
727 Self::PrincipalAccessBoundary => std::option::Option::Some(1),
728 Self::UnknownValue(u) => u.0.value(),
729 }
730 }
731
732 /// Gets the enum value as a string.
733 ///
734 /// Returns `None` if the enum contains an unknown value deserialized from
735 /// the integer representation of enums.
736 pub fn name(&self) -> std::option::Option<&str> {
737 match self {
738 Self::Unspecified => std::option::Option::Some("POLICY_KIND_UNSPECIFIED"),
739 Self::PrincipalAccessBoundary => {
740 std::option::Option::Some("PRINCIPAL_ACCESS_BOUNDARY")
741 }
742 Self::UnknownValue(u) => u.0.name(),
743 }
744 }
745 }
746
747 impl std::default::Default for PolicyKind {
748 fn default() -> Self {
749 use std::convert::From;
750 Self::from(0)
751 }
752 }
753
754 impl std::fmt::Display for PolicyKind {
755 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
756 wkt::internal::display_enum(f, self.name(), self.value())
757 }
758 }
759
760 impl std::convert::From<i32> for PolicyKind {
761 fn from(value: i32) -> Self {
762 match value {
763 0 => Self::Unspecified,
764 1 => Self::PrincipalAccessBoundary,
765 _ => Self::UnknownValue(policy_kind::UnknownValue(
766 wkt::internal::UnknownEnumValue::Integer(value),
767 )),
768 }
769 }
770 }
771
772 impl std::convert::From<&str> for PolicyKind {
773 fn from(value: &str) -> Self {
774 use std::string::ToString;
775 match value {
776 "POLICY_KIND_UNSPECIFIED" => Self::Unspecified,
777 "PRINCIPAL_ACCESS_BOUNDARY" => Self::PrincipalAccessBoundary,
778 _ => Self::UnknownValue(policy_kind::UnknownValue(
779 wkt::internal::UnknownEnumValue::String(value.to_string()),
780 )),
781 }
782 }
783 }
784
785 impl serde::ser::Serialize for PolicyKind {
786 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
787 where
788 S: serde::Serializer,
789 {
790 match self {
791 Self::Unspecified => serializer.serialize_i32(0),
792 Self::PrincipalAccessBoundary => serializer.serialize_i32(1),
793 Self::UnknownValue(u) => u.0.serialize(serializer),
794 }
795 }
796 }
797
798 impl<'de> serde::de::Deserialize<'de> for PolicyKind {
799 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
800 where
801 D: serde::Deserializer<'de>,
802 {
803 deserializer.deserialize_any(wkt::internal::EnumVisitor::<PolicyKind>::new(
804 ".google.iam.v3.PolicyBinding.PolicyKind",
805 ))
806 }
807 }
808}
809
810/// Request message for CreatePolicyBinding method.
811#[derive(Clone, Default, PartialEq)]
812#[non_exhaustive]
813pub struct CreatePolicyBindingRequest {
814 /// Required. The parent resource where this policy binding will be created.
815 /// The binding parent is the closest Resource Manager resource (project,
816 /// folder or organization) to the binding target.
817 ///
818 /// Format:
819 ///
820 /// * `projects/{project_id}/locations/{location}`
821 /// * `projects/{project_number}/locations/{location}`
822 /// * `folders/{folder_id}/locations/{location}`
823 /// * `organizations/{organization_id}/locations/{location}`
824 pub parent: std::string::String,
825
826 /// Required. The ID to use for the policy binding, which will become the final
827 /// component of the policy binding's resource name.
828 ///
829 /// This value must start with a lowercase letter followed by up to 62
830 /// lowercase letters, numbers, hyphens, or dots. Pattern,
831 /// /[a-z][a-z0-9-\.]{2,62}/.
832 pub policy_binding_id: std::string::String,
833
834 /// Required. The policy binding to create.
835 pub policy_binding: std::option::Option<crate::model::PolicyBinding>,
836
837 /// Optional. If set, validate the request and preview the creation, but do not
838 /// actually post it.
839 pub validate_only: bool,
840
841 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
842}
843
844impl CreatePolicyBindingRequest {
845 pub fn new() -> Self {
846 std::default::Default::default()
847 }
848
849 /// Sets the value of [parent][crate::model::CreatePolicyBindingRequest::parent].
850 ///
851 /// # Example
852 /// ```ignore,no_run
853 /// # use google_cloud_iam_v3::model::CreatePolicyBindingRequest;
854 /// let x = CreatePolicyBindingRequest::new().set_parent("example");
855 /// ```
856 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
857 self.parent = v.into();
858 self
859 }
860
861 /// Sets the value of [policy_binding_id][crate::model::CreatePolicyBindingRequest::policy_binding_id].
862 ///
863 /// # Example
864 /// ```ignore,no_run
865 /// # use google_cloud_iam_v3::model::CreatePolicyBindingRequest;
866 /// let x = CreatePolicyBindingRequest::new().set_policy_binding_id("example");
867 /// ```
868 pub fn set_policy_binding_id<T: std::convert::Into<std::string::String>>(
869 mut self,
870 v: T,
871 ) -> Self {
872 self.policy_binding_id = v.into();
873 self
874 }
875
876 /// Sets the value of [policy_binding][crate::model::CreatePolicyBindingRequest::policy_binding].
877 ///
878 /// # Example
879 /// ```ignore,no_run
880 /// # use google_cloud_iam_v3::model::CreatePolicyBindingRequest;
881 /// use google_cloud_iam_v3::model::PolicyBinding;
882 /// let x = CreatePolicyBindingRequest::new().set_policy_binding(PolicyBinding::default()/* use setters */);
883 /// ```
884 pub fn set_policy_binding<T>(mut self, v: T) -> Self
885 where
886 T: std::convert::Into<crate::model::PolicyBinding>,
887 {
888 self.policy_binding = std::option::Option::Some(v.into());
889 self
890 }
891
892 /// Sets or clears the value of [policy_binding][crate::model::CreatePolicyBindingRequest::policy_binding].
893 ///
894 /// # Example
895 /// ```ignore,no_run
896 /// # use google_cloud_iam_v3::model::CreatePolicyBindingRequest;
897 /// use google_cloud_iam_v3::model::PolicyBinding;
898 /// let x = CreatePolicyBindingRequest::new().set_or_clear_policy_binding(Some(PolicyBinding::default()/* use setters */));
899 /// let x = CreatePolicyBindingRequest::new().set_or_clear_policy_binding(None::<PolicyBinding>);
900 /// ```
901 pub fn set_or_clear_policy_binding<T>(mut self, v: std::option::Option<T>) -> Self
902 where
903 T: std::convert::Into<crate::model::PolicyBinding>,
904 {
905 self.policy_binding = v.map(|x| x.into());
906 self
907 }
908
909 /// Sets the value of [validate_only][crate::model::CreatePolicyBindingRequest::validate_only].
910 ///
911 /// # Example
912 /// ```ignore,no_run
913 /// # use google_cloud_iam_v3::model::CreatePolicyBindingRequest;
914 /// let x = CreatePolicyBindingRequest::new().set_validate_only(true);
915 /// ```
916 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
917 self.validate_only = v.into();
918 self
919 }
920}
921
922impl wkt::message::Message for CreatePolicyBindingRequest {
923 fn typename() -> &'static str {
924 "type.googleapis.com/google.iam.v3.CreatePolicyBindingRequest"
925 }
926}
927
928/// Request message for GetPolicyBinding method.
929#[derive(Clone, Default, PartialEq)]
930#[non_exhaustive]
931pub struct GetPolicyBindingRequest {
932 /// Required. The name of the policy binding to retrieve.
933 ///
934 /// Format:
935 ///
936 /// * `projects/{project_id}/locations/{location}/policyBindings/{policy_binding_id}`
937 /// * `projects/{project_number}/locations/{location}/policyBindings/{policy_binding_id}`
938 /// * `folders/{folder_id}/locations/{location}/policyBindings/{policy_binding_id}`
939 /// * `organizations/{organization_id}/locations/{location}/policyBindings/{policy_binding_id}`
940 pub name: std::string::String,
941
942 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
943}
944
945impl GetPolicyBindingRequest {
946 pub fn new() -> Self {
947 std::default::Default::default()
948 }
949
950 /// Sets the value of [name][crate::model::GetPolicyBindingRequest::name].
951 ///
952 /// # Example
953 /// ```ignore,no_run
954 /// # use google_cloud_iam_v3::model::GetPolicyBindingRequest;
955 /// let x = GetPolicyBindingRequest::new().set_name("example");
956 /// ```
957 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
958 self.name = v.into();
959 self
960 }
961}
962
963impl wkt::message::Message for GetPolicyBindingRequest {
964 fn typename() -> &'static str {
965 "type.googleapis.com/google.iam.v3.GetPolicyBindingRequest"
966 }
967}
968
969/// Request message for UpdatePolicyBinding method.
970#[derive(Clone, Default, PartialEq)]
971#[non_exhaustive]
972pub struct UpdatePolicyBindingRequest {
973 /// Required. The policy binding to update.
974 ///
975 /// The policy binding's `name` field is used to identify the policy binding to
976 /// update.
977 pub policy_binding: std::option::Option<crate::model::PolicyBinding>,
978
979 /// Optional. If set, validate the request and preview the update, but do not
980 /// actually post it.
981 pub validate_only: bool,
982
983 /// Optional. The list of fields to update
984 pub update_mask: std::option::Option<wkt::FieldMask>,
985
986 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
987}
988
989impl UpdatePolicyBindingRequest {
990 pub fn new() -> Self {
991 std::default::Default::default()
992 }
993
994 /// Sets the value of [policy_binding][crate::model::UpdatePolicyBindingRequest::policy_binding].
995 ///
996 /// # Example
997 /// ```ignore,no_run
998 /// # use google_cloud_iam_v3::model::UpdatePolicyBindingRequest;
999 /// use google_cloud_iam_v3::model::PolicyBinding;
1000 /// let x = UpdatePolicyBindingRequest::new().set_policy_binding(PolicyBinding::default()/* use setters */);
1001 /// ```
1002 pub fn set_policy_binding<T>(mut self, v: T) -> Self
1003 where
1004 T: std::convert::Into<crate::model::PolicyBinding>,
1005 {
1006 self.policy_binding = std::option::Option::Some(v.into());
1007 self
1008 }
1009
1010 /// Sets or clears the value of [policy_binding][crate::model::UpdatePolicyBindingRequest::policy_binding].
1011 ///
1012 /// # Example
1013 /// ```ignore,no_run
1014 /// # use google_cloud_iam_v3::model::UpdatePolicyBindingRequest;
1015 /// use google_cloud_iam_v3::model::PolicyBinding;
1016 /// let x = UpdatePolicyBindingRequest::new().set_or_clear_policy_binding(Some(PolicyBinding::default()/* use setters */));
1017 /// let x = UpdatePolicyBindingRequest::new().set_or_clear_policy_binding(None::<PolicyBinding>);
1018 /// ```
1019 pub fn set_or_clear_policy_binding<T>(mut self, v: std::option::Option<T>) -> Self
1020 where
1021 T: std::convert::Into<crate::model::PolicyBinding>,
1022 {
1023 self.policy_binding = v.map(|x| x.into());
1024 self
1025 }
1026
1027 /// Sets the value of [validate_only][crate::model::UpdatePolicyBindingRequest::validate_only].
1028 ///
1029 /// # Example
1030 /// ```ignore,no_run
1031 /// # use google_cloud_iam_v3::model::UpdatePolicyBindingRequest;
1032 /// let x = UpdatePolicyBindingRequest::new().set_validate_only(true);
1033 /// ```
1034 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1035 self.validate_only = v.into();
1036 self
1037 }
1038
1039 /// Sets the value of [update_mask][crate::model::UpdatePolicyBindingRequest::update_mask].
1040 ///
1041 /// # Example
1042 /// ```ignore,no_run
1043 /// # use google_cloud_iam_v3::model::UpdatePolicyBindingRequest;
1044 /// use wkt::FieldMask;
1045 /// let x = UpdatePolicyBindingRequest::new().set_update_mask(FieldMask::default()/* use setters */);
1046 /// ```
1047 pub fn set_update_mask<T>(mut self, v: T) -> Self
1048 where
1049 T: std::convert::Into<wkt::FieldMask>,
1050 {
1051 self.update_mask = std::option::Option::Some(v.into());
1052 self
1053 }
1054
1055 /// Sets or clears the value of [update_mask][crate::model::UpdatePolicyBindingRequest::update_mask].
1056 ///
1057 /// # Example
1058 /// ```ignore,no_run
1059 /// # use google_cloud_iam_v3::model::UpdatePolicyBindingRequest;
1060 /// use wkt::FieldMask;
1061 /// let x = UpdatePolicyBindingRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
1062 /// let x = UpdatePolicyBindingRequest::new().set_or_clear_update_mask(None::<FieldMask>);
1063 /// ```
1064 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1065 where
1066 T: std::convert::Into<wkt::FieldMask>,
1067 {
1068 self.update_mask = v.map(|x| x.into());
1069 self
1070 }
1071}
1072
1073impl wkt::message::Message for UpdatePolicyBindingRequest {
1074 fn typename() -> &'static str {
1075 "type.googleapis.com/google.iam.v3.UpdatePolicyBindingRequest"
1076 }
1077}
1078
1079/// Request message for DeletePolicyBinding method.
1080#[derive(Clone, Default, PartialEq)]
1081#[non_exhaustive]
1082pub struct DeletePolicyBindingRequest {
1083 /// Required. The name of the policy binding to delete.
1084 ///
1085 /// Format:
1086 ///
1087 /// * `projects/{project_id}/locations/{location}/policyBindings/{policy_binding_id}`
1088 /// * `projects/{project_number}/locations/{location}/policyBindings/{policy_binding_id}`
1089 /// * `folders/{folder_id}/locations/{location}/policyBindings/{policy_binding_id}`
1090 /// * `organizations/{organization_id}/locations/{location}/policyBindings/{policy_binding_id}`
1091 pub name: std::string::String,
1092
1093 /// Optional. The etag of the policy binding.
1094 /// If this is provided, it must match the server's etag.
1095 pub etag: std::string::String,
1096
1097 /// Optional. If set, validate the request and preview the deletion, but do not
1098 /// actually post it.
1099 pub validate_only: bool,
1100
1101 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1102}
1103
1104impl DeletePolicyBindingRequest {
1105 pub fn new() -> Self {
1106 std::default::Default::default()
1107 }
1108
1109 /// Sets the value of [name][crate::model::DeletePolicyBindingRequest::name].
1110 ///
1111 /// # Example
1112 /// ```ignore,no_run
1113 /// # use google_cloud_iam_v3::model::DeletePolicyBindingRequest;
1114 /// let x = DeletePolicyBindingRequest::new().set_name("example");
1115 /// ```
1116 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1117 self.name = v.into();
1118 self
1119 }
1120
1121 /// Sets the value of [etag][crate::model::DeletePolicyBindingRequest::etag].
1122 ///
1123 /// # Example
1124 /// ```ignore,no_run
1125 /// # use google_cloud_iam_v3::model::DeletePolicyBindingRequest;
1126 /// let x = DeletePolicyBindingRequest::new().set_etag("example");
1127 /// ```
1128 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1129 self.etag = v.into();
1130 self
1131 }
1132
1133 /// Sets the value of [validate_only][crate::model::DeletePolicyBindingRequest::validate_only].
1134 ///
1135 /// # Example
1136 /// ```ignore,no_run
1137 /// # use google_cloud_iam_v3::model::DeletePolicyBindingRequest;
1138 /// let x = DeletePolicyBindingRequest::new().set_validate_only(true);
1139 /// ```
1140 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1141 self.validate_only = v.into();
1142 self
1143 }
1144}
1145
1146impl wkt::message::Message for DeletePolicyBindingRequest {
1147 fn typename() -> &'static str {
1148 "type.googleapis.com/google.iam.v3.DeletePolicyBindingRequest"
1149 }
1150}
1151
1152/// Request message for ListPolicyBindings method.
1153#[derive(Clone, Default, PartialEq)]
1154#[non_exhaustive]
1155pub struct ListPolicyBindingsRequest {
1156 /// Required. The parent resource, which owns the collection of policy
1157 /// bindings.
1158 ///
1159 /// Format:
1160 ///
1161 /// * `projects/{project_id}/locations/{location}`
1162 /// * `projects/{project_number}/locations/{location}`
1163 /// * `folders/{folder_id}/locations/{location}`
1164 /// * `organizations/{organization_id}/locations/{location}`
1165 pub parent: std::string::String,
1166
1167 /// Optional. The maximum number of policy bindings to return. The service may
1168 /// return fewer than this value.
1169 ///
1170 /// If unspecified, at most 50 policy bindings will be returned.
1171 /// The maximum value is 1000; values above 1000 will be coerced to 1000.
1172 pub page_size: i32,
1173
1174 /// Optional. A page token, received from a previous `ListPolicyBindings` call.
1175 /// Provide this to retrieve the subsequent page.
1176 ///
1177 /// When paginating, all other parameters provided to `ListPolicyBindings` must
1178 /// match the call that provided the page token.
1179 pub page_token: std::string::String,
1180
1181 /// Optional. An expression for filtering the results of the request. Filter
1182 /// rules are case insensitive. Some eligible fields for filtering are:
1183 ///
1184 /// + `target`
1185 /// + `policy`
1186 ///
1187 /// Some examples of filter queries:
1188 ///
1189 /// * `target:ex*`: The binding target's name starts with "ex".
1190 /// * `target:example`: The binding target's name is `example`.
1191 /// * `policy:example`: The binding policy's name is `example`.
1192 pub filter: std::string::String,
1193
1194 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1195}
1196
1197impl ListPolicyBindingsRequest {
1198 pub fn new() -> Self {
1199 std::default::Default::default()
1200 }
1201
1202 /// Sets the value of [parent][crate::model::ListPolicyBindingsRequest::parent].
1203 ///
1204 /// # Example
1205 /// ```ignore,no_run
1206 /// # use google_cloud_iam_v3::model::ListPolicyBindingsRequest;
1207 /// let x = ListPolicyBindingsRequest::new().set_parent("example");
1208 /// ```
1209 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1210 self.parent = v.into();
1211 self
1212 }
1213
1214 /// Sets the value of [page_size][crate::model::ListPolicyBindingsRequest::page_size].
1215 ///
1216 /// # Example
1217 /// ```ignore,no_run
1218 /// # use google_cloud_iam_v3::model::ListPolicyBindingsRequest;
1219 /// let x = ListPolicyBindingsRequest::new().set_page_size(42);
1220 /// ```
1221 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1222 self.page_size = v.into();
1223 self
1224 }
1225
1226 /// Sets the value of [page_token][crate::model::ListPolicyBindingsRequest::page_token].
1227 ///
1228 /// # Example
1229 /// ```ignore,no_run
1230 /// # use google_cloud_iam_v3::model::ListPolicyBindingsRequest;
1231 /// let x = ListPolicyBindingsRequest::new().set_page_token("example");
1232 /// ```
1233 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1234 self.page_token = v.into();
1235 self
1236 }
1237
1238 /// Sets the value of [filter][crate::model::ListPolicyBindingsRequest::filter].
1239 ///
1240 /// # Example
1241 /// ```ignore,no_run
1242 /// # use google_cloud_iam_v3::model::ListPolicyBindingsRequest;
1243 /// let x = ListPolicyBindingsRequest::new().set_filter("example");
1244 /// ```
1245 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1246 self.filter = v.into();
1247 self
1248 }
1249}
1250
1251impl wkt::message::Message for ListPolicyBindingsRequest {
1252 fn typename() -> &'static str {
1253 "type.googleapis.com/google.iam.v3.ListPolicyBindingsRequest"
1254 }
1255}
1256
1257/// Response message for ListPolicyBindings method.
1258#[derive(Clone, Default, PartialEq)]
1259#[non_exhaustive]
1260pub struct ListPolicyBindingsResponse {
1261 /// The policy bindings from the specified parent.
1262 pub policy_bindings: std::vec::Vec<crate::model::PolicyBinding>,
1263
1264 /// Optional. A token, which can be sent as `page_token` to retrieve the next
1265 /// page. If this field is omitted, there are no subsequent pages.
1266 pub next_page_token: std::string::String,
1267
1268 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1269}
1270
1271impl ListPolicyBindingsResponse {
1272 pub fn new() -> Self {
1273 std::default::Default::default()
1274 }
1275
1276 /// Sets the value of [policy_bindings][crate::model::ListPolicyBindingsResponse::policy_bindings].
1277 ///
1278 /// # Example
1279 /// ```ignore,no_run
1280 /// # use google_cloud_iam_v3::model::ListPolicyBindingsResponse;
1281 /// use google_cloud_iam_v3::model::PolicyBinding;
1282 /// let x = ListPolicyBindingsResponse::new()
1283 /// .set_policy_bindings([
1284 /// PolicyBinding::default()/* use setters */,
1285 /// PolicyBinding::default()/* use (different) setters */,
1286 /// ]);
1287 /// ```
1288 pub fn set_policy_bindings<T, V>(mut self, v: T) -> Self
1289 where
1290 T: std::iter::IntoIterator<Item = V>,
1291 V: std::convert::Into<crate::model::PolicyBinding>,
1292 {
1293 use std::iter::Iterator;
1294 self.policy_bindings = v.into_iter().map(|i| i.into()).collect();
1295 self
1296 }
1297
1298 /// Sets the value of [next_page_token][crate::model::ListPolicyBindingsResponse::next_page_token].
1299 ///
1300 /// # Example
1301 /// ```ignore,no_run
1302 /// # use google_cloud_iam_v3::model::ListPolicyBindingsResponse;
1303 /// let x = ListPolicyBindingsResponse::new().set_next_page_token("example");
1304 /// ```
1305 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1306 self.next_page_token = v.into();
1307 self
1308 }
1309}
1310
1311impl wkt::message::Message for ListPolicyBindingsResponse {
1312 fn typename() -> &'static str {
1313 "type.googleapis.com/google.iam.v3.ListPolicyBindingsResponse"
1314 }
1315}
1316
1317#[doc(hidden)]
1318impl google_cloud_gax::paginator::internal::PageableResponse for ListPolicyBindingsResponse {
1319 type PageItem = crate::model::PolicyBinding;
1320
1321 fn items(self) -> std::vec::Vec<Self::PageItem> {
1322 self.policy_bindings
1323 }
1324
1325 fn next_page_token(&self) -> std::string::String {
1326 use std::clone::Clone;
1327 self.next_page_token.clone()
1328 }
1329}
1330
1331/// Request message for SearchTargetPolicyBindings method.
1332#[derive(Clone, Default, PartialEq)]
1333#[non_exhaustive]
1334pub struct SearchTargetPolicyBindingsRequest {
1335 /// Required. The target resource, which is bound to the policy in the binding.
1336 ///
1337 /// Format:
1338 ///
1339 /// * `//iam.googleapis.com/locations/global/workforcePools/POOL_ID`
1340 /// * `//iam.googleapis.com/projects/PROJECT_NUMBER/locations/global/workloadIdentityPools/POOL_ID`
1341 /// * `//iam.googleapis.com/locations/global/workspace/WORKSPACE_ID`
1342 /// * `//cloudresourcemanager.googleapis.com/projects/{project_number}`
1343 /// * `//cloudresourcemanager.googleapis.com/folders/{folder_id}`
1344 /// * `//cloudresourcemanager.googleapis.com/organizations/{organization_id}`
1345 pub target: std::string::String,
1346
1347 /// Optional. The maximum number of policy bindings to return. The service may
1348 /// return fewer than this value.
1349 ///
1350 /// If unspecified, at most 50 policy bindings will be returned.
1351 /// The maximum value is 1000; values above 1000 will be coerced to 1000.
1352 pub page_size: i32,
1353
1354 /// Optional. A page token, received from a previous
1355 /// `SearchTargetPolicyBindingsRequest` call. Provide this to retrieve the
1356 /// subsequent page.
1357 ///
1358 /// When paginating, all other parameters provided to
1359 /// `SearchTargetPolicyBindingsRequest` must match the call that provided the
1360 /// page token.
1361 pub page_token: std::string::String,
1362
1363 /// Required. The parent resource where this search will be performed. This
1364 /// should be the nearest Resource Manager resource (project, folder, or
1365 /// organization) to the target.
1366 ///
1367 /// Format:
1368 ///
1369 /// * `projects/{project_id}/locations/{location}`
1370 /// * `projects/{project_number}/locations/{location}`
1371 /// * `folders/{folder_id}/locations/{location}`
1372 /// * `organizations/{organization_id}/locations/{location}`
1373 pub parent: std::string::String,
1374
1375 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1376}
1377
1378impl SearchTargetPolicyBindingsRequest {
1379 pub fn new() -> Self {
1380 std::default::Default::default()
1381 }
1382
1383 /// Sets the value of [target][crate::model::SearchTargetPolicyBindingsRequest::target].
1384 ///
1385 /// # Example
1386 /// ```ignore,no_run
1387 /// # use google_cloud_iam_v3::model::SearchTargetPolicyBindingsRequest;
1388 /// let x = SearchTargetPolicyBindingsRequest::new().set_target("example");
1389 /// ```
1390 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1391 self.target = v.into();
1392 self
1393 }
1394
1395 /// Sets the value of [page_size][crate::model::SearchTargetPolicyBindingsRequest::page_size].
1396 ///
1397 /// # Example
1398 /// ```ignore,no_run
1399 /// # use google_cloud_iam_v3::model::SearchTargetPolicyBindingsRequest;
1400 /// let x = SearchTargetPolicyBindingsRequest::new().set_page_size(42);
1401 /// ```
1402 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1403 self.page_size = v.into();
1404 self
1405 }
1406
1407 /// Sets the value of [page_token][crate::model::SearchTargetPolicyBindingsRequest::page_token].
1408 ///
1409 /// # Example
1410 /// ```ignore,no_run
1411 /// # use google_cloud_iam_v3::model::SearchTargetPolicyBindingsRequest;
1412 /// let x = SearchTargetPolicyBindingsRequest::new().set_page_token("example");
1413 /// ```
1414 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1415 self.page_token = v.into();
1416 self
1417 }
1418
1419 /// Sets the value of [parent][crate::model::SearchTargetPolicyBindingsRequest::parent].
1420 ///
1421 /// # Example
1422 /// ```ignore,no_run
1423 /// # use google_cloud_iam_v3::model::SearchTargetPolicyBindingsRequest;
1424 /// let x = SearchTargetPolicyBindingsRequest::new().set_parent("example");
1425 /// ```
1426 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1427 self.parent = v.into();
1428 self
1429 }
1430}
1431
1432impl wkt::message::Message for SearchTargetPolicyBindingsRequest {
1433 fn typename() -> &'static str {
1434 "type.googleapis.com/google.iam.v3.SearchTargetPolicyBindingsRequest"
1435 }
1436}
1437
1438/// Response message for SearchTargetPolicyBindings method.
1439#[derive(Clone, Default, PartialEq)]
1440#[non_exhaustive]
1441pub struct SearchTargetPolicyBindingsResponse {
1442 /// The policy bindings bound to the specified target.
1443 pub policy_bindings: std::vec::Vec<crate::model::PolicyBinding>,
1444
1445 /// Optional. A token, which can be sent as `page_token` to retrieve the next
1446 /// page. If this field is omitted, there are no subsequent pages.
1447 pub next_page_token: std::string::String,
1448
1449 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1450}
1451
1452impl SearchTargetPolicyBindingsResponse {
1453 pub fn new() -> Self {
1454 std::default::Default::default()
1455 }
1456
1457 /// Sets the value of [policy_bindings][crate::model::SearchTargetPolicyBindingsResponse::policy_bindings].
1458 ///
1459 /// # Example
1460 /// ```ignore,no_run
1461 /// # use google_cloud_iam_v3::model::SearchTargetPolicyBindingsResponse;
1462 /// use google_cloud_iam_v3::model::PolicyBinding;
1463 /// let x = SearchTargetPolicyBindingsResponse::new()
1464 /// .set_policy_bindings([
1465 /// PolicyBinding::default()/* use setters */,
1466 /// PolicyBinding::default()/* use (different) setters */,
1467 /// ]);
1468 /// ```
1469 pub fn set_policy_bindings<T, V>(mut self, v: T) -> Self
1470 where
1471 T: std::iter::IntoIterator<Item = V>,
1472 V: std::convert::Into<crate::model::PolicyBinding>,
1473 {
1474 use std::iter::Iterator;
1475 self.policy_bindings = v.into_iter().map(|i| i.into()).collect();
1476 self
1477 }
1478
1479 /// Sets the value of [next_page_token][crate::model::SearchTargetPolicyBindingsResponse::next_page_token].
1480 ///
1481 /// # Example
1482 /// ```ignore,no_run
1483 /// # use google_cloud_iam_v3::model::SearchTargetPolicyBindingsResponse;
1484 /// let x = SearchTargetPolicyBindingsResponse::new().set_next_page_token("example");
1485 /// ```
1486 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1487 self.next_page_token = v.into();
1488 self
1489 }
1490}
1491
1492impl wkt::message::Message for SearchTargetPolicyBindingsResponse {
1493 fn typename() -> &'static str {
1494 "type.googleapis.com/google.iam.v3.SearchTargetPolicyBindingsResponse"
1495 }
1496}
1497
1498#[doc(hidden)]
1499impl google_cloud_gax::paginator::internal::PageableResponse
1500 for SearchTargetPolicyBindingsResponse
1501{
1502 type PageItem = crate::model::PolicyBinding;
1503
1504 fn items(self) -> std::vec::Vec<Self::PageItem> {
1505 self.policy_bindings
1506 }
1507
1508 fn next_page_token(&self) -> std::string::String {
1509 use std::clone::Clone;
1510 self.next_page_token.clone()
1511 }
1512}
1513
1514/// Request message for CreatePrincipalAccessBoundaryPolicyRequest method.
1515#[derive(Clone, Default, PartialEq)]
1516#[non_exhaustive]
1517pub struct CreatePrincipalAccessBoundaryPolicyRequest {
1518 /// Required. The parent resource where this principal access boundary policy
1519 /// will be created. Only organizations are supported.
1520 ///
1521 /// Format:
1522 /// `organizations/{organization_id}/locations/{location}`
1523 pub parent: std::string::String,
1524
1525 /// Required. The ID to use for the principal access boundary policy, which
1526 /// will become the final component of the principal access boundary policy's
1527 /// resource name.
1528 ///
1529 /// This value must start with a lowercase letter followed by up to 62
1530 /// lowercase letters, numbers, hyphens, or dots. Pattern,
1531 /// /[a-z][a-z0-9-\.]{2,62}/.
1532 pub principal_access_boundary_policy_id: std::string::String,
1533
1534 /// Required. The principal access boundary policy to create.
1535 pub principal_access_boundary_policy:
1536 std::option::Option<crate::model::PrincipalAccessBoundaryPolicy>,
1537
1538 /// Optional. If set, validate the request and preview the creation, but do not
1539 /// actually post it.
1540 pub validate_only: bool,
1541
1542 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1543}
1544
1545impl CreatePrincipalAccessBoundaryPolicyRequest {
1546 pub fn new() -> Self {
1547 std::default::Default::default()
1548 }
1549
1550 /// Sets the value of [parent][crate::model::CreatePrincipalAccessBoundaryPolicyRequest::parent].
1551 ///
1552 /// # Example
1553 /// ```ignore,no_run
1554 /// # use google_cloud_iam_v3::model::CreatePrincipalAccessBoundaryPolicyRequest;
1555 /// let x = CreatePrincipalAccessBoundaryPolicyRequest::new().set_parent("example");
1556 /// ```
1557 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1558 self.parent = v.into();
1559 self
1560 }
1561
1562 /// Sets the value of [principal_access_boundary_policy_id][crate::model::CreatePrincipalAccessBoundaryPolicyRequest::principal_access_boundary_policy_id].
1563 ///
1564 /// # Example
1565 /// ```ignore,no_run
1566 /// # use google_cloud_iam_v3::model::CreatePrincipalAccessBoundaryPolicyRequest;
1567 /// let x = CreatePrincipalAccessBoundaryPolicyRequest::new().set_principal_access_boundary_policy_id("example");
1568 /// ```
1569 pub fn set_principal_access_boundary_policy_id<T: std::convert::Into<std::string::String>>(
1570 mut self,
1571 v: T,
1572 ) -> Self {
1573 self.principal_access_boundary_policy_id = v.into();
1574 self
1575 }
1576
1577 /// Sets the value of [principal_access_boundary_policy][crate::model::CreatePrincipalAccessBoundaryPolicyRequest::principal_access_boundary_policy].
1578 ///
1579 /// # Example
1580 /// ```ignore,no_run
1581 /// # use google_cloud_iam_v3::model::CreatePrincipalAccessBoundaryPolicyRequest;
1582 /// use google_cloud_iam_v3::model::PrincipalAccessBoundaryPolicy;
1583 /// let x = CreatePrincipalAccessBoundaryPolicyRequest::new().set_principal_access_boundary_policy(PrincipalAccessBoundaryPolicy::default()/* use setters */);
1584 /// ```
1585 pub fn set_principal_access_boundary_policy<T>(mut self, v: T) -> Self
1586 where
1587 T: std::convert::Into<crate::model::PrincipalAccessBoundaryPolicy>,
1588 {
1589 self.principal_access_boundary_policy = std::option::Option::Some(v.into());
1590 self
1591 }
1592
1593 /// Sets or clears the value of [principal_access_boundary_policy][crate::model::CreatePrincipalAccessBoundaryPolicyRequest::principal_access_boundary_policy].
1594 ///
1595 /// # Example
1596 /// ```ignore,no_run
1597 /// # use google_cloud_iam_v3::model::CreatePrincipalAccessBoundaryPolicyRequest;
1598 /// use google_cloud_iam_v3::model::PrincipalAccessBoundaryPolicy;
1599 /// let x = CreatePrincipalAccessBoundaryPolicyRequest::new().set_or_clear_principal_access_boundary_policy(Some(PrincipalAccessBoundaryPolicy::default()/* use setters */));
1600 /// let x = CreatePrincipalAccessBoundaryPolicyRequest::new().set_or_clear_principal_access_boundary_policy(None::<PrincipalAccessBoundaryPolicy>);
1601 /// ```
1602 pub fn set_or_clear_principal_access_boundary_policy<T>(
1603 mut self,
1604 v: std::option::Option<T>,
1605 ) -> Self
1606 where
1607 T: std::convert::Into<crate::model::PrincipalAccessBoundaryPolicy>,
1608 {
1609 self.principal_access_boundary_policy = v.map(|x| x.into());
1610 self
1611 }
1612
1613 /// Sets the value of [validate_only][crate::model::CreatePrincipalAccessBoundaryPolicyRequest::validate_only].
1614 ///
1615 /// # Example
1616 /// ```ignore,no_run
1617 /// # use google_cloud_iam_v3::model::CreatePrincipalAccessBoundaryPolicyRequest;
1618 /// let x = CreatePrincipalAccessBoundaryPolicyRequest::new().set_validate_only(true);
1619 /// ```
1620 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1621 self.validate_only = v.into();
1622 self
1623 }
1624}
1625
1626impl wkt::message::Message for CreatePrincipalAccessBoundaryPolicyRequest {
1627 fn typename() -> &'static str {
1628 "type.googleapis.com/google.iam.v3.CreatePrincipalAccessBoundaryPolicyRequest"
1629 }
1630}
1631
1632/// Request message for GetPrincipalAccessBoundaryPolicy method.
1633#[derive(Clone, Default, PartialEq)]
1634#[non_exhaustive]
1635pub struct GetPrincipalAccessBoundaryPolicyRequest {
1636 /// Required. The name of the principal access boundary policy to retrieve.
1637 ///
1638 /// Format:
1639 /// `organizations/{organization_id}/locations/{location}/principalAccessBoundaryPolicies/{principal_access_boundary_policy_id}`
1640 pub name: std::string::String,
1641
1642 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1643}
1644
1645impl GetPrincipalAccessBoundaryPolicyRequest {
1646 pub fn new() -> Self {
1647 std::default::Default::default()
1648 }
1649
1650 /// Sets the value of [name][crate::model::GetPrincipalAccessBoundaryPolicyRequest::name].
1651 ///
1652 /// # Example
1653 /// ```ignore,no_run
1654 /// # use google_cloud_iam_v3::model::GetPrincipalAccessBoundaryPolicyRequest;
1655 /// let x = GetPrincipalAccessBoundaryPolicyRequest::new().set_name("example");
1656 /// ```
1657 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1658 self.name = v.into();
1659 self
1660 }
1661}
1662
1663impl wkt::message::Message for GetPrincipalAccessBoundaryPolicyRequest {
1664 fn typename() -> &'static str {
1665 "type.googleapis.com/google.iam.v3.GetPrincipalAccessBoundaryPolicyRequest"
1666 }
1667}
1668
1669/// Request message for UpdatePrincipalAccessBoundaryPolicy method.
1670#[derive(Clone, Default, PartialEq)]
1671#[non_exhaustive]
1672pub struct UpdatePrincipalAccessBoundaryPolicyRequest {
1673 /// Required. The principal access boundary policy to update.
1674 ///
1675 /// The principal access boundary policy's `name` field is used to identify the
1676 /// policy to update.
1677 pub principal_access_boundary_policy:
1678 std::option::Option<crate::model::PrincipalAccessBoundaryPolicy>,
1679
1680 /// Optional. If set, validate the request and preview the update, but do not
1681 /// actually post it.
1682 pub validate_only: bool,
1683
1684 /// Optional. The list of fields to update
1685 pub update_mask: std::option::Option<wkt::FieldMask>,
1686
1687 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1688}
1689
1690impl UpdatePrincipalAccessBoundaryPolicyRequest {
1691 pub fn new() -> Self {
1692 std::default::Default::default()
1693 }
1694
1695 /// Sets the value of [principal_access_boundary_policy][crate::model::UpdatePrincipalAccessBoundaryPolicyRequest::principal_access_boundary_policy].
1696 ///
1697 /// # Example
1698 /// ```ignore,no_run
1699 /// # use google_cloud_iam_v3::model::UpdatePrincipalAccessBoundaryPolicyRequest;
1700 /// use google_cloud_iam_v3::model::PrincipalAccessBoundaryPolicy;
1701 /// let x = UpdatePrincipalAccessBoundaryPolicyRequest::new().set_principal_access_boundary_policy(PrincipalAccessBoundaryPolicy::default()/* use setters */);
1702 /// ```
1703 pub fn set_principal_access_boundary_policy<T>(mut self, v: T) -> Self
1704 where
1705 T: std::convert::Into<crate::model::PrincipalAccessBoundaryPolicy>,
1706 {
1707 self.principal_access_boundary_policy = std::option::Option::Some(v.into());
1708 self
1709 }
1710
1711 /// Sets or clears the value of [principal_access_boundary_policy][crate::model::UpdatePrincipalAccessBoundaryPolicyRequest::principal_access_boundary_policy].
1712 ///
1713 /// # Example
1714 /// ```ignore,no_run
1715 /// # use google_cloud_iam_v3::model::UpdatePrincipalAccessBoundaryPolicyRequest;
1716 /// use google_cloud_iam_v3::model::PrincipalAccessBoundaryPolicy;
1717 /// let x = UpdatePrincipalAccessBoundaryPolicyRequest::new().set_or_clear_principal_access_boundary_policy(Some(PrincipalAccessBoundaryPolicy::default()/* use setters */));
1718 /// let x = UpdatePrincipalAccessBoundaryPolicyRequest::new().set_or_clear_principal_access_boundary_policy(None::<PrincipalAccessBoundaryPolicy>);
1719 /// ```
1720 pub fn set_or_clear_principal_access_boundary_policy<T>(
1721 mut self,
1722 v: std::option::Option<T>,
1723 ) -> Self
1724 where
1725 T: std::convert::Into<crate::model::PrincipalAccessBoundaryPolicy>,
1726 {
1727 self.principal_access_boundary_policy = v.map(|x| x.into());
1728 self
1729 }
1730
1731 /// Sets the value of [validate_only][crate::model::UpdatePrincipalAccessBoundaryPolicyRequest::validate_only].
1732 ///
1733 /// # Example
1734 /// ```ignore,no_run
1735 /// # use google_cloud_iam_v3::model::UpdatePrincipalAccessBoundaryPolicyRequest;
1736 /// let x = UpdatePrincipalAccessBoundaryPolicyRequest::new().set_validate_only(true);
1737 /// ```
1738 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1739 self.validate_only = v.into();
1740 self
1741 }
1742
1743 /// Sets the value of [update_mask][crate::model::UpdatePrincipalAccessBoundaryPolicyRequest::update_mask].
1744 ///
1745 /// # Example
1746 /// ```ignore,no_run
1747 /// # use google_cloud_iam_v3::model::UpdatePrincipalAccessBoundaryPolicyRequest;
1748 /// use wkt::FieldMask;
1749 /// let x = UpdatePrincipalAccessBoundaryPolicyRequest::new().set_update_mask(FieldMask::default()/* use setters */);
1750 /// ```
1751 pub fn set_update_mask<T>(mut self, v: T) -> Self
1752 where
1753 T: std::convert::Into<wkt::FieldMask>,
1754 {
1755 self.update_mask = std::option::Option::Some(v.into());
1756 self
1757 }
1758
1759 /// Sets or clears the value of [update_mask][crate::model::UpdatePrincipalAccessBoundaryPolicyRequest::update_mask].
1760 ///
1761 /// # Example
1762 /// ```ignore,no_run
1763 /// # use google_cloud_iam_v3::model::UpdatePrincipalAccessBoundaryPolicyRequest;
1764 /// use wkt::FieldMask;
1765 /// let x = UpdatePrincipalAccessBoundaryPolicyRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
1766 /// let x = UpdatePrincipalAccessBoundaryPolicyRequest::new().set_or_clear_update_mask(None::<FieldMask>);
1767 /// ```
1768 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1769 where
1770 T: std::convert::Into<wkt::FieldMask>,
1771 {
1772 self.update_mask = v.map(|x| x.into());
1773 self
1774 }
1775}
1776
1777impl wkt::message::Message for UpdatePrincipalAccessBoundaryPolicyRequest {
1778 fn typename() -> &'static str {
1779 "type.googleapis.com/google.iam.v3.UpdatePrincipalAccessBoundaryPolicyRequest"
1780 }
1781}
1782
1783/// Request message for DeletePrincipalAccessBoundaryPolicy method.
1784#[derive(Clone, Default, PartialEq)]
1785#[non_exhaustive]
1786pub struct DeletePrincipalAccessBoundaryPolicyRequest {
1787 /// Required. The name of the principal access boundary policy to delete.
1788 ///
1789 /// Format:
1790 /// `organizations/{organization_id}/locations/{location}/principalAccessBoundaryPolicies/{principal_access_boundary_policy_id}`
1791 pub name: std::string::String,
1792
1793 /// Optional. The etag of the principal access boundary policy.
1794 /// If this is provided, it must match the server's etag.
1795 pub etag: std::string::String,
1796
1797 /// Optional. If set, validate the request and preview the deletion, but do not
1798 /// actually post it.
1799 pub validate_only: bool,
1800
1801 /// Optional. If set to true, the request will force the deletion of the policy
1802 /// even if the policy is referenced in policy bindings.
1803 pub force: bool,
1804
1805 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1806}
1807
1808impl DeletePrincipalAccessBoundaryPolicyRequest {
1809 pub fn new() -> Self {
1810 std::default::Default::default()
1811 }
1812
1813 /// Sets the value of [name][crate::model::DeletePrincipalAccessBoundaryPolicyRequest::name].
1814 ///
1815 /// # Example
1816 /// ```ignore,no_run
1817 /// # use google_cloud_iam_v3::model::DeletePrincipalAccessBoundaryPolicyRequest;
1818 /// let x = DeletePrincipalAccessBoundaryPolicyRequest::new().set_name("example");
1819 /// ```
1820 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1821 self.name = v.into();
1822 self
1823 }
1824
1825 /// Sets the value of [etag][crate::model::DeletePrincipalAccessBoundaryPolicyRequest::etag].
1826 ///
1827 /// # Example
1828 /// ```ignore,no_run
1829 /// # use google_cloud_iam_v3::model::DeletePrincipalAccessBoundaryPolicyRequest;
1830 /// let x = DeletePrincipalAccessBoundaryPolicyRequest::new().set_etag("example");
1831 /// ```
1832 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1833 self.etag = v.into();
1834 self
1835 }
1836
1837 /// Sets the value of [validate_only][crate::model::DeletePrincipalAccessBoundaryPolicyRequest::validate_only].
1838 ///
1839 /// # Example
1840 /// ```ignore,no_run
1841 /// # use google_cloud_iam_v3::model::DeletePrincipalAccessBoundaryPolicyRequest;
1842 /// let x = DeletePrincipalAccessBoundaryPolicyRequest::new().set_validate_only(true);
1843 /// ```
1844 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1845 self.validate_only = v.into();
1846 self
1847 }
1848
1849 /// Sets the value of [force][crate::model::DeletePrincipalAccessBoundaryPolicyRequest::force].
1850 ///
1851 /// # Example
1852 /// ```ignore,no_run
1853 /// # use google_cloud_iam_v3::model::DeletePrincipalAccessBoundaryPolicyRequest;
1854 /// let x = DeletePrincipalAccessBoundaryPolicyRequest::new().set_force(true);
1855 /// ```
1856 pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1857 self.force = v.into();
1858 self
1859 }
1860}
1861
1862impl wkt::message::Message for DeletePrincipalAccessBoundaryPolicyRequest {
1863 fn typename() -> &'static str {
1864 "type.googleapis.com/google.iam.v3.DeletePrincipalAccessBoundaryPolicyRequest"
1865 }
1866}
1867
1868/// Request message for ListPrincipalAccessBoundaryPolicies method.
1869#[derive(Clone, Default, PartialEq)]
1870#[non_exhaustive]
1871pub struct ListPrincipalAccessBoundaryPoliciesRequest {
1872 /// Required. The parent resource, which owns the collection of principal
1873 /// access boundary policies.
1874 ///
1875 /// Format:
1876 /// `organizations/{organization_id}/locations/{location}`
1877 pub parent: std::string::String,
1878
1879 /// Optional. The maximum number of principal access boundary policies to
1880 /// return. The service may return fewer than this value.
1881 ///
1882 /// If unspecified, at most 50 principal access boundary policies will be
1883 /// returned. The maximum value is 1000; values above 1000 will be coerced to
1884 /// 1000.
1885 pub page_size: i32,
1886
1887 /// Optional. A page token, received from a previous
1888 /// `ListPrincipalAccessBoundaryPolicies` call. Provide this to retrieve the
1889 /// subsequent page.
1890 ///
1891 /// When paginating, all other parameters provided to
1892 /// `ListPrincipalAccessBoundaryPolicies` must match the call that provided the
1893 /// page token.
1894 pub page_token: std::string::String,
1895
1896 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1897}
1898
1899impl ListPrincipalAccessBoundaryPoliciesRequest {
1900 pub fn new() -> Self {
1901 std::default::Default::default()
1902 }
1903
1904 /// Sets the value of [parent][crate::model::ListPrincipalAccessBoundaryPoliciesRequest::parent].
1905 ///
1906 /// # Example
1907 /// ```ignore,no_run
1908 /// # use google_cloud_iam_v3::model::ListPrincipalAccessBoundaryPoliciesRequest;
1909 /// let x = ListPrincipalAccessBoundaryPoliciesRequest::new().set_parent("example");
1910 /// ```
1911 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1912 self.parent = v.into();
1913 self
1914 }
1915
1916 /// Sets the value of [page_size][crate::model::ListPrincipalAccessBoundaryPoliciesRequest::page_size].
1917 ///
1918 /// # Example
1919 /// ```ignore,no_run
1920 /// # use google_cloud_iam_v3::model::ListPrincipalAccessBoundaryPoliciesRequest;
1921 /// let x = ListPrincipalAccessBoundaryPoliciesRequest::new().set_page_size(42);
1922 /// ```
1923 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1924 self.page_size = v.into();
1925 self
1926 }
1927
1928 /// Sets the value of [page_token][crate::model::ListPrincipalAccessBoundaryPoliciesRequest::page_token].
1929 ///
1930 /// # Example
1931 /// ```ignore,no_run
1932 /// # use google_cloud_iam_v3::model::ListPrincipalAccessBoundaryPoliciesRequest;
1933 /// let x = ListPrincipalAccessBoundaryPoliciesRequest::new().set_page_token("example");
1934 /// ```
1935 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1936 self.page_token = v.into();
1937 self
1938 }
1939}
1940
1941impl wkt::message::Message for ListPrincipalAccessBoundaryPoliciesRequest {
1942 fn typename() -> &'static str {
1943 "type.googleapis.com/google.iam.v3.ListPrincipalAccessBoundaryPoliciesRequest"
1944 }
1945}
1946
1947/// Response message for ListPrincipalAccessBoundaryPolicies method.
1948#[derive(Clone, Default, PartialEq)]
1949#[non_exhaustive]
1950pub struct ListPrincipalAccessBoundaryPoliciesResponse {
1951 /// The principal access boundary policies from the specified parent.
1952 pub principal_access_boundary_policies:
1953 std::vec::Vec<crate::model::PrincipalAccessBoundaryPolicy>,
1954
1955 /// Optional. A token, which can be sent as `page_token` to retrieve the next
1956 /// page. If this field is omitted, there are no subsequent pages.
1957 pub next_page_token: std::string::String,
1958
1959 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1960}
1961
1962impl ListPrincipalAccessBoundaryPoliciesResponse {
1963 pub fn new() -> Self {
1964 std::default::Default::default()
1965 }
1966
1967 /// Sets the value of [principal_access_boundary_policies][crate::model::ListPrincipalAccessBoundaryPoliciesResponse::principal_access_boundary_policies].
1968 ///
1969 /// # Example
1970 /// ```ignore,no_run
1971 /// # use google_cloud_iam_v3::model::ListPrincipalAccessBoundaryPoliciesResponse;
1972 /// use google_cloud_iam_v3::model::PrincipalAccessBoundaryPolicy;
1973 /// let x = ListPrincipalAccessBoundaryPoliciesResponse::new()
1974 /// .set_principal_access_boundary_policies([
1975 /// PrincipalAccessBoundaryPolicy::default()/* use setters */,
1976 /// PrincipalAccessBoundaryPolicy::default()/* use (different) setters */,
1977 /// ]);
1978 /// ```
1979 pub fn set_principal_access_boundary_policies<T, V>(mut self, v: T) -> Self
1980 where
1981 T: std::iter::IntoIterator<Item = V>,
1982 V: std::convert::Into<crate::model::PrincipalAccessBoundaryPolicy>,
1983 {
1984 use std::iter::Iterator;
1985 self.principal_access_boundary_policies = v.into_iter().map(|i| i.into()).collect();
1986 self
1987 }
1988
1989 /// Sets the value of [next_page_token][crate::model::ListPrincipalAccessBoundaryPoliciesResponse::next_page_token].
1990 ///
1991 /// # Example
1992 /// ```ignore,no_run
1993 /// # use google_cloud_iam_v3::model::ListPrincipalAccessBoundaryPoliciesResponse;
1994 /// let x = ListPrincipalAccessBoundaryPoliciesResponse::new().set_next_page_token("example");
1995 /// ```
1996 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1997 self.next_page_token = v.into();
1998 self
1999 }
2000}
2001
2002impl wkt::message::Message for ListPrincipalAccessBoundaryPoliciesResponse {
2003 fn typename() -> &'static str {
2004 "type.googleapis.com/google.iam.v3.ListPrincipalAccessBoundaryPoliciesResponse"
2005 }
2006}
2007
2008#[doc(hidden)]
2009impl google_cloud_gax::paginator::internal::PageableResponse
2010 for ListPrincipalAccessBoundaryPoliciesResponse
2011{
2012 type PageItem = crate::model::PrincipalAccessBoundaryPolicy;
2013
2014 fn items(self) -> std::vec::Vec<Self::PageItem> {
2015 self.principal_access_boundary_policies
2016 }
2017
2018 fn next_page_token(&self) -> std::string::String {
2019 use std::clone::Clone;
2020 self.next_page_token.clone()
2021 }
2022}
2023
2024/// Request message for SearchPrincipalAccessBoundaryPolicyBindings rpc.
2025#[derive(Clone, Default, PartialEq)]
2026#[non_exhaustive]
2027pub struct SearchPrincipalAccessBoundaryPolicyBindingsRequest {
2028 /// Required. The name of the principal access boundary policy.
2029 /// Format:
2030 /// `organizations/{organization_id}/locations/{location}/principalAccessBoundaryPolicies/{principal_access_boundary_policy_id}`
2031 pub name: std::string::String,
2032
2033 /// Optional. The maximum number of policy bindings to return. The service may
2034 /// return fewer than this value.
2035 ///
2036 /// If unspecified, at most 50 policy bindings will be returned.
2037 /// The maximum value is 1000; values above 1000 will be coerced to 1000.
2038 pub page_size: i32,
2039
2040 /// Optional. A page token, received from a previous
2041 /// `SearchPrincipalAccessBoundaryPolicyBindingsRequest` call. Provide this to
2042 /// retrieve the subsequent page.
2043 ///
2044 /// When paginating, all other parameters provided to
2045 /// `SearchPrincipalAccessBoundaryPolicyBindingsRequest` must match the call
2046 /// that provided the page token.
2047 pub page_token: std::string::String,
2048
2049 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2050}
2051
2052impl SearchPrincipalAccessBoundaryPolicyBindingsRequest {
2053 pub fn new() -> Self {
2054 std::default::Default::default()
2055 }
2056
2057 /// Sets the value of [name][crate::model::SearchPrincipalAccessBoundaryPolicyBindingsRequest::name].
2058 ///
2059 /// # Example
2060 /// ```ignore,no_run
2061 /// # use google_cloud_iam_v3::model::SearchPrincipalAccessBoundaryPolicyBindingsRequest;
2062 /// let x = SearchPrincipalAccessBoundaryPolicyBindingsRequest::new().set_name("example");
2063 /// ```
2064 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2065 self.name = v.into();
2066 self
2067 }
2068
2069 /// Sets the value of [page_size][crate::model::SearchPrincipalAccessBoundaryPolicyBindingsRequest::page_size].
2070 ///
2071 /// # Example
2072 /// ```ignore,no_run
2073 /// # use google_cloud_iam_v3::model::SearchPrincipalAccessBoundaryPolicyBindingsRequest;
2074 /// let x = SearchPrincipalAccessBoundaryPolicyBindingsRequest::new().set_page_size(42);
2075 /// ```
2076 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2077 self.page_size = v.into();
2078 self
2079 }
2080
2081 /// Sets the value of [page_token][crate::model::SearchPrincipalAccessBoundaryPolicyBindingsRequest::page_token].
2082 ///
2083 /// # Example
2084 /// ```ignore,no_run
2085 /// # use google_cloud_iam_v3::model::SearchPrincipalAccessBoundaryPolicyBindingsRequest;
2086 /// let x = SearchPrincipalAccessBoundaryPolicyBindingsRequest::new().set_page_token("example");
2087 /// ```
2088 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2089 self.page_token = v.into();
2090 self
2091 }
2092}
2093
2094impl wkt::message::Message for SearchPrincipalAccessBoundaryPolicyBindingsRequest {
2095 fn typename() -> &'static str {
2096 "type.googleapis.com/google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsRequest"
2097 }
2098}
2099
2100/// Response message for SearchPrincipalAccessBoundaryPolicyBindings rpc.
2101#[derive(Clone, Default, PartialEq)]
2102#[non_exhaustive]
2103pub struct SearchPrincipalAccessBoundaryPolicyBindingsResponse {
2104 /// The policy bindings that reference the specified policy.
2105 pub policy_bindings: std::vec::Vec<crate::model::PolicyBinding>,
2106
2107 /// Optional. A token, which can be sent as `page_token` to retrieve the next
2108 /// page. If this field is omitted, there are no subsequent pages.
2109 pub next_page_token: std::string::String,
2110
2111 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2112}
2113
2114impl SearchPrincipalAccessBoundaryPolicyBindingsResponse {
2115 pub fn new() -> Self {
2116 std::default::Default::default()
2117 }
2118
2119 /// Sets the value of [policy_bindings][crate::model::SearchPrincipalAccessBoundaryPolicyBindingsResponse::policy_bindings].
2120 ///
2121 /// # Example
2122 /// ```ignore,no_run
2123 /// # use google_cloud_iam_v3::model::SearchPrincipalAccessBoundaryPolicyBindingsResponse;
2124 /// use google_cloud_iam_v3::model::PolicyBinding;
2125 /// let x = SearchPrincipalAccessBoundaryPolicyBindingsResponse::new()
2126 /// .set_policy_bindings([
2127 /// PolicyBinding::default()/* use setters */,
2128 /// PolicyBinding::default()/* use (different) setters */,
2129 /// ]);
2130 /// ```
2131 pub fn set_policy_bindings<T, V>(mut self, v: T) -> Self
2132 where
2133 T: std::iter::IntoIterator<Item = V>,
2134 V: std::convert::Into<crate::model::PolicyBinding>,
2135 {
2136 use std::iter::Iterator;
2137 self.policy_bindings = v.into_iter().map(|i| i.into()).collect();
2138 self
2139 }
2140
2141 /// Sets the value of [next_page_token][crate::model::SearchPrincipalAccessBoundaryPolicyBindingsResponse::next_page_token].
2142 ///
2143 /// # Example
2144 /// ```ignore,no_run
2145 /// # use google_cloud_iam_v3::model::SearchPrincipalAccessBoundaryPolicyBindingsResponse;
2146 /// let x = SearchPrincipalAccessBoundaryPolicyBindingsResponse::new().set_next_page_token("example");
2147 /// ```
2148 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2149 self.next_page_token = v.into();
2150 self
2151 }
2152}
2153
2154impl wkt::message::Message for SearchPrincipalAccessBoundaryPolicyBindingsResponse {
2155 fn typename() -> &'static str {
2156 "type.googleapis.com/google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsResponse"
2157 }
2158}
2159
2160#[doc(hidden)]
2161impl google_cloud_gax::paginator::internal::PageableResponse
2162 for SearchPrincipalAccessBoundaryPolicyBindingsResponse
2163{
2164 type PageItem = crate::model::PolicyBinding;
2165
2166 fn items(self) -> std::vec::Vec<Self::PageItem> {
2167 self.policy_bindings
2168 }
2169
2170 fn next_page_token(&self) -> std::string::String {
2171 use std::clone::Clone;
2172 self.next_page_token.clone()
2173 }
2174}
2175
2176/// An IAM principal access boundary policy resource.
2177#[derive(Clone, Default, PartialEq)]
2178#[non_exhaustive]
2179pub struct PrincipalAccessBoundaryPolicy {
2180 /// Identifier. The resource name of the principal access boundary policy.
2181 ///
2182 /// The following format is supported:
2183 /// `organizations/{organization_id}/locations/{location}/principalAccessBoundaryPolicies/{policy_id}`
2184 pub name: std::string::String,
2185
2186 /// Output only. The globally unique ID of the principal access boundary
2187 /// policy.
2188 pub uid: std::string::String,
2189
2190 /// Optional. The etag for the principal access boundary.
2191 /// If this is provided on update, it must match the server's etag.
2192 pub etag: std::string::String,
2193
2194 /// Optional. The description of the principal access boundary policy. Must be
2195 /// less than or equal to 63 characters.
2196 pub display_name: std::string::String,
2197
2198 /// Optional. User defined annotations. See
2199 /// <https://google.aip.dev/148#annotations> for more details such as format and
2200 /// size limitations
2201 pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
2202
2203 /// Output only. The time when the principal access boundary policy was
2204 /// created.
2205 pub create_time: std::option::Option<wkt::Timestamp>,
2206
2207 /// Output only. The time when the principal access boundary policy was most
2208 /// recently updated.
2209 pub update_time: std::option::Option<wkt::Timestamp>,
2210
2211 /// Optional. The details for the principal access boundary policy.
2212 pub details: std::option::Option<crate::model::PrincipalAccessBoundaryPolicyDetails>,
2213
2214 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2215}
2216
2217impl PrincipalAccessBoundaryPolicy {
2218 pub fn new() -> Self {
2219 std::default::Default::default()
2220 }
2221
2222 /// Sets the value of [name][crate::model::PrincipalAccessBoundaryPolicy::name].
2223 ///
2224 /// # Example
2225 /// ```ignore,no_run
2226 /// # use google_cloud_iam_v3::model::PrincipalAccessBoundaryPolicy;
2227 /// let x = PrincipalAccessBoundaryPolicy::new().set_name("example");
2228 /// ```
2229 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2230 self.name = v.into();
2231 self
2232 }
2233
2234 /// Sets the value of [uid][crate::model::PrincipalAccessBoundaryPolicy::uid].
2235 ///
2236 /// # Example
2237 /// ```ignore,no_run
2238 /// # use google_cloud_iam_v3::model::PrincipalAccessBoundaryPolicy;
2239 /// let x = PrincipalAccessBoundaryPolicy::new().set_uid("example");
2240 /// ```
2241 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2242 self.uid = v.into();
2243 self
2244 }
2245
2246 /// Sets the value of [etag][crate::model::PrincipalAccessBoundaryPolicy::etag].
2247 ///
2248 /// # Example
2249 /// ```ignore,no_run
2250 /// # use google_cloud_iam_v3::model::PrincipalAccessBoundaryPolicy;
2251 /// let x = PrincipalAccessBoundaryPolicy::new().set_etag("example");
2252 /// ```
2253 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2254 self.etag = v.into();
2255 self
2256 }
2257
2258 /// Sets the value of [display_name][crate::model::PrincipalAccessBoundaryPolicy::display_name].
2259 ///
2260 /// # Example
2261 /// ```ignore,no_run
2262 /// # use google_cloud_iam_v3::model::PrincipalAccessBoundaryPolicy;
2263 /// let x = PrincipalAccessBoundaryPolicy::new().set_display_name("example");
2264 /// ```
2265 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2266 self.display_name = v.into();
2267 self
2268 }
2269
2270 /// Sets the value of [annotations][crate::model::PrincipalAccessBoundaryPolicy::annotations].
2271 ///
2272 /// # Example
2273 /// ```ignore,no_run
2274 /// # use google_cloud_iam_v3::model::PrincipalAccessBoundaryPolicy;
2275 /// let x = PrincipalAccessBoundaryPolicy::new().set_annotations([
2276 /// ("key0", "abc"),
2277 /// ("key1", "xyz"),
2278 /// ]);
2279 /// ```
2280 pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
2281 where
2282 T: std::iter::IntoIterator<Item = (K, V)>,
2283 K: std::convert::Into<std::string::String>,
2284 V: std::convert::Into<std::string::String>,
2285 {
2286 use std::iter::Iterator;
2287 self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
2288 self
2289 }
2290
2291 /// Sets the value of [create_time][crate::model::PrincipalAccessBoundaryPolicy::create_time].
2292 ///
2293 /// # Example
2294 /// ```ignore,no_run
2295 /// # use google_cloud_iam_v3::model::PrincipalAccessBoundaryPolicy;
2296 /// use wkt::Timestamp;
2297 /// let x = PrincipalAccessBoundaryPolicy::new().set_create_time(Timestamp::default()/* use setters */);
2298 /// ```
2299 pub fn set_create_time<T>(mut self, v: T) -> Self
2300 where
2301 T: std::convert::Into<wkt::Timestamp>,
2302 {
2303 self.create_time = std::option::Option::Some(v.into());
2304 self
2305 }
2306
2307 /// Sets or clears the value of [create_time][crate::model::PrincipalAccessBoundaryPolicy::create_time].
2308 ///
2309 /// # Example
2310 /// ```ignore,no_run
2311 /// # use google_cloud_iam_v3::model::PrincipalAccessBoundaryPolicy;
2312 /// use wkt::Timestamp;
2313 /// let x = PrincipalAccessBoundaryPolicy::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
2314 /// let x = PrincipalAccessBoundaryPolicy::new().set_or_clear_create_time(None::<Timestamp>);
2315 /// ```
2316 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
2317 where
2318 T: std::convert::Into<wkt::Timestamp>,
2319 {
2320 self.create_time = v.map(|x| x.into());
2321 self
2322 }
2323
2324 /// Sets the value of [update_time][crate::model::PrincipalAccessBoundaryPolicy::update_time].
2325 ///
2326 /// # Example
2327 /// ```ignore,no_run
2328 /// # use google_cloud_iam_v3::model::PrincipalAccessBoundaryPolicy;
2329 /// use wkt::Timestamp;
2330 /// let x = PrincipalAccessBoundaryPolicy::new().set_update_time(Timestamp::default()/* use setters */);
2331 /// ```
2332 pub fn set_update_time<T>(mut self, v: T) -> Self
2333 where
2334 T: std::convert::Into<wkt::Timestamp>,
2335 {
2336 self.update_time = std::option::Option::Some(v.into());
2337 self
2338 }
2339
2340 /// Sets or clears the value of [update_time][crate::model::PrincipalAccessBoundaryPolicy::update_time].
2341 ///
2342 /// # Example
2343 /// ```ignore,no_run
2344 /// # use google_cloud_iam_v3::model::PrincipalAccessBoundaryPolicy;
2345 /// use wkt::Timestamp;
2346 /// let x = PrincipalAccessBoundaryPolicy::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
2347 /// let x = PrincipalAccessBoundaryPolicy::new().set_or_clear_update_time(None::<Timestamp>);
2348 /// ```
2349 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
2350 where
2351 T: std::convert::Into<wkt::Timestamp>,
2352 {
2353 self.update_time = v.map(|x| x.into());
2354 self
2355 }
2356
2357 /// Sets the value of [details][crate::model::PrincipalAccessBoundaryPolicy::details].
2358 ///
2359 /// # Example
2360 /// ```ignore,no_run
2361 /// # use google_cloud_iam_v3::model::PrincipalAccessBoundaryPolicy;
2362 /// use google_cloud_iam_v3::model::PrincipalAccessBoundaryPolicyDetails;
2363 /// let x = PrincipalAccessBoundaryPolicy::new().set_details(PrincipalAccessBoundaryPolicyDetails::default()/* use setters */);
2364 /// ```
2365 pub fn set_details<T>(mut self, v: T) -> Self
2366 where
2367 T: std::convert::Into<crate::model::PrincipalAccessBoundaryPolicyDetails>,
2368 {
2369 self.details = std::option::Option::Some(v.into());
2370 self
2371 }
2372
2373 /// Sets or clears the value of [details][crate::model::PrincipalAccessBoundaryPolicy::details].
2374 ///
2375 /// # Example
2376 /// ```ignore,no_run
2377 /// # use google_cloud_iam_v3::model::PrincipalAccessBoundaryPolicy;
2378 /// use google_cloud_iam_v3::model::PrincipalAccessBoundaryPolicyDetails;
2379 /// let x = PrincipalAccessBoundaryPolicy::new().set_or_clear_details(Some(PrincipalAccessBoundaryPolicyDetails::default()/* use setters */));
2380 /// let x = PrincipalAccessBoundaryPolicy::new().set_or_clear_details(None::<PrincipalAccessBoundaryPolicyDetails>);
2381 /// ```
2382 pub fn set_or_clear_details<T>(mut self, v: std::option::Option<T>) -> Self
2383 where
2384 T: std::convert::Into<crate::model::PrincipalAccessBoundaryPolicyDetails>,
2385 {
2386 self.details = v.map(|x| x.into());
2387 self
2388 }
2389}
2390
2391impl wkt::message::Message for PrincipalAccessBoundaryPolicy {
2392 fn typename() -> &'static str {
2393 "type.googleapis.com/google.iam.v3.PrincipalAccessBoundaryPolicy"
2394 }
2395}
2396
2397/// Principal access boundary policy details
2398#[derive(Clone, Default, PartialEq)]
2399#[non_exhaustive]
2400pub struct PrincipalAccessBoundaryPolicyDetails {
2401 /// Required. A list of principal access boundary policy rules. The number of
2402 /// rules in a policy is limited to 500.
2403 pub rules: std::vec::Vec<crate::model::PrincipalAccessBoundaryPolicyRule>,
2404
2405 /// Optional.
2406 /// The version number (for example, `1` or `latest`) that indicates which
2407 /// permissions are able to be blocked by the policy. If empty, the PAB policy
2408 /// version will be set to the most recent version number at the time of the
2409 /// policy's creation.
2410 pub enforcement_version: std::string::String,
2411
2412 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2413}
2414
2415impl PrincipalAccessBoundaryPolicyDetails {
2416 pub fn new() -> Self {
2417 std::default::Default::default()
2418 }
2419
2420 /// Sets the value of [rules][crate::model::PrincipalAccessBoundaryPolicyDetails::rules].
2421 ///
2422 /// # Example
2423 /// ```ignore,no_run
2424 /// # use google_cloud_iam_v3::model::PrincipalAccessBoundaryPolicyDetails;
2425 /// use google_cloud_iam_v3::model::PrincipalAccessBoundaryPolicyRule;
2426 /// let x = PrincipalAccessBoundaryPolicyDetails::new()
2427 /// .set_rules([
2428 /// PrincipalAccessBoundaryPolicyRule::default()/* use setters */,
2429 /// PrincipalAccessBoundaryPolicyRule::default()/* use (different) setters */,
2430 /// ]);
2431 /// ```
2432 pub fn set_rules<T, V>(mut self, v: T) -> Self
2433 where
2434 T: std::iter::IntoIterator<Item = V>,
2435 V: std::convert::Into<crate::model::PrincipalAccessBoundaryPolicyRule>,
2436 {
2437 use std::iter::Iterator;
2438 self.rules = v.into_iter().map(|i| i.into()).collect();
2439 self
2440 }
2441
2442 /// Sets the value of [enforcement_version][crate::model::PrincipalAccessBoundaryPolicyDetails::enforcement_version].
2443 ///
2444 /// # Example
2445 /// ```ignore,no_run
2446 /// # use google_cloud_iam_v3::model::PrincipalAccessBoundaryPolicyDetails;
2447 /// let x = PrincipalAccessBoundaryPolicyDetails::new().set_enforcement_version("example");
2448 /// ```
2449 pub fn set_enforcement_version<T: std::convert::Into<std::string::String>>(
2450 mut self,
2451 v: T,
2452 ) -> Self {
2453 self.enforcement_version = v.into();
2454 self
2455 }
2456}
2457
2458impl wkt::message::Message for PrincipalAccessBoundaryPolicyDetails {
2459 fn typename() -> &'static str {
2460 "type.googleapis.com/google.iam.v3.PrincipalAccessBoundaryPolicyDetails"
2461 }
2462}
2463
2464/// Principal access boundary policy rule that defines the resource boundary.
2465#[derive(Clone, Default, PartialEq)]
2466#[non_exhaustive]
2467pub struct PrincipalAccessBoundaryPolicyRule {
2468 /// Optional. The description of the principal access boundary policy rule.
2469 /// Must be less than or equal to 256 characters.
2470 pub description: std::string::String,
2471
2472 /// Required. A list of Resource Manager resources. If a resource is listed in
2473 /// the rule, then the rule applies for that resource and its descendants. The
2474 /// number of resources in a policy is limited to 500 across all rules in the
2475 /// policy.
2476 ///
2477 /// The following resource types are supported:
2478 ///
2479 /// * Organizations, such as
2480 /// `//cloudresourcemanager.googleapis.com/organizations/123`.
2481 /// * Folders, such as `//cloudresourcemanager.googleapis.com/folders/123`.
2482 /// * Projects, such as `//cloudresourcemanager.googleapis.com/projects/123`
2483 /// or `//cloudresourcemanager.googleapis.com/projects/my-project-id`.
2484 pub resources: std::vec::Vec<std::string::String>,
2485
2486 /// Required. The access relationship of principals to the resources in this
2487 /// rule.
2488 pub effect: crate::model::principal_access_boundary_policy_rule::Effect,
2489
2490 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2491}
2492
2493impl PrincipalAccessBoundaryPolicyRule {
2494 pub fn new() -> Self {
2495 std::default::Default::default()
2496 }
2497
2498 /// Sets the value of [description][crate::model::PrincipalAccessBoundaryPolicyRule::description].
2499 ///
2500 /// # Example
2501 /// ```ignore,no_run
2502 /// # use google_cloud_iam_v3::model::PrincipalAccessBoundaryPolicyRule;
2503 /// let x = PrincipalAccessBoundaryPolicyRule::new().set_description("example");
2504 /// ```
2505 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2506 self.description = v.into();
2507 self
2508 }
2509
2510 /// Sets the value of [resources][crate::model::PrincipalAccessBoundaryPolicyRule::resources].
2511 ///
2512 /// # Example
2513 /// ```ignore,no_run
2514 /// # use google_cloud_iam_v3::model::PrincipalAccessBoundaryPolicyRule;
2515 /// let x = PrincipalAccessBoundaryPolicyRule::new().set_resources(["a", "b", "c"]);
2516 /// ```
2517 pub fn set_resources<T, V>(mut self, v: T) -> Self
2518 where
2519 T: std::iter::IntoIterator<Item = V>,
2520 V: std::convert::Into<std::string::String>,
2521 {
2522 use std::iter::Iterator;
2523 self.resources = v.into_iter().map(|i| i.into()).collect();
2524 self
2525 }
2526
2527 /// Sets the value of [effect][crate::model::PrincipalAccessBoundaryPolicyRule::effect].
2528 ///
2529 /// # Example
2530 /// ```ignore,no_run
2531 /// # use google_cloud_iam_v3::model::PrincipalAccessBoundaryPolicyRule;
2532 /// use google_cloud_iam_v3::model::principal_access_boundary_policy_rule::Effect;
2533 /// let x0 = PrincipalAccessBoundaryPolicyRule::new().set_effect(Effect::Allow);
2534 /// ```
2535 pub fn set_effect<
2536 T: std::convert::Into<crate::model::principal_access_boundary_policy_rule::Effect>,
2537 >(
2538 mut self,
2539 v: T,
2540 ) -> Self {
2541 self.effect = v.into();
2542 self
2543 }
2544}
2545
2546impl wkt::message::Message for PrincipalAccessBoundaryPolicyRule {
2547 fn typename() -> &'static str {
2548 "type.googleapis.com/google.iam.v3.PrincipalAccessBoundaryPolicyRule"
2549 }
2550}
2551
2552/// Defines additional types related to [PrincipalAccessBoundaryPolicyRule].
2553pub mod principal_access_boundary_policy_rule {
2554 #[allow(unused_imports)]
2555 use super::*;
2556
2557 /// An effect to describe the access relationship.
2558 ///
2559 /// # Working with unknown values
2560 ///
2561 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2562 /// additional enum variants at any time. Adding new variants is not considered
2563 /// a breaking change. Applications should write their code in anticipation of:
2564 ///
2565 /// - New values appearing in future releases of the client library, **and**
2566 /// - New values received dynamically, without application changes.
2567 ///
2568 /// Please consult the [Working with enums] section in the user guide for some
2569 /// guidelines.
2570 ///
2571 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
2572 #[derive(Clone, Debug, PartialEq)]
2573 #[non_exhaustive]
2574 pub enum Effect {
2575 /// Effect unspecified.
2576 Unspecified,
2577 /// Allows access to the resources in this rule.
2578 Allow,
2579 /// If set, the enum was initialized with an unknown value.
2580 ///
2581 /// Applications can examine the value using [Effect::value] or
2582 /// [Effect::name].
2583 UnknownValue(effect::UnknownValue),
2584 }
2585
2586 #[doc(hidden)]
2587 pub mod effect {
2588 #[allow(unused_imports)]
2589 use super::*;
2590 #[derive(Clone, Debug, PartialEq)]
2591 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2592 }
2593
2594 impl Effect {
2595 /// Gets the enum value.
2596 ///
2597 /// Returns `None` if the enum contains an unknown value deserialized from
2598 /// the string representation of enums.
2599 pub fn value(&self) -> std::option::Option<i32> {
2600 match self {
2601 Self::Unspecified => std::option::Option::Some(0),
2602 Self::Allow => std::option::Option::Some(1),
2603 Self::UnknownValue(u) => u.0.value(),
2604 }
2605 }
2606
2607 /// Gets the enum value as a string.
2608 ///
2609 /// Returns `None` if the enum contains an unknown value deserialized from
2610 /// the integer representation of enums.
2611 pub fn name(&self) -> std::option::Option<&str> {
2612 match self {
2613 Self::Unspecified => std::option::Option::Some("EFFECT_UNSPECIFIED"),
2614 Self::Allow => std::option::Option::Some("ALLOW"),
2615 Self::UnknownValue(u) => u.0.name(),
2616 }
2617 }
2618 }
2619
2620 impl std::default::Default for Effect {
2621 fn default() -> Self {
2622 use std::convert::From;
2623 Self::from(0)
2624 }
2625 }
2626
2627 impl std::fmt::Display for Effect {
2628 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2629 wkt::internal::display_enum(f, self.name(), self.value())
2630 }
2631 }
2632
2633 impl std::convert::From<i32> for Effect {
2634 fn from(value: i32) -> Self {
2635 match value {
2636 0 => Self::Unspecified,
2637 1 => Self::Allow,
2638 _ => Self::UnknownValue(effect::UnknownValue(
2639 wkt::internal::UnknownEnumValue::Integer(value),
2640 )),
2641 }
2642 }
2643 }
2644
2645 impl std::convert::From<&str> for Effect {
2646 fn from(value: &str) -> Self {
2647 use std::string::ToString;
2648 match value {
2649 "EFFECT_UNSPECIFIED" => Self::Unspecified,
2650 "ALLOW" => Self::Allow,
2651 _ => Self::UnknownValue(effect::UnknownValue(
2652 wkt::internal::UnknownEnumValue::String(value.to_string()),
2653 )),
2654 }
2655 }
2656 }
2657
2658 impl serde::ser::Serialize for Effect {
2659 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2660 where
2661 S: serde::Serializer,
2662 {
2663 match self {
2664 Self::Unspecified => serializer.serialize_i32(0),
2665 Self::Allow => serializer.serialize_i32(1),
2666 Self::UnknownValue(u) => u.0.serialize(serializer),
2667 }
2668 }
2669 }
2670
2671 impl<'de> serde::de::Deserialize<'de> for Effect {
2672 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2673 where
2674 D: serde::Deserializer<'de>,
2675 {
2676 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Effect>::new(
2677 ".google.iam.v3.PrincipalAccessBoundaryPolicyRule.Effect",
2678 ))
2679 }
2680 }
2681}