#[non_exhaustive]pub struct PolicyBinding {
pub name: String,
pub uid: String,
pub etag: String,
pub display_name: String,
pub annotations: HashMap<String, String>,
pub target: Option<Target>,
pub policy_kind: PolicyKind,
pub policy: String,
pub policy_uid: String,
pub condition: Option<Expr>,
pub create_time: Option<Timestamp>,
pub update_time: Option<Timestamp>,
/* private fields */
}Expand description
IAM policy binding resource.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.name: StringIdentifier. The name of the policy binding, in the format
{binding_parent/locations/{location}/policyBindings/{policy_binding_id}.
The binding parent is the closest Resource Manager resource (project,
folder, or organization) to the binding target.
Format:
projects/{project_id}/locations/{location}/policyBindings/{policy_binding_id}projects/{project_number}/locations/{location}/policyBindings/{policy_binding_id}folders/{folder_id}/locations/{location}/policyBindings/{policy_binding_id}organizations/{organization_id}/locations/{location}/policyBindings/{policy_binding_id}
uid: StringOutput only. The globally unique ID of the policy binding. Assigned when the policy binding is created.
etag: StringOptional. The etag for the policy binding. If this is provided on update, it must match the server’s etag.
display_name: StringOptional. The description of the policy binding. Must be less than or equal to 63 characters.
annotations: HashMap<String, String>Optional. User-defined annotations. See https://google.aip.dev/148#annotations for more details such as format and size limitations
target: Option<Target>Required. Immutable. Target is the full resource name of the resource to which the policy will be bound. Immutable once set.
policy_kind: PolicyKindImmutable. The kind of the policy to attach in this binding. This field must be one of the following:
- Left empty (will be automatically set to the policy kind)
- The input policy kind
policy: StringRequired. Immutable. The resource name of the policy to be bound. The binding parent and policy must belong to the same organization.
policy_uid: StringOutput only. The globally unique ID of the policy to be bound.
condition: Option<Expr>Optional. The condition to apply to the policy binding. When set, the
expression field in the Expr must include from 1 to 10 subexpressions,
joined by the
“||”(Logical OR), “&&”(Logical AND) or “!”(Logical NOT) operators and
cannot contain more than 250 characters.
The condition is currently only supported when bound to policies of kind principal access boundary.
When the bound policy is a principal access boundary policy, the only
supported attributes in any subexpression are principal.type and
principal.subject. An example expression is: “principal.type ==
‘iam.googleapis.com/ServiceAccount’” or “principal.subject ==
‘bob@example.com’”.
Allowed operations for principal.subject:
principal.subject == <principal subject string>principal.subject != <principal subject string>principal.subject in [<list of principal subjects>]principal.subject.startsWith(<string>)principal.subject.endsWith(<string>)
Allowed operations for principal.type:
principal.type == <principal type string>principal.type != <principal type string>principal.type in [<list of principal types>]
Supported principal types are Workspace, Workforce Pool, Workload Pool and Service Account. Allowed string must be one of:
- iam.googleapis.com/WorkspaceIdentity
- iam.googleapis.com/WorkforcePoolIdentity
- iam.googleapis.com/WorkloadPoolIdentity
- iam.googleapis.com/ServiceAccount
create_time: Option<Timestamp>Output only. The time when the policy binding was created.
update_time: Option<Timestamp>Output only. The time when the policy binding was most recently updated.
Implementations§
Source§impl PolicyBinding
impl PolicyBinding
pub fn new() -> Self
Sourcepub fn set_display_name<T: Into<String>>(self, v: T) -> Self
pub fn set_display_name<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_annotations<T, K, V>(self, v: T) -> Self
pub fn set_annotations<T, K, V>(self, v: T) -> Self
Sets the value of annotations.
§Example
let x = PolicyBinding::new().set_annotations([
("key0", "abc"),
("key1", "xyz"),
]);Sourcepub fn set_target<T>(self, v: T) -> Self
pub fn set_target<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_target<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_target<T>(self, v: Option<T>) -> Self
Sourcepub fn set_policy_kind<T: Into<PolicyKind>>(self, v: T) -> Self
pub fn set_policy_kind<T: Into<PolicyKind>>(self, v: T) -> Self
Sets the value of policy_kind.
§Example
use google_cloud_iam_v3::model::policy_binding::PolicyKind;
let x0 = PolicyBinding::new().set_policy_kind(PolicyKind::PrincipalAccessBoundary);Sourcepub fn set_policy<T: Into<String>>(self, v: T) -> Self
pub fn set_policy<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_policy_uid<T: Into<String>>(self, v: T) -> Self
pub fn set_policy_uid<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_condition<T>(self, v: T) -> Self
pub fn set_condition<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_condition<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_condition<T>(self, v: Option<T>) -> Self
Sourcepub fn set_create_time<T>(self, v: T) -> Self
pub fn set_create_time<T>(self, v: T) -> Self
Sets the value of create_time.
§Example
use wkt::Timestamp;
let x = PolicyBinding::new().set_create_time(Timestamp::default()/* use setters */);Sourcepub fn set_or_clear_create_time<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_create_time<T>(self, v: Option<T>) -> Self
Sets or clears the value of create_time.
§Example
use wkt::Timestamp;
let x = PolicyBinding::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
let x = PolicyBinding::new().set_or_clear_create_time(None::<Timestamp>);Sourcepub fn set_update_time<T>(self, v: T) -> Self
pub fn set_update_time<T>(self, v: T) -> Self
Sets the value of update_time.
§Example
use wkt::Timestamp;
let x = PolicyBinding::new().set_update_time(Timestamp::default()/* use setters */);Sourcepub fn set_or_clear_update_time<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_update_time<T>(self, v: Option<T>) -> Self
Sets or clears the value of update_time.
§Example
use wkt::Timestamp;
let x = PolicyBinding::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
let x = PolicyBinding::new().set_or_clear_update_time(None::<Timestamp>);Trait Implementations§
Source§impl Clone for PolicyBinding
impl Clone for PolicyBinding
Source§fn clone(&self) -> PolicyBinding
fn clone(&self) -> PolicyBinding
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more