| Modifier | Constructor and Description |
|---|---|
protected |
IamPolicy.Builder()
Constructor for IAM Policy builder.
|
| Modifier and Type | Method and Description |
|---|---|
B |
addIdentity(R role,
Identity first,
Identity... others)
Adds one or more identities to the policy under the role specified.
|
B |
bindings(Map<R,Set<Identity>> bindings)
Replaces the builder's map of bindings with the given map of bindings.
|
abstract IamPolicy<R> |
build() |
protected B |
etag(String etag)
Sets the policy's etag.
|
B |
removeIdentity(R role,
Identity first,
Identity... others)
Removes one or more identities from an existing binding.
|
B |
removeRole(R role)
Removes the role (and all identities associated with that role) from the policy.
|
protected B |
version(Integer version)
Sets the version of the policy.
|
protected IamPolicy.Builder()
public final B bindings(Map<R,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 B removeRole(R role)
public final B addIdentity(R role, Identity first, Identity... others)
NullPointerException - if the role or any of the identities is null.public final B removeIdentity(R role, Identity first, Identity... others)
protected final B etag(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 B version(Integer version)
Copyright © 2016 Google. All rights reserved.