Class Policy (1.40.1)

public final class Policy extends GeneratedMessageV3 implements PolicyOrBuilder

Data for an IAM policy.

Protobuf type google.iam.v2.Policy

Implements

PolicyOrBuilder

Static Fields

ANNOTATIONS_FIELD_NUMBER

public static final int ANNOTATIONS_FIELD_NUMBER
Field Value
Type Description
int

CREATE_TIME_FIELD_NUMBER

public static final int CREATE_TIME_FIELD_NUMBER
Field Value
Type Description
int

DELETE_TIME_FIELD_NUMBER

public static final int DELETE_TIME_FIELD_NUMBER
Field Value
Type Description
int

DISPLAY_NAME_FIELD_NUMBER

public static final int DISPLAY_NAME_FIELD_NUMBER
Field Value
Type Description
int

ETAG_FIELD_NUMBER

public static final int ETAG_FIELD_NUMBER
Field Value
Type Description
int

KIND_FIELD_NUMBER

public static final int KIND_FIELD_NUMBER
Field Value
Type Description
int

MANAGING_AUTHORITY_FIELD_NUMBER

public static final int MANAGING_AUTHORITY_FIELD_NUMBER
Field Value
Type Description
int

NAME_FIELD_NUMBER

public static final int NAME_FIELD_NUMBER
Field Value
Type Description
int

RULES_FIELD_NUMBER

public static final int RULES_FIELD_NUMBER
Field Value
Type Description
int

UID_FIELD_NUMBER

public static final int UID_FIELD_NUMBER
Field Value
Type Description
int

UPDATE_TIME_FIELD_NUMBER

public static final int UPDATE_TIME_FIELD_NUMBER
Field Value
Type Description
int

Static Methods

getDefaultInstance()

public static Policy getDefaultInstance()
Returns
Type Description
Policy

getDescriptor()

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

newBuilder()

public static Policy.Builder newBuilder()
Returns
Type Description
Policy.Builder

newBuilder(Policy prototype)

public static Policy.Builder newBuilder(Policy prototype)
Parameter
Name Description
prototype Policy
Returns
Type Description
Policy.Builder

parseDelimitedFrom(InputStream input)

public static Policy parseDelimitedFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
Policy
Exceptions
Type Description
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Policy parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Policy
Exceptions
Type Description
IOException

parseFrom(byte[] data)

public static Policy parseFrom(byte[] data)
Parameter
Name Description
data byte[]
Returns
Type Description
Policy
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static Policy parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data byte[]
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Policy
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data)

public static Policy parseFrom(ByteString data)
Parameter
Name Description
data ByteString
Returns
Type Description
Policy
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static Policy parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteString
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Policy
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static Policy parseFrom(CodedInputStream input)
Parameter
Name Description
input CodedInputStream
Returns
Type Description
Policy
Exceptions
Type Description
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static Policy parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Policy
Exceptions
Type Description
IOException

parseFrom(InputStream input)

public static Policy parseFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
Policy
Exceptions
Type Description
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Policy parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Policy
Exceptions
Type Description
IOException

parseFrom(ByteBuffer data)

public static Policy parseFrom(ByteBuffer data)
Parameter
Name Description
data ByteBuffer
Returns
Type Description
Policy
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static Policy parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteBuffer
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Policy
Exceptions
Type Description
InvalidProtocolBufferException

parser()

public static Parser<Policy> parser()
Returns
Type Description
Parser<Policy>

Methods

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

equals(Object obj)

public boolean equals(Object obj)
Parameter
Name Description
obj Object
Returns
Type Description
boolean
Overrides

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.

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.

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

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.

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.

getParserForType()

public Parser<Policy> getParserForType()
Returns
Type Description
Parser<Policy>
Overrides

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

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>

getSerializedSize()

public int getSerializedSize()
Returns
Type Description
int
Overrides

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.

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.

hashCode()

public int hashCode()
Returns
Type Description
int
Overrides

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.internalGetMapFieldReflection(int)

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

newBuilderForType()

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

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected Policy.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
Name Description
parent BuilderParent
Returns
Type Description
Policy.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
Name Description
unused UnusedPrivateParameter
Returns
Type Description
Object
Overrides

toBuilder()

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

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
Name Description
output CodedOutputStream
Overrides
Exceptions
Type Description
IOException