Class Policy.Builder (1.37.0)

public static final class Policy.Builder extends GeneratedMessageV3.Builder<Policy.Builder> implements PolicyOrBuilder

Data for an IAM policy.

Protobuf type google.iam.v2.Policy

Implements

PolicyOrBuilder

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

Methods

addAllRules(Iterable<? extends PolicyRule> values)

public Policy.Builder addAllRules(Iterable<? extends PolicyRule> values)

A list of rules that specify the behavior of the Policy. All of the rules should be of the kind specified in the Policy.

repeated .google.iam.v2.PolicyRule rules = 10;

Parameter
Name Description
values Iterable<? extends com.google.iam.v2.PolicyRule>
Returns
Type Description
Policy.Builder

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public Policy.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
Policy.Builder
Overrides

addRules(PolicyRule value)

public Policy.Builder addRules(PolicyRule value)

A list of rules that specify the behavior of the Policy. All of the rules should be of the kind specified in the Policy.

repeated .google.iam.v2.PolicyRule rules = 10;

Parameter
Name Description
value PolicyRule
Returns
Type Description
Policy.Builder

addRules(PolicyRule.Builder builderForValue)

public Policy.Builder addRules(PolicyRule.Builder builderForValue)

A list of rules that specify the behavior of the Policy. All of the rules should be of the kind specified in the Policy.

repeated .google.iam.v2.PolicyRule rules = 10;

Parameter
Name Description
builderForValue PolicyRule.Builder
Returns
Type Description
Policy.Builder

addRules(int index, PolicyRule value)

public Policy.Builder addRules(int index, PolicyRule value)

A list of rules that specify the behavior of the Policy. All of the rules should be of the kind specified in the Policy.

repeated .google.iam.v2.PolicyRule rules = 10;

Parameters
Name Description
index int
value PolicyRule
Returns
Type Description
Policy.Builder

addRules(int index, PolicyRule.Builder builderForValue)

public Policy.Builder addRules(int index, PolicyRule.Builder builderForValue)

A list of rules that specify the behavior of the Policy. All of the rules should be of the kind specified in the Policy.

repeated .google.iam.v2.PolicyRule rules = 10;

Parameters
Name Description
index int
builderForValue PolicyRule.Builder
Returns
Type Description
Policy.Builder

addRulesBuilder()

public PolicyRule.Builder addRulesBuilder()

A list of rules that specify the behavior of the Policy. All of the rules should be of the kind specified in the Policy.

repeated .google.iam.v2.PolicyRule rules = 10;

Returns
Type Description
PolicyRule.Builder

addRulesBuilder(int index)

public PolicyRule.Builder addRulesBuilder(int index)

A list of rules that specify the behavior of the Policy. All of the rules should be of the kind specified in the Policy.

repeated .google.iam.v2.PolicyRule rules = 10;

Parameter
Name Description
index int
Returns
Type Description
PolicyRule.Builder

build()

public Policy build()
Returns
Type Description
Policy

buildPartial()

public Policy buildPartial()
Returns
Type Description
Policy

clear()

public Policy.Builder clear()
Returns
Type Description
Policy.Builder
Overrides

clearAnnotations()

public Policy.Builder clearAnnotations()
Returns
Type Description
Policy.Builder

clearCreateTime()

public Policy.Builder clearCreateTime()

Output only. The time when the Policy was created.

.google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
Policy.Builder

clearDeleteTime()

public Policy.Builder clearDeleteTime()

Output only. The time when the Policy was deleted. Empty if the policy is not deleted.

.google.protobuf.Timestamp delete_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
Policy.Builder

clearDisplayName()

public Policy.Builder clearDisplayName()

A user-specified description of the Policy. This value can be up to 63 characters.

string display_name = 4;

Returns
Type Description
Policy.Builder

This builder for chaining.

clearEtag()

public Policy.Builder clearEtag()

An opaque tag that identifies the current version of the Policy. IAM uses this value to help manage concurrent updates, so they do not cause one update to be overwritten by another.

If this field is present in a [CreatePolicy][] request, the value is ignored.

string etag = 6;

Returns
Type Description
Policy.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

public Policy.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
Name Description
field FieldDescriptor
Returns
Type Description
Policy.Builder
Overrides

clearKind()

public Policy.Builder clearKind()

Output only. The kind of the Policy. Always contains the value DenyPolicy.

string kind = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
Policy.Builder

This builder for chaining.

clearManagingAuthority()

public Policy.Builder clearManagingAuthority()

Immutable. Specifies that this policy is managed by an authority and can only be modified by that authority. Usage is restricted.

string managing_authority = 11 [(.google.api.field_behavior) = IMMUTABLE];

Returns
Type Description
Policy.Builder

This builder for chaining.

clearName()

public Policy.Builder clearName()

Immutable. The resource name of the Policy, which must be unique. Format: policies/{attachment_point}/denypolicies/{policy_id}

The attachment point is identified by its URL-encoded full resource name, which means that the forward-slash character, /, must be written as %2F. For example, policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-deny-policy.

For organizations and folders, use the numeric ID in the full resource name. For projects, requests can use the alphanumeric or the numeric ID. Responses always contain the numeric ID.

string name = 1 [(.google.api.field_behavior) = IMMUTABLE];

Returns
Type Description
Policy.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

public Policy.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
Name Description
oneof OneofDescriptor
Returns
Type Description
Policy.Builder
Overrides

clearRules()

public Policy.Builder clearRules()

A list of rules that specify the behavior of the Policy. All of the rules should be of the kind specified in the Policy.

repeated .google.iam.v2.PolicyRule rules = 10;

Returns
Type Description
Policy.Builder

clearUid()

public Policy.Builder clearUid()

Immutable. The globally unique ID of the Policy. Assigned automatically when the Policy is created.

string uid = 2 [(.google.api.field_behavior) = IMMUTABLE];

Returns
Type Description
Policy.Builder

This builder for chaining.

clearUpdateTime()

public Policy.Builder clearUpdateTime()

Output only. The time when the Policy was last updated.

.google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
Policy.Builder

clone()

public Policy.Builder clone()
Returns
Type Description
Policy.Builder
Overrides

containsAnnotations(String key)

public boolean containsAnnotations(String key)

A key-value map to store arbitrary metadata for the Policy. Keys can be up to 63 characters. Values can be up to 255 characters.

map<string, string> annotations = 5;

Parameter
Name Description
key String
Returns
Type Description
boolean

getAnnotations() (deprecated)

public Map<String,String> getAnnotations()

Use #getAnnotationsMap() instead.

Returns
Type Description
Map<String,String>

getAnnotationsCount()

public int getAnnotationsCount()

A key-value map to store arbitrary metadata for the Policy. Keys can be up to 63 characters. Values can be up to 255 characters.

map<string, string> annotations = 5;

Returns
Type Description
int

getAnnotationsMap()

public Map<String,String> getAnnotationsMap()

A key-value map to store arbitrary metadata for the Policy. Keys can be up to 63 characters. Values can be up to 255 characters.

map<string, string> annotations = 5;

Returns
Type Description
Map<String,String>

getAnnotationsOrDefault(String key, String defaultValue)

public String getAnnotationsOrDefault(String key, String defaultValue)

A key-value map to store arbitrary metadata for the Policy. Keys can be up to 63 characters. Values can be up to 255 characters.

map<string, string> annotations = 5;

Parameters
Name Description
key String
defaultValue String
Returns
Type Description
String

getAnnotationsOrThrow(String key)

public String getAnnotationsOrThrow(String key)

A key-value map to store arbitrary metadata for the Policy. Keys can be up to 63 characters. Values can be up to 255 characters.

map<string, string> annotations = 5;

Parameter
Name Description
key String
Returns
Type Description
String

getCreateTime()

public Timestamp getCreateTime()

Output only. The time when the Policy was created.

.google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
Timestamp

The createTime.

getCreateTimeBuilder()

public Timestamp.Builder getCreateTimeBuilder()

Output only. The time when the Policy was created.

.google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
Builder

getCreateTimeOrBuilder()

public TimestampOrBuilder getCreateTimeOrBuilder()

Output only. The time when the Policy was created.

.google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
TimestampOrBuilder

getDefaultInstanceForType()

public Policy getDefaultInstanceForType()
Returns
Type Description
Policy

getDeleteTime()

public Timestamp getDeleteTime()

Output only. The time when the Policy was deleted. Empty if the policy is not deleted.

.google.protobuf.Timestamp delete_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
Timestamp

The deleteTime.

getDeleteTimeBuilder()

public Timestamp.Builder getDeleteTimeBuilder()

Output only. The time when the Policy was deleted. Empty if the policy is not deleted.

.google.protobuf.Timestamp delete_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
Builder

getDeleteTimeOrBuilder()

public TimestampOrBuilder getDeleteTimeOrBuilder()

Output only. The time when the Policy was deleted. Empty if the policy is not deleted.

.google.protobuf.Timestamp delete_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
TimestampOrBuilder

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
Type Description
Descriptor
Overrides

getDisplayName()

public String getDisplayName()

A user-specified description of the Policy. This value can be up to 63 characters.

string display_name = 4;

Returns
Type Description
String

The displayName.

getDisplayNameBytes()

public ByteString getDisplayNameBytes()

A user-specified description of the Policy. This value can be up to 63 characters.

string display_name = 4;

Returns
Type Description
ByteString

The bytes for displayName.

getEtag()

public String getEtag()

An opaque tag that identifies the current version of the Policy. IAM uses this value to help manage concurrent updates, so they do not cause one update to be overwritten by another.

If this field is present in a [CreatePolicy][] request, the value is ignored.

string etag = 6;

Returns
Type Description
String

The etag.

getEtagBytes()

public ByteString getEtagBytes()

An opaque tag that identifies the current version of the Policy. IAM uses this value to help manage concurrent updates, so they do not cause one update to be overwritten by another.

If this field is present in a [CreatePolicy][] request, the value is ignored.

string etag = 6;

Returns
Type Description
ByteString

The bytes for etag.

getKind()

public String getKind()

Output only. The kind of the Policy. Always contains the value DenyPolicy.

string kind = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
String

The kind.

getKindBytes()

public ByteString getKindBytes()

Output only. The kind of the Policy. Always contains the value DenyPolicy.

string kind = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
ByteString

The bytes for kind.

getManagingAuthority()

public String getManagingAuthority()

Immutable. Specifies that this policy is managed by an authority and can only be modified by that authority. Usage is restricted.

string managing_authority = 11 [(.google.api.field_behavior) = IMMUTABLE];

Returns
Type Description
String

The managingAuthority.

getManagingAuthorityBytes()

public ByteString getManagingAuthorityBytes()

Immutable. Specifies that this policy is managed by an authority and can only be modified by that authority. Usage is restricted.

string managing_authority = 11 [(.google.api.field_behavior) = IMMUTABLE];

Returns
Type Description
ByteString

The bytes for managingAuthority.

getMutableAnnotations() (deprecated)

public Map<String,String> getMutableAnnotations()

Use alternate mutation accessors instead.

Returns
Type Description
Map<String,String>

getName()

public String getName()

Immutable. The resource name of the Policy, which must be unique. Format: policies/{attachment_point}/denypolicies/{policy_id}

The attachment point is identified by its URL-encoded full resource name, which means that the forward-slash character, /, must be written as %2F. For example, policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-deny-policy.

For organizations and folders, use the numeric ID in the full resource name. For projects, requests can use the alphanumeric or the numeric ID. Responses always contain the numeric ID.

string name = 1 [(.google.api.field_behavior) = IMMUTABLE];

Returns
Type Description
String

The name.

getNameBytes()

public ByteString getNameBytes()

Immutable. The resource name of the Policy, which must be unique. Format: policies/{attachment_point}/denypolicies/{policy_id}

The attachment point is identified by its URL-encoded full resource name, which means that the forward-slash character, /, must be written as %2F. For example, policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-deny-policy.

For organizations and folders, use the numeric ID in the full resource name. For projects, requests can use the alphanumeric or the numeric ID. Responses always contain the numeric ID.

string name = 1 [(.google.api.field_behavior) = IMMUTABLE];

Returns
Type Description
ByteString

The bytes for name.

getRules(int index)

public PolicyRule getRules(int index)

A list of rules that specify the behavior of the Policy. All of the rules should be of the kind specified in the Policy.

repeated .google.iam.v2.PolicyRule rules = 10;

Parameter
Name Description
index int
Returns
Type Description
PolicyRule

getRulesBuilder(int index)

public PolicyRule.Builder getRulesBuilder(int index)

A list of rules that specify the behavior of the Policy. All of the rules should be of the kind specified in the Policy.

repeated .google.iam.v2.PolicyRule rules = 10;

Parameter
Name Description
index int
Returns
Type Description
PolicyRule.Builder

getRulesBuilderList()

public List<PolicyRule.Builder> getRulesBuilderList()

A list of rules that specify the behavior of the Policy. All of the rules should be of the kind specified in the Policy.

repeated .google.iam.v2.PolicyRule rules = 10;

Returns
Type Description
List<Builder>

getRulesCount()

public int getRulesCount()

A list of rules that specify the behavior of the Policy. All of the rules should be of the kind specified in the Policy.

repeated .google.iam.v2.PolicyRule rules = 10;

Returns
Type Description
int

getRulesList()

public List<PolicyRule> getRulesList()

A list of rules that specify the behavior of the Policy. All of the rules should be of the kind specified in the Policy.

repeated .google.iam.v2.PolicyRule rules = 10;

Returns
Type Description
List<PolicyRule>

getRulesOrBuilder(int index)

public PolicyRuleOrBuilder getRulesOrBuilder(int index)

A list of rules that specify the behavior of the Policy. All of the rules should be of the kind specified in the Policy.

repeated .google.iam.v2.PolicyRule rules = 10;

Parameter
Name Description
index int
Returns
Type Description
PolicyRuleOrBuilder

getRulesOrBuilderList()

public List<? extends PolicyRuleOrBuilder> getRulesOrBuilderList()

A list of rules that specify the behavior of the Policy. All of the rules should be of the kind specified in the Policy.

repeated .google.iam.v2.PolicyRule rules = 10;

Returns
Type Description
List<? extends com.google.iam.v2.PolicyRuleOrBuilder>

getUid()

public String getUid()

Immutable. The globally unique ID of the Policy. Assigned automatically when the Policy is created.

string uid = 2 [(.google.api.field_behavior) = IMMUTABLE];

Returns
Type Description
String

The uid.

getUidBytes()

public ByteString getUidBytes()

Immutable. The globally unique ID of the Policy. Assigned automatically when the Policy is created.

string uid = 2 [(.google.api.field_behavior) = IMMUTABLE];

Returns
Type Description
ByteString

The bytes for uid.

getUpdateTime()

public Timestamp getUpdateTime()

Output only. The time when the Policy was last updated.

.google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
Timestamp

The updateTime.

getUpdateTimeBuilder()

public Timestamp.Builder getUpdateTimeBuilder()

Output only. The time when the Policy was last updated.

.google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
Builder

getUpdateTimeOrBuilder()

public TimestampOrBuilder getUpdateTimeOrBuilder()

Output only. The time when the Policy was last updated.

.google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
TimestampOrBuilder

hasCreateTime()

public boolean hasCreateTime()

Output only. The time when the Policy was created.

.google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
boolean

Whether the createTime field is set.

hasDeleteTime()

public boolean hasDeleteTime()

Output only. The time when the Policy was deleted. Empty if the policy is not deleted.

.google.protobuf.Timestamp delete_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
boolean

Whether the deleteTime field is set.

hasUpdateTime()

public boolean hasUpdateTime()

Output only. The time when the Policy was last updated.

.google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
boolean

Whether the updateTime field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

internalGetMapFieldReflection(int number)

protected MapFieldReflectionAccessor internalGetMapFieldReflection(int number)
Parameter
Name Description
number int
Returns
Type Description
com.google.protobuf.MapFieldReflectionAccessor
Overrides
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMapFieldReflection(int)

internalGetMutableMapFieldReflection(int number)

protected MapFieldReflectionAccessor internalGetMutableMapFieldReflection(int number)
Parameter
Name Description
number int
Returns
Type Description
com.google.protobuf.MapFieldReflectionAccessor
Overrides
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMutableMapFieldReflection(int)

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeCreateTime(Timestamp value)

public Policy.Builder mergeCreateTime(Timestamp value)

Output only. The time when the Policy was created.

.google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
value Timestamp
Returns
Type Description
Policy.Builder

mergeDeleteTime(Timestamp value)

public Policy.Builder mergeDeleteTime(Timestamp value)

Output only. The time when the Policy was deleted. Empty if the policy is not deleted.

.google.protobuf.Timestamp delete_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
value Timestamp
Returns
Type Description
Policy.Builder

mergeFrom(Policy other)

public Policy.Builder mergeFrom(Policy other)
Parameter
Name Description
other Policy
Returns
Type Description
Policy.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public Policy.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Policy.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

public Policy.Builder mergeFrom(Message other)
Parameter
Name Description
other Message
Returns
Type Description
Policy.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

public final Policy.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
Policy.Builder
Overrides

mergeUpdateTime(Timestamp value)

public Policy.Builder mergeUpdateTime(Timestamp value)

Output only. The time when the Policy was last updated.

.google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
value Timestamp
Returns
Type Description
Policy.Builder

putAllAnnotations(Map<String,String> values)

public Policy.Builder putAllAnnotations(Map<String,String> values)

A key-value map to store arbitrary metadata for the Policy. Keys can be up to 63 characters. Values can be up to 255 characters.

map<string, string> annotations = 5;

Parameter
Name Description
values Map<String,String>
Returns
Type Description
Policy.Builder

putAnnotations(String key, String value)

public Policy.Builder putAnnotations(String key, String value)

A key-value map to store arbitrary metadata for the Policy. Keys can be up to 63 characters. Values can be up to 255 characters.

map<string, string> annotations = 5;

Parameters
Name Description
key String
value String
Returns
Type Description
Policy.Builder

removeAnnotations(String key)

public Policy.Builder removeAnnotations(String key)

A key-value map to store arbitrary metadata for the Policy. Keys can be up to 63 characters. Values can be up to 255 characters.

map<string, string> annotations = 5;

Parameter
Name Description
key String
Returns
Type Description
Policy.Builder

removeRules(int index)

public Policy.Builder removeRules(int index)

A list of rules that specify the behavior of the Policy. All of the rules should be of the kind specified in the Policy.

repeated .google.iam.v2.PolicyRule rules = 10;

Parameter
Name Description
index int
Returns
Type Description
Policy.Builder

setCreateTime(Timestamp value)

public Policy.Builder setCreateTime(Timestamp value)

Output only. The time when the Policy was created.

.google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
value Timestamp
Returns
Type Description
Policy.Builder

setCreateTime(Timestamp.Builder builderForValue)

public Policy.Builder setCreateTime(Timestamp.Builder builderForValue)

Output only. The time when the Policy was created.

.google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
builderForValue Builder
Returns
Type Description
Policy.Builder

setDeleteTime(Timestamp value)

public Policy.Builder setDeleteTime(Timestamp value)

Output only. The time when the Policy was deleted. Empty if the policy is not deleted.

.google.protobuf.Timestamp delete_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
value Timestamp
Returns
Type Description
Policy.Builder

setDeleteTime(Timestamp.Builder builderForValue)

public Policy.Builder setDeleteTime(Timestamp.Builder builderForValue)

Output only. The time when the Policy was deleted. Empty if the policy is not deleted.

.google.protobuf.Timestamp delete_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
builderForValue Builder
Returns
Type Description
Policy.Builder

setDisplayName(String value)

public Policy.Builder setDisplayName(String value)

A user-specified description of the Policy. This value can be up to 63 characters.

string display_name = 4;

Parameter
Name Description
value String

The displayName to set.

Returns
Type Description
Policy.Builder

This builder for chaining.

setDisplayNameBytes(ByteString value)

public Policy.Builder setDisplayNameBytes(ByteString value)

A user-specified description of the Policy. This value can be up to 63 characters.

string display_name = 4;

Parameter
Name Description
value ByteString

The bytes for displayName to set.

Returns
Type Description
Policy.Builder

This builder for chaining.

setEtag(String value)

public Policy.Builder setEtag(String value)

An opaque tag that identifies the current version of the Policy. IAM uses this value to help manage concurrent updates, so they do not cause one update to be overwritten by another.

If this field is present in a [CreatePolicy][] request, the value is ignored.

string etag = 6;

Parameter
Name Description
value String

The etag to set.

Returns
Type Description
Policy.Builder

This builder for chaining.

setEtagBytes(ByteString value)

public Policy.Builder setEtagBytes(ByteString value)

An opaque tag that identifies the current version of the Policy. IAM uses this value to help manage concurrent updates, so they do not cause one update to be overwritten by another.

If this field is present in a [CreatePolicy][] request, the value is ignored.

string etag = 6;

Parameter
Name Description
value ByteString

The bytes for etag to set.

Returns
Type Description
Policy.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

public Policy.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
Policy.Builder
Overrides

setKind(String value)

public Policy.Builder setKind(String value)

Output only. The kind of the Policy. Always contains the value DenyPolicy.

string kind = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
value String

The kind to set.

Returns
Type Description
Policy.Builder

This builder for chaining.

setKindBytes(ByteString value)

public Policy.Builder setKindBytes(ByteString value)

Output only. The kind of the Policy. Always contains the value DenyPolicy.

string kind = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
value ByteString

The bytes for kind to set.

Returns
Type Description
Policy.Builder

This builder for chaining.

setManagingAuthority(String value)

public Policy.Builder setManagingAuthority(String value)

Immutable. Specifies that this policy is managed by an authority and can only be modified by that authority. Usage is restricted.

string managing_authority = 11 [(.google.api.field_behavior) = IMMUTABLE];

Parameter
Name Description
value String

The managingAuthority to set.

Returns
Type Description
Policy.Builder

This builder for chaining.

setManagingAuthorityBytes(ByteString value)

public Policy.Builder setManagingAuthorityBytes(ByteString value)

Immutable. Specifies that this policy is managed by an authority and can only be modified by that authority. Usage is restricted.

string managing_authority = 11 [(.google.api.field_behavior) = IMMUTABLE];

Parameter
Name Description
value ByteString

The bytes for managingAuthority to set.

Returns
Type Description
Policy.Builder

This builder for chaining.

setName(String value)

public Policy.Builder setName(String value)

Immutable. The resource name of the Policy, which must be unique. Format: policies/{attachment_point}/denypolicies/{policy_id}

The attachment point is identified by its URL-encoded full resource name, which means that the forward-slash character, /, must be written as %2F. For example, policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-deny-policy.

For organizations and folders, use the numeric ID in the full resource name. For projects, requests can use the alphanumeric or the numeric ID. Responses always contain the numeric ID.

string name = 1 [(.google.api.field_behavior) = IMMUTABLE];

Parameter
Name Description
value String

The name to set.

Returns
Type Description
Policy.Builder

This builder for chaining.

setNameBytes(ByteString value)

public Policy.Builder setNameBytes(ByteString value)

Immutable. The resource name of the Policy, which must be unique. Format: policies/{attachment_point}/denypolicies/{policy_id}

The attachment point is identified by its URL-encoded full resource name, which means that the forward-slash character, /, must be written as %2F. For example, policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-deny-policy.

For organizations and folders, use the numeric ID in the full resource name. For projects, requests can use the alphanumeric or the numeric ID. Responses always contain the numeric ID.

string name = 1 [(.google.api.field_behavior) = IMMUTABLE];

Parameter
Name Description
value ByteString

The bytes for name to set.

Returns
Type Description
Policy.Builder

This builder for chaining.

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public Policy.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
Name Description
field FieldDescriptor
index int
value Object
Returns
Type Description
Policy.Builder
Overrides

setRules(int index, PolicyRule value)

public Policy.Builder setRules(int index, PolicyRule value)

A list of rules that specify the behavior of the Policy. All of the rules should be of the kind specified in the Policy.

repeated .google.iam.v2.PolicyRule rules = 10;

Parameters
Name Description
index int
value PolicyRule
Returns
Type Description
Policy.Builder

setRules(int index, PolicyRule.Builder builderForValue)

public Policy.Builder setRules(int index, PolicyRule.Builder builderForValue)

A list of rules that specify the behavior of the Policy. All of the rules should be of the kind specified in the Policy.

repeated .google.iam.v2.PolicyRule rules = 10;

Parameters
Name Description
index int
builderForValue PolicyRule.Builder
Returns
Type Description
Policy.Builder

setUid(String value)

public Policy.Builder setUid(String value)

Immutable. The globally unique ID of the Policy. Assigned automatically when the Policy is created.

string uid = 2 [(.google.api.field_behavior) = IMMUTABLE];

Parameter
Name Description
value String

The uid to set.

Returns
Type Description
Policy.Builder

This builder for chaining.

setUidBytes(ByteString value)

public Policy.Builder setUidBytes(ByteString value)

Immutable. The globally unique ID of the Policy. Assigned automatically when the Policy is created.

string uid = 2 [(.google.api.field_behavior) = IMMUTABLE];

Parameter
Name Description
value ByteString

The bytes for uid to set.

Returns
Type Description
Policy.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

public final Policy.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
Policy.Builder
Overrides

setUpdateTime(Timestamp value)

public Policy.Builder setUpdateTime(Timestamp value)

Output only. The time when the Policy was last updated.

.google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
value Timestamp
Returns
Type Description
Policy.Builder

setUpdateTime(Timestamp.Builder builderForValue)

public Policy.Builder setUpdateTime(Timestamp.Builder builderForValue)

Output only. The time when the Policy was last updated.

.google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
builderForValue Builder
Returns
Type Description
Policy.Builder