Modifier | Constructor and Description |
---|---|
protected |
Builder() |
protected |
Builder(Policy policy) |
Modifier and Type | Method and Description |
---|---|
Policy.Builder |
addIdentity(Role role,
Identity first,
Identity... others)
Adds one or more identities to the policy under the role specified.
|
Policy |
build()
Creates a
Policy object. |
Policy.Builder |
removeIdentity(Role role,
Identity first,
Identity... others)
Removes one or more identities from an existing binding.
|
Policy.Builder |
removeRole(Role role)
Removes the role (and all identities associated with that role) from the policy.
|
Policy.Builder |
setBindings(Map<Role,Set<Identity>> bindings)
Replaces the builder's map of bindings with the given map of bindings.
|
Policy.Builder |
setEtag(String etag)
Sets the policy's etag.
|
protected Policy.Builder |
setVersion(int version)
Sets the version of the policy.
|
@InternalApi(value="This class should only be extended within google-cloud-java") protected Builder()
@InternalApi(value="This class should only be extended within google-cloud-java") protected Builder(Policy policy)
public final Policy.Builder setBindings(Map<Role,Set<Identity>> bindings)
NullPointerException
- if the given map is null or contains any null keys or valuesIllegalArgumentException
- if any identities in the given map are nullpublic final Policy.Builder removeRole(Role role)
public final Policy.Builder addIdentity(Role role, Identity first, Identity... others)
NullPointerException
- if the role or any of the identities is null.public final Policy.Builder removeIdentity(Role role, Identity first, Identity... others)
public final Policy.Builder setEtag(String etag)
Etags are used for optimistic concurrency control as a way to help prevent simultaneous updates of a policy from overwriting each other. It is strongly suggested that systems make use of the etag in the read-modify-write cycle to perform policy updates in order to avoid race conditions. An etag is returned in the response to getIamPolicy, and systems are expected to put that etag in the request to setIamPolicy to ensure that their change will be applied to the same version of the policy. If no etag is provided in the call to setIamPolicy, then the existing policy is overwritten blindly.
protected final Policy.Builder setVersion(int version)
public final Policy build()
Policy
object.Copyright © 2019 Google LLC. All rights reserved.